commit 93690fb1cd11a8cd555c33a1eb70f6579641581b Author: CaoYuHui <1152604503@qq.com> Date: Mon Jun 17 14:21:32 2024 +0800 20240617 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..766e31c --- /dev/null +++ b/.gitignore @@ -0,0 +1,365 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# The folders defined by Robin to be ignored +Bin/ +Lib/ +Src/Debug/ +Src/Release/ +Src/FH98ViewOnPlane_Setup/ +Src/ipch/ +Src/XtremeToolKitPro/ +Src/JoyStick/ +Src/QB_ImgProcessFun/ +Src/QB_ImgShowBase/ \ No newline at end of file diff --git a/Include/CallBackDef.h b/Include/CallBackDef.h new file mode 100644 index 0000000..5e70e73 --- /dev/null +++ b/Include/CallBackDef.h @@ -0,0 +1,72 @@ +#include "stdafx.h" + +#include "QBStru.h" + +// openCV Library +#include +using namespace cv; + + +// 解码后通用情报结构体数据回调 +// 参数意义: +// 1. qbstru: 情报结构体指针 +// 2. purpose:用途(目的) +typedef void (CALLBACK* SendQBStruProc)(const QBStru* qbstru, int purpose); + + +// 作用:人工选定目标时,对外输出目标点像素坐标 +typedef void (CALLBACK* SendCoordinateProc)(CPoint Value); + +// 鼠标移动输出像素信息 +typedef void (CALLBACK* SendPixInfoProc)(CPoint xy, double Lon, double Lat, double H); + +// 回调文件保存路径 +// 参数意义: +// 1. FilePath: 文件路径 +// 2. type :文件类型 +// type = -1: 未知 +// type = 0: 单帧图像采集或图像连续采集(后面) 图像路径 bmp格式 +// type = 1: 单帧图像采集或图像连续采集(后面) 复接数据路径 xml格式 +// type = 2: 多帧图像采集(前面图像) 图像路径 bmp格式 +// type = 3: 多帧图像采集(前面图像) 复接数据路径 xml格式 +// type = 4: 系统级几何校正后图像路径 tif格式 +// type = 5: 拼接图像自动几何校正前 bmp格式 +// type = 6: 拼接图像自动几何校正后 tif格式 +// type = 7: 目标图像 +typedef void (CALLBACK* SendFilePath)(CString FilePath, int type); + +// 回调输出信息 +typedef void (CALLBACK* SendMessageProc)(CString msg); +// +// 回调输出图像(显示) +typedef void (CALLBACK* SendImgProc)(const cv::Mat &img); +// +// 回调输出最近一张图像(4个角点图像坐标) +typedef void (CALLBACK* SendNewImgProc)(const POINT *pt); + +// 回调输出 目标定位导引 输出经纬度 +typedef void (CALLBACK* SendTgrLocLeadLonLatProc)(double lon0, double lat0, + double lon1, double lat1, + double lon2, double lat2, + double lon3, double lat3, + double lon4, double lat4); + + +// 回调输出 输出火炮校射 炸点相对于目标的距离和角度 +typedef void (CALLBACK* SendArtilleryReviseInfoProc)(float dist, float angle); + + +// 回调输出 通知简单图像显示对话框被双击 +typedef void (CALLBACK* SendLButtonDblClkInfoProc)(); + +// 通知简单图像显示对话框被右键按下 +typedef void (CALLBACK* SendButtonDownInfoProc)(int type); + +// 输出双击图像时的脱靶量 +typedef void (CALLBACK* SendPixXYOffsetProc)(CPoint xy, int flag); + +// 输出双击点与对话框中点的夹角 +typedef void (CALLBACK* SendAngleProc)(double angle); + +// 当鼠标按下时,输出鼠标点与对话框中心点的距离比例系数和角度 +typedef void (CALLBACK* SendDistRatioAndAngleProc)(double distRatio, double angle); diff --git a/Include/DecoderFactory.h b/Include/DecoderFactory.h new file mode 100644 index 0000000..7e7113b --- /dev/null +++ b/Include/DecoderFactory.h @@ -0,0 +1,40 @@ +#pragma once +#include + +#ifdef _DECODER_INTERFACE_EXPORT_ +#define _DECODER_INTERFACE_ _declspec(dllexport) +#else +#define _DECODER_INTERFACE_ _declspec(dllimport) +#endif + +typedef enum DecoderType +{ + DEC_SOFTWARE = 0, + DEC_HARDWARE = 1, +}EnumDecoderType; + +typedef void (*DecodeCallbackFun)(unsigned char* data,int width,int height); + +class _DECODER_INTERFACE_ DecoderInterface +{ +public: + DecoderInterface(void){}; + ~DecoderInterface(void){}; + + virtual bool init(int srcWth,int srcHth,int dstWth = 0,int dstHth = 0,int oPixFmt = 0,HWND hwnd = 0) = 0; + virtual void decoding(unsigned char* in_buf,int in_len) = 0; + virtual void release() = 0; + + virtual void setDecodingCallback(DecodeCallbackFun fun) = 0; +}; + +class _DECODER_INTERFACE_ DecoderFactory +{ +public: + DecoderFactory(void); + ~DecoderFactory(void); + + static DecoderInterface* CreateDecoder(EnumDecoderType type = DEC_SOFTWARE); + static void DestroyDecoder(DecoderInterface* deoder); +}; + diff --git a/Include/ExportImgShowBase.h b/Include/ExportImgShowBase.h new file mode 100644 index 0000000..60d660c --- /dev/null +++ b/Include/ExportImgShowBase.h @@ -0,0 +1,306 @@ +#pragma once + +// 包含情报结构体文件 +#include "QBStru.h" + +// 回调函数定义 +#include "CallBackDef.h" + +// 声明 图像显示对话框类 +class CImgShowDlg; +class AFX_CLASS_EXPORT CExportImgShowBase: public CObject +{ +public: + + // 构造函数 + CExportImgShowBase(void); + + // 析构函数 + ~CExportImgShowBase(void); + +public: + + /************************************************************************/ + /* part 1:窗口创建、销毁、图像显示、标注等 */ + /************************************************************************/ + + // 1 功能:创建视频显示窗口 + // 输入: + // 1. hParentWnd: 父窗口句柄 + // + // 输出:创建成功返回TRUE,否则返回FALSE + BOOL CreateWnd(const HWND hParentWnd); + + + // 2 功能:移动(设置)窗口(整个视频显示窗口)至指定位置 + // 输入: + // 1. clientRect:移动至该区域 + // + // 输出:无 + void MoveWnd(const CRect &clientRect); + + + // 3 功能:显示SW_SHOW 或隐藏 SW_HIDE 窗口 + // 输入: + // 1. nCmdShow:SW_SHOW 或 SW_HIDE + // + // 输出:无 + void ShowWnd(const int nCmdShow); + + + // 4 功能:显示一帧图像 + // 输入: + // 1. pImgInfo:图像信息头 + // 2. pImgData:图像数据指针 + // 3. LBbox:经纬度盒子 + // 4 isNeedFlip: 是否需要反转 + // 5. isNeedClip:是否需要裁剪标识 + // 6. ShowRegion:裁剪区域 + // 7. Strecth_Ratio 图像拉伸比例,默认为1,即填满屏幕 + // 8. 图像平移控制 + // + // 输出:显示成功返回TRUE,否则返回FALSE + // 说明:信号1 + BOOL ShowImage(const BITMAPINFO* pImgInfo, + BYTE* pImgData, + GeoBoundingBox LBbox = GeoBoundingBox(), + BOOL isNeedFlip = FALSE, + BOOL isNeedClip = FALSE, + const CRect* pShowRegion = NULL, + float Strecth_Ratio = 1.0F, + POINT xyShift = POINT()); + + // 5 功能:显示并处理通用情报数据 + // 输入: + // 1.qbData: 情报数据结构体变量指针 + // + // 输出: 无 + // 说明:信号2 + // 注意:信号1优先级 > 信号2优先级 + void DisposeQBData(const QBStru* qbData); + + + // 6 功能:标绘目标,其中输入为目标点像素坐标 + // 输入: + // 1. pt:目标点像素坐标 + // + // 输出:在窗口标绘目标 + // 注意事项:如果输入图像同时,对目标进行标绘,需要在 函数4(ShowImage)输入之后 输入本函数 + void SetTargetPixelCoordinate(const CPoint &pt); + + // 6.1 功能:标绘图像中的一块区域,其中输入为4个像素坐标点 + // 输入: + // 1. pt:4个角点像素坐标 + // + // 输出:在窗口标绘目标 + // 注意事项:如果输入图像同时,对目标进行标绘,需要在 函数4(ShowImage)输入之后 输入本函数 + void SetQuadrangleCorners(const POINT *pts); + + // 6.2 功能:标绘目标,其中输入为经纬度坐标 + // 输入: + // 1. pt:经纬度坐标 + // + // 输出:在窗口标绘目标 + // 注意事项:如果输入图像同时,对目标进行标绘,需要在 函数4(ShowImage)输入之后 输入本函数 + void SetTgtLocLeadLonLat(double lon, double lat); + + + + // 7 功能:删除视频显示窗口,同时释放所有占用资源 + // 输入:无 + // + // 输出:无 + void DestroyWnd(); + + + // 8 功能:清理内存及记忆 + // 输入:无 + // + // 输出:无 + void ClearMemory(); + + + + /************************************************************************/ + /* part 2:设置回调函数:像素点坐标、像素点信息、文件保存路径 */ + /************************************************************************/ + + // 1 功能:设置回调函数,对外输出目标点像素坐标(目标点通过左键双击图像获得) + // 输入: + // 1. proc: 回调函数指针 + // + // 输出:设置成功返回TRUE,否则返回FALSE + BOOL SetCallBackFun(SendCoordinateProc proc); + + + // 2 功能:设置回调函数,像素信息传递到外部CSU中 + // 输入: + // 1.proc: 函数指针 + // + // 输出: 设置成功返回TRUE,否则返回FALSE + BOOL SetCallBackFun(SendPixInfoProc proc); + + + // 3 功能:设置回调函数,传递保存文件路径到外部CSU中 + // 输入: + // 1.proc: 函数指针 + // + // 输出: 设置成功返回TRUE,否则返回FALSE + BOOL SetCallBackFun(SendFilePath proc); + + + // 5 功能:设置回调函数,目标定位导引经纬度到外部CSU中 + // 输入: + // 1.proc: 函数指针 + // + // 输出: 设置成功返回TRUE,否则返回FALSE + BOOL SetCallBackFun(SendTgrLocLeadLonLatProc proc); + + + // 6 功能:设置回调函数,火炮校射信息输出到外部CSU中 + // 输入: + // 1.proc: 函数指针 + // + // 输出: 设置成功返回TRUE,否则返回FALSE + BOOL SetCallBackFun(SendArtilleryReviseInfoProc proc); + + /************************************************************************/ + /* part 3:图像处理:显示控制、处理控制、保存控制 */ + /************************************************************************/ + + // 4 功能:通过鼠标滚轮,实现图像放大缩小 + BOOL OnMouseWheelZoomInOutImg(UINT nFlags, short zDelta, CPoint pt); + + // 5 功能:取消目标标绘 + void CancelTargetPlot(); + + // 6 功能:图像去雾 + // 输入: + // 1. bAdjust 是否调节 + // 2. A_MAX 控制去雾效果, A_MAX < 0 时,自适应计算(特别耗时); + // 有效范围【0,255】 异常值自适应; + // 3. degree 控制去雾效果, 有效范围【0,1】 异常值自适应 + // 输出:无 + void AdjustImgDehaze(BOOL bAdjust = FALSE, int A_MAX = -1, double degree = 0.78); + + // 7 功能:图像亮度调节 + // 输入: + // 1. bAdjust 是否调节 + // 2. degree 调节力度[0 20] + // 输出:无 + void AdjustImgIntensity(BOOL bAdjust = FALSE, int degree = 10); + + // 8 功能:图像对比度调节 + // 输入: + // 1. bAdjust 是否调节 + // 2. degree 调节力度[0 20] + // 输出:无 + void AdjustImgContrast(BOOL bAdjust = FALSE, int degree = 10); + + // 9 功能:图像清晰度调节 + // 输入: + // 1. bAdjust 是否调节 + // 2. degree 调节力度[0 20] + // 输出:无 + void AdjustImgDefinition(BOOL bAdjust = FALSE, int degree = 10); + + // 10 功能:返回图像调节上一步图像状态,显示上一次处理图像 + void ReturnToPreImgState(); + + // 11 功能:返回原始图像状态,显示原始图像 + void ReturnToSrcImgState(); + + // 12 功能:保存当前图像几何校正,并保存为TIFF格式 + void SaveImgToTiff(); + + // 13 功能:保存当前帧至本地文件 + // 输入: + // 1. sSaveFolder 图像存储文件夹,为空或找不到时,按默认存储路径存储 + // 说明:图像命名规则见设计文档 + void SaveCurrentFrame(CString sSaveFolder = ""); + + // 14 功能:是否需要记忆前面多帧(18帧)图像信息 + // 输入: + // 1. bMem TRUE:记忆 FALSE:不记忆 + // 输出:无 + void MemPreMultiFrame(BOOL bMem = TRUE); + + + // 18 功能:设置图像编辑类型 + // 输入: + // 1. type : 1:定位标记 + // 2: 文字标记 + // 3: 火炮校射标记 + // 其他值,无效 + void SetImgEditType(int type); + + // 19 功能:获取图像编辑模式 + // 输入:无 + // 返回: + // true: 图像增强模式 + // false:图像标记模式 + bool GetImgEditMode(); + + + // 21 功能:几何校正图像并显示图像 + void GeoCorrectAndShowImg(); + + // 22 功能:获取当前显示图像 + // 输入: + // 输出: + // 1:imgWidth 图像宽 + // 2:imgHeight 图像高 + // 3:bitCount 图像位数 + // 4:pImgData 图像数据指针 + // 返回值: + // 成功返回true,失败返回false + bool GetCurrentImg(int &imgWidth, int &imgHeight, int& bitCount, uchar* &pImgData); + + + // 23 功能:获取图像边界地理坐标 + // 输入: + // 输出: + // 1:leftLon 西经 + // 2:topLat 北纬 + // 3:rigtLon 东经 + // 4:bottomLat 南纬 + // 返回值: + // 成功返回true,失败返回false + bool GetImgBoundingBox(double &leftLon, double &topLat, double &rigtLon, double &bottomLat); + + + // 24 功能:获取当前显示图像中心经纬度 + // 输入: + // 输出: + // 1:lon 经度 + // 2:lat 纬度 + // 返回值: + // 成功返回true,失败返回false + bool GetCurrentImgCerterLonLat(double &lon, double &lat); + + + // 25 功能:标注图像(矩形、区域边缘) + // 输入: + // 1. 区域边缘点 集合 + void MarkRegionOnImg(std::vector> &valisContours); + + + // 26 功能:屏蔽右键菜单 + // 输入: + // 1. bClose 默认true关闭 + void CloseRightBtnDownMenu(bool bClose = true); + + + // 27 功能:设置空屏文字 + // 输入: + // 1. str 主题文字 + void SetThemeText(CString str); + + + // 28 功能:图像位置导引(同内部目标定位导引) + void LeadImgLoc(); + +private: + CImgShowDlg* m_ShowDlg; // MFC 对话框 +}; + diff --git a/Include/MapPrj.h b/Include/MapPrj.h new file mode 100644 index 0000000..62ac6f5 --- /dev/null +++ b/Include/MapPrj.h @@ -0,0 +1,812 @@ +#ifndef MAP_PRJ_H +#define MAP_PRJ_H + + + +#ifdef MAPPRJ_EXPORTS +#define MAPPRJ_API __declspec(dllexport) +#else +#define MAPPRJ_API __declspec(dllimport) +#endif + + + +/* +* 文件名称:MapPrj.h +* 文件标识: +* 摘 要:地图坐标转换动态链接库,实现如下的功能: +* 1)地理坐标(经纬度)与高斯平面直角坐标之间的转换,包括正变换、反变换和换代计算; +* 2)空间大地坐标(L、B、H)与空间大地直角坐标(X、Y、Z)之间的相互变换; +* 3)不同大地坐标之间的转换,转换模型包括:三参数、四参数、和布尔莎七参数; +* 4)两点之间的水平距离、倾距和方位角的计算; +* 5)目标坐标的计算,已知一点经纬度,另一点相对它的方位角和距离,计算另外一点的经纬度坐标 +* 6)不同平面直角坐标系之间的坐标转换,基于仿射变换的四参数模型 +* +* 当前版本:1.0 +* 作 者:郭新平 +* 完成日期:2011年5月11日 +* 修改时间:1)2013年11月10日, + 修改内容:按照标准DLL函数输出格式,提供包含DLL接口函数的头文件 +* 2)增加平面直角坐标系之间的变换 +*/ + + + +//功能:求解高斯投影正变换,大地坐标LB转高斯平面直角坐标XY +//输入: L 大地坐标的经度,以°为单位,经度范围【-180,180】 +// B 大地坐标的纬度,以°为单位 +// coordType 坐标系类型:1为BJ54坐标,2为xian80坐标系,3为wgs84坐标系 +// zoneWidth 投影带宽,分6°带和3°带 + +//输出: X 高斯平面直角坐标系的北向坐标,以m为单位 +// Y 高斯平面直角坐标系的东向坐标,以m为单位 +MAPPRJ_API void LB2XY(double &X, double &Y, + const double L, const double B, + const int coordType = 3, const int zoneWidth = 6); + + + + + +//功能:求解高斯投影反变换,高斯平面直角坐标XY转大地经纬度L、B + +//输入: X 高斯平面直角坐标系的北向坐标,以m为单位 +// Y 高斯平面直角坐标系的东向坐标,以m为单位,注意:Y包含投影带信息 +// coordType 坐标系类型:1为BJ54坐标,2为xian80坐标系,3为wgs84坐标系 +// zoneWidth 投影带宽,分6°带和3°带 + +//输出: L 大地坐标系的经度,以°为单位,经度范围【-180,180】 +// B 大地坐标系的纬度,以°为单位 +MAPPRJ_API void XY2LB(double &L, double &B, const double X, const double Y, + const int coordType = 3, const int zoneWidth = 6); + + + + +//功能:求解两点之间的水平距离和方位角 + +//输入: fromPtLon 起始点的经度,以°为单位 +// fromPtLat 起始点的纬度,以°为单位 +// toPtLon 终止点的经度,以°为单位 +// toPtLat 终止点的纬度,以°为单位 +// coordType 坐标系类型:1为BJ54坐标,2为xian80坐标系,3为wgs84坐标系 + +//输出: distance 两点之间的水平距离, 以m为单位 +// azAngle 起始点到终止点的方位角, 以°为单位 +MAPPRJ_API void CalculateTwoPtsDistanceAzimuth(double &distance, double &azAngle, const double fromPtLon, const double fromPtLat, + const double toPtLon, const double toPtLat, const int coordType); + + + + + + +//功能:求解两点连线的方位角 + +//输入: fromPtLon 起始点的经度,以°为单位,经度范围【-180,180】 +// fromPtLat 起始点的纬度,以°为单位 +// toPtLon 终止点的经度,以°为单位,,经度范围【-180,180】 +// toPtLat 终止点的纬度,以°为单位 +// coordType 坐标系类型:1为BJ54坐标,2为xian80坐标系,3为wgs84坐标系 + +//输出: azAngle 起始点到终止点的方位角, 以°为单位,范围【0,360】 +MAPPRJ_API void CalculateTwoPtsAzimuth(double &azAngle, + const double fromPtLon, const double fromPtLat, + const double toPtLon, const double toPtLat, + const int coordType); + + + + + +//功能:求解两点间的水平距离 + +//输入: fromPtLon 起始点的经度,以°为单位,经度范围【-180,180】 +// fromPtLat 起始点的纬度,以°为单位 +// toPtLon 终止点的经度,以°为单位,经度范围【-180,180】 +// toPtLat 终止点的纬度,以°为单位 +// coordType 坐标系类型:1为BJ54坐标,2为xian80坐标系,3为wgs84坐标系 +//输出: dis 起始点到终止点的距离, 以m为单位 +MAPPRJ_API void CalculateTwoPtsDistance(double &dis, + const double fromPtLon, const double fromPtLat, + const double toPtLon, const double toPtLat, + const int coordType); + + + + + + +//功能:求解两点间的斜距 + +//输入: ptForm[0] 起始点的经度,以°为单位,经度范围【-180,180】 +// ptForm[1] 起始点的纬度,以°为单位 +// ptForm[2] 起始点的高度,以m为单位 + +//输入: ptTo[0] 结束点的经度,以°为单位,经度范围【-180,180】 +// ptTo[1] 结束点的纬度,以°为单位 +// ptTo[2] 结束点的高度,以m为单位 +// coordType 坐标系类型:1为BJ54坐标,2为xian80坐标系,3为wgs84坐标系 + + +//输出: dis 起始点与终止点的斜距, 以m为单位 +MAPPRJ_API void CalculateTwoPtsSlopeDistance(double &dis, + const double *ptForm, const double *ptTo, + const int coordType); + + + + + + + +//功能:计算目标点的经纬度 + +//输入: fromPtLon 起始点的经度,以°为单位 +// fromPtLat 起始点的纬度,以°为单位 +// azAngle 起始点到目标点的方位角,以°为单位 +// distance 起始点与目标点的水平距离,以m为单位 +// coordType 坐标系类型:1为BJ54坐标,2为xian80坐标系,3为wgs84坐标系 + +//输出: targetPtLon 目标点的经度,以°为单位 +// targetPtLat 目标点的纬度,以°为单位 +MAPPRJ_API void CalculatePtCoordinate(double &targetPtLon, double &targetPtLat, + const double fromPtLon, const double fromPtLat, + const double azAngle, const double distance, + const int coordType); + + + + +//功能:同一个椭球体的空间直角坐标系转大地坐标系 +//输入:空间直角坐标系,椭球体类型type(1为北京54坐标系,2为西安80坐标系,3为WGS84坐标系) +//输出:经纬高 + +//功能:WGS84坐标系转北京54坐标系,单点转换 + +//输入: XYZ 空间直角坐标,其中: +// XYZ[0]------X,以m为单位 +// XYZ[1]------Y,以m为单位 +// XYZ[2]------Z,以m为单位 +// type 椭球体类型,其中: +// 1------北京54 +// 2------西安80 +// 3------WGS84 + +//输出: LLA 大地坐标,其中: +// LLA[0]------经度,以°为单位 +// LLA[1]------纬度,以°为单位 +// LLA[2]------高度,以m为单位 +MAPPRJ_API void XYZ2LLA(double *LLA, const double *XYZ, const int type); + + + + + + + + + + +//功能:同一个椭球体的大地坐标系转空间直角坐标系 + +//输入: LLA 大地坐标,其中: +// LLA[0]------经度,以°为单位 +// LLA[1]------纬度,以°为单位 +// LLA[2]------高度,以m为单位 +// type 椭球体类型,其中: +// 1------北京54 +// 2------西安80 +// 3------WGS84 + +//输出: XYZ 空间直角坐标,其中: +// XYZ[0]------X,以m为单位 +// XYZ[1]------Y,以m为单位 +// XYZ[2]------Z,以m为单位 +MAPPRJ_API void LLA2XYZ(double *XYZ, const double *LLA, const int type); + + + + + + + +//功能:北京54坐标系转WGS84坐标系,单点转换 + +//输入: bj54 北京54坐标系下的经纬高,其中: +// bj54[0]------经度,以°为单位 +// bj54[1]------纬度,以°为单位 +// bj54[2]------高度,以m为单位 +// sevenParameter 七参数数值,其中: +// sevenParameter[0]------dX,以m为单位 +// sevenParameter[1]------dY,以m为单位 +// sevenParameter[2]------dZ,以m为单位 +// sevenParameter[3]------eX,以秒为单位 +// sevenParameter[4]------eY,以秒为单位 +// sevenParameter[5]------eZ,以秒为单位 +// sevenParameter[6]------k, 尺度比ppm,百万分之几 + +//输出: wgs84 WGS84坐标系下的经纬高,其中: +// wgs84[0]------经度,以°为单位 +// wgs84[1]------纬度,以°为单位 +// wgs84[2]------高度,以m为单位 +MAPPRJ_API void Bj54ToWGS84_SevenParameter(double *wgs84, const double *bj54, const double *sevenParameter); + + + + + + + +//功能:北京54坐标系转西安80坐标系,单点转换 + +//输入: bj54 北京54坐标系下的经纬高,其中: +// bj54[0]------经度,以°为单位 +// bj54[1]------纬度,以°为单位 +// bj54[2]------高度,以m为单位 +// sevenParameter 七参数数值,其中: +// sevenParameter[0]------dX,以m为单位 +// sevenParameter[1]------dY,以m为单位 +// sevenParameter[2]------dZ,以m为单位 +// sevenParameter[3]------eX,以秒为单位 +// sevenParameter[4]------eY,以秒为单位 +// sevenParameter[5]------eZ,以秒为单位 +// sevenParameter[6]------k, 尺度比ppm,百万分之几 + +//输出: xian80 西安80坐标系下的经纬高,其中: +// xian80[0]------经度,以°为单位 +// xian80[1]------纬度,以°为单位 +// xian80[2]------高度,以m为单位 +MAPPRJ_API void Bj54ToXian80_SevenParameter(double *xian80, const double *bj54, const double *sevenParameter); + + + + + + + + +//功能:WGS84坐标系转北京54坐标系,单点转换 + +//输入: wgs84 WGS84坐标系下的经纬高,其中: +// wgs84[0]------经度,以°为单位 +// wgs84[1]------纬度,以°为单位 +// wgs84[2]------高度,以m为单位 +// sevenParameter 七参数数值,其中: +// sevenParameter[0]------dX,以m为单位 +// sevenParameter[1]------dY,以m为单位 +// sevenParameter[2]------dZ,以m为单位 +// sevenParameter[3]------eX,以秒为单位 +// sevenParameter[4]------eY,以秒为单位 +// sevenParameter[5]------eZ,以秒为单位 +// sevenParameter[6]------k, 尺度比ppm,百万分之几 + +//输出: bj54 北京54坐标系下的经纬高,其中: +// bj54[0]------经度,以°为单位 +// bj54[1]------纬度,以°为单位 +// bj54[2]------高度,以m为单位 +MAPPRJ_API void WGS84ToBj54_SevenParameter(double *bj54, const double *wgs84, const double *sevenParameter); + + + + + + + +//功能:WGS84坐标系转西安80坐标系,单点转换 + +//输入: wgs84 WGS84坐标系下的经纬高,其中: +// wgs84[0]------经度,以°为单位 +// wgs84[1]------纬度,以°为单位 +// wgs84[2]------高度,以m为单位 +// sevenParameter 七参数数值,其中: +// sevenParameter[0]------dX,以m为单位 +// sevenParameter[1]------dY,以m为单位 +// sevenParameter[2]------dZ,以m为单位 +// sevenParameter[3]------eX,以秒为单位 +// sevenParameter[4]------eY,以秒为单位 +// sevenParameter[5]------eZ,以秒为单位 +// sevenParameter[6]------k, 尺度比ppm,百万分之几 + +//输出: xian80 西安80坐标系下的经纬高,其中: +// xian80[0]------经度,以°为单位 +// xian80[1]------纬度,以°为单位 +// xian80[2]------高度,以m为单位 +MAPPRJ_API void WGS84ToXian80_SevenParameter(double *xian80, const double *wgs84, const double *sevenParameter); + + + + + + + + +//功能:西安80坐标系转北京54坐标系,单点转换 + +//输入: xian80 西安80坐标系下的经纬高,其中: +// xian80[0]------经度,以°为单位 +// xian80[1]------纬度,以°为单位 +// xian80[2]------高度,以m为单位 +// sevenParameter 七参数数值,其中: +// sevenParameter[0]------dX,以m为单位 +// sevenParameter[1]------dY,以m为单位 +// sevenParameter[2]------dZ,以m为单位 +// sevenParameter[3]------eX,以秒为单位 +// sevenParameter[4]------eY,以秒为单位 +// sevenParameter[5]------eZ,以秒为单位 +// sevenParameter[6]------k, 尺度比ppm,百万分之几 + +//输出: bj54 北京54坐标系下的经纬高,其中: +// bj54[0]------经度,以°为单位 +// bj54[1]------纬度,以°为单位 +// bj54[2]------高度,以m为单位 +MAPPRJ_API void Xian80ToBj54_SevenParameter(double *bj54, const double *xian80, const double *sevenParameter); + + + + + + + + + +//功能:西安80坐标系转WGS84坐标系,单点转换 + +//输入: xian80 西安80坐标系下的经纬高,其中: +// xian80[0]------经度,以°为单位 +// xian80[1]------纬度,以°为单位 +// xian80[2]------高度,以m为单位 +// sevenParameter 七参数数值,其中: +// sevenParameter[0]------dX,以m为单位 +// sevenParameter[1]------dY,以m为单位 +// sevenParameter[2]------dZ,以m为单位 +// sevenParameter[3]------eX,以秒为单位 +// sevenParameter[4]------eY,以秒为单位 +// sevenParameter[5]------eZ,以秒为单位 +// sevenParameter[6]------k, 尺度比ppm,百万分之几 + +//输出: wgs84 WGS84坐标系下的经纬高,其中: +// wgs84[0]------经度,以°为单位 +// wgs84[1]------纬度,以°为单位 +// wgs84[2]------高度,以m为单位 +MAPPRJ_API void Xian80ToWgs84_SevenParameter(double *wgs84, const double *xian80, const double *sevenParameter); + + + + + + + + + +//功能:北京54坐标系转WGS84坐标系,单点转换 + +//输入: bj54 北京54坐标系下的经纬高,其中: +// bj54[0]------经度,以°为单位 +// bj54[1]------纬度,以°为单位 +// bj54[2]------高度,以m为单位 +// ThreeParameter 三参数数值,其中: +// ThreeParameter[0]------dX,以m为单位 +// ThreeParameter[1]------dY,以m为单位 +// ThreeParameter[2]------dZ,以m为单位 + +//输出: wgs84 WGS84坐标系下的经纬高,其中: +// wgs84[0]------经度,以°为单位 +// wgs84[1]------纬度,以°为单位 +// wgs84[2]------高度,以m为单位 +MAPPRJ_API void Bj54ToWGS84_ThreeParameter(double *wgs84, const double *bj54, const double *ThreeParameter); + + + + + + + + + +//功能:WGS84坐标系转北京54坐标系,单点转换 + +//输入: wgs84 WGS84坐标系下的经纬高,其中: +// wgs84[0]------经度,以°为单位 +// wgs84[1]------纬度,以°为单位 +// wgs84[2]------高度,以m为单位 +// ThreeParameter 三参数数值,其中: +// ThreeParameter[0]------dX,以m为单位 +// ThreeParameter[1]------dY,以m为单位 +// ThreeParameter[2]------dZ,以m为单位 + +//输出: bj54 北京54坐标系下的经纬高,其中: +// bj54[0]------经度,以°为单位 +// bj54[1]------纬度,以°为单位 +// bj54[2]------高度,以m为单位 +MAPPRJ_API void WGS84ToBj54_ThreeParameter(double *bj54, const double *wgs84, const double *ThreeParameter); + + + + + + + + + + + + + + +//功能:计算不同大地坐标系间转换的参数,采用布尔莎七参数模型 + +//输入: nowLLA 当前坐标系的大地坐标,其中nowLLA的数组长度为3*ptNum: +// nowLLA[0+3*i]------经度,以°为单位 +// nowLLA[1+3*i]------纬度,以°为单位 +// nowLLA[2+3*i]------高度,以m为单位 +// 0<= i < ptNum +// nowType 当前坐标系的椭球体类型,其中: +// 1------北京54 +// 2------西安80 +// 3------WGS84 +// aimLLA 目标坐标系的大地坐标,其中的数组长度为3*ptNum: +// aimLLA[0+3*i]------经度,以°为单位 +// aimLLA[1+3*i]------纬度,以°为单位 +// aimLLA[2+3*i]------高度,以m为单位 +// 0<= i < ptNum +// aimType 目标坐标系的椭球体类型,其中: +// 1------北京54 +// 2------西安80 +// 3------WGS84 +// ptNum 控制点的个数(即在当前坐标系和目标坐标系都有坐标的点的个数) + + +//输出: sevenParameter 七参数数值,其中: +// sevenParameter[0]------dX,以m为单位 +// sevenParameter[1]------dY,以m为单位 +// sevenParameter[2]------dZ,以m为单位 +// sevenParameter[3]------eX,以秒为单位 +// sevenParameter[4]------eY,以秒为单位 +// sevenParameter[5]------eZ,以秒为单位 +// sevenParameter[6]------k, 尺度比ppm,百万分之几 +MAPPRJ_API void CalculateSevenParameters(double *sevenParameter, const double *nowLLA, const int nowType, + const double *aimLLA, const int aimType, const int ptNum); + + + + + + + + +//功能:计算不同大地坐标系间转换的参数,采用布尔莎七参数模型 + +//输入: nowXYZ 当前坐标系的空间直角坐标,其中nowXYZ的数组长度为3*ptNum: +// nowXYZ[0+3*i]------X,以m为单位 +// nowXYZ[1+3*i]------Y,以m为单位 +// nowXYZ[2+3*i]------Z,以m为单位 +// 0<= i < ptNum +// aimXYZ 目标坐标系的空间直角坐标,其中aimXYZ的数组长度为3*ptNum: +// aimXYZ[0+3*i]------X,以m为单位 +// aimXYZ[1+3*i]------Y,以m为单位 +// aimXYZ[2+3*i]------Z,以m为单位 +// 0<= i < ptNum +// ptNum 控制点的个数(即在当前坐标系和目标坐标系都有坐标的点的个数) + +//输出: sevenParameter 七参数数值,其中: +// sevenParameter[0]------dX,以m为单位 +// sevenParameter[1]------dY,以m为单位 +// sevenParameter[2]------dZ,以m为单位 +// sevenParameter[3]------eX,以秒为单位 +// sevenParameter[4]------eY,以秒为单位 +// sevenParameter[5]------eZ,以秒为单位 +// sevenParameter[6]------k, 尺度比ppm,百万分之一 +MAPPRJ_API void CalculateSevenParameters(double *sevenParameter, const double *nowXYZ, const double *aimXYZ, const int ptNum); + + + + + + + + + + + +//功能:计算不同大地坐标系间转换的参数,采用三参数模型 + +//输入: nowLLA 当前坐标系的大地坐标,其中: +// nowLLA[0]------经度,以°为单位 +// nowLLA[1]------纬度,以°为单位 +// nowLLA[2]------高度,以m为单位 +// nowType 当前坐标系的椭球体类型,其中: +// 1------北京54 +// 2------西安80 +// 3------WGS84 +// aimLLA 目标坐标系的大地坐标,其中: +// aimLLA[0]------经度,以°为单位 +// aimLLA[1]------纬度,以°为单位 +// aimLLA[2]------高度,以m为单位 +// aimType 目标坐标系的椭球体类型,其中: +// 1------北京54 +// 2------西安80 +// 3------WGS84 + +//输出: dx X轴的坐标平移量,以m为单位 +// dy Y轴的坐标平移量,以m为单位 +// dz Z轴的坐标平移量,以m为单位 +MAPPRJ_API void CalculateThreeParameters(double &dx, double &dy, double &dz, const double *nowLLA, const int nowType, + const double *aimLLA, const int aimType); + + + + + + + + + +//功能:计算不同大地坐标系间转换的参数,采用三参数模型 + +//输入: nowXYZ 当前坐标系的空间直角坐标,其中: +// nowXYZ[0]------X,以m为单位 +// nowXYZ[1]------Y,以m为单位 +// nowXYZ[2]------Z,以m为单位 +// aimXYZ 目标坐标系的空间直角坐标,其中: +// aimXYZ[0]------X,以m为单位 +// aimXYZ[1]------Y,以m为单位 +// aimXYZ[2]------Z,以m为单位 + +//输出: dx X轴的坐标平移量,以m为单位 +// dy Y轴的坐标平移量,以m为单位 +// dz Z轴的坐标平移量,以m为单位 +MAPPRJ_API void CalculateThreeParameters(double &dx, double &dy, double &dz, const double *nowXYZ, const double *aimXYZ); + + + + + + + + + + +//功能:计算不同平面直角坐标系间转换的参数,采用四参数模型 + +//输入: nowXY 当前坐标系的空间直角坐标,其中nowXY的数组长度为2*ptNum: +// nowXYZ[0+2*i]------X,以m为单位 +// nowXYZ[1+2*i]------Y,以m为单位 +// 0<= i < ptNum +// aimXY 目标坐标系的空间直角坐标,其中aimXYZ的数组长度为2*ptNum: +// aimXYZ[0+2*i]------X,以m为单位 +// aimXYZ[1+2*i]------Y,以m为单位 +// 0<= i < ptNum +// ptNum 控制点的个数(即在当前坐标系和目标坐标系都有坐标的点的个数) + +//输出: fourParameters 四参数数值,其中: +// fourParameters[0]------xo,X方向坐标平移量,以m为单位 +// fourParameters[1]------yo,Y方向坐标平移量,以m为单位 +// fourParameters[2]------p,比例系数,无单位 +// fourParameters[3]------q,比例系数,无单位 +MAPPRJ_API void CalculateFourParameters(double *fourParameters, const double *nowXY, const double *aimXY, const int ptNum); + + + + + + + + + + +//功能:计算不同平面直角坐标系间转换的参数,采用四参数模型 + +//输入: nowLLA 当前坐标系的大地坐标,其中nowLLA的数组长度为2*ptNum: +// nowXYZ[0+2*i]------经度,以°为单位 +// nowXYZ[1+2*i]------纬度,以°为单位 +// 0<= i < ptNum +// nowType 当前坐标系的椭球体类型,其中: +// 1------北京54 +// 2------西安80 +// 3------WGS84 +// aimLLA 目标坐标系的大地坐标,其中aimLLA的数组长度为2*ptNum: +// aimLLA[0+2*i]------经度,以°为单位 +// aimLLA[1+2*i]------纬度,以°为单位 +// 0<= i < ptNum +// aimType 目标坐标系的椭球体类型,其中: +// 1------北京54 +// 2------西安80 +// 3------WGS84 +// ptNum 控制点的个数(即在当前坐标系和目标坐标系都有坐标的点的个数) + +//输出: fourParameters 四参数数值,其中: +// fourParameters[0]------xo,X方向坐标平移量,以m为单位 +// fourParameters[1]------yo,Y方向坐标平移量,以m为单位 +// fourParameters[2]------p,比例系数,无单位 +// fourParameters[3]------q,比例系数,无单位 + +MAPPRJ_API void CalculateFourParameters(double *fourParameters, const double *nowLLA, const int nowType, + const double *aimLLA, const int aimType, const int ptNum); + + + + + + + + +//功能:北京54坐标系转WGS84坐标系,单点转换 + +//输入: bj54 北京54坐标系下的经纬高,其中: +// bj54[0]------经度,以°为单位 +// bj54[1]------纬度,以°为单位 +// bj54[2]------高度,以m为单位 +// fourParameter 四参数数值,其中: +// fourParameters[0]------xo,X方向坐标平移量,以m为单位 +// fourParameters[1]------yo,Y方向坐标平移量,以m为单位 +// fourParameters[2]------p,比例系数,无单位 +// fourParameters[3]------q,比例系数,无单位 + +//输出: wgs84 WGS84坐标系下的经纬高,其中: +// wgs84[0]------经度,以°为单位 +// wgs84[1]------纬度,以°为单位 +// wgs84[2]------高度,以m为单位 +MAPPRJ_API void Bj54ToWGS84_FourParameter(double *wgs84, const double *bj54, const double *fourParameter); + + + + + + + + + + + + +//功能:北京54坐标系转西安80坐标系,单点转换 + +//输入: bj54 北京54坐标系下的经纬高,其中: +// bj54[0]------经度,以°为单位 +// bj54[1]------纬度,以°为单位 +// bj54[2]------高度,以m为单位 +// fourParameter 四参数数值,其中: +// fourParameters[0]------xo,X方向坐标平移量,以m为单位 +// fourParameters[1]------yo,Y方向坐标平移量,以m为单位 +// fourParameters[2]------p,比例系数,无单位 +// fourParameters[3]------q,比例系数,无单位 + +//输出: xian80 西安80坐标系下的经纬高,其中: +// xian80[0]------经度,以°为单位 +// xian80[1]------纬度,以°为单位 +// xian80[2]------高度,以m为单位 +MAPPRJ_API void Bj54ToXian80_FourParameter(double *xian80, const double *bj54, const double *fourParameter); + + + + + + + + + + +//功能:WGS84坐标系转北京54坐标系,单点转换 + +//输入: wgs84 WGS84坐标系下的经纬高,其中: +// wgs84[0]------经度,以°为单位 +// wgs84[1]------纬度,以°为单位 +// wgs84[2]------高度,以m为单位 +// fourParameter 四参数数值,其中: +// fourParameters[0]------xo,X方向坐标平移量,以m为单位 +// fourParameters[1]------yo,Y方向坐标平移量,以m为单位 +// fourParameters[2]------p,比例系数,无单位 +// fourParameters[3]------q,比例系数,无单位 + +//输出: bj54 北京54坐标系下的经纬高,其中: +// bj54[0]------经度,以°为单位 +// bj54[1]------纬度,以°为单位 +// bj54[2]------高度,以m为单位 +MAPPRJ_API void WGS84ToBj54_FourParameter(double *bj54, const double *wgs84, const double *fourParameter); + + + + + + + + +//功能:WGS84坐标系转西安80坐标系,单点转换 + +//输入: wgs84 WGS84坐标系下的经纬高,其中: +// wgs84[0]------经度,以°为单位 +// wgs84[1]------纬度,以°为单位 +// wgs84[2]------高度,以m为单位 +// fourParameter 四参数数值,其中: +// fourParameters[0]------xo,X方向坐标平移量,以m为单位 +// fourParameters[1]------yo,Y方向坐标平移量,以m为单位 +// fourParameters[2]------p,比例系数,无单位 +// fourParameters[3]------q,比例系数,无单位 + +//输出: xian80 西安80坐标系下的经纬高,其中: +// xian80[0]------经度,以°为单位 +// xian80[1]------纬度,以°为单位 +// xian80[2]------高度,以m为单位 + +MAPPRJ_API void WGS84ToXian80_FourParameter(double *xian80, const double *wgs84, const double *fourParameter); + + + + + + + + +//功能:西安80坐标系转北京54坐标系,单点转换 + +//输入: xian80 西安80坐标系下的经纬高,其中: +// xian80[0]------经度,以°为单位 +// xian80[1]------纬度,以°为单位 +// xian80[2]------高度,以m为单位 +// fourParameter 四参数数值,其中: +// fourParameters[0]------xo,X方向坐标平移量,以m为单位 +// fourParameters[1]------yo,Y方向坐标平移量,以m为单位 +// fourParameters[2]------p,比例系数,无单位 +// fourParameters[3]------q,比例系数,无单位 + +//输出: bj54 北京54坐标系下的经纬高,其中: +// bj54[0]------经度,以°为单位 +// bj54[1]------纬度,以°为单位 +// bj54[2]------高度,以m为单位 +MAPPRJ_API void Xian80ToBj54_FourParameter(double *bj54, const double *xian80, const double *fourParameter); + + + + + + + +//功能:西安80坐标系转WGS84坐标系,单点转换 + +//输入: xian80 西安80坐标系下的经纬高,其中: +// xian80[0]------经度,以°为单位 +// xian80[1]------纬度,以°为单位 +// xian80[2]------高度,以m为单位 +// fourParameter 四参数数值,其中: +// fourParameters[0]------xo,X方向坐标平移量,以m为单位 +// fourParameters[1]------yo,Y方向坐标平移量,以m为单位 +// fourParameters[2]------p,比例系数,无单位 +// fourParameters[3]------q,比例系数,无单位 + +//输出: wgs84 WGS84坐标系下的经纬高,其中: +// wgs84[0]------经度,以°为单位 +// wgs84[1]------纬度,以°为单位 +// wgs84[2]------高度,以m为单位 + +MAPPRJ_API void Xian80ToWgs84_FourParameter(double *wgs84, const double *xian80, const double *fourParameter); + + + + + + + +//功能:不同平面直角坐标之间的变换,单点转换 + +//输入: pFromCoord 一个平面直角坐标系下的X、Y坐标,其中: +// pFromCoord[0]------X坐标,以m为单位 +// pFromCoord[1]------Y坐标,以m为单位 + +// fourParameter 四参数数值,其中: +// fourParameters[0]------xo,X方向坐标平移量,以m为单位 +// fourParameters[1]------yo,Y方向坐标平移量,以m为单位 +// fourParameters[2]------p,比例系数,无单位 +// fourParameters[3]------q,比例系数,无单位 + +//输出: pToCoord 目标平面直角坐标系下的X、Y坐标,其中: +// pToCoord[0]------X坐标,以m为单位 +// pToCoord[1]------Y坐标,以m为单位 +MAPPRJ_API void PlaneCoordTransform_FourParameter(double *pToCoord, const double *pFromCoord, const double *fourParameter); + + + + + + +#endif \ No newline at end of file diff --git a/Include/QBStru.h b/Include/QBStru.h new file mode 100644 index 0000000..7307c19 --- /dev/null +++ b/Include/QBStru.h @@ -0,0 +1,625 @@ +/* +* 文件名称:QBInfo.h +* 摘 要:定义情报处理通用数据结构 +* 当前版本:2.0 王家星 20170311 +*/ + +#pragma once + +#pragma pack(1) + +// 昼夜光电侦察平台复接数据结构体 110字节,顺序不可调整 +// struct struProtocal_FJ +// { +// // 帧头 +// UINT8 Head[2]; // 帧头: EB 90 +// +// // 载荷参数 +// UINT8 ZH_Type; // 载荷识别码 +// // 0x10:数码相机侦察平台 +// // 0x20:昼夜光电侦察平台 +// UINT8 ZH_CmdType; // 开关指令回报 +// UINT8 ZH_WorkState; // 载荷工作状态 +// UINT8 ZH_CtrlState0; // 主控状态字0 +// UINT8 ZH_CtrlState1; // 主控状态字1 +// UINT8 ZH_ServoState; // 伺服状态字 +// UINT8 ZH_EOState0; // 可见光状态字0 +// +// UINT8 ZH_IRState; // 昼夜光电侦察平台:红外状态字 +// // 数码相机侦察平台:数码相机曝光时间 +// +// UINT8 ZH_TrackState; // 跟踪器状态字 +// UINT8 ZH_RecorderState; // 记录仪状态字 +// +// +// INT16 ZH_Pitch; // 载荷俯仰角 +// INT16 ZH_Azimuth; // 载荷方位角 +// UINT16 ZH_LaserDist; // 激光测距值 +// UINT16 ZH_EOFocalLen; // 可见光焦距 +// +// UINT16 ZH_IRFocalLen; // 昼夜光电侦察平台:红外焦距 +// // 数码相机侦察平台:照片总编号:自上电起所有拍照总数 +// +// INT16 ZH_DeltaX; // 俯仰脱靶量 +// INT16 ZH_DeltaY; // 方位脱靶量 +// +// UINT8 ZH_EOState1; // 可见光状态字1 +// UINT8 ZH_LaserIndicateState; // 激光照射状态字 +// +// UINT8 ZH_ImgType; // 图像类型 +// UINT8 ZH_ImgFlow; // 图像码率 +// +// UINT8 ZH_SMOverlapRatio; // 数码照片重叠率 分辨率为0.5%, 范围:0%~100% +// UINT8 CHKSUM; // 和校验位 1~32字节累和低8位为0x00 +// +// // 第二部分:表4的部分内容,即struProtocal_FKtoZH后半部分内容(11-87) +// +// // 飞机参数(部分) +// UINT8 UAV_Type; // 无人机型号 +// UINT8 UAV_ID; // 无人机ID +// UINT8 UAV_States[11]; // 无人机飞行状态 +// INT16 UAV_GyroPitch; // 垂直陀螺俯仰角 +// INT16 UAV_GyroRoll; // 垂直陀螺滚转角 +// UINT16 UAV_AirPresAlt; // 无人机气压高度 +// UINT16 UAV_MagHeading; // 无人机磁航向角 +// +// // 左右两个GPS测量数据(可测飞机滚转角) +// UINT8 GPS_LR_WorkState; // 卫导1定位测资状态 +// UINT32 GPS_LR_UTC; // 卫导1时分秒 +// UINT8 GPS_LR_Day; // 卫导1日 +// UINT8 GPS_LR_Month; // 卫导1月 +// UINT8 GPS_LR_Year; // 卫导1年 +// INT32 GPS_LR_Lat; // 卫导1纬度 +// INT32 GPS_LR_Lon; // 卫导1经度 +// UINT16 GPS_LR_Alt; // 卫导1高度 +// UINT16 GPS_LR_VHeading; // 卫导1地速方向(实际运动方向) +// UINT16 GPS_LR_HoriSpeed; // 卫导1水平速度 +// INT16 GPS_LR_VertSpeed; // 卫导1天速(垂直速度) +// UINT16 GPS_LR_Heading; // 卫导1航向角(机头方向) +// INT16 GPS_LR_Roll; // 卫导1滚转角 +// +// // 前后两个GPS测量数据(可测飞机俯仰角) +// UINT8 GPS_FB_WorkState; // 卫导2定位测资状态 +// UINT32 GPS_FB_UTC; // 卫导2时分秒 +// UINT8 GPS_FB_Day; // 卫导2日 +// UINT8 GPS_FB_Month; // 卫导2月 +// UINT8 GPS_FB_Year; // 卫导2年 +// INT32 GPS_FB_Lat; // 卫导2纬度 +// INT32 GPS_FB_Lon; // 卫导2经度 +// UINT16 GPS_FB_Alt; // 卫导2高度 +// UINT16 GPS_FB_VHeading; // 卫导2地速方向(实际运动方向) +// UINT16 GPS_FB_HoriSpeed; // 卫导2水平速度 +// INT16 GPS_FB_VertSpeed; // 卫导2天速(垂直速度) +// UINT16 GPS_FB_Heading; // 卫导2航向角(机头方向) +// INT16 GPS_FB_Pitch; // 卫导2俯仰角 +// +// UINT8 CHKSUM2; // 和校验位 +// }; + +// 昼夜光电侦察平台复接数据结构体 110字节,顺序不可调整 +struct struProtocal_FJ +{ + // 帧头 + UINT8 Head[2]; // 帧头: EB 90 + + // 载荷参数 + UINT8 ZH_Type; // 载荷识别码 + // 0x10:数码相机侦察平台 + // 0x20:昼夜光电侦察平台 + UINT8 ZH_CmdType; // 开关指令回报 + UINT8 ZH_WorkState; // 载荷工作状态 + UINT8 ZH_CtrlState0; // 主控状态字0 + UINT8 ZH_CtrlState1; // 主控状态字1 + UINT8 ZH_ServoState; // 伺服状态字 + UINT8 ZH_EOState0; // 可见光状态字0 + + UINT8 ZH_IRState; // 昼夜光电侦察平台:红外状态字 + // 数码相机侦察平台:数码相机曝光时间 + + UINT8 ZH_TrackState; // 跟踪器状态字 + UINT8 ZH_RecorderState; // 记录仪状态字 + + + INT16 ZH_Pitch; // 载荷俯仰角 + INT16 ZH_Azimuth; // 载荷方位角 + UINT16 ZH_LaserDist; // 激光测距值 + UINT16 ZH_EOFocalLen; // 可见光焦距 + + UINT16 ZH_IRFocalLen; // 昼夜光电侦察平台:红外焦距 + // 数码相机侦察平台:照片总编号:自上电起所有拍照总数 + + INT16 ZH_DeltaX; // 俯仰脱靶量 + INT16 ZH_DeltaY; // 方位脱靶量 + + UINT8 ZH_EOState1; // 可见光状态字1 + UINT8 ZH_LaserIndicateState; // 激光照射状态字(含义见载荷补充协议) + + UINT8 ZH_ImgType; // 图像类型 + UINT8 ZH_ImgFlow; // 图像码率 + + UINT8 ZH_SMOverlapRatio; // 数码照片重叠率 分辨率为0.5%, 范围:0%~100% + UINT8 CHKSUM; // 和校验位 1~32字节累和低8位为0x00 + + // 第二部分:表4的部分内容,即struProtocal_FKtoZH后半部分内容(11-87) + + // 飞机参数(部分) + UINT8 UAV_Type; // 无人机型号 + UINT8 UAV_ID; // 无人机ID + UINT8 UAV_States[11]; // 无人机飞行状态 + INT16 UAV_GyroPitch; // 垂直陀螺俯仰角 + INT16 UAV_GyroRoll; // 垂直陀螺滚转角 + UINT16 UAV_AirPresAlt; // 无人机气压高度 + UINT16 UAV_MagHeading; // 无人机磁航向角 + + // 左右两个GPS测量数据(可测飞机滚转角) + UINT8 GPS_LR_WorkState; // 卫导1定位测资状态 + UINT32 GPS_LR_UTC; // 卫导1时分秒 + UINT8 GPS_LR_Day; // 卫导1日 + UINT8 GPS_LR_Month; // 卫导1月 + UINT8 GPS_LR_Year; // 卫导1年 + INT32 GPS_LR_Lat; // 卫导1纬度 + INT32 GPS_LR_Lon; // 卫导1经度 + UINT16 GPS_LR_Alt; // 卫导1高度 + UINT16 GPS_LR_VHeading; // 卫导1地速方向(实际运动方向) + UINT16 GPS_LR_HoriSpeed; // 卫导1水平速度 + INT16 GPS_LR_VertSpeed; // 卫导1天速(垂直速度) + UINT16 GPS_LR_Heading; // 卫导1航向角(机头方向) + INT16 GPS_LR_Roll; // 卫导1滚转角 + + // 前后两个GPS测量数据(可测飞机俯仰角) + UINT8 GPS_FB_WorkState; // 卫导2定位测资状态 + UINT32 GPS_FB_UTC; // 卫导2时分秒 + UINT8 GPS_FB_Day; // 卫导2日 + UINT8 GPS_FB_Month; // 卫导2月 + UINT8 GPS_FB_Year; // 卫导2年 + INT32 GPS_FB_Lat; // 卫导2纬度 + INT32 GPS_FB_Lon; // 卫导2经度 + UINT16 GPS_FB_Alt; // 卫导2高度 + UINT16 GPS_FB_VHeading; // 卫导2地速方向(实际运动方向) + UINT16 GPS_FB_HoriSpeed; // 卫导2水平速度 + INT16 GPS_FB_VertSpeed; // 卫导2天速(垂直速度) + UINT16 GPS_FB_Heading; // 卫导2航向角(机头方向) + INT16 GPS_FB_Pitch; // 卫导2俯仰角 + + UINT8 CHKSUM2; // 和校验位 +}; + +// 转换后的组播位置信息数据结构体 +struct struSocketProtocal +{ + UINT8 Socket_Head[2]; // 帧头 + UINT8 Socket_Marker; // 帧标识 + UINT8 Socket_Sender; // 发送方标识 + UINT16 Socket_FrameCount; // 帧计数 + INT32 UAV_Lon; // 自身经度 + INT32 UAV_Lat; // 自身纬度 + INT16 UAV_Alt; // 自身高度 + INT32 Target_Lon; // 目标经度 + INT32 Target_Lat; // 目标纬度 + INT16 Target_Alt; // 目标高度 + UINT8 CRC[2]; // CRC16校验 + UINT8 Socket_End[2]; // 帧尾 +}; + +// 转换后的图像复接数据结构体 +struct struTranslateProtocal_FJ +{ + bool bValid; // 结构体数据是否有效: TRUE—有效 FALSE—无效 + + // 载荷参数 + UINT8 ZH_Type; // 载荷识别码 0x10—数码相机侦察平台 0x20—昼夜光电侦查平台 + + UINT8 ZH_CmdType; // 回报开关指令 + + //载荷工作状态——主界面显示 + UINT8 ZH_StablePlatformWorkState; // 稳定平台工作状态:000—手动跟踪 001—自动跟踪 010—锁定 011—数引 100—扫描 101—刹车(昼夜光电平台)垂直随动(数码相机平台) 110—初始化 111—偏心跟踪 + UINT8 ZH_LaserRangeWorkState; // 激光测距仪工作状态:000—正常 001—故障 010—关机 011—待机 100—测距开 101—测距关 111—休息 + UINT8 ZH_ElevatorWorkState; // 升降机构工作状态:00—顶端 01—底端 10—上升 11—下降 + + //状态字 + UINT8 ZH_CtrlState0; // 主控状态字0 + UINT8 ZH_CtrlState1; // 主控状态字1 + UINT8 ZH_ServoState; // 伺服状态字 + + //可见光状态字0 + UINT8 ZH_EOCameraWorkState; // EO相机状态: 0—正常 1—故障 + UINT8 ZH_EOCameraImgState; // EO图像状态: 0—真实 1:—自检 + + //红外状态字 + UINT8 ZH_IRCameraWorkState; // 红外相机状态: 0—正常 1—故障 + UINT8 ZH_IRCameraImgState; // 红外图像状态: 0—真实 1:—自检 + UINT8 ZH_IRCameraDigitalDouble; // 热像仪数字变倍:0—正常 1—数字变倍2X + + //配合11所调试激光状态字,占用可见光状态字1字节 + UINT8 ZH_LASERTEST_D7; // 全系统: 0-正常 1-故障 + UINT8 ZH_LASERTEST_D6; // 温控: 0-正常 1-故障 + UINT8 ZH_LASERTEST_D5; // 驱动: 0-正常 1-故障 + UINT8 ZH_LASERTEST_D4; // 照射循环:0-未完成 1-已完成 + UINT8 ZH_LASERTEST_D3; // 主波: 0-有主波 1-无主波 + UINT8 ZH_LASERTEST_D2; // 回波: 0-有回波 1-无回波 + UINT8 ZH_LASERTEST_D1D0;//工作状态:00:待机 01:测距 10:照射 11:休息 + + + // 数码相机曝光时间 + UINT ZH_SMExposalTime; // 数码照片曝光时间 200~5000us + + // 跟踪器状态 + UINT8 ZH_EOTrackState_Control; // 可见光接收球上主控数据:0—正常 1—故障 + UINT8 ZH_EOTrackState; // 可见光跟踪器状态:000—正常 001—异常 010—目标丢失 011—相关跟踪 100—重心黑 101—重心白 110-冻结当前帧 111-显示当前帧 + UINT8 ZH_IRTrackState_Control; // 红外接收球上主控数据:0—正常 1—故障 + UINT8 ZH_IRTrackState; // 红外跟踪器状态:000—正常 001—异常 010—目标丢失 011—相关跟踪 100—重心黑 101—重心白 110-冻结当前帧 111-显示当前帧 + + + float ZH_Pitch; // 载荷俯仰角 + float ZH_Azimuth; // 载荷方位角 + bool ZH_LaserOn; // 激光测距开关,true为开 + unsigned int ZH_LaserDist; // 激光测距值 + float ZH_EOFocalLen; // 可见光焦距 + float ZH_IRFocalLen; // 红外焦距 + + UINT ZH_SMSerialNumber; // 数码相机照片总编号 + + int ZH_DeltaX; // 俯仰脱靶量 + int ZH_DeltaY; // 方位脱靶量 + + + + UINT8 ZH_ImgType; // 图像类型:0x01—可见光 0x02—红外 0x03-数码照片 0x04—可见光&红外 0x07-可见光&数码照片 + UINT8 ZH_ImgFlow; // 图像码流:0x03—3Mbps 0x05—5Mbps 0x08—7.68Mbps + + float ZH_SMOverlapRatio; // 数码照片重叠率 + + double ZH_EOPixelSize; // 可见光像元尺寸 + double ZH_IRPixelSize; // 红外像元尺寸 非数字变倍15um + double ZH_SMPixelSize; // 数码照片像元尺寸 + + + // 第二部分:表4的部分内容,即struProtocal_FKtoZH后半部分内容(11-87) + + // 飞机参数(部分) + UINT8 UAV_Type; // 无人机型号 + UINT8 UAV_ID; // 无人机ID + UINT8 UAV_States[11]; // 无人机飞行状态 + float UAV_GyroPitch; // 垂直陀螺俯仰角 + float UAV_GyroRoll; // 垂直陀螺滚转角 + float UAV_AirPresAlt; // 无人机气压高度 + float UAV_MagHeading; // 无人机磁航向角 + + // 左右两个GPS测量数据(可测飞机滚转角) + UINT8 GPS_LR_WorkState; // 卫导1定位测资状态 + UINT8 GPS_LR_Location; // 卫导1定位 + UINT8 GPS_LR_Attitude; // 卫导1测姿 + unsigned int GPS_LR_UTC; // 卫导1时分秒 + unsigned int GPS_LR_Day; // 卫导1日 + unsigned int GPS_LR_Month;// 卫导1月 + unsigned int GPS_LR_Year; // 卫导1年 + float GPS_LR_Lon; // 卫导1经度 + float GPS_LR_Lat; // 卫导1纬度 + float GPS_LR_Alt; // 卫导1高度 + float GPS_LR_VHeading; // 卫导1地速方向(实际运动方向) + float GPS_LR_HoriSpeed; // 卫导1水平速度 + float GPS_LR_VertSpeed; // 卫导1天速(垂直速度) + float GPS_LR_Heading; // 卫导1航向角(机头方向) + float GPS_LR_Roll; // 卫导1滚转角 + + // 前后两个GPS测量数据(可测飞机俯仰角) + UINT8 GPS_FB_WorkState; // 卫导2定位测资状态 + UINT8 GPS_FB_Location; // 卫导2定位 + UINT8 GPS_FB_Attitude; // 卫导2测姿 + unsigned int GPS_FB_UTC; // 卫导2时分秒 + unsigned int GPS_FB_Day; // 卫导2日 + unsigned int GPS_FB_Month; // 卫导2月 + unsigned int GPS_FB_Year; // 卫导2年 + float GPS_FB_Lon; // 卫导2经度 + float GPS_FB_Lat; // 卫导2纬度 + float GPS_FB_Alt; // 卫导2高度 + float GPS_FB_VHeading; // 卫导2地速方向(实际运动方向) + float GPS_FB_HoriSpeed; // 卫导2水平速度 + float GPS_FB_VertSpeed; // 卫导2天速(垂直速度) + float GPS_FB_Heading; // 卫导2航向角(机头方向) + float GPS_FB_Pitch; // 卫导2俯仰角 + + struTranslateProtocal_FJ() + { + bValid = false; + } +}; + +// 图像中心点定位结构体 +struct struCenterLocation +{ + bool bValid; // 是否有效 + double Lon; // 经度 + double Lat; // 纬度 + double H; // 高度 + + struCenterLocation() + { + bValid = false; + Lon = 0; + Lat = 0; + H = 0; + } +}; + +// 情报处理复接数据结构体 +struct struQB_FJ +{ +// bool bValid; // 结构体数据是否有效: TRUE—有效 FALSE—无效 +// +// // 载荷姿态和属性 +// UINT8 ZH_StablePlatformWorkState; // 稳定平台工作状态:000—手动跟踪 001—自动跟踪 010—锁定 011—数引 100—扫描 101—刹车 110—初始化 111—偏心跟踪 +// UINT8 ZH_TrackState; // 跟踪器状态:000—正常 001—异常 010—目标丢失 011—相关跟踪 100—重心黑 101—重心白 +// float ZH_Pitch; // 载荷俯仰角 +// float ZH_Azimuth; // 载荷方位角 +// bool ZH_LaserOn; // 激光测距开关,true为开 +// double ZH_LaserDist; // 激光测距值 +// float ZH_FocalLen; //焦距 mm +// float ZH_IRFocalLen; // IR焦距 mm(CH96补充) +// int ZH_DeltaX; //俯仰脱靶量 +// int ZH_DeltaY; //方位脱靶量 +// double ZH_PixelSize; //像元尺寸 +// int ZH_ImgWidth; // 图像宽 +// int ZH_ImgHeight; // 图像高 +// +// // 飞机位置姿态GPS +// double UAV_GPS_Lon; // 无人机经度 +// double UAV_GPS_Lat; // 无人机纬度 +// float UAV_GPS_Alt; // 无人机高度 +// float UAV_GPS_HSpeed; // 水平速度 +// float UAV_Pitch; // 俯仰角 +// float UAV_Yaw; // 航向角(机头方向) +// float UAV_Roll; // 滚转角 +// float UAV_GroundHeight; // 无人机下视点地面高度:地面计算获取30米高程 +// +// // GPS时间 +// unsigned int UAV_GPS_Year; // 卫导1年 +// unsigned int UAV_GPS_Month; // 卫导1月 +// unsigned int UAV_GPS_Day; // 卫导1日 +// unsigned int UAV_GPS_UTC; // 卫导1时分秒 +// +// // 附加部分 +// struCenterLocation centerLoc; // 图像中心点地理坐标,目标定位时会用到 +// +// struQB_FJ() +// { +// bValid = false; +// } + + bool bValid; // 结构体数据是否有效: TRUE—有效 FALSE—无效 + + // 载荷姿态和属性 + UINT8 ZH_StablePlatformWorkState; // 稳定平台工作状态:000—手动跟踪 001—自动跟踪 010—锁定 011—数引 100—扫描 101—刹车 110—初始化 111—偏心跟踪 + UINT8 ZH_TrackState; // 跟踪器状态:000—正常 001—异常 010—目标丢失 011—相关跟踪 100—重心黑 101—重心白 + float ZH_Pitch; // 载荷俯仰角 + float ZH_Azimuth; // 载荷方位角 + bool ZH_LaserOn; // 激光测距开关,true为开 + double ZH_LaserDist; // 激光测距值 + float ZH_FocalLen; //焦距 mm + int ZH_DeltaX; //俯仰脱靶量 + int ZH_DeltaY; //方位脱靶量 + double ZH_PixelSize; //像元尺寸 + int ZH_ImgWidth; // 图像宽 + int ZH_ImgHeight; // 图像高 + + // 飞机位置姿态GPS + double UAV_GPS_Lon; // 无人机经度 + double UAV_GPS_Lat; // 无人机纬度 + float UAV_GPS_Alt; // 无人机高度 + float UAV_GPS_HSpeed; // 水平速度 + float UAV_Pitch; // 俯仰角 + float UAV_Yaw; // 航向角(机头方向) + float UAV_Roll; // 滚转角 + float UAV_GroundHeight; // 无人机下视点地面高度:地面计算获取30米高程 + + // GPS时间 + unsigned int UAV_GPS_Year; // 卫导1年 + unsigned int UAV_GPS_Month; // 卫导1月 + unsigned int UAV_GPS_Day; // 卫导1日 + unsigned int UAV_GPS_UTC; // 卫导1时分秒 + + // 附加部分 + struCenterLocation centerLoc; // 图像中心点地理坐标,目标定位时会用到 + + struQB_FJ() + { + bValid = false; + } +}; + + +// 图像经纬度边界 +struct GeoBoundingBox +{ + double NorthLat; // 北纬 + double SouthLat; // 南纬 + double WestLon; // 西经 + double EastLon; // 东经 + + GeoBoundingBox() + { + NorthLat = -200.0; + SouthLat = -200.0; + WestLon = -200.0; + EastLon = -200.0; + } +}; + +//图像信息结构 +struct ImgStru +{ + int ImgWidth; // 图像宽 + int ImgHeight; // 图像高 + int bitcount; // 位数 + GeoBoundingBox BoundingBox; // 经纬度边界(存储几何校正后图像的地理边界信息) + unsigned char* buff; // 图像数据 + + ImgStru() + { + ImgWidth = 0; + ImgHeight = 0; + bitcount = 0; + buff = NULL; + } + + ~ImgStru() + { + if ( buff != NULL ) + { + delete[] buff; + buff = NULL; + } + } + +}; + +//图像数据:输入图像、输出图像、TIF图像 +struct ImgData +{ + bool bValid; //是否有效 + ImgStru srcImg; //输入图像数据 + ImgStru dstImg; //输出图像数据 + ImgStru geoImg; //TIF文件数据 +}; + +// 情报结构体 +struct QBStru +{ + //struTranslateProtocal_FJ frameAll; // 全部复接数据 + struQB_FJ framePart; // 部分复接数据 + ImgData image; // 图像数据 + + QBStru() + { + //memset(&frameAll, 0, sizeof(struTranslateProtocal_FJ)); + memset(&framePart, 0, sizeof(struQB_FJ)); + memset(&image, 0, sizeof(ImgData)); + } +}; +// CH96协议 +struct Protocal96TXD +{ + //载荷参数 + UINT8 head[2]; // 帧头(1-2) + + UINT8 mem1; // 预留,载荷参数开始(3) + UINT8 SwitchCmd; // 开关指令(4) + UINT8 Status0; // 状态字0(暂无)(5) + UINT8 Status1; // 状态字1(图像状态)(6) + UINT16 EOFocus; // 可见光焦距值(7-8) + UINT8 Status2; // 状态字2(伺服状态)(9) + UINT32 FrameCount; // 帧计数值(时码)(10-13) + INT16 dx; // 俯仰脱靶量(14-15) + INT16 dy; // 方位脱靶量(16-17) + UINT16 IRFocus; // 红外焦距值(18-19) + UINT16 LaserDis; // 激光测距值(20-21) + UINT8 LaserState; // 激光状态(测距开关)(22) + UINT32 None_1; // 无(23-26) + UINT32 None_2; // 无(27-30) + INT16 ZH_Pitch; // 载荷俯仰角(31-32) + INT16 ZH_Azimuth; // 载荷方位角(33-34) + UINT16 PixelSize; // 像元大小(35-36) + UINT16 mem2[6]; // 压缩/所取图像/横向/纵向分辨率(37-48) + + //飞机参数 + INT16 PlaneID; //飞机ID(49-50)(1-2) + INT16 Pitch; //飞机测姿俯仰角(51-52)(3-4) + INT16 Roll; //飞机测姿滚转角(53-54)(5-6) + INT16 Yaw; //飞机测姿航向角(55-56)(7-8) + INT32 Satelite_lon; //飞机测姿经度(57-60)(9-12) + INT32 Satelite_lat; //飞机测姿纬度(61-64)(13-16) + INT32 Satelite_height; //飞机测姿高度(65-68)(17-20) + INT16 Satelite_Ground_Speed; //飞机测姿地速(69-70)(21-22) + INT16 Satelite_Ground_Speed_Dir; //测姿GPS地速方向(71-72)(23-24) + INT16 Satelite_Sky_Speed; //测姿GPS天速(73-74)(25-26) + INT16 MTI_Pitch; //MTI俯仰角(75-76)(27-28) + INT16 MTI_Roll; //MTI滚转角(77-78)(29-30) + INT16 MTI_Yaw; //MTI航向角(79-80)(31-32) + INT32 MTI_lon; //MTI经度(81-84)(33-36) + INT32 MTI_lat; //MTI纬度(85-88)(37-40) + INT16 MTI_height; //MTI高度(89-90)(41-42) + INT16 MTI_Ground_Speed; //MTI地速(91-92)(43-44) + INT16 MTI_Ground_Speed_Dir; //MTI地速方向(93-94)(45-46) + INT16 MTI_Sky_Speed; //MTI天速(95-96)(47-48) + UINT32 UTC_Second; //UTC天秒(97-100)(49-52) + UINT8 UTC_Year; //UTC年(101)(53) + UINT8 UTC_Month; //UTC 月(102)(54) + UINT8 UTC_Day; //UTC 日(103)(55) + UINT8 NavigationState; //导航状态(104)(56) + UINT16 PressureHEG; //气压高度(105-106)(57-58) + INT16 AirSpeed; //空速(107-108)(59-60) + UINT8 Engine_Speed; //发动机转速(109)(61) + INT8 Left_Tmp; //左缸温(110)(62) + INT8 Right_Tmp; //右缸温(111)(63) + INT8 Pitch_Install_Err; //载荷俯仰安装误差(112)(64) + INT8 Roll_Install_Err; //载荷滚转安装误差(113)(65) + INT8 Yaw_Install_Err; //载荷偏航安装误差(114)(66) + UINT8 mem3; //预留(115)(67) + INT8 GPS_Parm[38]; //测姿GPS 参数(116-148)(68-100) + + UINT16 CRC; //飞参数据校验(149-150) +}; + +struct Data96TXD +{ + //载荷参数 + UINT8 head[2]; // 帧头(1-2) + + UINT8 mem1; // 预留,载荷参数开始(3) + UINT8 SwitchCmd; // 开关指令(4) + UINT8 Status0; // 状态字0(暂无)(5) + UINT8 Status1; // 状态字1(图像状态)(6) + float EOFocus; // 可见光焦距值(7-8) + UINT8 Status2; // 状态字2(伺服状态)(9) + UINT32 FrameCount; // 帧计数值(时码)(10-13) + int dx; // 俯仰脱靶量(14-15) + int dy; // 方位脱靶量(16-17) + float IRFocus; // 红外焦距值(18-19) + int LaserDis; // 激光测距值(20-21) + UINT8 LaserState; // 激光状态(测距开关)(22) + UINT32 None_1; // 无(23-26) + UINT32 None_2; // 无(27-30) + float ZH_Pitch; // 载荷俯仰角(31-32) + float ZH_Azimuth; // 载荷方位角(33-34) + float PixelSize; // 像元大小(35-36) + UINT16 mem2[6]; // 压缩/所取图像/横向/纵向分辨率(37-48) + + //飞机参数 + int PlaneID; //飞机ID(49-50)(1-2) + float Pitch; //飞机测姿俯仰角(51-52)(3-4) + float Roll; //飞机测姿滚转角(53-54)(5-6) + float Yaw; //飞机测姿航向角(55-56)(7-8) + double Satelite_lon; //飞机测姿经度(57-60)(9-12) + double Satelite_lat; //飞机测姿纬度(61-64)(13-16) + double Satelite_height; //飞机测姿高度(65-68)(17-20) + float Satelite_Ground_Speed; //飞机测姿地速(69-70)(21-22) + float Satelite_Ground_Speed_Dir; //测姿GPS地速方向(71-72)(23-24) + float Satelite_Sky_Speed; //测姿GPS天速(73-74)(25-26) + float MTI_Pitch; //MTI俯仰角(75-76)(27-28) + float MTI_Roll; //MTI滚转角(77-78)(29-30) + float MTI_Yaw; //MTI航向角(79-80)(31-32) + double MTI_lon; //MTI经度(81-84)(33-36) + double MTI_lat; //MTI纬度(85-88)(37-40) + double MTI_height; //MTI高度(89-90)(41-42) + float MTI_Ground_Speed; //MTI地速(91-92)(43-44) + float MTI_Ground_Speed_Dir; //MTI地速方向(93-94)(45-46) + float MTI_Sky_Speed; //MTI天速(95-96)(47-48) + int UTC_Second; //UTC天秒(97-100)(49-52) + int UTC_Year; //UTC年(101)(53) + int UTC_Month; //UTC 月(102)(54) + int UTC_Day; //UTC 日(103)(55) + UINT8 NavigationState; //导航状态(104)(56) + float PressureHEG; //气压高度(105-106)(57-58) + float AirSpeed; //空速(107-108)(59-60) + int Engine_Speed; //发动机转速(109)(61) + int Left_Tmp; //左缸温(110)(62) + int Right_Tmp; //右缸温(111)(63) + float Pitch_Install_Err; //载荷俯仰安装误差(112)(64) + float Roll_Install_Err; //载荷滚转安装误差(113)(65) + float Yaw_Install_Err; //载荷偏航安装误差(114)(66) + UINT8 mem3; //预留(115)(67) + INT8 GPS_Parm[38]; //测姿GPS 参数(116-148)(68-100) + + UINT16 CRC; //飞参数据校验(149-150) +}; +#pragma pack() diff --git a/Include/QB_ImgProcessFun.h b/Include/QB_ImgProcessFun.h new file mode 100644 index 0000000..3118dd1 --- /dev/null +++ b/Include/QB_ImgProcessFun.h @@ -0,0 +1,403 @@ +#ifndef QB_IMGPROCESS_H +#define QB_IMGPROCESS_H + +#ifdef IMGPROCESS_EXPORTS +#define IMGPROCESS_API __declspec(dllexport) +#else +#define IMGPROCESS_API __declspec(dllimport) +#endif + +// OpenCV +#include +using namespace cv; + +// 情报数据通用结构 +#include "QBStru.h" + + +// 1. 图像去雾控制 算法:王家星 + +//1.1 功能:图像去雾控制(暗通道先验) +//输入: 1. qbData 通用情报数据结构体 +// 2. A_MAX 控制去雾效果, A_MAX < 0 时,自适应计算(特别耗时); 有效范围【0,255】 +// 3. degree 控制去雾效果, 有效范围【0,1】 +// 4. bSrcFirst 默认时,优先处理srcImg, srcImg-->dstImg +// 否则,优先处理dstImg,dstImg——>dstImg + +//输出: 1. qbData 含去雾后图像的情报数据结构体 +// 2. 返回值:处理成功返回true,失败返回false +//说明: 首先判断图像数据有效性标识位,无效时直接返回,不做任何处理; +IMGPROCESS_API bool DoDehazeCtrl(QBStru *qbData, + int A_MAX = -1, + double degree = 0.78, + bool bSrcFirst = true); + + +//1.2 功能:图像去雾控制(函数重载) +//输入: 1. src 输入图像结构体 +// 2. A_MAX 控制去雾效果, A_MAX < 0 时,自适应计算(特别耗时); 有效范围【0,255】 +// 3. degree 控制去雾效果, 有效范围【0,1】 + +//输出: 1. dst 输出图像结构体 +// 2. 返回值:处理成功返回true,失败返回false +IMGPROCESS_API bool DoDehazeCtrl(ImgStru* src, + ImgStru* dst, + int A_MAX = -1, + double degree = 0.78); + + + +// 2. 图像亮度控制 算法:王家星 + +//2.1 功能:图像亮度控制 +//输入: 1. qbData 通用情报数据结构体 +// 2. degree 控制亮度, 有效范围【0,20】,值越小越暗,越大越亮 +// 3. bSrcFirst 默认时,优先处理srcImg, srcImg-->dstImg +// 否则,优先处理dstImg, dstImg——>dstImg + +//输出: 1. qbData 含亮度变化后图像的情报数据结构体 +// 2. 返回值:处理成功返回true,失败返回false +//说明: 首先判断图像数据有效性标识位,无效时直接返回,不做任何处理; +IMGPROCESS_API bool DoIntensityCtrl(QBStru *qbData, + int degree = 10, + bool bSrcFirst = true); + + +//2.2 功能:图像亮度控制(函数重载) +//输入: 1. src 输入图像结构体 +// 2. degree 控制亮度,有效范围【0,20】,值越小越暗,越大越亮 + +//输出: 1. dst 输出图像结构体 +// 2. 返回值:处理成功返回true,失败返回false +IMGPROCESS_API bool DoIntensityCtrl(ImgStru* src, + ImgStru* dst, + int degree = 10); + + + +// 3. 图像对比度控制 算法:王家星 + +//3.1 功能:图像对比度控制 +//输入: 1. qbData 通用情报数据结构体 +// 2. degree 控制对比度 +// 3. bSrcFirst 默认时,优先处理srcImg, srcImg-->dstImg +// 否则,优先处理dstImg,dstImg——>dstImg + +//输出: 1. qbData 含对比度变化后图像的情报数据结构体 +// 2. 返回值:处理成功返回true,失败返回false +//说明: 首先判断图像数据有效性标识位,无效时直接返回,不做任何处理; +IMGPROCESS_API bool DoContrastCtrl(QBStru *qbData, + int degree = 10, + bool bSrcFirst = true); + +//3.2 功能:图像对比度控制(函数重载) +//输入: 1. src 输入图像结构体 +// 2. degree 对比度亮度,有效范围【0,20】,值越大对比度越强 + +//输出: 1. dst 输出图像结构体 +// 2. 返回值:处理成功返回true,失败返回false +IMGPROCESS_API bool DoContrastCtrl(ImgStru* src, + ImgStru* dst, + int degree = 10); + + +// 4. 图像清晰度 + +//4.1 功能:图像清晰度控制 +//输入: 1. qbData 通用情报数据结构体 +// 2. degree 控制清晰度 +// 3. bSrcFirst 默认时,优先处理srcImg, srcImg-->dstImg +// 否则,优先处理dstImg,dstImg——>dstImg + +//输出: 1. qbData 含清晰度变化后图像的情报数据结构体 +// 2. 返回值:处理成功返回true,失败返回false +//说明: 首先判断图像数据有效性标识位,无效时直接返回,不做任何处理; +IMGPROCESS_API bool DoDefinitionCtrl(QBStru *qbData, + int degree = 10, + bool bSrcFirst = true); + + +//4.2 功能:图像清晰度控制(函数重载) +//输入: 1. src 输入图像结构体 +// 2. degree 清晰度控制,有效范围【0,20】,值越大清晰度越好 + +//输出: 1. dst 输出图像结构体 +// 2. 返回值:处理成功返回true,失败返回false +IMGPROCESS_API bool DoDefinitionCtrl(ImgStru* src, + ImgStru* dst, + int degree = 10); + + +// 5. 单帧图像目标定位 算法:王家星 + +//5.1 功能:计算图像中心点经纬度坐标、载荷等效俯仰角和方位角 +//输入: 1. frame 输入复接数据 +// +//输出: 1. Lon 图像中心点经度 +// 2. Lat: 图像中心点纬度 +// 3. 返回值:处理成功返回true,失败返回false +IMGPROCESS_API bool DoCalImgCenterCoordinate(double &Lon, + double &Lat, + double &H, + const struQB_FJ *frame); + + +//5.2 功能:计算图像中任意点经纬度坐标 +//输入: 1. frame 输入复接数据 +// 2. pt_x: 列 +// 3. pt_y: 行 +// +//输出: 1. Lon 经度 +// 2. Lat: 纬度 +// 3. 返回值:处理成功返回true,失败返回false +IMGPROCESS_API bool DoCalAnyPtCoordinate(double &Lon, + double &Lat, + double &H, + const struQB_FJ *frame, + int pt_x, + int pt_y); + + +// 6. 几何校正 算法:王家星 + +//6.1 功能:基于复接数据的图像系统级几何校正 +//输入: 1. qbData 通用情报数据结构体 +// 2. bSrcFirst 默认时,优先对srcImg进行几何校正,否则对dstImg进行几何校正 + +//输出: 1. qbData 含系统级几何校正后图像的情报数据结构体 +// 2. 返回值:处理成功返回true,失败返回false +IMGPROCESS_API bool DoSysGeoCorrect(QBStru *qbData, + bool bSrcFirst = true); + + +//6.2 功能:基于复接数据的图像系统级几何校正(重载) +//输入: 1. srcImg 输入图像数据 +// 2. qbData 输入复接数据 + +//输出: 1. dstImg 输出图像数据 +// 2. 返回值:处理成功返回true,失败返回false +IMGPROCESS_API bool DoSysGeoCorrect(ImgStru *dstImg, + const ImgStru *srcImg, + const struQB_FJ *qbData); + + +//6.3 功能:基于地面控制点的几何精校正 +//输入: 1. srcImg 输入图像数据 +// 2. GCP_XY 控制点(像素坐标) +// 3. GCP_LonLat 控制点(经纬度坐标) +// 4. type: 变换类型 -1:自适应 0:线性 1:二次多项式 + +//输出: 1. dstImg 输出图像数据 +// 2. 返回值:处理成功返回true,失败返回false +IMGPROCESS_API bool DoGCPGeoCorrectImg(ImgStru *dstImg, + const ImgStru *srcImg, + const std::vector& GCP_XY, + const std::vector& GCP_LonLat, + int type = -1); + + +//6.4 功能: OpenCV图像格式基于地面控制点的几何精校正 +//输入: 1. srcImg 输入图像数据 +// 2. GCP_XY 控制点(像素坐标) +// 3. GCP_LonLat 控制点(经纬度坐标) +// 4. type: 变换类型 -1:自适应 0:线性 1:二次多项式 + +//输出: 1. dstImg 输出图像数据 +// 2. LBbox 经纬度边界 +// 3. 返回值:处理成功返回true,失败返回false +IMGPROCESS_API bool DoGCPGeoCorrectImg( cv::Mat& dstImg, + GeoBoundingBox& LBbox, + const cv::Mat& srcImg, + const std::vector& GCP_XY, + const std::vector& GCP_LonLat, + int type = -1); + + +//6.5 功能:基于控制点的几何校正 +//输入: 1. srcImg 输入图像数据 +// 2. GCP_xy 控制点(畸变像素坐标) +// 3. GCP_XY 控制点(参考图像像素坐标) + +//输出: 1. dstImg 输出图像数据 +// 2. 返回值:处理成功返回true,失败返回false +IMGPROCESS_API bool DoCPBasedImgCorrect( cv::Mat &dstImg, + const cv::Mat &srcImg, + const std::vector& GCP_xy, + const std::vector& GCP_XY); + + +// 7. GeoTIFF文件生成保存 算法:王家星 + +//7.1 功能:保存情报数据至本地文件(GeoTiff格式) +//输入: 1. qbData 通用情报数据结构体 +// 2. savePath Tiff文件保存路径 + +//输出: 1. 返回值:保存成功返回true,失败返回false +//说明: 可能会先执行几何校正操作,再保存; +IMGPROCESS_API bool SaveToGeoTIFF(QBStru *qbData, + string savePath = ""); + + +//7.2 功能:保存图像数据至本地文件(GeoTiff格式) +//输入: 1. Img 通用情报数据结构体 +// 2. savePath Tiff文件保存路径 + +//输出: 1. 返回值:保存成功返回true,失败返回false +IMGPROCESS_API bool SaveToGeoTIFF(const ImgStru *Img, + string savePath = ""); + + +//7.3 功能:保存图像数据至本地文件(GeoTiff格式) +//输入: 1. Img OpenCV图像 +// 2. LBbox 经纬度边界 +// 3. savePath Tiff文件保存路径 + + +//输出: 1. 返回值:保存成功返回true,失败返回false +IMGPROCESS_API bool SaveToGeoTIFF(cv::Mat& Img, + GeoBoundingBox& LBbox, + string savePath = ""); + + + + +// 8. 距离、方位量算 算法:王家星 + +//8.1 功能:计算图像(几何校正前)中两点间的距离和方位(重载) +//输入: 1. frameData 通用复接数据结构体 +// 2. pt1 起点(像素坐标) +// 3. pt2 终点(像素坐标) + +//输出: 1. distance 距离 +// 2. azAngle 方位,起点点到终点 +// 3. 返回值:计算有效返回true,否则返回false +IMGPROCESS_API bool CalculateTwoPtsDistanceAzimuth( double &distance, + double &azAngle, + const struQB_FJ *frameData, + cv::Point pt1, + cv::Point pt2); + +//8.2 功能:计算图像中两点间的距离和方位 +//输入: 1. qbData 通用情报数据结构体 +// 2. pt1 起点(像素坐标) +// 3. pt2 终点(像素坐标) +// 4. flags:flags = 0:标识pt1、pt2为几何校正前图像中的点 +// flags = 1:标识pt1、pt2为几何校正后图像中的点 + +//输出: 1. distance 距离 +// 2. azAngle 方位,起点点到终点 +// 3. 返回值:计算有效返回true,否则返回false +IMGPROCESS_API bool CalculateTwoPtsDistanceAzimuth( double &distance, + double &azAngle, + const QBStru *qbData, + cv::Point pt1, + cv::Point pt2, + int flags = 0); + + + + +// 9. 面积量算 算法:王家星 + +//9.1 功能:计算图像(几何校正前)中多点组成的多边形面积 +//输入: 1. frameData 复接数据 +// 2. points 指向点坐标的指针 +// 3. count: 点数目 + +//输出: 1. area :多边形面积 +// 2. 返回值:计算有效返回true,否则返回false +IMGPROCESS_API bool CalculatePloygonArea(double &area, + const struQB_FJ *frameData, + cv::Point *points, + int count); + +//9.2 功能:计算图像中多边形面积 +//输入: 1. qbData 通用情报数据结构体 +// 2. point 多点指针(像素坐标) +// 3. count 点数目 +// 4. flags:flags = 0:标识为几何校正前图像中的点 +// flags = 1:标识为几何校正后图像中的点 + +//输出: 1. area 面积(平方米) +// 2. 返回值:计算有效返回true,否则返回false +//说明: 各点应为顺序或者逆序,不能乱序 +IMGPROCESS_API bool CalculatePloygonArea(double &area, + const QBStru *qbData, + cv::Point* point, + int count, + int flags = 0); + +//10 功能:基于经纬度读取地面高程 +//输入: +// 1. fLonDeg: 经度(度) +// 2. fLatDeg: 纬度(度) +// 3. sDir: 高程数据文件存储路径, 默认设为:"D:\\ElevationData" +// +//输出: +// 1. fElevator:高程(米) +// +//返回值:若函数运行成功,返回true,否则返回false +IMGPROCESS_API bool GetElevation( float& fElevator, double dLonDeg, double dLatDeg, string sDir, bool bNearst = false); +IMGPROCESS_API void ClearDem(); + +// 11 图像融合算法 + +// 11.1 功能:函数 DoFastFuseImgRGBplusIR() 快速融合两幅输入图像 +// 输入: +// img1: 输入图像1:RGB:三通道 +// img2: 输入图像2:IR:三通道或单通道 +// 输出: +// dst: 融合图像 +// 返回值: +// 运算有效返回true,否则返回false +IMGPROCESS_API bool DoFastFuseImgRGBplusIR(cv::Mat &dst, const cv::Mat RGBimg, const cv::Mat IRimg); + + +// 11.2 功能:函数 DoFuseImgRGBplusIR() 基于小波变换融合两幅输入图像 +// 输入: +// img1: 输入图像1:RGB:三通道 +// img2: 输入图像2:IR:三通道或单通道 +// wname: 小波名称 +// 支持小波: +// 1. haar +// 2. symN [1, 10] +// 3. dbN [1, 10] +// 4. coifN [1, 5] +// level:小波分解层数 +// 输出: +// dst: 融合图像 +// 返回值: +// 运算有效返回true,否则返回false +IMGPROCESS_API bool DoFuseImgRGBplusIR(cv::Mat &dst, const cv::Mat RGBimg, const cv::Mat IRimg, const string wname = "sym5", const unsigned int level = 10); + + + +// 11.3 功能:函数 FuseImg() 基于小波变换融合两幅输入图像 +// 输入: +// img1: 输入图像1 +// img2: 输入图像2 +// wname: 小波名称 +// 支持小波: +// 1. haar +// 2. symN [1, 10] +// 3. dbN [1, 10] +// 4. coifN [1, 10] +// level:小波分解层数 +// 输出: +// dst: 融合图像 +// 返回值: +// 运算有效返回true,否则返回false +IMGPROCESS_API bool DoFuseImg(cv::Mat &dst, const cv::Mat img1, const cv::Mat img2, const string wname = "sym5", const unsigned int level = 10); + + +// 12 超分重建 +// 功能:灰度图像(红外图像)超分辨率构建 +// 输入: +// imgDeque: 输入图像序列,要求图像尺寸相同,类型为CV_8UC1 +// 输出: +// dst: 输出超分图像 +// 返回重建中有效的图像数目 +IMGPROCESS_API int GetSuperResolutionImg(cv::Mat &dst, const std::deque &imgDeque, double multiple = 2); + + +#endif \ No newline at end of file diff --git a/Src/.gitignore b/Src/.gitignore new file mode 100644 index 0000000..742e971 --- /dev/null +++ b/Src/.gitignore @@ -0,0 +1,250 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +[Xx]64/ +[Xx]86/ +[Bb]uild/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml + +# TODO: Un-comment the next line if you do not want to checkin +# your web deploy settings because they may include unencrypted +# passwords +#*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# LightSwitch generated files +GeneratedArtifacts/ +ModelManifest.xml + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ + +#klocwork +.klocwork/ +#GIS +GISControlDlg20140626/ +.cpptest/ +.parasoft +.parasoft.dat/ diff --git a/Src/CH91PayloadSoftware.sln b/Src/CH91PayloadSoftware.sln new file mode 100644 index 0000000..318d72c --- /dev/null +++ b/Src/CH91PayloadSoftware.sln @@ -0,0 +1,32 @@ +锘 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34728.123 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CH91PayloadSoftware", "CH91PayloadSoftware\CH91PayloadSoftware.vcxproj", "{89E02284-2466-4FFA-B5D4-12173645A4F1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Decoder_H264_ALL", "Decoder_H264_ALL\Decoder_H264_ALL.vcxproj", "{5756743E-2CA9-41B7-A71D-0A4044E2F1A0}" +EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "FH98ViewOnPlane_Setup", "FH98ViewOnPlane_Setup\FH98ViewOnPlane_Setup.vdproj", "{DD324AC4-6BFF-4572-96FE-4BB937DDC038}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {89E02284-2466-4FFA-B5D4-12173645A4F1}.Debug|Win32.ActiveCfg = Debug|Win32 + {89E02284-2466-4FFA-B5D4-12173645A4F1}.Debug|Win32.Build.0 = Debug|Win32 + {89E02284-2466-4FFA-B5D4-12173645A4F1}.Release|Win32.ActiveCfg = Release|Win32 + {89E02284-2466-4FFA-B5D4-12173645A4F1}.Release|Win32.Build.0 = Release|Win32 + {5756743E-2CA9-41B7-A71D-0A4044E2F1A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {5756743E-2CA9-41B7-A71D-0A4044E2F1A0}.Debug|Win32.Build.0 = Debug|Win32 + {5756743E-2CA9-41B7-A71D-0A4044E2F1A0}.Release|Win32.ActiveCfg = Release|Win32 + {5756743E-2CA9-41B7-A71D-0A4044E2F1A0}.Release|Win32.Build.0 = Release|Win32 + {DD324AC4-6BFF-4572-96FE-4BB937DDC038}.Debug|Win32.ActiveCfg = Debug + {DD324AC4-6BFF-4572-96FE-4BB937DDC038}.Release|Win32.ActiveCfg = Release + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Src/CH91PayloadSoftware/BCMenu.cpp b/Src/CH91PayloadSoftware/BCMenu.cpp new file mode 100644 index 0000000..c63d8e1 --- /dev/null +++ b/Src/CH91PayloadSoftware/BCMenu.cpp @@ -0,0 +1,3101 @@ +//************************************************************************* +// BCMenu.cpp : implementation file +// Version : 3.02 +// Date : March 2002 +// Author : Brent Corkum +// Email : corkum@rocscience.com +// Latest Version : http://www.rocscience.com/~corkum/BCMenu.html +// +// Bug Fixes and portions of code supplied by: +// +// Ben Ashley,Girish Bharadwaj,Jean-Edouard Lachand-Robert, +// Robert Edward Caldecott,Kenny Goers,Leonardo Zide, +// Stefan Kuhr,Reiner Jung,Martin Vladic,Kim Yoo Chul, +// Oz Solomonovich,Tongzhe Cui,Stephane Clog,Warren Stevens, +// Damir Valiulin,David Kinder,Marc Loiry +// +// You are free to use/modify this code but leave this header intact. +// This class is public domain so you are free to use it any of +// your applications (Freeware,Shareware,Commercial). All I ask is +// that you let me know so that if you have a real winner I can +// brag to my buddies that some of my code is in your app. I also +// wouldn't mind if you sent me a copy of your application since I +// like to play with new stuff. +//************************************************************************* + +#include "stdafx.h" // Standard windows header file +#include "BCMenu.h" // BCMenu class declaration +#include //SK: makes A2W and other spiffy AFX macros work + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +#define BCMENU_GAP 1 +#ifndef OBM_CHECK +#define OBM_CHECK 32760 // from winuser.h +#endif + +#if _MFC_VER <0x400 +#error This code does not work on Versions of MFC prior to 4.0 +#endif + +static CPINFO CPInfo; +// how the menu's are drawn in win9x/NT/2000 +UINT BCMenu::original_drawmode=BCMENU_DRAWMODE_ORIGINAL; +BOOL BCMenu::original_select_disabled=TRUE; +// how the menu's are drawn in winXP +UINT BCMenu::xp_drawmode=BCMENU_DRAWMODE_XP; +BOOL BCMenu::xp_select_disabled=FALSE; +BOOL BCMenu::xp_draw_3D_bitmaps=TRUE; + +CImageList BCMenu::m_AllImages; +CArray BCMenu::m_AllImagesID; + +enum Win32Type{ + Win32s, + WinNT3, + Win95, + Win98, + WinME, + WinNT4, + Win2000, + WinXP +}; + + +Win32Type IsShellType() +{ + Win32Type ShellType; + DWORD winVer; + OSVERSIONINFO *osvi; + + winVer=GetVersion(); + if(winVer<0x80000000){/*NT */ + ShellType=WinNT3; + osvi= (OSVERSIONINFO *)malloc(sizeof(OSVERSIONINFO)); + if (osvi!=NULL){ + memset(osvi,0,sizeof(OSVERSIONINFO)); + osvi->dwOSVersionInfoSize=sizeof(OSVERSIONINFO); + GetVersionEx(osvi); + if(osvi->dwMajorVersion==4L)ShellType=WinNT4; + else if(osvi->dwMajorVersion==5L&&osvi->dwMinorVersion==0L)ShellType=Win2000; + else if(osvi->dwMajorVersion==5L&&osvi->dwMinorVersion==1L)ShellType=WinXP; + free(osvi); + } + } + else if (LOBYTE(LOWORD(winVer))<4) + ShellType=Win32s; + else{ + ShellType=Win95; + osvi= (OSVERSIONINFO *)malloc(sizeof(OSVERSIONINFO)); + if (osvi!=NULL){ + memset(osvi,0,sizeof(OSVERSIONINFO)); + osvi->dwOSVersionInfoSize=sizeof(OSVERSIONINFO); + GetVersionEx(osvi); + if(osvi->dwMajorVersion==4L&&osvi->dwMinorVersion==10L)ShellType=Win98; + else if(osvi->dwMajorVersion==4L&&osvi->dwMinorVersion==90L)ShellType=WinME; + free(osvi); + } + } + return ShellType; +} + +static Win32Type g_Shell=IsShellType(); + +void BCMenuData::SetAnsiString(LPCSTR szAnsiString) +{ + USES_CONVERSION; + SetWideString(A2W(szAnsiString)); //SK: see MFC Tech Note 059 +} + +CString BCMenuData::GetString(void)//returns the menu text in ANSI or UNICODE +//depending on the MFC-Version we are using +{ + CString strText; + if (m_szMenuText) + { +#ifdef UNICODE + strText = m_szMenuText; +#else + USES_CONVERSION; + strText=W2A(m_szMenuText); //SK: see MFC Tech Note 059 +#endif + } + return strText; +} + +CTypedPtrArray BCMenu::m_AllSubMenus; // Stores list of all sub-menus + +IMPLEMENT_DYNAMIC( BCMenu, CMenu ) + +/* +=============================================================================== +BCMenu::BCMenu() +BCMenu::~BCMenu() +----------------- + +Constructor and Destructor. + +=============================================================================== +*/ + +BCMenu::BCMenu() +{ + m_bDynIcons = FALSE; // O.S. - no dynamic icons by default + disable_old_style=FALSE; + m_iconX = 16; // Icon sizes default to 16 x 16 + m_iconY = 15; // ... + m_selectcheck = -1; + m_unselectcheck = -1; + checkmaps=NULL; + checkmapsshare=FALSE; + // set the color used for the transparent background in all bitmaps + m_bitmapBackground=RGB(192,192,192); //gray + m_bitmapBackgroundFlag=FALSE; + GetCPInfo(CP_ACP,&CPInfo); + m_loadmenu=FALSE; +} + + +BCMenu::~BCMenu() +{ + DestroyMenu(); +} + +BOOL BCMenu::IsNewShell () +{ + return (g_Shell>=Win95); +} + +BOOL BCMenu::IsWinXPLuna() +{ + if(g_Shell==WinXP){ + if(IsWindowsClassicTheme())return(FALSE); + else return(TRUE); + } + return(FALSE); +} + +BOOL BCMenu::IsLunaMenuStyle() +{ + if(IsWinXPLuna()){ + if(xp_drawmode==BCMENU_DRAWMODE_XP)return(TRUE); + } + else{ + if(original_drawmode==BCMENU_DRAWMODE_XP)return(TRUE); + } + return(FALSE); +} + +BCMenuData::~BCMenuData() +{ + if(bitmap) + delete(bitmap); + + delete[] m_szMenuText; //Need not check for NULL because ANSI X3J16 allows "delete NULL" +} + + +void BCMenuData::SetWideString(const wchar_t *szWideString) +{ + delete[] m_szMenuText;//Need not check for NULL because ANSI X3J16 allows "delete NULL" + + if (szWideString) + { + m_szMenuText = new wchar_t[sizeof(wchar_t)*(wcslen(szWideString)+1)]; + if (m_szMenuText) + wcscpy(m_szMenuText,szWideString); + } + else + m_szMenuText=NULL;//set to NULL so we need not bother about dangling non-NULL Ptrs +} + +BOOL BCMenu::IsMenu(CMenu *submenu) +{ + int m; + int numSubMenus = m_AllSubMenus.GetUpperBound(); + for(m=0;m<=numSubMenus;++m){ + if(submenu->m_hMenu==m_AllSubMenus[m])return(TRUE); + } + return(FALSE); +} + +BOOL BCMenu::IsMenu(HMENU submenu) +{ + int m; + int numSubMenus = m_AllSubMenus.GetUpperBound(); + for(m=0;m<=numSubMenus;++m){ + if(submenu==m_AllSubMenus[m])return(TRUE); + } + return(FALSE); +} + +BOOL BCMenu::DestroyMenu() +{ + // Destroy Sub menus: + int m,n; + int numAllSubMenus = m_AllSubMenus.GetUpperBound(); + for(n = numAllSubMenus; n>= 0; n--){ + if(m_AllSubMenus[n]==this->m_hMenu)m_AllSubMenus.RemoveAt(n); + } + int numSubMenus = m_SubMenus.GetUpperBound(); + for(m = numSubMenus; m >= 0; m--){ + numAllSubMenus = m_AllSubMenus.GetUpperBound(); + for(n = numAllSubMenus; n>= 0; n--){ + if(m_AllSubMenus[n]==m_SubMenus[m])m_AllSubMenus.RemoveAt(n); + } + CMenu *ptr=FromHandle(m_SubMenus[m]); + BOOL flag=ptr->IsKindOf(RUNTIME_CLASS( BCMenu )); + if(flag)delete((BCMenu *)ptr); + } + m_SubMenus.RemoveAll(); + // Destroy menu data + int numItems = m_MenuList.GetUpperBound(); + for(m = 0; m <= numItems; m++)delete(m_MenuList[m]); + m_MenuList.RemoveAll(); + if(checkmaps&&!checkmapsshare){ + delete checkmaps; + checkmaps=NULL; + } + // Call base-class implementation last: + return(CMenu::DestroyMenu()); +}; + +int BCMenu::GetMenuDrawMode(void) +{ + if(IsWinXPLuna())return(xp_drawmode); + return(original_drawmode); +} + +BOOL BCMenu::GetSelectDisableMode(void) +{ + if(IsLunaMenuStyle())return(xp_select_disabled); + return(original_select_disabled); +} + + +/* +========================================================================== +void BCMenu::DrawItem(LPDRAWITEMSTRUCT) +--------------------------------------- + + Called by the framework when a particular item needs to be drawn. We + overide this to draw the menu item in a custom-fashion, including icons + and the 3D rectangle bar. + ========================================================================== +*/ + +void BCMenu::DrawItem (LPDRAWITEMSTRUCT lpDIS) +{ + ASSERT(lpDIS != NULL); + CDC* pDC = CDC::FromHandle(lpDIS->hDC); + if(pDC->GetDeviceCaps(RASTERCAPS) & RC_PALETTE)DrawItem_Win9xNT2000(lpDIS); + else{ + if(IsWinXPLuna()){ + if(xp_drawmode==BCMENU_DRAWMODE_XP) DrawItem_WinXP(lpDIS); + else DrawItem_Win9xNT2000(lpDIS); + } + else{ + if(original_drawmode==BCMENU_DRAWMODE_XP) DrawItem_WinXP(lpDIS); + else DrawItem_Win9xNT2000(lpDIS); + } + } +} + +void BCMenu::DrawItem_Win9xNT2000 (LPDRAWITEMSTRUCT lpDIS) +{ + ASSERT(lpDIS != NULL); + CDC* pDC = CDC::FromHandle(lpDIS->hDC); + CRect rect; + UINT state = (((BCMenuData*)(lpDIS->itemData))->nFlags); + CBrush m_brBackground; + COLORREF m_clrBack; + + if(IsWinXPLuna())m_clrBack=GetSysColor(COLOR_3DFACE); + else m_clrBack=GetSysColor(COLOR_MENU); + + m_brBackground.CreateSolidBrush(m_clrBack); + + // remove the selected bit if it's grayed out + if(lpDIS->itemState & ODS_GRAYED&&!original_select_disabled){ + if(lpDIS->itemState & ODS_SELECTED)lpDIS->itemState=lpDIS->itemState & ~ODS_SELECTED; + } + + if(state & MF_SEPARATOR){ + rect.CopyRect(&lpDIS->rcItem); + pDC->FillRect (rect,&m_brBackground); + rect.top += (rect.Height()>>1); + pDC->DrawEdge(&rect,EDGE_ETCHED,BF_TOP); + } + else{ + CRect rect2; + BOOL standardflag=FALSE,selectedflag=FALSE,disableflag=FALSE; + BOOL checkflag=FALSE; + COLORREF crText = GetSysColor(COLOR_MENUTEXT); + CBrush m_brSelect; + CPen m_penBack; + int x0,y0,dy; + int nIconNormal=-1,xoffset=-1,global_offset=-1; + CImageList *bitmap=NULL; + + // set some colors + m_penBack.CreatePen (PS_SOLID,0,m_clrBack); + m_brSelect.CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT)); + + // draw the colored rectangle portion + + rect.CopyRect(&lpDIS->rcItem); + rect2=rect; + + // draw the up/down/focused/disabled state + + UINT state = lpDIS->itemState; + CString strText; + + if(lpDIS->itemData != NULL){ + nIconNormal = (((BCMenuData*)(lpDIS->itemData))->menuIconNormal); + xoffset = (((BCMenuData*)(lpDIS->itemData))->xoffset); + global_offset = (((BCMenuData*)(lpDIS->itemData))->global_offset); + bitmap = (((BCMenuData*)(lpDIS->itemData))->bitmap); + strText = ((BCMenuData*) (lpDIS->itemData))->GetString(); + + if(nIconNormal<0&&global_offset>=0){ + xoffset=global_offset; + nIconNormal=0; + bitmap = &m_AllImages; + } + + if(state&ODS_CHECKED && nIconNormal<0){ + if(state&ODS_SELECTED && m_selectcheck>0)checkflag=TRUE; + else if(m_unselectcheck>0) checkflag=TRUE; + } + else if(nIconNormal != -1){ + standardflag=TRUE; + if(state&ODS_SELECTED && !(state&ODS_GRAYED))selectedflag=TRUE; + else if(state&ODS_GRAYED) disableflag=TRUE; + } + } + else{ + strText.Empty(); + } + + if(state&ODS_SELECTED){ // draw the down edges + + CPen *pOldPen = pDC->SelectObject (&m_penBack); + + // You need only Text highlight and thats what you get + + if(checkflag||standardflag||selectedflag||disableflag||state&ODS_CHECKED) + rect2.SetRect(rect.left+m_iconX+4+BCMENU_GAP,rect.top,rect.right,rect.bottom); + pDC->FillRect (rect2,&m_brSelect); + + pDC->SelectObject (pOldPen); + crText = GetSysColor(COLOR_HIGHLIGHTTEXT); + } + else { + CPen *pOldPen = pDC->SelectObject (&m_penBack); + pDC->FillRect (rect,&m_brBackground); + pDC->SelectObject (pOldPen); + + // draw the up edges + pDC->Draw3dRect (rect,m_clrBack,m_clrBack); + } + + // draw the text if there is any + //We have to paint the text only if the image is nonexistant + + dy = (rect.Height()-4-m_iconY)/2; + dy = dy<0 ? 0 : dy; + + if(checkflag||standardflag||selectedflag||disableflag){ + rect2.SetRect(rect.left+1,rect.top+1+dy,rect.left+m_iconX+3, + rect.top+m_iconY+3+dy); + pDC->Draw3dRect (rect2,m_clrBack,m_clrBack); + if(checkflag && checkmaps){ + pDC->FillRect (rect2,&m_brBackground); + rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4, + rect.top+m_iconY+4+dy); + + pDC->Draw3dRect (rect2,m_clrBack,m_clrBack); + CPoint ptImage(rect.left+2,rect.top+2+dy); + + if(state&ODS_SELECTED)checkmaps->Draw(pDC,1,ptImage,ILD_TRANSPARENT); + else checkmaps->Draw(pDC,0,ptImage,ILD_TRANSPARENT); + } + else if(disableflag){ + if(!selectedflag){ + CBitmap bitmapstandard; + GetBitmapFromImageList(pDC,bitmap,xoffset,bitmapstandard); + rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4, + rect.top+m_iconY+4+dy); + pDC->Draw3dRect (rect2,m_clrBack,m_clrBack); + if(disable_old_style) + DitherBlt(lpDIS->hDC,rect.left+2,rect.top+2+dy,m_iconX,m_iconY, + (HBITMAP)(bitmapstandard),0,0,m_clrBack); + else + DitherBlt2(pDC,rect.left+2,rect.top+2+dy,m_iconX,m_iconY, + bitmapstandard,0,0,m_clrBack); + bitmapstandard.DeleteObject(); + } + } + else if(selectedflag){ + pDC->FillRect (rect2,&m_brBackground); + rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4, + rect.top+m_iconY+4+dy); + if (IsNewShell()){ + if(state&ODS_CHECKED) + pDC->Draw3dRect(rect2,GetSysColor(COLOR_3DSHADOW), + GetSysColor(COLOR_3DHILIGHT)); + else + pDC->Draw3dRect(rect2,GetSysColor(COLOR_3DHILIGHT), + GetSysColor(COLOR_3DSHADOW)); + } + CPoint ptImage(rect.left+2,rect.top+2+dy); + if(bitmap)bitmap->Draw(pDC,xoffset,ptImage,ILD_TRANSPARENT); + } + else{ + if(state&ODS_CHECKED){ + CBrush brush; + COLORREF col = m_clrBack; + col = LightenColor(col,0.6); + brush.CreateSolidBrush(col); + pDC->FillRect(rect2,&brush); + brush.DeleteObject(); + rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4, + rect.top+m_iconY+4+dy); + if (IsNewShell()) + pDC->Draw3dRect(rect2,GetSysColor(COLOR_3DSHADOW), + GetSysColor(COLOR_3DHILIGHT)); + } + else{ + pDC->FillRect (rect2,&m_brBackground); + rect2.SetRect(rect.left,rect.top+dy,rect.left+m_iconX+4, + rect.top+m_iconY+4+dy); + pDC->Draw3dRect (rect2,m_clrBack,m_clrBack); + } + CPoint ptImage(rect.left+2,rect.top+2+dy); + if(bitmap)bitmap->Draw(pDC,xoffset,ptImage,ILD_TRANSPARENT); + } + } + if(nIconNormal<0 && state&ODS_CHECKED && !checkflag){ + rect2.SetRect(rect.left+1,rect.top+2+dy,rect.left+m_iconX+1, + rect.top+m_iconY+2+dy); + CMenuItemInfo info; + info.fMask = MIIM_CHECKMARKS; + ::GetMenuItemInfo((HMENU)lpDIS->hwndItem,lpDIS->itemID, + MF_BYCOMMAND, &info); + if(state&ODS_CHECKED || info.hbmpUnchecked) { + Draw3DCheckmark(pDC, rect2, state&ODS_SELECTED, + state&ODS_CHECKED ? info.hbmpChecked : + info.hbmpUnchecked); + } + } + + //This is needed always so that we can have the space for check marks + + x0=rect.left;y0=rect.top; + rect.left = rect.left + m_iconX + 8 + BCMENU_GAP; + + if(!strText.IsEmpty()){ + + CRect rectt(rect.left,rect.top-1,rect.right,rect.bottom-1); + + // Find tabs + + CString leftStr,rightStr; + leftStr.Empty();rightStr.Empty(); + int tablocr=strText.ReverseFind(_T('\t')); + if(tablocr!=-1){ + rightStr=strText.Mid(tablocr+1); + leftStr=strText.Left(strText.Find(_T('\t'))); + rectt.right-=m_iconX; + } + else leftStr=strText; + + int iOldMode = pDC->GetBkMode(); + pDC->SetBkMode( TRANSPARENT); + + // Draw the text in the correct colour: + + UINT nFormat = DT_LEFT|DT_SINGLELINE|DT_VCENTER; + UINT nFormatr = DT_RIGHT|DT_SINGLELINE|DT_VCENTER; + if(!(lpDIS->itemState & ODS_GRAYED)){ + pDC->SetTextColor(crText); + pDC->DrawText (leftStr,rectt,nFormat); + if(tablocr!=-1) pDC->DrawText (rightStr,rectt,nFormatr); + } + else{ + + // Draw the disabled text + if(!(state & ODS_SELECTED)){ + RECT offset = *rectt; + offset.left+=1; + offset.right+=1; + offset.top+=1; + offset.bottom+=1; + pDC->SetTextColor(GetSysColor(COLOR_BTNHILIGHT)); + pDC->DrawText(leftStr,&offset, nFormat); + if(tablocr!=-1) pDC->DrawText (rightStr,&offset,nFormatr); + pDC->SetTextColor(GetSysColor(COLOR_GRAYTEXT)); + pDC->DrawText(leftStr,rectt, nFormat); + if(tablocr!=-1) pDC->DrawText (rightStr,rectt,nFormatr); + } + else{ + // And the standard Grey text: + pDC->SetTextColor(m_clrBack); + pDC->DrawText(leftStr,rectt, nFormat); + if(tablocr!=-1) pDC->DrawText (rightStr,rectt,nFormatr); + } + } + pDC->SetBkMode( iOldMode ); + } + + m_penBack.DeleteObject(); + m_brSelect.DeleteObject(); + } + m_brBackground.DeleteObject(); +} + +COLORREF BCMenu::LightenColor(COLORREF col,double factor) +{ + if(factor>0.0&&factor<=1.0){ + BYTE red,green,blue,lightred,lightgreen,lightblue; + red = GetRValue(col); + green = GetGValue(col); + blue = GetBValue(col); + lightred = (BYTE)((factor*(255-red)) + red); + lightgreen = (BYTE)((factor*(255-green)) + green); + lightblue = (BYTE)((factor*(255-blue)) + blue); + col = RGB(lightred,lightgreen,lightblue); + } + return(col); +} + +COLORREF BCMenu::DarkenColor(COLORREF col,double factor) +{ + if(factor>0.0&&factor<=1.0){ + BYTE red,green,blue,lightred,lightgreen,lightblue; + red = GetRValue(col); + green = GetGValue(col); + blue = GetBValue(col); + lightred = (BYTE)(red-(factor*red)); + lightgreen = (BYTE)(green-(factor*green)); + lightblue = (BYTE)(blue-(factor*blue)); + col = RGB(lightred,lightgreen,lightblue); + } + return(col); +} + + +void BCMenu::DrawItem_WinXP (LPDRAWITEMSTRUCT lpDIS) +{ + ASSERT(lpDIS != NULL); + CDC* pDC = CDC::FromHandle(lpDIS->hDC); +#ifdef BCMENU_USE_MEMDC + BCMenuMemDC *pMemDC=NULL; +#endif + CRect rect,rect2; + UINT state = (((BCMenuData*)(lpDIS->itemData))->nFlags); + COLORREF m_newclrBack=GetSysColor(COLOR_3DFACE); + COLORREF m_clrBack=GetSysColor(COLOR_WINDOW); + CFont m_fontMenu,*pFont=NULL; + LOGFONT m_lf; + if(!IsWinXPLuna())m_newclrBack=LightenColor(m_newclrBack,0.25); + CBrush m_newbrBackground,m_brBackground; + m_brBackground.CreateSolidBrush(m_clrBack); + m_newbrBackground.CreateSolidBrush(m_newclrBack); + int BCMENU_PAD=4; + if(xp_draw_3D_bitmaps)BCMENU_PAD=7; + int barwidth=m_iconX+BCMENU_PAD; + + // remove the selected bit if it's grayed out + if(lpDIS->itemState & ODS_GRAYED&&!xp_select_disabled){ + if(lpDIS->itemState & ODS_SELECTED)lpDIS->itemState=lpDIS->itemState & ~ODS_SELECTED; +#ifdef BCMENU_USE_MEMDC + pMemDC=new BCMenuMemDC(pDC,&lpDIS->rcItem); + pDC = pMemDC; + ZeroMemory ((PVOID) &m_lf,sizeof (LOGFONT)); + NONCLIENTMETRICS nm; + nm.cbSize = sizeof (NONCLIENTMETRICS); + VERIFY (SystemParametersInfo(SPI_GETNONCLIENTMETRICS,nm.cbSize,&nm,0)); + m_lf = nm.lfMenuFont; + m_fontMenu.CreateFontIndirect (&m_lf); + pFont = pDC->SelectObject (&m_fontMenu); +#endif + + } + + if(state & MF_SEPARATOR){ + rect.CopyRect(&lpDIS->rcItem); + pDC->FillRect (rect,&m_brBackground); + rect2.SetRect(rect.left,rect.top,rect.left+barwidth,rect.bottom); + rect.top+=rect.Height()>>1; + rect.left = rect2.right+BCMENU_PAD; + pDC->DrawEdge(&rect,EDGE_ETCHED,BF_TOP); + pDC->FillRect (rect2,&m_newbrBackground); + pDC->Draw3dRect (rect2,m_newclrBack,m_newclrBack); + } + else{ + BOOL standardflag=FALSE,selectedflag=FALSE,disableflag=FALSE; + BOOL checkflag=FALSE; + COLORREF crText = GetSysColor(COLOR_MENUTEXT); + COLORREF crSelect = GetSysColor(COLOR_HIGHLIGHT); + COLORREF crSelectFill; + if(!IsWinXPLuna())crSelectFill=LightenColor(crSelect,0.85); + else crSelectFill=LightenColor(crSelect,0.7); + CBrush m_brSelect; + CPen m_penBack; + int x0,y0,dx,dy; + int nIconNormal=-1,xoffset=-1,global_offset=-1; + int faded_offset=1,shadow_offset=2; + CImageList *bitmap=NULL; + BOOL CanDraw3D=FALSE; + + // set some colors + m_penBack.CreatePen (PS_SOLID,0,m_clrBack); + m_brSelect.CreateSolidBrush(crSelectFill); + + // draw the colored rectangle portion + + rect.CopyRect(&lpDIS->rcItem); + rect2=rect; + + // draw the up/down/focused/disabled state + + UINT state = lpDIS->itemState; + CString strText; + + if(lpDIS->itemData != NULL){ + nIconNormal = (((BCMenuData*)(lpDIS->itemData))->menuIconNormal); + xoffset = (((BCMenuData*)(lpDIS->itemData))->xoffset); + bitmap = (((BCMenuData*)(lpDIS->itemData))->bitmap); + strText = ((BCMenuData*) (lpDIS->itemData))->GetString(); + global_offset = (((BCMenuData*)(lpDIS->itemData))->global_offset); + + if(xoffset==0&&xp_draw_3D_bitmaps&&bitmap&&bitmap->GetImageCount()>2)CanDraw3D=TRUE; + + if(nIconNormal<0&&xoffset<0&&global_offset>=0){ + xoffset=global_offset; + nIconNormal=0; + bitmap = &m_AllImages; + if(xp_draw_3D_bitmaps&&CanDraw3DImageList(global_offset)){ + CanDraw3D=TRUE; + faded_offset=global_offset+1; + shadow_offset=global_offset+2; + } + } + + + if(state&ODS_CHECKED && nIconNormal<0){ + if(state&ODS_SELECTED && m_selectcheck>0)checkflag=TRUE; + else if(m_unselectcheck>0) checkflag=TRUE; + } + else if(nIconNormal != -1){ + standardflag=TRUE; + if(state&ODS_SELECTED && !(state&ODS_GRAYED))selectedflag=TRUE; + else if(state&ODS_GRAYED) disableflag=TRUE; + } + } + else{ + strText.Empty(); + } + + if(state&ODS_SELECTED){ // draw the down edges + + CPen *pOldPen = pDC->SelectObject (&m_penBack); + + pDC->FillRect (rect,&m_brSelect); + pDC->Draw3dRect (rect,crSelect,crSelect); + + pDC->SelectObject (pOldPen); + } + else { + rect2.SetRect(rect.left,rect.top,rect.left+barwidth,rect.bottom); + CPen *pOldPen = pDC->SelectObject (&m_penBack); + pDC->FillRect (rect,&m_brBackground); + pDC->FillRect (rect2,&m_newbrBackground); + pDC->SelectObject (pOldPen); + + // draw the up edges + + pDC->Draw3dRect (rect,m_clrBack,m_clrBack); + pDC->Draw3dRect (rect2,m_newclrBack,m_newclrBack); + } + + // draw the text if there is any + //We have to paint the text only if the image is nonexistant + + dy = (int)(0.5+(rect.Height()-m_iconY)/2.0); + dy = dy<0 ? 0 : dy; + dx = (int)(0.5+(barwidth-m_iconX)/2.0); + dx = dx<0 ? 0 : dx; + + if(checkflag||standardflag||selectedflag||disableflag){ + rect2.SetRect(rect.left+1,rect.top+1,rect.left+barwidth-1, + rect.bottom-1); + if(checkflag && checkmaps){ + pDC->FillRect (rect2,&m_newbrBackground); + CPoint ptImage(rect.left+dx,rect.top+dy); + if(state&ODS_SELECTED)checkmaps->Draw(pDC,1,ptImage,ILD_TRANSPARENT); + else checkmaps->Draw(pDC,0,ptImage,ILD_TRANSPARENT); + } + else if(disableflag){ + if(!selectedflag){ + CBitmap bitmapstandard; + GetBitmapFromImageList(pDC,bitmap,xoffset,bitmapstandard); + COLORREF transparentcol=m_newclrBack; + if(state&ODS_SELECTED)transparentcol=crSelectFill; + if(disable_old_style) + DitherBlt(lpDIS->hDC,rect.left+dx,rect.top+dy,m_iconX,m_iconY, + (HBITMAP)(bitmapstandard),0,0,transparentcol); + else + DitherBlt2(pDC,rect.left+dx,rect.top+dy,m_iconX,m_iconY, + bitmapstandard,0,0,transparentcol); + if(state&ODS_SELECTED)pDC->Draw3dRect (rect,crSelect,crSelect); + bitmapstandard.DeleteObject(); + } + } + else if(selectedflag){ + pDC->FillRect (rect2,&m_brSelect); + CPoint ptImage(rect.left+dx,rect.top+dy); + if(state&ODS_CHECKED){ + pDC->Draw3dRect(rect2,crSelect,crSelect); + ptImage.x-=1;ptImage.y-=1; + } + if(bitmap){ + if(CanDraw3D&&!(state&ODS_CHECKED)){ + CPoint ptImage1(ptImage.x+1,ptImage.y+1); + CPoint ptImage2(ptImage.x-1,ptImage.y-1); + bitmap->Draw(pDC,shadow_offset,ptImage1,ILD_TRANSPARENT); + bitmap->Draw(pDC,xoffset,ptImage2,ILD_TRANSPARENT); + } + else bitmap->Draw(pDC,xoffset,ptImage,ILD_TRANSPARENT); + } + } + else{ + if(state&ODS_CHECKED){ + CBrush brushin; + brushin.CreateSolidBrush(LightenColor(crSelect,0.85)); + pDC->FillRect(rect2,&brushin); + brushin.DeleteObject(); + pDC->Draw3dRect(rect2,crSelect,crSelect); + CPoint ptImage(rect.left+dx-1,rect.top+dy-1); + if(bitmap)bitmap->Draw(pDC,xoffset,ptImage,ILD_TRANSPARENT); + } + else{ + pDC->FillRect (rect2,&m_newbrBackground); + pDC->Draw3dRect (rect2,m_newclrBack,m_newclrBack); + CPoint ptImage(rect.left+dx,rect.top+dy); + if(bitmap){ + if(CanDraw3D) + bitmap->Draw(pDC,faded_offset,ptImage,ILD_TRANSPARENT); + else + bitmap->Draw(pDC,xoffset,ptImage,ILD_TRANSPARENT); + } + } + } + } + if(nIconNormal<0 && state&ODS_CHECKED && !checkflag){ + dy = (int)(0.5+(rect.Height()-16)/2.0); + dy = dy<0 ? 0 : dy; + dx = (int)(0.5+(barwidth-16)/2.0); + dx = dx<0 ? 0 : dx; + CMenuItemInfo info; + info.fMask = MIIM_CHECKMARKS; + ::GetMenuItemInfo((HMENU)lpDIS->hwndItem,lpDIS->itemID, + MF_BYCOMMAND, &info); + if(state&ODS_CHECKED || info.hbmpUnchecked) { + rect2.SetRect(rect.left+dx,rect.top+dy,rect.left+dx+16,rect.top+dy+16); + DrawXPCheckmark(pDC, rect2,state&ODS_CHECKED ? info.hbmpChecked : + info.hbmpUnchecked,crSelect); + } + } + + //This is needed always so that we can have the space for check marks + + x0=rect.left;y0=rect.top; + rect.left = rect.left + barwidth + 8; + + if(!strText.IsEmpty()){ + + CRect rectt(rect.left,rect.top-1,rect.right,rect.bottom-1); + + // Find tabs + + CString leftStr,rightStr; + leftStr.Empty();rightStr.Empty(); + int tablocr=strText.ReverseFind(_T('\t')); + if(tablocr!=-1){ + rightStr=strText.Mid(tablocr+1); + leftStr=strText.Left(strText.Find(_T('\t'))); + rectt.right-=m_iconX; + } + else leftStr=strText; + + int iOldMode = pDC->GetBkMode(); + pDC->SetBkMode( TRANSPARENT); + + // Draw the text in the correct colour: + + UINT nFormat = DT_LEFT|DT_SINGLELINE|DT_VCENTER; + UINT nFormatr = DT_RIGHT|DT_SINGLELINE|DT_VCENTER; + if(!(lpDIS->itemState & ODS_GRAYED)){ + pDC->SetTextColor(crText); + pDC->DrawText (leftStr,rectt,nFormat); + if(tablocr!=-1) pDC->DrawText (rightStr,rectt,nFormatr); + } + else{ + RECT offset = *rectt; + offset.left+=1; + offset.right+=1; + offset.top+=1; + offset.bottom+=1; + if(!IsWinXPLuna()){ + COLORREF graycol=GetSysColor(COLOR_GRAYTEXT); + if(!(state&ODS_SELECTED))graycol = LightenColor(graycol,0.4); + pDC->SetTextColor(graycol); + } + else pDC->SetTextColor(GetSysColor(COLOR_GRAYTEXT)); + pDC->DrawText(leftStr,rectt, nFormat); + if(tablocr!=-1) pDC->DrawText (rightStr,rectt,nFormatr); + } + pDC->SetBkMode( iOldMode ); + } + + m_penBack.DeleteObject(); + m_brSelect.DeleteObject(); + } + m_brBackground.DeleteObject(); + m_newbrBackground.DeleteObject(); +#ifdef BCMENU_USE_MEMDC + if(pFont)pDC->SelectObject (pFont); //set it to the old font + m_fontMenu.DeleteObject(); + if(pMemDC)delete pMemDC; +#endif +} + +BOOL BCMenu::GetBitmapFromImageList(CDC* pDC,CImageList *imglist,int nIndex,CBitmap &bmp) +{ + HICON hIcon = imglist->ExtractIcon(nIndex); + CDC dc; + dc.CreateCompatibleDC(pDC); + bmp.CreateCompatibleBitmap(pDC,m_iconX,m_iconY); + CBitmap* pOldBmp = dc.SelectObject(&bmp); + CBrush brush ; + COLORREF m_newclrBack; + m_newclrBack=GetSysColor(COLOR_3DFACE); + brush.CreateSolidBrush(m_newclrBack); + ::DrawIconEx( + dc.GetSafeHdc(), + 0, + 0, + hIcon, + m_iconX, + m_iconY, + 0, + (HBRUSH)brush, + DI_NORMAL + ); + dc.SelectObject( pOldBmp ); + dc.DeleteDC(); + // the icon is not longer needed + ::DestroyIcon(hIcon); + return(TRUE); +} + +/* +========================================================================== +void BCMenu::MeasureItem(LPMEASUREITEMSTRUCT) +--------------------------------------------- + + Called by the framework when it wants to know what the width and height + of our item will be. To accomplish this we provide the width of the + icon plus the width of the menu text, and then the height of the icon. + + ========================================================================== +*/ + +void BCMenu::MeasureItem( LPMEASUREITEMSTRUCT lpMIS ) +{ + UINT state = (((BCMenuData*)(lpMIS->itemData))->nFlags); + int BCMENU_PAD=4; + if(IsLunaMenuStyle()&&xp_draw_3D_bitmaps)BCMENU_PAD=7; + if(state & MF_SEPARATOR){ + lpMIS->itemWidth = 0; + int temp = GetSystemMetrics(SM_CYMENU)>>1; + lpMIS->itemHeight = temp>(m_iconY+BCMENU_PAD)/2 ? temp : (m_iconY+BCMENU_PAD)/2; + } + else{ + CFont m_fontMenu; + LOGFONT m_lf; + ZeroMemory ((PVOID) &m_lf,sizeof (LOGFONT)); + NONCLIENTMETRICS nm; + nm.cbSize = sizeof (NONCLIENTMETRICS); + VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, + nm.cbSize,&nm,0)); + m_lf = nm.lfMenuFont; + m_fontMenu.CreateFontIndirect (&m_lf); + + // Obtain the width of the text: + CWnd *pWnd = AfxGetMainWnd(); // Get main window + if (pWnd == NULL) pWnd = CWnd::GetDesktopWindow(); + CDC *pDC = pWnd->GetDC(); // Get device context + CFont* pFont=NULL; // Select menu font in... + + if (IsNewShell()) + pFont = pDC->SelectObject (&m_fontMenu);// Select menu font in... + + //Get pointer to text SK + const wchar_t *lpstrText = ((BCMenuData*)(lpMIS->itemData))->GetWideString();//SK: we use const to prevent misuse + + SIZE size; + size.cx=size.cy=0; + + if (Win32s!=g_Shell) + VERIFY(::GetTextExtentPoint32W(pDC->m_hDC,lpstrText, + wcslen(lpstrText),&size)); //SK should also work on 95 +#ifndef UNICODE //can't be UNICODE for Win32s + else{//it's Win32suckx + RECT rect; + rect.left=rect.top=0; + size.cy=DrawText(pDC->m_hDC,(LPCTSTR)lpstrText, + wcslen(lpstrText),&rect, + DT_SINGLELINE|DT_LEFT|DT_VCENTER|DT_CALCRECT); + //+3 makes at least three pixels space to the menu border + size.cx=rect.right-rect.left+3; + size.cx += 3*(size.cx/wcslen(lpstrText)); + } +#endif + + CSize t = CSize(size); + if(IsNewShell()) + pDC->SelectObject (pFont); // Select old font in + pWnd->ReleaseDC(pDC); // Release the DC + + // Set width and height: + + if(IsLunaMenuStyle())lpMIS->itemWidth = m_iconX+BCMENU_PAD+8+t.cx; + else lpMIS->itemWidth = m_iconX + t.cx + m_iconX + BCMENU_GAP; + int temp = GetSystemMetrics(SM_CYMENU); + lpMIS->itemHeight = temp>m_iconY+BCMENU_PAD ? temp : m_iconY+BCMENU_PAD; + m_fontMenu.DeleteObject(); + } +} + +void BCMenu::SetIconSize (int width, int height) +{ + m_iconX = width; + m_iconY = height; +} + +BOOL BCMenu::AppendODMenuA(LPCSTR lpstrText,UINT nFlags,UINT nID, + int nIconNormal) +{ + USES_CONVERSION; + return AppendODMenuW(A2W(lpstrText),nFlags,nID,nIconNormal);//SK: See MFC Tech Note 059 +} + + +BOOL BCMenu::AppendODMenuW(wchar_t *lpstrText,UINT nFlags,UINT nID, + int nIconNormal) +{ + // Add the MF_OWNERDRAW flag if not specified: + if(!nID){ + if(nFlags&MF_BYPOSITION)nFlags=MF_SEPARATOR|MF_OWNERDRAW|MF_BYPOSITION; + else nFlags=MF_SEPARATOR|MF_OWNERDRAW; + } + else if(!(nFlags & MF_OWNERDRAW))nFlags |= MF_OWNERDRAW; + + if(nFlags & MF_POPUP){ + m_AllSubMenus.Add((HMENU)nID); + m_SubMenus.Add((HMENU)nID); + } + + BCMenuData *mdata = new BCMenuData; + m_MenuList.Add(mdata); + mdata->SetWideString(lpstrText); //SK: modified for dynamic allocation + + mdata->menuIconNormal = -1; + mdata->xoffset = -1; + + if(nIconNormal>=0){ + CImageList bitmap; + int xoffset=0; + LoadFromToolBar(nID,nIconNormal,xoffset); + if(mdata->bitmap){ + mdata->bitmap->DeleteImageList(); + mdata->bitmap=NULL; + } + bitmap.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1); + if(AddBitmapToImageList(&bitmap,nIconNormal)){ + mdata->global_offset = AddToGlobalImageList(&bitmap,xoffset,nID); + } + } + else mdata->global_offset = GlobalImageListOffset(nID); + + mdata->nFlags = nFlags; + mdata->nID = nID; + BOOL returnflag=CMenu::AppendMenu(nFlags, nID, (LPCTSTR)mdata); + if(m_loadmenu)RemoveTopLevelOwnerDraw(); + return(returnflag); +} + +BOOL BCMenu::AppendODMenuA(LPCSTR lpstrText,UINT nFlags,UINT nID, + CImageList *il,int xoffset) +{ + USES_CONVERSION; + return AppendODMenuW(A2W(lpstrText),nFlags,nID,il,xoffset); +} + +BOOL BCMenu::AppendODMenuW(wchar_t *lpstrText,UINT nFlags,UINT nID, + CImageList *il,int xoffset) +{ + // Add the MF_OWNERDRAW flag if not specified: + if(!nID){ + if(nFlags&MF_BYPOSITION)nFlags=MF_SEPARATOR|MF_OWNERDRAW|MF_BYPOSITION; + else nFlags=MF_SEPARATOR|MF_OWNERDRAW; + } + else if(!(nFlags & MF_OWNERDRAW))nFlags |= MF_OWNERDRAW; + + if(nFlags & MF_POPUP){ + m_AllSubMenus.Add((HMENU)nID); + m_SubMenus.Add((HMENU)nID); + } + + BCMenuData *mdata = new BCMenuData; + m_MenuList.Add(mdata); + mdata->SetWideString(lpstrText); //SK: modified for dynamic allocation + + if(il){ + mdata->menuIconNormal = 0; + mdata->xoffset=0; + if(mdata->bitmap)mdata->bitmap->DeleteImageList(); + else mdata->bitmap=new(CImageList); + ImageListDuplicate(il,xoffset,mdata->bitmap); + } + else{ + mdata->menuIconNormal = -1; + mdata->xoffset = -1; + } + mdata->nFlags = nFlags; + mdata->nID = nID; + return(CMenu::AppendMenu(nFlags, nID, (LPCTSTR)mdata)); +} + +BOOL BCMenu::InsertODMenuA(UINT nPosition,LPCSTR lpstrText,UINT nFlags,UINT nID, + int nIconNormal) +{ + USES_CONVERSION; + return InsertODMenuW(nPosition,A2W(lpstrText),nFlags,nID,nIconNormal); +} + + +BOOL BCMenu::InsertODMenuW(UINT nPosition,wchar_t *lpstrText,UINT nFlags,UINT nID, + int nIconNormal) +{ + if(!(nFlags & MF_BYPOSITION)){ + int iPosition =0; + BCMenu* pMenu = FindMenuOption(nPosition,iPosition); + if(pMenu){ + return(pMenu->InsertODMenuW(iPosition,lpstrText,nFlags|MF_BYPOSITION,nID,nIconNormal)); + } + else return(FALSE); + } + + if(!nID)nFlags=MF_SEPARATOR|MF_OWNERDRAW|MF_BYPOSITION; + else if(!(nFlags & MF_OWNERDRAW))nFlags |= MF_OWNERDRAW; + + int menustart=0; + + if(nFlags & MF_POPUP){ + if(m_loadmenu){ + menustart=GetMenuStart(); + if(nPosition<(UINT)menustart)menustart=0; + } + m_AllSubMenus.Add((HMENU)nID); + m_SubMenus.InsertAt(nPosition,(HMENU)nID); + } + + //Stephane Clog suggested adding this, believe it or not it's in the help + if(nPosition==(UINT)-1)nPosition=GetMenuItemCount(); + + BCMenuData *mdata = new BCMenuData; + m_MenuList.InsertAt(nPosition-menustart,mdata); + mdata->SetWideString(lpstrText); //SK: modified for dynamic allocation + + mdata->menuIconNormal = nIconNormal; + mdata->xoffset=-1; + if(nIconNormal>=0){ + CImageList bitmap; + int xoffset=0; + LoadFromToolBar(nID,nIconNormal,xoffset); + if(mdata->bitmap){ + mdata->bitmap->DeleteImageList(); + mdata->bitmap=NULL; + } + bitmap.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1); + if(AddBitmapToImageList(&bitmap,nIconNormal)){ + mdata->global_offset = AddToGlobalImageList(&bitmap,xoffset,nID); + } + } + else mdata->global_offset = GlobalImageListOffset(nID); + mdata->nFlags = nFlags; + mdata->nID = nID; + BOOL returnflag=CMenu::InsertMenu(nPosition,nFlags,nID,(LPCTSTR)mdata); + if(m_loadmenu)RemoveTopLevelOwnerDraw(); + return(returnflag); +} + +BOOL BCMenu::InsertODMenuA(UINT nPosition,LPCSTR lpstrText,UINT nFlags,UINT nID, + CImageList *il,int xoffset) +{ + USES_CONVERSION; + return InsertODMenuW(nPosition,A2W(lpstrText),nFlags,nID,il,xoffset); +} + +BOOL BCMenu::InsertODMenuW(UINT nPosition,wchar_t *lpstrText,UINT nFlags,UINT nID, + CImageList *il,int xoffset) +{ + if(!(nFlags & MF_BYPOSITION)){ + int iPosition =0; + BCMenu* pMenu = FindMenuOption(nPosition,iPosition); + if(pMenu){ + return(pMenu->InsertODMenuW(iPosition,lpstrText,nFlags|MF_BYPOSITION,nID,il,xoffset)); + } + else return(FALSE); + } + + if(!nID)nFlags=MF_SEPARATOR|MF_OWNERDRAW|MF_BYPOSITION; + else if(!(nFlags & MF_OWNERDRAW))nFlags |= MF_OWNERDRAW; + + if(nFlags & MF_POPUP){ + m_AllSubMenus.Add((HMENU)nID); + m_SubMenus.InsertAt(nPosition,(HMENU)nID); + } + + //Stephane Clog suggested adding this, believe it or not it's in the help + if(nPosition==(UINT)-1)nPosition=GetMenuItemCount(); + + BCMenuData *mdata = new BCMenuData; + m_MenuList.InsertAt(nPosition,mdata); + mdata->SetWideString(lpstrText); //SK: modified for dynamic allocation + + mdata->menuIconNormal = -1; + mdata->xoffset = -1; + + if(il){ + if(mdata->bitmap){ + mdata->bitmap->DeleteImageList(); + mdata->bitmap=NULL; + } + mdata->global_offset = AddToGlobalImageList(il,xoffset,nID); + } + mdata->nFlags = nFlags; + mdata->nID = nID; + return(CMenu::InsertMenu(nPosition,nFlags,nID,(LPCTSTR)mdata)); +} + +BOOL BCMenu::ModifyODMenuA(const char * lpstrText,UINT nID,int nIconNormal) +{ + USES_CONVERSION; + return ModifyODMenuW(A2W(lpstrText),nID,nIconNormal);//SK: see MFC Tech Note 059 +} + +BOOL BCMenu::ModifyODMenuW(wchar_t *lpstrText,UINT nID,int nIconNormal) +{ + int nLoc; + BCMenuData *mdata; + CArraybcsubs; + CArraybclocs; + + // Find the old BCMenuData structure: + BCMenu *psubmenu = FindMenuOption(nID,nLoc); + do{ + if(psubmenu && nLoc>=0)mdata = psubmenu->m_MenuList[nLoc]; + else{ + // Create a new BCMenuData structure: + mdata = new BCMenuData; + m_MenuList.Add(mdata); + } + + ASSERT(mdata); + if(lpstrText) + mdata->SetWideString(lpstrText); //SK: modified for dynamic allocation + mdata->menuIconNormal = -1; + mdata->xoffset = -1; + if(nIconNormal>=0){ + CImageList bitmap; + int xoffset=0; + LoadFromToolBar(nID,nIconNormal,xoffset); + if(mdata->bitmap){ + mdata->bitmap->DeleteImageList(); + mdata->bitmap=NULL; + } + bitmap.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1); + if(AddBitmapToImageList(&bitmap,nIconNormal)){ + mdata->global_offset = AddToGlobalImageList(&bitmap,xoffset,nID); + } + } + else mdata->global_offset = GlobalImageListOffset(nID); + mdata->nFlags &= ~(MF_BYPOSITION); + mdata->nFlags |= MF_OWNERDRAW; + mdata->nID = nID; + bcsubs.Add(psubmenu); + bclocs.Add(nLoc); + if(psubmenu && nLoc>=0)psubmenu = FindAnotherMenuOption(nID,nLoc,bcsubs,bclocs); + else psubmenu=NULL; + }while(psubmenu); + return (CMenu::ModifyMenu(nID,mdata->nFlags,nID,(LPCTSTR)mdata)); +} + +BOOL BCMenu::ModifyODMenuA(const char * lpstrText,UINT nID,CImageList *il,int xoffset) +{ + USES_CONVERSION; + return ModifyODMenuW(A2W(lpstrText),nID,il,xoffset); +} + +BOOL BCMenu::ModifyODMenuW(wchar_t *lpstrText,UINT nID,CImageList *il,int xoffset) +{ + int nLoc; + BCMenuData *mdata; + CArraybcsubs; + CArraybclocs; + + // Find the old BCMenuData structure: + BCMenu *psubmenu = FindMenuOption(nID,nLoc); + do{ + if(psubmenu && nLoc>=0)mdata = psubmenu->m_MenuList[nLoc]; + else{ + // Create a new BCMenuData structure: + mdata = new BCMenuData; + m_MenuList.Add(mdata); + } + + ASSERT(mdata); + if(lpstrText) + mdata->SetWideString(lpstrText); //SK: modified for dynamic allocation + mdata->menuIconNormal = -1; + mdata->xoffset = -1; + if(il){ + if(mdata->bitmap){ + mdata->bitmap->DeleteImageList(); + mdata->bitmap=NULL; + } + mdata->global_offset = AddToGlobalImageList(il,xoffset,nID); + } + mdata->nFlags &= ~(MF_BYPOSITION); + mdata->nFlags |= MF_OWNERDRAW; + mdata->nID = nID; + bcsubs.Add(psubmenu); + bclocs.Add(nLoc); + if(psubmenu && nLoc>=0)psubmenu = FindAnotherMenuOption(nID,nLoc,bcsubs,bclocs); + else psubmenu=NULL; + }while(psubmenu); + return (CMenu::ModifyMenu(nID,mdata->nFlags,nID,(LPCTSTR)mdata)); +} + +BOOL BCMenu::ModifyODMenuA(const char * lpstrText,UINT nID,CBitmap *bmp) +{ + USES_CONVERSION; + return ModifyODMenuW(A2W(lpstrText),nID,bmp); +} + +BOOL BCMenu::ModifyODMenuW(wchar_t *lpstrText,UINT nID,CBitmap *bmp) +{ + if(bmp){ + CImageList temp; + temp.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1); + if(m_bitmapBackgroundFlag)temp.Add(bmp,m_bitmapBackground); + else temp.Add(bmp,GetSysColor(COLOR_3DFACE)); + return ModifyODMenuW(lpstrText,nID,&temp,0); + } + return ModifyODMenuW(lpstrText,nID,NULL,0); +} + +// courtesy of Warren Stevens +BOOL BCMenu::ModifyODMenuA(const char * lpstrText,UINT nID,COLORREF fill,COLORREF border,int hatchstyle,CSize *pSize) +{ + USES_CONVERSION; + return ModifyODMenuW(A2W(lpstrText),nID,fill,border,hatchstyle,pSize); +} + +BOOL BCMenu::ModifyODMenuW(wchar_t *lpstrText,UINT nID,COLORREF fill,COLORREF border,int hatchstyle,CSize *pSize) +{ + CWnd *pWnd = AfxGetMainWnd(); // Get main window + CDC *pDC = pWnd->GetDC(); // Get device context + SIZE sz; + if(!pSize){ + sz.cx = m_iconX; + sz.cy = m_iconY; + } + else{ + sz.cx = pSize->cx; + sz.cy = pSize->cy; + } + CSize bitmap_size(sz); + CSize icon_size(m_iconX,m_iconY); + CBitmap bmp; + ColorBitmap(pDC,bmp,bitmap_size,icon_size,fill,border,hatchstyle); + pWnd->ReleaseDC(pDC); + return ModifyODMenuW(lpstrText,nID,&bmp); +} + + +BOOL BCMenu::ModifyODMenuA(const char *lpstrText,const char *OptionText, + int nIconNormal) +{ + USES_CONVERSION; + return ModifyODMenuW(A2W(lpstrText),A2W(OptionText),nIconNormal);//SK: see MFC Tech Note 059 +} + +BOOL BCMenu::ModifyODMenuW(wchar_t* lpstrText, wchar_t* OptionText, int nIconNormal) +{ + BCMenuData *mdata; + + // Find the old BCMenuData structure: + CString junk(OptionText) ; + mdata=FindMenuOption(OptionText); + if(mdata) + { + if(lpstrText) + mdata->SetWideString(lpstrText);//SK: modified for dynamic allocation + + mdata->menuIconNormal = nIconNormal; + mdata->xoffset=-1; + if(nIconNormal>=0) + { + mdata->xoffset=0; + if(mdata->bitmap)mdata->bitmap->DeleteImageList(); + else mdata->bitmap=new(CImageList); + mdata->bitmap->Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1); + if(!AddBitmapToImageList(mdata->bitmap,nIconNormal)) + { + mdata->bitmap->DeleteImageList(); + delete mdata->bitmap; + mdata->bitmap=NULL; + mdata->menuIconNormal = nIconNormal = -1; + mdata->xoffset = -1; + } + } + return(TRUE); + } + return(FALSE); +} + +BCMenuData *BCMenu::NewODMenu(UINT pos,UINT nFlags,UINT nID,CString string) +{ + BCMenuData *mdata; + + mdata = new BCMenuData; + mdata->menuIconNormal = -1; + mdata->xoffset=-1; +#ifdef UNICODE + mdata->SetWideString((LPCTSTR)string);//SK: modified for dynamic allocation +#else + mdata->SetAnsiString(string); +#endif + mdata->nFlags = nFlags; + mdata->nID = nID; + +// if(nFlags & MF_POPUP)m_AllSubMenus.Add((HMENU)nID); + + if (nFlags&MF_OWNERDRAW){ + ASSERT(!(nFlags&MF_STRING)); + ModifyMenu(pos,nFlags,nID,(LPCTSTR)mdata); + } + else if (nFlags&MF_STRING){ + ASSERT(!(nFlags&MF_OWNERDRAW)); + ModifyMenu(pos,nFlags,nID,mdata->GetString()); + } + else{ + ASSERT(nFlags&MF_SEPARATOR); + ModifyMenu(pos,nFlags,nID); + } + + return(mdata); +}; + +BOOL BCMenu::LoadToolbars(const UINT *arID,int n) +{ + ASSERT(arID); + BOOL returnflag=TRUE; + for(int i=0;im_iconX)m_iconX=iconx; + if(icony>m_iconY)m_iconY=icony; + CImageList imglist; + imglist.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1); + if(AddBitmapToImageList(&imglist,nToolBar)){ + returnflag=TRUE; + for(int i=0;i=0){ + bar.GetButtonInfo(xoffset,nID,nStyle,xset); + if(xset>0)xoffset=xset; + } + ModifyODMenu(NULL,nID,&imglist,xoffset); + } + } + } + } + return(returnflag); +} + +BOOL BCMenu::LoadFromToolBar(UINT nID,UINT nToolBar,int& xoffset) +{ + int xset,offset; + UINT nStyle; + BOOL returnflag=FALSE; + CToolBar bar; + + CWnd* pWnd = AfxGetMainWnd(); + if (pWnd == NULL)pWnd = CWnd::GetDesktopWindow(); + bar.Create(pWnd); + if(bar.LoadToolBar(nToolBar)){ + offset=bar.CommandToIndex(nID); + if(offset>=0){ + bar.GetButtonInfo(offset,nID,nStyle,xset); + if(xset>0)xoffset=xset; + returnflag=TRUE; + } + } + return(returnflag); +} + +// O.S. +BCMenuData *BCMenu::FindMenuItem(UINT nID) +{ + BCMenuData *pData = NULL; + int i; + + for(i = 0; i <= m_MenuList.GetUpperBound(); i++){ + if (m_MenuList[i]->nID == nID){ + pData = m_MenuList[i]; + break; + } + } + if (!pData){ + int loc; + BCMenu *pMenu = FindMenuOption(nID, loc); + ASSERT(pMenu != this); + if (loc >= 0){ + return pMenu->FindMenuItem(nID); + } + } + return pData; +} + + +BCMenu *BCMenu::FindAnotherMenuOption(int nId,int& nLoc,CArray&bcsubs, + CArray&bclocs) +{ + int i,numsubs,j; + BCMenu *psubmenu,*pgoodmenu; + BOOL foundflag; + + for(i=0;i<(int)(GetMenuItemCount());++i){ +#ifdef _CPPRTTI + psubmenu=dynamic_cast(GetSubMenu(i)); +#else + psubmenu=(BCMenu *)GetSubMenu(i); +#endif + if(psubmenu){ + pgoodmenu=psubmenu->FindAnotherMenuOption(nId,nLoc,bcsubs,bclocs); + if(pgoodmenu)return(pgoodmenu); + } + else if(nId==(int)GetMenuItemID(i)){ + numsubs=bcsubs.GetSize(); + foundflag=TRUE; + for(j=0;j(GetSubMenu(i)); +#else + psubmenu=(BCMenu *)GetSubMenu(i); +#endif + if(psubmenu){ + pgoodmenu=psubmenu->FindMenuOption(nId,nLoc); + if(pgoodmenu)return(pgoodmenu); + } + else if(nId==(int)GetMenuItemID(i)){ + nLoc=i; + return(this); + } + } + nLoc = -1; + return(NULL); +} + +BCMenuData *BCMenu::FindMenuOption(wchar_t *lpstrText) +{ + int i,j; + BCMenu *psubmenu; + BCMenuData *pmenulist; + + for(i=0;i<(int)(GetMenuItemCount());++i){ +#ifdef _CPPRTTI + psubmenu=dynamic_cast(GetSubMenu(i)); +#else + psubmenu=(BCMenu *)GetSubMenu(i); +#endif + if(psubmenu){ + pmenulist=psubmenu->FindMenuOption(lpstrText); + if(pmenulist)return(pmenulist); + } + else{ + const wchar_t *szWide;//SK: we use const to prevent misuse of this Ptr + for(j=0;j<=m_MenuList.GetUpperBound();++j){ + szWide = m_MenuList[j]->GetWideString (); + if(szWide && !wcscmp(lpstrText,szWide))//SK: modified for dynamic allocation + return(m_MenuList[j]); + } + } + } + return(NULL); +} + + +BOOL BCMenu::LoadMenu(int nResource) +{ + return(BCMenu::LoadMenu(MAKEINTRESOURCE(nResource))); +}; + +BOOL BCMenu::LoadMenu(LPCTSTR lpszResourceName) +{ + ASSERT_VALID(this); + ASSERT(lpszResourceName != NULL); + + // Find the Menu Resource: + HINSTANCE hInst = AfxFindResourceHandle(lpszResourceName,RT_MENU); + HRSRC hRsrc = ::FindResource(hInst,lpszResourceName,RT_MENU); + if (hRsrc == NULL){ + hInst = NULL; + hRsrc = ::FindResource(hInst,lpszResourceName,RT_MENU); + } + if(hRsrc == NULL)return FALSE; + + // Load the Menu Resource: + + HGLOBAL hGlobal = LoadResource(hInst, hRsrc); + if(hGlobal == NULL)return FALSE; + + // first destroy the menu if we're trying to loadmenu again + DestroyMenu(); + + // Attempt to create us as a menu... + if(!CMenu::CreateMenu())return FALSE; + + // Get Item template Header, and calculate offset of MENUITEMTEMPLATES + + MENUITEMTEMPLATEHEADER *pTpHdr= + (MENUITEMTEMPLATEHEADER*)LockResource(hGlobal); + BYTE* pTp=(BYTE*)pTpHdr + + (sizeof(MENUITEMTEMPLATEHEADER) + pTpHdr->offset); + + + // Variables needed during processing of Menu Item Templates: + + int j=0; + WORD dwFlags = 0; // Flags of the Menu Item + WORD dwID = 0; // ID of the Menu Item + UINT uFlags; // Actual Flags. + wchar_t *szCaption=NULL; + int nLen = 0; // Length of caption + CTypedPtrArray m_Stack; // Popup menu stack + CArray m_StackEnd; // Popup menu stack + m_Stack.Add(this); // Add it to this... + m_StackEnd.Add(FALSE); + + do{ + // Obtain Flags and (if necessary), the ID... + memcpy(&dwFlags, pTp, sizeof(WORD));pTp+=sizeof(WORD);// Obtain Flags + if(!(dwFlags & MF_POPUP)){ + memcpy(&dwID, pTp, sizeof(WORD)); // Obtain ID + pTp+=sizeof(WORD); + } + else dwID = 0; + + uFlags = (UINT)dwFlags; // Remove MF_END from the flags that will + if(uFlags & MF_END) // be passed to the Append(OD)Menu functions. + uFlags -= MF_END; + + // Obtain Caption (and length) + + nLen = 0; + szCaption=new wchar_t[wcslen((wchar_t *)pTp)+1]; + wcscpy(szCaption,(wchar_t *)pTp); + pTp=&pTp[(wcslen((wchar_t *)pTp)+1)*sizeof(wchar_t)];//modified SK + + // Handle popup menus first.... + + //WideCharToMultiByte + if(dwFlags & MF_POPUP){ + if(dwFlags & MF_END)m_StackEnd.SetAt(m_Stack.GetUpperBound(),TRUE); + BCMenu* pSubMenu = new BCMenu; + pSubMenu->m_unselectcheck=m_unselectcheck; + pSubMenu->m_selectcheck=m_selectcheck; + pSubMenu->checkmaps=checkmaps; + pSubMenu->checkmapsshare=TRUE; + pSubMenu->CreatePopupMenu(); + + // Append it to the top of the stack: + + m_Stack[m_Stack.GetUpperBound()]->AppendODMenuW(szCaption,uFlags, + (UINT)pSubMenu->m_hMenu, -1); + m_Stack.Add(pSubMenu); + m_StackEnd.Add(FALSE); + } + else { + m_Stack[m_Stack.GetUpperBound()]->AppendODMenuW(szCaption, uFlags, + dwID, -1); + if(dwFlags & MF_END)m_StackEnd.SetAt(m_Stack.GetUpperBound(),TRUE); + j = m_Stack.GetUpperBound(); + while(j>=0 && m_StackEnd.GetAt(j)){ + m_Stack[m_Stack.GetUpperBound()]->InsertSpaces(); + m_Stack.RemoveAt(j); + m_StackEnd.RemoveAt(j); + --j; + } + } + + delete[] szCaption; + }while(m_Stack.GetUpperBound() != -1); + + for(int i=0;i<(int)GetMenuItemCount();++i){ + CString str=m_MenuList[i]->GetString(); + if(GetSubMenu(i)){ + m_MenuList[i]->nFlags=MF_POPUP|MF_BYPOSITION; + ModifyMenu(i,MF_POPUP|MF_BYPOSITION, + (UINT)GetSubMenu(i)->m_hMenu,str); + } + else{ + m_MenuList[i]->nFlags=MF_STRING|MF_BYPOSITION; + ModifyMenu(i,MF_STRING|MF_BYPOSITION,m_MenuList[i]->nID,str); + } + } + + m_loadmenu=TRUE; + + return(TRUE); +} + +int BCMenu::GetMenuStart(void) +{ + if(!m_loadmenu)return(0); + + CString name,str; + int menuloc=-1,listloc=-1,menustart=0,i=0,j=0; + int nummenulist=m_MenuList.GetSize(); + int nummenu=(int)GetMenuItemCount(); + + while(i0){ + for(j=0;jGetString(); + if(name==str){ + menuloc=i; + listloc=j; + break; + } + } + } + ++i; + } + if(menuloc>=0&&listloc>=0&&menuloc>=listloc)menustart=menuloc-listloc; + return(menustart); +} + +void BCMenu::RemoveTopLevelOwnerDraw(void) +{ + CString str; + int i=0,j=0; + int nummenulist=m_MenuList.GetSize(),menustart; + + menustart=GetMenuStart(); + for(i=menustart,j=0;i<(int)GetMenuItemCount();++i,++j){ + if(jGetString(); + if(GetSubMenu(i)){ + m_MenuList[j]->nFlags=MF_POPUP|MF_BYPOSITION; + ModifyMenu(i,MF_POPUP|MF_BYPOSITION, + (UINT)GetSubMenu(i)->m_hMenu,str); + } + } + } + +} + +void BCMenu::InsertSpaces(void) +{ + int i,j,numitems,maxlength; + CString string,newstring; + CSize t; + CFont m_fontMenu; + LOGFONT m_lf; + + ZeroMemory ((PVOID) &m_lf,sizeof (LOGFONT)); + NONCLIENTMETRICS nm; + nm.cbSize = sizeof (NONCLIENTMETRICS); + VERIFY (SystemParametersInfo (SPI_GETNONCLIENTMETRICS,nm.cbSize,&nm,0)); + m_lf = nm.lfMenuFont; + m_fontMenu.CreateFontIndirect (&m_lf); + + CWnd *pWnd = AfxGetMainWnd(); + if (pWnd == NULL)pWnd = CWnd::GetDesktopWindow(); + CDC *pDC = pWnd->GetDC(); + CFont* pFont = pDC->SelectObject (&m_fontMenu); + + numitems=GetMenuItemCount(); + maxlength = -1; + for(i=0;iGetString(); + j=string.Find((char)9); + newstring.Empty(); + if(j!=-1)newstring=string.Left(j); + else newstring=string; + newstring+=_T(" ");//SK: modified for Unicode correctness. + LPCTSTR lpstrText = (LPCTSTR)newstring; + t=pDC->GetTextExtent(lpstrText,_tcslen(lpstrText)); + if(t.cx>maxlength)maxlength = t.cx; + } + for(i=0;iGetString(); + j=string.Find((char)9); + if(j!=-1){ + newstring.Empty(); + newstring=string.Left(j); + LPCTSTR lpstrText = (LPCTSTR)(newstring); + t=pDC->GetTextExtent(lpstrText,_tcslen(lpstrText)); + while(t.cxGetTextExtent(lpstrText,_tcslen(lpstrText)); + } + newstring+=string.Mid(j); +#ifdef UNICODE + m_MenuList[i]->SetWideString(newstring);//SK: modified for dynamic allocation +#else + m_MenuList[i]->SetAnsiString(newstring); +#endif + } + } + pDC->SelectObject (pFont); // Select old font in + pWnd->ReleaseDC(pDC); // Release the DC + m_fontMenu.DeleteObject(); +} + +void BCMenu::LoadCheckmarkBitmap(int unselect, int select) +{ + if(unselect>0 && select>0){ + m_selectcheck=select; + m_unselectcheck=unselect; + if(checkmaps)checkmaps->DeleteImageList(); + else checkmaps=new(CImageList); + checkmaps->Create(m_iconX,m_iconY,ILC_MASK,2,1); + BOOL flag1=AddBitmapToImageList(checkmaps,unselect); + BOOL flag2=AddBitmapToImageList(checkmaps,select); + if(!flag1||!flag2){ + checkmaps->DeleteImageList(); + delete checkmaps; + checkmaps=NULL; + } + } +} + +//-------------------------------------------------------------------------- +//[18.06.99 rj] +BOOL BCMenu::GetMenuText(UINT id, CString& string, UINT nFlags/*= MF_BYPOSITION*/) +{ + BOOL returnflag=FALSE; + + if(MF_BYPOSITION&nFlags){ + UINT numMenuItems = m_MenuList.GetUpperBound(); + if(id<=numMenuItems){ + string=m_MenuList[id]->GetString(); + returnflag=TRUE; + } + } + else{ + int uiLoc; + BCMenu* pMenu = FindMenuOption(id,uiLoc); + if(NULL!=pMenu) returnflag = pMenu->GetMenuText(uiLoc,string); + } + return(returnflag); +} + + +void BCMenu::DrawRadioDot(CDC *pDC,int x,int y,COLORREF color) +{ + CRect rcDot(x,y,x+6,y+6); + CBrush brush; + CPen pen; + brush.CreateSolidBrush(color); + pen.CreatePen(PS_SOLID,0,color); + CBrush *pOldBrush=pDC->SelectObject(&brush); + CPen *pOldPen=pDC->SelectObject(&pen); + pDC->Ellipse(&rcDot); + pDC->SelectObject(pOldBrush); + pDC->SelectObject(pOldPen); + pen.DeleteObject(); + brush.DeleteObject(); +} + +void BCMenu::DrawCheckMark(CDC* pDC,int x,int y,COLORREF color) +{ + CPen m_penBack; + m_penBack.CreatePen (PS_SOLID,0,color); + CPen *pOldPen = pDC->SelectObject (&m_penBack); + pDC->MoveTo(x,y+2); + pDC->LineTo(x,y+5); + + pDC->MoveTo(x+1,y+3); + pDC->LineTo(x+1,y+6); + + pDC->MoveTo(x+2,y+4); + pDC->LineTo(x+2,y+7); + + pDC->MoveTo(x+3,y+3); + pDC->LineTo(x+3,y+6); + + pDC->MoveTo(x+4,y+2); + pDC->LineTo(x+4,y+5); + + pDC->MoveTo(x+5,y+1); + pDC->LineTo(x+5,y+4); + + pDC->MoveTo(x+6,y); + pDC->LineTo(x+6,y+3); + + pDC->SelectObject (pOldPen); + m_penBack.DeleteObject(); +} + +BCMenuData *BCMenu::FindMenuList(UINT nID) +{ + for(int i=0;i<=m_MenuList.GetUpperBound();++i){ + if(m_MenuList[i]->nID==nID && !m_MenuList[i]->syncflag){ + m_MenuList[i]->syncflag=1; + return(m_MenuList[i]); + } + } + return(NULL); +} + +void BCMenu::InitializeMenuList(int value) +{ + for(int i=0;i<=m_MenuList.GetUpperBound();++i) + m_MenuList[i]->syncflag=value; +} + +void BCMenu::DeleteMenuList(void) +{ + for(int i=0;i<=m_MenuList.GetUpperBound();++i){ + if(!m_MenuList[i]->syncflag){ + delete m_MenuList[i]; + } + } +} + +void BCMenu::SynchronizeMenu(void) +{ + CTypedPtrArray temp; + BCMenuData *mdata; + CString string; + UINT submenu, nID=0, state; + int j; + + InitializeMenuList(0); + for(j=0;jm_hMenu; + mdata=FindMenuList(submenu); + GetMenuString(j,string,MF_BYPOSITION); + if(!mdata)mdata=NewODMenu(j, + (state&0xFF)|MF_BYPOSITION|MF_POPUP|MF_OWNERDRAW,submenu,string); + else if(string.GetLength()>0) +#ifdef UNICODE + mdata->SetWideString(string); //SK: modified for dynamic allocation +#else + mdata->SetAnsiString(string); +#endif + } + else if(state&MF_SEPARATOR){ + mdata=FindMenuList(0); + if(!mdata)mdata=NewODMenu(j, + state|MF_BYPOSITION|MF_SEPARATOR|MF_OWNERDRAW,0,_T(""));//SK: modified for Unicode correctness + else ModifyMenu(j,mdata->nFlags,nID,(LPCTSTR)mdata); + } + else{ + nID=GetMenuItemID(j); + mdata=FindMenuList(nID); + GetMenuString(j,string,MF_BYPOSITION); + if(!mdata)mdata=NewODMenu(j,state|MF_BYPOSITION|MF_OWNERDRAW, + nID,string); + else{ + mdata->nFlags=state|MF_BYPOSITION|MF_OWNERDRAW; + if(string.GetLength()>0) +#ifdef UNICODE + mdata->SetWideString(string);//SK: modified for dynamic allocation +#else + mdata->SetAnsiString(string); +#endif + + ModifyMenu(j,mdata->nFlags,nID,(LPCTSTR)mdata); + } + } + if(mdata)temp.Add(mdata); + } + DeleteMenuList(); + m_MenuList.RemoveAll(); + m_MenuList.Append(temp); + temp.RemoveAll(); +} + +void BCMenu::UpdateMenu(CMenu *pmenu) +{ +#ifdef _CPPRTTI + BCMenu *psubmenu = dynamic_cast(pmenu); +#else + BCMenu *psubmenu = (BCMenu *)pmenu; +#endif + if(psubmenu)psubmenu->SynchronizeMenu(); +} + +LRESULT BCMenu::FindKeyboardShortcut(UINT nChar, UINT nFlags, + CMenu *pMenu) +{ +#ifdef _CPPRTTI + BCMenu *pBCMenu = dynamic_cast(pMenu); +#else + BCMenu *pBCMenu = (BCMenu *)pMenu; +#endif + if(pBCMenu && nFlags&MF_POPUP){ + CString key(_T('&'),2);//SK: modified for Unicode correctness + key.SetAt(1,(TCHAR)nChar); + key.MakeLower(); + CString menutext; + int menusize = (int)pBCMenu->GetMenuItemCount(); + if(menusize!=(pBCMenu->m_MenuList.GetUpperBound()+1)) + pBCMenu->SynchronizeMenu(); + for(int i=0;iGetMenuText(i,menutext)){ + menutext.MakeLower(); + if(menutext.Find(key)>=0)return(MAKELRESULT(i,2)); + } + } + } + return(0); +} + +void BCMenu::DitherBlt (HDC hdcDest, int nXDest, int nYDest, int nWidth, + int nHeight, HBITMAP hbm, int nXSrc, int nYSrc, + COLORREF bgcolor) +{ + ASSERT(hdcDest && hbm); + ASSERT(nWidth > 0 && nHeight > 0); + + // Create a generic DC for all BitBlts + HDC hDC = CreateCompatibleDC(hdcDest); + ASSERT(hDC); + + if (hDC) + { + // Create a DC for the monochrome DIB section + HDC bwDC = CreateCompatibleDC(hDC); + ASSERT(bwDC); + + if (bwDC) + { + // Create the monochrome DIB section with a black and white palette + struct { + BITMAPINFOHEADER bmiHeader; + RGBQUAD bmiColors[2]; + } RGBBWBITMAPINFO = { + + { // a BITMAPINFOHEADER + sizeof(BITMAPINFOHEADER), // biSize + nWidth, // biWidth; + nHeight, // biHeight; + 1, // biPlanes; + 1, // biBitCount + BI_RGB, // biCompression; + 0, // biSizeImage; + 0, // biXPelsPerMeter; + 0, // biYPelsPerMeter; + 0, // biClrUsed; + 0 // biClrImportant; + }, + { + { 0x00, 0x00, 0x00, 0x00 }, { 0xFF, 0xFF, 0xFF, 0x00 } + } + }; + VOID *pbitsBW; + HBITMAP hbmBW = CreateDIBSection(bwDC, + (LPBITMAPINFO)&RGBBWBITMAPINFO, DIB_RGB_COLORS, &pbitsBW, NULL, 0); + ASSERT(hbmBW); + + if (hbmBW) + { + // Attach the monochrome DIB section and the bitmap to the DCs + HBITMAP olddib = (HBITMAP)SelectObject(bwDC, hbmBW); + HBITMAP hdcolddib = (HBITMAP)SelectObject(hDC, hbm); + + // BitBlt the bitmap into the monochrome DIB section + BitBlt(bwDC, 0, 0, nWidth, nHeight, hDC, nXSrc, nYSrc, SRCCOPY); + + // Paint the destination rectangle in gray + FillRect(hdcDest, CRect(nXDest, nYDest, nXDest + nWidth, nYDest + + nHeight), GetSysColorBrush(bgcolor)); + //SK: looks better on the old shell + // BitBlt the black bits in the monochrome bitmap into COLOR_3DHILIGHT + // bits in the destination DC + // The magic ROP comes from the Charles Petzold's book + HBRUSH hb = CreateSolidBrush(GetSysColor(COLOR_3DHILIGHT)); + HBRUSH oldBrush = (HBRUSH)SelectObject(hdcDest, hb); + BitBlt(hdcDest,nXDest+1,nYDest+1,nWidth,nHeight,bwDC,0,0,0xB8074A); + + // BitBlt the black bits in the monochrome bitmap into COLOR_3DSHADOW + // bits in the destination DC + hb = CreateSolidBrush(GetSysColor(COLOR_3DSHADOW)); + DeleteObject(SelectObject(hdcDest, hb)); + BitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight,bwDC,0,0,0xB8074A); + DeleteObject(SelectObject(hdcDest, oldBrush)); + VERIFY(DeleteObject(SelectObject(bwDC, olddib))); + SelectObject(hDC, hdcolddib); + } + + VERIFY(DeleteDC(bwDC)); + } + + VERIFY(DeleteDC(hDC)); + } +} + +void BCMenu::GetFadedBitmap(CBitmap &bmp) +{ + CDC ddc; + COLORREF bgcol,col; + BITMAP BitMap; + + bmp.GetBitmap(&BitMap); + ddc.CreateCompatibleDC(NULL); + CBitmap * pddcOldBmp = ddc.SelectObject(&bmp); + + // use this to get the background color, takes into account color shifting + CDC ddc2; + CBrush brush; + CBitmap bmp2; + ddc2.CreateCompatibleDC(NULL); + bmp2.CreateCompatibleBitmap(&ddc,BitMap.bmWidth,BitMap.bmHeight); + col=GetSysColor(COLOR_3DFACE); + brush.CreateSolidBrush(col); + CBitmap * pddcOldBmp2 = ddc2.SelectObject(&bmp2); + CRect rect(0,0,BitMap.bmWidth,BitMap.bmHeight); + ddc2.FillRect(rect,&brush); + bgcol=ddc2.GetPixel(1,1); + brush.DeleteObject(); + ddc2.SelectObject(pddcOldBmp2); + + for(int i=0;iAdd((HICON)nResourceID); + bReturn=TRUE; + } + else{ + HBITMAP hbmp=LoadSysColorBitmap(nResourceID); + if(hbmp){ + CBitmap bmp; + bmp.Attach(hbmp); + if(m_bitmapBackgroundFlag){ + if(bmplist->Add(&bmp,m_bitmapBackground)>=0)bReturn=TRUE; + } + else{ + if(bmplist->Add(&bmp,GetSysColor(COLOR_3DFACE))>=0)bReturn=TRUE; + } + bmp.Detach(); + DeleteObject(hbmp); + } + else{ + CBitmap mybmp; + if(mybmp.LoadBitmap(nResourceID)){ + if(m_bitmapBackgroundFlag){ + if(bmplist->Add(&mybmp,m_bitmapBackground)>=0)bReturn=TRUE; + } + else{ + if(bmplist->Add(&mybmp,GetSysColor(COLOR_3DFACE))>=0)bReturn=TRUE; + } + } + } + } + if(bReturn&&IsLunaMenuStyle()&&xp_draw_3D_bitmaps){ + CWnd *pWnd = AfxGetMainWnd(); // Get main window + if (pWnd == NULL) pWnd = CWnd::GetDesktopWindow(); + CDC *pDC = pWnd->GetDC(); // Get device context + CBitmap bmp,bmp2; + GetBitmapFromImageList(pDC,bmplist,0,bmp); + GetFadedBitmap(bmp); + bmplist->Add(&bmp,GetSysColor(COLOR_3DFACE)); + GetBitmapFromImageList(pDC,bmplist,0,bmp2); + GetShadowBitmap(bmp2); + bmplist->Add(&bmp2,GetSysColor(COLOR_3DFACE)); + pWnd->ReleaseDC(pDC); // Release the DC + } + return(bReturn); +} + +void BCMenu::SetBitmapBackground(COLORREF color) +{ + m_bitmapBackground=color; + m_bitmapBackgroundFlag=TRUE; +} + +void BCMenu::UnSetBitmapBackground(void) +{ + m_bitmapBackgroundFlag=FALSE; +} + +// Given a toolbar, append all the options from it to this menu +// Passed a ptr to the toolbar object and the toolbar ID +// Author : Robert Edward Caldecott +void BCMenu::AddFromToolBar(CToolBar* pToolBar, int nResourceID) +{ + for (int i = 0; i < pToolBar->GetCount(); i++) { + UINT nID = pToolBar->GetItemID(i); + // See if this toolbar option + // appears as a command on this + // menu or is a separator + if (nID == 0 || GetMenuState(nID, MF_BYCOMMAND) == 0xFFFFFFFF) + continue; // Item doesn't exist + UINT nStyle; + int nImage; + // Get the toolbar button info + pToolBar->GetButtonInfo(i, nID, nStyle, nImage); + // OK, we have the command ID of the toolbar + // option, and the tollbar bitmap offset + int nLoc; + BCMenuData* pData; + BCMenu *pSubMenu = FindMenuOption(nID, nLoc); + if (pSubMenu && nLoc >= 0)pData = pSubMenu->m_MenuList[nLoc]; + else { + // Create a new BCMenuData structure + pData = new BCMenuData; + m_MenuList.Add(pData); + } + // Set some default structure members + pData->menuIconNormal = nResourceID; + pData->nID = nID; + pData->nFlags = MF_BYCOMMAND | MF_OWNERDRAW; + pData->xoffset = nImage; + if (pData->bitmap)pData->bitmap->DeleteImageList(); + else pData->bitmap = new CImageList; + pData->bitmap->Create(m_iconX, m_iconY,ILC_COLORDDB|ILC_MASK, 1, 1); + + if(!AddBitmapToImageList(pData->bitmap, nResourceID)){ + pData->bitmap->DeleteImageList(); + delete pData->bitmap; + pData->bitmap=NULL; + pData->menuIconNormal = -1; + pData->xoffset = -1; + } + + // Modify our menu + ModifyMenu(nID,pData->nFlags,nID,(LPCTSTR)pData); + } +} + +BOOL BCMenu::Draw3DCheckmark(CDC *dc, const CRect& rc, + BOOL bSelected, HBITMAP hbmCheck) +{ + CRect rcDest = rc; + CBrush brush; + COLORREF col; + if(IsWinXPLuna())col=GetSysColor(COLOR_3DFACE); + else col=GetSysColor(COLOR_MENU); + if(!bSelected)col = LightenColor(col,0.6); + brush.CreateSolidBrush(col); + dc->FillRect(rcDest,&brush); + brush.DeleteObject(); + if (IsNewShell()) //SK: looks better on the old shell + dc->DrawEdge(&rcDest, BDR_SUNKENOUTER, BF_RECT); + if (!hbmCheck)DrawCheckMark(dc,rc.left+4,rc.top+4,GetSysColor(COLOR_MENUTEXT)); + else DrawRadioDot(dc,rc.left+5,rc.top+4,GetSysColor(COLOR_MENUTEXT)); + return TRUE; +} + +BOOL BCMenu::DrawXPCheckmark(CDC *dc, const CRect& rc, HBITMAP hbmCheck,COLORREF &colorout) +{ + CBrush brushin; + brushin.CreateSolidBrush(LightenColor(colorout,0.85)); + dc->FillRect(rc,&brushin); + brushin.DeleteObject(); + dc->Draw3dRect (rc,colorout,colorout); + if (!hbmCheck)DrawCheckMark(dc,rc.left+5,rc.top+4,GetSysColor(COLOR_MENUTEXT)); + else DrawRadioDot(dc,rc.left+5,rc.top+4,GetSysColor(COLOR_MENUTEXT)); + return TRUE; +} + +void BCMenu::DitherBlt2(CDC *drawdc, int nXDest, int nYDest, int nWidth, + int nHeight, CBitmap &bmp, int nXSrc, int nYSrc, + COLORREF bgcolor) +{ + // create a monochrome memory DC + CDC ddc; + ddc.CreateCompatibleDC(0); + CBitmap bwbmp; + bwbmp.CreateCompatibleBitmap(&ddc, nWidth, nHeight); + CBitmap * pddcOldBmp = ddc.SelectObject(&bwbmp); + + CDC dc; + dc.CreateCompatibleDC(0); + CBitmap * pdcOldBmp = dc.SelectObject(&bmp); + + // build a mask + ddc.PatBlt(0, 0, nWidth, nHeight, WHITENESS); + dc.SetBkColor(GetSysColor(COLOR_BTNFACE)); + ddc.BitBlt(0, 0, nWidth, nHeight, &dc, nXSrc,nYSrc, SRCCOPY); + dc.SetBkColor(GetSysColor(COLOR_BTNHILIGHT)); + ddc.BitBlt(0, 0, nWidth, nHeight, &dc, nXSrc,nYSrc, SRCPAINT); + + // Copy the image from the toolbar into the memory DC + // and draw it (grayed) back into the toolbar. + dc.FillSolidRect(0,0, nWidth, nHeight, bgcolor); + //SK: Looks better on the old shell + dc.SetBkColor(RGB(0, 0, 0)); + dc.SetTextColor(RGB(255, 255, 255)); + CBrush brShadow, brHilight; + brHilight.CreateSolidBrush(GetSysColor(COLOR_BTNHILIGHT)); + brShadow.CreateSolidBrush(GetSysColor(COLOR_BTNSHADOW)); + CBrush * pOldBrush = dc.SelectObject(&brHilight); + dc.BitBlt(0,0, nWidth, nHeight, &ddc, 0, 0, 0x00E20746L); + drawdc->BitBlt(nXDest+1,nYDest+1,nWidth, nHeight, &dc,0,0,SRCCOPY); + dc.BitBlt(1,1, nWidth, nHeight, &ddc, 0, 0, 0x00E20746L); + dc.SelectObject(&brShadow); + dc.BitBlt(0,0, nWidth, nHeight, &ddc, 0, 0, 0x00E20746L); + drawdc->BitBlt(nXDest,nYDest,nWidth, nHeight, &dc,0,0,SRCCOPY); + // reset DCs + ddc.SelectObject(pddcOldBmp); + ddc.DeleteDC(); + dc.SelectObject(pOldBrush); + dc.SelectObject(pdcOldBmp); + dc.DeleteDC(); + + brShadow.DeleteObject(); + brHilight.DeleteObject(); + bwbmp.DeleteObject(); +} + +void BCMenu::SetDisableOldStyle(void) +{ + disable_old_style=TRUE; +} + +void BCMenu::UnSetDisableOldStyle(void) +{ + disable_old_style=FALSE; +} + +BOOL BCMenu::GetDisableOldStyle(void) +{ + return(disable_old_style); +} + + +WORD BCMenu::NumBitmapColors(LPBITMAPINFOHEADER lpBitmap) +{ + if ( lpBitmap->biClrUsed != 0) + return (WORD)lpBitmap->biClrUsed; + + switch (lpBitmap->biBitCount){ + case 1: + return 2; + case 4: + return 16; + case 8: + return 256; + default: + return 0; + } + return 0; +} + +HBITMAP BCMenu::LoadSysColorBitmap(int nResourceId) +{ + HINSTANCE hInst = + AfxFindResourceHandle(MAKEINTRESOURCE(nResourceId),RT_BITMAP); + HRSRC hRsrc = + ::FindResource(hInst,MAKEINTRESOURCE(nResourceId),RT_BITMAP); + if (hRsrc == NULL){ + hInst = NULL; + hRsrc = ::FindResource(hInst,MAKEINTRESOURCE(nResourceId),RT_BITMAP); + } + if (hRsrc == NULL)return NULL; + + // determine how many colors in the bitmap + HGLOBAL hglb; + if ((hglb = LoadResource(hInst, hRsrc)) == NULL) + return NULL; + LPBITMAPINFOHEADER lpBitmap = (LPBITMAPINFOHEADER)LockResource(hglb); + if (lpBitmap == NULL)return NULL; + WORD numcol = NumBitmapColors(lpBitmap); + ::FreeResource(hglb); + + if(numcol!=16)return(NULL); + + return AfxLoadSysColorBitmap(hInst, hRsrc, FALSE); +} + +BOOL BCMenu::RemoveMenu(UINT uiId,UINT nFlags) +{ + if(MF_BYPOSITION&nFlags){ + UINT uint = GetMenuState(uiId,MF_BYPOSITION); + if(uint&MF_SEPARATOR && !(uint&MF_POPUP)){ + delete m_MenuList.GetAt(uiId); + m_MenuList.RemoveAt(uiId); + } + else{ + BCMenu* pSubMenu = (BCMenu*) GetSubMenu(uiId); + if(NULL==pSubMenu){ + UINT uiCommandId = GetMenuItemID(uiId); + for(int i=0;inID==uiCommandId){ + delete m_MenuList.GetAt(i); + m_MenuList.RemoveAt(i); + break; + } + } + } + else{ + int numSubMenus = m_SubMenus.GetUpperBound(); + for(int m = numSubMenus; m >= 0; m--){ + if(m_SubMenus[m]==pSubMenu->m_hMenu){ + int numAllSubMenus = m_AllSubMenus.GetUpperBound(); + for(int n = numAllSubMenus; n>= 0; n--){ + if(m_AllSubMenus[n]==m_SubMenus[m])m_AllSubMenus.RemoveAt(n); + } + m_SubMenus.RemoveAt(m); + } + } + int num = pSubMenu->GetMenuItemCount(); + int i; + for(i=num-1;i>=0;--i)pSubMenu->RemoveMenu(i,MF_BYPOSITION); + for(i=m_MenuList.GetUpperBound();i>=0;i--){ + if(m_MenuList[i]->nID==(UINT)pSubMenu->m_hMenu){ + delete m_MenuList.GetAt(i); + m_MenuList.RemoveAt(i); + break; + } + } + delete pSubMenu; + } + } + } + else{ + int iPosition =0; + BCMenu* pMenu = FindMenuOption(uiId,iPosition); + // bug fix RIA 14th September 2000 + // failed to return correct value on call to remove menu as the item was + // removed twice. The second time its not found + // so a value of 0 was being returned + if(pMenu) return pMenu->RemoveMenu(iPosition,MF_BYPOSITION); // added return + } + return CMenu::RemoveMenu(uiId,nFlags); +} + +BOOL BCMenu::DeleteMenu(UINT uiId,UINT nFlags) +{ + if(MF_BYPOSITION&nFlags){ + UINT uint = GetMenuState(uiId,MF_BYPOSITION); + if(uint&MF_SEPARATOR && !(uint&MF_POPUP)){ + // make sure it's a separator + int menulistsize=m_MenuList.GetSize(); + if(uiId<(UINT)menulistsize){ + CString str=m_MenuList[uiId]->GetString(); + if(str==""){ + delete m_MenuList.GetAt(uiId); + m_MenuList.RemoveAt(uiId); + } + } + } + else{ + BCMenu* pSubMenu = (BCMenu*) GetSubMenu(uiId); + if(NULL==pSubMenu){ + UINT uiCommandId = GetMenuItemID(uiId); + for(int i=0;inID==uiCommandId){ + delete m_MenuList.GetAt(i); + m_MenuList.RemoveAt(i); + break; + } + } + } + else{ + int numSubMenus = m_SubMenus.GetUpperBound(); + for(int m = numSubMenus; m >= 0; m--){ + if(m_SubMenus[m]==pSubMenu->m_hMenu){ + int numAllSubMenus = m_AllSubMenus.GetUpperBound(); + for(int n = numAllSubMenus; n>= 0; n--){ + if(m_AllSubMenus[n]==m_SubMenus[m])m_AllSubMenus.RemoveAt(n); + } + m_SubMenus.RemoveAt(m); + } + } + int num = pSubMenu->GetMenuItemCount(); + int i; + for(i=num-1;i>=0;--i)pSubMenu->DeleteMenu(i,MF_BYPOSITION); + for(i=m_MenuList.GetUpperBound();i>=0;i--){ + if(m_MenuList[i]->nID==(UINT)pSubMenu->m_hMenu){ + delete m_MenuList.GetAt(i); + m_MenuList.RemoveAt(i); + break; + } + } + delete pSubMenu; + } + } + } + else{ + int iPosition =0; + BCMenu* pMenu = FindMenuOption(uiId,iPosition); + if(pMenu)return pMenu->DeleteMenu(iPosition,MF_BYPOSITION); + } + + return(CMenu::DeleteMenu(uiId,nFlags)); +} + + +BOOL BCMenu::AppendMenuA(UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,int nIconNormal) +{ + USES_CONVERSION; + return AppendMenuW(nFlags,nIDNewItem,A2W(lpszNewItem),nIconNormal); +} + +BOOL BCMenu::AppendMenuW(UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,int nIconNormal) +{ + return AppendODMenuW(lpszNewItem,nFlags,nIDNewItem,nIconNormal); +} + +BOOL BCMenu::AppendMenuA(UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CImageList *il,int xoffset) +{ + USES_CONVERSION; + return AppendMenuW(nFlags,nIDNewItem,A2W(lpszNewItem),il,xoffset); +} + +BOOL BCMenu::AppendMenuW(UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CImageList *il,int xoffset) +{ + return AppendODMenuW(lpszNewItem,nFlags,nIDNewItem,il,xoffset); +} + +BOOL BCMenu::AppendMenuA(UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CBitmap *bmp) +{ + USES_CONVERSION; + return AppendMenuW(nFlags,nIDNewItem,A2W(lpszNewItem),bmp); +} + +BOOL BCMenu::AppendMenuW(UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CBitmap *bmp) +{ + if(bmp){ + CImageList temp; + temp.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1); + if(m_bitmapBackgroundFlag)temp.Add(bmp,m_bitmapBackground); + else temp.Add(bmp,GetSysColor(COLOR_3DFACE)); + return AppendODMenuW(lpszNewItem,nFlags,nIDNewItem,&temp,0); + } + return AppendODMenuW(lpszNewItem,nFlags,nIDNewItem,NULL,0); +} + +BOOL BCMenu::InsertMenuA(UINT nPosition,UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,int nIconNormal) +{ + USES_CONVERSION; + return InsertMenuW(nPosition,nFlags,nIDNewItem,A2W(lpszNewItem),nIconNormal); +} + +BOOL BCMenu::InsertMenuW(UINT nPosition,UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,int nIconNormal) +{ + return InsertODMenuW(nPosition,lpszNewItem,nFlags,nIDNewItem,nIconNormal); +} + +BOOL BCMenu::InsertMenuA(UINT nPosition,UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CImageList *il,int xoffset) +{ + USES_CONVERSION; + return InsertMenuW(nPosition,nFlags,nIDNewItem,A2W(lpszNewItem),il,xoffset); +} + +BOOL BCMenu::InsertMenuW(UINT nPosition,UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CImageList *il,int xoffset) +{ + return InsertODMenuW(nPosition,lpszNewItem,nFlags,nIDNewItem,il,xoffset); +} + +BOOL BCMenu::InsertMenuA(UINT nPosition,UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CBitmap *bmp) +{ + USES_CONVERSION; + return InsertMenuW(nPosition,nFlags,nIDNewItem,A2W(lpszNewItem),bmp); +} + +BOOL BCMenu::InsertMenuW(UINT nPosition,UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CBitmap *bmp) +{ + if(bmp){ + CImageList temp; + temp.Create(m_iconX,m_iconY,ILC_COLORDDB|ILC_MASK,1,1); + if(m_bitmapBackgroundFlag)temp.Add(bmp,m_bitmapBackground); + else temp.Add(bmp,GetSysColor(COLOR_3DFACE)); + return InsertODMenuW(nPosition,lpszNewItem,nFlags,nIDNewItem,&temp,0); + } + return InsertODMenuW(nPosition,lpszNewItem,nFlags,nIDNewItem,NULL,0); +} + +//-------------------------------------------------------------------------- +//[21.06.99 rj] +BCMenu* BCMenu::AppendODPopupMenuW(wchar_t *lpstrText) +{ + BCMenu* pSubMenu = new BCMenu; + pSubMenu->m_unselectcheck=m_unselectcheck; + pSubMenu->m_selectcheck=m_selectcheck; + pSubMenu->checkmaps=checkmaps; + pSubMenu->checkmapsshare=TRUE; + pSubMenu->CreatePopupMenu(); + AppendODMenuW(lpstrText,MF_POPUP,(UINT)pSubMenu->m_hMenu, -1); + return pSubMenu; +} + +//-------------------------------------------------------------------------- +//[21.06.99 rj] +BCMenu* BCMenu::AppendODPopupMenuA(LPCSTR lpstrText) +{ + USES_CONVERSION; + return AppendODPopupMenuW(A2W(lpstrText)); +} + +BOOL BCMenu::ImageListDuplicate(CImageList *il,int xoffset,CImageList *newlist) +{ + if (il == NULL||newlist==NULL||xoffset<0) return FALSE; + HICON hIcon = il->ExtractIcon(xoffset); + int cx, cy; + ImageList_GetIconSize(il->m_hImageList, &cx, &cy); + newlist->Create(cx,cy,ILC_COLORDDB|ILC_MASK,1,1); + newlist->Add(hIcon); + ::DestroyIcon(hIcon); + if(IsLunaMenuStyle()&&xp_draw_3D_bitmaps){ + CWnd *pWnd = AfxGetMainWnd(); // Get main window + if (pWnd == NULL) pWnd = CWnd::GetDesktopWindow(); + CDC *pDC = pWnd->GetDC(); // Get device context + CBitmap bmp,bmp2; + GetBitmapFromImageList(pDC,newlist,0,bmp); + GetFadedBitmap(bmp); + newlist->Add(&bmp,GetSysColor(COLOR_3DFACE)); + GetBitmapFromImageList(pDC,newlist,0,bmp2); + GetShadowBitmap(bmp2); + newlist->Add(&bmp2,GetSysColor(COLOR_3DFACE)); + pWnd->ReleaseDC(pDC); // Release the DC + } + return TRUE; +} + +// 2001-07-12, Damir Valiulin: +// Added GetSubMenu (LPCTSTR lpszSubMenuName) function +// + +CMenu* BCMenu::GetSubMenu(int nPos) +{ + return CMenu::GetSubMenu (nPos); +} + +CMenu* BCMenu::GetSubMenu(LPCTSTR lpszSubMenuName) +{ + int num = GetMenuItemCount (); + CString name; + + for (int i=0; inID; + CMenu *ptr=FromHandle(bchmenu); + BOOL flag=ptr->IsKindOf(RUNTIME_CLASS( BCMenu )); + if(flag)return((BCMenu *)ptr); + } + return NULL; +} + + +// Tongzhe Cui, Functions to remove a popup menu based on its name. Seperators +// before and after the popup menu can also be removed if they exist. +int BCMenu::GetMenuPosition(char* pText) +{ + USES_CONVERSION; + return GetMenuPosition(A2W(pText)); +} + +int BCMenu::GetMenuPosition(wchar_t* pText) +{ + int i,j; + BCMenu* psubmenu; + for(i=0;i<(int)(GetMenuItemCount());++i) + { + psubmenu=(BCMenu *)GetSubMenu(i); + if(!psubmenu) + { + const wchar_t *szWide;//SK: we use const to prevent misuse of this Ptr + for(j=0;j<=m_MenuList.GetUpperBound();++j) + { + szWide = m_MenuList[j]->GetWideString (); + if(szWide && !wcscmp(pText,szWide))//SK: modified for dynamic allocation + return j; + } + } + } + // means no found; + return -1; +} + +int BCMenu::RemoveMenu(char* pText, BC_Seperator sPos) +{ + USES_CONVERSION; + return RemoveMenu(A2W(pText), sPos); +} + +int BCMenu::RemoveMenu(wchar_t* pText, BC_Seperator sPos) +{ + int nPos = GetMenuPosition(pText); + if(nPos != -1) + { + RemoveMenu(nPos, MF_BYPOSITION); + } + if(sPos == BCMENU_HEAD) + { + ASSERT(nPos - 1 >= 0); + RemoveMenu(nPos-1, MF_BYPOSITION); + } + else if(sPos == BCMENU_TAIL) + { + RemoveMenu(nPos-1, MF_BYPOSITION); + } + else if(sPos == BCMENU_BOTH) + { + // remove the end first; + RemoveMenu(nPos-1, MF_BYPOSITION); + // remove the head; + ASSERT(nPos - 1 >= 0); + RemoveMenu(nPos-1, MF_BYPOSITION); + } + return nPos; +} + +int BCMenu::DeleteMenu(char* pText, BC_Seperator sPos) +{ + USES_CONVERSION; + return DeleteMenu(A2W(pText), sPos); +} + +int BCMenu::DeleteMenu(wchar_t* pText, BC_Seperator sPos) +{ + int nPos = GetMenuPosition(pText); + if(nPos != -1) + { + DeleteMenu(nPos, MF_BYPOSITION); + } + if(sPos == BCMENU_HEAD) + { + ASSERT(nPos - 1 >= 0); + DeleteMenu(nPos-1, MF_BYPOSITION); + } + else if(sPos == BCMENU_TAIL) + { + DeleteMenu(nPos-1, MF_BYPOSITION); + } + else if(sPos == BCMENU_BOTH) + { + // remove the end first; + DeleteMenu(nPos-1, MF_BYPOSITION); + // remove the head; + ASSERT(nPos - 1 >= 0); + DeleteMenu(nPos-1, MF_BYPOSITION); + } + return nPos; +} + +// Larry Antram +BOOL BCMenu::SetMenuText(UINT id, CString string, UINT nFlags/*= MF_BYPOSITION*/ ) +{ + BOOL returnflag=FALSE; + + if(MF_BYPOSITION&nFlags) + { + UINT numMenuItems = m_MenuList.GetUpperBound(); + if(id<=numMenuItems){ +#ifdef UNICODE + m_MenuList[id]->SetWideString((LPCTSTR)string); +#else + m_MenuList[id]->SetAnsiString(string); +#endif + returnflag=TRUE; + } + } + else{ + int uiLoc; + BCMenu* pMenu = FindMenuOption(id,uiLoc); + if(NULL!=pMenu) returnflag = pMenu->SetMenuText(uiLoc,string); + } + return(returnflag); +} + +// courtesy of Warren Stevens +void BCMenu::ColorBitmap(CDC* pDC,CBitmap& bmp,CSize bitmap_size,CSize icon_size,COLORREF fill,COLORREF border,int hatchstyle) +{ + CDC bmpdc; + COLORREF m_newclrBack; + int x1=0,y1=0,x2=bitmap_size.cx,y2=bitmap_size.cy; + + if(IsWinXPLuna())m_newclrBack=GetSysColor(COLOR_3DFACE); + else m_newclrBack=GetSysColor(COLOR_MENU); + + bmpdc.CreateCompatibleDC(pDC); + + bmp.CreateCompatibleBitmap(pDC, icon_size.cx, icon_size.cy); + CBitmap* pOldBitmap = bmpdc.SelectObject(&bmp); + + if(bitmap_size!=icon_size){ + CBrush background_brush; + background_brush.CreateSolidBrush(m_newclrBack); + CRect rect(0,0, icon_size.cx, icon_size.cy); + bmpdc.FillRect(rect,&background_brush); + x1 = (icon_size.cx-bitmap_size.cx)/2; + y1 = (icon_size.cy-bitmap_size.cy)/2; + x2 = x1+bitmap_size.cx; + y2 = y1+bitmap_size.cy; + background_brush.DeleteObject(); + } + + CPen border_pen(PS_SOLID, 1, border); + CBrush fill_brush; + if(hatchstyle!=-1) { fill_brush.CreateHatchBrush(hatchstyle, fill); } + else { fill_brush.CreateSolidBrush(fill); } + + CPen* pOldPen = bmpdc.SelectObject(&border_pen); + CBrush* pOldBrush = bmpdc.SelectObject(&fill_brush); + + bmpdc.Rectangle(x1,y1,x2,y2); + + if(NULL!=pOldBrush) { bmpdc.SelectObject(pOldBrush); } + if(NULL!=pOldPen) { bmpdc.SelectObject(pOldPen); } + if(NULL!=pOldBitmap) { bmpdc.SelectObject(pOldBitmap); } +} + +BOOL BCMenu::IsWindowsClassicTheme(void) +{ + TCHAR Buf[_MAX_PATH+10]; + HKEY hKey; + DWORD size,type; + long lRetCode; + static BOOL XPTheme_returnflag=FALSE; + static BOOL XPTheme_checkflag=FALSE; + + if(XPTheme_checkflag)return(XPTheme_returnflag); + + XPTheme_checkflag=TRUE; + lRetCode = RegOpenKeyEx ( HKEY_CURRENT_USER, + _T("Software\\Microsoft\\Plus!\\Themes\\Current"), + 0,KEY_READ,&hKey); + if (lRetCode == ERROR_SUCCESS){ + size = _MAX_PATH;type=REG_SZ; + lRetCode=::RegQueryValueEx(hKey,NULL,NULL,&type, + (unsigned char *)Buf,&size); + if(lRetCode == ERROR_SUCCESS){ + TCHAR szClassicTheme[]=_T("Windows Classic.theme"); + int len=lstrlen(Buf); + if(len>=lstrlen(szClassicTheme)){ + if(!lstrcmpi(&Buf[len-lstrlen(szClassicTheme)],szClassicTheme)){ + XPTheme_returnflag=TRUE; + } + } + } + RegCloseKey(hKey); + } + return(XPTheme_returnflag); +} + +int BCMenu::GlobalImageListOffset(int nID) +{ + int numcurrent=m_AllImagesID.GetSize(); + int existsloc = -1; + for(int i=0;iExtractIcon(xoffset); + if(hIcon){ + CBitmap bmp,bmp2; + if(IsLunaMenuStyle()&&xp_draw_3D_bitmaps){ + CWnd *pWnd = AfxGetMainWnd(); // Get main window + if (pWnd == NULL) pWnd = CWnd::GetDesktopWindow(); + CDC *pDC = pWnd->GetDC(); // Get device context + GetBitmapFromImageList(pDC,il,xoffset,bmp); + GetFadedBitmap(bmp); + GetBitmapFromImageList(pDC,il,xoffset,bmp2); + GetShadowBitmap(bmp2); + pWnd->ReleaseDC(pDC); // Release the DC + } + int numcurrent=m_AllImagesID.GetSize(); + int existsloc = -1; + for(int i=0;i=0){ + m_AllImages.Replace(existsloc,hIcon); + loc = existsloc; + if(IsLunaMenuStyle()&&xp_draw_3D_bitmaps){ + if(existsloc+1wVersion == 1); + + UINT* pItems = new UINT[pData->wItemCount]; + for (int i = 0; i < pData->wItemCount; i++) + pItems[i] = pData->items()[i]; + BOOL bResult = SetButtons(pItems,pData->wItemCount); + delete[] pItems; + + if (bResult){ + CSize sizeImage(pData->wWidth,pData->wHeight); + CSize sizeButton(pData->wWidth+7,pData->wHeight+7); + SetSizes(sizeButton,sizeImage); + m_iconX=pData->wWidth; + m_iconY=pData->wHeight; + bResult = LoadBitmap(lpszResourceName); + } + + ::UnlockResource(hGlobal); + ::FreeResource(hGlobal); + return bResult; +} + +BOOL BCMenuToolBar::LoadBitmap(LPCTSTR lpszResourceName) +{ + ASSERT_VALID(this); + ASSERT(lpszResourceName != NULL); + + HINSTANCE hInstImageWell = AfxFindResourceHandle(lpszResourceName,RT_BITMAP); + HRSRC hRsrcImageWell = ::FindResource(hInstImageWell,lpszResourceName,RT_BITMAP); + if (hRsrcImageWell == NULL){ + hInstImageWell = NULL; + hRsrcImageWell = ::FindResource(hInstImageWell,lpszResourceName,RT_BITMAP); + } + if (hRsrcImageWell == NULL) + return FALSE; + + HBITMAP hbmImageWell; + hbmImageWell = AfxLoadSysColorBitmap(hInstImageWell,hRsrcImageWell); + + if (!AddReplaceBitmap(hbmImageWell)) + return FALSE; + + m_hInstImageWell = hInstImageWell; + m_hRsrcImageWell = hRsrcImageWell; + return TRUE; +} diff --git a/Src/CH91PayloadSoftware/BCMenu.h b/Src/CH91PayloadSoftware/BCMenu.h new file mode 100644 index 0000000..7fce95b --- /dev/null +++ b/Src/CH91PayloadSoftware/BCMenu.h @@ -0,0 +1,391 @@ +//************************************************************************* +// BCMenu.h : header file +// Version : 3.02 +// Date : March 2002 +// Author : Brent Corkum +// Email : corkum@rocscience.com +// Latest Version : http://www.rocscience.com/~corkum/BCMenu.html +// +// Bug Fixes and portions of code supplied by: +// +// Ben Ashley,Girish Bharadwaj,Jean-Edouard Lachand-Robert, +// Robert Edward Caldecott,Kenny Goers,Leonardo Zide, +// Stefan Kuhr,Reiner Jung,Martin Vladic,Kim Yoo Chul, +// Oz Solomonovich,Tongzhe Cui,Stephane Clog,Warren Stevens, +// Damir Valiulin,David Kinder,Marc Loiry +// +// You are free to use/modify this code but leave this header intact. +// This class is public domain so you are free to use it any of +// your applications (Freeware,Shareware,Commercial). All I ask is +// that you let me know so that if you have a real winner I can +// brag to my buddies that some of my code is in your app. I also +// wouldn't mind if you sent me a copy of your application since I +// like to play with new stuff. +//************************************************************************* + +#ifndef BCMenu_H +#define BCMenu_H + +#include + +// BCMenuData class. Fill this class structure to define a single menu item: +class BCMenuData +{ + wchar_t *m_szMenuText; +public: + BCMenuData () {menuIconNormal=-1;xoffset=-1;bitmap=NULL;pContext=NULL; + nFlags=0;nID=0;syncflag=0;m_szMenuText=NULL;global_offset=-1;threeD=FALSE;}; + void SetAnsiString(LPCSTR szAnsiString); + void SetWideString(const wchar_t *szWideString); + const wchar_t *GetWideString(void) {return m_szMenuText;}; + ~BCMenuData (); + CString GetString(void);//returns the menu text in ANSI or UNICODE + int xoffset,global_offset; + BOOL threeD; + int menuIconNormal; + UINT nFlags,nID,syncflag; + CImageList *bitmap; + void *pContext; // used to attach user data +}; + +//struct CMenuItemInfo : public MENUITEMINFO { +struct CMenuItemInfo : public +//MENUITEMINFO +#ifndef UNICODE //SK: this fixes warning C4097: typedef-name 'MENUITEMINFO' used as synonym for class-name 'tagMENUITEMINFOA' +tagMENUITEMINFOA +#else +tagMENUITEMINFOW +#endif +{ + CMenuItemInfo() + { + memset(this, 0, sizeof(MENUITEMINFO)); + cbSize = sizeof(MENUITEMINFO); + } +}; + +// how the menu's are drawn, either original or XP style +typedef enum {BCMENU_DRAWMODE_ORIGINAL,BCMENU_DRAWMODE_XP} BC_MenuDrawMode; + +// how seperators are handled when removing a menu (Tongzhe Cui) +typedef enum {BCMENU_NONE, BCMENU_HEAD, BCMENU_TAIL, BCMENU_BOTH} BC_Seperator; + +// defines for unicode support +#ifndef UNICODE +#define AppendMenu AppendMenuA +#define InsertMenu InsertMenuA +#define InsertODMenu InsertODMenuA +#define AppendODMenu AppendODMenuA +#define AppendODPopupMenu AppendODPopupMenuA +#define ModifyODMenu ModifyODMenuA +#else +#define AppendMenu AppendMenuW +#define InsertMenu InsertMenuW +#define InsertODMenu InsertODMenuW +#define AppendODMenu AppendODMenuW +#define ModifyODMenu ModifyODMenuW +#define AppendODPopupMenu AppendODPopupMenuW +#endif + + +class BCMenu : public CMenu +{ + DECLARE_DYNAMIC( BCMenu ) +public: + BCMenu(); + virtual ~BCMenu(); + + // Functions for loading and applying bitmaps to menus (see example application) + virtual BOOL LoadMenu(LPCTSTR lpszResourceName); + virtual BOOL LoadMenu(int nResource); + BOOL LoadToolbar(UINT nToolBar); + BOOL LoadToolbars(const UINT *arID,int n); + void AddFromToolBar(CToolBar* pToolBar, int nResourceID); + BOOL LoadFromToolBar(UINT nID,UINT nToolBar,int& xoffset); + BOOL AddBitmapToImageList(CImageList *list,UINT nResourceID); + static HBITMAP LoadSysColorBitmap(int nResourceId); + void LoadCheckmarkBitmap(int unselect,int select); // custom check mark bitmaps + + // functions for appending a menu option, use the AppendMenu call (see above define) + BOOL AppendMenuA(UINT nFlags,UINT nIDNewItem=0,const char *lpszNewItem=NULL,int nIconNormal=-1); + BOOL AppendMenuA(UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CImageList *il,int xoffset); + BOOL AppendMenuA(UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CBitmap *bmp); + BOOL AppendMenuW(UINT nFlags,UINT nIDNewItem=0,wchar_t *lpszNewItem=NULL,int nIconNormal=-1); + BOOL AppendMenuW(UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CImageList *il,int xoffset); + BOOL AppendMenuW(UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CBitmap *bmp); + BOOL AppendODMenuA(LPCSTR lpstrText,UINT nFlags = MF_OWNERDRAW,UINT nID = 0,int nIconNormal = -1); + BOOL AppendODMenuW(wchar_t *lpstrText,UINT nFlags = MF_OWNERDRAW,UINT nID = 0,int nIconNormal = -1); + BOOL AppendODMenuA(LPCSTR lpstrText,UINT nFlags,UINT nID,CImageList *il,int xoffset); + BOOL AppendODMenuW(wchar_t *lpstrText,UINT nFlags,UINT nID,CImageList *il,int xoffset); + + // for appending a popup menu (see example application) + BCMenu* AppendODPopupMenuA(LPCSTR lpstrText); + BCMenu* AppendODPopupMenuW(wchar_t *lpstrText); + + // functions for inserting a menu option, use the InsertMenu call (see above define) + BOOL InsertMenuA(UINT nPosition,UINT nFlags,UINT nIDNewItem=0,const char *lpszNewItem=NULL,int nIconNormal=-1); + BOOL InsertMenuA(UINT nPosition,UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CImageList *il,int xoffset); + BOOL InsertMenuA(UINT nPosition,UINT nFlags,UINT nIDNewItem,const char *lpszNewItem,CBitmap *bmp); + BOOL InsertMenuW(UINT nPosition,UINT nFlags,UINT nIDNewItem=0,wchar_t *lpszNewItem=NULL,int nIconNormal=-1); + BOOL InsertMenuW(UINT nPosition,UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CImageList *il,int xoffset); + BOOL InsertMenuW(UINT nPosition,UINT nFlags,UINT nIDNewItem,wchar_t *lpszNewItem,CBitmap *bmp); + BOOL InsertODMenuA(UINT nPosition,LPCSTR lpstrText,UINT nFlags = MF_OWNERDRAW,UINT nID = 0,int nIconNormal = -1); + BOOL InsertODMenuW(UINT nPosition,wchar_t *lpstrText,UINT nFlags = MF_OWNERDRAW,UINT nID = 0,int nIconNormal = -1); + BOOL InsertODMenuA(UINT nPosition,LPCSTR lpstrText,UINT nFlags,UINT nID,CImageList *il,int xoffset); + BOOL InsertODMenuW(UINT nPosition,wchar_t *lpstrText,UINT nFlags,UINT nID,CImageList *il,int xoffset); + + // functions for modifying a menu option, use the ModifyODMenu call (see above define) + BOOL ModifyODMenuA(const char *lpstrText,UINT nID=0,int nIconNormal=-1); + BOOL ModifyODMenuA(const char *lpstrText,UINT nID,CImageList *il,int xoffset); + BOOL ModifyODMenuA(const char *lpstrText,UINT nID,CBitmap *bmp); + BOOL ModifyODMenuA(const char *lpstrText,const char *OptionText,int nIconNormal); + BOOL ModifyODMenuW(wchar_t *lpstrText,UINT nID=0,int nIconNormal=-1); + BOOL ModifyODMenuW(wchar_t *lpstrText,UINT nID,CImageList *il,int xoffset); + BOOL ModifyODMenuW(wchar_t *lpstrText,UINT nID,CBitmap *bmp); + BOOL ModifyODMenuW(wchar_t *lpstrText,wchar_t *OptionText,int nIconNormal); + // use this method for adding a solid/hatched colored square beside a menu option + // courtesy of Warren Stevens + BOOL ModifyODMenuA(const char *lpstrText,UINT nID,COLORREF fill,COLORREF border,int hatchstyle=-1,CSize *pSize=NULL); + BOOL ModifyODMenuW(wchar_t *lpstrText,UINT nID,COLORREF fill,COLORREF border,int hatchstyle=-1,CSize *pSize=NULL); + + // for deleting and removing menu options + BOOL RemoveMenu(UINT uiId,UINT nFlags); + BOOL DeleteMenu(UINT uiId,UINT nFlags); + // sPos means Seperator's position, since we have no way to find the seperator's position in the menu + // we have to specify them when we call the RemoveMenu to make sure the unused seperators are removed; + // sPos = None no seperator removal; + // = Head seperator in front of this menu item; + // = Tail seperator right after this menu item; + // = Both seperators at both ends; + // remove the menu item based on their text, return -1 if not found, otherwise return the menu position; + int RemoveMenu(char* pText, BC_Seperator sPos=BCMENU_NONE); + int RemoveMenu(wchar_t* pText, BC_Seperator sPos=BCMENU_NONE); + int DeleteMenu(char* pText, BC_Seperator sPos=BCMENU_NONE); + int DeleteMenu(wchar_t* pText, BC_Seperator sPos=BCMENU_NONE); + + // Destoying + virtual BOOL DestroyMenu(); + + // function for retrieving and setting a menu options text (use this function + // because it is ownerdrawn) + BOOL GetMenuText(UINT id,CString &string,UINT nFlags = MF_BYPOSITION); + BOOL SetMenuText(UINT id,CString string, UINT nFlags = MF_BYPOSITION); + + // Getting a submenu from it's name or position + BCMenu* GetSubBCMenu(char* lpszSubMenuName); + BCMenu* GetSubBCMenu(wchar_t* lpszSubMenuName); + CMenu* GetSubMenu (LPCTSTR lpszSubMenuName); + CMenu* GetSubMenu (int nPos); + int GetMenuPosition(char* pText); + int GetMenuPosition(wchar_t* pText); + + // Drawing: + virtual void DrawItem( LPDRAWITEMSTRUCT); // Draw an item + virtual void MeasureItem( LPMEASUREITEMSTRUCT ); // Measure an item + + // Static functions used for handling menu's in the mainframe + static void UpdateMenu(CMenu *pmenu); + static BOOL IsMenu(CMenu *submenu); + static BOOL IsMenu(HMENU submenu); + static LRESULT FindKeyboardShortcut(UINT nChar,UINT nFlags,CMenu *pMenu); + + // Function to set how menu is drawn, either original or XP style + static void SetMenuDrawMode(UINT mode){ + BCMenu::original_drawmode=mode; + BCMenu::xp_drawmode=mode; + }; + // Function to set how disabled items are drawn (mode=FALSE means they are not drawn selected) + static void SetSelectDisableMode(BOOL mode){ + BCMenu::original_select_disabled=mode; + BCMenu::xp_select_disabled=mode; + }; + static int BCMenu::GetMenuDrawMode(void); + static BOOL BCMenu::GetSelectDisableMode(void); + + // how the bitmaps are drawn in XP Luna mode + static void SetXPBitmap3D(BOOL val){ + BCMenu::xp_draw_3D_bitmaps=val; + }; + static BOOL GetXPBitmap3D(void){return BCMenu::xp_draw_3D_bitmaps;} + + // Customizing: + // Set icon size + void SetIconSize (int, int); + // set the color in the bitmaps that is the background transparent color + void SetBitmapBackground(COLORREF color); + void UnSetBitmapBackground(void); + // obsolete functions for setting how menu images are dithered for disabled menu options + BOOL GetDisableOldStyle(void); + void SetDisableOldStyle(void); + void UnSetDisableOldStyle(void); + static COLORREF LightenColor(COLORREF col,double factor); + static COLORREF DarkenColor(COLORREF col,double factor); + +// Miscellaneous Protected Member functions +protected: + static BOOL IsNewShell(void); + static BOOL IsWinXPLuna(void); + static BOOL IsLunaMenuStyle(void); + static BOOL IsWindowsClassicTheme(void); + BCMenuData *BCMenu::FindMenuItem(UINT nID); + BCMenu *FindMenuOption(int nId,int& nLoc); + BCMenu *FindAnotherMenuOption(int nId,int& nLoc,CArray&bcsubs, + CArray&bclocs); + BCMenuData *FindMenuOption(wchar_t *lpstrText); + void InsertSpaces(void); + void DrawCheckMark(CDC *pDC,int x,int y,COLORREF color); + void DrawRadioDot(CDC *pDC,int x,int y,COLORREF color); + BCMenuData *NewODMenu(UINT pos,UINT nFlags,UINT nID,CString string); + void SynchronizeMenu(void); + void BCMenu::InitializeMenuList(int value); + void BCMenu::DeleteMenuList(void); + BCMenuData *BCMenu::FindMenuList(UINT nID); + void DrawItem_Win9xNT2000 (LPDRAWITEMSTRUCT lpDIS); + void DrawItem_WinXP (LPDRAWITEMSTRUCT lpDIS); + BOOL Draw3DCheckmark(CDC *dc, const CRect& rc,BOOL bSelected,HBITMAP hbmCheck); + BOOL DrawXPCheckmark(CDC *dc, const CRect& rc, HBITMAP hbmCheck,COLORREF &colorout); + void DitherBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, + int nHeight, HBITMAP hbm, int nXSrc, int nYSrc,COLORREF bgcolor); + void DitherBlt2(CDC *drawdc, int nXDest, int nYDest, int nWidth, + int nHeight, CBitmap &bmp, int nXSrc, int nYSrc,COLORREF bgcolor); + BOOL GetBitmapFromImageList(CDC* pDC,CImageList *imglist,int nIndex,CBitmap &bmp); + BOOL ImageListDuplicate(CImageList *il,int xoffset,CImageList *newlist); + static WORD NumBitmapColors(LPBITMAPINFOHEADER lpBitmap); + void ColorBitmap(CDC* pDC, CBitmap& bmp,CSize bitmap_size,CSize icon_size,COLORREF fill,COLORREF border,int hatchstyle=-1); + void RemoveTopLevelOwnerDraw(void); + int GetMenuStart(void); + void GetFadedBitmap(CBitmap &bmp); + void GetShadowBitmap(CBitmap &bmp); + int AddToGlobalImageList(CImageList *il,int xoffset,int nID); + int GlobalImageListOffset(int nID); + BOOL CanDraw3DImageList(int offset); + +// Member Variables +protected: + CTypedPtrArray m_MenuList; // Stores list of menu items + // When loading an owner-drawn menu using a Resource, BCMenu must keep track of + // the popup menu's that it creates. Warning, this list *MUST* be destroyed + // last item first :) + CTypedPtrArray m_SubMenus; // Stores list of sub-menus + // Stores a list of all BCMenu's ever created + static CTypedPtrArray m_AllSubMenus; + // Global ImageList + static CImageList m_AllImages; + static CArray m_AllImagesID; + // icon size + int m_iconX,m_iconY; + COLORREF m_bitmapBackground; + BOOL m_bitmapBackgroundFlag; + BOOL disable_old_style; + static UINT original_drawmode; + static BOOL original_select_disabled; + static UINT xp_drawmode; + static BOOL xp_select_disabled; + static BOOL xp_draw_3D_bitmaps; + CImageList *checkmaps; + BOOL checkmapsshare; + int m_selectcheck; + int m_unselectcheck; + BOOL m_bDynIcons; + BOOL m_loadmenu; +}; + +class BCMenuToolBar : public CToolBar{ +public: + BCMenuToolBar() : CToolBar() {m_iconX=m_iconY=0;} + BOOL LoadToolBar(LPCTSTR lpszResourceName); + BOOL LoadToolBar(UINT nIDResource){ + return LoadToolBar(MAKEINTRESOURCE(nIDResource)); + } + BOOL LoadBitmap(LPCTSTR lpszResourceName); + void GetIconSize(int &iconx,int &icony){iconx=m_iconX;icony=m_iconY;} +protected: + int m_iconX,m_iconY; +}; + +#define BCMENU_USE_MEMDC + +#ifdef BCMENU_USE_MEMDC +////////////////////////////////////////////////// +// BCMenuMemDC - memory DC +// +// Author: Keith Rule +// Email: keithr@europa.com +// Copyright 1996-1997, Keith Rule +// +// You may freely use or modify this code provided this +// Copyright is included in all derived versions. +// +// History - 10/3/97 Fixed scrolling bug. +// Added print support. +// 25 feb 98 - fixed minor assertion bug +// +// This class implements a memory Device Context + +class BCMenuMemDC : public CDC +{ +public: + + // constructor sets up the memory DC + BCMenuMemDC(CDC* pDC,LPCRECT lpSrcRect) : CDC() + { + ASSERT(pDC != NULL); + + m_rect.CopyRect(lpSrcRect); + m_pDC = pDC; + m_pOldBitmap = NULL; + m_bMemDC = !pDC->IsPrinting(); + + if (m_bMemDC) // Create a Memory DC + { + CreateCompatibleDC(pDC); + m_bitmap.CreateCompatibleBitmap(pDC, m_rect.Width(), m_rect.Height()); + m_pOldBitmap = SelectObject(&m_bitmap); + SetWindowOrg(m_rect.left, m_rect.top); + } + else // Make a copy of the relevent parts of the current DC for printing + { + m_bPrinting = pDC->m_bPrinting; + m_hDC = pDC->m_hDC; + m_hAttribDC = pDC->m_hAttribDC; + } + } + + // Destructor copies the contents of the mem DC to the original DC + ~BCMenuMemDC() + { + if (m_bMemDC) + { + // Copy the offscreen bitmap onto the screen. + m_pDC->BitBlt(m_rect.left, m_rect.top, m_rect.Width(), m_rect.Height(), + this, m_rect.left, m_rect.top, SRCCOPY); + + //Swap back the original bitmap. + SelectObject(m_pOldBitmap); + } else { + // All we need to do is replace the DC with an illegal value, + // this keeps us from accidently deleting the handles associated with + // the CDC that was passed to the constructor. + m_hDC = m_hAttribDC = NULL; + } + } + + // Allow usage as a pointer + BCMenuMemDC* operator->() {return this;} + + // Allow usage as a pointer + operator BCMenuMemDC*() {return this;} + +private: + CBitmap m_bitmap; // Offscreen bitmap + CBitmap* m_pOldBitmap; // bitmap originally found in BCMenuMemDC + CDC* m_pDC; // Saves CDC passed in constructor + CRect m_rect; // Rectangle of drawing area. + BOOL m_bMemDC; // TRUE if CDC really is a Memory DC. +}; + +#endif + +#endif + +//************************************************************************* diff --git a/Src/CH91PayloadSoftware/BackgroundUtil.cpp b/Src/CH91PayloadSoftware/BackgroundUtil.cpp new file mode 100644 index 0000000..726ee36 --- /dev/null +++ b/Src/CH91PayloadSoftware/BackgroundUtil.cpp @@ -0,0 +1,138 @@ +#include "stdafx.h" +#include "BackgroundUtil.h" +// Download by http://www.codefans.net +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[]=__FILE__; +#define new DEBUG_NEW +#endif + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CBackgroundUtil::CBackgroundUtil() +{ +} + + +CBackgroundUtil::~CBackgroundUtil() +{ + m_BmpPattern.Detach(); + m_BmpPalette.Detach(); +} + + +BOOL CBackgroundUtil::SetBitmap(UINT uResourceID) +{ + BITMAP bm; + BOOL bRet; + + // Detach previous resources + m_BmpPattern.Detach(); + m_BmpPalette.Detach(); + + // Default return value + bRet = TRUE; + + // Load new bitmap + if (uResourceID != 0) + { + bRet = GetBitmapAndPalette(uResourceID, m_BmpPattern, m_BmpPalette); + // If all ok + if (bRet == TRUE) + { + // Get dimension + m_BmpPattern.GetBitmap(&bm); + // Width of the bitmap + m_nBmpWidth = bm.bmWidth; + // Height of the bitmap + m_nBmpHeight = bm.bmHeight; + } + } + + return bRet; +} // End of SetBitmap + + +BOOL CBackgroundUtil::GetBitmapAndPalette(UINT nIDResource, CBitmap & bitmap, CPalette & pal) +{ + LPCTSTR lpszResourceName = (LPCTSTR)nIDResource; + + HBITMAP hBmp = (HBITMAP)::LoadImage( AfxGetInstanceHandle(), + lpszResourceName, IMAGE_BITMAP, 0,0, LR_CREATEDIBSECTION); + + if (hBmp == NULL) return FALSE; + + bitmap.Attach(hBmp); + + // Create a logical palette for the bitmap + DIBSECTION ds; + BITMAPINFOHEADER &bmInfo = ds.dsBmih; + bitmap.GetObject(sizeof(ds), &ds); + + int nColors = bmInfo.biClrUsed ? bmInfo.biClrUsed : 1 << bmInfo.biBitCount; + + // Create a halftone palette if colors > 256. + CClientDC dc(NULL); // Desktop DC + + if(nColors > 256) + pal.CreateHalftonePalette(&dc); + else + { + // Create the palette + RGBQUAD *pRGB = new RGBQUAD[nColors]; + CDC memDC; + memDC.CreateCompatibleDC(&dc); + memDC.SelectObject( &bitmap ); + ::GetDIBColorTable( memDC, 0, nColors, pRGB ); + UINT nSize = sizeof(LOGPALETTE) + (sizeof(PALETTEENTRY) * nColors); + LOGPALETTE *pLP = (LOGPALETTE *) new BYTE[nSize]; + pLP->palVersion = 0x300; + pLP->palNumEntries = nColors; + for (int i=0; i < nColors; i++) + { + pLP->palPalEntry[i].peRed = pRGB[i].rgbRed; + pLP->palPalEntry[i].peGreen = pRGB[i].rgbGreen; + pLP->palPalEntry[i].peBlue = pRGB[i].rgbBlue; + pLP->palPalEntry[i].peFlags = 0; + } + pal.CreatePalette( pLP ); + delete[] pLP; + delete[] pRGB; + } + return TRUE; +} // End of GetBitmapAndPalette + + +BOOL CBackgroundUtil::TileBitmap(CDC* pDC, CRect rc) +{ + CDC MemDC; + + int x = 0, y = 0; + + // If there is a bitmap loaded + if (m_BmpPattern.m_hObject != NULL) + { + MemDC.CreateCompatibleDC(pDC); + CBitmap* pOldBitmap = MemDC.SelectObject(&m_BmpPattern); + + // Tile the bitmap + while (y < rc.Height()) + { + while(x < rc.Width()) + { + pDC->BitBlt(x, y, m_nBmpWidth, m_nBmpHeight, &MemDC, 0, 0, SRCCOPY); + x += m_nBmpWidth; + } + x = 0; + y += m_nBmpHeight; + } + + MemDC.SelectObject(pOldBitmap); + + return TRUE; + } + + return FALSE; // Normal behaviour +} // End of TileBitmap diff --git a/Src/CH91PayloadSoftware/BackgroundUtil.h b/Src/CH91PayloadSoftware/BackgroundUtil.h new file mode 100644 index 0000000..23b9a50 --- /dev/null +++ b/Src/CH91PayloadSoftware/BackgroundUtil.h @@ -0,0 +1,25 @@ +#ifndef _BACKGROUNDUTIL_H_ +#define _BACKGROUNDUTIL_H_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +class CBackgroundUtil +{ +public: + BOOL SetBitmap(UINT uResourceID = 0); + CBackgroundUtil(); + virtual ~CBackgroundUtil(); + +protected: + BOOL TileBitmap(CDC* pDC, CRect rc); + BOOL GetBitmapAndPalette(UINT nIDResource, CBitmap& bitmap, CPalette& pal); + // For background bitmap + CBitmap m_BmpPattern; + CPalette m_BmpPalette; + int m_nBmpWidth; + int m_nBmpHeight; +}; + +#endif diff --git a/Src/CH91PayloadSoftware/BitmapSlider.cpp b/Src/CH91PayloadSoftware/BitmapSlider.cpp new file mode 100644 index 0000000..0a551ac --- /dev/null +++ b/Src/CH91PayloadSoftware/BitmapSlider.cpp @@ -0,0 +1,1010 @@ +// BitmapSlider.cpp : implementation file +// + +#include "stdafx.h" +#include "BitmapSlider.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// +// CBitmapSlider v1.5 +// +// It's free for everywhere - 16/September/2003 - Joon-ho Ryu +// +///////////////////////////////////////////////////////////////////////////// + + +CBitmapSlider::CBitmapSlider() +{ + m_nPos = m_nMin = 0; + m_nMax = 100; + m_nPage = 20; + + m_nMarginLeft = m_nMarginRight = m_nMarginTop = m_nMarginBottom = 0; + m_nThumbWidth = m_nThumbHeight = 0; + + m_bChannel = m_bVertical = m_bThumb = m_bLButtonDown = FALSE; + + m_bFocusRect = m_bFocus = FALSE; + m_bDrawFocusRect = TRUE; + + m_bEnable = TRUE; + + m_nThumbBgX = m_nThumbBgY = -1; +} + +CBitmapSlider::~CBitmapSlider() +{ +} + + +BEGIN_MESSAGE_MAP(CBitmapSlider, CStatic) + //{{AFX_MSG_MAP(CBitmapSlider) + ON_WM_ERASEBKGND() + ON_WM_PAINT() + ON_WM_LBUTTONDOWN() + ON_WM_MOUSEMOVE() + ON_WM_LBUTTONUP() + ON_WM_GETDLGCODE() + ON_WM_KEYDOWN() + ON_WM_KILLFOCUS() + ON_WM_SETFOCUS() + ON_WM_CREATE() + ON_WM_DESTROY() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CBitmapSlider message handlers + +BOOL CBitmapSlider::OnEraseBkgnd(CDC* pDC) +{ + // Do not erase background for the transparency effect + return TRUE; +} + +// Draw channel and thumb +// +void CBitmapSlider::OnPaint() +{ + CPaintDC dcOrigin(this); + + // "Flicker Free Drawing In MFC" by Keith Rule + CMemDC_Slider dc( &dcOrigin, &m_rect, m_bTransparentChannel ); + + CDC dcMem; + dcMem.CreateCompatibleDC( &dc ); + + CBitmap *pbmTmp; + + // Delete focus rectangle for transparent channel + if( m_bFocusRect && ( m_bTransparentChannel || !m_bChannel ) ) { + + dc.DrawFocusRect( m_rect ); + m_bFocusRect = FALSE; + } + + // Draw channel + if( m_bChannel ) { + + pbmTmp = dcMem.SelectObject( &m_bmChannel ); + + // There is a bitmap for active channel + if( m_bChannelActive && m_bEnable ) { + + // Vertical slider + if( m_bVertical ) { + + // Lower part + DrawBitmap( &dc, 0, Pos2Pixel(m_nPos), + m_nWidth, m_nHeight - Pos2Pixel(m_nPos), + &dcMem, 0, Pos2Pixel(m_nPos), + &m_bmChannelActiveMask, m_bTransparentChannel ); + + dcMem.SelectObject( &m_bmChannelActive ); + + // Upper part + DrawBitmap( &dc, 0, 0, m_nWidth, Pos2Pixel(m_nPos), + &dcMem, 0, 0, &m_bmChannelMask, m_bTransparentChannel ); + + // Horizontal slider + } else { + + // Right side + DrawBitmap( &dc, Pos2Pixel(m_nPos), 0, + m_nWidth - Pos2Pixel(m_nPos), m_nHeight, + &dcMem, Pos2Pixel(m_nPos), 0, + &m_bmChannelActiveMask, m_bTransparentChannel ); + + dcMem.SelectObject( &m_bmChannelActive ); + + // Left side + DrawBitmap( &dc, 0, 0, Pos2Pixel(m_nPos), m_nHeight, + &dcMem, 0, 0, &m_bmChannelMask, m_bTransparentChannel ); + } + + // Only one bitmap for channel + } else { + + DrawBitmap( &dc, 0, 0, m_nWidth, m_nHeight, + &dcMem, 0, 0, &m_bmChannelMask, m_bTransparentChannel ); + + } + + dcMem.SelectObject( pbmTmp ); + } + + // If there is a bitmap to restore background image of a thumb + if( m_nThumbBgX != -1 ) { + + RestoreBackground( + &dc, m_nThumbBgX, m_nThumbBgY, + m_nThumbWidth, m_nThumbHeight, &m_bmThumbBg ); + + m_nThumbBgX = -1; + } + + // Draw thumb + if( m_bThumb && m_bEnable ) { + + if( m_bThumbActive && m_bLButtonDown ) + pbmTmp = dcMem.SelectObject( &m_bmThumbActive ); // Active thumb + else + pbmTmp = dcMem.SelectObject( &m_bmThumb ); // Normal thumb + + // Vertical slider + if( m_bVertical ) { + + // Background image is need to be restored + if( m_bTransparentChannel || !m_bChannel ) { + + m_nThumbBgX = m_nMarginLeft; + m_nThumbBgY = Pos2Pixel(m_nPos) - m_nThumbHeight/2; + + CopyBackground( + &dc, m_nThumbBgX, m_nThumbBgY, + m_nThumbWidth, m_nThumbHeight, &m_bmThumbBg ); + } + + DrawBitmap( + &dc, m_nMarginLeft, Pos2Pixel(m_nPos) - m_nThumbHeight/2, + m_nThumbWidth, m_nThumbHeight, + &dcMem, 0, 0, &m_bmThumbMask, m_bTransparentThumb ); + + // Horizontal slider + } else { + + // Background image is need to be restored + if( m_bTransparentChannel || !m_bChannel ) { + + m_nThumbBgX = Pos2Pixel(m_nPos) - m_nThumbWidth/2; + m_nThumbBgY = m_nMarginTop; + + CopyBackground( + &dc, m_nThumbBgX, m_nThumbBgY, + m_nThumbWidth, m_nThumbHeight, &m_bmThumbBg ); + } + + DrawBitmap( + &dc, Pos2Pixel(m_nPos) - m_nThumbWidth/2, m_nMarginTop, + m_nThumbWidth, m_nThumbHeight, + &dcMem, 0, 0, &m_bmThumbMask, m_bTransparentThumb ); + + } // if horizontal + + dcMem.SelectObject( pbmTmp ); + + } // if draw thumb + + // Draw focus rectangle + if( m_bDrawFocusRect && m_bFocus && m_bEnable ) { + + dc.DrawFocusRect( m_rect ); + m_bFocusRect = TRUE; + } + + dcMem.DeleteDC(); +} + +// Sets the maximum range for the slider. +// +// Parameters: +// [IN] nMax +// Maximum position for the slider. +// [IN] bRedraw +// TRUE to redraw after the range is set. +// FALSE to only change maximum position. +// +void CBitmapSlider::SetRangeMax(int nMax, BOOL bRedraw) +{ + m_nMax = nMax; + if( bRedraw ) + Invalidate(); +} + +// Sets the minimum range for the slider. +// +// Parameters: +// [IN] nMin +// Minimum position for the slider. +// [IN] bRedraw +// TRUE to redraw after the range is set. +// FALSE to only change minimum position. +// +void CBitmapSlider::SetRangeMin(int nMin, BOOL bRedraw) +{ + m_nMin = nMin; + if( bRedraw ) + Invalidate(); +} + +// Sets the range (minimum and maximum positions) for the slider. +// +// Parameters: +// [IN] nMin +// Minimum position for the slider. +// [IN] nMax +// Maximum position for the slider. +// [IN] bRedraw +// TRUE to redraw after the range is set. +// FALSE to only change the range. +// +void CBitmapSlider::SetRange(int nMin, int nMax, BOOL bRedraw) +{ + SetRangeMin( nMin, FALSE ); + SetRangeMax( nMax, bRedraw ); +} + +// Sets the current position of the slider. +// +// Parameters: +// [IN] nPos +// Specifies the new slider position. +// +void CBitmapSlider::SetPos(int nPos) +{ + m_nPos = nPos; + + // Boundary check + if( m_nPos > m_nMax ) + m_nPos = m_nMax; + if( m_nPos < m_nMin ) + m_nPos = m_nMin; + + Invalidate(); +} + +// Sets the size of the page for a control. +// +// Parameters: +// [IN] nSize +// The new page size of the control. +// +// Return value: +// The previous page size. +// +int CBitmapSlider::SetPageSize(int nSize) +{ + int nRet = m_nPage; + + m_nPage = nSize; + + return nRet; +} + +// Sets the left, top, right, and bottom margins for a control +// +void CBitmapSlider::SetMargin(int nLeft, int nTop, int nRight, int nBottom ) +{ + SetMarginLeft( nLeft ); + SetMarginTop( nTop ); + SetMarginRight( nRight ); + SetMarginBottom( nBottom ); +} + +// Enables or disables control. +// +// [IN] bEnable +// TRUE to enable control. +// FALSE to disable control. +// +void CBitmapSlider::Enable(BOOL bEnable) +{ + m_bEnable = bEnable; + + // If control is disabled during dragging + if( !m_bEnable && m_bLButtonDown ) { + + m_bLButtonDown = FALSE; + ReleaseCapture(); + } + + Invalidate(); +} + +// Specify whether draw focus rectangle or not. +// +// [IN] bDraw +// TRUE to draw focus rectangle. +// FALSE to hide focus rectangle. +// +// [IN] bRedraw +// TRUE to redraw status is changed. +// FALSE to only change the status. +// +void CBitmapSlider::DrawFocusRect(BOOL bDraw, BOOL bRedraw) +{ + m_bDrawFocusRect = bDraw; + + if( bRedraw ) + Invalidate(); +} + +// Load bitmaps for a channel +// +// Parameters: +// [IN] nChannelID +// ID number of the bitmap resource of the channel. +// [IN] nActiveID +// ID number of the bitmap resource of the active channel. +// [IN] bTransparent +// TRUE to apply transparency effect. +// FALSE to display normal bitmap. +// [IN] clrpTransColor +// RGB color to treat as transparent. +// [IN] iTransPixelX +// Logical x-coordinate of a point. +// It's color will be treated as transparent. +// [IN] iTransPixelY +// Logical y-coordinate of a point. +// It's color will be treated as transparent. +// +// Return value: +// TRUE +// Function succeedes. +// FALSE +// Function failes to load bitmaps. +// +BOOL CBitmapSlider::SetBitmapChannel( + UINT nChannelID, UINT nActiveID , BOOL bTransparent, + COLORREF clrpTransColor, int iTransPixelX, int iTransPixelY ) +{ + // This control will not have any bitmap for channel + if( !nChannelID ) { + + m_bChannel = FALSE; + + m_bmChannel.DeleteObject(); + m_bmChannelMask.DeleteObject(); + m_bmChannelActive.DeleteObject(); + m_bmChannelActiveMask.DeleteObject(); + + return TRUE; + } + + // load a bitmap + m_bmChannel.DeleteObject(); + + if( !m_bmChannel.LoadBitmap( nChannelID ) ) + return FALSE; + + // Prepare mask for transparency effect. + if( bTransparent ) { + + PrepareMask( &m_bmChannel, &m_bmChannelMask, + clrpTransColor, iTransPixelX, iTransPixelY ); + } + + // Load a bitmap for active state. + if( nActiveID ) { + + m_bmChannelActive.DeleteObject(); + + if( !m_bmChannelActive.LoadBitmap( nActiveID ) ) { + + m_bmChannel.DeleteObject(); + if( bTransparent ) + m_bmChannelMask.DeleteObject(); + + return FALSE; + } + + if( bTransparent ) { + + PrepareMask( &m_bmChannelActive, &m_bmChannelActiveMask, + clrpTransColor, iTransPixelX, iTransPixelY ); + } + + m_bChannelActive = TRUE; + + // There is no bitmap for active state. + } else + m_bChannelActive = FALSE; + + // Get size of bitmap. + BITMAP bitmap; + m_bmChannel.GetBitmap( &bitmap ); + + m_nWidth = bitmap.bmWidth; + m_nHeight = bitmap.bmHeight; + + // Compare size + if( m_bChannelActive ) { + + BITMAP bitmap; + m_bmChannelActive.GetBitmap( &bitmap ); + + ASSERT( m_nWidth == bitmap.bmWidth && m_nHeight == bitmap.bmHeight ); + } + + // Change size of control as same as the bitmap. + SetWindowPos(NULL, 0, 0, m_nWidth, m_nHeight, SWP_NOZORDER | SWP_NOMOVE); + + GetClientRect( &m_rect ); + + m_bTransparentChannel = bTransparent; + m_bChannel = TRUE; + + return TRUE; +} + +// Load bitmaps for a thumb +// +// Parameters: +// [IN] nThumbID +// ID number of the bitmap resource of the thumb +// [IN] nActiveID +// ID number of the bitmap resource of the active thumb +// [IN] bTransparent +// TRUE to apply transparency effect +// FALSE to display normal bitmap +// [IN] clrpTransColor +// RGB color to treat as transparent +// [IN] iTransPixelX +// Logical x-coordinate of a point. +// It's color will be treated as transparent +// [IN] iTransPixelY +// Logical y-coordinate of a point. +// It's color will be treated as transparent +// +// Return value: +// TRUE +// Function succeedes. +// FALSE +// Function failes to load bitmaps. +// +BOOL CBitmapSlider::SetBitmapThumb( + UINT nThumbID, UINT nActiveID, BOOL bTransparent, + COLORREF clrpTransColor, int iTransPixelX, int iTransPixelY ) +{ + // This control will not have bitmap + if( !nThumbID ) { + + m_bThumb = FALSE; + + m_bmThumb.DeleteObject(); + m_bmThumbMask.DeleteObject(); + m_bmThumbActive.DeleteObject(); + m_bmThumbActiveMask.DeleteObject(); + m_bmThumbBg.DeleteObject(); + + return TRUE; + } + + // load a bitmap + m_bmThumb.DeleteObject(); + + if( !m_bmThumb.LoadBitmap( nThumbID ) ) + return FALSE; + + // Prepare mask for transparency effect. + if( bTransparent ) { + + PrepareMask( &m_bmThumb, &m_bmThumbMask, + clrpTransColor, iTransPixelX, iTransPixelY ); + } + + // Load a bitmap for active state. + if( nActiveID ) { + + m_bmThumbActive.DeleteObject(); + + if( !m_bmThumbActive.LoadBitmap( nActiveID ) ) { + + m_bmThumb.DeleteObject(); + if( bTransparent ) + m_bmThumbMask.DeleteObject(); + + return FALSE; + } + + if( bTransparent ) { + + PrepareMask( &m_bmThumbActive, &m_bmThumbActiveMask, + clrpTransColor, iTransPixelX, iTransPixelY ); + } + + m_bThumbActive = TRUE; + + // There is no bitmap for active state. + } else + m_bThumbActive = FALSE; + + // Get size of the bitmap + BITMAP bitmap; + m_bmThumb.GetBitmap( &bitmap ); + + m_nThumbWidth = bitmap.bmWidth; + m_nThumbHeight = bitmap.bmHeight; + + // Get size of the control if there was no bitmap for channel. + if( !m_bChannel ) { + + GetClientRect( &m_rect ); + m_nHeight = m_rect.Height(); + m_nWidth = m_rect.Width(); + } + + ASSERT( m_nThumbWidth <= m_nWidth && m_nThumbHeight <= m_nHeight ); + + // Compare size + if( m_bThumbActive ) { + + BITMAP bitmap; + m_bmThumbActive.GetBitmap( &bitmap ); + + ASSERT( + m_nThumbWidth == bitmap.bmWidth && + m_nThumbHeight == bitmap.bmHeight ); + } + + // Set attributes + m_bTransparentThumb = bTransparent; + m_bThumb = TRUE; + + return TRUE; +} + +// OnLButtonDown +// +// Dragging is started +// +void CBitmapSlider::OnLButtonDown(UINT nFlags, CPoint point) +{ + if( !m_bEnable ) + return; + + SetCapture(); + SetFocus(); + + m_bLButtonDown = TRUE; + + // If mouse button is clicked on the thumb, + // capture the coordinates of mouse pointer and center of thumb + // and calculate distance between them. + if( m_bVertical ) + { + + if( abs( point.y - Pos2Pixel( m_nPos ) ) <= m_nThumbHeight / 2 ) + m_nMouseOffset = point.y - Pos2Pixel( m_nPos ); + else + m_nMouseOffset = 0; + + } + else + { + + if( abs( point.x - Pos2Pixel( m_nPos ) ) <= m_nThumbWidth / 2 ) + m_nMouseOffset = point.x - Pos2Pixel( m_nPos ); + else + m_nMouseOffset = 0; + } + + OnMouseMove( nFlags, point ); + Invalidate(); + + CStatic::OnLButtonDown(nFlags, point); +} + +// OnMouseMove +// +// During dragging +// +void CBitmapSlider::OnMouseMove(UINT nFlags, CPoint point) +{ + if( !m_bLButtonDown || !m_bEnable ) + return; + + int nPixel; + + // Boundary check + if( m_bVertical ) { + + nPixel = point.y - m_nMouseOffset; + + if( nPixel > m_nHeight - m_nMarginBottom - m_nThumbHeight/2 ) + nPixel = m_nHeight - m_nMarginBottom - m_nThumbHeight/2; + + if( nPixel < m_nMarginTop + m_nThumbHeight/2 ) + nPixel = m_nMarginTop + m_nThumbHeight/2; + + } else { + + nPixel = point.x - m_nMouseOffset; + + if( nPixel < m_nMarginLeft + m_nThumbWidth/2 ) + nPixel = m_nMarginLeft + m_nThumbWidth/2; + + if( nPixel > m_nWidth - m_nMarginRight - m_nThumbWidth/2 ) + nPixel = m_nWidth - m_nMarginRight - m_nThumbWidth/2; + } + + // Apply change + if( Pos2Pixel(m_nPos) != nPixel ) { + + SetPos( Pixel2Pos( nPixel ) ); + + ::PostMessage( + GetParent()->GetSafeHwnd(), WM_BITMAPSLIDER_MOVING, + GetDlgCtrlID(), m_nPos ); + } + + CStatic::OnMouseMove(nFlags, point); +} + +// OnLButtonUp +// +// Dragging is finished +// +void CBitmapSlider::OnLButtonUp(UINT nFlags, CPoint point) +{ + if( !m_bEnable ) + return; + + ReleaseCapture(); + m_bLButtonDown = FALSE; + + Invalidate(); + + ::PostMessage( + GetParent()->GetSafeHwnd(), WM_BITMAPSLIDER_MOVED, + GetDlgCtrlID(), m_nPos ); + + CStatic::OnLButtonUp(nFlags, point); +} + +// Calculate point of thumb from position value +// +int CBitmapSlider::Pos2Pixel(int nPos) +{ + if( m_bVertical ) { + + return + m_nMarginTop + m_nThumbHeight/2 + + (int)( + ( m_nHeight - m_nMarginTop - m_nMarginBottom - m_nThumbHeight ) * + ((double) ( nPos - m_nMin ) / ( m_nMax - m_nMin ) ) + ); + + } else { + + return (int)( + ( m_nWidth - m_nMarginLeft - m_nMarginRight - m_nThumbWidth ) * + ((double) ( nPos - m_nMin ) / ( m_nMax - m_nMin ) ) + ) + m_nMarginLeft + m_nThumbWidth/2; + } +} + +// Calculate position value from point of mouse +// +int CBitmapSlider::Pixel2Pos(int nPixel) +{ + if( m_bVertical ) { + + return (int)( + m_nMin + + (double)( nPixel - m_nMarginTop - m_nThumbHeight/2) / + ( m_nHeight - m_nMarginBottom - m_nMarginTop - m_nThumbHeight ) * + ( m_nMax - m_nMin ) + ); + + } else { + + return (int)( + m_nMin + + (double)( nPixel - m_nMarginLeft - m_nThumbWidth/2 ) / + ( m_nWidth - m_nMarginLeft - m_nMarginRight - m_nThumbWidth ) * + ( m_nMax - m_nMin ) + ); + } +} + +// Copy background image to bitmap +// +void CBitmapSlider::CopyBackground( + CDC *pDC, int nXSrc, int nYSrc, int nWidth, int nHeight, CBitmap *pBmDst) +{ + pBmDst->DeleteObject(); + pBmDst->CreateCompatibleBitmap( pDC, nWidth, nHeight ); + + CDC memDC; + + memDC.CreateCompatibleDC( pDC ); + CBitmap *pBmTmp = memDC.SelectObject( pBmDst ); + + memDC.BitBlt( 0, 0, nWidth, nHeight, pDC, nXSrc, nYSrc, SRCCOPY ); + + memDC.SelectObject( pBmTmp ); + memDC.DeleteDC(); +} + +// Restore background image from bitmap +// +void CBitmapSlider::RestoreBackground( + CDC *pDC, int nXDst, int nYDst, int nWidth, int nHeight, CBitmap *pBmSrc) +{ + CDC memDC; + + memDC.CreateCompatibleDC( pDC ); + CBitmap *pBmTmp = memDC.SelectObject( pBmSrc ); + + pDC->BitBlt( nXDst, nYDst, nWidth, nHeight, &memDC, 0, 0, SRCCOPY ); + + memDC.SelectObject( pBmTmp ); + memDC.DeleteDC(); +} + +// DrawBitmap +// +// It's for code readability +// +void CBitmapSlider::DrawBitmap( + CDC *pDC, int xStart, int yStart, int wWidth, int wHeight, + CDC *pTmpDC, int xSource, int ySource, CBitmap *bmMask, BOOL bTransparent ) +{ + if( bTransparent ) { + + DrawTransparentBitmap( + pDC, xStart, yStart, + wWidth, wHeight, + pTmpDC, xSource, ySource, bmMask ); + + } else { + + pDC->BitBlt( xStart, yStart, + wWidth, wHeight, + pTmpDC, xSource, ySource, SRCCOPY ); + } +} + +// PrepareMask +// +// "Drawing Transparent Bitmap with ease with on the fly masks in MFC" +// By Raja Segar +// +// I changed default clrpTransColor value from NULL(black) to 0xFF000000(not RGB color) +// +void CBitmapSlider::PrepareMask( + CBitmap *pBmpSource, CBitmap *pBmpMask, + COLORREF clrpTransColor, int iTransPixelX, int iTransPixelY) +{ + BITMAP bm; + + // Get the dimensions of the source bitmap + pBmpSource->GetObject(sizeof(BITMAP), &bm); + + // Create the mask bitmap + pBmpMask->DeleteObject(); + pBmpMask->CreateBitmap( bm.bmWidth, bm.bmHeight, 1, 1, NULL); + + // We will need two DCs to work with. One to hold the Image + // (the source), and one to hold the mask (destination). + // When blitting onto a monochrome bitmap from a color, pixels + // in the source color bitmap that are equal to the background + // color are blitted as white. All the remaining pixels are + // blitted as black. + + CDC hdcSrc, hdcDst; + + hdcSrc.CreateCompatibleDC(NULL); + hdcDst.CreateCompatibleDC(NULL); + + // Load the bitmaps into memory DC + CBitmap* hbmSrcT = (CBitmap*) hdcSrc.SelectObject(pBmpSource); + CBitmap* hbmDstT = (CBitmap*) hdcDst.SelectObject(pBmpMask); + + // Dynamically get the transparent color + COLORREF clrTrans; + if (clrpTransColor == 0xFF000000) + { + // User did not specify trans color so get it from bmp + clrTrans = hdcSrc.GetPixel(iTransPixelX, iTransPixelY); + } + else + { + clrTrans = clrpTransColor; + } + + + // Change the background to trans color + COLORREF clrSaveBk = hdcSrc.SetBkColor(clrTrans); + + // This call sets up the mask bitmap. + hdcDst.BitBlt(0,0,bm.bmWidth, bm.bmHeight, &hdcSrc,0,0,SRCCOPY); + + // Now, we need to paint onto the original image, making + // sure that the "transparent" area is set to black. What + // we do is AND the monochrome image onto the color Image + // first. When blitting from mono to color, the monochrome + // pixel is first transformed as follows: + // if 1 (black) it is mapped to the color set by SetTextColor(). + // if 0 (white) is is mapped to the color set by SetBkColor(). + // Only then is the raster operation performed. + + COLORREF clrSaveDstText = hdcSrc.SetTextColor(RGB(255,255,255)); + hdcSrc.SetBkColor(RGB(0,0,0)); + + hdcSrc.BitBlt(0,0,bm.bmWidth, bm.bmHeight, &hdcDst,0,0,SRCAND); + + // Clean up by deselecting any objects, and delete the + // DC's. + hdcDst.SetTextColor(clrSaveDstText); + + hdcSrc.SetBkColor(clrSaveBk); + hdcSrc.SelectObject(hbmSrcT); + hdcDst.SelectObject(hbmDstT); + + hdcSrc.DeleteDC(); + hdcDst.DeleteDC(); +} + +// DrawTransparentBitmap +// +// "Drawing Transparent Bitmap with ease with on the fly masks in MFC" +// By Raja Segar +// +void CBitmapSlider::DrawTransparentBitmap( + CDC *pDC, int xStart, int yStart, int wWidth, int wHeight, + CDC *pTmpDC, int xSource, int ySource, CBitmap *bmMask ) +{ + // We are going to paint the two DDB's in sequence to the destination. + // 1st the monochrome bitmap will be blitted using an AND operation to + // cut a hole in the destination. The color image will then be ORed + // with the destination, filling it into the hole, but leaving the + // surrounding area untouched. + + CDC hdcMem; + hdcMem.CreateCompatibleDC(NULL); + + CBitmap* hbmT = hdcMem.SelectObject(bmMask); + + pDC->BitBlt( xStart, yStart, wWidth, wHeight, &hdcMem, + xSource, ySource, SRCAND); + + // Also note the use of SRCPAINT rather than SRCCOPY. + + pDC->BitBlt(xStart, yStart, wWidth, wHeight, pTmpDC, + xSource, ySource,SRCPAINT); + + // Now, clean up. + hdcMem.SelectObject(hbmT); + hdcMem.DeleteDC(); +} + +// To get keyboard input +// +UINT CBitmapSlider::OnGetDlgCode() +{ + if( GetKeyState(VK_TAB) >= 0 ) { + + return DLGC_WANTALLKEYS; + } + + return CStatic::OnGetDlgCode(); +} + +// Handling keyboard input +// +void CBitmapSlider::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) +{ + if( !m_bEnable ) + return; + + switch( nChar ) { + + // Left & up + case VK_LEFT : + case VK_UP : + + SetPos( m_nPos-1 ); + break; + + // Right & down + case VK_RIGHT : + case VK_DOWN : + + SetPos( m_nPos+1 ); + break; + + // Home + case VK_HOME : + + SetPos( m_nMin ); + break; + + // End + case VK_END : + + SetPos( m_nMax ); + break; + + // Page up + case VK_PRIOR : + + SetPos( m_nPos - m_nPage ); + break; + + // Page down + case VK_NEXT : + + SetPos( m_nPos + m_nPage ); + break; + + default : + + CStatic::OnKeyDown(nChar, nRepCnt, nFlags); + return; + } + + ::PostMessage( + GetParent()->GetSafeHwnd(), WM_BITMAPSLIDER_MOVED, + GetDlgCtrlID(), m_nPos ); + + CStatic::OnKeyDown(nChar, nRepCnt, nFlags); +} + +// Control looses its focus +// +void CBitmapSlider::OnKillFocus(CWnd* pNewWnd) +{ + CStatic::OnKillFocus(pNewWnd); + + m_bFocus = FALSE; + Invalidate(); +} + +// This control gains its focus +// +void CBitmapSlider::OnSetFocus(CWnd* pOldWnd) +{ + CStatic::OnSetFocus(pOldWnd); + + m_bFocus = TRUE; + Invalidate(); +} + +// Release resources +// +void CBitmapSlider::OnDestroy() +{ + CStatic::OnDestroy(); + + m_bmThumb.DeleteObject(); + m_bmThumbMask.DeleteObject(); + + m_bmThumbActive.DeleteObject(); + m_bmThumbActiveMask.DeleteObject(); + + m_bmThumbBg.DeleteObject(); + + m_bmChannel.DeleteObject(); + m_bmChannelMask.DeleteObject(); + + m_bmChannelActive.DeleteObject(); + m_bmChannelActiveMask.DeleteObject(); +} diff --git a/Src/CH91PayloadSoftware/BitmapSlider.h b/Src/CH91PayloadSoftware/BitmapSlider.h new file mode 100644 index 0000000..d8a8c04 --- /dev/null +++ b/Src/CH91PayloadSoftware/BitmapSlider.h @@ -0,0 +1,145 @@ +#if !defined(AFX_BITMAPSLIDER_H__BED36788_B60C_4C9E_AC56_FE430B93A0FD__INCLUDED_) +#define AFX_BITMAPSLIDER_H__BED36788_B60C_4C9E_AC56_FE430B93A0FD__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 +// BitmapSlider.h : header file +// + +///////////////////////////////////////////////////////////////////////////// +// +// CBitmapSlider v1.5 +// +// It's free for everywhere - 16/September/2003 - Joon-ho Ryu +// +///////////////////////////////////////////////////////////////////////////// + +#include "memdc.h" // "Flicker Free Drawing In MFC" by Keith Rule + +#define WM_BITMAPSLIDER_MOVING WM_USER + 9425 +#define WM_BITMAPSLIDER_MOVED WM_USER + 9426 + +class CBitmapSlider : public CStatic +{ +// Construction +public: + CBitmapSlider(); + +// Attributes +public: + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CBitmapSlider) + //}}AFX_VIRTUAL + +// Implementation +public: + + void GetRange( int &nMin, int &nMax ) { nMin = m_nMin; nMax = m_nMax; }; + int GetRangeMax() { return m_nMax; }; + int GetRangeMin() { return m_nMin; }; + + int GetPos() { return m_nPos; }; + + void SetRange( int nMin, int nMax, BOOL bRedraw=FALSE ); + void SetRangeMin(int nMin, BOOL bRedraw = FALSE); + void SetRangeMax( int nMax, BOOL bRedraw = FALSE ); + + void SetPos( int nPos ); + int SetPageSize( int nSize ); + + BOOL SetBitmapChannel( + UINT nChannelID, UINT nActiveID=NULL, BOOL bTransparent=FALSE, + COLORREF clrpTransColor=0xFF000000, int iTransPixelX=0, int iTransPixelY=0 ); + + BOOL SetBitmapThumb( + UINT nThumbID, UINT nActiveID=NULL, BOOL bTransparent=FALSE, + COLORREF clrpTransColor=0xFF000000, int iTransPixelX=0, int iTransPixelY=0 ); + + void SetMargin( int nLeft, int nTop, int nRight, int nBottom ); + void SetMarginTop( int nMargin ) { m_nMarginTop = nMargin; }; + void SetMarginLeft( int nMargin ) { m_nMarginLeft = nMargin; }; + void SetMarginRight( int nMargin ) { m_nMarginRight = nMargin; }; + void SetMarginBottom( int nMargin ) { m_nMarginBottom = nMargin; }; + + void SetVertical( BOOL bVertical=TRUE ) { m_bVertical = bVertical; }; + + void Enable( BOOL bEnable = TRUE ); + + void DrawFocusRect( BOOL bDraw = TRUE, BOOL bRedraw = FALSE ); + + virtual ~CBitmapSlider(); + + // Generated message map functions +protected: + void RestoreBackground( + CDC *pDC, int nXDst, int nYDst, int nWidth, int nHeight, CBitmap *pBmSrc); + + void CopyBackground( + CDC *pDC, int nXSrc, int nYSrc, int nWidth, int nHeight, CBitmap *pBmDst ); + + void DrawBitmap( + CDC* pDC, int xStart, int yStart, int wWidth, int wHeight, + CDC* pTmpDC, int xSource, int ySource, + CBitmap *bmMask = NULL, BOOL bTransparent = FALSE ); + + + void DrawTransparentBitmap( + CDC* pDC, int xStart, int yStart, int wWidth, int wHeight, + CDC* pTmpDC, int xSource, int ySource, CBitmap *bmMask ); + + void PrepareMask( + CBitmap* pBmpSource, CBitmap* pBmpMask, + COLORREF clrpTransColor=0xFF000000, int iTransPixelX=0, int iTransPixelY=0 ); + + int Pixel2Pos( int nPixel ); + int Pos2Pixel( int nPos ); + + int m_nMax, m_nMin, m_nPos, m_nPage; + + CRect m_rect; + int m_nWidth, m_nHeight; + int m_nThumbWidth, m_nThumbHeight; + int m_nMarginLeft, m_nMarginRight, m_nMarginTop, m_nMarginBottom; + int m_nThumbBgX, m_nThumbBgY; + int m_nMouseOffset; + + BOOL m_bVertical; + BOOL m_bChannelActive, m_bThumbActive; + BOOL m_bTransparentChannel, m_bTransparentThumb, m_bThumb, m_bChannel; + BOOL m_bLButtonDown, m_bFocus, m_bFocusRect, m_bDrawFocusRect; + BOOL m_bEnable; + + CBitmap m_bmChannel, m_bmChannelMask, m_bmChannelActive, m_bmChannelActiveMask; + CBitmap m_bmThumb, m_bmThumbMask, m_bmThumbActive, m_bmThumbActiveMask, m_bmThumbBg; + + //{{AFX_MSG(CBitmapSlider) + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg UINT OnGetDlgCode(); + afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnKillFocus(CWnd* pNewWnd); + afx_msg void OnSetFocus(CWnd* pOldWnd); + afx_msg void OnDestroy(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +private: + // This is CStatic method + void SetBitmap( HBITMAP hBitmap ) {}; +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_BITMAPSLIDER_H__BED36788_B60C_4C9E_AC56_FE430B93A0FD__INCLUDED_) diff --git a/Src/CH91PayloadSoftware/BkDialog.cpp b/Src/CH91PayloadSoftware/BkDialog.cpp new file mode 100644 index 0000000..7762dfb --- /dev/null +++ b/Src/CH91PayloadSoftware/BkDialog.cpp @@ -0,0 +1,66 @@ +// BkDialog.cpp : Defines the class behaviors for the application. +// + +#include "stdafx.h" +#include "BkDialog.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +CBkDialog::CBkDialog(CWnd* pParent /*=NULL*/) +{ + //{{AFX_DATA_INIT(CBkDialog) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT +} + + +CBkDialog::CBkDialog(UINT uResourceID, CWnd* pParent) + : CDialog(uResourceID, pParent) +{ +} + + +CBkDialog::CBkDialog(LPCTSTR pszResourceID, CWnd* pParent) + : CDialog(pszResourceID, pParent) +{ +} + + +CBkDialog::~CBkDialog() +{ +} + + +void CBkDialog::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CBkDialog) + // NOTE: the ClassWizard will add DDX and DDV calls here + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CBkDialog, CDialog) + //{{AFX_MSG_MAP(CBkDialog) + ON_WM_ERASEBKGND() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + + +BOOL CBkDialog::OnEraseBkgnd(CDC* pDC) +{ + CRect rc; + + GetClientRect(rc); + + m_pDC = pDC; + + if (TileBitmap(pDC, rc) == TRUE) + return TRUE; + else + return CDialog::OnEraseBkgnd(pDC); +} // End of OnEraseBkgnd diff --git a/Src/CH91PayloadSoftware/BkDialog.h b/Src/CH91PayloadSoftware/BkDialog.h new file mode 100644 index 0000000..221ce2e --- /dev/null +++ b/Src/CH91PayloadSoftware/BkDialog.h @@ -0,0 +1,50 @@ +#ifndef _BKDIALOG_H_ +#define _BKDIALOG_H_ + +#include "BackgroundUtil.h" + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CBkDialog dialog + +class CBkDialog : public CDialog, public CBackgroundUtil +{ +// Construction +public: + CDC* m_pDC; + ~CBkDialog(); + CBkDialog(LPCTSTR pszResourceID, CWnd* pParent = NULL); + CBkDialog(UINT uResourceID, CWnd* pParent = NULL); + CBkDialog(CWnd* pParent = NULL); // standard constructor + +// Dialog Data + //{{AFX_DATA(CBkDialog) + // NOTE: the ClassWizard will add data members here + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CBkDialog) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CBkDialog) + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif diff --git a/Src/CH91PayloadSoftware/BtnST.cpp b/Src/CH91PayloadSoftware/BtnST.cpp new file mode 100644 index 0000000..71800f8 --- /dev/null +++ b/Src/CH91PayloadSoftware/BtnST.cpp @@ -0,0 +1,1884 @@ +#include "stdafx.h" +#include "BtnST.h" +// Download by http://www.codefans.net +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CButtonST + +// Mask for control's type +#define BS_TYPEMASK SS_TYPEMASK + +CButtonST::CButtonST() +{ + m_bIsPressed = FALSE; + m_bIsFocused = FALSE; + m_bIsDisabled = FALSE; + m_bMouseOnButton = FALSE; + + FreeResources(FALSE); + + // Default type is "flat" button + m_bIsFlat = TRUE; + // Button will be tracked also if when the window is inactive (like Internet Explorer) + m_bAlwaysTrack = TRUE; + + // By default draw border in "flat" button + m_bDrawBorder = TRUE; + + // By default icon is aligned horizontally + m_byAlign = ST_ALIGN_HORIZ; + + // By default, for "flat" button, don't draw the focus rect + m_bDrawFlatFocus = FALSE; + + // By default the button is not the default button + m_bIsDefault = FALSE; + // Invalid value, since type still unknown + m_nTypeStyle = BS_TYPEMASK; + + // By default the button is not a checkbox + m_bIsCheckBox = FALSE; + m_nCheck = 0; + + // Set default colors + SetDefaultColors(FALSE); + + // No tooltip created + m_ToolTip.m_hWnd = NULL; + + // Do not draw as a transparent button + m_bDrawTransparent = FALSE; + m_pbmpOldBk = NULL; + + // No URL defined + SetURL(NULL); + + // No cursor defined + m_hCursor = NULL; + + // No associated menu +#ifndef BTNST_USE_BCMENU + m_hMenu = NULL; +#endif + m_hParentWndMenu = NULL; + m_bMenuDisplayed = FALSE; + + m_bShowDisabledBitmap = TRUE; +} // End of CButtonST + +CButtonST::~CButtonST() +{ + // Restore old bitmap (if any) + if (m_dcBk.m_hDC && m_pbmpOldBk) + { + m_dcBk.SelectObject(m_pbmpOldBk); + } // if + + FreeResources(); + + // Destroy the cursor (if any) + if (m_hCursor) ::DestroyCursor(m_hCursor); + + // Destroy the menu (if any) +#ifdef BTNST_USE_BCMENU + if (m_menuPopup.m_hMenu) m_menuPopup.DestroyMenu(); +#else + if (m_hMenu) ::DestroyMenu(m_hMenu); +#endif +} // End of ~CButtonST + +BEGIN_MESSAGE_MAP(CButtonST, CButton) + //{{AFX_MSG_MAP(CButtonST) + ON_WM_SETCURSOR() + ON_WM_KILLFOCUS() + ON_WM_MOUSEMOVE() + ON_WM_SYSCOLORCHANGE() + ON_CONTROL_REFLECT_EX(BN_CLICKED, OnClicked) + ON_WM_ACTIVATE() + ON_WM_ENABLE() + ON_WM_CANCELMODE() + ON_WM_GETDLGCODE() + ON_WM_CTLCOLOR_REFLECT() + //}}AFX_MSG_MAP +#ifdef BTNST_USE_BCMENU + ON_WM_MENUCHAR() + ON_WM_MEASUREITEM() +#endif + + ON_MESSAGE(BM_SETSTYLE, OnSetStyle) + ON_MESSAGE(WM_MOUSELEAVE, OnMouseLeave) + ON_MESSAGE(BM_SETCHECK, OnSetCheck) + ON_MESSAGE(BM_GETCHECK, OnGetCheck) +END_MESSAGE_MAP() + +void CButtonST::FreeResources(BOOL bCheckForNULL) +{ + if (bCheckForNULL) + { + // Destroy icons + // Note: the following two lines MUST be here! even if + // BoundChecker says they are unnecessary! + if (m_csIcons[0].hIcon) ::DestroyIcon(m_csIcons[0].hIcon); + if (m_csIcons[1].hIcon) ::DestroyIcon(m_csIcons[1].hIcon); + + // Destroy bitmaps + if (m_csBitmaps[0].hBitmap) ::DeleteObject(m_csBitmaps[0].hBitmap); + if (m_csBitmaps[1].hBitmap) ::DeleteObject(m_csBitmaps[1].hBitmap); + + // Destroy mask bitmaps + if (m_csBitmaps[0].hMask) ::DeleteObject(m_csBitmaps[0].hMask); + if (m_csBitmaps[1].hMask) ::DeleteObject(m_csBitmaps[1].hMask); + } // if + + ::ZeroMemory(&m_csIcons, sizeof(m_csIcons)); + ::ZeroMemory(&m_csBitmaps, sizeof(m_csBitmaps)); +} // End of FreeResources + +void CButtonST::PreSubclassWindow() +{ + UINT nBS; + + nBS = GetButtonStyle(); + + // Set initial control type + m_nTypeStyle = nBS & BS_TYPEMASK; + + // Check if this is a checkbox + if (nBS & BS_CHECKBOX) m_bIsCheckBox = TRUE; + + // Set initial default state flag + if (m_nTypeStyle == BS_DEFPUSHBUTTON) + { + // Set default state for a default button + m_bIsDefault = TRUE; + + // Adjust style for default button + m_nTypeStyle = BS_PUSHBUTTON; + } // If + + // You should not set the Owner Draw before this call + // (don't use the resource editor "Owner Draw" or + // ModifyStyle(0, BS_OWNERDRAW) before calling PreSubclassWindow() ) + ASSERT(m_nTypeStyle != BS_OWNERDRAW); + + // Switch to owner-draw + ModifyStyle(BS_TYPEMASK, BS_OWNERDRAW, SWP_FRAMECHANGED); + + CButton::PreSubclassWindow(); +} // End of PreSubclassWindow + +UINT CButtonST::OnGetDlgCode() +{ + UINT nCode = CButton::OnGetDlgCode(); + + // Tell the system if we want default state handling + // (losing default state always allowed) + nCode |= (m_bIsDefault ? DLGC_DEFPUSHBUTTON : DLGC_UNDEFPUSHBUTTON); + + return nCode; +} // End of OnGetDlgCode + +BOOL CButtonST::PreTranslateMessage(MSG* pMsg) +{ + InitToolTip(); + m_ToolTip.RelayEvent(pMsg); + + return CButton::PreTranslateMessage(pMsg); +} // End of PreTranslateMessage + +LRESULT CButtonST::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam) +{ + if (message == WM_LBUTTONDBLCLK) + { + message = WM_LBUTTONDOWN; + } // if + /* + switch (message) + { + case WM_LBUTTONDBLCLK: + message = WM_LBUTTONDOWN; + break; + case WM_MOVE: + CRect rect; + + GetClientRect(&rect); + if (::IsWindow(m_ToolTip.m_hWnd)) + { + if (m_ToolTip.GetToolCount() != 0) + m_ToolTip.SetToolRect(this, 1, &rect); + } // if + break; + } // switch + */ + return CButton::DefWindowProc(message, wParam, lParam); +} // End of DefWindowProc + +HBRUSH CButtonST::CtlColor(CDC* /*pDC*/, UINT /*nCtlColor*/) +{ + return (HBRUSH)::GetStockObject(NULL_BRUSH); +} // End of CtlColor + +void CButtonST::OnSysColorChange() +{ + CButton::OnSysColorChange(); + + m_dcBk.DeleteDC(); + m_bmpBk.DeleteObject(); +} // End of OnSysColorChange + +LRESULT CButtonST::OnSetStyle(WPARAM wParam, LPARAM lParam) +{ + UINT nNewType = (wParam & BS_TYPEMASK); + + // Update default state flag + if (nNewType == BS_DEFPUSHBUTTON) + { + m_bIsDefault = TRUE; + } // if + else if (nNewType == BS_PUSHBUTTON) + { + // Losing default state always allowed + m_bIsDefault = FALSE; + } // if + + // Can't change control type after owner-draw is set. + // Let the system process changes to other style bits + // and redrawing, while keeping owner-draw style + return DefWindowProc(BM_SETSTYLE, + (wParam & ~BS_TYPEMASK) | BS_OWNERDRAW, lParam); +} // End of OnSetStyle + +LRESULT CButtonST::OnSetCheck(WPARAM wParam, LPARAM /*lParam*/) +{ + ASSERT(m_bIsCheckBox); + + switch (wParam) + { + case BST_CHECKED: + case BST_INDETERMINATE: // Indeterminate state is handled like checked state + SetCheck(1); + break; + default: + SetCheck(0); + break; + } // switch + + return 0; +} // End of OnSetCheck + +LRESULT CButtonST::OnGetCheck(WPARAM /*wParam*/, LPARAM /*lParam*/) +{ + ASSERT(m_bIsCheckBox); + return GetCheck(); +} // End of OnGetCheck + +#ifdef BTNST_USE_BCMENU +LRESULT CButtonST::OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu) +{ + LRESULT lResult; + if (BCMenu::IsMenu(pMenu)) + lResult = BCMenu::FindKeyboardShortcut(nChar, nFlags, pMenu); + else + lResult = CButton::OnMenuChar(nChar, nFlags, pMenu); + return lResult; +} // End of OnMenuChar +#endif + +#ifdef BTNST_USE_BCMENU +void CButtonST::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct) +{ + BOOL bSetFlag = FALSE; + if (lpMeasureItemStruct->CtlType == ODT_MENU) + { + if (IsMenu((HMENU)lpMeasureItemStruct->itemID) && BCMenu::IsMenu((HMENU)lpMeasureItemStruct->itemID)) + { + m_menuPopup.MeasureItem(lpMeasureItemStruct); + bSetFlag = TRUE; + } // if + } // if + if (!bSetFlag) CButton::OnMeasureItem(nIDCtl, lpMeasureItemStruct); +} // End of OnMeasureItem +#endif + +void CButtonST::OnEnable(BOOL bEnable) +{ + CButton::OnEnable(bEnable); + + if (bEnable == FALSE) + { + CWnd* pWnd = GetParent()->GetNextDlgTabItem(this); + if (pWnd) + pWnd->SetFocus(); + else + GetParent()->SetFocus(); + + CancelHover(); + } // if +} // End of OnEnable + +void CButtonST::OnKillFocus(CWnd * pNewWnd) +{ + CButton::OnKillFocus(pNewWnd); + CancelHover(); +} // End of OnKillFocus + +void CButtonST::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) +{ + CButton::OnActivate(nState, pWndOther, bMinimized); + if (nState == WA_INACTIVE) CancelHover(); +} // End of OnActivate + +void CButtonST::OnCancelMode() +{ + CButton::OnCancelMode(); + CancelHover(); +} // End of OnCancelMode + +BOOL CButtonST::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) +{ + // If a cursor was specified then use it! + if (m_hCursor != NULL) + { + ::SetCursor(m_hCursor); + return TRUE; + } // if + + return CButton::OnSetCursor(pWnd, nHitTest, message); +} // End of OnSetCursor + +void CButtonST::CancelHover() +{ + // Only for flat buttons + if (m_bIsFlat) + { + if (m_bMouseOnButton) + { + m_bMouseOnButton = FALSE; + Invalidate(); + } // if + } // if +} // End of CancelHover + +void CButtonST::OnMouseMove(UINT nFlags, CPoint point) +{ + CWnd* wndUnderMouse = NULL; + CWnd* wndActive = this; + TRACKMOUSEEVENT csTME; + + CButton::OnMouseMove(nFlags, point); + + ClientToScreen(&point); + wndUnderMouse = WindowFromPoint(point); + + // If the mouse enter the button with the left button pressed then do nothing + if (nFlags & MK_LBUTTON && m_bMouseOnButton == FALSE) return; + + // If our button is not flat then do nothing + if (m_bIsFlat == FALSE) return; + + if (m_bAlwaysTrack == FALSE) wndActive = GetActiveWindow(); + + if (wndUnderMouse && wndUnderMouse->m_hWnd == m_hWnd && wndActive) + { + if (!m_bMouseOnButton) + { + m_bMouseOnButton = TRUE; + + Invalidate(); + + csTME.cbSize = sizeof(csTME); + csTME.dwFlags = TME_LEAVE; + csTME.hwndTrack = m_hWnd; + ::_TrackMouseEvent(&csTME); + } // if + } else CancelHover(); +} // End of OnMouseMove + +// Handler for WM_MOUSELEAVE +LRESULT CButtonST::OnMouseLeave(WPARAM /*wParam*/, LPARAM /*lParam*/) +{ + CancelHover(); + return 0; +} // End of OnMouseLeave + +BOOL CButtonST::OnClicked() +{ + SetFocus(); + + if (m_bIsCheckBox) + { + m_nCheck = !m_nCheck; + Invalidate(); + } // if + else + { + // Handle the menu (if any) +#ifdef BTNST_USE_BCMENU + if (m_menuPopup.m_hMenu) +#else + if (m_hMenu) +#endif + { + CRect rWnd; + GetWindowRect(rWnd); + + m_bMenuDisplayed = TRUE; + Invalidate(); + +#ifdef BTNST_USE_BCMENU + BCMenu *psub = (BCMenu*)m_menuPopup.GetSubMenu(0); + DWORD dwRetValue = psub->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, rWnd.left, rWnd.bottom, this, NULL); +#else + HMENU hSubMenu = ::GetSubMenu(m_hMenu, 0); + //DWORD dwRetValue = ::TrackPopupMenuEx(hSubMenu, TPM_LEFTALIGN | TPM_LEFTBUTTON, rWnd.left, rWnd.bottom, m_hParentWndMenu, NULL); + DWORD dwRetValue = ::TrackPopupMenuEx(hSubMenu, TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, rWnd.left, rWnd.bottom, m_hParentWndMenu, NULL); +#endif + + m_bMenuDisplayed = FALSE; + Invalidate(); + + if (dwRetValue) + ::PostMessage(m_hParentWndMenu, WM_COMMAND, MAKEWPARAM(dwRetValue, 0), (LPARAM)NULL); + } // if + else + { + // Handle the URL (if any) + if (_tcslen(m_szURL) > 0) + { + SHELLEXECUTEINFO csSEI; + + memset(&csSEI, 0, sizeof(csSEI)); + csSEI.cbSize = sizeof(SHELLEXECUTEINFO); + csSEI.fMask = SEE_MASK_FLAG_NO_UI; + csSEI.lpVerb = _T("open"); + csSEI.lpFile = m_szURL; + csSEI.nShow = SW_SHOWMAXIMIZED; + ::ShellExecuteEx(&csSEI); + } // if + } // else + } // else + + return FALSE; +} // End of OnClicked + +void CButtonST::DrawItem(LPDRAWITEMSTRUCT lpDIS) +{ + CDC* pDC = CDC::FromHandle(lpDIS->hDC); + CPen* pOldPen; + + // Checkbox? + if (m_bIsCheckBox) + { + m_bIsPressed = (lpDIS->itemState & ODS_SELECTED) || (m_nCheck != 0); + } // if + else // Normal button OR other button style ... + { + m_bIsPressed = (lpDIS->itemState & ODS_SELECTED); + + // If there is a menu and it's displayed, draw the button as pressed + if ( +#ifdef BTNST_USE_BCMENU + m_menuPopup.m_hMenu +#else + m_hMenu +#endif + && m_bMenuDisplayed) m_bIsPressed = TRUE; + } // else + + m_bIsFocused = (lpDIS->itemState & ODS_FOCUS); + m_bIsDisabled = (lpDIS->itemState & ODS_DISABLED); + + CRect itemRect = lpDIS->rcItem; + + pDC->SetBkMode(TRANSPARENT); + + if (m_bIsFlat == FALSE) + { + if (m_bIsFocused || m_bIsDefault) + { + CBrush br(RGB(0,0,0)); + pDC->FrameRect(&itemRect, &br); + itemRect.DeflateRect(1, 1); + } // if + } // if + + // Prepare draw... paint button background + + // Draw transparent? + if (m_bDrawTransparent) + PaintBk(pDC); + else + OnDrawBackground(pDC, &itemRect); + + // Draw pressed button + if (m_bIsPressed) + { + if (m_bIsFlat) + { + if (m_bDrawBorder) + OnDrawBorder(pDC, &itemRect); + } + else + { + CBrush brBtnShadow(GetSysColor(COLOR_BTNSHADOW)); + pDC->FrameRect(&itemRect, &brBtnShadow); + } + } + else // ...else draw non pressed button + { + CPen penBtnHiLight(PS_SOLID, 0, GetSysColor(COLOR_BTNHILIGHT)); // White + CPen pen3DLight(PS_SOLID, 0, GetSysColor(COLOR_3DLIGHT)); // Light gray + CPen penBtnShadow(PS_SOLID, 0, GetSysColor(COLOR_BTNSHADOW)); // Dark gray + CPen pen3DDKShadow(PS_SOLID, 0, GetSysColor(COLOR_3DDKSHADOW)); // Black + + if (m_bIsFlat) + { + if (m_bMouseOnButton && m_bDrawBorder) + OnDrawBorder(pDC, &itemRect); + } + else + { + // Draw top-left borders + // White line + pOldPen = pDC->SelectObject(&penBtnHiLight); + pDC->MoveTo(itemRect.left, itemRect.bottom-1); + pDC->LineTo(itemRect.left, itemRect.top); + pDC->LineTo(itemRect.right, itemRect.top); + // Light gray line + pDC->SelectObject(pen3DLight); + pDC->MoveTo(itemRect.left+1, itemRect.bottom-1); + pDC->LineTo(itemRect.left+1, itemRect.top+1); + pDC->LineTo(itemRect.right, itemRect.top+1); + // Draw bottom-right borders + // Black line + pDC->SelectObject(pen3DDKShadow); + pDC->MoveTo(itemRect.left, itemRect.bottom-1); + pDC->LineTo(itemRect.right-1, itemRect.bottom-1); + pDC->LineTo(itemRect.right-1, itemRect.top-1); + // Dark gray line + pDC->SelectObject(penBtnShadow); + pDC->MoveTo(itemRect.left+1, itemRect.bottom-2); + pDC->LineTo(itemRect.right-2, itemRect.bottom-2); + pDC->LineTo(itemRect.right-2, itemRect.top); + // + pDC->SelectObject(pOldPen); + } // else + } // else + + // Read the button's title + CString sTitle; + GetWindowText(sTitle); + + CRect captionRect = lpDIS->rcItem; + + // Draw the icon + if (m_csIcons[0].hIcon) + { + DrawTheIcon(pDC, !sTitle.IsEmpty(), &lpDIS->rcItem, &captionRect, m_bIsPressed, m_bIsDisabled); + } // if + + if (m_csBitmaps[0].hBitmap) + { + pDC->SetBkColor(RGB(255,255,255)); + DrawTheBitmap(pDC, !sTitle.IsEmpty(), &lpDIS->rcItem, &captionRect, m_bIsPressed, m_bIsDisabled); + } // if + + // Write the button title (if any) + if (sTitle.IsEmpty() == FALSE) + { + // Draw the button's title + // If button is pressed then "press" title also + if (m_bIsPressed && m_bIsCheckBox == FALSE) + captionRect.OffsetRect(1, 1); + + // ONLY FOR DEBUG + //CBrush brBtnShadow(RGB(255, 0, 0)); + //pDC->FrameRect(&captionRect, &brBtnShadow); + + // Center text + CRect centerRect = captionRect; + pDC->DrawText(sTitle, -1, captionRect, DT_WORDBREAK | DT_CENTER | DT_CALCRECT); + captionRect.OffsetRect((centerRect.Width() - captionRect.Width())/2, (centerRect.Height() - captionRect.Height())/2); + /* RFU + captionRect.OffsetRect(0, (centerRect.Height() - captionRect.Height())/2); + captionRect.OffsetRect((centerRect.Width() - captionRect.Width())-4, (centerRect.Height() - captionRect.Height())/2); + */ + + pDC->SetBkMode(TRANSPARENT); + /* + pDC->DrawState(captionRect.TopLeft(), captionRect.Size(), (LPCTSTR)sTitle, (bIsDisabled ? DSS_DISABLED : DSS_NORMAL), + TRUE, 0, (CBrush*)NULL); + */ + if (m_bIsDisabled) + { + captionRect.OffsetRect(1, 1); + pDC->SetTextColor(::GetSysColor(COLOR_3DHILIGHT)); + pDC->DrawText(sTitle, -1, captionRect, DT_WORDBREAK | DT_CENTER); + captionRect.OffsetRect(-1, -1); + pDC->SetTextColor(::GetSysColor(COLOR_3DSHADOW)); + pDC->DrawText(sTitle, -1, captionRect, DT_WORDBREAK | DT_CENTER); + } // if + else + { + if (m_bMouseOnButton || m_bIsPressed) + { + pDC->SetTextColor(m_crColors[BTNST_COLOR_FG_IN]); + pDC->SetBkColor(m_crColors[BTNST_COLOR_BK_IN]); + } // if + else + { + pDC->SetTextColor(m_crColors[BTNST_COLOR_FG_OUT]); + pDC->SetBkColor(m_crColors[BTNST_COLOR_BK_OUT]); + } // else + pDC->DrawText(sTitle, -1, captionRect, DT_WORDBREAK | DT_CENTER); + } // if + } // if + + if (m_bIsFlat == FALSE || (m_bIsFlat && m_bDrawFlatFocus)) + { + // Draw the focus rect + if (m_bIsFocused) + { + CRect focusRect = itemRect; + focusRect.DeflateRect(3, 3); + pDC->DrawFocusRect(&focusRect); + } // if + } // if +} // End of DrawItem + +void CButtonST::PaintBk(CDC* pDC) +{ + CClientDC clDC(GetParent()); + CRect rect; + CRect rect1; + + GetClientRect(rect); + + GetWindowRect(rect1); + GetParent()->ScreenToClient(rect1); + + if (m_dcBk.m_hDC == NULL) + { + m_dcBk.CreateCompatibleDC(&clDC); + m_bmpBk.CreateCompatibleBitmap(&clDC, rect.Width(), rect.Height()); + m_pbmpOldBk = m_dcBk.SelectObject(&m_bmpBk); + m_dcBk.BitBlt(0, 0, rect.Width(), rect.Height(), &clDC, rect1.left, rect1.top, SRCCOPY); + } // if + + pDC->BitBlt(0, 0, rect.Width(), rect.Height(), &m_dcBk, 0, 0, SRCCOPY); +} // End of PaintBk + +HBITMAP CButtonST::CreateBitmapMask(HBITMAP hSourceBitmap, DWORD dwWidth, DWORD dwHeight, COLORREF crTransColor) +{ + HBITMAP hMask = NULL; + HDC hdcSrc = NULL; + HDC hdcDest = NULL; + HBITMAP hbmSrcT = NULL; + HBITMAP hbmDestT = NULL; + COLORREF crSaveBk; + COLORREF crSaveDestText; + + hMask = ::CreateBitmap(dwWidth, dwHeight, 1, 1, NULL); + if (hMask == NULL) return NULL; + + hdcSrc = ::CreateCompatibleDC(NULL); + hdcDest = ::CreateCompatibleDC(NULL); + + hbmSrcT = (HBITMAP)::SelectObject(hdcSrc, hSourceBitmap); + hbmDestT = (HBITMAP)::SelectObject(hdcDest, hMask); + + crSaveBk = ::SetBkColor(hdcSrc, crTransColor); + + ::BitBlt(hdcDest, 0, 0, dwWidth, dwHeight, hdcSrc, 0, 0, SRCCOPY); + + crSaveDestText = ::SetTextColor(hdcSrc, RGB(255, 255, 255)); + ::SetBkColor(hdcSrc,RGB(0, 0, 0)); + + ::BitBlt(hdcSrc, 0, 0, dwWidth, dwHeight, hdcDest, 0, 0, SRCAND); + + SetTextColor(hdcDest, crSaveDestText); + + ::SetBkColor(hdcSrc, crSaveBk); + ::SelectObject(hdcSrc, hbmSrcT); + ::SelectObject(hdcDest, hbmDestT); + + ::DeleteDC(hdcSrc); + ::DeleteDC(hdcDest); + + return hMask; +} // End of CreateBitmapMask + +// +// Parameters: +// [IN] bHasTitle +// TRUE if the button has a text +// [IN] rpItem +// A pointer to a RECT structure indicating the allowed paint area +// [IN/OUT]rpTitle +// A pointer to a CRect object indicating the paint area reserved for the +// text. This structure will be modified if necessary. +// [IN] bIsPressed +// TRUE if the button is currently pressed +// [IN] dwWidth +// Width of the image (icon or bitmap) +// [IN] dwHeight +// Height of the image (icon or bitmap) +// [OUT] rpImage +// A pointer to a CRect object that will receive the area available to the image +// +void CButtonST::PrepareImageRect(BOOL bHasTitle, RECT* rpItem, CRect* rpTitle, BOOL bIsPressed, DWORD dwWidth, DWORD dwHeight, CRect* rpImage) +{ + CRect rBtn; + + rpImage->CopyRect(rpItem); + + switch (m_byAlign) + { + case ST_ALIGN_HORIZ: + if (bHasTitle == FALSE) + { + // Center image horizontally + rpImage->left += ((rpImage->Width() - (long)dwWidth)/2); + } + else + { + // Image must be placed just inside the focus rect + rpImage->left += 3; + rpTitle->left += dwWidth + 3; + } + // Center image vertically + rpImage->top += ((rpImage->Height() - (long)dwHeight)/2); + break; + + case ST_ALIGN_HORIZ_RIGHT: + GetClientRect(&rBtn); + if (bHasTitle == FALSE) + { + // Center image horizontally + rpImage->left += ((rpImage->Width() - (long)dwWidth)/2); + } + else + { + // Image must be placed just inside the focus rect + rpTitle->right = rpTitle->Width() - dwWidth - 3; + rpTitle->left = 3; + rpImage->left = rBtn.right - dwWidth - 3; + // Center image vertically + rpImage->top += ((rpImage->Height() - (long)dwHeight)/2); + } + break; + + case ST_ALIGN_VERT: + // Center image horizontally + rpImage->left += ((rpImage->Width() - (long)dwWidth)/2); + if (bHasTitle == FALSE) + { + // Center image vertically + rpImage->top += ((rpImage->Height() - (long)dwHeight)/2); + } + else + { + rpImage->top = 3; + rpTitle->top += dwHeight; + } + break; + } + + // If button is pressed then press image also + if (bIsPressed && m_bIsCheckBox == FALSE) + rpImage->OffsetRect(1, 1); +} // End of PrepareImageRect + +void CButtonST::DrawTheIcon(CDC* pDC, BOOL bHasTitle, RECT* rpItem, CRect* rpTitle, BOOL bIsPressed, BOOL bIsDisabled) +{ + BYTE byIndex = 0; + + // Select the icon to use + if ((m_bIsCheckBox && bIsPressed) || (!m_bIsCheckBox && (bIsPressed || m_bMouseOnButton))) + byIndex = 0; + else + byIndex = (m_csIcons[1].hIcon == NULL ? 0 : 1); + + CRect rImage; + PrepareImageRect(bHasTitle, rpItem, rpTitle, bIsPressed, m_csIcons[byIndex].dwWidth, m_csIcons[byIndex].dwHeight, &rImage); + + // Ole'! + pDC->DrawState( rImage.TopLeft(), + rImage.Size(), + m_csIcons[byIndex].hIcon, + (bIsDisabled ? DSS_DISABLED : DSS_NORMAL), + (CBrush*)NULL); +} // End of DrawTheIcon + +void CButtonST::DrawTheBitmap(CDC* pDC, BOOL bHasTitle, RECT* rItem, CRect *rCaption, BOOL bIsPressed, BOOL bIsDisabled) +{ + HDC hdcBmpMem = NULL; + HBITMAP hbmOldBmp = NULL; + HDC hdcMem = NULL; + HBITMAP hbmT = NULL; + + BYTE byIndex = 0; + + // Select the bitmap to use + if ((m_bIsCheckBox && bIsPressed) || (!m_bIsCheckBox && (bIsPressed || m_bMouseOnButton))) + byIndex = 0; + else + byIndex = (m_csBitmaps[1].hBitmap == NULL ? 0 : 1); + + CRect rImage; + PrepareImageRect(bHasTitle, rItem, rCaption, bIsPressed, m_csBitmaps[byIndex].dwWidth, m_csBitmaps[byIndex].dwHeight, &rImage); + + hdcBmpMem = ::CreateCompatibleDC(pDC->m_hDC); + + hbmOldBmp = (HBITMAP)::SelectObject(hdcBmpMem, m_csBitmaps[byIndex].hBitmap); + + hdcMem = ::CreateCompatibleDC(NULL); + + hbmT = (HBITMAP)::SelectObject(hdcMem, m_csBitmaps[byIndex].hMask); + + if (bIsDisabled && m_bShowDisabledBitmap) + { + HDC hDC = NULL; + HBITMAP hBitmap = NULL; + + hDC = ::CreateCompatibleDC(pDC->m_hDC); + hBitmap = ::CreateCompatibleBitmap(pDC->m_hDC, m_csBitmaps[byIndex].dwWidth, m_csBitmaps[byIndex].dwHeight); + HBITMAP hOldBmp2 = (HBITMAP)::SelectObject(hDC, hBitmap); + + RECT rRect; + rRect.left = 0; + rRect.top = 0; + rRect.right = rImage.right + 1; + rRect.bottom = rImage.bottom + 1; + ::FillRect(hDC, &rRect, (HBRUSH)RGB(255, 255, 255)); + + COLORREF crOldColor = ::SetBkColor(hDC, RGB(255,255,255)); + + ::BitBlt(hDC, 0, 0, m_csBitmaps[byIndex].dwWidth, m_csBitmaps[byIndex].dwHeight, hdcMem, 0, 0, SRCAND); + ::BitBlt(hDC, 0, 0, m_csBitmaps[byIndex].dwWidth, m_csBitmaps[byIndex].dwHeight, hdcBmpMem, 0, 0, SRCPAINT); + + ::SetBkColor(hDC, crOldColor); + ::SelectObject(hDC, hOldBmp2); + ::DeleteDC(hDC); + + pDC->DrawState( CPoint(rImage.left/*+1*/, rImage.top), + CSize(m_csBitmaps[byIndex].dwWidth, m_csBitmaps[byIndex].dwHeight), + hBitmap, DST_BITMAP | DSS_DISABLED); + + ::DeleteObject(hBitmap); + } // if + else + { + ::BitBlt(pDC->m_hDC, rImage.left, rImage.top, m_csBitmaps[byIndex].dwWidth, m_csBitmaps[byIndex].dwHeight, hdcMem, 0, 0, SRCAND); + + ::BitBlt(pDC->m_hDC, rImage.left, rImage.top, m_csBitmaps[byIndex].dwWidth, m_csBitmaps[byIndex].dwHeight, hdcBmpMem, 0, 0, SRCPAINT); + } // else + + ::SelectObject(hdcMem, hbmT); + ::DeleteDC(hdcMem); + + ::SelectObject(hdcBmpMem, hbmOldBmp); + ::DeleteDC(hdcBmpMem); +} // End of DrawTheBitmap + +// This function creates a grayscale icon starting from a given icon. +// The resulting icon will have the same size of the original one. +// +// Parameters: +// [IN] hIcon +// Handle to the original icon. +// +// Return value: +// If the function succeeds, the return value is the handle to the newly created +// grayscale icon. +// If the function fails, the return value is NULL. +// +HICON CButtonST::CreateGrayscaleIcon(HICON hIcon) +{ + HICON hGrayIcon = NULL; + HDC hMainDC = NULL, hMemDC1 = NULL, hMemDC2 = NULL; + BITMAP bmp; + HBITMAP hOldBmp1 = NULL, hOldBmp2 = NULL; + ICONINFO csII, csGrayII; + BOOL bRetValue = FALSE; + + bRetValue = ::GetIconInfo(hIcon, &csII); + if (bRetValue == FALSE) return NULL; + + hMainDC = ::GetDC(m_hWnd); + hMemDC1 = ::CreateCompatibleDC(hMainDC); + hMemDC2 = ::CreateCompatibleDC(hMainDC); + if (hMainDC == NULL || hMemDC1 == NULL || hMemDC2 == NULL) return NULL; + + if (::GetObject(csII.hbmColor, sizeof(BITMAP), &bmp)) + { + csGrayII.hbmColor = ::CreateBitmap(csII.xHotspot*2, csII.yHotspot*2, bmp.bmPlanes, bmp.bmBitsPixel, NULL); + if (csGrayII.hbmColor) + { + hOldBmp1 = (HBITMAP)::SelectObject(hMemDC1, csII.hbmColor); + hOldBmp2 = (HBITMAP)::SelectObject(hMemDC2, csGrayII.hbmColor); + + ::BitBlt(hMemDC2, 0, 0, csII.xHotspot*2, csII.yHotspot*2, hMemDC1, 0, 0, SRCCOPY); + + DWORD dwLoopY = 0, dwLoopX = 0; + COLORREF crPixel = 0; + BYTE byNewPixel = 0; + + for (dwLoopY = 0; dwLoopY < csII.yHotspot*2; dwLoopY++) + { + for (dwLoopX = 0; dwLoopX < csII.xHotspot*2; dwLoopX++) + { + crPixel = ::GetPixel(hMemDC2, dwLoopX, dwLoopY); + + byNewPixel = (BYTE)((GetRValue(crPixel) * 0.299) + (GetGValue(crPixel) * 0.587) + (GetBValue(crPixel) * 0.114)); + if (crPixel) ::SetPixel(hMemDC2, dwLoopX, dwLoopY, RGB(byNewPixel, byNewPixel, byNewPixel)); + } // for + } // for + + ::SelectObject(hMemDC1, hOldBmp1); + ::SelectObject(hMemDC2, hOldBmp2); + + csGrayII.hbmMask = csII.hbmMask; + + csGrayII.fIcon = TRUE; + hGrayIcon = ::CreateIconIndirect(&csGrayII); + } // if + + ::DeleteObject(csGrayII.hbmColor); + //::DeleteObject(csGrayII.hbmMask); + } // if + + ::DeleteObject(csII.hbmColor); + ::DeleteObject(csII.hbmMask); + ::DeleteDC(hMemDC1); + ::DeleteDC(hMemDC2); + ::ReleaseDC(m_hWnd, hMainDC); + + return hGrayIcon; +} // End of CreateGrayscaleIcon + +// This function assigns icons to the button. +// Any previous icon or bitmap will be removed. +// +// Parameters: +// [IN] nIconIn +// ID number of the icon resource to show when the mouse is over the button. +// Pass NULL to remove any icon from the button. +// [IN] nIconOut +// ID number of the icon resource to show when the mouse is outside the button. +// Can be NULL. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// BTNST_INVALIDRESOURCE +// Failed loading the specified resource. +// +DWORD CButtonST::SetIcon(int nIconIn, int nIconOut) +{ + HICON hIconIn = NULL; + HICON hIconOut = NULL; + HINSTANCE hInstResource = NULL; + + // Find correct resource handle + hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE(nIconIn), RT_GROUP_ICON); + + // Set icon when the mouse is IN the button + hIconIn = (HICON)::LoadImage(hInstResource, MAKEINTRESOURCE(nIconIn), IMAGE_ICON, 0, 0, 0); + + // Set icon when the mouse is OUT the button + if (nIconOut) + { + if (nIconOut == (int)BTNST_AUTO_GRAY) + hIconOut = BTNST_AUTO_GRAY; + else + hIconOut = (HICON)::LoadImage(hInstResource, MAKEINTRESOURCE(nIconOut), IMAGE_ICON, 0, 0, 0); + } // if + + return SetIcon(hIconIn, hIconOut); +} // End of SetIcon + +// This function assigns icons to the button. +// Any previous icon or bitmap will be removed. +// +// Parameters: +// [IN] hIconIn +// Handle fo the icon to show when the mouse is over the button. +// Pass NULL to remove any icon from the button. +// [IN] hIconOut +// Handle to the icon to show when the mouse is outside the button. +// Can be NULL. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// BTNST_INVALIDRESOURCE +// Failed loading the specified resource. +// +DWORD CButtonST::SetIcon(HICON hIconIn, HICON hIconOut) +{ + BOOL bRetValue; + ICONINFO ii; + + // Free any loaded resource + FreeResources(); + + if (hIconIn) + { + // Icon when mouse over button? + m_csIcons[0].hIcon = hIconIn; + // Get icon dimension + ::ZeroMemory(&ii, sizeof(ICONINFO)); + bRetValue = ::GetIconInfo(hIconIn, &ii); + if (bRetValue == FALSE) + { + FreeResources(); + return BTNST_INVALIDRESOURCE; + } // if + + m_csIcons[0].dwWidth = (DWORD)(ii.xHotspot * 2); + m_csIcons[0].dwHeight = (DWORD)(ii.yHotspot * 2); + ::DeleteObject(ii.hbmMask); + ::DeleteObject(ii.hbmColor); + + // Icon when mouse outside button? + if (hIconOut) + { + if (hIconOut == BTNST_AUTO_GRAY) + { + hIconOut = CreateGrayscaleIcon(hIconIn); + } // if + + m_csIcons[1].hIcon = hIconOut; + // Get icon dimension + ::ZeroMemory(&ii, sizeof(ICONINFO)); + bRetValue = ::GetIconInfo(hIconOut, &ii); + if (bRetValue == FALSE) + { + FreeResources(); + return BTNST_INVALIDRESOURCE; + } // if + + m_csIcons[1].dwWidth = (DWORD)(ii.xHotspot * 2); + m_csIcons[1].dwHeight = (DWORD)(ii.yHotspot * 2); + ::DeleteObject(ii.hbmMask); + ::DeleteObject(ii.hbmColor); + } // if + } // if + + Invalidate(); + + return BTNST_OK; +} // End of SetIcon + +// This function assigns bitmaps to the button. +// Any previous icon or bitmap will be removed. +// +// Parameters: +// [IN] nBitmapIn +// ID number of the bitmap resource to show when the mouse is over the button. +// Pass NULL to remove any bitmap from the button. +// [IN] crTransColorIn +// Color (inside nBitmapIn) to be used as transparent color. +// [IN] nBitmapOut +// ID number of the bitmap resource to show when the mouse is outside the button. +// Can be NULL. +// [IN] crTransColorOut +// Color (inside nBitmapOut) to be used as transparent color. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// BTNST_INVALIDRESOURCE +// Failed loading the specified resource. +// BTNST_FAILEDMASK +// Failed creating mask bitmap. +// +DWORD CButtonST::SetBitmaps(int nBitmapIn, COLORREF crTransColorIn, int nBitmapOut, COLORREF crTransColorOut) +{ + HBITMAP hBitmapIn = NULL; + HBITMAP hBitmapOut = NULL; + HINSTANCE hInstResource = NULL; + + // Find correct resource handle + hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE(nBitmapIn), RT_BITMAP); + + // Load bitmap In + hBitmapIn = (HBITMAP)::LoadImage(hInstResource, MAKEINTRESOURCE(nBitmapIn), IMAGE_BITMAP, 0, 0, 0); + + // Load bitmap Out + if (nBitmapOut) + hBitmapOut = (HBITMAP)::LoadImage(hInstResource, MAKEINTRESOURCE(nBitmapOut), IMAGE_BITMAP, 0, 0, 0); + + return SetBitmaps(hBitmapIn, crTransColorIn, hBitmapOut, crTransColorOut); +} // End of SetBitmaps + +// This function assigns bitmaps to the button. +// Any previous icon or bitmap will be removed. +// +// Parameters: +// [IN] hBitmapIn +// Handle fo the bitmap to show when the mouse is over the button. +// Pass NULL to remove any bitmap from the button. +// [IN] crTransColorIn +// Color (inside hBitmapIn) to be used as transparent color. +// [IN] hBitmapOut +// Handle to the bitmap to show when the mouse is outside the button. +// Can be NULL. +// [IN] crTransColorOut +// Color (inside hBitmapOut) to be used as transparent color. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// BTNST_INVALIDRESOURCE +// Failed loading the specified resource. +// BTNST_FAILEDMASK +// Failed creating mask bitmap. +// +DWORD CButtonST::SetBitmaps(HBITMAP hBitmapIn, COLORREF crTransColorIn, HBITMAP hBitmapOut, COLORREF crTransColorOut) +{ + int nRetValue; + BITMAP csBitmapSize; + + // Free any loaded resource + FreeResources(); + + if (hBitmapIn) + { + m_csBitmaps[0].hBitmap = hBitmapIn; + m_csBitmaps[0].crTransparent = crTransColorIn; + // Get bitmap size + nRetValue = ::GetObject(hBitmapIn, sizeof(csBitmapSize), &csBitmapSize); + if (nRetValue == 0) + { + FreeResources(); + return BTNST_INVALIDRESOURCE; + } // if + m_csBitmaps[0].dwWidth = (DWORD)csBitmapSize.bmWidth; + m_csBitmaps[0].dwHeight = (DWORD)csBitmapSize.bmHeight; + + // Create mask for bitmap In + m_csBitmaps[0].hMask = CreateBitmapMask(hBitmapIn, m_csBitmaps[0].dwWidth, m_csBitmaps[0].dwHeight, crTransColorIn); + if (m_csBitmaps[0].hMask == NULL) + { + FreeResources(); + return BTNST_FAILEDMASK; + } // if + + if (hBitmapOut) + { + m_csBitmaps[1].hBitmap = hBitmapOut; + m_csBitmaps[1].crTransparent = crTransColorOut; + // Get bitmap size + nRetValue = ::GetObject(hBitmapOut, sizeof(csBitmapSize), &csBitmapSize); + if (nRetValue == 0) + { + FreeResources(); + return BTNST_INVALIDRESOURCE; + } // if + m_csBitmaps[1].dwWidth = (DWORD)csBitmapSize.bmWidth; + m_csBitmaps[1].dwHeight = (DWORD)csBitmapSize.bmHeight; + + // Create mask for bitmap Out + m_csBitmaps[1].hMask = CreateBitmapMask(hBitmapOut, m_csBitmaps[1].dwWidth, m_csBitmaps[1].dwHeight, crTransColorOut); + if (m_csBitmaps[1].hMask == NULL) + { + FreeResources(); + return BTNST_FAILEDMASK; + } // if + } // if + } // if + + Invalidate(); + + return BTNST_OK; +} // End of SetBitmaps + +// This functions sets the button to have a standard or flat style. +// +// Parameters: +// [IN] bFlat +// If TRUE the button will have a flat style, else +// will have a standard style. +// By default, CButtonST buttons are flat. +// [IN] bRepaint +// If TRUE the control will be repainted. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// +DWORD CButtonST::SetFlat(BOOL bFlat, BOOL bRepaint) +{ + m_bIsFlat = bFlat; + if (bRepaint) Invalidate(); + + return BTNST_OK; +} // End of SetFlat + +// This function sets the alignment type between icon/bitmap and text. +// +// Parameters: +// [IN] byAlign +// Alignment type. Can be one of the following values: +// ST_ALIGN_HORIZ Icon/bitmap on the left, text on the right +// ST_ALIGN_VERT Icon/bitmap on the top, text on the bottom +// ST_ALIGN_HORIZ_RIGHT Icon/bitmap on the right, text on the left +// By default, CButtonST buttons have ST_ALIGN_HORIZ alignment. +// [IN] bRepaint +// If TRUE the control will be repainted. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// BTNST_INVALIDALIGN +// Alignment type not supported. +// +DWORD CButtonST::SetAlign(BYTE byAlign, BOOL bRepaint) +{ + switch (byAlign) + { + case ST_ALIGN_HORIZ: + case ST_ALIGN_HORIZ_RIGHT: + case ST_ALIGN_VERT: + m_byAlign = byAlign; + if (bRepaint) Invalidate(); + return BTNST_OK; + break; + } // switch + + return BTNST_INVALIDALIGN; +} // End of SetAlign + +// This function sets the state of the checkbox. +// If the button is not a checkbox, this function has no meaning. +// +// Parameters: +// [IN] nCheck +// 1 to check the checkbox. +// 0 to un-check the checkbox. +// [IN] bRepaint +// If TRUE the control will be repainted. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// +DWORD CButtonST::SetCheck(int nCheck, BOOL bRepaint) +{ + if (m_bIsCheckBox) + { + if (nCheck == 0) m_nCheck = 0; + else m_nCheck = 1; + + if (bRepaint) Invalidate(); + } // if + + return BTNST_OK; +} // End of SetCheck + +// This function returns the current state of the checkbox. +// If the button is not a checkbox, this function has no meaning. +// +// Return value: +// The current state of the checkbox. +// 1 if checked. +// 0 if not checked or the button is not a checkbox. +// +int CButtonST::GetCheck() +{ + return m_nCheck; +} // End of GetCheck + +// This function sets all colors to a default value. +// +// Parameters: +// [IN] bRepaint +// If TRUE the control will be repainted. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// +DWORD CButtonST::SetDefaultColors(BOOL bRepaint) +{ + m_crColors[BTNST_COLOR_BK_IN] = ::GetSysColor(COLOR_BTNFACE); + m_crColors[BTNST_COLOR_FG_IN] = ::GetSysColor(COLOR_BTNTEXT); + m_crColors[BTNST_COLOR_BK_OUT] = ::GetSysColor(COLOR_BTNFACE); + m_crColors[BTNST_COLOR_FG_OUT] = ::GetSysColor(COLOR_BTNTEXT); + m_crColors[BTNST_COLOR_BK_FOCUS] = ::GetSysColor(COLOR_BTNFACE); + m_crColors[BTNST_COLOR_FG_FOCUS] = ::GetSysColor(COLOR_BTNTEXT); + + if (bRepaint) Invalidate(); + + return BTNST_OK; +} // End of SetDefaultColors + +// This function sets the color to use for a particular state. +// +// Parameters: +// [IN] byColorIndex +// Index of the color to set. Can be one of the following values: +// BTNST_COLOR_BK_IN Background color when mouse is over the button +// BTNST_COLOR_FG_IN Text color when mouse is over the button +// BTNST_COLOR_BK_OUT Background color when mouse is outside the button +// BTNST_COLOR_FG_OUT Text color when mouse is outside the button +// BTNST_COLOR_BK_FOCUS Background color when the button is focused +// BTNST_COLOR_FG_FOCUS Text color when the button is focused +// [IN] crColor +// New color. +// [IN] bRepaint +// If TRUE the control will be repainted. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// BTNST_INVALIDINDEX +// Invalid color index. +// +DWORD CButtonST::SetColor(BYTE byColorIndex, COLORREF crColor, BOOL bRepaint) +{ + if (byColorIndex >= BTNST_MAX_COLORS) return BTNST_INVALIDINDEX; + + // Set new color + m_crColors[byColorIndex] = crColor; + + if (bRepaint) Invalidate(); + + return BTNST_OK; +} // End of SetColor + +// This functions returns the color used for a particular state. +// +// Parameters: +// [IN] byColorIndex +// Index of the color to get. +// See SetColor for the list of available colors. +// [OUT] crpColor +// A pointer to a COLORREF that will receive the color. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// BTNST_INVALIDINDEX +// Invalid color index. +// +DWORD CButtonST::GetColor(BYTE byColorIndex, COLORREF* crpColor) +{ + if (byColorIndex >= BTNST_MAX_COLORS) return BTNST_INVALIDINDEX; + + // Get color + *crpColor = m_crColors[byColorIndex]; + + return BTNST_OK; +} // End of GetColor + +// This function applies an offset to the RGB components of the specified color. +// This function can be seen as an easy way to make a color darker or lighter than +// its default value. +// +// Parameters: +// [IN] byColorIndex +// Index of the color to set. +// See SetColor for the list of available colors. +// [IN] shOffsetColor +// A short value indicating the offset to apply to the color. +// This value must be between -255 and 255. +// [IN] bRepaint +// If TRUE the control will be repainted. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// BTNST_INVALIDINDEX +// Invalid color index. +// BTNST_BADPARAM +// The specified offset is out of range. +// +DWORD CButtonST::OffsetColor(BYTE byColorIndex, short shOffset, BOOL bRepaint) +{ + BYTE byRed = 0; + BYTE byGreen = 0; + BYTE byBlue = 0; + short shOffsetR = shOffset; + short shOffsetG = shOffset; + short shOffsetB = shOffset; + + if (byColorIndex >= BTNST_MAX_COLORS) return BTNST_INVALIDINDEX; + if (shOffset < -255 || shOffset > 255) return BTNST_BADPARAM; + + // Get RGB components of specified color + byRed = GetRValue(m_crColors[byColorIndex]); + byGreen = GetGValue(m_crColors[byColorIndex]); + byBlue = GetBValue(m_crColors[byColorIndex]); + + // Calculate max. allowed real offset + if (shOffset > 0) + { + if (byRed + shOffset > 255) shOffsetR = 255 - byRed; + if (byGreen + shOffset > 255) shOffsetG = 255 - byGreen; + if (byBlue + shOffset > 255) shOffsetB = 255 - byBlue; + + shOffset = min(min(shOffsetR, shOffsetG), shOffsetB); + } // if + else + { + if (byRed + shOffset < 0) shOffsetR = -byRed; + if (byGreen + shOffset < 0) shOffsetG = -byGreen; + if (byBlue + shOffset < 0) shOffsetB = -byBlue; + + shOffset = max(max(shOffsetR, shOffsetG), shOffsetB); + } // else + + // Set new color + m_crColors[byColorIndex] = RGB(byRed + shOffset, byGreen + shOffset, byBlue + shOffset); + + if (bRepaint) Invalidate(); + + return BTNST_OK; +} // End of OffsetColor + +// This function sets the hilight logic for the button. +// Applies only to flat buttons. +// +// Parameters: +// [IN] bAlwaysTrack +// If TRUE the button will be hilighted even if the window that owns it, is +// not the active window. +// If FALSE the button will be hilighted only if the window that owns it, +// is the active window. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// +DWORD CButtonST::SetAlwaysTrack(BOOL bAlwaysTrack) +{ + m_bAlwaysTrack = bAlwaysTrack; + return BTNST_OK; +} // End of SetAlwaysTrack + +// This function sets the cursor to be used when the mouse is over the button. +// +// Parameters: +// [IN] nCursorId +// ID number of the cursor resource. +// Pass NULL to remove a previously loaded cursor. +// [IN] bRepaint +// If TRUE the control will be repainted. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// BTNST_INVALIDRESOURCE +// Failed loading the specified resource. +// +DWORD CButtonST::SetBtnCursor(int nCursorId, BOOL bRepaint) +{ + HINSTANCE hInstResource = NULL; + // Destroy any previous cursor + if (m_hCursor) + { + ::DestroyCursor(m_hCursor); + m_hCursor = NULL; + } // if + + // Load cursor + if (nCursorId) + { + hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE(nCursorId), RT_GROUP_CURSOR); + // Load cursor resource + m_hCursor = (HCURSOR)::LoadImage(hInstResource, MAKEINTRESOURCE(nCursorId), IMAGE_CURSOR, 0, 0, 0); + // Repaint the button + if (bRepaint) Invalidate(); + // If something wrong + if (m_hCursor == NULL) return BTNST_INVALIDRESOURCE; + } // if + + return BTNST_OK; +} // End of SetBtnCursor + +// This function sets if the button border must be drawn. +// Applies only to flat buttons. +// +// Parameters: +// [IN] bDrawBorder +// If TRUE the border will be drawn. +// [IN] bRepaint +// If TRUE the control will be repainted. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// +DWORD CButtonST::DrawBorder(BOOL bDrawBorder, BOOL bRepaint) +{ + m_bDrawBorder = bDrawBorder; + // Repaint the button + if (bRepaint) Invalidate(); + + return BTNST_OK; +} // End of DrawBorder + +// This function sets if the focus rectangle must be drawn for flat buttons. +// +// Parameters: +// [IN] bDrawFlatFocus +// If TRUE the focus rectangle will be drawn also for flat buttons. +// [IN] bRepaint +// If TRUE the control will be repainted. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// +DWORD CButtonST::DrawFlatFocus(BOOL bDrawFlatFocus, BOOL bRepaint) +{ + m_bDrawFlatFocus = bDrawFlatFocus; + // Repaint the button + if (bRepaint) Invalidate(); + + return BTNST_OK; +} // End of DrawFlatFocus + +void CButtonST::InitToolTip() +{ + if (m_ToolTip.m_hWnd == NULL) + { + // Create ToolTip control + m_ToolTip.Create(this); + // Create inactive + m_ToolTip.Activate(FALSE); + // Enable multiline + m_ToolTip.SendMessage(TTM_SETMAXTIPWIDTH, 0, 400); + } // if +} // End of InitToolTip + +// This function sets the text to show in the button tooltip. +// +// Parameters: +// [IN] nText +// ID number of the string resource containing the text to show. +// [IN] bActivate +// If TRUE the tooltip will be created active. +// +void CButtonST::SetTooltipText(int nText, BOOL bActivate) +{ + CString sText; + + // Load string resource + sText.LoadString(nText); + // If string resource is not empty + if (sText.IsEmpty() == FALSE) SetTooltipText((LPCTSTR)sText, bActivate); +} // End of SetTooltipText + +// This function sets the text to show in the button tooltip. +// +// Parameters: +// [IN] lpszText +// Pointer to a null-terminated string containing the text to show. +// [IN] bActivate +// If TRUE the tooltip will be created active. +// +void CButtonST::SetTooltipText(LPCTSTR lpszText, BOOL bActivate) +{ + // We cannot accept NULL pointer + if (lpszText == NULL) return; + + // Initialize ToolTip + InitToolTip(); + + // If there is no tooltip defined then add it + if (m_ToolTip.GetToolCount() == 0) + { + CRect rectBtn; + GetClientRect(rectBtn); + m_ToolTip.AddTool(this, lpszText, rectBtn, 1); + } // if + + // Set text for tooltip + m_ToolTip.UpdateTipText(lpszText, this, 1); + m_ToolTip.Activate(bActivate); +} // End of SetTooltipText + +// This function enables or disables the button tooltip. +// +// Parameters: +// [IN] bActivate +// If TRUE the tooltip will be activated. +// +void CButtonST::ActivateTooltip(BOOL bActivate) +{ + // If there is no tooltip then do nothing + if (m_ToolTip.GetToolCount() == 0) return; + + // Activate tooltip + m_ToolTip.Activate(bActivate); +} // End of EnableTooltip + +// This function returns if the button is the default button. +// +// Return value: +// TRUE +// The button is the default button. +// FALSE +// The button is not the default button. +// +BOOL CButtonST::GetDefault() +{ + return m_bIsDefault; +} // End of GetDefault + +// This function enables the transparent mode. +// Note: this operation is not reversible. +// DrawTransparent should be called just after the button is created. +// Do not use trasparent buttons until you really need it (you have a bitmapped +// background) since each transparent button makes a copy in memory of its background. +// This may bring unnecessary memory use and execution overload. +// +// Parameters: +// [IN] bRepaint +// If TRUE the control will be repainted. +// +void CButtonST::DrawTransparent(BOOL bRepaint) +{ + m_bDrawTransparent = TRUE; + + // Restore old bitmap (if any) + if (m_dcBk.m_hDC != NULL && m_pbmpOldBk != NULL) + { + m_dcBk.SelectObject(m_pbmpOldBk); + } // if + + m_bmpBk.DeleteObject(); + m_dcBk.DeleteDC(); + + // Repaint the button + if (bRepaint) Invalidate(); +} // End of DrawTransparent + +// This function sets the URL that will be opened when the button is clicked. +// +// Parameters: +// [IN] lpszURL +// Pointer to a null-terminated string that contains the URL. +// Pass NULL to removed any previously specified URL. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// +DWORD CButtonST::SetURL(LPCTSTR lpszURL) +{ + // Remove any existing URL + memset(m_szURL, 0, sizeof(m_szURL)); + + if (lpszURL) + { + // Store the URL + _tcsncpy(m_szURL, lpszURL, _MAX_PATH); + } // if + + return BTNST_OK; +} // End of SetURL + +// This function associates a menu to the button. +// The menu will be displayed clicking the button. +// +// Parameters: +// [IN] nMenu +// ID number of the menu resource. +// Pass NULL to remove any menu from the button. +// [IN] hParentWnd +// Handle to the window that owns the menu. +// This window receives all messages from the menu. +// [IN] bRepaint +// If TRUE the control will be repainted. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// BTNST_INVALIDRESOURCE +// Failed loading the specified resource. +// +#ifndef BTNST_USE_BCMENU +DWORD CButtonST::SetMenu(UINT nMenu, HWND hParentWnd, BOOL bRepaint) +{ + HINSTANCE hInstResource = NULL; + + // Destroy any previous menu + if (m_hMenu) + { + ::DestroyMenu(m_hMenu); + m_hMenu = NULL; + m_hParentWndMenu = NULL; + m_bMenuDisplayed = FALSE; + } // if + + // Load menu + if (nMenu) + { + // Find correct resource handle + hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE(nMenu), RT_MENU); + // Load menu resource + m_hMenu = ::LoadMenu(hInstResource, MAKEINTRESOURCE(nMenu)); + m_hParentWndMenu = hParentWnd; + // If something wrong + if (m_hMenu == NULL) return BTNST_INVALIDRESOURCE; + } // if + + // Repaint the button + if (bRepaint) Invalidate(); + + return BTNST_OK; +} // End of SetMenu +#endif + +// This function associates a menu to the button. +// The menu will be displayed clicking the button. +// The menu will be handled by the BCMenu class. +// +// Parameters: +// [IN] nMenu +// ID number of the menu resource. +// Pass NULL to remove any menu from the button. +// [IN] hParentWnd +// Handle to the window that owns the menu. +// This window receives all messages from the menu. +// [IN] bWinXPStyle +// If TRUE the menu will be displayed using the new Windows XP style. +// If FALSE the menu will be displayed using the standard style. +// [IN] nToolbarID +// Resource ID of the toolbar to be associated to the menu. +// [IN] sizeToolbarIcon +// A CSize object indicating the size (in pixels) of each icon into the toolbar. +// All icons into the toolbar must have the same size. +// [IN] crToolbarBk +// A COLORREF value indicating the color to use as background for the icons into the toolbar. +// This color will be used as the "transparent" color. +// [IN] bRepaint +// If TRUE the control will be repainted. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// BTNST_INVALIDRESOURCE +// Failed loading the specified resource. +// +#ifdef BTNST_USE_BCMENU +DWORD CButtonST::SetMenu(UINT nMenu, HWND hParentWnd, BOOL bWinXPStyle, UINT nToolbarID, CSize sizeToolbarIcon, COLORREF crToolbarBk, BOOL bRepaint) +{ + BOOL bRetValue = FALSE; + + // Destroy any previous menu + if (m_menuPopup.m_hMenu) + { + m_menuPopup.DestroyMenu(); + m_hParentWndMenu = NULL; + m_bMenuDisplayed = FALSE; + } // if + + // Load menu + if (nMenu) + { + m_menuPopup.SetMenuDrawMode(bWinXPStyle); + // Load menu + bRetValue = m_menuPopup.LoadMenu(nMenu); + // If something wrong + if (bRetValue == FALSE) return BTNST_INVALIDRESOURCE; + + // Load toolbar + if (nToolbarID) + { + m_menuPopup.SetBitmapBackground(crToolbarBk); + m_menuPopup.SetIconSize(sizeToolbarIcon.cx, sizeToolbarIcon.cy); + + bRetValue = m_menuPopup.LoadToolbar(nToolbarID); + // If something wrong + if (bRetValue == FALSE) + { + m_menuPopup.DestroyMenu(); + return BTNST_INVALIDRESOURCE; + } // if + } // if + + m_hParentWndMenu = hParentWnd; + } // if + + // Repaint the button + if (bRepaint) Invalidate(); + + return BTNST_OK; +} // End of SetMenu +#endif + +// This function is called every time the button background needs to be painted. +// If the button is in transparent mode this function will NOT be called. +// This is a virtual function that can be rewritten in CButtonST-derived classes +// to produce a whole range of buttons not available by default. +// +// Parameters: +// [IN] pDC +// Pointer to a CDC object that indicates the device context. +// [IN] pRect +// Pointer to a CRect object that indicates the bounds of the +// area to be painted. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// +DWORD CButtonST::OnDrawBackground(CDC* pDC, LPCRECT pRect) +{ + COLORREF crColor; + + if (m_bMouseOnButton || m_bIsPressed) + crColor = m_crColors[BTNST_COLOR_BK_IN]; + else + { + if (m_bIsFocused) + crColor = m_crColors[BTNST_COLOR_BK_FOCUS]; + else + crColor = m_crColors[BTNST_COLOR_BK_OUT]; + } // else + + CBrush brBackground(crColor); + + pDC->FillRect(pRect, &brBackground); + + return BTNST_OK; +} // End of OnDrawBackground + +// This function is called every time the button border needs to be painted. +// If the button is in standard (not flat) mode this function will NOT be called. +// This is a virtual function that can be rewritten in CButtonST-derived classes +// to produce a whole range of buttons not available by default. +// +// Parameters: +// [IN] pDC +// Pointer to a CDC object that indicates the device context. +// [IN] pRect +// Pointer to a CRect object that indicates the bounds of the +// area to be painted. +// +// Return value: +// BTNST_OK +// Function executed successfully. +// +DWORD CButtonST::OnDrawBorder(CDC* pDC, LPCRECT pRect) +{ + if (m_bIsPressed) + pDC->Draw3dRect(pRect, ::GetSysColor(COLOR_BTNSHADOW), ::GetSysColor(COLOR_BTNHILIGHT)); + else + pDC->Draw3dRect(pRect, ::GetSysColor(COLOR_BTNHILIGHT), ::GetSysColor(COLOR_BTNSHADOW)); + + return BTNST_OK; +} // End of OnDrawBorder + +#undef BS_TYPEMASK diff --git a/Src/CH91PayloadSoftware/BtnST.h b/Src/CH91PayloadSoftware/BtnST.h new file mode 100644 index 0000000..cec5284 --- /dev/null +++ b/Src/CH91PayloadSoftware/BtnST.h @@ -0,0 +1,241 @@ +// +// Class: CButtonST + +// +// Note: Code for the PreSubclassWindow and OnSetStyle functions +// has been taken from the COddButton class +// published by Paolo Messina and Jerzy Kaczorowski +// +// Disclaimer +// ---------- +// THIS SOFTWARE AND THE ACCOMPANYING FILES ARE DISTRIBUTED "AS IS" AND WITHOUT +// ANY WARRANTIES WHETHER EXPRESSED OR IMPLIED. NO REPONSIBILITIES FOR POSSIBLE +// DAMAGES OR EVEN FUNCTIONALITY CAN BE TAKEN. THE USER MUST ASSUME THE ENTIRE +// RISK OF USING THIS SOFTWARE. +// +// Terms of use +// ------------ +// THIS SOFTWARE IS FREE FOR PERSONAL USE OR FREEWARE APPLICATIONS. +// IF YOU USE THIS SOFTWARE IN COMMERCIAL OR SHAREWARE APPLICATIONS YOU +// ARE GENTLY ASKED TO DONATE 1$ (ONE U.S. DOLLAR) TO THE AUTHOR: + +#ifndef _BTNST_H +#define _BTNST_H + +// Uncomment the following 2 lines to enable support for BCMenu class +#define BTNST_USE_BCMENU +#include "BCMenu.h" + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +// Return values +#ifndef BTNST_OK +#define BTNST_OK 0 +#endif +#ifndef BTNST_INVALIDRESOURCE +#define BTNST_INVALIDRESOURCE 1 +#endif +#ifndef BTNST_FAILEDMASK +#define BTNST_FAILEDMASK 2 +#endif +#ifndef BTNST_INVALIDINDEX +#define BTNST_INVALIDINDEX 3 +#endif +#ifndef BTNST_INVALIDALIGN +#define BTNST_INVALIDALIGN 4 +#endif +#ifndef BTNST_BADPARAM +#define BTNST_BADPARAM 5 +#endif + +// Dummy identifier for grayscale icon +#ifndef BTNST_AUTO_GRAY +#define BTNST_AUTO_GRAY (HICON)(0xffffffff - 1L) +#endif + +class CButtonST : public CButton +{ +public: + CButtonST(); + ~CButtonST(); + + enum { + ST_ALIGN_HORIZ = 0, // Icon/bitmap on the left, text on the right + ST_ALIGN_VERT, // Icon/bitmap on the top, text on the bottom + ST_ALIGN_HORIZ_RIGHT // Icon/bitmap on the right, text on the left + }; + + enum { + BTNST_COLOR_BK_IN = 0, // Background color when mouse is INside + BTNST_COLOR_FG_IN, // Text color when mouse is INside + BTNST_COLOR_BK_OUT, // Background color when mouse is OUTside + BTNST_COLOR_FG_OUT, // Text color when mouse is OUTside + BTNST_COLOR_BK_FOCUS, // Background color when the button is focused + BTNST_COLOR_FG_FOCUS, // Text color when the button is focused + + BTNST_MAX_COLORS + }; + + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CButtonST) + public: + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + virtual BOOL PreTranslateMessage(MSG* pMsg); + protected: + virtual void PreSubclassWindow(); + virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam); + //}}AFX_VIRTUAL + +public: + DWORD SetDefaultColors(BOOL bRepaint = TRUE); + DWORD SetColor(BYTE byColorIndex, COLORREF crColor, BOOL bRepaint = TRUE); + DWORD GetColor(BYTE byColorIndex, COLORREF* crpColor); + DWORD OffsetColor(BYTE byColorIndex, short shOffset, BOOL bRepaint = TRUE); + + DWORD SetCheck(int nCheck, BOOL bRepaint = TRUE); + int GetCheck(); + + DWORD SetURL(LPCTSTR lpszURL = NULL); + void DrawTransparent(BOOL bRepaint = FALSE); + + BOOL GetDefault(); + DWORD SetAlwaysTrack(BOOL bAlwaysTrack = TRUE); + + // 文字 提示 + void SetTooltipText(int nText, BOOL bActivate = TRUE); + void SetTooltipText(LPCTSTR lpszText, BOOL bActivate = TRUE); + void ActivateTooltip(BOOL bEnable = TRUE); + + DWORD SetBtnCursor(int nCursorId = NULL, BOOL bRepaint = TRUE); + + // 设置为平面 + DWORD SetFlat(BOOL bFlat = TRUE, BOOL bRepaint = TRUE); + + // 设置图标文字位置 + DWORD SetAlign(BYTE byAlign, BOOL bRepaint = TRUE); + + DWORD DrawBorder(BOOL bDrawBorder = TRUE, BOOL bRepaint = TRUE); + DWORD DrawFlatFocus(BOOL bDrawFlatFocus, BOOL bRepaint = TRUE); + + DWORD SetIcon(int nIconIn, int nIconOut = NULL); + DWORD SetIcon(HICON hIconIn, HICON hIconOut = NULL); + + DWORD SetBitmaps(int nBitmapIn, COLORREF crTransColorIn, int nBitmapOut = NULL, COLORREF crTransColorOut = 0); + DWORD SetBitmaps(HBITMAP hBitmapIn, COLORREF crTransColorIn, HBITMAP hBitmapOut = NULL, COLORREF crTransColorOut = 0); + +#ifdef BTNST_USE_BCMENU + DWORD SetMenu(UINT nMenu, HWND hParentWnd, BOOL bWinXPStyle = TRUE, UINT nToolbarID = NULL, CSize sizeToolbarIcon = CSize(16, 16), COLORREF crToolbarBk = RGB(255, 0, 255), BOOL bRepaint = TRUE); +#else + DWORD SetMenu(UINT nMenu, HWND hParentWnd, BOOL bRepaint = TRUE); +#endif + + static short GetVersionI() {return 35;} + static LPCTSTR GetVersionC() {return (LPCTSTR)_T("3.5");} + + BOOL m_bShowDisabledBitmap; + +protected: + //{{AFX_MSG(CButtonST) + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg void OnKillFocus(CWnd* pNewWnd); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnSysColorChange(); + afx_msg BOOL OnClicked(); + afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); + afx_msg void OnEnable(BOOL bEnable); + afx_msg void OnCancelMode(); + afx_msg UINT OnGetDlgCode(); + //}}AFX_MSG + +#ifdef BTNST_USE_BCMENU + afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu); + afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct); +#endif + + afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); + HICON CreateGrayscaleIcon(HICON hIcon); + virtual DWORD OnDrawBackground(CDC* pDC, LPCRECT pRect); + virtual DWORD OnDrawBorder(CDC* pDC, LPCRECT pRect); + + BOOL m_bIsFlat; // Is a flat button? + BOOL m_bMouseOnButton; // Is mouse over the button? + BOOL m_bDrawTransparent; // Draw transparent? + BOOL m_bIsPressed; // Is button pressed? + BOOL m_bIsFocused; // Is button focused? + BOOL m_bIsDisabled; // Is button disabled? + BOOL m_bIsDefault; // Is default button? + BOOL m_bIsCheckBox; // Is the button a checkbox? + BYTE m_byAlign; // Align mode + BOOL m_bDrawBorder; // Draw border? + BOOL m_bDrawFlatFocus; // Draw focus rectangle for flat button? + COLORREF m_crColors[BTNST_MAX_COLORS]; // Colors to be used + HWND m_hParentWndMenu; // Handle to window for menu selection + BOOL m_bMenuDisplayed; // Is menu displayed ? + +#ifdef BTNST_USE_BCMENU + BCMenu m_menuPopup; // BCMenu class instance +#else + HMENU m_hMenu; // Handle to associated menu +#endif + +private: + LRESULT OnSetCheck(WPARAM wParam, LPARAM lParam); + LRESULT OnGetCheck(WPARAM wParam, LPARAM lParam); + LRESULT OnSetStyle(WPARAM wParam, LPARAM lParam); + LRESULT OnMouseLeave(WPARAM wParam, LPARAM lParam); + + void CancelHover(); + void FreeResources(BOOL bCheckForNULL = TRUE); + void PrepareImageRect(BOOL bHasTitle, RECT* rpItem, CRect* rpTitle, BOOL bIsPressed, DWORD dwWidth, DWORD dwHeight, CRect* rpImage); + HBITMAP CreateBitmapMask(HBITMAP hSourceBitmap, DWORD dwWidth, DWORD dwHeight, COLORREF crTransColor); + void DrawTheIcon(CDC* pDC, BOOL bHasTitle, RECT* rpItem, CRect* rpTitle, BOOL bIsPressed, BOOL bIsDisabled); + void DrawTheBitmap(CDC* pDC, BOOL bHasTitle, RECT *rItem, CRect *rCaption, BOOL bIsPressed, BOOL bIsDisabled); + void PaintBk(CDC* pDC); + + void InitToolTip(); + + HCURSOR m_hCursor; // Handle to cursor + CToolTipCtrl m_ToolTip; // Tooltip + + CDC m_dcBk; + CBitmap m_bmpBk; + CBitmap* m_pbmpOldBk; + + BOOL m_bAlwaysTrack; // Always hilight button? + int m_nCheck; // Current value for checkbox + UINT m_nTypeStyle; // Button style + + TCHAR m_szURL[_MAX_PATH]; // URL to open when clicked + +#pragma pack(1) + typedef struct _STRUCT_ICONS + { + HICON hIcon; // Handle to icon + DWORD dwWidth; // Width of icon + DWORD dwHeight; // Height of icon + } STRUCT_ICONS; +#pragma pack() + +#pragma pack(1) + typedef struct _STRUCT_BITMAPS + { + HBITMAP hBitmap; // Handle to bitmap + DWORD dwWidth; // Width of bitmap + DWORD dwHeight; // Height of bitmap + HBITMAP hMask; // Handle to mask bitmap + COLORREF crTransparent; // Transparent color + } STRUCT_BITMAPS; +#pragma pack() + + STRUCT_ICONS m_csIcons[2]; + STRUCT_BITMAPS m_csBitmaps[2]; + + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif diff --git a/Src/CH91PayloadSoftware/CH91PayloadSoftware.cpp b/Src/CH91PayloadSoftware/CH91PayloadSoftware.cpp new file mode 100644 index 0000000..1be3c39 --- /dev/null +++ b/Src/CH91PayloadSoftware/CH91PayloadSoftware.cpp @@ -0,0 +1,153 @@ + +// CH91PayloadSoftware.cpp : 定义应用程序的类行为。 +// + +#include "stdafx.h" +#include "CH91PayloadSoftware.h" +#include "CH91PayloadSoftwareDlg.h" +#include "cDESUtils.h" +#include "cPhysicsInfoUtils.h" +#include "cMD5Encode.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// CCH91PayloadSoftwareApp + +BEGIN_MESSAGE_MAP(CCH91PayloadSoftwareApp, CWinApp) + //ON_COMMAND(ID_HELP, &CWinApp::OnHelp) +END_MESSAGE_MAP() + + +// CCH91PayloadSoftwareApp 构造 + +CCH91PayloadSoftwareApp::CCH91PayloadSoftwareApp() +{ + // 支持重新启动管理器 + m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART; + + // TODO: 在此处添加构造代码, + // 将所有重要的初始化放置在 InitInstance 中 + +} + + +// 唯一的一个 CCH91PayloadSoftwareApp 对象 + +CCH91PayloadSoftwareApp theApp; + + +// CCH91PayloadSoftwareApp 初始化 + +BOOL CCH91PayloadSoftwareApp::InitInstance() +{ + /************************************************************************/ + /* DES加解密 软件防拷贝 */ + /************************************************************************/ + cPhysicsInfoUtils m_physicsInfoUtils; + string strSerialNum; //硬盘序列号 + string strMAC; //网卡MAC地址 + string strCPUId; //CPU序列号 + + m_physicsInfoUtils.GetHardDiskSerial(strSerialNum); //获取硬盘序列号 + m_physicsInfoUtils.GetMAC(strMAC); //获取MAC地址 + m_physicsInfoUtils.GetCPU_iD(strCPUId); //获取CPU序列号 + + cDESUtils m_desUtils; + string str1 = strSerialNum + strMAC + strCPUId; + + Md5Encode m_Md5Encoder; + str1 = m_Md5Encoder.Encode(str1); + //str1 = "A1335FA36BDA99F1E5D53DD08FDF7898"; + string str2 = "FEIPENGZHIKONG2021.";//密钥 + + str1 = m_desUtils.H(str1);//十六进制转换为二进制 + str2 = m_desUtils.H(str2);//十六进制转换为二进制 + m_desUtils.generateKeys(str2);//生成子密钥 + string str3 = m_desUtils.encrypt(str1);//明文加密 + str3 = m_desUtils.G(str3);//二进制转换为十六进制 + CString strSoftwareCode = str3.c_str(); + + CString m_strRegisterPath = GetSoftwareCurrentDirectory() + _T("\\Register.txt");//注册码文件 + if (PathFileExists(m_strRegisterPath))//注册码文件存在 + { + CStdioFile fileRegister; + fileRegister.Open(m_strRegisterPath, CFile::modeRead); + CString strRegisterCode; + fileRegister.ReadString(strRegisterCode); + fileRegister.Close(); + if (!(strRegisterCode == strSoftwareCode)) + { + MessageBox(NULL, "请联系航天飞鹏完成软件注册!", "提示", MB_OK); + return FALSE; + } + }else //注册码文件不存在 + { + MessageBox(NULL, "请联系航天飞鹏完成软件注册!", "提示", MB_OK); + return FALSE; + } + + // 在初始对话框之前设置线程语言 + // // 设置线程语言为“中文” + // SetThreadLocale(MAKELCID(MAKELANGID( + // LANG_CHINESE, + // SUBLANG_CHINESE_SIMPLIFIED), + // SORT_DEFAULT)); + + + // 如果一个运行在 Windows XP 上的应用程序清单指定要 + // 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式, + //则需要 InitCommonControlsEx()。否则,将无法创建窗口。 + INITCOMMONCONTROLSEX InitCtrls; + InitCtrls.dwSize = sizeof(InitCtrls); + // 将它设置为包括所有要在应用程序中使用的 + // 公共控件类。 + InitCtrls.dwICC = ICC_WIN95_CLASSES; + InitCommonControlsEx(&InitCtrls); + CWinApp::InitInstance(); + + + AfxEnableControlContainer(); + + // 创建 shell 管理器,以防对话框包含 + // 任何 shell 树视图控件或 shell 列表视图控件。 + CShellManager *pShellManager = new CShellManager; + + // 标准初始化 + // 如果未使用这些功能并希望减小 + // 最终可执行文件的大小,则应移除下列 + // 不需要的特定初始化例程 + // 更改用于存储设置的注册表项 + // TODO: 应适当修改该字符串, + // 例如修改为公司或组织名 + SetRegistryKey(_T("应用程序向导生成的本地应用程序")); + // 设置线程语言为“英文” + SetThreadLocale(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); + + CCH91PayloadSoftwareDlg dlg; + m_pMainWnd = &dlg; + INT_PTR nResponse = dlg.DoModal(); + if (nResponse == IDOK) + { + // TODO: 在此放置处理何时用 + // “确定”来关闭对话框的代码 + } + else if (nResponse == IDCANCEL) + { + // TODO: 在此放置处理何时用 + // “取消”来关闭对话框的代码 + } + + // 删除上面创建的 shell 管理器。 + if (pShellManager != NULL) + { + delete pShellManager; + } + + // 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序, + // 而不是启动应用程序的消息泵。 + return FALSE; +} + diff --git a/Src/CH91PayloadSoftware/CH91PayloadSoftware.h b/Src/CH91PayloadSoftware/CH91PayloadSoftware.h new file mode 100644 index 0000000..3e7ef66 --- /dev/null +++ b/Src/CH91PayloadSoftware/CH91PayloadSoftware.h @@ -0,0 +1,32 @@ + +// CH91PayloadSoftware.h : PROJECT_NAME 应用程序的主头文件 +// + +#pragma once + +#ifndef __AFXWIN_H__ + #error "在包含此文件之前包含“stdafx.h”以生成 PCH 文件" +#endif + +#include "resource.h" // 主符号 + + +// CCH91PayloadSoftwareApp: +// 有关此类的实现,请参阅 CH91PayloadSoftware.cpp +// + +class CCH91PayloadSoftwareApp : public CWinApp +{ +public: + CCH91PayloadSoftwareApp(); + +// 重写 +public: + virtual BOOL InitInstance(); + +// 实现 + + DECLARE_MESSAGE_MAP() +}; + +extern CCH91PayloadSoftwareApp theApp; \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/CH91PayloadSoftware.rc b/Src/CH91PayloadSoftware/CH91PayloadSoftware.rc new file mode 100644 index 0000000..37da237 Binary files /dev/null and b/Src/CH91PayloadSoftware/CH91PayloadSoftware.rc differ diff --git a/Src/CH91PayloadSoftware/CH91PayloadSoftware.sln b/Src/CH91PayloadSoftware/CH91PayloadSoftware.sln new file mode 100644 index 0000000..3619ff7 --- /dev/null +++ b/Src/CH91PayloadSoftware/CH91PayloadSoftware.sln @@ -0,0 +1,20 @@ +锘 +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CH91PayloadSoftware", "CH91PayloadSoftware.vcxproj", "{89E02284-2466-4FFA-B5D4-12173645A4F1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {89E02284-2466-4FFA-B5D4-12173645A4F1}.Debug|Win32.ActiveCfg = Debug|Win32 + {89E02284-2466-4FFA-B5D4-12173645A4F1}.Debug|Win32.Build.0 = Debug|Win32 + {89E02284-2466-4FFA-B5D4-12173645A4F1}.Release|Win32.ActiveCfg = Release|Win32 + {89E02284-2466-4FFA-B5D4-12173645A4F1}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Src/CH91PayloadSoftware/CH91PayloadSoftware.vcxproj b/Src/CH91PayloadSoftware/CH91PayloadSoftware.vcxproj new file mode 100644 index 0000000..3061e0d --- /dev/null +++ b/Src/CH91PayloadSoftware/CH91PayloadSoftware.vcxproj @@ -0,0 +1,286 @@ +锘 + + + + Debug + Win32 + + + Release + Win32 + + + + {89E02284-2466-4FFA-B5D4-12173645A4F1} + CH91PayloadSoftware + MFCProj + + + + Application + true + MultiByte + Dynamic + + + Application + false + true + MultiByte + Dynamic + + + + + + + + + + + + + + + + + + + true + ..\..\Bin\ + $(Configuration)\ + C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\boost_1_56;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\opencv245\include;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\gdal\include;$(IncludePath) + C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\boost_1_56\stage\lib;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\gdal\lib;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\opencv245\lib\x86;$(LibraryPath) + + + false + ..\..\Bin\ + ..\..\Bin\ + C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\boost_1_56;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\opencv245\include\opencv;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\opencv245\include\opencv2;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\opencv245\include;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\gdal\include;$(IncludePath) + C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\boost_1_56\stage\lib;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\gdal\lib;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\opencv245\lib\x86;$(LibraryPath) + FH98PayloadOnBoard + + + + Use + Level3 + Disabled + WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) + Async + ..\..\Include;..\XtremeToolKitPro;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\gdal\include;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\opencv245\include;%(AdditionalIncludeDirectories) + + + Windows + true + QB_SimpleImgShowD.lib;QB_GoogleMapOperateD.lib;MapPrj.lib;QB_ImgShowBaseD.lib;QB_ImgProcessFunD.lib;QB_AutoMapD.lib;OIS_static_d.lib;Decoder_H264_ALLD.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\opencv245\lib\x86;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\gdal\lib;%(AdditionalLibraryDirectories) + + + false + true + _DEBUG;%(PreprocessorDefinitions) + + + 0x0804 + _DEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) + Async + ..\..\Include;..\XtremeToolKitPro;C:\ProgramFiles\opencv245\include;C:\ProgramFiles\gdal\include;%(AdditionalIncludeDirectories) + + + Windows + true + true + true + QB_SimpleImgShow.lib;QB_GoogleMapOperate.lib;MapPrj.lib;QB_ImgShowBase.lib;QB_AutoMap.lib;QB_ImgProcessFun.lib;OIS_static.lib;Decoder_H264_ALLR.lib;%(AdditionalDependencies) + C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\gdal\lib;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\opencv245\lib\x86;%(AdditionalLibraryDirectories) + + + false + true + NDEBUG;%(PreprocessorDefinitions) + + + 0x0804 + NDEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/CH91PayloadSoftware.vcxproj.filters b/Src/CH91PayloadSoftware/CH91PayloadSoftware.vcxproj.filters new file mode 100644 index 0000000..3a99993 --- /dev/null +++ b/Src/CH91PayloadSoftware/CH91PayloadSoftware.vcxproj.filters @@ -0,0 +1,548 @@ +锘 + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {2c47f6ec-5889-40dd-84a0-4a7a3824543e} + + + {994b2653-405f-4e81-a574-2a5471597def} + + + {b2e6a3ca-3198-428a-94ea-f0c9235fa3c8} + + + {1a537331-9999-4114-af76-816ee123721d} + + + {f965b4eb-c120-4667-b38c-aa281f1b242d} + + + {1d5e7efa-7a87-4b0a-9ffd-9e5feab4f388} + + + {6f6d3966-ef1a-4d34-9c4d-8e1d9ca56239} + + + {8556a374-d901-40be-a311-fd36ec5ffa24} + + + {3624c3f4-0761-4c84-8fff-a1d9ef6a811c} + + + {5a735158-3c0e-4272-bbdb-d7081a4ba28b} + + + {7fe17581-e651-4b10-a392-97613d13cccd} + + + {0b65e705-1cec-4541-a95c-317bb8c969e4} + + + {3a07efef-8012-4426-b5ea-b321ad162dee} + + + {e366088b-ea63-4916-81b7-d77bd588678e} + + + {465d4127-69ef-48a2-a925-b10ecda8dc3b} + + + {39c8d198-f92f-43a2-8a58-0e15ba92b402} + + + {8342d623-5967-4829-bc07-540180ee9b82} + + + {7c9ecd9b-bd1f-490b-8d0d-248a8b6fab48} + + + {d0afe885-b4d7-4411-b9b1-19695f56ae4f} + + + {89832b67-f355-4634-ad59-819a3c35319e} + + + {98e31955-0ba4-4b74-9db1-8a712a10792a} + + + {ab6ee3f8-60f1-43e8-9f15-bbb160de9c67} + + + {f06cd1e0-85bf-45a0-867a-ee5a88d8e499} + + + {ac0ffa33-f9fc-4e75-9781-73b28c12be43} + + + {14c6a6db-8887-4abf-aeee-f39bfcb37fc6} + + + {04315dca-4ce2-425a-bcc9-d26fe11219c5} + + + {8eb1f68d-8c2d-485d-b3bd-9859d81467d5} + + + {be9a2dce-ba4c-44fd-9db6-fefe7b53caa0} + + + + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + 璧勬簮鏂囦欢 + + + + + 澶存枃浠 + + + 澶存枃浠 + + + 澶存枃浠 + + + 澶存枃浠 + + + 鍏ㄥ眬 + + + 鍏ㄥ眬 + + + 鍏ㄥ眬 + + + 閫氫俊鐩稿叧\缁勬挱绫 + + + H264瑙g爜 + + + 閫氫俊鐩稿叧\涓插彛绫 + + + 澶嶆帴鏄剧ず绐楀彛 + + + 璧勬簮鏂囦欢\璇诲彇楂樼▼ + + + 閫氫俊鐩稿叧\UDP绫 + + + 涓荤獥鍙 + + + 瑙嗛鍥炴斁鎺у埗绐楀彛 + + + 鎸夐挳缇庡寲 + + + 鎸夐挳缇庡寲 + + + 鎸夐挳缇庡寲 + + + 鎸夐挳缇庡寲 + + + 鎸夐挳缇庡寲 + + + 鎸夐挳缇庡寲 + + + 鎸夐挳缇庡寲 + + + 鎸夐挳缇庡寲 + + + 鎸夐挳缇庡寲 + + + 瑙嗛鍥炴斁鎺у埗绐楀彛 + + + 涓荤獥鍙 + + + 鍏ㄥ眬 + + + 涓荤獥鍙 + + + 绾㈠鍙嶄氦閿 + + + 杞借嵎鎺у埗绐楀彛\鎵嬪姩鎸囦护鐩&鍙戦佹寚浠 + + + 鎽囨潌鍙婅棰戦敭鐩榎鎽囨潌 + + + 鎽囨潌鍙婅棰戦敭鐩榎瑙嗛閿洏 + + + 鎽囨潌鍙婅棰戦敭鐩榎鎽囨潌 + + + H264瑙g爜 + + + 澶存枃浠 + + + 澶存枃浠 + + + 杞借嵎鎺у埗绐楀彛\CH96鎺у埗椤甸潰 + + + 缁勬挱鏀舵暟 + + + 缁勬挱鏀舵暟 + + + 甯цВ鏋愮被 + + + 甯цВ鏋愮被 + + + 甯цВ鏋愮被 + + + 甯цВ鏋愮被 + + + 澶存枃浠 + + + 鎸夐挳缇庡寲 + + + 閫氫俊鐩稿叧\TCP绫 + + + 鍔犺В瀵 + + + 鍔犺В瀵 + + + 鍔犺В瀵 + + + 鍔犺В瀵 + + + 閫氫俊鐩稿叧\涓插彛绫籠涓插彛鎺у埗鐩稿叧 + + + IMP\閫氫俊 + + + IMP\瀵硅瘽妗 + + + IMP\鍗忚 + + + CYH鏂板 + + + CYH鏂板 + + + CYH鏂板 + + + CYH鏂板 + + + CYH鏂板 + + + + + 婧愭枃浠 + + + 婧愭枃浠 + + + 鍏ㄥ眬 + + + 鍏ㄥ眬 + + + 閫氫俊鐩稿叧\缁勬挱绫 + + + H264瑙g爜 + + + 閫氫俊鐩稿叧\涓插彛绫 + + + 澶嶆帴鏄剧ず绐楀彛 + + + 璧勬簮鏂囦欢\璇诲彇楂樼▼ + + + 閫氫俊鐩稿叧\UDP绫 + + + 涓荤獥鍙 + + + 瑙嗛鍥炴斁鎺у埗绐楀彛 + + + 鎸夐挳缇庡寲 + + + 鎸夐挳缇庡寲 + + + 鎸夐挳缇庡寲 + + + 鎸夐挳缇庡寲 + + + 鎸夐挳缇庡寲 + + + 鎸夐挳缇庡寲 + + + 鎸夐挳缇庡寲 + + + 瑙嗛鍥炴斁鎺у埗绐楀彛 + + + 涓荤獥鍙 + + + 涓荤獥鍙 + + + 绾㈠鍙嶄氦閿 + + + 杞借嵎鎺у埗绐楀彛\鎵嬪姩鎸囦护鐩&鍙戦佹寚浠 + + + 鎽囨潌鍙婅棰戦敭鐩榎鎽囨潌 + + + 鎽囨潌鍙婅棰戦敭鐩榎瑙嗛閿洏 + + + 鎽囨潌鍙婅棰戦敭鐩榎鎽囨潌 + + + 杞借嵎鎺у埗绐楀彛\CH96鎺у埗椤甸潰 + + + 缁勬挱鏀舵暟 + + + 缁勬挱鏀舵暟 + + + 婧愭枃浠 + + + 鎸夐挳缇庡寲 + + + 閫氫俊鐩稿叧\TCP绫 + + + 鍔犺В瀵 + + + 鍔犺В瀵 + + + 鍔犺В瀵 + + + 鍔犺В瀵 + + + 閫氫俊鐩稿叧\涓插彛绫籠涓插彛鎺у埗鐩稿叧 + + + IMP\閫氫俊 + + + IMP\瀵硅瘽妗 + + + IMP\鍗忚 + + + CYH鏂板 + + + CYH鏂板 + + + CYH鏂板 + + + CYH鏂板 + + + + + 璧勬簮鏂囦欢 + + + \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/CH91PayloadSoftwareDlg.cpp b/Src/CH91PayloadSoftware/CH91PayloadSoftwareDlg.cpp new file mode 100644 index 0000000..79843db --- /dev/null +++ b/Src/CH91PayloadSoftware/CH91PayloadSoftwareDlg.cpp @@ -0,0 +1,2156 @@ +// CH91PayloadSoftwareDlg.cpp : 实现文件 +// + +#include "stdafx.h" +#include "CH91PayloadSoftware.h" +#include "CH91PayloadSoftwareDlg.h" +#include "afxdialogex.h" +#include "Global.h" +#include "GlobalMessage.h" +#include "GlobalMember.h" +#include "GetElevation.h" +#include + +using namespace cv; + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// 用于应用程序“关于”菜单项的 CAboutDlg 对话框 +class CAboutDlg : public CDialogEx +{ +public: + CAboutDlg(); + + // 对话框数据 + enum { IDD = IDD_ABOUTBOX }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + // 实现 +protected: + DECLARE_MESSAGE_MAP() +}; + +CAboutDlg::CAboutDlg() : CDialogEx(CAboutDlg::IDD) +{ +} + +void CAboutDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + +BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx) +END_MESSAGE_MAP() + + +// CCH91PayloadSoftwareDlg 对话框 +CCH91PayloadSoftwareDlg::CCH91PayloadSoftwareDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CCH91PayloadSoftwareDlg::IDD, pParent) +{ + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); + + // 分别代表 数据处理的线程的句柄和ID + m_hThread_ProcessData = NULL; + m_ThreadID_ProcessData = 0; + // 分别代表 数据处理的线程的句柄和ID + m_hThread_ProcessDataH264 = NULL; + m_ThreadID_ProcessDataH264 = 0; + + //显示可见光及红外图像 + m_wndShowEO = nullptr; // EO + + // 是否按下鼠标中键 + m_bMButtonDown = FALSE; // TRUE: 按下鼠标中键 FALSE: 抬起鼠标中键 + + //载荷控制、状态查看、视频回放控制对话框对象 + m_ShowFJDataDlg = nullptr; + m_ShowReplayDlg = nullptr; + m_ShowDlgRecvDataFromQB = nullptr; + m_JoyStickControlDlg = nullptr; + //图像采集变量 + m_bCaptureEOImg = false; + m_bCaptureIRImg = false; + + // 视频全屏显示变量 + m_bVideoShowFullScreen = FALSE; + + g_bMapDirectGuide = FALSE; // 是否是地图直接导引标志 + + p_DlgCameraCtrl = NULL;//吊舱控制页面 + g_DlgIMP = NULL;//IMP对话框初始化指针 + p_Dlg13InstituteDCNewCtrl = NULL;//13所吊舱新控制放页面 +} + +void CCH91PayloadSoftwareDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + +BEGIN_MESSAGE_MAP(CCH91PayloadSoftwareDlg, CDialogEx) + ON_WM_SYSCOMMAND() + ON_WM_PAINT() + ON_WM_QUERYDRAGICON() + ON_WM_DESTROY() + ON_MESSAGE(WM_SHOW_CH96_INFO, CCH91PayloadSoftwareDlg::ShowMsgOnDlgEO) + ON_MESSAGE(WM_SHOW_IR_INFO, CCH91PayloadSoftwareDlg::ShowMsgOnDlgIR) + ON_MESSAGE(WM_SHOW_DC_INFO, CCH91PayloadSoftwareDlg::ShowMsgOnDlgDC) + + ON_MESSAGE(WM_SHOW_GUIDE_AZIMUTH, CCH91PayloadSoftwareDlg::ShowGuideAzimuthOnDlg) + ON_MESSAGE(WM_SHOW_GUIDE_PITCH, CCH91PayloadSoftwareDlg::ShowGuidePitchOnDlg) + ON_MESSAGE(WM_SHOW_CTRL_INSTRUCTIONS, CCH91PayloadSoftwareDlg::ShowCtrlInstruction) + + ON_MESSAGE(WM_SET_PAYLOAD_TYPE, CCH91PayloadSoftwareDlg::PayloadTypeSet) + ON_MESSAGE(WM_SETFOCUS_AFTERCONTROL, CCH91PayloadSoftwareDlg::SetFocusOnMainDlg) + ON_WM_MOUSEWHEEL() + ON_BN_CLICKED(IDC_BTN_SHOW_FJ, &CCH91PayloadSoftwareDlg::OnBnClickedBtnShowFj) + ON_BN_CLICKED(IDC_BTN_LOOKUP_RESULT, &CCH91PayloadSoftwareDlg::OnBnClickedBtnLookupResult) + ON_WM_TIMER() + ON_BN_CLICKED(IDC_BTN_REPLAY, &CCH91PayloadSoftwareDlg::OnBnClickedBtnReplay) + ON_WM_MOUSEWHEEL() + ON_WM_ERASEBKGND() + ON_WM_MBUTTONDOWN() + ON_BN_CLICKED(IDC_BTN_MULTICASTSOCKETRECEIVE, &CCH91PayloadSoftwareDlg::OnBnClickedBtnMulticastsocketreceive) + ON_BN_CLICKED(IDC_BTN_CAPTURE_VIDEO, &CCH91PayloadSoftwareDlg::OnBnClickedBtnCaptureVideo) + ON_WM_ERASEBKGND() + ON_WM_ERASEBKGND() + ON_WM_CTLCOLOR() + ON_WM_LBUTTONDBLCLK() + ON_WM_RBUTTONDOWN() + ON_WM_MBUTTONDOWN() + ON_WM_MOUSEMOVE() + ON_WM_MBUTTONUP() + + //ON_MESSAGE(WM_UPDATE_IMPDOWN_CHECKED, OnUpdateIMPDownDataChecked) //更新IMP下行遥测数据 + +END_MESSAGE_MAP() + + +// CCH91PayloadSoftwareDlg 消息处理程序 + +// 输出双击点与对话框中点的夹角 +void CALLBACK GetAngleProcAzimuth (double angle) +{ + g_Guide_Azimuth = int(angle * 10) / 10.0f; + ::SendMessage(g_mainDlgHwnd, WM_SHOW_GUIDE_AZIMUTH, WPARAM(0), LPARAM(0)); +} + +// 输出双击点与对话框中点的夹角 +void CALLBACK GetAngleProcPitch (double angle) +{ + g_Guide_Pitch = int(angle * 10) / 10.0f; + + if (g_Guide_Pitch < 0) + { + g_Guide_Pitch += 360; + } + + if (g_Guide_Pitch >= 80 && g_Guide_Pitch <= 200) + { + g_Guide_Pitch = 90 - g_Guide_Pitch; + + ::SendMessage(g_mainDlgHwnd, WM_SHOW_GUIDE_PITCH, WPARAM(0), LPARAM(0)); + } +} + +LRESULT CCH91PayloadSoftwareDlg::ShowGuideAzimuthOnDlg(WPARAM wParam, LPARAM lParam) +{ + m_Guide_Azimuth = g_Guide_Azimuth; + UpdateData(FALSE); + return 0; +} + +LRESULT CCH91PayloadSoftwareDlg::ShowGuidePitchOnDlg(WPARAM wParam, LPARAM lParam) +{ + m_Guide_Pitch = g_Guide_Pitch; + UpdateData(FALSE); + return 0; +} + +// 发送控制指令之后,将焦点置于主界面上 +LRESULT CCH91PayloadSoftwareDlg::SetFocusOnMainDlg(WPARAM wParam, LPARAM lParam) +{ + // 设置焦点 + GetDlgItem(IDC_BTN_REPLAY)->SetFocus(); + return 0; +} + +BOOL CCH91PayloadSoftwareDlg::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + + // 将“关于...”菜单项添加到系统菜单中。 + + + // IDM_ABOUTBOX 必须在系统命令范围内。 + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + BOOL bNameValid; + CString strAboutMenu; + bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); + ASSERT(bNameValid); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + + // 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动 + // 执行此操作 + SetIcon(m_hIcon, TRUE); // 设置大图标 + SetIcon(m_hIcon, FALSE); // 设置小图标 + + + g_IsSending = FALSE; + //机载相机组播通信类 -- ypf + if (g_MUDPCamera.IsSerializable()) + { + g_MUDPCamera.LeaveGroup(); + } + else + { + if (!g_MUDPCamera.InitGroup("224.1.1.1",60000,5,FALSE)) + { + MessageBox("机载相机指令通信网口不可用,请重新配置!"); + } + g_IsSending = TRUE; + } + + // 创建结果目录文件夹 + CString sRootDir = GetSoftwareCurrentDirectory() + "\\Result"; + CreateDirectoryA(sRootDir, NULL); + // 创建载荷原始数据文件夹 + CString sRootDir_dat = GetSoftwareCurrentDirectory() + "\\Result\\Payload Receive"; + CreateDirectoryA(sRootDir_dat, NULL); + // 创建图像数据文件夹 + CString sRootDir_h264 = GetSoftwareCurrentDirectory() + "\\Result\\VideoData"; + CreateDirectoryA(sRootDir_h264, NULL); + // 设置软件工作语言,通过配置文件导入 + DlgLanguageSet(); + // 设置主对话框标题 + SetWindowText(_T("FH-98机载视频监控系统")); + + // 创建文件, 存储载荷软件接收原始数据(图像数据+复接数据 .tx) + CTime tm = CTime::GetCurrentTime(); + CString str_DataTime; + str_DataTime.Format(_T("FH98_SoftwareReceive_%04d%02d%02d_%02d%02d%02d.tx"), tm.GetYear(), tm.GetMonth(), tm.GetDay(), tm.GetHour(), tm.GetMinute(), tm.GetSecond());//文件名中不能出现冒号 + CString path = GetSoftwareCurrentDirectory() + "\\Result\\Payload Receive\\" + str_DataTime; + g_DataSavePath = path; + fopen_s(&g_pFileSaveCH96txData, path, _T("ab")); + + str_DataTime.Format(_T("FH98_SoftwareReceive_%04d%02d%02d_%02d%02d%02d.h264"), tm.GetYear(), tm.GetMonth(), tm.GetDay(), tm.GetHour(), tm.GetMinute(), tm.GetSecond());//文件名中不能出现冒号 + path = GetSoftwareCurrentDirectory() + "\\Result\\Payload Receive\\" + str_DataTime; + fopen_s(&g_pFileSaveVideoH264Data, path, _T("ab")); + + // 获取窗口句柄 + g_mainDlgHwnd = GetSafeHwnd(); + // 显示FJ窗口 + m_ShowFJDataDlg = new CShowFJDataDlg(); + if (m_ShowFJDataDlg != NULL) + { + m_ShowFJDataDlg->Create(IDD_DLG_SHOW_FJ_DATA, this); + } + + // 显示情报席位目标定位对话框 + m_ShowDlgRecvDataFromQB = new CDlgRecvDataFromQB(); + if (m_ShowDlgRecvDataFromQB != NULL) + { + m_ShowDlgRecvDataFromQB->Create(IDD_DLG_RECVFROMQB, this); + } + + // 显示组播收数创建对话框 + m_MulticastSocketReceiveDlg = new CMulticastSocketReceiveDlg(); + if (m_MulticastSocketReceiveDlg != NULL) + { + m_MulticastSocketReceiveDlg->Create(IDD_DLG_MULTICASTSOCKETRECEIVE, this); + } + + // 关联摇杆控制对话框(隐藏) + m_JoyStickControlDlg = new CJoyStickControlDlg(); + if (m_JoyStickControlDlg != NULL) + { + m_JoyStickControlDlg->Create(IDD_DLG_JOYSTICKCONTROL, this); + } + + // 设置主对话框上的文字 + //GetDlgItem(IDC_STATIC_COMMANDSEND) -> SetWindowText(g_str_CommandSend); + //GetDlgItem(IDC_STATIC_COMMANDRESPONSE) -> SetWindowText(g_str_CommandResponse); + //GetDlgItem(IDC_STATIC_STATE) -> SetWindowText(g_str_State); + // 控制指令面板初始化 + OnInitControlDlg(); + // 显示视频回放控制窗口 + m_ShowReplayDlg = new CShowReplayDlg(); + if (m_ShowReplayDlg != NULL) + { + m_ShowReplayDlg->Create(IDD_DLG_REPLAY, this); + } + // 互斥对象 + g_hMutex_ProcessDataCH96 = CreateMutexA(NULL, FALSE, NULL); + g_hMutex_SaveFJData = CreateMutexA(NULL,FALSE, NULL); + g_hMutex_ShowFJData = CreateMutexA(NULL, FALSE, NULL); + g_hMutex_DisplayVideoCH96 = CreateMutexA(NULL, FALSE, NULL); + g_hMutex_ProcessDataH264 = CreateMutexA(NULL, FALSE, NULL); + + // 对解码器进行初始化 + OnInitCH96Decoder(); + + // TODO: 在此添加额外的初始化 + // 线程开始执行 + g_bProcessDataFlag = true; + // 创建一个线程并立即执行,在该线程中处理接收到的数据(发送到主显示页面) + m_hThread_ProcessData = CreateThread(NULL, 0, + (LPTHREAD_START_ROUTINE)ProcessCH96Data, + nullptr, // 传递参数 + 0, // 线程创建后会被马上调用 + &m_ThreadID_ProcessData); + //线程开始执行 + g_bProcessDataSocketFlag = true; + // 创建一个线程并立即执行,在该线程中处理接收到的数据(发送到主显示页面) + m_hThread_ProcessDataH264 = CreateThread(NULL, 0, + (LPTHREAD_START_ROUTINE)ProcessH264VideoData, + nullptr, // 传递参数 + 0, // 线程创建后会被马上调用 + &m_ThreadID_ProcessDataH264); + // 设置定时器,显示视频 + SetTimer(1, 30, nullptr); + + // 判定存储空间是否不足 + CString root = GetSoftwareCurrentDirectory(); + CString disk = root.Left(1); + if(GetFreeVolumeLen(disk.GetBuffer(0)) < 10) // 10G + { + ::MessageBoxA(NULL, g_str_WarningStorage, g_str_WarningTitle, MB_OK); + } + + // 设置窗口启动最大化 + ShowWindow(SW_SHOWMAXIMIZED); + // 设置对话框风格 + DlgStyleChange(); + /* + // 将接收数据转发至移动终端 + // 控制IP和端口绑定 + CString fileSysName = GetSoftwareCurrentDirectory()+ "\\ini\\" + "config.ini"; + char LocalIp1[20]; + unsigned int LocalPort1 = 0; //本地端口 + char RemoteIp1[20]; + unsigned int RemotePort1 = 0; //对方端口 + + GetPrivateProfileString("UDPInfo_SEND2MOBILE", "UDPRemoteIP ", "0", RemoteIp1, 20, fileSysName); + GetPrivateProfileString("UDPInfo_SEND2MOBILE", "UDPLocalIP", "0", LocalIp1, 20, fileSysName); + + RemotePort1 = GetPrivateProfileInt("UDPInfo_SEND2MOBILE", "UDPRemotePort", 0, fileSysName); + LocalPort1 = GetPrivateProfileInt("UDPInfo_SEND2MOBILE", "UDPLocalPort", 0, fileSysName); + + assert(LocalPort1 != 0 && RemotePort1 != 0); + g_bCreatSend2Mobile = g_UdpSend2Mobile.StartListening(LocalIp1, LocalPort1, RemoteIp1, RemotePort1); + */ + + return TRUE; +} + +// 设置载荷类型 +LRESULT CCH91PayloadSoftwareDlg::PayloadTypeSet(WPARAM wParam, LPARAM lParam) +{ + return 0; +} +// 对Tab页上显示的控制面板进行初始化 +void CCH91PayloadSoftwareDlg::OnInitControlDlg() +{ + //关联控制指令界面 + CRect rc_ControlInstruction; + GetDlgItem(IDC_STATIC_CONTROLINSTRUCTION_FH96)->GetWindowRect(rc_ControlInstruction); + ScreenToClient(rc_ControlInstruction); + + /*m_CControlDlgFH96Page1Dlg = new CControlDlgFH96Page1(); + if (m_CControlDlgFH96Page1Dlg != NULL) + { + m_CControlDlgFH96Page1Dlg->Create(IDD_DLG_CONTROL_96_1, this); + } + m_CControlDlgFH96Page1Dlg->MoveWindow(&rc_ControlInstruction); + m_CControlDlgFH96Page1Dlg->ShowWindow(SW_SHOW);*/ + + /**************原吊舱控制页面***********/ + p_DlgCameraCtrl = new CDlgCameraCtrl(); + if (p_DlgCameraCtrl != NULL) + { + p_DlgCameraCtrl->Create(IDD_DLG_CAMERA_CTRL, this); + } + + p_DlgCameraCtrl->MoveWindow(&rc_ControlInstruction); + //p_DlgCameraCtrl->ShowWindow(SW_SHOW); + p_DlgCameraCtrl->ShowWindow(SW_HIDE); + /*************原吊舱控制页面************/ + + + /**********13所吊舱数据装订指令页面**********/ + p_Dlg13InstituteDCNewCtrl = new Dlg13InstituteDCNew(); + if (p_Dlg13InstituteDCNewCtrl != NULL) + { + p_Dlg13InstituteDCNewCtrl->Create(IDD_DIALOG_DC_13INSTITUTE_NEW, this); + } + p_Dlg13InstituteDCNewCtrl->MoveWindow(&rc_ControlInstruction); + p_Dlg13InstituteDCNewCtrl->ShowWindow(SW_HIDE); + /**********13所吊舱数据装订指令页面**********/ + + /***********IMP************/ + CRect rc_ControlInstructionIMP; + GetDlgItem(IDC_STATIC_CONTROLINSTRUCTION_IMP)->GetWindowRect(rc_ControlInstructionIMP); + ScreenToClient(rc_ControlInstructionIMP); + + g_DlgIMP = new CDlgIMP(); + if(g_DlgIMP != NULL) + { + g_DlgIMP->Create(IDD_DLG_IMP, this); + } + g_DlgIMP->MoveWindow(&rc_ControlInstructionIMP); + //g_DlgIMP->ShowWindow(SW_SHOW); + g_DlgIMP->ShowWindow(SW_HIDE); + if(g_DlgIMP->IsWindowVisible()) + { + IMPDlgWindowVisible=true; + } + else + { + IMPDlgWindowVisible=false; + } + /***********IMP************/ + + /**********吊舱数据装订指令页面**********/ + p_DlgDCOverroll = new DCOverrollDlg(); + if(p_DlgDCOverroll != NULL) + { + p_DlgDCOverroll->Create(IDD_DIALOG_DC,this); + } + p_DlgDCOverroll->MoveWindow(&rc_ControlInstruction); + p_DlgDCOverroll->ShowWindow(SW_SHOW); + /**********吊舱数据装订指令页面**********/ + +} +// 对解码器进行初始化 +void CCH91PayloadSoftwareDlg::OnInitCH96Decoder() +{ + // 对显示区域初始化 + GetDlgItem(IDC_STATIC_EO_REGION)->GetWindowRect(rect_SmallRegion); + ScreenToClient(rect_SmallRegion); + GetDlgItem(IDC_STATIC_VIDEO_REGIONALL)->GetWindowRect(rect_BigRegion); + ScreenToClient(rect_BigRegion); + // CH96解码器 + CString fileSysName = GetSoftwareCurrentDirectory()+ "\\ini\\" + "config.ini"; + char ComputerConfiguration[20]; + GetPrivateProfileString("COMPUTER_CONFIGURATION", "ComputerConfiguration ", "0", ComputerConfiguration, 20, fileSysName); + CString str_ComputerConfiguration = ComputerConfiguration; + if (str_ComputerConfiguration == "HIGH") + { + g_bGoodComputer = TRUE; + } + else if (str_ComputerConfiguration == "LOW") + { + g_bGoodComputer = FALSE; + } + else + { + MessageBoxA(_T("计算机配置类型有误,系统自动选择高配置环境!")); + g_bGoodComputer = TRUE; + } + // 如果电脑不是低配置电脑,则对显示空间进行模块初始化,同时设置为软解码 + if (g_bGoodComputer != FALSE) + { + if (m_wndShowEO == NULL) + { + m_wndShowEO = new CExportSimpleImgShow(); + } + + if (g_mainDlgHwnd != NULL && m_wndShowEO != NULL) + { + m_wndShowEO->CreateWnd(g_mainDlgHwnd); + + CRect rect; + GetDlgItem(IDC_STATIC_EO_REGION)->GetWindowRect(&rect); + ScreenToClient(&rect); + + m_wndShowEO_Position_Max_x = rect.right - rect.left; //图像显示区域的坐标最大值x + m_wndShowEO_Position_Max_y = rect.bottom - rect.top; //图像显示区域的坐标最大值y + + m_wndShowEO->MoveWnd(rect); + m_wndShowEO->ShowWnd(SW_SHOW); + m_wndShowEO->SetCallBackFun(GetEOImgCenterOffset); + m_wndShowEO->SetCallBackFun(GetEOIRImgRightButtonDown); + m_wndShowEO->SetCallBackFun(GetDistRatioAndAngleThroughImg); + } + // 软解码 + g_CH96_h264decoder = DecoderFactory::CreateDecoder(); + if (g_CH96_h264decoder != nullptr) + { + g_CH96_h264decoder->init(1920, 1080, 0, 0, 2); + // 回调函数,将文件放置内存并进行操作 + g_CH96_h264decoder->setDecodingCallback(CH96_h264DecodeResultCallbackFun); + } + } + // 如果电脑配置较低,则设置为硬解码,同时将图片直接绘制在控件上 + else + { + // 硬解码 + g_CH96_h264decoder = DecoderFactory::CreateDecoder(DEC_HARDWARE); + if (g_CH96_h264decoder != nullptr) + { + // 直接将绘制结果显示到控件上 + g_CH96_h264decoder->init(1920, 1080, 0, 0, 2, GetDlgItem(IDC_STATIC_VIDEO_REGIONALL)->GetSafeHwnd()); + // 回调函数,将文件放置内存并进行操作 + g_CH96_h264decoder->setDecodingCallback(CH96_h264DecodeResultCallbackFun); + // 改变显示区域 + GetDlgItem(IDC_STATIC_VIDEO_REGIONALL)->SetWindowPos(NULL ,0, 0, rect_SmallRegion.Width(), rect_SmallRegion.Height(), SWP_NOZORDER); + } + } +} +void CCH91PayloadSoftwareDlg::OnSysCommand(UINT nID, LPARAM lParam) +{ + if ((nID & 0xFFF0) == IDM_ABOUTBOX) + { + CAboutDlg dlgAbout; + dlgAbout.DoModal(); + } + else + { + CDialogEx::OnSysCommand(nID, lParam); + } +} + +// 如果向对话框添加最小化按钮,则需要下面的代码 +// 来绘制该图标。对于使用文档/视图模型的 MFC 应用程序, +// 这将由框架自动完成。 + +void CCH91PayloadSoftwareDlg::OnPaint() +{ + if (IsIconic()) + { + CPaintDC dc(this); // 用于绘制的设备上下文 + + SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0); + + // 使图标在工作区矩形中居中 + int cxIcon = GetSystemMetrics(SM_CXICON); + int cyIcon = GetSystemMetrics(SM_CYICON); + CRect rect; + GetClientRect(&rect); + int x = (rect.Width() - cxIcon + 1) / 2; + int y = (rect.Height() - cyIcon + 1) / 2; + + // 绘制图标 + dc.DrawIcon(x, y, m_hIcon); + } + else + { + CDialogEx::OnPaint(); + } +} + +//当用户拖动最小化窗口时系统调用此函数取得光标 +//显示。 +HCURSOR CCH91PayloadSoftwareDlg::OnQueryDragIcon() +{ + return static_cast(m_hIcon); +} + + + +void CCH91PayloadSoftwareDlg::OnDestroy() +{ + CDialogEx::OnDestroy(); + + //关闭机载相机指令发送 + if (g_MUDPCamera.IsSerializable()) + { + g_MUDPCamera.SetReadCallBack(NULL,NULL); + g_MUDPCamera.LeaveGroup(); + g_IsSending = FALSE; + } + + // 关闭ProcessData线程 + g_bProcessDataFlag = false; + g_bProcessDataSocketFlag = false; + + // 关闭存储文件 + if (g_pFileSaveCH96txData != NULL) + { + fclose(g_pFileSaveCH96txData); + g_pFileSaveCH96txData = NULL; + // 如果存储文件大小为0,则删除该文件 + CFileStatus m_Status; // 文件结构体 + if (CFile::GetStatus(g_DataSavePath, m_Status)) + { + if (m_Status.m_size == 0) + { + DeleteFile(g_DataSavePath); + } + } + } + // 关闭存储文件 + if (g_pFileSaveVideoDataCH96 != NULL) + { + fclose(g_pFileSaveVideoDataCH96); + g_pFileSaveVideoDataCH96 = NULL; + } + + // 关闭存储文件 + if (g_pFileSaveVideoH264Data != NULL) + { + fclose(g_pFileSaveVideoH264Data); + g_pFileSaveVideoH264Data = NULL; + } + + // 释放图像显示窗口资源 + if (m_wndShowEO != nullptr) + { + m_wndShowEO->DestroyWnd(); + m_wndShowEO = NULL; + } + + if (m_ShowReplayDlg != NULL) + { + delete m_ShowReplayDlg; + m_ShowReplayDlg = nullptr; + } + if (m_ShowFJDataDlg != NULL) + { + delete m_ShowFJDataDlg; + m_ShowFJDataDlg = nullptr; + } + + if (m_ShowDlgRecvDataFromQB != NULL) + { + delete m_ShowDlgRecvDataFromQB; + m_ShowDlgRecvDataFromQB = nullptr; + } + // 卸载解码器 + if (g_CH96_h264decoder != nullptr) + { + DecoderFactory::DestroyDecoder(g_CH96_h264decoder); + } + // 卸载视频键盘 + m_JoyKeybord.OnDestoryJoyKeybord(); + + //吊舱控制页面 + if(p_DlgCameraCtrl) + { + delete p_DlgCameraCtrl; + p_DlgCameraCtrl = NULL; + } + //13所吊舱新控制放页面 + if(p_Dlg13InstituteDCNewCtrl) + { + delete p_Dlg13InstituteDCNewCtrl; + p_Dlg13InstituteDCNewCtrl = NULL; + } + // 卸载IMP对话框 + if(g_DlgIMP !=NULL) + { + delete g_DlgIMP; + g_DlgIMP = nullptr; + IMPDlgWindowVisible = false; + } +} + +// 显示可见光图像复接信息 +LRESULT CCH91PayloadSoftwareDlg::ShowMsgOnDlgEO(WPARAM wParam, LPARAM lParam) +{ + //ShowImgFJData(); + return 0; +} +// 显示红外图像复接信息 +LRESULT CCH91PayloadSoftwareDlg::ShowMsgOnDlgIR(WPARAM wParam, LPARAM lParam) +{ + // 显示图像复接信息 + //ShowImgFJData(); + return 0; +} + +// 显示数码照片复接数据 +LRESULT CCH91PayloadSoftwareDlg::ShowMsgOnDlgDC(WPARAM wParam, LPARAM lParam) +{ + // 显示图像复接信息 + //ShowImgFJData(); + return 0; +} + + + +// 显示复接数据&主界面显示重要数据 +void CCH91PayloadSoftwareDlg::ShowImgFJData() +{ + if (m_ShowFJDataDlg != nullptr) + { + //复接数据窗口显示CH96数据 + m_ShowFJDataDlg->ShowCH96FJData(g_CH96TransFJData); + // 将复接数据送入队列,并用于目标定位 + if (g_CH96QBData.bValid == true) // 只要复接数据有效 就入队 不管定不定位 + { + // 复接数据入栈 + PushToFrameDataDeque(g_CH96QBData); + } + // 解析开关指令并显示在主界面上 + //GetDlgItem(IDC_EDIT_BACKSWITCHINSTRUCTION)->SetWindowText(TranlateBackSwitchInstructions(g_CH96TransFJData.SwitchCmd)); + //解析载荷工作状态并显示在主界面上 + //ZHWorkState(g_CH96TransFJData.Status1 & 0x40, g_CH96TransFJData.Status2, g_CH96TransFJData.LaserState & 0x01); + } +} + + + +//显示复接数据面板 +void CCH91PayloadSoftwareDlg::OnBnClickedBtnShowFj() +{ + if (m_ShowFJDataDlg != NULL) + { + if (TRUE == m_ShowFJDataDlg->IsWindowVisible()) + { + m_ShowFJDataDlg->ShowWindow(SW_HIDE); + } + else + { + m_ShowFJDataDlg->ShowWindow(SW_SHOW); + } + } +} + + +//显示载荷回放数据对话框 +void CCH91PayloadSoftwareDlg::OnBnClickedBtnReplay() +{ + if(m_ShowReplayDlg != NULL) + { + if (TRUE == m_ShowReplayDlg->IsWindowVisible()) + { + m_ShowReplayDlg->ShowWindow(SW_HIDE); + } + else + { + m_ShowReplayDlg->ShowWindow(SW_SHOW); + } + } +} + +// 显示发送指令内容 +LRESULT CCH91PayloadSoftwareDlg::ShowCtrlInstruction(WPARAM wParam, LPARAM lParam) +{ + //GetDlgItem(IDC_EDIT_CTRLINSTRUCTIONS)->SetWindowText(g_sCtrlInstruction); + return 0; +} + +//解析开关指令 +CString CCH91PayloadSoftwareDlg::TranlateBackSwitchInstructions(UINT8 switchInstruction) +{ + static CString sInstruction; + //***********************************通用指令回报解析****************************// + if (0x00 == switchInstruction) // 速度配置 + { + //sInstruction = "速度配置"; + } + else if (0x15 == switchInstruction) // 锁定模式 + { + sInstruction = "锁定模式"; + } + else if (0x17 == switchInstruction) // 扫描模式 + { + sInstruction = "扫描模式"; + } + else if (0x19 == switchInstruction) // 数字引导模式 + { + sInstruction = "数字引导"; + } + else if (0x1B == switchInstruction) // 平台复位 + { + sInstruction = "平台复位"; + } + else if (0x1D == switchInstruction) // 补漂方位- + { + sInstruction = "补漂方位-"; + } + else if (0x1F == switchInstruction) // 补漂方位+ + { + sInstruction = "补漂方位+"; + } + else if (0x21 == switchInstruction) // 补漂俯仰- + { + sInstruction = "补漂俯仰-"; + } + else if (0x23 == switchInstruction) // 补漂俯仰+ + { + sInstruction = "补漂俯仰+"; + } + else if (0x25 == switchInstruction) // 手动模式 + { + sInstruction = "手动模式"; + } + else if (0x27 == switchInstruction) // 跟踪模式 + { + sInstruction = "跟踪模式"; + } + else if (0x81 == switchInstruction) // 红外白热 + { + sInstruction = "红外白热"; + } + else if (0x82 == switchInstruction) // 红外黑热 + { + sInstruction = "红外黑热"; + } + else if (0x85 == switchInstruction) // 焦距+ + { + sInstruction = "焦距+"; + } + else if (0x86 == switchInstruction) // 焦距- + { + sInstruction = "焦距-"; + } + else if (0x87 == switchInstruction) // 红外小视场 + { + sInstruction = "红外小视场"; + } + else if (0x89 == switchInstruction) // 红外大视场 + { + sInstruction = "红外大视场"; + } + else if (0xA1 == switchInstruction) // OSD on/off + { + sInstruction = "OSD ON/OFF"; + } + else if (0xA3 == switchInstruction) // 图像切换 + { + sInstruction = "图像切换"; + } + else if (0xB5 == switchInstruction) // 画中画开 + { + sInstruction = "画中画开"; + } + else if (0xB6 == switchInstruction) // 画中画关 + { + sInstruction = "画中画关"; + } + else if (0xB7 == switchInstruction) // 图像稳定关 + { + sInstruction = "图像稳定关"; + } + else if (0xB8 == switchInstruction) // 图像稳定开 + { + sInstruction = "图像稳定开"; + } + else if (0xBB == switchInstruction) // 可见光透雾1 + { + sInstruction = "可见光透雾1"; + } + else if (0xBC == switchInstruction) // 可见光透雾2 + { + sInstruction = "可见光透雾2"; + } + else if (0xBD == switchInstruction) // 可见光透雾3 + { + sInstruction = "可见光透雾3"; + } + else if (0xBE == switchInstruction) // 可见光透雾关 + { + sInstruction = "可见光透雾关"; + } + else if (0xC1 == switchInstruction) // 开始连续照相 + { + sInstruction = "连续照相"; + } + else if (0xC3 == switchInstruction) // 停止照相 + { + sInstruction = "停止照相"; + } + else if (0xC6 == switchInstruction) // 拍一张照 + { + sInstruction = "拍一张照"; + } + else if (0x91 == switchInstruction) // 激光测距开 + { + sInstruction = "激光测距开"; + } + else if (0x92 == switchInstruction) // 激光测距关 + { + sInstruction = "激光测距关"; + } + else if (0x93 == switchInstruction) // 激光电源开 + { + sInstruction = "激光电源开"; + } + else if (0x94 == switchInstruction) // 激光电源关 + { + sInstruction = "激光电源关"; + } + + return sInstruction; +} + +//解析载荷工作状态 +void CCH91PayloadSoftwareDlg::ZHWorkState(UINT8 CurrentImgType, UINT8 SystemState, UINT8 LaserState) +{ + CString workState_Show; + CString SystemState_Show; //激光测距仪器 + CString LaserState_Show; //激光状态 + CString LaserDistance_Show;//激光距离 + //当前图像状态 + if(1 == CurrentImgType) + { + str_CurrentImgType = "IR图像"; + } + else + { + str_CurrentImgType = "EO图像"; + } + + + //伺服状态 + if (0x00 == SystemState) + { + SystemState_Show = "手动状态"; + } + else if (0x01 == SystemState) + { + SystemState_Show = "跟踪状态"; + } + else if (0x02 == SystemState) + { + SystemState_Show = "锁定状态"; + } + else if (0x03 == SystemState) + { + SystemState_Show = "数引状态"; + } + else if (0x04 == SystemState) + { + SystemState_Show = "扫描状态"; + } + else if (0x05 == SystemState) + { + SystemState_Show = "保护状态"; + } + else if (0x07 == SystemState) + { + SystemState_Show = "初始化"; + } + else if (0x08 == SystemState) + { + SystemState_Show = "跟随状态"; + } + else + { + SystemState_Show = "N/A异常"; + } + //升降机构 + if (1 == LaserState) + { + LaserState_Show = "测距关"; + } + else + { + LaserState_Show = "测距开"; + } + LaserDistance_Show.Format("%d",g_CH96TransFJData.LaserDis); + + //GetDlgItem(IDC_EDIT_CURRENTIMGTYPE)->SetWindowText(str_CurrentImgType); + //GetDlgItem(IDC_EDIT_WORKSTATE)->SetWindowText(SystemState_Show); + //GetDlgItem(IDC_EDIT_LaserState)->SetWindowText(LaserState_Show + "—" + LaserDistance_Show); +} + +// 调用图片显示对话框 +void CCH91PayloadSoftwareDlg::OnBnClickedBtnLookupResult() +{ + // 结果预览 + char exeFullPath[MAX_PATH]; + GetModuleFileName(NULL, exeFullPath, MAX_PATH); + + CString Directy; + Directy.Format("%s", exeFullPath); + + int index = Directy.ReverseFind('\\'); + Directy.Delete(index, Directy.GetLength() - index); + Directy = Directy + "\\Result"; + ShellExecute(NULL, NULL, Directy, NULL, NULL, SW_SHOW); +} + +void CCH91PayloadSoftwareDlg::ShowEOImg(cv::Mat img) +{ + // 如果是实时模式,则显示可见光图像 + if (img.empty() == false && img.cols == 1920 && img.rows == 1080 && img.type() == CV_8UC3 ) + { + BITMAPINFO info; + info.bmiHeader.biBitCount = 24; + info.bmiHeader.biHeight = 1080; + info.bmiHeader.biWidth = 1920; + cv::flip(img, img, 0); + m_wndShowEO->ShowImage(&info, img.data); + } +} + +BOOL CCH91PayloadSoftwareDlg::PreTranslateMessage(MSG* pMsg) +{ + // 键盘消息 + if (pMsg->message == WM_KEYDOWN) + { + // 忽略ESC和回车键 + if (pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_RETURN) + { + return TRUE; + } + // F1键控制“视频控制”窗口的显示/隐藏 + // TODO: 在此添加控件通知处理程序代码 + if(pMsg->wParam == VK_F1) + { + if (TRUE == m_ShowReplayDlg->IsWindowVisible()) + { + m_ShowReplayDlg->ShowWindow(SW_HIDE); + } + else + { + m_ShowReplayDlg->ShowWindow(SW_SHOW); + } + } + // F2键控制“状态查看”窗口的现显示/隐藏 + if(pMsg->wParam == VK_F2) + { + if (TRUE == m_ShowFJDataDlg->IsWindowVisible()) + { + m_ShowFJDataDlg->ShowWindow(SW_HIDE); + } + else + { + m_ShowFJDataDlg->ShowWindow(SW_SHOW); + } + } + // F3键控制“组播收数”串口显隐 + if(pMsg->wParam == VK_F3) + { + if (TRUE == m_MulticastSocketReceiveDlg->IsWindowVisible()) + { + m_MulticastSocketReceiveDlg->ShowWindow(SW_HIDE); + } + else + { + m_MulticastSocketReceiveDlg->ShowWindow(SW_SHOW); + } + } + // F5控制“视频录制”功能 + if (pMsg -> wParam == VK_F5) + { + OnBnClickedBtnCaptureVideo(); + } + // F6控制“结果预览”功能 + if (pMsg -> wParam == VK_F6) + { + OnBnClickedBtnLookupResult(); + } + // Ctrl + 1控制“图像显示全屏切换”功能 + if (pMsg -> wParam == '1') + { + VideoShowFullScreenONOFF(); + +// if (::GetKeyState(VK_CONTROL) < 0) +// { +// VideoShowFullScreenONOFF(); +// } + } + } + // 鼠标消息 + + return CDialogEx::PreTranslateMessage(pMsg); +} + +void CCH91PayloadSoftwareDlg::OnTimer(UINT_PTR nIDEvent) +{ + // 定时器1显示视频 + if (nIDEvent == 1) + { + // 如果不为配置较低电脑,则进行软解码并显示队列中图像 + if (g_bGoodComputer != FALSE) + { + // 显示可见光 + WaitForSingleObject(g_hMutex_DisplayVideoCH96, INFINITE); //取可见光图像互斥句柄 + if (g_CH96VideoDeque.empty() == false) + { + cv::Mat localEO; + localEO = g_CH96VideoDeque.front(); + std::deque::iterator iter; + iter = g_CH96VideoDeque.begin(); + iter->data = nullptr; + g_CH96VideoDeque.pop_front(); + ReleaseMutex(g_hMutex_DisplayVideoCH96); + + ShowEOImg(localEO); + + if (g_bCaptureImg == true || g_bRun == TRUE) + { + g_QB.image.bValid = true; + g_QB.image.srcImg.bitcount = 24; + g_QB.image.srcImg.ImgWidth = localEO.cols; + g_QB.image.srcImg.ImgHeight = localEO.rows; + + g_QB.framePart = g_CH96QBData; + + if (localEO.type() == CV_8UC1) + { + g_QB.image.srcImg.bitcount = 8; + } + + if (g_QB.image.srcImg.buff != nullptr) + { + delete [] g_QB.image.srcImg.buff; + g_QB.image.srcImg.buff = nullptr; + } + int bufferSize = g_QB.image.srcImg.ImgWidth * g_QB.image.srcImg.ImgHeight * g_QB.image.srcImg.bitcount / 8; + g_QB.image.srcImg.buff = new unsigned char[bufferSize]; + memcpy(g_QB.image.srcImg.buff, localEO.data, bufferSize); + } + + if (g_bCaptureImg == true) + { + g_bCaptureImg = false; + ::SendMessageA(g_mapMatchDlg, WM_CAPTURE_IMG_WHEN_MAPMATCH, WPARAM(0), LPARAM(0)); + } + + + if (g_bRun == TRUE) + { + cv::Mat img; + cv::flip(localEO, img, 0); + int bufferSize = g_QB.image.srcImg.ImgWidth * g_QB.image.srcImg.ImgHeight * g_QB.image.srcImg.bitcount / 8; + memcpy(g_QB.image.srcImg.buff, img.data, bufferSize); + + // 线程互斥 + WaitForSingleObject(g_hMutex_ImgStitch, INFINITE); + QBStru local; + CloneQBData(&g_QB, &local); + if(g_StitchImgDeque.size() >= 2) + { + std::deque::iterator iter; + iter = g_StitchImgDeque.begin(); + + // 释放指针指向的内存 + SAFE_DELETE_ARRAY(iter->image.srcImg.buff); + SAFE_DELETE_ARRAY(iter->image.dstImg.buff); + SAFE_DELETE_ARRAY(iter->image.geoImg.buff); + + g_StitchImgDeque.pop_front(); + } + + g_StitchImgDeque.push_back(local); + local.image.srcImg.buff = nullptr; + local.image.dstImg.buff = nullptr; + local.image.geoImg.buff = nullptr; + + ReleaseMutex(g_hMutex_ImgStitch); + } + } + else + { + ReleaseMutex(g_hMutex_DisplayVideoCH96); + } + } + } + CDialogEx::OnTimer(nIDEvent); +} + +// 图像显示全屏切换 +void CCH91PayloadSoftwareDlg::VideoShowFullScreenONOFF() +{ + if (m_bVideoShowFullScreen == FALSE) + { + m_bVideoShowFullScreen = TRUE; + // 隐藏其它控件 + HWND hwndChild = ::GetWindow(g_mainDlgHwnd, GW_CHILD); + while (hwndChild) + { + CWnd::FromHandle(hwndChild)->ShowWindow(FALSE); + hwndChild = ::GetWindow(hwndChild, GW_HWNDNEXT); + } + // 改变显示区域 + // 高性能配置,软解码情况 + if (g_bGoodComputer != FALSE) + { + // 全屏显示 + CRect rect; + GetDlgItem(IDC_STATIC_VIDEO_REGIONALL)->GetWindowRect(&rect); + ScreenToClient(&rect); + m_wndShowEO->MoveWnd(rect); + m_wndShowEO->ShowWnd(SW_SHOW); + } + // 低性能配置,硬解码情况 + else + { + // 全屏显示 + GetDlgItem(IDC_STATIC_VIDEO_REGIONALL)->SetWindowPos(NULL ,0, 0, rect_BigRegion.Width(), rect_BigRegion.Height(), SWP_NOZORDER); + // 显示控件 + GetDlgItem(IDC_STATIC_VIDEO_REGIONALL)->ShowWindow(TRUE); + } + } + else + { + m_bVideoShowFullScreen = FALSE; + // 显示其它控件 + HWND hwndChild = ::GetWindow(g_mainDlgHwnd, GW_CHILD); + while (hwndChild) + { + CWnd::FromHandle(hwndChild)->ShowWindow(TRUE); + hwndChild = ::GetWindow(hwndChild, GW_HWNDNEXT); + } + // 改变显示区域 + // 高性能配置,软解码情况 + if (g_bGoodComputer != FALSE) + { + // 局部显示 + CRect rect; + GetDlgItem(IDC_STATIC_EO_REGION)->GetWindowRect(&rect); + ScreenToClient(&rect); + m_wndShowEO->MoveWnd(rect); + m_wndShowEO->ShowWnd(SW_SHOW); + } + // 低性能配置,硬解码情况 + else + { + // 局部显示 + GetDlgItem(IDC_STATIC_VIDEO_REGIONALL)->SetWindowPos(NULL ,0, 0, rect_SmallRegion.Width(), rect_SmallRegion.Height(), SWP_NOZORDER); + } + } +} + +// 设置对话框风格 +void CCH91PayloadSoftwareDlg::DlgStyleChange() +{ + // 视频控制 + m_Btn_Replay.SubclassDlgItem(IDC_BTN_REPLAY, this); + m_Btn_Replay.SetIcon(IDI_ICON_MAIN_REPLAY); + m_Btn_Replay.SetTooltipText("Video Control"); + m_Btn_Replay.SetAlign(CButtonST::ST_ALIGN_VERT);// 文字在下 + m_Btn_Replay.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151));// 鼠标指向按钮时候的文字颜色 + m_Btn_Replay.DrawTransparent(TRUE); + + + //会报错,原因不明 + // 状态查看 + //m_Btn_FJ.SubclassDlgItem(IDC_BTN_SHOW_FJ, this); + //m_Btn_FJ.SetIcon(IDI_ICON_MAIN_FJ); + //m_Btn_FJ.SetTooltipText("Status Inquiry"); + //m_Btn_FJ.SetAlign(CButtonST::ST_ALIGN_VERT);// 文字在下 + //m_Btn_FJ.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //m_Btn_FJ.DrawTransparent(TRUE); + + // 组播收数 + m_Btn_SocketReceive.SubclassDlgItem(IDC_BTN_MULTICASTSOCKETRECEIVE, this); + m_Btn_SocketReceive.SetIcon(IDI_ICON_MAIN_SOCKETSEND); + m_Btn_SocketReceive.SetTooltipText("Data Receive"); + m_Btn_SocketReceive.SetAlign(CButtonST::ST_ALIGN_VERT);// 文字在下 + m_Btn_SocketReceive.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + m_Btn_SocketReceive.DrawTransparent(TRUE); + + // 开始录像 + m_Btn_CaptureVideo.SubclassDlgItem(IDC_BTN_CAPTURE_VIDEO, this); + m_Btn_CaptureVideo.SetIcon(IDI_ICON_MAIN_CAPTUREVIDEO); + m_Btn_CaptureVideo.SetTooltipText("Recording Start"); + m_Btn_CaptureVideo.SetAlign(CButtonST::ST_ALIGN_VERT);// 文字在下 + m_Btn_CaptureVideo.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + m_Btn_CaptureVideo.DrawTransparent(TRUE); + + // 结果预览 + m_Btn_Result.SubclassDlgItem(IDC_BTN_LOOKUP_RESULT, this); + m_Btn_Result.SetIcon(IDI_ICON_MAIN_RESULT); + m_Btn_Result.SetTooltipText("Instant Preview"); + m_Btn_Result.SetAlign(CButtonST::ST_ALIGN_VERT);// 文字在下 + m_Btn_Result.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + m_Btn_Result.DrawTransparent(TRUE); + + //// 情报处理 + //m_Btn_QBFunctions.SubclassDlgItem(IDC_BTN_SET_PARAMS, this); + //m_Btn_QBFunctions.SetIcon(IDI_ICON_MAIN_QBFUNCTIONS); + //m_Btn_QBFunctions.SetTooltipText("情报处理"); + //m_Btn_QBFunctions.SetAlign(CButtonST::ST_ALIGN_VERT);// 文字在下 + //m_Btn_QBFunctions.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //m_Btn_QBFunctions.DrawTransparent(TRUE); + +} + +// 通过滚轮控制视场大小 +BOOL CCH91PayloadSoftwareDlg::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) +{ + ScreenToClient(&pt); + // 鼠标滚轮控制视场大小 + CRect rect1; + GetDlgItem(IDC_STATIC_EO_REGION)->GetWindowRect(&rect1); + ScreenToClient(&rect1); + CRect rect2; + GetDlgItem(IDC_STATIC_VIDEO_REGIONALL)->GetWindowRect(&rect2); + ScreenToClient(&rect2); + // 需要判断一下图像类型 + if (str_CurrentImgType == "EO图像") // EO图像 + { + g_CtrlFocusThroughMouseWheel = true; + if (m_bVideoShowFullScreen == FALSE) + { + if (pt.x > rect1.left && pt.x < rect1.right && pt.y > rect1.top && pt.y < rect1.bottom) + { + if (zDelta < 0) // 视场大 + { + g_payloadCtrlProtocol = 15; + g_sCtrlInstruction = "EO视场大"; + } + else // 视场小 + { + g_payloadCtrlProtocol = 14; + g_sCtrlInstruction = "EO视场小"; + } + } + } + else + { + if (pt.x > rect2.left && pt.x < rect2.right && pt.y > rect2.top && pt.y < rect2.bottom) + { + if (zDelta < 0) // 视场大 + { + g_payloadCtrlProtocol = 15; + g_sCtrlInstruction = "EO视场大"; + } + else // 视场小 + { + g_payloadCtrlProtocol = 14; + g_sCtrlInstruction = "EO视场小"; + } + } + } + } + else if (str_CurrentImgType == "IR图像") // IR图像 + { + g_CtrlFocusThroughMouseWheel = true; + if (m_bVideoShowFullScreen == FALSE) + { + if (pt.x > rect1.left && pt.x < rect1.right && pt.y > rect1.top && pt.y < rect1.bottom) + { + if (zDelta < 0) // 视场大 + { + g_payloadCtrlProtocol = 15; + g_sCtrlInstruction = "IR视场大"; + } + else // 视场小 + { + g_payloadCtrlProtocol = 14; + g_sCtrlInstruction = "IR视场小"; + } + } + } + else + { + if (pt.x > rect2.left && pt.x < rect2.right && pt.y > rect2.top && pt.y < rect2.bottom) + { + if (zDelta < 0) // 视场大 + { + g_payloadCtrlProtocol = 17; + g_sCtrlInstruction = "IR视场大"; + } + else // 视场小 + { + g_payloadCtrlProtocol = 16; + g_sCtrlInstruction = "IR视场小"; + } + } + } + } + else + { + // 无响应 + } + return CDialogEx::OnMouseWheel(nFlags, zDelta, pt); +} + +// 设置软件应用语言 +void CCH91PayloadSoftwareDlg::DlgLanguageSet() +{ + // 通过配置文件导入语言类型 + CString str_fileLanguageName = "config_Chinese.ini"; + CString fileLanguageSet = GetSoftwareCurrentDirectory()+ "\\ini\\" + str_fileLanguageName; + + // 通过配置文件导入[TITLE]语言文字 + // 视频控制页面标题 + GetPrivateProfileString("TITLE", "TITLE_REPLAY", "0", g_char_TitleReplay, 30, fileLanguageSet); + g_str_TitleReplay = g_char_TitleReplay; + + // 通过配置文件导入[WARNING]语言文字 + // 信息提示 + GetPrivateProfileString("WARNING", "WARNING_TITLE", "0", g_char_WarningTitle, 100, fileLanguageSet); + g_str_WarningTitle = g_char_WarningTitle; + // 磁盘空间提示 + GetPrivateProfileString("WARNING", "WARNING_STORAGE", "0", g_char_WarningStorage, 100, fileLanguageSet); + g_str_WarningStorage = g_char_WarningStorage; + // UDP收数提示(测控、情报) + GetPrivateProfileString("WARNING", "WARNING_UDPRECEIVE", "0", g_char_WarningUDPReceive, 100, fileLanguageSet); + g_str_WarningUDPReceive = g_char_WarningUDPReceive; + // 串口收数提示 + GetPrivateProfileString("WARNING", "WARNING_SERIALRECEIVE", "0", g_char_WarningSerialReceive, 100, fileLanguageSet); + g_str_WarningSerialReceive = g_char_WarningSerialReceive; + // 载荷控制连接提示 + GetPrivateProfileString("WARNING", "WARNING_PAYLOADCONTROL", "0", g_char_WarningPayloadControl, 100, fileLanguageSet); + g_str_WarningPayloadControl = g_char_WarningPayloadControl; + // 激光编码密码登陆提示 + GetPrivateProfileString("WARNING", "WARNING_LRFCODE", "0", g_char_WarningLRFCode, 100, fileLanguageSet); + g_str_WarningLRFCode = g_char_WarningLRFCode; + // 激光编码周期范围提示 + GetPrivateProfileString("WARNING", "WARNING_LRFNUMBER", "0", g_char_WarningLRFNumber, 100, fileLanguageSet); + g_str_WarningLRFNumber = g_char_WarningLRFNumber; + // 输入数字提示(数引) + GetPrivateProfileString("WARNING", "WARNING_INPUTNUMBER", "0", g_char_WarningInputNumber, 100, fileLanguageSet); + g_str_WarningInputNumber = g_char_WarningInputNumber; + // 地图高程设定提示 + GetPrivateProfileString("WARNING", "WARNING_MAPALTSET", "0", g_char_WarningMapAltSet, 100, fileLanguageSet); + g_str_WarningMapAltSet = g_char_WarningMapAltSet; + + + // 通过配置文件导入[STATIC]语言文字 + // 发送指令 + GetPrivateProfileString("STATIC", "STATIC_COMMANDSEND", "0", g_char_CommandSend, 30, fileLanguageSet); + g_str_CommandSend = g_char_CommandSend; + // 回报指令 + GetPrivateProfileString("STATIC", "STATIC_COMMANDRESPONSE", "0", g_char_CommandResponse, 30, fileLanguageSet); + g_str_CommandResponse = g_char_CommandResponse; + // 载荷状态 + GetPrivateProfileString("STATIC", "STATIC_STATE", "0", g_char_State, 30, fileLanguageSet); + g_str_State = g_char_State; + // 文件路径 + GetPrivateProfileString("STATIC", "STATIC_FILEPATH", "0", g_char_FilePath, 30, fileLanguageSet); + g_str_FilePath = g_char_FilePath; + // 可见光相机指令 + GetPrivateProfileString("STATIC", "STATIC_EOCOMMAND", "0", g_char_EOCommand, 30, fileLanguageSet); + g_str_EOCommand = g_char_EOCommand; + // 红外相机指令 + GetPrivateProfileString("STATIC", "STATIC_IRCOMMAND", "0", g_char_IRCommand, 30, fileLanguageSet); + g_str_IRCommand = g_char_IRCommand; + // 陀螺修正 + GetPrivateProfileString("STATIC", "STATIC_DRIFT", "0", g_char_Drift, 30, fileLanguageSet); + g_str_Drift = g_char_Drift; + // 波门位移 + GetPrivateProfileString("STATIC", "STATIC_AVTGATE", "0", g_char_AVTGate, 30, fileLanguageSet); + g_str_AVTGate = g_char_AVTGate; + // 密码登陆 + GetPrivateProfileString("STATIC", "STATIC_LOGIN", "0", g_char_LogIn, 30, fileLanguageSet); + g_str_LogIn = g_char_LogIn; + // 编码序号: + GetPrivateProfileString("STATIC", "STATIC_LASERNUM", "0", g_char_LaserNum, 30, fileLanguageSet); + g_str_LaserNum = g_char_LaserNum; + // 编码周期: + GetPrivateProfileString("STATIC", "STATIC_LASERPERIOD", "0", g_char_LaserPeriod, 30, fileLanguageSet); + g_str_LaserPeriod = g_char_LaserPeriod; + + + // 通过配置文件导入[COMMAND]语言文字 + // 目标经度装订 + GetPrivateProfileString("COMMAND", "COMMAND_TARGETLONSET", "0", g_char_TargetLonSet, 30, fileLanguageSet); + g_str_TargetLonSet = g_char_TargetLonSet; + // 目标纬度装订 + GetPrivateProfileString("COMMAND", "COMMAND_TARGETLATSET", "0", g_char_TargetLatSet, 30, fileLanguageSet); + g_str_TargetLatSet = g_char_TargetLatSet; + // 目标高度装订 + GetPrivateProfileString("COMMAND", "COMMAND_TARGETALTSET", "0", g_char_TargetAltSet, 30, fileLanguageSet); + g_str_TargetAltSet = g_char_TargetAltSet; + // 地理坐标跟踪 + GetPrivateProfileString("COMMAND", "COMMAND_GEOGRAPHYTRACKING", "0", g_char_GeographyTracking, 30, fileLanguageSet); + g_str_GeographyTracking = g_char_GeographyTracking; + // 手动搜索 + GetPrivateProfileString("COMMAND", "COMMAND_MANUALSLEW", "0", g_char_ManualSlew, 30, fileLanguageSet); + g_str_ManualSlew = g_char_ManualSlew; + // 锁定 + GetPrivateProfileString("COMMAND", "COMMAND_VERTICALVIEW", "0", g_char_VerticalView, 30, fileLanguageSet); + g_str_VerticalView = g_char_VerticalView; + // 扫描 + GetPrivateProfileString("COMMAND", "COMMAND_AUTOSCAN", "0", g_char_AutoScan, 30, fileLanguageSet); + g_str_AutoScan = g_char_AutoScan; + // 数引 + GetPrivateProfileString("COMMAND", "COMMAND_ANGLELOCK", "0", g_char_AngleLock, 30, fileLanguageSet); + g_str_AngleLock = g_char_AngleLock; + // 平台复位 + GetPrivateProfileString("COMMAND", "COMMAND_TURRETRESET", "0", g_char_TurretReset, 30, fileLanguageSet); + g_str_TurretReset = g_char_TurretReset; + // 陀螺右修 + GetPrivateProfileString("COMMAND", "COMMAND_DRIFTRIGHT", "0", g_char_DriftRight, 30, fileLanguageSet); + g_str_DriftRight = g_char_DriftRight; + // 陀螺左修 + GetPrivateProfileString("COMMAND", "COMMAND_DRIFTLEFT", "0", g_char_DriftLeft, 30, fileLanguageSet); + g_str_DriftLeft = g_char_DriftLeft; + // 陀螺上修 + GetPrivateProfileString("COMMAND", "COMMAND_DRIFTUP", "0", g_char_DriftUp, 30, fileLanguageSet); + g_str_DriftUp = g_char_DriftUp; + // 陀螺下修 + GetPrivateProfileString("COMMAND", "COMMAND_DRIFTDOWN", "0", g_char_DriftDown, 30, fileLanguageSet); + g_str_DriftDown = g_char_DriftDown; + // 载荷升 + GetPrivateProfileString("COMMAND", "COMMAND_TURRETSTOW", "0", g_char_TurretStow, 30, fileLanguageSet); + g_str_TurretStow = g_char_TurretStow; + // 载荷降 + GetPrivateProfileString("COMMAND", "COMMAND_TURRETFWD", "0", g_char_TurretFWD, 30, fileLanguageSet); + g_str_TurretFWD = g_char_TurretFWD; + // 可见光自动跟踪 + GetPrivateProfileString("COMMAND", "COMMAND_EOAUTOTRACKING", "0", g_char_EOAutoTracking, 30, fileLanguageSet); + g_str_EOAutoTracking = g_char_EOAutoTracking; + // 红外自动跟踪 + GetPrivateProfileString("COMMAND", "COMMAND_IRAUTOTRACKING", "0", g_char_IRAutoTracking, 30, fileLanguageSet); + g_str_IRAutoTracking = g_char_IRAutoTracking; + // 相关跟踪 + GetPrivateProfileString("COMMAND", "COMMAND_CORRELATIONTRACKING", "0", g_char_CorrelationTracking, 30, fileLanguageSet); + g_str_CorrelationTracking = g_char_CorrelationTracking; + // 重心黑 + GetPrivateProfileString("COMMAND", "COMMAND_CENTROIDBLACKTRACKING", "0", g_char_CentroidBlackTracking, 30, fileLanguageSet); + g_str_CentroidBlackTracking = g_char_CentroidBlackTracking; + // 重心白 + GetPrivateProfileString("COMMAND", "COMMAND_CENTROIDWHITETRACKING", "0", g_char_CentroidWhiteTracking, 30, fileLanguageSet); + g_str_CentroidWhiteTracking = g_char_CentroidWhiteTracking; + // 字符叠加/消隐 + GetPrivateProfileString("COMMAND", "COMMAND_OSDONOFF", "0", g_char_OSDONOFF, 30, fileLanguageSet); + g_str_OSDONOFF = g_char_OSDONOFF; + // 偏心跟踪 + GetPrivateProfileString("COMMAND", "COMMAND_OFFSETTRACKING", "0", g_char_OffsetTracking, 30, fileLanguageSet); + g_str_OffsetTracking = g_char_OffsetTracking; + // 静态目标跟踪 + GetPrivateProfileString("COMMAND", "COMMAND_STATICTARGETTRACKING", "0", g_char_StaticTargetTracking, 30, fileLanguageSet); + g_str_StaticTargetTracking = g_char_StaticTargetTracking; + // 动态目标跟踪 + GetPrivateProfileString("COMMAND", "COMMAND_MOVETARGETTRACKING", "0", g_char_MoveTargetTracking, 30, fileLanguageSet); + g_str_MoveTargetTracking = g_char_MoveTargetTracking; + // 场景跟踪 + GetPrivateProfileString("COMMAND", "COMMAND_VIEWTRACKING", "0", g_char_ViewTracking, 30, fileLanguageSet); + g_str_ViewTracking = g_char_ViewTracking; + // 大波门 + GetPrivateProfileString("COMMAND", "COMMAND_AVTGATESIZEBIG", "0", g_char_AVTGateSizeBig, 30, fileLanguageSet); + g_str_AVTGateSizeBig = g_char_AVTGateSizeBig; + // 小波门 + GetPrivateProfileString("COMMAND", "COMMAND_AVTGATESIZESMALL", "0", g_char_AVTGateSizeSmall, 30, fileLanguageSet); + g_str_AVTGateSizeSmall = g_char_AVTGateSizeSmall; + // 中波门 + GetPrivateProfileString("COMMAND", "COMMAND_AVTGATESIZEMIDDLE", "0", g_char_AVTGateSizeMiddle, 30, fileLanguageSet); + g_str_AVTGateSizeMiddle = g_char_AVTGateSizeMiddle; + // 自适应波门 + GetPrivateProfileString("COMMAND", "COMMAND_AVTGATESIZEAUTO", "0", g_char_AVTGateSizeAuto, 30, fileLanguageSet); + g_str_AVTGateSizeAuto = g_char_AVTGateSizeAuto; + // 图像增强开 + GetPrivateProfileString("COMMAND", "COMMAND_IMGENHANCEON", "0", g_char_ImgEnhanceON, 30, fileLanguageSet); + g_str_ImgEnhanceON = g_char_ImgEnhanceON; + // 图像增强关 + GetPrivateProfileString("COMMAND", "COMMAND_IMGENHANCEOFF", "0", g_char_ImgEnhanceOFF, 30, fileLanguageSet); + g_str_ImgEnhanceOFF = g_char_ImgEnhanceOFF; + // 波门右移 + GetPrivateProfileString("COMMAND", "COMMAND_AVTGATERIGHT", "0", g_char_AVTGateRight, 30, fileLanguageSet); + g_str_AVTGateRight = g_char_AVTGateRight; + // 波门左移 + GetPrivateProfileString("COMMAND", "COMMAND_AVTGATELEFT", "0", g_char_AVTGateLeft, 30, fileLanguageSet); + g_str_AVTGateLeft = g_char_AVTGateLeft; + // 波门上移 + GetPrivateProfileString("COMMAND", "COMMAND_AVTGATEUP", "0", g_char_AVTGateUp, 30, fileLanguageSet); + g_str_AVTGateUp = g_char_AVTGateUp; + // 波门下移 + GetPrivateProfileString("COMMAND", "COMMAND_AVTGATEDOWN", "0", g_char_AVTGateDown, 30, fileLanguageSet); + g_str_AVTGateDown = g_char_AVTGateDown; + + // 激光电源开 + GetPrivateProfileString("COMMAND", "COMMAND_LRFPOWERON", "0", g_char_LRFPowerON, 30, fileLanguageSet); + g_str_LRFPowerON = g_char_LRFPowerON; + // 激光电源关 + GetPrivateProfileString("COMMAND", "COMMAND_LRFPOWEROFF", "0", g_char_LRFPowerOFF, 30, fileLanguageSet); + g_str_LRFPowerOFF = g_char_LRFPowerOFF; + // 激光测距开 + GetPrivateProfileString("COMMAND", "COMMAND_LRFARMED", "0", g_char_LRFArmed, 30, fileLanguageSet); + g_str_LRFArmed = g_char_LRFArmed; + // 激光测距关 + GetPrivateProfileString("COMMAND", "COMMAND_LRFSAFE", "0", g_char_LRFSafe, 30, fileLanguageSet); + g_str_LRFSafe = g_char_LRFSafe; + // 激光照射开 + GetPrivateProfileString("COMMAND", "COMMAND_LDARMED", "0", g_char_LDArmed, 30, fileLanguageSet); + g_str_LDArmed = g_char_LDArmed; + // 激光照射关 + GetPrivateProfileString("COMMAND", "COMMAND_LDSAFE", "0", g_char_LDSafe, 30, fileLanguageSet); + g_str_LDSafe = g_char_LDSafe; + // 激光编码1 + GetPrivateProfileString("COMMAND", "COMMAND_LASERNO1", "0", g_char_LaserNo1, 30, fileLanguageSet); + g_str_LaserNo1 = g_char_LaserNo1; + // 激光编码2 + GetPrivateProfileString("COMMAND", "COMMAND_LASERNO2", "0", g_char_LaserNo2, 30, fileLanguageSet); + g_str_LaserNo2 = g_char_LaserNo2; + // 激光编码3 + GetPrivateProfileString("COMMAND", "COMMAND_LASERNO3", "0", g_char_LaserNo3, 30, fileLanguageSet); + g_str_LaserNo3 = g_char_LaserNo3; + // 激光编码4 + GetPrivateProfileString("COMMAND", "COMMAND_LASERNO4", "0", g_char_LaserNo4, 30, fileLanguageSet); + g_str_LaserNo4 = g_char_LaserNo4; + // 激光编码5 + GetPrivateProfileString("COMMAND", "COMMAND_LASERNO5", "0", g_char_LaserNo5, 30, fileLanguageSet); + g_str_LaserNo5 = g_char_LaserNo5; + // 激光编码6 + GetPrivateProfileString("COMMAND", "COMMAND_LASERNO6", "0", g_char_LaserNo6, 30, fileLanguageSet); + g_str_LaserNo6 = g_char_LaserNo6; + // 激光编码7 + GetPrivateProfileString("COMMAND", "COMMAND_LASERNO7", "0", g_char_LaserNo7, 30, fileLanguageSet); + g_str_LaserNo7 = g_char_LaserNo7; + // 激光编码8 + GetPrivateProfileString("COMMAND", "COMMAND_LASERNO8", "0", g_char_LaserNo8, 30, fileLanguageSet); + g_str_LaserNo8 = g_char_LaserNo8; + // 激光编码9 + GetPrivateProfileString("COMMAND", "COMMAND_LASERNO9", "0", g_char_LaserNo9, 30, fileLanguageSet); + g_str_LaserNo9 = g_char_LaserNo9; + // 激光编码10 + GetPrivateProfileString("COMMAND", "COMMAND_LASERNO10", "0", g_char_LaserNo10, 30, fileLanguageSet); + g_str_LaserNo10 = g_char_LaserNo10; + // 激光编码加载 + GetPrivateProfileString("COMMAND", "COMMAND_LASERLOAD", "0", g_char_LaserLoad, 30, fileLanguageSet); + g_str_LaserLoad = g_char_LaserLoad; + + // 低照度增强开 + GetPrivateProfileString("COMMAND", "COMMAND_ICRON", "0", g_char_ICRON, 30, fileLanguageSet); + g_str_ICRON = g_char_ICRON; + // 低照度增强关 + GetPrivateProfileString("COMMAND", "COMMAND_ICROFF", "0", g_char_ICROFF, 30, fileLanguageSet); + g_str_ICROFF = g_char_ICROFF; + // 透雾开 + GetPrivateProfileString("COMMAND", "COMMAND_DEFOGON", "0", g_char_DefogON, 30, fileLanguageSet); + g_str_DefogON = g_char_DefogON; + // 透雾关 + GetPrivateProfileString("COMMAND", "COMMAND_DEFOGOFF", "0", g_char_DefogOFF, 30, fileLanguageSet); + g_str_DefogOFF = g_char_DefogOFF; + // EO调焦+ + GetPrivateProfileString("COMMAND", "COMMAND_EOFOCUSPLUS", "0", g_char_EOFocusPlus, 30, fileLanguageSet); + g_str_EOFocusPlus = g_char_EOFocusPlus; + // EO调焦- + GetPrivateProfileString("COMMAND", "COMMAND_EOFOCUSMINUS", "0", g_char_EOFocusMinus, 30, fileLanguageSet); + g_str_EOFocusMinus = g_char_EOFocusMinus; + // EO视场大 + GetPrivateProfileString("COMMAND", "COMMAND_EOZOOMOUT", "0", g_char_EOZoomOut, 30, fileLanguageSet); + g_str_EOZoomOut = g_char_EOZoomOut; + // EO视场小 + GetPrivateProfileString("COMMAND", "COMMAND_EOZOOMIN", "0", g_char_EOZoomIn, 30, fileLanguageSet); + g_str_EOZoomIn = g_char_EOZoomIn; + // EO手动调光 + GetPrivateProfileString("COMMAND", "COMMAND_EOLIGHTMANUAL", "0", g_char_EOLightManual, 30, fileLanguageSet); + g_str_EOLightManual = g_char_EOLightManual; + // EO自动调光 + GetPrivateProfileString("COMMAND", "COMMAND_EOLIGHTAUTO", "0", g_char_EOLightAuto, 30, fileLanguageSet); + g_str_EOLightAuto = g_char_EOLightAuto; + // EO亮度+ + GetPrivateProfileString("COMMAND", "COMMAND_EOLIGHTPLUS", "0", g_char_EOLightPlus, 30, fileLanguageSet); + g_str_EOLightPlus = g_char_EOLightPlus; + // EO亮度- + GetPrivateProfileString("COMMAND", "COMMAND_EOLIGHTMINUS", "0", g_char_EOLightMinus, 30, fileLanguageSet); + g_str_EOLightMinus = g_char_EOLightMinus; + // EO电源开 + GetPrivateProfileString("COMMAND", "COMMAND_EOPOWERON", "0", g_char_EOPowerON, 30, fileLanguageSet); + g_str_EOPowerON = g_char_EOPowerON; + // EO电源关 + GetPrivateProfileString("COMMAND", "COMMAND_EOPOWEROFF", "0", g_char_EOPowerOFF, 30, fileLanguageSet); + g_str_EOPowerOFF = g_char_EOPowerOFF; + // EO宽动态开 + GetPrivateProfileString("COMMAND", "COMMAND_EOWDRON", "0", g_char_EOWDRON, 30, fileLanguageSet); + g_str_EOWDRON = g_char_EOWDRON; + // EO宽动态关 + GetPrivateProfileString("COMMAND", "COMMAND_EOWDROFF", "0", g_char_EOWDROFF, 30, fileLanguageSet); + g_str_EOWDROFF = g_char_EOWDROFF; + // EO自动调焦 + GetPrivateProfileString("COMMAND", "COMMAND_EOFOCUSAUTO", "0", g_char_EOFocusAuto, 30, fileLanguageSet); + g_str_EOFocusAuto = g_char_EOFocusAuto; + // EO实时调焦 + GetPrivateProfileString("COMMAND", "COMMAND_EOFOCUSREALTIME", "0", g_char_EOFocusRealTime, 30, fileLanguageSet); + g_str_EOFocusRealTime = g_char_EOFocusRealTime; + + // IR调焦+ + GetPrivateProfileString("COMMAND", "COMMAND_IRFOCUSPLUS", "0", g_char_IRFocusPlus, 30, fileLanguageSet); + g_str_IRFocusPlus = g_char_IRFocusPlus; + // IR调焦- + GetPrivateProfileString("COMMAND", "COMMAND_IRFOCUSMINUS", "0", g_char_IRFocusMinus, 30, fileLanguageSet); + g_str_IRFocusMinus = g_char_IRFocusMinus; + // IR自动调焦 + GetPrivateProfileString("COMMAND", "COMMAND_IRFOCUSAUTO", "0", g_char_IRFocusAuto, 30, fileLanguageSet); + g_str_IRFocusAuto = g_char_IRFocusAuto; + // IR实时调焦 + GetPrivateProfileString("COMMAND", "COMMAND_IRFOCUSREALTIME", "0", g_char_IRFocusRealTime, 30, fileLanguageSet); + g_str_IRFocusRealTime = g_char_IRFocusRealTime; + // IR视场大 + GetPrivateProfileString("COMMAND", "COMMAND_IRZOOMOUT", "0", g_char_IRZoomOut, 30, fileLanguageSet); + g_str_IRZoomOut = g_char_IRZoomOut; + // IR视场小 + GetPrivateProfileString("COMMAND", "COMMAND_IRZOOMIN", "0", g_char_IRZoomIn, 30, fileLanguageSet); + g_str_IRZoomIn = g_char_IRZoomIn; + // IR黑白热 + GetPrivateProfileString("COMMAND", "COMMAND_BHWH", "0", g_char_BHWH, 30, fileLanguageSet); + g_str_BHWH = g_char_BHWH; + // IR校正 + GetPrivateProfileString("COMMAND", "COMMAND_IRCALIBRATION", "0", g_char_IRCalibration, 30, fileLanguageSet); + g_str_IRCalibration = g_char_IRCalibration; + // IR手动调光 + GetPrivateProfileString("COMMAND", "COMMAND_IRLIGHTMANUAL", "0", g_char_IRLightManual, 30, fileLanguageSet); + g_str_IRLightManual = g_char_IRLightManual; + // IR自动调光 + GetPrivateProfileString("COMMAND", "COMMAND_IRLIGHTAUTO", "0", g_char_IRLightAuto, 30, fileLanguageSet); + g_str_IRLightAuto = g_char_IRLightAuto; + // IR亮度+ + GetPrivateProfileString("COMMAND", "COMMAND_IRLIGHTPLUS", "0", g_char_IRLightPlus, 30, fileLanguageSet); + g_str_IRLightPlus = g_char_IRLightPlus; + // IR亮度- + GetPrivateProfileString("COMMAND", "COMMAND_IRLIGHTMINUS", "0", g_char_IRLightMinus, 30, fileLanguageSet); + g_str_IRLightMinus = g_char_IRLightMinus; + // IR对比度+ + GetPrivateProfileString("COMMAND", "COMMAND_IRCONTRASTPLUS", "0", g_char_IRContrastPlus, 30, fileLanguageSet); + g_str_IRContrastPlus = g_char_IRContrastPlus; + // IR对比度- + GetPrivateProfileString("COMMAND", "COMMAND_IRCONTRASTMINUS", "0", g_char_IRContrastMinus, 30, fileLanguageSet); + g_str_IRContrastMinus = g_char_IRContrastMinus; + // 边缘锐化开 + GetPrivateProfileString("COMMAND", "COMMAND_DDEON", "0", g_char_DDEON, 30, fileLanguageSet); + g_str_DDEON = g_char_DDEON; + // 边缘锐化关 + GetPrivateProfileString("COMMAND", "COMMAND_DDEOFF", "0", g_char_DDEOFF, 30, fileLanguageSet); + g_str_DDEOFF = g_char_DDEOFF; + // IR电源开 + GetPrivateProfileString("COMMAND", "COMMAND_IRPOWERON", "0", g_char_IRPowerON, 30, fileLanguageSet); + g_str_IRPowerON = g_char_IRPowerON; + // IR电源关 + GetPrivateProfileString("COMMAND", "COMMAND_IRPOWEROFF", "0", g_char_IRPowerOFF, 30, fileLanguageSet); + g_str_IRPowerOFF = g_char_IRPowerOFF; + // 设置图像类型 + GetPrivateProfileString("COMMAND", "COMMAND_IMGTYPESET", "0", g_char_ImgTypeSet, 30, fileLanguageSet); + g_str_ImgTypeSet = g_char_ImgTypeSet; + // 设置图像码流 + GetPrivateProfileString("COMMAND", "COMMAND_IMGFLOWSET", "0", g_char_ImgFlowSet, 30, fileLanguageSet); + g_str_ImgFlowSet = g_char_ImgFlowSet; + + // DC手动白平衡 + GetPrivateProfileString("COMMAND", "COMMAND_DCWBMANUAL", "0", g_char_DCWBManual, 30, fileLanguageSet); + g_str_DCWBManual = g_char_DCWBManual; + // DC自动白平衡 + GetPrivateProfileString("COMMAND", "COMMAND_DCWBAUTO", "0", g_char_DCWBAuto, 30, fileLanguageSet); + g_str_DCWBAuto = g_char_DCWBAuto; + // 单拍 + GetPrivateProfileString("COMMAND", "COMMAND_SINGLESHOOT", "0", g_char_SingleShoot, 30, fileLanguageSet); + g_str_SingleShoot = g_char_SingleShoot; + // 两秒连拍 + GetPrivateProfileString("COMMAND", "COMMAND_CC2S", "0", g_char_CC2s, 30, fileLanguageSet); + g_str_CC2s = g_char_CC2s; + // 四秒连拍 + GetPrivateProfileString("COMMAND", "COMMAND_CC4S", "0", g_char_CC4s, 30, fileLanguageSet); + g_str_CC4s = g_char_CC4s; + // 保证重叠率连拍 + GetPrivateProfileString("COMMAND", "COMMAND_CCOVERLAP", "0", g_char_CCOverlap, 30, fileLanguageSet); + g_str_CCOverlap = g_char_CCOverlap; + // 摆扫连拍 + GetPrivateProfileString("COMMAND", "COMMAND_CCAUTOSCAN", "0", g_char_CCAutoScan, 30, fileLanguageSet); + g_str_CCAutoScan = g_char_CCAutoScan; + // DC自动曝光 + GetPrivateProfileString("COMMAND", "COMMAND_DCEXPOSUREAUTO", "0", g_char_DCExposureAuto, 30, fileLanguageSet); + g_str_DCExposureAuto = g_char_DCExposureAuto; + // DC手动曝光 + GetPrivateProfileString("COMMAND", "COMMAND_DCEXPOSUREMANUAL", "0", g_char_DCExposureManual, 30, fileLanguageSet); + g_str_DCExposureManual = g_char_DCExposureManual; + // DC曝光时间+ + GetPrivateProfileString("COMMAND", "COMMAND_DCEXPOSUREPLUS", "0", g_char_DCExposurePlus, 30, fileLanguageSet); + g_str_DCExposurePlus = g_char_DCExposurePlus; + // DC曝光时间- + GetPrivateProfileString("COMMAND", "COMMAND_DCEXPOSUREMINUS", "0", g_char_DCExposureMinus, 30, fileLanguageSet); + g_str_DCExposureMinus = g_char_DCExposureMinus; + // 保证速高比曝光 + GetPrivateProfileString("COMMAND", "COMMAND_DCEXPOSUREVHR", "0", g_char_DCExposureVHR, 30, fileLanguageSet); + g_str_DCExposureVHR = g_char_DCExposureVHR; + + // 伺服电源开 + GetPrivateProfileString("COMMAND", "COMMAND_SERVOPOWERON", "0", g_char_ServoPowerON, 30, fileLanguageSet); + g_str_ServoPowerON = g_char_ServoPowerON; + // 伺服电源关 + GetPrivateProfileString("COMMAND", "COMMAND_SERVOPOWEROFF", "0", g_char_ServoPowerOFF, 30, fileLanguageSet); + g_str_ServoPowerOFF = g_char_ServoPowerOFF; + + + // 通过配置文件导入[OTHER]语言文字 + // 未选择编码 + GetPrivateProfileString("OTHER", "OTHER_LASERCHOOSE", "0", g_char_LaserChoose, 30, fileLanguageSet); + g_str_LaserChoose = g_char_LaserChoose; + // 编码加载成功 + GetPrivateProfileString("OTHER", "OTHER_LASERNUMLOADSUCCESS", "0", g_char_LaserLoadSuccess, 30, fileLanguageSet); + g_str_LaserLoadSuccess = g_char_LaserLoadSuccess; + // 编码加载失败 + GetPrivateProfileString("OTHER", "OTHER_LASERNUMLOADFAIL", "0", g_char_LaserLoadFail, 30, fileLanguageSet); + g_str_LaserLoadFail = g_char_LaserLoadFail; +} + + +void CCH91PayloadSoftwareDlg::OnBnClickedBtnMulticastsocketreceive() +{ + // 组播收数 + if (m_MulticastSocketReceiveDlg != NULL) + { + if (TRUE == m_MulticastSocketReceiveDlg->IsWindowVisible()) + { + m_MulticastSocketReceiveDlg->ShowWindow(SW_HIDE); + } + else + { + m_MulticastSocketReceiveDlg->ShowWindow(SW_SHOW); + } + } +} + + +void CCH91PayloadSoftwareDlg::OnBnClickedBtnCaptureVideo() +{ + g_bVideoCapture =! g_bVideoCapture; + + if (TRUE == g_bVideoCapture) + { + GetDlgItem(IDC_BTN_CAPTURE_VIDEO)->SetWindowText("停止录制"); + m_Btn_CaptureVideo.SetIcon(IDI_ICON_MAIN_CAPTURESTOP); + m_Btn_CaptureVideo.SetTooltipText("Recording Stop"); + // 创建文件 + CTime tm = CTime::GetCurrentTime(); + CString str_DataTime; + str_DataTime.Format(_T("FH98_VideoData_%04d%02d%02d_%02d%02d%02d"), tm.GetYear(), tm.GetMonth(), tm.GetDay(), tm.GetHour(), tm.GetMinute(), tm.GetSecond());//文件名中不能出现冒号 + CString str_DateTimeVideo; + str_DateTimeVideo = str_DataTime + ".h264"; + CString pathCH96Video = GetSoftwareCurrentDirectory() + "\\Result\\VideoData\\" + str_DateTimeVideo; + fopen_s(&g_pFileSaveVideoDataCH96, pathCH96Video, _T("ab")); + } + else + { + GetDlgItem(IDC_BTN_CAPTURE_VIDEO)->SetWindowText("视频录制"); + m_Btn_CaptureVideo.SetIcon(IDI_ICON_MAIN_CAPTUREVIDEO); + m_Btn_CaptureVideo.SetTooltipText("Recording Start"); + // 关闭存储文件 + if (g_pFileSaveVideoDataCH96 != NULL) + { + fclose(g_pFileSaveVideoDataCH96); + g_pFileSaveVideoDataCH96 = NULL; + } + } +} + + +// Ctrl + 鼠标左键双击——目标跟踪 +void CCH91PayloadSoftwareDlg::OnLButtonDblClk(UINT nFlags, CPoint point) +{ + // 在图像显示页面摁住Ctrl后双击有效 + if (::GetKeyState(VK_CONTROL) < 0) + { + // 如果当前是小区域显示图像 + if (m_bVideoShowFullScreen == FALSE) + { + // 如果双击位置在小区域 + if (point.x > rect_SmallRegion.left && point.x < rect_SmallRegion.right && point.y > rect_SmallRegion.top && point.y < rect_SmallRegion.bottom) + { + // 控件中心坐标 + CPoint centerPt = rect_SmallRegion.CenterPoint(); + centerPt.x = centerPt.x - rect_SmallRegion.left; + centerPt.y = centerPt.y - rect_SmallRegion.top; + // 控件偏移量 + CPoint offset; + offset.x = point.x - centerPt.x; + offset.y = centerPt.y - point.y; + // 控件偏移量转为图像偏移量 + offset.x = offset.x * 1920 / rect_SmallRegion.Width(); + offset.y = offset.y * 1080 / rect_SmallRegion.Height(); + // 指令发送 + g_payloadCtrlProtocol = 11; + g_TrackOffset = offset; + } + else + { + return; + } + } + // 如果当前是大区域显示图像 + else + { + // 如果双击位置在大区域 + if (point.x > rect_BigRegion.left && point.x < rect_BigRegion.right && point.y > rect_BigRegion.top && point.y < rect_BigRegion.bottom) + { + // 控件中心坐标 + CPoint centerPt = rect_BigRegion.CenterPoint(); + centerPt.x = centerPt.x - rect_SmallRegion.left; + centerPt.y = centerPt.y - rect_SmallRegion.top; + // 控件偏移量 + CPoint offset; + offset.x = point.x - centerPt.x; + offset.y = centerPt.y - point.y; + // 控件偏移量转为图像偏移量 + offset.x = offset.x * 1920 / rect_BigRegion.Width(); + offset.y = offset.y * 1080 / rect_BigRegion.Height(); + // 指令发送 + g_payloadCtrlProtocol = 11; + g_TrackOffset = offset; + } + else + { + return; + } + } + } + + CDialogEx::OnLButtonDblClk(nFlags, point); +} + +// Ctrl + 鼠标右键单击——手动搜索 +void CCH91PayloadSoftwareDlg::OnRButtonDown(UINT nFlags, CPoint point) +{ + // 在图像显示页面摁住Ctrl后右击有效 + if (::GetKeyState(VK_CONTROL) < 0) + { + // 如果当前是小区域显示图像 + if (m_bVideoShowFullScreen == FALSE) + { + // 如果右击位置在小区域 + if (point.x > rect_SmallRegion.left && point.x < rect_SmallRegion.right && point.y > rect_SmallRegion.top && point.y < rect_SmallRegion.bottom) + { + // 手动模式 + g_payloadCtrlProtocol = 10; + } + else + { + return; + } + } + // 如果当前是大区域显示图像 + else + { + // 如果右击位置在大区域 + if (point.x > rect_BigRegion.left && point.x < rect_BigRegion.right && point.y > rect_BigRegion.top && point.y < rect_BigRegion.bottom) + { + // 手动模式 + g_payloadCtrlProtocol = 10; + } + else + { + return; + } + } + } + CDialogEx::OnRButtonDown(nFlags, point); +} + +// 鼠标中键摁下 +void CCH91PayloadSoftwareDlg::OnMButtonDown(UINT nFlags, CPoint point) +{ + // 鼠标中键摁下 + m_bMButtonDown = TRUE; + CDialogEx::OnMButtonDown(nFlags, point); +} +// 鼠标中键抬起 +void CCH91PayloadSoftwareDlg::OnMButtonUp(UINT nFlags, CPoint point) +{ + // 鼠标中键抬起 + m_bMButtonDown = FALSE; + // 偏移量归零,并发送消息 + g_MS_Ratio = 0; + g_MS_Angle = 0; + ::SendMessage(g_SendControlCommandDlgHwnd, WM_SHOW_MANUAL_SEARCH , WPARAM(0), LPARAM(0)); + CDialogEx::OnMButtonUp(nFlags, point); +} +// 拖动鼠标 +void CCH91PayloadSoftwareDlg::OnMouseMove(UINT nFlags, CPoint point) +{ + // 如果鼠标中键摁下 + if (m_bMButtonDown == TRUE) + { + // 如果当前是小区域显示图像 + if (m_bVideoShowFullScreen == FALSE) + { + // 如果鼠标移动区域在小区域内部 + if (point.x > rect_SmallRegion.left && point.x < rect_SmallRegion.right && point.y > rect_SmallRegion.top && point.y < rect_SmallRegion.bottom) + { + // 中心坐标 + CPoint centerPt = rect_SmallRegion.CenterPoint(); + centerPt.x = centerPt.x - rect_SmallRegion.left; + centerPt.y = centerPt.y - rect_SmallRegion.top; + // 偏移坐标 + CPoint offset; + offset.x = point.x - centerPt.x; + offset.y = centerPt.y - point.y; + // 计算角度和偏移比例 + double angle = GetOffsetAngle(offset.x, offset.y); + double distRatio = sqrt(4.0 * (offset.x * offset.x + offset.y * offset.y) / (rect_SmallRegion.Width() * rect_SmallRegion.Width())); + // 条件判定 + if (distRatio > 1.0 || abs(angle) > 180) + { + m_bMButtonDown = FALSE; + // 全局变量赋值 + g_MS_Ratio = 0; + g_MS_Angle = 0; + ::SendMessage(g_SendControlCommandDlgHwnd, WM_SHOW_MANUAL_SEARCH , WPARAM(0), LPARAM(0)); + } + else + { + // 条件判定 + if (distRatio > 0.5) + { + distRatio = 0.5; + } + // 全局变量赋值 + g_MS_Ratio = distRatio; + g_MS_Angle = angle; + ::SendMessage(g_SendControlCommandDlgHwnd, WM_SHOW_MANUAL_SEARCH , WPARAM(0), LPARAM(0)); + } + } + } + // 如果当前是大区域显示图像 + else + { + // 如果鼠标移动区域在大区域内部 + if (point.x > rect_BigRegion.left && point.x < rect_BigRegion.right && point.y > rect_BigRegion.top && point.y < rect_BigRegion.bottom) + { + // 中心坐标 + CPoint centerPt = rect_BigRegion.CenterPoint(); + centerPt.x = centerPt.x - rect_BigRegion.left; + centerPt.y = centerPt.y - rect_BigRegion.top; + // 偏移坐标 + CPoint offset; + offset.x = point.x - centerPt.x; + offset.y = centerPt.y - point.y; + // 计算角度和偏移比例 + double angle = GetOffsetAngle(offset.x, offset.y); + double distRatio = sqrt(4.0 * (offset.x * offset.x + offset.y * offset.y) / (rect_BigRegion.Width() * rect_BigRegion.Width())); + // 条件判定 + if (distRatio > 1.0 || abs(angle) > 180) + { + m_bMButtonDown = FALSE; + // 全局变量赋值 + g_MS_Ratio = 0; + g_MS_Angle = 0; + ::SendMessage(g_SendControlCommandDlgHwnd, WM_SHOW_MANUAL_SEARCH , WPARAM(0), LPARAM(0)); + } + else + { + // 条件判定 + if (distRatio > 0.5) + { + distRatio = 0.5; + } + // 全局变量赋值 + g_MS_Ratio = distRatio; + g_MS_Angle = angle; + ::SendMessage(g_SendControlCommandDlgHwnd, WM_SHOW_MANUAL_SEARCH , WPARAM(0), LPARAM(0)); + } + } + } + } + CDialogEx::OnMouseMove(nFlags, point); +} +// 计算偏移角度 +double CCH91PayloadSoftwareDlg::GetOffsetAngle(int X, int Y) +{ + double XA = X; + double YA = Y; + + // 输出合成航向角 Yaw + double PayLoad_Yaw = 0; + + // 在坐标轴上 + if (XA > 0 && YA == 0) + { + PayLoad_Yaw = 90; + } + else if (XA < 0 && YA == 0) + { + PayLoad_Yaw = -90; + } + else if (XA == 0 && YA > 0) + { + PayLoad_Yaw = 0; + } + else if (XA == 0 && YA < 0) + { + PayLoad_Yaw = 180; + } + else + { + double tanYaw = 0.0; + if (YA > 0 && XA > 0) + { + // 第1象限 + tanYaw = XA / YA; + PayLoad_Yaw = atan(tanYaw) * 180 / CV_PI; + } + else if (YA < 0 && XA > 0) + { + // 第2象限 + tanYaw = -XA / YA; + PayLoad_Yaw = atan(tanYaw) * 180 / CV_PI; + PayLoad_Yaw = 180 - PayLoad_Yaw; + } + else if (YA < 0 && XA < 0) + { + // 第3象限 + tanYaw = XA / YA; + PayLoad_Yaw = atan(tanYaw) * 180 / CV_PI; + PayLoad_Yaw = -180 + PayLoad_Yaw; + } + else if (YA > 0 && XA < 0) + { + // 第4象限 + tanYaw = -XA / YA; + PayLoad_Yaw = atan(tanYaw) * 180 / CV_PI; + PayLoad_Yaw = -PayLoad_Yaw; + } + } + + return PayLoad_Yaw; +} + + +/**********IMP**********/ +////IMP下行帧通过校验后调的函数 +//void CALLBACK IMPDOWNCheckCallback(CFrameIMPDown_ *ss) +//{ +// ::SendMessageA(g_mainDlgHwnd,WM_UPDATE_IMPDOWN_CHECKED,0,0); +//} +////IMP串口有数据后,进行校验 +//void OnReadFromCommIMP( char *buffer,const DWORD size) +//{ +// //buffer = (unsigned char*)buffer; +// const BYTE* buffer2 = (BYTE*)buffer; +// if(size>0) +// { +// BYTE DCBufferCmd[6]; +// memset(DCBufferCmd,0,sizeof(DCBufferCmd)); +// +// /********进入校验,校验通过就给g_FrameIMPDown赋值********/ +// g_FrameIMPDown.Phrase(buffer2, size); +// ////IMP协议类回调函数设置,校验通过后回自动调用该回调函数 +// //g_FrameIMPDown.SetCheckCallback((IMPDOWNCheckCallback,nullptr),nullptr); +// //g_FrameIMPDown.SetNotCheckCallback(nullptr); +// ::SendMessageA(g_mainDlgHwnd,WM_UPDATE_IMPDOWN_CHECKED,0,0); +// } +//} +////初始化 +//void CCH91PayloadSoftwareDlg::onInitIMPFrame() +//{ +// //串口通信设置 +// memset(pSerialPort, 0, 20); +// GetSerialPortNumber(pSerialPort,"串口40"); +// CString IMPComPort; +// IMPComPort = "115200"; +// pSerialPortBaud = atoi(IMPComPort);//波特率 +// if (!OnCheckComPort(pSerialPort)) //串口被占用,返回false +// { +// return; +// } +// if(m_SerialIMP.Initialize(pSerialPort, pSerialPortBaud, 8, 0, 0)) //开启串口通信 +// { +// m_SerialIMP.SetComReadCallback( OnReadFromCommIMP ); +// //m_SerialIMP.SetNotCheckCallback(nullptr,NULL); +// BYTE buffersend[10]; +// memset(buffersend,1,10); +// m_SerialIMP.WriteABuffer(buffersend,sizeof(buffersend)); +// } +//} +////处理通过校验的IMP下行数据 +//LRESULT CCH91PayloadSoftwareDlg::OnUpdateIMPDownDataChecked(WPARAM param, LPARAM lparam) +//{ +// //数据解析与显示 +// if(p_DlgIMP->IsWindowVisible()) +// { +// p_DlgIMP->SetIMPData(g_FrameIMPDown); +// } +// return 0; +//} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/CH91PayloadSoftwareDlg.h b/Src/CH91PayloadSoftware/CH91PayloadSoftwareDlg.h new file mode 100644 index 0000000..a554a17 --- /dev/null +++ b/Src/CH91PayloadSoftware/CH91PayloadSoftwareDlg.h @@ -0,0 +1,210 @@ + +// CH91PayloadSoftwareDlg.h : 头文件 +// + +#pragma once + +#include "MulticastSocket.h" +#include "ExportSimpleImgShow.h" +#include "ExportImgShowBase.h" +#include "JoyKeybordControl.h" +#include "JoyStickControlDlg.h" +#include "ControlDlgFH96Page1.h" +#include "ShowFJDataDlg.h" +#include "DlgRecvDataFromQB.h" +#include "CUDPSocket.h" +#include "ShowReplayDlg.h" +#include "MulticastSocketReceiveDlg.h" +#include "BtnST.h" +#include "EditInput.h" +#include "Serial.h" +#include "afxwin.h" +#include "afxcmn.h" +#include "DlgCameraCtrl.h" +#include "DlgIMP.h" +#include "Dlg13InstituteDCNew.h" +#include "DCOverrollDlg.h" +//#include "FrameIMP_DOWN.h" + +// CCH91PayloadSoftwareDlg 对话框 +class CCH91PayloadSoftwareDlg : public CDialogEx +{ +// 构造 +public: + CCH91PayloadSoftwareDlg(CWnd* pParent = NULL); // 标准构造函数 + +// 对话框数据 + enum { IDD = IDD_CH91PAYLOADSOFTWARE_DIALOG }; + + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + +public: + + // 分别代表 数据处理的线程的句柄和ID + HANDLE m_hThread_ProcessData; + DWORD m_ThreadID_ProcessData; + + // 分别代表 数据处理的线程的句柄和ID + HANDLE m_hThread_ProcessDataH264; + DWORD m_ThreadID_ProcessDataH264; + + // UDP实时接收数据 + CUDPSocket m_UDPSocket_ZH; + // 图像显示模块 + CExportSimpleImgShow *m_wndShowEO; // EO + + // 对话框 + CShowFJDataDlg* m_ShowFJDataDlg; // 显示FJ数据对话框 + CShowReplayDlg* m_ShowReplayDlg; // 显示视频回放控制对话框 + CDlgRecvDataFromQB* m_ShowDlgRecvDataFromQB; //显示情报席位目标定位数据对话框 + CMulticastSocketReceiveDlg* m_MulticastSocketReceiveDlg; // 显示组播发送创建对话框 + + + // 视频键盘类 + CJoyKeybordControl m_JoyKeybord; + // 摇杆控制类(对话框模式,不显示) + CJoyStickControlDlg* m_JoyStickControlDlg; + + // 显示组播接收信息 + CString str_MulticastSocketInfo; + + // rect变量 + CRect rect_SmallRegion; + CRect rect_BigRegion; +// 实现 +protected: + HICON m_hIcon; + // 生成的消息映射函数 + virtual BOOL OnInitDialog(); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnPaint(); + afx_msg HCURSOR OnQueryDragIcon(); + DECLARE_MESSAGE_MAP() + +public: // 美化主界面按钮 + CButtonST m_Btn_Replay; // 视频回放 + CButtonST m_Btn_FJ; // 复接数据 + CButtonST m_Btn_Trans; // 可见光,红外变换显示 + CButtonST m_Btn_CaptureVideo; // 视频录像 + CButtonST m_Btn_CaptureImg; // 抓图 + CButtonST m_Btn_Result; // 录像及截图结果预览 + CButtonST m_Btn_ReadImg; // 读取图片(数码照片) + CButtonST m_Btn_Guide; // 数引功能 + CButtonST m_Btn_QBFunctions; // 参数设置 + CButtonST m_Btn_SocketSend; // 组播发送 + CButtonST m_Btn_SocketReceive; // 组播收数 + CButtonST m_Btn_PhotoCtrl; // 图片浏览 + CButtonST m_Btn_PayloadEvaluation; // 载荷评价 + void DlgStyleChange(); + +public: + afx_msg void OnDestroy(); + // 对控制页面的Tab页进行初始化 + void OnInitControlDlg(); + // 对解码器进行初始化 + void OnInitCH96Decoder(); + // 通过视频回放页面控制载荷类型,型号类型在配置文件中更改 + LRESULT PayloadTypeSet(WPARAM wParam, LPARAM lParam); + // 可见光,红外显示复接数据 + LRESULT ShowMsgOnDlgEO(WPARAM wParam, LPARAM lParam); + LRESULT ShowMsgOnDlgIR(WPARAM wParam, LPARAM lParam); + // 数码照片复接数据 + LRESULT ShowMsgOnDlgDC(WPARAM wParam, LPARAM lParam); + + // 回放进度停止时,清空图像缓存 + void ShowEOImg(cv::Mat img); + + LRESULT ShowGuideAzimuthOnDlg(WPARAM wParam, LPARAM lParam); + LRESULT ShowGuidePitchOnDlg(WPARAM wParam, LPARAM lParam); + + + // 在发送控制指令之后,将焦点设置在主界面上 + LRESULT SetFocusOnMainDlg(WPARAM wParam, LPARAM lParam); + + // 显示复接数据 + void ShowImgFJData(); + afx_msg void OnBnClickedBtnShowFj(); + //afx_msg void OnBnClickedBtnSendKz(); + + + // 显示发送指令内容 + LRESULT ShowCtrlInstruction(WPARAM wParam, LPARAM lParam); + + // 解析开关指令 + CString TranlateBackSwitchInstructions(UINT8 switchInstruction); + + //解析载荷工作状态 + void ZHWorkState(UINT8 CurrentImgType, UINT8 SystemState, UINT8 LaserState); + + afx_msg void OnBnClickedBtnLookupResult(); + + // 主界面数引控制 + CEditInput str_Guide_Azimuth; //方位角 + CEditInput str_Guide_Pitch; //俯仰角 + + float m_Guide_Azimuth; //方位角 + float m_Guide_Pitch; //俯仰角 + + virtual BOOL PreTranslateMessage(MSG* pMsg); + afx_msg void OnTimer(UINT_PTR nIDEvent); + //afx_msg void OnBnClickedBtnCaptureImg(); + + //图像采集(视频录像功能定义在Global中) + bool m_bCaptureEOImg; + bool m_bCaptureIRImg; + + // 主界面显示UDP组播连接及串位情况 + afx_msg void OnBnClickedBtnReplay(); + + // 主界面方位角Picture Control + afx_msg void OnBnClickedBtnBigimage(); + + // 关联对话框变量 + + // 当前图像类型 + CString str_CurrentImgType; // 两种 EO图像/IR图像 + + // 是否按下鼠标中键 + BOOL m_bMButtonDown; // TRUE: 按下鼠标中键 FALSE: 抬起鼠标中键 +private: + CUDPSocket m_UdpSend2Payload; + bool m_bCreatUDP; + //CControlDlgFH96Page1* m_CControlDlgFH96Page1Dlg; + CDlgCameraCtrl * p_DlgCameraCtrl;//吊舱控制页面 + Dlg13InstituteDCNew * p_Dlg13InstituteDCNewCtrl;//13所吊舱新控制放页面 + DCOverrollDlg *p_DlgDCOverroll;//吊舱控制总页面 + +public: + afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); + + // 视频全屏显示 + BOOL m_bVideoShowFullScreen; // TRUE: 视频全屏显示 FALSE: 视频非全屏显示 + void VideoShowFullScreenONOFF(); + + // 串口类, 连接视频键盘 + CSerial m_Serial; // 串口 + void DlgLanguageSet(); + afx_msg void OnBnClickedBtnMulticastsocketreceive(); + afx_msg void OnBnClickedBtnCaptureVideo(); + // 图像显示界面左键双击,目标跟踪 + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + // 图像显示界面右键单击,手动模式 + afx_msg void OnRButtonDown(UINT nFlags, CPoint point); + // 图像显示界面摁住鼠标中键拖动,控制伺服 + afx_msg void OnMButtonDown(UINT nFlags, CPoint point); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnMButtonUp(UINT nFlags, CPoint point); + // 计算拖动鼠标时,偏移量形成的角度 + double GetOffsetAngle(int X, int Y); + + + //////IMP相关 + CDlgIMP * g_DlgIMP;//IMP对话框 + //CSerial m_SerialIMP; // IMP通信串口 + //char pSerialPort[20];//串口号 + //DWORD pSerialPortBaud;//端口号 + //void onInitIMPFrame();//初始化IMP协议 + //LRESULT OnUpdateIMPDownDataChecked(WPARAM param, LPARAM lparam); //处理IMP下行通过校验的遥测数据 + +}; diff --git a/Src/CH91PayloadSoftware/CMDBtn.cpp b/Src/CH91PayloadSoftware/CMDBtn.cpp new file mode 100644 index 0000000..cd4bd4a --- /dev/null +++ b/Src/CH91PayloadSoftware/CMDBtn.cpp @@ -0,0 +1,89 @@ +#include "stdafx.h" +#include "Global.h" +#include "CMDBtn.h" + + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +CCMDBtn::CCMDBtn(void) +{ + Cmd = 0x00; + Cmdpage = 0; +} + +BEGIN_MESSAGE_MAP(CCMDBtn, CMFCButton) + //{{AFX_MSG_MAP(CMCBtn) + ON_WM_LBUTTONUP() + ON_WM_LBUTTONDOWN() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +CCMDBtn::~CCMDBtn(void) +{ +} + +void CCMDBtn::OnLButtonUp( UINT nFlags, CPoint point ) +{ + g_FrameCamera.ckCmd = 0x00; + g_FrameCamera.SendPrepare(); + if(g_IsSending) + g_MUDPCamera.SendToY(g_FrameCamera.Addr(),8); + CButton::OnLButtonUp( nFlags, point ); +} + +void CCMDBtn::OnLButtonDown( UINT nFlags, CPoint point ) +{ + BYTE byFcCmd; + byFcCmd = GetFcCmdFromPane( Cmdpage, Cmd ); + g_FrameCamera.ckCmd = byFcCmd; + g_FrameCamera.SendPrepare(); + if(g_IsSending) + g_MUDPCamera.SendToY(g_FrameCamera.Addr(),8); + CButton::OnLButtonDown( nFlags, point ); +} +BYTE CCMDBtn::GetFcCmdFromPane( int page, BYTE cmd ) +{ + BYTE B; + /*视频管理计算机指令-来之吊舱控制页面*/ + if( page == 20) + { + switch ( cmd ) + { + case 1: + B = 0xC4; break;//2M速率 + case 2: + B = 0xC5; break;//4M速率 + case 3: + B = 0xC6; break;//吊舱通道1 + case 4: + B = 0xC7; break;//吊舱通道2 + case 5: + B = 0xC8; break;//0-3拼图 + case 6: + B = 0xC9; break;//4-6拼图 + case 7: + B = 0xCB; break;//记录 + case 8: + B = 0xCC; break;//停止记录 + case 9: + B = 0xCD; break;//清空数据 + case 10: + B = 0xC0; break;//L链输出/SPI输出 + case 11: + B = 0xC1; break;//卫通输出/网络输出 + case 12: + B = 0xC2; break;//双路输出/两路输出 + default: + B = 0x00; break; + } + } + else if(page==0) + { + + } + return B; +} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/CMDBtn.h b/Src/CH91PayloadSoftware/CMDBtn.h new file mode 100644 index 0000000..e583012 --- /dev/null +++ b/Src/CH91PayloadSoftware/CMDBtn.h @@ -0,0 +1,25 @@ +#if !defined(AFX_CMDBTN_H__1806C3A3_0279_4B10_A383_905233E78AD1__INCLUDED_) +#define AFX_CMDBTN_H__1806C3A3_0279_4B10_A383_905233E78AD1__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +class CCMDBtn : public CMFCButton +{ +public: + CCMDBtn(); + BYTE Cmd; + int Cmdpage; + virtual ~CCMDBtn(); +protected: + //{{AFX_MSG(CMCBtn) + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +public: + BYTE GetFcCmdFromPane(int page,BYTE cmd); +}; +#endif // !defined(AFX_XPBTN_H__1806C3A3_0278_4B10_A383_905233E78AD1__INCLUDED_) diff --git a/Src/CH91PayloadSoftware/CTCPSocket.cpp b/Src/CH91PayloadSoftware/CTCPSocket.cpp new file mode 100644 index 0000000..cf7ed32 --- /dev/null +++ b/Src/CH91PayloadSoftware/CTCPSocket.cpp @@ -0,0 +1,87 @@ +#include "stdafx.h" +#include "CTCPSocket.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + +CTCPSocket::CTCPSocket() : CAsyncSocket(), RemoteIP( "127.0.0.1" ), RemotePort( 8888 ), + LocalIP( "127.0.0.1" ), LocalPort(8889), RevData(NULL), m_Param( NULL ), m_Length( -1 ), + m_bConnected( false ) +{ + memset(ReceiveBuf, 0, MAX_TCP_BUF_LEN); +} + +CTCPSocket::~CTCPSocket() +{ + try + { + CAsyncSocket::Close(); + m_Param = NULL; + } + catch ( ... ) + { + } +} + +bool CTCPSocket::StartListening() +{ + if ( !AfxSocketInit() ) + { + return false; + } + if ( !Create() ) + { + return false; + } + if ( Connect( RemoteIP, RemotePort )/*t_Error == 1*/) + { + //MessageBox(_T("连接TCP服务器")+RemoteIP+_T("失败!")); + return false; + } + + return true; +} + +bool CTCPSocket::WriteBuffer( const void *buf, unsigned int len ) +{ + if(!m_bConnected) + { + return false; + } + + int nRet = CAsyncSocket::Send( buf, len ); + + //Sleep( 1 ); + + if (SOCKET_ERROR == nRet) + { + return false; + } + return true; +} + +void CTCPSocket::OnReceive( int nErrorCode ) +{ + CAsyncSocket::OnReceive( nErrorCode ); + if( nErrorCode == 0 ) + { + m_Length = ReceiveFrom( ReceiveBuf, MAX_TCP_BUF_LEN, RemoteIP, RemotePort ); + if ( m_Length == SOCKET_ERROR ) + { + return; + } + if ( RevData != NULL ) + { + RevData(ReceiveBuf, m_Length, (UINT32)m_Param ); + } + } +} + +void CTCPSocket::OnConnect(int nErrorCode) +{ + if(nErrorCode == 0) + { + m_bConnected = true; + } +} diff --git a/Src/CH91PayloadSoftware/CTCPSocket.h b/Src/CH91PayloadSoftware/CTCPSocket.h new file mode 100644 index 0000000..17798b0 --- /dev/null +++ b/Src/CH91PayloadSoftware/CTCPSocket.h @@ -0,0 +1,65 @@ +#ifndef _CTCP_SOCKET_H +#define _CTCP_SOCKET_H +#include +//#include +//using namespace std; + +#define MAX_TCP_BUF_LEN 30745 + +typedef void ( CALLBACK *TCPRevDataCALLBACK )( unsigned char *buffer, int length, UINT32 data); + +class CTCPSocket : public CAsyncSocket +{ +public: + CTCPSocket(); + virtual ~CTCPSocket(); + +public: + + bool StartListening(); + bool StopListening() + { + CAsyncSocket::Close(); + return true; + } + void SetLocalIP( CString ip ) + { + LocalIP = ip; + } + void SetLocalPort( unsigned int port ) + { + LocalPort = port; + } + void SetRomoteIP( CString ip ) + { + RemoteIP = ip; + } + void SetRemotePort( unsigned int port ) + { + RemotePort = port; + } + void SetCallBack( TCPRevDataCALLBACK DataCallBack, LPVOID Param ) + { + RevData = DataCallBack; + m_Param = Param; + } + bool WriteBuffer( const void *buf, unsigned int len ); + +protected: + virtual void OnReceive(int nErrorCode); + virtual void OnConnect(int nErrorCode); + +private: + CString RemoteIP; + unsigned int RemotePort; + CString LocalIP; + unsigned int LocalPort; + TCPRevDataCALLBACK RevData; + LPVOID m_Param; + bool m_bConnected; + int m_Length; + unsigned char ReceiveBuf[MAX_TCP_BUF_LEN]; + +}; + +#endif diff --git a/Src/CH91PayloadSoftware/CUDPSocket.cpp b/Src/CH91PayloadSoftware/CUDPSocket.cpp new file mode 100644 index 0000000..c8aa6e2 --- /dev/null +++ b/Src/CH91PayloadSoftware/CUDPSocket.cpp @@ -0,0 +1,99 @@ +#include "stdafx.h" +#include "CUDPSocket.h" +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + +CUDPSocket::CUDPSocket() : CAsyncSocket(), RemoteIP( "127.0.0.1" ), RemotePort( 8888 ), + LocalIP( "127.0.0.1" ), LocalPort(8889), SendHDNum( 0 ), + m_Param(NULL),RevData(NULL), + ReceiveNum( 0 ), bRecSearchHead( false ),m_Length( -1 ) +{ + memset(ReceiveBuf, 0, MAX_UDP_BUF_LEN); +} + +void CUDPSocket::SetParams(CString localIP,unsigned int localPort,CString remoteIP,unsigned int remotePort) +{ + memset(ReceiveBuf, 0, MAX_UDP_BUF_LEN); + LocalIP = localIP; + LocalPort = localPort; + RemoteIP = remoteIP; + RemotePort = remotePort; +} + +CUDPSocket::~CUDPSocket() +{ + try + { + CAsyncSocket::Close(); + m_Param = NULL; + } + catch ( ... ) + { + } +} + +bool CUDPSocket::StartListening(bool flag) +{ + RemoteIP.ReleaseBuffer(); + LocalIP.ReleaseBuffer(); + + if ( !AfxSocketInit() ) + { + return false; + } + if(flag) + { + if ( !Create( LocalPort, SOCK_DGRAM, FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE ) ) + { + return false; + } + + Bind(LocalPort,LocalIP); + } + else + { + if ( !Create( LocalPort, SOCK_DGRAM, FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE,LocalIP ) ) + { + return false; + } + } + + + DWORD dwFlag = 0; + IOCtl( FIONBIO, &dwFlag ); + + return true; +} + +bool CUDPSocket::WriteBuffer( const void *buf, unsigned int len ) +{ + if(SendTo( buf, len, RemotePort, RemoteIP ) < 0) + { + return false; + } + return true; +} + +void CUDPSocket::OnReceive( int nErrorCode ) +{ + m_Length = ReceiveFrom( ReceiveBuf, MAX_UDP_BUF_LEN, RemoteIP, RemotePort ); + if ( m_Length == SOCKET_ERROR ) + { + return; + } + if ( RevData != NULL ) + { + RevData(ReceiveBuf, m_Length, m_Param ); + } + + CAsyncSocket::OnReceive( nErrorCode ); +} + +void CUDPSocket::SetCallBack( UDPRevDataCALLBACK DataCallBack, LPVOID Param ) +{ + + m_Param = Param; + RevData = DataCallBack; + +} diff --git a/Src/CH91PayloadSoftware/CUDPSocket.h b/Src/CH91PayloadSoftware/CUDPSocket.h new file mode 100644 index 0000000..dc831a2 --- /dev/null +++ b/Src/CH91PayloadSoftware/CUDPSocket.h @@ -0,0 +1,62 @@ +#ifndef _CUDP_SOCKET_H +#define _CUDP_SOCKET_H +#include +#include +using namespace std; + +#define MAX_UDP_BUF_LEN 30745//25600 30745 SMData大小 + +//#define WM_RECEIVE_NET_DATA (WM_USER + 88) +//typedef void ( CALLBACK *UDPRevDataCALLBACK )( unsigned char *rxdata, DWORD lLen, UINT32 Param ); +typedef void ( CALLBACK *UDPRevDataCALLBACK )(const void* buffer, int length, LPVOID data); + +class CUDPSocket : public CAsyncSocket +{ +private: + CString RemoteIP; + unsigned int RemotePort; + CString LocalIP; + unsigned int LocalPort; + unsigned char SendHDNum; + unsigned int ReceiveNum; + bool bRecSearchHead; + + int m_Length; + char ReceiveBuf[MAX_UDP_BUF_LEN]; + UDPRevDataCALLBACK RevData; + LPVOID m_Param; +public: + + CUDPSocket(); + void SetParams(CString localIP,unsigned int localPort,CString remoteIP,unsigned int remotePort); + virtual ~CUDPSocket(); + bool StartListening(bool flag = false); + bool StopListening() + { + CAsyncSocket::Close(); + return true; + } + void SetLocalIP( CString ip ) + { + LocalIP = ip; + } + void SetLocalPort( unsigned int port ) + { + LocalPort = port; + } + void SetRomoteIP( CString ip ) + { + RemoteIP = ip; + } + void SetRemotePort( unsigned int port ) + { + RemotePort = port; + } + void SetCallBack( UDPRevDataCALLBACK DataCallBack, LPVOID Param ); + bool WriteBuffer( const void *buf, unsigned int len ); + +protected: + virtual void OnReceive( int nErrorCode ); +}; + +#endif //CUdpSocket diff --git a/Src/CH91PayloadSoftware/CYHMudpSend.cpp b/Src/CH91PayloadSoftware/CYHMudpSend.cpp new file mode 100644 index 0000000..60b240d --- /dev/null +++ b/Src/CH91PayloadSoftware/CYHMudpSend.cpp @@ -0,0 +1,34 @@ +#include "StdAfx.h" +#include "CYHMudpSend.h" +/*组播发送*/ +CYHMudpSend::CYHMudpSend() +{ + +} +CYHMudpSend::~CYHMudpSend() +{ + +} + + +bool CYHMudpSend::initMUDP(const char *IP,u_short Port) +{ + WSAStartup(MAKEWORD(2, 2), &wsaData); + sock = socket(AF_INET, SOCK_DGRAM, 0); + n = 0; + setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL, (char*)&n, sizeof(n)); + + addr.sin_addr.S_un.S_addr = inet_addr(IP); + addr.sin_family = AF_INET; + addr.sin_port = htons(Port); + return true; +} + +bool CYHMudpSend::SendData(BYTE* const bufs,int length) +{ + char* buf = (char*)bufs; + //sendto(sock, buf, strlen(buf) + 1, 0, (sockaddr*)&addr, sizeof(sockaddr)); + sendto(sock, buf, length, 0, (sockaddr*)&addr, sizeof(sockaddr)); + return true; +} + diff --git a/Src/CH91PayloadSoftware/CYHMudpSend.h b/Src/CH91PayloadSoftware/CYHMudpSend.h new file mode 100644 index 0000000..25c912d --- /dev/null +++ b/Src/CH91PayloadSoftware/CYHMudpSend.h @@ -0,0 +1,19 @@ +#pragma once +#include +#include +#include +class CYHMudpSend +{ +public: + CYHMudpSend(); + ~CYHMudpSend(); +public: + WSADATA wsaData; + SOCKET sock; + int n; + sockaddr_in addr; +public: + bool initMUDP(const char* IP, u_short Port); + bool SendData(BYTE* const,int); +}; + diff --git a/Src/CH91PayloadSoftware/CallBackDef.h b/Src/CH91PayloadSoftware/CallBackDef.h new file mode 100644 index 0000000..5e70e73 --- /dev/null +++ b/Src/CH91PayloadSoftware/CallBackDef.h @@ -0,0 +1,72 @@ +#include "stdafx.h" + +#include "QBStru.h" + +// openCV Library +#include +using namespace cv; + + +// 解码后通用情报结构体数据回调 +// 参数意义: +// 1. qbstru: 情报结构体指针 +// 2. purpose:用途(目的) +typedef void (CALLBACK* SendQBStruProc)(const QBStru* qbstru, int purpose); + + +// 作用:人工选定目标时,对外输出目标点像素坐标 +typedef void (CALLBACK* SendCoordinateProc)(CPoint Value); + +// 鼠标移动输出像素信息 +typedef void (CALLBACK* SendPixInfoProc)(CPoint xy, double Lon, double Lat, double H); + +// 回调文件保存路径 +// 参数意义: +// 1. FilePath: 文件路径 +// 2. type :文件类型 +// type = -1: 未知 +// type = 0: 单帧图像采集或图像连续采集(后面) 图像路径 bmp格式 +// type = 1: 单帧图像采集或图像连续采集(后面) 复接数据路径 xml格式 +// type = 2: 多帧图像采集(前面图像) 图像路径 bmp格式 +// type = 3: 多帧图像采集(前面图像) 复接数据路径 xml格式 +// type = 4: 系统级几何校正后图像路径 tif格式 +// type = 5: 拼接图像自动几何校正前 bmp格式 +// type = 6: 拼接图像自动几何校正后 tif格式 +// type = 7: 目标图像 +typedef void (CALLBACK* SendFilePath)(CString FilePath, int type); + +// 回调输出信息 +typedef void (CALLBACK* SendMessageProc)(CString msg); +// +// 回调输出图像(显示) +typedef void (CALLBACK* SendImgProc)(const cv::Mat &img); +// +// 回调输出最近一张图像(4个角点图像坐标) +typedef void (CALLBACK* SendNewImgProc)(const POINT *pt); + +// 回调输出 目标定位导引 输出经纬度 +typedef void (CALLBACK* SendTgrLocLeadLonLatProc)(double lon0, double lat0, + double lon1, double lat1, + double lon2, double lat2, + double lon3, double lat3, + double lon4, double lat4); + + +// 回调输出 输出火炮校射 炸点相对于目标的距离和角度 +typedef void (CALLBACK* SendArtilleryReviseInfoProc)(float dist, float angle); + + +// 回调输出 通知简单图像显示对话框被双击 +typedef void (CALLBACK* SendLButtonDblClkInfoProc)(); + +// 通知简单图像显示对话框被右键按下 +typedef void (CALLBACK* SendButtonDownInfoProc)(int type); + +// 输出双击图像时的脱靶量 +typedef void (CALLBACK* SendPixXYOffsetProc)(CPoint xy, int flag); + +// 输出双击点与对话框中点的夹角 +typedef void (CALLBACK* SendAngleProc)(double angle); + +// 当鼠标按下时,输出鼠标点与对话框中心点的距离比例系数和角度 +typedef void (CALLBACK* SendDistRatioAndAngleProc)(double distRatio, double angle); diff --git a/Src/CH91PayloadSoftware/CeXDib.cpp b/Src/CH91PayloadSoftware/CeXDib.cpp new file mode 100644 index 0000000..4420075 --- /dev/null +++ b/Src/CH91PayloadSoftware/CeXDib.cpp @@ -0,0 +1,333 @@ +#include "stdafx.h" +#include "CeXDib.h" + +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[]=__FILE__; +#define new DEBUG_NEW +#endif + +CCeXDib::CCeXDib() +{ + m_hDib = NULL; + m_dwLineWidth = 0; + m_wColors = 0; + + m_hMemDC = NULL; + m_hBitmap = NULL; + m_lpBits = NULL; + + FreeResources(); +} + +CCeXDib::~CCeXDib() +{ + FreeResources(); +} + +void CCeXDib::FreeResources() +{ + if (m_hMemDC) ::DeleteDC(m_hMemDC); + if (m_hBitmap) ::DeleteObject(m_hBitmap); + if (m_hDib) delete m_hDib; + + m_hDib = NULL; + m_hMemDC = NULL; + m_hBitmap = NULL; + m_lpBits = NULL; + memset(&m_bi, 0, sizeof(m_bi)); +} // End of FreeResources + +HDIB CCeXDib::Create(DWORD dwWidth, DWORD dwHeight, WORD wBitCount) +{ + LPBITMAPINFOHEADER lpbi = NULL; // Pointer to BITMAPINFOHEADER + DWORD dwLen = 0; // Size of memory block + + FreeResources(); + + // Following is taken from + // CDIBSectionLite class by Chris Maunder + switch (wBitCount) + { + case 1: m_wColors = 2; break; +#ifdef _WIN32_WCE + case 2: m_wColors = 4; break; // winCE only +#endif + case 4: m_wColors = 16; break; + case 8: m_wColors = 256; break; + case 16: + case 24: + case 32: m_wColors = 0; break; // 16,24 or 32 bpp have no color table + + default: + m_wColors = 0; + } // switch +/* + // Make sure bits per pixel is valid + if (wBitCount <= 1) wBitCount = 1; + else if (wBitCount <= 4) wBitCount = 4; + else if (wBitCount <= 8) wBitCount = 8; + else wBitCount = 24; + + switch (wBitCount) + { + case 1: + m_wColors = 2; + break; + case 4: + m_wColors = 16; + break; + case 8: + m_wColors = 256; + break; + default: + m_wColors = 0; + break; + } // switch +*/ + m_dwLineWidth = WIDTHBYTES(wBitCount * dwWidth); + + // Initialize BITMAPINFOHEADER + m_bi.biSize = sizeof(BITMAPINFOHEADER); + m_bi.biWidth = dwWidth; // fill in width from parameter + m_bi.biHeight = dwHeight; // fill in height from parameter + m_bi.biPlanes = 1; // must be 1 + m_bi.biBitCount = wBitCount; // from parameter + m_bi.biCompression = BI_RGB; + m_bi.biSizeImage = m_dwLineWidth * dwHeight; + m_bi.biXPelsPerMeter = 0; + m_bi.biYPelsPerMeter = 0; + m_bi.biClrUsed = 0; + m_bi.biClrImportant = 0; + + // Calculate size of memory block required to store the DIB. This + // block should be big enough to hold the BITMAPINFOHEADER, the color + // table, and the bits. + dwLen = GetSize(); + + m_hDib = new HDIB[dwLen]; // Allocate memory block to store our bitmap + if (m_hDib == NULL) return NULL; + + // Use our bitmap info structure to fill in first part of + // our DIB with the BITMAPINFOHEADER + lpbi = (LPBITMAPINFOHEADER)(m_hDib); + *lpbi = m_bi; + + return m_hDib; // Return handle to the DIB +} // End of Create + +DWORD CCeXDib::GetSize() +{ + return m_bi.biSize + m_bi.biSizeImage + GetPaletteSize(); +} // End of GetSize + +DWORD CCeXDib::GetPaletteSize() +{ + return (m_wColors * sizeof(RGBQUAD)); +} // End of GetPaletteSize + +LPBYTE CCeXDib::GetBits() +{ + if (m_hDib) return ((LPBYTE)m_hDib + *(LPDWORD)m_hDib + GetPaletteSize()); + + return NULL; +} // End of GetBits + +DWORD CCeXDib::GetWidth() +{ + return m_bi.biWidth; +} // End of GetWidth + +DWORD CCeXDib::GetHeight() +{ + return m_bi.biHeight; +} // End of GetHeight + +DWORD CCeXDib::GetLineWidth() +{ + return m_dwLineWidth; +} // End of GetLineWidth + +void CCeXDib::BlendPalette(COLORREF crColor, DWORD dwPerc) +{ + if (m_hDib == NULL || m_wColors == 0) return; + + LPBYTE iDst = (LPBYTE)(m_hDib) + sizeof(BITMAPINFOHEADER); + + long i,r,g,b; + + RGBQUAD* pPal = (RGBQUAD*)iDst; + + r = GetRValue(crColor); + g = GetGValue(crColor); + b = GetBValue(crColor); + + if (dwPerc > 100) dwPerc = 100; + + for (i = 0; i < m_wColors; i++) + { + pPal[i].rgbBlue = (BYTE)((pPal[i].rgbBlue * (100 - dwPerc) + b * dwPerc) / 100); + pPal[i].rgbGreen = (BYTE)((pPal[i].rgbGreen * (100 - dwPerc) + g * dwPerc) / 100); + pPal[i].rgbRed = (BYTE)((pPal[i].rgbRed * (100 - dwPerc) + r * dwPerc) / 100); + } // for +} // End of BlendPalette + +void CCeXDib::Clear(BYTE byVal) +{ + if (m_hDib) memset(GetBits(), byVal, m_bi.biSizeImage); +} // End of Clear + +void CCeXDib::SetPixelIndex(DWORD dwX, DWORD dwY, BYTE byI) +{ + if ((m_hDib == NULL) || (m_wColors == 0) || + ((long)dwX < 0) || ((long)dwY < 0) || (dwX >= (DWORD)m_bi.biWidth) || (dwY >= (DWORD)m_bi.biHeight)) return; + + LPBYTE iDst = GetBits(); + iDst[(m_bi.biHeight - dwY - 1) * m_dwLineWidth + dwX] = byI; +} // End of SetPixelIndex + +void CCeXDib::Clone(CCeXDib* src) +{ + Create(src->GetWidth(), src->GetHeight(), src->GetBitCount()); + if (m_hDib) memcpy(m_hDib, src->m_hDib, GetSize()); +} // End of Clone + +WORD CCeXDib::GetBitCount() +{ + return m_bi.biBitCount; +} // End of GetBitCount + +void CCeXDib::SetPaletteIndex(BYTE byIdx, BYTE byR, BYTE byG, BYTE byB) +{ + if (m_hDib && m_wColors) + { + LPBYTE iDst = (LPBYTE)(m_hDib) + sizeof(BITMAPINFOHEADER); + if ((byIdx >= 0) && (byIdx < m_wColors)) + { + long ldx = byIdx * sizeof(RGBQUAD); + iDst[ldx++] = (BYTE)byB; + iDst[ldx++] = (BYTE)byG; + iDst[ldx++] = (BYTE)byR; + iDst[ldx] = (BYTE)0; + } // if + } // if +} // End of SetPaletteIndex + +void CCeXDib::Draw(HDC hDC, DWORD dwX, DWORD dwY) +{ + HBITMAP hBitmap = NULL; + HBITMAP hOldBitmap = NULL; + HDC hMemDC = NULL; + + if (m_hBitmap == NULL) + { + m_hBitmap = CreateDIBSection(hDC, (BITMAPINFO*)m_hDib, DIB_RGB_COLORS, &m_lpBits, NULL, 0); + if (m_hBitmap == NULL) return; + if (m_lpBits == NULL) + { + ::DeleteObject(m_hBitmap); + m_hBitmap = NULL; + return; + } // if + } // if + + memcpy(m_lpBits, GetBits(), m_bi.biSizeImage); + + if (m_hMemDC == NULL) + { + m_hMemDC = CreateCompatibleDC(hDC); + if (m_hMemDC == NULL) return; + } // if + + hOldBitmap = (HBITMAP)SelectObject(m_hMemDC, m_hBitmap); + + BitBlt(hDC, dwX, dwY, m_bi.biWidth, m_bi.biHeight, m_hMemDC, 0, 0, SRCCOPY); + + SelectObject(m_hMemDC, hOldBitmap); +} // End of Draw + +void CCeXDib::SetGrayPalette() +{ + RGBQUAD pal[256]; + RGBQUAD* ppal; + LPBYTE iDst; + int ni; + + if (m_hDib == NULL || m_wColors == 0) return; + + ppal = (RGBQUAD*)&pal[0]; + iDst = (LPBYTE)(m_hDib) + sizeof(BITMAPINFOHEADER); + for (ni = 0; ni < m_wColors; ni++) + { + pal[ni] = RGB2RGBQUAD(RGB(ni,ni,ni)); + } // for + + pal[0] = RGB2RGBQUAD(RGB(0,0,0)); + pal[m_wColors-1] = RGB2RGBQUAD(RGB(255,255,255)); + + memcpy(iDst, ppal, GetPaletteSize()); +} // End of SetGrayPalette + +RGBQUAD CCeXDib::RGB2RGBQUAD(COLORREF cr) +{ + RGBQUAD c; + c.rgbRed = GetRValue(cr); /* get R, G, and B out of DWORD */ + c.rgbGreen = GetGValue(cr); + c.rgbBlue = GetBValue(cr); + c.rgbReserved=0; + return c; +} // End of RGB2RGBQUAD + +WORD CCeXDib::GetNumColors() +{ + return m_wColors; +} // End of GetNumColors + +BOOL CCeXDib::WriteBMP(LPCTSTR bmpFileName) +{ + BITMAPFILEHEADER hdr; + HANDLE hFile; + DWORD nByteWrite; + + if (*bmpFileName == _T('\0') || m_hDib == 0) return 0; + + hFile=CreateFile( // open if exist ini file + bmpFileName, // pointer to name of the file + GENERIC_WRITE, // access mode + 0, // share mode + NULL, // pointer to security descriptor + CREATE_ALWAYS, // how to create + FILE_ATTRIBUTE_NORMAL, // file attributes + NULL // handle to file with attributes to copy + ); + if (hFile == INVALID_HANDLE_VALUE) return FALSE; + + // Fill in the fields of the file header + hdr.bfType = BFT_BITMAP; + hdr.bfSize = GetSize() + sizeof(BITMAPFILEHEADER); + hdr.bfReserved1 = hdr.bfReserved2 = 0; + hdr.bfOffBits = (DWORD) sizeof(BITMAPFILEHEADER)+ + m_bi.biSize + GetPaletteSize(); + + // Write the file header + WriteFile( // write ini (sync mode <-> no overlapped) + hFile, // handle of file to write + (LPSTR) &hdr, // address of buffer that contains data + sizeof(BITMAPFILEHEADER), // number of bytes to write + &nByteWrite, // address of number of bytes written + NULL // address of structure for data + ); + + // Write the DIB header and the bits + WriteFile( // write ini (sync mode <-> no overlapped) + hFile, // handle of file to write + (LPSTR) m_hDib, // address of buffer that contains data + GetSize(), // number of bytes to write + &nByteWrite, // address of number of bytes written + NULL // address of structure for data + ); + + CloseHandle(hFile); // free file handle + + return TRUE; +} // End of WriteBMP diff --git a/Src/CH91PayloadSoftware/CeXDib.h b/Src/CH91PayloadSoftware/CeXDib.h new file mode 100644 index 0000000..b92c198 --- /dev/null +++ b/Src/CH91PayloadSoftware/CeXDib.h @@ -0,0 +1,96 @@ +// +// Class: CCeXDib +// +// Compiler: Visual C++ +// eMbedded Visual C++ +// Tested on: Visual C++ 6.0 +// Windows CE 3.0 +// +// Author: Davide Calabro' davide_calabro@yahoo.com +// http://www.softechsoftware.it +// +// Note: This class uses code snippets taken from a similar class written +// for the Win32 enviroment by Davide Pizzolato (ing.davide.pizzolato@libero.it) +// +// Disclaimer +// ---------- +// THIS SOFTWARE AND THE ACCOMPANYING FILES ARE DISTRIBUTED "AS IS" AND WITHOUT +// ANY WARRANTIES WHETHER EXPRESSED OR IMPLIED. NO REPONSIBILITIES FOR POSSIBLE +// DAMAGES OR EVEN FUNCTIONALITY CAN BE TAKEN. THE USER MUST ASSUME THE ENTIRE +// RISK OF USING THIS SOFTWARE. +// +// Terms of use +// ------------ +// THIS SOFTWARE IS FREE FOR PERSONAL USE OR FREEWARE APPLICATIONS. +// IF YOU USE THIS SOFTWARE IN COMMERCIAL OR SHAREWARE APPLICATIONS YOU +// ARE GENTLY ASKED TO DONATE 1$ (ONE U.S. DOLLAR) TO THE AUTHOR: +// +// Davide Calabro' +// P.O. Box 65 +// 21019 Somma Lombardo (VA) +// Italy +// +// +#ifndef _CEXDIB_H_ +#define _CEXDIB_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#ifndef HDIB +#define HDIB HANDLE +#endif + +#ifndef WIDTHBYTES +#define WIDTHBYTES(bits) (((bits) + 31) / 32 * 4) +#endif + +#ifndef BFT_BITMAP +#define BFT_BITMAP 0x4d42 // 'BM' +#endif + +class CCeXDib +{ +public: + CCeXDib(); + virtual ~CCeXDib(); + + HDIB Create(DWORD dwWidth, DWORD dwHeight, WORD wBitCount); + void Clone(CCeXDib* src); + void Draw(HDC hDC, DWORD dwX, DWORD dwY); + LPBYTE GetBits(); + void Clear(BYTE byVal = 0); + + void SetGrayPalette(); + void SetPaletteIndex(BYTE byIdx, BYTE byR, BYTE byG, BYTE byB); + void SetPixelIndex(DWORD dwX, DWORD dwY, BYTE byI); + void BlendPalette(COLORREF crColor, DWORD dwPerc); + + WORD GetBitCount(); + DWORD GetLineWidth(); + DWORD GetWidth(); + DWORD GetHeight(); + WORD GetNumColors(); + + BOOL WriteBMP(LPCTSTR bmpFileName); + +private: + void FreeResources(); + + DWORD GetPaletteSize(); + DWORD GetSize(); + + RGBQUAD RGB2RGBQUAD(COLORREF cr); + + HDIB m_hDib; + BITMAPINFOHEADER m_bi; + DWORD m_dwLineWidth; + WORD m_wColors; + + HBITMAP m_hBitmap; // Handle to bitmap + HDC m_hMemDC; // Handle to memory DC + LPVOID m_lpBits; // Pointer to actual bitmap bits +}; + +#endif diff --git a/Src/CH91PayloadSoftware/ComControlFunction.cpp b/Src/CH91PayloadSoftware/ComControlFunction.cpp new file mode 100644 index 0000000..596c527 --- /dev/null +++ b/Src/CH91PayloadSoftware/ComControlFunction.cpp @@ -0,0 +1,185 @@ +//功能:实现串口操作的一些函数 +#include "StdAfx.h" +#include "ComControlFunction.h" + +//查找系统可用的串口号,将所有的串口号保存在pPortList数组里 +//输出:串口数portNumber,串口号数组pPortList +//pPortList保存各串口的串口数字 +BOOL ScanPCCom( int *pPortList, int& portNumber ) +{ + portNumber = 0; //系统配置的串口总数 + + //扫描PC机存在的串口,从注册表读取存在的串口。 + UINT nComNum = 0; + HKEY hKEY = NULL; + LONG hResult = ::RegOpenKeyEx( HKEY_LOCAL_MACHINE, _T( "HARDWARE\\DEVICEMAP\\SERIALCOMM" ), 0, KEY_READ, &hKEY ); + + if ( hResult != ERROR_SUCCESS ) //如果无法打开hKEY,则中止程序的执行 + { + return FALSE; + } + + TCHAR strInf[30]; + memset( strInf, 0, sizeof( TCHAR ) * 30 ); + + DWORD type_1 = REG_SZ; + DWORD cbData_1 = 10; + DWORD aa = 30, num = 0; + DWORD a1 = 0, a2 = 0, a3 = 0, a4 = 0, a5 = 0, a6 = 0, a7 = 0; + + //hResult = ::RegQueryInfoKey( hKEY, strInf, &a7, NULL, &a3, &a1, &a2, &num, &a4, &a5, &a6, NULL ); + hResult = ::RegQueryInfoKeyA( hKEY, NULL, NULL, NULL, &a3, &a1, NULL, &num, &a4, &a5, NULL, NULL ); + if ( hResult != ERROR_SUCCESS ) + { + RegCloseKey( hKEY ); + return FALSE; + } + + BYTE portName[15]; + memset( portName, 0, 15 ); + + CString csr = _T( "" ); + + for ( DWORD i = 0 ; i < num ; ++i ) + { + aa = 30 ; + cbData_1 = 10; + hResult = ::RegEnumValue( hKEY, i, strInf, &aa, NULL, &type_1, portName, &cbData_1 ); + if ( hResult != ERROR_SUCCESS ) + { + continue; + } + csr.Format( _T( "%s" ), portName ); + + csr.Delete( 0, 3 ); + + pPortList[portNumber] = atoi( csr ); + + ++portNumber; //系统配置的串口总数 + + ++nComNum; + } + RegCloseKey( hKEY ); + return TRUE; +} + + +//判断串口是否被占有,串口可用返回true,否则返回false +bool OnCheckComPort( const CString& portName ) +{ + CString str = _T( "//./" ) + portName; + HANDLE hCom = CreateFile( str, //打开串口1 + GENERIC_READ | GENERIC_WRITE, //允许读和写操作 + 0, //独占方式 + 0, OPEN_EXISTING, //打开一个存在的串口 + 0, 0 ); + + + if ( hCom == INVALID_HANDLE_VALUE ) //打开串口失败 + { + return false; + } + else + { + CloseHandle( hCom ); + hCom = NULL; + return true; + } +} + + +//判断串口是否为空 +//串口为空返回true,否则返回false +bool CheckComPortIsEmpty( const CString strPort ) +{ + if ( strPort.Compare( _T( "" ) ) == 0 ) + { + return true; + } + return false; +} + +//功能:检测2个串口是否相同,相同返回True,否则返回false +bool CompareTwoComPort( const CString port1, const CString port2 ) +{ + if ( ( port1.Compare( port2 ) ) == 0 ) + { + return true; + } + else + { + return false; + } +} + +//判断串口是否可用 +//可用返回true,否则返回false +bool CheckComPortCanWork( const CString strPort ) +{ + if ( strPort.GetLength() <= 4 ) + { + return false; + } + + CString str = strPort; + str.Delete( 0, 4 ); //删除“串口”字符 + + CString strSelectCom = _T( "" ); + strSelectCom.Format( "COM%d", atoi( str ) ); + + if ( !OnCheckComPort( strSelectCom ) ) //串口被占用,返回false + { + return false; + } + else //串口可用,返回true + { + return true; + } +} + +//判断串口名称是否正确,正确的名称为“串口XX”——前面为“串口”,后面为数字 +//串口名称正确返回true, 否则返回false +bool CheckComPortName( const CString strPort ) +{ + if ( strPort.GetLength() < 5 ) + { + return false; + } + CString str = strPort; + + if ( str.Left( 4 ) != _T( "串口" ) ) + { + return false; + } + str = strPort; + str.Delete( 0, 4 ); + + for ( int i = 0; i < str.GetLength(); ++i ) + { + if ( ( str.GetAt( i ) < '0' ) || ( str.GetAt( i ) > '9' ) ) + { + return false; + } + } + + return true; +} +//从串口数组中进行查找,查找出配置文件设置的串口号 +//输入:数组portArray,数组长度arrLength,查找元素itemValue +//输出:元素的位置pos +//返回值:查找成功返回true,否则返回false +bool FindItemFromComList( int& pos, const int *portArray, const int& arrLength, const int& itemValue ) +{ + for ( int i = 0; i < arrLength; ++i ) + { + if ( itemValue == portArray[i] ) + { + pos = i; + return true; + } + } + + return false; +} + + diff --git a/Src/CH91PayloadSoftware/ComControlFunction.h b/Src/CH91PayloadSoftware/ComControlFunction.h new file mode 100644 index 0000000..c55fad4 --- /dev/null +++ b/Src/CH91PayloadSoftware/ComControlFunction.h @@ -0,0 +1,41 @@ +//功能:实现串口操作的一些函数 + + +#ifndef COM_CONTROL_FUNCTION_H +#define COM_CONTROL_FUNCTION_H + + +//查找系统可用的串口号,将所有的串口号保存在pPortList数组里 +//输出:串口数portNumber,串口号数组pPortList +//pPortList保存各串口的串口数字 +extern BOOL ScanPCCom( int *pPortList, int& portNumber ); + +//判断串口是否被占有,串口可用返回true,否则返回false +extern bool OnCheckComPort( const CString& portName ); + + +//功能:检测2个串口是否相同,相同返回True,否则返回false +extern bool CompareTwoComPort( const CString port1, const CString port2 ); + +//判断串口是否可用 +//可用返回true,否则返回false +extern bool CheckComPortCanWork( const CString strPort ); + +//判断串口是否为空 +//串口为空返回true,否则返回false +extern bool CheckComPortIsEmpty( const CString strPort ); + +//判断串口名称是否正确,正确的名称为“串口XX” +//串口名称正确返回true, 否则返回false +extern bool CheckComPortName( const CString strPort ); + +//从串口数组中进行查找,查找出配置文件设置的串口号 +//输入:数组portArray,数组长度arrLength,查找元素itemValue +//输出:元素的位置pos +//返回值:查找成功返回true,否则返回false +extern bool FindItemFromComList( int& pos, const int *portArray, const int& arrLength, const int& itemValue ); + + +const int MaxComPortNumber = 1024; + +#endif \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/ControlDlgFH96Page1.cpp b/Src/CH91PayloadSoftware/ControlDlgFH96Page1.cpp new file mode 100644 index 0000000..13ee0a1 --- /dev/null +++ b/Src/CH91PayloadSoftware/ControlDlgFH96Page1.cpp @@ -0,0 +1,475 @@ +// ControlDlgFH96Page1.cpp : 实现文件 +// + +#include "stdafx.h" +#include "CH91PayloadSoftware.h" +#include "ControlDlgFH96Page1.h" +#include "afxdialogex.h" +#include "Global.h" +#include "GlobalMember.h" +#include "GlobalMessage.h" + +// CControlDlgFH96Page1 对话框 + +IMPLEMENT_DYNAMIC(CControlDlgFH96Page1, CDialogEx) + +CControlDlgFH96Page1::CControlDlgFH96Page1(CWnd* pParent /*=NULL*/) + : CDialogEx(CControlDlgFH96Page1::IDD, pParent) +{ + // 数引变量初始化 + m_Guide_Pitch = -90; + m_Guide_Azimuth = 0; +} + +CControlDlgFH96Page1::~CControlDlgFH96Page1() +{ +} + +void CControlDlgFH96Page1::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Control(pDX, IDC_EDIT_GUIDE_AZIMUTH_FH96, str_Guide_Azimuth); + DDX_Control(pDX, IDC_EDIT_GUIDE_PITCH_FH96, str_Guide_Pitch); + DDX_Text(pDX, IDC_EDIT_GUIDE_AZIMUTH_FH96, m_Guide_Azimuth); + DDX_Text(pDX, IDC_EDIT_GUIDE_PITCH_FH96, m_Guide_Pitch); +} + + +BEGIN_MESSAGE_MAP(CControlDlgFH96Page1, CDialogEx) + ON_MESSAGE(WM_SHOW_MAP_GUIDE_POS, CControlDlgFH96Page1::ShowMapZHGuide) +END_MESSAGE_MAP() + + +// CControlDlgFH96Page1 消息处理程序 + +BOOL CControlDlgFH96Page1::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + // 获取句柄 + g_CH96CtrlDlgHwnd = GetSafeHwnd(); + // 关联发送指令&&手动控制显示 + CRect rc_SendCommandControl; + GetDlgItem(IDC_STATIC_MANUALSLEW_FH96)->GetWindowRect(rc_SendCommandControl); + ScreenToClient(rc_SendCommandControl); + m_SendControlCommandDlg = new CSendControlCommand(); + if (m_SendControlCommandDlg != NULL) + { + m_SendControlCommandDlg->Create(IDD_DLG_SENDCONTROLCOMMAND, this); + } + m_SendControlCommandDlg->MoveWindow(&rc_SendCommandControl); + m_SendControlCommandDlg->ShowWindow(SW_SHOW); + // 设置对话框界面 + DlgStyleSet(); + return TRUE; // return TRUE unless you set the focus to a control + // 异常: OCX 属性页应返回 FALSE +} + +// 获取载荷控制指令 +int CControlDlgFH96Page1::GetPayloadCtrlProtocol() +{ + return g_payloadCtrlProtocol; +} + +// 设置载荷控制指令 +void CControlDlgFH96Page1::SetPayloadCtrlProtocol(int Protocol) +{ + g_payloadCtrlProtocol = Protocol; +} + +// 地图载荷导引显示函数 +LRESULT CControlDlgFH96Page1::ShowMapZHGuide(WPARAM wParam, LPARAM lParam) +{ + m_Guide_Azimuth = int(g_Guide_Azimuth * 100) * 0.01f; + m_Guide_Pitch = int(g_Guide_Pitch * 100) * 0.01f; + UpdateData(FALSE); + // 数引 + SetPayloadCtrlProtocol(4); + g_sCtrlInstruction = "数引"; + g_Guide_Azimuth = m_Guide_Azimuth; + g_Guide_Pitch = m_Guide_Pitch; + g_bMapDirectGuide = TRUE; // 是否是地图直接导引的标志位 + return 0; +} + + +BOOL CControlDlgFH96Page1::PreTranslateMessage(MSG* pMsg) +{ + // 键盘消息 + if (pMsg->message == WM_KEYDOWN) + { + // 忽略ESC和回车键 + if (pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_RETURN) + { + return TRUE; + } + } + //如果左键按下,则发送数据(按下、重复类) + if (pMsg->message == WM_LBUTTONDOWN) + { + g_bCtrlFromSoftware = TRUE; + // 速度配置——重复 + if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_SPEEDCONFIG_FH96)) + { + g_payloadCtrlProtocol = 1; + } + // 锁定模式 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_LOCKMODE_FH96)) + { + g_payloadCtrlProtocol = 2; + } + // 扫描模式 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_SCANMODE_FH96)) + { + g_payloadCtrlProtocol = 3; + } + // 数字引导模式——抬起 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_DIGITALBOOTMODE_FH96)) + { + // 如果输入的内容为空或者只有1负号,则值为零 + CString _Azimuth; + CString _Pitch; + GetDlgItem(IDC_EDIT_GUIDE_AZIMUTH_FH96)->GetWindowText(_Azimuth); + GetDlgItem(IDC_EDIT_GUIDE_PITCH_FH96)->GetWindowText(_Pitch); + if (_Azimuth == "" || _Azimuth == "-" ) + { + GetDlgItem(IDC_EDIT_GUIDE_AZIMUTH_FH96)->SetWindowText("0"); + } + if (_Pitch == "" || _Pitch == "-") + { + GetDlgItem(IDC_EDIT_GUIDE_PITCH_FH96)->SetWindowText("-90"); + } + UpdateData(TRUE); + if (m_Guide_Azimuth <=180 && m_Guide_Azimuth >= -180 && m_Guide_Pitch <= 10 && m_Guide_Pitch >= -110) + { + g_Guide_Azimuth = m_Guide_Azimuth; + g_Guide_Pitch = m_Guide_Pitch; + g_payloadCtrlProtocol = 4; + } + else + { + GetDlgItem(IDC_EDIT_GUIDE_AZIMUTH_FH96)->SetWindowText("0"); + GetDlgItem(IDC_EDIT_GUIDE_PITCH_FH96)->SetWindowText("-90"); + MessageBox(_T("请输入正确范围内的角度!")); + } + } + // 平台复位——抬起 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_TURRETRESET_FH96)) + { + g_payloadCtrlProtocol = 5; + } + //补漂方位-——重复 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_COMPENSATEDRIFT_AZUMITHMINUS_FH96)) + { + g_payloadCtrlProtocol = 6; + } + //补漂方位+——重复 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_COMPENSATEDRIFT_AZUMITHADD_FH96)) + { + g_payloadCtrlProtocol = 7; + } + //补漂俯仰-——重复 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_COMPENSATEDRIFT_PITCHMINUS_FH96)) + { + g_payloadCtrlProtocol = 8; + } + //补漂俯仰+——重复 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_COMPENSATEDRIFT_PITCHADD_FH96)) + { + g_payloadCtrlProtocol = 9; + } + // 手动模式——抬起 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_MANUALMODE_FH96)) + { + g_payloadCtrlProtocol = 10; + } + // 跟踪模式——抬起 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_TRACKMODE_FH96)) + { + g_payloadCtrlProtocol = 11; + } + // 红外白热——抬起 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_IRWH_FH96)) + { + g_payloadCtrlProtocol = 12; + } + // 红外黑热——抬起 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_IRBH_FH96)) + { + g_payloadCtrlProtocol = 13; + } + //焦距+——重复 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_FOCUSADD_FH96)) + { + g_payloadCtrlProtocol = 14; + } + //焦距-——重复 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_FOCUSMINUS_FH96)) + { + g_payloadCtrlProtocol = 15; + } + // 红外小视场——抬起 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_IRFOVMINUS_FH96)) + { + g_payloadCtrlProtocol = 16; + } + // 红外大视场——抬起 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_IRFOVADD_FH96)) + { + g_payloadCtrlProtocol = 17; + } + // OSD ON/OFF——抬起 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_OSDON_FH96)) + { + g_payloadCtrlProtocol = 18; + } + // 图像切换——抬起 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_IMGSWITCH_FH96)) + { + g_payloadCtrlProtocol = 19; + } + // 画中画开——抬起 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_PIPON_FH96)) + { + g_payloadCtrlProtocol = 20; + } + // 画中画关——抬起 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_PIPOFF_FH96)) + { + g_payloadCtrlProtocol = 21; + } + // 图像稳定关——抬起 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_IMGSTABLIZEOFF_FH96)) + { + g_payloadCtrlProtocol = 22; + } + // 图像稳定开——抬起 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_IMGSTABLIZEON_FH96)) + { + g_payloadCtrlProtocol = 23; + } + //可见光透雾1——重复 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_DEFOGONE_FH96)) + { + g_payloadCtrlProtocol = 24; + } + //可见光透雾2——重复 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_DEFOGTWO_FH96)) + { + g_payloadCtrlProtocol = 25; + } + //可见光透雾3——重复 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_DEFOGTHREE_FH96)) + { + g_payloadCtrlProtocol = 26; + } + //可见光透雾关——重复 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_DEFOGOFF_FH96)) + { + g_payloadCtrlProtocol = 27; + } + //开始连续照相 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_CONTINUOUSSHOOT_FH96)) + { + g_payloadCtrlProtocol = 28; + } + //停止照相 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_STOPSHOOT_FH96)) + { + g_payloadCtrlProtocol = 29; + } + //拍一张照 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_SINGLESHOOT_FH96)) + { + g_payloadCtrlProtocol = 30; + } + //激光测距开 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_LASERRANGINGON_FH96)) + { + g_payloadCtrlProtocol = 31; + } + //激光测距关 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_LASERRANGINGOFF_FH96)) + { + g_payloadCtrlProtocol = 32; + } + //激光电源开 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_LASERPOWERON_FH96)) + { + g_payloadCtrlProtocol = 33; + } + //激光电源关 + else if (WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_BTN_LASERPOWEROFF_FH96)) + { + g_payloadCtrlProtocol = 34; + } + else + { + + } + } + else if (pMsg->message == WM_LBUTTONUP) // 如果左键抬起,则发送数据(抬起类) + { + g_payloadCtrlProtocol = 0; + g_bCtrlFromSoftware = FALSE; + // 发送消息,将焦点置于主界面 + if(WindowFromPoint(pMsg->pt) != GetDlgItem(IDC_EDIT_GUIDE_AZIMUTH_FH96) && WindowFromPoint(pMsg->pt) != GetDlgItem(IDC_EDIT_GUIDE_PITCH_FH96)) + { + ::PostMessage(g_mainDlgHwnd, WM_SETFOCUS_AFTERCONTROL, 0, 0); + } + } + return CDialogEx::PreTranslateMessage(pMsg); +} + +void CControlDlgFH96Page1::OnDestroy() +{ + CDialogEx::OnDestroy(); + + // 停止发送控制指令 + if (true == g_bCreatUDP) + { + g_UdpSend2Payload.SetCallBack(NULL, nullptr); + g_UdpSend2Payload.StopListening(); + } +} + +// 设置对话框界面 +void CControlDlgFH96Page1::DlgStyleSet() +{ + //速度配置 + m_Btn_SpeedConfig.SubclassDlgItem(IDC_BTN_SPEEDCONFIG_FH96, this); + m_Btn_SpeedConfig.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_SpeedConfig.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + // 锁定模式 + m_Btn_LockMode.SubclassDlgItem(IDC_BTN_LOCKMODE_FH96, this); + m_Btn_LockMode.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_LockMode.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + // 扫描模式 + m_Btn_ScanMode.SubclassDlgItem(IDC_BTN_SCANMODE_FH96, this); + m_Btn_ScanMode.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_ScanMode.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + // 平台复位 + m_Btn_TurretReset.SubclassDlgItem(IDC_BTN_TURRETRESET_FH96, this); + m_Btn_TurretReset.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_TurretReset.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + // 补漂方位- + m_Btn_CompensateDrift_AzumithMinus.SubclassDlgItem(IDC_BTN_COMPENSATEDRIFT_AZUMITHMINUS_FH96, this); + m_Btn_CompensateDrift_AzumithMinus.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_CompensateDrift_AzumithMinus.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + // 补漂方位+ + m_Btn_CompensateDrift_AzumithAdd.SubclassDlgItem(IDC_BTN_COMPENSATEDRIFT_AZUMITHADD_FH96, this); + m_Btn_CompensateDrift_AzumithAdd.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_CompensateDrift_AzumithAdd.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + // 补漂俯仰- + m_Btn_CompensateDrift_PitchMinus.SubclassDlgItem(IDC_BTN_COMPENSATEDRIFT_PITCHMINUS_FH96, this); + m_Btn_CompensateDrift_PitchMinus.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_CompensateDrift_PitchMinus.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + // 补漂俯仰+ + m_Btn_CompensateDrift_PitchAdd.SubclassDlgItem(IDC_BTN_COMPENSATEDRIFT_PITCHADD_FH96, this); + m_Btn_CompensateDrift_PitchAdd.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_CompensateDrift_PitchAdd.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + // 手动模式 + m_Btn_ManualMode.SubclassDlgItem(IDC_BTN_MANUALMODE_FH96, this); + m_Btn_ManualMode.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_ManualMode.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + // 跟踪模式 + m_Btn_TrackMode.SubclassDlgItem(IDC_BTN_TRACKMODE_FH96, this); + m_Btn_TrackMode.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_TrackMode.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + // 红外白热 + m_Btn_IRWH.SubclassDlgItem(IDC_BTN_IRWH_FH96, this); + m_Btn_IRWH.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_IRWH.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + // 红外黑热 + m_Btn_IRBH.SubclassDlgItem(IDC_BTN_IRBH_FH96, this); + m_Btn_IRBH.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_IRBH.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //焦距+ + m_Btn_FocusAdd.SubclassDlgItem(IDC_BTN_FOCUSADD_FH96, this); + m_Btn_FocusAdd.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_FocusAdd.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //焦距- + m_Btn_FocusMinus.SubclassDlgItem(IDC_BTN_FOCUSMINUS_FH96, this); + m_Btn_FocusMinus.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_FocusMinus.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //红外小视场 + m_Btn_IRFOVMinus.SubclassDlgItem(IDC_BTN_IRFOVMINUS_FH96, this); + m_Btn_IRFOVMinus.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_IRFOVMinus.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //红外大视场 + m_Btn_IRFOVAdd.SubclassDlgItem(IDC_BTN_IRFOVADD_FH96, this); + m_Btn_IRFOVAdd.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_IRFOVAdd.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //OSD ON/OFF + m_Btn_OSDON.SubclassDlgItem(IDC_BTN_OSDON_FH96, this); + m_Btn_OSDON.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_OSDON.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //图像切换 + m_Btn_ImgSwitch.SubclassDlgItem(IDC_BTN_IMGSWITCH_FH96, this); + m_Btn_ImgSwitch.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_ImgSwitch.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //画中画开 + m_Btn_PIPON.SubclassDlgItem(IDC_BTN_PIPON_FH96, this); + m_Btn_PIPON.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_PIPON.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //画中画关 + m_Btn_PIPOFF.SubclassDlgItem(IDC_BTN_PIPOFF_FH96, this); + m_Btn_PIPOFF.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_PIPOFF.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //图像稳定关 + m_Btn_ImgStablizeOFF.SubclassDlgItem(IDC_BTN_IMGSTABLIZEOFF_FH96, this); + m_Btn_ImgStablizeOFF.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_ImgStablizeOFF.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //图像稳定开 + m_Btn_ImgStablizeON.SubclassDlgItem(IDC_BTN_IMGSTABLIZEON_FH96, this); + m_Btn_ImgStablizeON.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_ImgStablizeON.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //可见光透雾1 + m_Btn_DEFOGOne.SubclassDlgItem(IDC_BTN_DEFOGONE_FH96, this); + m_Btn_DEFOGOne.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_DEFOGOne.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //可见光透雾2 + m_Btn_DEFOGTwo.SubclassDlgItem(IDC_BTN_DEFOGTWO_FH96, this); + m_Btn_DEFOGTwo.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_DEFOGTwo.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //可见光透雾3 + m_Btn_DEFOGThree.SubclassDlgItem(IDC_BTN_DEFOGTHREE_FH96, this); + m_Btn_DEFOGThree.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_DEFOGThree.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //可见光透雾关 + m_Btn_DEFOGOFF.SubclassDlgItem(IDC_BTN_DEFOGOFF_FH96, this); + m_Btn_DEFOGOFF.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_DEFOGOFF.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //开始连续照相 + m_Btn_ContinuousShoot.SubclassDlgItem(IDC_BTN_CONTINUOUSSHOOT_FH96, this); + m_Btn_ContinuousShoot.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_ContinuousShoot.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //停止照相 + m_Btn_StopShoot.SubclassDlgItem(IDC_BTN_STOPSHOOT_FH96, this); + m_Btn_StopShoot.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_StopShoot.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //拍一张照 + m_Btn_SingleShoot.SubclassDlgItem(IDC_BTN_SINGLESHOOT_FH96, this); + m_Btn_SingleShoot.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_SingleShoot.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //激光测距开 + m_Btn_LaserRangingON.SubclassDlgItem(IDC_BTN_LASERRANGINGON_FH96, this); + m_Btn_LaserRangingON.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_LaserRangingON.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //激光测距关 + m_Btn_LaserRangingOFF.SubclassDlgItem(IDC_BTN_LASERRANGINGOFF_FH96, this); + m_Btn_LaserRangingOFF.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_LaserRangingOFF.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //激光电源开 + m_Btn_LaserPowerON.SubclassDlgItem(IDC_BTN_LASERPOWERON_FH96, this); + m_Btn_LaserPowerON.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_LaserPowerON.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //激光电源关 + m_Btn_LaserPowerOFF.SubclassDlgItem(IDC_BTN_LASERPOWEROFF_FH96, this); + m_Btn_LaserPowerOFF.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_LaserPowerOFF.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + //数字引导 + m_Btn_DigitalBootMode.SubclassDlgItem(IDC_BTN_DIGITALBOOTMODE_FH96, this); + m_Btn_DigitalBootMode.SetShade(CShadeButtonST::SHS_METAL); + m_Btn_DigitalBootMode.SetColor(CButtonST::BTNST_COLOR_FG_IN, RGB(29, 191, 151)); + +} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/ControlDlgFH96Page1.h b/Src/CH91PayloadSoftware/ControlDlgFH96Page1.h new file mode 100644 index 0000000..5c80f83 --- /dev/null +++ b/Src/CH91PayloadSoftware/ControlDlgFH96Page1.h @@ -0,0 +1,78 @@ +#pragma once + +#include "afxwin.h" +#include "afxcmn.h" +#include "ShadeButtonST.h" +#include "SendControlCommand.h" +#include "EditInput.h" +// CControlDlgFH96Page1 对话框 + +class CControlDlgFH96Page1 : public CDialogEx +{ + DECLARE_DYNAMIC(CControlDlgFH96Page1) + +public: + CControlDlgFH96Page1(CWnd* pParent = NULL); // 标准构造函数 + virtual ~CControlDlgFH96Page1(); + +// 对话框数据 + enum { IDD = IDD_DLG_CONTROL_96_1 }; +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + DECLARE_MESSAGE_MAP() + +private: + CSendControlCommand* m_SendControlCommandDlg; +public: + virtual BOOL OnInitDialog(); + void SetPayloadCtrlProtocol(int Protocol); + int GetPayloadCtrlProtocol(); + void DlgStyleSet(); + BOOL PreTranslateMessage(MSG* pMsg); + void OnDestroy(); + // 地图载荷导引显示函数 + LRESULT ShowMapZHGuide(WPARAM wParam, LPARAM lParam); + +//指令 +public: + CShadeButtonST m_Btn_SpeedConfig; //速度配置 + CShadeButtonST m_Btn_LockMode; // 锁定模式 + CShadeButtonST m_Btn_ScanMode; // 扫描模式 + CShadeButtonST m_Btn_TurretReset; // 平台复位 + CShadeButtonST m_Btn_CompensateDrift_AzumithMinus; // 补漂方位- + CShadeButtonST m_Btn_CompensateDrift_AzumithAdd; // 补漂方位+ + CShadeButtonST m_Btn_CompensateDrift_PitchMinus; // 补漂俯仰- + CShadeButtonST m_Btn_CompensateDrift_PitchAdd; // 补漂俯仰+ + CShadeButtonST m_Btn_ManualMode; // 手动模式 + CShadeButtonST m_Btn_TrackMode; // 跟踪模式 + CShadeButtonST m_Btn_IRWH; // 红外白热 + CShadeButtonST m_Btn_IRBH; // 红外黑热 + CShadeButtonST m_Btn_FocusAdd; //焦距+ + CShadeButtonST m_Btn_FocusMinus; //焦距- + CShadeButtonST m_Btn_IRFOVMinus; //红外小视场 + CShadeButtonST m_Btn_IRFOVAdd; //红外大视场 + CShadeButtonST m_Btn_OSDON; //OSD ON/OFF + CShadeButtonST m_Btn_ImgSwitch; //图像切换 + CShadeButtonST m_Btn_PIPON; //画中画开 + CShadeButtonST m_Btn_PIPOFF; //画中画关 + CShadeButtonST m_Btn_ImgStablizeOFF; //图像稳定关 + CShadeButtonST m_Btn_ImgStablizeON; //图像稳定开 + CShadeButtonST m_Btn_DEFOGOne; //可见光透雾1 + CShadeButtonST m_Btn_DEFOGTwo; //可见光透雾2 + CShadeButtonST m_Btn_DEFOGThree; //可见光透雾3 + CShadeButtonST m_Btn_DEFOGOFF; //可见光透雾关 + CShadeButtonST m_Btn_ContinuousShoot; //开始连续照相 + CShadeButtonST m_Btn_StopShoot; //停止照相 + CShadeButtonST m_Btn_SingleShoot; //拍一张照 + CShadeButtonST m_Btn_LaserRangingON; //激光测距开 + CShadeButtonST m_Btn_LaserRangingOFF; // 激光测距关 + CShadeButtonST m_Btn_LaserPowerON; // 激光电源开 + CShadeButtonST m_Btn_LaserPowerOFF; // 激光电源关 + CShadeButtonST m_Btn_DigitalBootMode; // 数字引导模式 + // 主界面数引控制 + CEditInput str_Guide_Azimuth; //方位角 + CEditInput str_Guide_Pitch; //俯仰角 + float m_Guide_Azimuth; //方位角 + float m_Guide_Pitch; //俯仰角 +}; diff --git a/Src/CH91PayloadSoftware/ControlDlgFH96Page2.cpp b/Src/CH91PayloadSoftware/ControlDlgFH96Page2.cpp new file mode 100644 index 0000000..24344a7 --- /dev/null +++ b/Src/CH91PayloadSoftware/ControlDlgFH96Page2.cpp @@ -0,0 +1,36 @@ +// ControlDlgFH96Page2.cpp : 实现文件 +// + +#include "stdafx.h" +#include "CH91PayloadSoftware.h" +#include "ControlDlgFH96Page2.h" +#include "afxdialogex.h" +#include "Global.h" +#include "GlobalMember.h" +#include "GlobalMessage.h" + +// CControlDlgFH96Page2 对话框 + +IMPLEMENT_DYNAMIC(CControlDlgFH96Page2, CDialogEx) + +CControlDlgFH96Page2::CControlDlgFH96Page2(CWnd* pParent /*=NULL*/) + : CDialogEx(CControlDlgFH96Page2::IDD, pParent) +{ + +} + +CControlDlgFH96Page2::~CControlDlgFH96Page2() +{ +} + +void CControlDlgFH96Page2::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CControlDlgFH96Page2, CDialogEx) +END_MESSAGE_MAP() + + +// CControlDlgFH96Page2 消息处理程序 diff --git a/Src/CH91PayloadSoftware/ControlDlgFH96Page2.h b/Src/CH91PayloadSoftware/ControlDlgFH96Page2.h new file mode 100644 index 0000000..5b1fdc2 --- /dev/null +++ b/Src/CH91PayloadSoftware/ControlDlgFH96Page2.h @@ -0,0 +1,24 @@ +#pragma once + +#include "afxwin.h" +#include "afxcmn.h" +#include "ShadeButtonST.h" +#include "SendControlCommand.h" +// CControlDlgFH96Page2 对话框 + +class CControlDlgFH96Page2 : public CDialogEx +{ + DECLARE_DYNAMIC(CControlDlgFH96Page2) + +public: + CControlDlgFH96Page2(CWnd* pParent = NULL); // 标准构造函数 + virtual ~CControlDlgFH96Page2(); + +// 对话框数据 + enum { IDD = IDD_DLG_CONTROL_96_2 }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + DECLARE_MESSAGE_MAP() +}; diff --git a/Src/CH91PayloadSoftware/DCFrameCkCmd.h b/Src/CH91PayloadSoftware/DCFrameCkCmd.h new file mode 100644 index 0000000..ff3b117 --- /dev/null +++ b/Src/CH91PayloadSoftware/DCFrameCkCmd.h @@ -0,0 +1,214 @@ +#ifndef _CDCFrameCkCmdFrame_ +#define _CDCFrameCkCmdFrame_ + +//数据注入指令从控发送数据协议 + +#pragma once +//#include "framelib/basetype.h" +//#include "framelib/DataInject.h" +#pragma pack(1) + +typedef struct struProtocalDataInject_DC +{ + UINT8 DCtype; //吊舱类型 + union + { + struct + { + UINT8 SwitchCmd; //开关指令 + INT16 param1; //参数1 + INT16 param2; //参数2 + UINT8 reserve[9]; //保留 + }DC_13Ins;//13所吊舱控制指令 + struct + { + BYTE param; //参数 + BYTE param2; //参数 + BYTE param3; //参数 + BYTE param4; //参数 + BYTE param5; //参数 + BYTE param6; //参数 + BYTE param7; //参数 + BYTE param8; //参数 + BYTE param9; //参数 + BYTE param10; //参数 + BYTE param11; //参数 + BYTE param12; //参数 + BYTE param13; //参数 + BYTE param14; //参数 + }DC_WHTJ; //天进吊舱控制指令 + BYTE DataIn[14];//14个字节 + }; +}ProtocalDataInject_DC; + +typedef struct struDataInject_DC +{ + UINT8 DCtype; //吊舱类型 + union + { + struct + { + UINT8 SwitchCmd; //开关指令 + double param1; //参数1 + double param2; //参数2 + UINT8 reserve[9]; //保留 + }DC_13Ins;//13所吊舱控制指令 + struct + { + BYTE param; //参数 + BYTE param2; //参数 + BYTE param3; //参数 + BYTE param4; //参数 + BYTE param5; //参数 + BYTE param6; //参数 + BYTE param7; //参数 + BYTE param8; //参数 + BYTE param9; //参数 + BYTE param10; //参数 + BYTE param11; //参数 + BYTE param12; //参数 + BYTE param13; //参数 + BYTE param14; //参数 + }DC_WHTJ;//天进吊舱控制指令 + BYTE DC_Data[14];//14个字节 + }; +}DataInject_DC; + + +//数据注入指令从控发送数据帧---13所吊舱 +typedef struct struDCFrameCkCmd +{ + UINT8 FrameHead[2]; //帧头EB 90 + UINT8 fcode; //数据注入指令码 + ProtocalDataInject_DC protocalDataInject_DC; + UINT16 crc16; //校验位 +}DCFrameCkCmd; + + +#pragma pack() +//数据结构体 +typedef struct struDCFrameCkCmdData +{ + UINT8 fcode; //数据注入指令码 + DataInject_DC dataInject_DC; + UINT16 crc16; //校验位 +}DCFrameCkCmdData; +#pragma pack() + +class CDCFrameCkCmdFrame : public CFrameAbstract +{ +public: + DCFrameCkCmdData Data; +public: + CDCFrameCkCmdFrame() + { + //具体数据长度 + _tcscpy(Name, _T("DateInject_CK_DC"));//数据注入 从控 吊舱 + FrameLength = 20; + HeadLength = 2; + Head[0] = 0xEB; + Head[1] = 0x90; + memcpy(Addr(), Head, HeadLength);//把Head的第一位到HeadLength位的值赋值给Addr() + CheckLength = 2; + CheckPos = FrameLength - 2; + FrameType = ftFKu; + memset(&Data,0,sizeof(DCFrameCkCmdData));//将Data中的数据全都初始化为0 + } + + virtual ~CDCFrameCkCmdFrame(){} + virtual void Encode() + { + DCFrameCkCmd *pBuff = (DCFrameCkCmd*) Addr(); + pBuff->fcode = Data.fcode; + pBuff->protocalDataInject_DC.DCtype = Data.dataInject_DC.DCtype; + switch(Data.dataInject_DC.DCtype) + { + case 0x01: + pBuff->protocalDataInject_DC.DC_13Ins.SwitchCmd = Data.dataInject_DC.DC_13Ins.SwitchCmd; + pBuff->protocalDataInject_DC.DC_13Ins.param1 = Data.dataInject_DC.DC_13Ins.param1; + pBuff->protocalDataInject_DC.DC_13Ins.param2 = Data.dataInject_DC.DC_13Ins.param2; + memset(&(pBuff->protocalDataInject_DC.DC_13Ins.reserve),0,sizeof(pBuff->protocalDataInject_DC.DC_13Ins.reserve)); + break; + case 0x02: + pBuff->protocalDataInject_DC.DC_WHTJ.param = Data.dataInject_DC.DC_WHTJ.param; + pBuff->protocalDataInject_DC.DC_WHTJ.param2 = Data.dataInject_DC.DC_WHTJ.param2; + pBuff->protocalDataInject_DC.DC_WHTJ.param3 = Data.dataInject_DC.DC_WHTJ.param3; + pBuff->protocalDataInject_DC.DC_WHTJ.param4 = Data.dataInject_DC.DC_WHTJ.param4; + pBuff->protocalDataInject_DC.DC_WHTJ.param5 = Data.dataInject_DC.DC_WHTJ.param5; + pBuff->protocalDataInject_DC.DC_WHTJ.param6 = Data.dataInject_DC.DC_WHTJ.param6; + pBuff->protocalDataInject_DC.DC_WHTJ.param7 = Data.dataInject_DC.DC_WHTJ.param7; + pBuff->protocalDataInject_DC.DC_WHTJ.param8 = Data.dataInject_DC.DC_WHTJ.param8; + pBuff->protocalDataInject_DC.DC_WHTJ.param9 = Data.dataInject_DC.DC_WHTJ.param9; + pBuff->protocalDataInject_DC.DC_WHTJ.param10 = Data.dataInject_DC.DC_WHTJ.param10; + pBuff->protocalDataInject_DC.DC_WHTJ.param11 = Data.dataInject_DC.DC_WHTJ.param11; + pBuff->protocalDataInject_DC.DC_WHTJ.param12 = Data.dataInject_DC.DC_WHTJ.param12; + pBuff->protocalDataInject_DC.DC_WHTJ.param13 = Data.dataInject_DC.DC_WHTJ.param13; + pBuff->protocalDataInject_DC.DC_WHTJ.param14 = Data.dataInject_DC.DC_WHTJ.param14; + break; + default: + break; + } + /* + switch(Data.fcode) + { + case 0x70: + if(Data.details.DataZ70.DCtype == 0x01){ + EncodeUZ70( &( pBuff->details ),&( Data.details )); + } + if(Data.details.DataZ70_TJDC.DCTpye == 0x02){ + EncodeUZ70_TJDC( &( pBuff->details ),&( Data.details )); + } + break; + default: + break; + } + */ + } + virtual void Decode() + { + DCFrameCkCmd *pBuff = (DCFrameCkCmd*) Addr(); + Data.fcode = pBuff->fcode; + Data.dataInject_DC.DCtype = pBuff->protocalDataInject_DC.DCtype; + switch(pBuff->protocalDataInject_DC.DCtype) + { + case 0x01: + Data.dataInject_DC.DC_13Ins.SwitchCmd = pBuff->protocalDataInject_DC.DC_13Ins.SwitchCmd; + Data.dataInject_DC.DC_13Ins.param1 = pBuff->protocalDataInject_DC.DC_13Ins.param1; + Data.dataInject_DC.DC_13Ins.param2 = pBuff->protocalDataInject_DC.DC_13Ins.param2; + memset(&(Data.dataInject_DC.DC_13Ins.reserve),0,sizeof(Data.dataInject_DC.DC_13Ins.reserve)); + break; + case 0x02: + Data.dataInject_DC.DC_WHTJ.param = pBuff->protocalDataInject_DC.DC_WHTJ.param; + Data.dataInject_DC.DC_WHTJ.param2 = pBuff->protocalDataInject_DC.DC_WHTJ.param2; + Data.dataInject_DC.DC_WHTJ.param3 = pBuff->protocalDataInject_DC.DC_WHTJ.param3; + Data.dataInject_DC.DC_WHTJ.param4 = pBuff->protocalDataInject_DC.DC_WHTJ.param4; + Data.dataInject_DC.DC_WHTJ.param5 = pBuff->protocalDataInject_DC.DC_WHTJ.param5; + Data.dataInject_DC.DC_WHTJ.param6 = pBuff->protocalDataInject_DC.DC_WHTJ.param6; + Data.dataInject_DC.DC_WHTJ.param7 = pBuff->protocalDataInject_DC.DC_WHTJ.param7; + Data.dataInject_DC.DC_WHTJ.param8 = pBuff->protocalDataInject_DC.DC_WHTJ.param8; + Data.dataInject_DC.DC_WHTJ.param9 = pBuff->protocalDataInject_DC.DC_WHTJ.param9; + Data.dataInject_DC.DC_WHTJ.param10 = pBuff->protocalDataInject_DC.DC_WHTJ.param10; + Data.dataInject_DC.DC_WHTJ.param11 = pBuff->protocalDataInject_DC.DC_WHTJ.param11; + Data.dataInject_DC.DC_WHTJ.param12 = pBuff->protocalDataInject_DC.DC_WHTJ.param12; + Data.dataInject_DC.DC_WHTJ.param13 = pBuff->protocalDataInject_DC.DC_WHTJ.param13; + Data.dataInject_DC.DC_WHTJ.param14 = pBuff->protocalDataInject_DC.DC_WHTJ.param14; + break; + default: + break; + } + Data.crc16 = pBuff->crc16; + } + //void Phrase(const BYTE* Src, const UINT32 Count) + //{ + + //} + + virtual struCHECK CheckCRC(BYTE* const p) + { + //return MakeCheckSum_WuHanTJDC(p,31); + return MakeCheckCRC(p+2,16); + } + +}; + +#endif//_CDCFrameCkCmdFrame_ \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/DCOverrollDlg.cpp b/Src/CH91PayloadSoftware/DCOverrollDlg.cpp new file mode 100644 index 0000000..82e2222 --- /dev/null +++ b/Src/CH91PayloadSoftware/DCOverrollDlg.cpp @@ -0,0 +1,321 @@ +// DCOverrollDlg.cpp : 实现文件 +// + +#include "stdafx.h" +#include "DCOverrollDlg.h" +#include "afxdialogex.h" + + +// DCOverrollDlg 对话框 + +IMPLEMENT_DYNAMIC(DCOverrollDlg, CDialogEx) + +DCOverrollDlg::DCOverrollDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(DCOverrollDlg::IDD, pParent) +{ + //m_bkBrush.CreateSolidBrush(BKGCLR); + + m_CurSelect = 99; +} + +DCOverrollDlg::~DCOverrollDlg() +{ + /*关闭定时器*/ + DelateTimer(); +} +//定时器回调函数 +void FAR PASCAL m_DCOverrollTimer(WORD IDEvent, WORD uReserved, DWORD dwUser, DWORD dwReserved1, DWORD dwReserve2) +{ + DCOverrollDlg *m_pView = (DCOverrollDlg *)dwUser; + m_pView->DC0verrollStep(dwUser); +} +void DCOverrollDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + //DDX_Control(pDX, IDC_STATIC_DC, m_DCFrameInfoTab); + DDX_Control(pDX, IDC_STATIC_DC, m_ShowPosition); +} + + +BEGIN_MESSAGE_MAP(DCOverrollDlg, CDialogEx) + //ON_COMMAND(ID_13Ins, &DCOverrollDlg::OnUpdate13Ins) + //ON_UPDATE_COMMAND_UI(ID_WHTJ, &DCOverrollDlg::OnUpdateWHTJ) + ON_WM_CTLCOLOR() + ON_WM_CLOSE() + ON_BN_CLICKED(IDC_BTN_SHOW, &DCOverrollDlg::OnBnClickedBtnShow) + ON_CBN_SELCHANGE(IDC_DC_CHOSET, &DCOverrollDlg::OnCbnSelchangeDcChoset) + ON_BN_CLICKED(IDC_RADIO1, &DCOverrollDlg::OnBnClickedRadio1) + ON_BN_CLICKED(IDC_RADIO2, &DCOverrollDlg::OnBnClickedRadio2) + ON_MESSAGE(WM_PROCESS_DC_CMD, ProcessDCCMD) +END_MESSAGE_MAP() + +HBRUSH DCOverrollDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) +{ + HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor); + + // TODO: 在此更改 DC 的任何特性 + /* + if(nCtlColor==CTLCOLOR_STATIC) + { + pDC->SetBkColor(RGB(0,0,0)); + pDC->SetTextColor(TXTCLR); + pDC->SetBkMode(TRANSPARENT); + }*/ + // TODO: 如果默认的不是所需画笔,则返回另一个画笔 + return m_bkBrush; +} + +// DCOverrollDlg 消息处理程序 +BOOL DCOverrollDlg::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + DlgDCOverroll_Hwnd = GetSafeHwnd();//获得自身的窗口句柄 + + //CRect m_crect; + //GetDlgItem(IDC_STATIC_DC_PUBLCI)->GetWindowRect(m_crect); + //ScreenToClient(&m_crect); + //this->MoveWindow(m_crect.left, m_crect.top, m_crect.Width()*1.05, m_crect.Height()*12); + this->CenterWindow(); + + ///*根据屏幕分辨率最大化显示*/ + //int cx = 0.65*GetSystemMetrics(SM_CXMAXIMIZED); + //int cy = 0.5*GetSystemMetrics(SM_CYMAXIMIZED); + //CRect rcRect(0,0,cx,cy); + //this->MoveWindow(rcRect,true); + //this->CenterWindow(); + + //CSize tabSize(180,25); + //m_DCFrameInfoTab.SetItemSize(tabSize); + //m_DCFrameInfoTab.SetNormalColor(RGB(230,230,230)); + //m_DCFrameInfoTab.SetSelectedColor(0x32CD32); + + CreateAllDlg(); + + ((CComboBox *)GetDlgItem(IDC_DC_CHOSET))->InsertString(0, "13所吊舱控制"); + ((CComboBox *)GetDlgItem(IDC_DC_CHOSET))->InsertString(1, "天进吊舱控制"); + ((CComboBox *)GetDlgItem(IDC_DC_CHOSET))->SetCurSel(0); + + ((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(true); + + /*启动定时器*/ + //先关闭 + DelateTimer(); + //再启动 + if((DCDC0verrollTimerId = timeSetEvent(20, 10, (LPTIMECALLBACK)m_DCOverrollTimer, (DWORD)this, TIME_PERIODIC)) == 0) + { + MessageBox( "通用控制吊舱定时器启动错误!" ); + } + + return 0; +} + +BOOL DCOverrollDlg::CreateAllDlg() +{ + CRect m_crect; + GetDlgItem(IDC_STATIC_DC_PUBLCI)->GetWindowRect(m_crect);//获得IDC_STATIC_DC_PUBLCI的位置 + ScreenToClient(&m_crect); + + CRect m_crect2; + GetDlgItem(IDC_STATIC_DC)->GetWindowRect(m_crect2);//获得IDC_STATIC_DC的位置 + ScreenToClient(&m_crect2); + + + //吊舱新的控制方式 默认显示 + if(!m_13InstituteDCNewDlg.GetSafeHwnd()) + { + m_13InstituteDCNewDlg.Create(IDD_DIALOG_DC_13INSTITUTE_NEW,this); + } + + m_13InstituteDCNewDlg.MoveWindow(m_crect2);//将IDD_DIALOG_DC_13INSTITUTE_NEW移到IDC_STATIC_DC_PUBLCI所在的位置 + m_13InstituteDCNewDlg.ShowWindow(SW_SHOW); + + if(!m_WHTJDCNewDlg.GetSafeHwnd()) + { + m_WHTJDCNewDlg.Create(IDD_DIALOG_DC_WuHanTJ_NEW,this); + } + + m_WHTJDCNewDlg.MoveWindow(m_crect2);//将IDD_DIALOG_DC_13INSTITUTE_NEW移到IDC_STATIC_DC_PUBLCI所在的位置 + m_WHTJDCNewDlg.ShowWindow(SW_HIDE); + + CRect m_RectShow; //显示部分的面积区域 + GetWindowRect(&m_RectLarge); + GetDlgItem(IDC_STATIC_DC_PUBLCI)->GetWindowRect(&m_RectShow); + m_RectSmall.left = m_RectLarge.left; + m_RectSmall.top = m_RectLarge.top; + m_RectSmall.right = m_RectShow.right; + m_RectSmall.bottom = m_RectLarge.bottom; + SetWindowPos(NULL,0,0,m_RectSmall.Width(),m_RectSmall.Height(),SWP_NOMOVE|SWP_NOZORDER); + + return true; +} +//定时器处理函数 +void DCOverrollDlg::DC0verrollStep(DWORD) +{ + +} +void DCOverrollDlg::DelateTimer() +{ + if(DCDC0verrollTimerId!=0) + { + timeKillEvent(DCDC0verrollTimerId); + DCDC0verrollTimerId = 0; + } +} +void DCOverrollDlg::OnClose() +{ + // TODO: 在此添加消息处理程序代码和/或调用默认值 + /*关闭定时器*/ + DelateTimer(); + + m_CurSelect = 99; + CDialogEx::OnClose(); +} + + +void DCOverrollDlg::OnBnClickedBtnShow() +{ + // TODO: 在此添加控件通知处理程序代码 + + CString str; + GetDlgItemText(IDC_BTN_SHOW, str); + if(str == _T("扩展显示>>")) + { + SetDlgItemText(IDC_BTN_SHOW, _T("隐藏显示<<")); + SetWindowPos(NULL, 0, 0, m_RectLarge.Width(), m_RectLarge.Height(),SWP_NOMOVE|SWP_NOZORDER); + } + else if(str == _T("隐藏显示<<")) + { + SetDlgItemText(IDC_BTN_SHOW, _T("扩展显示>>")); + SetWindowPos(NULL, 0, 0, m_RectSmall.Width(), m_RectSmall.Height(),SWP_NOMOVE|SWP_NOZORDER); + } + +} +//LRESULT DCOverrollDlg::ProcessDCCMD(WPARAM wParam, LPARAM lParam) +//{ +// if(!gCurGCSCtrlFlag) +// { +// return 0; +// } +// if(m_CurSelect == 1) +// { +// m_WHTJDCNewDlg.UpdateTJDCAction((int)lParam); +// } +// else if(m_CurSelect == 0 || m_CurSelect == 99)//默认控制13所吊舱 +// { +// m_13InstituteDCNewDlg.UpdateDC13Action((int)lParam); +// } +// +// return 0; +//} + +void DCOverrollDlg::OnCbnSelchangeDcChoset() +{ + // TODO: 在此添加控件通知处理程序代码 + // TODO: 在此添加控件通知处理程序代码 + //int a = m_DCFrameInfoTab.GetCurSel(); + UpdateData( true ); + int iCount =((CComboBox *)GetDlgItem(IDC_DC_CHOSET))->GetCurSel(); + if(m_CurSelect != iCount) + { + m_CurSelect = iCount; + + if(m_CurSelect == 0) + { + /* + //吊舱旧的控制方式 + //删除天进吊舱对话框 + m_WuHanTJDCDlg.ShowWindow(SW_HIDE); + m_WuHanTJDCDlg.DelateTimer(); + m_WuHanTJDCDlg.m_DCCommonDateProcess.DelateTimer(); + //显示13所吊舱控制对话框 + m_13InstituteDCDlg.ShowWindow(SW_SHOW); + m_13InstituteDCDlg.InitializeTimer(); + */ + + //吊舱新的控制方式 + //显示13所吊舱控制对话框 + m_13InstituteDCNewDlg.ShowWindow(SW_SHOW); + //隐藏天进吊舱控制对话框 + m_WHTJDCNewDlg.ShowWindow(SW_HIDE); + + Sleep(120); + } + if(m_CurSelect == 1) + { + /* + //吊舱旧的控制方式 + //删除13所吊舱对话框 + m_13InstituteDCDlg.ShowWindow(SW_HIDE); + m_13InstituteDCDlg.DelateTimer(); + m_13InstituteDCDlg.m_DCCommonDateProcess.DelateTimer(); + //显示天进吊舱控制对话框 + m_WuHanTJDCDlg.ShowWindow(SW_SHOW); + m_WuHanTJDCDlg.InitializeTimer(); + */ + + //吊舱新的控制方式 + //隐藏13所吊舱控制对话框 + m_13InstituteDCNewDlg.ShowWindow(SW_HIDE); + //显示天进吊舱控制对话框 + m_WHTJDCNewDlg.ShowWindow(SW_SHOW); + + Sleep(120); + } + if(m_CurSelect == 99)//默认显示13所吊舱 + { + /* + //吊舱旧的控制方式 + m_WuHanTJDCDlg.DelateTimer(); + m_WuHanTJDCDlg.ShowWindow(SW_HIDE); + m_WuHanTJDCDlg.m_DCCommonDateProcess.DelateTimer(); + m_13InstituteDCDlg.DelateTimer(); + m_13InstituteDCDlg.ShowWindow(SW_HIDE); + m_13InstituteDCDlg.m_DCCommonDateProcess.DelateTimer(); + */ + + //吊舱新的控制方式 + //隐藏13所吊舱控制对话框 + m_13InstituteDCNewDlg.ShowWindow(SW_HIDE); + //隐藏天进吊舱控制对话框 + m_WHTJDCNewDlg.ShowWindow(SW_HIDE); + + Sleep(120); + } + } +} + + +void DCOverrollDlg::OnBnClickedRadio1() +{ + + m_CurSelect = 0; + //显示13所吊舱控制对话框 + m_13InstituteDCNewDlg.ShowWindow(SW_SHOW); + //隐藏天进吊舱控制对话框 + m_WHTJDCNewDlg.ShowWindow(SW_HIDE); + Sleep(120); +} + + +void DCOverrollDlg::OnBnClickedRadio2() +{ + m_CurSelect = 1; + //隐藏13所吊舱控制对话框 + m_13InstituteDCNewDlg.ShowWindow(SW_HIDE); + //显示天进吊舱控制对话框 + m_WHTJDCNewDlg.ShowWindow(SW_SHOW); + Sleep(120); +} +LRESULT DCOverrollDlg::ProcessDCCMD(WPARAM wParam, LPARAM lParam) +{ + if(m_CurSelect == 1) + { + m_WHTJDCNewDlg.UpdateTJDCAction((int)lParam); + } + //else if(m_CurSelect == 0 || m_CurSelect == 99)//默认控制13所吊舱 + //{ + // m_13InstituteDCNewDlg.UpdateDC13Action((int)lParam); + //} + + return 0; +} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/DCOverrollDlg.h b/Src/CH91PayloadSoftware/DCOverrollDlg.h new file mode 100644 index 0000000..bec6190 --- /dev/null +++ b/Src/CH91PayloadSoftware/DCOverrollDlg.h @@ -0,0 +1,61 @@ +#pragma once +#include "resource.h" +#include "DlgWHTJDCNew.h" //武汉天进对话框类新 +#include "Dlg13InstituteDCNew.h" //13所吊舱对话框类新 + +#include "afxwin.h" +#include "CMDBtn.h" +#include "BtnST.h" +#include "afxdlgs.h" +// DCOverrollDlg 对话框 + +class DCOverrollDlg : public CDialogEx +{ + DECLARE_DYNAMIC(DCOverrollDlg) +private: + CBrush m_bkBrush; //界面背景画刷 +public: + afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); +public: + DCOverrollDlg(CWnd* pParent = NULL); // 标准构造函数 + virtual ~DCOverrollDlg(); + +// 对话框数据 + enum { IDD = IDD_DIALOG_DC }; + virtual BOOL OnInitDialog(); + BOOL CreateAllDlg(); + //CXTabCtrl m_DCFrameInfoTab; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + DECLARE_MESSAGE_MAP() +public: + + //吊舱新的控制方式 + Dlg13InstituteDCNew m_13InstituteDCNewDlg; //13所吊舱新控制界面对话框 + DlgWHTJDCNew m_WHTJDCNewDlg; //武汉天进吊舱新控制界面对话框 + + + +private: + CRect m_RectLarge; //整个,整体全部面积区域 + CRect m_RectSmall; //隐藏之后的面积区域 + +public: + //CMFCToolBar m_wndToolBar; + //afx_msg void OnUpdate13Ins(); + //afx_msg void OnUpdateWHTJ(CCmdUI *pCmdUI); + void DC0verrollStep(DWORD); //定时器处理函数 + int DCDC0verrollTimerId; //定时ID + int m_CurSelect; + void DelateTimer(); //删除定时器 + afx_msg void OnBnClickedButton1(); + afx_msg void OnClose(); + afx_msg void OnBnClickedBtnShow(); + LRESULT ProcessDCCMD(WPARAM param, LPARAM lparam); // + afx_msg void OnCbnSelchangeDcChoset(); + CStatic m_ShowPosition; + afx_msg void OnBnClickedRadio1(); + afx_msg void OnBnClickedRadio2(); +}; diff --git a/Src/CH91PayloadSoftware/Decoder.cpp b/Src/CH91PayloadSoftware/Decoder.cpp new file mode 100644 index 0000000..d9472e9 --- /dev/null +++ b/Src/CH91PayloadSoftware/Decoder.cpp @@ -0,0 +1,2 @@ +#include "stdafx.h" +#include "Decoder.h" \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/Decoder.h b/Src/CH91PayloadSoftware/Decoder.h new file mode 100644 index 0000000..87f6599 --- /dev/null +++ b/Src/CH91PayloadSoftware/Decoder.h @@ -0,0 +1,157 @@ +#pragma once + +#include "stdafx.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +//BOOST +#include +#include +#include "boost/shared_ptr.hpp" +//#include +#include + +////////////////////////////////////////////////////////////////////////// +//Definitions +////////////////////////////////////////////////////////////////////////// +typedef int (*pinit_h264ToBMP)(uint32_t width, uint32_t height, uint32_t pps); +typedef BOOL (*ppost_BMP_RGB)(const uint8_t *h264_data, uint32_t h264_data_size,unsigned char *decodebuf); +typedef void (*pFree_all)(); + +struct H264Decode +{ + pinit_h264ToBMP m_DLL_init_h264ToBMP_without_encoder; + ppost_BMP_RGB m_DLL_post_BMP_RGB; + pFree_all m_Dll_pFree_all; + + HINSTANCE m_h264Dll; + unsigned char* m_tmpBuf; + + bool Init(int decodeId) + { + char dllname[255]; + sprintf(dllname,"h264ToBMP_%d.dll",decodeId); + std::string destfilename = boost::str(boost::format("h264ToBMP_%d.dll") % decodeId); + boost::filesystem::path destPath(destfilename); + boost::filesystem::path basePath("h264ToBMP.dll"); + if (!boost::filesystem::is_regular_file(destPath)) + { + //winXP下,如果已存文件再copy一下会出现问题,如果catch住,就可以避免其发生 + try + { + boost::filesystem::copy_file(basePath, destPath); + }catch(boost::filesystem::filesystem_error) + { + } + } + + m_h264Dll = LoadLibrary(destfilename.c_str()); + + if (nullptr == m_h264Dll) + { + return false; + } + m_DLL_init_h264ToBMP_without_encoder = (pinit_h264ToBMP) GetProcAddress(m_h264Dll, "init_h264ToBMP_without_encoder"); + m_DLL_post_BMP_RGB = (ppost_BMP_RGB) GetProcAddress(m_h264Dll, "post_BMP_RGB"); + m_Dll_pFree_all = (pFree_all) GetProcAddress(m_h264Dll, "free_all"); + m_tmpBuf = new unsigned char[2500*1500]; + return true; + } + + int InitDecoder(int width, int height, int pps) + { + if (m_h264Dll != nullptr) + { + int ret = m_DLL_init_h264ToBMP_without_encoder(width, height, pps); + return ret; + } + else + { + return 0; + } + } + + int DecodeVideo(const char* data,int msgLen,unsigned char* imgbuf) + { + try + { + if (m_h264Dll != nullptr) + { + static bool firstTime = true; + int length = msgLen; + if (true == firstTime) + { + firstTime = false; + uint8_t sps_frame[16] = { 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x1E, 0x89, 0x95, 0x41, 0x68, 0x22, 0xD0, 0x04 };//GAODE NEW + + memcpy(m_tmpBuf, sps_frame, 15); + memcpy(m_tmpBuf + 15, data, msgLen); + length = msgLen + 15; + } + else + { + memcpy(m_tmpBuf, data, msgLen); + } + + if (m_tmpBuf != nullptr && length > 0 && imgbuf != nullptr) + { + // 此处容易在测控状态不好的情况下报错。 + try + { + int got_bmp = m_DLL_post_BMP_RGB(m_tmpBuf, length, imgbuf); + return got_bmp; + } + catch (...) + { + + } + } + else + { + return 0; + } + } + else + { + return 0; + } + } + catch (CMemoryException* e) + { + e; + return 0; + } + catch (CFileException* e) + { + e; + return 0; + } + catch (CException* e) + { + e; + return 0; + } + + return 1; + } + + void DeInit() + { + delete m_tmpBuf; + m_tmpBuf = nullptr; + + m_h264Dll = nullptr; + + m_Dll_pFree_all(); + } +}; diff --git a/Src/CH91PayloadSoftware/DecoderFactory.h b/Src/CH91PayloadSoftware/DecoderFactory.h new file mode 100644 index 0000000..7e7113b --- /dev/null +++ b/Src/CH91PayloadSoftware/DecoderFactory.h @@ -0,0 +1,40 @@ +#pragma once +#include + +#ifdef _DECODER_INTERFACE_EXPORT_ +#define _DECODER_INTERFACE_ _declspec(dllexport) +#else +#define _DECODER_INTERFACE_ _declspec(dllimport) +#endif + +typedef enum DecoderType +{ + DEC_SOFTWARE = 0, + DEC_HARDWARE = 1, +}EnumDecoderType; + +typedef void (*DecodeCallbackFun)(unsigned char* data,int width,int height); + +class _DECODER_INTERFACE_ DecoderInterface +{ +public: + DecoderInterface(void){}; + ~DecoderInterface(void){}; + + virtual bool init(int srcWth,int srcHth,int dstWth = 0,int dstHth = 0,int oPixFmt = 0,HWND hwnd = 0) = 0; + virtual void decoding(unsigned char* in_buf,int in_len) = 0; + virtual void release() = 0; + + virtual void setDecodingCallback(DecodeCallbackFun fun) = 0; +}; + +class _DECODER_INTERFACE_ DecoderFactory +{ +public: + DecoderFactory(void); + ~DecoderFactory(void); + + static DecoderInterface* CreateDecoder(EnumDecoderType type = DEC_SOFTWARE); + static void DestroyDecoder(DecoderInterface* deoder); +}; + diff --git a/Src/CH91PayloadSoftware/Decoder_H264_ALLD.lib b/Src/CH91PayloadSoftware/Decoder_H264_ALLD.lib new file mode 100644 index 0000000..4adf469 Binary files /dev/null and b/Src/CH91PayloadSoftware/Decoder_H264_ALLD.lib differ diff --git a/Src/CH91PayloadSoftware/Decoder_H264_ALLR.lib b/Src/CH91PayloadSoftware/Decoder_H264_ALLR.lib new file mode 100644 index 0000000..c3901cd Binary files /dev/null and b/Src/CH91PayloadSoftware/Decoder_H264_ALLR.lib differ diff --git a/Src/CH91PayloadSoftware/Dlg13InstituteDCNew.cpp b/Src/CH91PayloadSoftware/Dlg13InstituteDCNew.cpp new file mode 100644 index 0000000..488fee5 --- /dev/null +++ b/Src/CH91PayloadSoftware/Dlg13InstituteDCNew.cpp @@ -0,0 +1,1337 @@ +// Dlg13InstituteDCNew.cpp : 实现文件 + +#include "stdafx.h" +#include "Dlg13InstituteDCNew.h" +#include "afxdialogex.h" + +/*组播发送*/ +#include +#include +#include + + +//tag_RecBind +HWND g_hwnd13InstituteDCNew = nullptr; + +//线程函数 赋值一次 +void ThreadInstituteDCNew() +{ + //发送消息 + ::PostMessage(g_hwnd13InstituteDCNew,WM_13DC_UPDAFRAME,(WPARAM)g_commandNum,(LPARAM)0); + Sleep(50); + ::PostMessage(g_hwnd13InstituteDCNew,WM_13DC_UPDAFRAME,(WPARAM)g_commandNum,(LPARAM)1); + +} +//方位俯仰-线程函数80毫秒发送一次 +void ThreadInstituteDCNew2() +{ + do + { + ::PostMessage(g_hwnd13InstituteDCNew,WM_13DC_UPDAFRAME,(WPARAM)g_commandNum,(LPARAM)0); + Sleep(80); + } + while(g_bBindData==true);//按钮抬起,g_bBindData变成fasle,循环结束 + //::PostMessage(g_hwnd13InstituteDCNew,WM_13DC_UPDAFRAME,(WPARAM)g_commandNum,(LPARAM)1); +} + +IMPLEMENT_DYNAMIC(Dlg13InstituteDCNew, CDialogEx) + +Dlg13InstituteDCNew::Dlg13InstituteDCNew(CWnd* pParent /*=NULL*/) + : CDialogEx(Dlg13InstituteDCNew::IDD, pParent) + ,InfraredOrVisibleLight(0) + ,Param1(0) + ,Param2(0) +{ + SwitchCmd = 0x00; + PitchControl = 0x00; + DirControl = 0x00; + PitchRecord = 0x00; + DirRecord = 0x00; + mTimerId = 0; + num = 0; + injectstart = false; +} + +Dlg13InstituteDCNew::~Dlg13InstituteDCNew() +{ + //关闭定时器 + if(mTimerId!=0) + { + timeKillEvent(mTimerId); + mTimerId = 0; + } +} + +//定时器回调函数 +void FAR PASCAL TimeCALLBACK(WORD IDEvent, WORD uReserved, DWORD dwUser, DWORD dwReserved1, DWORD dwReserve2) +{ + Dlg13InstituteDCNew *m_pView = (Dlg13InstituteDCNew *)dwUser; + m_pView->TimeStep(dwUser); +} +//定时器处理 +void Dlg13InstituteDCNew::TimeStep(DWORD dwUser) +{ + + if (g_IsSending && g_bBindData) + { + //m_MudpSend.SendData(DCFrameCkCmd13.Addr(),20); + //g_DCMUDP.SendTo(DCFrameCkCmd13.Addr(), 20); + //g_MUDPCamera.SendToY(DCFrameCkCmd13.Addr(), 20); + } +} +void Dlg13InstituteDCNew::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW, DC13InsBtn[0]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW2, DC13InsBtn[1]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW3, DC13InsBtn[2]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW4, DC13InsBtn[3]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW5, DC13InsBtn[4]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW6, DC13InsBtn[5]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW7, DC13InsBtn[6]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW8, DC13InsBtn[7]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW9, DC13InsBtn[8]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW10, DC13InsBtn[9]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW11, DC13InsBtn[10]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW12, DC13InsBtn[11]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW13, DC13InsBtn[12]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW14, DC13InsBtn[13]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW15, DC13InsBtn[14]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW16, DC13InsBtn[15]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW17, DC13InsBtn[16]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW18, DC13InsBtn[17]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW19, DC13InsBtn[18]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW20, DC13InsBtn[19]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW21, DC13InsBtn[20]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW22, DC13InsBtn[21]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW23, DC13InsBtn[22]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW24, DC13InsBtn[23]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW25, DC13InsBtn[24]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW26, DC13InsBtn[25]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW27, DC13InsBtn[26]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW28, DC13InsBtn[27]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW29, DC13InsBtn[28]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW30, DC13InsBtn[29]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW31, DC13InsBtn[30]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW32, DC13InsBtn[31]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW33, DC13InsBtn[32]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW34, DC13InsBtn[33]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW35, DC13InsBtn[34]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW36, DC13InsBtn[35]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW37, DC13InsBtn[36]); + DDX_Control(pDX, IDC_BTN_DC_13INSTITUTE_NEW38, DC13InsBtn[37]); + + DDX_Control(pDX, IDC_BUTTON_DCOverroll_13Ins_1, m_DCFlyCmd[0]);//吊舱通道1 + DDX_Control(pDX, IDC_BUTTON_DCOverroll_13Ins_2, m_DCFlyCmd[1]);//吊舱通道2 + DDX_Control(pDX, IDC_BUTTON_DCOverroll_13Ins_3, m_DCFlyCmd[2]); + DDX_Control(pDX, IDC_BUTTON_DCOverroll_13Ins_4, m_DCFlyCmd[3]); + DDX_Control(pDX, IDC_BUTTON_DCOverroll_13Ins_5, m_DCFlyCmd[4]); + DDX_Control(pDX, IDC_BUTTON_DCOverroll_13Ins_6, m_DCFlyCmd[5]); + DDX_Control(pDX, IDC_BUTTON_DCOverroll_13Ins_7, m_DCFlyCmd[6]); + DDX_Control(pDX, IDC_BUTTON_DCOverroll_13Ins_8, m_DCFlyCmd[7]); + DDX_Control(pDX, IDC_BUTTON_DCOverroll_13Ins_9, m_DCFlyCmd[8]); + DDX_Control(pDX, IDC_BUTTON_DCOverroll_13Ins_10, m_DCFlyCmd[9]); + DDX_Control(pDX, IDC_BUTTON_DCOverroll_13Ins_11, m_DCFlyCmd[10]); + DDX_Control(pDX, IDC_BUTTON_DCOverroll_13Ins_12, m_DCFlyCmd[11]); + + //DDX_Control(pDX, IDC_STATIC, DC13InsBtn[38]); + DDX_Text(pDX, IDC_EDIT_Pitch_Param, Param1); + //DDV_MinMaxInt(pDX, Param1, -18000, 18000); + DDX_Text(pDX, IDC_EDIT_Dir_Param, Param2); + //DDV_MinMaxInt(pDX, Param2, -18000, 18000); +} + +BOOL Dlg13InstituteDCNew::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + CenterWindow(); + g_hwnd13InstituteDCNew = this->GetSafeHwnd(); + + CFont m_oFont;//字体 + m_oFont.CreatePointFont(80, _T("Times New Roman")); + for(int i = 0;i<38;++i) + { + //DC13InsBtn[i].SetTextColor(RGB(255,255,255)); + //DC13InsBtn[i].SetFont(&m_oFont); + //DC13InsBtn[i].SetFaceColor(RGB(54,54,54),true); + if(i==34||i==35||i==36||i==37||i==3) + { + DC13InsBtn[i].SetTextColor(RGB(0,0,0)); + DC13InsBtn[i].SetFont(&m_oFont); + DC13InsBtn[i].SetFaceColor(RGB(133,220,49),true); + } + else + { + DC13InsBtn[i].SetTextColor(RGB(0,0,0)); + DC13InsBtn[i].SetFont(&m_oFont); + DC13InsBtn[i].SetFaceColor(RGB(204,255,255),true); + } + + } + + m_font.CreatePointFont(100,_T("宋体"),NULL); + CWnd* pWnd = GetDlgItem(IDC_STATIC_PitchAndDir); + pWnd->SetFont(&m_font); + + CWnd* pWnd2 = GetDlgItem(IDC_EDIT_Pitch_Param); + pWnd2->SetFont(&m_font); + GetDlgItem(IDC_EDIT_Pitch_Param)->SetWindowText("0.00"); + CWnd* pWnd3 = GetDlgItem(IDC_EDIT_Dir_Param); + pWnd3->SetFont(&m_font); + GetDlgItem(IDC_EDIT_Dir_Param)->SetWindowText("0.00"); + + + + ////定时器 + //if((mTimerId = timeSetEvent(50, 20, (LPTIMECALLBACK)TimeCALLBACK, (DWORD)this, TIME_PERIODIC)) == 0) + //{ + // MessageBox( "13所吊舱定时器启动错误!", _T("提示!")); + //} + + m_MudpSend.initMUDP("224.1.1.1",5622); + + for(int i=0;i<12;++i) + { + m_DCFlyCmd[i].Cmd=i+1; + m_DCFlyCmd[i].Cmdpage = 20;//这里的页面标志设置为20 + m_DCFlyCmd[i].SetTextColor(RGB(0,0,0)); + m_DCFlyCmd[i].SetFont(&m_oFont); + m_DCFlyCmd[i].SetFaceColor(RGB(24,225,255),true); + } + + memset(DC13InsCmdBuffer,0,sizeof(DC13InsCmdBuffer)); + + + + return TRUE; +} + +BEGIN_MESSAGE_MAP(Dlg13InstituteDCNew, CDialogEx) + + ON_MESSAGE(WM_13DC_UPDAFRAME, &Dlg13InstituteDCNew::OnUpdate13DCFrame) + ON_WM_CTLCOLOR() +END_MESSAGE_MAP() + + +// Dlg13InstituteDCNew 消息处理程序 +//接收线程来的消息,处理消息 +afx_msg LRESULT Dlg13InstituteDCNew::OnUpdate13DCFrame(WPARAM wParam, LPARAM lParam) +{ + injectstart = true;//吊舱装订开始 + switch ((int)wParam) + { + case 0://锁定模式 + UpdateFrame((int&)lParam); + break; + case 2://扫描模式 + UpdateFrame2((int&)lParam); + break; + case 3://数字引导模式 + UpdateFrame3((int&)lParam); + break; + case 4://平台复位 + UpdateFrame4((int&)lParam); + break; + case 5: + UpdateFrame5(); + break; + case 6: + UpdateFrame6(); + break; + case 7: + UpdateFrame7(); + break; + case 8: + UpdateFrame8(); + break; + case 9: + UpdateFrame9((int&)lParam); + break; + case 10: + UpdateFrame10((int&)lParam); + break; + case 11: + UpdateFrame11((int&)lParam); + break; + case 12: + UpdateFrame12((int&)lParam); + break; + case 13: + UpdateFrame13((int&)lParam); + break; + case 14: + UpdateFrame14(); + break; + case 15: + UpdateFrame15(); + break; + case 16: + UpdateFrame16((int&)lParam); + break; + case 17: + UpdateFrame17((int&)lParam); + break; + case 18: + UpdateFrame18((int&)lParam); + break; + case 19: + UpdateFrame19((int&)lParam); + break; + case 20: + UpdateFrame20(); + break; + case 21: + UpdateFrame21(); + break; + case 22: + UpdateFrame22((int&)lParam); + break; + case 23: + UpdateFrame23((int&)lParam); + break; + case 24: + UpdateFrame24((int&)lParam); + break; + case 25: + UpdateFrame25((int&)lParam); + break; + case 26: + UpdateFrame26((int&)lParam); + break; + case 27: + UpdateFrame27((int&)lParam); + break; + case 28: + UpdateFrame28((int&)lParam); + break; + case 29: + UpdateFrame29((int&)lParam); + break; + case 30: + UpdateFrame30((int&)lParam); + break; + case 31: + UpdateFrame31((int&)lParam); + break; + case 32: + UpdateFrame32((int&)lParam); + break; + case 33: + UpdateFrame33((int&)lParam); + break; + case 34: + UpdateFrame34((int&)lParam); + break; + case 35://俯仰+ + UpdateFrame35(); + break; + case 36://俯仰- + UpdateFrame36(); + break; + case 37://方位+ + UpdateFrame37(); + break; + case 38://方位- + UpdateFrame38(); + break; + default: + break; + } + //if((int&)lParam == 0) + //{ + // if(g_IsSending){ + // g_MUDPCamera.SendToY(DCFrameCkCmd13.Addr(), 20); + // } + //} + /* + if((int&)lParam==0) + { + if(!gCurGCSCtrlFlag)//从控 + { + if(gComFlags.test(11))//((gCommuFlags & 0x0800) != 0x00) ) + { + //数据注入指令从控发送数据---13所吊舱 + DCFrameCkCmd13.Data.fcode = 0x70; + DCFrameCkCmd13.Data.DCtype = g_FrameFKU.Data.details.DataZ70.DCtype ; + DCFrameCkCmd13.Data.SwitchCmd =g_FrameFKU.Data.details.DataZ70.SwitchCmd; + DCFrameCkCmd13.Data.param1 = g_FrameFKU.Data.details.DataZ70.param1; + DCFrameCkCmd13.Data.param2 = g_FrameFKU.Data.details.DataZ70.param2; + DCFrameCkCmd13.SendPrepare(); + g_UDPACmdSwi.WriteBuffer(DCFrameCkCmd13.Addr(),11); + } + } + } + */ + return 0; +} + +//更新13所吊舱控制指令 按钮按下,分类进行处理。 +//对于重复发送的指令,直接赋值,直至按钮抬起,装订标志变为false,发送停止 +//对于只发送一次的指令,开启一个线程,线程中相差100ms发送先后发送赋值和清空操作。赋值期间指令发送(GCSView::Setp函数),清空后指令不再发送。 +void Dlg13InstituteDCNew::Update13InsNewCmdBuffer(HWND hwnd) +{ + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW)->m_hWnd) + { + g_commandNum = 0; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW2)->m_hWnd) + { + g_commandNum = 2; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW3)->m_hWnd) + { + g_commandNum = 3; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW4)->m_hWnd) + { + g_commandNum = 4; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW5)->m_hWnd) + { + //UpdateFrame5(); + g_commandNum = 5; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程2 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW6)->m_hWnd) + { + //UpdateFrame6(); + g_commandNum = 6; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程2 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW7)->m_hWnd) + { + //UpdateFrame7(); + g_commandNum = 7; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程2 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW8)->m_hWnd) + { + //UpdateFrame8(); + g_commandNum = 8; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程2 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW9)->m_hWnd) + { + g_commandNum = 9; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW10)->m_hWnd) + { + g_commandNum = 10; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW11)->m_hWnd) + { + g_commandNum = 11; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW12)->m_hWnd) + { + g_commandNum = 12; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW13)->m_hWnd) + { + g_commandNum = 13; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW14)->m_hWnd) + { + //UpdateFrame14(); + g_commandNum = 14; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程2 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW15)->m_hWnd) + { + //UpdateFrame15(); + g_commandNum = 15; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程2 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW16)->m_hWnd) + { + g_commandNum = 16; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW17)->m_hWnd) + { + g_commandNum = 17; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW18)->m_hWnd) + { + g_commandNum = 18; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW19)->m_hWnd) + { + g_commandNum = 19; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW20)->m_hWnd) + { + //UpdateFrame20(); + g_commandNum = 20; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程2 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW21)->m_hWnd) + { + //UpdateFrame21(); + g_commandNum = 21; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程2 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW22)->m_hWnd) + { + g_commandNum = 22; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW23)->m_hWnd) + { + g_commandNum = 23; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW24)->m_hWnd) + { + g_commandNum = 24; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW25)->m_hWnd) + { + g_commandNum = 25; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW26)->m_hWnd) + { + g_commandNum = 26; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW27)->m_hWnd) + { + g_commandNum = 27; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW28)->m_hWnd) + { + g_commandNum = 28; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW29)->m_hWnd) + { + g_commandNum = 29; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW30)->m_hWnd) + { + g_commandNum = 30; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW31)->m_hWnd) + { + g_commandNum = 31; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW32)->m_hWnd) + { + g_commandNum = 32; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW33)->m_hWnd) + { + g_commandNum = 33; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW34)->m_hWnd) + { + g_commandNum = 34; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW35)->m_hWnd)//俯仰+ + { + g_commandNum = 35; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程2 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW36)->m_hWnd)//俯仰- + { + g_commandNum = 36; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程2 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW37)->m_hWnd)//方位+ + { + g_commandNum = 37; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程2 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_DC_13INSTITUTE_NEW38)->m_hWnd)//方位- + { + g_commandNum = 38; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadInstituteDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程2 + CloseHandle(hCheckThread); + } +} +//更新buffer到帧结构体 +void Dlg13InstituteDCNew::UpdateDataZ70_13Ins() +{ + DCFrameCkCmd13.Data.fcode = 0x70; + DCFrameCkCmd13.Data.dataInject_DC.DCtype = 0x01; + DCFrameCkCmd13.Data.dataInject_DC.DC_13Ins.SwitchCmd = DC13InsCmdBuffer[0]; + DCFrameCkCmd13.Data.dataInject_DC.DC_13Ins.param1 = DC13InsCmdBuffer[1]+DC13InsCmdBuffer[2]*255; + DCFrameCkCmd13.Data.dataInject_DC.DC_13Ins.param2 = DC13InsCmdBuffer[3]+DC13InsCmdBuffer[4]*255; + DCFrameCkCmd13.SendPrepare(); + if(g_IsSending){ + g_MUDPCamera.SendToY(DCFrameCkCmd13.Addr(), 20); + } + //DC13InsCmdBuffer清空 + memset(DC13InsCmdBuffer,0,sizeof(DC13InsCmdBuffer)); +} +//锁定模式DC13InsCmdBuffer +void Dlg13InstituteDCNew::UpdateFrame(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0x15; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//扫描模式 +void Dlg13InstituteDCNew::UpdateFrame2(int &sendEnd) +{ + if (sendEnd == 0) + { + DC13InsCmdBuffer[0] = 0x17; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//数字引导模式 +void Dlg13InstituteDCNew::UpdateFrame3(int &sendEnd) +{ + if(sendEnd==0) + { + UpdateData(TRUE); + DC13InsCmdBuffer[0] = 0x19; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + + /*俯仰限制*/ + INT16 MinPitch = 0xD508;//-11000 + INT16 MaxPitch = 0x1388;//5000 + if(Param1*100MaxPitch) + { + PitchControl = MaxPitch; + } + else + { + PitchControl = Param1*100; + } + /*方位限制*/ + INT16 MinDir = 0xB9B0;//-18000 + INT16 MaxDir = 0x4650;//+18000 + if(Param2*100MaxDir) + { + DirControl = MaxDir; + } + else + { + DirControl = Param2*100; + } + DC13InsCmdBuffer[1] = PitchControl; + DC13InsCmdBuffer[2] = PitchControl>>8; + DC13InsCmdBuffer[3] = DirControl; + DC13InsCmdBuffer[4] = DirControl>>8; + PitchRecord = PitchControl; + DirRecord = DirControl; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//平台复位 +void Dlg13InstituteDCNew::UpdateFrame4(int &sendEnd) +{ + if (sendEnd == 0) + { + DC13InsCmdBuffer[0] = 0x1B; + PitchRecord = 0; + DirRecord = 0; + PitchControl = 0; + DirControl = 0; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//补漂方位- +void Dlg13InstituteDCNew::UpdateFrame5() +{ + DC13InsCmdBuffer[0] = 0x1D; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + g_bBindData = true; +} +//补漂方位+ +void Dlg13InstituteDCNew::UpdateFrame6() +{ + DC13InsCmdBuffer[0] = 0x1F; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + g_bBindData = true; +} +//补漂俯仰- +void Dlg13InstituteDCNew::UpdateFrame7() +{ + DC13InsCmdBuffer[0] = 0x21; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + g_bBindData = true; +} +//补漂俯仰+ +void Dlg13InstituteDCNew::UpdateFrame8() +{ + DC13InsCmdBuffer[0] = 0x23; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + g_bBindData = true; +} +//手动模式 +void Dlg13InstituteDCNew::UpdateFrame9(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0x25; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//可见光跟踪 +void Dlg13InstituteDCNew::UpdateFrame10(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0x27; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//红外跟踪 +void Dlg13InstituteDCNew::UpdateFrame11(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0x28; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; + +} +//红外白热 +void Dlg13InstituteDCNew::UpdateFrame12(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0x81; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; + +} +//红外黑热 +void Dlg13InstituteDCNew::UpdateFrame13(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0x82; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; + +} +//焦距+ +void Dlg13InstituteDCNew::UpdateFrame14() +{ + DC13InsCmdBuffer[0] = 0x85; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; +} +//焦距- +void Dlg13InstituteDCNew::UpdateFrame15() +{ + DC13InsCmdBuffer[0] = 0x86; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; +} +//红外小视场 +void Dlg13InstituteDCNew::UpdateFrame16(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0x87; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; + +} +//红外大视场 +void Dlg13InstituteDCNew::UpdateFrame17(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0x89; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; + +} +//OSD on/off +void Dlg13InstituteDCNew::UpdateFrame18(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0xA1; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; + +} +//图像切换 +void Dlg13InstituteDCNew::UpdateFrame19(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0xA3; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; + +} +//画中画开 +void Dlg13InstituteDCNew::UpdateFrame20() +{ + DC13InsCmdBuffer[0] = 0xB5; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; +} +//画中画关 +void Dlg13InstituteDCNew::UpdateFrame21() +{ + DC13InsCmdBuffer[0] = 0xB6; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; +} +//图像稳定关 +void Dlg13InstituteDCNew::UpdateFrame22(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0xB7; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; + +} +//图像稳定开 +void Dlg13InstituteDCNew::UpdateFrame23(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0xB8; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; + +} +//可见光透雾1 +void Dlg13InstituteDCNew::UpdateFrame24(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0xBB; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; + +} +//可见光透雾2 +void Dlg13InstituteDCNew::UpdateFrame25(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0xBC; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//可见光透雾3 +void Dlg13InstituteDCNew::UpdateFrame26(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0xBD; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//可见光透关 +void Dlg13InstituteDCNew::UpdateFrame27(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0xBE; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//开始连续照相 +void Dlg13InstituteDCNew::UpdateFrame28(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0xC1; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//停止照相 +void Dlg13InstituteDCNew::UpdateFrame29(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0xC3; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//拍一张照 +void Dlg13InstituteDCNew::UpdateFrame30(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0xC5; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//激光电源开 +void Dlg13InstituteDCNew::UpdateFrame31(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0x92; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//激光电源关 +void Dlg13InstituteDCNew::UpdateFrame32(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0x93; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//测距开 +void Dlg13InstituteDCNew::UpdateFrame33(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0x94; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//测距关 +void Dlg13InstituteDCNew::UpdateFrame34(int &sendEnd) +{ + if(sendEnd==0) + { + DC13InsCmdBuffer[0] = 0x95; + DC13InsCmdBuffer[1] = 0x00; + DC13InsCmdBuffer[2] = 0x00; + DC13InsCmdBuffer[3] = 0x00; + DC13InsCmdBuffer[4] = 0x00; + UpdateDataZ70_13Ins(); + + g_bBindData = true; + } + else + g_bBindData = false; +} +//俯仰+范围50~-110 +void Dlg13InstituteDCNew::UpdateFrame35() +{ + DC13InsCmdBuffer[0] = 0x19; + if(PitchControl<0x1388)//5000 + { + PitchRecord = PitchRecord+100; + } + else + { + PitchRecord = 0x1388; + } + //DirRecord = DirRecord; + PitchControl = PitchRecord; + DirControl = DirRecord; + DC13InsCmdBuffer[1] = PitchControl; + DC13InsCmdBuffer[2] = PitchControl>>8; + DC13InsCmdBuffer[3] = DirControl; + DC13InsCmdBuffer[4] = DirControl>>8; + UpdateDataZ70_13Ins(); + + g_bBindData = true; +} +//俯仰- +void Dlg13InstituteDCNew::UpdateFrame36() +{ + DC13InsCmdBuffer[0] = 0x19; + INT16 MinPitch = 0xD508;//-11000 + if(PitchRecord>MinPitch) + { + PitchRecord = PitchRecord-100; + } + else + { + PitchRecord = MinPitch; + } + //DirRecord = DirRecord; + PitchControl = PitchRecord; + DirControl = DirRecord; + DC13InsCmdBuffer[1] = PitchControl; + DC13InsCmdBuffer[2] = PitchControl>>8; + DC13InsCmdBuffer[3] = DirControl; + DC13InsCmdBuffer[4] = DirControl>>8; + UpdateDataZ70_13Ins(); + + g_bBindData = true; +} +//方位+范围180~-180 +void Dlg13InstituteDCNew::UpdateFrame37() +{ + DC13InsCmdBuffer[0] = 0x19; + //PitchRecord = PitchRecord; + if(DirRecord<0x4650)//18000 + { + DirRecord = DirRecord+100; + } + else + { + DirRecord = 0x4650; + } + PitchControl = PitchRecord; + DirControl = DirRecord; + DC13InsCmdBuffer[1] = PitchControl; + DC13InsCmdBuffer[2] = PitchControl>>8; + DC13InsCmdBuffer[3] = DirControl; + DC13InsCmdBuffer[4] = DirControl>>8; + UpdateDataZ70_13Ins(); + + g_bBindData = true; +} +//方位- +void Dlg13InstituteDCNew::UpdateFrame38() +{ + DC13InsCmdBuffer[0] = 0x19; + //PitchRecord = PitchRecord; + INT16 MinDir = 0xb9b0; + if(DirRecord>MinDir)//-18000 + { + DirRecord = DirRecord-100; + } + else + { + DirRecord = MinDir; + } + PitchControl = PitchRecord; + DirControl = DirRecord; + DC13InsCmdBuffer[1] = PitchControl; + DC13InsCmdBuffer[2] = PitchControl>>8; + DC13InsCmdBuffer[3] = DirControl; + DC13InsCmdBuffer[4] = DirControl>>8; + UpdateDataZ70_13Ins(); + + g_bBindData = true; +} + +//按钮按下、抬起触发此函数 +BOOL Dlg13InstituteDCNew::PreTranslateMessage(MSG* pMsg) +{ + if(g_IsSending) + { + // TODO: 在此添加专用代码和/或调用基类 + if(pMsg->message == WM_LBUTTONDOWN)//按下 + { + Update13InsNewCmdBuffer(pMsg->hwnd); + } + if(pMsg->message == WM_LBUTTONUP)//抬起 + { + g_bBindData = false;//装订标志变成false + + + //if(!gCurGCSCtrlFlag) + //{ + // if(gComFlags.test(11))//((gCommuFlags & 0x0800) != 0x00) ) + // { + // g_DC13FrameCkCmd = g_FrameFKU; + // g_UDPACmdSwi.WriteBuffer(g_DC13FrameCkCmd.Addr(),g_DC13FrameCkCmd.GetFrameLength());//写从控指令转发网口 + + // } + //} + + + } + } + + return CDialogEx::PreTranslateMessage(pMsg); +} + diff --git a/Src/CH91PayloadSoftware/Dlg13InstituteDCNew.h b/Src/CH91PayloadSoftware/Dlg13InstituteDCNew.h new file mode 100644 index 0000000..ccb4d1b --- /dev/null +++ b/Src/CH91PayloadSoftware/Dlg13InstituteDCNew.h @@ -0,0 +1,106 @@ +#pragma once +#include "resource.h" +#include "global.h" +#include +#include "afxwin.h" +#include "DCFrameCkCmd.h" +#include "CYHMudpSend.h"//自定义组播发送 +#include "CMDBtn.h" +// Dlg13InstituteDCNew 对话框 + + +class Dlg13InstituteDCNew : public CDialogEx +{ + DECLARE_DYNAMIC(Dlg13InstituteDCNew) + +public: + Dlg13InstituteDCNew(CWnd* pParent = NULL); // 标准构造函数 + virtual ~Dlg13InstituteDCNew(); + + // 对话框数据 + enum { IDD = IDD_DIALOG_DC_13INSTITUTE_NEW }; + virtual BOOL OnInitDialog(); + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + DECLARE_MESSAGE_MAP() +public: + void TimeStep(DWORD); //定时器处理函数 + int mTimerId; //定时ID + int num; //指令计数 + bool injectstart; //吊舱装订开始的标志 +public: + UINT8 SwitchCmd; //开关指令 + INT16 PitchControl; //俯仰控制量 + INT16 DirControl; //方位控制量 + INT16 PitchRecord; //俯仰量记录 + INT16 DirRecord; //方位量记录 + +public: + void Update13InsNewCmdBuffer(HWND);//更新控制指令到吊舱协议 + void UpdateDataZ70_13Ins();//更新buffer到帧结构体 + void UpdateFrame(int&); + void UpdateFrame2(int&); + void UpdateFrame3(int&); + void UpdateFrame4(int&); + void UpdateFrame5(); + void UpdateFrame6(); + void UpdateFrame7(); + void UpdateFrame8(); + void UpdateFrame9(int&); + void UpdateFrame10(int&); + void UpdateFrame11(int&); + void UpdateFrame12(int&); + void UpdateFrame13(int&); + void UpdateFrame14(); + void UpdateFrame15(); + void UpdateFrame16(int&); + void UpdateFrame17(int&); + void UpdateFrame18(int&); + void UpdateFrame19(int&); + void UpdateFrame20(); + void UpdateFrame21(); + void UpdateFrame22(int&); + void UpdateFrame23(int&); + void UpdateFrame24(int&); + void UpdateFrame25(int&); + void UpdateFrame26(int&); + void UpdateFrame27(int&); + void UpdateFrame28(int&); + void UpdateFrame29(int&); + void UpdateFrame30(int&); + void UpdateFrame31(int&); + void UpdateFrame32(int&); + void UpdateFrame33(int&); + void UpdateFrame34(int&); + void UpdateFrame35();//俯仰+范围50~-110 + void UpdateFrame36();//俯仰- + void UpdateFrame37();//方位+范围180~-180 + void UpdateFrame38();//方位- + //void UpdateFrame39(int&); + //void UpdateFrame40(int&); + //void UpdateDC13Action(int); + +public: + HANDLE hCheckThread;//线程 + DWORD ThreadCheckIDRegion; + afx_msg LRESULT OnUpdate13DCFrame(WPARAM wParam, LPARAM lParam); + int InfraredOrVisibleLight;//红外可见光切换 + virtual BOOL PreTranslateMessage(MSG* pMsg); + //CFont m_oFont;//字体 + + CMFCButton DC13InsBtn[38]; + CCMDBtn m_DCFlyCmd[12]; + double Param1; + double Param2; + BYTE DC13InsCmdBuffer[5]; +public: + CBrush m_brush; + CFont m_font; +public: + //afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + CDCFrameCkCmdFrame DCFrameCkCmd13;//数据注入指令从控发送数据帧---13所吊舱 + CYHMudpSend m_MudpSend; + +}; diff --git a/Src/CH91PayloadSoftware/DlgCameraCtrl.cpp b/Src/CH91PayloadSoftware/DlgCameraCtrl.cpp new file mode 100644 index 0000000..b08fc36 --- /dev/null +++ b/Src/CH91PayloadSoftware/DlgCameraCtrl.cpp @@ -0,0 +1,95 @@ +// DlgCameraCtrl.cpp : 实现文件 +// + +#include "stdafx.h" +#include "CH91PayloadSoftware.h" +#include "DlgCameraCtrl.h" +#include "afxdialogex.h" + + +// CDlgCameraCtrl 对话框 + +IMPLEMENT_DYNAMIC(CDlgCameraCtrl, CDialogEx) + +CDlgCameraCtrl::CDlgCameraCtrl(CWnd* pParent /*=NULL*/) + : CDialogEx(CDlgCameraCtrl::IDD, pParent) +{ + m_btn_camera_1.Cmd = 0x66; + m_btn_camera_2.Cmd = 0x67; + m_btn_camera_3.Cmd = 0x68; + m_btn_camera_4.Cmd = 0x69; + m_btn_camera_5.Cmd = 0x75; + m_btn_camera_6.Cmd = 0x76; + m_btn_camera_7.Cmd = 0x77; + m_btn_camera_8.Cmd = 0x78; + //m_btn_camera_9.Cmd = 0x79; + m_btn_camera_10.Cmd = 0x7A; + //m_btn_camera_11.Cmd = 0x7B; + m_btn_camera_12.Cmd = 0x7C; + m_btn_camera_13.Cmd = 0x7D; + m_btn_camera_14.Cmd = 0x66;//图像切换 + m_btn_camera_15.Cmd = 0x67;//画中画开 + m_btn_camera_16.Cmd = 0x68;//画中画关 + m_btn_camera_17.Cmd = 0x6A;//红外大 + m_btn_camera_18.Cmd = 0x69;//红外小 + m_btn_camera_19.Cmd = 0x7B;//复位 + m_btn_camera_20.Cmd = 0x7A;//锁定 + m_btn_camera_21.Cmd = 0x79;//扫描 + m_btn_camera_22.Cmd = 0x6B;//跟踪 + m_btn_camera_23.Cmd = 0xC4;//2M速率 + m_btn_camera_24.Cmd = 0xC5;//4M速率 + m_btn_camera_25.Cmd = 0xCB;//开始记录 + m_btn_camera_26.Cmd = 0xCC;//停止记录 + m_btn_camera_27.Cmd = 0xCD;//清除数据 + m_btn_camera_28.Cmd = 0xC8;//0-3图拼接 + m_btn_camera_29.Cmd = 0xC9;//4-6图拼接 + m_btn_camera_30.Cmd = 0xC6;//吊舱通道1 + m_btn_camera_31.Cmd = 0xC7;//吊舱通道2 +} + +CDlgCameraCtrl::~CDlgCameraCtrl() +{ +} + +void CDlgCameraCtrl::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Control(pDX, IDC_BTN_CAMERA_1, m_btn_camera_1); + DDX_Control(pDX, IDC_BTN_CAMERA_2, m_btn_camera_2); + DDX_Control(pDX, IDC_BTN_CAMERA_3, m_btn_camera_3); + DDX_Control(pDX, IDC_BTN_CAMERA_4, m_btn_camera_4); + DDX_Control(pDX, IDC_BTN_CAMERA_5, m_btn_camera_5); + DDX_Control(pDX, IDC_BTN_CAMERA_6, m_btn_camera_6); + DDX_Control(pDX, IDC_BTN_CAMERA_7, m_btn_camera_7); + DDX_Control(pDX, IDC_BTN_CAMERA_8, m_btn_camera_8); + //DDX_Control(pDX, IDC_BTN_CAMERA_9, m_btn_camera_9); + DDX_Control(pDX, IDC_BTN_CAMERA_10, m_btn_camera_10); + //DDX_Control(pDX, IDC_BTN_CAMERA_11, m_btn_camera_11); + DDX_Control(pDX, IDC_BTN_CAMERA_12, m_btn_camera_12); + DDX_Control(pDX, IDC_BTN_CAMERA_13, m_btn_camera_13); + DDX_Control(pDX, IDC_BTN_CAMERA_14, m_btn_camera_14); + DDX_Control(pDX, IDC_BTN_CAMERA_15, m_btn_camera_15); + DDX_Control(pDX, IDC_BTN_CAMERA_16, m_btn_camera_16); + DDX_Control(pDX, IDC_BTN_CAMERA_17, m_btn_camera_17); + DDX_Control(pDX, IDC_BTN_CAMERA_18, m_btn_camera_18); + DDX_Control(pDX, IDC_BTN_CAMERA_19, m_btn_camera_19); + DDX_Control(pDX, IDC_BTN_CAMERA_20, m_btn_camera_20); + DDX_Control(pDX, IDC_BTN_CAMERA_21, m_btn_camera_21); + DDX_Control(pDX, IDC_BTN_CAMERA_22, m_btn_camera_22); + DDX_Control(pDX, IDC_BTN_CAMERA_23, m_btn_camera_23); + DDX_Control(pDX, IDC_BTN_CAMERA_24, m_btn_camera_24); + DDX_Control(pDX, IDC_BTN_CAMERA_25, m_btn_camera_25); + DDX_Control(pDX, IDC_BTN_CAMERA_26, m_btn_camera_26); + DDX_Control(pDX, IDC_BTN_CAMERA_27, m_btn_camera_27); + DDX_Control(pDX, IDC_BTN_CAMERA_28, m_btn_camera_28); + DDX_Control(pDX, IDC_BTN_CAMERA_29, m_btn_camera_29); + DDX_Control(pDX, IDC_BTN_CAMERA_30, m_btn_camera_30); + DDX_Control(pDX, IDC_BTN_CAMERA_31, m_btn_camera_31); +} + + +BEGIN_MESSAGE_MAP(CDlgCameraCtrl, CDialogEx) +END_MESSAGE_MAP() + + +// CDlgCameraCtrl 消息处理程序 diff --git a/Src/CH91PayloadSoftware/DlgCameraCtrl.h b/Src/CH91PayloadSoftware/DlgCameraCtrl.h new file mode 100644 index 0000000..2311b08 --- /dev/null +++ b/Src/CH91PayloadSoftware/DlgCameraCtrl.h @@ -0,0 +1,53 @@ +#pragma once + +#include "CMDBtn.h" +// CDlgCameraCtrl 对话框 + +class CDlgCameraCtrl : public CDialogEx +{ + DECLARE_DYNAMIC(CDlgCameraCtrl) + +public: + CDlgCameraCtrl(CWnd* pParent = NULL); // 标准构造函数 + virtual ~CDlgCameraCtrl(); + +// 对话框数据 + enum { IDD = IDD_DLG_CAMERA_CTRL }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + DECLARE_MESSAGE_MAP() +public: + CCMDBtn m_btn_camera_1; + CCMDBtn m_btn_camera_2; + CCMDBtn m_btn_camera_3; + CCMDBtn m_btn_camera_4; + CCMDBtn m_btn_camera_5; + CCMDBtn m_btn_camera_6; + CCMDBtn m_btn_camera_7; + CCMDBtn m_btn_camera_8; + //CCMDBtn m_btn_camera_9; + CCMDBtn m_btn_camera_10; + //CCMDBtn m_btn_camera_11; + CCMDBtn m_btn_camera_12; + CCMDBtn m_btn_camera_13; + CCMDBtn m_btn_camera_14;//图像切换 + CCMDBtn m_btn_camera_15;//画中画开 + CCMDBtn m_btn_camera_16;//画中画关 + CCMDBtn m_btn_camera_17;//红外大 + CCMDBtn m_btn_camera_18;//红外小 + CCMDBtn m_btn_camera_19;//复位 + CCMDBtn m_btn_camera_20;//锁定 + CCMDBtn m_btn_camera_21;//扫描 + CCMDBtn m_btn_camera_22;//跟踪 + CCMDBtn m_btn_camera_23;//2M速率 + CCMDBtn m_btn_camera_24;//4M速率 + CCMDBtn m_btn_camera_25;//开始记录 + CCMDBtn m_btn_camera_26;//停止记录 + CCMDBtn m_btn_camera_27;//清除数据 + CCMDBtn m_btn_camera_28;//0-3图拼接 + CCMDBtn m_btn_camera_29;//4-6图拼接 + CCMDBtn m_btn_camera_30;//吊舱通道1 + CCMDBtn m_btn_camera_31;//吊舱通道2 +}; diff --git a/Src/CH91PayloadSoftware/DlgIMP.cpp b/Src/CH91PayloadSoftware/DlgIMP.cpp new file mode 100644 index 0000000..fc019df --- /dev/null +++ b/Src/CH91PayloadSoftware/DlgIMP.cpp @@ -0,0 +1,134 @@ +// DlgIMP.cpp : 实现文件 +// + +#include "stdafx.h" +#include "CH91PayloadSoftware.h" +#include "DlgIMP.h" +#include "afxdialogex.h" + +// CDlgIMP 对话框 + +IMPLEMENT_DYNAMIC(CDlgIMP, CDialogEx) + +CDlgIMP::CDlgIMP() + : CDialogEx(CDlgIMP::IDD) +{ +} + +CDlgIMP::~CDlgIMP() +{ +} + +void CDlgIMP::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CDlgIMP, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON1, &CDlgIMP::OnBnClickedButton1) + + ON_MESSAGE(WM_UPDATE_IMP_SERIAL_CONNECT, ImpSerialConnectMessage) //IMP通信开始消息 + ON_MESSAGE(WM_UPDATE_IMPDOWN_CHECKED, OnUpdateIMPDownDataChecked) //更新IMP下行遥测数据 +END_MESSAGE_MAP() +BOOL CDlgIMP::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + g_IMPDLGhwnd = GetSafeHwnd(); + return TRUE; +} + +// DlgIMP 消息处理程序 +void CDlgIMP::SetIMPData(CFrameIMPDown_ data) +{ + CString tstr; + tstr.Format(_T("%d"),data.Data.Bytes); + GetDlgItem(IDC_EDIT2)->SetWindowTextA(tstr); + + +} + + +void CDlgIMP::OnBnClickedButton1() +{ + // TODO: 在此添加控件通知处理程序代码 +} + +//IMP串口有数据后,进行校验 +void OnReadFromCommIMP( char *buffer,const DWORD size) +{ + //buffer = (unsigned char*)buffer; + const BYTE* buffer2 = (BYTE*)buffer; + if(size>0) + { + BYTE DCBufferCmd[6]; + memset(DCBufferCmd,0,sizeof(DCBufferCmd)); + DCBufferCmd[0] = buffer2[0] ; + DCBufferCmd[1] = buffer2[1] ; + DCBufferCmd[2] = buffer2[2] ; + int a = sizeof(buffer2); + /********进入校验,校验通过就给g_FrameIMPDown赋值********/ + g_FrameIMPDown.Phrase(buffer2, size); + + ::SendMessageA(g_IMPDLGhwnd,WM_UPDATE_IMPDOWN_CHECKED,0,0); + } +} +LRESULT CDlgIMP::ImpSerialConnectMessage(WPARAM param, LPARAM lparam) +{ + // 卸载串口 + if (TRUE == m_SerialIMP.IsInitialized()) + { + m_SerialIMP.DeInit(); + } + else + { + //串口通信设置 + char pSerialPort[20];//串口号 + DWORD pSerialPortBaud;//端口号 + memset(pSerialPort, 0, 20); + + /*自定义消息发送CString类型数据时,消息发送时采用如下方式: + //::SendMessageA(g_IMPDLGhwnd,WM_UPDATE_IMP_SERIAL_CONNECT,(WPARAM)mComPortIMP.AllocSysString(), (LPARAM)mComBaudIMP.AllocSysString()); + //解析时采用如下方式,即:WPARAM转CSTring + */ + CString sPort = (CString)((BSTR)param); + CString sBaud = (CString)((BSTR)lparam); + SysFreeString((BSTR)param); + SysFreeString((BSTR)lparam); + + + GetSerialPortNumber(pSerialPort,sPort); + pSerialPortBaud = atoi(sBaud);//波特率 + + if (!OnCheckComPort(pSerialPort)) //串口被占用,返回false + { + return 0; + } + if(m_SerialIMP.Initialize(pSerialPort, pSerialPortBaud, 8, 0, 0)) //开启串口通信 + { + m_SerialIMP.SetComReadCallback( OnReadFromCommIMP ); + //m_SerialIMP.SetNotCheckCallback(nullptr,NULL); + BYTE buffersend[10]; + memset(buffersend,1,10); + m_SerialIMP.WriteABuffer(buffersend,sizeof(buffersend)); + } + return 0; + } + + +} + +//处理通过校验的IMP下行数据 +LRESULT CDlgIMP::OnUpdateIMPDownDataChecked(WPARAM param, LPARAM lparam) +{ + //数据解析与显示 + //if(p_DlgIMP->IsWindowVisible()) + //{ + // p_DlgIMP->SetIMPData(g_FrameIMPDown); + //} + if(IMPDlgWindowVisible) + { + SetIMPData(g_FrameIMPDown); + } + return 0; +} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/DlgIMP.h b/Src/CH91PayloadSoftware/DlgIMP.h new file mode 100644 index 0000000..1177117 --- /dev/null +++ b/Src/CH91PayloadSoftware/DlgIMP.h @@ -0,0 +1,36 @@ +#pragma once +#include "Global.h" +#include "resource.h" +#include "GlobalMessage.h" +#include "ComControlFunction.h" +#include "Serial.h" + +// CDlgIMP 对话框 + +class CDlgIMP : public CDialogEx +{ + DECLARE_DYNAMIC(CDlgIMP) + +public: + CDlgIMP(); + virtual ~CDlgIMP(); + +// 对话框数据 + enum { IDD = IDD_DLG_IMP }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + DECLARE_MESSAGE_MAP() +public: + void SetIMPData(CFrameIMPDown_ data); + afx_msg void OnBnClickedButton1(); + afx_msg LRESULT ImpSerialConnectMessage(WPARAM param, LPARAM lparam); //IMP通信开始 + virtual BOOL OnInitDialog(); + + CSerial m_SerialIMP; // IMP通信串口 + char pSerialPort[20];//串口号 + DWORD pSerialPortBaud;//端口号 + //void onInitIMPFrame();//初始化IMP协议 + afx_msg LRESULT OnUpdateIMPDownDataChecked(WPARAM param, LPARAM lparam); //处理IMP下行通过校验的遥测数据 +}; diff --git a/Src/CH91PayloadSoftware/DlgRecvDataFromQB.cpp b/Src/CH91PayloadSoftware/DlgRecvDataFromQB.cpp new file mode 100644 index 0000000..3df43bc --- /dev/null +++ b/Src/CH91PayloadSoftware/DlgRecvDataFromQB.cpp @@ -0,0 +1,60 @@ +// DlgRecvDataFromQB.cpp : 实现文件 +// + +#include "stdafx.h" +#include "CH91PayloadSoftware.h" +#include "DlgRecvDataFromQB.h" +#include "afxdialogex.h" +#include "GlobalMember.h" + + +// CDlgRecvDataFromQB 对话框 + +IMPLEMENT_DYNAMIC(CDlgRecvDataFromQB, CDialogEx) + +CDlgRecvDataFromQB::CDlgRecvDataFromQB(CWnd* pParent /*=NULL*/) + : CDialogEx(CDlgRecvDataFromQB::IDD, pParent) + , m_targetLon(0) +{ + +} +CDlgRecvDataFromQB::~CDlgRecvDataFromQB() +{ +} + +void CDlgRecvDataFromQB::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_TARGETLON, m_targetLon); + DDX_Text(pDX, IDC_EDIT_TARGETLAT, m_targetLat); + DDX_Text(pDX, IDC_EDIT_TARGETALT, m_targetAlt); +} + + +BEGIN_MESSAGE_MAP(CDlgRecvDataFromQB, CDialogEx) + ON_BN_CLICKED(IDC_BTN_ADDTOMAP, &CDlgRecvDataFromQB::OnBnClickedBtnAddtomap) +END_MESSAGE_MAP() + + +// CDlgRecvDataFromQB 消息处理程序 + + +BOOL CDlgRecvDataFromQB::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + + // TODO: 在此添加额外的初始化 + g_QBTargetHwnd = GetSafeHwnd(); + return TRUE; // return TRUE unless you set the focus to a control + // 异常: OCX 属性页应返回 FALSE +} + +void CDlgRecvDataFromQB::UpdateTargetData() +{ +} + +// 单击“添加”之后,将目标点显示到地图上 +void CDlgRecvDataFromQB::OnBnClickedBtnAddtomap() +{ + ::PostMessageA(g_MapGuideHwnd, WM_SHOW_TARGET_ONMAP, 0, 0); +} diff --git a/Src/CH91PayloadSoftware/DlgRecvDataFromQB.h b/Src/CH91PayloadSoftware/DlgRecvDataFromQB.h new file mode 100644 index 0000000..0a21c9a --- /dev/null +++ b/Src/CH91PayloadSoftware/DlgRecvDataFromQB.h @@ -0,0 +1,30 @@ +#pragma once +#include "resource.h" +#include "GlobalMessage.h" +// CDlgRecvDataFromQB 对话框 + +class CDlgRecvDataFromQB : public CDialogEx +{ + DECLARE_DYNAMIC(CDlgRecvDataFromQB) + +public: + CDlgRecvDataFromQB(CWnd* pParent = NULL); // 标准构造函数 + virtual ~CDlgRecvDataFromQB(); + +// 对话框数据 + enum { IDD = IDD_DLG_RECVFROMQB }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + DECLARE_MESSAGE_MAP() +public: + double m_targetLon; // 情报席位目标定位经度 + double m_targetLat; // 情报席位目标定位纬度 + double m_targetAlt; // 情报席位目标定位高度 + virtual BOOL OnInitDialog(); + + // 解析情报席位目标定位信息 + void UpdateTargetData(); + afx_msg void OnBnClickedBtnAddtomap(); +}; diff --git a/Src/CH91PayloadSoftware/DlgWHTJDCNew.cpp b/Src/CH91PayloadSoftware/DlgWHTJDCNew.cpp new file mode 100644 index 0000000..59d01d2 --- /dev/null +++ b/Src/CH91PayloadSoftware/DlgWHTJDCNew.cpp @@ -0,0 +1,1712 @@ +// DlgWHTJDCNew.cpp : 实现文件 + +#include "stdafx.h" +#include "DlgWHTJDCNew.h" +#include "afxdialogex.h" + +/*组播发送*/ +#include +#include +#include + + +//tag_RecBind +HWND g_hwndWHTJDCNew = nullptr; +//线程函数 单次 +void ThreadWHTJDCNew() +{ + //发送消息 + ::PostMessage(g_hwndWHTJDCNew,WM_WHTJDC_UPDAFRAME,(WPARAM)g_WHTJDCCmdNum,(LPARAM)0); + Sleep(50); + ::PostMessage(g_hwndWHTJDCNew,WM_WHTJDC_UPDAFRAME,(WPARAM)g_WHTJDCCmdNum,(LPARAM)1); + +} +//线程函数 连续 +void ThreadWHTJDCNew2() +{ + do + { + ::PostMessage(g_hwndWHTJDCNew,WM_WHTJDC_UPDAFRAME,(WPARAM)g_WHTJDCCmdNum,(LPARAM)0); + Sleep(80); + } + while(g_bBindData==true);//按钮抬起,g_bBindData变成fasle,循环结束 + //::PostMessage(g_hwndWHTJDCNew,WM_WHTJDC_UPDAFRAME,(WPARAM)g_WHTJDCCmdNum,(LPARAM)1); +} + +IMPLEMENT_DYNAMIC(DlgWHTJDCNew, CDialogEx) + +DlgWHTJDCNew::DlgWHTJDCNew(CWnd* pParent /*=NULL*/) + : CDialogEx(DlgWHTJDCNew::IDD, pParent) + , m_TarTakTemSizeSetWidth(_T("")) + , m_TarTakTemSizeSetHigth(_T("")) + , m_FocalDistanceSet(_T("")) + , m_DigitalGuidanceDir(_T("")) + , m_DigitalGuidancePitch(_T("")) + , m_SCanModelAngle(_T("")) + , m_SCanModelSpeed(_T("")) + , m_DirSCanSetCentre(_T("")) + , m_DirSCanSetRange(_T("")) + , m_PitchSCanSetCentre(_T("")) + , m_PitchSCanSetRange(_T("")) +{ + CharacterSuperpositionSet = 0; + FogThroughMode = 0; + PseudoColorSwitch = 0; + FocalDistanceSIZE = 3; + DirAndPitchCrlSize = 8; +} + +DlgWHTJDCNew::~DlgWHTJDCNew() +{ +} + +void DlgWHTJDCNew::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW, DC13InsBtn[0]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW2, DC13InsBtn[1]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW3, DC13InsBtn[2]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW4, DC13InsBtn[3]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW5, DC13InsBtn[4]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW6, DC13InsBtn[5]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW7, DC13InsBtn[6]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW8, DC13InsBtn[7]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW9, DC13InsBtn[8]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW10, DC13InsBtn[9]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW11, DC13InsBtn[10]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW12, DC13InsBtn[11]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW13, DC13InsBtn[12]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW14, DC13InsBtn[13]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW15, DC13InsBtn[14]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW16, DC13InsBtn[15]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW17, DC13InsBtn[16]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW18, DC13InsBtn[17]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW19, DC13InsBtn[18]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW20, DC13InsBtn[19]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW21, DC13InsBtn[20]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW22, DC13InsBtn[21]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW23, DC13InsBtn[22]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW24, DC13InsBtn[23]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW25, DC13InsBtn[24]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW26, DC13InsBtn[25]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW27, DC13InsBtn[26]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW28, DC13InsBtn[27]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW29, DC13InsBtn[28]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW30, DC13InsBtn[29]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW31, DC13InsBtn[30]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW32, DC13InsBtn[31]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW33, DC13InsBtn[32]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW34, DC13InsBtn[33]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW35, DC13InsBtn[34]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW36, DC13InsBtn[35]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW37, DC13InsBtn[36]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW38, DC13InsBtn[37]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW39, DC13InsBtn[38]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW40, DC13InsBtn[39]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW41, DC13InsBtn[40]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW42, DC13InsBtn[41]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW43, DC13InsBtn[42]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW44, DC13InsBtn[43]); + //DDX_Text(pDX, IDC_EDIT_Pitch_Param, Param1); + + //DDX_Text(pDX, IDC_EDIT_Dir_Param, Param2); + + + DDX_Control(pDX, IDC_BUTTON1, m_DCFlyCmd[0]);//吊舱通道1 + DDX_Control(pDX, IDC_BUTTON2, m_DCFlyCmd[1]);//吊舱通道2 + DDX_Control(pDX, IDC_BUTTON3, m_DCFlyCmd[2]); + DDX_Control(pDX, IDC_BUTTON4, m_DCFlyCmd[3]); + DDX_Control(pDX, IDC_BUTTON5, m_DCFlyCmd[4]); + DDX_Control(pDX, IDC_BUTTON6, m_DCFlyCmd[5]); + DDX_Control(pDX, IDC_BUTTON7, m_DCFlyCmd[6]); + DDX_Control(pDX, IDC_BUTTON8, m_DCFlyCmd[7]); + DDX_Control(pDX, IDC_BUTTON9, m_DCFlyCmd[8]); + DDX_Control(pDX, IDC_BUTTON10, m_DCFlyCmd[9]); + DDX_Control(pDX, IDC_BUTTON11, m_DCFlyCmd[10]); + DDX_Control(pDX, IDC_BUTTON12, m_DCFlyCmd[11]); + + DDX_Text(pDX, IDC_EDIT_WHTD_6, m_TarTakTemSizeSetWidth); + DDX_Text(pDX, IDC_EDIT_WHTD_7, m_TarTakTemSizeSetHigth); + DDX_Text(pDX, IDC_EDIT_WHTD_5, m_FocalDistanceSet); + DDX_Text(pDX, IDC_EDIT_WHTD_3, m_DigitalGuidanceDir); + DDX_Text(pDX, IDC_EDIT_WHTD_4, m_DigitalGuidancePitch); + DDX_Text(pDX, IDC_EDIT_WHTD_1, m_SCanModelAngle); + DDX_Text(pDX, IDC_EDIT_WHTD_2, m_SCanModelSpeed); + DDX_Text(pDX, IDC_EDIT_WHTD_8, m_DirSCanSetCentre); + DDX_Text(pDX, IDC_EDIT_WHTD_9, m_DirSCanSetRange); + DDX_Text(pDX, IDC_EDIT_WHTD_10, m_PitchSCanSetCentre); + DDX_Text(pDX, IDC_EDIT_WHTD_11, m_PitchSCanSetRange); +} + +BOOL DlgWHTJDCNew::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + CenterWindow(); + + g_hwndWHTJDCNew = this->GetSafeHwnd(); + + CFont m_oFont;//字体 + m_oFont.CreatePointFont(80, _T("Times New Roman"),NULL); + for(int i = 0;i<44;++i) + { + //DC13InsBtn[i].SetTextColor(RGB(255,255,255)); + //DC13InsBtn[i].SetFont(&m_oFont); + //DC13InsBtn[i].SetFaceColor(RGB(54,54,54),true); + if(i==0||i==1||i==2||i==3||i==6||i==7||i==29||i==33) + { + DC13InsBtn[i].SetTextColor(RGB(0,0,0)); + DC13InsBtn[i].SetFont(&m_oFont); + DC13InsBtn[i].SetFaceColor(RGB(133,220,49),true); + } + else + { + DC13InsBtn[i].SetTextColor(RGB(0,0,0)); + DC13InsBtn[i].SetFont(&m_oFont); + DC13InsBtn[i].SetFaceColor(RGB(204,255,255),true); + } + } + + CFont m_font; + m_font.CreatePointFont(100,_T("宋体"),NULL); + //CWnd* pWnd = GetDlgItem(IDC_STATIC_PitchAndDir); + //pWnd->SetFont(&m_font); + + CFont m_font2; + m_font2.CreatePointFont(120,_T("宋体"),NULL); + + CWnd* pWnd2 = GetDlgItem(IDC_EDIT_WHTD_1); + pWnd2->SetFont(&m_font2); + GetDlgItem(IDC_EDIT_WHTD_1)->SetWindowText("100"); + + CWnd* pWnd3 = GetDlgItem(IDC_EDIT_WHTD_2); + pWnd3->SetFont(&m_font2); + GetDlgItem(IDC_EDIT_WHTD_2)->SetWindowText("5"); + + CWnd* pWnd4 = GetDlgItem(IDC_EDIT_WHTD_3); + pWnd4->SetFont(&m_font2); + GetDlgItem(IDC_EDIT_WHTD_3)->SetWindowText("0.00"); + + CWnd* pWnd5 = GetDlgItem(IDC_EDIT_WHTD_4); + pWnd5->SetFont(&m_font2); + GetDlgItem(IDC_EDIT_WHTD_4)->SetWindowText("0.00"); + + CWnd* pWnd6 = GetDlgItem(IDC_EDIT_WHTD_5); + pWnd6->SetFont(&m_font2); + GetDlgItem(IDC_EDIT_WHTD_5)->SetWindowText("0.0"); + + CWnd* pWnd7 = GetDlgItem(IDC_EDIT_WHTD_6); + pWnd7->SetFont(&m_font2); + GetDlgItem(IDC_EDIT_WHTD_6)->SetWindowText("0"); + + CWnd* pWnd8 = GetDlgItem(IDC_EDIT_WHTD_7); + pWnd8->SetFont(&m_font2); + GetDlgItem(IDC_EDIT_WHTD_7)->SetWindowText("0"); + + CWnd* pWnd9 = GetDlgItem(IDC_EDIT_WHTD_8); + pWnd9->SetFont(&m_font2); + GetDlgItem(IDC_EDIT_WHTD_8)->SetWindowText("0"); + + CWnd* pWnd10 = GetDlgItem(IDC_EDIT_WHTD_9); + pWnd10->SetFont(&m_font2); + GetDlgItem(IDC_EDIT_WHTD_9)->SetWindowText("100"); + + CWnd* pWnd11 = GetDlgItem(IDC_EDIT_WHTD_10); + pWnd11->SetFont(&m_font2); + GetDlgItem(IDC_EDIT_WHTD_10)->SetWindowText("-15"); + + CWnd* pWnd12 = GetDlgItem(IDC_EDIT_WHTD_11); + pWnd12->SetFont(&m_font2); + GetDlgItem(IDC_EDIT_WHTD_11)->SetWindowText("50"); + + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_1))->InsertString(0,_TEXT("自定义大小")); + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_1))->InsertString(1,_TEXT("小模版(16*16)")); + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_1))->InsertString(2,_TEXT("中模版(32*32)")); + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_1))->InsertString(3,_TEXT("大模版(64*64)")); + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_1))->InsertString(4,_TEXT("超大模版(128*128)")); + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_1))->SetCurSel(0); + + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_2))->InsertString(0,_TEXT("非常慢")); + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_2))->InsertString(1,_TEXT("很慢")); + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_2))->InsertString(2,_TEXT("较慢")); + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_2))->InsertString(3,_TEXT("慢")); + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_2))->InsertString(4,_TEXT("中等")); + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_2))->InsertString(5,_TEXT("快")); + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_2))->InsertString(6,_TEXT("较快")); + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_2))->InsertString(7,_TEXT("很快")); + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_2))->InsertString(8,_TEXT("非常快")); + ((CComboBox * )GetDlgItem(IDC_COMBO_TJDC_2))->SetCurSel(4); + + for(int i=0;i<12;++i) + { + m_DCFlyCmd[i].Cmd=i+1; + m_DCFlyCmd[i].Cmdpage = 20;//这里的页面标志设置为20 + m_DCFlyCmd[i].SetTextColor(RGB(0,0,0)); + m_DCFlyCmd[i].SetFont(&m_oFont); + m_DCFlyCmd[i].SetFaceColor(RGB(24,225,255),true); + } + + memset(TJDCCmdBuffer,0,sizeof(TJDCCmdBuffer)); + + return TRUE; +} + +BEGIN_MESSAGE_MAP(DlgWHTJDCNew, CDialogEx) + ON_MESSAGE(WM_WHTJDC_UPDAFRAME, &DlgWHTJDCNew::OnUpdateWHTJDCFrame) + ON_WM_CTLCOLOR() + ON_CBN_SELCHANGE(IDC_COMBO_TJDC_2, &DlgWHTJDCNew::OnCbnSelchangeComboTjdc2) + ON_WM_LBUTTONDOWN() +END_MESSAGE_MAP() + + +// DlgWHTJDCNew 消息处理程序 +//接收线程来的消息,处理消息 +afx_msg LRESULT DlgWHTJDCNew::OnUpdateWHTJDCFrame(WPARAM wParam, LPARAM lParam) +{ + switch ((int)wParam) + { + case 0: + UpdateFrame(); + break; + case 2: + UpdateFrame2(); + break; + case 3: + UpdateFrame3(); + break; + case 4: + UpdateFrame4(); + break; + case 5: + UpdateFrame5((int&)lParam); + break; + case 6: + UpdateFrame6((int&)lParam); + break; + case 7: + UpdateFrame7(); + break; + case 8: + UpdateFrame8(); + break; + case 9: + UpdateFrame9((int&)lParam); + break; + case 10: + UpdateFrame10((int&)lParam); + break; + case 11: + UpdateFrame11((int&)lParam); + break; + case 12: + UpdateFrame12((int&)lParam); + break; + case 13: + UpdateFrame13((int&)lParam); + break; + case 14: + UpdateFrame14((int&)lParam); + break; + case 15: + UpdateFrame15((int&)lParam); + break; + case 16: + UpdateFrame16((int&)lParam); + break; + case 17: + UpdateFrame17((int&)lParam); + break; + case 18: + UpdateFrame18((int&)lParam); + break; + case 19: + UpdateFrame19((int&)lParam); + break; + case 20: + UpdateFrame20((int&)lParam); + break; + case 21: + UpdateFrame21((int&)lParam); + break; + case 22: + UpdateFrame22((int&)lParam); + break; + case 23: + UpdateFrame23((int&)lParam); + break; + case 24: + UpdateFrame24((int&)lParam); + break; + case 25: + UpdateFrame25((int&)lParam); + break; + case 26: + UpdateFrame26((int&)lParam); + break; + case 27: + UpdateFrame27((int&)lParam); + break; + case 28: + UpdateFrame28((int&)lParam); + break; + case 29: + UpdateFrame29((int&)lParam); + break; + case 30: + UpdateFrame30(); + break; + case 31: + UpdateFrame31((int&)lParam); + break; + case 32: + UpdateFrame32((int&)lParam); + break; + case 33: + UpdateFrame33((int&)lParam); + break; + case 34: + UpdateFrame34(); + break; + case 35: + UpdateFrame35((int&)lParam); + break; + case 36: + UpdateFrame36((int&)lParam); + break; + case 37: + UpdateFrame37((int&)lParam); + break; + case 38: + UpdateFrame38((int&)lParam); + break; + case 39: + UpdateFrame39((int&)lParam); + break; + case 40: + UpdateFrame40((int&)lParam); + break; + case 41: + UpdateFrame41((int&)lParam); + break; + case 43: + UpdateFrame43((int&)lParam); + break; + case 44: + UpdateFrame44((int&)lParam); + break; + case 100: + UpdateFrame100((int&)lParam); + break; + case 101: + UpdateFrame101((int&)lParam); + break; + default: + break; + } + + //if((int&)lParam == 0) + //{ + // if(g_IsSending){ + // g_MUDPCamera.SendToY(DCFrameCkCmdWHTJ.Addr(), 20); + // } + //} + return 0; +} + +//更新13所吊舱控制指令 按钮按下,分类进行处理。 +//对于重复发送的指令,直接赋值,直至按钮抬起,装订标志变为false,发送停止 +//对于只发送一次的指令,开启一个线程,线程中相差100ms发送先后发送赋值和清空操作。赋值期间指令发送(GCSView::Setp函数),清空后指令不再发送。 +void DlgWHTJDCNew::UpdateWHTJDCCmdBuffer(HWND hwnd) +{ + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW)->m_hWnd) + { + g_WHTJDCCmdNum = 0; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW2)->m_hWnd) + { + g_WHTJDCCmdNum = 2; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW3)->m_hWnd) + { + g_WHTJDCCmdNum = 3; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW4)->m_hWnd) + { + g_WHTJDCCmdNum = 4; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW5)->m_hWnd) + { + g_WHTJDCCmdNum = 5; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW6)->m_hWnd) + { + g_WHTJDCCmdNum = 6; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW7)->m_hWnd) + { + g_WHTJDCCmdNum = 7; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW8)->m_hWnd) + { + g_WHTJDCCmdNum = 8; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW9)->m_hWnd) + { + g_WHTJDCCmdNum = 9; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW10)->m_hWnd) + { + g_WHTJDCCmdNum = 10; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW11)->m_hWnd) + { + g_WHTJDCCmdNum = 11; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW12)->m_hWnd) + { + g_WHTJDCCmdNum = 12; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW13)->m_hWnd) + { + g_WHTJDCCmdNum = 13; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW14)->m_hWnd) + { + //UpdateFrame14(); + g_WHTJDCCmdNum = 14; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW15)->m_hWnd) + { + //UpdateFrame15(); + g_WHTJDCCmdNum = 15; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW16)->m_hWnd) + { + g_WHTJDCCmdNum = 16; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW17)->m_hWnd) + { + g_WHTJDCCmdNum = 17; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW18)->m_hWnd) + { + g_WHTJDCCmdNum = 18; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW19)->m_hWnd) + { + g_WHTJDCCmdNum = 19; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW20)->m_hWnd) + { + //UpdateFrame20(); + g_WHTJDCCmdNum = 20; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW21)->m_hWnd) + { + //UpdateFrame21(); + g_WHTJDCCmdNum = 21; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW22)->m_hWnd) + { + g_WHTJDCCmdNum = 22; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW23)->m_hWnd) + { + g_WHTJDCCmdNum = 23; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW24)->m_hWnd) + { + g_WHTJDCCmdNum = 24; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW25)->m_hWnd) + { + g_WHTJDCCmdNum = 25; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW26)->m_hWnd) + { + g_WHTJDCCmdNum = 26; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW27)->m_hWnd) + { + g_WHTJDCCmdNum = 27; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW28)->m_hWnd) + { + g_WHTJDCCmdNum = 28; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW29)->m_hWnd) + { + g_WHTJDCCmdNum = 29; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW30)->m_hWnd) + { + g_WHTJDCCmdNum = 30; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW31)->m_hWnd) + { + g_WHTJDCCmdNum = 31; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW32)->m_hWnd) + { + g_WHTJDCCmdNum = 32; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW33)->m_hWnd) + { + g_WHTJDCCmdNum = 33; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW34)->m_hWnd) + { + g_WHTJDCCmdNum = 34; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew2, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW35)->m_hWnd) + { + g_WHTJDCCmdNum = 35; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW36)->m_hWnd) + { + g_WHTJDCCmdNum = 36; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW37)->m_hWnd) + { + g_WHTJDCCmdNum = 37; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW38)->m_hWnd) + { + g_WHTJDCCmdNum = 38; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW39)->m_hWnd) + { + g_WHTJDCCmdNum = 39; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW40)->m_hWnd) + { + g_WHTJDCCmdNum = 40; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW41)->m_hWnd) + { + g_WHTJDCCmdNum = 41; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW43)->m_hWnd) + { + g_WHTJDCCmdNum = 43; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW44)->m_hWnd) + { + g_WHTJDCCmdNum = 44; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } +} +void DlgWHTJDCNew::UpdateDataZ70_TJDC() +{ + DCFrameCkCmdWHTJ.Data.fcode=0x70; + DCFrameCkCmdWHTJ.Data.dataInject_DC.DCtype = TJDCCmdBuffer[0];//0x02 + DCFrameCkCmdWHTJ.Data.dataInject_DC.DC_WHTJ.param = TJDCCmdBuffer[1]; + DCFrameCkCmdWHTJ.Data.dataInject_DC.DC_WHTJ.param2 = TJDCCmdBuffer[2]; + DCFrameCkCmdWHTJ.Data.dataInject_DC.DC_WHTJ.param3 = TJDCCmdBuffer[3]; + DCFrameCkCmdWHTJ.Data.dataInject_DC.DC_WHTJ.param4 = TJDCCmdBuffer[4]; + DCFrameCkCmdWHTJ.Data.dataInject_DC.DC_WHTJ.param5 = TJDCCmdBuffer[5]; + DCFrameCkCmdWHTJ.Data.dataInject_DC.DC_WHTJ.param6 = TJDCCmdBuffer[6]; + DCFrameCkCmdWHTJ.Data.dataInject_DC.DC_WHTJ.param7 = TJDCCmdBuffer[7]; + DCFrameCkCmdWHTJ.Data.dataInject_DC.DC_WHTJ.param8 = TJDCCmdBuffer[8]; + DCFrameCkCmdWHTJ.Data.dataInject_DC.DC_WHTJ.param9 = TJDCCmdBuffer[9]; + DCFrameCkCmdWHTJ.Data.dataInject_DC.DC_WHTJ.param10 = TJDCCmdBuffer[10]; + DCFrameCkCmdWHTJ.Data.dataInject_DC.DC_WHTJ.param11 = TJDCCmdBuffer[11]; + DCFrameCkCmdWHTJ.Data.dataInject_DC.DC_WHTJ.param12 = TJDCCmdBuffer[12]; + DCFrameCkCmdWHTJ.Data.dataInject_DC.DC_WHTJ.param13 = TJDCCmdBuffer[13]; + DCFrameCkCmdWHTJ.Data.dataInject_DC.DC_WHTJ.param14 = TJDCCmdBuffer[14]; + DCFrameCkCmdWHTJ.SendPrepare(); + + if(g_IsSending){ + g_MUDPCamera.SendToY(DCFrameCkCmdWHTJ.Addr(), 20); + } + + //TJDCCmdBuffer清空 + memset(TJDCCmdBuffer,0,sizeof(TJDCCmdBuffer)); + +} +void DlgWHTJDCNew::UpdateFrame() +{ + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[6]=0x70; + TJDCCmdBuffer[7]=0x00; + TJDCCmdBuffer[8]=0x00; + TJDCCmdBuffer[9]=DirAndPitchCrlSize; + TJDCCmdBuffer[10]=DirAndPitchCrlSize>>8; + UpdateDataZ70_TJDC(); + g_bBindData = true; + +} +void DlgWHTJDCNew::UpdateFrame2() +{ + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[6]=0x70; + TJDCCmdBuffer[7]=0x00; + TJDCCmdBuffer[8]=0x00; + TJDCCmdBuffer[9]=-DirAndPitchCrlSize; + TJDCCmdBuffer[10]=-DirAndPitchCrlSize>>8; + UpdateDataZ70_TJDC(); + g_bBindData = true; + +} +void DlgWHTJDCNew::UpdateFrame3() +{ + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[6]=0x70; + TJDCCmdBuffer[7]=-DirAndPitchCrlSize; + TJDCCmdBuffer[8]=-DirAndPitchCrlSize>>8; + TJDCCmdBuffer[9]=0x00; + TJDCCmdBuffer[10]=0x00; + UpdateDataZ70_TJDC(); + g_bBindData = true; +} +void DlgWHTJDCNew::UpdateFrame4() +{ + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[6]=0x70; + TJDCCmdBuffer[7]=DirAndPitchCrlSize; + TJDCCmdBuffer[8]=DirAndPitchCrlSize>>8; + TJDCCmdBuffer[9]=0x00; + TJDCCmdBuffer[10]=0x00; + UpdateDataZ70_TJDC(); + g_bBindData = true; +} +void DlgWHTJDCNew::UpdateFrame5(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x71; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame6(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x31; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame7() +{ + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x45; + TJDCCmdBuffer[2]=0x03; + TJDCCmdBuffer[3]=FocalDistanceSIZE; + UpdateDataZ70_TJDC(); + g_bBindData = true; +} +void DlgWHTJDCNew::UpdateFrame8() +{ + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x45; + TJDCCmdBuffer[2]=0x04; + TJDCCmdBuffer[3]=FocalDistanceSIZE; + UpdateDataZ70_TJDC(); + g_bBindData = true; +} +void DlgWHTJDCNew::UpdateFrame9(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x3A; + TJDCCmdBuffer[2]=0x00; + TJDCCmdBuffer[3]=0x00; + TJDCCmdBuffer[4]=0x00; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame10(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x32; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame11(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x33; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame12(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x37; + if(CharacterSuperpositionSet==0){CharacterSuperpositionSet = 1;} + else if(CharacterSuperpositionSet==1){CharacterSuperpositionSet = 2;} + else if(CharacterSuperpositionSet==2){CharacterSuperpositionSet = 0;} + TJDCCmdBuffer[2]=CharacterSuperpositionSet; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame13(int &sendEnd) +{ + if(sendEnd==0) + { + SelectPointTrack = true; + //TJDCCmdBuffer[0]=0x02; + //TJDCCmdBuffer[1]=0x3A; + //TJDCCmdBuffer[2]=0x00; + //TJDCCmdBuffer[3]=0x00; + //TJDCCmdBuffer[4]=0x00; + //TJDCCmdBuffer[5]=0x00; + //UpdateDataZ70_TJDC(); + g_bBindData = true; + //MessageBox(_T("地面站不支持选点跟踪功能,默认选择图像中心")); + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame13_1() +{ + //x1 m_wndShowEO_Position_Max_x + //y1 m_wndShowEO_Position_Max_y + //x2 g_TrackOffset.x + //y2 g_TrackOffset.y + //double k1 = (float)1920/1080; + + //获取实际图像区域坐标 + //x,y实际图像区域坐标,b:实际图像区域和软件图像区域x方向偏移量,k比例系数 + int x,y,b; + float k; + k = 1080/m_wndShowEO_Position_Max_y; + y = g_TrackOffset.y * k; + b = 0.5*(m_wndShowEO_Position_Max_x * k-1920); + x = (g_TrackOffset.x - b) * k; + if(x<0||x>1920) + { + return; + } + //转化为吊舱控制指令坐标,中心为零,x范围:[-960,960],y范围:[-540,540]; + int xx = x-960; + int yy = y-540; + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x3A; + TJDCCmdBuffer[2]=xx; + TJDCCmdBuffer[3]=xx>>8; + TJDCCmdBuffer[4]=yy; + TJDCCmdBuffer[5]=yy>>8; + UpdateDataZ70_TJDC(); + SelectPointTrack = false; + +} +void DlgWHTJDCNew::UpdateFrame14(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x36; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame15(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x3D; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame16(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x34; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame17(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x33; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame18(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x33; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame19(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x3B; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame20(int &sendEnd) +{ + if(sendEnd==0) + { + if(!UpdateData(TRUE))//更新对话框对应的变量内容 + { + MessageBox(_T("请输入正确数据!!!")); + return; + } + + if(!IsPositiveInteger(m_TarTakTemSizeSetWidth)||!IsPositiveInteger(m_TarTakTemSizeSetHigth)) + { + MessageBox(_T("请输入一个0-255的正整数!")); + return; + } + int TarTakTemSizeSetWidth,TarTakTemSizeSetHigth; + TarTakTemSizeSetWidth = _ttoi(m_TarTakTemSizeSetWidth); + TarTakTemSizeSetHigth = _ttoi(m_TarTakTemSizeSetHigth); + if(TarTakTemSizeSetWidth<0||TarTakTemSizeSetWidth>255||TarTakTemSizeSetHigth<0||TarTakTemSizeSetHigth>255) + { + MessageBox(_T("目标跟踪模板大小设置范围0-255!")); + return; + } + + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x23; + int m_TDFlag = ((CComboBox*)GetDlgItem(IDC_COMBO_TJDC_1))->GetCurSel();//获得IDC_COMBO_TJDC_1按钮的当前选择 + switch (m_TDFlag) + { + case 0: + TJDCCmdBuffer[2]=0x00; + TJDCCmdBuffer[3]=0; + TJDCCmdBuffer[4]=TarTakTemSizeSetWidth; + TJDCCmdBuffer[5]=TarTakTemSizeSetHigth; + break; + case 1: + TJDCCmdBuffer[2]=0x01; + TJDCCmdBuffer[3]=0; + TJDCCmdBuffer[4]=0; + TJDCCmdBuffer[5]=0; + break; + case 2: + TJDCCmdBuffer[2]=0x02; + TJDCCmdBuffer[3]=0; + TJDCCmdBuffer[4]=0; + TJDCCmdBuffer[5]=0; + break; + case 3: + TJDCCmdBuffer[2]=0x03; + TJDCCmdBuffer[3]=0; + TJDCCmdBuffer[4]=0; + TJDCCmdBuffer[5]=0; + break; + case 4: + TJDCCmdBuffer[2]=0x04; + TJDCCmdBuffer[3]=0; + TJDCCmdBuffer[4]=0; + TJDCCmdBuffer[5]=0; + break; + default: + break; + } + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } + +} +void DlgWHTJDCNew::UpdateFrame21(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x38; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame22(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x3E; + TJDCCmdBuffer[2]=0x02; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame23(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x53; + TJDCCmdBuffer[2]=0x01; + if(PseudoColorSwitch==0){PseudoColorSwitch = 1;} + else if(PseudoColorSwitch==1){PseudoColorSwitch = 2;} + else if(PseudoColorSwitch==2){PseudoColorSwitch = 3;} + else if(PseudoColorSwitch==3){PseudoColorSwitch = 4;} + else if(PseudoColorSwitch==4){PseudoColorSwitch = 5;} + else if(PseudoColorSwitch==5){PseudoColorSwitch = 6;} + else if(PseudoColorSwitch==6){PseudoColorSwitch = 7;} + else if(PseudoColorSwitch==7){PseudoColorSwitch = 8;} + else if(PseudoColorSwitch==8){PseudoColorSwitch = 9;} + else if(PseudoColorSwitch==9){PseudoColorSwitch = 10;} + else if(PseudoColorSwitch==10){PseudoColorSwitch = 0;} + TJDCCmdBuffer[3]=PseudoColorSwitch; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame24(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x56; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame25(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x54; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame26(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x57; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame27(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x79; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame28(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x73; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame29(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x3F; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame30() +{ + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x45; + TJDCCmdBuffer[2]=0x01; + TJDCCmdBuffer[3]=FocalDistanceSIZE; + UpdateDataZ70_TJDC(); + g_bBindData = true; + +} +void DlgWHTJDCNew::UpdateFrame31(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x4A; + if(FogThroughMode==0){FogThroughMode = 1;} + else if(FogThroughMode==1){FogThroughMode = 2;} + else if(FogThroughMode==2){FogThroughMode = 0;} + TJDCCmdBuffer[2]=FogThroughMode; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame32(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x75; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame33(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x7B; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame34() +{ + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x45; + TJDCCmdBuffer[2]=0x02; + TJDCCmdBuffer[3]=FocalDistanceSIZE; + UpdateDataZ70_TJDC(); + g_bBindData = true; +} +void DlgWHTJDCNew::UpdateFrame35(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x4B; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame36(int &sendEnd) +{ + if(sendEnd==0) + { + if(!UpdateData(TRUE))//更新对话框对应的变量内容 + { + MessageBox(_T("请输入正确数据!!!")); + return; + } + if(!IsPositiveNumber(m_FocalDistanceSet)) + { + MessageBox(_T("请输入[4.3,129.0]之间的正数")); + return; + } + float FocalDistanceSet; + FocalDistanceSet = _ttof(m_FocalDistanceSet); + if(FocalDistanceSet<0.0||FocalDistanceSet>129.0) + { + MessageBox("焦距设置有效范围[4.3,129.0]"); + return; + } + UINT16 UINT16FocalDistanceSet; + UINT16FocalDistanceSet = (UINT16)(FocalDistanceSet*10); + + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x4C; + TJDCCmdBuffer[2]=UINT16FocalDistanceSet; + TJDCCmdBuffer[3]=UINT16FocalDistanceSet>>8; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame37(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x74; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame38(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x7A; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame39(int &sendEnd) +{ + if(sendEnd==0) + { + if(!UpdateData(TRUE))//更新对话框对应的变量内容 + { + MessageBox(_T("请输入正确数据!!!")); + return; + } + + if(!IsNumber(m_DigitalGuidanceDir)||!IsNumber(m_DigitalGuidancePitch)) + { + MessageBox(_T("请输入数字!")); + return; + } + float DigitalGuidanceDir,DigitalGuidancePitch; + DigitalGuidanceDir = _ttof(m_DigitalGuidanceDir); + DigitalGuidancePitch = _ttof(m_DigitalGuidancePitch); + if(DigitalGuidanceDir<-180||DigitalGuidanceDir>180) + { + MessageBox(_T("数字导引方位设置范围[-180.00,180.00]")); + return; + } + if(DigitalGuidancePitch<-120||DigitalGuidancePitch>90) + { + MessageBox(_T("数字导引俯仰设置范围[-120.00,90.00]")); + return; + } + INT16 UINT16DigitalGuidanceDir,UINT16DigitalGuidancePitch; + UINT16DigitalGuidanceDir = (INT16)(DigitalGuidanceDir*100); + UINT16DigitalGuidancePitch = (INT16)(DigitalGuidancePitch*100); + + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x72; + TJDCCmdBuffer[2]=UINT16DigitalGuidanceDir; + TJDCCmdBuffer[3]=UINT16DigitalGuidanceDir>>8; + TJDCCmdBuffer[4]=UINT16DigitalGuidancePitch; + TJDCCmdBuffer[5]=UINT16DigitalGuidancePitch>>8; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame40(int &sendEnd) +{ + if(sendEnd==0) + { + if(!UpdateData(TRUE))//更新对话框对应的变量内容 + { + MessageBox(_T("请输入正确数据!!!")); + return; + } + if(!IsPositiveInteger(m_SCanModelSpeed)||!IsPositiveInteger(m_SCanModelAngle)) + { + MessageBox(_T("请输入正整数!")); + return; + } + INT16 SCanModelSpeed,SCanModelAngle; + SCanModelSpeed = _ttoi(m_SCanModelSpeed); + SCanModelAngle = _ttoi(m_SCanModelAngle); + if(SCanModelAngle<0||SCanModelAngle>180) + { + MessageBox(_T("扫描角度设置范围0-180!")); + return; + } + if(SCanModelSpeed<0||SCanModelSpeed>100) + { + MessageBox(_T("扫描速度设置范围0-100!")); + return; + } + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x79; + TJDCCmdBuffer[2]=SCanModelAngle; + TJDCCmdBuffer[3]=SCanModelAngle>>8; + TJDCCmdBuffer[4]=SCanModelSpeed; + TJDCCmdBuffer[5]=SCanModelSpeed>>8; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame41(int &sendEnd) +{ + if(sendEnd==0) + { + if(!UpdateData(TRUE))//更新对话框对应的变量内容 + { + MessageBox(_T("请输入正确数据!!!")); + return; + } + + if(!IsNumber(m_DigitalGuidanceDir)||!IsNumber(m_DigitalGuidancePitch)) + { + MessageBox(_T("请输入数字!")); + return; + } + float DigitalGuidanceDir,DigitalGuidancePitch; + DigitalGuidanceDir = _ttof(m_DigitalGuidanceDir); + DigitalGuidancePitch = _ttof(m_DigitalGuidancePitch); + if(DigitalGuidanceDir<-180||DigitalGuidanceDir>180) + { + MessageBox(_T("姿态指引方位设置范围[-180.00,180.00]")); + return; + } + if(DigitalGuidancePitch<-120||DigitalGuidancePitch>90) + { + MessageBox(_T("姿态指引俯仰设置范围[-120.00,90.00]")); + return; + } + INT16 UINT16DigitalGuidanceDir,UINT16DigitalGuidancePitch; + UINT16DigitalGuidanceDir = (INT16)(DigitalGuidanceDir*100); + UINT16DigitalGuidancePitch = (INT16)(DigitalGuidancePitch*100); + + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x7C; + TJDCCmdBuffer[2]=UINT16DigitalGuidanceDir; + TJDCCmdBuffer[3]=UINT16DigitalGuidanceDir>>8; + TJDCCmdBuffer[4]=UINT16DigitalGuidancePitch; + TJDCCmdBuffer[5]=UINT16DigitalGuidancePitch>>8; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame43(int &sendEnd) +{ + if(sendEnd==0) + { + if(!UpdateData(TRUE))//更新对话框对应的变量内容 + { + MessageBox(_T("请输入正确数据!!!")); + return; + } + if(!IsPositiveInteger(m_DirSCanSetCentre)||!IsPositiveInteger(m_DirSCanSetRange)) + { + MessageBox(_T("请输入正整数!")); + return; + } + INT16 DirSCanSetCentre,DirSCanSetRange; + DirSCanSetCentre = _ttoi(m_DirSCanSetCentre); + DirSCanSetRange = _ttoi(m_DirSCanSetRange); + if(DirSCanSetCentre<0||DirSCanSetCentre>360) + { + MessageBox(_T("方位扫描中心点设置范围0-360!")); + return; + } + if(DirSCanSetRange<0||DirSCanSetRange>180) + { + MessageBox(_T("方位扫描范围设置范围0-180!")); + return; + } + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x77; + TJDCCmdBuffer[2]=DirSCanSetCentre; + TJDCCmdBuffer[3]=DirSCanSetCentre>>8; + TJDCCmdBuffer[4]=DirSCanSetRange; + TJDCCmdBuffer[5]=DirSCanSetRange>>8; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +void DlgWHTJDCNew::UpdateFrame44(int &sendEnd) +{ + if(sendEnd==0) + { + if(!UpdateData(TRUE))//更新对话框对应的变量内容 + { + MessageBox(_T("请输入正确数据!!!")); + return; + } + if(!IsInteger(m_PitchSCanSetCentre)) + { + MessageBox(_T("俯仰扫描中心点设置为整数!")); + return; + } + if(!IsPositiveInteger(m_PitchSCanSetRange)) + { + MessageBox(_T("俯仰扫描范围设置为正整数!")); + return; + } + INT16 PitchSCanSetCentre,PitchSCanSetRange; + PitchSCanSetCentre = _ttoi(m_PitchSCanSetCentre); + PitchSCanSetRange = _ttoi(m_PitchSCanSetRange); + if(PitchSCanSetCentre<-180||PitchSCanSetCentre>180) + { + MessageBox(_T("俯仰扫描中心点设置范围-180-180!")); + return; + } + if(PitchSCanSetRange<0||PitchSCanSetRange>180) + { + MessageBox(_T("俯仰扫描范围设置范围0-180!")); + return; + } + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x78; + TJDCCmdBuffer[2]=PitchSCanSetCentre; + TJDCCmdBuffer[3]=PitchSCanSetCentre>>8; + TJDCCmdBuffer[4]=PitchSCanSetRange; + TJDCCmdBuffer[5]=PitchSCanSetRange>>8; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} + + +void DlgWHTJDCNew::UpdateFrame100(int &sendEnd) +{ + UpdateFrame28(sendEnd);//垂直下视 +} +void DlgWHTJDCNew::UpdateFrame101(int &sendEnd) +{ + if(sendEnd==0) + { + //吊舱朝前 + INT16 CmdDir,CmdPitch; + CmdDir = 0x0000; + CmdPitch = 0x0000; + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x72; + TJDCCmdBuffer[2]=CmdDir; + TJDCCmdBuffer[3]=CmdDir>>8; + TJDCCmdBuffer[4]=CmdPitch; + TJDCCmdBuffer[5]=CmdPitch>>8; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} +//0:UpdateFrame101 +//1:UpdateFrame100 +//2:UpdateFrame13_1 +void DlgWHTJDCNew::UpdateTJDCAction(int num) +{ + switch(num) + { + case 0: + g_WHTJDCCmdNum = 100; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + break; + case 1: + g_WHTJDCCmdNum = 101; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + break; + case 2: + UpdateFrame13_1(); + break; + default: + break; + } +} + + +//按钮按下、抬起触发此函数 +BOOL DlgWHTJDCNew::PreTranslateMessage(MSG* pMsg) +{ + if(g_IsSending) + { + // TODO: 在此添加专用代码和/或调用基类 + if(pMsg->message == WM_LBUTTONDOWN)//按下 + { + UpdateWHTJDCCmdBuffer(pMsg->hwnd); + } + if(pMsg->message == WM_LBUTTONUP)//抬起 + { + g_bBindData = false;//装订标志变成false + + //if(!gCurGCSCtrlFlag) + //{ + // if(gComFlags.test(11))//((gCommuFlags & 0x0800) != 0x00) ) + // { + // g_DC13FrameCkCmd = g_FrameFKU; + // g_UDPACmdSwi.WriteBuffer(g_DC13FrameCkCmd.Addr(),g_DC13FrameCkCmd.GetFrameLength());//写从控指令转发网口 + + // } + //} + + + } + } + + return CDialogEx::PreTranslateMessage(pMsg); +} +//伺服控制步长选择 +void DlgWHTJDCNew::OnCbnSelchangeComboTjdc2() +{ + // TODO: 在此添加控件通知处理程序代码 + int m_TDFlag = ((CComboBox*)GetDlgItem(IDC_COMBO_TJDC_2))->GetCurSel();//获得IDC_COMBO_TJDC_1按钮的当前选择 + switch(m_TDFlag) + { + case 0: + DirAndPitchCrlSize = 1; + break; + case 1: + DirAndPitchCrlSize = 2; + break; + case 2: + DirAndPitchCrlSize = 4; + break; + case 3: + DirAndPitchCrlSize = 6; + break; + case 4: + DirAndPitchCrlSize = 8; + break; + case 5: + DirAndPitchCrlSize = 10; + break; + case 6: + DirAndPitchCrlSize = 12; + break; + case 7: + DirAndPitchCrlSize = 14; + break; + case 8: + DirAndPitchCrlSize = 16; + break; + default: + DirAndPitchCrlSize = 8; + break; + } +} + + +void DlgWHTJDCNew::OnLButtonDown(UINT nFlags, CPoint point) +{ + // TODO: 在此添加消息处理程序代码和/或调用默认值 + if(SelectPointTrack) + { + CPoint point_g; + GetCursorPos(&point_g); + SelectPointTrack = false; + } + CDialogEx::OnLButtonDown(nFlags, point); +} diff --git a/Src/CH91PayloadSoftware/DlgWHTJDCNew.h b/Src/CH91PayloadSoftware/DlgWHTJDCNew.h new file mode 100644 index 0000000..035774b --- /dev/null +++ b/Src/CH91PayloadSoftware/DlgWHTJDCNew.h @@ -0,0 +1,126 @@ +#pragma once +#include "resource.h" +#include "global.h" +#include +#include "afxwin.h" +#include "DCFrameCkCmd.h" +#include "CYHMudpSend.h"//自定义组播发送 +#include "CMDBtn.h" +//#include "MCBtn.h" +// DlgWHTJDCNew 对话框 + +class DlgWHTJDCNew : public CDialogEx +{ + DECLARE_DYNAMIC(DlgWHTJDCNew) + +public: + DlgWHTJDCNew(CWnd* pParent = NULL); // 标准构造函数 + virtual ~DlgWHTJDCNew(); + + // 对话框数据 + enum { IDD = IDD_DIALOG_DC_WuHanTJ_NEW }; + virtual BOOL OnInitDialog(); + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + DECLARE_MESSAGE_MAP() + +public: + CCMDBtn m_DCFlyCmd[12]; + CMFCButton DC13InsBtn[44]; + BYTE TJDCCmdBuffer[15]; +public: + UINT8 SwitchCmd; //开关指令 + INT16 PitchControl; //俯仰控制量 + INT16 DirControl; //方位控制量 + INT16 PitchRecord; //俯仰量记录 + INT16 DirRecord; //方位量记录 + double Param1; + double Param2; + UINT8 CharacterSuperpositionSet;//字符叠加设置 + INT16 DirAndPitchCrlSize;//方位俯仰控制量 + CString m_TarTakTemSizeSetWidth; + CString m_TarTakTemSizeSetHigth; + UINT8 FogThroughMode; //透雾模式 + UINT8 PseudoColorSwitch;//伪色彩切换 + CString m_FocalDistanceSet;//焦距设置 + CString m_DigitalGuidancePitch;//数引模式 俯仰 + CString m_DigitalGuidanceDir;//数引模式 方位 + CString m_SCanModelAngle;//扫描设置 角度 + CString m_SCanModelSpeed;//扫描设置 速度 + CString m_DirSCanSetCentre;//方位扫描设置 中心 + CString m_DirSCanSetRange;//方位扫描设置 范围 + CString m_PitchSCanSetCentre;//俯仰扫描设置 中心 + CString m_PitchSCanSetRange;//俯仰扫描设置 范围 + int FocalDistanceSIZE;//调焦/变倍等级(1-7) +public: + void UpdateWHTJDCCmdBuffer(HWND);//更新控制指令到吊舱协议 + void DlgWHTJDCNew::UpdateDataZ70_TJDC();//更新数据注入指令Z70 + void UpdateFrame(); //俯仰+ 长按 + void UpdateFrame2(); //俯仰- 长按 + void UpdateFrame3(); //方位+ 长按 + void UpdateFrame4(); //方位- 长按 + void UpdateFrame5(int&); //复位 + void UpdateFrame6(int&); //图像切换 + void UpdateFrame7(); //焦距+ 长按 + void UpdateFrame8(); //焦距- 长按 + void UpdateFrame9(int&); //可见光跟踪 + void UpdateFrame10(int&); //拍一张照 + void UpdateFrame11(int&); //停止照相 + void UpdateFrame12(int&); //字符叠加设置 + void UpdateFrame13(int&); //选点跟踪 + void UpdateFrame13_1(); //选点跟踪执行 + + void UpdateFrame14(int&); //设置参数保存 + void UpdateFrame15(int&); //单次激光测距 + void UpdateFrame16(int&); //连续照相 + void UpdateFrame17(int&); //开始录像 + void UpdateFrame18(int&); //停止录像 + void UpdateFrame19(int&); //取消跟踪 + void UpdateFrame20(int&); //跟踪模板大小设置 + void UpdateFrame21(int&); //查询反馈 + void UpdateFrame22(int&); //开启激光测距 + void UpdateFrame23(int&); //伪色彩切换 + void UpdateFrame24(int&); //红外快门补偿 + void UpdateFrame25(int&); //电子放大 + void UpdateFrame26(int&); //红外图像增强 + void UpdateFrame27(int&); //云台扫描 + void UpdateFrame28(int&); //垂直下视 + void UpdateFrame29(int&); //停止激光测距 + void UpdateFrame30(); //变倍+ 长按 + void UpdateFrame31(int&); //透雾模式 + void UpdateFrame32(int&); //关伺服 + void UpdateFrame33(int&); //方位弱随动 + void UpdateFrame34(); //变倍- 长按 + void UpdateFrame35(int&); //低照度模式 + void UpdateFrame36(int&); //焦距设置 + void UpdateFrame37(int&); //收藏模式 + void UpdateFrame38(int&); //方位锁定 + void UpdateFrame39(int&); //数字引导 72 + void UpdateFrame40(int&); //吊舱扫描设置 + void UpdateFrame41(int&); //姿态指引 7C + void UpdateFrame43(int&); //方位扫描设置 + void UpdateFrame44(int&); //俯仰扫描设置 + + void UpdateFrame100(int&); //吊舱行为1 + void UpdateFrame101(int&); //吊舱行为2 + void UpdateTJDCAction(int); //吊舱行为控制 + +public: + HANDLE hCheckThread;//线程 + DWORD ThreadCheckIDRegion; + afx_msg LRESULT OnUpdateWHTJDCFrame(WPARAM wParam, LPARAM lParam); + int InfraredOrVisibleLight;//红外可见光切换 + virtual BOOL PreTranslateMessage(MSG* pMsg); +private: + CBrush m_brush; + //CFont m_font; +public: + CDCFrameCkCmdFrame DCFrameCkCmdWHTJ;//数据注入指令从控发送数据帧---武汉天进吊舱 + + + + afx_msg void OnCbnSelchangeComboTjdc2();//伺服控制步长选择 + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); +}; diff --git a/Src/CH91PayloadSoftware/EditInput.cpp b/Src/CH91PayloadSoftware/EditInput.cpp new file mode 100644 index 0000000..5a4b93d --- /dev/null +++ b/Src/CH91PayloadSoftware/EditInput.cpp @@ -0,0 +1,89 @@ +// EditInput.cpp : 实现文件 +// + +#include "stdafx.h" +#include "CH91PayloadSoftware.h" +#include "EditInput.h" + + +// CEditInput + +IMPLEMENT_DYNAMIC(CEditInput, CEdit) + +CEditInput::CEditInput() +{ + +} + +CEditInput::~CEditInput() +{ +} + + +BEGIN_MESSAGE_MAP(CEditInput, CEdit) + ON_WM_CHAR() +END_MESSAGE_MAP() + +void CEditInput::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) +{ + // 保证小数点最多只能出现一次 + if (nChar == '.') + { + CString str; + // 获取原来编辑框中的字符串 + GetWindowText(str); + + if (str.Find('.') != -1) + { + //字符串中已经有小数点,不输入 + } + else + { + CEdit::OnChar(nChar, nRepCnt, nFlags); + } + } + //负号只能出现一次,并且只能在第一个字符出现 + else if (nChar == '-') + { + CString str; + GetWindowText(str); + if (str.IsEmpty() ) + { + CEdit::OnChar(nChar, nRepCnt, nFlags); + } + else + { + int nSource, nDestination; + + //当前选中编辑框中的内容 + GetSel(nSource, nDestination); + //当光标位于第一个位置时 + if (nSource == 0) + { + //nDestination = nSource时表示未选中 + //光标位于最前方并且str中已经有'-'不操作 + if (str[0] == '-' && nDestination == 0) + { + } + + else + CEdit::OnChar(nChar, nRepCnt, nFlags); + } + else + { + + } + } + } + //小数点,负号,还应该允许输入数字,backspace, delete + else if( (nChar>='0' && nChar<='9') || (nChar == 0x08) || (nChar == 0x10) ) + { + CEdit::OnChar(nChar, nRepCnt, nFlags); + } + //其余不响应 + else + { + + } + //CEdit::OnChar(nChar, nRepCnt, nFlags); +} diff --git a/Src/CH91PayloadSoftware/EditInput.h b/Src/CH91PayloadSoftware/EditInput.h new file mode 100644 index 0000000..01f70bb --- /dev/null +++ b/Src/CH91PayloadSoftware/EditInput.h @@ -0,0 +1,20 @@ +#pragma once + + +// CEditInput + +class CEditInput : public CEdit +{ + DECLARE_DYNAMIC(CEditInput) + +public: + CEditInput(); + virtual ~CEditInput(); + +protected: + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); +}; + + diff --git a/Src/CH91PayloadSoftware/ExportImgShowBase.h b/Src/CH91PayloadSoftware/ExportImgShowBase.h new file mode 100644 index 0000000..60d660c --- /dev/null +++ b/Src/CH91PayloadSoftware/ExportImgShowBase.h @@ -0,0 +1,306 @@ +#pragma once + +// 包含情报结构体文件 +#include "QBStru.h" + +// 回调函数定义 +#include "CallBackDef.h" + +// 声明 图像显示对话框类 +class CImgShowDlg; +class AFX_CLASS_EXPORT CExportImgShowBase: public CObject +{ +public: + + // 构造函数 + CExportImgShowBase(void); + + // 析构函数 + ~CExportImgShowBase(void); + +public: + + /************************************************************************/ + /* part 1:窗口创建、销毁、图像显示、标注等 */ + /************************************************************************/ + + // 1 功能:创建视频显示窗口 + // 输入: + // 1. hParentWnd: 父窗口句柄 + // + // 输出:创建成功返回TRUE,否则返回FALSE + BOOL CreateWnd(const HWND hParentWnd); + + + // 2 功能:移动(设置)窗口(整个视频显示窗口)至指定位置 + // 输入: + // 1. clientRect:移动至该区域 + // + // 输出:无 + void MoveWnd(const CRect &clientRect); + + + // 3 功能:显示SW_SHOW 或隐藏 SW_HIDE 窗口 + // 输入: + // 1. nCmdShow:SW_SHOW 或 SW_HIDE + // + // 输出:无 + void ShowWnd(const int nCmdShow); + + + // 4 功能:显示一帧图像 + // 输入: + // 1. pImgInfo:图像信息头 + // 2. pImgData:图像数据指针 + // 3. LBbox:经纬度盒子 + // 4 isNeedFlip: 是否需要反转 + // 5. isNeedClip:是否需要裁剪标识 + // 6. ShowRegion:裁剪区域 + // 7. Strecth_Ratio 图像拉伸比例,默认为1,即填满屏幕 + // 8. 图像平移控制 + // + // 输出:显示成功返回TRUE,否则返回FALSE + // 说明:信号1 + BOOL ShowImage(const BITMAPINFO* pImgInfo, + BYTE* pImgData, + GeoBoundingBox LBbox = GeoBoundingBox(), + BOOL isNeedFlip = FALSE, + BOOL isNeedClip = FALSE, + const CRect* pShowRegion = NULL, + float Strecth_Ratio = 1.0F, + POINT xyShift = POINT()); + + // 5 功能:显示并处理通用情报数据 + // 输入: + // 1.qbData: 情报数据结构体变量指针 + // + // 输出: 无 + // 说明:信号2 + // 注意:信号1优先级 > 信号2优先级 + void DisposeQBData(const QBStru* qbData); + + + // 6 功能:标绘目标,其中输入为目标点像素坐标 + // 输入: + // 1. pt:目标点像素坐标 + // + // 输出:在窗口标绘目标 + // 注意事项:如果输入图像同时,对目标进行标绘,需要在 函数4(ShowImage)输入之后 输入本函数 + void SetTargetPixelCoordinate(const CPoint &pt); + + // 6.1 功能:标绘图像中的一块区域,其中输入为4个像素坐标点 + // 输入: + // 1. pt:4个角点像素坐标 + // + // 输出:在窗口标绘目标 + // 注意事项:如果输入图像同时,对目标进行标绘,需要在 函数4(ShowImage)输入之后 输入本函数 + void SetQuadrangleCorners(const POINT *pts); + + // 6.2 功能:标绘目标,其中输入为经纬度坐标 + // 输入: + // 1. pt:经纬度坐标 + // + // 输出:在窗口标绘目标 + // 注意事项:如果输入图像同时,对目标进行标绘,需要在 函数4(ShowImage)输入之后 输入本函数 + void SetTgtLocLeadLonLat(double lon, double lat); + + + + // 7 功能:删除视频显示窗口,同时释放所有占用资源 + // 输入:无 + // + // 输出:无 + void DestroyWnd(); + + + // 8 功能:清理内存及记忆 + // 输入:无 + // + // 输出:无 + void ClearMemory(); + + + + /************************************************************************/ + /* part 2:设置回调函数:像素点坐标、像素点信息、文件保存路径 */ + /************************************************************************/ + + // 1 功能:设置回调函数,对外输出目标点像素坐标(目标点通过左键双击图像获得) + // 输入: + // 1. proc: 回调函数指针 + // + // 输出:设置成功返回TRUE,否则返回FALSE + BOOL SetCallBackFun(SendCoordinateProc proc); + + + // 2 功能:设置回调函数,像素信息传递到外部CSU中 + // 输入: + // 1.proc: 函数指针 + // + // 输出: 设置成功返回TRUE,否则返回FALSE + BOOL SetCallBackFun(SendPixInfoProc proc); + + + // 3 功能:设置回调函数,传递保存文件路径到外部CSU中 + // 输入: + // 1.proc: 函数指针 + // + // 输出: 设置成功返回TRUE,否则返回FALSE + BOOL SetCallBackFun(SendFilePath proc); + + + // 5 功能:设置回调函数,目标定位导引经纬度到外部CSU中 + // 输入: + // 1.proc: 函数指针 + // + // 输出: 设置成功返回TRUE,否则返回FALSE + BOOL SetCallBackFun(SendTgrLocLeadLonLatProc proc); + + + // 6 功能:设置回调函数,火炮校射信息输出到外部CSU中 + // 输入: + // 1.proc: 函数指针 + // + // 输出: 设置成功返回TRUE,否则返回FALSE + BOOL SetCallBackFun(SendArtilleryReviseInfoProc proc); + + /************************************************************************/ + /* part 3:图像处理:显示控制、处理控制、保存控制 */ + /************************************************************************/ + + // 4 功能:通过鼠标滚轮,实现图像放大缩小 + BOOL OnMouseWheelZoomInOutImg(UINT nFlags, short zDelta, CPoint pt); + + // 5 功能:取消目标标绘 + void CancelTargetPlot(); + + // 6 功能:图像去雾 + // 输入: + // 1. bAdjust 是否调节 + // 2. A_MAX 控制去雾效果, A_MAX < 0 时,自适应计算(特别耗时); + // 有效范围【0,255】 异常值自适应; + // 3. degree 控制去雾效果, 有效范围【0,1】 异常值自适应 + // 输出:无 + void AdjustImgDehaze(BOOL bAdjust = FALSE, int A_MAX = -1, double degree = 0.78); + + // 7 功能:图像亮度调节 + // 输入: + // 1. bAdjust 是否调节 + // 2. degree 调节力度[0 20] + // 输出:无 + void AdjustImgIntensity(BOOL bAdjust = FALSE, int degree = 10); + + // 8 功能:图像对比度调节 + // 输入: + // 1. bAdjust 是否调节 + // 2. degree 调节力度[0 20] + // 输出:无 + void AdjustImgContrast(BOOL bAdjust = FALSE, int degree = 10); + + // 9 功能:图像清晰度调节 + // 输入: + // 1. bAdjust 是否调节 + // 2. degree 调节力度[0 20] + // 输出:无 + void AdjustImgDefinition(BOOL bAdjust = FALSE, int degree = 10); + + // 10 功能:返回图像调节上一步图像状态,显示上一次处理图像 + void ReturnToPreImgState(); + + // 11 功能:返回原始图像状态,显示原始图像 + void ReturnToSrcImgState(); + + // 12 功能:保存当前图像几何校正,并保存为TIFF格式 + void SaveImgToTiff(); + + // 13 功能:保存当前帧至本地文件 + // 输入: + // 1. sSaveFolder 图像存储文件夹,为空或找不到时,按默认存储路径存储 + // 说明:图像命名规则见设计文档 + void SaveCurrentFrame(CString sSaveFolder = ""); + + // 14 功能:是否需要记忆前面多帧(18帧)图像信息 + // 输入: + // 1. bMem TRUE:记忆 FALSE:不记忆 + // 输出:无 + void MemPreMultiFrame(BOOL bMem = TRUE); + + + // 18 功能:设置图像编辑类型 + // 输入: + // 1. type : 1:定位标记 + // 2: 文字标记 + // 3: 火炮校射标记 + // 其他值,无效 + void SetImgEditType(int type); + + // 19 功能:获取图像编辑模式 + // 输入:无 + // 返回: + // true: 图像增强模式 + // false:图像标记模式 + bool GetImgEditMode(); + + + // 21 功能:几何校正图像并显示图像 + void GeoCorrectAndShowImg(); + + // 22 功能:获取当前显示图像 + // 输入: + // 输出: + // 1:imgWidth 图像宽 + // 2:imgHeight 图像高 + // 3:bitCount 图像位数 + // 4:pImgData 图像数据指针 + // 返回值: + // 成功返回true,失败返回false + bool GetCurrentImg(int &imgWidth, int &imgHeight, int& bitCount, uchar* &pImgData); + + + // 23 功能:获取图像边界地理坐标 + // 输入: + // 输出: + // 1:leftLon 西经 + // 2:topLat 北纬 + // 3:rigtLon 东经 + // 4:bottomLat 南纬 + // 返回值: + // 成功返回true,失败返回false + bool GetImgBoundingBox(double &leftLon, double &topLat, double &rigtLon, double &bottomLat); + + + // 24 功能:获取当前显示图像中心经纬度 + // 输入: + // 输出: + // 1:lon 经度 + // 2:lat 纬度 + // 返回值: + // 成功返回true,失败返回false + bool GetCurrentImgCerterLonLat(double &lon, double &lat); + + + // 25 功能:标注图像(矩形、区域边缘) + // 输入: + // 1. 区域边缘点 集合 + void MarkRegionOnImg(std::vector> &valisContours); + + + // 26 功能:屏蔽右键菜单 + // 输入: + // 1. bClose 默认true关闭 + void CloseRightBtnDownMenu(bool bClose = true); + + + // 27 功能:设置空屏文字 + // 输入: + // 1. str 主题文字 + void SetThemeText(CString str); + + + // 28 功能:图像位置导引(同内部目标定位导引) + void LeadImgLoc(); + +private: + CImgShowDlg* m_ShowDlg; // MFC 对话框 +}; + diff --git a/Src/CH91PayloadSoftware/ExportSimpleImgShow.h b/Src/CH91PayloadSoftware/ExportSimpleImgShow.h new file mode 100644 index 0000000..e74e83f --- /dev/null +++ b/Src/CH91PayloadSoftware/ExportSimpleImgShow.h @@ -0,0 +1,153 @@ +#pragma once + + +// 输出双击图像时的脱靶量 +// flag = 0: 脱靶量 +// flag = 1: 对话框坐标 +typedef void (CALLBACK* SendPixXYOffsetProc)(CPoint xy, int flag); + +// 输出双击点与对话框中点的夹角 +typedef void (CALLBACK* SendAngleProc)(double angle); + +// 当鼠标按下时,输出鼠标点与对话框中心点的距离比例系数和角度 +typedef void (CALLBACK* SendDistRatioAndAngleProc)(double distRatio, double angle); + +// 通知简单图像显示对话框被左键双击 +typedef void (CALLBACK* SendLButtonDblClkInfoProc)(); + +// 通知简单图像显示对话框被右键按下 1:Ctrl +typedef void (CALLBACK* SendButtonDownInfoProc)(int type); + + +// 声明 图像显示对话框类 +class CSimpleImgShowDlg; + +class AFX_CLASS_EXPORT CExportSimpleImgShow: public CObject +{ +public: + CExportSimpleImgShow(void); + ~CExportSimpleImgShow(void); +public: + + /************************************************************************/ + /* part 1:窗口创建、销毁、图像显示、标注等 */ + /************************************************************************/ + + // 1 功能:创建视频显示窗口 + // 输入: + // 1. hParentWnd: 父窗口句柄 + // + // 输出:创建成功返回TRUE,否则返回FALSE + BOOL CreateWnd(const HWND hParentWnd); + + + // 2 功能:移动(设置)窗口(整个视频显示窗口)至指定位置 + // 输入: + // 1. clientRect:移动至该区域 + // + // 输出:无 + void MoveWnd(const CRect &clientRect); + + + // 3 功能:显示SW_SHOW 或隐藏 SW_HIDE 窗口 + // 输入: + // 1. nCmdShow:SW_SHOW 或 SW_HIDE + // + // 输出:无 + void ShowWnd(const int nCmdShow); + + + // 4 功能:显示一帧图像 + // 输入: + // 1. pImgInfo:图像信息头 + // 2. pImgData:图像数据指针 + // + // 输出:显示成功返回TRUE,否则返回FALSE + BOOL ShowImage(const BITMAPINFO* pImgInfo, BYTE* pImgData); + + + // 5 功能:删除视频显示窗口,同时释放所有占用资源 + // 输入:无 + // + // 输出:无 + void DestroyWnd(); + + // 6 功能:设置回调函数 + // 输入: + // 1. fun 函数指针 + // + // 输出:无 + void SetCallBackFun(SendPixXYOffsetProc fun); + + // 7 功能:设置回调函数 + // 输入: + // 1. fun 函数指针 + // + // 输出:无 + void SetCallBackFun(SendAngleProc fun); + + // 8 功能:设置回调函数 + // 输入: + // 1. fun 函数指针 + // + // 输出:无 + void SetCallBackFun(SendDistRatioAndAngleProc fun); + + // 9 功能:设置回调函数 + // 输入: + // 1. fun 函数指针 + // + // 输出:无 + void SetCallBackFun(SendLButtonDblClkInfoProc fun); + + + // 10 功能:设置是否显著标记对话框 + // 输入: + // 1. bMark: 是否标记 + // 2. bEnhance: 增强该功能 + // + // 输出:无 + void MarkDialog(bool bMark, bool bEnhance = false); + + // 11 功能:设置回调函数 + // 输入: + // 1. fun 函数指针 + // + // 输出:无 + void SetCallBackFun(SendButtonDownInfoProc fun); + + // 12 功能:获取当前显示图像 + // 输入: + // 无 + // 输出: + // 1:imgWidth 图像宽 + // 2:imgHeight 图像高 + // 3:bitCount 图像位数 + // 4:pImgData 图像数据指针 + // 返回值: + // 成功返回true,失败返回false + bool GetCurrentImg(int &imgWidth, int &imgHeight, int& bitCount, unsigned char* &pImgData); + + // 13 功能:设置空屏文字 + // 输入: + // 1. str 主题文字 + // 输出: + // 无 + // 返回值: + // 无 + void SetThemeText(CString str); + + + // 13 功能:关闭右键菜单 + void CloseRightBtnDownMenu(bool bClose = true); + + + // 14 功能:清空显示 + void ClearImg(); + + + +private: + CSimpleImgShowDlg* m_ShowDlg; // MFC 对话框 +}; + diff --git a/Src/CH91PayloadSoftware/ExtendSliderCtrl.cpp b/Src/CH91PayloadSoftware/ExtendSliderCtrl.cpp new file mode 100644 index 0000000..3dbb47c --- /dev/null +++ b/Src/CH91PayloadSoftware/ExtendSliderCtrl.cpp @@ -0,0 +1,48 @@ +// MySlider.cpp : 实现文件 +// + +#include "stdafx.h" +#include "ExtendSliderCtrl.h" + + +// CMySlider + +IMPLEMENT_DYNAMIC(CExtendSliderCtrl, CSliderCtrl) + +CExtendSliderCtrl::CExtendSliderCtrl() +{ + +} + +CExtendSliderCtrl::~CExtendSliderCtrl() +{ +} + + +BEGIN_MESSAGE_MAP(CExtendSliderCtrl, CSliderCtrl) + ON_WM_LBUTTONDOWN() +END_MESSAGE_MAP() + + + +// CMySlider 消息处理程序 +void CExtendSliderCtrl::OnLButtonDown(UINT nFlags, CPoint point) +{ + // TODO: 在此添加消息处理程序代码和/或调用默认值 + CSliderCtrl::OnLButtonDown(nFlags, point); + + CRect rectClient, rectChannel; + GetClientRect(rectClient); + GetChannelRect(rectChannel); + + int nMax = 0; + int nMin = 0; + + GetRange(nMin, nMax); + + int nPos = (nMax - nMin) * (point.x - rectClient.left - rectChannel.left) / (rectChannel.right - rectChannel.left); + + // 移动到鼠标位置 + SetPos(nPos); +} + diff --git a/Src/CH91PayloadSoftware/ExtendSliderCtrl.h b/Src/CH91PayloadSoftware/ExtendSliderCtrl.h new file mode 100644 index 0000000..4df0095 --- /dev/null +++ b/Src/CH91PayloadSoftware/ExtendSliderCtrl.h @@ -0,0 +1,22 @@ +#pragma once + + +// CExtendSliderCtrl + +class CExtendSliderCtrl : public CSliderCtrl +{ + DECLARE_DYNAMIC(CExtendSliderCtrl) + +public: + CExtendSliderCtrl(); + virtual ~CExtendSliderCtrl(); + +protected: + DECLARE_MESSAGE_MAP() +public: + + // 功能:让滑块移动到鼠标点击处 + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); +}; + + diff --git a/Src/CH91PayloadSoftware/FrameFKU_Camera.h b/Src/CH91PayloadSoftware/FrameFKU_Camera.h new file mode 100644 index 0000000..8fdd351 --- /dev/null +++ b/Src/CH91PayloadSoftware/FrameFKU_Camera.h @@ -0,0 +1,83 @@ +#ifndef __FRAME_FK_U_CAMERA +#define __FRAME_FK_U_CAMERA + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "FrameRecieve.h" +#pragma pack(1) + + +typedef struct struProtocalKB { + UINT8 head[2]; //帧头0x + UINT8 reserved; //预留 + UINT8 data[3]; //开关指令 + UINT8 curPage; //指令页 + UINT8 CHKSUM; //校验字节 +}ProtocalKB; + +#pragma pack() + + +class CFrameFK_U_CAMERA : public CFrameAbstract { +public: + int fk_counter; + CFrameFK_U_CAMERA() + { + strcpy(Name, "机载相机"); + FrameLength = 8; + HeadLength = 2; + Head[0] = 0xEB; + Head[1] = 0x98; + memcpy(Addr(), Head, HeadLength); + CheckLength = 1; + CheckPos = FrameLength -1; + FrameType = ftFKd; + fk_counter = 0; + DINeedRespond = FALSE; + + ckCmd = 0x00; + + memset(&Data,0,sizeof(ProtocalKB)); + } +public: + ProtocalKB Data; + BOOL DINeedRespond; + virtual struCHECK CheckCRC(BYTE* const p)//子帧校验 + { + return getCRC8(p,7); + } + + virtual BYTE* SendPrepare() + { + return CFrameAbstract::SendPrepare(); + } +public: + BYTE ckCmd;//从控指令 +public: + virtual ~CFrameFK_U_CAMERA(){ + } +protected: + virtual BOOL OnCheck(){ + if(CheckCRC(Addr()).C0 == Addr()[7]) + return true; + else + return false; + } + virtual void Decode() + { + } + + virtual void Encode() + { + ProtocalKB *pBuff = (ProtocalKB*) Addr(); + pBuff->head[0] = 0xEB; + pBuff->head[1] = 0x98; + pBuff->reserved = 0x00; + memset(pBuff->data,ckCmd,3); + pBuff->curPage = 0x01; + } +}; + +#endif \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/FrameIMP_DOWN.cpp b/Src/CH91PayloadSoftware/FrameIMP_DOWN.cpp new file mode 100644 index 0000000..3bd1321 --- /dev/null +++ b/Src/CH91PayloadSoftware/FrameIMP_DOWN.cpp @@ -0,0 +1,110 @@ +#include "StdAfx.h" +#include "FrameIMP_Down.h" + +CFrameIMPDown_::CFrameIMPDown_(void) +{ + _tcscpy(Name, _T("IMP下行")); + FrameLength = 6; + HeadLength = 1; + Head[0] = 0x55; + memcpy(Addr(), Head, HeadLength); + CheckLength = 1; + CheckPos = FrameLength - 2; + + memset(&Data,0,sizeof(DataIMPDown)); + memset(recvDataValue, 0, 6); +} + + +CFrameIMPDown_::~CFrameIMPDown_(void) +{ +} + +BOOL CFrameIMPDown_::FullFrame() +{ + int HeaderPos, HeaderPos2; + HeaderPos = FindHead(0, Length() - HeadLength); //找第一个帧头 + if (0 == HeaderPos) { + //帧头在最前面 + if (OnCheck()) //CRC校验 + DoCheck(); + else { + if (Length() < FrameLength) //数据长度不足,未通过CRC校验 + { + if (Size() < FrameLength) //误码,未通过CRC校验 + { + DoDropBYTE((UINT16)HeadLength); //丢弃帧头 + } + return TRUE; + } + else //误码,未通过CRC校验 + { + HeaderPos2 = FindHead(HeadLength, Length() - HeadLength); + if (HeaderPos2 >= 0) + { + Drop((UINT16) HeaderPos2); + return FALSE; + } + else + { + DoDropBYTE((UINT16) (Length()-(HeadLength-1))); + return TRUE; + } + } + } + } else if (HeaderPos < 0) { + //没找到帧头 + DoDropBYTE((UINT16) (Length()-(HeadLength-1))); + } else { + //丢弃帧头前的数据 + DoDropBYTE((UINT16) HeaderPos); + } + return FALSE; +} + +BOOL CFrameIMPDown_::OnCheck() +{ + //数据帧校验 + BYTE* p = Addr(); + memcpy(recvDataValue, p, 5); + if (Length() < FrameLength) + { + return false; + } + + struCHECK ck1=CheckCRC(p); + //if (p[CheckPos] == ck1.C0 && p[CheckPos + 1] == ck1.C1)//CRC校验 + if (p[CheckPos] == ck1.C0 )//和校验 + { + memcpy(recvDataValue, p, 5); + return true; + } + else + { + return false; + } +} + +void CFrameIMPDown_::DoCheck() +{ + CountFrameAll++; + CountFrameCheck++; + OnDataCheck(); + Drop(FrameLength); +} + +struCHECK CFrameIMPDown_::CheckCRC(BYTE* const p) +{ + return MakeCheckSum(p+1, FrameLength - HeadLength - CheckLength - 1);//1为帧尾,IMP有一个字节的帧尾 +} + +void CFrameIMPDown_::Decode() +{ + ProtocalIMPDown* pBuffIMP = (ProtocalIMPDown*)Addr(); + Data.head = pBuffIMP->head; + Data.Bytes = pBuffIMP->Bytes; + Data.StatusWord = pBuffIMP->StatusWord; + Data.FaultWord = pBuffIMP->FaultWord; + Data.CHKSUM = pBuffIMP->CHKSUM; + Data.EndFlag = pBuffIMP->EndFlag; +} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/FrameIMP_DOWN.h b/Src/CH91PayloadSoftware/FrameIMP_DOWN.h new file mode 100644 index 0000000..21a8a29 --- /dev/null +++ b/Src/CH91PayloadSoftware/FrameIMP_DOWN.h @@ -0,0 +1,84 @@ + +#include "FrameRecieve.h" + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + + + +#ifdef __WIN_32_VC__ +typedef unsigned char BYTE; +typedef unsigned char INT8U; +typedef unsigned short INT16U; +typedef unsigned int INT32U; +typedef char INT8S; +typedef short INT16S; +typedef int INT32S; +#endif + +#pragma pack(1) +//超视距通用协议帧 +typedef struct struProtocalIMPDown{ + UINT8 head; //帧头0x + UINT8 Bytes; //字节数 + UINT8 StatusWord; //状态字 + UINT8 FaultWord; //故障字 + UINT8 CHKSUM; //校验和 + UINT8 EndFlag; //结束标志 +}ProtocalIMPDown; +#pragma pack() + +//超视距通用帧数据 +typedef struct struDataIMPDown{ + UINT8 head; //帧头0x + UINT8 Bytes; //预留 + UINT8 StatusWord; //状态字 + UINT8 FaultWord; //故障字 + UINT8 CHKSUM; //校验和 + UINT8 EndFlag; //结束标志 +}DataIMPDown; + +class CFrameIMPDown_ : public CFrameAbstract +{ +public: + CFrameIMPDown_(void); + ~CFrameIMPDown_(void); + +protected: + virtual BOOL FullFrame(); + + virtual BOOL OnCheck(); + void DoCheck(); + + virtual struCHECK CheckCRC(BYTE* const p); + + virtual void Decode(); + BYTE recvDataValue[6]; + +public: + DataIMPDown Data; //IMP下行协议数据 + +public: + float LimitedValueF(float val,float minimum, float maximum) + { + val = val>maximum?maximum:val; + val = valmaximum?maximum:val; + val = valmaximum?maximum:val; + val = val 1000 +#pragma once +#endif // _MSC_VER > 1000 + +typedef enum { +ftFJu, //按飞机平台上行协议校验 +ftFJd, //按飞机平台下行协议校验 +ftEOu, //按稳定平台上行协议校验 +ftEOd, //按稳定平台下行协议校验 +ftCJu, //按测距测角上行协议校验 +ftCJd, //按测距测角下行协议校验 +ftQBu, //按情报上行协议校验 +ftQBd, //按情报下行协议校验 +ftCKd, //按测控下行协议校验 +ftSFu, ftSFd, ftFKu, ftFKd, ftEOGCSu, ftEOSBu, ftTXd, ftTXd_8B, ftTXd_8B_SM, ftTXd_8B_SAR, //图像复接数据协议 +ftEOU_8B, +ftMIMUu, //MIMU上行协议数据协议 +ftMIMUd, //MIMU下行协议数据协议 +ftGPSu, //GPS上行协议数据协议 +ftGPSd, //GPS下行协议数据协议 +ftBDu, //北斗上行协议数据协议 +ftBDd, //北斗下行协议数据协议 +ftPOWERu, //飞控计算机发送到电源管理器的数据帧 +ftPOWERd, //电源管理器发送到飞控计算机的数据帧 +ftOILu, //飞控计算机发送到油量传感器的数据帧 +ftOILd, //油量传感器发送到飞控计算机的数据帧 +ftMAGu, //飞控计算机发送到电子罗盘的数据帧 +ftMAGd, //电子罗盘发送到飞控计算机的数据帧 +ftGKu, //飞控计算机发送到高度/空速传感器的数据帧 +ftGKd, //高度/空速传感器发送到飞控计算机的数据帧 +ftNone //自定义校验 +}TFrameType; + +inline double RoundMax(double v, double vmax) +{ +return fmod(v, vmax); +} + +inline void ChangeFileNameExt(char *name, const char *ext) +{ + char *p = strrchr(name, '.'); + if(p) *(p+1) = 0; + strcat(name, ext); +} + +//解析事件回调函数类型 +class CFrameAbstract; +typedef void (CALLBACK *FLDropBYTECALLBACK)(CFrameAbstract* frm, UINT16 Count); +typedef void (CALLBACK *FLDropFrameCALLBACK)(CFrameAbstract* frm, UINT16 Count); +typedef void (CALLBACK *FLNotCheckCALLBACK)(CFrameAbstract* frm); +typedef void (CALLBACK *FLCheckCALLBACK)(CFrameAbstract* frm,LPVOID lp); +//数据帧编帧、解析抽象类 +class CFrameAbstract : public CBufferLoop { +public: + CFrameAbstract() : + FrameLength(32), HeadLength(2), CheckLength(1), CheckPos(31), FrameType(ftNone), + bphrasing(FALSE), bFileOpen(FALSE), nFlushCount(0), + hFileOrg(NULL), hFileCheck(NULL), hFileNotCheck(NULL), + funcDropBYTE(NULL), funcDropFrame(NULL), funcNotCheck(NULL), funcCheck(NULL), + CountBYTEAll(0), CountBYTEDrop(0), CountFrameAll(0), CountFrameCheck(0), CountFrameNotCheck(0), CountFrameDrop(0), + funcDropBYTEParam(NULL), funcDropFrameParam(NULL), funcNotCheckParam(NULL), funcCheckParam(NULL) + {}; + virtual ~CFrameAbstract(){ + funcDropBYTE = NULL; + funcDropFrame = NULL; + funcNotCheck = NULL; + funcCheck = NULL; + funcDropBYTEParam = NULL; + funcDropFrameParam = NULL; + funcNotCheckParam = NULL; + funcCheckParam = NULL; + while (TRUE == bphrasing){ + Sleep(100); + } + if(bFileOpen){ + fclose(hFileOrg); + fclose(hFileCheck); + fclose(hFileNotCheck); + bFileOpen = FALSE; + } + } + +protected: + UINT16 FrameLength; //帧长 + UINT16 HeadLength; //帧头长度 + UINT16 CheckLength; //帧内保存校验字节的长度 + UINT16 CheckPos; //帧内保存校验字节的位置 + TFrameType FrameType; //帧格式类型 +public: + char Name[20]; + BYTE Head[13]; + BOOL bphrasing; + TFrameType GetFrameType(){return FrameType;} + UINT16 GetFrameLength(){return FrameLength;} + UINT16 GetHeadLength(){return HeadLength;} +private: + BOOL bFileOpen; + INT32 nFlushCount; + char strModuleName[1024]; + char strAppPath[1024]; +public: + char strDataPath[1024]; +protected: + char strDataName[1024]; + FILE * hFileOrg; + FILE * hFileCheck; + FILE * hFileNotCheck; + + BOOL FullFrame() //因为没有整个256做校验,排除长短帧,进行查找两个 + { + int HeaderPos, HeaderPos2; + HeaderPos = FindHead(0, Length() - HeadLength); // + if (0 == HeaderPos) { + //帧头在最前面 + if (OnCheck()) //用256 257 + DoCheck(); + else { + HeaderPos2 = FindHead(HeadLength, Length() - HeadLength); + if (HeaderPos2 >= 0) + { + Drop((UINT16) HeaderPos2); + TRACE("Diu >= 0\n"); + return FALSE; + } + else + { TRACE("Diu < 0\n"); + + DoDropBYTE((UINT16) (Length()-(HeadLength-1))); + return TRUE; + } + } + } + else if (HeaderPos < 0) + { + //没找到帧头 + DoDropBYTE((UINT16) (Length()-(HeadLength-1))); + } + else + { + //丢弃帧头前的数据 + DoDropBYTE((UINT16) HeaderPos); + TRACE("Diu < 0\n"); + } + return FALSE; + } + void DoCheck() + { + assert(FrameLength > 0); + CountFrameAll++; + CountFrameCheck++; + OnDataCheck(); + Drop(FrameLength); + } + void DoNotCheck() + { + assert(FrameLength > 0); + CountFrameAll++; + CountBYTEDrop += FrameLength; + CountFrameNotCheck++; + OnDataNotCheck(); + Drop(FrameLength); + } + void DoDropFrame(const int Count) + { + assert(Count > 0); + CountFrameAll++; + CountBYTEDrop += Count; + CountFrameDrop++; + OnDataDropFrame(Count); + Drop(Count); + } + void DoDropBYTE(const int Count) + { + + if(Count <= 0) return; + + assert(Count > 0); + + CountBYTEDrop += Count; + OnDataDropBYTE(Count); + Drop(Count); + } + int FindHead(int Start, const int Length) + { + if((Start < 0) || (Length <=0 )) return -1; + assert((Start >= 0) && (Length > 0)); + BYTE* p = Addr() + Start; + while (Start < (Length-HeadLength+1)) + { + if (memcmp(p, Head, HeadLength) == 0) + return Start; + p++; + Start++; + } + return -1; + } + virtual BOOL OnCheck() //帧校验函数 + { + + return 1; + BYTE* p = Addr(); + struCHECK ck=CheckCRC(p+2); + if (1 == CheckLength) + { + return (ck.C0== p[CheckPos]) ? TRUE : FALSE; + } + else if (2 == CheckLength) + { + return ((p[CheckPos]==ck.C1)&&(p[CheckPos+1]==ck.C0)); + } + else + { + return false; + } + } + +protected: + FLDropBYTECALLBACK funcDropBYTE; + FLDropFrameCALLBACK funcDropFrame; + FLNotCheckCALLBACK funcNotCheck; + FLCheckCALLBACK funcCheck; + + INT32 CountBYTEAll; //接收到的全部字节数 + INT32 CountBYTEDrop; //丢弃的字节数 + INT32 CountFrameAll; //全部帧计数 + INT32 CountFrameCheck; //有效帧计数 + INT32 CountFrameNotCheck; //校验错的帧计数 + INT32 CountFrameDrop; //短帧计数 + virtual void OnDataDropBYTE(const int Count) //无效字节段事件函数,需用户自行编制处理函数 + { + if (funcDropBYTE != NULL) funcDropBYTE(this, Count); + } + virtual void OnDataDropFrame(const int Count) //短帧事件函数,需用户自行编制处理函数 + { + if (funcDropFrame != NULL) funcDropFrame(this, Count); + } + virtual void OnDataNotCheck() //帧校验错事件函数,需用户自行编制处理函数 + { + //Decode(); + if (funcNotCheck != NULL) funcNotCheck(this); + //Distribute(); + //Show(); + if(bFileOpen) fwrite(Addr(), FrameLength, 1, hFileNotCheck); + } + virtual void OnDataCheck() //有效帧事件函数,需用户自行编制处理函数 + { + Decode(); + if (funcCheck != NULL) funcCheck(this,funcCheckParam); + Distribute(); + Show(); + if(bFileOpen) fwrite(Addr(), FrameLength, 1, hFileCheck); + } + +public: + UINT32 funcDropBYTEParam; + UINT32 funcDropFrameParam; + UINT32 funcNotCheckParam; + LPVOID funcCheckParam; + void SetDropBYTECallback(FLDropBYTECALLBACK fun, UINT32 Param = 0){ funcDropBYTE = fun; funcDropBYTEParam = Param;} + void SetDropFrameCallback(FLDropFrameCALLBACK fun, UINT32 Param = 0){ funcDropFrame = fun; funcDropFrameParam = Param;} + void SetNotCheckCallback(FLNotCheckCALLBACK fun, UINT32 Param = 0){ funcNotCheck = fun; funcNotCheckParam = Param;} + void SetCheckCallback(FLCheckCALLBACK fun,LPVOID Param = NULL){funcCheck = fun; funcCheckParam = Param;} + void SetSaveStatus(BOOL IsSave, const char *name = NULL) + { + if(IsSave){ + GetModuleFileName(GetModuleHandle(NULL), strModuleName, 1024); + char *p = strrchr(strModuleName, '\\'); + if(p) strncpy(strAppPath, strModuleName, p - strModuleName); + else strcpy(strAppPath, strModuleName); + + time_t ltime; + struct tm *t; + time( <ime ); + t = localtime( <ime ); + + sprintf(strDataPath, "%s\\RecordOrg-%04d%02d%02d", strAppPath, t->tm_year, t->tm_mon, t->tm_mday); + char temp[1024]; + sprintf(temp, "%04d%02d%02d %02d%02d%02d", t->tm_year + 1900, t->tm_mon, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); + CreateDirectory((LPCSTR)strDataPath, NULL); + + if(name == NULL){ + sprintf(strDataName, "%s\\%s-%s.dat", strDataPath, temp, Name); + } + else{ + sprintf(strDataName, "%s\\%s-%s.dat", strDataPath, temp, name); + } + + if((hFileOrg = fopen(strDataName, "wb")) != NULL){ + strcpy(temp, strDataName); + ChangeFileNameExt(temp,"chk"); + if((hFileCheck = fopen(temp, "wb")) != NULL){ + strcpy(temp, strDataName); + ChangeFileNameExt(temp,"err"); + if((hFileNotCheck = fopen(temp, "wb")) != NULL){ + bFileOpen = TRUE; + } + else{ + fclose(hFileCheck); + fclose(hFileOrg); + } + bFileOpen = TRUE; + } + else{ + fclose(hFileOrg); + } + } + } + else{ + if(bFileOpen){ + fclose(hFileOrg); + fclose(hFileCheck); + fclose(hFileNotCheck); + bFileOpen = FALSE; + } + } + } + + void ResetCount() + { + //用于计数清零 + CountBYTEAll = 0L; + CountBYTEDrop = 0L; + CountFrameAll = 0L; + CountFrameCheck = 0L; + CountFrameNotCheck = 0L; + CountFrameDrop = 0L; + } + void Phrase(const BYTE* Src, const UINT32 Count) + { + cs->Enter(); + int ReadCount; + UINT32 LeftCount = Count; + const BYTE* psrc = Src; + bphrasing = TRUE; + while (LeftCount > 0) + { + ReadCount = Append(psrc, LeftCount);// + psrc += ReadCount; + LeftCount -= ReadCount; + CountBYTEAll += ReadCount; + while (Length() >= (FrameLength+HeadLength)) // + if (FullFrame()) + break; + } + try{ + if(bFileOpen) + { + fwrite(Src, Count, 1, hFileOrg); + if((CountBYTEAll - nFlushCount) > 40960) + { + fflush(hFileOrg); + fflush(hFileCheck); + fflush(hFileNotCheck); + nFlushCount = CountBYTEAll; + } + } + } + catch (...) + { + cs->Leave(); + bphrasing = FALSE; + } + cs->Leave(); + bphrasing = FALSE; + } + INT32 GetCountBYTEAll(){return CountBYTEAll;} + INT32 GetCountBYTEDrop(){return CountBYTEDrop;} + INT32 GetCountFrameAll(){return CountFrameAll;} + INT32 GetCountFrameCheck(){return CountFrameCheck;} + INT32 GetCountFrameNotCheck(){return CountFrameNotCheck;} + INT32 GetCountFrameDrop(){return CountFrameDrop;} + //output +protected: + virtual void FrameCrc(BYTE* p) + { + struCHECK ck=CheckCRC(p); + if (CheckLength==1) + { + p[CheckPos]=ck.C0; + } + if (CheckLength==2) + { + p[CheckPos] = ck.C0; + p[CheckPos+1]=ck.C1; + } + } +public: + virtual BYTE* SendPrepare() + { + BYTE* po; + po = Addr(); + Encode(); + FrameCrc(po); + return(po); + } + virtual struCHECK CheckCRC(BYTE* const p) = 0; +protected: + virtual void Encode(){} + virtual void Decode(){} + virtual void Distribute(){} +public: + virtual void Show(){} +}; + +#endif // !defined(AFX_FRAMERECIEVE_H__79D92644_4FC6_49FB_A28B_59EF7305C25A__INCLUDED_) diff --git a/Src/CH91PayloadSoftware/GetElevation.cpp b/Src/CH91PayloadSoftware/GetElevation.cpp new file mode 100644 index 0000000..f272f50 --- /dev/null +++ b/Src/CH91PayloadSoftware/GetElevation.cpp @@ -0,0 +1,255 @@ +#include "StdAfx.h" +#include "GetElevation.h" + +// tiff文件读取 +#include "gdal_priv.h" +#include "cpl_conv.h" //for CPLMalloc() + +// boost-1.56:准C++标准库 +#include +#include + +#include +using namespace std; + + +// 定义高程图像存储结构体 +#pragma pack(1) +struct struDemPic +{ + struDemPic() + { + pDEMData = NULL; + }; + + virtual ~struDemPic() + { + if (pDEMData != NULL) + { + delete[] pDEMData; + pDEMData = NULL; + } + } + + signed short int *pDEMData; + string strDemName; + double adfGeoTransform[6]; + int iXSize; + int iYSize; +}; +#pragma pack() + +// 定义类型: DEM_PIC_LIST +typedef vector DEM_PIC_LIST; + +// 全局变量 +DEM_PIC_LIST g_DemPicList; + +// 基于经纬度 计算tif文件名称 +string GetDemName( const float fLonDeg, const float fLatDeg ) +{ + string sLatLon; // 输出 + + int iLon = (int) fLonDeg; + int iLat = (int) fLatDeg; + + //判断经纬度在正常范围之内 + if ((fLonDeg < -180) || (fLonDeg > 180)) + { + return ""; + } + + if ((fLatDeg < -90) || (fLatDeg > 90)) + { + return ""; + } + + string sLat, sLon; + + + // 纬度 南北纬 区别对待 + boost::format fmt("S%02d"); + if (fLatDeg <= 0) + { + fmt % ((-iLat) + 1); + sLat = fmt.str(); + } + else + { + fmt = boost::format("N%02d"); + fmt % iLat; + sLat = fmt.str(); + } + + // 经度 东西经 区别对待 + if (fLonDeg <= 0) + { + fmt = boost::format("W%03d"); + fmt % ((-iLon) + 1); + sLon = fmt.str(); + } + else + { + fmt = boost::format("E%03d"); + fmt % iLon; + sLon = fmt.str(); + } + + sLatLon = "ASTGTM_" + sLat + sLon + "_dem.tif"; + return sLatLon; +} + + +// 搜寻文件路径是否已经存在 +int FindDemDataSet( const string strDemName ) +{ + for ( unsigned int i = 0; i < g_DemPicList.size(); i++ ) + { + if ( g_DemPicList[i]->strDemName == strDemName ) + { + return i; + } + } + return -1; +} + +bool GetDem( float& fElevator, const float fLonDeg, const float fLatDeg, struDemPic* pDemPic ) +{ + // 空值判断 + if (pDemPic == NULL) + { + return false; + } + + // 分辨率 判断 + if (pDemPic->adfGeoTransform[1] <= 0 || pDemPic->adfGeoTransform[5] >= 0) + { + return false; + } + + // 计算像素坐标 + float px = float(( fLonDeg - pDemPic->adfGeoTransform[0] ) / pDemPic->adfGeoTransform[1]); + float py = float(( pDemPic->adfGeoTransform[3] - fLatDeg ) / fabs(pDemPic->adfGeoTransform[5])); + + //防止越界 + if ((px < 0) || (px > pDemPic->iXSize - 1) || + (py < 0) || ( py > pDemPic->iYSize - 1)) + { + return false; + } + + // 规则:双线性内插 计算高程值 + int yt = 0, yb = 0; // y 上下 + int xl = 0, xr = 0; // x 左右 + + yt = int(py); + yb = yt + 1; + xl = int(px); + xr = xl + 1; + + if ((xl < 0) || (xl > pDemPic->iXSize - 1) || + (xr < 0) || (xr > pDemPic->iYSize - 1)) + { + return false; + } + + if ((yt < 0) || (yt > pDemPic->iXSize - 1) || + (yb < 0) || (yb > pDemPic->iYSize - 1)) + { + return false; + } + + // 相邻四个像素的值 + signed short int DNlt = *(pDemPic->pDEMData + yt * pDemPic->iXSize + xl); + signed short int DNrt = *(pDemPic->pDEMData + yt * pDemPic->iXSize + xr); + signed short int DNlb = *(pDemPic->pDEMData + yb * pDemPic->iXSize + xl); + signed short int DNrb = *(pDemPic->pDEMData + yb * pDemPic->iXSize + xr); + + // 间距 + float h, v; + h = py - yt; + v = px - xl; + + fElevator = DNlt * (1 - h) * (1 - v) + DNlb * h * (1 - v)+ DNrt * (1 - h) * v + DNrb * h * v; + + return true; +} + + + +// 获取高程 +bool GetDem( float& fElevator, float fLonDeg, float fLatDeg, string sDir) +{ + // tif文件 名称 + string strName = GetDemName(fLonDeg, fLatDeg); + if (strName == "") + { + return false; + } + + // tif文件 路径名称 + string strPathName; + + if (sDir != "") + { + strPathName = sDir + "\\" + strName; + } + else + { + return false; + } + + + // 是否能在记录中找到 + int idx = FindDemDataSet(strPathName); + if (idx >= 0) + { + return GetDem(fElevator, fLonDeg, fLatDeg, g_DemPicList[idx]);; + } + + //如果在数据集数组中找不到 读取文件并添加到数据集 + // 注册 + GDALAllRegister(); + CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "NO"); + + GDALDataset* tempdata = NULL; + tempdata = (GDALDataset*) GDALOpen(strPathName.c_str(), GA_ReadOnly); + if ( tempdata != NULL ) + { + GDALDataType dataType = tempdata->GetRasterBand(1)->GetRasterDataType(); + int iXSzie = tempdata->GetRasterBand(1)->GetXSize(); + int iYSzie = tempdata->GetRasterBand(1)->GetYSize(); + struDemPic* temp = new struDemPic; + temp->iXSize = iXSzie; + temp->iYSize = iYSzie; + tempdata->GetGeoTransform(temp->adfGeoTransform); + temp->pDEMData = new signed short int[iXSzie * iYSzie]; + + memset((void*) temp->pDEMData, 0, iXSzie * iYSzie * sizeof(signed short int)); + tempdata->GetRasterBand(1)->RasterIO( GF_Read, 0, 0, iXSzie, iYSzie, temp->pDEMData, iXSzie, iYSzie, GDT_Int16, 0, 0 ); + GDALClose(tempdata); + + // 入队 存储 + temp->strDemName = strPathName; + g_DemPicList.push_back(temp); + + return GetDem(fElevator, fLonDeg, fLatDeg, g_DemPicList[g_DemPicList.size() - 1]);; + } + return false; +} + + +//功能:释放资源 +void ReleaseDemMemory() +{ + // 高程数集 + for (unsigned int i = 0; i < g_DemPicList.size(); i++ ) + { + if ( g_DemPicList[i] != NULL ) + { + delete g_DemPicList[i]; + } + } + g_DemPicList.clear(); +} + diff --git a/Src/CH91PayloadSoftware/GetElevation.h b/Src/CH91PayloadSoftware/GetElevation.h new file mode 100644 index 0000000..90a82ea --- /dev/null +++ b/Src/CH91PayloadSoftware/GetElevation.h @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------- +概述:读取30米地面读取。 + +使用环境:windows操作系统 + VS2008 VS2010 VS2013 +依赖项: + gdal库 + boost库 + +应用示例: + + 1)获取高程时,直接调用函数 GetDem(...)即可; + 2)程序若调用过该函数,最后需要调用函数ReleaseDemMemory()释放内存资源,避免泄漏内存; + + +问题及解决情况记录: + 问题1: + 解决情况: + + 问题2: + 解决情况: + + ...... + +修改记录: + 版本 日期 作者 备注 + V1.0 2016/12/15 王家星 在原有代码整理与简化,添加头文件注释 +----------------------------------------------------------------------------*/ + +#include "StdAfx.h" + +#include +using namespace std; + +//1 功能:基于经纬度读取地面高程 +//输入: +// 1. fLonDeg: 经度(度) +// 2. fLatDeg: 纬度(度) +// 3. sDir: 高程数据文件存储路径, 默认设为:"D:\\ElevationData",可根据实际情况修改,高程tif文件文件名字遵循标准格式: +// 举例:ASTGTM_N20E095_dem.tif +// +//输出: +// 1. fElevator:高程(米) +// +//返回值:若函数运行成功,返回true,否则返回false +bool GetDem( float& fElevator, float fLonDeg, float fLatDeg, string sDir = "D:\\ElevationData"); + +//2 功能:释放DEM加载的资源 +void ReleaseDemMemory(); + + diff --git a/Src/CH91PayloadSoftware/Global.cpp b/Src/CH91PayloadSoftware/Global.cpp new file mode 100644 index 0000000..d068a56 --- /dev/null +++ b/Src/CH91PayloadSoftware/Global.cpp @@ -0,0 +1,3093 @@ +#include "stdafx.h" +#include "resource.h" +#include "Global.h" +#include "math.h" +#include "GlobalMessage.h" +#include "GlobalMember.h" +#include "GetElevation.h" +#include "CH91PayloadSoftwareDlg.h" +#include "MapPrj.h" +#include +#include +#include +#include "deinterlace.h" +#include "basetype.h" +#pragma comment(lib,"ws2_32.lib") +using namespace cv; + +CFrameFK_U_CAMERA g_FrameCamera; +CMUDP g_MUDPCamera; +BOOL g_IsSending; + +// CRC校验 +//struct struCHECK +//{ +// struCHECK() +// { +// C0 = C1 = 0; +// }; +// +// BYTE C0; +// BYTE C1; +//}; + +const UINT16 Crc_Table[256] = // X16+X12+X5+1 1021余式表 CCITT +{ + 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, + 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, + 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, + 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, + 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, + 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, + 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, + 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, + 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, + 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, + 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, + 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, + 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, + 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, + 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, + 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, + 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, + 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, + 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, + 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, + 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, + 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, + 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, + 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, + 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, + 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, + 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, + 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, + 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, + 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, + 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, + 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 +}; + +struCHECK MakeCheckCRC16(UINT8 *ptr,UINT8 len) +{ + UINT8 temp,i; + UINT16 crc = 0; + + for(i = 0; i < len; i++) + { + temp = (UINT8) (crc / 256); // 以8位二进制数暂存CRC 的高8 位 + crc <<= 8; // 左移 8 位 + crc ^= Crc_Table[temp ^ *ptr]; // 高字节和当前数据XOR 再查表 + ptr++; + } + struCHECK ck; + ck.C1 = (crc>>8); + ck.C0 = (crc&0xff); + return ck; +} + +#define PLOYNOMAL 0x1021 +unsigned int CreateCRC2(unsigned char lpCRCBlock[], unsigned int nCRCLen) +{ + unsigned char* lpBuffer = NULL; + + if (1 == nCRCLen % 2) + { + nCRCLen += 1; + lpBuffer = new unsigned char[nCRCLen]; + memset(lpBuffer, 0, nCRCLen); + memcpy(&lpBuffer[1], lpCRCBlock, nCRCLen-1); + } + + else + { + lpBuffer = new unsigned char[nCRCLen]; + memcpy(lpBuffer, lpCRCBlock, nCRCLen); + } + + unsigned long crc, ploy; + unsigned int crcCode; + int i=0, j=0, k=0; + + crc = 0; + ploy = 0x80000000; + ploy = ploy ^ ((unsigned long)PLOYNOMAL << 15); + + crc = crc ^ ((unsigned long)lpBuffer[0] << 24) ^ ((unsigned long)lpBuffer[1] << 16); + + + for (i = 2; i < (int)(nCRCLen + 1); i = i + 2 ) + { + + if (i < (int)nCRCLen) + { + crc = crc ^ ((unsigned long)lpBuffer[i] << 8) ^ ((unsigned long)lpBuffer[i + 1]); + + } + else + crc = crc & 0xffff0000; + if (i == 2) + { + + while ( ! (crc & 0x80000000)) + { + crc = crc << 1; + k = k + 1; + if(crc==0) + break; + + } + + for (j = 0; j < (16 - k); j ++) + { + + if (crc & 0x80000000) + crc = ((crc ^ ploy) << 1); + else + crc = crc << 1; + } + } + + else + { + for (j = 0; j < 16; j ++) + { + if (crc & 0x80000000) + crc = (crc ^ ploy) << 1; + else + crc = crc << 1; + } + } + } + + crcCode = (unsigned int)(crc >> 16); + + + if (NULL != lpBuffer) + { + delete[] lpBuffer; + } + + + return crcCode; +} +// 获取指定磁盘剩余空间 +long GetFreeVolumeLen(char *p) +{ + if (p == nullptr) + { + return 0; + } + + ULARGE_INTEGER lpuse; + ULARGE_INTEGER lptotal; + ULARGE_INTEGER lpfree; + + char chvolume[10] = {0}; + StrCat(chvolume, p); + StrCat(chvolume, ":\\"); + + GetDiskFreeSpaceExA(chvolume, &lpuse, &lptotal, &lpfree); + + long len = static_cast((((lpfree.QuadPart / 1024) / 1024) / 1024)); + return len; +} + +// 功能:获取软件当前工作目录 +CString GetSoftwareCurrentDirectory() +{ + char exeFullPath[MAX_PATH]; + GetModuleFileName(NULL, exeFullPath, MAX_PATH); + + CString Directy; + Directy.Format("%s", exeFullPath); + + int index = Directy.ReverseFind('\\'); + Directy.Delete(index, Directy.GetLength() - index); + + return Directy; +} + +//功能:在文件夹中查找文件,看其是否存在 +bool SearchDirectory(const CString &strDir) +{ + CFileFind fileFind; + + if (fileFind.FindFile(strDir)) + { + fileFind.Close(); + return true; + } + else + { + fileFind.Close(); + return false; + } +} + +// 获取可见光、红外帧的单帧数据长度 +unsigned int getFrameLen(BYTE B0, BYTE B1, BYTE B2, BYTE B3) +{ + BYTE a[4]; + a[0] = B3; + a[1] = B2; + a[2] = B1; + a[3] = B0; + unsigned int val = *((unsigned int*)(a)); //一个unsigned int是4个字节,开头*号是取值的意思 + + return val; +} + +// 获取数码照片帧的单帧数据长度 +unsigned int getFrameLenDC(BYTE B0, BYTE B1) +{ + BYTE a[2]; + a[0] = B1; + a[1] = B0; + wchar_t val = *((wchar_t*)(a)); //一个wchar_t是2个字节,开头*号是取值的意思 + return val; +} + +// 获取图像双击点偏移量 +void CALLBACK GetEOImgCenterOffset(CPoint offset, int flag) +{ + g_payloadCtrlProtocol = 11; + g_TrackOffset = offset; + + //天进吊舱-选点跟踪 + if(SelectPointTrack) + { + g_TrackOffset = offset; + ::SendMessageA(DlgDCOverroll_Hwnd, WM_PROCESS_DC_CMD, 0, 2); + } +} + +// 右键点击可见光或红外,转换为手动跟踪 +void CALLBACK GetEOIRImgRightButtonDown(int type) +{ + // 切换为手动搜素 + if (type == 1) + { + g_payloadCtrlProtocol = 10; + } + // 停止响应视场大小 + else if (type == 2) + { + g_payloadCtrlProtocol = 0; + } +} + + +// 通过图像控制伺服 +void CALLBACK GetDistRatioAndAngleThroughImg(double distRatio, double angle) +{ + if (distRatio >= 0 && distRatio <= 1 && abs(angle) <= 180) + { + if (distRatio > 0.5) + { + distRatio = 0.5; + } + + g_MS_Ratio = distRatio; + g_MS_Angle = angle; + ::SendMessage(g_SendControlCommandDlgHwnd, WM_SHOW_MANUAL_SEARCH , WPARAM(0), LPARAM(0)); + } +} + + +//地图模块回调函数 +void CALLBACK GetLeadLonLat(double Lon, double Lat, double Alt) +{ + //回调函数,基于地图模块上的经纬度获取该点的高程值 + CString rootDir = GetSoftwareCurrentDirectory() + "\\ElevationData"; + float fElevator = 0; + bool ret = GetDem( fElevator, float(Lon), float(Lat), rootDir.GetBuffer(0));//经纬高度都可以获得了 + + if (ret == false) + { + fElevator = g_DEMSetting; + } + g_UAVLon = g_CH96TransFJData.Satelite_lon; + g_UAVLat = g_CH96TransFJData.Satelite_lat; + g_UAVAlt = g_CH96TransFJData.Satelite_height; + double uavPos[3] = {g_UAVLon, g_UAVLat, g_UAVAlt}; + double tgtPos[3] = {Lon, Lat, fElevator}; + double uavPose[3] = {g_UAVPitch, g_UAVRoll, g_UAVYaw}; + + double guidePitch = -90; + double guideAzimuth = 0; + ret = CalLoadAttitudeForLoadGuide(guidePitch, guideAzimuth, uavPos, tgtPos, uavPose); + + if (ret == true) + { + // 此处协议与91不同,方位角左为正,故此处方位角取反显示,后续工作应与91协议统一 + g_Guide_Azimuth = -static_cast(guideAzimuth); //方位角 + g_Guide_Pitch = static_cast(guidePitch); //俯仰角 + + // 发送消息 更新地图主界面载荷数引信息 + ::SendMessageA(g_CH96CtrlDlgHwnd, WM_SHOW_MAP_GUIDE_POS, WPARAM(0), LPARAM(0)); + } +} + +// 回放模式输入数据 +void ReplayInputData(const void* buffer, int length) +{ + // 回放模式判定 + if (g_bWorkMode == true) + { + SocketReceiveFH96Data(buffer, length); + + memset(Buffer,0,sizeof(Buffer)); + memcpy(Buffer, buffer, length); + if (g_udpStarted) + { + int iTimes = length/512; + for (int i = 0; i < iTimes; i++) + { + // g_UDPTrans2Server.WriteBuffer(Buffer + i * 512, 512); + } + if (length%512 > 0) + { + // g_UDPTrans2Server.WriteBuffer(Buffer + iTimes * 512, length%512); + } + + //g_UDPTrans2Server.WriteBuffer(buffer, length); + } + } +} + + //UDP 收数(来自载荷) +void CALLBACK UDPRevTgtInfo(const void* buffer, int length, UINT32 data) +{ + if (g_bWorkMode == false) // 实时模式 + { + if (buffer == nullptr || length < 1) + { + return; + } + else + { + try + { + // 复接数据填充 + memcpy(&tgtRecvInfo, buffer, length); + ::PostMessageA(g_MapGuideHwnd, WM_SHOW_QB_TARGET, 0, 0); + } + catch(...) + { + + } + } + } +} + +// L链组播收数 +void GetFH96DataFromNet() +{ + // 实时状态 + if (g_bWorkMode == false) + { + BYTE Buffer[512000]; + sockaddr_in loc; + while (true && g_socketFH96Data != INVALID_SOCKET) + { + // 接收数据 + int len = sizeof(SOCKADDR); + int ret = recvfrom(g_socketFH96Data, + (char* )&Buffer, + 512000, + 0, + (struct sockaddr*)&loc, + &len); + if (ret != SOCKET_ERROR) + { + + + //if (g_udpStarted) + // { + // int iTimes = ret/512; + // for (int i = 0; i < iTimes; i++) + // { + // g_UDPTrans2Server.WriteBuffer(Buffer + i * 512, 512); + // } + // if (ret%512 > 0) + // { + // g_UDPTrans2Server.WriteBuffer(Buffer + iTimes * 512, ret%512); + // } + // + // //g_UDPTrans2Server.WriteBuffer(Buffer, ret); + // } + + // 处理数据 + SocketReceiveFH96Data(Buffer, ret); + /*if (g_tcpStarted) + { + g_TCPTrans2Server.WriteBuffer(Buffer, ret); + }*/ + + } + } + } +} + +void SocketReceiveFH96Data(const void* buffer, int length) +{ + if (buffer == nullptr || length < 1) + { + return; + } + else + { + // 存入内存池——多线程开关,用于ProcessData + WaitForSingleObject(g_hMutex_ProcessDataCH96, INFINITE); + try + { + if (g_bWorkMode == false) // 实时模式下写入文件 + { + //写入本地文件 + if (g_pFileSaveCH96txData != NULL) + { + fwrite(buffer, static_cast(1), length, g_pFileSaveCH96txData); // 写数据 + + // 向移动终端发送数据 + // g_UdpSend2Mobile.WriteBuffer(buffer, length); + } + } + + // 判定数据 + if (length + g_validDataLen < g_MaxBufferLen) //初始g_validDataLen为0,即为如果收数的length小于最大字长,则…… + { + memcpy(g_receiveDataBuffer + g_validDataLen, buffer, length); //将buffer内容拷贝到g_receiveDataBuffer延长g_validDataLen个字节之后的g_receiveDataBuffer中 + g_validDataLen = length + g_validDataLen; //有效字长置为收数字长 + } + else + { + if (length <= g_MaxBufferLen) // 修改(增添) + { + // 清理缓存 + g_validDataLen = 0; + + // 记录本次数据 + memcpy(g_receiveDataBuffer + g_validDataLen, buffer, length); + g_validDataLen = length + g_validDataLen; + } + } + ReleaseMutex(g_hMutex_ProcessDataCH96); + } + catch(...) + { + ReleaseMutex(g_hMutex_ProcessDataCH96); + } + } +} +// h264解码结果回调函数 +void CH96_h264DecodeResultCallbackFun(unsigned char* data,int width,int height) +{ + if (data == nullptr || width != 1920 || height != 1080) + { + return; + } + // 如果电脑配置较低,则…… + if (g_bGoodComputer == FALSE) + { + // 硬解码直接将解码结果显示在了控件上,此处将图像复制来进行备用 + memcpy(g_ImgforLowComputer.data, data, 1080*1920*3); + } + // 如果电脑配置较高,或配置类型输入有误,则依照原先显示方式进行处理 + else + { + // 可见光图像入队 + WaitForSingleObject(g_hMutex_DisplayVideoCH96, INFINITE); + if (g_CH96VideoDeque.size() > 15) + { + g_CH96VideoDeque.pop_front(); + } + + cv::Mat img(1080, 1920, CV_8UC3, cv::Scalar(0,0,0)); + if (img.empty() == false) + { + memcpy(img.data, data, 1080*1920*3); + g_CH96VideoDeque.push_back(img); + img.data = NULL; + } + } + ReleaseMutex(g_hMutex_DisplayVideoCH96); +} + +//void ProcessCH96Data() +//{ +// while(g_bProcessDataFlag) +// { +// try +// { +// WaitForSingleObject(g_hMutex_ProcessDataCH96, INFINITE); +// // 是否成功将数据复制到临时位置,表征变量 +// bool bHaveRelease = false; +// // 最小帧长 +// if (g_validDataLen >= 512) +// { +// //if(DCTypeSelected_video==2)//h264数据 +// //{ +// // if (g_CH96_h264decoder != nullptr) +// // { +// // g_CH96_h264decoder->decoding(g_receiveDataBuffer , 2560); +// // } +// // if (g_pFileSaveVideoDataCH96 != NULL && g_bVideoCapture == TRUE) +// // { +// // fwrite(g_receiveDataBuffer, static_cast(1), 2560, g_pFileSaveVideoDataCH96); // 写数据 +// // } +// //} +// //else//13所或武汉天进吊舱数据 +// //{ +// +// if (g_CH96_h264decoder != nullptr) +// { +// g_CH96_h264decoder->decoding(g_receiveDataBuffer , 2560); +// } +// // 找帧头 +// int _head = 0; // head 从0开始计数 +// bool _bfindhead = false; +// int SetMaxLoc = g_validDataLen - 256; // 最多找到离尾256个字节处 +// +// unsigned char midBuffer[256]; +// +// for (_head = 0; ((_head < SetMaxLoc) && (_bfindhead == false)); _head++) +// { +// if (g_receiveDataBuffer[_head + 0] == 0xEB && +// g_receiveDataBuffer[_head + 1] == 0x90) +// { +// _bfindhead = true; +// break; // 跳出for循环 +// } +// } // for 循环找帧头 +// +// // 如果找到了帧头 +// if (_bfindhead == true) +// { +// // 数据复制 +// memcpy(midBuffer, g_receiveDataBuffer + _head, 256); +// // 更新内存 +// unsigned int frameLen = 256; +// g_validDataLen = g_validDataLen - _head - frameLen; +// memcpy(g_receiveDataBuffer_middle, g_receiveDataBuffer + _head + frameLen, g_validDataLen); +// memcpy(g_receiveDataBuffer, g_receiveDataBuffer_middle, g_validDataLen); +// ReleaseMutex(g_hMutex_ProcessDataCH96); +// // 数据成功复制到临时位置 +// bHaveRelease = true; +// +// //if(DCTypeSelected_video==0)//13所吊舱数据 +// //{ +// // 飞行遥测数据 +// if (midBuffer[4] == 0x2A) +// { +// +// } +// // 复接数据 +// else if (midBuffer[4] == 0x50) +// { +// // 获取复接数据(只保留复接数据中的9-158字节,共150字节) +// WaitForSingleObject(g_hMutex_SaveFJData, INFINITE); +// memcpy(&g_CH96FJData, midBuffer + 8, 150); +// // 复接数据转换 +// TransCH96FJData(g_CH96TransFJData, g_CH96FJData); +// // 复接数据转换为情报处理用复接数据 +// TransCH96FJDatatoQBData(g_CH96QBData, g_CH96TransFJData); +// ReleaseMutex(g_hMutex_SaveFJData); +// // 组播页面显示FJ数据内容 +// ::PostMessageA(g_MulticastSocketReceiveDlgHwnd, WN_SHOW_CH96_FJDATA, 0, 0); +// // 发送消息,复接数据栏显示复接数据 +// //::PostMessageA(g_mainDlgHwnd, WM_SHOW_CH96_INFO, 0, 0); +// // 显示激光测距值 +// ::PostMessageA(g_QBTargetTrackFunctionsHwnd, WM_SHOW_LASERDIS_QBFUNCTIONSDLG, 0, 0); +// // 更新地图状态 +// ::PostMessageA(g_MapGuideHwnd, WM_UPDATA_GOOGLEMAP, 0, 0); +// } +// // 图像数据 +// else if (midBuffer[4] == 0xD5) +// { +// // 解码 +// if (g_CH96_h264decoder != nullptr) +// { +// g_CH96_h264decoder->decoding(midBuffer + 8, 248); +// g_UDPTrans2Server.WriteBuffer(midBuffer + 8, 248); +// } +// /* +// if(g_tcpStarted==true){ +// +// memcpy(g_tcpData+26,midBuffer + 8, 248); +// //帧计数 +// memcpy(g_tcpData+5,&g_frameCountTX,4); +// g_frameCountTX++; +// unsigned int crc_; +// crc_=CreateCRC2(g_tcpData+2, 272); +// memcpy(g_tcpData+274,&crc_,2); +// g_TCPYYDT.WriteBuffer(g_tcpData,276); +// +// //g_TCPYYDT.WriteBuffer(g_tcpData + 5,4); +// //g_TCPYYDT.WriteBuffer(g_tcpData + 26,248); +// } +// */ +// +// // 存储数据 +// // 写入本地文件 +// if (g_pFileSaveVideoDataCH96 != NULL && g_bVideoCapture == TRUE) +// { +// fwrite(midBuffer + 8, static_cast(1), 248, g_pFileSaveVideoDataCH96); // 写数据 +// } +// } +// // 数据类型有误 +// else +// { +// // do nothing +// } +// //} +// +// +// //else if(DCTypeSelected_video==1)//武汉天进吊舱数据 EB 90 H264 +// //{ +// // if (g_CH96_h264decoder != nullptr) +// // { +// // g_CH96_h264decoder->decoding(midBuffer + 2, 254); +// // } +// // if (g_pFileSaveVideoDataCH96 != NULL && g_bVideoCapture == TRUE) +// // { +// // fwrite(midBuffer + 2, static_cast(1), 254, g_pFileSaveVideoDataCH96); // 写数据 +// // } +// //} +// +// +// } +// // 没找到帧头 +// else +// { +// // head之前的删掉 +// g_validDataLen = g_validDataLen - _head; +// memcpy(g_receiveDataBuffer_middle, g_receiveDataBuffer + _head, g_validDataLen); +// memcpy(g_receiveDataBuffer, g_receiveDataBuffer_middle, g_validDataLen); +// } +// +// +// //} +// +// +// +// } +// +// if (bHaveRelease == false) +// { +// ReleaseMutex(g_hMutex_ProcessDataCH96); +// } +// } +// catch(...) +// { +// //ReleaseMutex(g_hMutex_ProcessDataCH96); +// } +// } +//} + +void ProcessCH96Data() +{ + while(g_bProcessDataFlag) + { + try + { + WaitForSingleObject(g_hMutex_ProcessDataCH96, INFINITE); + // 是否成功将数据复制到临时位置,表征变量 + bool bHaveRelease = false; + // 最小帧长 + if (g_validDataLen >= 512) + { + + if(DCTypeSelected_video==2)//h264数据 + { + if (g_CH96_h264decoder != nullptr) + { + g_CH96_h264decoder->decoding(g_receiveDataBuffer , g_validDataLen); + } + if (g_pFileSaveVideoDataCH96 != NULL && g_bVideoCapture == TRUE) + { + fwrite(g_receiveDataBuffer, static_cast(1), g_validDataLen, g_pFileSaveVideoDataCH96); // 写数据 + } + g_validDataLen = 0; + } + + + else//13所或武汉天进吊舱数据 + { + // 找帧头 + int _head = 0; // head 从0开始计数 + bool _bfindhead = false; + int SetMaxLoc = g_validDataLen - 256; // 最多找到离尾256个字节处 + + unsigned char midBuffer[256]; + + for (_head = 0; ((_head < SetMaxLoc) && (_bfindhead == false)); _head++) + { + if (g_receiveDataBuffer[_head + 0] == 0xEB && + g_receiveDataBuffer[_head + 1] == 0x90) + { + _bfindhead = true; + break; // 跳出for循环 + } + } // for 循环找帧头 + + // 如果找到了帧头 + if (_bfindhead == true) + { + // 数据复制 + memcpy(midBuffer, g_receiveDataBuffer + _head, 256); + // 更新内存 + unsigned int frameLen = 256; + g_validDataLen = g_validDataLen - _head - frameLen; + memcpy(g_receiveDataBuffer_middle, g_receiveDataBuffer + _head + frameLen, g_validDataLen); + memcpy(g_receiveDataBuffer, g_receiveDataBuffer_middle, g_validDataLen); + ReleaseMutex(g_hMutex_ProcessDataCH96); + // 数据成功复制到临时位置 + bHaveRelease = true; + + if(DCTypeSelected_video==0)//13所吊舱数据 + { + // 飞行遥测数据 + if (midBuffer[4] == 0x2A) + { + + } + // 复接数据 + else if (midBuffer[4] == 0x50) + { + // 获取复接数据(只保留复接数据中的9-158字节,共150字节) + WaitForSingleObject(g_hMutex_SaveFJData, INFINITE); + memcpy(&g_CH96FJData, midBuffer + 8, 150); + // 复接数据转换 + TransCH96FJData(g_CH96TransFJData, g_CH96FJData); + // 复接数据转换为情报处理用复接数据 + TransCH96FJDatatoQBData(g_CH96QBData, g_CH96TransFJData); + ReleaseMutex(g_hMutex_SaveFJData); + // 组播页面显示FJ数据内容 + ::PostMessageA(g_MulticastSocketReceiveDlgHwnd, WN_SHOW_CH96_FJDATA, 0, 0); + // 发送消息,复接数据栏显示复接数据 + //::PostMessageA(g_mainDlgHwnd, WM_SHOW_CH96_INFO, 0, 0); + // 显示激光测距值 + ::PostMessageA(g_QBTargetTrackFunctionsHwnd, WM_SHOW_LASERDIS_QBFUNCTIONSDLG, 0, 0); + // 更新地图状态 + ::PostMessageA(g_MapGuideHwnd, WM_UPDATA_GOOGLEMAP, 0, 0); + } + // 图像数据 + else if (midBuffer[4] == 0xD5) + { + // 解码 + if (g_CH96_h264decoder != nullptr) + { + g_CH96_h264decoder->decoding(midBuffer + 8, 248); + g_UDPTrans2Server.WriteBuffer(midBuffer + 8, 248); + } + /* + if(g_tcpStarted==true){ + + memcpy(g_tcpData+26,midBuffer + 8, 248); + //帧计数 + memcpy(g_tcpData+5,&g_frameCountTX,4); + g_frameCountTX++; + unsigned int crc_; + crc_=CreateCRC2(g_tcpData+2, 272); + memcpy(g_tcpData+274,&crc_,2); + g_TCPYYDT.WriteBuffer(g_tcpData,276); + + //g_TCPYYDT.WriteBuffer(g_tcpData + 5,4); + //g_TCPYYDT.WriteBuffer(g_tcpData + 26,248); + } + */ + + // 存储数据 + // 写入本地文件 + if (g_pFileSaveVideoDataCH96 != NULL && g_bVideoCapture == TRUE) + { + fwrite(midBuffer + 8, static_cast(1), 248, g_pFileSaveVideoDataCH96); // 写数据 + } + } + // 数据类型有误 + else + { + // do nothing + } + } + + + else if(DCTypeSelected_video==1)//武汉天进吊舱数据 EB 90 H264 + { + if (g_CH96_h264decoder != nullptr) + { + g_CH96_h264decoder->decoding(midBuffer + 2, 254); + } + if (g_pFileSaveVideoDataCH96 != NULL && g_bVideoCapture == TRUE) + { + fwrite(midBuffer + 2, static_cast(1), 254, g_pFileSaveVideoDataCH96); // 写数据 + } + } + + + } + // 没找到帧头 + else + { + // head之前的删掉 + g_validDataLen = g_validDataLen - _head; + memcpy(g_receiveDataBuffer_middle, g_receiveDataBuffer + _head, g_validDataLen); + memcpy(g_receiveDataBuffer, g_receiveDataBuffer_middle, g_validDataLen); + } + + + } + + + + } + + if (bHaveRelease == false) + { + ReleaseMutex(g_hMutex_ProcessDataCH96); + } + } + catch(...) + { + //ReleaseMutex(g_hMutex_ProcessDataCH96); + } + } +} + +// 获取CH96复接数据 +void TransCH96FJData(Data96TXD &dst, Protocal96TXD &src) +{ + dst.head[0] = 0xEE; // 帧头 + dst.head[1] = 0x16; + // 载荷相关 + dst.mem1 = 0x00; // 预留 + dst.SwitchCmd = src.SwitchCmd; // 开关指令 + dst.Status0 = src.Status0; // 状态字0 + dst.Status1 = src.Status1; // 状态字1 + dst.EOFocus = (float)(src.EOFocus * 0.1); // EO焦距mm + dst.Status2 = src.Status2; // 状态字2 + dst.FrameCount = src.FrameCount; // 时码 + dst.dx = (int)src.dx; // 俯仰脱靶量 + dst.dy = (int)src.dy; // 方位脱靶量 + dst.IRFocus = (float)(src.IRFocus * 0.1); // IR焦距mm + dst.LaserDis = (int)src.LaserDis; // 激光测距值 + dst.LaserState = src.LaserState; // 激光状态 + dst.None_1 = src.None_1; // 无 + dst.None_2 = src.None_2; // 无 + dst.ZH_Azimuth = (float)(src.ZH_Azimuth * 0.01); // 载荷俯仰角 + dst.ZH_Pitch = (float)(src.ZH_Pitch * 0.01); // 载荷方位角 + dst.PixelSize = (float)(src.PixelSize*1e-3F); // 像元尺寸 + // 飞机相关 + dst.PlaneID = (int)src.PlaneID; // 飞机ID + dst.Pitch = (float)(src.Pitch * 0.01); // 飞机俯仰角 + dst.Roll = (float)(src.Roll * 0.01F); // 飞机滚转角 + dst.Yaw = (float)(src.Yaw * 0.01F); // 飞机方位角 + dst.Satelite_lat = (double)(src.Satelite_lat * 1e-7); // 飞机测姿经度 + dst.Satelite_lon = (double)(src.Satelite_lon * 1e-7); // 飞机测姿纬度 + dst.Satelite_height = (double)(src.Satelite_height * 0.01); // 飞机测姿高度 + dst.Satelite_Ground_Speed = (float)(src.Satelite_Ground_Speed * 0.01); // 飞机GPS地速 + dst.Satelite_Ground_Speed_Dir = (float)(src.Satelite_Ground_Speed_Dir * 0.01); // 飞机GPS地速方向 + dst.Satelite_Sky_Speed = (float)(src.Satelite_Sky_Speed * 0.01); // 飞机GPS天速 + dst.MTI_Pitch = (float)(src.MTI_Pitch*0.01); // MTI俯仰角 + dst.MTI_Roll = (float)(src.MTI_Roll*0.01); // MTI滚转角 + dst.MTI_Yaw = (float)(src.MTI_Yaw*0.01); // MTI航向角 + + dst.MTI_lat = (double)(src.MTI_lat * 1e-7); // MTI经度 + dst.MTI_lon = (double)(src.MTI_lon * 1e-7); // MTI纬度 + dst.MTI_height = (double)(src.MTI_height * 0.2 - 500); // MTI高度 + dst.MTI_Ground_Speed = (float)(src.MTI_Ground_Speed * 0.01); // MTI地速 + dst.MTI_Ground_Speed_Dir = (float)(src.MTI_Ground_Speed_Dir * 0.01); // MTI地速方向 + dst.MTI_Sky_Speed = (float)(src.MTI_Sky_Speed * 0.01); // MTI天速 + + dst.UTC_Second = (int)(src.UTC_Second * 0.001); //UTC天秒 + dst.UTC_Year = (int)(src.UTC_Year); // UTC年 + dst.UTC_Month = (int)(src.UTC_Month); // UTC月 + dst.UTC_Day = (int)(src.UTC_Day); // UTC日 + + dst.NavigationState = src.NavigationState; // 导航状态 + dst.PressureHEG = (float)(src.PressureHEG * 0.2 - 500); // 气压高度 + + dst.AirSpeed = (float)(src.AirSpeed * 0.01); // 空速 + dst.Engine_Speed = (int)(src.Engine_Speed); // 发动机转速 + dst.Left_Tmp = (int)(src.Left_Tmp * 2); // 左缸温 + dst.Right_Tmp = (int)(src.Right_Tmp * 2); // 右缸温 + + dst.Pitch_Install_Err = (float)(src.Pitch_Install_Err * 0.02); // 载荷俯仰安装误差 + dst.Roll_Install_Err = (float)(src.Roll_Install_Err * 0.02); // 载荷方位安装误差 + dst.Yaw_Install_Err = (float)(src.Yaw_Install_Err * 0.02); // 载荷偏航安装误差 + + dst.mem3 = src.mem3; // 预留 + dst.CRC = src.CRC; // CRC校验 +} + +void TransCH96FJDatatoQBData(struQB_FJ &QB_FJ, Data96TXD &CH96FJ) +{ + QB_FJ.bValid = true; // 结构体数据是否有效: TRUE—有效 FALSE—无效 + + // 载荷姿态和属性 + QB_FJ.ZH_StablePlatformWorkState = 0x01; // 稳定平台工作状态:000—手动跟踪 001—自动跟踪 010—锁定 011—数引 100—扫描 101—刹车 110—初始化 111—偏心跟踪 + QB_FJ.ZH_TrackState = 0x11; // 跟踪器状态:000—正常 001—异常 010—目标丢失 011—相关跟踪 100—重心黑 101—重心白 + + QB_FJ.ZH_Pitch = CH96FJ.ZH_Pitch; // 载荷俯仰角 + QB_FJ.ZH_Azimuth = -CH96FJ.ZH_Azimuth; // 载荷方位角 + + QB_FJ.ZH_LaserOn = !(CH96FJ.LaserState & 0x01); // 激光测距开关,true为开(最低位为激光测距开关位置) + + QB_FJ.ZH_LaserDist = CH96FJ.LaserDis; // 激光测距值 + QB_FJ.ZH_FocalLen = CH96FJ.EOFocus; //EO焦距 mm +// QB_FJ.ZH_IRFocalLen = CH96FJ.IRFocus; //IR焦距 mm + QB_FJ.ZH_DeltaX = CH96FJ.dx; //俯仰脱靶量 + QB_FJ.ZH_DeltaY = CH96FJ.dy; //方位脱靶量 + QB_FJ.ZH_PixelSize = CH96FJ.PixelSize * 1e-6; //像元尺寸可见光2.8um,红外15um或30um + QB_FJ.ZH_ImgWidth = 1920; // 图像宽 + QB_FJ.ZH_ImgHeight = 1080; // 图像高 + + // 飞机位置姿态GPS + QB_FJ.UAV_GPS_Lon = CH96FJ.Satelite_lon; // 无人机经度 + QB_FJ.UAV_GPS_Lat = CH96FJ.Satelite_lat; // 无人机纬度 + QB_FJ.UAV_GPS_Alt = float(CH96FJ.Satelite_height); // 无人机高度 + QB_FJ.UAV_GPS_HSpeed = CH96FJ.Satelite_Ground_Speed; // 水平速度 + QB_FJ.UAV_Pitch = CH96FJ.Pitch; // 俯仰角 + QB_FJ.UAV_Yaw = CH96FJ.Yaw; // 航向角(机头方向) + QB_FJ.UAV_Roll = CH96FJ.Roll; // 滚转角 + QB_FJ.UAV_GroundHeight = 1280; // 无人机下视点地面高度:地面计算获取30米高程 + + // GPS时间 + QB_FJ.UAV_GPS_Year = CH96FJ.UTC_Year; // 卫导1年 + QB_FJ.UAV_GPS_Month = CH96FJ.UTC_Month; // 卫导1月 + QB_FJ.UAV_GPS_Day = CH96FJ.UTC_Day; // 卫导1日 + QB_FJ.UAV_GPS_UTC = CH96FJ.UTC_Second; // 卫导1时分秒 +} +// 位置信息结构体解析函数 +void TransLocationSocketStruct(struSocketProtocal &dst, const struQB_FJ & src) +{ + dst.Socket_Head[0] = 0x55; + dst.Socket_Head[1] = 0xAA; + dst.Socket_Marker = 0x11; + dst.Socket_Sender = 0x20; + dst.UAV_Lon = (INT32)(src.UAV_GPS_Lon * 10000000); + dst.UAV_Lat = (INT32)(src.UAV_GPS_Lat * 10000000); + dst.UAV_Alt = (INT16)(src.UAV_GPS_Alt * 10); +// dst.Target_Lon = 0xFFFFFFFF; +// dst.Target_Lat = 0xFFFFFFFF; +// dst.Target_Alt = 0xFFFF; + // 获取CRC校验位 计算dst[26-27] + BYTE _LocationSocketData[26]; + memcpy(_LocationSocketData, &dst, 26); + struCHECK tempstruCheck = MakeCheckCRC16(_LocationSocketData, 26); + dst.CRC[0] = tempstruCheck.C0; + dst.CRC[1] = tempstruCheck.C1; + // 帧尾 + dst.Socket_End[0] = 0xAF; + dst.Socket_End[1] = 0xAF; +} +// 复接数据结构体解析函数 +void TransFJStruct( struTranslateProtocal_FJ &dst, const struProtocal_FJ &src) +{ + // 判断src有效性 + if (src.Head[0] == 0xEB && src.Head[1] == 0x90) + { + dst.bValid = TRUE; + + // 转换解析 + //解析载荷识别码 + dst.ZH_Type = src.ZH_Type; + + //解析开关指令 + dst.ZH_CmdType = src.ZH_CmdType; + + //解析载荷工作状态——稳定平台工作状态 + dst.ZH_StablePlatformWorkState = (src.ZH_WorkState & 0xE0)>>5; + //解析载荷工作状态——激光测距仪 + dst.ZH_LaserRangeWorkState = (src.ZH_WorkState & 0x1C)>>2; + + // 判定激光测距开关 + if (dst.ZH_LaserRangeWorkState == 0x04) + { + dst.ZH_LaserOn = true; + } + else + { + dst.ZH_LaserOn = false; + } + + //解析载荷工作状态——升降机构——主界面显示 + dst.ZH_ElevatorWorkState = src.ZH_WorkState & 0x03; + + //解析主控状态字0 + dst.ZH_CtrlState0 = src.ZH_CtrlState0; + + //解析主控状态子1 + dst.ZH_CtrlState1 = src.ZH_CtrlState1; + + //解析伺服状态字 + dst.ZH_ServoState = src.ZH_ServoState; + + //解析可见光状态字0——可见光相机状态 + dst.ZH_EOCameraWorkState = (src.ZH_EOState0 & 0x80) >> 7; + + //解析可见光状态字0——可见光图像状态 + dst.ZH_EOCameraImgState = (src.ZH_EOState0 & 0x40) >> 6; + + //解析红外状态字——红外相机状态 + dst.ZH_IRCameraWorkState = (src.ZH_IRState & 0x80) >> 7; + //解析红外状态字——图像状态 + dst.ZH_IRCameraImgState = (src.ZH_IRState & 0x40) >> 6; + //解析红外状态字——热像仪数字变倍 + dst.ZH_IRCameraDigitalDouble = (src.ZH_IRState & 0x08) >> 3; + + dst.ZH_SMExposalTime = src.ZH_IRState * 20; + + //解析跟踪器状态字——可见光接收球上主控数据 + dst.ZH_EOTrackState_Control = (src.ZH_TrackState & 0x80) >> 7; + //解析跟踪器状态字——可见光跟踪器状态 + dst.ZH_EOTrackState = (src.ZH_TrackState & 0x70) >> 4; + //解析跟踪器状态字——红外接收球上主控数据 + dst.ZH_IRTrackState_Control = (src.ZH_TrackState & 0x08) >> 3; + //解析跟踪器状态字——红外跟踪器状态 + dst.ZH_IRTrackState = (src.ZH_TrackState & 0x07); + + //解析激光测试状态字 + dst.ZH_LASERTEST_D7 = (src.ZH_EOState1 & 0x80) >> 7; + dst.ZH_LASERTEST_D6 = (src.ZH_EOState1 & 0x40) >> 6; + dst.ZH_LASERTEST_D5 = (src.ZH_EOState1 & 0x20) >> 5; + dst.ZH_LASERTEST_D4 = (src.ZH_EOState1 & 0x10) >> 4; + dst.ZH_LASERTEST_D3 = (src.ZH_EOState1 & 0x08) >> 3; + dst.ZH_LASERTEST_D2 = (src.ZH_EOState1 & 0x04) >> 2; + dst.ZH_LASERTEST_D1D0 = (src.ZH_EOState1 & 0x03); + + //解析激光测距值 + dst.ZH_LaserDist = (unsigned int)src.ZH_LaserDist; + + //可见光焦距值 + dst.ZH_EOFocalLen = (float)(src.ZH_EOFocalLen * 0.01); + + //红外焦距值 + dst.ZH_IRFocalLen = (float)(src.ZH_IRFocalLen * 0.01); + + dst.ZH_SMSerialNumber = src.ZH_IRFocalLen; // 数码照片编号 + + // 像元尺寸 固定值 + dst.ZH_EOPixelSize = 4.5e-6; + dst.ZH_IRPixelSize = 15e-6; + dst.ZH_SMPixelSize = 2.8e-6; // 暂时 + + + //图像输出类型 + dst.ZH_ImgType = src.ZH_ImgType; + + //图像输出码流 + dst.ZH_ImgFlow = src.ZH_ImgFlow; + + dst.ZH_SMOverlapRatio = float(src.ZH_SMOverlapRatio * 0.5); + + + /*——————————显示飞机数据————————*/ + //无人机型号 + dst.UAV_Type = src.UAV_Type; + + //飞机ID + dst.UAV_ID = src.UAV_ID; + + //无人机飞行状态 + for (int i = 0; i<10; i++) + { + dst.UAV_States[i] = src.UAV_States[i]; + } + + //垂直陀螺俯仰角——负180~正180度 + dst.UAV_GyroPitch = (float)(src.UAV_GyroPitch * 0.01); + + //垂直陀螺滚转角——负180度~正180度 + dst.UAV_GyroRoll = (float)(src.UAV_GyroRoll * 0.01); + + //气压高度 + dst.UAV_AirPresAlt = (float)(src.UAV_AirPresAlt * 0.2 - 500.0); + + //磁航向角——北偏东为正,0~360度 + dst.UAV_MagHeading = (float)(src.UAV_MagHeading * 0.1); + + //卫导1定位测姿状态 + dst.GPS_LR_WorkState = src.GPS_LR_WorkState; + dst.GPS_LR_Location = dst.GPS_LR_WorkState & 0x0F; + dst.GPS_LR_Attitude = (dst.GPS_LR_WorkState & 0xF0) >> 4; + + //卫导1UTC天秒 + dst.GPS_LR_UTC = (unsigned int)(src.GPS_LR_UTC * 0.001); + + //卫导1UTC日 + dst.GPS_LR_Day = (unsigned int)src.GPS_LR_Day; + + //卫导1UTC月 + dst.GPS_LR_Month = (unsigned int)src.GPS_LR_Month; + + // 错误原因不详 + if (dst.GPS_LR_Month > 48) + { + dst.GPS_LR_Month -= 48; + } + + //卫导1UTC年 + dst.GPS_LR_Year = (unsigned int)(src.GPS_LR_Year + 2000); + + //卫导1经度——东经为正,西经为负(低字节在前,高字节在后) + dst.GPS_LR_Lon = (float)(src.GPS_LR_Lon * 1.0 / 10000000.0); + + //卫导1纬度——北纬为正,南纬为负 + dst.GPS_LR_Lat = (float)(src.GPS_LR_Lat * 1.0 / 10000000.0); + + //卫导1高度 + dst.GPS_LR_Alt = (float)(src.GPS_LR_Alt * 0.2 - 500.0); + + //卫导1地速方向——北偏东为正,0~360度 + dst.GPS_LR_VHeading = (float)(src.GPS_LR_VHeading * 0.01); + + //卫导1水平速度 + dst.GPS_LR_HoriSpeed = (float)(src.GPS_LR_HoriSpeed * 0.01); + + //卫导1天速——上正下负 + dst.GPS_LR_VertSpeed = (float)(src.GPS_LR_VertSpeed * 0.01); + + //卫导1航向角——北偏东为正,0~360度 + dst.GPS_LR_Heading = (float)(src.GPS_LR_Heading * 0.01); + + //卫导1滚转角 + dst.GPS_LR_Roll = (float)(src.GPS_LR_Roll * 0.01); + + //卫导2定位测姿状态 + dst.GPS_FB_WorkState = src.GPS_FB_WorkState; + dst.GPS_FB_Location = dst.GPS_FB_WorkState & 0x0F; + dst.GPS_FB_Attitude = (dst.GPS_FB_WorkState & 0xF0) >> 4; + + //卫导2UTC天秒 + dst.GPS_FB_UTC = (unsigned int)(src.GPS_FB_UTC * 0.001); + + //卫导2UTC日 + dst.GPS_FB_Day = (unsigned int)src.GPS_FB_Day; + + //卫导2UTC月 + dst.GPS_FB_Month = (unsigned int)src.GPS_FB_Month; + + // 错误原因不详 + if (dst.GPS_FB_Month > 48) + { + dst.GPS_FB_Month -= 48; + } + + //卫导2UTC年 + dst.GPS_FB_Year = (unsigned int)(src.GPS_FB_Year + 2000); + + //卫导2经度——东经为正,西经为负 + dst.GPS_FB_Lon = (float)(src.GPS_FB_Lon * 1.0 / 10000000.0); + + //卫导2纬度——北纬为正,南纬为负 + dst.GPS_FB_Lat = (float)(src.GPS_FB_Lat * 1.0 / 10000000.0); + + //卫导2高度 + dst.GPS_FB_Alt = (float)(src.GPS_FB_Alt * 0.2 - 500.0); + + //卫导2地速方向——北偏东为正,0~360度 + dst.GPS_FB_VHeading = (float)(src.GPS_FB_VHeading * 0.01); + + //卫导2水平速度 + dst.GPS_FB_HoriSpeed = (float)(src.GPS_FB_HoriSpeed * 0.01); + + //卫导2天速——上正下负 + dst.GPS_FB_VertSpeed = (float)(src.GPS_FB_VertSpeed * 0.01); + + //卫导2航向角——北偏东为正,0~360度 + dst.GPS_FB_Heading = (float)(src.GPS_FB_Heading * 0.01); + + //卫导2俯仰角——抬头向上为正,负180~正180度 + dst.GPS_FB_Pitch = (float)(src.GPS_FB_Pitch * 0.01); + } + else + { + dst.bValid = FALSE; + } +} + +// 复接数据入队列 +void PushToFrameDataDeque(const struQB_FJ &TgtLocStru) +{ + // 线程互斥 + WaitForSingleObject(g_hMutex_TgtLoc, INFINITE); + + if ( g_TgtLocStructDeque.size() < 2) + { + g_TgtLocStructDeque.push_back(TgtLocStru); // 入队 + } + else + { + while(g_TgtLocStructDeque.size() >= 2) // 设计原因:中途可能设置小于当前数目的容量 + { + // 弹出 + g_TgtLocStructDeque.pop_front(); + } + + g_TgtLocStructDeque.push_back(TgtLocStru); // 入队 + } + + + ReleaseMutex(g_hMutex_TgtLoc); +} +// 转情报用EO复接数据 +void TransToEOQBFJ(struQB_FJ &dst, const struTranslateProtocal_FJ &src) +{ + dst.bValid = true; + if (src.bValid == true) + { + // 载荷姿态和属性 + dst.ZH_StablePlatformWorkState = src.ZH_StablePlatformWorkState; // 平台状态 + dst.ZH_TrackState = src.ZH_EOTrackState; // 跟踪状态 + dst.ZH_Pitch = src.ZH_Pitch; // 载荷俯仰角 + dst.ZH_Azimuth = src.ZH_Azimuth; // 载荷方位角 + + if (dst.ZH_Pitch > 10.5 || dst.ZH_Pitch < -110.1) + { + dst.bValid = false; + } + + if (abs(dst.ZH_Azimuth) > 180) + { + dst.bValid = false; + } + + dst.ZH_LaserOn = src.ZH_LaserOn; // 激光测距开关,true为开 + dst.ZH_LaserDist = src.ZH_LaserDist; // 激光测距值 + + dst.ZH_FocalLen = src.ZH_EOFocalLen; //焦距 + + if (dst.ZH_FocalLen < 1e-6) + { + dst.bValid = false; + } + + dst.ZH_DeltaX = src.ZH_DeltaX; //俯仰脱靶量 + dst.ZH_DeltaY = src.ZH_DeltaY; //方位脱靶量 + + if (abs(dst.ZH_DeltaX) > 960) + { + dst.bValid = false; + } + + if (abs(dst.ZH_DeltaY) > 540) + { + dst.bValid = false; + } + + dst.ZH_PixelSize = src.ZH_EOPixelSize; + + dst.ZH_ImgWidth = 1920; // 图像宽 + dst.ZH_ImgHeight = 1080; // 图像高 + + UINT8 GPS_LR_LocState = src.GPS_LR_WorkState & 0x0F; + UINT8 GPS_LR_PosState = src.GPS_LR_WorkState >> 4; + + UINT8 GPS_FB_LocState = src.GPS_FB_WorkState & 0x0F; + UINT8 GPS_FB_PosState = src.GPS_FB_WorkState >> 4; + + // 定位状态: + // 0x00 单点定位 + // 0x02 载波相位差分定位 + // 测资状态: + // 0x00 正常测资 + + if (GPS_FB_LocState == 0x00 || GPS_FB_LocState == 0x02) // 前后正常定位 + { + dst.UAV_GPS_Lon = src.GPS_FB_Lon; // 无人机经度 + dst.UAV_GPS_Lat = src.GPS_FB_Lat; // 无人机纬度 + dst.UAV_GPS_Alt = src.GPS_FB_Alt; // 无人机高度 + dst.UAV_GPS_HSpeed = src.GPS_FB_HoriSpeed; // 水平速度 + + dst.UAV_GPS_Year = src.GPS_FB_Year; + dst.UAV_GPS_Month = src.GPS_FB_Month; + dst.UAV_GPS_Day = src.GPS_FB_Day; + dst.UAV_GPS_UTC = src.GPS_FB_UTC; + } + else if (GPS_LR_LocState == 0x00 || GPS_LR_LocState == 0x02) // 左右正常定位 + { + dst.UAV_GPS_Lon = src.GPS_LR_Lon; // 无人机经度 + dst.UAV_GPS_Lat = src.GPS_LR_Lat; // 无人机纬度 + dst.UAV_GPS_Alt = src.GPS_LR_Alt; // 无人机高度 + dst.UAV_GPS_HSpeed = src.GPS_LR_HoriSpeed; // 水平速度 + + dst.UAV_GPS_Year = src.GPS_LR_Year; + dst.UAV_GPS_Month = src.GPS_LR_Month; + dst.UAV_GPS_Day = src.GPS_LR_Day; + dst.UAV_GPS_UTC = src.GPS_LR_UTC; + } + else if (GPS_FB_LocState == 0x01 || GPS_FB_LocState == 0x03) + { + dst.UAV_GPS_Lon = src.GPS_FB_Lon; // 无人机经度 + dst.UAV_GPS_Lat = src.GPS_FB_Lat; // 无人机纬度 + dst.UAV_GPS_Alt = src.GPS_FB_Alt; // 无人机高度 + dst.UAV_GPS_HSpeed = src.GPS_FB_HoriSpeed; // 水平速度 + + dst.UAV_GPS_Year = src.GPS_FB_Year; + dst.UAV_GPS_Month = src.GPS_FB_Month; + dst.UAV_GPS_Day = src.GPS_FB_Day; + dst.UAV_GPS_UTC = src.GPS_FB_UTC; + } + else if (GPS_LR_LocState == 0x01 || GPS_LR_LocState == 0x03) + { + dst.UAV_GPS_Lon = src.GPS_LR_Lon; // 无人机经度 + dst.UAV_GPS_Lat = src.GPS_LR_Lat; // 无人机纬度 + dst.UAV_GPS_Alt = src.GPS_LR_Alt; // 无人机高度 + dst.UAV_GPS_HSpeed = src.GPS_LR_HoriSpeed; // 水平速度 + + dst.UAV_GPS_Year = src.GPS_LR_Year; + dst.UAV_GPS_Month = src.GPS_LR_Month; + dst.UAV_GPS_Day = src.GPS_LR_Day; + dst.UAV_GPS_UTC = src.GPS_LR_UTC; + } + else // 飞机不定位 + { + dst.bValid = false; + } + + // 测资判断 + if (GPS_LR_PosState == 0x00 && GPS_FB_PosState == 0x00) + { + dst.UAV_Yaw = src.GPS_LR_Heading; // 航向角 + dst.UAV_Roll = src.GPS_LR_Roll; // 滚转角 + dst.UAV_Pitch = src.GPS_FB_Pitch; // 俯仰角 + } + else + { + if (GPS_LR_PosState == 0x00) + { + // 左右GPS测:航向角+滚转角 + dst.UAV_Yaw = src.GPS_LR_Heading; // 航向角 + dst.UAV_Roll = src.GPS_LR_Roll; // 滚转角 + + // 垂直陀螺俯仰角 + dst.UAV_Pitch = src.UAV_GyroPitch; + } + else if (GPS_FB_PosState == 0x00) + { + // 前后GPS测:航向角+俯仰角 + dst.UAV_Yaw = src.GPS_FB_Heading; + dst.UAV_Pitch = src.GPS_FB_Pitch; + + // 垂直陀螺测滚转角 + dst.UAV_Roll = src.UAV_GyroRoll; + } + else + { + // 陀螺 + 磁航向 + dst.UAV_Yaw = src.UAV_MagHeading; // 航向角 + dst.UAV_Roll = src.UAV_GyroRoll; // 滚转角 + dst.UAV_Pitch = src.UAV_GyroPitch; + } + } + } +} + + + +// 转情报用IR复接数据 +void TransToIRQBFJ(struQB_FJ &dst, const struTranslateProtocal_FJ &src) +{ + dst.bValid = true; + if (src.bValid == true) + { + // 载荷姿态和属性 + dst.ZH_StablePlatformWorkState = src.ZH_StablePlatformWorkState; // 平台状态 + dst.ZH_TrackState = src.ZH_IRTrackState; // 跟踪状态 + dst.ZH_Pitch = src.ZH_Pitch; // 载荷俯仰角 + dst.ZH_Azimuth = src.ZH_Azimuth; // 载荷方位角 + + if (dst.ZH_Pitch > 10.5 || dst.ZH_Pitch < -110.1) + { + dst.bValid = false;; + } + + if (abs(dst.ZH_Azimuth) > 180) + { + dst.bValid = false;; + } + + dst.ZH_LaserOn = src.ZH_LaserOn; // 激光测距开关,true为开 + dst.ZH_LaserDist = src.ZH_LaserDist; // 激光测距值 + + dst.ZH_FocalLen = src.ZH_IRFocalLen; //焦距 + + // 适应数字变倍 2 + if (src.ZH_IRCameraDigitalDouble == 0x01) + { + dst.ZH_FocalLen = 2 * dst.ZH_FocalLen; + } + + if (dst.ZH_FocalLen < 1e-6) + { + dst.bValid = false; + } + + dst.ZH_DeltaX = src.ZH_DeltaX; //俯仰脱靶量 + dst.ZH_DeltaY = src.ZH_DeltaY; //方位脱靶量 + + if (abs(dst.ZH_DeltaX) > 320) + { + dst.bValid = false;; + } + + if (abs(dst.ZH_DeltaY) > 256) + { + dst.bValid = false;; + } + + dst.ZH_PixelSize = src.ZH_IRPixelSize; + + dst.ZH_ImgWidth = 720; // 图像宽 + dst.ZH_ImgHeight = 576; // 图像高 + + UINT8 GPS_LR_LocState = src.GPS_LR_WorkState & 0x0F; + UINT8 GPS_LR_PosState = src.GPS_LR_WorkState >> 4; + + UINT8 GPS_FB_LocState = src.GPS_FB_WorkState & 0x0F; + UINT8 GPS_FB_PosState = src.GPS_FB_WorkState >> 4; + + // 定位状态: + // 0x00 单点定位 + // 0x02 载波相位差分定位 + // 测资状态: + // 0x00 正常测资 + if (GPS_FB_LocState == 0x00 || GPS_FB_LocState == 0x02) // 前后正常定位 + { + dst.UAV_GPS_Lon = src.GPS_FB_Lon; // 无人机经度 + dst.UAV_GPS_Lat = src.GPS_FB_Lat; // 无人机纬度 + dst.UAV_GPS_Alt = src.GPS_FB_Alt; // 无人机高度 + dst.UAV_GPS_HSpeed = src.GPS_FB_HoriSpeed; // 水平速度 + + dst.UAV_GPS_Year = src.GPS_FB_Year; + dst.UAV_GPS_Month = src.GPS_FB_Month; + dst.UAV_GPS_Day = src.GPS_FB_Day; + dst.UAV_GPS_UTC = src.GPS_FB_UTC; + } + else if (GPS_LR_LocState == 0x00 || GPS_LR_LocState == 0x02) // 左右正常定位 + { + dst.UAV_GPS_Lon = src.GPS_LR_Lon; // 无人机经度 + dst.UAV_GPS_Lat = src.GPS_LR_Lat; // 无人机纬度 + dst.UAV_GPS_Alt = src.GPS_LR_Alt; // 无人机高度 + dst.UAV_GPS_HSpeed = src.GPS_LR_HoriSpeed; // 水平速度 + + dst.UAV_GPS_Year = src.GPS_LR_Year; + dst.UAV_GPS_Month = src.GPS_LR_Month; + dst.UAV_GPS_Day = src.GPS_LR_Day; + dst.UAV_GPS_UTC = src.GPS_LR_UTC; + } + else if (GPS_FB_LocState == 0x01 || GPS_FB_LocState == 0x03) // 前后正常定位 + { + dst.UAV_GPS_Lon = src.GPS_FB_Lon; // 无人机经度 + dst.UAV_GPS_Lat = src.GPS_FB_Lat; // 无人机纬度 + dst.UAV_GPS_Alt = src.GPS_FB_Alt; // 无人机高度 + dst.UAV_GPS_HSpeed = src.GPS_FB_HoriSpeed; // 水平速度 + + dst.UAV_GPS_Year = src.GPS_FB_Year; + dst.UAV_GPS_Month = src.GPS_FB_Month; + dst.UAV_GPS_Day = src.GPS_FB_Day; + dst.UAV_GPS_UTC = src.GPS_FB_UTC; + } + else if (GPS_LR_LocState == 0x01 || GPS_LR_LocState == 0x03) // 左右正常定位 + { + dst.UAV_GPS_Lon = src.GPS_LR_Lon; // 无人机经度 + dst.UAV_GPS_Lat = src.GPS_LR_Lat; // 无人机纬度 + dst.UAV_GPS_Alt = src.GPS_LR_Alt; // 无人机高度 + dst.UAV_GPS_HSpeed = src.GPS_LR_HoriSpeed; // 水平速度 + + dst.UAV_GPS_Year = src.GPS_LR_Year; + dst.UAV_GPS_Month = src.GPS_LR_Month; + dst.UAV_GPS_Day = src.GPS_LR_Day; + dst.UAV_GPS_UTC = src.GPS_LR_UTC; + } + else // 飞机不定位 + { + dst.bValid = false;; + } + + // 测资判断 + if (GPS_LR_PosState == 0x00 && GPS_FB_PosState == 0x00) + { + dst.UAV_Yaw = src.GPS_LR_Heading; // 航向角 + dst.UAV_Roll = src.GPS_LR_Roll; // 滚转角 + dst.UAV_Pitch = src.GPS_FB_Pitch; // 俯仰角 + } + else + { + if (GPS_LR_PosState == 0x00) + { + // 左右GPS测:航向角+滚转角 + dst.UAV_Yaw = src.GPS_LR_Heading; // 航向角 + dst.UAV_Roll = src.GPS_LR_Roll; // 滚转角 + + // 垂直陀螺俯仰角 + dst.UAV_Pitch = src.UAV_GyroPitch; + } + else if (GPS_FB_PosState == 0x00) + { + // 前后GPS测:航向角+俯仰角 + dst.UAV_Yaw = src.GPS_FB_Heading; + dst.UAV_Pitch = src.GPS_FB_Pitch; + + // 垂直陀螺测滚转角 + dst.UAV_Roll = src.UAV_GyroRoll; + } + else + { + // 陀螺 + 磁航向 + dst.UAV_Yaw = src.UAV_MagHeading; // 航向角 + dst.UAV_Roll = src.UAV_GyroRoll; // 滚转角 + dst.UAV_Pitch = src.UAV_GyroPitch; + } + } + } +} + + +// 功能:载荷导引,计算载荷姿态角() +// 输入: +// 1. uavPos:飞机位置,double uavPos[GPS经度,GPS纬度,GPS高度] +// 2. tgtPos:目标位置,double tgtPos[GPS经度,GPS纬度,GPS高度] +// 3. uavAttitude: 飞机姿态,double uavAttitude[俯仰,滚转,偏航] +// 输出: +// 1. loadPitch 载荷高低角,单位度 +// 2. loadAzimuth 载荷方位角,单位度 +// 返回值:计算成功返回true,否则返回false。 +bool CalLoadAttitudeForLoadGuide(double &loadPitch, double &loadAzimuth, const double *uavPos, const double *tgtPos, const double *uavAttitude) +{ + const double g_PI = 3.1415926; + + // 输入判断 + if (uavPos == nullptr || tgtPos == nullptr || uavAttitude == nullptr) + { + return false; + } + + double uavLon = uavPos[0]; + double uavLat = uavPos[1]; + double uavAlt = uavPos[2]; + + double tgtLon = tgtPos[0]; + double tgtLat = tgtPos[1]; + double tgtAlt = tgtPos[2]; + + double uavPitch = uavAttitude[0]; + double uavRoll = uavAttitude[1]; + double uavYaw = uavAttitude[2]; + + if (abs(uavLon) > 180 || abs(uavLat) > 90 || uavLat < 0) + { + return false; + } + + if (abs(tgtLon) > 180 || abs(tgtLat) > 90 || tgtLat < 0) + { + return false; + } + + // 目标 飞机限制在经纬度10度范围内,且飞机比目标要高 + if (abs(uavLon - tgtLon) > 10 || abs(uavLat - tgtLat) > 10 || uavAlt - tgtAlt < 0) + { + return false; + } + + // 计算飞机与目标的距离 + double uavTgtDist = 0; + CalculateTwoPtsSlopeDistance(uavTgtDist, uavPos, tgtPos, 3); + + // 最近距离要求 + if (uavTgtDist < 1) + { + return false; + } + + // 飞机三个姿态角 + uavPitch = uavAttitude[0] / 180 * CV_PI; + uavRoll = uavAttitude[1] / 180 * CV_PI; + uavYaw = uavAttitude[2] / 180 * CV_PI; + + // 飞机俯仰角 + cv::Mat m3(3, 3, CV_64FC1); + m3.at(0, 0) = 1; + m3.at(0, 1) = 0; + m3.at(0, 2) = 0; + + m3.at(1, 0) = 0; + m3.at(1, 1) = cos(uavPitch); + m3.at(1, 2) = -sin(uavPitch); + + m3.at(2, 0) = 0; + m3.at(2, 1) = sin(uavPitch); + m3.at(2, 2) = cos(uavPitch); + + // 飞机滚转角 + cv::Mat m4(3, 3, CV_64FC1); + m4.at(0, 0) = cos(uavRoll); + m4.at(0, 1) = 0; + m4.at(0, 2) = sin(uavRoll); + + m4.at(1, 0) = 0; + m4.at(1, 1) = 1; + m4.at(1, 2) = 0; + + m4.at(2, 0) = -sin(uavRoll); + m4.at(2, 1) = 0; + m4.at(2, 2) = cos(uavRoll); + + // 飞机航向角 + cv::Mat m5(3, 3, CV_64FC1); + m5.at(0, 0) = cos(uavYaw); + m5.at(0, 1) = sin(uavYaw); + m5.at(0, 2) = 0; + + m5.at(1, 0) = -sin(uavYaw); + m5.at(1, 1) = cos(uavYaw); + m5.at(1, 2) = 0; + + m5.at(2, 0) = 0; + m5.at(2, 1) = 0; + m5.at(2, 2) = 1; + + + // 矩阵乘法 + cv::Mat m543; + cv::gemm(m4, m3, 1, cv::noArray(), 0, m543); + cv::gemm(m5, m543, 1, cv::noArray(), 0, m543); + + double a1 = m543.at(0, 0); + double a2 = m543.at(0, 1); + double a3 = m543.at(0, 2); + + double a4 = m543.at(1, 0); + double a5 = m543.at(1, 1); + double a6 = m543.at(1, 2); + + double a7 = m543.at(2, 0); + double a8 = m543.at(2, 1); + double a9 = m543.at(2, 2); + + + // 基于飞机位置和目标位置求:x3 x6 x9 + double x3 = 0; + double x6 = 0; + double x9 = 0; + + // 飞机相对于目标的高度 + double height = uavAlt - tgtAlt; + x9 = height / uavTgtDist; + + // 三角形底边 + double distance = sqrt(pow(uavTgtDist, 2) - pow(height, 2)); + + // 求目标相对于飞机地面投影的方位角 + double azAngle = 0; + CalculateTwoPtsAzimuth(azAngle, uavLon, uavLat, tgtLon, tgtLat, 3); + + x3 = -distance * sin(azAngle / 180.0 * g_PI) / uavTgtDist; + x6 = -distance * cos(azAngle / 180.0 * g_PI) / uavTgtDist; + + + double delta1 = a1 * x3 + a4 * x6 + a7 * x9; + double delta2 = a2 * x3 + a5 * x6 + a8 * x9; + double delta3 = a3 * x3 + a6 * x6 + a9 * x9; + + loadPitch = acos(delta3) * 180 / g_PI - 90; + + double sinLoadAzimuth = -delta1 / sqrt(1 - delta3 * delta3); + double cosLoadAzimuth = -delta2 / sqrt(1 - delta3 * delta3); + + if (sinLoadAzimuth > 0 && cosLoadAzimuth > 0) + { + loadAzimuth = asin(sinLoadAzimuth) * 180 / g_PI; + } + else if (sinLoadAzimuth > 0 && cosLoadAzimuth < 0) + { + loadAzimuth = 180 - asin(sinLoadAzimuth) * 180 / g_PI; + } + else if (sinLoadAzimuth < 0 && cosLoadAzimuth < 0) + { + loadAzimuth = -180 - asin(sinLoadAzimuth) * 180 / g_PI; + } + else + { + loadAzimuth = asin(sinLoadAzimuth) * 180 / g_PI; + } + + return true; +} + +// 获取飞机姿态 +bool GetUAVLocAndPose(double &UAVLon, double &UAVLat,double &UAVAlt, + double &UAVRoll, double &UAVYaw,double &UAVPitch, + const struTranslateProtocal_FJ &src) +{ + UINT8 GPS_LR_LocState = src.GPS_LR_WorkState & 0x0F; + UINT8 GPS_LR_PosState = src.GPS_LR_WorkState >> 4; + + UINT8 GPS_FB_LocState = src.GPS_FB_WorkState & 0x0F; + UINT8 GPS_FB_PosState = src.GPS_FB_WorkState >> 4; + if (src.bValid == TRUE) + { + // 定位判断 + if (GPS_FB_LocState == 0x00 || GPS_FB_LocState == 0x02) // 前后正常定位 + { + UAVLon = src.GPS_LR_Lon; // 无人机经度 + UAVLat = src.GPS_LR_Lat; // 无人机纬度 + UAVAlt = src.GPS_LR_Alt; // 无人机高度 + } + else if (GPS_LR_LocState == 0x00 || GPS_LR_LocState == 0x02) // 左右正常定位 + { + UAVLon = src.GPS_LR_Lon; // 无人机经度 + UAVLat = src.GPS_LR_Lat; // 无人机纬度 + UAVAlt = src.GPS_LR_Alt; // 无人机高度 + + UAVYaw = src.GPS_LR_Heading; // 无人机航向角 + UAVRoll = src.GPS_LR_Roll; // 无人机滚转角 + } + else if (GPS_FB_LocState == 0x01 || GPS_FB_LocState == 0x03) + { + UAVLon = src.GPS_LR_Lon; // 无人机经度 + UAVLat = src.GPS_LR_Lat; // 无人机纬度 + UAVAlt = src.GPS_LR_Alt; // 无人机高度 + + UAVYaw = src.GPS_LR_Heading; // 无人机航向角 + UAVRoll = src.GPS_LR_Roll; // 无人机滚转角 + } + else if (GPS_LR_LocState == 0x01 || GPS_LR_LocState == 0x03) + { + UAVLon = src.GPS_LR_Lon; // 无人机经度 + UAVLat = src.GPS_LR_Lat; // 无人机纬度 + UAVAlt = src.GPS_LR_Alt; // 无人机高度 + + UAVYaw = src.GPS_LR_Heading; // 无人机航向角 + UAVRoll = src.GPS_LR_Roll; // 无人机滚转角 + } + else + { + return false; + } + // 测姿判断 + // 测资判断 + if (GPS_LR_PosState == 0x00 && GPS_FB_PosState == 0x00) + { + UAVYaw = src.GPS_LR_Heading; // 无人机航向角 + UAVRoll = src.GPS_LR_Roll; // 无人机滚转角 + UAVPitch = src.GPS_FB_Pitch; // 无人机俯仰角 + } + else + { + if (GPS_LR_PosState == 0x00) + { + // 左右GPS测:航向角+滚转角 + UAVYaw = src.GPS_LR_Heading; // 无人机航向角 + UAVRoll = src.GPS_LR_Roll; // 无人机滚转角 + + // 垂直陀螺俯仰角 + UAVPitch = src.UAV_GyroPitch; + } + else if (GPS_FB_PosState == 0x00) + { + // 前后GPS测:航向角+俯仰角 + UAVYaw = src.GPS_FB_Heading; + UAVPitch = src.GPS_FB_Pitch; + + // 垂直陀螺测滚转角 + UAVRoll = src.UAV_GyroRoll; + } + else + { + // 陀螺 + 磁航向 + UAVYaw = src.UAV_MagHeading; // 航向角 + UAVRoll = src.UAV_GyroRoll; // 滚转角 + UAVPitch = src.UAV_GyroPitch; + } + } + } + return true; +} + + +// 计算方位角 +double getYaw(double XA, double YA) +{ + // 输出合成航向角 Yaw + double PayLoad_Yaw = 0; + + // 在坐标轴上 + if (XA > 0 && YA == 0) + { + PayLoad_Yaw = 90; + } + else if (XA < 0 && YA == 0) + { + PayLoad_Yaw = -90; + } + else if (XA == 0 && YA > 0) + { + PayLoad_Yaw = 0; + } + else if (XA == 0 && YA < 0) + { + PayLoad_Yaw = 180; + } + else + { + double tanYaw = 0.0; + if (YA > 0 && XA > 0) + { + // 第1象限 + tanYaw = XA / YA; + PayLoad_Yaw = atan(tanYaw) * 180 / CV_PI; + } + else if (YA < 0 && XA > 0) + { + // 第2象限 + tanYaw = -XA / YA; + PayLoad_Yaw = atan(tanYaw) * 180 / CV_PI; + PayLoad_Yaw = 180 - PayLoad_Yaw; + } + else if (YA < 0 && XA < 0) + { + // 第3象限 + tanYaw = XA / YA; + PayLoad_Yaw = atan(tanYaw) * 180 / CV_PI; + PayLoad_Yaw = -180 + PayLoad_Yaw; + } + else if (YA > 0 && XA < 0) + { + // 第4象限 + tanYaw = -XA / YA; + PayLoad_Yaw = atan(tanYaw) * 180 / CV_PI; + PayLoad_Yaw = -PayLoad_Yaw; + } + } + + return PayLoad_Yaw; +} + + +//功能:计算图像中任意点经纬度坐标 无误差补偿 +//输入: 1. frame 输入复接数据 +// 2. pt_x: 列 +// 3. pt_y: 行 +// +//输出: 1. Lon 经度 +// 2. Lat: 纬度 +// 3. 返回值:处理成功返回true,失败返回false +bool CalAnyPtCoordinateWithoutErrorCompensate(double &Lon, double &Lat, double &H, const struQB_FJ *frame, int pt_x, int pt_y) +{ + try + { + // 基础条件判断 + if (frame == NULL || frame->bValid == FALSE) + { + return false; + } + + // 判断复接数据有效性 + double uavLon = frame->UAV_GPS_Lon; + double uavLat = frame->UAV_GPS_Lat; + double uavAlt = frame->UAV_GPS_Alt; + + double uavGroundHeight = frame->UAV_GroundHeight; + + double uavYaw = frame->UAV_Yaw; + double uavPitch = frame->UAV_Pitch; + double uavRoll = frame->UAV_Roll; + + double zhAz = frame->ZH_Azimuth; + double zhPitch = frame->ZH_Pitch; + + // 2. 越界判断 + if (abs(uavLon) > 180) // 经度 + { + return false; + } + + if (abs(uavLat) > 90) // 纬度 + { + return false; + } + + if (uavAlt < 0 || uavAlt > 10000) // 高度 + { + return false; + } + + if (uavGroundHeight < 0 || (uavAlt - uavGroundHeight < 30)) + { + return false; + } + + if (abs(uavYaw) > 360) // 飞机航向角 + { + return false; + } + + if (abs(uavPitch) > 30) // 飞机俯仰角 + { + return false; + } + + if (abs(uavRoll) > 30) // 飞机滚转角 + { + return false; + } + + if (abs(zhAz) > 180) // 载荷方位角 + { + return false; + } + + if (zhPitch > -15 || zhPitch < -110) + { + return false; + } + + // 图像尺寸 + int imgWidth = frame->ZH_ImgWidth; + int imgHeight = frame->ZH_ImgHeight; + + // 判断 + if (imgWidth <= 0 || imgHeight <= 0) + { + return false; + } + + // 输入位置判断 + if (pt_x < 0 || pt_x >= imgWidth) + { + return false; + } + + if (pt_y < 0 || pt_y >= imgHeight) + { + return false; + } + + // 焦距 + double f = frame->ZH_FocalLen / 1000; // 米 + if (f <= 0) + { + return false; + } + + // 像元尺寸 米 + double pixelSize = frame->ZH_PixelSize; + if (pixelSize <= 0) + { + return false; + } + + // 飞机 + double UAV_ROLL = uavRoll; // 飞机滚转角 (角度) + double UAV_PITCH = uavPitch; // 飞机俯仰角 (角度) + double UAV_YAW = uavYaw; // 飞机航向角 (角度) + + // 载荷 + double ZH_PITCH = zhPitch; // 载荷高低角 (角度) + double ZH_YAW = zhAz; // 载荷方位角 (角度) + + // 载荷俯仰角修正 + ZH_PITCH = ZH_PITCH + 90; // [0 90] + + // 各个角转换为弧度 + ZH_PITCH = ZH_PITCH / 180 * CV_PI; // 1 + ZH_YAW = ZH_YAW / 180 * CV_PI; // 2 + + UAV_PITCH = UAV_PITCH / 180 * CV_PI; // 3 + UAV_ROLL = UAV_ROLL / 180 * CV_PI; // 4 + UAV_YAW = UAV_YAW / 180 * CV_PI; // 5 + + + double BaseLon = uavLon; // 经度 + double BaseLat = uavLat; // 经度 + + double height = uavAlt - uavGroundHeight; // 相对高度 = 飞行高度 - 地面高程 + + bool bLaser = frame->ZH_LaserOn; + double LaserDistance = frame->ZH_LaserDist; + + // 激光测距有效性判断 + if (bLaser == true && LaserDistance < 100) + { + return false; + } + + // 计算旋转矩阵 + // x1 x2 x3 + // x4 x5 x6 + // x7 x8 x9 + + // 载荷俯仰角 + cv::Mat m1(3,3,CV_64FC1); + m1.at(0,0) = 1; + m1.at(0,1) = 0; + m1.at(0,2) = 0; + + m1.at(1,0) = 0; + m1.at(1,1) = cos(ZH_PITCH); + m1.at(1,2) = -sin(ZH_PITCH); + + m1.at(2,0) = 0; + m1.at(2,1) = sin(ZH_PITCH); + m1.at(2,2) = cos(ZH_PITCH); + + // 载荷方位角 + cv::Mat m2(3,3,CV_64FC1); + m2.at(0,0) = cos(ZH_YAW); + m2.at(0,1) = sin(ZH_YAW); + m2.at(0,2) = 0; + + m2.at(1,0) = -sin(ZH_YAW); + m2.at(1,1) = cos(ZH_YAW); + m2.at(1,2) = 0; + + m2.at(2,0) = 0; + m2.at(2,1) = 0; + m2.at(2,2) = 1; + + // 飞机俯仰角 + cv::Mat m3(3,3,CV_64FC1); + m3.at(0,0) = 1; + m3.at(0,1) = 0; + m3.at(0,2) = 0; + + m3.at(1,0) = 0; + m3.at(1,1) = cos(UAV_PITCH); + m3.at(1,2) = -sin(UAV_PITCH); + + m3.at(2,0) = 0; + m3.at(2,1) = sin(UAV_PITCH); + m3.at(2,2) = cos(UAV_PITCH); + + // 飞机滚转角 + cv::Mat m4(3,3,CV_64FC1); + m4.at(0,0) = cos(UAV_ROLL); + m4.at(0,1) = 0; + m4.at(0,2) = sin(UAV_ROLL); + + m4.at(1,0) = 0; + m4.at(1,1) = 1; + m4.at(1,2) = 0; + + m4.at(2,0) = -sin(UAV_ROLL); + m4.at(2,1) = 0; + m4.at(2,2) = cos(UAV_ROLL); + + // 飞机航向角 + cv::Mat m5(3,3,CV_64FC1); + m5.at(0,0) = cos(UAV_YAW); + m5.at(0,1) = sin(UAV_YAW); + m5.at(0,2) = 0; + + m5.at(1,0) = -sin(UAV_YAW); + m5.at(1,1) = cos(UAV_YAW); + m5.at(1,2) = 0; + + m5.at(2,0) = 0; + m5.at(2,1) = 0; + m5.at(2,2) = 1; + + + // 矩阵乘法 + cv::Mat m54321; + cv::gemm(m2, m1, 1, cv::noArray(), 0, m54321); + cv::gemm(m3, m54321, 1, cv::noArray(), 0, m54321); + cv::gemm(m4, m54321, 1, cv::noArray(), 0, m54321); + cv::gemm(m5, m54321, 1, cv::noArray(), 0, m54321); + + + // 取出M54321中的值 + double x1 = m54321.at(0,0); + double x2 = m54321.at(0,1); + double x3 = m54321.at(0,2); + + double x4 = m54321.at(1,0); + double x5 = m54321.at(1,1); + double x6 = m54321.at(1,2); + + double x7 = m54321.at(2,0); + double x8 = m54321.at(2,1); + double x9 = m54321.at(2,2); + + // 坐标转换 + double x = 0, y = 0; + + // 像平面坐标系 + x = +pt_x - imgWidth / 2; + y = -pt_y + imgHeight / 2; + + // 转换为物理坐标 单位 米 + x = x * pixelSize; + y = y * pixelSize; + + // 分母零值判断 + if (x7 * x + x8 * y - x9 * f == 0) + { + return false; + } + + // 共线方程模型 + double XA = -(x1 * x + x2 * y - x3 * f) / (x7 * x + x8 * y - x9 * f) * height; + double YA = -(x4 * x + x5 * y - x6 * f) / (x7 * x + x8 * y - x9 * f) * height; + + // 计算方位角和距离 + double distance = sqrt(XA * XA + YA * YA); + double yaw = getYaw(XA, YA); + + // 计算图像中心点经纬度 + CalculatePtCoordinate(Lon, Lat, BaseLon, BaseLat, yaw, distance, 3); // WGS84坐标系 + + // 目标高度计算 + H = uavGroundHeight; + + return true; + } + catch(cv::Exception &e) + { + e.msg.c_str(); + return false; + } + catch(...) + { + return false; + } + + return true; +} + + +// 充分利用激光,提高单点定位精度 +void CalLonLatOffset(double &LonOffset, double &LatOffset, const struQB_FJ *frame) +{ + try + { + // 置零 + LonOffset = 0; + LatOffset = 0; + + // 基础条件判断 + if (frame == NULL || frame->bValid == false) + { + return; + } + + // 如果无激光 直接返回 + if ((frame->ZH_LaserOn == true && frame->ZH_LaserDist > 0 && frame->ZH_LaserDist < 65535) == false) + { + return; + } + + // 激光测量计算结果 + double LaserLon = 0.0; + double LaserLat = 0.0; + double LaserH = 0.0; + + // 无激光测量计算结果 + double Lon = 0.0; + double Lat = 0.0; + double H = 0.0; + + if (true == CalImgCenterCoordinate(LaserLon, LaserLat, LaserH, frame) && + true == CalAnyPtCoordinateWithoutErrorCompensate(Lon, Lat, H, frame, frame->ZH_ImgWidth / 2, frame->ZH_ImgWidth / 2)) + { + LonOffset = LaserLon - Lon; + LatOffset = LaserLat - Lat; + } + } + catch(cv::Exception &e) + { + e.msg.c_str(); + return; + } + catch(...) + { + return; + } +} + +// 计算图像中心点经纬度坐标 +bool CalImgCenterCoordinate(double &Lon, double &Lat, double &H, const struQB_FJ *frame) +{ + try + { + // 基础条件判断 + if (frame == NULL || frame->bValid == FALSE) + { + return false; + } + + // 判断复接数据有效性 + double uavLon = frame->UAV_GPS_Lon; + double uavLat = frame->UAV_GPS_Lat; + double uavAlt = frame->UAV_GPS_Alt; + + double uavGroundHeight = frame->UAV_GroundHeight; + + double uavYaw = frame->UAV_Yaw; + double uavPitch = frame->UAV_Pitch; + double uavRoll = frame->UAV_Roll; + + double zhAz = frame->ZH_Azimuth; + double zhPitch = frame->ZH_Pitch; + + // 2. 越界判断 + if (abs(uavLon) > 180) // 经度 + { + return false; + } + + if (abs(uavLat) > 90) // 纬度 + { + return false; + } + + if (uavAlt < 0 || uavAlt > 10000) // 高度 + { + return false; + } + + if (uavGroundHeight < 0 || (uavAlt - uavGroundHeight < 30)) + { + return false; + } + + if (abs(uavYaw) > 360) // 飞机航向角 + { + return false; + } + + if (abs(uavPitch) > 30) // 飞机俯仰角 + { + return false; + } + + if (abs(uavRoll) > 30) // 飞机滚转角 + { + return false; + } + + if (abs(zhAz) > 180) // 载荷方位角 + { + return false; + } + + if (zhPitch > -15 || zhPitch < -110) + { + return false; + } + + + // 飞机 + double UAV_ROLL = uavRoll; // 飞机滚转角 (角度) + double UAV_PITCH = uavPitch; // 飞机俯仰角 (角度) + double UAV_YAW = uavYaw; // 飞机航向角 (角度) + + // 载荷 + double ZH_PITCH = zhPitch; // 载荷高低角 (角度) + double ZH_YAW = zhAz; // 载荷方位角 (角度) + + // 载荷俯仰角修正 + ZH_PITCH = ZH_PITCH + 90; // [0 90] + + // 各个角转换为弧度 + ZH_PITCH = ZH_PITCH / 180 * CV_PI; // 1 + ZH_YAW = ZH_YAW / 180 * CV_PI; // 2 + + UAV_PITCH = UAV_PITCH / 180 * CV_PI; // 3 + UAV_ROLL = UAV_ROLL / 180 * CV_PI; // 4 + UAV_YAW = UAV_YAW / 180 * CV_PI; // 5 + + + double BaseLon = uavLon; // 经度 + double BaseLat = uavLat; // 经度 + + double height = uavAlt - uavGroundHeight; // 相对高度 = 飞行高度 - 地面高程 + + bool bLaser = frame->ZH_LaserOn; + double LaserDistance = frame->ZH_LaserDist; + + // 激光测距有效性判断 + if (bLaser == true && LaserDistance < 100) + { + bLaser = false; + } + + // 计算旋转矩阵 + // x1 x2 x3 + // x4 x5 x6 + // x7 x8 x9 + + // 载荷俯仰角 + cv::Mat m1(3,3,CV_64FC1); + m1.at(0,0) = 1; + m1.at(0,1) = 0; + m1.at(0,2) = 0; + + m1.at(1,0) = 0; + m1.at(1,1) = cos(ZH_PITCH); + m1.at(1,2) = -sin(ZH_PITCH); + + m1.at(2,0) = 0; + m1.at(2,1) = sin(ZH_PITCH); + m1.at(2,2) = cos(ZH_PITCH); + + // 载荷方位角 + cv::Mat m2(3,3,CV_64FC1); + m2.at(0,0) = cos(ZH_YAW); + m2.at(0,1) = sin(ZH_YAW); + m2.at(0,2) = 0; + + m2.at(1,0) = -sin(ZH_YAW); + m2.at(1,1) = cos(ZH_YAW); + m2.at(1,2) = 0; + + m2.at(2,0) = 0; + m2.at(2,1) = 0; + m2.at(2,2) = 1; + + // 飞机俯仰角 + cv::Mat m3(3,3,CV_64FC1); + m3.at(0,0) = 1; + m3.at(0,1) = 0; + m3.at(0,2) = 0; + + m3.at(1,0) = 0; + m3.at(1,1) = cos(UAV_PITCH); + m3.at(1,2) = -sin(UAV_PITCH); + + m3.at(2,0) = 0; + m3.at(2,1) = sin(UAV_PITCH); + m3.at(2,2) = cos(UAV_PITCH); + + // 飞机滚转角 + cv::Mat m4(3,3,CV_64FC1); + m4.at(0,0) = cos(UAV_ROLL); + m4.at(0,1) = 0; + m4.at(0,2) = sin(UAV_ROLL); + + m4.at(1,0) = 0; + m4.at(1,1) = 1; + m4.at(1,2) = 0; + + m4.at(2,0) = -sin(UAV_ROLL); + m4.at(2,1) = 0; + m4.at(2,2) = cos(UAV_ROLL); + + // 飞机航向角 + cv::Mat m5(3,3,CV_64FC1); + m5.at(0,0) = cos(UAV_YAW); + m5.at(0,1) = sin(UAV_YAW); + m5.at(0,2) = 0; + + m5.at(1,0) = -sin(UAV_YAW); + m5.at(1,1) = cos(UAV_YAW); + m5.at(1,2) = 0; + + m5.at(2,0) = 0; + m5.at(2,1) = 0; + m5.at(2,2) = 1; + + + // 矩阵乘法 + cv::Mat m54321; + cv::gemm(m2, m1, 1, cv::noArray(), 0, m54321); + cv::gemm(m3, m54321, 1, cv::noArray(), 0, m54321); + cv::gemm(m4, m54321, 1, cv::noArray(), 0, m54321); + cv::gemm(m5, m54321, 1, cv::noArray(), 0, m54321); + + + // 取出M54321中的值 + double x1 = m54321.at(0,0); + double x2 = m54321.at(0,1); + double x3 = m54321.at(0,2); + + double x4 = m54321.at(1,0); + double x5 = m54321.at(1,1); + double x6 = m54321.at(1,2); + + double x7 = m54321.at(2,0); + double x8 = m54321.at(2,1); + double x9 = m54321.at(2,2); + + + // 如果有激光测距 以激光测距为准 + if (bLaser == true && LaserDistance < 65535) // 65535 = 0xFFFF 无效值 + { + height = LaserDistance * x9; + } + + double XA = -(x3) / (x9) * height; + double YA = -(x6) / (x9) * height; + + // 输出合成航向角 Yaw + double PayLoad_Yaw = 0; + PayLoad_Yaw = getYaw(XA, YA); + + // 高低角 合成 + double PayLoad_Pitch = acos(x9) * 180 / CV_PI; + + // 三角形底边 + double distance = height * tan(PayLoad_Pitch / 180.0 * CV_PI); + + // 如果有激光测距 以激光测距为准 + if (bLaser == true && LaserDistance < 65535) + { + // 根据激光距离和合成角度 计算平面投影距离 + distance = LaserDistance * sin(PayLoad_Pitch / 180.0 * CV_PI); + } + + //功能:计算目标点的经纬度 + CalculatePtCoordinate(Lon, Lat, BaseLon, BaseLat, PayLoad_Yaw, distance, 3); // WGS84坐标系 + + // 目标高度计算 + H = uavGroundHeight; + + // 如果有激光测距 + if (bLaser == true && LaserDistance < 65535) + { + H = uavAlt - LaserDistance * cos(PayLoad_Pitch * CV_PI / 180); + } + } + catch(cv::Exception &e) + { + e.msg.c_str(); + return false; + } + catch(...) + { + return false; + } + + return true; +} + +//功能:计算图像中任意点经纬度坐标 +//输入: 1. frame 输入复接数据 +// 2. pt_x: 列 +// 3. pt_y: 行 +// +//输出: 1. Lon 经度 +// 2. Lat: 纬度 +// 3. 返回值:处理成功返回true,失败返回false +bool CalAnyPtCoordinate(double &Lon, double &Lat, double &H, const struQB_FJ *frame, int pt_x, int pt_y) +{ + try + { + // 基础条件判断 + if (frame == NULL || frame->bValid == FALSE) + { + return false; + } + + // 判断复接数据有效性 + double uavLon = frame->UAV_GPS_Lon; + double uavLat = frame->UAV_GPS_Lat; + double uavAlt = frame->UAV_GPS_Alt; + + double uavGroundHeight = frame->UAV_GroundHeight; + + double uavYaw = frame->UAV_Yaw; + double uavPitch = frame->UAV_Pitch; + double uavRoll = frame->UAV_Roll; + + double zhAz = frame->ZH_Azimuth; + double zhPitch = frame->ZH_Pitch; + + // 2. 越界判断 + if (abs(uavLon) > 180) // 经度 + { + return false; + } + + if (abs(uavLat) > 90) // 纬度 + { + return false; + } + + if (uavAlt < 0 || uavAlt > 10000) // 高度 + { + return false; + } + + if (uavGroundHeight < 0 || (uavAlt - uavGroundHeight < 30)) + { + return false; + } + + if (abs(uavYaw) > 360) // 飞机航向角 + { + return false; + } + + if (abs(uavPitch) > 30) // 飞机俯仰角 + { + return false; + } + + if (abs(uavRoll) > 30) // 飞机滚转角 + { + return false; + } + + if (abs(zhAz) > 180) // 载荷方位角 + { + return false; + } + + if (zhPitch > -15 || zhPitch < -110) + { + return false; + } + + // 图像尺寸 + int imgWidth = frame->ZH_ImgWidth; + int imgHeight = frame->ZH_ImgHeight; + + // 判断 + if (imgWidth <= 0 || imgHeight <= 0) + { + return false; + } + + // 输入位置判断 + if (pt_x < 0 || pt_x >= imgWidth) + { + return false; + } + + if (pt_y < 0 || pt_y >= imgHeight) + { + return false; + } + + // 焦距 + double f = frame->ZH_FocalLen / 1000; // 米 + if (f <= 0) + { + return false; + } + + // 像元尺寸 米 + double pixelSize = frame->ZH_PixelSize; + if (pixelSize <= 0) + { + return false; + } + + // 飞机 + double UAV_ROLL = uavRoll; // 飞机滚转角 (角度) + double UAV_PITCH = uavPitch; // 飞机俯仰角 (角度) + double UAV_YAW = uavYaw; // 飞机航向角 (角度) + + // 载荷 + double ZH_PITCH = zhPitch; // 载荷高低角 (角度) + double ZH_YAW = zhAz; // 载荷方位角 (角度) + + // 载荷俯仰角修正 + ZH_PITCH = ZH_PITCH + 90; // [0 90] + + // 各个角转换为弧度 + ZH_PITCH = ZH_PITCH / 180 * CV_PI; // 1 + ZH_YAW = ZH_YAW / 180 * CV_PI; // 2 + + UAV_PITCH = UAV_PITCH / 180 * CV_PI; // 3 + UAV_ROLL = UAV_ROLL / 180 * CV_PI; // 4 + UAV_YAW = UAV_YAW / 180 * CV_PI; // 5 + + + double BaseLon = uavLon; // 经度 + double BaseLat = uavLat; // 经度 + + double height = uavAlt - uavGroundHeight; // 相对高度 = 飞行高度 - 地面高程 + + bool bLaser = frame->ZH_LaserOn; + double LaserDistance = frame->ZH_LaserDist; + + // 激光测距有效性判断 + if (bLaser == true && LaserDistance < 100) + { + bLaser = false; + } + + // 计算旋转矩阵 + // x1 x2 x3 + // x4 x5 x6 + // x7 x8 x9 + + // 载荷俯仰角 + cv::Mat m1(3,3,CV_64FC1); + m1.at(0,0) = 1; + m1.at(0,1) = 0; + m1.at(0,2) = 0; + + m1.at(1,0) = 0; + m1.at(1,1) = cos(ZH_PITCH); + m1.at(1,2) = -sin(ZH_PITCH); + + m1.at(2,0) = 0; + m1.at(2,1) = sin(ZH_PITCH); + m1.at(2,2) = cos(ZH_PITCH); + + // 载荷方位角 + cv::Mat m2(3,3,CV_64FC1); + m2.at(0,0) = cos(ZH_YAW); + m2.at(0,1) = sin(ZH_YAW); + m2.at(0,2) = 0; + + m2.at(1,0) = -sin(ZH_YAW); + m2.at(1,1) = cos(ZH_YAW); + m2.at(1,2) = 0; + + m2.at(2,0) = 0; + m2.at(2,1) = 0; + m2.at(2,2) = 1; + + // 飞机俯仰角 + cv::Mat m3(3,3,CV_64FC1); + m3.at(0,0) = 1; + m3.at(0,1) = 0; + m3.at(0,2) = 0; + + m3.at(1,0) = 0; + m3.at(1,1) = cos(UAV_PITCH); + m3.at(1,2) = -sin(UAV_PITCH); + + m3.at(2,0) = 0; + m3.at(2,1) = sin(UAV_PITCH); + m3.at(2,2) = cos(UAV_PITCH); + + // 飞机滚转角 + cv::Mat m4(3,3,CV_64FC1); + m4.at(0,0) = cos(UAV_ROLL); + m4.at(0,1) = 0; + m4.at(0,2) = sin(UAV_ROLL); + + m4.at(1,0) = 0; + m4.at(1,1) = 1; + m4.at(1,2) = 0; + + m4.at(2,0) = -sin(UAV_ROLL); + m4.at(2,1) = 0; + m4.at(2,2) = cos(UAV_ROLL); + + // 飞机航向角 + cv::Mat m5(3,3,CV_64FC1); + m5.at(0,0) = cos(UAV_YAW); + m5.at(0,1) = sin(UAV_YAW); + m5.at(0,2) = 0; + + m5.at(1,0) = -sin(UAV_YAW); + m5.at(1,1) = cos(UAV_YAW); + m5.at(1,2) = 0; + + m5.at(2,0) = 0; + m5.at(2,1) = 0; + m5.at(2,2) = 1; + + + // 矩阵乘法 + cv::Mat m54321; + cv::gemm(m2, m1, 1, cv::noArray(), 0, m54321); + cv::gemm(m3, m54321, 1, cv::noArray(), 0, m54321); + cv::gemm(m4, m54321, 1, cv::noArray(), 0, m54321); + cv::gemm(m5, m54321, 1, cv::noArray(), 0, m54321); + + + // 取出M54321中的值 + double x1 = m54321.at(0,0); + double x2 = m54321.at(0,1); + double x3 = m54321.at(0,2); + + double x4 = m54321.at(1,0); + double x5 = m54321.at(1,1); + double x6 = m54321.at(1,2); + + double x7 = m54321.at(2,0); + double x8 = m54321.at(2,1); + double x9 = m54321.at(2,2); + + // 坐标转换 + double x = 0, y = 0; + + // 像平面坐标系 + x = +pt_x - imgWidth / 2; + y = -pt_y + imgHeight / 2; + + // 转换为物理坐标 单位 米 + x = x * pixelSize; + y = y * pixelSize; + + // 分母零值判断 + if (x7 * x + x8 * y - x9 * f == 0) + { + return false; + } + + // 共线方程模型 + double XA = -(x1 * x + x2 * y - x3 * f) / (x7 * x + x8 * y - x9 * f) * height; + double YA = -(x4 * x + x5 * y - x6 * f) / (x7 * x + x8 * y - x9 * f) * height; + + // 计算方位角和距离 + double distance = sqrt(XA * XA + YA * YA); + double yaw = getYaw(XA, YA); + + // 计算图像中心点经纬度 + CalculatePtCoordinate(Lon, Lat, BaseLon, BaseLat, yaw, distance, 3); // WGS84坐标系 + + // 充分利用激光定位相对准确,计算偏移量,作补偿 + double Lonoffset = 0.0; + double Latoffset = 0.0; + CalLonLatOffset(Lonoffset, Latoffset, frame); + + // 修正偏移量 + Lon += Lonoffset; + Lat += Latoffset; + + // 目标高度计算 + H = uavGroundHeight; + + return true; + } + catch(cv::Exception &e) + { + e.msg.c_str(); + return false; + } + catch(...) + { + return false; + } + + return true; +} + +// 功能:释放情报数据 +void ReleaseQBData(QBStru *pQBData) +{ + // 指针为空判断 + if (pQBData != NULL) + { + // srcImg + delete [] pQBData->image.srcImg.buff; + + // dstImg + delete [] pQBData->image.dstImg.buff; + + // demImg + delete [] pQBData->image.geoImg.buff; + + // 清零 + memset(pQBData, 0, sizeof(QBStru)); + } +} + +// 功能:克隆图像数据 +void CloneImgStru(const ImgStru *src, ImgStru *dst) +{ + try + { + if(src == NULL || dst == NULL) + { + return; + } + + if (src->ImgWidth > 0 && src->ImgHeight > 0 && (src->bitcount == 24 || src->bitcount == 8) && src->buff != NULL) + { + // 图像属性复制 + dst->ImgWidth = src->ImgWidth; + dst->ImgHeight = src->ImgHeight; + dst->bitcount = src->bitcount; + dst->BoundingBox = src->BoundingBox; + + // 数据复制 + SAFE_DELETE_ARRAY(dst->buff); + dst->buff = NULL; + + // 步长:每行像素所占字节数,必须扩展成4的倍数 + int lineByte = (dst->ImgWidth * dst->bitcount / 8); + + // 位图数据缓冲区的大小,即图像大小 + int imgBufSize = dst->ImgHeight * lineByte; + + // 分配内存空间 + if (imgBufSize > 0) + { + dst->buff = new BYTE[imgBufSize]; + + if (dst->buff != NULL) + { + memcpy(dst->buff, src->buff, static_cast(imgBufSize)); // 图像数据复制 + } + } + + dst->BoundingBox = src->BoundingBox; + } + } + catch(cv::Exception &e) + { + e.msg; + return; + } + catch(...) + { + return; + } +} + +void CloneQBData(const QBStru *src, QBStru *dst) +{ + if(src == NULL || dst == NULL) + { + return; + } + + // 如果src数据均无效,直接返回 + if (src->image.bValid == false) + { + return; + } + + // dst->frameAll = src->frameAll; + dst->framePart = src->framePart; + + + if (src->image.bValid == true) + { + dst->image.bValid = true; + CloneImgStru(&src->image.srcImg, &dst->image.srcImg); + CloneImgStru(&src->image.dstImg, &dst->image.dstImg); + CloneImgStru(&src->image.geoImg, &dst->image.geoImg); + } +} + +BYTE Buffer[512000]; + +void GetH264VideoDataFromNet() +{ + // 实时状态 + if (g_bWorkMode == false) + { + BYTE Buffer[512000]; + sockaddr_in loc; + while (true && g_socketFH96Data != INVALID_SOCKET) + { + // 接收数据 + int len = sizeof(SOCKADDR); + int ret = recvfrom(g_socketFH96Data, + (char* )&Buffer, + 512000, + 0, + (struct sockaddr*)&loc, + &len); + if (ret != SOCKET_ERROR) + { + if (g_CH96_h264decoder != nullptr) + { + g_CH96_h264decoder->decoding(Buffer, ret); + } + // 处理数据 + //SocketReceiveH264VideoData(Buffer, ret); + /*if (g_tcpStarted) + { + g_TCPTrans2Server.WriteBuffer(Buffer, ret); + }*/ + if (g_udpStarted) + { + int iTimes = ret/512; + for (int i = 0; i < iTimes; i++) + { + g_UDPTrans2Server.WriteBuffer(Buffer + i * 512, 512); + } + if (ret%512 > 0) + { + g_UDPTrans2Server.WriteBuffer(Buffer + iTimes * 512, ret%512); + } + + //g_UDPTrans2Server.WriteBuffer(Buffer, ret); + } + } + } + } +} + +void SocketReceiveH264VideoData(const void* buffer, int length) +{ + if (buffer == nullptr || length < 1) + { + return; + } + else + { + // 存入内存池——多线程开关,用于ProcessData + WaitForSingleObject(g_hMutex_ProcessDataH264, INFINITE); + try + { + if (g_bWorkMode == false) // 实时模式下写入文件 + { + //写入本地文件 + if (g_pFileSaveVideoH264Data != NULL) + { + fwrite(buffer, static_cast(1), length, g_pFileSaveVideoH264Data); // 写数据 + } + } + + // 判定数据 + if (length + g_validDataLenSocket < g_MaxBufferLenSocket) //初始g_validDataLenSocket为0,即为如果收数的length小于最大字长,则…… + { + memcpy(g_receiveDataBufferSocket + g_validDataLenSocket, buffer, length); //将buffer内容拷贝到g_receiveDataBufferSocket延长g_validDataLenSocket个字节之后的g_receiveDataBufferSocket中 + g_validDataLenSocket = length + g_validDataLenSocket; //有效字长置为收数字长 + } + else + { + if (length <= g_MaxBufferLenSocket) // 修改(增添) + { + // 清理缓存 + g_validDataLenSocket = 0; + + // 记录本次数据 + memcpy(g_receiveDataBufferSocket + g_validDataLenSocket, buffer, length); + g_validDataLenSocket = length + g_validDataLenSocket; + } + } + ReleaseMutex(g_hMutex_ProcessDataH264); + } + catch(...) + { + ReleaseMutex(g_hMutex_ProcessDataH264); + } + } +} + +void ProcessH264VideoData() +{ + return; + while(g_bProcessDataSocketFlag) + { + try + { + WaitForSingleObject(g_hMutex_ProcessDataH264, INFINITE); + // 是否成功将数据复制到临时位置,表征变量 + //bool bHaveRelease = false; + // 最小帧长 + if (g_validDataLenSocket > 0) + { + //unsigned char midBuffer[1024]; + + //// 数据复制 + //memcpy(midBuffer, g_receiveDataBufferSocket, 1024); + //// 更新内存 + //unsigned int frameLen = 256; + //g_validDataLenSocket = g_validDataLenSocket - frameLen; + //memcpy(g_receiveDataBuffer_middleSocket, g_receiveDataBufferSocket + frameLen, g_validDataLenSocket); + //memcpy(g_receiveDataBufferSocket, g_receiveDataBuffer_middleSocket, g_validDataLenSocket); + ReleaseMutex(g_hMutex_ProcessDataH264); + // 数据成功复制到临时位置 + //bHaveRelease = true; + // 解码 + if (g_CH96_h264decoder != nullptr) + { + g_CH96_h264decoder->decoding(g_receiveDataBufferSocket, g_validDataLenSocket); + } + // 天进吊舱解码 + if (g_CH96_h264decoder != nullptr) + { + g_CH96_h264decoder->decoding(g_receiveDataBufferSocket , 25600); + } + } + + /*if (bHaveRelease == false) + { + ReleaseMutex(g_hMutex_ProcessDataH264); + }*/ + } + catch(...) + { + + } + } +} + +//功能:串口数字换算到标准的串口输出 +//输入:串口数值portID +//输出:串口数组port +void GetSerialPortNumber(char *port, const CString portID) +{ + + CString strSerialPortNumber = portID; + strSerialPortNumber.Delete( 0, 4 ); + int ptNumber = atoi( strSerialPortNumber ); + + CString str = _T( "" ); + str.Format( "COM%d", ptNumber ); + + memcpy( port, str.GetBuffer( 255 ), str.GetLength() ); + str.ReleaseBuffer(); +} + +//正数+负数 +bool IsNumber(CString str) +{ + str = str.Trim(); + if (str == "") + { + return false; + } + if (str[0] == '-') //可能为负数 + { + str = str.Mid(1); + } + if (str.SpanIncluding(_T("0123456789.")) != str) + { + return false; + } + return true; +} +//正数 +bool IsPositiveNumber(CString str) +{ + str = str.Trim(); + if(str == "") + { + return false; + } + if(str.SpanIncluding(_T("0123456789.")) != str) + { + return false; + } + return true; +} +//整数 +bool IsInteger(CString str) +{ + str = str.Trim(); + if (str == "") + { + return false; + } + if (str[0] == '-') //可能为负数 + { + str = str.Mid(1); + } + if (str.SpanIncluding(_T("0123456789")) != str) + { + return false; + } + return true; +} +//正整数 +bool IsPositiveInteger(CString str) +{ + str = str.Trim(); + if (str == "") + { + return false; + } + if (str.SpanIncluding(_T("0123456789")) != str) + { + return false; + } + return true; +} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/Global.h b/Src/CH91PayloadSoftware/Global.h new file mode 100644 index 0000000..528e912 --- /dev/null +++ b/Src/CH91PayloadSoftware/Global.h @@ -0,0 +1,145 @@ +#pragma once +#include "stdafx.h" +#include "GlobalMember.h" // 全局变量 +#include "MUDP.h" +#include "FrameFKU_Camera.h" +#include "MulticastSocket.h" + +#define SAFE_DELETE(p) { if(p) { delete (p); (p) = nullptr; } } +#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p) = nullptr; } } + +extern CFrameFK_U_CAMERA g_FrameCamera; +extern CMUDP g_MUDPCamera; +extern BOOL g_IsSending; + + +// 获取指定磁盘剩余空间 +extern long GetFreeVolumeLen(char *p = "C"); +// 功能:获取软件当前工作目录 +extern CString GetSoftwareCurrentDirectory(); + +//功能:在文件夹中查找文件,看其是否存在 +extern bool SearchDirectory(const CString &strDir); + +//功能:计算4个字节的数值 +extern unsigned int getFrameLen(BYTE B0, BYTE B1, BYTE B2, BYTE B3); + +// 获取图像双击点偏移量 +extern void CALLBACK GetEOImgCenterOffset(CPoint offset, int flag); + +// 右键点击可见光或红外,转换为手动跟踪 +extern void CALLBACK GetEOIRImgRightButtonDown(int type); + +// 通过图像控制伺服 +extern void CALLBACK GetDistRatioAndAngleThroughImg(double distRatio, double angle); + + +//地图模块回调函数 +extern void CALLBACK GetLeadLonLat(double Lon, double Lat, double Alt); + +// 回放模式输入数据 +extern void ReplayInputData(const void* buffer, int length); + +// UDP 实时收数(来自情报) +extern void CALLBACK UDPRevTgtInfo(const void* buffer, int length, UINT32 data); + +// 数据处理——(线程函数) +extern void ProcessData(); +// 位置信息结构体解析函数 +extern void TransLocationSocketStruct(struSocketProtocal &dst, const struQB_FJ & src); +// 复接数据结构体解析函数 +extern void TransFJStruct( struTranslateProtocal_FJ &dst, const struProtocal_FJ &src); +// 复接数据入队列 +extern void PushToFrameDataDeque(const struQB_FJ &TgtLocStru); + +// 转情报用EO复接数据 +extern void TransToEOQBFJ(struQB_FJ &dst, const struTranslateProtocal_FJ &src); + +// 转情报用IR复接数据 +extern void TransToIRQBFJ(struQB_FJ &dst, const struTranslateProtocal_FJ &src); +// CH96获取数据 +extern void GetFH96DataFromNet(); +extern void SocketReceiveFH96Data(const void* buffer, int length); +extern void ProcessCH96Data(); +// 获取CH96复接数据 +extern void TransCH96FJData(Data96TXD &dst, Protocal96TXD &src); +// CH96复接数据转FH统型复接数据 +extern void TransCH96FJDatatoQBData(struQB_FJ &QB_FJ, Data96TXD &CH96FJ); +// CH96解码回调函数 +void CH96_h264DecodeResultCallbackFun(unsigned char* data,int width,int height); + + +// 基于飞机位置姿态和目标位置,计算载荷姿态 +// 功能:载荷导引,计算载荷姿态角() +// 输入: +// 1. uavPos:飞机位置,double uavPos[GPS经度,GPS纬度,GPS高度] +// 2. tgtPos:目标位置,double tgtPos[GPS经度,GPS纬度,GPS高度] +// 3. uavAttitude: 飞机姿态,double uavAttitude[俯仰,滚转,偏航] +// 输出: +// 1. loadPitch 载荷高低角,单位度 +// 2. loadAzimuth 载荷方位角,单位度 +// 返回值:计算成功返回true,否则返回false。 +extern bool CalLoadAttitudeForLoadGuide(double &loadPitch, double &loadAzimuth, const double *uavPos, const double *tgtPos, const double *uavAttitude); + +// 获取飞机的经纬高和姿态 +extern bool GetUAVLocAndPose(double &UAVLon, double &UAVLat,double &UAVAlt, + double &UAVRoll, double &UAVYaw,double &UAVPitch, + const struTranslateProtocal_FJ &src); + + +// 转情报用EO复接数据 +extern void TransToEOQBFJ(struQB_FJ &dst, const struTranslateProtocal_FJ &src); + +// 转情报用IR复接数据 +extern void TransToIRQBFJ(struQB_FJ &dst, const struTranslateProtocal_FJ &src); + +// +extern double getYaw(double XA, double YA); +extern bool CalAnyPtCoordinateWithoutErrorCompensate(double &Lon, double &Lat, double &H, const struQB_FJ *frame, int pt_x, int pt_y); +extern void CalLonLatOffset(double &LonOffset, double &LatOffset, const struQB_FJ *frame); + +//功能3:计算图像中心点经纬度坐标 +//输入: 1. frame 输入复接数据 +// +//输出: 1. Lon 图像中心点经度 +// 2. Lat 图像中心点纬度 +// 3. H 图像中心点高度 +// 4. 返回值:处理成功返回true,失败返回false +// 说明:当有激光测距时,对地形无要求,当无激光测距时,定位地形应尽量平坦 +extern bool CalImgCenterCoordinate(double &Lon, double &Lat, double &H, const struQB_FJ *frame); + + +//功能4:计算图像中任意点经纬度坐标 +//输入: 1. frame 输入复接数据 +// 2. pt_x 列坐标 +// 3. pt_y 行坐标 +// +//输出: 1. Lon 经度 +// 2. Lat 纬度 +// 3. H 高度 +// 4. 返回值:处理成功返回true,失败返回false +// 说明:当有激光测距时,对地形无要求; +// 当无激光测距时,定位地形应尽量平坦,此时,定位误差与目标高程与飞机垂点地面高程之差成正比。 +extern bool CalAnyPtCoordinate(double &Lon, double &Lat, double &H, const struQB_FJ *frame, int pt_x, int pt_y); + + +// 功能:释放情报数据 +extern void ReleaseQBData(QBStru *pQBData); + +// 功能:克隆图像数据 +extern void CloneImgStru(const ImgStru *src, ImgStru *dst); +extern void CloneQBData(const QBStru *src, QBStru *dst); + +extern BYTE Buffer[512000]; + +//功能:获取原始视频数据 +extern void GetH264VideoDataFromNet(); +extern void SocketReceiveH264VideoData(const void* buffer, int length); +extern void ProcessH264VideoData(); + +extern void GetSerialPortNumber(char *port, const CString portID);//串口数字换算到标准的串口输出 + +extern bool IsNumber(CString str);//正数+负数 +extern bool IsPositiveNumber(CString str);//正数 +extern bool IsInteger(CString str);//整数 +extern bool IsPositiveInteger(CString str);//正整数 \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/GlobalMember.cpp b/Src/CH91PayloadSoftware/GlobalMember.cpp new file mode 100644 index 0000000..9e5819a --- /dev/null +++ b/Src/CH91PayloadSoftware/GlobalMember.cpp @@ -0,0 +1,502 @@ +#include "stdafx.h" +#include "GlobalMember.h" + +// 工作模式 +bool g_bWorkMode = false; // true:回放, false实时 +BOOL g_bMulticastSocketConnect = FALSE; +BOOL g_bReplayPlay = FALSE; // true: 回放中处于播放态, false: 回放中处于暂停态 +int g_ChartTabNum = 1; // 图表分析窗口中tab页的编号,1为第一页,以此类推 +BOOL g_bShowEvaluation = FALSE; // 载荷评价对话框是否展开 +BOOL g_bVideoCapture = FALSE; //视频录制 + +HWND g_mainDlgHwnd = nullptr; +HWND g_ReplayDlgHwnd = nullptr; +HWND g_MapGuideHwnd = nullptr; +HWND g_QBTargetHwnd = nullptr; +HWND g_PhotoCtrlDlgHwnd = nullptr; +HWND g_QBFunctionsHwnd = nullptr; +HWND g_QBTargetTrackFunctionsHwnd = nullptr; +HWND g_SendControlCommandDlgHwnd = nullptr; +HWND g_JoyStickControlDlgHwnd = nullptr; +HWND g_CH96CtrlDlgHwnd = nullptr; +HWND g_MulticastSocketReceiveDlgHwnd = nullptr; +HWND g_mapMatchDlg = nullptr; +HWND g_IMPDLGhwnd;//IMP窗口句柄 + +// 视频解码器 及 图像存储空间 +H264Decode g_EO_Decoder; +H264Decode g_IR_Decoder; +unsigned char g_CH96_ImgBuffer[1920 * 1088 * 3]; +unsigned char g_IR_ImgBuffer[720 * 576 * 3]; +BOOL g_bEOImgUpdate = FALSE; // 界面EO图像是否更新,TRUE:更新 FALSE:未更新 +BOOL g_bIRImgUpdate = FALSE; // 界面IR图像是否更新,TRUE:更新 FALSE:未更新 +// 解码器对象 +DecoderInterface *g_CH96_h264decoder = nullptr; +//数据转发 +CTCPSocket g_TCPTrans2Server; +BYTE g_tcpData[276]; +bool g_tcpStarted=false; +CUDPSocket g_UDPTrans2Server; +bool g_udpStarted = false; +unsigned int g_frameCountTX=0; +// 当计算机性能较差时,采用硬解码,同时不使用图像库 +cv::Mat g_ImgforLowComputer = cv::Mat(1080, 1920, CV_8UC3, cv::Scalar(0, 0, 0)); +// 表征计算机性能的BOOL变量 +BOOL g_bGoodComputer = FALSE; + +// 复接数据 +struProtocal_FJ g_ImgFJData; +struProtocal_FJ g_SocketFJData; // 组播复接数据 +struProtocal_FJ g_PhotoFJData; +struTranslateProtocal_FJ g_ImgTransFJData; // 转换后 +struTranslateProtocal_FJ g_PhotoTransFJData; // 转换后 + +struSocketProtocal g_LocationSocketData; // 位置信息组播数据 + + +Protocal96TXD g_CH96FJData; // CH96原始复接数据 +Data96TXD g_CH96TransFJData; // CH96显示用复接数据 +struQB_FJ g_CH96QBData; // CH96目标定位用情报数据 + +struQB_FJ g_IRFJData; + +QBStru g_QB; + +// 跟踪偏移量 +CPoint g_TrackOffset(0, 0); +BOOL g_bTracking = FALSE; + +// 摇杆控制量——伺服移动速度 +extern int g_ServoSpeedUpDown = 0; // [-512, 512] +extern int g_ServoSpeedLeftRight = 0; // [-512, 512] + +//主界面指令盘点击偏移量 +CPoint g_CtrlAzimuth(0, 0); //方位角 +CPoint g_CtrlPitch(0, 0); //俯仰角 + +//主窗口控制指令实时显示变量 +CString g_sCtrlInstruction; + + +// 存储全部UDP接收数据文件 +FILE* g_pFileSaveCH96txData = nullptr; // 全部UDP接收数据 +FILE* g_pFileSaveVideoDataCH96 = nullptr; // 可见光 264编码部分 +FILE* g_pFileSaveVideoForKCF = nullptr; // KCF视频264部分 +FILE* g_pFileSaveVideoH264Data = nullptr; // 光电吊舱 264编码部分 + +// 数据处理互斥句柄 +HANDLE g_hMutex_ProcessData = NULL; +HANDLE g_hMutex_ProcessDataSocket = NULL; +HANDLE g_hMutex_SaveFJData = NULL; +HANDLE g_hMutex_ShowFJData = NULL; +HANDLE g_hMutex_ProcessDataCH96 = NULL; +HANDLE g_hMutex_ProcessDataH264 = NULL; + +// 图像显示处理互斥句柄 +HANDLE g_hMutex_DisplayVideoCH96 = NULL; +HANDLE g_hMutex_DisplayIRVideo = NULL; +HANDLE g_hMutex_DisplayDCPhoto = NULL; +// 组播组包/发送互斥句柄 +HANDLE g_hMutex_SocketSendLocation = NULL; +HANDLE g_hMutex_SocketSendIR = NULL; +HANDLE g_hMutex_SocketSendEO = NULL; + +// UDP 收数(来自服务器) +BYTE g_receiveDataBuffer[g_MaxBufferLen]; +BYTE g_receiveDataBuffer_middle[g_MaxBufferLen]; +int g_validDataLen = 0; +// 接收到的有效数据:用于进行组播组包 +BYTE g_receiveDataBufferSocket[g_MaxBufferLenSocket]; +BYTE g_receiveDataBuffer_middleSocket[g_MaxBufferLenSocket]; +int g_validDataLenSocket = 0; + +// 解码图像存储队列 +std::deque g_CH96VideoDeque; + +// 目标定位用复接数据存储队列 +std::deque g_TgtLocStructDeque; // 目标定位 复接数据 队列 容量 + +//主界面数引功能全局控制变量 +float g_Guide_Azimuth = 0; //方位角 +float g_Guide_Pitch = -90; //俯仰角 +bool g_bGuide_Button = false; //主界面数引键默认抬起 + +// ProcessData线程开关变量 +bool g_bProcessDataFlag = false; +bool g_bProcessDataSocketFlag = false; + +// 手动搜索控制指令盘变量 +double g_MS_Ratio = 0; // 比率 +double g_MS_Angle = 0; // 角度 + +// 精确飞机位置姿态 +double g_UAVLon = 0; +double g_UAVLat = 0; +double g_UAVAlt = 0; +double g_UAVRoll = 0; +double g_UAVYaw = 0; +double g_UAVPitch = 0; + +//定义UDP据发送对象 +CUDPSocket g_UdpSend2Payload; +CUDPSocket g_UdpSendTgtInfo; +CUDPSocket g_UdpSend2Mobile; +bool g_bCreatUDP; +bool g_bCreatTgtInfoUDP; +bool g_bCreatSend2Mobile; +BYTE g_payloadCtrlInstruction[32]; // 发送指令 +int g_payloadCtrlProtocol = 0; // 载荷控制开关指令 +BYTE g_payloadCtrlInstructionFromVK[8]; // 收到来自视频键盘的控制指令 +BOOL g_bCtrlFromSoftware = FALSE; // 判断指令是否来自视频键盘或者软件软键盘 TURE:视频键盘 FALSE:视频键盘 + +bool g_CtrlFocusThroughMouseWheel = false; // 是否通过滚轮控制载荷焦距 + +BOOL g_bShowEOInBigArea = TRUE; // 变换显示,在大区域显示可见光或红外 + +// 定义收取目标定位信息结构体 +MostSimpleTgtInfo tgtRecvInfo; + +// 载荷软件存储文件 +CString g_DataSavePath = ""; + +// 地图导引模块中高程设置变量 +float g_DEMSetting = 0.0; + +// 设置跟踪阈值全局变量 +int g_ThresholdSetting = 6; // 范围[0,10],默认6 + +BOOL g_bMapDirectGuide = FALSE; // 是否是地图直接导引标志 + +// 数码照片名称 +CString g_str_DCname = ""; +CString g_DCPath = ""; +cv::Mat g_DCImg; + +// 目标定位 +HANDLE g_hMutex_TgtLoc = NULL;// 目标定位互斥句柄 +double g_LLA[3] = {0, 0, 0};// 定位结果 +double g_VD[2] = {0, 0}; // 动目标定位速度方向 +double g_TgtLocReliability = 0.0; // 定位结果可信度 +BOOL g_bMoveTarget = FALSE; // TRUE:动目标定位 FALSE:静目标定位 +BOOL g_bWithLaser = TRUE; // +BOOL g_bStartTargetLoc = FALSE; +BOOL g_bReStartTargetLoc = FALSE; // TRUE: 重新开始目标定位 FALSE: 不重新开始目标定位 +CString g_strTargetLocResult_Lon = ""; // 目标定位经度 +CString g_strTargetLocResult_Lat = ""; // 目标定位纬度 + +// 语言变量,获取语言内容时先用char格式获取,再将char转为CString + +// [TITLE] +char g_char_TitleReplay[30]; // 视频回放标题 +CString g_str_TitleReplay = ""; + +// [WARNING] +char g_char_WarningTitle[100]; // 信息提示 +CString g_str_WarningTitle = ""; +char g_char_WarningStorage[100]; // 磁盘空间 +CString g_str_WarningStorage= ""; +char g_char_WarningUDPReceive[100]; // UDP收数提示(测控、情报) +CString g_str_WarningUDPReceive = ""; +char g_char_WarningSerialReceive[100]; // 串口收数提示 +CString g_str_WarningSerialReceive = ""; +char g_char_WarningPayloadControl[100]; // 载荷控制连接提示 +CString g_str_WarningPayloadControl = ""; +char g_char_WarningLRFCode[100]; // 激光编码密码登陆提示 +CString g_str_WarningLRFCode = ""; +char g_char_WarningLRFNumber[100]; // 激光编码周期范围提示 +CString g_str_WarningLRFNumber = ""; +char g_char_WarningInputNumber[100]; // 输入数字提示(数引) +CString g_str_WarningInputNumber = ""; +char g_char_WarningMapAltSet[100]; // 地图高程设定提示 +CString g_str_WarningMapAltSet = ""; +// [STATIC] +char g_char_CommandSend[30]; // 发送指令 +CString g_str_CommandSend; +char g_char_CommandResponse[30]; // 回报指令 +CString g_str_CommandResponse; +char g_char_State[30]; // 载荷状态 +CString g_str_State; +char g_char_FilePath[30]; // 文件路径 +CString g_str_FilePath; +char g_char_EOCommand[30]; // 可见光相机指令 +CString g_str_EOCommand = ""; +char g_char_IRCommand[30]; // 红外相机指令 +CString g_str_IRCommand = ""; +char g_char_Drift[30]; // 陀螺修正 +CString g_str_Drift = ""; +char g_char_AVTGate[30]; // 波门位移 +CString g_str_AVTGate = ""; +char g_char_LogIn[30]; // 密码登陆 +CString g_str_LogIn = ""; +char g_char_LaserNum[30]; // 编码序号: +CString g_str_LaserNum = ""; +char g_char_LaserPeriod[30]; // 编码周期: +CString g_str_LaserPeriod = ""; + +// [COMMAND]——按照协议顺序编写 +char g_char_TargetLonSet[30]; // 目标经度装订 +CString g_str_TargetLonSet = ""; +char g_char_TargetLatSet[30]; // 目标纬度导引 +CString g_str_TargetLatSet = ""; +char g_char_TargetAltSet[30]; // 目标高度导引 +CString g_str_TargetAltSet = ""; +char g_char_GeographyTracking[30]; // 地理坐标跟踪 +CString g_str_GeographyTracking = ""; +char g_char_ManualSlew[30]; // 手动搜索 +CString g_str_ManualSlew = ""; +char g_char_VerticalView[30]; // 锁定 +CString g_str_VerticalView = ""; +char g_char_AutoScan[30]; // 扫描 +CString g_str_AutoScan = ""; +char g_char_AngleLock[30]; // 数引 +CString g_str_AngleLock = ""; +char g_char_TurretReset[30]; // 平台复位 +CString g_str_TurretReset = ""; +char g_char_DriftRight[30]; // 陀螺右修 +CString g_str_DriftRight = ""; +char g_char_DriftLeft[30]; // 陀螺左修 +CString g_str_DriftLeft = ""; +char g_char_DriftUp[30]; // 陀螺上修 +CString g_str_DriftUp = ""; +char g_char_DriftDown[30]; // 陀螺下修 +CString g_str_DriftDown = ""; +char g_char_TurretStow[30]; // 载荷升 +CString g_str_TurretStow = ""; +char g_char_TurretFWD[30]; // 载荷降 +CString g_str_TurretFWD = ""; +char g_char_EOAutoTracking[30]; // EO自动跟踪 +CString g_str_EOAutoTracking = ""; +char g_char_IRAutoTracking[30]; // IR自动跟踪 +CString g_str_IRAutoTracking = ""; +char g_char_CorrelationTracking[30]; // 相关跟踪 +CString g_str_CorrelationTracking = ""; +char g_char_CentroidBlackTracking[30]; // 重心黑 +CString g_str_CentroidBlackTracking = ""; +char g_char_CentroidWhiteTracking[30]; // 重心白 +CString g_str_CentroidWhiteTracking = ""; +char g_char_OSDONOFF[30]; // 字符叠加/消隐 +CString g_str_OSDONOFF = ""; +char g_char_OffsetTracking[30]; // 偏心跟踪 +CString g_str_OffsetTracking = ""; +char g_char_StaticTargetTracking[30]; // 静态目标跟踪 +CString g_str_StaticTargetTracking = ""; +char g_char_MoveTargetTracking[30]; // 动态目标跟踪 +CString g_str_MoveTargetTracking = ""; +char g_char_ViewTracking[30]; // 场景跟踪 +CString g_str_ViewTracking = ""; +char g_char_AVTGateSizeBig[30]; // 大波门 +CString g_str_AVTGateSizeBig = ""; +char g_char_AVTGateSizeSmall[30]; // 小波门 +CString g_str_AVTGateSizeSmall = ""; +char g_char_AVTGateSizeMiddle[30]; // 中波门 +CString g_str_AVTGateSizeMiddle = ""; +char g_char_AVTGateSizeAuto[30]; // 自适应波门 +CString g_str_AVTGateSizeAuto = ""; +char g_char_ImgEnhanceON[30]; // 图像增强开 +CString g_str_ImgEnhanceON = ""; +char g_char_ImgEnhanceOFF[30]; // 图像增强关 +CString g_str_ImgEnhanceOFF = ""; +char g_char_AVTGateRight[30]; // 波门右移 +CString g_str_AVTGateRight = ""; +char g_char_AVTGateLeft[30]; // 波门左移 +CString g_str_AVTGateLeft = ""; +char g_char_AVTGateUp[30]; // 波门上移 +CString g_str_AVTGateUp = ""; +char g_char_AVTGateDown[30]; // 波门下移 +CString g_str_AVTGateDown = ""; +char g_char_LRFPowerON[30]; // 激光电源开 +CString g_str_LRFPowerON = ""; +char g_char_LRFPowerOFF[30]; // 激光电源关 +CString g_str_LRFPowerOFF = ""; +char g_char_LRFArmed[30]; // 激光测距开 +CString g_str_LRFArmed = ""; +char g_char_LRFSafe[30]; // 激光测距关 +CString g_str_LRFSafe = ""; +char g_char_LDArmed[30]; // 激光照射开 +CString g_str_LDArmed = ""; +char g_char_LDSafe[30]; // 激光照射关 +CString g_str_LDSafe = ""; +char g_char_LaserNo1[30]; // 激光编码1 +CString g_str_LaserNo1 = ""; +char g_char_LaserNo2[30]; // 激光编码2 +CString g_str_LaserNo2 = ""; +char g_char_LaserNo3[30]; // 激光编码3 +CString g_str_LaserNo3 = ""; +char g_char_LaserNo4[30]; // 激光编码4 +CString g_str_LaserNo4 = ""; +char g_char_LaserNo5[30]; // 激光编码5 +CString g_str_LaserNo5 = ""; +char g_char_LaserNo6[30]; // 激光编码6 +CString g_str_LaserNo6 = ""; +char g_char_LaserNo7[30]; // 激光编码7 +CString g_str_LaserNo7 = ""; +char g_char_LaserNo8[30]; // 激光编码8 +CString g_str_LaserNo8 = ""; +char g_char_LaserNo9[30]; // 激光编码9 +CString g_str_LaserNo9 = ""; +char g_char_LaserNo10[30]; // 激光编码10 +CString g_str_LaserNo10 = ""; +char g_char_LaserLoad[30]; // 激光编码加载 +CString g_str_LaserLoad = ""; +char g_char_ICRON[30]; // 低照度增强开 +CString g_str_ICRON = ""; +char g_char_ICROFF[30]; // 低照度增强关 +CString g_str_ICROFF = ""; +char g_char_DefogON[30]; // 透雾开 +CString g_str_DefogON = ""; +char g_char_DefogOFF[30]; // 透雾关 +CString g_str_DefogOFF = ""; +char g_char_EOFocusPlus[30]; // EO远焦 +CString g_str_EOFocusPlus = ""; +char g_char_EOFocusMinus[30]; // EO近焦 +CString g_str_EOFocusMinus = ""; +char g_char_EOZoomOut[30]; // EO视场大 +CString g_str_EOZoomOut = ""; +char g_char_EOZoomIn[30]; // EO视场小 +CString g_str_EOZoomIn = ""; +char g_char_EOLightManual[30]; // EO手动调光 +CString g_str_EOLightManual = ""; +char g_char_EOLightAuto[30]; // EO自动调光 +CString g_str_EOLightAuto = ""; +char g_char_EOLightPlus[30]; // EO亮度+ +CString g_str_EOLightPlus = ""; +char g_char_EOLightMinus[30]; // EO亮度- +CString g_str_EOLightMinus = ""; +char g_char_EOPowerON[30]; // EO电源开 +CString g_str_EOPowerON = ""; +char g_char_EOPowerOFF[30]; // EO电源关 +CString g_str_EOPowerOFF = ""; +char g_char_EOWDRON[30]; // EO宽动态开 +CString g_str_EOWDRON = ""; +char g_char_EOWDROFF[30]; // EO宽动态关 +CString g_str_EOWDROFF = ""; +char g_char_EOFocusAuto[30]; // EO自动调焦 +CString g_str_EOFocusAuto = ""; +char g_char_EOFocusRealTime[30]; // EO实时调焦 +CString g_str_EOFocusRealTime = ""; + +char g_char_IRFocusPlus[30]; // IR远焦 +CString g_str_IRFocusPlus = ""; +char g_char_IRFocusMinus[30]; // IR近焦 +CString g_str_IRFocusMinus = ""; +char g_char_IRFocusAuto[30]; // IR自动调焦 +CString g_str_IRFocusAuto = ""; +char g_char_IRFocusRealTime[30]; // IR实时调焦 +CString g_str_IRFocusRealTime = ""; +char g_char_IRZoomOut[30]; // IR视场大 +CString g_str_IRZoomOut = ""; +char g_char_IRZoomIn[30]; // IR视场小 +CString g_str_IRZoomIn = ""; +char g_char_BHWH[30]; // IR黑白热 +CString g_str_BHWH = ""; +char g_char_IRCalibration[30]; // IR校正 +CString g_str_IRCalibration = ""; +char g_char_IRLightManual[30]; // IR手动调光 +CString g_str_IRLightManual = ""; +char g_char_IRLightAuto[30]; // IR自动调光 +CString g_str_IRLightAuto = ""; +char g_char_IRLightPlus[30]; // IR亮度+ +CString g_str_IRLightPlus = ""; +char g_char_IRLightMinus[30]; // IR亮度- +CString g_str_IRLightMinus = ""; +char g_char_IRContrastPlus[30]; // IR对比度+ +CString g_str_IRContrastPlus = ""; +char g_char_IRContrastMinus[30]; // IR对比度- +CString g_str_IRContrastMinus = ""; +char g_char_DDEON[30]; // IR边缘锐化开 +CString g_str_DDEON = ""; +char g_char_DDEOFF[30]; // IR边缘锐化关 +CString g_str_DDEOFF = ""; +char g_char_IRPowerON[30]; // IR电源开 +CString g_str_IRPowerON = ""; +char g_char_IRPowerOFF[30]; // IR电源关 +CString g_str_IRPowerOFF = ""; +char g_char_ImgTypeSet[30]; // 设置图像类型 +CString g_str_ImgTypeSet = ""; +char g_char_ImgFlowSet[30]; // 设置图像码流 +CString g_str_ImgFlowSet = ""; + +char g_char_DCWBManual[30]; // DC手动白平衡 +CString g_str_DCWBManual = ""; +char g_char_DCWBAuto[30]; // DC自动白平衡 +CString g_str_DCWBAuto = ""; +char g_char_SingleShoot[30]; // 单拍 +CString g_str_SingleShoot = ""; +char g_char_CC2s[30]; // 两秒连拍 +CString g_str_CC2s = ""; +char g_char_CC4s[30]; // 四秒连拍 +CString g_str_CC4s = ""; +char g_char_CCOverlap[30]; // 保证重叠率连拍 +CString g_str_CCOverlap = ""; +char g_char_CCAutoScan[30]; // 摆扫连拍 +CString g_str_CCAutoScan = ""; +char g_char_DCExposureAuto[30]; // DC自动曝光 +CString g_str_DCExposureAuto = ""; +char g_char_DCExposureManual[30]; // DC手动曝光 +CString g_str_DCExposureManual = ""; +char g_char_DCExposurePlus[30]; // DC曝光+ +CString g_str_DCExposurePlus = ""; +char g_char_DCExposureMinus[30]; // DC曝光- +CString g_str_DCExposureMinus = ""; +char g_char_DCExposureVHR[30]; // DC速高比曝光 +CString g_str_DCExposureVHR = ""; + +char g_char_ServoPowerON[30]; // 伺服电源开 +CString g_str_ServoPowerON = ""; +char g_char_ServoPowerOFF[30]; // 伺服电源关 +CString g_str_ServoPowerOFF = ""; + +//[OTHER] +char g_char_LaserChoose[30]; // 未选择激光编码 +CString g_str_LaserChoose = ""; +char g_char_LaserLoadSuccess[30]; // 编码加载成功 +CString g_str_LaserLoadSuccess =""; +char g_char_LaserLoadFail[30]; // 编码加载失败 +CString g_str_LaserLoadFail = ""; + +// 创建全局WinSoc套接字 +SOCKET g_socketFH96Data = -1; + +// 采集图像 +bool g_bCaptureImg = false; + +// 互斥对象句柄 +HANDLE g_hMutex_ImgStitch = nullptr; + +// 定义图像队列 +std::deque g_StitchImgDeque; + +BOOL g_bRun = FALSE; +BOOL g_bStop = FALSE; + + +/*****IMP*****/ +CFrameIMPDown_ g_FrameIMPDown;//IMP协议类实例化 +bool IMPDlgWindowVisible;//IMP对话框为可视状态 +//CDlgIMP * g_DlgIMP;//IMP对话框 +//波特率列表 +CString gComBaudItems[BAUDITEMNUM] = +{ + "1200", + "2400", + "4800", + "9600", + "14400", + "19200", + "38400", + "56000", + "57600", + "115200" +}; +bool g_bBindData = false;//是否在装订的标志 + +//13所吊舱控制新 +int g_commandNum; //控制指令序号 +CDCFrameCkCmdFrame g_DCFrameCkCmd13; //数据注入指令从控发送数据帧---13所吊舱 +//武汉天进吊舱控制 +int g_WHTJDCCmdNum; //控制指令序号 +int DCTypeSelected_video = 0; //吊舱类型选择_图像接收 +bool SelectPointTrack;//选点跟踪 +HWND DlgDCOverroll_Hwnd; //DCOverrollDlg句柄 +float m_wndShowEO_Position_Max_x; //图像显示区域的坐标最大值x +float m_wndShowEO_Position_Max_y; //图像显示区域的坐标最大值y \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/GlobalMember.h b/Src/CH91PayloadSoftware/GlobalMember.h new file mode 100644 index 0000000..4d417bd --- /dev/null +++ b/Src/CH91PayloadSoftware/GlobalMember.h @@ -0,0 +1,518 @@ +#pragma once +#include "stdafx.h" +#include "Decoder.h" +// 李振h264解码库 +#include "DecoderFactory.h" +#include "deque" +#include "CUDPSocket.h" +#include "CTCPSocket.h" +#include +using namespace cv; + +#include "QBStru.h" +#include "FrameIMP_DOWN.h" +#include "DlgIMP.h" +#include "DCFrameCkCmd.h" + +// 命名 +typedef unsigned __int8 UINT8; +typedef unsigned __int16 UINT16; +typedef unsigned __int32 UINT32; +//typedef __int8 INT8; +typedef __int16 INT16; +typedef __int32 INT32; + +// 工作模式 +extern bool g_bWorkMode; // true:回放, false实时 +extern BOOL g_bMulticastSocketConnect; // 表征组播连接已创建的变量 TURE:创建连接 FALSE:断开连接 +extern BOOL g_bReplayPlay; // TRUE: 回放中处于播放态, FALSE: 回放中处于暂停态 +extern int g_ChartTabNum; // 图表分析窗口中tab页的编号,1为第一页,以此类推 +extern BOOL g_bShowEvaluation; // 载荷评价对话框是否展开 +extern BOOL g_bVideoCapture; //视频录制 +extern HWND g_mainDlgHwnd; // 主窗口句柄 +extern HWND g_ReplayDlgHwnd; // 视频控制窗口句柄 +extern HWND g_MapGuideHwnd; // 地图导引 +extern HWND g_QBTargetHwnd; // 情报席位目标定位窗口句柄(待删除) +extern HWND g_PhotoCtrlDlgHwnd; // 图片显示窗口句柄 +extern HWND g_QBFunctionsHwnd; // 其他功能窗口句柄 +extern HWND g_QBTargetTrackFunctionsHwnd; // 目标跟踪功能窗口句柄 +extern HWND g_SendControlCommandDlgHwnd; // 发送指令&&手动控制指令盘界面句柄 +extern HWND g_JoyStickControlDlgHwnd; // 摇杆控制窗口句柄 +extern HWND g_CH96CtrlDlgHwnd; // CH96控制页面 +extern HWND g_MulticastSocketReceiveDlgHwnd; // 组播收数窗口句柄 +extern HWND g_mapMatchDlg; +extern HWND g_IMPDLGhwnd;//IMP窗口句柄 + + +// 视频解码器 及 图像存储空间 +extern H264Decode g_EO_Decoder; +extern H264Decode g_IR_Decoder; +extern unsigned char g_CH96_ImgBuffer[1920 * 1088 * 3]; +extern unsigned char g_IR_ImgBuffer[720 * 576 * 3]; +extern BOOL g_bEOImgUpdate; // 界面EO图像是否更新,TRUE:更新 FALSE:未更新 +extern BOOL g_bIRImgUpdate; // 界面IR图像是否更新,TRUE:更新 FALSE:未更新 +// 解码器对象 +extern DecoderInterface *g_CH96_h264decoder; +//数据转发 +extern CTCPSocket g_TCPTrans2Server; +extern BYTE g_tcpData[276]; +extern bool g_tcpStarted; +extern CUDPSocket g_UDPTrans2Server; +extern bool g_udpStarted; +extern unsigned int g_frameCountTX; +// 当计算机性能较差时,采用硬解码,同时不使用图像库 +extern cv::Mat g_ImgforLowComputer; +// 表征计算机性能的BOOL变量 +extern BOOL g_bGoodComputer; + +// 复接数据 +extern struProtocal_FJ g_ImgFJData; // 视频图像复接数据 +extern struProtocal_FJ g_SocketFJData; // 组播复接数据 +extern struProtocal_FJ g_PhotoFJData; // 数码照片复接数据 +extern struTranslateProtocal_FJ g_ImgTransFJData; // 转换后 +extern struTranslateProtocal_FJ g_PhotoTransFJData; // 转换后 + +extern struSocketProtocal g_LocationSocketData; // 位置信息组播数据 + +extern Protocal96TXD g_CH96FJData; // CH96原始复接数据 +extern Data96TXD g_CH96TransFJData; // CH96显示用复接数据 +extern struQB_FJ g_CH96QBData; // CH96目标定位用情报数据 + +extern QBStru g_QB; + +extern struQB_FJ g_IRFJData; + +// 跟踪偏移量 +extern CPoint g_TrackOffset; +extern BOOL g_bTracking; + +// 摇杆控制量——伺服移动速度 +extern int g_ServoSpeedUpDown; // [-512, 512] +extern int g_ServoSpeedLeftRight; // [-512, 512] + +// 主界面指令盘点击偏移量 +extern CPoint g_CtrlAzimuth; //方位角 +extern CPoint g_CtrlPitch; //俯仰角 + +//主窗口控制指令实时显示变量 +extern CString g_sCtrlInstruction; + +// 存储全部遥测数据的文件 +extern FILE* g_pFileSaveCH96txData; // 全部数据 +extern FILE* g_pFileSaveVideoDataCH96; // 可见光 264编码部分 +extern FILE* g_pFileSaveVideoForKCF; // 为KCF分析录制视频 +extern FILE* g_pFileSaveVideoH264Data; // 光电吊舱 264编码部分 + +// 接收到的有效数据: 预分配内存 大小 +static const int g_MaxBufferLen = 102400 * 5; +extern BYTE g_receiveDataBuffer[g_MaxBufferLen]; +extern BYTE g_receiveDataBuffer_middle[g_MaxBufferLen]; +extern int g_validDataLen; // 有效长度 +// 接收到的有效数据:用于进行组播组包 +static const int g_MaxBufferLenSocket = 102400 * 5; +extern BYTE g_receiveDataBufferSocket[g_MaxBufferLenSocket]; +extern BYTE g_receiveDataBuffer_middleSocket[g_MaxBufferLenSocket]; +extern int g_validDataLenSocket; + +// 数据处理互斥句柄 +extern HANDLE g_hMutex_ProcessData; +extern HANDLE g_hMutex_ProcessDataSocket; +extern HANDLE g_hMutex_SaveFJData; +extern HANDLE g_hMutex_ShowFJData; +extern HANDLE g_hMutex_ProcessDataCH96; +extern HANDLE g_hMutex_ProcessDataH264; + +// 图像显示处理互斥句柄 +extern HANDLE g_hMutex_DisplayVideoCH96; +extern HANDLE g_hMutex_DisplayIRVideo; +extern HANDLE g_hMutex_DisplayDCPhoto; + +// 组播组包/发送互斥句柄 +extern HANDLE g_hMutex_SocketSendLocation; +extern HANDLE g_hMutex_SocketSendIR; +extern HANDLE g_hMutex_SocketSendEO; + +// 解码图像存储队列 +extern std::deque g_CH96VideoDeque; + +// 目标定位用复接数据存储队列 +extern std::deque g_TgtLocStructDeque; // 目标定位 复接数据 队列 容量 3 + +//主界面数引功能全局控制变量 +extern float g_Guide_Azimuth; //方位角 +extern float g_Guide_Pitch; //俯仰角 +extern bool g_bGuide_Button; //判断主界面数引键是否按下 + +// ProcessData线程开关变量 +extern bool g_bProcessDataFlag; +extern bool g_bProcessDataSocketFlag; + +// 手动搜索控制指令盘变量 +extern double g_MS_Ratio; // 比率 +extern double g_MS_Angle; // 角度 + +// 精确飞机位置姿态 +extern double g_UAVLon; +extern double g_UAVLat; +extern double g_UAVAlt; +extern double g_UAVRoll; +extern double g_UAVYaw; +extern double g_UAVPitch; + +//定义控制指令UDP数据发送对象 +extern CUDPSocket g_UdpSend2Payload; +extern CUDPSocket g_UdpSendTgtInfo; +extern CUDPSocket g_UdpSend2Mobile; +extern bool g_bCreatUDP; +extern bool g_bCreatTgtInfoUDP; +extern bool g_bCreatSend2Mobile; +extern BYTE g_payloadCtrlInstruction[32]; // 发送指令 +extern int g_payloadCtrlProtocol; // 载荷控制开关指令 +extern BYTE g_payloadCtrlInstructionFromVK[8]; // 收到来自视频键盘的控制指令 +extern BOOL g_bCtrlFromSoftware; // 判断指令是否来自视频键盘或者软件软键盘 TURE:软件 FALSE:视频键盘 + +extern bool g_CtrlFocusThroughMouseWheel; // 是否通过滚轮控制载荷焦距 + +extern BOOL g_bShowEOInBigArea; // 变换显示,在大区域显示可见光或红外 +// 定义收取目标定位信息结构体 +extern MostSimpleTgtInfo tgtRecvInfo; + +// 载荷软件存储文件 +extern CString g_DataSavePath; // 载荷软件存储文件的路径名称 + +// 地图导引模块中高程设置变量 +extern float g_DEMSetting; + +// 设置跟踪阈值全局变量 +extern int g_ThresholdSetting; // 范围[0,10],默认6 + +extern BOOL g_bMapDirectGuide; // 是否是地图直接导引标志 + +// 数码照片名称 +extern CString g_str_DCname; +extern CString g_DCPath; +extern cv::Mat g_DCImg; + +// 目标定位 +extern HANDLE g_hMutex_TgtLoc;// 目标定位互斥句柄 +extern double g_LLA[3]; // WGS84下目标定位结果 +extern double g_VD[2]; // 动目标定位速度方向 +extern double g_TgtLocReliability; // 定位结果可信度 +extern BOOL g_bMoveTarget; // TRUE:动目标定位 FALSE:静目标定位 +extern BOOL g_bWithLaser; // TRUE: 有激光定位 FALSE: 无激光定位 +extern BOOL g_bStartTargetLoc; // TRUE: 开始目标定位 FALSE: 停止目标定位 +extern BOOL g_bReStartTargetLoc; // TRUE: 重新开始目标定位 FALSE: 不重新开始目标定位 +extern CString g_strTargetLocResult_Lon; // 目标定位经度 +extern CString g_strTargetLocResult_Lat; // 目标定位纬度 +// 语言变量,获取语言内容时先用char格式获取,再将char转为CString + +// [TITLE] +extern char g_char_TitleReplay[30]; // 视频回放标题 +extern CString g_str_TitleReplay; + +// [WARNING] +extern char g_char_WarningTitle[100]; // 信息提示 +extern CString g_str_WarningTitle; +extern char g_char_WarningStorage[100]; // 磁盘空间提示 +extern CString g_str_WarningStorage; +extern char g_char_WarningUDPReceive[100]; // UDP收数提示(测控、情报) +extern CString g_str_WarningUDPReceive; +extern char g_char_WarningSerialReceive[100]; // 串口收数提示 +extern CString g_str_WarningSerialReceive; +extern char g_char_WarningPayloadControl[100]; // 载荷控制连接提示 +extern CString g_str_WarningPayloadControl; +extern char g_char_WarningLRFCode[100]; // 激光编码密码登陆提示 +extern CString g_str_WarningLRFCode; +extern char g_char_WarningLRFNumber[100]; // 激光编码周期范围提示 +extern CString g_str_WarningLRFNumber; +extern char g_char_WarningInputNumber[100]; // 输入数字提示(数引) +extern CString g_str_WarningInputNumber; +extern char g_char_WarningMapAltSet[100]; // 地图高程设定提示 +extern CString g_str_WarningMapAltSet; + +// [STATIC] +extern char g_char_CommandSend[30]; // 发送指令 +extern CString g_str_CommandSend; +extern char g_char_CommandResponse[30]; // 回报指令 +extern CString g_str_CommandResponse; +extern char g_char_State[30]; // 载荷状态 +extern CString g_str_State; +extern char g_char_FilePath[30]; // 文件路径 +extern CString g_str_FilePath; +extern char g_char_EOCommand[30]; // 可见光相机指令 +extern CString g_str_EOCommand; +extern char g_char_IRCommand[30]; // 红外相机指令 +extern CString g_str_IRCommand; +extern char g_char_Drift[30]; // 陀螺修正 +extern CString g_str_Drift; +extern char g_char_AVTGate[30]; // 波门位移 +extern CString g_str_AVTGate; +extern char g_char_LogIn[30]; // 密码登陆 +extern CString g_str_LogIn; +extern char g_char_LaserNum[30]; // 编码序号: +extern CString g_str_LaserNum; +extern char g_char_LaserPeriod[30]; // 编码周期: +extern CString g_str_LaserPeriod; + +// [COMMAND]——按照协议顺序编写 +extern char g_char_TargetLonSet[30]; // 目标经度装订 +extern CString g_str_TargetLonSet; +extern char g_char_TargetLatSet[30]; // 目标纬度导引 +extern CString g_str_TargetLatSet; +extern char g_char_TargetAltSet[30]; // 目标高度导引 +extern CString g_str_TargetAltSet; +extern char g_char_GeographyTracking[30]; // 地理坐标跟踪 +extern CString g_str_GeographyTracking; +extern char g_char_ManualSlew[30]; // 手动搜索 +extern CString g_str_ManualSlew; +extern char g_char_VerticalView[30]; // 锁定 +extern CString g_str_VerticalView; +extern char g_char_AutoScan[30]; // 扫描 +extern CString g_str_AutoScan; +extern char g_char_AngleLock[30]; // 数引 +extern CString g_str_AngleLock; +extern char g_char_TurretReset[30]; // 平台复位 +extern CString g_str_TurretReset; +extern char g_char_DriftRight[30]; // 陀螺右修 +extern CString g_str_DriftRight; +extern char g_char_DriftLeft[30]; // 陀螺左修 +extern CString g_str_DriftLeft; +extern char g_char_DriftUp[30]; // 陀螺上修 +extern CString g_str_DriftUp; +extern char g_char_DriftDown[30]; // 陀螺下修 +extern CString g_str_DriftDown; +extern char g_char_TurretStow[30]; // 载荷升 +extern CString g_str_TurretStow; +extern char g_char_TurretFWD[30]; // 载荷降 +extern CString g_str_TurretFWD; +extern char g_char_EOAutoTracking[30]; // EO自动跟踪 +extern CString g_str_EOAutoTracking; +extern char g_char_IRAutoTracking[30]; // IR自动跟踪 +extern CString g_str_IRAutoTracking; +extern char g_char_CorrelationTracking[30]; // 相关跟踪 +extern CString g_str_CorrelationTracking; +extern char g_char_CentroidBlackTracking[30]; // 重心黑 +extern CString g_str_CentroidBlackTracking; +extern char g_char_CentroidWhiteTracking[30]; // 重心白 +extern CString g_str_CentroidWhiteTracking; +extern char g_char_OSDONOFF[30]; // 字符叠加/消隐 +extern CString g_str_OSDONOFF; +extern char g_char_OffsetTracking[30]; // 偏心跟踪 +extern CString g_str_OffsetTracking; +extern char g_char_StaticTargetTracking[30]; // 静态目标跟踪 +extern CString g_str_StaticTargetTracking; +extern char g_char_MoveTargetTracking[30]; // 动态目标跟踪 +extern CString g_str_MoveTargetTracking; +extern char g_char_ViewTracking[30]; // 场景跟踪 +extern CString g_str_ViewTracking; +extern char g_char_AVTGateSizeBig[30]; // 大波门 +extern CString g_str_AVTGateSizeBig; +extern char g_char_AVTGateSizeSmall[30]; // 小波门 +extern CString g_str_AVTGateSizeSmall; +extern char g_char_AVTGateSizeMiddle[30]; // 中波门 +extern CString g_str_AVTGateSizeMiddle; +extern char g_char_AVTGateSizeAuto[30]; // 自适应波门 +extern CString g_str_AVTGateSizeAuto; +extern char g_char_ImgEnhanceON[30]; // 图像增强开 +extern CString g_str_ImgEnhanceON; +extern char g_char_ImgEnhanceOFF[30]; // 图像增强关 +extern CString g_str_ImgEnhanceOFF; +extern char g_char_AVTGateRight[30]; // 波门右移 +extern CString g_str_AVTGateRight; +extern char g_char_AVTGateLeft[30]; // 波门左移 +extern CString g_str_AVTGateLeft; +extern char g_char_AVTGateUp[30]; // 波门上移 +extern CString g_str_AVTGateUp; +extern char g_char_AVTGateDown[30]; // 波门下移 +extern CString g_str_AVTGateDown; +extern char g_char_LRFPowerON[30]; // 激光电源开 +extern CString g_str_LRFPowerON; +extern char g_char_LRFPowerOFF[30]; // 激光电源关 +extern CString g_str_LRFPowerOFF; +extern char g_char_LRFArmed[30]; // 激光测距开 +extern CString g_str_LRFArmed; +extern char g_char_LRFSafe[30]; // 激光测距关 +extern CString g_str_LRFSafe; +extern char g_char_LDArmed[30]; // 激光照射开 +extern CString g_str_LDArmed; +extern char g_char_LDSafe[30]; // 激光照射关 +extern CString g_str_LDSafe; +extern char g_char_LaserNo1[30]; // 激光编码1 +extern CString g_str_LaserNo1; +extern char g_char_LaserNo2[30]; // 激光编码2 +extern CString g_str_LaserNo2; +extern char g_char_LaserNo3[30]; // 激光编码3 +extern CString g_str_LaserNo3; +extern char g_char_LaserNo4[30]; // 激光编码4 +extern CString g_str_LaserNo4; +extern char g_char_LaserNo5[30]; // 激光编码5 +extern CString g_str_LaserNo5; +extern char g_char_LaserNo6[30]; // 激光编码6 +extern CString g_str_LaserNo6; +extern char g_char_LaserNo7[30]; // 激光编码7 +extern CString g_str_LaserNo7; +extern char g_char_LaserNo8[30]; // 激光编码8 +extern CString g_str_LaserNo8; +extern char g_char_LaserNo9[30]; // 激光编码9 +extern CString g_str_LaserNo9; +extern char g_char_LaserNo10[30]; // 激光编码10 +extern CString g_str_LaserNo10; +extern char g_char_LaserLoad[30]; // 激光编码加载 +extern CString g_str_LaserLoad; +extern char g_char_ICRON[30]; // 低照度增强开 +extern CString g_str_ICRON; +extern char g_char_ICROFF[30]; // 低照度增强关 +extern CString g_str_ICROFF; +extern char g_char_DefogON[30]; // 透雾开 +extern CString g_str_DefogON; +extern char g_char_DefogOFF[30]; // 透雾关 +extern CString g_str_DefogOFF; +extern char g_char_EOFocusPlus[30]; // EO远焦 +extern CString g_str_EOFocusPlus; +extern char g_char_EOFocusMinus[30]; // EO近焦 +extern CString g_str_EOFocusMinus; +extern char g_char_EOZoomOut[30]; // EO视场大 +extern CString g_str_EOZoomOut; +extern char g_char_EOZoomIn[30]; // EO视场小 +extern CString g_str_EOZoomIn; +extern char g_char_EOLightManual[30]; // EO手动调光 +extern CString g_str_EOLightManual; +extern char g_char_EOLightAuto[30]; // EO自动调光 +extern CString g_str_EOLightAuto; +extern char g_char_EOLightPlus[30]; // EO亮度+ +extern CString g_str_EOLightPlus; +extern char g_char_EOLightMinus[30]; // EO亮度- +extern CString g_str_EOLightMinus; +extern char g_char_EOPowerON[30]; // EO电源开 +extern CString g_str_EOPowerON; +extern char g_char_EOPowerOFF[30]; // EO电源关 +extern CString g_str_EOPowerOFF; +extern char g_char_EOWDRON[30]; // EO宽动态开 +extern CString g_str_EOWDRON; +extern char g_char_EOWDROFF[30]; // EO宽动态关 +extern CString g_str_EOWDROFF; +extern char g_char_EOFocusAuto[30]; // EO自动调焦 +extern CString g_str_EOFocusAuto; +extern char g_char_EOFocusRealTime[30]; // EO实时调焦 +extern CString g_str_EOFocusRealTime; + +extern char g_char_IRFocusPlus[30]; // IR远焦 +extern CString g_str_IRFocusPlus; +extern char g_char_IRFocusMinus[30]; // IR近焦 +extern CString g_str_IRFocusMinus; +extern char g_char_IRFocusAuto[30]; // IR自动调焦 +extern CString g_str_IRFocusAuto; +extern char g_char_IRFocusRealTime[30]; // IR实时调焦 +extern CString g_str_IRFocusRealTime; +extern char g_char_IRZoomOut[30]; // IR视场大 +extern CString g_str_IRZoomOut; +extern char g_char_IRZoomIn[30]; // IR视场小 +extern CString g_str_IRZoomIn; +extern char g_char_BHWH[30]; // IR黑白热 +extern CString g_str_BHWH; +extern char g_char_IRCalibration[30]; // IR校正 +extern CString g_str_IRCalibration; +extern char g_char_IRLightManual[30]; // IR手动调光 +extern CString g_str_IRLightManual; +extern char g_char_IRLightAuto[30]; // IR自动调光 +extern CString g_str_IRLightAuto; +extern char g_char_IRLightPlus[30]; // IR亮度+ +extern CString g_str_IRLightPlus; +extern char g_char_IRLightMinus[30]; // IR亮度- +extern CString g_str_IRLightMinus; +extern char g_char_IRContrastPlus[30]; // IR对比度+ +extern CString g_str_IRContrastPlus; +extern char g_char_IRContrastMinus[30]; // IR对比度- +extern CString g_str_IRContrastMinus; +extern char g_char_DDEON[30]; // IR边缘锐化开 +extern CString g_str_DDEON; +extern char g_char_DDEOFF[30]; // IR边缘锐化关 +extern CString g_str_DDEOFF; +extern char g_char_IRPowerON[30]; // IR电源开 +extern CString g_str_IRPowerON; +extern char g_char_IRPowerOFF[30]; // IR电源关 +extern CString g_str_IRPowerOFF; +extern char g_char_ImgTypeSet[30]; // 设置图像类型 +extern CString g_str_ImgTypeSet; +extern char g_char_ImgFlowSet[30]; // 设置图像码流 +extern CString g_str_ImgFlowSet; + +extern char g_char_DCWBManual[30]; // DC手动白平衡 +extern CString g_str_DCWBManual; +extern char g_char_DCWBAuto[30]; // DC自动白平衡 +extern CString g_str_DCWBAuto; +extern char g_char_SingleShoot[30]; // 单拍 +extern CString g_str_SingleShoot; +extern char g_char_CC2s[30]; // 两秒连拍 +extern CString g_str_CC2s; +extern char g_char_CC4s[30]; // 四秒连拍 +extern CString g_str_CC4s; +extern char g_char_CCOverlap[30]; // 保证重叠率连拍 +extern CString g_str_CCOverlap; +extern char g_char_CCAutoScan[30]; // 摆扫连拍 +extern CString g_str_CCAutoScan; +extern char g_char_DCExposureAuto[30]; // DC自动曝光 +extern CString g_str_DCExposureAuto; +extern char g_char_DCExposureManual[30]; // DC手动曝光 +extern CString g_str_DCExposureManual; +extern char g_char_DCExposurePlus[30]; // DC曝光+ +extern CString g_str_DCExposurePlus; +extern char g_char_DCExposureMinus[30]; // DC曝光- +extern CString g_str_DCExposureMinus; +extern char g_char_DCExposureVHR[30]; // DC速高比曝光 +extern CString g_str_DCExposureVHR; + +extern char g_char_ServoPowerON[30]; // 伺服电源开 +extern CString g_str_ServoPowerON; +extern char g_char_ServoPowerOFF[30]; // 伺服电源关 +extern CString g_str_ServoPowerOFF; + + +//[OTHER] +extern char g_char_LaserChoose[30]; // 未选择激光编码 +extern CString g_str_LaserChoose; +extern char g_char_LaserLoadSuccess[30]; // 编码加载成功 +extern CString g_str_LaserLoadSuccess; +extern char g_char_LaserLoadFail[30]; // 编码加载失败 +extern CString g_str_LaserLoadFail; + +// 创建全局WinSoc套接字 +extern SOCKET g_socketFH96Data; + +// 采集图像 +extern bool g_bCaptureImg; + +// 互斥对象句柄 +extern HANDLE g_hMutex_ImgStitch; + +// 定义图像队列 +extern std::deque g_StitchImgDeque; + +extern BOOL g_bRun; +extern BOOL g_bStop; + +/*****IMP*****/ +extern CFrameIMPDown_ g_FrameIMPDown;//IMP协议类实例化 +extern bool IMPDlgWindowVisible;//IMP对话框为可视状态 +//extern CDlgIMP* g_DlgIMP;//IMP对话框 +//串口相关 +const unsigned BAUDITEMNUM =10; //波特率数目 +const unsigned NCOUNTER=500; //失败尝试次数 +//波特率列表 +extern CString gComBaudItems[BAUDITEMNUM]; + +extern bool g_bBindData;//是否在装订的标志 + +//13所吊舱控制新 +#define WM_13DC_UPDAFRAME WM_USER + 148 // +extern int g_commandNum; //控制指令序号 +extern CDCFrameCkCmdFrame g_DCFrameCkCmd13; //数据注入指令从控发送数据帧---13所吊舱 +//武汉天进吊舱控制 +#define WM_WHTJDC_UPDAFRAME WM_USER + 149 // +extern int g_WHTJDCCmdNum; //控制指令序号 +extern int DCTypeSelected_video; //吊舱类型选择_图像接收 +extern bool SelectPointTrack;//选点跟踪 +extern HWND DlgDCOverroll_Hwnd; //DCOverrollDlg句柄 + +extern float m_wndShowEO_Position_Max_x; //图像显示区域的坐标最大值x +extern float m_wndShowEO_Position_Max_y; //图像显示区域的坐标最大值y \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/GlobalMessage.h b/Src/CH91PayloadSoftware/GlobalMessage.h new file mode 100644 index 0000000..36747aa --- /dev/null +++ b/Src/CH91PayloadSoftware/GlobalMessage.h @@ -0,0 +1,103 @@ +#ifndef GLOBAL_MESSAGE_H +#define GLOBAL_MESSAGE_H + +// 显示可见光和红外信息 +const UINT WM_SHOW_CH96_INFO = WM_USER + 5000; +const UINT WM_SHOW_IR_INFO = WM_USER + 5001; +const UINT WM_SHOW_DC_INFO = WM_USER + 5002; + +// 显示发送指令内容 +const UINT WM_SHOW_CTRL_INSTRUCTIONS = WM_USER + 5003; + +// 双击表盘图像,显示载荷导引两个角 +const UINT WM_SHOW_GUIDE_AZIMUTH = WM_USER + 5004; +const UINT WM_SHOW_GUIDE_PITCH = WM_USER + 5005; + +// 目标跟踪消息响应函数 +const UINT WM_SHOW_EO_TGT_TRACK = WM_USER + 5006; +const UINT WM_SHOW_IR_TGT_TRACK = WM_USER + 5007; + +// 手动搜索指令盘响应函数 +const UINT WM_SHOW_MANUAL_SEARCH = WM_USER + 5008; + +// 主界面数引窗口显示地图上的载荷导引角 +const UINT WM_SHOW_MAP_GUIDE_POS = WM_USER + 5009; + +// 显示载荷视场 +const UINT WM_UPDATA_GOOGLEMAP = WM_USER + 5010; + +// 显示激光编码状态 +const UINT WM_SHOW_LD_STATE = WM_USER + 5011; + +// 显示情报席位目标定位数据对话框 +const UINT WM_SHOW_QB_TARGET = WM_USER + 5012; +// 根据情报席位的目标经纬度将目标点显示在地图上 +const UINT WM_SHOW_TARGET_ONMAP = WM_USER + 5013; + +// 根据复接数据的方位俯仰脱靶量在其他功能界面上进行折线图显示 +const UINT WM_SHOW_MISSDISTANCE_CHART = WM_USER + 5014; +// KCF分析中设定目标中心消息,并将该消息传递给图像分析对话框 +const UINT WM_SET_TARGET_IMAGE_CENTER = WM_USER + 5015; +// 载荷评价窗口子页面向父页面发送的结果保存的消息 +const UINT WM_SAVE_EVALUATION_RESULTS = WM_USER + 5016; +// 在视频控制页面更改载荷类型消息 +const UINT WM_SET_PAYLOAD_TYPE = WM_USER + 5017; +// 在CH92中的视频播放界面将DC修改为EO/IR +const UINT WM_RETURN_PAYLOAD_TYPE_WARNING = WM_USER + 5018; +// 显示EO图像监控分析 +const UINT WM_SHOW_EO_MONITOR = WM_USER + 5019; +// 显示IR图像监控分析 +const UINT WM_SHOW_IR_MONITOR = WM_USER + 5020; + +// 向情报处理窗口发送消息,显示激光测距值等内容 +const UINT WM_SHOW_LASERDIS_QBFUNCTIONSDLG = WM_USER + 5021; +// 显示激光定位结果 +const UINT WM_SHOW_TARGET_LOCATE_RESULT = WM_USER + 5022; +// 向组播连接窗口发送消息,显示复接数据各字节内容 +const UINT WN_SHOW_CH96_FJDATA = WM_USER + 5023; + +// 目标定位模块向情报处理主窗口传递坐标转换消息 +const UINT WM_SHOW_TARGETLOC_CHANGE = WM_USER + 5024; +// 当在控制页面发送指令之后,将焦点置于主界面 +const UINT WM_SETFOCUS_AFTERCONTROL = WM_USER + 5025; + +// 匹配定位采集图像 +const UINT WM_CAPTURE_IMG_WHEN_MAPMATCH = WM_USER + 5026; +const UINT WM_LeadAndTag_TO_MAPMATCHLOCATE = WM_USER + 5027; // 定位导引 +const UINT WM_SHOW_MAP_MATCH_LOCATE_IMG_INFO = WM_USER + 5028; // 显示单帧图像定位信息 +const UINT WM_SHOW_MAP_MATCH_LOCATE_RESULT = WM_USER + 5029; // 显示单帧图像定位信息 + +// 开启视频拼接页面 开始 按钮有效性 +const UINT WM_ENABLE_STITCHPAGE_START_BTN = WM_USER + 6000; + +// 关闭视频拼接页面 开始 按钮有效性 +const UINT WM_UNENABLE_STITCHPAGE_START_BTN = WM_USER + 6001; + +// 开启视频拼接页面 暂停 按钮有效性 +const UINT WM_ENABLE_STITCHPAGE_PAUSE_BTN = WM_USER + 6002; + +// 关闭视频拼接页面 暂停 按钮有效性 +const UINT WM_UNENABLE_STITCHPAGE_PAUSE_BTN = WM_USER + 6003; + +// 开启视频拼接页面 停止 按钮有效性 +const UINT WM_ENABLE_STITCHPAGE_STOP_BTN = WM_USER + 6004; + +// 关闭视频拼接页面 停止 按钮有效性 +const UINT WM_UNENABLE_STITCHPAGE_STOP_BTN = WM_USER + 6005; + +// 图像拼接页面输出拼接图像 +const UINT WM_OUTPUT_IMG = WM_USER + 6006; + +// 图像拼接页面输出当前视场 +const UINT WM_OUTPUT_QUADRANGLE = WM_USER + 6007; + + +//IMP +#define WM_UPDATE_IMPDOWN_CHECKED WM_USER + 7008 +#define WM_UPDATE_IMP_SERIAL_CONNECT WM_USER + 7009 + + +//吊舱 +#define WM_PROCESS_DC_CMD WM_USER + 7010 + +#endif \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/IMPConect.cpp b/Src/CH91PayloadSoftware/IMPConect.cpp new file mode 100644 index 0000000..1cc5512 --- /dev/null +++ b/Src/CH91PayloadSoftware/IMPConect.cpp @@ -0,0 +1,12 @@ +#include "StdAfx.h" +#include "IMPConect.h" + + +IMPConect::IMPConect(void) +{ +} + + +IMPConect::~IMPConect(void) +{ +} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/IMPConect.h b/Src/CH91PayloadSoftware/IMPConect.h new file mode 100644 index 0000000..dd13dda --- /dev/null +++ b/Src/CH91PayloadSoftware/IMPConect.h @@ -0,0 +1,7 @@ +#pragma once +class IMPConect +{ +public: + IMPConect(void); + ~IMPConect(void); +}; \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/JoyKeybordControl.cpp b/Src/CH91PayloadSoftware/JoyKeybordControl.cpp new file mode 100644 index 0000000..ec88b28 --- /dev/null +++ b/Src/CH91PayloadSoftware/JoyKeybordControl.cpp @@ -0,0 +1,226 @@ +#include "StdAfx.h" +#include "JoyKeybordControl.h" + + +CJoyKeybordControl::CJoyKeybordControl(void) +{ +} + + +CJoyKeybordControl::~CJoyKeybordControl(void) +{ +} +// 串口收来自视频键盘的数 +void GetSerialPortData(char *buffer,const DWORD size) +{ + memcpy(g_payloadCtrlInstructionFromVK, buffer, size); + // 如果控制指令来自视频键盘 + if (g_bCtrlFromSoftware == FALSE) + { + if (0x12 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 2; + g_sCtrlInstruction = g_str_VerticalView; + } + else if (0x13 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 3; + g_sCtrlInstruction = g_str_AutoScan; + } + else if (0x11 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 1; + g_sCtrlInstruction = g_str_ManualSlew; + } + else if (0x1C == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 10; + g_sCtrlInstruction = g_str_TurretStow; + } + else if (0x1D == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 11; + g_sCtrlInstruction = g_str_TurretFWD; + } + else if (0x23 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 14; + g_sCtrlInstruction = g_str_CorrelationTracking; + } + else if (0x24 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 15; + g_sCtrlInstruction = g_str_CentroidBlackTracking; + } + else if (0x25 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 16; + g_sCtrlInstruction = g_str_CentroidWhiteTracking; + } + else if (0x40 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 25; + g_sCtrlInstruction = g_str_LRFPowerON; + } + else if (0x41 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 26; + g_sCtrlInstruction = g_str_LRFPowerOFF; + } + else if (0x42 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 27; + g_sCtrlInstruction = g_str_LRFArmed; + } + else if (0x43 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 28; + g_sCtrlInstruction = g_str_LRFSafe; + } + else if (0xA2 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol =29; + g_sCtrlInstruction = g_str_LDArmed; + } + else if (0x45 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 30; + g_sCtrlInstruction = g_str_LDSafe; + } + else if (0x46 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 31; + g_sCtrlInstruction = g_str_LaserNo1; + } + else if (0x47 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 32; + g_sCtrlInstruction = g_str_LaserNo2; + } + else if (0x48 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 33; + g_sCtrlInstruction = g_str_LaserNo3; + } + else if (0x49 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 34; + g_sCtrlInstruction = g_str_LaserNo4; + } + else if (0x4A == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 35; + g_sCtrlInstruction = g_str_LaserNo5; + } + else if (0x4B == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 36; + g_sCtrlInstruction = g_str_LaserNo6; + } + else if (0x4C == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 37; + g_sCtrlInstruction = g_str_LaserNo7; + } + else if (0x4D == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 38; + g_sCtrlInstruction = g_str_LaserNo8; + } + else if (0x4E == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 39; + g_sCtrlInstruction = g_str_LaserNo9; + } + else if (0x4F == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 40; + g_sCtrlInstruction = g_str_LaserNo10; + } + else if (0x54 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 42; + g_sCtrlInstruction = g_str_ICRON; + } + else if (0x55 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 43; + g_sCtrlInstruction = g_str_ICROFF; + } + else if (0x56 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 44; + g_sCtrlInstruction = g_str_DefogON; + } + else if (0x58 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 45; + g_sCtrlInstruction = g_str_DefogOFF; + } + else if (0x52 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 48; + g_sCtrlInstruction = g_str_EOZoomOut; + } + else if (0x53 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 49; + g_sCtrlInstruction = g_str_EOZoomOut; + } + else if (0x83 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 62; + g_sCtrlInstruction = g_str_IRFocusPlus; + } + else if (0x84 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 63; + g_sCtrlInstruction = g_str_IRFocusMinus; + } + else if (0x85 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 65; + g_sCtrlInstruction = g_str_IRZoomOut; + } + else if (0x86 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 66; + g_sCtrlInstruction = g_str_IRZoomIn; + } + else if (0x87 == g_payloadCtrlInstructionFromVK[2]) + { + g_payloadCtrlProtocol = 67; + g_sCtrlInstruction = g_str_BHWH; + } + else + { + g_payloadCtrlProtocol = 0; + } + } +} + +void CJoyKeybordControl::OnInitJoyKeybord() +{ + // 设置视频键盘串口初始化 + CString fileSysName = GetSoftwareCurrentDirectory()+ "\\ini\\" + "config.ini"; + char char_COMName[20]; + GetPrivateProfileString("CONTROL_FROM_COM", "COMName", "0", char_COMName, 20, fileSysName); + if (!m_Serial.Initialize(char_COMName, 38400)) + { + ::MessageBoxA(NULL, g_str_WarningSerialReceive, g_str_WarningTitle, MB_OK); + } + else + { + m_Serial.SetComReadCallback(GetSerialPortData); + } + +} + +void CJoyKeybordControl::OnDestoryJoyKeybord() +{ + // 卸载串口 + if (TRUE == m_Serial.IsInitialized()) + { + m_Serial.DeInit(); + } +} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/JoyKeybordControl.h b/Src/CH91PayloadSoftware/JoyKeybordControl.h new file mode 100644 index 0000000..e43b28e --- /dev/null +++ b/Src/CH91PayloadSoftware/JoyKeybordControl.h @@ -0,0 +1,21 @@ +#include "Serial.h" +#include "Global.h" +#include "GlobalMember.h" +#include "GlobalMessage.h" +#pragma once +class CJoyKeybordControl +{ +public: + CJoyKeybordControl(void); + ~CJoyKeybordControl(void); +private: + CSerial m_Serial; +public: + // 串口初始化并开始接受数据 + void OnInitJoyKeybord(); + // 串口关闭 + void OnDestoryJoyKeybord(); + + +}; + diff --git a/Src/CH91PayloadSoftware/JoyStickControlDlg.cpp b/Src/CH91PayloadSoftware/JoyStickControlDlg.cpp new file mode 100644 index 0000000..5fddc7f --- /dev/null +++ b/Src/CH91PayloadSoftware/JoyStickControlDlg.cpp @@ -0,0 +1,159 @@ +// JoyStickControlDlg.cpp : 实现文件 +// + +#include "stdafx.h" +#include "CH91PayloadSoftware.h" +#include "JoyStickControlDlg.h" +#include "afxdialogex.h" +#include "GlobalMember.h" +#include "Global.h" +#include "GlobalMessage.h" + + +// CJoyStickControlDlg 对话框 + +IMPLEMENT_DYNAMIC(CJoyStickControlDlg, CDialogEx) + + CJoyStickControlDlg::CJoyStickControlDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CJoyStickControlDlg::IDD, pParent) +{ + +} + +CJoyStickControlDlg::~CJoyStickControlDlg() +{ +} + +void CJoyStickControlDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CJoyStickControlDlg, CDialogEx) + ON_WM_TIMER() +END_MESSAGE_MAP() + + +// CJoyStickControlDlg 消息处理程序 + + +BOOL CJoyStickControlDlg::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + // 获取窗口句柄 + g_JoyStickControlDlgHwnd = GetSafeHwnd(); + // 摇杆变量初始化 + m_JoyStickListener = new JSParser::JoyStickListener(); + m_JoyStickListener->init(g_JoyStickControlDlgHwnd); + + // 设定时间变量 + SetTimer(1, 2000, nullptr); + return TRUE; // return TRUE unless you set the focus to a control + // 异常: OCX 属性页应返回 FALSE +} + + +void CJoyStickControlDlg::OnTimer(UINT_PTR nIDEvent) +{ + //if (m_JoyStickListener->isInit()) + //{ + // // 更新摇杆主轴状态 + // m_JoyStickListener->UpdateStick(stick_Height, stick_Width); + // // 更新摇杆按键状态 + // m_JoyStickListener->UpdateButtons(m_JoyStickButtons); + + // // 更新指令 + // UpdateControl(); + //} + //else + //{ + // m_JoyStickListener->init(g_JoyStickControlDlgHwnd); + //} + CDialogEx::OnTimer(nIDEvent); +} + +void CJoyStickControlDlg::UpdateControl() +{ + if (g_bCtrlFromSoftware == FALSE) + { + // 手动跟踪,控制伺服 + if (m_JoyStickButtons[0] == true) + { + g_payloadCtrlProtocol = 1002; + g_ServoSpeedUpDown = (int)(0 - stick_Height * 512); + g_ServoSpeedLeftRight = (int)(stick_Width * 512); + //TRACE("X:%d Y:%d\n",g_ServoSpeedUpDown,g_ServoSpeedLeftRight); + + } + // EO自动跟踪,控制波门 + else if (m_JoyStickButtons[3] == true) + { + g_payloadCtrlProtocol = 16; + g_TrackOffset.y = (int)(0 - stick_Height * 540); + g_TrackOffset.x = (int)(stick_Width * 960); + } + // IR自动跟踪,控制波门 + else if (m_JoyStickButtons[2] == true) + { + g_payloadCtrlProtocol = 17; + g_TrackOffset.y = (int)(0 - stick_Height * 288); + g_TrackOffset.x = (int)(stick_Width * 360); + } + // EO自动对焦 + else if (m_JoyStickButtons[1] == true) + { + g_payloadCtrlProtocol = 69; + } + // IR自动对焦 + else if (m_JoyStickButtons[4] == true) + { + g_payloadCtrlProtocol = 78; + } + // EO视场小 + else if (m_JoyStickButtons[6] == true) + { + g_payloadCtrlProtocol = 60; + } + // EO视场大 + else if (m_JoyStickButtons[8] == true) + { + g_payloadCtrlProtocol = 59; + } + // IR视场小 + else if (m_JoyStickButtons[10] == true) + { + g_payloadCtrlProtocol = 81; + } + // IR视场大 + else if (m_JoyStickButtons[12] == true) + { + g_payloadCtrlProtocol = 80; + } + // 波门上移 + else if (m_JoyStickButtons[14] == true) + { + g_payloadCtrlProtocol = 34; + } + // 波门下移 + else if (m_JoyStickButtons[16] == true) + { + g_payloadCtrlProtocol = 35; + } + // 波门右移 + else if (m_JoyStickButtons[15] == true) + { + g_payloadCtrlProtocol = 32; + } + // 波门左移 + else if (m_JoyStickButtons[17] == true) + { + g_payloadCtrlProtocol = 33; + } + // 其他操作,发送空指令 + else + { + g_payloadCtrlProtocol = 0; + } + } +} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/JoyStickControlDlg.h b/Src/CH91PayloadSoftware/JoyStickControlDlg.h new file mode 100644 index 0000000..410668b --- /dev/null +++ b/Src/CH91PayloadSoftware/JoyStickControlDlg.h @@ -0,0 +1,41 @@ +#pragma once +#include "JoyStickListener.h" + +// CJoyStickControlDlg 对话框 + +class CJoyStickControlDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CJoyStickControlDlg) + +public: + CJoyStickControlDlg(CWnd* pParent = NULL); // 标准构造函数 + virtual ~CJoyStickControlDlg(); + +// 对话框数据 + enum { IDD = IDD_DLG_JOYSTICKCONTROL }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + DECLARE_MESSAGE_MAP() + +public: + JSParser::JoyStickListener* m_JoyStickListener; + // 摇杆主轴状态 + float stick_Height;//摇杆纵向位移(-1,1) + float stick_Width;//摇杆横向位移(-1,1) +// // 摇杆控制量——EO波门位置 +// extern int g_EOAVTGate_UpDown; // [-540, 540]; +// extern int g_EOAVTGate_LeftRight; // [-960, 960]; +// // 摇杆控制量——IR波门位置 +// extern int g_IRAVTGate_UpDown; // [-256, 256]; +// extern int g_IRAVTGate_LeftRight; // [-320, 320]; + // 摇杆按钮状态 + std::vector m_JoyStickButtons; + + +public: + virtual BOOL OnInitDialog(); + afx_msg void OnTimer(UINT_PTR nIDEvent); + void UpdateControl(); +}; diff --git a/Src/CH91PayloadSoftware/JoyStickListener.cpp b/Src/CH91PayloadSoftware/JoyStickListener.cpp new file mode 100644 index 0000000..6d9a569 --- /dev/null +++ b/Src/CH91PayloadSoftware/JoyStickListener.cpp @@ -0,0 +1,123 @@ +#include "stdafx.h" +#include "JoyStickListener.h" + +using namespace JSParser; + +JoyStickListener::JoyStickListener() + :m_pInputMgr(NULL) + ,m_pJoystickMgr(NULL) +{ + +} + +JoyStickListener::~JoyStickListener() +{ + m_pInputMgr->destroyInputObject(m_pJoystickMgr); + OIS::InputManager::destroyInputSystem(m_pInputMgr); +} + +void JoyStickListener::init(HWND hWnd) +{ + OIS::ParamList pl; + //HWND _hWnd = AfxGetMainWnd()->GetSafeHwnd(); + std::ostringstream wnd; wnd << (size_t)hWnd; + pl.insert(std::make_pair(std::string("WINDOW"), wnd.str())); + pl.insert(std::make_pair(std::string("w32_joystick"), std::string("DISCL_BACKGROUND"))); //后台模式 + pl.insert(std::make_pair(std::string("w32_joystick"), std::string("DISCL_NONEXCLUSIVE")));//非独占模式 + + try + { + m_pInputMgr = OIS::InputManager::createInputSystem( pl ); + } + catch (...) + { + std::cout << "Fail to initialize InputSystem......" << std::endl; + } + + if (m_pInputMgr != NULL) + { + try + { + //布尔值表示(非)缓冲模式 + m_pJoystickMgr = static_cast(m_pInputMgr->createInputObject( OIS::OISJoyStick, true )); + } + catch(...) + { + m_pJoystickMgr = NULL; + std::cout << "Fail to initialize Joystick......" << std::endl; + } + + if (m_pJoystickMgr != NULL) + { + //设置摇杆消息监听 + m_pJoystickMgr->setEventCallback(this); + + m_pJoyStickState = m_pJoystickMgr->getJoyStickState(); + m_pJoyStickState.clear(); + } + } + +} + +void JoyStickListener::UpdateStick(float &a,float &e) +{ + m_pJoystickMgr->capture(); + m_pJoyStickState = m_pJoystickMgr->getJoyStickState(); + + a = double((m_pJoyStickState.mAxes[0]).abs) / OIS::JoyStick::MAX_AXIS;//纵向 + e = double((m_pJoyStickState.mAxes[1]).abs) / OIS::JoyStick::MAX_AXIS;//横向 + +} +void JoyStickListener::UpdateButtons(std::vector &buttons) +{ + m_pJoystickMgr->capture(); + m_pJoyStickState = m_pJoystickMgr->getJoyStickState(); + buttons = m_pJoyStickState.mButtons; +} + +bool JoyStickListener::buttonPressed( const OIS::JoyStickEvent &arg, int button ) +{ + std::cout << "Button Pressed: " << button << std::endl; + return true; +} + +bool JoyStickListener::buttonReleased( const OIS::JoyStickEvent &arg, int button ) +{ + std::cout << "Button Released: " << button << std::endl; + return true; +} + +bool JoyStickListener::axisMoved( const OIS::JoyStickEvent &arg, int axis ) +{ + std::cout << "Joystick Axis[" << axis << "] Moved(Abs): " << arg.state.mAxes[axis].abs << std::endl; + return true; +} + +bool JoyStickListener::povMoved( const OIS::JoyStickEvent &arg, int pov ) +{ + std::cout << "Pov[" << pov << "] Moved Direction: " << arg.state.mPOV[pov].direction << std::endl; + std::cout << "Pov Moved to "; + + + if(arg.state.mPOV[pov].direction & OIS::Pov::Centered) + std::cout << "Centered"; + else if(arg.state.mPOV[pov].direction & OIS::Pov::East) + std::cout << "East"; + else if(arg.state.mPOV[pov].direction & OIS::Pov::South) + std::cout << "South"; + else if(arg.state.mPOV[pov].direction & OIS::Pov::West) + std::cout << "West"; + else if(arg.state.mPOV[pov].direction & OIS::Pov::North) + std::cout << "North"; + else if(arg.state.mPOV[pov].direction & OIS::Pov::NorthEast) + std::cout << "NorthEast"; + else if(arg.state.mPOV[pov].direction & OIS::Pov::NorthWest) + std::cout << "NorthWest"; + else if(arg.state.mPOV[pov].direction & OIS::Pov::SouthEast) + std::cout << "SouthEast"; + else if(arg.state.mPOV[pov].direction & OIS::Pov::SouthWest) + std::cout << "SouthWest"; + + std::cout << std::endl; + return true; +} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/JoyStickListener.h b/Src/CH91PayloadSoftware/JoyStickListener.h new file mode 100644 index 0000000..85a1330 --- /dev/null +++ b/Src/CH91PayloadSoftware/JoyStickListener.h @@ -0,0 +1,50 @@ +#ifndef __JOYSTICKLISTENER_H__ +#define __JOYSTICKLISTENER_H__ + +#include "OIS.h" +#include "windows.h" + +#include +#include +#include +#include +#include +#include +#include + +namespace JSParser +{ + class JoyStickListener : public OIS::JoyStickListener + { + public: + JoyStickListener(); + ~JoyStickListener(); + + void init(HWND hWnd); + + bool buttonPressed( const OIS::JoyStickEvent &arg, int button ); + + bool buttonReleased( const OIS::JoyStickEvent &arg, int button ); + + //摇杆主轴 + bool axisMoved( const OIS::JoyStickEvent &arg, int axis ); + + //摇杆上的多向按钮(帽) + bool povMoved( const OIS::JoyStickEvent &arg, int pov ); + + bool isInit() { return (m_pJoystickMgr == NULL) ? false : true; }; + + // 更新摇杆主轴状态 + void UpdateStick(float &a,float &e); + // 更新摇杆按钮状态 + void UpdateButtons(std::vector &buttons); + + protected: + private: + OIS::InputManager* m_pInputMgr; + OIS::JoyStick* m_pJoystickMgr; + OIS::JoyStickState m_pJoyStickState; + }; +} + +#endif \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/MUDP.cpp b/Src/CH91PayloadSoftware/MUDP.cpp new file mode 100644 index 0000000..5096030 --- /dev/null +++ b/Src/CH91PayloadSoftware/MUDP.cpp @@ -0,0 +1,111 @@ +锘#include "stdafx.h" +#include "MUDP.h" +#include "Mmc.h" +CMUDP::CMUDP() +{ + memset( m_strBuffer, 0, sizeof( m_strBuffer ) ); + m_fun=NULL; + if (!AfxSocketInit()){ + MessageBox(NULL,_T("缃戠粶缁勬挱濂楁帴瀛楀垵濮嬪寲澶辫触"),"....", MB_OK | MB_ICONSTOP); + } +} + +CMUDP::~CMUDP() +{ +} + +///////////////////////////////////////////////////////////////////////////// +// CMulticastSocket member functions + +void CMUDP::OnReceive( int nErrorCode ) +{ + memset( m_strBuffer, 0, 32000 ); + + int nDataNum = ReceiveFrom( m_strBuffer, 32000, m_strSendersIP, m_nSendersPort ); + + if ( nDataNum == SOCKET_ERROR ) + { + AfxMessageBox( "缃戠粶缁勬挱鎺ユ敹鏁版嵁閿欒锛" ); + } + else + { + if (m_fun) + { + m_fun(m_strBuffer,nDataNum,m_param); + } + } + + CAsyncSocket::OnReceive( nErrorCode ); +} + +BOOL CMUDP::LeaveGroup() +{ + if ( setsockopt( m_hSocket, IPPROTO_IP, IP_DROP_MEMBERSHIP, ( char FAR * ) &m_mrMReq, sizeof( m_mrMReq ) ) < 0 ) + { + return FALSE; + } + Close(); // Close receving socket + return TRUE; +} + +BOOL CMUDP::SendToY( const void *strMessage, int nSize ) +{ + if ( SendTo( strMessage, nSize, ( SOCKADDR * ) &m_saHostGroup, sizeof( SOCKADDR ), 0 ) == SOCKET_ERROR ) + { + return FALSE; + } + else + { + return TRUE; + } +} + +BOOL CMUDP::InitGroup( CString GroupIP, UINT nGroupPort, UINT nTTL, BOOL bLoopback ) +{ + int nLoopBack = ( int ) bLoopback; + + if ( !Create( nGroupPort, SOCK_DGRAM, FD_READ|FD_WRITE ) ){ + Close(); + return FALSE; + } + + m_mrMReq.imr_multiaddr.s_addr = inet_addr(GroupIP ); + m_mrMReq.imr_interface.s_addr = htons( INADDR_ANY ); + + memset( &m_saHostGroup, 0, sizeof( m_saHostGroup ) ); + m_saHostGroup.sin_family = AF_INET; + m_saHostGroup.sin_addr.s_addr = inet_addr( GroupIP ); + m_saHostGroup.sin_port = htons( ( USHORT ) nGroupPort ); + + BOOL bMultipleApps = TRUE; + if(SetSockOpt( SO_REUSEADDR, ( void * ) &bMultipleApps, sizeof( BOOL ), SOL_SOCKET ) < 0){ + AfxMessageBox( "缃戠粶缁勬挱璁剧疆澶辫触--1" ); + Close(); + return FALSE; + } + if (SetSockOpt( IP_MULTICAST_TTL, &nTTL, sizeof( int ), IPPROTO_IP ) < 0 ){ + AfxMessageBox( "缃戠粶缁勬挱璁剧疆澶辫触--2" ); + Close(); + return FALSE; + } + if (SetSockOpt(IP_MULTICAST_LOOP, &nLoopBack, sizeof( int ), IPPROTO_IP ) < 0 ){ + AfxMessageBox( "缃戠粶缁勬挱璁剧疆澶辫触--3" ); + Close(); + return FALSE; + } + if(SetSockOpt(IP_ADD_MEMBERSHIP,( char FAR * ) &m_mrMReq,sizeof( m_mrMReq ),IPPROTO_IP) < 0){ + AfxMessageBox( "缃戠粶缁勬挱璁剧疆澶辫触--4" ); + Close(); + return FALSE; + } + + return TRUE; +} + +void CMUDP::SetReadCallBack(MulticastCALLBACK fun, LPVOID lp) +{ + m_fun=fun; + m_param = lp; +} + + diff --git a/Src/CH91PayloadSoftware/MUDP.h b/Src/CH91PayloadSoftware/MUDP.h new file mode 100644 index 0000000..41e42d9 --- /dev/null +++ b/Src/CH91PayloadSoftware/MUDP.h @@ -0,0 +1,34 @@ +#ifndef _M_UDP_ +#define _M_UDP_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 +// MulticastSocket.h : header file + +typedef void(CALLBACK*MulticastCALLBACK)(unsigned char* buffer, const DWORD size,LPVOID lp); +#include + +class CMUDP : public CAsyncSocket +{ +public: + CMUDP(); + virtual ~CMUDP(); +public: + BOOL InitGroup( CString, UINT, UINT, BOOL ); + BOOL LeaveGroup(); + BOOL SendToY( const void *, int ); + void SetReadCallBack(MulticastCALLBACK fun, LPVOID lp); +public: + virtual void OnReceive(int nErrorCode); +private: + unsigned char m_strBuffer[32000]; // Receiving buffer for the packet that has arrived + SOCKADDR_IN m_saHostGroup; // SOCKADDR structure to hold IP/Port of the Host group to send data to it + ip_mreq m_mrMReq; // Contains IP and interface of the host group + UINT m_nSendersPort; // Holds Port No. of the socket from which last packet was received + CString m_strSendersIP; // Hold IP of the socket from which the last packet was received + MulticastCALLBACK m_fun; + LPVOID m_param; +}; + +#endif // !defined(AFX_MULTICASTSOCKET_H__269E2C7F_2037_11D3_8EF3_0000C0FD25F8__INCLUDED_) diff --git a/Src/CH91PayloadSoftware/MapPrj.lib b/Src/CH91PayloadSoftware/MapPrj.lib new file mode 100644 index 0000000..7c77335 Binary files /dev/null and b/Src/CH91PayloadSoftware/MapPrj.lib differ diff --git a/Src/CH91PayloadSoftware/MasterHardDiskSerial.cpp b/Src/CH91PayloadSoftware/MasterHardDiskSerial.cpp new file mode 100644 index 0000000..d6cef47 --- /dev/null +++ b/Src/CH91PayloadSoftware/MasterHardDiskSerial.cpp @@ -0,0 +1,802 @@ +#include "StdAfx.h" +#include "MasterHardDiskSerial.h" +#include + +int MasterHardDiskSerial::ReadPhysicalDriveInNTWithAdminRights(void) +{ + int iDone = FALSE; + int iDrive = 0; + + for (iDrive = 0; iDrive < MAX_IDE_DRIVES; iDrive++) + { + HANDLE hPhysicalDriveIOCTL = 0; + + // Try to get a handle to PhysicalDrive IOCTL, report failure + // and exit if can't. + char cszDriveName[256]; + + sprintf_s(cszDriveName, 256, "\\\\.\\PhysicalDrive%d", iDrive); + + // Windows NT, Windows 2000, must have admin rights + hPhysicalDriveIOCTL = CreateFileA(cszDriveName, + GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, 0, NULL); + if (hPhysicalDriveIOCTL == INVALID_HANDLE_VALUE) + { + SecureZeroMemory(m_cszErrorMessage, sizeof(m_cszErrorMessage)); + sprintf_s(m_cszErrorMessage, 256, "%d ReadPhysicalDriveInNTWithAdminRights ERROR ,CreateFileA(%s) returned INVALID_HANDLE_VALUE", __LINE__, cszDriveName); + } + else + { + GETVERSIONOUTPARAMS VersionParams; + DWORD dwBytesReturned = 0; + + // Get the version, etc of PhysicalDrive IOCTL + memset((void *)&VersionParams, 0, sizeof(VersionParams)); + + if (!DeviceIoControl(hPhysicalDriveIOCTL, DFP_GET_VERSION, + NULL, + 0, + &VersionParams, + sizeof(VersionParams), + &dwBytesReturned, NULL)) + { + + DWORD dwErr = GetLastError(); + SecureZeroMemory(m_cszErrorMessage, sizeof(m_cszErrorMessage)); + + sprintf_s(m_cszErrorMessage, 256, "%d ReadPhysicalDriveInNTWithAdminRights ERROR DeviceIoControl() %ld, DFP_GET_VERSION) returned 0, error is %d\n", __LINE__, (long long)hPhysicalDriveIOCTL, (int)dwErr); + } + + // If there is a IDE device at number "iI" issue commands + // to the device + if (VersionParams.bIDEDeviceMap <= 0) + { + SecureZeroMemory(m_cszErrorMessage, sizeof(m_cszErrorMessage)); + sprintf_s(m_cszErrorMessage, 256, "%d ReadPhysicalDriveInNTWithAdminRights ERROR No device found at iPosition %d (%d)", __LINE__, (int)iDrive, (int)VersionParams.bIDEDeviceMap); + } + else + { + BYTE bIDCmd = 0; // IDE or ATAPI IDENTIFY cmd + SENDCMDINPARAMS scip; + //SENDCMDOUTPARAMS OutCmd; + + // Now, get the ID sector for all IDE devices in the system. + // If the device is ATAPI use the IDE_ATAPI_IDENTIFY command, + // otherwise use the IDE_ATA_IDENTIFY command + bIDCmd = (VersionParams.bIDEDeviceMap >> iDrive & 0x10) ? IDE_ATAPI_IDENTIFY : IDE_ATA_IDENTIFY; + + memset(&scip, 0, sizeof(scip)); + memset(byIdOutCmd, 0, sizeof(byIdOutCmd)); + + if (DoIDENTIFY(hPhysicalDriveIOCTL, + &scip, + (PSENDCMDOUTPARAMS)&byIdOutCmd, + (BYTE)bIDCmd, + (BYTE)iDrive, + &dwBytesReturned)) + { + DWORD dwDiskData[256]; + int iIjk = 0; + USHORT *punIdSector = (USHORT *)((PSENDCMDOUTPARAMS)byIdOutCmd)->bBuffer; + + for (iIjk = 0; iIjk < 256; iIjk++) + dwDiskData[iIjk] = punIdSector[iIjk]; + + PrintIdeInfo(iDrive, dwDiskData); + + iDone = TRUE; + } + } + + CloseHandle(hPhysicalDriveIOCTL); + } + } + + return iDone; +} + +int MasterHardDiskSerial::ReadPhysicalDriveInNTUsingSmart(void) +{ + int iDone = FALSE; + int iDrive = 0; + + for (iDrive = 0; iDrive < MAX_IDE_DRIVES; iDrive++) + { + HANDLE hPhysicalDriveIOCTL = 0; + + // Try to get a handle to PhysicalDrive IOCTL, report failure + // and exit if can't. + char cszDriveName[256]; + + sprintf_s(cszDriveName, 256, "\\\\.\\PhysicalDrive%d", iDrive); + + // Windows NT, Windows 2000, Windows Server 2003, Vista + hPhysicalDriveIOCTL = CreateFileA(cszDriveName, + GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, 0, NULL); + // if (hPhysicalDriveIOCTL == INVALID_HANDLE_VALUE) + // printf ("Unable to open physical iDrive %d, error code: 0x%lX\n", + // iDrive, GetLastError ()); + + if (hPhysicalDriveIOCTL == INVALID_HANDLE_VALUE) + { + SecureZeroMemory(m_cszErrorMessage, sizeof(m_cszErrorMessage)); + sprintf_s(m_cszErrorMessage, 256, "%d ReadPhysicalDriveInNTUsingSmart ERROR, CreateFileA(%s) returned INVALID_HANDLE_VALUE Error Code %d", __LINE__, cszDriveName, GetLastError()); + } + else + { + GETVERSIONINPARAMS GetVersionParams; + DWORD dwBytesReturned = 0; + + // Get the version, etc of PhysicalDrive IOCTL + memset((void *)&GetVersionParams, 0, sizeof(GetVersionParams)); + + if (!DeviceIoControl(hPhysicalDriveIOCTL, SMART_GET_VERSION, + NULL, + 0, + &GetVersionParams, sizeof(GETVERSIONINPARAMS), + &dwBytesReturned, NULL)) + { + DWORD dwErr = GetLastError(); + SecureZeroMemory(m_cszErrorMessage, sizeof(m_cszErrorMessage)); + sprintf_s(m_cszErrorMessage, 256, "\n%d ReadPhysicalDriveInNTUsingSmart ERROR DeviceIoControl(%ld, SMART_GET_VERSION) returned 0, error is %d", __LINE__, (long long)hPhysicalDriveIOCTL, (int)dwErr); + } + else + { + // Print the SMART version + // PrintVersion (& GetVersionParams); + // Allocate the command cszBuffer + ULONG CommandSize = sizeof(SENDCMDINPARAMS) + IDENTIFY_BUFFER_SIZE; + PSENDCMDINPARAMS Command = (PSENDCMDINPARAMS)malloc(CommandSize); + // Retrieve the IDENTIFY data + // Prepare the command +#define ID_CMD 0xEC // Returns ID sector for ATA + Command->irDriveRegs.bCommandReg = ID_CMD; + DWORD BytesReturned = 0; + if (!DeviceIoControl(hPhysicalDriveIOCTL, + SMART_RCV_DRIVE_DATA, Command, sizeof(SENDCMDINPARAMS), + Command, CommandSize, + &BytesReturned, NULL)) + { + SecureZeroMemory(m_cszErrorMessage, sizeof(m_cszErrorMessage)); + sprintf_s(m_cszErrorMessage, 256, "SMART_RCV_DRIVE_DATA IOCTL"); + + // Print the error + //PrintError ("SMART_RCV_DRIVE_DATA IOCTL", GetLastError()); + } + else + { + // Print the IDENTIFY data + DWORD dwDiskData[256]; + USHORT *punIdSector = (USHORT *)(PIDENTIFY_DATA)((PSENDCMDOUTPARAMS)Command)->bBuffer; + + for (int iIjk = 0; iIjk < 256; iIjk++) + dwDiskData[iIjk] = punIdSector[iIjk]; + + PrintIdeInfo(iDrive, dwDiskData); + iDone = TRUE; + } + // Done + CloseHandle(hPhysicalDriveIOCTL); + free(Command); + } + } + } + + return iDone; +} + +char *MasterHardDiskSerial::flipAndCodeBytes(int iPos, int iFlip, const char *pcszStr, char *pcszBuf) +{ + int iI; + int iJ = 0; + int iK = 0; + + pcszBuf[0] = '\0'; + if (iPos <= 0) + return pcszBuf; + + if (!iJ) + { + char cP = 0; + // First try to gather all characters representing hex digits only. + iJ = 1; + iK = 0; + pcszBuf[iK] = 0; + for (iI = iPos; iJ && !(pcszStr[iI] == '\0'); ++iI) + { + char cC = tolower(pcszStr[iI]); + if (isspace(cC)) + cC = '0'; + ++cP; + pcszBuf[iK] <<= 4; + + if (cC >= '0' && cC <= '9') + pcszBuf[iK] |= (char)(cC - '0'); + else if (cC >= 'a' && cC <= 'f') + pcszBuf[iK] |= (char)(cC - 'a' + 10); + else + { + iJ = 0; + break; + } + + if (cP == 2) + { + if ((pcszBuf[iK] != '\0') && !isprint(pcszBuf[iK])) + { + iJ = 0; + break; + } + ++iK; + cP = 0; + pcszBuf[iK] = 0; + } + } + } + + if (!iJ) + { + // There are non-digit characters, gather them as is. + iJ = 1; + iK = 0; + for (iI = iPos; iJ && (pcszStr[iI] != '\0'); ++iI) + { + char cC = pcszStr[iI]; + + if (!isprint(cC)) + { + iJ = 0; + break; + } + + pcszBuf[iK++] = cC; + } + } + + if (!iJ) + { + // The characters are not there or are not printable. + iK = 0; + } + + pcszBuf[iK] = '\0'; + + if (iFlip) + // Flip adjacent characters + for (iJ = 0; iJ < iK; iJ += 2) + { + char t = pcszBuf[iJ]; + pcszBuf[iJ] = pcszBuf[iJ + 1]; + pcszBuf[iJ + 1] = t; + } + + // Trim any beginning and end space + iI = iJ = -1; + for (iK = 0; (pcszBuf[iK] != '\0'); ++iK) + { + if (!isspace(pcszBuf[iK])) + { + if (iI < 0) + iI = iK; + iJ = iK; + } + } + + if ((iI >= 0) && (iJ >= 0)) + { + for (iK = iI; (iK <= iJ) && (pcszBuf[iK] != '\0'); ++iK) + pcszBuf[iK - iI] = pcszBuf[iK]; + pcszBuf[iK - iI] = '\0'; + } + + return pcszBuf; +} + +int MasterHardDiskSerial::ReadPhysicalDriveInNTWithZeroRights(void) +{ + int iDone = FALSE; + int iDrive = 0; + + for (iDrive = 0; iDrive < MAX_IDE_DRIVES; iDrive++) + { + HANDLE hPhysicalDriveIOCTL = 0; + + // Try to get a handle to PhysicalDrive IOCTL, report failure + // and exit if can't. + char cszDriveName[256]; + + sprintf_s(cszDriveName, 256, "\\\\.\\PhysicalDrive%d", iDrive); + + // Windows NT, Windows 2000, Windows XP - admin rights not required + hPhysicalDriveIOCTL = CreateFileA(cszDriveName, 0, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, 0, NULL); + if (hPhysicalDriveIOCTL == INVALID_HANDLE_VALUE) + { + SecureZeroMemory(m_cszErrorMessage, sizeof(m_cszErrorMessage)); + sprintf_s(m_cszErrorMessage, 256, "%d ReadPhysicalDriveInNTWithZeroRights ERROR CreateFileA(%s) returned INVALID_HANDLE_VALUE", __LINE__, cszDriveName); + } + else + { + STORAGE_PROPERTY_QUERY query; + DWORD dwBytesReturned = 0; + char cszBuffer[10000]; + + memset((void *)&query, 0, sizeof(query)); + query.PropertyId = StorageDeviceProperty; + query.QueryType = PropertyStandardQuery; + + memset(cszBuffer, 0, sizeof(cszBuffer)); + + if (DeviceIoControl(hPhysicalDriveIOCTL, IOCTL_STORAGE_QUERY_PROPERTY, + &query, + sizeof(query), + &cszBuffer, + sizeof(cszBuffer), + &dwBytesReturned, NULL)) + { + STORAGE_DEVICE_DESCRIPTOR *descrip = (STORAGE_DEVICE_DESCRIPTOR *)&cszBuffer; + char cszSerialNumber[1000]; + char cszModelNumber[1000]; + char cszVendorId[1000]; + char cszProductRevision[1000]; + + flipAndCodeBytes(descrip->VendorIdOffset, + 0, cszBuffer, cszVendorId); + flipAndCodeBytes(descrip->ProductIdOffset, + 0, cszBuffer, cszModelNumber); + flipAndCodeBytes(descrip->ProductRevisionOffset, + 0, cszBuffer, cszProductRevision); + flipAndCodeBytes(descrip->SerialNumberOffset, + 0, cszBuffer, cszSerialNumber); + + if (0 == m_cszHardDriveSerialNumber[0] && + // serial number must be alphanumeric + // (but there can be leading spaces on IBM drives) + (iswalnum(cszSerialNumber[0]) || iswalnum(cszSerialNumber[19]))) + { + strcpy_s(m_cszHardDriveSerialNumber, 1024, cszSerialNumber); + strcpy_s(m_cszHardDriveModelNumber, 1024, cszModelNumber); + iDone = TRUE; + } + // Get the disk iDrive geometry. + memset(cszBuffer, 0, sizeof(cszBuffer)); + if (!DeviceIoControl(hPhysicalDriveIOCTL, + IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, + NULL, + 0, + &cszBuffer, + sizeof(cszBuffer), + &dwBytesReturned, + NULL)) + { + SecureZeroMemory(m_cszErrorMessage, sizeof(m_cszErrorMessage)); + sprintf_s(m_cszErrorMessage, "%s ReadPhysicalDriveInNTWithZeroRights ERROR DeviceIoControl(), IOCTL_DISK_GET_DRIVE_GEOMETRY_EX) returned 0", cszDriveName); + } + else + { + DISK_GEOMETRY_EX *geom = (DISK_GEOMETRY_EX *)&cszBuffer; + int iFixed = (geom->Geometry.MediaType == FixedMedia); + __int64 i64Size = geom->DiskSize.QuadPart; + } + } + else + { + DWORD dwErr = GetLastError(); + SecureZeroMemory(m_cszErrorMessage, sizeof(m_cszErrorMessage)); + sprintf_s(m_cszErrorMessage, "DeviceIOControl IOCTL_STORAGE_QUERY_PROPERTY error = %d\n", dwErr); + } + + CloseHandle(hPhysicalDriveIOCTL); + } + } + + return iDone; +} + +BOOL MasterHardDiskSerial::DoIDENTIFY(HANDLE hPhysicalDriveIOCTL, PSENDCMDINPARAMS pSCIP, + PSENDCMDOUTPARAMS pSCOP, BYTE bIDCmd, BYTE bDriveNum, + PDWORD lpcbBytesReturned) +{ + // Set up data structures for IDENTIFY command. + pSCIP->cBufferSize = IDENTIFY_BUFFER_SIZE; + pSCIP->irDriveRegs.bFeaturesReg = 0; + pSCIP->irDriveRegs.bSectorCountReg = 1; + //pSCIP -> irDriveRegs.bSectorNumberReg = 1; + pSCIP->irDriveRegs.bCylLowReg = 0; + pSCIP->irDriveRegs.bCylHighReg = 0; + + // Compute the iDrive number. + pSCIP->irDriveRegs.bDriveHeadReg = 0xA0 | ((bDriveNum & 1) << 4); + + // The command can either be IDE identify or ATAPI identify. + pSCIP->irDriveRegs.bCommandReg = bIDCmd; + pSCIP->bDriveNumber = bDriveNum; + pSCIP->cBufferSize = IDENTIFY_BUFFER_SIZE; + + return (DeviceIoControl(hPhysicalDriveIOCTL, DFP_RECEIVE_DRIVE_DATA, + (LPVOID)pSCIP, + sizeof(SENDCMDINPARAMS) - 1, + (LPVOID)pSCOP, + sizeof(SENDCMDOUTPARAMS) + IDENTIFY_BUFFER_SIZE - 1, + lpcbBytesReturned, NULL)); +} + +int MasterHardDiskSerial::ReadIdeDriveAsScsiDriveInNT(void) +{ + int iDone = FALSE; + int iController = 0; + + for (iController = 0; iController < 2; iController++) + { + HANDLE hScsiDriveIOCTL = 0; + char cszDriveName[256]; + + // Try to get a handle to PhysicalDrive IOCTL, report failure + // and exit if can't. + sprintf_s(cszDriveName, "\\\\.\\Scsi%d:", iController); + + // Windows NT, Windows 2000, any rights should do + hScsiDriveIOCTL = CreateFileA(cszDriveName, + GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, 0, NULL); + + if (hScsiDriveIOCTL != INVALID_HANDLE_VALUE) + { + int iDrive = 0; + + for (iDrive = 0; iDrive < 2; iDrive++) + { + char cszBuffer[sizeof(SRB_IO_CONTROL) + SENDIDLENGTH]; + SRB_IO_CONTROL *cP = (SRB_IO_CONTROL *)cszBuffer; + SENDCMDINPARAMS *pin = + (SENDCMDINPARAMS *)(cszBuffer + sizeof(SRB_IO_CONTROL)); + DWORD dwDummy; + + memset(cszBuffer, 0, sizeof(cszBuffer)); + cP->HeaderLength = sizeof(SRB_IO_CONTROL); + cP->Timeout = 10000; + cP->Length = SENDIDLENGTH; + cP->ControlCode = IOCTL_SCSI_MINIPORT_IDENTIFY; + strncpy((char *)cP->Signature, "SCSIDISK", 8); + + pin->irDriveRegs.bCommandReg = IDE_ATA_IDENTIFY; + pin->bDriveNumber = iDrive; + + if (DeviceIoControl(hScsiDriveIOCTL, IOCTL_SCSI_MINIPORT, + cszBuffer, + sizeof(SRB_IO_CONTROL) + + sizeof(SENDCMDINPARAMS) - 1, + cszBuffer, + sizeof(SRB_IO_CONTROL) + SENDIDLENGTH, + &dwDummy, NULL)) + { + SENDCMDOUTPARAMS *pOut = + (SENDCMDOUTPARAMS *)(cszBuffer + sizeof(SRB_IO_CONTROL)); + IDSECTOR *pId = (IDSECTOR *)(pOut->bBuffer); + if (pId->sModelNumber[0]) + { + DWORD dwDiskData[256]; + int iIjk = 0; + USHORT *punIdSector = (USHORT *)pId; + + for (iIjk = 0; iIjk < 256; iIjk++) + dwDiskData[iIjk] = punIdSector[iIjk]; + + PrintIdeInfo(iController * 2 + iDrive, dwDiskData); + + iDone = TRUE; + } + } + } + CloseHandle(hScsiDriveIOCTL); + } + } + + return iDone; +} + +void MasterHardDiskSerial::PrintIdeInfo(int iDrive, DWORD dwDiskData[256]) +{ + char cszSerialNumber[1024]; + char cszModelNumber[1024]; + char cszRevisionNumber[1024]; + char bufferSize[32]; + + __int64 i64Sectors = 0; + __int64 i64Byte = 0; + + // copy the hard iDrive serial number to the cszBuffer + ConvertToString(dwDiskData, 10, 19, cszSerialNumber); + ConvertToString(dwDiskData, 27, 46, cszModelNumber); + ConvertToString(dwDiskData, 23, 26, cszRevisionNumber); + sprintf_s(bufferSize, 32, "%u", dwDiskData[21] * 512); + + if (0 == m_cszHardDriveSerialNumber[0] && + // serial number must be alphanumeric + // (but there can be leading spaces on IBM drives) + (isalnum(cszSerialNumber[0]) || isalnum(cszSerialNumber[19]))) + { + strcpy_s(m_cszHardDriveSerialNumber, 1024, cszSerialNumber); + strcpy_s(m_cszHardDriveModelNumber, 1024, cszModelNumber); + } +} + +long MasterHardDiskSerial::getHardDriveComputerID() +{ + int iDone = FALSE; + // char string [1024]; + __int64 i64Id = 0; + OSVERSIONINFO version; + + strcpy_s(m_cszHardDriveSerialNumber, 1024, ""); + + memset(&version, 0, sizeof(version)); + version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&version); + if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) + { + // this works under WinNT4 or Win2K if you have admin rights + iDone = ReadPhysicalDriveInNTWithAdminRights(); + + // this should work in WinNT or Win2K if previous did not work + // this is kind of a backdoor via the SCSI mini port driver into + // the IDE drives + if (!iDone) + iDone = ReadIdeDriveAsScsiDriveInNT(); + + // this works under WinNT4 or Win2K or WinXP if you have any rights + if (!iDone) + iDone = ReadPhysicalDriveInNTWithZeroRights(); + + // this works under WinNT4 or Win2K or WinXP or Windows Server 2003 or Vista if you have any rights + if (!iDone) + iDone = ReadPhysicalDriveInNTUsingSmart(); + } + + if (m_cszHardDriveSerialNumber[0] > 0) + { + char *cP = m_cszHardDriveSerialNumber; + + // ignore first 5 characters from western digital hard drives if + // the first four characters are WD-W + if (!strncmp(m_cszHardDriveSerialNumber, "WD-W", 4)) + cP += 5; + for (; cP && *cP; cP++) + { + if ('-' == *cP) + continue; + i64Id *= 10; + switch (*cP) + { + case '0': + i64Id += 0; + break; + case '1': + i64Id += 1; + break; + case '2': + i64Id += 2; + break; + case '3': + i64Id += 3; + break; + case '4': + i64Id += 4; + break; + case '5': + i64Id += 5; + break; + case '6': + i64Id += 6; + break; + case '7': + i64Id += 7; + break; + case '8': + i64Id += 8; + break; + case '9': + i64Id += 9; + break; + case 'a': + case 'A': + i64Id += 10; + break; + case 'b': + case 'B': + i64Id += 11; + break; + case 'c': + case 'C': + i64Id += 12; + break; + case 'd': + case 'D': + i64Id += 13; + break; + case 'e': + case 'E': + i64Id += 14; + break; + case 'f': + case 'F': + i64Id += 15; + break; + case 'g': + case 'G': + i64Id += 16; + break; + case 'h': + case 'H': + i64Id += 17; + break; + case 'i': + case 'I': + i64Id += 18; + break; + case 'j': + case 'J': + i64Id += 19; + break; + case 'k': + case 'K': + i64Id += 20; + break; + case 'l': + case 'L': + i64Id += 21; + break; + case 'm': + case 'M': + i64Id += 22; + break; + case 'n': + case 'N': + i64Id += 23; + break; + case 'o': + case 'O': + i64Id += 24; + break; + case 'p': + case 'P': + i64Id += 25; + break; + case 'q': + case 'Q': + i64Id += 26; + break; + case 'r': + case 'R': + i64Id += 27; + break; + case 's': + case 'S': + i64Id += 28; + break; + case 't': + case 'T': + i64Id += 29; + break; + case 'u': + case 'U': + i64Id += 30; + break; + case 'v': + case 'V': + i64Id += 31; + break; + case 'w': + case 'W': + i64Id += 32; + break; + case 'x': + case 'X': + i64Id += 33; + break; + case 'y': + case 'Y': + i64Id += 34; + break; + case 'z': + case 'Z': + i64Id += 35; + break; + } + } + } + + i64Id %= 100000000; + if (strstr(m_cszHardDriveModelNumber, "IBM-")) + i64Id += 300000000; + else if (strstr(m_cszHardDriveModelNumber, "MAXTOR") || + strstr(m_cszHardDriveModelNumber, "Maxtor")) + i64Id += 400000000; + else if (strstr(m_cszHardDriveModelNumber, "WDC ")) + i64Id += 500000000; + else + i64Id += 600000000; + + return (long)i64Id; +} + +//int MasterHardDiskSerial::GetSerialNo(std::vector &serialNumber) +int MasterHardDiskSerial::GetSerialNo(char *SerialNumber) +{ + getHardDriveComputerID(); + size_t numberLength = strlen(m_cszHardDriveSerialNumber); + if (numberLength == 0) + return -1; + //serialNumber.resize(numberLength); + //std::cout << "size " << serialNumber.size() << std::endl; + //memcpy(&serialNumber.front(), m_cszHardDriveSerialNumber, serialNumber.size()); //m_cszHardDriveSerialNumber; + memcpy(SerialNumber, m_cszHardDriveSerialNumber, numberLength); + return 0; +} + +char *MasterHardDiskSerial::ConvertToString(DWORD dwDiskData[256], + int iFirstIndex, + int iLastIndex, + char *pcszBuf) +{ + int iIndex = 0; + int iPosition = 0; + + // each integer has two characters stored in it backwards + + // Removes the spaces from the serial no + for (iIndex = iFirstIndex; iIndex <= iLastIndex; iIndex++) + { + // get high byte for 1st character + char ctemp = (char)(dwDiskData[iIndex] / 256); + char cszmyspace[] = " "; + if (!(ctemp == *cszmyspace)) + { + pcszBuf[iPosition++] = ctemp; + } + // get low byte for 2nd character + char ctemp1 = (char)(dwDiskData[iIndex] % 256); + if (!(ctemp1 == *cszmyspace)) + { + pcszBuf[iPosition++] = ctemp1; + } + } + + // end the string + pcszBuf[iPosition] = '\0'; + + // cut off the trailing blanks + for (iIndex = iPosition - 1; iIndex > 0 && isspace(pcszBuf[iIndex]); iIndex--) + pcszBuf[iIndex] = '\0'; + + return pcszBuf; +} + +int MasterHardDiskSerial::GetErrorMessage(TCHAR *tszErrorMessage) +{ + if (strlen(m_cszErrorMessage) != 0) + { + mbstowcs((wchar_t *)tszErrorMessage, m_cszErrorMessage, sizeof(m_cszErrorMessage)); + return 0; + } + else + return -1; +} + +MasterHardDiskSerial::MasterHardDiskSerial() +{ + SecureZeroMemory(m_cszErrorMessage, sizeof(m_cszErrorMessage)); + SecureZeroMemory(m_cszHardDriveModelNumber, sizeof(m_cszHardDriveModelNumber)); + SecureZeroMemory(m_cszHardDriveSerialNumber, sizeof(m_cszHardDriveSerialNumber)); +} + +MasterHardDiskSerial::~MasterHardDiskSerial() +{ +} + diff --git a/Src/CH91PayloadSoftware/MasterHardDiskSerial.h b/Src/CH91PayloadSoftware/MasterHardDiskSerial.h new file mode 100644 index 0000000..1bb3a1e --- /dev/null +++ b/Src/CH91PayloadSoftware/MasterHardDiskSerial.h @@ -0,0 +1,258 @@ +#ifndef _HDD_SERIAL_INFO_H_ +#define _HDD_SERIAL_INFO_H_ + +#include +#include +#include +#include +#include +#include + +#pragma pack(1) + +#define IDENTIFY_BUFFER_SIZE 512 + +// IOCTL commands +#define DFP_GET_VERSION 0x00074080 +#define DFP_SEND_DRIVE_COMMAND 0x0007c084 +#define DFP_RECEIVE_DRIVE_DATA 0x0007c088 + +#define FILE_DEVICE_SCSI 0x0000001b +#define IOCTL_SCSI_MINIPORT_IDENTIFY ((FILE_DEVICE_SCSI << 16) + 0x0501) +#define IOCTL_SCSI_MINIPORT 0x0004D008 // see NTDDSCSI.H for definition + +#define SMART_GET_VERSION CTL_CODE(IOCTL_DISK_BASE, 0x0020, METHOD_BUFFERED, FILE_READ_ACCESS) +#define SMART_SEND_DRIVE_COMMAND CTL_CODE(IOCTL_DISK_BASE, 0x0021, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) +#define SMART_RCV_DRIVE_DATA CTL_CODE(IOCTL_DISK_BASE, 0x0022, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) + +// GETVERSIONOUTPARAMS contains the data returned from the +// Get Driver Version function. +typedef struct _GETVERSIONOUTPARAMS +{ + BYTE bVersion; // Binary driver version. + BYTE bRevision; // Binary driver revision. + BYTE bReserved; // Not used. + BYTE bIDEDeviceMap; // Bit map of IDE devices. + DWORD fCapabilities; // Bit mask of driver capabilities. + DWORD dwReserved[4]; // For future use. +} GETVERSIONOUTPARAMS, *PGETVERSIONOUTPARAMS, *LPGETVERSIONOUTPARAMS; + +// Bits returned in the fCapabilities member of GETVERSIONOUTPARAMS +#define CAP_IDE_ID_FUNCTION 1 // ATA ID command supported +#define CAP_IDE_ATAPI_ID 2 // ATAPI ID command supported +#define CAP_IDE_EXECUTE_SMART_FUNCTION 4 // SMART commannds supported + +// Valid values for the bCommandReg member of IDEREGS. +#define IDE_ATAPI_IDENTIFY 0xA1 // Returns ID sector for ATAPI. +#define IDE_ATA_IDENTIFY 0xEC // Returns ID sector for ATA. + +// The following struct defines the interesting part of the IDENTIFY +// buffer: +typedef struct _IDSECTOR +{ + USHORT wGenConfig; + USHORT wNumCyls; + USHORT wReserved; + USHORT wNumHeads; + USHORT wBytesPerTrack; + USHORT wBytesPerSector; + USHORT wSectorsPerTrack; + USHORT wVendorUnique[3]; + CHAR sSerialNumber[20]; + USHORT wBufferType; + USHORT wBufferSize; + USHORT wECCSize; + CHAR sFirmwareRev[8]; + CHAR sModelNumber[40]; + USHORT wMoreVendorUnique; + USHORT wDoubleWordIO; + USHORT wCapabilities; + USHORT wReserved1; + USHORT wPIOTiming; + USHORT wDMATiming; + USHORT wBS; + USHORT wNumCurrentCyls; + USHORT wNumCurrentHeads; + USHORT wNumCurrentSectorsPerTrack; + ULONG ulCurrentSectorCapacity; + USHORT wMultSectorStuff; + ULONG ulTotalAddressableSectors; + USHORT wSingleWordDMA; + USHORT wMultiWordDMA; + BYTE bReserved[128]; +} IDSECTOR, *PIDSECTOR; + +typedef struct _SRB_IO_CONTROL +{ + ULONG HeaderLength; + UCHAR Signature[8]; + ULONG Timeout; + ULONG ControlCode; + ULONG ReturnCode; + ULONG Length; +} SRB_IO_CONTROL, *PSRB_IO_CONTROL; + +// Max number of drives assuming primary/secondary, master/slave topology +// Modified to read only the master serial +#define MAX_IDE_DRIVES 1 + +// +// IDENTIFY data (from ATAPI driver source) +// + +#pragma pack(1) + +typedef struct _IDENTIFY_DATA +{ + USHORT GeneralConfiguration; // 00 00 + USHORT NumberOfCylinders; // 02 1 + USHORT Reserved1; // 04 2 + USHORT NumberOfHeads; // 06 3 + USHORT UnformattedBytesPerTrack; // 08 4 + USHORT UnformattedBytesPerSector; // 0A 5 + USHORT SectorsPerTrack; // 0C 6 + USHORT VendorUnique1[3]; // 0E 7-9 + USHORT SerialNumber[10]; // 14 10-19 + USHORT BufferType; // 28 20 + USHORT BufferSectorSize; // 2A 21 + USHORT NumberOfEccBytes; // 2C 22 + USHORT FirmwareRevision[4]; // 2E 23-26 + USHORT ModelNumber[20]; // 36 27-46 + UCHAR MaximumBlockTransfer; // 5E 47 + UCHAR VendorUnique2; // 5F + USHORT DoubleWordIo; // 60 48 + USHORT Capabilities; // 62 49 + USHORT Reserved2; // 64 50 + UCHAR VendorUnique3; // 66 51 + UCHAR PioCycleTimingMode; // 67 + UCHAR VendorUnique4; // 68 52 + UCHAR DmaCycleTimingMode; // 69 + USHORT TranslationFieldsValid : 1; // 6A 53 + USHORT Reserved3 : 15; + USHORT NumberOfCurrentCylinders; // 6C 54 + USHORT NumberOfCurrentHeads; // 6E 55 + USHORT CurrentSectorsPerTrack; // 70 56 + ULONG CurrentSectorCapacity; // 72 57-58 + USHORT CurrentMultiSectorSetting; // 59 + ULONG UserAddressableSectors; // 60-61 + USHORT SingleWordDMASupport : 8; // 62 + USHORT SingleWordDMAActive : 8; + USHORT MultiWordDMASupport : 8; // 63 + USHORT MultiWordDMAActive : 8; + USHORT AdvancedPIOModes : 8; // 64 + USHORT Reserved4 : 8; + USHORT MinimumMWXferCycleTime; // 65 + USHORT RecommendedMWXferCycleTime; // 66 + USHORT MinimumPIOCycleTime; // 67 + USHORT MinimumPIOCycleTimeIORDY; // 68 + USHORT Reserved5[2]; // 69-70 + USHORT ReleaseTimeOverlapped; // 71 + USHORT ReleaseTimeServiceCommand; // 72 + USHORT MajorRevision; // 73 + USHORT MinorRevision; // 74 + USHORT Reserved6[50]; // 75-126 + USHORT SpecialFunctionsEnabled; // 127 + USHORT Reserved7[128]; // 128-255 +} IDENTIFY_DATA, *PIDENTIFY_DATA; + +#pragma pack() + +// Required to ensure correct PhysicalDrive IOCTL structure setup +#pragma pack(4) + +// +// IOCTL_STORAGE_QUERY_PROPERTY +// +// Input Buffer: +// a STORAGE_PROPERTY_QUERY structure which describes what type of query +// is being done, what property is being queried for, and any additional +// parameters which a particular property query requires. +// +// Output Buffer: +// Contains a buffer to place the results of the query into. Since all +// property descriptors can be cast into a STORAGE_DESCRIPTOR_HEADER, +// the IOCTL can be called once with a small buffer then again using +// a buffer as large as the header reports is necessary. +// + +// +// Types of queries +// + +// +// define some initial property id's +// + +// +// Query structure - additional parameters for specific queries can follow +// the header +// + +#define IOCTL_STORAGE_QUERY_PROPERTY CTL_CODE(IOCTL_STORAGE_BASE, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS) + +// +// Device property descriptor - this is really just a rehash of the inquiry +// data retrieved from a scsi device +// +// This may only be retrieved from a target device. Sending this to the bus +// will result in an error +// + +#pragma pack(4) + +// (* Output Bbuffer for the VxD (rt_IdeDinfo record) *) +typedef struct _rt_IdeDInfo_ +{ + BYTE IDEExists[4]; + BYTE DiskExists[8]; + WORD DisksRawInfo[8 * 256]; +} rt_IdeDInfo, *pt_IdeDInfo; + +// (* IdeDinfo "data fields" *) +typedef struct _rt_DiskInfo_ +{ + BOOL DiskExists; + BOOL ATAdevice; + BOOL RemovableDevice; + WORD TotLogCyl; + WORD TotLogHeads; + WORD TotLogSPT; + char SerialNumber[20]; + char FirmwareRevision[8]; + char ModelNumber[40]; + WORD CurLogCyl; + WORD CurLogHeads; + WORD CurLogSPT; +} rt_DiskInfo; + +#define SENDIDLENGTH sizeof(SENDCMDOUTPARAMS) + IDENTIFY_BUFFER_SIZE +#define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX CTL_CODE(IOCTL_DISK_BASE, 0x0028, METHOD_BUFFERED, FILE_ANY_ACCESS) + +class MasterHardDiskSerial +{ +public: + MasterHardDiskSerial(); + ~MasterHardDiskSerial(); + //int GetSerialNo(std::vector &serialNumber); + int GetSerialNo(char *SerialNumber); + int GetErrorMessage(TCHAR *_ptszErrorMessage = NULL); + +private: + char *ConvertToString(DWORD dwDiskdata[256], int iFirstIndex, int iLastIndex, char *pcBuf = NULL); + BOOL DoIDENTIFY(HANDLE, PSENDCMDINPARAMS, PSENDCMDOUTPARAMS, BYTE, BYTE, PDWORD); + int ReadPhysicalDriveInNTWithAdminRights(void); + int ReadPhysicalDriveInNTUsingSmart(void); + int ReadPhysicalDriveInNTWithZeroRights(void); + int ReadIdeDriveAsScsiDriveInNT(void); + char *flipAndCodeBytes(int iPos, int iFlip, const char *pcStr = NULL, char *pcBuf = NULL); + void PrintIdeInfo(int iDrive, DWORD dwDiskdata[256]); + long getHardDriveComputerID(); + +private: + char m_cszHardDriveSerialNumber[1024]; + char m_cszHardDriveModelNumber[1024]; + char m_cszErrorMessage[256]; + BYTE byIdOutCmd[sizeof(SENDCMDOUTPARAMS) + IDENTIFY_BUFFER_SIZE - 1]; +}; + +#endif // _HDD_SERIAL_INFO_H_ \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/MemDC_Redefine.h b/Src/CH91PayloadSoftware/MemDC_Redefine.h new file mode 100644 index 0000000..c5a88df --- /dev/null +++ b/Src/CH91PayloadSoftware/MemDC_Redefine.h @@ -0,0 +1,71 @@ + +// MemDC.h : header file + +#include "StdAfx.h" + +#pragma once + +class CMemDC_Redefine : public CDC +{ +public: + + //构造内存设备场景 + CMemDC_Redefine(CDC* pDC) : CDC() + { + ASSERT(pDC != NULL); + + m_pDC = pDC; + m_pOldBitmap = NULL; + m_bMemDC = !pDC->IsPrinting(); + + if (m_bMemDC) + { + pDC->GetClipBox(&m_rect); + CreateCompatibleDC(pDC); + m_bitmap.CreateCompatibleBitmap(pDC, m_rect.Width(), m_rect.Height()); + m_pOldBitmap = SelectObject(&m_bitmap); + SetWindowOrg(m_rect.left, m_rect.top); + } + else + { + m_bPrinting = pDC->m_bPrinting; + m_hDC = pDC->m_hDC; + m_hAttribDC = pDC->m_hAttribDC; + } + } + + //析构 + ~CMemDC_Redefine() + { + if (m_bMemDC) + { + m_pDC->BitBlt(m_rect.left, m_rect.top, m_rect.Width(), m_rect.Height(), + this, m_rect.left, m_rect.top, SRCCOPY); + + SelectObject(m_pOldBitmap); + } + else + { + m_hDC = m_hAttribDC = NULL; + } + } + + CMemDC_Redefine * operator->() + { + return this; + } + + operator CMemDC_Redefine *() + { + return this; + } + +private: + CBitmap m_bitmap; + CBitmap* m_pOldBitmap; + CDC* m_pDC; + CRect m_rect; + BOOL m_bMemDC; +}; + + diff --git a/Src/CH91PayloadSoftware/MulticastSocket.cpp b/Src/CH91PayloadSoftware/MulticastSocket.cpp new file mode 100644 index 0000000..4dc4b5f --- /dev/null +++ b/Src/CH91PayloadSoftware/MulticastSocket.cpp @@ -0,0 +1,188 @@ +// MulticastSocket.cpp : implementation file +// + +#include "stdafx.h" +#include "MulticastSocket.h" +#include "Mmc.h" +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CMulticastSocket + +CMulticastSocket::CMulticastSocket() +{ + m_RevData = NULL; + m_nSendersPort = 0; + m_nLocalPort = 0; + bForceNoLoopback = FALSE; + + if (!AfxSocketInit()) + { + //MessageBox(NULL,_T("Failed to Initialize Sockets"),"图像显示", MB_OK | MB_ICONSTOP); + MessageBoxEx(NULL,"Failed to Initialize Sockets","ImageShow",MB_OK|MB_ICONSTOP,MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US)); + } +} + +CMulticastSocket::~CMulticastSocket() +{ +} + + +// Do not edit the following lines, which are needed by ClassWizard. +#if 0 +BEGIN_MESSAGE_MAP(CMulticastSocket, CAsyncSocket) + //{{AFX_MSG_MAP(CMulticastSocket) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() +#endif // 0 + +///////////////////////////////////////////////////////////////////////////// +// CMulticastSocket member functions + +BOOL CMulticastSocket::CreateReceivingSocket(LPCTSTR strGroupIP, UINT nGroupPort) +{ + /* Create socket for receiving packets from multicast group */ + if(!Create(nGroupPort, SOCK_DGRAM, FD_READ)) + { + return FALSE; + } + + BOOL bMultipleApps = TRUE; /* allow reuse of local port if needed */ + SetSockOpt(SO_REUSEADDR, (void*)&bMultipleApps, sizeof(BOOL), SOL_SOCKET); + + /* Fill m_saHostGroup_in for sending datagrams */ + memset(&m_saHostGroup, 0, sizeof(m_saHostGroup)); + m_saHostGroup.sin_family = AF_INET; + m_saHostGroup.sin_addr.s_addr = inet_addr(strGroupIP); + m_saHostGroup.sin_port = htons((USHORT)nGroupPort); + + /* Join the multicast group */ + m_mrMReq.imr_multiaddr.s_addr = inet_addr(strGroupIP); /* group addr */ + m_mrMReq.imr_interface.s_addr = htons(INADDR_ANY); /* use default */ + + if(setsockopt(m_hSocket, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char FAR *)&m_mrMReq, sizeof(m_mrMReq)) < 0) + { + int nn = WSAGetLastError(); + return FALSE; + } + + BOOL bOptVal = 1; + if (setsockopt(m_hSocket, IPPROTO_UDP, 1, (char*)&bOptVal, sizeof(bOptVal)) <0) + { + printf("Set UDP_NOCHECKSUM: TRUE\n"); + return FALSE; + } + return TRUE; +} + +BOOL CMulticastSocket::CreateSendingSocket(UINT nTTL, BOOL bLoopBack) +{ + if(!m_SendSocket.Create(0, SOCK_DGRAM, 0)) // Create an unconnected UDP socket + return FALSE; + + if(!SetTTL(nTTL)) // Set Time to Live as specified by user + MessageBoxEx(NULL,"Warning! Error Setting TTL","ImageShow",NULL,MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US)); + + SetLoopBack(bLoopBack); // Enable/Disable Loopback + + return TRUE; +} + +BOOL CMulticastSocket::SetTTL(UINT nTTL) +{ + /* Set Time to Live to parameter TTL */ + if(m_SendSocket.SetSockOpt(IP_MULTICAST_TTL, &nTTL, sizeof(int), IPPROTO_IP) == 0) + return FALSE; /* Error Setting TTL */ + else + return TRUE; /* else TTL set successfully */ +} + +void CMulticastSocket::SetLoopBack(BOOL bLoop) +{ + /* Set LOOPBACK option to TRUE OR FALSE according to IsLoop parameter */ + int nLoopBack = (int)bLoop; + if(m_SendSocket.SetSockOpt(IP_MULTICAST_LOOP, &nLoopBack, sizeof(int), IPPROTO_IP) == 0) + { + if(!bLoop) /* if required to stop loopback */ + { + bForceNoLoopback = TRUE; /* Internally making a note that loopback has to be disabled forcefilly */ + + // Get IP/Port for send socket in order to disable loopback forcefully */ + char localHost[255]; + gethostname(localHost, 255); + struct hostent *host = gethostbyname(localHost); /* Get local host IP */ + m_strLocalIP = inet_ntoa (*(struct in_addr*)*host->h_addr_list); + CString Dummy; // Dummy string to be passed to the GetSockName function + m_SendSocket.GetSockName(Dummy, m_nLocalPort); /* Get Port Number for Sending Port */ + } + } +} + + +void CMulticastSocket::OnReceive(int nErrorCode) +{ + int nError = ReceiveFrom (m_strBuffer, 10240, m_strSendersIP, m_nSendersPort); + + if(nError == SOCKET_ERROR) + { + MessageBoxEx(NULL,"Error receiving data from the host group","ImageShow",NULL,MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US)); + } + else + { + if (!bForceNoLoopback || (bForceNoLoopback && !(m_strSendersIP == m_strLocalIP && m_nSendersPort == m_nLocalPort))) + { + // 1. If loopbackback is not to be forced then interface handles the loopback itself + // 2. If you have to loopback and SOCKOPT LOOPBACK fails, no problem, interfaces loopback by default + // 3. If you have to stop loopback and SOCKOPT LOOPBACK fails, ignore messages coming from your own sending socket + + if ( m_RevData != NULL) + { + m_RevData( m_strBuffer, nError); + } + } + } + + CAsyncSocket::OnReceive(nErrorCode); +} + +BOOL CMulticastSocket::LeaveGroup() +{ + if(setsockopt (m_hSocket, IPPROTO_IP, IP_DROP_MEMBERSHIP, (char FAR *)&m_mrMReq, sizeof(m_mrMReq)) < 0) + return FALSE; + + m_SendSocket.Close(); // Close sending socket + Close(); + + return TRUE; +} + +BOOL CMulticastSocket::SendTo(const void* strMessage, int nSize) +{ + if(m_SendSocket.SendTo(strMessage, nSize, (SOCKADDR*)&m_saHostGroup, sizeof(SOCKADDR), 0) == SOCKET_ERROR) + { + return FALSE; + } + else + { + return TRUE; + } +} + +BOOL CMulticastSocket::JoinGroup(CString GroupIP, UINT nGroupPort, UINT nTTL, BOOL bLoopback) +{ + if(!CreateReceivingSocket(GroupIP, nGroupPort)) /* Create Socket for receiving and join the host group */ + { + return FALSE; + } + + if(!CreateSendingSocket(nTTL, bLoopback)) /* Create Socket for sending */ + { + return FALSE; + } + + return TRUE; +} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/MulticastSocket.h b/Src/CH91PayloadSoftware/MulticastSocket.h new file mode 100644 index 0000000..ec65427 --- /dev/null +++ b/Src/CH91PayloadSoftware/MulticastSocket.h @@ -0,0 +1,142 @@ + +/*--------------------------------------------------------------------------- +概述:UDP组播读写操作类,用于收发数据。 + +使用环境:windows操作系统 + VS2008 VS2010 VS2013 + +应用示例: + + 1. 定义对象 + CMulticastSocket m_multiSocket; + + 2. 初始化 + 根据需要:执行函数2 或 3 或4 + + 3. 根据需要设置接收数据回调函数 + m_multiSocket.SetCallBack(); + + + 4. 通过组播发送数据 + m_Serial.SendTo(buffer,10); // 举例 + + 5. 离开组播,释放资源 + m_Serial.LeaveGroup(); + + 其它接口函数根据实际需求进行调用。 + + +问题及解决情况记录: + 问题1: + 解决情况: + + 问题2: + 解决情况: + + ...... + +修改记录: + 版本 日期 作者 备注 + V1.0 2016/12/28 王家星 在原有代码整理与简化,添加头文件注释 +----------------------------------------------------------------------------*/ + +#if !defined(AFX_MULTICASTSOCKET_H__269E2C7F_2037_11D3_8EF3_0000C0FD25F8__INCLUDED_) +#define AFX_MULTICASTSOCKET_H__269E2C7F_2037_11D3_8EF3_0000C0FD25F8__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +#include + +// 定义数据接收回调函数格式 +typedef void ( CALLBACK *RevNetDataCALLBACK )(const void* buffer, int length); + +class CMulticastSocket : public CAsyncSocket +{ + // Operations +public: + CMulticastSocket(); + virtual ~CMulticastSocket(); + +public: + /* 【1】 + 功能: 设置对网口UDP组播读入数据进行处理的回调函数 + 输入: + DataCallBack,串口回调函数地址 + 输出: + 返回值:无 + */ + void SetCallBack( RevNetDataCALLBACK DataCallBack) + { + m_RevData = DataCallBack; + } + + + /* 【2】 + 功能: 创建接收数据Socket + 输入: + 1. strGroupIP,组播IP + 2. nGroupPort,组播端口号 + 输出: + 返回值:创建成功返回True, 否则返回False + */ + BOOL CreateReceivingSocket(LPCTSTR strGroupIP, UINT nGroupPort); + + + /* 【3】 + 功能: 创建发送数据Socket + 输入: + 1. nTTL,(Time to Live)即数据最多可经过几个网关 + 2. bLoopBack,是否接收自己发送的数据 + 输出: + 返回值:创建成功返回True, 否则返回False + */ + BOOL CreateSendingSocket(UINT nTTL = 5, BOOL bLoopBack = FALSE); + + + /* 【4】 + 功能: 发送数据 + 输入: + 1. strMessage,指针 + 2. nSize,长度 + 输出: + 返回值:发送成功返回True, 否则返回False + */ + BOOL SendTo(const void* strMessage, int nSize); + + + /* 【5】 + 功能: 功能2 + 功能3 + */ + BOOL JoinGroup(CString GroupIP, UINT nGroupPort, UINT nTTL = 5, BOOL bLoopback = FALSE); + + + /* 【6】 + 功能: 退出组播 + 输入: + 输出: + 返回值:退出成功返回True, 否则返回False + */ + BOOL LeaveGroup(); + + +private: + RevNetDataCALLBACK m_RevData; + char m_strBuffer[10240]; // Receiving buffer for the packet that has arrived + SOCKADDR_IN m_saHostGroup; // SOCKADDR structure to hold IP/Port of the Host group to send data to it + ip_mreq m_mrMReq; // Contains IP and interface of the host group + UINT m_nSendersPort; // Holds Port No. of the socket from which last packet was received + CString m_strSendersIP; // Hold IP of the socket from which the last packet was received + UINT m_nLocalPort; // Ephemeral port number of the sending port + CString m_strLocalIP; // IP Address of the local host or your machine + BOOL bForceNoLoopback; // If interface does not support lopback and the service is required, the bool is set to true + CAsyncSocket m_SendSocket; // Socket for sending data to the host group +private: + void SetLoopBack(BOOL); + BOOL SetTTL(UINT nTTL); +protected: + virtual void OnReceive(int nErrorCode); +}; + +#endif // !defined(AFX_MULTICASTSOCKET_H__269E2C7F_2037_11D3_8EF3_0000C0FD25F8__INCLUDED_) diff --git a/Src/CH91PayloadSoftware/MulticastSocketReceiveDlg.cpp b/Src/CH91PayloadSoftware/MulticastSocketReceiveDlg.cpp new file mode 100644 index 0000000..e651d99 --- /dev/null +++ b/Src/CH91PayloadSoftware/MulticastSocketReceiveDlg.cpp @@ -0,0 +1,751 @@ +// MulticastSocketReceiveDlg.cpp : 实现文件 +// + +#include "stdafx.h" +#include "CH91PayloadSoftware.h" +#include "CH91PayloadSoftwareDlg.h" +#include "afxdialogex.h" +#include "Global.h" +#include "GlobalMessage.h" +#include "GlobalMember.h" +#include "GetElevation.h" +#include "MulticastSocketReceiveDlg.h" +#include +#include + +// CMulticastSocketReceiveDlg 对话框 + +//卫通UDP通信端口接收图像数据回调函数 +void CALLBACK OnReadFromUDPSACKU( const void* rxdata, int lLen, LPVOID Param ) +{ + if ( lLen > 0) + { + // 处理数据 + SocketReceiveFH96Data(rxdata, lLen); + CTime t = GetCurrentTime(); + TRACE(_T("%d,%d,%d\n"), lLen,t.GetMinute(), t.GetSecond()); + //SocketReceiveH264VideoData(rxdata, lLen); + } +} + +IMPLEMENT_DYNAMIC(CMulticastSocketReceiveDlg, CDialogEx) + +CMulticastSocketReceiveDlg::CMulticastSocketReceiveDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CMulticastSocketReceiveDlg::IDD, pParent) + , m_iVideoSrc(0) + , mComPortIMP(_T("")) + , mComBaudIMP(_T("")) +{ + //, mStrCDPayLoadIPAddr(_T("0.0.0.0")) + + // WinSoc + m_hThread_GetFH96DataFromNet = NULL; + m_ThreadID_GetFH96DataFromNet = 0; + // 组播IP + str_LocalIP_ReceiveMUDP = _T(""); + str_MulticastSocketIP = "233.0.0.1"; + m_MulticastSocketPortFH96Data = 8080; + str_MulticastSocketInfoReceive = "等待通信连接……\r\n"; + //FJ数据显示初始化 + m_bFJDataShow = FALSE; + //L测控 + m_strLLinkMultiCastIP = ""; + m_nLLinkMulticastPort = 8000; + //卫通组播 + m_strSACMulticastIPAddr = ""; + m_nSACMulticastRemotePort = 8001; + //卫通UDP单播 + m_strSACUDPIPAddr = ""; + m_nSACUDPRemotePort = 2203; + m_nSACUDPLocalPort = 8009; + + m_sysSetComNumber = 0;//窜口数 +} + +CMulticastSocketReceiveDlg::~CMulticastSocketReceiveDlg() +{ +} + +void CMulticastSocketReceiveDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Control(pDX, IDC_IPADDRESS4,m_IPAddress_MultiCastIP);//网络IP + + DDX_Radio(pDX, IDC_RADIO_L, m_iVideoSrc); + + DDX_CBString(pDX, IDC_COMBO_PORT_IMP, mComPortIMP); + DDX_CBString(pDX, IDC_COMBO_BAUD_IMP, mComBaudIMP); + +} + + +BEGIN_MESSAGE_MAP(CMulticastSocketReceiveDlg, CDialogEx) + ON_BN_CLICKED(IDC_BTN_MULTISOCKET_CONNECT, &CMulticastSocketReceiveDlg::OnBnClickedBtnMultisocketConnect) + ON_BN_CLICKED(IDC_BTN_MULTISOCKET_DISCONNECT, &CMulticastSocketReceiveDlg::OnBnClickedBtnMultisocketDisconnect) + ON_MESSAGE(WN_SHOW_CH96_FJDATA, &CMulticastSocketReceiveDlg::ShowCH96FJData) + ON_BN_CLICKED(IDC_CHECK1, &CMulticastSocketReceiveDlg::OnBnClickedCheck1) + + ON_BN_CLICKED(IDC_RADIO_L, &CMulticastSocketReceiveDlg::OnRadioBtnVideoSrcClicked) + ON_BN_CLICKED(IDC_RADIO_SAC1, &CMulticastSocketReceiveDlg::OnRadioBtnVideoSrcClicked) + ON_BN_CLICKED(IDC_RADIO_SAC2, &CMulticastSocketReceiveDlg::OnRadioBtnVideoSrcClicked) + + ON_CBN_SELCHANGE(IDC_COMBO_PORT_IMP, &CMulticastSocketReceiveDlg::OnCbnSelchangePortIMP)//串口号 + ON_CBN_SELCHANGE(IDC_COMBO_BAUD_IMP, &CMulticastSocketReceiveDlg::OnCbnSelchangePortIMP)//波特率 + ON_BN_CLICKED(IDC_BTN_IMP_SERIAL_CONNECT, &CMulticastSocketReceiveDlg::OnBnClickedBtnImpSerialConnect) + ON_BN_CLICKED(IDC_BTN_IMP_SERIAL_DISCONNECT, &CMulticastSocketReceiveDlg::OnBnClickedBtnImpSerialDisconnect) + + ON_BN_CLICKED(IDC_RADIO_DC_13Ins, &CMulticastSocketReceiveDlg::OnBnClickedRadioDc13ins) + ON_BN_CLICKED(IDC_RADIO_DC_WHTJ, &CMulticastSocketReceiveDlg::OnBnClickedRadioDcWhtj) + ON_BN_CLICKED(IDC_RADIO_H264Data, &CMulticastSocketReceiveDlg::OnBnClickedRadioH264data) +END_MESSAGE_MAP() + +BOOL CMulticastSocketReceiveDlg::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + + // 获取窗口句柄 + g_MulticastSocketReceiveDlgHwnd = GetSafeHwnd(); + // 获取主机本地IP并显示 + //CString str_LocalIP_Receive; + GetHostAddress(str_LocalIP_ReceiveMUDP); + GetDlgItem(IDC_EDIT_LOCALIP_RECEIVE)->SetWindowText(str_LocalIP_ReceiveMUDP); + + // 设置界面初始显示内容 + m_IPAddress_MultiCastIP.SetWindowText(str_MulticastSocketIP); + GetDlgItem(IDC_EDIT_MULTISOCKETPORT_RECEIVE)->SetWindowText("8080"); + GetDlgItem(IDC_EDIT_LOCALPORT_RECEIVE)->SetWindowTextA("8082"); + GetDlgItem(IDC_EDIT_MULTICASTSOCKETINFORECEIVE)->SetWindowText(str_MulticastSocketInfoReceive); + + // 设置按钮状态 + GetDlgItem(IDC_BTN_MULTISOCKET_CONNECT)->EnableWindow(TRUE); + + m_strServerPayLoadIPSend = _T("192.168.1.20"); // udp单播转发的服务器IP + + m_nServerSendLocalPort = 60302; + m_nServerSendObjectPort = 13001; // 远端端口 + + //添加串口号到列表框 + AddPortNumberToComboBox(); + //添加波特率到列表框 + AddBaudNumberToComboBox(); + + ((CButton *)GetDlgItem(IDC_RADIO_DC_13Ins))->SetCheck(true); + ((CButton *)GetDlgItem(IDC_RADIO_DC_WHTJ))->SetCheck(false); + ((CButton *)GetDlgItem(IDC_RADIO_H264Data))->SetCheck(false); + + return TRUE; // return TRUE unless you set the focus to a control + // 异常: OCX 属性页应返回 FALSE +} + + +// 连接 +void CMulticastSocketReceiveDlg::OnBnClickedBtnMultisocketConnect() +{ + UpdateData(TRUE); + switch(m_iVideoSrc) + { + case 0: //L测控 任管数据 + { + //更改IP地址和端口号 + m_IPAddress_MultiCastIP.GetWindowText(m_strLLinkMultiCastIP); //L测控组播IP + str_MulticastSocketIP = m_strLLinkMultiCastIP; + CString _str; + GetDlgItem(IDC_EDIT_MULTISOCKETPORT_RECEIVE)->GetWindowText(_str); //从文本框中读取远端端口 + m_nLLinkMulticastPort = _ttoi(_str); + m_MulticastSocketPortFH96Data = m_nLLinkMulticastPort; + // 创建组播接收实例——图像和复接数据 + CreateMulticastSocketFH96Data(); + } + break; + case 1: //卫通UDP单播 任管数据 + { + //更改IP地址和端口号 + m_IPAddress_MultiCastIP.GetWindowTextA(m_strSACUDPIPAddr); //卫通UDP单播远端地址 + CString _str; + GetDlgItem(IDC_EDIT_MULTISOCKETPORT_RECEIVE)->GetWindowTextA(_str); //从文本框中读取远端端口 + m_nSACUDPRemotePort = _ttoi(_str); + GetDlgItem(IDC_EDIT_LOCALPORT_RECEIVE)->GetWindowTextA(_str); //从文本框中读取本地端口 + m_nSACUDPLocalPort = _ttoi(_str); + //创建UDP接收实例——图像和复接数据 + CreateUDPSocketReceiveData(); + } + break; + case 2: //卫通组播 光电吊舱裸流数据 + { + //更改IP地址和端口号 + m_IPAddress_MultiCastIP.GetWindowText(m_strSACMulticastIPAddr); + str_MulticastSocketIP = m_strSACMulticastIPAddr; + CString _str; + GetDlgItem(IDC_EDIT_MULTISOCKETPORT_RECEIVE)->GetWindowText(_str); //从文本框中读取远端端口 + m_nSACMulticastRemotePort = _ttoi(_str); + m_MulticastSocketPortFH96Data = m_nSACMulticastRemotePort; + // 创建组播接收实例——图像裸流H264 + CreateMulticastSocketFH96Data(); + } + break; + default: + break; + } + + // 更改按钮状态 + GetDlgItem(IDC_BTN_MULTISOCKET_CONNECT)->EnableWindow(FALSE); + GetDlgItem(IDC_BTN_MULTISOCKET_DISCONNECT)->EnableWindow(TRUE); + GetDlgItem(IDC_RADIO_L)->EnableWindow(FALSE); + GetDlgItem(IDC_RADIO_SAC1)->EnableWindow(FALSE); + GetDlgItem(IDC_RADIO_SAC2)->EnableWindow(FALSE); + GetDlgItem(IDC_RADIO_DC_13Ins)->EnableWindow(FALSE); + GetDlgItem(IDC_RADIO_DC_WHTJ)->EnableWindow(FALSE); + GetDlgItem(IDC_RADIO_H264Data)->EnableWindow(FALSE); + + //UDP服务器传输 + g_UDPTrans2Server.SetCallBack(NULL, this); + CString strLocalIPAddr = _T("0.0.0.0"); + g_UDPTrans2Server.SetParams(strLocalIPAddr, m_nServerSendLocalPort, m_strServerPayLoadIPSend, m_nServerSendObjectPort); + if (g_UDPTrans2Server.StartListening()) + { + g_udpStarted = true; + CString strPassword = _T("FP-WRJ-98"); + g_UDPTrans2Server.WriteBuffer((BYTE*)strPassword.GetBuffer(), strPassword.GetLength()); + } + else + { + g_udpStarted = false; + } +} + +// 显示CH96FJ数据内容 +LRESULT CMulticastSocketReceiveDlg::ShowCH96FJData(WPARAM wParam, LPARAM lParam) +{ + if (m_bFJDataShow == TRUE) + { + // 显示FJ数据150字节内容 + BYTE _FJData[150]; + WaitForSingleObject(g_hMutex_SaveFJData, INFINITE); + memcpy(_FJData, &g_CH96FJData, 150); + ReleaseMutex(g_hMutex_SaveFJData); + CString _strByte; + _strByte = ""; + CString _strFJDataShow; + _strFJDataShow = ""; + for (int i = 0; i < 150; i++) + { + _strByte.Format("%02X",_FJData[i]); + _strFJDataShow = _strFJDataShow + _strByte + "\t"; + if ( 0 == (i+1)%8 ) + { + _strFJDataShow += "\r\n"; + } + } + GetDlgItem(IDC_EDIT_FJDATASHOW)->SetWindowText(_strFJDataShow); + } + return 0; +} + +// 创建组播连接 +void CMulticastSocketReceiveDlg::CreateMulticastSocketFH96Data() +{ + if (g_socketFH96Data != INVALID_SOCKET) + { + // 关闭套接字 + closesocket(g_socketFH96Data); + g_socketFH96Data = -1; + } + // 创建套接字 + SetUpWinSocketFH96Data(); +} + +// 创建WinSocket套接字 +void CMulticastSocketReceiveDlg::SetUpWinSocketFH96Data() +{ + // 加载套接字库 + WSADATA WSAData; + WSAStartup(WINSOCK_VERSION, &WSAData); + // 创建套接字 + g_socketFH96Data = socket(AF_INET, // 地址族 + SOCK_DGRAM, // socket 类型 + IPPROTO_UDP); // 协议 + + if (g_socketFH96Data == INVALID_SOCKET) + { + CString receiverData = "数据组播接收套接字创建失败!"; + receiverData += "\r\n"; + str_MulticastSocketInfoReceive += receiverData; + + // 显示信息 + ShowMulticastSocketInfoReceive(); + return; + } + int ret = 0; + // 绑定套接字 + sockaddr_in local; + local.sin_family = AF_INET; + local.sin_port = htons(m_MulticastSocketPortFH96Data); + local.sin_addr.s_addr = INADDR_ANY; + ret = ::bind(g_socketFH96Data, (struct sockaddr*)&local, sizeof(local)); + if(ret == SOCKET_ERROR) + { + CString receiverData = "数据组播接收套接字绑定port失败!"; + receiverData += "\r\n"; + str_MulticastSocketInfoReceive += receiverData; + // 显示信息 + ShowMulticastSocketInfoReceive(); + return; + } + + // 设置接收缓冲区大小 + int length = 512000 ; + ret = setsockopt(g_socketFH96Data,SOL_SOCKET,SO_RCVBUF,(const char*)&length, sizeof(int)); + if (ret == SOCKET_ERROR) + { + CString receiverData = "数据组播接收套接字缓冲区设置失败!"; + receiverData += "\r\n"; + str_MulticastSocketInfoReceive += receiverData; + // 显示信息 + ShowMulticastSocketInfoReceive(); + return; + } + + int nNetTimeout = 1000; // 1S 设置接收时限 + ret = setsockopt(g_socketFH96Data,SOL_SOCKET,SO_RCVTIMEO,(const char*)&nNetTimeout, sizeof(int)); + if (ret == SOCKET_ERROR) + { + CString receiverData = "数据组播接收套接字时限设置失败!"; + receiverData += "\r\n"; + str_MulticastSocketInfoReceive += receiverData; + + // 显示信息 + ShowMulticastSocketInfoReceive(); + + return; + } + + struct ip_mreq mcast_addr; + mcast_addr.imr_multiaddr.s_addr = inet_addr(str_MulticastSocketIP); + mcast_addr.imr_interface.s_addr = INADDR_ANY; + ret = setsockopt(g_socketFH96Data, IPPROTO_IP,IP_ADD_MEMBERSHIP, (char*)&mcast_addr, sizeof(mcast_addr)); + if (ret == SOCKET_ERROR) + { + CString receiverData = "数据组播接收套接字绑定IP失败!"; + receiverData += "\r\n"; + str_MulticastSocketInfoReceive += receiverData; + + // 显示信息 + ShowMulticastSocketInfoReceive(); + + return; + } + else + { + CString receiverData = "数据组播接收创建成功!"; + receiverData += "\r\n"; + str_MulticastSocketInfoReceive += receiverData; + // 显示信息 + ShowMulticastSocketInfoReceive(); + switch(m_iVideoSrc) + { + case 0: //L测控组播 + // 创建一个线程并立即执行 + m_hThread_GetFH96DataFromNet = CreateThread(NULL, 0, + (LPTHREAD_START_ROUTINE)GetFH96DataFromNet, + nullptr, // 传递参数 + 0, // 线程创建后会被马上调用 + &m_ThreadID_GetFH96DataFromNet); + break; + case 1: //卫通UDP单播 + break; + case 2: //卫通组播 + // 创建一个线程并立即执行 + m_hThread_GetFH96DataFromNet = CreateThread(NULL, 0, + (LPTHREAD_START_ROUTINE)GetH264VideoDataFromNet, + nullptr, // 传递参数 + 0, // 线程创建后会被马上调用 + &m_ThreadID_GetFH96DataFromNet); + break; + default: + break; + } + } + +} + +void CMulticastSocketReceiveDlg::ShowMulticastSocketInfoReceive() +{ + GetDlgItem(IDC_EDIT_MULTICASTSOCKETINFORECEIVE)->SetWindowText(str_MulticastSocketInfoReceive); + GetDlgItem(IDC_EDIT_MULTICASTSOCKETINFORECEIVE)->SendMessage(WM_VSCROLL,SB_BOTTOM,0); +} + +// 获取主机IP +void CMulticastSocketReceiveDlg::GetHostAddress(CString &strIP) +{ + char HostName[100]; + gethostname(HostName, sizeof(HostName)); // 获取主机名称 + hostent* hn; + hn = gethostbyname(HostName); // 根据主机名称得到本机IP + strIP = inet_ntoa(*(struct in_addr *)hn->h_addr_list[0]); +} + +void CMulticastSocketReceiveDlg::OnBnClickedBtnMultisocketDisconnect() +{ + // 关闭组播 + // 关闭套接字 + if (INVALID_SOCKET != g_socketFH96Data) + { + closesocket(g_socketFH96Data); + g_socketFH96Data = -1; + // 卸载socket库 + WSACleanup(); + } + //关闭卫通UDP单播 + m_nSACUDPSocket.SetCallBack(NULL, nullptr); + m_nSACUDPSocket.StopListening(); + + g_udpStarted = false; + g_UDPTrans2Server.SetCallBack(NULL, nullptr); + g_UDPTrans2Server.StopListening(); + + if (NULL != m_hThread_GetFH96DataFromNet) + { + TerminateThread(m_hThread_GetFH96DataFromNet, 0); + m_hThread_GetFH96DataFromNet = NULL; + m_ThreadID_GetFH96DataFromNet = 0; + } + // 更新显示内容 + str_MulticastSocketInfoReceive = str_MulticastSocketInfoReceive + "数据接收已断开!\r\n" + "等待通信连接……\r\n"; + ShowMulticastSocketInfo(); + + // 更改按钮状态 + // 设置按钮状态 + GetDlgItem(IDC_BTN_MULTISOCKET_CONNECT)->EnableWindow(TRUE); + GetDlgItem(IDC_BTN_MULTISOCKET_DISCONNECT)->EnableWindow(FALSE); + GetDlgItem(IDC_RADIO_L)->EnableWindow(TRUE); + GetDlgItem(IDC_RADIO_SAC1)->EnableWindow(TRUE); + GetDlgItem(IDC_RADIO_SAC2)->EnableWindow(TRUE); + GetDlgItem(IDC_RADIO_DC_13Ins)->EnableWindow(TRUE); + GetDlgItem(IDC_RADIO_DC_WHTJ)->EnableWindow(TRUE); + GetDlgItem(IDC_RADIO_H264Data)->EnableWindow(TRUE); + +} +void CMulticastSocketReceiveDlg::ShowMulticastSocketInfo() +{ + GetDlgItem(IDC_EDIT_MULTICASTSOCKETINFORECEIVE)->SetWindowText(str_MulticastSocketInfoReceive); + GetDlgItem(IDC_EDIT_MULTICASTSOCKETINFORECEIVE)->SendMessage(WM_VSCROLL,SB_BOTTOM,0); +} + +void CMulticastSocketReceiveDlg::OnBnClickedCheck1() +{ + m_bFJDataShow = !m_bFJDataShow; +} + +// 键盘/鼠标消息响应函数 +BOOL CMulticastSocketReceiveDlg::PreTranslateMessage(MSG* pMsg) +{ + // 键盘消息 + if (pMsg->message == WM_KEYDOWN) + { + // 忽略ESC和回车键 + if (pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_RETURN) + { + return TRUE; + } + // F3键控制“组播收数”窗口的现实/隐藏 + if (pMsg->wParam == VK_F3) + { + // 关闭窗口 + OnOK(); + } + } + return CDialogEx::PreTranslateMessage(pMsg); +} + +void CMulticastSocketReceiveDlg::OnRadioBtnVideoSrcClicked() +{ + // TODO: 在此添加控件通知处理程序代码 + UpdateData(TRUE); + + if (0 == m_iVideoSrc)//L链路SPI输出 UDP组播 + { + // 显示主机本地IP + GetDlgItem(IDC_EDIT_LOCALIP_RECEIVE)->SetWindowText(str_LocalIP_ReceiveMUDP); + + // 设置界面初始显示内容 + m_IPAddress_MultiCastIP.SetWindowText(str_MulticastSocketIP); + GetDlgItem(IDC_EDIT_MULTISOCKETPORT_RECEIVE)->SetWindowText("8080"); + GetDlgItem(IDC_EDIT_LOCALPORT_RECEIVE)->SetWindowTextA("8082"); + }else if (1 == m_iVideoSrc)//卫通视频管理计算机网口输出 UDP单播 + { + // 获取主机本地IP并显示 + CString str_LocalIP_Receive; + str_LocalIP_Receive = _T("192.168.0.4"); // 界面展示本机卫通IP + GetDlgItem(IDC_EDIT_LOCALIP_RECEIVE)->SetWindowText(str_LocalIP_Receive); + + // 设置界面初始显示内容 + CString str_RemoteIP_Connect; + str_RemoteIP_Connect = _T("192.168.0.180"); // 界面展示IP + m_IPAddress_MultiCastIP.SetWindowText(str_RemoteIP_Connect); + GetDlgItem(IDC_EDIT_MULTISOCKETPORT_RECEIVE)->SetWindowText("8080"); + GetDlgItem(IDC_EDIT_LOCALPORT_RECEIVE)->SetWindowTextA("8080"); + } + +} + +void CMulticastSocketReceiveDlg::CreateUDPSocketReceiveData() +{ + //卫通UDP连接 + m_nSACUDPSocket.SetCallBack(OnReadFromUDPSACKU, this); + CString strLocalIPAddr; + strLocalIPAddr = _T("192.168.1.20"); // 卫通接受IP + GetDlgItem(IDC_EDIT_LOCALIP_RECEIVE)->GetWindowTextA(strLocalIPAddr); + /*自测用*/ + //strLocalIPAddr = _T("172.10.1.183"); + //m_strSACUDPIPAddr = _T("172.10.1.183"); + //m_nSACUDPLocalPort = 8080; + //m_nSACUDPRemotePort = 8081; + /*自测用*/ + + m_nSACUDPSocket.SetParams(strLocalIPAddr, m_nSACUDPLocalPort, m_strSACUDPIPAddr, m_nSACUDPRemotePort); + if (m_nSACUDPSocket.StartListening()) + { + CString receiverData = "任管数据接收设置成功!"; + receiverData += "\r\n"; + str_MulticastSocketInfoReceive += receiverData; + // 显示信息 + ShowMulticastSocketInfoReceive(); + } + else + { + CString receiverData = "任管数据接收设置失败!"; + receiverData += "\r\n"; + str_MulticastSocketInfoReceive += receiverData; + // 显示信息 + ShowMulticastSocketInfoReceive(); + } +} + +//添加系统串口到组合选择框 +void CMulticastSocketReceiveDlg::AddPortNumberToComboBox() +{ + int *comPortList = new int[MaxComPortNumber]; + memset( comPortList, 0, MaxComPortNumber ); + + //系统设置的串口数目 + int sysSetComNumber = 0; + + //获得系统当前的串口数量,存于数组comPortList中 + BOOL bScanPort = ScanPCCom( comPortList, sysSetComNumber ); + m_sysSetComNumber = sysSetComNumber; + + if ( !bScanPort ) //读取失败 + { + if ( comPortList != NULL ) + { + delete[]comPortList; + comPortList = NULL; + } + return; + } + + //对数组进行升序排列 + OrderComPortList( comPortList, sysSetComNumber ); + + //写入对话框的CComboBox中 + CString str; + for ( int i = 0; i < sysSetComNumber; ++i ) + { + str.Format( "串口%d", comPortList[i] ); + + ( ( CComboBox * ) GetDlgItem( IDC_COMBO_PORT_IMP ) )->InsertString( i, str ); //IMP串口号 + } + + int setComPos = 0; + + //配置文件设置 + SetComboBoxCurSel( IDC_COMBO_PORT_IMP, comPortList, sysSetComNumber, mComPortIMP ); + + if ( comPortList != NULL ) + { + delete[]comPortList; + comPortList = NULL; + } +} + +//添加串口波特率到组合选择框 +void CMulticastSocketReceiveDlg::AddBaudNumberToComboBox() +{ + int iCount0=( ( CComboBox * ) GetDlgItem( IDC_COMBO_BAUD_IMP ) )->GetCount(); //IMP串口波特率 + if(iCount0 < 1) + { + for(int i = 0; i < BAUDITEMNUM; ++i ){ + ( ( CComboBox * ) GetDlgItem( IDC_COMBO_BAUD_IMP ) )->InsertString( i, gComBaudItems[i] ); + } + } + + //配置文件设置的SD2串口 + SetComboBaudCurSel( IDC_COMBO_BAUD_IMP, gComBaudItems, BAUDITEMNUM, mComBaudIMP ); + +} + +//从配置文件中读取指定串口号 +void CMulticastSocketReceiveDlg::SetComboBoxCurSel( int comboBoxID, const int *portArray, const int& arrLength,CString& strPortNumber ) +{ + if ( strPortNumber.GetLength() <= 4 ) + { + strPortNumber = _T( "" ); + return; + } + + CString initializeComPort = strPortNumber; + initializeComPort.Delete( 0, 4 ); + int filePortValue = atoi( initializeComPort ); + + int setComPos = 0; + if ( FindItemFromComList( setComPos, portArray, arrLength, filePortValue ) ) + { + ( ( CComboBox * ) GetDlgItem( comboBoxID ) )->SetCurSel( setComPos ); + } + else + { + strPortNumber = _T( "" ); + } +} + +//对串口数组进行升序排列 +void CMulticastSocketReceiveDlg::OrderComPortList( int *portArray, const int& arrLength ) +{ + int portValue = 0; + for ( int i = 0; i < arrLength - 1; ++i ) + { + for ( int j = i + 1; j < arrLength; ++j ) + { + if ( portArray[i] > portArray[j] ) + { + portValue = portArray[i]; + portArray[i] = portArray[j]; + portArray[j] = portValue; + } + } + } +} + +//给指定的波特率组合框设定选择值 +void CMulticastSocketReceiveDlg::SetComboBaudCurSel( int comboBoxID, const CString *baudArray, const int& arrLength,CString& strBaudNumber ) +{ + if ( strBaudNumber.GetLength() <= 0 ) + { + strBaudNumber = _T( "" ); + return; + } + + CString initializeComBaud = strBaudNumber; + initializeComBaud.Trim(); + + int fileBaudValue = atoi( initializeComBaud ); + + int setBaudPos = -1; + + if ( FindItemFromBaudList( setBaudPos, baudArray, arrLength, fileBaudValue ) ) + { + ( ( CComboBox * ) GetDlgItem( comboBoxID ) )->SetCurSel( setBaudPos ); + } + else + { + strBaudNumber = _T( "" ); + } +} + +//从波特率列表中查找指定波特率 +bool CMulticastSocketReceiveDlg::FindItemFromBaudList( int& pos, const CString *baudArray, const int& arrLength, const int& itemValue ) +{ + for ( int i = 0; i < arrLength; ++i ) + { + if ( itemValue == atoi((baudArray[i])) ) + { + pos = i; + return true; + } + } + return false; +} + +//IMP通信串口选择后触发 +void CMulticastSocketReceiveDlg::OnCbnSelchangePortIMP() +{ + UpdateData( true ); + //判断该串口是否已经被占用 + if ( !CheckComPortCanWork( mComPortIMP ) ) + { + ( ( CComboBox * ) GetDlgItem( IDC_COMBO_PORT_IMP ) )->SetCurSel( -1 ); + } +} +//IMP通信串口波特率选择后触发 +void CMulticastSocketReceiveDlg::OnCbnSelchangeBaudIMP() +{ + UpdateData( true ); + //判断该串口是否已经被占用 + if ( !CheckComPortCanWork( mComPortIMP ) ) + { + ( ( CComboBox * ) GetDlgItem( IDC_COMBO_BAUD_IMP ) )->SetCurSel( -1 ); + } +} +void CMulticastSocketReceiveDlg::OnBnClickedBtnImpSerialConnect() +{ + // TODO: 在此添加控件通知处理程序代码 + GetDlgItem(IDC_BTN_IMP_SERIAL_CONNECT)->EnableWindow(FALSE); + GetDlgItem(IDC_BTN_IMP_SERIAL_DISCONNECT)->EnableWindow(TRUE); + ::SendMessageA(g_IMPDLGhwnd,WM_UPDATE_IMP_SERIAL_CONNECT,(WPARAM)mComPortIMP.AllocSysString(), (LPARAM)mComBaudIMP.AllocSysString()); + +} +void CMulticastSocketReceiveDlg::OnBnClickedBtnImpSerialDisconnect() +{ + // TODO: 在此添加控件通知处理程序代码 + GetDlgItem(IDC_BTN_IMP_SERIAL_CONNECT)->EnableWindow(TRUE); + GetDlgItem(IDC_BTN_IMP_SERIAL_DISCONNECT)->EnableWindow(FALSE); + ::SendMessageA(g_IMPDLGhwnd,WM_UPDATE_IMP_SERIAL_CONNECT,(WPARAM)mComPortIMP.AllocSysString(), (LPARAM)mComBaudIMP.AllocSysString()); + +} + + +void CMulticastSocketReceiveDlg::OnBnClickedRadioDc13ins() +{ + // TODO: 在此添加控件通知处理程序代码 + UpdateData(TRUE); + DCTypeSelected_video = 0; + //switch(m_DCvideoTypeSelct) + //{ + //case 0: + // DCTypeSelected_video =0; + // break; + //case 1: + // DCTypeSelected_video =1; + // break; + //case 2: + // DCTypeSelected_video =2; + // break; + //default: + // DCTypeSelected_video =0; + //} + ((CButton *)GetDlgItem(IDC_RADIO_DC_13Ins))->SetCheck(true); + ((CButton *)GetDlgItem(IDC_RADIO_DC_WHTJ))->SetCheck(false); + ((CButton *)GetDlgItem(IDC_RADIO_H264Data))->SetCheck(false); +} + + +void CMulticastSocketReceiveDlg::OnBnClickedRadioDcWhtj() +{ + // TODO: 在此添加控件通知处理程序代码 + UpdateData(TRUE); + DCTypeSelected_video = 1; + ((CButton *)GetDlgItem(IDC_RADIO_DC_13Ins))->SetCheck(false); + ((CButton *)GetDlgItem(IDC_RADIO_DC_WHTJ))->SetCheck(true); + ((CButton *)GetDlgItem(IDC_RADIO_H264Data))->SetCheck(false); +} + + +void CMulticastSocketReceiveDlg::OnBnClickedRadioH264data() +{ + // TODO: 在此添加控件通知处理程序代码 + UpdateData(TRUE); + DCTypeSelected_video = 2; + ((CButton *)GetDlgItem(IDC_RADIO_DC_13Ins))->SetCheck(false); + ((CButton *)GetDlgItem(IDC_RADIO_DC_WHTJ))->SetCheck(false); + ((CButton *)GetDlgItem(IDC_RADIO_H264Data))->SetCheck(true); +} diff --git a/Src/CH91PayloadSoftware/MulticastSocketReceiveDlg.h b/Src/CH91PayloadSoftware/MulticastSocketReceiveDlg.h new file mode 100644 index 0000000..7114182 --- /dev/null +++ b/Src/CH91PayloadSoftware/MulticastSocketReceiveDlg.h @@ -0,0 +1,115 @@ +#pragma once + +#include "MulticastSocket.h" +#include "ExportSimpleImgShow.h" +#include "CUDPSocket.h" +#include "BtnST.h" +#include "EditInput.h" +#include "Serial.h" +#include "afxwin.h" +#include "afxcmn.h" +#include "opencv2/core/core.hpp" +#include "ComControlFunction.h" + +// CMulticastSocketReceiveDlg 对话框 + +class CMulticastSocketReceiveDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CMulticastSocketReceiveDlg) + +public: + CMulticastSocketReceiveDlg(CWnd* pParent = NULL); // 标准构造函数 + virtual ~CMulticastSocketReceiveDlg(); + +// 对话框数据 + enum { IDD = IDD_DLG_MULTICASTSOCKETRECEIVE }; +public: + // 显示组播接收信息 + CString str_MulticastSocketInfoReceive; + // 设置IR组播端口 + UINT m_MulticastSocketPortFH96Data; + // 设置组播IP + CString str_MulticastSocketIP; + + CString str_LocalIP_ReceiveMUDP; + + CIPAddressCtrl m_IPAddress_MultiCastIP; //组播 //网络IP + + // WinSoc + HANDLE m_hThread_GetFH96DataFromNet; + DWORD m_ThreadID_GetFH96DataFromNet; + // 设置位置组播接收 + CMulticastSocket m_MulticastSocketLocation; // 组播接收——位置信息 + //FJ数据开关 + BOOL m_bFJDataShow; + + CString m_strServerPayLoadIPSend; //服务器发数IP地址 + + int m_nServerSendLocalPort; //服务器发数本地端口 + int m_nServerSendObjectPort; //服务器发数远端端口 + + //L测控 + CString m_strLLinkMultiCastIP; //L测控组播IP + int m_nLLinkMulticastPort; //L测控组播收数端口 + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + DECLARE_MESSAGE_MAP() + +public: + virtual BOOL OnInitDialog(); + afx_msg void OnBnClickedBtnMultisocketConnect(); + void CreateMulticastSocketFH96Data(); + void SetUpWinSocketFH96Data(); + void ShowMulticastSocketInfoReceive(); + void GetHostAddress(CString &strIP); + afx_msg void OnBnClickedBtnMultisocketDisconnect(); + void ShowMulticastSocketInfo(); + // 显示FJ数据各字节内容 + LRESULT ShowCH96FJData(WPARAM wParam, LPARAM lParam); + afx_msg void OnBnClickedCheck1(); + virtual BOOL PreTranslateMessage(MSG* pMsg); + // 视频数据源 + int m_iVideoSrc; + afx_msg void OnRadioBtnVideoSrcClicked(); + + //卫通组播 + CString m_strSACMulticastIPAddr; //卫通组播IP地址 + int m_nSACMulticastRemotePort; //卫通组播收数端口 + + //卫通UDP单播 + CString m_strSACUDPIPAddr; //卫通UDP单播IP地址 + int m_nSACUDPRemotePort; //卫通UDP单播远端端口 + int m_nSACUDPLocalPort; //卫通UDP单播本地端口 + CUDPSocket m_nSACUDPSocket; //卫通UDP通信套接字 + void CreateUDPSocketReceiveData(); //卫通UDP数据通信创建 + + //IMP + CString mComPortIMP; //IMP通信串口号 + CString mComBaudIMP; //IMP通信串口波特率 + //const int MaxComPortNumber = 1024; + //const unsigned BAUDITEMNUM = 10; //波特率数目 + //const unsigned NCOUNTER = 500; //失败尝试次数 +private: + //添加系统串口到组合选择框 + void AddPortNumberToComboBox(); + void SetComboBoxCurSel( int comboBoxID, const int *portArray, const int& arrLength, CString& strPortNumber ); + void SetComboBaudCurSel( int comboBoxID, const CString *baudArray, const int& arrLength, CString& strBaudNumber ); + bool FindItemFromBaudList( int& pos, const CString *baudArray, const int& arrLength, const int& itemValue ); + void AddBaudNumberToComboBox(); + void OrderComPortList( int *portArray, const int& arrLength ); +public: + afx_msg void OnCbnSelchangePortIMP();//串口号选择触发函数 + afx_msg void OnCbnSelchangeBaudIMP();//串口波特率选择触发函数 +private: + int m_sysSetComNumber; //串口数 + +public: + afx_msg void OnBnClickedBtnImpSerialConnect(); + afx_msg void OnBnClickedBtnImpSerialDisconnect(); + afx_msg void OnBnClickedRadioDc13ins();//吊舱类型选择-13所吊舱 + afx_msg void OnBnClickedRadioDcWhtj();//吊舱类型选择-武汉天进吊舱 + afx_msg void OnBnClickedRadioH264data();//吊舱类型选择-h264数据 + int m_DCvideoTypeSelct; +}; diff --git a/Src/CH91PayloadSoftware/OIS.h b/Src/CH91PayloadSoftware/OIS.h new file mode 100644 index 0000000..3c1bb32 --- /dev/null +++ b/Src/CH91PayloadSoftware/OIS.h @@ -0,0 +1,41 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef OIS_OISALL_H +#define OIS_OISALL_H + +#include "OISPrereqs.h" +#include "OISObject.h" +#include "OISMouse.h" +#include "OISKeyboard.h" +#include "OISJoyStick.h" +#include "OISMultiTouch.h" +#include "OISInputManager.h" +#include "OISFactoryCreator.h" +#include "OISException.h" +#include "OISEvents.h" + +#include "OISEffect.h" +#include "OISInterface.h" +#include "OISForceFeedback.h" + +#endif diff --git a/Src/CH91PayloadSoftware/OISConfig.h b/Src/CH91PayloadSoftware/OISConfig.h new file mode 100644 index 0000000..c70dfe3 --- /dev/null +++ b/Src/CH91PayloadSoftware/OISConfig.h @@ -0,0 +1,75 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef OIS_CONFIG_HEADER +#define OIS_CONFIG_HEADER + +//----------------------------------------------------------------------------// +//* This file contains defines for building certain parts of this Lib +//* This file is not meant for External inclusion. However, you can edit this +//* file before a build to effect what features are used internally +//----------------------------------------------------------------------------// + +/** +@remarks + These lines have no bearing on internal build of OIS. This is here for + external build settings. Meaning, changing this does not require a + rebuild of OIS. This just affects VC dll import settings, as the DLL + build already defines this during its build for setting dll exports. + The undefine here is here just incase you decide to only use + DLL, and want to set it permently and recompile OIS too.. Avoid redefinition + from DLL build of OIS. + + So, if wanting to link against DLL version, just uncomment these lines. +*/ +//#ifdef OIS_DYNAMIC_LIB +//# undef OIS_DYNAMIC_LIB +//#endif +//#define OIS_DYNAMIC_LIB + +/** +@remarks + Build in support for LIRC / WinLIRC - remote control support. + Requires Boost::asio +@notes + Experimental - Supports connecting and enumerating. Control does not + yet return state or events +*/ +//#define OIS_LIRC_SUPPORT + +/** +@remarks + Build in support for PC Nintendo WiiMote Win32 HID interface. + Requires Boost::threads +@notes + Useable, but not quite finished - supports rumble, all buttons, & main orientation axis. + Still needs Nunchuck, IR, and LED/Battery support. +*/ +//#define OIS_WIN32_WIIMOTE_SUPPORT + +/** +@remarks + Build in support for Win32 XInput (Xbox 360 Controller) +*/ +//#define OIS_WIN32_XINPUT_SUPPORT + +#endif diff --git a/Src/CH91PayloadSoftware/OISEffect.h b/Src/CH91PayloadSoftware/OISEffect.h new file mode 100644 index 0000000..788da00 --- /dev/null +++ b/Src/CH91PayloadSoftware/OISEffect.h @@ -0,0 +1,278 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef OIS_Effect_H +#define OIS_Effect_H + +#include "OISPrereqs.h" + +namespace OIS +{ + //Predeclare some Effect Property structs + class ForceEffect; + class ConstantEffect; + class RampEffect; + class PeriodicEffect; + class ConditionalEffect; + + /** + Force Feedback is a relatively complex set of properties to upload to a device. + The best place for information on the different properties, effects, etc is in + the DX Documentation and MSDN - there are even pretty graphs ther =) + As this class is modeled on the the DX interface you can apply that same + knowledge to creating effects via this class on any OS supported by OIS. + + In anycase, this is the main class you will be using. There is *absolutely* no + need to instance any of the supporting ForceEffect classes yourself. + */ + class _OISExport Effect + { + public: + //! Type of force + enum EForce + { + UnknownForce = 0, + ConstantForce, + RampForce, + PeriodicForce, + ConditionalForce, + CustomForce, + _ForcesNumber // Always keep in last position. + }; + + static const char* getForceTypeName(EForce eValue); + + //! Type of effect + enum EType + { + //Type ----- Pairs with force: + Unknown = 0, //UnknownForce + Constant, //ConstantForce + Ramp, //RampForce + Square, //PeriodicForce + Triangle, //PeriodicForce + Sine, //PeriodicForce + SawToothUp, //PeriodicForce + SawToothDown,//PeriodicForce + Friction, //ConditionalForce + Damper, //ConditionalForce + Inertia, //ConditionalForce + Spring, //ConditionalForce + Custom, //CustomForce + _TypesNumber // Always keep in last position. + }; + + static const char* getEffectTypeName(EType eValue); + + //! Direction of the Force + enum EDirection + { + NorthWest, + North, + NorthEast, + East, + SouthEast, + South, + SouthWest, + West, + _DirectionsNumber // Always keep in last position. + }; + + static const char* getDirectionName(EDirection eValue); + + /** + This constructor allows you to set the force type and effect. + */ + Effect(EForce ef, EType et); + virtual ~Effect(); + + const EForce force; + const EType type; + + //Infinite Time + static const unsigned int OIS_INFINITE = 0xFFFFFFFF; + + //-------------------------------------------------------------------// + //--- Set these variables before uploading or modifying an effect ---// + + //Direction to apply to the force - affects two axes+ effects + EDirection direction; + + //Number of button triggering an effect (-1 means no trigger) + short trigger_button; + + //Time to wait before an effect can be re-triggered (microseconds) + unsigned int trigger_interval; + + //Duration of an effect (microseconds) + unsigned int replay_length; + + //Time to wait before to start playing an effect (microseconds) + unsigned int replay_delay; + + //Get the specific Force Effect. This should be cast depending on the EForce + ForceEffect* getForceEffect() const; + + /** + @remarks + Set the number of Axes to use before the initial creation of the effect. + Can only be done prior to creation! Use the FF interface to determine + how many axes can be used (are availiable) + */ + void setNumAxes(short nAxes); + + /** + @remarks + Returns the number of axes used in this effect + */ + short getNumAxes() const; + + //------------- Library Internal -------------------------------------// + /** + set internally.. do not change or you will not be able to upload/stop + this effect any more. It will become lost. It is mutable so even + with const reference it can/will be changed by this lib + */ + mutable int _handle; + protected: + // Prevent copying. + Effect(const Effect&); + Effect& operator=(Effect); + + ForceEffect* effect; //Properties depend on EForce + short axes; //Number of axes to use in effect + }; + + //-----------------------------------------------------------------------------// + /** + Base class of all effect property classes + */ + class _OISExport ForceEffect + { + public: + virtual ~ForceEffect() {} + }; + + //-----------------------------------------------------------------------------// + /** + An optional envelope to be applied to the start/end of an effect. If any of + these values are nonzero, then the envelope will be used in setting up the + effect. + */ + class _OISExport Envelope : public ForceEffect + { + public: + Envelope() : attackLength(0), attackLevel(0), fadeLength(0), fadeLevel(0) {} +#if defined(OIS_MSVC_COMPILER) + #pragma warning (push) + #pragma warning (disable : 4800) +#endif + bool isUsed() const { return attackLength | attackLevel | fadeLength | fadeLevel; } +#if defined(OIS_MSVC_COMPILER) + #pragma warning (pop) +#endif + + // Duration of the attack (microseconds) + unsigned int attackLength; + + // Absolute level at the beginning of the attack (0 to 10K) + // (automatically signed when necessary by FF core according to effect level sign) + unsigned short attackLevel; + + // Duration of fade (microseconds) + unsigned int fadeLength; + + // Absolute level at the end of fade (0 to 10K) + // (automatically signed when necessary by FF core according to effect level sign) + unsigned short fadeLevel; + }; + + //-----------------------------------------------------------------------------// + /** + Use this class when dealing with Force type of Constant + */ + class _OISExport ConstantEffect : public ForceEffect + { + public: + ConstantEffect() : level(5000) {} + + Envelope envelope; //Optional envolope + signed short level; //-10K to +10k + }; + + //-----------------------------------------------------------------------------// + /** + Use this class when dealing with Force type of Ramp + */ + class _OISExport RampEffect : public ForceEffect + { + public: + RampEffect() : startLevel(0), endLevel(0) {} + + Envelope envelope; //Optional envelope + signed short startLevel; //-10K to +10k + signed short endLevel; //-10K to +10k + }; + + //-----------------------------------------------------------------------------// + /** + Use this class when dealing with Force type of Periodic + */ + class _OISExport PeriodicEffect : public ForceEffect + { + public: + PeriodicEffect() : magnitude(0), offset(0), phase(0), period(0) {} + + Envelope envelope; //Optional Envelope + + unsigned short magnitude; //0 to 10,0000 + signed short offset; + unsigned short phase; //Position at which playback begins 0 to 35,999 + unsigned int period; //Period of effect (microseconds) + }; + + //-----------------------------------------------------------------------------// + /** + Use this class when dealing with Force type of Condional + */ + class _OISExport ConditionalEffect : public ForceEffect + { + public: + ConditionalEffect() : + rightCoeff(0), leftCoeff(0), rightSaturation(0), leftSaturation(0), + deadband(0), center(0) {} + + signed short rightCoeff; //-10k to +10k (Positive Coeff) + signed short leftCoeff; //-10k to +10k (Negative Coeff) + + unsigned short rightSaturation; //0 to 10k (Pos Saturation) + unsigned short leftSaturation; //0 to 10k (Neg Saturation) + + //Region around center in which the condition is not active, in the range + //from 0 through 10,000 + unsigned short deadband; + + //(Offset in DX) -10k and 10k + signed short center; + }; +} +#endif //OIS_Effect_H diff --git a/Src/CH91PayloadSoftware/OISEvents.h b/Src/CH91PayloadSoftware/OISEvents.h new file mode 100644 index 0000000..442aa83 --- /dev/null +++ b/Src/CH91PayloadSoftware/OISEvents.h @@ -0,0 +1,43 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef _OIS_EVENTHEADERS_ +#define _OIS_EVENTHEADERS_ +#include "OISPrereqs.h" + +namespace OIS +{ + /** + Base class of all events + */ + class _OISExport EventArg + { + public: + explicit EventArg( Object* obj ) : device(obj) {} + virtual ~EventArg() {} + + //! Pointer to the Input Device + const Object* device; + }; +} + +#endif //_OIS_EVENTHEADERS_ diff --git a/Src/CH91PayloadSoftware/OISException.h b/Src/CH91PayloadSoftware/OISException.h new file mode 100644 index 0000000..9af0e87 --- /dev/null +++ b/Src/CH91PayloadSoftware/OISException.h @@ -0,0 +1,83 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef _OIS_EXCEPTION_HEADER_ +#define _OIS_EXCEPTION_HEADER_ +#include "OISPrereqs.h" +#include + +namespace OIS +{ + //! Simple enum's for dealing with exceptions + enum OIS_ERROR + { + E_InputDisconnected, + E_InputDeviceNonExistant, + E_InputDeviceNotSupported, + E_DeviceFull, + E_NotSupported, + E_NotImplemented, + E_Duplicate, + E_InvalidParam, + E_General + }; + + /** + @remarks + Class for handling OIS exceptions. Much cleaner than checking every method for reurn value. + Inherits from std::exception so you can simply log those messages if you want to be generic. + Also note that this has a source file now since OSX was not finding the OIS::Exception symbol + which would cause program abortion with now correponding exception type. + */ + class _OISExport Exception : public std::exception + { + public: + //! Creates exception object + Exception( OIS_ERROR err, const char* str, int line, const char *file ) + : eType(err), eLine(line), eFile(file), eText(str) {} + + Exception(const Exception& other) + : eType(other.eType), eLine(other.eLine), eFile(other.eFile), eText(other.eText) {} + + ~Exception() throw() {} + + virtual const char* what() const throw(); + + //! The type of exception raised + const OIS_ERROR eType; + //! The line number it occurred on + const int eLine; + //! The source file + const char* eFile; + //! A message passed along when the exception was raised + const char* eText; + + private: + // Unimplemented and unaccessible due to const members. + Exception& operator=(Exception); + }; +} + +//! Use this macro to handle exceptions easily +#define OIS_EXCEPT( err, str ) throw( OIS::Exception(err, str, __LINE__, __FILE__) ) + +#endif //_OIS_EXCEPTION_HEADER_ diff --git a/Src/CH91PayloadSoftware/OISFactoryCreator.h b/Src/CH91PayloadSoftware/OISFactoryCreator.h new file mode 100644 index 0000000..5682f97 --- /dev/null +++ b/Src/CH91PayloadSoftware/OISFactoryCreator.h @@ -0,0 +1,81 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef OIS_FactoryCreator_H +#define OIS_FactoryCreator_H + +#include "OISPrereqs.h" + +namespace OIS +{ + /** + Interface for creating devices - all devices ultimately get enumerated/created via a factory. + A factory can create multiple types of objects. + */ + class _OISExport FactoryCreator + { + public: + /** + @remarks Virtual Destructor + */ + virtual ~FactoryCreator() {}; + + /** + @remarks Return a list of all unused devices the factory maintains + */ + virtual DeviceList freeDeviceList() = 0; + + /** + @remarks Number of total devices of requested type + @param iType Type of devices to check + */ + virtual int totalDevices(Type iType) = 0; + + /** + @remarks Number of free devices of requested type + @param iType Type of devices to check + */ + virtual int freeDevices(Type iType) = 0; + + /** + @remarks Does a Type exist with the given vendor name + @param iType Type to check + @param vendor Vendor name to test + */ + virtual bool vendorExist(Type iType, const std::string & vendor) = 0; + + /** + @remarks Creates the object + @param iType Type to create + @param bufferMode True to setup for buffered events + @param vendor Create a device with the vendor name, "" means vendor name is unimportant + */ + virtual Object* createObject(InputManager* creator, Type iType, bool bufferMode, const std::string & vendor = "") = 0; + + /** + @remarks Destroys object + @param obj Object to destroy + */ + virtual void destroyObject(Object* obj) = 0; + }; +} +#endif //OIS_FactoryCreator_H diff --git a/Src/CH91PayloadSoftware/OISForceFeedback.h b/Src/CH91PayloadSoftware/OISForceFeedback.h new file mode 100644 index 0000000..06b1816 --- /dev/null +++ b/Src/CH91PayloadSoftware/OISForceFeedback.h @@ -0,0 +1,120 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef OIS_ForceFeedBack_H +#define OIS_ForceFeedBack_H + +#include "OISPrereqs.h" +#include "OISInterface.h" +#include "OISEffect.h" + +namespace OIS +{ + /** + Interface class for dealing with Force Feedback devices + */ + class _OISExport ForceFeedback : public Interface + { + public: + ForceFeedback(); + virtual ~ForceFeedback() {} + + /** + @remarks + This is like setting the master volume of an audio device. + Individual effects have gain levels; however, this affects all + effects at once. + Note: If the device does not support master gain setting, nothing is done + @param level + A value between 0.0 and 1.0 represent the percentage of gain. 1.0 + being the highest possible force level (means no scaling). + */ + virtual void setMasterGain( float level ) = 0; + + /** + @remarks + If using Force Feedback effects, this should be turned off + before uploading any effects. Auto centering is the motor moving + the joystick back to center. DirectInput only has an on/off setting, + whereas linux has levels.. Though, we go with DI's on/off mode only + Note: If the device does not support auto-centering, nothing is done + @param auto_on + true to turn auto centering on, false to turn off. + */ + virtual void setAutoCenterMode( bool auto_on ) = 0; + + /** + @remarks + Creates and Plays the effect immediately. If the device is full + of effects, it will fail to be uploaded. You will know this by + an invalid Effect Handle + */ + virtual void upload( const Effect* effect ) = 0; + + /** + @remarks + Modifies an effect that is currently playing + */ + virtual void modify( const Effect* effect ) = 0; + + /** + @remarks + Remove the effect from the device + */ + virtual void remove( const Effect* effect ) = 0; + + /** + @remarks + Get the number of supported Axes for FF usage + */ + virtual short getFFAxesNumber() = 0; + + /** + @remarks + Get the current load (%, in [0, 100] of the FF device memory + */ + virtual unsigned short getFFMemoryLoad() = 0; + + typedef std::multimap SupportedEffectList; + /** + @remarks + Get a list of all supported effects + */ + const SupportedEffectList& getSupportedEffects() const; + + /** + @remarks + Tell if a given force / effect type pair is supported + */ + bool supportsEffect(Effect::EForce force, Effect::EType type) const; + + void _addEffectTypes( Effect::EForce force, Effect::EType type ); + void _setGainSupport( bool on ); + void _setAutoCenterSupport( bool on ); + + protected: + SupportedEffectList mSupportedEffects; + bool mSetGainSupport; + bool mSetAutoCenterSupport; + }; +} +#endif //OIS_ForceFeedBack_H diff --git a/Src/CH91PayloadSoftware/OISInputManager.h b/Src/CH91PayloadSoftware/OISInputManager.h new file mode 100644 index 0000000..6794510 --- /dev/null +++ b/Src/CH91PayloadSoftware/OISInputManager.h @@ -0,0 +1,205 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef OIS_InputManager_H +#define OIS_InputManager_H + +#include "OISPrereqs.h" + +namespace OIS +{ + //Forward declare a couple of classes we might use later + class LIRCFactoryCreator; + class WiiMoteFactoryCreator; + + /** + Base Manager class. No longer a Singleton; so feel free to create as many InputManager's as you have + windows. + */ + class _OISExport InputManager + { + public: + /** + @remarks + Returns version number (useful in DLL/SO libs) + @returns + Bits: 1-8 Patch number, 9-16 Minor version, 17-32 Major version + */ + static unsigned int getVersionNumber(); + + /** + @remarks + Returns version string (useful in DLL/SO libs) + @returns + Version name + */ + const std::string &getVersionName(); + + /** + @remarks + Creates appropriate input system dependent on platform. + @param winHandle + Contains OS specific window handle (such as HWND or X11 Window) + @returns + A pointer to the created manager, or raises Exception + */ + static InputManager* createInputSystem( std::size_t winHandle ); + + /** + @remarks + Creates appropriate input system dependent on platform. + @param paramList + ParamList contains OS specific info (such as HWND and HINSTANCE for window apps), + and access mode. + @returns + A pointer to the created manager, or raises Exception + */ + static InputManager* createInputSystem( ParamList ¶mList ); + + /** + @remarks + Destroys the InputManager + @param manager + Manager to destroy + */ + static void destroyInputSystem(InputManager* manager); + + /** + @remarks Gets the name of the current platform input system + */ + const std::string& inputSystemName(); + + /** + @remarks + Returns the number of the specified OIS::Type devices discovered by OIS + @param iType + Type that you are interested in + */ + int getNumberOfDevices( Type iType ); + + /** + @remarks + Lists all unused devices + @returns + DeviceList which contains Type and vendor of device + */ + DeviceList listFreeDevices(); + + /** + @remarks + Tries to create an object with the specified vendor. If you have no + preference of vendor, leave vender as default (""). Raises exception on failure + */ + Object* createInputObject( Type iType, bool bufferMode, const std::string &vendor = ""); + + /** + @remarks Destroys Input Object + */ + void destroyInputObject( Object* obj ); + + /** + @remarks + Add a custom object factory to allow for user controls. + @param factory + Factory instance to add + @notes + Make sure you do not delete the factory before devices created from + the factory are destroyed (either by calling RemoveFactoryCreator, or shutting down + the input system). Order should be something like the following: + * Create Input System + * Create Factory Instance + * AddFactoryCreator(factory) + * Create a device from the InputManager (device created by factory) + * One of the follwoing: + * removeFactoryCreator(factory) + * inputManager->destroyInputObject(obj) + * destroyInputSystem(inputManager) + * destroy Factory Instance + You can safely delete the factory instance once you have removed it or shut down the + input manager. + */ + void addFactoryCreator( FactoryCreator* factory ); + + /** + @remarks + Remove a previously added object factory + @param factory + Factory object to remove. + @notes + Removing a factory will automatically destroy any Objects created from the factory + */ + void removeFactoryCreator( FactoryCreator* factory ); + + //! All generic devices OIS supports internally (if they are compiled in) + enum AddOnFactories + { + AddOn_All = 0, //All Devices + AddOn_LIRC = 1, //PC Linux Infrared Remote Control + AddOn_WiiMote = 2 //PC WiiMote Support + }; + + /** + @remarks + Enable an addon FactoryCreator extension. By default, none are activated. + If the desired support was not compiled in, this has no effect. Calling + multiple times has no effect. Once activated, there is no way to deactivate - + simply destroy and recreate input manager. + */ + void enableAddOnFactory(AddOnFactories factory); + + protected: + /** + @remarks + Called from createInputSystem, gives derived input class a chance to setup after it is created + */ + virtual void _initialize(ParamList ¶mList) = 0; + + /** + @remarks + Derived classes must provide input system name + */ + explicit InputManager(const std::string& name); + + /** + @remarks + Virtual Destructor - this base class will clean up all devices still opened in mFactoryObjects list + */ + virtual ~InputManager(); + + //! OIS Version name + const std::string m_VersionName; + + //! FactoryCreator list + FactoryList mFactories; + + //! Factory created objects - useful so we can find creator to send destruction request to + FactoryCreatedObject mFactoryObjects; + + //! Name of the input system + const std::string mInputSystemName; + + //! Extra factory (not enabled by default) + LIRCFactoryCreator *m_lircSupport; + WiiMoteFactoryCreator *m_wiiMoteSupport; + }; +} +#endif diff --git a/Src/CH91PayloadSoftware/OISInterface.h b/Src/CH91PayloadSoftware/OISInterface.h new file mode 100644 index 0000000..ed42223 --- /dev/null +++ b/Src/CH91PayloadSoftware/OISInterface.h @@ -0,0 +1,47 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef OIS_Interface_H +#define OIS_Interface_H + +#include "OISPrereqs.h" + +namespace OIS +{ + /** + An Object's interface is a way to gain write access to devices which support + it. For example, force feedack. + */ + class _OISExport Interface + { + public: + virtual ~Interface() {}; + + //! Type of Interface + enum IType + { + ForceFeedback, + Reserved + }; + }; +} +#endif //OIS_Interface_H diff --git a/Src/CH91PayloadSoftware/OISJoyStick.h b/Src/CH91PayloadSoftware/OISJoyStick.h new file mode 100644 index 0000000..5c83249 --- /dev/null +++ b/Src/CH91PayloadSoftware/OISJoyStick.h @@ -0,0 +1,233 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef OIS_Joystick_H +#define OIS_Joystick_H +#include "OISObject.h" +#include "OISEvents.h" + +namespace OIS +{ + /** @remarks default sensitivity for vector3 component of joystick */ + #define OIS_JOYSTICK_VECTOR3_DEFAULT 2.28f + + //! POV / HAT Joystick component + class _OISExport Pov : public Component + { + public: + Pov() : Component(OIS_POV), direction(0) {} + + static const int Centered = 0x00000000; + static const int North = 0x00000001; + static const int South = 0x00000010; + static const int East = 0x00000100; + static const int West = 0x00001000; + static const int NorthEast = 0x00000101; + static const int SouthEast = 0x00000110; + static const int NorthWest = 0x00001001; + static const int SouthWest = 0x00001010; + + int direction; + }; + + //! A sliding axis - only used in Win32 Right Now + class _OISExport Slider : public Component + { + public: + Slider() : Component(OIS_Slider), abX(0), abY(0) {}; + //! true if pushed, false otherwise + int abX, abY; + }; + + /** + Represents the state of the joystick + All members are valid for both buffered and non buffered mode + Sticks with zero values are not present on the device + */ + class _OISExport JoyStickState + { + public: + //! Constructor + JoyStickState() { clear(); } + + //! Represents all the buttons (uses a bitset) + std::vector mButtons; + + //! Represents all the single axes on the device + std::vector mAxes; + + //! Represents the value of a POV. Maximum of 4 + Pov mPOV[4]; + + //! Represent the max sliders + Slider mSliders[4]; + + //! Represents all Vector type controls the device exports + std::vector mVectors; + + //! internal method to reset all variables to initial values + void clear() + { + for( std::vector::iterator i = mButtons.begin(), e = mButtons.end(); i != e; ++i ) + { + (*i) = false; + } + + for( std::vector::iterator i = mAxes.begin(), e = mAxes.end(); i != e; ++i ) + { + i->absOnly = true; //Currently, joysticks only report Absolute values + i->clear(); + } + + for( std::vector::iterator i = mVectors.begin(), e = mVectors.end(); i != e; ++i ) + { + i->clear(); + } + + for( int i = 0; i < 4; ++i ) + { + mPOV[i].direction = Pov::Centered; + mSliders[i].abX = mSliders[i].abY = 0; + } + } + }; + + /** Specialised for joystick events */ + class _OISExport JoyStickEvent : public EventArg + { + public: + JoyStickEvent( Object* obj, const JoyStickState &st ) : EventArg(obj), state(st) {} + virtual ~JoyStickEvent() {} + + const JoyStickState &state; + + private: + // Prevent copying. + JoyStickEvent(const JoyStickEvent&); + JoyStickEvent& operator=(JoyStickEvent); + }; + + /** + To recieve buffered joystick input, derive a class from this, and implement the + methods here. Then set the call back to your JoyStick instance with JoyStick::setEventCallback + Each JoyStick instance can use the same callback class, as a devID number will be provided + to differentiate between connected joysticks. Of course, each can have a seperate + callback instead. + */ + class _OISExport JoyStickListener + { + public: + virtual ~JoyStickListener() {} + /** @remarks Joystick button down event */ + virtual bool buttonPressed( const JoyStickEvent &arg, int button ) = 0; + + /** @remarks Joystick button up event */ + virtual bool buttonReleased( const JoyStickEvent &arg, int button ) = 0; + + /** @remarks Joystick axis moved event */ + virtual bool axisMoved( const JoyStickEvent &arg, int axis ) = 0; + + //-- Not so common control events, so are not required --// + //! Joystick Event, and sliderID + virtual bool sliderMoved( const JoyStickEvent &arg, int index) { OIS_UNUSED(arg); OIS_UNUSED(index); return true; } + + //! Joystick Event, and povID + virtual bool povMoved( const JoyStickEvent &arg, int index) { OIS_UNUSED(arg); OIS_UNUSED(index); return true; } + + //! Joystick Event, and Vector3ID + virtual bool vector3Moved( const JoyStickEvent &arg, int index) { OIS_UNUSED(arg); OIS_UNUSED(index); return true; } + }; + + /** + Joystick base class. To be implemented by specific system (ie. DirectX joystick) + This class is useful as you remain OS independent using this common interface. + */ + class _OISExport JoyStick : public Object + { + public: + virtual ~JoyStick() {} + + /** + @remarks + Returns the number of requested components + @param cType + The ComponentType you are interested in knowing about + */ + int getNumberOfComponents(ComponentType cType) const; + + /** + @remarks + Sets a cutoff limit for changes in the Vector3 component for movement to + be ignored. Helps reduce much event traffic for frequent small/sensitive + changes + @param degrees + The degree under which Vector3 events should be discarded + */ + void setVector3Sensitivity(float degrees = OIS_JOYSTICK_VECTOR3_DEFAULT); + + /** + @remarks + Returns the sensitivity cutoff for Vector3 Component + */ + float getVector3Sensitivity() const; + + /** + @remarks + Register/unregister a JoyStick Listener - Only one allowed for simplicity. If broadcasting + is neccessary, just broadcast from the callback you registered. + @param joyListener + Send a pointer to a class derived from JoyStickListener or 0 to clear the callback + */ + virtual void setEventCallback( JoyStickListener *joyListener ); + + /** @remarks Returns currently set callback.. or null */ + JoyStickListener* getEventCallback() const; + + /** @remarks Returns the state of the joystick - is valid for both buffered and non buffered mode */ + const JoyStickState& getJoyStickState() const { return mState; } + + //! The minimal axis value + static const int MIN_AXIS = -32768; + + //! The maximum axis value + static const int MAX_AXIS = 32767; + + protected: + JoyStick(const std::string &vendor, bool buffered, int devID, InputManager* creator); + + //! Number of sliders + int mSliders; + + //! Number of POVs + int mPOVs; + + //! The JoyStickState structure (contains all component values) + JoyStickState mState; + + //! The callback listener + JoyStickListener *mListener; + + //! Adjustment factor for orientation vector accuracy + float mVector3Sensitivity; + }; +} +#endif diff --git a/Src/CH91PayloadSoftware/OISKeyboard.h b/Src/CH91PayloadSoftware/OISKeyboard.h new file mode 100644 index 0000000..c8af717 --- /dev/null +++ b/Src/CH91PayloadSoftware/OISKeyboard.h @@ -0,0 +1,324 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef OIS_Keyboard_H +#define OIS_Keyboard_H +#include "OISObject.h" +#include "OISEvents.h" + +namespace OIS +{ + //! Keyboard scan codes + enum KeyCode + { + KC_UNASSIGNED = 0x00, + KC_ESCAPE = 0x01, + KC_1 = 0x02, + KC_2 = 0x03, + KC_3 = 0x04, + KC_4 = 0x05, + KC_5 = 0x06, + KC_6 = 0x07, + KC_7 = 0x08, + KC_8 = 0x09, + KC_9 = 0x0A, + KC_0 = 0x0B, + KC_MINUS = 0x0C, // - on main keyboard + KC_EQUALS = 0x0D, + KC_BACK = 0x0E, // backspace + KC_TAB = 0x0F, + KC_Q = 0x10, + KC_W = 0x11, + KC_E = 0x12, + KC_R = 0x13, + KC_T = 0x14, + KC_Y = 0x15, + KC_U = 0x16, + KC_I = 0x17, + KC_O = 0x18, + KC_P = 0x19, + KC_LBRACKET = 0x1A, + KC_RBRACKET = 0x1B, + KC_RETURN = 0x1C, // Enter on main keyboard + KC_LCONTROL = 0x1D, + KC_A = 0x1E, + KC_S = 0x1F, + KC_D = 0x20, + KC_F = 0x21, + KC_G = 0x22, + KC_H = 0x23, + KC_J = 0x24, + KC_K = 0x25, + KC_L = 0x26, + KC_SEMICOLON = 0x27, + KC_APOSTROPHE = 0x28, + KC_GRAVE = 0x29, // accent + KC_LSHIFT = 0x2A, + KC_BACKSLASH = 0x2B, + KC_Z = 0x2C, + KC_X = 0x2D, + KC_C = 0x2E, + KC_V = 0x2F, + KC_B = 0x30, + KC_N = 0x31, + KC_M = 0x32, + KC_COMMA = 0x33, + KC_PERIOD = 0x34, // . on main keyboard + KC_SLASH = 0x35, // / on main keyboard + KC_RSHIFT = 0x36, + KC_MULTIPLY = 0x37, // * on numeric keypad + KC_LMENU = 0x38, // left Alt + KC_SPACE = 0x39, + KC_CAPITAL = 0x3A, + KC_F1 = 0x3B, + KC_F2 = 0x3C, + KC_F3 = 0x3D, + KC_F4 = 0x3E, + KC_F5 = 0x3F, + KC_F6 = 0x40, + KC_F7 = 0x41, + KC_F8 = 0x42, + KC_F9 = 0x43, + KC_F10 = 0x44, + KC_NUMLOCK = 0x45, + KC_SCROLL = 0x46, // Scroll Lock + KC_NUMPAD7 = 0x47, + KC_NUMPAD8 = 0x48, + KC_NUMPAD9 = 0x49, + KC_SUBTRACT = 0x4A, // - on numeric keypad + KC_NUMPAD4 = 0x4B, + KC_NUMPAD5 = 0x4C, + KC_NUMPAD6 = 0x4D, + KC_ADD = 0x4E, // + on numeric keypad + KC_NUMPAD1 = 0x4F, + KC_NUMPAD2 = 0x50, + KC_NUMPAD3 = 0x51, + KC_NUMPAD0 = 0x52, + KC_DECIMAL = 0x53, // . on numeric keypad + KC_OEM_102 = 0x56, // < > | on UK/Germany keyboards + KC_F11 = 0x57, + KC_F12 = 0x58, + KC_F13 = 0x64, // (NEC PC98) + KC_F14 = 0x65, // (NEC PC98) + KC_F15 = 0x66, // (NEC PC98) + KC_KANA = 0x70, // (Japanese keyboard) + KC_ABNT_C1 = 0x73, // / ? on Portugese (Brazilian) keyboards + KC_CONVERT = 0x79, // (Japanese keyboard) + KC_NOCONVERT = 0x7B, // (Japanese keyboard) + KC_YEN = 0x7D, // (Japanese keyboard) + KC_ABNT_C2 = 0x7E, // Numpad . on Portugese (Brazilian) keyboards + KC_NUMPADEQUALS= 0x8D, // = on numeric keypad (NEC PC98) + KC_PREVTRACK = 0x90, // Previous Track (KC_CIRCUMFLEX on Japanese keyboard) + KC_AT = 0x91, // (NEC PC98) + KC_COLON = 0x92, // (NEC PC98) + KC_UNDERLINE = 0x93, // (NEC PC98) + KC_KANJI = 0x94, // (Japanese keyboard) + KC_STOP = 0x95, // (NEC PC98) + KC_AX = 0x96, // (Japan AX) + KC_UNLABELED = 0x97, // (J3100) + KC_NEXTTRACK = 0x99, // Next Track + KC_NUMPADENTER = 0x9C, // Enter on numeric keypad + KC_RCONTROL = 0x9D, + KC_MUTE = 0xA0, // Mute + KC_CALCULATOR = 0xA1, // Calculator + KC_PLAYPAUSE = 0xA2, // Play / Pause + KC_MEDIASTOP = 0xA4, // Media Stop + KC_VOLUMEDOWN = 0xAE, // Volume - + KC_VOLUMEUP = 0xB0, // Volume + + KC_WEBHOME = 0xB2, // Web home + KC_NUMPADCOMMA = 0xB3, // , on numeric keypad (NEC PC98) + KC_DIVIDE = 0xB5, // / on numeric keypad + KC_SYSRQ = 0xB7, + KC_RMENU = 0xB8, // right Alt + KC_PAUSE = 0xC5, // Pause + KC_HOME = 0xC7, // Home on arrow keypad + KC_UP = 0xC8, // UpArrow on arrow keypad + KC_PGUP = 0xC9, // PgUp on arrow keypad + KC_LEFT = 0xCB, // LeftArrow on arrow keypad + KC_RIGHT = 0xCD, // RightArrow on arrow keypad + KC_END = 0xCF, // End on arrow keypad + KC_DOWN = 0xD0, // DownArrow on arrow keypad + KC_PGDOWN = 0xD1, // PgDn on arrow keypad + KC_INSERT = 0xD2, // Insert on arrow keypad + KC_DELETE = 0xD3, // Delete on arrow keypad + KC_LWIN = 0xDB, // Left Windows key + KC_RWIN = 0xDC, // Right Windows key + KC_APPS = 0xDD, // AppMenu key + KC_POWER = 0xDE, // System Power + KC_SLEEP = 0xDF, // System Sleep + KC_WAKE = 0xE3, // System Wake + KC_WEBSEARCH = 0xE5, // Web Search + KC_WEBFAVORITES= 0xE6, // Web Favorites + KC_WEBREFRESH = 0xE7, // Web Refresh + KC_WEBSTOP = 0xE8, // Web Stop + KC_WEBFORWARD = 0xE9, // Web Forward + KC_WEBBACK = 0xEA, // Web Back + KC_MYCOMPUTER = 0xEB, // My Computer + KC_MAIL = 0xEC, // Mail + KC_MEDIASELECT = 0xED // Media Select + }; + + /** + Specialised for key events + */ + class _OISExport KeyEvent : public EventArg + { + public: + KeyEvent(Object* obj, KeyCode kc, unsigned int txt) : EventArg(obj), key(kc), text(txt) {} + virtual ~KeyEvent() {} + + //! KeyCode of event + KeyCode key; + //! Text character, depends on current TextTranslationMode + unsigned int text; + }; + + /** + To recieve buffered keyboard input, derive a class from this, and implement the + methods here. Then set the call back to your Keyboard instance with Keyboard::setEventCallback + */ + class _OISExport KeyListener + { + public: + virtual ~KeyListener() {} + virtual bool keyPressed(const KeyEvent &arg) = 0; + virtual bool keyReleased(const KeyEvent &arg) = 0; + }; + + /** + Keyboard base class. To be implemented by specific system (ie. DirectX Keyboard) + This class is useful as you remain OS independent using this common interface. + */ + class _OISExport Keyboard : public Object + { + public: + virtual ~Keyboard() {}; + + /** + @remarks + Returns true if key is donwn + @param key + A KeyCode to check + */ + virtual bool isKeyDown(KeyCode key) const = 0; + + /** + @remarks + Register/unregister a Keyboard Listener - Only one allowed for simplicity. If broadcasting + is neccessary, just broadcast from the callback you registered. + @param keyListener + Send a pointer to a class derived from KeyListener or 0 to clear the callback + */ + virtual void setEventCallback(KeyListener *keyListener) { mListener = keyListener;} + + /** + @remarks + Returns currently set callback.. or 0 + */ + KeyListener* getEventCallback() const {return mListener;} + + //! TextTranslation Mode + enum TextTranslationMode + { + Off, + Unicode, + Ascii + }; + + /** + @remarks + Enable extra processing to translate KC_*** to an + actual text character based off of locale. Different + managers may implement none or all. Check the + translation mode after setting to be sure + @param mode + Off, Unicode, Ascii + */ + virtual void setTextTranslation(TextTranslationMode mode); + + /** + @remarks + Returns current translation mode + */ + TextTranslationMode getTextTranslation() const {return mTextMode;} + + /** + @remarks + Translates KeyCode to string representation. + For example, KC_ENTER will be "Enter" - Locale + specific of course. + @param kc + KeyCode to convert + @returns + The string as determined from the current locale + */ + virtual const std::string& getAsString(KeyCode kc) = 0; + + //! Enum of bit position of modifer + enum Modifier + { + Shift = 0x0000001, + Ctrl = 0x0000010, + Alt = 0x0000100 + }; + + /** + @remarks + Translates string to KeyCode representation. + For example, "Enter" will be KC_ENTER - Locale + specific of course. + @param str + string to convert + @returns + The matching KeyCode + */ + virtual OIS::KeyCode getAsKeyCode(std::string str) = 0; + + /** + @remarks + Check modifier status + */ + bool isModifierDown(Modifier mod) const; + + /** + @remarks + Copies the state of the keys into the sent buffer + (in the form of 1 is down and 0 is up) + */ + virtual void copyKeyStates(char keys[256]) const = 0; + + protected: + Keyboard(const std::string &vendor, bool buffered, int devID, InputManager* creator) + : Object(vendor, OISKeyboard, buffered, devID, creator), + mModifiers(0), mListener(0), mTextMode(Unicode) {} + + //! Bit field that holds status of Alt, Ctrl, Shift + unsigned int mModifiers; + + //! Used for buffered/actionmapping callback + KeyListener *mListener; + + //! The current translation mode + TextTranslationMode mTextMode; + }; +} +#endif diff --git a/Src/CH91PayloadSoftware/OISMouse.h b/Src/CH91PayloadSoftware/OISMouse.h new file mode 100644 index 0000000..513f70e --- /dev/null +++ b/Src/CH91PayloadSoftware/OISMouse.h @@ -0,0 +1,143 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef OIS_Mouse_H +#define OIS_Mouse_H +#include "OISObject.h" +#include "OISEvents.h" + +namespace OIS +{ + //! Button ID for mouse devices + enum MouseButtonID + { + MB_Left = 0, MB_Right, MB_Middle, + MB_Button3, MB_Button4, MB_Button5, MB_Button6, MB_Button7 + }; + + /** + Represents the state of the mouse + All members are valid for both buffered and non buffered mode + */ + class _OISExport MouseState + { + public: + MouseState() : width(50), height(50), buttons(0) {}; + + /** Represents the height/width of your display area.. used if mouse clipping + or mouse grabbed in case of X11 - defaults to 50.. Make sure to set this + and change when your size changes.. */ + mutable int width, height; + + //! X Axis component + Axis X; + + //! Y Axis Component + Axis Y; + + //! Z Axis Component + Axis Z; + + //! represents all buttons - bit position indicates button down + int buttons; + + //! Button down test + inline bool buttonDown( MouseButtonID button ) const + { + return ((buttons & ( 1L << button )) == 0) ? false : true; + } + + //! Clear all the values + void clear() + { + X.clear(); + Y.clear(); + Z.clear(); + buttons = 0; + } + }; + + /** Specialised for mouse events */ + class _OISExport MouseEvent : public EventArg + { + public: + MouseEvent( Object *obj, const MouseState &ms ) : EventArg(obj), state(ms) {} + virtual ~MouseEvent() {} + + //! The state of the mouse - including buttons and axes + const MouseState &state; + + private: + // Prevent copying. + MouseEvent(const MouseEvent&); + MouseEvent& operator=(MouseEvent); + }; + + /** + To recieve buffered mouse input, derive a class from this, and implement the + methods here. Then set the call back to your Mouse instance with Mouse::setEventCallback + */ + class _OISExport MouseListener + { + public: + virtual ~MouseListener() {} + virtual bool mouseMoved( const MouseEvent &arg ) = 0; + virtual bool mousePressed( const MouseEvent &arg, MouseButtonID id ) = 0; + virtual bool mouseReleased( const MouseEvent &arg, MouseButtonID id ) = 0; + }; + + /** + Mouse base class. To be implemented by specific system (ie. DirectX Mouse) + This class is useful as you remain OS independent using this common interface. + */ + class _OISExport Mouse : public Object + { + public: + virtual ~Mouse() {} + + /** + @remarks + Register/unregister a Mouse Listener - Only one allowed for simplicity. If broadcasting + is neccessary, just broadcast from the callback you registered. + @param mouseListener + Send a pointer to a class derived from MouseListener or 0 to clear the callback + */ + virtual void setEventCallback( MouseListener *mouseListener ) {mListener = mouseListener;} + + /** @remarks Returns currently set callback.. or 0 */ + MouseListener* getEventCallback() const {return mListener;} + + /** @remarks Returns the state of the mouse - is valid for both buffered and non buffered mode */ + const MouseState& getMouseState() const { return mState; } + + protected: + Mouse(const std::string &vendor, bool buffered, int devID, InputManager* creator) + : Object(vendor, OISMouse, buffered, devID, creator), mListener(0) {} + + //! The state of the mouse + MouseState mState; + + //! Used for buffered/actionmapping callback + MouseListener *mListener; + }; +} +#endif diff --git a/Src/CH91PayloadSoftware/OISMultiTouch.h b/Src/CH91PayloadSoftware/OISMultiTouch.h new file mode 100644 index 0000000..2c337c5 --- /dev/null +++ b/Src/CH91PayloadSoftware/OISMultiTouch.h @@ -0,0 +1,169 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef OIS_MultiTouch_H +#define OIS_MultiTouch_H +#include "OISObject.h" +#include "OISEvents.h" + +#include +#include + +#define OIS_MAX_NUM_TOUCHES 4 // 4 finger touches are probably the highest we'll ever get + +namespace OIS +{ + /** + Represents the state of the multi-touch device + All members are valid for both buffered and non buffered mode + */ + + //! Touch Event type + enum MultiTypeEventTypeID + { + MT_None = 0, MT_Pressed, MT_Released, MT_Moved, MT_Cancelled + }; + + class _OISExport MultiTouchState + { + public: + MultiTouchState() : width(50), height(50), touchType(MT_None) {}; + + /** Represents the height/width of your display area.. used if touch clipping + or touch grabbed in case of X11 - defaults to 50.. Make sure to set this + and change when your size changes.. */ + mutable int width, height; + + //! X Axis component + Axis X; + + //! Y Axis Component + Axis Y; + + //! Z Axis Component + Axis Z; + + int touchType; + + inline bool touchIsType( MultiTypeEventTypeID touch ) const + { + return ((touchType & ( 1L << touch )) == 0) ? false : true; + } + + //! Clear all the values + void clear() + { + X.clear(); + Y.clear(); + Z.clear(); + touchType = MT_None; + } + }; + + /** Specialised for multi-touch events */ + class _OISExport MultiTouchEvent : public EventArg + { + public: + MultiTouchEvent( Object *obj, const MultiTouchState &ms ) : EventArg(obj), state(ms) {} + virtual ~MultiTouchEvent() {} + + //! The state of the touch - including axes + const MultiTouchState &state; + }; + + /** + To receive buffered touch input, derive a class from this, and implement the + methods here. Then set the call back to your MultiTouch instance with MultiTouch::setEventCallback + */ + class _OISExport MultiTouchListener + { + public: + virtual ~MultiTouchListener() {} + virtual bool touchMoved( const MultiTouchEvent &arg ) = 0; + virtual bool touchPressed( const MultiTouchEvent &arg ) = 0; + virtual bool touchReleased( const MultiTouchEvent &arg ) = 0; + virtual bool touchCancelled( const MultiTouchEvent &arg ) = 0; + }; + + /** + MultiTouch base class. To be implemented by specific system (ie. iPhone UITouch) + This class is useful as you remain OS independent using this common interface. + */ + class _OISExport MultiTouch : public Object + { + public: + virtual ~MultiTouch() {} + + /** + @remarks + Register/unregister a MultiTouch Listener - Only one allowed for simplicity. If broadcasting + is necessary, just broadcast from the callback you registered. + @param touchListener + Send a pointer to a class derived from MultiTouchListener or 0 to clear the callback + */ + virtual void setEventCallback( MultiTouchListener *touchListener ) {mListener = touchListener;} + + /** @remarks Returns currently set callback.. or 0 */ + MultiTouchListener* getEventCallback() {return mListener;} + + /** @remarks Clear out the set of input states. Should be called after input has been processed by the application */ + void clearStates(void) { mStates.clear(); } + + /** @remarks Returns the state of the touch - is valid for both buffered and non buffered mode */ + std::vector getMultiTouchStates() const { return mStates; } + + /** @remarks Returns the first n touch states. Useful if you know your app only needs to + process n touches. The return value is a vector to allow random access */ + const std::vector getFirstNTouchStates(int n) { + std::vector states; + for( unsigned int i = 0; i < mStates.size(); i++ ) { + if(!(mStates[i].touchIsType(MT_None))) { + states.push_back(mStates[i]); + } + } + return states; + } + + /** @remarks Returns the first n touch states. Useful if you know your app only needs to + process n touches. The return value is a vector to allow random access */ + const std::vector getMultiTouchStatesOfType(MultiTypeEventTypeID type) { + std::vector states; + for( unsigned int i = 0; i < mStates.size(); i++ ) { + if(mStates[i].touchIsType(type)) { + states.push_back(mStates[i]); + } + } + return states; + } + + protected: + MultiTouch(const std::string &vendor, bool buffered, int devID, InputManager* creator) + : Object(vendor, OISMultiTouch, buffered, devID, creator), mListener(0) {} + + //! The state of the touch device, implemented in a vector to store the state from each finger touch + std::vector mStates; + + //! Used for buffered/actionmapping callback + MultiTouchListener *mListener; + }; +} +#endif diff --git a/Src/CH91PayloadSoftware/OISObject.h b/Src/CH91PayloadSoftware/OISObject.h new file mode 100644 index 0000000..8881305 --- /dev/null +++ b/Src/CH91PayloadSoftware/OISObject.h @@ -0,0 +1,95 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef OIS_Object_H +#define OIS_Object_H + +#include "OISPrereqs.h" +#include "OISInterface.h" + +namespace OIS +{ + /** The base class of all input types. */ + class _OISExport Object + { + public: + virtual ~Object() {} + + /** @remarks Get the type of device */ + Type type() const { return mType; } + + /** @remarks Get the vender string name */ + const std::string& vendor() const { return mVendor; } + + /** @remarks Get buffered mode - true is buffered, false otherwise */ + virtual bool buffered() const { return mBuffered; } + + /** @remarks Returns this input object's creator */ + InputManager* getCreator() const { return mCreator; } + + /** @remarks Sets buffered mode */ + virtual void setBuffered(bool buffered) = 0; + + /** @remarks Used for updating call once per frame before checking state or to update events */ + virtual void capture() = 0; + + /** @remarks This may/may not) differentiate the different controllers based on (for instance) a port number (useful for console InputManagers) */ + virtual int getID() const {return mDevID;} + + /** + @remarks + If available, get an interface to write to some devices. + Examples include, turning on and off LEDs, ForceFeedback, etc + @param type + The type of interface you are looking for + */ + virtual Interface* queryInterface(Interface::IType type) = 0; + + /** @remarks Internal... Do not call this directly. */ + virtual void _initialize() = 0; + + protected: + Object(const std::string &vendor, Type iType, bool buffered, + int devID, InputManager* creator) : + mVendor(vendor), + mType(iType), + mBuffered(buffered), + mDevID(devID), + mCreator(creator) {} + + //! Vendor name if applicable/known + std::string mVendor; + + //! Type of controller object + Type mType; + + //! Buffered flag + bool mBuffered; + + //! Not fully implemented yet + int mDevID; + + //! The creator who created this object + InputManager* mCreator; + }; +} +#endif diff --git a/Src/CH91PayloadSoftware/OISPrereqs.h b/Src/CH91PayloadSoftware/OISPrereqs.h new file mode 100644 index 0000000..ad5b77d --- /dev/null +++ b/Src/CH91PayloadSoftware/OISPrereqs.h @@ -0,0 +1,247 @@ +/* +The zlib/libpng License + +Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com) + +This software is provided 'as-is', without any express or implied warranty. In no event will +the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial +applications, and to alter it and redistribute it freely, subject to the following +restrictions: + + 1. The origin of this software must not be misrepresented; you must not claim that + you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef OIS_Prereqs_H +#define OIS_Prereqs_H +//----------------------------------------------------------------------------// +// This Header File contains: forward declared classes +// * Forward Declarations of all public API classes +// * Several typedef's used around the library +// * Base class component types +// * Preprocessor definitons +//----------------------------------------------------------------------------// + +//-------------- Common STL Containers ---------------------------------------// +#include +#include +#include +#include "OISConfig.h" + +// Default is blank for most OS's +#define _OISExport + +//-------------- Determine Compiler --------------------------------- +#if defined( _MSC_VER ) +# define OIS_MSVC_COMPILER +#elif defined( __GNUC__ ) +# if defined( __WIN32__ ) || defined( _WIN32 ) +# define OIS_MINGW_COMPILER +# else +# define OIS_GCC_COMPILER +# endif +#elif defined( __BORLANDC__ ) +# define OIS_BORLAND_COMPILER +#else +# error No Recognized Compiler! +#endif + +// --------------- Determine Operating System Platform --------------- +#if defined( __WIN32__ ) || defined( _WIN32 ) // Windows 2000, XP, ETC +# if defined ( _XBOX ) +# define OIS_XBOX_PLATFORM +# else +# define OIS_WIN32_PLATFORM +# if defined( OIS_DYNAMIC_LIB ) +# undef _OISExport + //Ignorable Dll interface warning... +# if !defined(OIS_MINGW_COMPILER) +# pragma warning (disable : 4251) +# endif +# if defined( OIS_NONCLIENT_BUILD ) +# define _OISExport __declspec( dllexport ) +# else +# if defined(OIS_MINGW_COMPILER) +# define _OISExport +# else +# define _OISExport __declspec( dllimport ) +# endif +# endif +# endif +# endif +#elif defined( __APPLE_CC__ ) // Apple OS X + // Device Simulator +# if __IPHONE_OS_VERSION_MIN_REQUIRED >= 20201 || __IPHONE_OS_VERSION_MIN_REQUIRED >= 20000 +//# if __IPHONE_OS_VERSION_MIN_REQUIRED >= 30000 || __IPHONE_OS_VERSION_MIN_REQUIRED >= 30000 +# define OIS_IPHONE_PLATFORM +# else +# define OIS_APPLE_PLATFORM +# endif +# undef _OISExport +# define _OISExport __attribute__((visibility("default"))) +#else //Probably Linux +# define OIS_LINUX_PLATFORM +# include +#endif + +//Is Processor 32 or 64 bits... +#if defined(__x86_64__) +# define OIS_ARCH_64 +#else +# define OIS_ARCH_32 +#endif + +//-------------- Various helper preprocessor definitions ---------------------// + +#ifdef OIS_MSVC_COMPILER +# define OIS_INLINE_PRAGMA(x) __pragma(x) // x is intentionally not wrapped; __pragma rejects expressions beginning with '('. +#else +# define OIS_INLINE_PRAGMA(x) +#endif + +#define OIS_MACRO_BEGIN do { + +#define OIS_MACRO_END \ + } OIS_INLINE_PRAGMA(warning(push)) OIS_INLINE_PRAGMA(warning(disable:4127)) while (0) OIS_INLINE_PRAGMA(warning(pop)) + +// This creative trickery taken from this StackOverflow answer: +// http://stackoverflow.com/questions/4030959/will-a-variablename-c-statement-be-a-no-op-at-all-times/4030983#4030983 +#define OIS_UNUSED(x)\ + OIS_MACRO_BEGIN\ + ((void)(true ? 0 : ((x), void(), 0)));\ + OIS_MACRO_END + +//-------------- Common Classes, Enums, and Typdef's -------------------------// +#define OIS_VERSION_MAJOR 1 +#define OIS_VERSION_MINOR 4 +#define OIS_VERSION_PATCH 0 +#define OIS_VERSION_NAME "1.4.0" + +#define OIS_VERSION ((OIS_VERSION_MAJOR << 16) | (OIS_VERSION_MINOR << 8) | OIS_VERSION_PATCH) + +namespace OIS +{ + //Forward Declarations + class InputManager; + class FactoryCreator; + class Object; + class Keyboard; + class Mouse; + class JoyStick; + class MultiTouch; + class KeyListener; + class MouseListener; + class MultiTouchListener; + class JoyStickListener; + class Interface; + class ForceFeedback; + class Effect; + class Exception; + + //! Way to send OS nuetral parameters.. ie OS Window handles, modes, flags + typedef std::multimap ParamList; + + //! List of FactoryCreator's + typedef std::vector FactoryList; + + //! Map of FactoryCreator created Objects + typedef std::map FactoryCreatedObject; + + //! Each Input class has a General Type variable, a form of RTTI + enum Type + { + OISUnknown = 0, + OISKeyboard = 1, + OISMouse = 2, + OISJoyStick = 3, + OISTablet = 4, + OISMultiTouch = 5 + }; + + //! Map of device objects connected and their respective vendors + typedef std::multimap DeviceList; + + //-------- Shared common components ------------------------// + + //! Base type for all device components (button, axis, etc) + enum ComponentType + { + OIS_Unknown = 0, + OIS_Button = 1, //ie. Key, mouse button, joy button, etc + OIS_Axis = 2, //ie. A joystick or mouse axis + OIS_Slider = 3, // + OIS_POV = 4, //ie. Arrow direction keys + OIS_Vector3 = 5 //ie. WiiMote orientation + }; + + //! Base of all device components (button, axis, etc) + class _OISExport Component + { + public: + Component() : cType(OIS_Unknown) {}; + explicit Component(ComponentType type) : cType(type) {}; + //! Indicates what type of coponent this is + ComponentType cType; + }; + + //! Button can be a keyboard key, mouse button, etc + class _OISExport Button : public Component + { + public: + Button() : Component(OIS_Button), pushed(false) {} + explicit Button(bool bPushed) : Component(OIS_Button), pushed(bPushed) {} + //! true if pushed, false otherwise + bool pushed; + }; + + //! Axis component + class _OISExport Axis : public Component + { + public: + Axis() : Component(OIS_Axis), abs(0), rel(0), absOnly(false) {}; + + //! Absoulte and Relative value components + int abs, rel; + + //! Indicates if this Axis only supports Absoulte (ie JoyStick) + bool absOnly; + + //! Used internally by OIS + void clear() + { + abs = rel = 0; + } + }; + + //! A 3D Vector component (perhaps an orientation, as in the WiiMote) + class _OISExport Vector3 : public Component + { + public: + Vector3() {} + Vector3(float _x, float _y, float _z) : Component(OIS_Vector3), x(_x), y(_y), z(_z) {}; + + //! X component of vector + float x; + + //! Y component of vector + float y; + + //! Z component of vector + float z; + + void clear() + { + x = y = z = 0.0f; + } + }; +} + +#endif //end if prereq header defined diff --git a/Src/CH91PayloadSoftware/OIS_static.lib b/Src/CH91PayloadSoftware/OIS_static.lib new file mode 100644 index 0000000..dcdeaa0 Binary files /dev/null and b/Src/CH91PayloadSoftware/OIS_static.lib differ diff --git a/Src/CH91PayloadSoftware/OIS_static_d.lib b/Src/CH91PayloadSoftware/OIS_static_d.lib new file mode 100644 index 0000000..4125d64 Binary files /dev/null and b/Src/CH91PayloadSoftware/OIS_static_d.lib differ diff --git a/Src/CH91PayloadSoftware/QBStru.h b/Src/CH91PayloadSoftware/QBStru.h new file mode 100644 index 0000000..6a5fa7d --- /dev/null +++ b/Src/CH91PayloadSoftware/QBStru.h @@ -0,0 +1,634 @@ +/* +* 文件名称:QBInfo.h +* 摘 要:定义情报处理通用数据结构 +* 当前版本:2.0 王家星 20170311 +*/ + +#pragma once + +#pragma pack(1) + +// 昼夜光电侦察平台复接数据结构体 110字节,顺序不可调整 +// struct struProtocal_FJ +// { +// // 帧头 +// UINT8 Head[2]; // 帧头: EB 90 +// +// // 载荷参数 +// UINT8 ZH_Type; // 载荷识别码 +// // 0x10:数码相机侦察平台 +// // 0x20:昼夜光电侦察平台 +// UINT8 ZH_CmdType; // 开关指令回报 +// UINT8 ZH_WorkState; // 载荷工作状态 +// UINT8 ZH_CtrlState0; // 主控状态字0 +// UINT8 ZH_CtrlState1; // 主控状态字1 +// UINT8 ZH_ServoState; // 伺服状态字 +// UINT8 ZH_EOState0; // 可见光状态字0 +// +// UINT8 ZH_IRState; // 昼夜光电侦察平台:红外状态字 +// // 数码相机侦察平台:数码相机曝光时间 +// +// UINT8 ZH_TrackState; // 跟踪器状态字 +// UINT8 ZH_RecorderState; // 记录仪状态字 +// +// +// INT16 ZH_Pitch; // 载荷俯仰角 +// INT16 ZH_Azimuth; // 载荷方位角 +// UINT16 ZH_LaserDist; // 激光测距值 +// UINT16 ZH_EOFocalLen; // 可见光焦距 +// +// UINT16 ZH_IRFocalLen; // 昼夜光电侦察平台:红外焦距 +// // 数码相机侦察平台:照片总编号:自上电起所有拍照总数 +// +// INT16 ZH_DeltaX; // 俯仰脱靶量 +// INT16 ZH_DeltaY; // 方位脱靶量 +// +// UINT8 ZH_EOState1; // 可见光状态字1 +// UINT8 ZH_LaserIndicateState; // 激光照射状态字 +// +// UINT8 ZH_ImgType; // 图像类型 +// UINT8 ZH_ImgFlow; // 图像码率 +// +// UINT8 ZH_SMOverlapRatio; // 数码照片重叠率 分辨率为0.5%, 范围:0%~100% +// UINT8 CHKSUM; // 和校验位 1~32字节累和低8位为0x00 +// +// // 第二部分:表4的部分内容,即struProtocal_FKtoZH后半部分内容(11-87) +// +// // 飞机参数(部分) +// UINT8 UAV_Type; // 无人机型号 +// UINT8 UAV_ID; // 无人机ID +// UINT8 UAV_States[11]; // 无人机飞行状态 +// INT16 UAV_GyroPitch; // 垂直陀螺俯仰角 +// INT16 UAV_GyroRoll; // 垂直陀螺滚转角 +// UINT16 UAV_AirPresAlt; // 无人机气压高度 +// UINT16 UAV_MagHeading; // 无人机磁航向角 +// +// // 左右两个GPS测量数据(可测飞机滚转角) +// UINT8 GPS_LR_WorkState; // 卫导1定位测资状态 +// UINT32 GPS_LR_UTC; // 卫导1时分秒 +// UINT8 GPS_LR_Day; // 卫导1日 +// UINT8 GPS_LR_Month; // 卫导1月 +// UINT8 GPS_LR_Year; // 卫导1年 +// INT32 GPS_LR_Lat; // 卫导1纬度 +// INT32 GPS_LR_Lon; // 卫导1经度 +// UINT16 GPS_LR_Alt; // 卫导1高度 +// UINT16 GPS_LR_VHeading; // 卫导1地速方向(实际运动方向) +// UINT16 GPS_LR_HoriSpeed; // 卫导1水平速度 +// INT16 GPS_LR_VertSpeed; // 卫导1天速(垂直速度) +// UINT16 GPS_LR_Heading; // 卫导1航向角(机头方向) +// INT16 GPS_LR_Roll; // 卫导1滚转角 +// +// // 前后两个GPS测量数据(可测飞机俯仰角) +// UINT8 GPS_FB_WorkState; // 卫导2定位测资状态 +// UINT32 GPS_FB_UTC; // 卫导2时分秒 +// UINT8 GPS_FB_Day; // 卫导2日 +// UINT8 GPS_FB_Month; // 卫导2月 +// UINT8 GPS_FB_Year; // 卫导2年 +// INT32 GPS_FB_Lat; // 卫导2纬度 +// INT32 GPS_FB_Lon; // 卫导2经度 +// UINT16 GPS_FB_Alt; // 卫导2高度 +// UINT16 GPS_FB_VHeading; // 卫导2地速方向(实际运动方向) +// UINT16 GPS_FB_HoriSpeed; // 卫导2水平速度 +// INT16 GPS_FB_VertSpeed; // 卫导2天速(垂直速度) +// UINT16 GPS_FB_Heading; // 卫导2航向角(机头方向) +// INT16 GPS_FB_Pitch; // 卫导2俯仰角 +// +// UINT8 CHKSUM2; // 和校验位 +// }; + +// 昼夜光电侦察平台复接数据结构体 110字节,顺序不可调整 +struct struProtocal_FJ +{ + // 帧头 + UINT8 Head[2]; // 帧头: EB 90 + + // 载荷参数 + UINT8 ZH_Type; // 载荷识别码 + // 0x10:数码相机侦察平台 + // 0x20:昼夜光电侦察平台 + UINT8 ZH_CmdType; // 开关指令回报 + UINT8 ZH_WorkState; // 载荷工作状态 + UINT8 ZH_CtrlState0; // 主控状态字0 + UINT8 ZH_CtrlState1; // 主控状态字1 + UINT8 ZH_ServoState; // 伺服状态字 + UINT8 ZH_EOState0; // 可见光状态字0 + + UINT8 ZH_IRState; // 昼夜光电侦察平台:红外状态字 + // 数码相机侦察平台:数码相机曝光时间 + + UINT8 ZH_TrackState; // 跟踪器状态字 + UINT8 ZH_RecorderState; // 记录仪状态字 + + + INT16 ZH_Pitch; // 载荷俯仰角 + INT16 ZH_Azimuth; // 载荷方位角 + UINT16 ZH_LaserDist; // 激光测距值 + UINT16 ZH_EOFocalLen; // 可见光焦距 + + UINT16 ZH_IRFocalLen; // 昼夜光电侦察平台:红外焦距 + // 数码相机侦察平台:照片总编号:自上电起所有拍照总数 + + INT16 ZH_DeltaX; // 俯仰脱靶量 + INT16 ZH_DeltaY; // 方位脱靶量 + + UINT8 ZH_EOState1; // 可见光状态字1 + UINT8 ZH_LaserIndicateState; // 激光照射状态字(含义见载荷补充协议) + + UINT8 ZH_ImgType; // 图像类型 + UINT8 ZH_ImgFlow; // 图像码率 + + UINT8 ZH_SMOverlapRatio; // 数码照片重叠率 分辨率为0.5%, 范围:0%~100% + UINT8 CHKSUM; // 和校验位 1~32字节累和低8位为0x00 + + // 第二部分:表4的部分内容,即struProtocal_FKtoZH后半部分内容(11-87) + + // 飞机参数(部分) + UINT8 UAV_Type; // 无人机型号 + UINT8 UAV_ID; // 无人机ID + UINT8 UAV_States[11]; // 无人机飞行状态 + INT16 UAV_GyroPitch; // 垂直陀螺俯仰角 + INT16 UAV_GyroRoll; // 垂直陀螺滚转角 + UINT16 UAV_AirPresAlt; // 无人机气压高度 + UINT16 UAV_MagHeading; // 无人机磁航向角 + + // 左右两个GPS测量数据(可测飞机滚转角) + UINT8 GPS_LR_WorkState; // 卫导1定位测资状态 + UINT32 GPS_LR_UTC; // 卫导1时分秒 + UINT8 GPS_LR_Day; // 卫导1日 + UINT8 GPS_LR_Month; // 卫导1月 + UINT8 GPS_LR_Year; // 卫导1年 + INT32 GPS_LR_Lat; // 卫导1纬度 + INT32 GPS_LR_Lon; // 卫导1经度 + UINT16 GPS_LR_Alt; // 卫导1高度 + UINT16 GPS_LR_VHeading; // 卫导1地速方向(实际运动方向) + UINT16 GPS_LR_HoriSpeed; // 卫导1水平速度 + INT16 GPS_LR_VertSpeed; // 卫导1天速(垂直速度) + UINT16 GPS_LR_Heading; // 卫导1航向角(机头方向) + INT16 GPS_LR_Roll; // 卫导1滚转角 + + // 前后两个GPS测量数据(可测飞机俯仰角) + UINT8 GPS_FB_WorkState; // 卫导2定位测资状态 + UINT32 GPS_FB_UTC; // 卫导2时分秒 + UINT8 GPS_FB_Day; // 卫导2日 + UINT8 GPS_FB_Month; // 卫导2月 + UINT8 GPS_FB_Year; // 卫导2年 + INT32 GPS_FB_Lat; // 卫导2纬度 + INT32 GPS_FB_Lon; // 卫导2经度 + UINT16 GPS_FB_Alt; // 卫导2高度 + UINT16 GPS_FB_VHeading; // 卫导2地速方向(实际运动方向) + UINT16 GPS_FB_HoriSpeed; // 卫导2水平速度 + INT16 GPS_FB_VertSpeed; // 卫导2天速(垂直速度) + UINT16 GPS_FB_Heading; // 卫导2航向角(机头方向) + INT16 GPS_FB_Pitch; // 卫导2俯仰角 + + UINT8 CHKSUM2; // 和校验位 +}; + +// 转换后的组播位置信息数据结构体 +struct struSocketProtocal +{ + UINT8 Socket_Head[2]; // 帧头 + UINT8 Socket_Marker; // 帧标识 + UINT8 Socket_Sender; // 发送方标识 + UINT16 Socket_FrameCount; // 帧计数 + INT32 UAV_Lon; // 自身经度 + INT32 UAV_Lat; // 自身纬度 + INT16 UAV_Alt; // 自身高度 + INT32 Target_Lon; // 目标经度 + INT32 Target_Lat; // 目标纬度 + INT16 Target_Alt; // 目标高度 + UINT8 CRC[2]; // CRC16校验 + UINT8 Socket_End[2]; // 帧尾 +}; + +// 转换后的图像复接数据结构体 +struct struTranslateProtocal_FJ +{ + bool bValid; // 结构体数据是否有效: TRUE—有效 FALSE—无效 + + // 载荷参数 + UINT8 ZH_Type; // 载荷识别码 0x10—数码相机侦察平台 0x20—昼夜光电侦查平台 + + UINT8 ZH_CmdType; // 回报开关指令 + + //载荷工作状态——主界面显示 + UINT8 ZH_StablePlatformWorkState; // 稳定平台工作状态:000—手动跟踪 001—自动跟踪 010—锁定 011—数引 100—扫描 101—刹车(昼夜光电平台)垂直随动(数码相机平台) 110—初始化 111—偏心跟踪 + UINT8 ZH_LaserRangeWorkState; // 激光测距仪工作状态:000—正常 001—故障 010—关机 011—待机 100—测距开 101—测距关 111—休息 + UINT8 ZH_ElevatorWorkState; // 升降机构工作状态:00—顶端 01—底端 10—上升 11—下降 + + //状态字 + UINT8 ZH_CtrlState0; // 主控状态字0 + UINT8 ZH_CtrlState1; // 主控状态字1 + UINT8 ZH_ServoState; // 伺服状态字 + + //可见光状态字0 + UINT8 ZH_EOCameraWorkState; // EO相机状态: 0—正常 1—故障 + UINT8 ZH_EOCameraImgState; // EO图像状态: 0—真实 1:—自检 + + //红外状态字 + UINT8 ZH_IRCameraWorkState; // 红外相机状态: 0—正常 1—故障 + UINT8 ZH_IRCameraImgState; // 红外图像状态: 0—真实 1:—自检 + UINT8 ZH_IRCameraDigitalDouble; // 热像仪数字变倍:0—正常 1—数字变倍2X + + //配合11所调试激光状态字,占用可见光状态字1字节 + UINT8 ZH_LASERTEST_D7; // 全系统: 0-正常 1-故障 + UINT8 ZH_LASERTEST_D6; // 温控: 0-正常 1-故障 + UINT8 ZH_LASERTEST_D5; // 驱动: 0-正常 1-故障 + UINT8 ZH_LASERTEST_D4; // 照射循环:0-未完成 1-已完成 + UINT8 ZH_LASERTEST_D3; // 主波: 0-有主波 1-无主波 + UINT8 ZH_LASERTEST_D2; // 回波: 0-有回波 1-无回波 + UINT8 ZH_LASERTEST_D1D0;//工作状态:00:待机 01:测距 10:照射 11:休息 + + + // 数码相机曝光时间 + UINT ZH_SMExposalTime; // 数码照片曝光时间 200~5000us + + // 跟踪器状态 + UINT8 ZH_EOTrackState_Control; // 可见光接收球上主控数据:0—正常 1—故障 + UINT8 ZH_EOTrackState; // 可见光跟踪器状态:000—正常 001—异常 010—目标丢失 011—相关跟踪 100—重心黑 101—重心白 110-冻结当前帧 111-显示当前帧 + UINT8 ZH_IRTrackState_Control; // 红外接收球上主控数据:0—正常 1—故障 + UINT8 ZH_IRTrackState; // 红外跟踪器状态:000—正常 001—异常 010—目标丢失 011—相关跟踪 100—重心黑 101—重心白 110-冻结当前帧 111-显示当前帧 + + + float ZH_Pitch; // 载荷俯仰角 + float ZH_Azimuth; // 载荷方位角 + bool ZH_LaserOn; // 激光测距开关,true为开 + unsigned int ZH_LaserDist; // 激光测距值 + float ZH_EOFocalLen; // 可见光焦距 + float ZH_IRFocalLen; // 红外焦距 + + UINT ZH_SMSerialNumber; // 数码相机照片总编号 + + int ZH_DeltaX; // 俯仰脱靶量 + int ZH_DeltaY; // 方位脱靶量 + + + + UINT8 ZH_ImgType; // 图像类型:0x01—可见光 0x02—红外 0x03-数码照片 0x04—可见光&红外 0x07-可见光&数码照片 + UINT8 ZH_ImgFlow; // 图像码流:0x03—3Mbps 0x05—5Mbps 0x08—7.68Mbps + + float ZH_SMOverlapRatio; // 数码照片重叠率 + + double ZH_EOPixelSize; // 可见光像元尺寸 + double ZH_IRPixelSize; // 红外像元尺寸 非数字变倍15um + double ZH_SMPixelSize; // 数码照片像元尺寸 + + + // 第二部分:表4的部分内容,即struProtocal_FKtoZH后半部分内容(11-87) + + // 飞机参数(部分) + UINT8 UAV_Type; // 无人机型号 + UINT8 UAV_ID; // 无人机ID + UINT8 UAV_States[11]; // 无人机飞行状态 + float UAV_GyroPitch; // 垂直陀螺俯仰角 + float UAV_GyroRoll; // 垂直陀螺滚转角 + float UAV_AirPresAlt; // 无人机气压高度 + float UAV_MagHeading; // 无人机磁航向角 + + // 左右两个GPS测量数据(可测飞机滚转角) + UINT8 GPS_LR_WorkState; // 卫导1定位测资状态 + UINT8 GPS_LR_Location; // 卫导1定位 + UINT8 GPS_LR_Attitude; // 卫导1测姿 + unsigned int GPS_LR_UTC; // 卫导1时分秒 + unsigned int GPS_LR_Day; // 卫导1日 + unsigned int GPS_LR_Month;// 卫导1月 + unsigned int GPS_LR_Year; // 卫导1年 + float GPS_LR_Lon; // 卫导1经度 + float GPS_LR_Lat; // 卫导1纬度 + float GPS_LR_Alt; // 卫导1高度 + float GPS_LR_VHeading; // 卫导1地速方向(实际运动方向) + float GPS_LR_HoriSpeed; // 卫导1水平速度 + float GPS_LR_VertSpeed; // 卫导1天速(垂直速度) + float GPS_LR_Heading; // 卫导1航向角(机头方向) + float GPS_LR_Roll; // 卫导1滚转角 + + // 前后两个GPS测量数据(可测飞机俯仰角) + UINT8 GPS_FB_WorkState; // 卫导2定位测资状态 + UINT8 GPS_FB_Location; // 卫导2定位 + UINT8 GPS_FB_Attitude; // 卫导2测姿 + unsigned int GPS_FB_UTC; // 卫导2时分秒 + unsigned int GPS_FB_Day; // 卫导2日 + unsigned int GPS_FB_Month; // 卫导2月 + unsigned int GPS_FB_Year; // 卫导2年 + float GPS_FB_Lon; // 卫导2经度 + float GPS_FB_Lat; // 卫导2纬度 + float GPS_FB_Alt; // 卫导2高度 + float GPS_FB_VHeading; // 卫导2地速方向(实际运动方向) + float GPS_FB_HoriSpeed; // 卫导2水平速度 + float GPS_FB_VertSpeed; // 卫导2天速(垂直速度) + float GPS_FB_Heading; // 卫导2航向角(机头方向) + float GPS_FB_Pitch; // 卫导2俯仰角 + + struTranslateProtocal_FJ() + { + bValid = false; + } +}; + +// 图像中心点定位结构体 +struct struCenterLocation +{ + bool bValid; // 是否有效 + double Lon; // 经度 + double Lat; // 纬度 + double H; // 高度 + + struCenterLocation() + { + bValid = false; + Lon = 0; + Lat = 0; + H = 0; + } +}; + +// 情报处理复接数据结构体 +struct struQB_FJ +{ +// bool bValid; // 结构体数据是否有效: TRUE—有效 FALSE—无效 +// +// // 载荷姿态和属性 +// UINT8 ZH_StablePlatformWorkState; // 稳定平台工作状态:000—手动跟踪 001—自动跟踪 010—锁定 011—数引 100—扫描 101—刹车 110—初始化 111—偏心跟踪 +// UINT8 ZH_TrackState; // 跟踪器状态:000—正常 001—异常 010—目标丢失 011—相关跟踪 100—重心黑 101—重心白 +// float ZH_Pitch; // 载荷俯仰角 +// float ZH_Azimuth; // 载荷方位角 +// bool ZH_LaserOn; // 激光测距开关,true为开 +// double ZH_LaserDist; // 激光测距值 +// float ZH_FocalLen; //焦距 mm +// float ZH_IRFocalLen; // IR焦距 mm(CH96补充) +// int ZH_DeltaX; //俯仰脱靶量 +// int ZH_DeltaY; //方位脱靶量 +// double ZH_PixelSize; //像元尺寸 +// int ZH_ImgWidth; // 图像宽 +// int ZH_ImgHeight; // 图像高 +// +// // 飞机位置姿态GPS +// double UAV_GPS_Lon; // 无人机经度 +// double UAV_GPS_Lat; // 无人机纬度 +// float UAV_GPS_Alt; // 无人机高度 +// float UAV_GPS_HSpeed; // 水平速度 +// float UAV_Pitch; // 俯仰角 +// float UAV_Yaw; // 航向角(机头方向) +// float UAV_Roll; // 滚转角 +// float UAV_GroundHeight; // 无人机下视点地面高度:地面计算获取30米高程 +// +// // GPS时间 +// unsigned int UAV_GPS_Year; // 卫导1年 +// unsigned int UAV_GPS_Month; // 卫导1月 +// unsigned int UAV_GPS_Day; // 卫导1日 +// unsigned int UAV_GPS_UTC; // 卫导1时分秒 +// +// // 附加部分 +// struCenterLocation centerLoc; // 图像中心点地理坐标,目标定位时会用到 +// +// struQB_FJ() +// { +// bValid = false; +// } + + bool bValid; // 结构体数据是否有效: TRUE—有效 FALSE—无效 + + // 载荷姿态和属性 + UINT8 ZH_StablePlatformWorkState; // 稳定平台工作状态:000—手动跟踪 001—自动跟踪 010—锁定 011—数引 100—扫描 101—刹车 110—初始化 111—偏心跟踪 + UINT8 ZH_TrackState; // 跟踪器状态:000—正常 001—异常 010—目标丢失 011—相关跟踪 100—重心黑 101—重心白 + float ZH_Pitch; // 载荷俯仰角 + float ZH_Azimuth; // 载荷方位角 + bool ZH_LaserOn; // 激光测距开关,true为开 + double ZH_LaserDist; // 激光测距值 + float ZH_FocalLen; //焦距 mm + int ZH_DeltaX; //俯仰脱靶量 + int ZH_DeltaY; //方位脱靶量 + double ZH_PixelSize; //像元尺寸 + int ZH_ImgWidth; // 图像宽 + int ZH_ImgHeight; // 图像高 + + // 飞机位置姿态GPS + double UAV_GPS_Lon; // 无人机经度 + double UAV_GPS_Lat; // 无人机纬度 + float UAV_GPS_Alt; // 无人机高度 + float UAV_GPS_HSpeed; // 水平速度 + float UAV_Pitch; // 俯仰角 + float UAV_Yaw; // 航向角(机头方向) + float UAV_Roll; // 滚转角 + float UAV_GroundHeight; // 无人机下视点地面高度:地面计算获取30米高程 + + // GPS时间 + unsigned int UAV_GPS_Year; // 卫导1年 + unsigned int UAV_GPS_Month; // 卫导1月 + unsigned int UAV_GPS_Day; // 卫导1日 + unsigned int UAV_GPS_UTC; // 卫导1时分秒 + + // 附加部分 + struCenterLocation centerLoc; // 图像中心点地理坐标,目标定位时会用到 + + struQB_FJ() + { + bValid = false; + } +}; + + +// 图像经纬度边界 +struct GeoBoundingBox +{ + double NorthLat; // 北纬 + double SouthLat; // 南纬 + double WestLon; // 西经 + double EastLon; // 东经 + + GeoBoundingBox() + { + NorthLat = -200.0; + SouthLat = -200.0; + WestLon = -200.0; + EastLon = -200.0; + } +}; + +//图像信息结构 +struct ImgStru +{ + int ImgWidth; // 图像宽 + int ImgHeight; // 图像高 + int bitcount; // 位数 + GeoBoundingBox BoundingBox; // 经纬度边界(存储几何校正后图像的地理边界信息) + unsigned char* buff; // 图像数据 + + ImgStru() + { + ImgWidth = 0; + ImgHeight = 0; + bitcount = 0; + buff = NULL; + } + + ~ImgStru() + { + if ( buff != NULL ) + { + delete[] buff; + buff = NULL; + } + } + +}; + +//图像数据:输入图像、输出图像、TIF图像 +struct ImgData +{ + bool bValid; //是否有效 + ImgStru srcImg; //输入图像数据 + ImgStru dstImg; //输出图像数据 + ImgStru geoImg; //TIF文件数据 +}; + +// 情报结构体 +struct QBStru +{ + //struTranslateProtocal_FJ frameAll; // 全部复接数据 + struQB_FJ framePart; // 部分复接数据 + ImgData image; // 图像数据 + + QBStru() + { + //memset(&frameAll, 0, sizeof(struTranslateProtocal_FJ)); + memset(&framePart, 0, sizeof(struQB_FJ)); + memset(&image, 0, sizeof(ImgData)); + } +}; +// CH96协议 +struct Protocal96TXD +{ + //载荷参数 + UINT8 head[2]; // 帧头(1-2) + + UINT8 mem1; // 预留,载荷参数开始(3) + UINT8 SwitchCmd; // 开关指令(4) + UINT8 Status0; // 状态字0(暂无)(5) + UINT8 Status1; // 状态字1(图像状态)(6) + UINT16 EOFocus; // 可见光焦距值(7-8) + UINT8 Status2; // 状态字2(伺服状态)(9) + UINT32 FrameCount; // 帧计数值(时码)(10-13) + INT16 dx; // 俯仰脱靶量(14-15) + INT16 dy; // 方位脱靶量(16-17) + UINT16 IRFocus; // 红外焦距值(18-19) + UINT16 LaserDis; // 激光测距值(20-21) + UINT8 LaserState; // 激光状态(测距开关)(22) + UINT32 None_1; // 无(23-26) + UINT32 None_2; // 无(27-30) + INT16 ZH_Pitch; // 载荷俯仰角(31-32) + INT16 ZH_Azimuth; // 载荷方位角(33-34) + UINT16 PixelSize; // 像元大小(35-36) + UINT16 mem2[6]; // 压缩/所取图像/横向/纵向分辨率(37-48) + + //飞机参数 + INT16 PlaneID; //飞机ID(49-50)(1-2) + INT16 Pitch; //飞机测姿俯仰角(51-52)(3-4) + INT16 Roll; //飞机测姿滚转角(53-54)(5-6) + INT16 Yaw; //飞机测姿航向角(55-56)(7-8) + INT32 Satelite_lon; //飞机测姿经度(57-60)(9-12) + INT32 Satelite_lat; //飞机测姿纬度(61-64)(13-16) + INT32 Satelite_height; //飞机测姿高度(65-68)(17-20) + INT16 Satelite_Ground_Speed; //飞机测姿地速(69-70)(21-22) + INT16 Satelite_Ground_Speed_Dir; //测姿GPS地速方向(71-72)(23-24) + INT16 Satelite_Sky_Speed; //测姿GPS天速(73-74)(25-26) + INT16 MTI_Pitch; //MTI俯仰角(75-76)(27-28) + INT16 MTI_Roll; //MTI滚转角(77-78)(29-30) + INT16 MTI_Yaw; //MTI航向角(79-80)(31-32) + INT32 MTI_lon; //MTI经度(81-84)(33-36) + INT32 MTI_lat; //MTI纬度(85-88)(37-40) + INT16 MTI_height; //MTI高度(89-90)(41-42) + INT16 MTI_Ground_Speed; //MTI地速(91-92)(43-44) + INT16 MTI_Ground_Speed_Dir; //MTI地速方向(93-94)(45-46) + INT16 MTI_Sky_Speed; //MTI天速(95-96)(47-48) + UINT32 UTC_Second; //UTC天秒(97-100)(49-52) + UINT8 UTC_Year; //UTC年(101)(53) + UINT8 UTC_Month; //UTC 月(102)(54) + UINT8 UTC_Day; //UTC 日(103)(55) + UINT8 NavigationState; //导航状态(104)(56) + UINT16 PressureHEG; //气压高度(105-106)(57-58) + INT16 AirSpeed; //空速(107-108)(59-60) + UINT8 Engine_Speed; //发动机转速(109)(61) + INT8 Left_Tmp; //左缸温(110)(62) + INT8 Right_Tmp; //右缸温(111)(63) + INT8 Pitch_Install_Err; //载荷俯仰安装误差(112)(64) + INT8 Roll_Install_Err; //载荷滚转安装误差(113)(65) + INT8 Yaw_Install_Err; //载荷偏航安装误差(114)(66) + UINT8 mem3; //预留(115)(67) + INT8 GPS_Parm[38]; //测姿GPS 参数(116-148)(68-100) + + UINT16 CRC; //飞参数据校验(149-150) +}; + +struct Data96TXD +{ + //载荷参数 + UINT8 head[2]; // 帧头(1-2) + + UINT8 mem1; // 预留,载荷参数开始(3) + UINT8 SwitchCmd; // 开关指令(4) + UINT8 Status0; // 状态字0(暂无)(5) + UINT8 Status1; // 状态字1(图像状态)(6) + float EOFocus; // 可见光焦距值(7-8) + UINT8 Status2; // 状态字2(伺服状态)(9) + UINT32 FrameCount; // 帧计数值(时码)(10-13) + int dx; // 俯仰脱靶量(14-15) + int dy; // 方位脱靶量(16-17) + float IRFocus; // 红外焦距值(18-19) + int LaserDis; // 激光测距值(20-21) + UINT8 LaserState; // 激光状态(测距开关)(22) + UINT32 None_1; // 无(23-26) + UINT32 None_2; // 无(27-30) + float ZH_Pitch; // 载荷俯仰角(31-32) + float ZH_Azimuth; // 载荷方位角(33-34) + float PixelSize; // 像元大小(35-36) + UINT16 mem2[6]; // 压缩/所取图像/横向/纵向分辨率(37-48) + + //飞机参数 + int PlaneID; //飞机ID(49-50)(1-2) + float Pitch; //飞机测姿俯仰角(51-52)(3-4) + float Roll; //飞机测姿滚转角(53-54)(5-6) + float Yaw; //飞机测姿航向角(55-56)(7-8) + double Satelite_lon; //飞机测姿经度(57-60)(9-12) + double Satelite_lat; //飞机测姿纬度(61-64)(13-16) + double Satelite_height; //飞机测姿高度(65-68)(17-20) + float Satelite_Ground_Speed; //飞机测姿地速(69-70)(21-22) + float Satelite_Ground_Speed_Dir; //测姿GPS地速方向(71-72)(23-24) + float Satelite_Sky_Speed; //测姿GPS天速(73-74)(25-26) + float MTI_Pitch; //MTI俯仰角(75-76)(27-28) + float MTI_Roll; //MTI滚转角(77-78)(29-30) + float MTI_Yaw; //MTI航向角(79-80)(31-32) + double MTI_lon; //MTI经度(81-84)(33-36) + double MTI_lat; //MTI纬度(85-88)(37-40) + double MTI_height; //MTI高度(89-90)(41-42) + float MTI_Ground_Speed; //MTI地速(91-92)(43-44) + float MTI_Ground_Speed_Dir; //MTI地速方向(93-94)(45-46) + float MTI_Sky_Speed; //MTI天速(95-96)(47-48) + int UTC_Second; //UTC天秒(97-100)(49-52) + int UTC_Year; //UTC年(101)(53) + int UTC_Month; //UTC 月(102)(54) + int UTC_Day; //UTC 日(103)(55) + UINT8 NavigationState; //导航状态(104)(56) + float PressureHEG; //气压高度(105-106)(57-58) + float AirSpeed; //空速(107-108)(59-60) + int Engine_Speed; //发动机转速(109)(61) + int Left_Tmp; //左缸温(110)(62) + int Right_Tmp; //右缸温(111)(63) + float Pitch_Install_Err; //载荷俯仰安装误差(112)(64) + float Roll_Install_Err; //载荷滚转安装误差(113)(65) + float Yaw_Install_Err; //载荷偏航安装误差(114)(66) + UINT8 mem3; //预留(115)(67) + INT8 GPS_Parm[38]; //测姿GPS 参数(116-148)(68-100) + + UINT16 CRC; //飞参数据校验(149-150) +}; + +struct MostSimpleTgtInfo +{ + unsigned int ID; + double Lon; + double Lat; + double Alt; +}; + +#pragma pack() diff --git a/Src/CH91PayloadSoftware/QB_AutoMap.lib b/Src/CH91PayloadSoftware/QB_AutoMap.lib new file mode 100644 index 0000000..ad09dd8 Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_AutoMap.lib differ diff --git a/Src/CH91PayloadSoftware/QB_AutoMapD.lib b/Src/CH91PayloadSoftware/QB_AutoMapD.lib new file mode 100644 index 0000000..177be1d Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_AutoMapD.lib differ diff --git a/Src/CH91PayloadSoftware/QB_GDALImg.lib b/Src/CH91PayloadSoftware/QB_GDALImg.lib new file mode 100644 index 0000000..128a772 Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_GDALImg.lib differ diff --git a/Src/CH91PayloadSoftware/QB_GDALImgD.lib b/Src/CH91PayloadSoftware/QB_GDALImgD.lib new file mode 100644 index 0000000..a2e972e Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_GDALImgD.lib differ diff --git a/Src/CH91PayloadSoftware/QB_GeoLocateName.lib b/Src/CH91PayloadSoftware/QB_GeoLocateName.lib new file mode 100644 index 0000000..d39a56d Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_GeoLocateName.lib differ diff --git a/Src/CH91PayloadSoftware/QB_GeoLocateNameD.lib b/Src/CH91PayloadSoftware/QB_GeoLocateNameD.lib new file mode 100644 index 0000000..360c63f Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_GeoLocateNameD.lib differ diff --git a/Src/CH91PayloadSoftware/QB_GoogleMapOperate.lib b/Src/CH91PayloadSoftware/QB_GoogleMapOperate.lib new file mode 100644 index 0000000..77b9e58 Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_GoogleMapOperate.lib differ diff --git a/Src/CH91PayloadSoftware/QB_GoogleMapOperateD.lib b/Src/CH91PayloadSoftware/QB_GoogleMapOperateD.lib new file mode 100644 index 0000000..e63dc53 Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_GoogleMapOperateD.lib differ diff --git a/Src/CH91PayloadSoftware/QB_ImgProcessFun.lib b/Src/CH91PayloadSoftware/QB_ImgProcessFun.lib new file mode 100644 index 0000000..3ce4239 Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_ImgProcessFun.lib differ diff --git a/Src/CH91PayloadSoftware/QB_ImgProcessFunD.lib b/Src/CH91PayloadSoftware/QB_ImgProcessFunD.lib new file mode 100644 index 0000000..11139bb Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_ImgProcessFunD.lib differ diff --git a/Src/CH91PayloadSoftware/QB_ImgShowBase.lib b/Src/CH91PayloadSoftware/QB_ImgShowBase.lib new file mode 100644 index 0000000..8dc3456 Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_ImgShowBase.lib differ diff --git a/Src/CH91PayloadSoftware/QB_ImgShowBaseD.lib b/Src/CH91PayloadSoftware/QB_ImgShowBaseD.lib new file mode 100644 index 0000000..aeb29f4 Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_ImgShowBaseD.lib differ diff --git a/Src/CH91PayloadSoftware/QB_SimpleImgShow.lib b/Src/CH91PayloadSoftware/QB_SimpleImgShow.lib new file mode 100644 index 0000000..802adcb Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_SimpleImgShow.lib differ diff --git a/Src/CH91PayloadSoftware/QB_SimpleImgShowD.lib b/Src/CH91PayloadSoftware/QB_SimpleImgShowD.lib new file mode 100644 index 0000000..ec8f702 Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_SimpleImgShowD.lib differ diff --git a/Src/CH91PayloadSoftware/QB_VideoShowBase.lib b/Src/CH91PayloadSoftware/QB_VideoShowBase.lib new file mode 100644 index 0000000..5284d34 Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_VideoShowBase.lib differ diff --git a/Src/CH91PayloadSoftware/QB_VideoShowBaseD.lib b/Src/CH91PayloadSoftware/QB_VideoShowBaseD.lib new file mode 100644 index 0000000..c459958 Binary files /dev/null and b/Src/CH91PayloadSoftware/QB_VideoShowBaseD.lib differ diff --git a/Src/CH91PayloadSoftware/ReadMe.txt b/Src/CH91PayloadSoftware/ReadMe.txt new file mode 100644 index 0000000..a4c0531 --- /dev/null +++ b/Src/CH91PayloadSoftware/ReadMe.txt @@ -0,0 +1,77 @@ +================================================================================ +MICROSOFT 基础类库: CH91PayloadSoftware 项目概述 +=============================================================================== + +应用程序向导已为您创建了这个 CH91PayloadSoftware 应用程序。此应用程序不仅演示 Microsoft 基础类的基本使用方法,还可作为您编写应用程序的起点。 + +本文件概要介绍组成 CH91PayloadSoftware 应用程序的每个文件的内容。 + +CH91PayloadSoftware.vcxproj +这是使用应用程序向导生成的 VC++ 项目的主项目文件。 +它包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 + +CH91PayloadSoftware.vcxproj.filters + 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。 + 它包含有关项目文件与筛选器之间的关联信息。在 IDE 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。例如,“.cpp”文件与“源文件”筛选器关联。 + +CH91PayloadSoftware.h +这是应用程序的主要头文件。它包括其他项目特定的头文件(包括 Resource.h),并声明 CCH91PayloadSoftwareApp 应用程序类。 + +CH91PayloadSoftware.cpp +这是包含应用程序类 CCH91PayloadSoftwareApp 的主要应用程序源文件。 + +CH91PayloadSoftware.rc +这是程序使用的所有 Microsoft Windows 资源的列表。它包括 RES 子目录中存储的图标、位图和光标。此文件可以直接在 Microsoft Visual C++ 中进行编辑。项目资源位于 2052 中。 + +res\CH91PayloadSoftware.ico +这是用作应用程序图标的图标文件。此图标包括在主要资源文件 CH91PayloadSoftware.rc 中。 + +res\CH91PayloadSoftware.rc2 +此文件包含不在 Microsoft Visual C++ 中进行编辑的资源。您应该将不可由资源编辑器编辑的所有资源放在此文件中。 + + +///////////////////////////////////////////////////////////////////////////// + +应用程序向导创建一个对话框类: + +CH91PayloadSoftwareDlg.h,CH91PayloadSoftwareDlg.cpp - 对话框 +这些文件包含 CCH91PayloadSoftwareDlg 类。该类定义应用程序主对话框的行为。该对话框的模板位于 CH91PayloadSoftware.rc 中,该文件可以在 Microsoft Visual C++ 中进行编辑。 + + +///////////////////////////////////////////////////////////////////////////// + +其他功能: + +ActiveX 控件 +应用程序包括对使用 ActiveX 控件的支持。 + +打印及打印预览支持 +应用程序向导已通过从 MFC 库调用 CView 类中的成员函数,生成了用于处理打印、打印设置和打印预览命令的代码。 + +///////////////////////////////////////////////////////////////////////////// + +其他标准文件: + +StdAfx.h,StdAfx.cpp +这些文件用于生成名为 CH91PayloadSoftware.pch 的预编译头 (PCH) 文件和名为 StdAfx.obj 的预编译类型文件。 + +Resource.h +这是标准头文件,它定义新的资源 ID。 +Microsoft Visual C++ 读取并更新此文件。 + +CH91PayloadSoftware.manifest + 应用程序清单文件供 Windows XP 用来描述应用程序 + 对特定版本并行程序集的依赖性。加载程序使用此 + 信息从程序集缓存加载适当的程序集或 + 从应用程序加载私有信息。应用程序清单可能为了重新分发而作为 + 与应用程序可执行文件安装在相同文件夹中的外部 .manifest 文件包括, + 也可能以资源的形式包括在该可执行文件中。 +///////////////////////////////////////////////////////////////////////////// + +其他注释: + +应用程序向导使用“TODO:”指示应添加或自定义的源代码部分。 + +如果应用程序在共享的 DLL 中使用 MFC,则需要重新发布这些 MFC DLL;如果应用程序所用的语言与操作系统的当前区域设置不同,则还需要重新发布对应的本地化资源 MFC100XXX.DLL。有关这两个主题的更多信息,请参见 MSDN 文档中有关 Redistributing Visual C++ applications (重新发布 Visual C++ 应用程序)的章节。 + +///////////////////////////////////////////////////////////////////////////// diff --git a/Src/CH91PayloadSoftware/SendControlCommand.cpp b/Src/CH91PayloadSoftware/SendControlCommand.cpp new file mode 100644 index 0000000..8f1f011 --- /dev/null +++ b/Src/CH91PayloadSoftware/SendControlCommand.cpp @@ -0,0 +1,574 @@ +// SendControlCommand.cpp : 实现文件 +// + +#include "stdafx.h" +#include "CH91PayloadSoftware.h" +#include "SendControlCommand.h" +#include "afxdialogex.h" +#include "Global.h" +#include "GlobalMember.h" +#include "GlobalMessage.h" + +// CSendControlCommand 对话框 +//struct struCHECK +//{ +// struCHECK() +// { +// C0 = C1 = 0; +// }; +// +// BYTE C0; +// BYTE C1; +//}; + +// const UINT16 Crc_Table[256] = // X16+X12+X5+1 1021余式表 CCITT +// { +// 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, +// 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, +// 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, +// 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, +// 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, +// 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, +// 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, +// 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, +// 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, +// 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, +// 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, +// 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, +// 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, +// 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, +// 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, +// 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, +// 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, +// 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, +// 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, +// 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, +// 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, +// 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, +// 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, +// 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, +// 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, +// 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, +// 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, +// 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, +// 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, +// 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, +// 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, +// 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 +// }; +//const UINT8 Crc_Table[512]= +//{ +// 0x0,0x0,0x89,0x11,0x12,0x23,0x9b,0x32,0x24,0x46,0xad,0x57,0x36,0x65,0xbf,0x74, +// 0x48,0x8c,0xc1,0x9d,0x5a,0xaf,0xd3,0xbe,0x6c,0xca,0xe5,0xdb,0x7e,0xe9,0xf7,0xf8, +// 0x81,0x10,0x8,0x1,0x93,0x33,0x1a,0x22,0xa5,0x56,0x2c,0x47,0xb7,0x75,0x3e,0x64, +// 0xc9,0x9c,0x40,0x8d,0xdb,0xbf,0x52,0xae,0xed,0xda,0x64,0xcb,0xff,0xf9,0x76,0xe8, +// 0x2,0x21,0x8b,0x30,0x10,0x2,0x99,0x13,0x26,0x67,0xaf,0x76,0x34,0x44,0xbd,0x55, +// 0x4a,0xad,0xc3,0xbc,0x58,0x8e,0xd1,0x9f,0x6e,0xeb,0xe7,0xfa,0x7c,0xc8,0xf5,0xd9, +// 0x83,0x31,0xa,0x20,0x91,0x12,0x18,0x3,0xa7,0x77,0x2e,0x66,0xb5,0x54,0x3c,0x45, +// 0xcb,0xbd,0x42,0xac,0xd9,0x9e,0x50,0x8f,0xef,0xfb,0x66,0xea,0xfd,0xd8,0x74,0xc9, +// 0x4,0x42,0x8d,0x53,0x16,0x61,0x9f,0x70,0x20,0x4,0xa9,0x15,0x32,0x27,0xbb,0x36, +// 0x4c,0xce,0xc5,0xdf,0x5e,0xed,0xd7,0xfc,0x68,0x88,0xe1,0x99,0x7a,0xab,0xf3,0xba, +// 0x85,0x52,0xc,0x43,0x97,0x71,0x1e,0x60,0xa1,0x14,0x28,0x5,0xb3,0x37,0x3a,0x26, +// 0xcd,0xde,0x44,0xcf,0xdf,0xfd,0x56,0xec,0xe9,0x98,0x60,0x89,0xfb,0xbb,0x72,0xaa, +// 0x6,0x63,0x8f,0x72,0x14,0x40,0x9d,0x51,0x22,0x25,0xab,0x34,0x30,0x6,0xb9,0x17, +// 0x4e,0xef,0xc7,0xfe,0x5c,0xcc,0xd5,0xdd,0x6a,0xa9,0xe3,0xb8,0x78,0x8a,0xf1,0x9b, +// 0x87,0x73,0xe,0x62,0x95,0x50,0x1c,0x41,0xa3,0x35,0x2a,0x24,0xb1,0x16,0x38,0x7, +// 0xcf,0xff,0x46,0xee,0xdd,0xdc,0x54,0xcd,0xeb,0xb9,0x62,0xa8,0xf9,0x9a,0x70,0x8b, +// 0x8,0x84,0x81,0x95,0x1a,0xa7,0x93,0xb6,0x2c,0xc2,0xa5,0xd3,0x3e,0xe1,0xb7,0xf0, +// 0x40,0x8,0xc9,0x19,0x52,0x2b,0xdb,0x3a,0x64,0x4e,0xed,0x5f,0x76,0x6d,0xff,0x7c, +// 0x89,0x94,0x0,0x85,0x9b,0xb7,0x12,0xa6,0xad,0xd2,0x24,0xc3,0xbf,0xf1,0x36,0xe0, +// 0xc1,0x18,0x48,0x9,0xd3,0x3b,0x5a,0x2a,0xe5,0x5e,0x6c,0x4f,0xf7,0x7d,0x7e,0x6c, +// 0xa,0xa5,0x83,0xb4,0x18,0x86,0x91,0x97,0x2e,0xe3,0xa7,0xf2,0x3c,0xc0,0xb5,0xd1, +// 0x42,0x29,0xcb,0x38,0x50,0xa,0xd9,0x1b,0x66,0x6f,0xef,0x7e,0x74,0x4c,0xfd,0x5d, +// 0x8b,0xb5,0x2,0xa4,0x99,0x96,0x10,0x87,0xaf,0xf3,0x26,0xe2,0xbd,0xd0,0x34,0xc1, +// 0xc3,0x39,0x4a,0x28,0xd1,0x1a,0x58,0xb,0xe7,0x7f,0x6e,0x6e,0xf5,0x5c,0x7c,0x4d, +// 0xc,0xc6,0x85,0xd7,0x1e,0xe5,0x97,0xf4,0x28,0x80,0xa1,0x91,0x3a,0xa3,0xb3,0xb2, +// 0x44,0x4a,0xcd,0x5b,0x56,0x69,0xdf,0x78,0x60,0xc,0xe9,0x1d,0x72,0x2f,0xfb,0x3e, +// 0x8d,0xd6,0x4,0xc7,0x9f,0xf5,0x16,0xe4,0xa9,0x90,0x20,0x81,0xbb,0xb3,0x32,0xa2, +// 0xc5,0x5a,0x4c,0x4b,0xd7,0x79,0x5e,0x68,0xe1,0x1c,0x68,0xd,0xf3,0x3f,0x7a,0x2e, +// 0xe,0xe7,0x87,0xf6,0x1c,0xc4,0x95,0xd5,0x2a,0xa1,0xa3,0xb0,0x38,0x82,0xb1,0x93, +// 0x46,0x6b,0xcf,0x7a,0x54,0x48,0xdd,0x59,0x62,0x2d,0xeb,0x3c,0x70,0xe,0xf9,0x1f, +// 0x8f,0xf7,0x6,0xe6,0x9d,0xd4,0x14,0xc5,0xab,0xb1,0x22,0xa0,0xb9,0x92,0x30,0x83, +// 0xc7,0x7b,0x4e,0x6a,0xd5,0x58,0x5c,0x49,0xe3,0x3d,0x6a,0x2c,0xf1,0x1e,0x78,0xf +//}; +//struCHECK MakeCheckCRC(UINT8 *ptr,UINT8 len) +//{ +// UINT8 temp,i; +// UINT16 crc = 0; +// +// for(i = 0; i < len; i++) +// { +// temp = (UINT8) (crc / 256); // 以8位二进制数暂存CRC 的高8 位 +// crc <<= 8; // 左移 8 位 +// crc ^= Crc_Table[temp ^ *ptr]; // 高字节和当前数据XOR 再查表 +// ptr++; +// } +// struCHECK ck; +// ck.C1 = (crc>>8); +// ck.C0 = (crc&0xff); +// return ck; +//} +IMPLEMENT_DYNAMIC(CSendControlCommand, CDialogEx) + +CSendControlCommand::CSendControlCommand(CWnd* pParent /*=NULL*/) + : CDialogEx(CSendControlCommand::IDD, pParent) +{ + // 各变量初始化 + memset(g_payloadCtrlInstruction, 0, 32); // 初始化为0 + g_bCreatUDP = false; + m_wndManual_Search = nullptr; + // 手动搜索指令盘按钮初始移动速度 + m_Speed = 0; + m_Speed_UpDown = 0; + m_Speed_LeftRight = 0; +} + +CSendControlCommand::~CSendControlCommand() +{ +} + +void CSendControlCommand::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CSendControlCommand, CDialogEx) + ON_WM_TIMER() + ON_MESSAGE(WM_SHOW_MANUAL_SEARCH, CSendControlCommand::ManualSpeed) + ON_WM_DESTROY() +END_MESSAGE_MAP() + + +// CSendControlCommand 消息处理程序 +// 手动搜索指令盘 +void CALLBACK GetDistRatioAndAngleProc(double distRatio, double angle) +{ + if (distRatio >= 0 && distRatio <= 1 && abs(angle) <= 180) + { + if (distRatio > 0.5) + { + distRatio = 0.5; + } + + g_MS_Ratio = distRatio; + g_MS_Angle = angle; + ::SendMessage(g_SendControlCommandDlgHwnd, WM_SHOW_MANUAL_SEARCH , WPARAM(0), LPARAM(0)); + } +} + + +//手动搜索指令盘 +LRESULT CSendControlCommand::ManualSpeed(WPARAM wParam, LPARAM lParam) +{ + // 定义协议序号 + g_payloadCtrlProtocol = 1001; + if (g_MS_Ratio < 1e-6) + { + g_payloadCtrlProtocol = 0; + } + + // 速度变量传递 + m_Speed = static_cast(2 * 512 * g_MS_Ratio); + + m_Speed_LeftRight = static_cast(m_Speed * sin(g_MS_Angle / 180 * CV_PI)); + m_Speed_UpDown = static_cast(m_Speed * cos(g_MS_Angle / 180 * CV_PI)); + + // 更新指令盘图像 + ShowManualSearchImg(g_MS_Angle, g_MS_Ratio); + return 0; +} + +BOOL CSendControlCommand::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + // 更改指令发送帧频 + SetTimer(1,40, nullptr); + + g_SendControlCommandDlgHwnd = GetSafeHwnd(); + // 控制IP和端口绑定 + CString fileSysName = GetSoftwareCurrentDirectory()+ "\\ini\\" + "config.ini"; + char LocalIp1[20]; + unsigned int LocalPort1 = 0; //本地端口 + char RemoteIp1[20]; + unsigned int RemotePort1 = 0; //对方端口 + + GetPrivateProfileString("UDPInfo_SEND2PAYLOAD", "UDPRemoteIP ", "0", RemoteIp1, 20, fileSysName); + GetPrivateProfileString("UDPInfo_SEND2PAYLOAD", "UDPLocalIP", "0", LocalIp1, 20, fileSysName); + + RemotePort1 = GetPrivateProfileInt("UDPInfo_SEND2PAYLOAD", "UDPRemotePort", 0, fileSysName); + LocalPort1 = GetPrivateProfileInt("UDPInfo_SEND2PAYLOAD", "UDPLocalPort", 0, fileSysName); + + assert(LocalPort1 != 0 && RemotePort1 != 0); + g_UdpSend2Payload.SetParams(LocalIp1, LocalPort1, RemoteIp1, RemotePort1); + g_bCreatUDP = g_UdpSend2Payload.StartListening(); + if( g_bCreatUDP == false) + { + ::MessageBoxA(NULL, g_str_WarningPayloadControl, g_str_WarningTitle, MB_OK); + } + //手动搜索控制面板 + if (m_wndManual_Search == nullptr) + { + m_wndManual_Search = new CExportSimpleImgShow(); + } + + if (g_SendControlCommandDlgHwnd != nullptr && m_wndManual_Search != NULL) + { + m_wndManual_Search->CreateWnd(g_SendControlCommandDlgHwnd); + CRect rect_Manual_Search; + GetDlgItem(IDC_STATIC_MANUAL_SEARCH)->GetWindowRect(&rect_Manual_Search); + ScreenToClient(&rect_Manual_Search); + + m_wndManual_Search->MoveWnd(rect_Manual_Search); + m_wndManual_Search->ShowWnd(SW_SHOW); + m_wndManual_Search->SetCallBackFun(GetDistRatioAndAngleProc); + + // 显示图像 + m_ManualSearchImg = imread("back_ManualSearch_English.jpg"); + ShowManualSearchImg(0, 0); + } + return TRUE; // return TRUE unless you set the focus to a control + // 异常: OCX 属性页应返回 FALSE +} + + +void CSendControlCommand::OnTimer(UINT_PTR nIDEvent) +{ + // TODO: 在此添加消息处理程序代码和/或调用默认值 + + for( size_t i = 0; i < 32; i++) + { + g_payloadCtrlInstruction[i] = 0x00; + } + + g_payloadCtrlInstruction[0] = 0xEB; // 帧头 + g_payloadCtrlInstruction[1] = 0x90; + g_payloadCtrlInstruction[2] = 0x02; // 目的地址 源地址 + g_payloadCtrlInstruction[3] = 0x01; // 飞机ID暂时置为定值0 + + static int cnt = 0; + + if (cnt > 255) + { + cnt = 0; + } + g_payloadCtrlInstruction[4] = BYTE(cnt); // 帧计数 + cnt++; + + // 数据注入指令帧 + g_payloadCtrlInstruction[12] = 0x1F; + + // 执行鼠标滚轮控制视场大小指令 + // 循环三次 + static int zoomCnt = 0; + if (g_CtrlFocusThroughMouseWheel == TRUE) + { + if (zoomCnt < 3 ) + { + zoomCnt++; + } + else + { + zoomCnt = 0; + g_bCtrlFromSoftware = FALSE; + } + } + else + { + zoomCnt = 0; + } + + switch(g_payloadCtrlProtocol) + { + case 1: // 速度配置 + g_payloadCtrlInstruction[29] = 0x00; + g_payloadCtrlInstruction[25] = 0x00; + g_payloadCtrlInstruction[26] = 0x00; + g_payloadCtrlInstruction[27] = 0x00; + g_payloadCtrlInstruction[28] = 0x00; + g_sCtrlInstruction = "速度配置"; + break; + case 2: // 锁定模式 + g_payloadCtrlInstruction[29] = 0x15; + g_sCtrlInstruction = "锁定模式"; + break; + case 3: // 扫描模式 + g_payloadCtrlInstruction[29] = 0x17; + g_sCtrlInstruction = "扫描模式"; + break; + case 4: // 数字引导模式 + g_payloadCtrlInstruction[29] = 0x19; + g_payloadCtrlInstruction[25] = INT16(g_Guide_Pitch * 36000 / 360) & 0xFF; + g_payloadCtrlInstruction[26] = (INT16(g_Guide_Pitch * 36000 / 360) >> 8) & 0xFF; + g_payloadCtrlInstruction[27] = INT16(g_Guide_Azimuth * 36000 / 360) & 0xFF; + g_payloadCtrlInstruction[28] = (INT16(g_Guide_Azimuth * 36000 / 360) >> 8) & 0xFF; + g_sCtrlInstruction = "数字引导"; + break; + case 5: // 平台复位 + g_payloadCtrlInstruction[29] = 0x1B; + g_sCtrlInstruction = "平台复位"; + break; + case 6: // 补漂方位- + g_payloadCtrlInstruction[29] = 0x1D; + g_sCtrlInstruction = "补漂方位-"; + break; + case 7: // 补漂方位+ + g_payloadCtrlInstruction[29] = 0x1F; + g_sCtrlInstruction = "补漂方位+"; + break; + case 8: // 补漂俯仰- + g_payloadCtrlInstruction[29] = 0x21; + g_sCtrlInstruction = "补漂俯仰-"; + break; + case 9: // 补漂俯仰+ + g_payloadCtrlInstruction[29] = 0x23; + g_sCtrlInstruction = g_sCtrlInstruction = "补漂俯仰+"; + break; + case 10: // 手动模式 + g_payloadCtrlInstruction[29] = 0x25; + g_sCtrlInstruction = "手动模式"; + break; + case 11: // 目标跟踪 + g_payloadCtrlInstruction[29] = 0x27; + g_payloadCtrlInstruction[25] = INT16(g_TrackOffset.y) & 0xFF; + g_payloadCtrlInstruction[26] = (INT16(g_TrackOffset.y) >> 8) & 0xFF; + g_payloadCtrlInstruction[27] = INT16(g_TrackOffset.x / 2) & 0xFF; + g_payloadCtrlInstruction[28] = (INT16(g_TrackOffset.x / 2) >> 8) & 0xFF; + g_sCtrlInstruction = "目标跟踪"; + break; + case 12: // 红外白热 + g_payloadCtrlInstruction[29] = 0x81; + g_sCtrlInstruction = "红外白热"; + break; + case 13: // 红外黑热 + g_payloadCtrlInstruction[29] = 0x82; + g_sCtrlInstruction = "红外黑热"; + break; + case 14: // EO视场小 + g_payloadCtrlInstruction[29] = 0x85; + if (g_CtrlFocusThroughMouseWheel == true && zoomCnt == 3) + { + g_CtrlFocusThroughMouseWheel = false; + g_payloadCtrlProtocol = 0; + } + g_sCtrlInstruction = "EO视场小"; + break; + case 15: // EO视场大 + g_payloadCtrlInstruction[29] = 0x86; + if (g_CtrlFocusThroughMouseWheel == true && zoomCnt == 3) + { + g_CtrlFocusThroughMouseWheel = false; + g_payloadCtrlProtocol = 0; + } + g_sCtrlInstruction = "EO视场大"; + break; + case 16: // IR视场小 + g_payloadCtrlInstruction[29] = 0x87; + if (g_CtrlFocusThroughMouseWheel == true && zoomCnt == 3) + { + g_CtrlFocusThroughMouseWheel = false; + g_payloadCtrlProtocol = 0; + } + g_sCtrlInstruction = "IR视场小"; + break; + case 17: // IR视场大 + g_payloadCtrlInstruction[29] = 0x89; + if (g_CtrlFocusThroughMouseWheel == true && zoomCnt == 3) + { + g_CtrlFocusThroughMouseWheel = false; + g_payloadCtrlProtocol = 0; + } + g_sCtrlInstruction = "IR视场大"; + break; + case 18: // OSD on/off + g_payloadCtrlInstruction[29] = 0xA1; + g_sCtrlInstruction = "OSD ON/OFF"; + break; + case 19: // 图像切换 + g_payloadCtrlInstruction[29] = 0xA3; + g_sCtrlInstruction = "图像切换"; + break; + case 20: // 画中画开 + g_payloadCtrlInstruction[29] = 0xB5; + g_sCtrlInstruction = "画中画开"; + break; + case 21: // 画中画关 + g_payloadCtrlInstruction[29] = 0xB6; + g_sCtrlInstruction = "画中画关"; + break; + case 22: // 图像稳定关 + g_payloadCtrlInstruction[29] = 0xB7; + g_sCtrlInstruction = "图像稳定关"; + break; + case 23: // 图像稳定开 + g_payloadCtrlInstruction[29] = 0xB8; + g_sCtrlInstruction = "图像稳定开"; + break; + case 24: // 可见光透雾1 + g_payloadCtrlInstruction[29] = 0xBB; + g_sCtrlInstruction = "可见光透雾1"; + break; + case 25: // 可见光透雾2 + g_payloadCtrlInstruction[29] = 0xBC; + g_sCtrlInstruction = "可见光透雾2"; + break; + case 26: // 可见光透雾3 + g_payloadCtrlInstruction[29] = 0xBD; + g_sCtrlInstruction = "可见光透雾3"; + break; + case 27: // 可见光透雾关 + g_payloadCtrlInstruction[29] = 0xBE; + g_sCtrlInstruction = "可见光透雾关"; + break; + case 28: // 开始连续照相 + g_payloadCtrlInstruction[29] = 0xC1; + g_sCtrlInstruction = "连续照相"; + break; + case 29: // 停止照相 + g_payloadCtrlInstruction[29] = 0xC3; + g_sCtrlInstruction = "停止照相"; + break; + case 30: // 拍一张照 + g_payloadCtrlInstruction[29] = 0xC6; + g_sCtrlInstruction = "拍一张照"; + break; + case 31: // 激光测距开 + g_payloadCtrlInstruction[29] = 0x91; + g_sCtrlInstruction = "激光测距开"; + break; + case 32: // 激光测距关 + g_payloadCtrlInstruction[29] = 0x92; + g_sCtrlInstruction = "激光测距关"; + break; + case 33: // 激光电源开 + g_payloadCtrlInstruction[29] = 0x93; + g_sCtrlInstruction = "激光电源开"; + break; + case 34: // 激光电源关 + g_payloadCtrlInstruction[29] = 0x94; + g_sCtrlInstruction = "激光电源关"; + break; + + // 需要对照协议进行修改 + case 1001: // 当鼠标拖动载荷旋转时,g_payloadCtrlProtocol 定义为1001; 见函数:ManualSpeed + // 手动 + if ((g_CH96TransFJData.ZH_Pitch>0)&&(m_Speed_UpDown>0)) + { + g_payloadCtrlInstruction[25] = 0; + g_payloadCtrlInstruction[26] = 0; + g_payloadCtrlInstruction[27] = INT16(m_Speed_LeftRight) & 0xFF; + g_payloadCtrlInstruction[28] = (INT16(m_Speed_LeftRight) >> 8) & 0xFF; + g_bCtrlFromSoftware = TRUE; + } + + else + { + g_payloadCtrlInstruction[25] = INT16(m_Speed_UpDown) & 0xFF; + g_payloadCtrlInstruction[26] = (INT16(m_Speed_UpDown) >> 8) & 0xFF; + g_payloadCtrlInstruction[27] = INT16(m_Speed_LeftRight) & 0xFF; + g_payloadCtrlInstruction[28] = (INT16(m_Speed_LeftRight) >> 8) & 0xFF; + } + g_bCtrlFromSoftware = TRUE; + break; + + default: + break; + } + + // 获取CRC校验位 计算g_payloadCtrlInstruction[30-31] + // 配合CH96协议进行更改 + BYTE _PayloadCtrlInstruction[28]; + memcpy(&_PayloadCtrlInstruction, g_payloadCtrlInstruction + 2, 28); + struCHECK tempstruCheck = MakeCheckCRC(_PayloadCtrlInstruction, 28); + g_payloadCtrlInstruction[30] = tempstruCheck.C0; + g_payloadCtrlInstruction[31] = tempstruCheck.C1; + + // UDP 发往飞控软件 + if (g_bCreatUDP == true) + { + g_UdpSend2Payload.WriteBuffer(g_payloadCtrlInstruction, 32); + } + + // 发送消息, 让主窗口显示发送指令 + //::PostMessageA(g_mainDlgHwnd, WM_SHOW_CTRL_INSTRUCTIONS, 0, 0); + + // 手动及目标跟踪循环指令 + static int Cnt = 0; // 计数用 + if (g_payloadCtrlProtocol == 10 || g_payloadCtrlProtocol == 11) + { + if (Cnt < 4) + { + Cnt++; + } + else + { + Cnt = 0; + g_payloadCtrlProtocol = 0; + } + } + else + { + Cnt = 0; + } + // 更改手动搜索指令盘按钮颜色,只有改变有效指令时才调用显示 + if (g_payloadCtrlProtocol >=1 && g_payloadCtrlProtocol <= 34) + { + ShowManualSearchImg(0, 0); + } + + CDialogEx::OnTimer(nIDEvent); +} + +void CSendControlCommand::ShowManualSearchImg( double Angle, double Ratio) +{ + // 输入判断 + if (abs(Angle) > 180 || Ratio < 0 || Ratio > 1) + { + return; + } + + // 限制绘制半径 + double R = m_ManualSearchImg.cols / 2 * Ratio; // 比例半径 + if (R > 110) + { + R = 110; + } + + cv::Point drawPt(0,0); + Angle = Angle / 180 * CV_PI; + drawPt.x = static_cast(R * sin(Angle) + m_ManualSearchImg.cols / 2 + 0.5); + drawPt.y = static_cast(-R * cos(Angle) + m_ManualSearchImg.rows / 2 + 0.5); + + cv::Mat local; + m_ManualSearchImg.copyTo(local); + + if (g_sCtrlInstruction == "手动模式") + { + cv::circle(local, drawPt, 20, cv::Scalar(52, 116, 64), -1); + } + else + { + cv::Point drawPt(0,0); + drawPt.x = static_cast(m_ManualSearchImg.cols / 2 + 0.5); + drawPt.y = static_cast(m_ManualSearchImg.rows / 2 + 0.5); + cv::circle(local, drawPt, 20, cv::Scalar(31, 31, 197), -1); + } + + if (m_wndManual_Search != nullptr) + { + BITMAPINFO info; + info.bmiHeader.biBitCount = 24; + info.bmiHeader.biHeight = local.rows; + info.bmiHeader.biWidth = local.cols; + m_wndManual_Search->ShowImage(&info, local.data); + } +} + + +void CSendControlCommand::OnDestroy() +{ + CDialogEx::OnDestroy(); + + // TODO: 在此处添加消息处理程序代码 + KillTimer(1); +} diff --git a/Src/CH91PayloadSoftware/SendControlCommand.h b/Src/CH91PayloadSoftware/SendControlCommand.h new file mode 100644 index 0000000..a7e2ba2 --- /dev/null +++ b/Src/CH91PayloadSoftware/SendControlCommand.h @@ -0,0 +1,39 @@ +#pragma once +#include "ExportSimpleImgShow.h" +#include +#include "ShadeButtonST.h" +#include "afxwin.h" +#include "JoyStickControlDlg.h" + +// CSendControlCommand 对话框 + +class CSendControlCommand : public CDialogEx +{ + DECLARE_DYNAMIC(CSendControlCommand) + +public: + CSendControlCommand(CWnd* pParent = NULL); // 标准构造函数 + virtual ~CSendControlCommand(); + +// 对话框数据 + enum { IDD = IDD_DLG_SENDCONTROLCOMMAND }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + DECLARE_MESSAGE_MAP() +public: + // 手动搜索控件变量 + CExportSimpleImgShow *m_wndManual_Search; + cv::Mat m_ManualSearchImg; // 底图 + int m_Speed; // 手动搜索指令盘速度 + int m_Speed_UpDown; // 上下移动速度 + int m_Speed_LeftRight; // 左右移动速度 +public: + void ShowManualSearchImg( double Angle, double Ratio); + virtual BOOL OnInitDialog(); + afx_msg void OnTimer(UINT_PTR nIDEvent); + //手动搜索指令盘 + LRESULT ManualSpeed(WPARAM wParam, LPARAM lParam); + afx_msg void OnDestroy(); +}; + diff --git a/Src/CH91PayloadSoftware/Serial.cpp b/Src/CH91PayloadSoftware/Serial.cpp new file mode 100644 index 0000000..9ed4292 --- /dev/null +++ b/Src/CH91PayloadSoftware/Serial.cpp @@ -0,0 +1,592 @@ +// Serial.cpp: implementation of the CSerial class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "Serial.h" + +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[]=__FILE__; +#define new DEBUG_NEW +#endif + +/*----------------------------------------------------------------------------- +prototype declaration +-----------------------------------------------------------------------------*/ +DWORD WINAPI ReadThreadFunc(LPVOID para); +DWORD WINAPI WriteThreadFunc(LPVOID para); + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +/*----------------------------------------------------------------------------- +FUNCTION: CSerial() +PURPOSE: Construction +COMMENTS: +HISTORY: Date: Author: Comment: +-----------------------------------------------------------------------------*/ +CSerial::CSerial() +{ + m_bIsInitialized=FALSE; + m_hExitReadThreadEvent=NULL; + m_hExitWriteThreadEvent=NULL; + m_hComHandle=NULL; + m_hReadCompletedEvent=NULL; + m_hWriteCompletedEvent=NULL; + m_hReadThread=NULL; + m_hWriteThread=NULL; + m_hStartWriteEvent=NULL; + memset(out_buffer,0,MAX_OUT_BUFFER); + memset(in_buffer,0,MAX_IN_BUFFER); + ReadCallBack=NULL; + InitializeCriticalSection(&m_csReadSection); + InitializeCriticalSection(&m_csWriteSection); +} + +/*----------------------------------------------------------------------------- +FUNCTION: ~CSerial() +PURPOSE: Destruction +COMMENTS: +HISTORY: Date: Author: Comment: +-----------------------------------------------------------------------------*/ +CSerial::~CSerial() +{ + DeInit(); + DeleteCriticalSection(&m_csReadSection); + DeleteCriticalSection(&m_csWriteSection); +} + +/*----------------------------------------------------------------------------- +函数原型: DWORD WINAPI ReadThreadFunc(LPVOID para) +目的: 读串口线程函数 +参数: LPVOID para,传入读串口线程的参数,为PDATA_PACKAGE型 +返回值: DWORD 型,表明线程返回 +备注: +修改记录: 日期: 作者: 备注: +-----------------------------------------------------------------------------*/ +DWORD WINAPI ReadThreadFunc(LPVOID para) +{ + CSerial*pSerial=(CSerial*)para; + OVERLAPPED osReader={0}; + HANDLE hArray[2]; + BOOL bThreadOn=TRUE; + BOOL bWaitingOnRead=FALSE; + DWORD dwRes; + osReader.hEvent=CreateEvent(NULL,TRUE,FALSE,NULL); + hArray[0]=osReader.hEvent; + hArray[1]=pSerial->m_hExitReadThreadEvent; + while(bThreadOn) + { + EnterCriticalSection(&(pSerial->m_csReadSection)); + if(!bWaitingOnRead) + { + if(!ReadFile(pSerial->m_hComHandle,pSerial->in_buffer,MAX_IN_BUFFER,&(pSerial->m_dwRead),&osReader)) + { + if(GetLastError()!=ERROR_IO_PENDING) + { + bThreadOn=FALSE; + } + else + { + bWaitingOnRead=TRUE; + } + } + else + { + if(pSerial->m_dwRead>0) + { + pSerial->HandleSuccessRead(); + } + } + } + if(bWaitingOnRead) + { + dwRes=WaitForMultipleObjects(2,hArray,FALSE,100); + switch(dwRes) + { + case WAIT_OBJECT_0: + if(!GetOverlappedResult(pSerial->m_hComHandle,&osReader,&(pSerial->m_dwRead),FALSE)) + { + bThreadOn=FALSE; + } + else + { + if(pSerial->m_dwRead>0) + { + pSerial->HandleSuccessRead(); + } + } + bWaitingOnRead=FALSE; + ResetEvent(osReader.hEvent); + break; + case WAIT_OBJECT_0+1: + bThreadOn=FALSE; + break; + case WAIT_TIMEOUT: + break; + default: + bThreadOn=FALSE; + break; + } + } + LeaveCriticalSection(&(pSerial->m_csReadSection)); + } + CloseHandle(osReader.hEvent); + return 0; +} + +/*----------------------------------------------------------------------------- +函数原型: DWORD WINAPI WriteThreadFunc(LPVOID para) +目的: 写串口线程函数 +参数: LPVOID para,传入写串口线程的参数,为PDATA_PACKAGE型 +返回值: DWORD 型,表明线程返回 +备注: +修改记录: 日期: 作者: 备注: +07/01/05 杜志伟 初步完成原型 +08/25/05 杜志伟 增加数据同步代码, +防止数据被同时修改 +-----------------------------------------------------------------------------*/ +DWORD WINAPI WriteThreadFunc(LPVOID para) +{ + CSerial*pSerial=(CSerial*)para; + OVERLAPPED osWriter={0}; + BOOL bThreadOn=TRUE; + BOOL bWaitingOnWrite=FALSE; + DWORD dwRes; + HANDLE hArray[3]; + osWriter.hEvent=CreateEvent(NULL,TRUE,FALSE,NULL); + hArray[0]=pSerial->m_hStartWriteEvent; + hArray[1]=osWriter.hEvent; + hArray[2]=pSerial->m_hExitWriteThreadEvent; + + while(bThreadOn) + { + dwRes=WaitForMultipleObjects(3,hArray,FALSE,CHECK_TIMEOUT); + EnterCriticalSection(&(pSerial->m_csWriteSection)); + switch(dwRes) + { + case WAIT_OBJECT_0: + DWORD dd; + if(!WriteFile(pSerial->m_hComHandle,pSerial->out_buffer,pSerial->m_dwToWrite,&dd,&osWriter)) + { + if(GetLastError()!=ERROR_IO_PENDING) + { + bThreadOn=FALSE; + } + } + ResetEvent(pSerial->m_hStartWriteEvent); + break; + case WAIT_OBJECT_0+1: + if(!GetOverlappedResult(pSerial->m_hComHandle,&osWriter,&pSerial->m_dwWritten,FALSE)) + { + bThreadOn=FALSE; + } + else + { + SetEvent(pSerial->m_hWriteCompletedEvent); + } + ResetEvent(osWriter.hEvent); + break; + case WAIT_OBJECT_0+2: + bThreadOn=FALSE; + break; + case WAIT_TIMEOUT: + break; + default: + bThreadOn=FALSE; + break; + } + LeaveCriticalSection(&(pSerial->m_csWriteSection)); + } + CloseHandle(osWriter.hEvent); + return 0; +} + +/*----------------------------------------------------------------------------- +函数原型: BOOL CSerial::Initialize(char *serial_port, +DWORD baud_rate, +BYTE byte_size, +BYTE parity, +BYTE stopbits) +目的: 初始化串口 +参数: char*serial_port,用字符串表示的串口名称 +DWORD baud_rate,波特率 +BYTE byte_size,数据位长度 +BYTE parity ,校验类型 +BYTE stopbits,停止位长度 +返回值: BOOL 型,表明是否初始化成功 +备注: +修改记录: 日期: 作者: 备注:char *serial_port, +-----------------------------------------------------------------------------*/ +BOOL CSerial::Initialize(PCTSTR serial_port, + DWORD baud_rate/*=CBR_9600*/, + BYTE byte_size/*=8*/, + BYTE parity/*=PARITY_NONE*/, + BYTE stopbits/*=ONESTOPBIT*/) +{ + if(m_bIsInitialized) + DeInit(); + + TCHAR name[256]; + _tcscpy(name, _T("\\\\.\\")); + _tcscat(name, serial_port); + + m_hComHandle=CreateFile(name, + GENERIC_READ|GENERIC_WRITE, + 0, + 0, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, + 0); + + if(INVALID_HANDLE_VALUE==m_hComHandle) + { + DeInit(); + return FALSE; + } + DCB dcb; + if(!GetCommState(m_hComHandle,&dcb)) + { + DeInit(); + return FALSE; + } + dcb.BaudRate=baud_rate; + dcb.ByteSize=byte_size; + dcb.Parity=parity; + dcb.StopBits=stopbits; + if(!SetCommState(m_hComHandle,&dcb)) + { + DeInit(); + return FALSE; + } + COMMTIMEOUTS timeout; + timeout.ReadIntervalTimeout=5; + timeout.ReadTotalTimeoutConstant=0; + timeout.ReadTotalTimeoutMultiplier=0; + timeout.WriteTotalTimeoutConstant=0; + timeout.WriteTotalTimeoutMultiplier=0; + if(!SetCommTimeouts(m_hComHandle,&timeout)) + { + DeInit(); + return FALSE; + } + if(!RestartReadThread()) + { + DeInit(); + return FALSE; + } + if(!RestartWriteThread()) + { + DeInit(); + return FALSE; + } + m_bIsInitialized=TRUE; + return TRUE; +} + +/*----------------------------------------------------------------------------- +函数原型: BOOL CSerial::DeInit() +目的: 断开串口 +参数: +返回值: +备注: +修改记录: 日期: 作者: 备注: +-----------------------------------------------------------------------------*/ +void CSerial::DeInit() +{ + ExitReadThread(); + ExitWriteThread(); + if(m_hComHandle!=NULL) + { + CloseHandle(m_hComHandle); + m_hComHandle=NULL; + } + m_bIsInitialized=FALSE; +} + +/*----------------------------------------------------------------------------- +函数原型: BOOL CSerial::ExitReadThread() +目的: 退出读串口线程 +参数: +返回值: +备注: +修改记录: 日期: 作者: 备注: +-----------------------------------------------------------------------------*/ +void CSerial::ExitReadThread() +{ + if(m_hReadThread!=NULL) + { + SetEvent(m_hExitReadThreadEvent); + Sleep(300); + if(m_hReadThread!=NULL) + { + CloseHandle(m_hReadThread); + m_hReadThread=NULL; + } + } + if(m_hExitReadThreadEvent!=NULL) + { + CloseHandle(m_hExitReadThreadEvent); + m_hExitReadThreadEvent=NULL; + } + if(m_hReadCompletedEvent!=NULL) + { + SetEvent(m_hReadCompletedEvent); + Sleep(200); + if(m_hReadCompletedEvent!=NULL) + { + CloseHandle(m_hReadCompletedEvent); + m_hReadCompletedEvent=NULL; + } + } +} + +/*----------------------------------------------------------------------------- +函数原型: BOOL CSerial::RestartReadThread() +目的: 重启读串口线程 +参数: +返回值: BOOL 型,表明是否成功 +备注: +修改记录: 日期: 作者: 备注: +-----------------------------------------------------------------------------*/ +BOOL CSerial::RestartReadThread() +{ + PurgeComm(m_hComHandle, PURGE_RXCLEAR); + m_hExitReadThreadEvent=CreateEvent(NULL,TRUE,FALSE,NULL); + if(m_hExitReadThreadEvent==NULL) + { + ExitReadThread(); + return FALSE; + } + m_hReadCompletedEvent=CreateEvent(NULL,TRUE,FALSE,NULL); + if(m_hReadCompletedEvent==NULL) + { + ExitReadThread(); + return FALSE; + } + m_hReadThread=CreateThread(NULL, + 0, + ReadThreadFunc, + this, + NULL, + &m_dwReadProcID); + if(m_hReadThread==NULL) + { + ExitReadThread(); + return FALSE; + } + return TRUE; +} + +/*----------------------------------------------------------------------------- +函数原型: BOOL CSerial::RestartWriteThread() +目的: 重启写串口线程 +参数: +返回值: BOOL 型,表明是否成功 +备注: +修改记录: 日期: 作者: 备注: +-----------------------------------------------------------------------------*/ +BOOL CSerial::RestartWriteThread() +{ + PurgeComm(m_hComHandle, PURGE_TXCLEAR); + m_hStartWriteEvent=CreateEvent(NULL,TRUE,FALSE,NULL); + if(m_hStartWriteEvent==NULL) + { + DeInit(); + return FALSE; + } + m_hExitWriteThreadEvent=CreateEvent(NULL,TRUE,FALSE,NULL); + if(m_hExitWriteThreadEvent==NULL) + { + DeInit(); + return FALSE; + } + m_hWriteCompletedEvent=CreateEvent(NULL,TRUE,FALSE,NULL); + if(m_hWriteCompletedEvent==NULL) + { + DeInit(); + return FALSE; + } + + m_hWriteThread=CreateThread(NULL, + 0, + WriteThreadFunc, + this, + NULL, + &m_dwWriteProcID); + if(m_hWriteThread==NULL) + { + DeInit(); + return FALSE; + } + return TRUE; +} + +/*----------------------------------------------------------------------------- +函数原型: BOOL CSerial::ExitWriteThread() +目的: 关闭写串口线程 +参数: +返回值: +备注: +修改记录: 日期: 作者: 备注: +-----------------------------------------------------------------------------*/ +void CSerial::ExitWriteThread() +{ + if(m_hWriteThread!=NULL) + { + SetEvent(m_hExitWriteThreadEvent); + Sleep(200); + if(m_hWriteThread!=NULL) + { + CloseHandle(m_hWriteThread); + m_hWriteThread=NULL; + } + } + if(m_hExitWriteThreadEvent!=NULL) + { + CloseHandle(m_hExitWriteThreadEvent); + m_hExitWriteThreadEvent=NULL; + } + if(m_hWriteCompletedEvent!=NULL) + { + SetEvent(m_hWriteCompletedEvent); + Sleep(200); + if(m_hWriteCompletedEvent!=NULL) + { + CloseHandle(m_hWriteCompletedEvent); + m_hWriteCompletedEvent=NULL; + } + } + if(m_hStartWriteEvent!=NULL) + { + CloseHandle(m_hStartWriteEvent); + m_hStartWriteEvent=NULL; + } +} + +/*----------------------------------------------------------------------------- +函数原型: HANDLE* CSerial::GetWriteCompletedEvent() const +目的: 得到写串口完成事件句柄 +参数: +返回值: HANDLE* 型,写串口完成事件句柄 +备注: +修改记录: 日期: 作者: 备注: +-----------------------------------------------------------------------------*/ +HANDLE* CSerial::GetWriteCompletedEvent() const +{ + return (HANDLE*)&m_hWriteCompletedEvent; +} + +/*----------------------------------------------------------------------------- +函数原型: HANDLE* CSerial::GetReadCompletedEvent() const +目的: 得到读串口完成事件句柄 +参数: +返回值: HANDLE* 型,读串口完成事件句柄 +备注: +修改记录: 日期: 作者: 备注: +-----------------------------------------------------------------------------*/ +HANDLE *CSerial::GetReadCompletedEvent() const +{ + return (HANDLE*)&m_hReadCompletedEvent; +} + +/*----------------------------------------------------------------------------- +函数原型: void CSerial::WriteABuffer(char *buffer, DWORD size) +目的: 通过串口向外发送数据 +参数: char*buffer,待发送的数据 +DWORD size,buffer的大小 +返回值: +备注: +修改记录: 日期: 作者: 备注: +-----------------------------------------------------------------------------*/ +void CSerial::WriteABuffer(unsigned char *buffer, DWORD size) +{ + EnterCriticalSection(&m_csWriteSection); + for(DWORD i=0;i 1000 +#pragma once +#endif + +#define MAX_OUT_BUFFER 2048 +#define MAX_IN_BUFFER 2048 +#define CHECK_TIMEOUT 110 + +// 回调函数定义 +typedef void(*COMCALLBACK)(char *buffer,const DWORD size); + +class CSerial +{ +public: + CSerial(); + virtual ~CSerial(); +public: + /* 【1】 + 功能: 设置对串口读入数据进行处理的回调函数 + 输入: + func,串口回调函数地址 + 输出: + 返回值:无 + */ + void SetComReadCallback(COMCALLBACK func); + + /* 【2】 + 功能: 初始化串口 + 输入: + 1. serial_port,用字符串表示的串口名称:例如:“COM5” + 2. baud_rate,波特率 + 3. byte_size,数据位长度 + 4. parity ,校验类型 + 5. stopbits,停止位长度 + 输出: + 返回值: BOOL 型,表明是否初始化成功char *serial_port, + */ + BOOL Initialize(PCTSTR serial_port, + DWORD baud_rate = CBR_9600, + BYTE byte_size = 8, + BYTE parity = NOPARITY, + BYTE stopbits = ONESTOPBIT); + + /* 【3】 + 功能: 判断是否已经进行了初始化 + 输入: + 输出: + 返回值: BOOL 型,表明是否初始化成功 + */ + BOOL IsInitialized()const; + + + /* 【4】 + 功能: 断开串口 + 输入: + 输出: + 返回值: + */ + void DeInit(); + + + /* 【5】 + 功能:通过串口向外发送数据 + 输入: + 1. buffer:待发送的数据 + 2. size:buffer的大小 + 输出: + 返回值: + */ + void WriteABuffer(unsigned char*buffer,DWORD size); + + + /* 【6】 + 功能:读进串口数据 + 输入: + buffer,读进的数据 + 输出: + 返回值: DWORD型,读进的数据的大小 + */ + DWORD ReadABuffer(char*buffer); + + + /* 【7】 + 功能:获取读串口完成事件句柄 + 输入: + 输出: + 返回值:HANDLE* 型,读串口完成事件句柄 + */ + HANDLE* GetReadCompletedEvent()const; + + /* 【8】 + 功能: 得到写串口完成事件句柄 + 输入: + 输出: + 返回值:HANDLE* 型,写串口完成事件句柄 + */ + HANDLE* GetWriteCompletedEvent()const; + + /* 【9】 + 功能: 关闭写串口线程 + 输入: + 输出: + 返回值: + */ + void ExitWriteThread(); + + /* 【10】 + 功能: 重启写串口线程 + 输入: + 输出: + 返回值: BOOL 型,表明是否成功 + */ + BOOL RestartWriteThread(); + + /* 【11】 + 功能: 重启读串口线程 + 输入: + 输出: + 返回值: BOOL型,表明是否成功 + */ + BOOL RestartReadThread(); + + /* 【12】 + 功能: 退出读串口线程 + 输入: + 输出: + 返回值: + */ + void ExitReadThread(); + + /* 【13】 + 功能: 获取串口写线程ID + 输入: + 输出: + 返回值:DWORD型,写线程ID + */ + DWORD GetWriteThreadID()const; + + /* 【14】 + 功能: 获取串口读线程ID + 输入: + 输出: + 返回值:DWORD型,读线程ID + */ + DWORD GetReadThreadID()const; + + + /* 【15】 + 功能: 读串口线程函数 + 输入: + LPVOID para,传入读串口线程的参数,为PDATA_PACKAGE型 + 输出: + 返回值:DWORD 型,表明线程返回 + */ + friend DWORD WINAPI ReadThreadFunc(LPVOID para); + + + /* 【16】 + 功能: 写串口线程函数 + 输入: + LPVOID para,传入写串口线程的参数,为PDATA_PACKAGE型 + 输出: + 返回值: DWORD 型,表明线程返回 + */ + friend DWORD WINAPI WriteThreadFunc(LPVOID para); + +protected: + void HandleSuccessRead(); + HANDLE m_hComHandle; /*串口句柄*/ + HANDLE m_hWriteThread; /*写串口线程句柄*/ + DWORD m_dwWriteProcID; /*写串口线程ID*/ + HANDLE m_hReadThread; /*读串口线程句柄*/ + DWORD m_dwReadProcID; /*读串口线程ID*/ + HANDLE m_hWriteCompletedEvent; /*写串口完成事件*/ + HANDLE m_hReadCompletedEvent; /*读串口完成事件*/ + BOOL m_bIsInitialized; /*是否初始化的标志*/ + HANDLE m_hExitReadThreadEvent; /*结束读串口线程的事件句柄*/ + HANDLE m_hExitWriteThreadEvent; /*结束写串口线程的事件句柄*/ + HANDLE m_hStartWriteEvent; /*开始写串口时间句柄*/ + DWORD m_dwWritten; /*实际向外发送的数据量*/ + DWORD m_dwToWrite; /*需要向外发送的数据量*/ + DWORD m_dwRead; /*实际读进的数据*/ + CRITICAL_SECTION m_csReadSection; /*处理读入数据的关键代码段*/ + CRITICAL_SECTION m_csWriteSection; /*处理发送数据的关键代码段*/ + + char out_buffer[MAX_OUT_BUFFER]; + char in_buffer[MAX_IN_BUFFER]; + COMCALLBACK ReadCallBack; /*处理输入的回调函数*/ +}; + +#endif // !defined(AFX_SERIAL_H_UAV) diff --git a/Src/CH91PayloadSoftware/ShadeButtonST.cpp b/Src/CH91PayloadSoftware/ShadeButtonST.cpp new file mode 100644 index 0000000..03cf9cf --- /dev/null +++ b/Src/CH91PayloadSoftware/ShadeButtonST.cpp @@ -0,0 +1,257 @@ +#include "stdafx.h" +#include "ShadeButtonST.h" + +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[]=__FILE__; +#define new DEBUG_NEW +#endif + +CShadeButtonST::CShadeButtonST() +{ +} + +CShadeButtonST::~CShadeButtonST() +{ +} + +void CShadeButtonST::SetShade(UINT shadeID, BYTE granularity, BYTE highlight, BYTE coloring, COLORREF color) +{ + long sXSize,sYSize,bytes,j,i,k,h; + BYTE *iDst ,*posDst; + + RECT rect; + GetWindowRect(&rect); + sYSize=rect.bottom-rect.top; + sXSize=rect.right-rect.left ; + + m_dh.Create(max(1,sXSize /*-2*m_FocusRectMargin-1*/ ),1,8); //create the horizontal focus bitmap + m_dv.Create(1,max(1,sYSize /*-2*m_FocusRectMargin*/),8); //create the vertical focus bitmap + + m_dNormal.Create(sXSize,sYSize,8); //create the default bitmap + + COLORREF hicr=GetSysColor(COLOR_BTNHIGHLIGHT); //get the button base colors + COLORREF midcr=GetSysColor(COLOR_BTNFACE); + COLORREF locr=GetSysColor(COLOR_BTNSHADOW); + long r,g,b; //build the shaded palette + for(i=0;i<129;i++){ + r=((128-i)*GetRValue(locr)+i*GetRValue(midcr))/128; + g=((128-i)*GetGValue(locr)+i*GetGValue(midcr))/128; + b=((128-i)*GetBValue(locr)+i*GetBValue(midcr))/128; + m_dNormal.SetPaletteIndex((BYTE)i,(BYTE)r,(BYTE)g,(BYTE)b); + m_dh.SetPaletteIndex((BYTE)i,(BYTE)r,(BYTE)g,(BYTE)b); + m_dv.SetPaletteIndex((BYTE)i,(BYTE)r,(BYTE)g,(BYTE)b); + } + for(i=1;i<129;i++){ + r=((128-i)*GetRValue(midcr)+i*GetRValue(hicr))/128; + g=((128-i)*GetGValue(midcr)+i*GetGValue(hicr))/128; + b=((128-i)*GetBValue(midcr)+i*GetBValue(hicr))/128; + m_dNormal.SetPaletteIndex((BYTE)(i+127),(BYTE)r,(BYTE)g,(BYTE)b); + m_dh.SetPaletteIndex((BYTE)(i+127),(BYTE)r,(BYTE)g,(BYTE)b); + m_dv.SetPaletteIndex((BYTE)(i+127),(BYTE)r,(BYTE)g,(BYTE)b); + } + + m_dNormal.BlendPalette(color,coloring); //color the palette + + iDst=m_dh.GetBits(); //build the horiz. dotted focus bitmap + j=(long)m_dh.GetWidth(); + for(i=0;i0)&&((y+i)0)) + m_dNormal.SetPixelIndex(sXSize-x+i,y-i,(BYTE)d); + } + } + //blend strokes with SHS_DIAGONAL + posDst =iDst; + a=(idxmax-idxmin-k)/2; + for(i = 0; i < sYSize; i++) { + for(j = 0; j < sXSize; j++) { + d=posDst[j]+((a*i)/sYSize+(a*(sXSize-j))/sXSize); + posDst[j]=(BYTE)d; + posDst[j]+=rand()/grainx2; + } + posDst+=bytes; + } + + break; +//---------------------------------------------------- + case 7: // SHS_HARDBUMP + //set horizontal bump + for(i = 0; i < sYSize; i++) { + k=(255*i/sYSize)-127; + k=(k*(k*k)/128)/128; + k=(k*(128-granularity*2))/128+128; + for(j = 0; j < sXSize; j++) { + posDst[j]=(BYTE)k; + posDst[j]+=rand()/grainx2-granularity; + } + posDst+=bytes; + } + //set vertical bump + d=min(16,sXSize/6); //max edge=16 + a=sYSize*sYSize/4; + posDst =iDst; + for(i = 0; i < sYSize; i++) { + y=i-sYSize/2; + for(j = 0; j < sXSize; j++) { + x=j-sXSize/2; + xs=sXSize/2-d+(y*y*d)/a; + if (x>xs) + { + posDst[j]=BYTE(idxmin+(BYTE)(((sXSize-j)*128)/d)); + } + if ((x+xs)<0) + { + posDst[j]=BYTE(idxmax-(BYTE)((j*128)/d)); + } + posDst[j]+=rand()/grainx2-granularity; + } + posDst+=bytes; + } + break; +//---------------------------------------------------- + case 6: //SHS_SOFTBUMP + for(i = 0; i < sYSize; i++) { + h=(255*i/sYSize)-127; + for(j = 0; j < sXSize; j++) { + k=(255*(sXSize-j)/sXSize)-127; + k=(h*(h*h)/128)/128+(k*(k*k)/128)/128; + k=k*(128-granularity)/128+128; + if (kidxmax) k=idxmax; + posDst[j]=(BYTE)k; + posDst[j]+=rand()/grainx2-granularity; + } + posDst+=bytes; + } + break; +//---------------------------------------------------- + case 5: // SHS_VBUMP + for(j = 0; j < sXSize; j++) { + k=(255*(sXSize-j)/sXSize)-127; + k=(k*(k*k)/128)/128; + k=(k*(128-granularity))/128+128; + for(i = 0; i < sYSize; i++) { + posDst[j+i*bytes]=(BYTE)k; + posDst[j+i*bytes]+=rand()/grainx2-granularity; + } + } + break; +//---------------------------------------------------- + case 4: //SHS_HBUMP + for(i = 0; i < sYSize; i++) { + k=(255*i/sYSize)-127; + k=(k*(k*k)/128)/128; + k=(k*(128-granularity))/128+128; + for(j = 0; j < sXSize; j++) { + posDst[j]=(BYTE)k; + posDst[j]+=rand()/grainx2-granularity; + } + posDst+=bytes; + } + break; +//---------------------------------------------------- + case 1: //SHS_DIAGSHADE + a=(idxmax-idxmin)/2; + for(i = 0; i < sYSize; i++) { + for(j = 0; j < sXSize; j++) { + posDst[j]=(BYTE)(idxmin+a*i/sYSize+a*(sXSize-j)/sXSize); + posDst[j]+=rand()/grainx2-granularity; + } + posDst+=bytes; + } + break; +//---------------------------------------------------- + case 2: //SHS_HSHADE + a=idxmax-idxmin; + for(i = 0; i < sYSize; i++) { + k=a*i/sYSize+idxmin; + for(j = 0; j < sXSize; j++) { + posDst[j]=(BYTE)k; + posDst[j]+=rand()/grainx2-granularity; + } + posDst+=bytes; + } + break; +//---------------------------------------------------- + case 3: //SHS_VSHADE: + a=idxmax-idxmin; + for(j = 0; j < sXSize; j++) { + k=a*(sXSize-j)/sXSize+idxmin; + for(i = 0; i < sYSize; i++) { + posDst[j+i*bytes]=(BYTE)k; + posDst[j+i*bytes]+=rand()/grainx2-granularity; + } + } + break; +//---------------------------------------------------- + default: //SHS_NOISE + for(i = 0; i < sYSize; i++) { + for(j = 0; j < sXSize; j++) { + posDst[j]=128+rand()/grainx2-granularity; + } + posDst+=bytes; + } + } +//---------------------------------------------------- + m_dDisabled.Clone(&m_dNormal); //build the other bitmaps + m_dOver.Clone(&m_dNormal); + m_dOver.BlendPalette(hicr,highlight); + m_dDown.Clone(&m_dOver); +} // End of SetShade + +DWORD CShadeButtonST::OnDrawBackground(CDC *pDC, LPCRECT pRect) +{ + if (m_bMouseOnButton) + { + if (m_bIsPressed) + m_dOver.Draw(pDC->GetSafeHdc(),1,1); + else + m_dOver.Draw(pDC->GetSafeHdc(),0,0); + } + else + m_dNormal.Draw(pDC->GetSafeHdc(),0,0); + + return BTNST_OK; +} // End of OnDrawBackground + +DWORD CShadeButtonST::OnDrawBorder(CDC* pDC, LPCRECT pRect) +{ + BASE_BTNST_CLASS::OnDrawBorder(pDC, pRect); + + return BTNST_OK; +} // End of OnDrawBorder diff --git a/Src/CH91PayloadSoftware/ShadeButtonST.h b/Src/CH91PayloadSoftware/ShadeButtonST.h new file mode 100644 index 0000000..f69e00f --- /dev/null +++ b/Src/CH91PayloadSoftware/ShadeButtonST.h @@ -0,0 +1,77 @@ +// +// Class: CShadeButtonST +// +// Compiler: Visual C++ +// eMbedded Visual C++ +// Tested on: Visual C++ 6.0 +// Windows CE 3.0 +// +// Created: 14/June/2001 +// Updated: 03/December/2001 +// +// Author: Davide Calabro' davide_calabro@yahoo.com +// http://www.softechsoftware.it +// +// Disclaimer +// ---------- +// THIS SOFTWARE AND THE ACCOMPANYING FILES ARE DISTRIBUTED "AS IS" AND WITHOUT +// ANY WARRANTIES WHETHER EXPRESSED OR IMPLIED. NO REPONSIBILITIES FOR POSSIBLE +// DAMAGES OR EVEN FUNCTIONALITY CAN BE TAKEN. THE USER MUST ASSUME THE ENTIRE +// RISK OF USING THIS SOFTWARE. +// +// Terms of use +// ------------ +// THIS SOFTWARE IS FREE FOR PERSONAL USE OR FREEWARE APPLICATIONS. +// IF YOU USE THIS SOFTWARE IN COMMERCIAL OR SHAREWARE APPLICATIONS YOU +// ARE GENTLY ASKED TO DONATE 1$ (ONE U.S. DOLLAR) TO THE AUTHOR: +// +// Davide Calabro' +// P.O. Box 65 +// 21019 Somma Lombardo (VA) +// Italy +// +#ifndef _SHADEBUTTONST_H_ +#define _SHADEBUTTONST_H_ + +#ifdef _WIN32_WCE +#define BASE_BTNST_CLASS CCeButtonST +#define INC_BTNST "CeBtnST.h" +#else +#define BASE_BTNST_CLASS CButtonST +#define INC_BTNST "BtnST.h" +#endif + +#include INC_BTNST +#include "CeXDib.h" + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +class CShadeButtonST : public BASE_BTNST_CLASS +{ +public: + CShadeButtonST(); + virtual ~CShadeButtonST(); + + enum { SHS_NOISE = 0, + SHS_DIAGSHADE, + SHS_HSHADE, + SHS_VSHADE, + SHS_HBUMP, + SHS_VBUMP, + SHS_SOFTBUMP, + SHS_HARDBUMP, + SHS_METAL }; + + void SetShade(UINT shadeID=0,BYTE granularity=8,BYTE highlight=10,BYTE coloring=0,COLORREF color=0); + +private: + CCeXDib m_dNormal,m_dDown,m_dDisabled,m_dOver,m_dh,m_dv; + +protected: + virtual DWORD OnDrawBorder(CDC* pDC, LPCRECT pRect); + virtual DWORD OnDrawBackground(CDC* pDC, LPCRECT pRect); +}; + +#endif diff --git a/Src/CH91PayloadSoftware/ShowFJDataDlg.cpp b/Src/CH91PayloadSoftware/ShowFJDataDlg.cpp new file mode 100644 index 0000000..19f4373 --- /dev/null +++ b/Src/CH91PayloadSoftware/ShowFJDataDlg.cpp @@ -0,0 +1,287 @@ +// ShowFJDataDlg.cpp : 实现文件 +// + +#include "stdafx.h" +#include "CH91PayloadSoftware.h" +#include "ShowFJDataDlg.h" +#include "afxdialogex.h" +#include "GlobalMessage.h" + +// CShowFJDataDlg 对话框 + +IMPLEMENT_DYNAMIC(CShowFJDataDlg, CDialogEx) + +CShowFJDataDlg::CShowFJDataDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CShowFJDataDlg::IDD, pParent) + , m_PixelProportion_EO(0) + , m_PixelProportion_IR(0) +{ + // 对话框收缩、高度等变量控制值初始化 + m_shrink = TRUE;// 默认收缩 + m_DlgWidth = 0; + m_DlgWidth_Shrink = 0; + // 对话框透明变量,初始设置为不透明 + m_bTransParent = FALSE; + // 设定目标初始像素比 + m_PixelProportion_EO = 1; + m_PixelProportion_IR = 1; +} + +CShowFJDataDlg::~CShowFJDataDlg() +{ +} + +void CShowFJDataDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CShowFJDataDlg, CDialogEx) +END_MESSAGE_MAP() + +//十进制转化为二进制的函数 +CString DectoBin(CString strDec) +{ + int nDec = atoi(strDec); //字符串转十进制数字 + int nYushu, nShang; //余数、商 + CString strBin; //二进制数字代表的字符串 + CString strTemp; + char buf[9]; + BOOL bContinue = TRUE; + int nCount = 0; + while (bContinue) + { + nYushu = nDec % 2; + nShang = nDec / 2; + nDec = nShang; + buf[nCount] = nYushu+48; + if (0 == nShang) + { + bContinue = FALSE; + } + nCount++; + buf[nCount] = '\0'; + } + strBin = buf; + for (int i = 0; i<(strBin.GetLength()/2); i++) + { + char temp; + temp = buf[i]; + buf[i] = buf[strBin.GetLength()-1-i]; + buf[strBin.GetLength()-1-i] = temp; + } + strBin = buf; + int nTemp = strBin.GetLength()%8; + switch(nTemp) + { + case 1: + strTemp.Format(_T("0000000%s"),strBin); + strBin = strTemp; + break; + case 2: + strTemp.Format(_T("000000%s"),strBin); + strBin = strTemp; + break; + case 3: + strTemp.Format(_T("00000%s"),strBin); + strBin = strTemp; + break; + case 4: + strTemp.Format(_T("0000%s"),strBin); + strBin = strTemp; + break; + case 5: + strTemp.Format(_T("000%s"),strBin); + strBin = strTemp; + break; + case 6: + strTemp.Format(_T("00%s"),strBin); + strBin = strTemp; + break; + case 7: + strTemp.Format(_T("0%s"),strBin); + strBin = strTemp; + break; + default: + break; + } + return strBin; +} + +// 键盘/鼠标消息响应函数 +BOOL CShowFJDataDlg::PreTranslateMessage(MSG* pMsg) +{ + // 键盘消息 + if (pMsg->message == WM_KEYDOWN) + { + // 忽略ESC和回车键 + if (pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_RETURN) + { + return TRUE; + } + // F2键控制“视频控制”窗口的现实/隐藏 + if (pMsg->wParam == VK_F2) + { + // 关闭窗口 + OnOK(); + } + } + return CDialogEx::PreTranslateMessage(pMsg); +} + +BOOL CShowFJDataDlg::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + return TRUE; // return TRUE unless you set the focus to a control +} + +// 显示CH96FJ数据 +void CShowFJDataDlg::ShowCH96FJData(const Data96TXD &frame) +{ + CString str; + //********************************************载荷状态******************************// + // EO焦距值 + str.Format("%.2f", frame.EOFocus); + GetDlgItem(IDC_EDIT_CH96_EOFocalLen)->SetWindowText(str); + // IR焦距值 + str.Format("%.2f", frame.IRFocus); + GetDlgItem(IDC_EDIT_CH96_IRFocalLen)->SetWindowText(str); + // 载荷方位角 + str.Format("%.2f", frame.ZH_Azimuth); + GetDlgItem(IDC_EDIT_CH96_ZH_Azimuth)->SetWindowText(str); + // 载荷俯仰角 + str.Format("%.2f", frame.ZH_Pitch); + GetDlgItem(IDC_EDIT_CH96_ZH_Pitch)->SetWindowText(str); + // 方位脱靶量(dy) + str.Format("%d", frame.dy); + GetDlgItem(IDC_EDIT_CH96_ZH_DeltaY)->SetWindowText(str); + // 俯仰脱靶量 + str.Format("%d", frame.dx); + GetDlgItem(IDC_EDIT_CH96_ZH_DeltaX)->SetWindowText(str); + // 像元尺寸 + str.Format("%.2f", frame.PixelSize); + GetDlgItem(IDC_EDIT_CH96_ZH_PIXELSIZE)->SetWindowText(str); + // 激光状态 + str.Format("%d", frame.LaserState); + GetDlgItem(IDC_EDIT_CH96_LASERSTATE)->SetWindowText(str); + // 激光测距值 + str.Format("%d",frame.LaserDis); + GetDlgItem(IDC_EDIT_CH96_ZH_LaserDist)->SetWindowText(str); + // 载荷状态(复接数据有误的情况下,返回值不局限于8位) + UINT8 ZHState = frame.Status2 & 0x0F; + if (ZHState >= 7) + { + ZHState = 7; // 只保留7种类型 + } + const CString ZHStr[8] = {"手动跟踪", "自动跟踪", "锁定", "数引", "扫描", "保护态", "初始化", "其他"}; + str.Format("%s", ZHStr[ZHState]); + GetDlgItem(IDC_EDIT_CH96_ZHSTATE)->SetWindowText(str); + + + + + //********************************************载荷状态******************************// + // 飞机ID + str.Format("%d", frame.PlaneID); + GetDlgItem(IDC_EDIT_UAV_ID)->SetWindowText(str); + // 飞机俯仰角 + str.Format("%.2f", frame.Pitch); + GetDlgItem(IDC_EDIT_GPS_FB_Pitch)->SetWindowText(str); + // 飞机滚转角 + str.Format("%.2f", frame.Roll); + GetDlgItem(IDC_EDIT_GPS_LR_Roll)->SetWindowText(str); + // 飞机航向角 + str.Format("%.2f", frame.Yaw); + GetDlgItem(IDC_EDIT_GPS_LR_Heading)->SetWindowText(str); + + // GPS经度 + str.Format("%.7f", frame.Satelite_lon); + GetDlgItem(IDC_EDIT_GPS_LR_Lon)->SetWindowText(str); + // GPS纬度 + str.Format("%.7f", frame.Satelite_lat); + GetDlgItem(IDC_EDIT_GPS_LR_Lat)->SetWindowText(str); + // GPS高度 + str.Format("%.2f", frame.Satelite_height); + GetDlgItem(IDC_EDIT_GPS_LR_Alt)->SetWindowText(str); + // 卫星定位东向速度 + str.Format("%.2f", frame.Satelite_Ground_Speed); + GetDlgItem(IDC_EDIT_GPS_LR_VHeading)->SetWindowText(str); + // 卫星定位北向速度 + str.Format("%.2f", frame.Satelite_Ground_Speed_Dir); + GetDlgItem(IDC_EDIT_GPS_LR_HoriSpeed)->SetWindowText(str); + // 卫星定位天速 + str.Format("%.2f", frame.Satelite_Sky_Speed); + GetDlgItem(IDC_EDIT_GPS_LR_VertSpeed)->SetWindowText(str); + + // 导航状态 + str.Format("%d", frame.NavigationState); + GetDlgItem(IDC_EDIT_GPS_LR_WorkState)->SetWindowText(str); + // 组合导航俯仰角 + str.Format("%.2f", frame.MTI_Pitch); + GetDlgItem(IDC_EDIT_MTI_PITCH)->SetWindowText(str); + // 组合导航滚转角 + str.Format("%.2f", frame.MTI_Roll); + GetDlgItem(IDC_EDIT_MTI_ROLL)->SetWindowText(str); + // 组合导航航向角 + str.Format("%.2f", frame.MTI_Yaw); + GetDlgItem(IDC_EDIT_MTI_YAW)->SetWindowText(str); + // 组合导航经度 + str.Format("%.2f", frame.MTI_lon); + GetDlgItem(IDC_EDIT_MTI_LON)->SetWindowText(str); + // 组合导航纬度 + str.Format("%.2f", frame.MTI_lat); + GetDlgItem(IDC_EDIT_MTI_LAT)->SetWindowText(str); + // 组合导航高度 + str.Format("%.2f", frame.MTI_height); + GetDlgItem(IDC_EDIT_MTI_ALT)->SetWindowText(str); + // 组合导航东向速度 + str.Format("%.2f", frame.MTI_Ground_Speed); + GetDlgItem(IDC_EDIT_MTI_EASTSPEED)->SetWindowText(str); + // 组合导航北向速度 + str.Format("%.2f", frame.MTI_Ground_Speed_Dir); + GetDlgItem(IDC_EDIT_MTI_NORTHSPEED)->SetWindowText(str); + // 组合导航天速 + str.Format("%.2f", frame.MTI_Sky_Speed); + GetDlgItem(IDC_EDIT_MTI_SKYSPEED)->SetWindowText(str); + + // 气压高度 + str.Format("%.2f", frame.PressureHEG); + GetDlgItem(IDC_EDIT_UAV_AirPresAlt)->SetWindowText(str); + // 空速 + str.Format("%.2f", frame.AirSpeed); + GetDlgItem(IDC_EDIT_UAV_AirPresSpeed)->SetWindowText(str); + // 发动机转速 + str.Format("%d", frame.Engine_Speed); + GetDlgItem(IDC_EDIT_EngineSpeed)->SetWindowText(str); + // 左缸温 + str.Format("%d", frame.Left_Tmp); + GetDlgItem(IDC_EDIT_TemL)->SetWindowText(str); + // 右缸温 + str.Format("%d", frame.Right_Tmp); + GetDlgItem(IDC_EDIT_TemR)->SetWindowText(str); + + //卫导1UTC天秒(此处是否需要乘个系数?) + int utc_LR = static_cast(frame.UTC_Second ); + CString str_Hour_LR, str_Min_LR, str_Sec_LR; + str_Hour_LR.Format("%02d", (utc_LR / 3600 + 8) % 24); + str_Min_LR.Format("%02d", utc_LR % 3600 / 60); + str_Sec_LR.Format("%02d", utc_LR % 3600 % 60); + CString str_GPS_LR_UTC; + str_GPS_LR_UTC = str_Hour_LR + ":" + str_Min_LR + ":" + str_Sec_LR; + GetDlgItem(IDC_EDIT_GPS_LR_UTC)->SetWindowTextA(str_GPS_LR_UTC); + + //卫导1UTC日——与卫导1月,年合并,并显示在年那一栏 + CString str_GPS_LR_Day; + str_GPS_LR_Day.Format(_T("%d"), frame.UTC_Day); + + //卫导1UTC月——与卫导1日,年合并,并显示在年那一栏 + CString str_GPS_LR_Month; + str_GPS_LR_Month.Format(_T("%d"), frame.UTC_Month); + + //卫导1UTC年——与卫导1日,月合并,并显示在本栏 + CString str_GPS_LR_Year; + str_GPS_LR_Year.Format(_T("%d"), frame.UTC_Year); + str_GPS_LR_Year = str_GPS_LR_Year + "/" + str_GPS_LR_Month + "/" + str_GPS_LR_Day; + GetDlgItem(IDC_EDIT_GPS_LR_Year)->SetWindowTextA(str_GPS_LR_Year); +} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/ShowFJDataDlg.h b/Src/CH91PayloadSoftware/ShowFJDataDlg.h new file mode 100644 index 0000000..bb47716 --- /dev/null +++ b/Src/CH91PayloadSoftware/ShowFJDataDlg.h @@ -0,0 +1,43 @@ +#pragma once +#include "GlobalMember.h" + +// CShowFJDataDlg 对话框 + +class CShowFJDataDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CShowFJDataDlg) + +public: + CShowFJDataDlg(CWnd* pParent = NULL); // 标准构造函数 + virtual ~CShowFJDataDlg(); + +// 对话框数据 + enum { IDD = IDD_DLG_SHOW_FJ_DATA }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + DECLARE_MESSAGE_MAP() + + +private: + //扩展、收缩载荷控制面板(默认为收缩) + bool m_shrink; //是否收缩标记值 + int m_DlgWidth; //对话框高度 + int m_DlgWidth_Shrink; //收缩后的对话框高度 + + // 对话框半透明设置变量 + BOOL m_bTransParent; // TRUE为半透明,初始设置为FALSE + // 计算焦距比例的变量值,初始比例为1:1 + double m_PixelProportion_EO; + double m_PixelProportion_IR; + +public: + // 显示复接数据 + //void ShowFJData(const struTranslateProtocal_FJ &frame); + // 显示96复接数据 + void ShowCH96FJData(const Data96TXD &frame); + // 一般模式/专家模式切换 + virtual BOOL OnInitDialog(); + virtual BOOL PreTranslateMessage(MSG* pMsg); +}; diff --git a/Src/CH91PayloadSoftware/ShowReplayDlg.cpp b/Src/CH91PayloadSoftware/ShowReplayDlg.cpp new file mode 100644 index 0000000..4e809cc --- /dev/null +++ b/Src/CH91PayloadSoftware/ShowReplayDlg.cpp @@ -0,0 +1,482 @@ +// ShowReplayDlg.cpp : 实现文件 +// + +#include "stdafx.h" +#include "CH91PayloadSoftware.h" +#include "ShowReplayDlg.h" +#include "afxdialogex.h" +#include "Global.h" +#include "GlobalMessage.h" + +// 多媒体定时器 +#include "MMSystem.h" +#pragma comment(lib, "winmm") + +//timeSetEvent中的回调函数,名字随便起,但是内容固定 +void CALLBACK TimerPlayFunc(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2) +{ + // 目的:调用ReadandPlay,将dwUser强制转换为ptr,可以使用ptr格式,更加方便 + CShowReplayDlg* ptr = reinterpret_cast(dwUser); + // 读取文件并播放 + if (ptr != NULL) + { + ptr->ReadAndPlay(); + } +} + + +// CShowReplayDlg 对话框 + +IMPLEMENT_DYNAMIC(CShowReplayDlg, CDialogEx) + +CShowReplayDlg::CShowReplayDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CShowReplayDlg::IDD, pParent) +{ + m_TimerID = 0; + m_TimerPeriod = 20; // 默认20ms 调用一次多媒体时钟函数,由于EO和IR穿插,因此一秒钟调用50次,EO和IR帧频各25 + m_bFileOpen = FALSE; + + m_bIsPlay = FALSE; + m_bPauseSliderReflect = FALSE; + m_bService = FALSE; // 初始情况下后台服务程序未打开 + + m_bTransParent = FALSE; // 初始情况下不透明 +} + +CShowReplayDlg::~CShowReplayDlg() +{ +} + +void CShowReplayDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Control(pDX, IDC_SLIDER_REPLAYRATIO, m_SliderReplayRatio); +} + + +BEGIN_MESSAGE_MAP(CShowReplayDlg, CDialogEx) + ON_BN_CLICKED(IDC_BTN_OPENFILE, &CShowReplayDlg::OnBnClickedBtnOpenfile) + ON_BN_CLICKED(IDC_BTN_FILEPLAYPAUSE, &CShowReplayDlg::OnBnClickedBtnFileplaypause) + ON_BN_CLICKED(IDC_BTN_FILESTOP, &CShowReplayDlg::OnBnClickedBtnFilestop) + ON_BN_CLICKED(IDC_BTN_FILESLOW, &CShowReplayDlg::OnBnClickedBtnFileslow) + ON_BN_CLICKED(IDC_BTN_FILEFAST, &CShowReplayDlg::OnBnClickedBtnFilefast) + ON_CBN_SELCHANGE(IDC_COMBOX_PLAYTYPE, &CShowReplayDlg::OnCbnSelchangeComboxPlaytype) + ON_WM_DESTROY() + ON_MESSAGE(WM_BITMAPSLIDER_MOVING, OnBitmapSliderMoving) + ON_MESSAGE(WM_RETURN_PAYLOAD_TYPE_WARNING, &CShowReplayDlg::ReturnPayloadTypeWarning) +END_MESSAGE_MAP() + + +// CShowReplayDlg 消息处理程序 +BOOL CShowReplayDlg::PreTranslateMessage(MSG* pMsg) +{ + // TODO: 在此添加专用代码和/或调用基类 + // 键盘消息 + if (pMsg->message == WM_KEYDOWN) + { + // 忽略ESC和回车键 + if (pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_RETURN) + { + return TRUE; + } + // F1键控制“视频控制”窗口的现实/隐藏 + if (pMsg->wParam == VK_F1) + { + // 关闭窗口 + OnOK(); + } + } + return CDialogEx::PreTranslateMessage(pMsg); +} + + +BOOL CShowReplayDlg::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + + // 设置对话框标题 + SetWindowText(g_str_TitleReplay); + // 设置文件路径名称 + GetDlgItem(IDC_STATIC_HF_FILE_PATH) -> SetWindowText(g_str_FilePath); + //设置回放进度条各参数 + m_SliderReplayRatio.SetBitmapChannel( IDB_MP_CHANNEL, IDB_MP_CHANNEL_ACTIVE ); + m_SliderReplayRatio.SetBitmapThumb( IDB_MP_THUMB, IDB_MP_THUMB_ACTIVE, TRUE ); + m_SliderReplayRatio.DrawFocusRect( FALSE ); + m_SliderReplayRatio.SetMargin( 2, 3, 2, 0 ); + m_SliderReplayRatio.SetRange(0, 5000); + m_SliderReplayRatio.SetPos(0); + + // 获取窗口句柄 + g_ReplayDlgHwnd = GetSafeHwnd(); + + + // 工作模式 + + ((CComboBox*)GetDlgItem(IDC_COMBOX_PLAYTYPE))->AddString("回放"); + ((CComboBox*)GetDlgItem(IDC_COMBOX_PLAYTYPE))->AddString("实时"); + + ((CComboBox*)GetDlgItem(IDC_COMBOX_PLAYTYPE))->SetCurSel(1); + + OnCbnSelchangeComboxPlaytype(); + + // 设置界面按钮 + // 打开文件 + m_Btn_OpenFile.SubclassDlgItem(IDC_BTN_OPENFILE, this); + m_Btn_OpenFile.SetIcon(IDI_ICON_OPENFILE); + m_Btn_OpenFile.DrawTransparent(TRUE); + m_Btn_OpenFile.SetTooltipText("文件"); + m_Btn_OpenFile.DrawBorder(FALSE); + + // 开始/暂停 + m_Btn_PlayPause.SubclassDlgItem(IDC_BTN_FILEPLAYPAUSE, this); + m_Btn_PlayPause.SetIcon(IDI_ICON_PLAY); + m_Btn_PlayPause.DrawTransparent(TRUE); + m_Btn_PlayPause.SetTooltipText("开始/暂停"); + m_Btn_PlayPause.DrawBorder(FALSE); + + // 停止 + m_Btn_Stop.SubclassDlgItem(IDC_BTN_FILESTOP, this); + m_Btn_Stop.SetIcon(IDI_ICON_STOP); + m_Btn_Stop.DrawTransparent(TRUE); + m_Btn_Stop.SetTooltipText("停止"); + m_Btn_Stop.DrawBorder(FALSE); + + // 加速 + m_Btn_SpeedUp.SubclassDlgItem(IDC_BTN_FILEFAST, this); + m_Btn_SpeedUp.SetIcon(IDI_ICON_SPEEDUP); + m_Btn_SpeedUp.DrawTransparent(TRUE); + m_Btn_SpeedUp.SetTooltipText("加速"); + m_Btn_SpeedUp.DrawBorder(FALSE); + + // 减速 + m_Btn_SpeedDown.SubclassDlgItem(IDC_BTN_FILESLOW, this); + m_Btn_SpeedDown.SetIcon(IDI_ICON_SPEEDDOWN); + m_Btn_SpeedDown.DrawTransparent(TRUE); + m_Btn_SpeedDown.SetTooltipText("减速"); + m_Btn_SpeedDown.DrawBorder(FALSE); + + // 设置播放比率初始值 + GetDlgItem(IDC_STATIC_REPLAY_RATIO)->SetWindowText(_T("0%")); + return TRUE; +} + + +// 打开回放视频文件 +void CShowReplayDlg::OnBnClickedBtnOpenfile() +{ + // 首先停止播放视频 + OnBnClickedBtnFilestop(); + // 打开文件夹 + CFileDialog Dialog( + TRUE, + NULL, + NULL, + OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST|OFN_HIDEREADONLY, + _T("Video Files (*.tx) |*.tx| All Files (*.*) |*.*||"), + NULL); + Dialog.m_ofn.lpstrTitle = _T("Open Files"); + + if (Dialog.DoModal()!=IDOK) + { + return; + } + + if (m_bIsPlay == FALSE) + { + m_HFfilePath = Dialog.GetPathName(); + + // 显示文件路径 + GetDlgItem(IDC_STATIC_HF_FILE_PATH)->SetWindowText(g_str_FilePath + m_HFfilePath); + } + else + { + + } +} + +//启动定时器——多媒体定时器,与 +void CShowReplayDlg::StartTimer() +{ + // 启动定时器,回调函数:TimerPlayFunc,固定格式,只需编译回调函数TimerPlayFunc + m_TimerID = timeSetEvent(m_TimerPeriod, 1, TimerPlayFunc, (DWORD_PTR)this, TIME_PERIODIC); +} + +//停止定时器 +void CShowReplayDlg::StopTimer() +{ + if (m_TimerID != 0) + { + timeKillEvent(m_TimerID); + m_TimerID = 0; + } +} + +// 播放及暂停视频 +void CShowReplayDlg::OnBnClickedBtnFileplaypause() +{ + if (m_bFileOpen == FALSE) + { + // 显示文件名之后打开文件,获取文件长度,文件内容当前进度以及文件 + if (m_ReplayFile.Open(m_HFfilePath, CFile::modeRead) == TRUE) + { + m_bFileOpen = TRUE; + + m_FileInfo.FileTotalLen = m_ReplayFile.GetLength(); // 获取文件长度 + m_FileInfo.curFilePos = 0; //获取文件当前内容位置为0 + m_FileInfo.FrameLen = 1024;//1024; //设定读取一帧的字节大小(10KB) + } + else + { + return; + } + } + if (m_bFileOpen == TRUE) + { + //如果没有播放 + if (m_bIsPlay == FALSE) + { + // 如果上一次定时器(或者其他情况下)处于意外没有停止,则停止当前定时器 + if (m_TimerID != 0) + { + timeKillEvent(m_TimerID); + m_TimerID = 0; + } + + m_bIsPlay = TRUE; + //设定新的定时器,并用定时器调用读取每一帧进行播放 + StartTimer(); + //GetDlgItem(IDC_BTN_FILEPLAYPAUSE)->SetWindowTextA("暂停"); + m_Btn_PlayPause.SetIcon(IDI_ICON_PAUSE); + } + //如果正在播放,则暂停 + else + { + if (m_TimerID != 0) + { + timeKillEvent(m_TimerID); + m_TimerID = 0; + } + + m_bIsPlay = FALSE; + g_bEOImgUpdate = FALSE; + g_bIRImgUpdate = FALSE; + //GetDlgItem(IDC_BTN_FILEPLAYPAUSE)->SetWindowTextA("播放"); + m_Btn_PlayPause.SetIcon(IDI_ICON_PLAY); + } + } + g_bReplayPlay = m_bIsPlay; +} + +//读文件并播放,在TimerPlayFunc中调用 +void CShowReplayDlg::ReadAndPlay() +{ + //如果正在播放且滑动条没有暂停相应 + if(m_bIsPlay == TRUE && m_bPauseSliderReflect == FALSE) + { + if (m_bFileOpen == FALSE) + { + return; + } + + int readLen = 0; + //时钟设定之后,每次调用函数,每次顺次读一下文件 + readLen = m_ReplayFile.Read(m_FileInfo.Buffer, m_FileInfo.FrameLen); + + //当前文件位置 + m_FileInfo.curFilePos += readLen; + + // 判断是否已到文件结尾 + if(m_FileInfo.curFilePos < m_FileInfo.FileTotalLen) + { + // 输出原始数据 + ReplayInputData(m_FileInfo.Buffer, readLen); + + // 输出播放百分比 + double ratio = 0.0; + ratio = m_FileInfo.curFilePos * 1.0 / m_FileInfo.FileTotalLen; + int rangeMax = m_SliderReplayRatio.GetRangeMax(); + int currentPos = static_cast(ratio * rangeMax + 0.5); // int类型强制转换为向下取整,加上0.5可以保证取整时四舍五入 + + m_bPauseSliderReflect = TRUE; // 暂停滑动条响应 + m_SliderReplayRatio.SetPos(currentPos); + CString str; + str.Format("%.1f", ratio * 100); + str = str + "%"; +/* UpdateData(TRUE);*/ + GetDlgItem(IDC_STATIC_REPLAY_RATIO)->SetWindowText(str); + m_bPauseSliderReflect = FALSE; // 所有关于输出百分比设置的事情结束之后,开始滑动条响应 + } + else + { + } + } +} + +// 设置回放进度 +void CShowReplayDlg::SetFileReplayRatio(double ratio) +{ + if (ratio < 0 || ratio > 1) + { + return; + } + else + { + if (m_bFileOpen == TRUE) + { + // 计算文件大小 + m_FileInfo.curFilePos = ULONGLONG(m_FileInfo.FileTotalLen * ratio); + m_ReplayFile.Seek(LONGLONG(m_FileInfo.curFilePos), CFile::begin); + } + } +} + +// 拖动滑动条响应函数 +LRESULT CShowReplayDlg::OnBitmapSliderMoving(WPARAM wParam, LPARAM lParam) +{ + if (m_bPauseSliderReflect == FALSE) + { + // 滑动条暂停响应 + m_bPauseSliderReflect = TRUE; + // 确定当前读取文件位置 + int pos = m_SliderReplayRatio.GetPos(); + int rangeMax = m_SliderReplayRatio.GetRangeMax(); + double ratio = pos * 1.0 / rangeMax; + SetFileReplayRatio(ratio); + // 滑动条开始响应 + m_bPauseSliderReflect = FALSE; + } + return 0; +} + +// 停止播放 +void CShowReplayDlg::OnBnClickedBtnFilestop() +{ + if (g_bWorkMode == true) + { + StopTimer(); + + // 读取图像缓存清零 + if (m_bFileOpen == TRUE) + { + m_ReplayFile.Close(); + m_bFileOpen = FALSE; + m_FileInfo.ClearStru(); + } + + m_bIsPlay = FALSE; + + Sleep(20); + + // 播放进度条复位 + m_SliderReplayRatio.SetPos(0); + + // 播放比率置零 + GetDlgItem(IDC_STATIC_REPLAY_RATIO)->SetWindowText(_T("0%")); + //GetDlgItem(IDC_BTN_FILEPLAYPAUSE)->SetWindowTextA("播放"); + m_Btn_PlayPause.SetIcon(IDI_ICON_PLAY); + + // ::PostMessage(g_mainDlgHwnd, WM_SHOW_STOP, 0, 0); + } +} + +// 减速——通过设定每帧字节的大小来控制播放的快慢 +void CShowReplayDlg::OnBnClickedBtnFileslow() +{ + if(m_bFileOpen == TRUE && m_bIsPlay == TRUE) + { + if ((m_FileInfo.FrameLen - 1024) >= g_MinReadLen) + { + m_FileInfo.FrameLen = m_FileInfo.FrameLen - 1024; + } + else + { + m_FileInfo.FrameLen = g_MinReadLen; + } + } +} + +// 加速——通过设定每帧字节的大小来控制播放的快慢 +void CShowReplayDlg::OnBnClickedBtnFilefast() +{ + if(m_bFileOpen == TRUE && m_bIsPlay == TRUE) + { + if (m_FileInfo.FrameLen + 1024 <= g_MaxReadLen) + { + m_FileInfo.FrameLen = m_FileInfo.FrameLen + 1024; + } + else + { + m_FileInfo.FrameLen = g_MaxReadLen; + } + } +} + + +void CShowReplayDlg::OnCbnSelchangeComboxPlaytype() +{ + int state = ((CComboBox*)GetDlgItem(IDC_COMBOX_PLAYTYPE))->GetCurSel(); + // 视频回放功能 + if (state == 0) + { + g_bWorkMode = true; // 回放 + + GetDlgItem(IDC_BTN_OPENFILE)->EnableWindow(TRUE); + GetDlgItem(IDC_BTN_FILEPLAYPAUSE)->EnableWindow(TRUE); + GetDlgItem(IDC_BTN_FILESTOP)->EnableWindow(TRUE); + GetDlgItem(IDC_BTN_FILESLOW)->EnableWindow(TRUE); + GetDlgItem(IDC_BTN_FILEFAST)->EnableWindow(TRUE); + } + + // 实时接收数据显示功能 + else + { + // 停止文件回放 + OnBnClickedBtnFilestop(); + + GetDlgItem(IDC_BTN_OPENFILE)->EnableWindow(FALSE); + GetDlgItem(IDC_BTN_FILEPLAYPAUSE)->EnableWindow(FALSE); + GetDlgItem(IDC_BTN_FILESTOP)->EnableWindow(FALSE); + GetDlgItem(IDC_BTN_FILESLOW)->EnableWindow(FALSE); + GetDlgItem(IDC_BTN_FILEFAST)->EnableWindow(FALSE); + + g_bWorkMode = false; // 实时 + } +} +void CShowReplayDlg::OnDestroy() +{ + CDialogEx::OnDestroy(); + + // 停止文件回放 + OnBnClickedBtnFilestop(); +} + +// 判断进程是否正在运行函数 返回0说明没有运行 +DWORD CShowReplayDlg::GetProcessIdFromName(LPCTSTR name) +{ + PROCESSENTRY32 pe; + DWORD id = 0; + HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); + pe.dwSize = sizeof(PROCESSENTRY32); + if( !Process32First(hSnapshot,&pe) ) + return 0; + while(1) + { + pe.dwSize = sizeof(PROCESSENTRY32); + if( Process32Next(hSnapshot,&pe)==FALSE ) + break; + if(strcmp(pe.szExeFile,name) == 0) + { + id = pe.th32ProcessID; + break; + } + } + CloseHandle(hSnapshot); + return id; +} + + +LRESULT CShowReplayDlg::ReturnPayloadTypeWarning(WPARAM wParam, LPARAM lParam) +{ + UpdateData(FALSE); + return 0; +} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/ShowReplayDlg.h b/Src/CH91PayloadSoftware/ShowReplayDlg.h new file mode 100644 index 0000000..b05f1e3 --- /dev/null +++ b/Src/CH91PayloadSoftware/ShowReplayDlg.h @@ -0,0 +1,112 @@ +#pragma once +#include "resource.h" +#include "afxcmn.h" +#include "ExtendSliderCtrl.h" +#include "BtnST.h" +#include "BitmapSlider.h" +#include "tlhelp32.h" +//读文件结构体 +// 为保证初始读数速度为25fps,此处计算得出速度为8533 +static const int g_DefaultReadLen = 6000; // 8k +static const int g_MaxReadLen = 20480; // 20k +static const int g_MinReadLen = 1024; // 1k +struct struFileStru +{ + ULONGLONG FileTotalLen; // 文件 长度 + ULONGLONG curFilePos; // 当前读取文件当前内容位置 + UINT FrameLen; // 每帧字节大小 + BYTE Buffer[g_MaxReadLen]; // 从文件读取的数据每帧数据存放位置 + + struFileStru() + { + FileTotalLen = 0; + curFilePos = 0; + FrameLen = g_DefaultReadLen; + }; + + void ClearStru() + { + FileTotalLen = 0; + curFilePos = 0; + FrameLen = 8533; + } +}; + + +// CShowReplayDlg 对话框 +class CShowReplayDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CShowReplayDlg) + +public: + CShowReplayDlg(CWnd* pParent = NULL); // 标准构造函数 + virtual ~CShowReplayDlg(); + +// 对话框数据 + enum { IDD = IDD_DLG_REPLAY }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + DECLARE_MESSAGE_MAP() + +private: + CString m_HFfilePath; //打开回放文件路径 + CFile m_ReplayFile; //回放文件对象 + BOOL m_bFileOpen; //文件是否打开成功 + struFileStru m_FileInfo; // 回放文件信息 + UINT m_TimerID; // 定时器编号 + UINT m_TimerPeriod; // 定时器周期 + BOOL m_bIsPlay; // 正在播放或者已经暂停 + BOOL m_bPauseSliderReflect; // 暂停滑动条响应 + BOOL m_bService; // 判断后台服务程序是否打开 + + // 美化视频回放界面按钮 + CButtonST m_Btn_OpenFile; // 打开文件 + CButtonST m_Btn_PlayPause; // 播放暂停 + CButtonST m_Btn_Stop; // 停止播放 + CButtonST m_Btn_SpeedUp; // 加速播放 + CButtonST m_Btn_SpeedDown; // 减速播放 + + // 对话框半透明设置变量 + BOOL m_bTransParent; // TRUE为半透明,初始设置为FALSE + + +public: + //CExtendSliderCtrl m_SliderReplayRatio; // 滑动条关联变量 + CBitmapSlider m_SliderReplayRatio; // 滑动条关联变量——加载bitmap + + virtual BOOL OnInitDialog(); + + void StartTimer(); // 启动定时器 + void StopTimer(); // 关闭定时器 + + void ReadAndPlay(); // 读取文件,并播放 + + void SetFileReplayRatio(double ratio); // 设置回放进度 + + afx_msg void OnBnClickedBtnOpenfile(); // 打开文件 + // 播放及暂停视频 + afx_msg void OnBnClickedBtnFileplaypause(); + // 停止播放 + afx_msg void OnBnClickedBtnFilestop(); + // 播放进度变慢 + afx_msg void OnBnClickedBtnFileslow(); + // 播放进度变快 + afx_msg void OnBnClickedBtnFilefast(); + // 选择模式——实时/回放(默认实时) + afx_msg void OnCbnSelchangeComboxPlaytype(); + // 关闭窗口时销毁 + afx_msg void OnDestroy(); +// afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + // 滑动条响应函数 + afx_msg LRESULT OnBitmapSliderMoving(WPARAM wParam, LPARAM lParam); + + // 判断进程是否正在运行函数 返回0说明没有运行 + DWORD GetProcessIdFromName(LPCTSTR name); + + virtual BOOL PreTranslateMessage(MSG* pMsg); + + // CH92中修改DC为EO/IR + LRESULT ReturnPayloadTypeWarning(WPARAM wParam, LPARAM lParam); +}; \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/ShowWaveDlg.cpp b/Src/CH91PayloadSoftware/ShowWaveDlg.cpp new file mode 100644 index 0000000..d81b5e3 --- /dev/null +++ b/Src/CH91PayloadSoftware/ShowWaveDlg.cpp @@ -0,0 +1,82 @@ +// ShowWaveDlg.cpp : 实现文件 +// + +#include "stdafx.h" +#include "CH91PayloadSoftware.h" +#include "ShowWaveDlg.h" +#include "afxdialogex.h" +#include "Global.h" +#include "GlobalMessage.h" +#include "GlobalMember.h" + + +// CShowWaveDlg 对话框 + +IMPLEMENT_DYNAMIC(CShowWaveDlg, CDialogEx) + +CShowWaveDlg::CShowWaveDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CShowWaveDlg::IDD, pParent) +{ + +} + +CShowWaveDlg::~CShowWaveDlg() +{ +} + +void CShowWaveDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Control(pDX, IDC_STATIC_WAVESHOW, m_WaveShow); +} + + +BEGIN_MESSAGE_MAP(CShowWaveDlg, CDialogEx) + ON_MESSAGE(WM_SHOW_WAVE, CShowWaveDlg::ShowWave) + ON_WM_LBUTTONDOWN() +END_MESSAGE_MAP() + + +// CShowWaveDlg 消息处理程序 + +BOOL CShowWaveDlg::OnInitDialog() +{ + CDialogEx::OnInitDialog(); + // 获取句柄 + g_ShowWaveHwnd = GetSafeHwnd(); + m_WaveShow.SetTitle(0,"载荷方位角"); + m_WaveShow.SetTitle(1,"载荷俯仰角"); + m_WaveShow.SetTitle(2,"UAV方位角"); + m_WaveShow.SetTitle(3,"UAV俯仰角"); + m_WaveShow.SetTitle(4,"UAV滚转角"); + m_WaveShow.SetXRange(0,100); + m_WaveShow.SetYRange(-50,50); + m_wavetime = 0; + return TRUE; +} + +LRESULT CShowWaveDlg::ShowWave(WPARAM wParam, LPARAM lParam) +{ + m_wavetime += 0.1; + m_WaveShow.AddValue(0, m_wavetime, g_ZH_Azimuth); + m_WaveShow.AddValue(1, m_wavetime, g_ZH_Pitch); + m_WaveShow.AddValue(2, m_wavetime, g_GPS_LR_Heading); + m_WaveShow.AddValue(3, m_wavetime, g_GPS_FB_Pitch); + m_WaveShow.AddValue(4, m_wavetime, g_GPS_LR_Roll); + m_WaveShow.UpdateCurve(); + return 0; +} + +// 相应鼠标左键点击消息 +void CShowWaveDlg::OnLButtonDown(UINT nFlags, CPoint point) +{ + CRect rect; + GetDlgItem(IDC_STATIC_WAVESHOW)->GetWindowRect(&rect); + ScreenToClient(rect); + + point.x -= rect.left; + point.y -= rect.top; + m_WaveShow.OnLButtonDown(nFlags, point); + + CDialogEx::OnLButtonDown(nFlags, point); +} diff --git a/Src/CH91PayloadSoftware/ShowWaveDlg.h b/Src/CH91PayloadSoftware/ShowWaveDlg.h new file mode 100644 index 0000000..2b1c88b --- /dev/null +++ b/Src/CH91PayloadSoftware/ShowWaveDlg.h @@ -0,0 +1,28 @@ +#pragma once +#include "Scope.h" +// CShowWaveDlg 对话框 + +class CShowWaveDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CShowWaveDlg) + +public: + CShowWaveDlg(CWnd* pParent = NULL); // 标准构造函数 + virtual ~CShowWaveDlg(); + +// 对话框数据 + enum { IDD = IDD_DLG_WAVESHOW }; + CScope m_WaveShow; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 + + DECLARE_MESSAGE_MAP() +public: + virtual BOOL OnInitDialog(); + // 绘制曲线 + LRESULT ShowWave(WPARAM wParam, LPARAM lParam); + // 曲线横坐标 + double m_wavetime; + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); +}; diff --git a/Src/CH91PayloadSoftware/ToolkitPro1531vc100.exp b/Src/CH91PayloadSoftware/ToolkitPro1531vc100.exp new file mode 100644 index 0000000..9d5aa93 Binary files /dev/null and b/Src/CH91PayloadSoftware/ToolkitPro1531vc100.exp differ diff --git a/Src/CH91PayloadSoftware/ToolkitPro1531vc100.lib b/Src/CH91PayloadSoftware/ToolkitPro1531vc100.lib new file mode 100644 index 0000000..98639b0 Binary files /dev/null and b/Src/CH91PayloadSoftware/ToolkitPro1531vc100.lib differ diff --git a/Src/CH91PayloadSoftware/ToolkitPro1531vc100D.exp b/Src/CH91PayloadSoftware/ToolkitPro1531vc100D.exp new file mode 100644 index 0000000..a1dbf99 Binary files /dev/null and b/Src/CH91PayloadSoftware/ToolkitPro1531vc100D.exp differ diff --git a/Src/CH91PayloadSoftware/ToolkitPro1531vc100D.lib b/Src/CH91PayloadSoftware/ToolkitPro1531vc100D.lib new file mode 100644 index 0000000..4241136 Binary files /dev/null and b/Src/CH91PayloadSoftware/ToolkitPro1531vc100D.lib differ diff --git a/Src/CH91PayloadSoftware/ToolkitPro1531vc100U.exp b/Src/CH91PayloadSoftware/ToolkitPro1531vc100U.exp new file mode 100644 index 0000000..9ea07f1 Binary files /dev/null and b/Src/CH91PayloadSoftware/ToolkitPro1531vc100U.exp differ diff --git a/Src/CH91PayloadSoftware/ToolkitPro1531vc100U.lib b/Src/CH91PayloadSoftware/ToolkitPro1531vc100U.lib new file mode 100644 index 0000000..cdd7268 Binary files /dev/null and b/Src/CH91PayloadSoftware/ToolkitPro1531vc100U.lib differ diff --git a/Src/CH91PayloadSoftware/ToolkitPro1531vc100UD.exp b/Src/CH91PayloadSoftware/ToolkitPro1531vc100UD.exp new file mode 100644 index 0000000..ce07801 Binary files /dev/null and b/Src/CH91PayloadSoftware/ToolkitPro1531vc100UD.exp differ diff --git a/Src/CH91PayloadSoftware/ToolkitPro1531vc100UD.lib b/Src/CH91PayloadSoftware/ToolkitPro1531vc100UD.lib new file mode 100644 index 0000000..87e4433 Binary files /dev/null and b/Src/CH91PayloadSoftware/ToolkitPro1531vc100UD.lib differ diff --git a/Src/CH91PayloadSoftware/XTToolkitPro.rc b/Src/CH91PayloadSoftware/XTToolkitPro.rc new file mode 100644 index 0000000..db00dad --- /dev/null +++ b/Src/CH91PayloadSoftware/XTToolkitPro.rc @@ -0,0 +1,87 @@ +// Reource file +// +// This file is a part of the XTREME TOOLKIT PRO MFC class library. +// (c)1998-2012 Codejock Software, All Rights Reserved. +// +// THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE +// RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN +// CONSENT OF CODEJOCK SOFTWARE. +// +// THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED +// IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO +// YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A +// SINGLE COMPUTER. +// +// CONTACT INFORMATION: +// support@codejock.com +// http://www.codejock.com +// +///////////////////////////////////////////////////////////////////////////// + +#include "afxres.h" +// #define LANGUAGE_DEFAULT(ProdName) <##ProdName##\res\Resource.rc> +// #define _XTP_RESOURCE_LANGUAGE zh_CN +// +// #ifdef _XTP_RESOURCE_LANGUAGE +// #define LANGUAGE_LOCALIZED__(ProdName, LangName) <##ProdName##\res\Resource_##LangName##.rc> +// #define LANGUAGE_LOCALIZED_(ProdName, LangName) LANGUAGE_LOCALIZED__(ProdName, LangName) +// #define LANGUAGE_LOCALIZED(ProdName) LANGUAGE_LOCALIZED_(ProdName, _XTP_RESOURCE_LANGUAGE) +// #else +// #define LANGUAGE_LOCALIZED(ProdName) LANGUAGE_DEFAULT(ProdName) +// #endif +// +// #if !defined(_XTP_EXCLUDE_CALENDAR) +// #include LANGUAGE_LOCALIZED(Calendar) // _XTP_INCLUDE_CALENDAR +// #endif +// +// #if !defined(_XTP_EXCLUDE_COMMANDBARS) +// #include LANGUAGE_LOCALIZED(CommandBars) // _XTP_INCLUDE_COMMANDBARS +// #endif +// +// #if !defined(_XTP_EXCLUDE_COMMON) +// #include LANGUAGE_LOCALIZED(Common) // _XTP_INCLUDE_COMMON +// #endif +// +// #if !defined(_XTP_EXCLUDE_CONTROLS) +// #include LANGUAGE_LOCALIZED(Controls) // _XTP_INCLUDE_CONTROLS +// #endif +// +// #if !defined(_XTP_EXCLUDE_DOCKINGPANE) +// #include LANGUAGE_LOCALIZED(DockingPane) // _XTP_INCLUDE_DOCKINGPANE +// #endif +// +// #if !defined(_XTP_EXCLUDE_PROPERTYGRID) +// #include LANGUAGE_LOCALIZED(PropertyGrid) // _XTP_INCLUDE_PROPERTYGRID +// #endif +// +// #if !defined(_XTP_EXCLUDE_REPORTCONTROL) +// #include LANGUAGE_LOCALIZED(ReportControl) // _XTP_INCLUDE_REPORTCONTROL +// #endif +// +// #if !defined(_XTP_EXCLUDE_RIBBON) +// #include LANGUAGE_LOCALIZED(Ribbon) // _XTP_INCLUDE_RIBBON +// #endif +// +// #if !defined(_XTP_EXCLUDE_SHORTCUTBAR) +// #include LANGUAGE_LOCALIZED(ShortcutBar) // _XTP_INCLUDE_SHORTCUTBAR +// #endif +// +// #if !defined(_XTP_EXCLUDE_SYNTAXEDIT) +// #include LANGUAGE_LOCALIZED(SyntaxEdit) // _XTP_INCLUDE_SYNTAXEDIT +// #endif +// +// #if !defined(_XTP_EXCLUDE_TABMANAGER) +// #include LANGUAGE_LOCALIZED(TabManager) // _XTP_INCLUDE_TABMANAGER +// #endif +// +// #if !defined(_XTP_EXCLUDE_TASKPANEL) +// #include LANGUAGE_DEFAULT(TaskPanel) // _XTP_INCLUDE_TASKPANEL +// #endif +// +// #if !defined(_XTP_EXCLUDE_CHART) +// #include LANGUAGE_DEFAULT(Chart) // _XTP_INCLUDE_CHART +// #endif +// +// +// #undef LANGUAGE_LOCALIZED +// #undef LANGUAGE_DEFAULT diff --git a/Src/CH91PayloadSoftware/basetype.h b/Src/CH91PayloadSoftware/basetype.h new file mode 100644 index 0000000..b088f8e --- /dev/null +++ b/Src/CH91PayloadSoftware/basetype.h @@ -0,0 +1,255 @@ +#ifndef _BASE_TYPE_H_ +#define _BASE_TYPE_H_ + +#define __WIN_32_VC__ + +#ifdef __WIN_32_VC__ +#include +#include +#include +#include +#include +#include +#endif + +#ifdef __WIN_32_BCB__ +#include +#endif + +#ifdef __WIN_32_BCB__ +typedef unsigned __int8 BYTE; +typedef unsigned __int8 UINT8; +typedef unsigned __int16 UINT16; +typedef unsigned __int32 UINT32; +typedef __int8 INT8; +typedef __int16 INT16; +typedef __int32 INT32; +#endif + +#ifdef __DOS_16_BC__ +typedef unsigned char BYTE; +typedef unsigned char UINT8; +typedef unsigned int UINT16; +typedef unsigned long UINT32; +typedef char INT8; +typedef int INT16; +typedef long INT32; +#endif + +#ifdef __DJGPP__ +typedef unsigned char BYTE; +typedef unsigned char UINT8; +typedef unsigned int UINT16; +typedef unsigned long UINT32; +typedef char INT8; +typedef int INT16; +typedef long INT32; +#endif + +#ifdef __WIN_32_VC__ +typedef unsigned char BYTE; +typedef unsigned char UINT8; +typedef unsigned __int16 UINT16; +typedef unsigned int UINT32; +typedef __int16 INT16; +typedef int INT32; +#endif + +#ifndef __WIN_32_BCB__ +#ifdef __BORLANDC__ +typedef unsigned char BOOL; +const BOOL FALSE = 0; +const BOOL TRUE = 1; +#endif +#endif + +namespace FRAMELIB +{ + #define ROUND_INT8(v) ((INT8)((floor)(v+0.5))) + #define ROUND_UINT8(v) ((UINT8)((floor)(v+0.5))) + #define ROUND_INT16(v) ((INT16)((floor)(v+0.5))) + #define ROUND_UINT16(v) ((UINT16)((floor)(v+0.5))) + #define ROUND_INT32(v) ((INT32)((floor)(v+0.5))) + #define ROUND_UINT32(v) ((UINT32)((floor)(v+0.5))) + + const double PI = 3.141592653589793238462643383279502884197169399; + const double PI2 = PI * 2; + const double PI_2 = PI * 0.5; + const double PI_3 = PI / 3; + const double PI_4 = PI * 0.25; + const double RAD2DEG = 57.295779513082322864647721871733665466308593750000; +} + + +template< class T> inline const int SIGN(const T& x) +{ + return x < 0 ? -1 : 1; +} + +template< class T> inline const T ABS(const T& x) +{ + return x < 0 ? -x : x; +} + +struct struCHECK +{ + struCHECK(){C0=C1=0;}; + BYTE C0; + BYTE C1; +}; + +const UINT16 CRC8TAB[256] = +{ +//0 + 0x0000, 0x0031, 0x0062, 0x0053, 0x00C4, 0x00F5, 0x00A6, 0x0097, + 0x00B9, 0x0088, 0x00DB, 0x00EA, 0x007D, 0x004C, 0x001F, 0x002E, +//1 + 0x0043, 0x0072, 0x0021, 0x0010, 0x0087, 0x00B6, 0x00E5, 0x00D4, + 0x00FA, 0x00CB, 0x0098, 0x00A9, 0x003E, 0x000F, 0x005C, 0x006D, +//2 + 0x0086, 0x00B7, 0x00E4, 0x00D5, 0x0042, 0x0073, 0x0020, 0x0011, + 0x003F, 0x000E, 0x005D, 0x006C, 0x00FB, 0x00CA, 0x0099, 0x00A8, +//3 + 0x00C5, 0x00F4, 0x00A7, 0x0096, 0x0001, 0x0030, 0x0063, 0x0052, + 0x007C, 0x004D, 0x001E, 0x002F, 0x00B8, 0x0089, 0x00DA, 0x00EB, +//4 + 0x003D, 0x000C, 0x005F, 0x006E, 0x00F9, 0x00C8, 0x009B, 0x00AA, + 0x0084, 0x00B5, 0x00E6, 0x00D7, 0x0040, 0x0071, 0x0022, 0x0013, +//5 + 0x007E, 0x004F, 0x001C, 0x002D, 0x00BA, 0x008B, 0x00D8, 0x00E9, + 0x00C7, 0x00F6, 0x00A5, 0x0094, 0x0003, 0x0032, 0x0061, 0x0050, +//6 + 0x00BB, 0x008A, 0x00D9, 0x00E8, 0x007F, 0x004E, 0x001D, 0x002C, + 0x0002, 0x0033, 0x0060, 0x0051, 0x00C6, 0x00F7, 0x00A4, 0x0095, +//7 + 0x00F8, 0x00C9, 0x009A, 0x00AB, 0x003C, 0x000D, 0x005E, 0x006F, + 0x0041, 0x0070, 0x0023, 0x0012, 0x0085, 0x00B4, 0x00E7, 0x00D6, +//8 + 0x007A, 0x004B, 0x0018, 0x0029, 0x00BE, 0x008F, 0x00DC, 0x00ED, + 0x00C3, 0x00F2, 0x00A1, 0x0090, 0x0007, 0x0036, 0x0065, 0x0054, +//9 + 0x0039, 0x0008, 0x005B, 0x006A, 0x00FD, 0x00CC, 0x009F, 0x00AE, + 0x0080, 0x00B1, 0x00E2, 0x00D3, 0x0044, 0x0075, 0x0026, 0x0017, +//A + 0x00FC, 0x00CD, 0x009E, 0x00AF, 0x0038, 0x0009, 0x005A, 0x006B, + 0x0045, 0x0074, 0x0027, 0x0016, 0x0081, 0x00B0, 0x00E3, 0x00D2, +//B + 0x00BF, 0x008E, 0x00DD, 0x00EC, 0x007B, 0x004A, 0x0019, 0x0028, + 0x0006, 0x0037, 0x0064, 0x0055, 0x00C2, 0x00F3, 0x00A0, 0x0091, +//C + 0x0047, 0x0076, 0x0025, 0x0014, 0x0083, 0x00B2, 0x00E1, 0x00D0, + 0x00FE, 0x00CF, 0x009C, 0x00AD, 0x003A, 0x000B, 0x0058, 0x0069, +//D + 0x0004, 0x0035, 0x0066, 0x0057, 0x00C0, 0x00F1, 0x00A2, 0x0093, + 0x00BD, 0x008C, 0x00DF, 0x00FE, 0x0079, 0x0048, 0x001B, 0x002A, +//E + 0x00C1, 0x00F0, 0x00A3, 0x0092, 0x0005, 0x0034, 0x0067, 0x0056, + 0x0078, 0x0049, 0x001A, 0x002B, 0x00BC, 0x008D, 0x00DE, 0x00EF, +//F + 0x0082, 0x00B3, 0x00E0, 0x00D1, 0x0046, 0x0077, 0x0024, 0x0015, + 0x003B, 0x000A, 0x0059, 0x0068, 0x00FF, 0x00CE, 0x009D, 0x00AC +}; + +//206,902,96用的CRC校验码 +const unsigned char CRCLIST[512] = { + 0x0,0x0,0x89,0x11,0x12,0x23,0x9b,0x32,0x24,0x46,0xad,0x57,0x36,0x65,0xbf,0x74, + 0x48,0x8c,0xc1,0x9d,0x5a,0xaf,0xd3,0xbe,0x6c,0xca,0xe5,0xdb,0x7e,0xe9,0xf7,0xf8, + 0x81,0x10,0x8,0x1,0x93,0x33,0x1a,0x22,0xa5,0x56,0x2c,0x47,0xb7,0x75,0x3e,0x64, + 0xc9,0x9c,0x40,0x8d,0xdb,0xbf,0x52,0xae,0xed,0xda,0x64,0xcb,0xff,0xf9,0x76,0xe8, + 0x2,0x21,0x8b,0x30,0x10,0x2,0x99,0x13,0x26,0x67,0xaf,0x76,0x34,0x44,0xbd,0x55, + 0x4a,0xad,0xc3,0xbc,0x58,0x8e,0xd1,0x9f,0x6e,0xeb,0xe7,0xfa,0x7c,0xc8,0xf5,0xd9, + 0x83,0x31,0xa,0x20,0x91,0x12,0x18,0x3,0xa7,0x77,0x2e,0x66,0xb5,0x54,0x3c,0x45, + 0xcb,0xbd,0x42,0xac,0xd9,0x9e,0x50,0x8f,0xef,0xfb,0x66,0xea,0xfd,0xd8,0x74,0xc9, + 0x4,0x42,0x8d,0x53,0x16,0x61,0x9f,0x70,0x20,0x4,0xa9,0x15,0x32,0x27,0xbb,0x36, + 0x4c,0xce,0xc5,0xdf,0x5e,0xed,0xd7,0xfc,0x68,0x88,0xe1,0x99,0x7a,0xab,0xf3,0xba, + 0x85,0x52,0xc,0x43,0x97,0x71,0x1e,0x60,0xa1,0x14,0x28,0x5,0xb3,0x37,0x3a,0x26, + 0xcd,0xde,0x44,0xcf,0xdf,0xfd,0x56,0xec,0xe9,0x98,0x60,0x89,0xfb,0xbb,0x72,0xaa, + 0x6,0x63,0x8f,0x72,0x14,0x40,0x9d,0x51,0x22,0x25,0xab,0x34,0x30,0x6,0xb9,0x17, + 0x4e,0xef,0xc7,0xfe,0x5c,0xcc,0xd5,0xdd,0x6a,0xa9,0xe3,0xb8,0x78,0x8a,0xf1,0x9b, + 0x87,0x73,0xe,0x62,0x95,0x50,0x1c,0x41,0xa3,0x35,0x2a,0x24,0xb1,0x16,0x38,0x7, + 0xcf,0xff,0x46,0xee,0xdd,0xdc,0x54,0xcd,0xeb,0xb9,0x62,0xa8,0xf9,0x9a,0x70,0x8b, + 0x8,0x84,0x81,0x95,0x1a,0xa7,0x93,0xb6,0x2c,0xc2,0xa5,0xd3,0x3e,0xe1,0xb7,0xf0, + 0x40,0x8,0xc9,0x19,0x52,0x2b,0xdb,0x3a,0x64,0x4e,0xed,0x5f,0x76,0x6d,0xff,0x7c, + 0x89,0x94,0x0,0x85,0x9b,0xb7,0x12,0xa6,0xad,0xd2,0x24,0xc3,0xbf,0xf1,0x36,0xe0, + 0xc1,0x18,0x48,0x9,0xd3,0x3b,0x5a,0x2a,0xe5,0x5e,0x6c,0x4f,0xf7,0x7d,0x7e,0x6c, + 0xa,0xa5,0x83,0xb4,0x18,0x86,0x91,0x97,0x2e,0xe3,0xa7,0xf2,0x3c,0xc0,0xb5,0xd1, + 0x42,0x29,0xcb,0x38,0x50,0xa,0xd9,0x1b,0x66,0x6f,0xef,0x7e,0x74,0x4c,0xfd,0x5d, + 0x8b,0xb5,0x2,0xa4,0x99,0x96,0x10,0x87,0xaf,0xf3,0x26,0xe2,0xbd,0xd0,0x34,0xc1, + 0xc3,0x39,0x4a,0x28,0xd1,0x1a,0x58,0xb,0xe7,0x7f,0x6e,0x6e,0xf5,0x5c,0x7c,0x4d, + 0xc,0xc6,0x85,0xd7,0x1e,0xe5,0x97,0xf4,0x28,0x80,0xa1,0x91,0x3a,0xa3,0xb3,0xb2, + 0x44,0x4a,0xcd,0x5b,0x56,0x69,0xdf,0x78,0x60,0xc,0xe9,0x1d,0x72,0x2f,0xfb,0x3e, + 0x8d,0xd6,0x4,0xc7,0x9f,0xf5,0x16,0xe4,0xa9,0x90,0x20,0x81,0xbb,0xb3,0x32,0xa2, + 0xc5,0x5a,0x4c,0x4b,0xd7,0x79,0x5e,0x68,0xe1,0x1c,0x68,0xd,0xf3,0x3f,0x7a,0x2e, + 0xe,0xe7,0x87,0xf6,0x1c,0xc4,0x95,0xd5,0x2a,0xa1,0xa3,0xb0,0x38,0x82,0xb1,0x93, + 0x46,0x6b,0xcf,0x7a,0x54,0x48,0xdd,0x59,0x62,0x2d,0xeb,0x3c,0x70,0xe,0xf9,0x1f, + 0x8f,0xf7,0x6,0xe6,0x9d,0xd4,0x14,0xc5,0xab,0xb1,0x22,0xa0,0xb9,0x92,0x30,0x83, + 0xc7,0x7b,0x4e,0x6a,0xd5,0x58,0x5c,0x49,0xe3,0x3d,0x6a,0x2c,0xf1,0x1e,0x78,0xf +}; +inline struCHECK MakeCheckCRC(UINT8 *ptr,UINT8 len) +{ + struCHECK ck; + int count = 0; + unsigned char C0,C1,Y0,Y1,Z0,Z1; + + C0=C1=Y0=Y1=Z0=Z1=0; + + BYTE *pData = ptr; + while(count < len) + { + //make crc + unsigned int idx = (unsigned int)(*pData); + idx = idx << 1; + Y0=(CRCLIST[idx]^C1) & 0x00FF; + Y1=(CRCLIST[idx+1]) & 0x00FF; + idx = ((unsigned int)C0) << 1; + Z0=CRCLIST[idx] & 0x00FF; + Z1=CRCLIST[idx+1] & 0x00FF; + C0=(Y0^Z0) & 0x00FF; + C1=(Y1^Z1) & 0x00FF; + pData++; + count++; + } + ck.C0=C0; + ck.C1=C1; + + return ck;// return crc result +} + +inline struCHECK getCRC8(UINT8* data, int len) + { + UINT16 crc = 0; + int i=0; + while (len-- > 0) + { + crc = CRC8TAB[crc ^ (data[i]&0x00FF)]; + + i++; + } + + struCHECK ck; + ck.C1=(crc>>8); + ck.C0=(crc&0x00ff); + + return ck; + } + +//和校验 +//inline UINT8 MakeCheckSum(UINT8 *ptr, UINT8 len) +inline struCHECK MakeCheckSum(UINT8 *ptr, UINT8 len) +{ + UINT8 i; + UINT8 CK_A=0; + BYTE *pData = ptr; + + for (i=0; i < len; ++i ) + { + CK_A = CK_A + ptr[i]; + } + + //return CK_A; + struCHECK ck; + ck.C0=CK_A; + ck.C1=0x00; + return ck; +} +#endif//_BASE_TYPE_H_ diff --git a/Src/CH91PayloadSoftware/bufferloop.h b/Src/CH91PayloadSoftware/bufferloop.h new file mode 100644 index 0000000..af47aaa --- /dev/null +++ b/Src/CH91PayloadSoftware/bufferloop.h @@ -0,0 +1,134 @@ +#pragma once +//关键段 +class CSimpleCriticalSection { +private: + CRITICAL_SECTION FSection; +public: + CSimpleCriticalSection(){InitializeCriticalSection(&FSection);} + virtual ~CSimpleCriticalSection(){DeleteCriticalSection(&FSection);} + void Enter(){EnterCriticalSection(&FSection);} + void Leave(){LeaveCriticalSection(&FSection);} +}; +//循环缓冲区类 +class CBufferLoop { +private: + int FSize; //缓冲区大小 + int FStart; //有效数据头 + int FEnd; //有效数据尾 + int FLength; //有效数据长度 + BYTE* FBuffer; //缓冲区地址 +protected: + CSimpleCriticalSection* cs; +protected: + INT16 Append(const unsigned char* Src, const UINT32 alen) + { + INT16 len = (alen > (UINT32) FSize) ? FSize : (INT16) alen; + //assert(len > 0); + //缓存剩余空间不够Length + if ((len + FLength) >= FSize) + len = FSize - FLength; + if ((len + FEnd) >= FSize) { + //缓存内数据块后部空间不够Length,将数据块移到缓存首地址 + memcpy(FBuffer, FBuffer + FStart, FLength); + FStart = 0; + FEnd = FLength; + } + memcpy(FBuffer + FEnd, Src, len); + FEnd += len; + FLength += len; + return len; + } + void Drop(const int len) + { + //assert(len > 0); + if (len > FLength) { + FStart = 0; + FEnd = 0; + FLength = 0; + } else { + FStart += len; + FLength -= len; + } + } + int Size(){return FSize;} + int Length(){return FLength;} +public: + CBufferLoop() : FSize(512), FStart(0), FEnd(0), FLength(0), FBuffer(0),cs(new CSimpleCriticalSection()) + { + FBuffer = new unsigned char[FSize]; + memset(FBuffer, 0, FSize); + }; + CBufferLoop(const CBufferLoop& abl) + : FSize(abl.FSize), FStart(abl.FStart), FEnd(abl.FEnd), + FLength(abl.FLength), FBuffer(0) + { + FBuffer = new unsigned char[FSize]; + memcpy(FBuffer, abl.FBuffer, FSize); + } + virtual ~CBufferLoop(){ + + delete[] FBuffer; + FBuffer = 0; + //by CYH 不注释会报错,原因未知 + //delete cs; + + } + CBufferLoop& operator=(const CBufferLoop& abl) + { + if (this == &abl) + return *this; // 见条款17 + if (FBuffer) + delete[] FBuffer; + FSize = abl.FSize; + FStart = abl.FStart; + FEnd = abl.FEnd; + FLength = abl.FLength; + FBuffer = new unsigned char[FSize]; + memcpy(FBuffer, abl.FBuffer, FSize); + return *this; + } + BYTE* const Addr() {return FBuffer + FStart;} + void Reset() + { + memset(FBuffer, 0, FSize); + FStart = 0; + FEnd = 0; + FLength = 0; + } + //重新申请缓冲区 + void CBufferLoop::AllocMemory(int len) + { + if ( (len > FSize) && (FSize >= 0) && (len < 64 * 1024 * 1024) ) + { + unsigned char *temp = new unsigned char[len]; + if(temp != NULL) + { + if (FBuffer != 0) + { + if (FLength > 0) + { +#ifndef __MSDOS__ + cs->Enter(); +#endif + memcpy((void*)temp, (void*)(FBuffer + FStart), (unsigned int)FLength); + FSize = len; + FStart = 0; + FEnd = FLength; +#ifndef __MSDOS__ + cs->Leave(); +#endif + } + else + { + FSize = len; + FStart = 0; + FEnd = 0; + FLength = 0; + } + delete[] FBuffer; + } + FBuffer = temp; + } + } + } +}; \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/cDESUtils.cpp b/Src/CH91PayloadSoftware/cDESUtils.cpp new file mode 100644 index 0000000..a5ff261 --- /dev/null +++ b/Src/CH91PayloadSoftware/cDESUtils.cpp @@ -0,0 +1,516 @@ +#include "StdAfx.h" +#include "cDESUtils.h" + +/** + + *数据初始置换表 + + */ +int T1[8][8]={58,50,42,34,26,18,10,2, + 60,52,44,36,28,20,12,4, + 62,54,46,38,30,22,14,6, + 64,56,48,40,32,24,16,8, + 57,49,41,33,25,17,9,1, + 59,51,43,35,27,19,11,3, + 61,53,45,37,29,21,13,5, + 63,55,47,39,31,23,15,7}; +/** + + *密钥初始置换表 + + */ +int T2[8][7]={57,49,41,33,25,17,9, + 1,58,50,42,34,26,18, + 10,2,59,51,43,35,27, + 19,11,3,60,52,44,36, + 3,55,47,39,31,23,15, + 7,62,54,46,38,30,22, + 14,6,61,53,45,37,29, + 21,13,5,28,20,12,4}; + +/** + + *密钥循环左移位数表 + + */ +//int T3[16]={1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1}; +int T3[16]={1,2,2,3,1,1,3,2,2,1,3,2,1,1,4,1}; + +/** + + *密钥压缩置换表 + + */ +int T4[8][6]={14,17,11,24,1,5, + 3,28,15,6,21,10, + 23,19,12,4,26,8, + 16,7,27,20,13,2, + 41,52,31,37,47,55, + 30,40,51,45,33,48, + 44,49,39,56,34,53, + 46,42,50,36,29,32}; + +/** + + *数据扩展表 + + */ +int T5[8][6]={32,1,2,3,4,5, + 4,5,6,7,8,9, + 8,9,10,11,12,13, + 12,13,14,15,16,17, + 16,17,18,19,20,21, + 20,21,22,23,24,25, + 24,25,26,27,28,29, + 28,29,30,31,32,1}; + +/** + + *S盒置换表 + + */ +int S[8][4][16]={{{14,4,13,1,2,15,11,8,3,10,6,12,5,9,0,7},{0,15,7,4,14,2,13,1,10,6,12,11,9,5,3,8},{4,1,14,8,13,6,2,11,15,12,9,7,3,10,5,0},{15,12,8,2,4,9,1,7,5,11,3,14,10,0,6,13}}, + {{15,1,8,14,6,11,3,4,9,7,2,13,12,0,5,10},{3,13,4,7,15,2,8,14,12,0,1,10,6,9,11,5},{ 0,14,7,11,10,4,13,1,5,8,12,6,9,3,2,15},{ 13,8,10,1,3,15,4,2,11,6,7,12,0,5,14,9}}, + {{10,0,9,14,6,3,15,5,1,13,12,7,11,4,2,8},{13,7,0,9,3,4,6,10,2,8,5,14,12,11,15,1},{13,6,4,9,8,15,3,0,11,1,2,12,5,10,14,7},{1,10,13,0,6,9,8,7,4,15,14,3,11,5,2,12}}, + {{7,13,14,3,0,6,9,10,1,2,8,5,11,12,4,15},{13,8,11,5,6,15,0,3,4,7,2,12,1,10,14,9},{10,6,9,0,12,11,7,13,15,1,3,14,5,2,8,4},{3,15,0,6,10,1,13,8,9,4,5,11,12,7,2,14}}, + {{2,12,4,1,7,10,11,6,8,5,3,15,13,0,14,9},{14,11,2,12,4,7,13,1,5,0,15,10,3,9,8,6},{4,2,1,11,10,13,7,8,15,9,12,5,6,3,0,14},{11,8,12,7,1,14,2,13,6,15,0,9,10,4,5,3}}, + {{12,1,10,15,9,2,6,8,0,13,3,4,14,7,5,11},{10,15,4,2,7,12,9,5,6,1,13,14,0,11,3,8},{9,14,15,5,2,8,12,3,7,0,4,10,1,13,11,6},{4,3,2,12,9,5,15,10,11,14,1,7,6,0,8,13}}, + {{4,11,2,14,15,0,8,13,3,12,9,7,5,10,6,1},{13,0,11,7,4,9,1,10,14,3,5,12,2,15,8,6},{1,4,11,13,12,3,7,14,10,15,6,8,0,5,9,2},{6,11,13,8,1,4,10,7,9,5,0,15,14,2,3,12}}, + {{13,2,8,4,6,15,11,1,10,9,3,14,5,0,12,7},{1,15,13,8,10,3,7,4,12,5,6,11,0,14,9,2},{7,11,4,1,9,12,14,2,0,6,10,13,15,3,5,8},{2,1,14,7,4,10,8,13,15,12,9,0,3,5,6,11}}}; + +/** + + *P盒置换表 + + */ +int P[4][8]={16,7,20,21, + 29,12,28,17, + 1,15,23,26, + 5,18,31,10, + 2,8,24,14, + 32,27,3,9, + 19,13,30,6, + 22,11,4,25}; + + +/** + + *最终置换表 + + */ +int T6[8][8]={ 40,8,48,16,56,24,64,32, + 39,7,47,15,55,23,63,31, + 38,6,46,14,54,22,62,30, + 37,5,45,13,53,21,61,29, + 36,4,44,12,52,20,60,28, + 35,3,43,11,51,19,59,27, + 34,2,42,10,50,18,58,26, + 33,1,41,9,49,17,57,25}; + +cDESUtils::cDESUtils(void) +{ +} + + +cDESUtils::~cDESUtils(void) +{ +} + +/** + + *最终置换函数 64位->64位 + + *函数说明:s为完成最后一轮循环得到的64为数据 + + *返回值为密文或明文 + + */ +std::string cDESUtils::final_permutation(string s) +{ + string rs=""; + for(int i=0;i<8;i++) + { + for(int j=0;j<8;j++) + { + rs+=s[T6[i][j]-1]; + } + } + return rs; +} + + +/** + + *P盒置换函数 32位->32位 + + *函数说明:s为S盒的输出 + + */ +std::string cDESUtils::P_box(string s) +{ + string rs=""; + for(int i=0;i<4;i++) + { + for(int j=0;j<8;j++) + { + rs+=(s[P[i][j]-1]); + } + } + return rs; +} + +/** + + *S盒置换函数 48位->32位 + + *函数说明:s为48位数据 + + *返回值为32位 + + */ +std::string cDESUtils::S_box(string s) +{ + string rs=""; + string s1; + int k1,k2;//S盒的行号和列号 + int h=1;//决定使用那个S盒 + for(int i=0;i<=42;i=i+6,h++) + { + k1=(s[i]-'0')*2+(s[i+5]-'0')*1; + k2=(s[i+1]-'0')*8+(s[i+2]-'0')*4+(s[i+3]-'0')*2+(s[i+4]-'0')*1; + int x=S[h-1][k1][k2]; + s1=""; + int y=8; + for(int j=1;j<=4;j++) + { + if(x48 + + *函数说明:s为数据的右半部分 32位 + + *扩展成48位的输出 + + */ +std::string cDESUtils::plaintext_righthalf_extended_permutation(string s) +{ + string rs=""; + for(int i=0;i<8;i++) + { + for(int j=0;j<6;j++) + { + rs+=s[T5[i][j]-1]; + } + } + return rs; +} + +/** + + *密钥压缩置换函数 56位->48位 + + *函数说明:s为56为的密钥 + + *输出为48位的子密钥 + + */ +std::string cDESUtils::secret_key_compression_replacement(string s) +{ + string rs=""; + for(int i=0;i<8;i++) + { + for(int j=0;j<6;j++) + { + rs+=s[T4[i][j]-1]; + } + } + return rs; +} + +/** + + *密钥循环左移函数 56位->56位 + + *函数说明:k为左移位数 s为密钥 + + *返回值位数不变 + + */ +std::string cDESUtils::secret_ket_left_move(int k,string s) +{ + string s1=s.substr(0,28); + string s2=s.substr(28,28); + string rs=s1.substr(k,28-k)+s1.substr(0,k)+s2.substr(k,28-k)+s2.substr(0,k); + return rs; +} + +/** + + *密钥初始置换函数 64位->58位 + + *函数说明:s为64位的初始密钥 + + *返回值为58位 + + */ +std::string cDESUtils::secret_key_initial_permutation(string s) +{ + string rs=""; + for(int i=0;i<8;i++) + { + for(int j=0;j<7;j++) + { + rs+=s[T2[i][j]-1]; + } + } + return rs; +} + +/** + + *明文初始置换函数 64位->64位 + + *函数说明:s为初始明文 64位 + + *返回值为6位 + + */ +std::string cDESUtils::plaintext_initial_permutation(string s) +{ + string rs=""; + for(int i=0;i<8;i++) + { + for(int j=0;j<8;j++) + { + rs+=s[T1[i][j]-1]; + } + } + return rs; +} + +/** + + *16进制转2进制函数 + + *函数说明:s为16进制字符串 + + *返回为2进制字符串 + + */ +std::string cDESUtils::H(string s) +{ + string s1; + string rs=""; + for(int i=0;i='0'&&s[i]<='9') + { + x=s[i]-'0'; + }else + { + x=s[i]-'A'+10; + } + s1=""; + int y=8; + for(int j=1;j<=4;j++) + { + if(x=10) + { + temp=(char)(x-10+'A'); + }else + { + temp=(char)(x+'0'); + } + rs+=temp; + } + return rs; +} + +/** + + *封装函数f + + *函数说明:接收32位数据和48位的子密钥 产生一个32位的输出 + + *str1:32位数据 str2:48位的子密钥 + + *返回值32位 + + */ +std::string cDESUtils::foldFunc(string str1,string str2) +{ + //32位数据扩展为48位 + string expendR=plaintext_righthalf_extended_permutation(str1); + //密钥和扩展数据异或 + string rs=XOR(expendR,str2); + //S盒替代(48->32) + rs=S_box(rs); + //P盒替代(32->32) + rs=P_box(rs); + + return rs; +} + +/** + + *子密钥生成函数 + + *函数说明:s为给定的密钥 + + *生成16个子密钥 + + */ +void cDESUtils::generateKeys(string s) +{ + s=secret_key_initial_permutation(s); + + for(int i=1;i<=16;i++) + { + s=secret_ket_left_move(T3[i-1],s); + Keys[i]=secret_key_compression_replacement(s); + } +} + +/** + + *DES加密函数 64位->64位 + + *函数说明:str1为64位的给定明文 + + *返回值为64位的密文 + + */ +std::string cDESUtils::encrypt(string str1) +{ + //第一步:明文初始置换 64->64 + str1=plaintext_initial_permutation(str1); + + //第二步:数据分组 + string left=str1.substr(0,32); + string right=str1.substr(32,32); + + string newleft; + + //第三步:16轮迭代 + for(int i=1;i<=16;i++) + { + newleft=right; + + right=XOR(left,foldFunc(right,Keys[i])); + + left=newleft; + } + + //第四步:合并数据 注意位R16L16 + string rs=right+left; + + //结尾置换 + rs=final_permutation(rs); + + return rs; +} + +/** + + *解密函数 + + *str为密文 + + *输出明文 + + */ +std::string cDESUtils::decrypt(string str) +{ + //把密文当作明文进行初始明文置换(64->64) + str=plaintext_initial_permutation(str); + + //分组 + string left=str.substr(0,32); + string right=str.substr(32,32); + + string newleft; + + //逆序的子密钥使用 16轮迭代 + for(int i=16;i>=1;i--) + { + newleft=right; + right=XOR(left,foldFunc(right,Keys[i])); + left=newleft; + } + + //合并 + string rs=right+left; + + //最后置换 + rs=final_permutation(rs); + + return rs; +} diff --git a/Src/CH91PayloadSoftware/cDESUtils.h b/Src/CH91PayloadSoftware/cDESUtils.h new file mode 100644 index 0000000..f687d4b --- /dev/null +++ b/Src/CH91PayloadSoftware/cDESUtils.h @@ -0,0 +1,184 @@ +#include + +#pragma once + +using namespace std; +class cDESUtils +{ + + +public: + cDESUtils(void); + ~cDESUtils(void); + +private: + /** + + *最终置换函数 64位->64位 + + *函数说明:s为完成最后一轮循环得到的64为数据 + + *返回值为密文或明文 + + */ +string final_permutation(string s); + +/** + + *P盒置换函数 32位->32位 + + *函数说明:s为S盒的输出 + + */ +string P_box(string s); + +/** + + *S盒置换函数 48位->32位 + + *函数说明:s为48位数据 + + *返回值为32位 + + */ +string S_box(string s); + +/** + + *异或运算函数 + + *要求位数相同 + + */ +string XOR(string s1,string s2); + +/** + + *数据扩展函数 32->48 + + *函数说明:s为数据的右半部分 32位 + + *扩展成48位的输出 + + */ +string plaintext_righthalf_extended_permutation(string s); + +/** + + *密钥压缩置换函数 56位->48位 + + *函数说明:s为56为的密钥 + + *输出为48位的子密钥 + + */ +string secret_key_compression_replacement(string s); + +/** + + *密钥循环左移函数 56位->56位 + + *函数说明:k为左移位数 s为密钥 + + *返回值位数不变 + + */ +string secret_ket_left_move(int k,string s);//密钥循环左移k位 + +/** + + *密钥初始置换函数 64位->58位 + + *函数说明:s为64位的初始密钥 + + *返回值为58位 + + */ +string secret_key_initial_permutation(string s); + +/** + + *明文初始置换函数 64位->64位 + + *函数说明:s为初始明文 64位 + + *返回值为6位 + + */ +string plaintext_initial_permutation(string s);//明文初始置换 + +/** + + *封装函数f + + *函数说明:接收32位数据和48位的子密钥 产生一个32位的输出 + + *str1:32位数据 str2:48位的子密钥 + + *返回值32位 + + */ + +string foldFunc(string str1,string str2); + + +string Keys[20]; + +public: + /** + + *16进制转2进制函数 + + *函数说明:s为16进制字符串 + + *返回为2进制字符串 + + */ +string H(string s); + +/** + + *2进制转16进制函数 + + *str为2进制字符串 + + *返回值为16进制字符串 + + */ +string G(string str); + + /** + + *子密钥生成函数 + + *函数说明:s为给定的密钥 + + *生成16个子密钥 + + */ + void generateKeys(string s); + + /** + + *DES加密函数 64位->64位 + + *函数说明:str1为64位的给定明文 + + *返回值为64位的密文 + + */ + string encrypt(string str1); + + /** + + *解密函数 + + *str为密文 + + *输出明文 + + */ + string decrypt(string str); + +}; + diff --git a/Src/CH91PayloadSoftware/cMD5Encode.cpp b/Src/CH91PayloadSoftware/cMD5Encode.cpp new file mode 100644 index 0000000..3ac4fde --- /dev/null +++ b/Src/CH91PayloadSoftware/cMD5Encode.cpp @@ -0,0 +1,217 @@ +#include "StdAfx.h" +#include "cMD5Encode.h" +#include +#include + +// 幻数定义 +const int Md5Encode::kA = 0x67452301; +const int Md5Encode::kB = 0xefcdab89; +const int Md5Encode::kC = 0x98badcfe; +const int Md5Encode::kD = 0x10325476; + +const unsigned long long Md5Encode::k_ti_num_integer = 4294967296; + +// function: CycleMoveLeft +// @param src_num:要左移的数 +// @param bit_num_to_move:要移动的bit位数 +// @return 循环左移后的结果数 +UInt32 Md5Encode::CycleMoveLeft(UInt32 src_num, int bit_num_to_move) { + UInt32 src_num1 = src_num; + UInt32 src_num2 = src_num; + if (0 >= bit_num_to_move) { + return src_num; + } + UInt32 num1 = src_num1 << bit_num_to_move; + UInt32 num2 = src_num2 >> (32 - bit_num_to_move); + + return ((src_num1 << bit_num_to_move) \ + | (src_num2 >> (32 - bit_num_to_move))); +} + +// function: FillData +// @param in_data_ptr: 要加密的信息数据 +// @param data_byte_len: 数据的字节数 +// @param out_data_ptr: 填充必要信息后的数据 +// return : 填充信息后的数据长度,以字节为单位 +UInt32 Md5Encode::FillData(const char *in_data_ptr, int data_byte_len, char** out_data_ptr) { + int bit_num = data_byte_len*BIT_OF_BYTE; + int grop_num = bit_num / BIT_OF_GROUP; + int mod_bit_num = bit_num % BIT_OF_GROUP; + int bit_need_fill = 0; + if (mod_bit_num > (BIT_OF_GROUP - SRC_DATA_LEN)) { + bit_need_fill = (BIT_OF_GROUP - mod_bit_num); + bit_need_fill += (BIT_OF_GROUP - SRC_DATA_LEN); + } + else { + bit_need_fill = (BIT_OF_GROUP - SRC_DATA_LEN) - mod_bit_num; // 这里多加了一个BIT_OF_GROUP,避免bit_need_fill正好等于0,暂时不加 + } + int all_bit = bit_num + bit_need_fill; + if (0 < bit_need_fill) { + *out_data_ptr = new char[all_bit / BIT_OF_BYTE + SRC_DATA_LEN / BIT_OF_BYTE]; + memset(*out_data_ptr, 0, all_bit / BIT_OF_BYTE + SRC_DATA_LEN / BIT_OF_BYTE); + // copy data + memcpy(*out_data_ptr, in_data_ptr, data_byte_len); + // fill rest data + unsigned char *tmp = reinterpret_cast(*out_data_ptr); + tmp += data_byte_len; + // fill 1 and 0 + *tmp = 0x80; + // fill origin data len + unsigned long long * origin_num = (unsigned long long *)((*out_data_ptr) + ((all_bit / BIT_OF_BYTE))); + *origin_num = data_byte_len*BIT_OF_BYTE; + } + return (all_bit / BIT_OF_BYTE + SRC_DATA_LEN / BIT_OF_BYTE); +} + +void Md5Encode::RoundF(char *data_BIT_OF_GROUP_ptr, ParamDynamic & param) { + UInt32 *M = reinterpret_cast(data_BIT_OF_GROUP_ptr); + int s[] = { 7, 12, 17, 22 }; + for (int i = 0; i < 16; ++i) { + UInt32 ti = k_ti_num_integer * abs(sin(double(i + 1))); + if (i % 4 == 0) { + FF(param.ua_, param.ub_, param.uc_, param.ud_, M[i], s[i % 4], ti); + } + else if (i % 4 == 1) { + FF(param.ud_, param.ua_, param.ub_, param.uc_, M[i], s[i % 4], ti); + } + else if (i % 4 == 2) { + FF(param.uc_, param.ud_, param.ua_, param.ub_, M[i], s[i % 4], ti); + } + else if (i % 4 == 3) { + FF(param.ub_, param.uc_, param.ud_, param.ua_, M[i], s[i % 4], ti); + } + } +} + +void Md5Encode::RoundG(char *data_BIT_OF_GROUP_ptr, ParamDynamic & param) { + UInt32 *M = reinterpret_cast(data_BIT_OF_GROUP_ptr); + int s[] = { 5, 9, 14, 20 }; + for (int i = 0; i < 16; ++i) { + UInt32 ti = k_ti_num_integer * abs(sin(double(i + 1 + 16))); + int index = (i * 5 + 1) % 16; + if (i % 4 == 0) { + GG(param.ua_, param.ub_, param.uc_, param.ud_, M[index], s[i % 4], ti); + } + else if (i % 4 == 1) { + GG(param.ud_, param.ua_, param.ub_, param.uc_, M[index], s[i % 4], ti); + } + else if (i % 4 == 2) { + GG(param.uc_, param.ud_, param.ua_, param.ub_, M[index], s[i % 4], ti); + } + else if (i % 4 == 3) { + GG(param.ub_, param.uc_, param.ud_, param.ua_, M[index], s[i % 4], ti); + } + } +} + +void Md5Encode::RoundH(char *data_BIT_OF_GROUP_ptr, ParamDynamic & param) { + UInt32 *M = reinterpret_cast(data_BIT_OF_GROUP_ptr); + int s[] = { 4, 11, 16, 23 }; + for (int i = 0; i < 16; ++i) { + UInt32 ti = k_ti_num_integer * abs(sin(double(i + 1 + 32))); + int index = (i * 3 + 5) % 16; + if (i % 4 == 0) { + HH(param.ua_, param.ub_, param.uc_, param.ud_, M[index], s[i % 4], ti); + } + else if (i % 4 == 1) { + HH(param.ud_, param.ua_, param.ub_, param.uc_, M[index], s[i % 4], ti); + } + else if (i % 4 == 2) { + HH(param.uc_, param.ud_, param.ua_, param.ub_, M[index], s[i % 4], ti); + } + else if (i % 4 == 3) { + HH(param.ub_, param.uc_, param.ud_, param.ua_, M[index], s[i % 4], ti); + } + } +} + +void Md5Encode::RoundI(char *data_BIT_OF_GROUP_ptr, ParamDynamic & param) { + UInt32 *M = reinterpret_cast(data_BIT_OF_GROUP_ptr); + int s[] = { 6, 10, 15, 21 }; + for (int i = 0; i < 16; ++i) { + UInt32 ti = k_ti_num_integer * abs(sin(double(i + 1 + 48))); + int index = (i * 7 + 0) % 16; + if (i % 4 == 0) { + II(param.ua_, param.ub_, param.uc_, param.ud_, M[index], s[i % 4], ti); + } + else if (i % 4 == 1) { + II(param.ud_, param.ua_, param.ub_, param.uc_, M[index], s[i % 4], ti); + } + else if (i % 4 == 2) { + II(param.uc_, param.ud_, param.ua_, param.ub_, M[index], s[i % 4], ti); + } + else if (i % 4 == 3) { + II(param.ub_, param.uc_, param.ud_, param.ua_, M[index], s[i % 4], ti); + } + } +} + +void Md5Encode::RotationCalculate(char *data_512_ptr, ParamDynamic & param) { + if (NULL == data_512_ptr) { + return; + } + RoundF(data_512_ptr, param); + RoundG(data_512_ptr, param); + RoundH(data_512_ptr, param); + RoundI(data_512_ptr, param); + param.ua_ = param.va_last_ + param.ua_; + param.ub_ = param.vb_last_ + param.ub_; + param.uc_ = param.vc_last_ + param.uc_; + param.ud_ = param.vd_last_ + param.ud_; + + param.va_last_ = param.ua_; + param.vb_last_ = param.ub_; + param.vc_last_ = param.uc_; + param.vd_last_ = param.ud_; +} + +// 转换成十六进制字符串输出 +std::string Md5Encode::GetHexStr(unsigned int num_str) { + std::string hexstr = ""; + char szch[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; + unsigned char *tmptr = (unsigned char *)&num_str; + int len = sizeof(num_str); + // 小端字节序,逆序打印 + for (int i = 0; i < len; i++){ + unsigned char ch = tmptr[i] & 0xF0; + ch = ch >> 4; + hexstr.append(1, szch[ch]); + ch = tmptr[i] & 0x0F; + hexstr.append(1, szch[ch]); + } + return hexstr; +} + +// function: Encode +// @param src_info:要加密的信息 +// return :加密后的MD5值 +std::string Md5Encode::Encode(std::string src_info) { + ParamDynamic param; + param.ua_ = kA; + param.ub_ = kB; + param.uc_ = kC; + param.ud_ = kD; + param.va_last_ = kA; + param.vb_last_ = kB; + param.vc_last_ = kC; + param.vd_last_ = kD; + + std::string result; + const char *src_data = src_info.c_str(); + char *out_data_ptr = NULL; + int total_byte = FillData(src_data, strlen(src_data), &out_data_ptr); + //char * data_BIT_OF_GROUP = out_data_ptr; + for (int i = 0; i < total_byte / (BIT_OF_GROUP / BIT_OF_BYTE); ++i) { + char * data_BIT_OF_GROUP = out_data_ptr; + data_BIT_OF_GROUP += i*(BIT_OF_GROUP / BIT_OF_BYTE); + RotationCalculate(data_BIT_OF_GROUP, param); + } + if (NULL != out_data_ptr) { + delete[] out_data_ptr, out_data_ptr = NULL; + } + result.append(GetHexStr(param.ua_)); + result.append(GetHexStr(param.ub_)); + result.append(GetHexStr(param.uc_)); + result.append(GetHexStr(param.ud_)); + return result; +} \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/cMD5Encode.h b/Src/CH91PayloadSoftware/cMD5Encode.h new file mode 100644 index 0000000..b337709 --- /dev/null +++ b/Src/CH91PayloadSoftware/cMD5Encode.h @@ -0,0 +1,71 @@ +/* +******************************************************* +* brief: md5 encryption +* author: Monkey.Knight +******************************************************* +*/ + +#ifndef __MD5_ENCODE_H__ +#define __MD5_ENCODE_H__ + +// std +#include + +// define +#define UInt32 unsigned int +#define BIT_OF_BYTE 8 +#define BIT_OF_GROUP 512 +#define SRC_DATA_LEN 64 + +// 四个非线性函数宏定义 +#define DEF_F(X, Y, Z ) ((( (X) & (Y) )|((~X)&(Z)))) +#define DEF_G(X, Y, Z) (((X)&(Z))|((Y)&(~Z))) +#define DEF_H(X, Y, Z) ((X)^(Y)^(Z)) +#define DEF_I(X, Y, Z) ((Y)^((X)|(~Z))) + +// 求链接数函数宏定义 +#define FF(a, b, c, d, Mj, s, ti) (a = b + CycleMoveLeft((a + DEF_F(b,c,d) + Mj + ti),s)); +#define GG(a, b, c, d, Mj, s, ti) (a = b + CycleMoveLeft((a + DEF_G(b,c,d) + Mj + ti),s)); +#define HH(a, b, c, d, Mj, s, ti) (a = b + CycleMoveLeft((a + DEF_H(b,c,d) + Mj + ti),s)); +#define II(a, b, c, d, Mj, s, ti) (a = b + CycleMoveLeft((a + DEF_I(b,c,d) + Mj + ti),s)); + +#pragma once +class Md5Encode { +public: + // 4轮循环算法 + struct ParamDynamic{ + UInt32 ua_; + UInt32 ub_; + UInt32 uc_; + UInt32 ud_; + UInt32 va_last_; + UInt32 vb_last_; + UInt32 vc_last_; + UInt32 vd_last_; + }; +public: + Md5Encode() { + } + std::string Encode(std::string src_info); + +protected: + + UInt32 CycleMoveLeft(UInt32 src_num, int bit_num_to_move); + UInt32 FillData(const char *in_data_ptr, int data_byte_len, char** out_data_ptr); + void RoundF(char *data_512_ptr, ParamDynamic & param); + void RoundG(char *data_512_ptr, ParamDynamic & param); + void RoundH(char *data_512_ptr, ParamDynamic & param); + void RoundI(char *data_512_ptr, ParamDynamic & param); + void RotationCalculate(char *data_512_ptr, ParamDynamic & param); + std::string GetHexStr(unsigned int num_str); + +private: + // 幻数定义 + static const int kA; + static const int kB; + static const int kC; + static const int kD; + static const unsigned long long k_ti_num_integer; +}; + +#endif \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/cPhysicsInfoUtils.cpp b/Src/CH91PayloadSoftware/cPhysicsInfoUtils.cpp new file mode 100644 index 0000000..8d34178 --- /dev/null +++ b/Src/CH91PayloadSoftware/cPhysicsInfoUtils.cpp @@ -0,0 +1,159 @@ +#include "StdAfx.h" +#include "cPhysicsInfoUtils.h" +#include +#include +#include +#include +#include +#include + +#pragma comment(lib, "Iphlpapi.lib") +#pragma comment(lib, "ws2_32.lib") +#pragma comment(lib, "netapi32.lib") + +cPhysicsInfoUtils::cPhysicsInfoUtils(void) +{ +} + + +cPhysicsInfoUtils::~cPhysicsInfoUtils(void) +{ +} + +/*//调试不可用 +BOOL cPhysicsInfoUtils::GetSerialNum(string& pSerialNum) +{ + HANDLE hFile = CreateFile(_T("\\\\.\\PHYSICALDRIVE0"), 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); + if (INVALID_HANDLE_VALUE == hFile) + { + return FALSE; + } + + DWORD retn; + static BYTE buffer[0x1000]; + STORAGE_DEVICE_DESCRIPTOR* descriptor = (STORAGE_DEVICE_DESCRIPTOR*)buffer; + STORAGE_PROPERTY_QUERY p = {StorageDeviceIdProperty, PropertyStandardQuery}; + if (!DeviceIoControl(hFile, IOCTL_STORAGE_QUERY_PROPERTY, &p, sizeof(p), buffer, sizeof(buffer), &retn, 0)) + { + return FALSE; + } + + if (descriptor->SerialNumberOffset > 0) + { + char Serial[256]; + BYTE* data; + data = buffer + descriptor->SerialNumberOffset; + sprintf_s(Serial, 256, "%s", data); + string SerialNum = Serial; + //删除硬盘序列号两端的空格 + SerialNum.erase(0, SerialNum.find_first_not_of(" ")); + SerialNum.erase(SerialNum.find_last_not_of(" ") + 1); + pSerialNum = SerialNum; + } + + return TRUE; +} +*/ + +BOOL cPhysicsInfoUtils::GetHardDiskSerial(string& pSerial) +{ + char SerialNumber[1024] = {""}; + memset(&SerialNumber, 0, sizeof(SerialNumber)); + + MasterHardDiskSerial a; + int ret = a.GetSerialNo(SerialNumber); + if (!ret) + { + pSerial = SerialNumber; + } + + return TRUE; +} + +BOOL cPhysicsInfoUtils::GetMAC(string& pMac) +{ + char mac[128]; + string getMac_key; + PIP_ADAPTER_INFO pAdapterInfo; + PIP_ADAPTER_INFO pAdapter = NULL; + DWORD dwRetVal = 0; + ULONG ulOutBufLen; + + pAdapterInfo = (PIP_ADAPTER_INFO)malloc(sizeof(PIP_ADAPTER_INFO)); + ulOutBufLen = sizeof(PIP_ADAPTER_INFO); + if (GetAdaptersInfo(pAdapterInfo, &ulOutBufLen) == ERROR_BUFFER_OVERFLOW) + { + free(pAdapterInfo); + pAdapterInfo = (PIP_ADAPTER_INFO)malloc(ulOutBufLen); + } + + if ((dwRetVal = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen)) == NO_ERROR) + { + pAdapter = pAdapterInfo; + if (pAdapter) + { + sprintf_s(mac, 128, "%02x-%02x-%02x-%02x-%02x-%02x", + pAdapter->Address[0], + pAdapter->Address[1], + pAdapter->Address[2], + pAdapter->Address[3], + pAdapter->Address[4], + pAdapter->Address[5]); + pMac = mac; + + return TRUE; + } + } + + return FALSE; +} + +BOOL cPhysicsInfoUtils::GetCPU_iD(string& pCPU_iD) +{ + int dwBuf[4]; + getcpuid((unsigned int *)dwBuf, 1); + char pCpuId[32] = ""; + sprintf(pCpuId,"%08X",dwBuf[3]); + sprintf(pCpuId + 8, "%08X", dwBuf[0]); + pCPU_iD = pCpuId; + + return TRUE; +} + +void cPhysicsInfoUtils::getcpuid(unsigned int *CPUInfo, unsigned int InfoType) +{ + #if defined(__GNUC__)// GCC + __cpuid(InfoType, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]); + #elif defined(_MSC_VER)// MSVC + #if _MSC_VER >= 1400 //VC2005才支持__cpuid + __cpuid((int*)(void*)CPUInfo, (int)(InfoType)); + #else //其他使用getcpuidex + getcpuidex(CPUInfo, InfoType, 0); + #endif + #endif +} + +void cPhysicsInfoUtils::getcpuidex(unsigned int *CPUInfo, unsigned int InfoType, unsigned int ECXValue) +{ + #if defined(_MSC_VER) // MSVC + #if defined(_WIN64) // 64位下不支持内联汇编. 1600: VS2010, 据说VC2008 SP1之后才支持__cpuidex. + __cpuidex((int*)(void*)CPUInfo, (int)InfoType, (int)ECXValue); + #else + if (NULL==CPUInfo) + return; + _asm{ + // load. 读取参数到寄存器. + mov edi, CPUInfo; + mov eax, InfoType; + mov ecx, ECXValue; + // CPUID + cpuid; + // save. 将寄存器保存到CPUInfo + mov [edi], eax; + mov [edi+4], ebx; + mov [edi+8], ecx; + mov [edi+12], edx; + } + #endif + #endif +} diff --git a/Src/CH91PayloadSoftware/cPhysicsInfoUtils.h b/Src/CH91PayloadSoftware/cPhysicsInfoUtils.h new file mode 100644 index 0000000..a04016b --- /dev/null +++ b/Src/CH91PayloadSoftware/cPhysicsInfoUtils.h @@ -0,0 +1,27 @@ +#include +#include "MasterHardDiskSerial.h" + +#pragma once +using namespace std; +class cPhysicsInfoUtils +{ +public: + cPhysicsInfoUtils(void); + ~cPhysicsInfoUtils(void); + +public: + //获取硬盘序列号 + //BOOL GetSerialNum(string& pSerialNum);//调试不可用 + BOOL GetHardDiskSerial(string& pSerial); + + //获取MAC地址 + BOOL GetMAC(string& pMac); + + //获取CPU ID + BOOL GetCPU_iD(string& pCPU_iD); + +private: + void getcpuid(unsigned int *CPUInfo, unsigned int InfoType); + void getcpuidex(unsigned int *CPUInfo, unsigned int InfoType, unsigned int ECXValue); +}; + diff --git a/Src/CH91PayloadSoftware/deinterlace.cpp b/Src/CH91PayloadSoftware/deinterlace.cpp new file mode 100644 index 0000000..1d353ad --- /dev/null +++ b/Src/CH91PayloadSoftware/deinterlace.cpp @@ -0,0 +1,125 @@ +// deinterlace.cpp : 定义控制台应用程序的入口点。 +// + +#include "stdafx.h" +#include "deinterlace.h" +/* + * ======== deinterlace_420psemi.c ======== + * Video encoder algorithm. + * + * This file contains an implementation of the IVIDENC1 interface + * defined by XDM. + */ + +#include +typedef unsigned char uint8_t; + +enum YUVFormat{ + FMT_YUV411P, + FMT_YUV420P, + FMT_YUV420PSEMI, + FMT_YUV422P, + FMT_YUV444P}; + + +#define MAX_NEG_CROP 0 + +static uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP]; + + +void Deinterlace_init(void) +{ + int i; + + for(i=0;i<256;i++) ff_cropTbl[i + MAX_NEG_CROP] = i; + for(i=0;i 0;size--) { + sum = -lum_m4[0]; + sum += lum_m3[0] << 2; + sum += lum_m2[0] << 1; + sum += lum_m1[0] << 2; + sum += -lum[0]; + dst[0] = cm[(sum + 4) >> 3]; + + if(sum >= 2040) dst[0] = 0xff; + + lum_m4++; + lum_m3++; + lum_m2++; + lum_m1++; + lum++; + dst++; + } +} + +void deinterlace_bottom_field(uint8_t *dst, int dst_wrap, + const uint8_t *src1, int src_wrap, + int width, int height) +{ + const uint8_t *src_m2, *src_m1, *src_0, *src_p1, *src_p2; + int y; + + src_m2 = src1; + src_m1 = src1; + src_0=&src_m1[src_wrap]; + src_p1=&src_0[src_wrap]; + src_p2=&src_p1[src_wrap]; + for(y=0;y<(height-2);y+=2) { + memcpy(dst,src_m1,width); + dst += dst_wrap; + deinterlace_line(dst,src_m2,src_m1,src_0,src_p1,src_p2,width); + src_m2 = src_0; + src_m1 = src_p1; + src_0 = src_p2; + src_p1 += 2*src_wrap; + src_p2 += 2*src_wrap; + dst += dst_wrap; + } + memcpy(dst,src_m1,width); + dst += dst_wrap; + /* do last line */ + deinterlace_line(dst,src_m2,src_m1,src_0,src_0,src_0,width); +} + +int Deinterlace_process(unsigned char *dst, unsigned char *src, int width, int height) +{ + int i; + unsigned char *srcData[3]={NULL},*dstData[3]={NULL}; + int iplane = 1; + + if ((width & 3) != 0 || (height & 3) != 0) + return -1; + + + srcData[0] = src; + srcData[1] = src + width *height; + srcData[2] = src + ((width*height*5)>>2); + dstData[0] = dst; + dstData[1] = dst + width *height; + dstData[2] = dst + ((width*height*5)>>2); + + for(i=0;i>= 1; + height >>= 1; + } + deinterlace_bottom_field(dstData[i], width, srcData[i], width, width, height); + } + + memset(dstData[1], 128, (width * height)>>1); + return 0; +} diff --git a/Src/CH91PayloadSoftware/deinterlace.h b/Src/CH91PayloadSoftware/deinterlace.h new file mode 100644 index 0000000..582a0b8 --- /dev/null +++ b/Src/CH91PayloadSoftware/deinterlace.h @@ -0,0 +1,6 @@ +#ifndef _DEINTERLACE_H_ +#define _DEINTERLACE_H_ + +void Deinterlace_init(void); +int Deinterlace_process(unsigned char *dst, unsigned char *src, int width, int height); +#endif \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/ffttools.hpp b/Src/CH91PayloadSoftware/ffttools.hpp new file mode 100644 index 0000000..8580a27 --- /dev/null +++ b/Src/CH91PayloadSoftware/ffttools.hpp @@ -0,0 +1,237 @@ +/* +Author: Christian Bailer +Contact address: Christian.Bailer@dfki.de +Department Augmented Vision DFKI + + License Agreement + For Open Source Computer Vision Library + (3-clause BSD License) + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the names of the copyright holders nor the names of the contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as is" and +any express or implied warranties, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose are disclaimed. +In no event shall copyright holders or contributors be liable for any direct, +indirect, incidental, special, exemplary, or consequential damages +(including, but not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) however caused +and on any theory of liability, whether in contract, strict liability, +or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. +*/ + +#pragma once + +//#include + +#ifndef _OPENCV_FFTTOOLS_HPP_ +#define _OPENCV_FFTTOOLS_HPP_ +#endif + +//NOTE: FFTW support is still shaky, disabled for now. +/*#ifdef USE_FFTW +#include +#endif*/ + +namespace FFTTools +{ +// Previous declarations, to avoid warnings +cv::Mat fftd(cv::Mat img, bool backwards = false); +cv::Mat real(cv::Mat img); +cv::Mat imag(cv::Mat img); +cv::Mat magnitude(cv::Mat img); +cv::Mat complexMultiplication(cv::Mat a, cv::Mat b); +cv::Mat complexDivision(cv::Mat a, cv::Mat b); +void rearrange(cv::Mat &img); +void normalizedLogTransform(cv::Mat &img); + + +cv::Mat fftd(cv::Mat img, bool backwards) +{ +/* +#ifdef USE_FFTW + + fftw_complex * fm = (fftw_complex*) fftw_malloc(sizeof (fftw_complex) * img.cols * img.rows); + + fftw_plan p = fftw_plan_dft_2d(img.rows, img.cols, fm, fm, backwards ? 1 : -1, 0 * FFTW_ESTIMATE); + + + if (img.channels() == 1) + { + for (int i = 0; i < img.rows; i++) + for (int j = 0; j < img.cols; j++) + { + fm[i * img.cols + j][0] = img.at(i, j); + fm[i * img.cols + j][1] = 0; + } + } + else + { + assert(img.channels() == 2); + for (int i = 0; i < img.rows; i++) + for (int j = 0; j < img.cols; j++) + { + fm[i * img.cols + j][0] = img.at (i, j)[0]; + fm[i * img.cols + j][1] = img.at (i, j)[1]; + } + } + fftw_execute(p); + cv::Mat res(img.rows, img.cols, CV_64FC2); + + + for (int i = 0; i < img.rows; i++) + for (int j = 0; j < img.cols; j++) + { + res.at (i, j)[0] = fm[i * img.cols + j][0]; + res.at (i, j)[1] = fm[i * img.cols + j][1]; + + // _iout(fm[i * img.cols + j][0]); + } + + if (backwards)res *= 1.d / (float) (res.cols * res.rows); + + fftw_free(p); + fftw_free(fm); + return res; + +#else +*/ + if (img.channels() == 1) + { + cv::Mat planes[] = {cv::Mat_ (img), cv::Mat_::zeros(img.size())}; + //cv::Mat planes[] = {cv::Mat_ (img), cv::Mat_::zeros(img.size())}; + cv::merge(planes, 2, img); + } + cv::dft(img, img, backwards ? (cv::DFT_INVERSE | cv::DFT_SCALE) : 0 ); + + return img; + +/*#endif*/ + +} + +cv::Mat real(cv::Mat img) +{ + std::vector planes; + cv::split(img, planes); + return planes[0]; +} + +cv::Mat imag(cv::Mat img) +{ + std::vector planes; + cv::split(img, planes); + return planes[1]; +} + +cv::Mat magnitude(cv::Mat img) +{ + cv::Mat res; + std::vector planes; + cv::split(img, planes); // planes[0] = Re(DFT(I), planes[1] = Im(DFT(I)) + if (planes.size() == 1) res = cv::abs(img); + else if (planes.size() == 2) cv::magnitude(planes[0], planes[1], res); // planes[0] = magnitude + else assert(0); + return res; +} + +cv::Mat complexMultiplication(cv::Mat a, cv::Mat b) +{ + std::vector pa; + std::vector pb; + cv::split(a, pa); + cv::split(b, pb); + + std::vector pres; + pres.push_back(pa[0].mul(pb[0]) - pa[1].mul(pb[1])); + pres.push_back(pa[0].mul(pb[1]) + pa[1].mul(pb[0])); + + cv::Mat res; + cv::merge(pres, res); + + return res; +} + +cv::Mat complexDivision(cv::Mat a, cv::Mat b) +{ + std::vector pa; + std::vector pb; + cv::split(a, pa); + cv::split(b, pb); + + cv::Mat divisor = 1. / (pb[0].mul(pb[0]) + pb[1].mul(pb[1])); + + std::vector pres; + + pres.push_back((pa[0].mul(pb[0]) + pa[1].mul(pb[1])).mul(divisor)); + pres.push_back((pa[1].mul(pb[0]) + pa[0].mul(pb[1])).mul(divisor)); + + cv::Mat res; + cv::merge(pres, res); + return res; +} + +void rearrange(cv::Mat &img) +{ + // img = img(cv::Rect(0, 0, img.cols & -2, img.rows & -2)); + int cx = img.cols / 2; + int cy = img.rows / 2; + + cv::Mat q0(img, cv::Rect(0, 0, cx, cy)); // Top-Left - Create a ROI per quadrant + cv::Mat q1(img, cv::Rect(cx, 0, cx, cy)); // Top-Right + cv::Mat q2(img, cv::Rect(0, cy, cx, cy)); // Bottom-Left + cv::Mat q3(img, cv::Rect(cx, cy, cx, cy)); // Bottom-Right + + cv::Mat tmp; // swap quadrants (Top-Left with Bottom-Right) + q0.copyTo(tmp); + q3.copyTo(q0); + tmp.copyTo(q3); + q1.copyTo(tmp); // swap quadrant (Top-Right with Bottom-Left) + q2.copyTo(q1); + tmp.copyTo(q2); +} +/* +template < typename type> +cv::Mat fouriertransFull(const cv::Mat & in) +{ + return fftd(in); + + cv::Mat planes[] = {cv::Mat_ (in), cv::Mat_::zeros(in.size())}; + cv::Mat t; + assert(planes[0].depth() == planes[1].depth()); + assert(planes[0].size == planes[1].size); + cv::merge(planes, 2, t); + cv::dft(t, t); + + //cv::normalize(a, a, 0, 1, CV_MINMAX); + //cv::normalize(t, t, 0, 1, CV_MINMAX); + + // cv::imshow("a",real(a)); + // cv::imshow("b",real(t)); + // cv::waitKey(0); + + return t; +}*/ + +void normalizedLogTransform(cv::Mat &img) +{ + img = cv::abs(img); + img += cv::Scalar::all(1); + cv::log(img, img); + // cv::normalize(img, img, 0, 1, CV_MINMAX); +} + +} diff --git a/Src/CH91PayloadSoftware/fhog.cpp b/Src/CH91PayloadSoftware/fhog.cpp new file mode 100644 index 0000000..978beb9 --- /dev/null +++ b/Src/CH91PayloadSoftware/fhog.cpp @@ -0,0 +1,511 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2010-2013, University of Nizhny Novgorod, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + + +//Modified from latentsvm module's "lsvmc_featurepyramid.cpp". + +//#include "precomp.hpp" +//#include "_lsvmc_latentsvm.h" +//#include "_lsvmc_resizeimg.h" +#include "stdafx.h" +#include "fhog.hpp" + + +#ifdef HAVE_TBB +#include +#include "tbb/parallel_for.h" +#include "tbb/blocked_range.h" +#endif + +#ifndef max +#define max(a,b) (((a) > (b)) ? (a) : (b)) +#endif + +#ifndef min +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#endif + + +/* +// Getting feature map for the selected subimage +// +// API +// int getFeatureMaps(const IplImage * image, const int k, featureMap **map); +// INPUT +// image - selected subimage +// k - size of cells +// OUTPUT +// map - feature map +// RESULT +// Error status +*/ +int getFeatureMaps(const IplImage* image, const int k, CvLSVMFeatureMapCaskade **map) +{ + int sizeX, sizeY; + int p, px, stringSize; + int height, width, numChannels; + int i, j, kk, c, ii, jj, d; + float * datadx, * datady; + + int ch; + float magnitude, x, y, tx, ty; + + IplImage * dx, * dy; + int *nearest; + float *w, a_x, b_x; + + float kernel[3] = {-1.f, 0.f, 1.f}; + CvMat kernel_dx = cvMat(1, 3, CV_32F, kernel); + CvMat kernel_dy = cvMat(3, 1, CV_32F, kernel); + + float * r; + int * alfa; + + float boundary_x[NUM_SECTOR + 1]; + float boundary_y[NUM_SECTOR + 1]; + float max, dotProd; + int maxi; + + height = image->height; + width = image->width ; + + numChannels = image->nChannels; + + dx = cvCreateImage(cvSize(image->width, image->height), + IPL_DEPTH_32F, 3); + dy = cvCreateImage(cvSize(image->width, image->height), + IPL_DEPTH_32F, 3); + + sizeX = width / k; + sizeY = height / k; + px = 3 * NUM_SECTOR; + p = px; + stringSize = sizeX * p; + allocFeatureMapObject(map, sizeX, sizeY, p); + + cvFilter2D(image, dx, &kernel_dx, cvPoint(-1, 0)); + cvFilter2D(image, dy, &kernel_dy, cvPoint(0, -1)); + + float arg_vector; + for(i = 0; i <= NUM_SECTOR; i++) + { + arg_vector = ( (float) i ) * ( (float)(PI) / (float)(NUM_SECTOR) ); + boundary_x[i] = cosf(arg_vector); + boundary_y[i] = sinf(arg_vector); + }/*for(i = 0; i <= NUM_SECTOR; i++) */ + + r = (float *)malloc( sizeof(float) * (width * height)); + alfa = (int *)malloc( sizeof(int ) * (width * height * 2)); + + for(j = 1; j < height - 1; j++) + { + datadx = (float*)(dx->imageData + dx->widthStep * j); + datady = (float*)(dy->imageData + dy->widthStep * j); + for(i = 1; i < width - 1; i++) + { + c = 0; + x = (datadx[i * numChannels + c]); + y = (datady[i * numChannels + c]); + + r[j * width + i] =sqrtf(x * x + y * y); + for(ch = 1; ch < numChannels; ch++) + { + tx = (datadx[i * numChannels + ch]); + ty = (datady[i * numChannels + ch]); + magnitude = sqrtf(tx * tx + ty * ty); + if(magnitude > r[j * width + i]) + { + r[j * width + i] = magnitude; + c = ch; + x = tx; + y = ty; + } + }/*for(ch = 1; ch < numChannels; ch++)*/ + + max = boundary_x[0] * x + boundary_y[0] * y; + maxi = 0; + for (kk = 0; kk < NUM_SECTOR; kk++) + { + dotProd = boundary_x[kk] * x + boundary_y[kk] * y; + if (dotProd > max) + { + max = dotProd; + maxi = kk; + } + else + { + if (-dotProd > max) + { + max = -dotProd; + maxi = kk + NUM_SECTOR; + } + } + } + alfa[j * width * 2 + i * 2 ] = maxi % NUM_SECTOR; + alfa[j * width * 2 + i * 2 + 1] = maxi; + }/*for(i = 0; i < width; i++)*/ + }/*for(j = 0; j < height; j++)*/ + + nearest = (int *)malloc(sizeof(int ) * k); + w = (float*)malloc(sizeof(float) * (k * 2)); + + for(i = 0; i < k / 2; i++) + { + nearest[i] = -1; + }/*for(i = 0; i < k / 2; i++)*/ + for(i = k / 2; i < k; i++) + { + nearest[i] = 1; + }/*for(i = k / 2; i < k; i++)*/ + + for(j = 0; j < k / 2; j++) + { + b_x = k / 2 + j + 0.5f; + a_x = k / 2 - j - 0.5f; + w[j * 2 ] = 1.0f/a_x * ((a_x * b_x) / ( a_x + b_x)); + w[j * 2 + 1] = 1.0f/b_x * ((a_x * b_x) / ( a_x + b_x)); + }/*for(j = 0; j < k / 2; j++)*/ + for(j = k / 2; j < k; j++) + { + a_x = j - k / 2 + 0.5f; + b_x =-j + k / 2 - 0.5f + k; + w[j * 2 ] = 1.0f/a_x * ((a_x * b_x) / ( a_x + b_x)); + w[j * 2 + 1] = 1.0f/b_x * ((a_x * b_x) / ( a_x + b_x)); + }/*for(j = k / 2; j < k; j++)*/ + + for(i = 0; i < sizeY; i++) + { + for(j = 0; j < sizeX; j++) + { + for(ii = 0; ii < k; ii++) + { + for(jj = 0; jj < k; jj++) + { + if ((i * k + ii > 0) && + (i * k + ii < height - 1) && + (j * k + jj > 0) && + (j * k + jj < width - 1)) + { + d = (k * i + ii) * width + (j * k + jj); + (*map)->map[ i * stringSize + j * (*map)->numFeatures + alfa[d * 2 ]] += + r[d] * w[ii * 2] * w[jj * 2]; + (*map)->map[ i * stringSize + j * (*map)->numFeatures + alfa[d * 2 + 1] + NUM_SECTOR] += + r[d] * w[ii * 2] * w[jj * 2]; + if ((i + nearest[ii] >= 0) && + (i + nearest[ii] <= sizeY - 1)) + { + (*map)->map[(i + nearest[ii]) * stringSize + j * (*map)->numFeatures + alfa[d * 2 ] ] += + r[d] * w[ii * 2 + 1] * w[jj * 2 ]; + (*map)->map[(i + nearest[ii]) * stringSize + j * (*map)->numFeatures + alfa[d * 2 + 1] + NUM_SECTOR] += + r[d] * w[ii * 2 + 1] * w[jj * 2 ]; + } + if ((j + nearest[jj] >= 0) && + (j + nearest[jj] <= sizeX - 1)) + { + (*map)->map[i * stringSize + (j + nearest[jj]) * (*map)->numFeatures + alfa[d * 2 ] ] += + r[d] * w[ii * 2] * w[jj * 2 + 1]; + (*map)->map[i * stringSize + (j + nearest[jj]) * (*map)->numFeatures + alfa[d * 2 + 1] + NUM_SECTOR] += + r[d] * w[ii * 2] * w[jj * 2 + 1]; + } + if ((i + nearest[ii] >= 0) && + (i + nearest[ii] <= sizeY - 1) && + (j + nearest[jj] >= 0) && + (j + nearest[jj] <= sizeX - 1)) + { + (*map)->map[(i + nearest[ii]) * stringSize + (j + nearest[jj]) * (*map)->numFeatures + alfa[d * 2 ] ] += + r[d] * w[ii * 2 + 1] * w[jj * 2 + 1]; + (*map)->map[(i + nearest[ii]) * stringSize + (j + nearest[jj]) * (*map)->numFeatures + alfa[d * 2 + 1] + NUM_SECTOR] += + r[d] * w[ii * 2 + 1] * w[jj * 2 + 1]; + } + } + }/*for(jj = 0; jj < k; jj++)*/ + }/*for(ii = 0; ii < k; ii++)*/ + }/*for(j = 1; j < sizeX - 1; j++)*/ + }/*for(i = 1; i < sizeY - 1; i++)*/ + + cvReleaseImage(&dx); + cvReleaseImage(&dy); + + + free(w); + free(nearest); + + free(r); + free(alfa); + + return LATENT_SVM_OK; +} + +/* +// Feature map Normalization and Truncation +// +// API +// int normalizeAndTruncate(featureMap *map, const float alfa); +// INPUT +// map - feature map +// alfa - truncation threshold +// OUTPUT +// map - truncated and normalized feature map +// RESULT +// Error status +*/ +int normalizeAndTruncate(CvLSVMFeatureMapCaskade *map, const float alfa) +{ + int i,j, ii; + int sizeX, sizeY, p, pos, pp, xp, pos1, pos2; + float * partOfNorm; // norm of C(i, j) + float * newData; + float valOfNorm; + + sizeX = map->sizeX; + sizeY = map->sizeY; + partOfNorm = (float *)malloc (sizeof(float) * (sizeX * sizeY)); + + p = NUM_SECTOR; + xp = NUM_SECTOR * 3; + pp = NUM_SECTOR * 12; + + for(i = 0; i < sizeX * sizeY; i++) + { + valOfNorm = 0.0f; + pos = i * map->numFeatures; + for(j = 0; j < p; j++) + { + valOfNorm += map->map[pos + j] * map->map[pos + j]; + }/*for(j = 0; j < p; j++)*/ + partOfNorm[i] = valOfNorm; + }/*for(i = 0; i < sizeX * sizeY; i++)*/ + + sizeX -= 2; + sizeY -= 2; + + newData = (float *)malloc (sizeof(float) * (sizeX * sizeY * pp)); +//normalization + for(i = 1; i <= sizeY; i++) + { + for(j = 1; j <= sizeX; j++) + { + valOfNorm = sqrtf( + partOfNorm[(i )*(sizeX + 2) + (j )] + + partOfNorm[(i )*(sizeX + 2) + (j + 1)] + + partOfNorm[(i + 1)*(sizeX + 2) + (j )] + + partOfNorm[(i + 1)*(sizeX + 2) + (j + 1)]) + FLT_EPSILON; + pos1 = (i ) * (sizeX + 2) * xp + (j ) * xp; + pos2 = (i-1) * (sizeX ) * pp + (j-1) * pp; + for(ii = 0; ii < p; ii++) + { + newData[pos2 + ii ] = map->map[pos1 + ii ] / valOfNorm; + }/*for(ii = 0; ii < p; ii++)*/ + for(ii = 0; ii < 2 * p; ii++) + { + newData[pos2 + ii + p * 4] = map->map[pos1 + ii + p] / valOfNorm; + }/*for(ii = 0; ii < 2 * p; ii++)*/ + valOfNorm = sqrtf( + partOfNorm[(i )*(sizeX + 2) + (j )] + + partOfNorm[(i )*(sizeX + 2) + (j + 1)] + + partOfNorm[(i - 1)*(sizeX + 2) + (j )] + + partOfNorm[(i - 1)*(sizeX + 2) + (j + 1)]) + FLT_EPSILON; + for(ii = 0; ii < p; ii++) + { + newData[pos2 + ii + p ] = map->map[pos1 + ii ] / valOfNorm; + }/*for(ii = 0; ii < p; ii++)*/ + for(ii = 0; ii < 2 * p; ii++) + { + newData[pos2 + ii + p * 6] = map->map[pos1 + ii + p] / valOfNorm; + }/*for(ii = 0; ii < 2 * p; ii++)*/ + valOfNorm = sqrtf( + partOfNorm[(i )*(sizeX + 2) + (j )] + + partOfNorm[(i )*(sizeX + 2) + (j - 1)] + + partOfNorm[(i + 1)*(sizeX + 2) + (j )] + + partOfNorm[(i + 1)*(sizeX + 2) + (j - 1)]) + FLT_EPSILON; + for(ii = 0; ii < p; ii++) + { + newData[pos2 + ii + p * 2] = map->map[pos1 + ii ] / valOfNorm; + }/*for(ii = 0; ii < p; ii++)*/ + for(ii = 0; ii < 2 * p; ii++) + { + newData[pos2 + ii + p * 8] = map->map[pos1 + ii + p] / valOfNorm; + }/*for(ii = 0; ii < 2 * p; ii++)*/ + valOfNorm = sqrtf( + partOfNorm[(i )*(sizeX + 2) + (j )] + + partOfNorm[(i )*(sizeX + 2) + (j - 1)] + + partOfNorm[(i - 1)*(sizeX + 2) + (j )] + + partOfNorm[(i - 1)*(sizeX + 2) + (j - 1)]) + FLT_EPSILON; + for(ii = 0; ii < p; ii++) + { + newData[pos2 + ii + p * 3 ] = map->map[pos1 + ii ] / valOfNorm; + }/*for(ii = 0; ii < p; ii++)*/ + for(ii = 0; ii < 2 * p; ii++) + { + newData[pos2 + ii + p * 10] = map->map[pos1 + ii + p] / valOfNorm; + }/*for(ii = 0; ii < 2 * p; ii++)*/ + }/*for(j = 1; j <= sizeX; j++)*/ + }/*for(i = 1; i <= sizeY; i++)*/ +//truncation + for(i = 0; i < sizeX * sizeY * pp; i++) + { + if(newData [i] > alfa) newData [i] = alfa; + }/*for(i = 0; i < sizeX * sizeY * pp; i++)*/ +//swop data + + map->numFeatures = pp; + map->sizeX = sizeX; + map->sizeY = sizeY; + + free (map->map); + free (partOfNorm); + + map->map = newData; + + return LATENT_SVM_OK; +} +/* +// Feature map reduction +// In each cell we reduce dimension of the feature vector +// according to original paper special procedure +// +// API +// int PCAFeatureMaps(featureMap *map) +// INPUT +// map - feature map +// OUTPUT +// map - feature map +// RESULT +// Error status +*/ +int PCAFeatureMaps(CvLSVMFeatureMapCaskade *map) +{ + int i,j, ii, jj, k; + int sizeX, sizeY, p, pp, xp, yp, pos1, pos2; + float * newData; + float val; + float nx, ny; + + sizeX = map->sizeX; + sizeY = map->sizeY; + p = map->numFeatures; + pp = NUM_SECTOR * 3 + 4; + yp = 4; + xp = NUM_SECTOR; + + nx = 1.0f / sqrtf((float)(xp * 2)); + ny = 1.0f / sqrtf((float)(yp )); + + newData = (float *)malloc (sizeof(float) * (sizeX * sizeY * pp)); + + for(i = 0; i < sizeY; i++) + { + for(j = 0; j < sizeX; j++) + { + pos1 = ((i)*sizeX + j)*p; + pos2 = ((i)*sizeX + j)*pp; + k = 0; + for(jj = 0; jj < xp * 2; jj++) + { + val = 0; + for(ii = 0; ii < yp; ii++) + { + val += map->map[pos1 + yp * xp + ii * xp * 2 + jj]; + }/*for(ii = 0; ii < yp; ii++)*/ + newData[pos2 + k] = val * ny; + k++; + }/*for(jj = 0; jj < xp * 2; jj++)*/ + for(jj = 0; jj < xp; jj++) + { + val = 0; + for(ii = 0; ii < yp; ii++) + { + val += map->map[pos1 + ii * xp + jj]; + }/*for(ii = 0; ii < yp; ii++)*/ + newData[pos2 + k] = val * ny; + k++; + }/*for(jj = 0; jj < xp; jj++)*/ + for(ii = 0; ii < yp; ii++) + { + val = 0; + for(jj = 0; jj < 2 * xp; jj++) + { + val += map->map[pos1 + yp * xp + ii * xp * 2 + jj]; + }/*for(jj = 0; jj < xp; jj++)*/ + newData[pos2 + k] = val * nx; + k++; + } /*for(ii = 0; ii < yp; ii++)*/ + }/*for(j = 0; j < sizeX; j++)*/ + }/*for(i = 0; i < sizeY; i++)*/ +//swop data + + map->numFeatures = pp; + + free (map->map); + + map->map = newData; + + return LATENT_SVM_OK; +} + + +//modified from "lsvmc_routine.cpp" + +int allocFeatureMapObject(CvLSVMFeatureMapCaskade **obj, const int sizeX, + const int sizeY, const int numFeatures) +{ + int i; + (*obj) = (CvLSVMFeatureMapCaskade *)malloc(sizeof(CvLSVMFeatureMapCaskade)); + (*obj)->sizeX = sizeX; + (*obj)->sizeY = sizeY; + (*obj)->numFeatures = numFeatures; + (*obj)->map = (float *) malloc(sizeof (float) * + (sizeX * sizeY * numFeatures)); + for(i = 0; i < sizeX * sizeY * numFeatures; i++) + { + (*obj)->map[i] = 0.0f; + } + return LATENT_SVM_OK; +} + +int freeFeatureMapObject (CvLSVMFeatureMapCaskade **obj) +{ + if(*obj == NULL) return LATENT_SVM_MEM_NULL; + free((*obj)->map); + free(*obj); + (*obj) = NULL; + return LATENT_SVM_OK; +} diff --git a/Src/CH91PayloadSoftware/fhog.hpp b/Src/CH91PayloadSoftware/fhog.hpp new file mode 100644 index 0000000..060bfec --- /dev/null +++ b/Src/CH91PayloadSoftware/fhog.hpp @@ -0,0 +1,178 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2010-2013, University of Nizhny Novgorod, all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + + +//Modified from latentsvm module's "_lsvmc_latentsvm.h". + + +/*****************************************************************************/ +/* Latent SVM prediction API */ +/*****************************************************************************/ + +#ifndef _FHOG_H_ +#define _FHOG_H_ + +#include +//#include "_lsvmc_types.h" +//#include "_lsvmc_error.h" +//#include "_lsvmc_routine.h" + +//#include "opencv2/imgproc.hpp" +#include "opencv2/imgproc/imgproc_c.h" + + +//modified from "_lsvmc_types.h" + +// DataType: STRUCT featureMap +// FEATURE MAP DESCRIPTION +// Rectangular map (sizeX x sizeY), +// every cell stores feature vector (dimension = numFeatures) +// map - matrix of feature vectors +// to set and get feature vectors (i,j) +// used formula map[(j * sizeX + i) * p + k], where +// k - component of feature vector in cell (i, j) +typedef struct{ + int sizeX; + int sizeY; + int numFeatures; + float *map; +} CvLSVMFeatureMapCaskade; + + +#include "float.h" + +#define PI CV_PI + +#define EPS 0.000001 + +#define F_MAX FLT_MAX +#define F_MIN -FLT_MAX + +// The number of elements in bin +// The number of sectors in gradient histogram building +#define NUM_SECTOR 9 + +// The number of levels in image resize procedure +// We need Lambda levels to resize image twice +#define LAMBDA 10 + +// Block size. Used in feature pyramid building procedure +#define SIDE_LENGTH 8 + +#define VAL_OF_TRUNCATE 0.2f + + +//modified from "_lsvm_error.h" +#define LATENT_SVM_OK 0 +#define LATENT_SVM_MEM_NULL 2 +#define DISTANCE_TRANSFORM_OK 1 +#define DISTANCE_TRANSFORM_GET_INTERSECTION_ERROR -1 +#define DISTANCE_TRANSFORM_ERROR -2 +#define DISTANCE_TRANSFORM_EQUAL_POINTS -3 +#define LATENT_SVM_GET_FEATURE_PYRAMID_FAILED -4 +#define LATENT_SVM_SEARCH_OBJECT_FAILED -5 +#define LATENT_SVM_FAILED_SUPERPOSITION -6 +#define FILTER_OUT_OF_BOUNDARIES -7 +#define LATENT_SVM_TBB_SCHEDULE_CREATION_FAILED -8 +#define LATENT_SVM_TBB_NUMTHREADS_NOT_CORRECT -9 +#define FFT_OK 2 +#define FFT_ERROR -10 +#define LSVM_PARSER_FILE_NOT_FOUND -11 + + + +/* +// Getting feature map for the selected subimage +// +// API +// int getFeatureMaps(const IplImage * image, const int k, featureMap **map); +// INPUT +// image - selected subimage +// k - size of cells +// OUTPUT +// map - feature map +// RESULT +// Error status +*/ +int getFeatureMaps(const IplImage * image, const int k, CvLSVMFeatureMapCaskade **map); + + +/* +// Feature map Normalization and Truncation +// +// API +// int normalizationAndTruncationFeatureMaps(featureMap *map, const float alfa); +// INPUT +// map - feature map +// alfa - truncation threshold +// OUTPUT +// map - truncated and normalized feature map +// RESULT +// Error status +*/ +int normalizeAndTruncate(CvLSVMFeatureMapCaskade *map, const float alfa); + +/* +// Feature map reduction +// In each cell we reduce dimension of the feature vector +// according to original paper special procedure +// +// API +// int PCAFeatureMaps(featureMap *map) +// INPUT +// map - feature map +// OUTPUT +// map - feature map +// RESULT +// Error status +*/ +int PCAFeatureMaps(CvLSVMFeatureMapCaskade *map); + + +//modified from "lsvmc_routine.h" + +int allocFeatureMapObject(CvLSVMFeatureMapCaskade **obj, const int sizeX, const int sizeY, + const int p); + +int freeFeatureMapObject (CvLSVMFeatureMapCaskade **obj); + + +#endif diff --git a/Src/CH91PayloadSoftware/freetype291.lib b/Src/CH91PayloadSoftware/freetype291.lib new file mode 100644 index 0000000..9f0bda7 Binary files /dev/null and b/Src/CH91PayloadSoftware/freetype291.lib differ diff --git a/Src/CH91PayloadSoftware/kcftracker.cpp b/Src/CH91PayloadSoftware/kcftracker.cpp new file mode 100644 index 0000000..0dfeb0d --- /dev/null +++ b/Src/CH91PayloadSoftware/kcftracker.cpp @@ -0,0 +1,538 @@ +锘/* + +Tracker based on Kernelized Correlation Filter (KCF) [1] and Circulant Structure with Kernels (CSK) [2]. +CSK is implemented by using raw gray level features, since it is a single-channel filter. +KCF is implemented by using HOG features (the default), since it extends CSK to multiple channels. + +[1] J. F. Henriques, R. Caseiro, P. Martins, J. Batista, +"High-Speed Tracking with Kernelized Correlation Filters", TPAMI 2015. + +[2] J. F. Henriques, R. Caseiro, P. Martins, J. Batista, +"Exploiting the Circulant Structure of Tracking-by-detection with Kernels", ECCV 2012. + +Authors: Joao Faro, Christian Bailer, Joao F. Henriques +Contacts: joaopfaro@gmail.com, Christian.Bailer@dfki.de, henriques@isr.uc.pt +Institute of Systems and Robotics - University of Coimbra / Department Augmented Vision DFKI + + +Constructor parameters, all boolean: + hog: use HOG features (default), otherwise use raw pixels + fixed_window: fix window size (default), otherwise use ROI size (slower but more accurate) + multiscale: use multi-scale tracking (default; cannot be used with fixed_window = true) + +Default values are set for all properties of the tracker depending on the above choices. +Their values can be customized further before calling init(): + interp_factor: linear interpolation factor for adaptation + sigma: gaussian kernel bandwidth + lambda: regularization + cell_size: HOG cell size + padding: area surrounding the target, relative to its size + output_sigma_factor: bandwidth of gaussian target + template_size: template size in pixels, 0 to use ROI size + scale_step: scale step for multi-scale estimation, 1 to disable it + scale_weight: to downweight detection scores of other scales for added stability + +For speed, the value (template_size/cell_size) should be a power of 2 or a product of small prime numbers. + +Inputs to init(): + image is the initial frame. + roi is a cv::Rect with the target positions in the initial frame + +Inputs to update(): + image is the current frame. + +Outputs of update(): + cv::Rect with target positions for the current frame + + +By downloading, copying, installing or using the software you agree to this license. +If you do not agree to this license, do not download, install, +copy or use the software. + + + License Agreement + For Open Source Computer Vision Library + (3-clause BSD License) + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the names of the copyright holders nor the names of the contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as is" and +any express or implied warranties, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose are disclaimed. +In no event shall copyright holders or contributors be liable for any direct, +indirect, incidental, special, exemplary, or consequential damages +(including, but not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) however caused +and on any theory of liability, whether in contract, strict liability, +or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. + */ + +//#ifndef _KCFTRACKER_HEADERS +#include "stdafx.h" +#include "kcftracker.hpp" +#include "ffttools.hpp" +#include "recttools.hpp" +#include "fhog.hpp" +#include "labdata.hpp" + +//#endif + +// Constructor +KCFTracker::KCFTracker(bool hog, bool fixed_window, bool multiscale, bool lab) +{ + + // Parameters equal in all cases + lambda = 0.0001; + padding = 2.5; + //output_sigma_factor = 0.1; + output_sigma_factor = 0.125; + + + if (hog) { // HOG + // VOT + interp_factor = 0.012; + sigma = 0.6; + // TPAMI + //interp_factor = 0.02; + //sigma = 0.5; + cell_size = 4; + _hogfeatures = true; + + if (lab) { + interp_factor = 0.005; + sigma = 0.4; + //output_sigma_factor = 0.025; + output_sigma_factor = 0.1; + + _labfeatures = true; + _labCentroids = cv::Mat(nClusters, 3, CV_32FC1, &data); + cell_sizeQ = cell_size*cell_size; + } + else{ + _labfeatures = false; + } + } + else { // RAW + interp_factor = 0.075; + sigma = 0.2; + cell_size = 1; + _hogfeatures = false; + + if (lab) { + printf("Lab features are only used with HOG features.\n"); + _labfeatures = false; + } + } + + + if (multiscale) { // multiscale + template_size = 96; + //template_size = 100; + scale_step = 1.05; + scale_weight = 0.95; + if (!fixed_window) { + //printf("Multiscale does not support non-fixed window.\n"); + fixed_window = true; + } + } + else if (fixed_window) { // fit correction without multiscale + template_size = 96; + //template_size = 100; + scale_step = 1; + } + else { + template_size = 1; + scale_step = 1; + } +} + +// Initialize tracker +void KCFTracker::init(const cv::Rect &roi, cv::Mat image) +{ + _roi = roi; + assert(roi.width >= 0 && roi.height >= 0); + _tmpl = getFeatures(image, 1);//鍙湁绗竴娆″垵濮嬪寲鐨勬椂鍊欙紝绗簩涓舰鍙傛墠涓1锛屽绗竴甯х壒寰佽繘琛屾眽瀹佺獥骞虫粦 + _prob = createGaussianPeak(size_patch[0], size_patch[1]);//鍒涘缓楂樻柉宄帮紝鍙湁绗竴甯ф墠鐢ㄥ埌 + _alphaf = cv::Mat(size_patch[0], size_patch[1], CV_32FC2, float(0));////alphaf鍒濆鍖 + //_num = cv::Mat(size_patch[0], size_patch[1], CV_32FC2, float(0)); + //_den = cv::Mat(size_patch[0], size_patch[1], CV_32FC2, float(0)); + train(_tmpl, 1.0); // train with initial frame + } +// Update position based on the new frame +cv::Rect KCFTracker::update(cv::Mat image) +{ + if (_roi.x + _roi.width <= 0) _roi.x = -_roi.width + 1; + if (_roi.y + _roi.height <= 0) _roi.y = -_roi.height + 1; + if (_roi.x >= image.cols - 1) _roi.x = image.cols - 2; + if (_roi.y >= image.rows - 1) _roi.y = image.rows - 2; + + float cx = _roi.x + _roi.width / 2.0f;//涓績鐐 + float cy = _roi.y + _roi.height / 2.0f; + + + float peak_value; + cv::Point2f res = detect(_tmpl, getFeatures(image, 0, 1.0f), peak_value);//鑾峰彇response鐨勪綅缃 + + //澶勭悊灏哄害鍙樺寲鐨勬儏鍐 + if (scale_step != 1) { + // Test at a smaller _scale + float new_peak_value; + cv::Point2f new_res = detect(_tmpl, getFeatures(image, 0, 1.0f / scale_step), new_peak_value); + //update roi and other parameter 鏇存柊roi鍖哄煙鍙婂叾鍙傛暟 + if (scale_weight * new_peak_value > peak_value) { + res = new_res; + peak_value = new_peak_value; + _scale /= scale_step; + _roi.width /= scale_step; + _roi.height /= scale_step; + } + + // Test at a bigger _scale + new_res = detect(_tmpl, getFeatures(image, 0, scale_step), new_peak_value); + + if (scale_weight * new_peak_value > peak_value) { + res = new_res; + peak_value = new_peak_value; + _scale *= scale_step; + _roi.width *= scale_step; + _roi.height *= scale_step; + } + } + + // Adjust by cell size and _scale ????????????cell size???????????????????? + _roi.x = cx - _roi.width / 2.0f + ((float) res.x * cell_size * _scale); + _roi.y = cy - _roi.height / 2.0f + ((float) res.y * cell_size * _scale); + //瓒呭嚭杈圭晫鐨勬儏鍐 + if (_roi.x >= image.cols - 1) _roi.x = image.cols - 1; + if (_roi.y >= image.rows - 1) _roi.y = image.rows - 1; + if (_roi.x + _roi.width <= 0) _roi.x = -_roi.width + 2; + if (_roi.y + _roi.height <= 0) _roi.y = -_roi.height + 2; + + assert(_roi.width >= 0 && _roi.height >= 0); + + //涓婇潰寰楀埌roi鏂扮殑浣嶇疆涔嬪悗锛屽啀閲嶆柊璁粌寰楀埌鐩稿叧婊ゆ尝鍣 + cv::Mat x = getFeatures(image, 0);//鎻愬彇鏂扮殑roi鐗瑰緛 + train(x, interp_factor);//璁粌寰楀埌鏂扮殑婊ゆ尝鍣 + + return _roi; +} + + +// Detect object in the current frame. +cv::Point2f KCFTracker::detect(cv::Mat z, cv::Mat x, float &peak_value) +{ + using namespace FFTTools; + + cv::Mat k = gaussianCorrelation(x, z);//浣滅浉鍏宠繍绠 + cv::Mat res = (real(fftd(complexMultiplication(_alphaf, fftd(k)), true)));//鑾峰緱response + + //minMaxLoc only accepts doubles for the peak, and integer points for the coordinates + cv::Point2i pi;//瀛樻斁鍝嶅簲response鏈澶у兼墍鍦ㄧ殑浣嶇疆 + double pv;//pv瀛樻斁鍝嶅簲response鏈澶у + //鎵惧埌杈撳叆鏁扮粍鐨勬渶澶/鏈灏忓硷紝姝ゅ瀵绘壘鏈澶у硷紝pv瀛樻斁鏈澶у硷紝pi瀛樻斁鏈澶у兼墍鍦ㄧ殑浣嶇疆 + cv::minMaxLoc(res, NULL, &pv, NULL, &pi); + peak_value = (float) pv; + + //subpixel peak estimation, coordinates will be non-integer + cv::Point2f p((float)pi.x, (float)pi.y); + // + //target location is at the maximum response. we must take into + //account the fact that, if the target doesn't move, the peak + //will appear at the top - left corner, not at the center(this is + //discussed in the paper).the responses wrap around cyclically. + if (pi.x > 0 && pi.x < res.cols-1) { + p.x += subPixelPeak(res.at(pi.y, pi.x-1), peak_value, res.at(pi.y, pi.x+1)); + } + + if (pi.y > 0 && pi.y < res.rows-1) { + p.y += subPixelPeak(res.at(pi.y-1, pi.x), peak_value, res.at(pi.y+1, pi.x)); + } + + p.x -= (res.cols) / 2; + p.y -= (res.rows) / 2; + + return p; //responses鏈澶у搷搴斿搴旂殑鐩爣浣嶇疆 +} + +// train tracker with a single image +void KCFTracker::train(cv::Mat x, float train_interp_factor) +{ + using namespace FFTTools; + + cv::Mat k = gaussianCorrelation(x, x); + cv::Mat alphaf = complexDivision(_prob, (fftd(k) + lambda)); + + _tmpl = (1 - train_interp_factor) * _tmpl + (train_interp_factor) * x; + _alphaf = (1 - train_interp_factor) * _alphaf + (train_interp_factor) * alphaf; + + + /*cv::Mat kf = fftd(gaussianCorrelation(x, x)); + cv::Mat num = complexMultiplication(kf, _prob); + cv::Mat den = complexMultiplication(kf, kf + lambda); + + _tmpl = (1 - train_interp_factor) * _tmpl + (train_interp_factor) * x; + _num = (1 - train_interp_factor) * _num + (train_interp_factor) * num; + _den = (1 - train_interp_factor) * _den + (train_interp_factor) * den; + + _alphaf = complexDivision(_num, _den);*/ + +} + +// Evaluates a Gaussian kernel with bandwidth SIGMA for all relative shifts between input images X and Y, +// which must both be MxN. They must also be periodic (ie., pre-processed with a cosine window). +cv::Mat KCFTracker::gaussianCorrelation(cv::Mat x1, cv::Mat x2) +{ + using namespace FFTTools; + cv::Mat c = cv::Mat( cv::Size(size_patch[1], size_patch[0]), CV_32F, cv::Scalar(0) ); + // HOG features + if (_hogfeatures) { + cv::Mat caux; + cv::Mat x1aux; + cv::Mat x2aux; + for (int i = 0; i < size_patch[2]; i++) { + x1aux = x1.row(i); // Procedure do deal with cv::Mat multichannel bug + x1aux = x1aux.reshape(1, size_patch[0]); + x2aux = x2.row(i).reshape(1, size_patch[0]); + cv::mulSpectrums(fftd(x1aux), fftd(x2aux), caux, 0, true); + caux = fftd(caux, true); + rearrange(caux); + caux.convertTo(caux,CV_32F); + c = c + real(caux); + } + } + // Gray features + else { + cv::mulSpectrums(fftd(x1), fftd(x2), c, 0, true); + c = fftd(c, true); + rearrange(c); + c = real(c); + } + cv::Mat d; + cv::max(( (cv::sum(x1.mul(x1))[0] + cv::sum(x2.mul(x2))[0])- 2. * c) / (size_patch[0]*size_patch[1]*size_patch[2]) , 0, d); + + cv::Mat k; + cv::exp((-d / (sigma * sigma)), k); + return k; +} + +// Create Gaussian Peak. Function called only in the first frame. +cv::Mat KCFTracker::createGaussianPeak(int sizey, int sizex) +{ + cv::Mat_ res(sizey, sizex); + + int syh = (sizey) / 2; + int sxh = (sizex) / 2; + + float output_sigma = std::sqrt((float) sizex * sizey) / padding * output_sigma_factor; + float mult = -0.5 / (output_sigma * output_sigma); + + for (int i = 0; i < sizey; i++) + for (int j = 0; j < sizex; j++) + { + int ih = i - syh; + int jh = j - sxh; + res(i, j) = std::exp(mult * (float) (ih * ih + jh * jh)); + } + return FFTTools::fftd(res); +} + +// Obtain sub-window from image, with replication-padding and extract features +cv::Mat KCFTracker::getFeatures(const cv::Mat & image, bool inithann, float scale_adjust) +{ + cv::Rect extracted_roi; + + float cx = _roi.x + _roi.width / 2; + float cy = _roi.y + _roi.height / 2; + + if (inithann) {//姹夊畞绐?????? + int padded_w = _roi.width * padding; + int padded_h = _roi.height * padding; + + if (template_size > 1) { // Fit largest dimension to the given template size + if (padded_w >= padded_h) //fit to width + _scale = padded_w / (float) template_size; + else + _scale = padded_h / (float) template_size; + + _tmpl_sz.width = padded_w / _scale; + _tmpl_sz.height = padded_h / _scale; + } + else { //No template size given, use ROI size + _tmpl_sz.width = padded_w; + _tmpl_sz.height = padded_h; + _scale = 1; + // original code from paper: + /*if (sqrt(padded_w * padded_h) >= 100) { //Normal size + _tmpl_sz.width = padded_w; + _tmpl_sz.height = padded_h; + _scale = 1; + } + else { //ROI is too big, track at half size + _tmpl_sz.width = padded_w / 2; + _tmpl_sz.height = padded_h / 2; + _scale = 2; + }*/ + } + + if (_hogfeatures) { + // Round to cell size and also make it even + _tmpl_sz.width = ( ( (int)(_tmpl_sz.width / (2 * cell_size)) ) * 2 * cell_size ) + cell_size*2; + _tmpl_sz.height = ( ( (int)(_tmpl_sz.height / (2 * cell_size)) ) * 2 * cell_size ) + cell_size*2; + } + else { //Make number of pixels even (helps with some logic involving half-dimensions) + _tmpl_sz.width = (_tmpl_sz.width / 2) * 2; + _tmpl_sz.height = (_tmpl_sz.height / 2) * 2; + } + } + + extracted_roi.width = scale_adjust * _scale * _tmpl_sz.width; + extracted_roi.height = scale_adjust * _scale * _tmpl_sz.height; + + // center roi with new size + extracted_roi.x = cx - extracted_roi.width / 2; + extracted_roi.y = cy - extracted_roi.height / 2; + + cv::Mat FeaturesMap; + //obtain a subwindow for detection at the position from last + // frame, and convert to Fourier domain(its size is unchanged) + // 鍦ㄦ湰甯т腑鑾峰彇鍓嶄竴甯х洰鏍囦綅缃殑瀛愮獥鍙 + cv::Mat z = RectTools::subwindow(image, extracted_roi, cv::BORDER_REPLICATE); + //鐒跺悗瑕佸z鎻愬彇鐗瑰緛锛岀劧鍚庡啀鍒伴鍩熶笂涓庣浉鍏虫护娉㈠櫒浣滅浉鍏筹紝寰楀埌response涔嬪悗浜х敓鏂扮殑鐩爣浣嶇疆 + ////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////// + if (z.cols != _tmpl_sz.width || z.rows != _tmpl_sz.height) { + cv::resize(z, z, _tmpl_sz); + } + + // HOG features + if (_hogfeatures) { + IplImage z_ipl = z; + CvLSVMFeatureMapCaskade *map; + getFeatureMaps(&z_ipl, cell_size, &map); + normalizeAndTruncate(map,0.2f); + PCAFeatureMaps(map); + size_patch[0] = map->sizeY; + size_patch[1] = map->sizeX; + size_patch[2] = map->numFeatures; + + FeaturesMap = cv::Mat(cv::Size(map->numFeatures,map->sizeX*map->sizeY), CV_32F, map->map); // Procedure do deal with cv::Mat multichannel bug + FeaturesMap = FeaturesMap.t(); + freeFeatureMapObject(&map); + + // Lab features //褰搇ab = false鏃讹紝鐢ㄤ笉鍒 + if (_labfeatures) { + cv::Mat imgLab; + cvtColor(z, imgLab, CV_BGR2Lab); + unsigned char *input = (unsigned char*)(imgLab.data); + + // Sparse output vector + cv::Mat outputLab = cv::Mat(_labCentroids.rows, size_patch[0]*size_patch[1], CV_32F, float(0)); + + int cntCell = 0; + // Iterate through each cell + for (int cY = cell_size; cY < z.rows-cell_size; cY+=cell_size){ + for (int cX = cell_size; cX < z.cols-cell_size; cX+=cell_size){ + // Iterate through each pixel of cell (cX,cY) + for(int y = cY; y < cY+cell_size; ++y){ + for(int x = cX; x < cX+cell_size; ++x){ + // Lab components for each pixel + float l = (float)input[(z.cols * y + x) * 3]; + float a = (float)input[(z.cols * y + x) * 3 + 1]; + float b = (float)input[(z.cols * y + x) * 3 + 2]; + + // Iterate trough each centroid + float minDist = FLT_MAX; + int minIdx = 0; + float *inputCentroid = (float*)(_labCentroids.data); + for(int k = 0; k < _labCentroids.rows; ++k){ + float dist = ( (l - inputCentroid[3*k]) * (l - inputCentroid[3*k]) ) + + ( (a - inputCentroid[3*k+1]) * (a - inputCentroid[3*k+1]) ) + + ( (b - inputCentroid[3*k+2]) * (b - inputCentroid[3*k+2]) ); + if(dist < minDist){ + minDist = dist; + minIdx = k; + } + } + // Store result at output + outputLab.at(minIdx, cntCell) += 1.0 / cell_sizeQ; + //((float*) outputLab.data)[minIdx * (size_patch[0]*size_patch[1]) + cntCell] += 1.0 / cell_sizeQ; + } + } + cntCell++; + } + } + // Update size_patch[2] and add features to FeaturesMap + size_patch[2] += _labCentroids.rows; + FeaturesMap.push_back(outputLab); + } + } + else { //raw pixel + FeaturesMap = RectTools::getGrayImage(z); + FeaturesMap -= (float) 0.5; // In Paper; + size_patch[0] = z.rows; + size_patch[1] = z.cols; + size_patch[2] = 1; + } + + if (inithann) {//鍙湁鍦ㄧ涓甯х殑鏃跺欐墠浼氱敤鍒帮紝鍒涘缓/鍒濆鍖 姹夊畞绐 + createHanningMats(); + } + FeaturesMap = hann.mul(FeaturesMap);//鐗瑰緛涓庢眽瀹佺獥鐩镐箻锛岃捣骞虫粦浣滅敤 + return FeaturesMap; //鏈鍚庤繑鍥炵殑鏄笌姹夊畞绐楃浉涔樺悗鐨勭粨鏋滐紝锛岋紝鍚庣画杩樿杩涜涓庣浉鍏虫护娉㈠櫒浣滅浉鍏 + ////////////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////////// +} + +// Initialize Hanning window. Function called only in the first frame. +void KCFTracker::createHanningMats() +{ + cv::Mat hann1t = cv::Mat(cv::Size(size_patch[1],1), CV_32F, cv::Scalar(0)); + cv::Mat hann2t = cv::Mat(cv::Size(1,size_patch[0]), CV_32F, cv::Scalar(0)); + + for (int i = 0; i < hann1t.cols; i++) + hann1t.at (0, i) = 0.5 * (1 - std::cos(2 * 3.14159265358979323846 * i / (hann1t.cols - 1))); + for (int i = 0; i < hann2t.rows; i++) + hann2t.at (i, 0) = 0.5 * (1 - std::cos(2 * 3.14159265358979323846 * i / (hann2t.rows - 1))); + + cv::Mat hann2d = hann2t * hann1t; + // HOG features + if (_hogfeatures) { + cv::Mat hann1d = hann2d.reshape(1,1); // Procedure do deal with cv::Mat multichannel bug + + hann = cv::Mat(cv::Size(size_patch[0]*size_patch[1], size_patch[2]), CV_32F, cv::Scalar(0)); + for (int i = 0; i < size_patch[2]; i++) { + for (int j = 0; j(i,j) = hann1d.at(0,j); + } + } + } + // Gray features + else { + hann = hann2d; + } +} + +// Calculate sub-pixel peak for one dimension +float KCFTracker::subPixelPeak(float left, float center, float right) +{ + float divisor = 2 * center - right - left; + //divisor = 0.28 0.35 0.27 0.37 0.30 0.33 0.24 0.38 + //printf("%f \n", divisor); + if (divisor == 0) + return 0; + + return 0.5 * (right - left) / divisor; +} diff --git a/Src/CH91PayloadSoftware/kcftracker.hpp b/Src/CH91PayloadSoftware/kcftracker.hpp new file mode 100644 index 0000000..e34a687 --- /dev/null +++ b/Src/CH91PayloadSoftware/kcftracker.hpp @@ -0,0 +1,154 @@ +锘/* + +Tracker based on Kernelized Correlation Filter (KCF) [1] and Circulant Structure with Kernels (CSK) [2]. +CSK is implemented by using raw gray level features, since it is a single-channel filter. +KCF is implemented by using HOG features (the default), since it extends CSK to multiple channels. + +[1] J. F. Henriques, R. Caseiro, P. Martins, J. Batista, +"High-Speed Tracking with Kernelized Correlation Filters", TPAMI 2015. + +[2] J. F. Henriques, R. Caseiro, P. Martins, J. Batista, +"Exploiting the Circulant Structure of Tracking-by-detection with Kernels", ECCV 2012. + +Authors: Joao Faro, Christian Bailer, Joao F. Henriques +Contacts: joaopfaro@gmail.com, Christian.Bailer@dfki.de, henriques@isr.uc.pt +Institute of Systems and Robotics - University of Coimbra / Department Augmented Vision DFKI + + +Constructor parameters, all boolean: + hog: use HOG features (default), otherwise use raw pixels + fixed_window: fix window size (default), otherwise use ROI size (slower but more accurate) + multiscale: use multi-scale tracking (default; cannot be used with fixed_window = true) + +Default values are set for all properties of the tracker depending on the above choices. +Their values can be customized further before calling init(): + interp_factor: linear interpolation factor for adaptation + sigma: gaussian kernel bandwidth + lambda: regularization + cell_size: HOG cell size + padding: horizontal area surrounding the target, relative to its size + output_sigma_factor: bandwidth of gaussian target + template_size: template size in pixels, 0 to use ROI size + scale_step: scale step for multi-scale estimation, 1 to disable it + scale_weight: to downweight detection scores of other scales for added stability + +For speed, the value (template_size/cell_size) should be a power of 2 or a product of small prime numbers. + +Inputs to init(): + image is the initial frame. + roi is a cv::Rect with the target positions in the initial frame + +Inputs to update(): + image is the current frame. + +Outputs of update(): + cv::Rect with target positions for the current frame + + +By downloading, copying, installing or using the software you agree to this license. +If you do not agree to this license, do not download, install, +copy or use the software. + + + License Agreement + For Open Source Computer Vision Library + (3-clause BSD License) + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the names of the copyright holders nor the names of the contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as is" and +any express or implied warranties, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose are disclaimed. +In no event shall copyright holders or contributors be liable for any direct, +indirect, incidental, special, exemplary, or consequential damages +(including, but not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) however caused +and on any theory of liability, whether in contract, strict liability, +or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. + */ + +#pragma once + + +#include "tracker.h" +#ifndef _OPENCV_KCFTRACKER_HPP_ +#define _OPENCV_KCFTRACKER_HPP_ + +#endif + +class KCFTracker : public Tracker +{ +public: + // Constructor + KCFTracker(bool hog = true, bool fixed_window = true, bool multiscale = true, bool lab = true); + + // Initialize tracker + virtual void init(const cv::Rect &roi, cv::Mat image); + + // Update position based on the new frame + virtual cv::Rect update(cv::Mat image); + + float interp_factor; // linear interpolation factor for adaptation + float sigma; // gaussian kernel bandwidth + float lambda; // regularization + int cell_size; // HOG cell size + int cell_sizeQ; // cell size^2, to avoid repeated operations + float padding; // extra area surrounding the target + float output_sigma_factor; // bandwidth of gaussian target + int template_size; // template size + float scale_step; // scale step for multi-scale estimation + float scale_weight; // to downweight detection scores of other scales for added stability + +protected: + // Detect object in the current frame. + cv::Point2f detect(cv::Mat z, cv::Mat x, float &peak_value); + + // train tracker with a single image + void train(cv::Mat x, float train_interp_factor); + + // Evaluates a Gaussian kernel with bandwidth SIGMA for all relative shifts between input images X and Y, which must both be MxN. They must also be periodic (ie., pre-processed with a cosine window). + cv::Mat gaussianCorrelation(cv::Mat x1, cv::Mat x2); + + // Create Gaussian Peak. Function called only in the first frame. + cv::Mat createGaussianPeak(int sizey, int sizex); + + // Obtain sub-window from image, with replication-padding and extract features + cv::Mat getFeatures(const cv::Mat & image, bool inithann, float scale_adjust = 1.0f); + + // Initialize Hanning window. Function called only in the first frame. + void createHanningMats(); + + // Calculate sub-pixel peak for one dimension + float subPixelPeak(float left, float center, float right); + + cv::Mat _alphaf; + cv::Mat _prob; //fft2(y) + cv::Mat _tmpl; //鎻愬彇鐨勭壒寰 + cv::Mat _num; + cv::Mat _den; + cv::Mat _labCentroids; + +private: + int size_patch[3]; + cv::Mat hann; //姹夊畞绐 + cv::Size _tmpl_sz; + float _scale; + int _gaussian_size; + bool _hogfeatures; + bool _labfeatures; +}; + + diff --git a/Src/CH91PayloadSoftware/labdata.hpp b/Src/CH91PayloadSoftware/labdata.hpp new file mode 100644 index 0000000..26e7a65 --- /dev/null +++ b/Src/CH91PayloadSoftware/labdata.hpp @@ -0,0 +1,17 @@ +const int nClusters = 15; +float data[nClusters][3] = { +{161.317504, 127.223401, 128.609333}, +{142.922425, 128.666965, 127.532319}, +{67.879757, 127.721830, 135.903311}, +{92.705062, 129.965717, 137.399500}, +{120.172257, 128.279647, 127.036493}, +{195.470568, 127.857070, 129.345415}, +{41.257102, 130.059468, 132.675336}, +{12.014861, 129.480555, 127.064714}, +{226.567086, 127.567831, 136.345727}, +{154.664210, 131.676606, 156.481669}, +{121.180447, 137.020793, 153.433743}, +{87.042204, 137.211742, 98.614874}, +{113.809537, 106.577104, 157.818094}, +{81.083293, 170.051905, 148.904079}, +{45.015485, 138.543124, 102.402528}}; \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/memdc.h b/Src/CH91PayloadSoftware/memdc.h new file mode 100644 index 0000000..0b181b9 --- /dev/null +++ b/Src/CH91PayloadSoftware/memdc.h @@ -0,0 +1,119 @@ +#ifndef _MEMDC_H_ +#define _MEMDC_H_ +////////////////////////////////////////////////// +// CMemDC - memory DC +// +// Author: Keith Rule +// Email: keithr@europa.com +// Copyright 1996-2002, Keith Rule +// +// You may freely use or modify this code provided this +// Copyright is included in all derived versions. +// +// History - 10/3/97 Fixed scrolling bug. +// Added print support. - KR +// +// 11/3/99 Fixed most common complaint. Added +// background color fill. - KR +// +// 11/3/99 Added support for mapping modes other than +// MM_TEXT as suggested by Lee Sang Hun. - KR +// +// 02/11/02 Added support for CScrollView as supplied +// by Gary Kirkham. - KR +// +// This class implements a memory Device Context which allows +// flicker free drawing. +// +// +// I made a few changes to support transparency effect +// +// Line 44 : Added bBg parameter. +// Line 83 ~ 87 : If bBg is TRUE, copy background. +// +class CMemDC_Slider : public CDC { +private: + CBitmap m_bitmap; // Offscreen bitmap + CBitmap* m_oldBitmap; // bitmap originally found in CMemDC_Slider + CDC* m_pDC; // Saves CDC passed in constructor + CRect m_rect; // Rectangle of drawing area. + BOOL m_bMemDC; // TRUE if CDC really is a Memory DC. +public: + + CMemDC_Slider(CDC* pDC, const CRect* pRect = NULL, BOOL bBg = FALSE) : CDC() + { + ASSERT(pDC != NULL); + + // Some initialization + m_pDC = pDC; + m_oldBitmap = NULL; + m_bMemDC = !pDC->IsPrinting(); + + // Get the rectangle to draw + if (pRect == NULL) { + pDC->GetClipBox(&m_rect); + } else { + m_rect = *pRect; + } + + if (m_bMemDC) { + // Create a Memory DC + CreateCompatibleDC(pDC); + pDC->LPtoDP(&m_rect); + + m_bitmap.CreateCompatibleBitmap(pDC, m_rect.Width(), m_rect.Height()); + m_oldBitmap = SelectObject(&m_bitmap); + + SetMapMode(pDC->GetMapMode()); + + SetWindowExt(pDC->GetWindowExt()); + SetViewportExt(pDC->GetViewportExt()); + + pDC->DPtoLP(&m_rect); + SetWindowOrg(m_rect.left, m_rect.top); + } else { + // Make a copy of the relevent parts of the current DC for printing + m_bPrinting = pDC->m_bPrinting; + m_hDC = pDC->m_hDC; + m_hAttribDC = pDC->m_hAttribDC; + } + + // Fill background + if( bBg ) + BitBlt(m_rect.left, m_rect.top, m_rect.Width(), m_rect.Height(), + m_pDC, m_rect.left, m_rect.top, SRCCOPY); + else + FillSolidRect(m_rect, pDC->GetBkColor()); + } + + ~CMemDC_Slider() + { + if (m_bMemDC) { + // Copy the offscreen bitmap onto the screen. + m_pDC->BitBlt(m_rect.left, m_rect.top, m_rect.Width(), m_rect.Height(), + this, m_rect.left, m_rect.top, SRCCOPY); + + //Swap back the original bitmap. + SelectObject(m_oldBitmap); + } else { + // All we need to do is replace the DC with an illegal value, + // this keeps us from accidently deleting the handles associated with + // the CDC that was passed to the constructor. + m_hDC = m_hAttribDC = NULL; + } + } + + // Allow usage as a pointer + CMemDC_Slider* operator->() + { + return this; + } + + // Allow usage as a pointer + operator CMemDC_Slider*() + { + return this; + } +}; + +#endif \ No newline at end of file diff --git a/Src/CH91PayloadSoftware/pthreadVC2.lib b/Src/CH91PayloadSoftware/pthreadVC2.lib new file mode 100644 index 0000000..c20ee20 Binary files /dev/null and b/Src/CH91PayloadSoftware/pthreadVC2.lib differ diff --git a/Src/CH91PayloadSoftware/recttools.hpp b/Src/CH91PayloadSoftware/recttools.hpp new file mode 100644 index 0000000..780ad32 --- /dev/null +++ b/Src/CH91PayloadSoftware/recttools.hpp @@ -0,0 +1,140 @@ +/* +Author: Christian Bailer +Contact address: Christian.Bailer@dfki.de +Department Augmented Vision DFKI + + License Agreement + For Open Source Computer Vision Library + (3-clause BSD License) + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the names of the copyright holders nor the names of the contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as is" and +any express or implied warranties, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose are disclaimed. +In no event shall copyright holders or contributors be liable for any direct, +indirect, incidental, special, exemplary, or consequential damages +(including, but not limited to, procurement of substitute goods or services; +loss of use, data, or profits; or business interruption) however caused +and on any theory of liability, whether in contract, strict liability, +or tort (including negligence or otherwise) arising in any way out of +the use of this software, even if advised of the possibility of such damage. +*/ + +#pragma once + +//#include +#include + +#ifndef _OPENCV_RECTTOOLS_HPP_ +#define _OPENCV_RECTTOOLS_HPP_ +#endif + +namespace RectTools +{ + +template +inline cv::Vec center(const cv::Rect_ &rect) +{ + return cv::Vec (rect.x + rect.width / (t) 2, rect.y + rect.height / (t) 2); +} + +template +inline t x2(const cv::Rect_ &rect) +{ + return rect.x + rect.width; +} + +template +inline t y2(const cv::Rect_ &rect) +{ + return rect.y + rect.height; +} + +template +inline void resize(cv::Rect_ &rect, float scalex, float scaley = 0) +{ + if (!scaley)scaley = scalex; + rect.x -= rect.width * (scalex - 1.f) / 2.f; + rect.width *= scalex; + + rect.y -= rect.height * (scaley - 1.f) / 2.f; + rect.height *= scaley; + +} + +template +inline void limit(cv::Rect_ &rect, cv::Rect_ limit) +{ + if (rect.x + rect.width > limit.x + limit.width)rect.width = (limit.x + limit.width - rect.x); + if (rect.y + rect.height > limit.y + limit.height)rect.height = (limit.y + limit.height - rect.y); + if (rect.x < limit.x) + { + rect.width -= (limit.x - rect.x); + rect.x = limit.x; + } + if (rect.y < limit.y) + { + rect.height -= (limit.y - rect.y); + rect.y = limit.y; + } + if(rect.width<0)rect.width=0; + if(rect.height<0)rect.height=0; +} + +template +inline void limit(cv::Rect_ &rect, t width, t height, t x = 0, t y = 0) +{ + limit(rect, cv::Rect_ (x, y, width, height)); +} + +template +inline cv::Rect getBorder(const cv::Rect_ &original, cv::Rect_ & limited) +{ + cv::Rect_ res; + res.x = limited.x - original.x; + res.y = limited.y - original.y; + res.width = x2(original) - x2(limited); + res.height = y2(original) - y2(limited); + assert(res.x >= 0 && res.y >= 0 && res.width >= 0 && res.height >= 0); + return res; +} + +inline cv::Mat subwindow(const cv::Mat &in, const cv::Rect & window, int borderType = cv::BORDER_CONSTANT) +{ + cv::Rect cutWindow = window; + RectTools::limit(cutWindow, in.cols, in.rows); + if (cutWindow.height <= 0 || cutWindow.width <= 0)assert(0); //return cv::Mat(window.height,window.width,in.type(),0) ; + cv::Rect border = RectTools::getBorder(window, cutWindow); + cv::Mat res = in(cutWindow); + + if (border != cv::Rect(0, 0, 0, 0)) + { + cv::copyMakeBorder(res, res, border.y, border.height, border.x, border.width, borderType); + } + return res; +} + +inline cv::Mat getGrayImage(cv::Mat img) +{ + cv::cvtColor(img, img, CV_BGR2GRAY); + img.convertTo(img, CV_32F, 1 / 255.f); + return img; +} + +} + + + diff --git a/Src/CH91PayloadSoftware/res/BackGround.jpg b/Src/CH91PayloadSoftware/res/BackGround.jpg new file mode 100644 index 0000000..f52d0d6 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/BackGround.jpg differ diff --git a/Src/CH91PayloadSoftware/res/BackGround_DlgKZ.bmp b/Src/CH91PayloadSoftware/res/BackGround_DlgKZ.bmp new file mode 100644 index 0000000..e9d47d8 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/BackGround_DlgKZ.bmp differ diff --git a/Src/CH91PayloadSoftware/res/BackGround_DlgMain.bmp b/Src/CH91PayloadSoftware/res/BackGround_DlgMain.bmp new file mode 100644 index 0000000..4c18d6e Binary files /dev/null and b/Src/CH91PayloadSoftware/res/BackGround_DlgMain.bmp differ diff --git a/Src/CH91PayloadSoftware/res/BackGround_DlgReplay2.bmp b/Src/CH91PayloadSoftware/res/BackGround_DlgReplay2.bmp new file mode 100644 index 0000000..3256f95 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/BackGround_DlgReplay2.bmp differ diff --git a/Src/CH91PayloadSoftware/res/Background_Replay.bmp b/Src/CH91PayloadSoftware/res/Background_Replay.bmp new file mode 100644 index 0000000..03f6a31 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/Background_Replay.bmp differ diff --git a/Src/CH91PayloadSoftware/res/CH91PayloadSoftware.rc2 b/Src/CH91PayloadSoftware/res/CH91PayloadSoftware.rc2 new file mode 100644 index 0000000..d9a8089 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/CH91PayloadSoftware.rc2 differ diff --git a/Src/CH91PayloadSoftware/res/FH98PayloadSoftware.ico b/Src/CH91PayloadSoftware/res/FH98PayloadSoftware.ico new file mode 100644 index 0000000..e686b08 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/FH98PayloadSoftware.ico differ diff --git a/Src/CH91PayloadSoftware/res/ReplayDlg.jpg b/Src/CH91PayloadSoftware/res/ReplayDlg.jpg new file mode 100644 index 0000000..344ef2b Binary files /dev/null and b/Src/CH91PayloadSoftware/res/ReplayDlg.jpg differ diff --git a/Src/CH91PayloadSoftware/res/Sky.bmp b/Src/CH91PayloadSoftware/res/Sky.bmp new file mode 100644 index 0000000..7676538 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/Sky.bmp differ diff --git a/Src/CH91PayloadSoftware/res/bitmap4.bmp b/Src/CH91PayloadSoftware/res/bitmap4.bmp new file mode 100644 index 0000000..6e8e840 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/bitmap4.bmp differ diff --git a/Src/CH91PayloadSoftware/res/bitmap5.bmp b/Src/CH91PayloadSoftware/res/bitmap5.bmp new file mode 100644 index 0000000..0581072 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/bitmap5.bmp differ diff --git a/Src/CH91PayloadSoftware/res/icon2.ico b/Src/CH91PayloadSoftware/res/icon2.ico new file mode 100644 index 0000000..f1282c6 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/icon2.ico differ diff --git a/Src/CH91PayloadSoftware/res/icon4.ico b/Src/CH91PayloadSoftware/res/icon4.ico new file mode 100644 index 0000000..f1282c6 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/icon4.ico differ diff --git a/Src/CH91PayloadSoftware/res/image_48px_1068841_easyicon.net.ico b/Src/CH91PayloadSoftware/res/image_48px_1068841_easyicon.net.ico new file mode 100644 index 0000000..a9591d2 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/image_48px_1068841_easyicon.net.ico differ diff --git a/Src/CH91PayloadSoftware/res/mp_channel.bmp b/Src/CH91PayloadSoftware/res/mp_channel.bmp new file mode 100644 index 0000000..80aa940 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/mp_channel.bmp differ diff --git a/Src/CH91PayloadSoftware/res/mp_channel_active.bmp b/Src/CH91PayloadSoftware/res/mp_channel_active.bmp new file mode 100644 index 0000000..4c402f6 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/mp_channel_active.bmp differ diff --git a/Src/CH91PayloadSoftware/res/mp_thumb.bmp b/Src/CH91PayloadSoftware/res/mp_thumb.bmp new file mode 100644 index 0000000..f80dfb2 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/mp_thumb.bmp differ diff --git a/Src/CH91PayloadSoftware/res/mp_thumb_active.bmp b/Src/CH91PayloadSoftware/res/mp_thumb_active.bmp new file mode 100644 index 0000000..c02728a Binary files /dev/null and b/Src/CH91PayloadSoftware/res/mp_thumb_active.bmp differ diff --git a/Src/CH91PayloadSoftware/res/涓籣鍋滄褰曞儚.ico b/Src/CH91PayloadSoftware/res/涓籣鍋滄褰曞儚.ico new file mode 100644 index 0000000..bfbe537 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣鍋滄褰曞儚.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣鍙傛暟璁剧疆.ico b/Src/CH91PayloadSoftware/res/涓籣鍙傛暟璁剧疆.ico new file mode 100644 index 0000000..ee38f1d Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣鍙傛暟璁剧疆.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣鍙樻崲鏄剧ず.ico b/Src/CH91PayloadSoftware/res/涓籣鍙樻崲鏄剧ず.ico new file mode 100644 index 0000000..d6217ce Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣鍙樻崲鏄剧ず.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣鍥惧儚鐩戞帶.ico b/Src/CH91PayloadSoftware/res/涓籣鍥惧儚鐩戞帶.ico new file mode 100644 index 0000000..262cd41 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣鍥惧儚鐩戞帶.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣鍥剧墖娴忚.ico b/Src/CH91PayloadSoftware/res/涓籣鍥剧墖娴忚.ico new file mode 100644 index 0000000..329bc72 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣鍥剧墖娴忚.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣澶嶆帴鏁版嵁.ico b/Src/CH91PayloadSoftware/res/涓籣澶嶆帴鏁版嵁.ico new file mode 100644 index 0000000..15ba2c7 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣澶嶆帴鏁版嵁.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣鎯呮姤澶勭悊.ico b/Src/CH91PayloadSoftware/res/涓籣鎯呮姤澶勭悊.ico new file mode 100644 index 0000000..18c6f58 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣鎯呮姤澶勭悊.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣鎶撳浘.ico b/Src/CH91PayloadSoftware/res/涓籣鎶撳浘.ico new file mode 100644 index 0000000..5266ab4 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣鎶撳浘.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣鏁板紩.ico b/Src/CH91PayloadSoftware/res/涓籣鏁板紩.ico new file mode 100644 index 0000000..df9142a Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣鏁板紩.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣鐩戣渚︽煡.ico b/Src/CH91PayloadSoftware/res/涓籣鐩戣渚︽煡.ico new file mode 100644 index 0000000..695f142 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣鐩戣渚︽煡.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣缁勬挱鍙戦.ico b/Src/CH91PayloadSoftware/res/涓籣缁勬挱鍙戦.ico new file mode 100644 index 0000000..d2f50bf Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣缁勬挱鍙戦.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣缁撴灉棰勮.ico b/Src/CH91PayloadSoftware/res/涓籣缁撴灉棰勮.ico new file mode 100644 index 0000000..7218797 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣缁撴灉棰勮.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣瑙嗛鍥炴斁.ico b/Src/CH91PayloadSoftware/res/涓籣瑙嗛鍥炴斁.ico new file mode 100644 index 0000000..f547d6e Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣瑙嗛鍥炴斁.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣瑙嗛褰曞儚.ico b/Src/CH91PayloadSoftware/res/涓籣瑙嗛褰曞儚.ico new file mode 100644 index 0000000..1f7f236 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣瑙嗛褰曞儚.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣杞借嵎鎺у埗.ico b/Src/CH91PayloadSoftware/res/涓籣杞借嵎鎺у埗.ico new file mode 100644 index 0000000..c314b51 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣杞借嵎鎺у埗.ico differ diff --git a/Src/CH91PayloadSoftware/res/涓籣杞借嵎璇勪环.ico b/Src/CH91PayloadSoftware/res/涓籣杞借嵎璇勪环.ico new file mode 100644 index 0000000..26cfae3 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/涓籣杞借嵎璇勪环.ico differ diff --git a/Src/CH91PayloadSoftware/res/鍋滄.ico b/Src/CH91PayloadSoftware/res/鍋滄.ico new file mode 100644 index 0000000..75117a6 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/鍋滄.ico differ diff --git a/Src/CH91PayloadSoftware/res/蹇繘.ico b/Src/CH91PayloadSoftware/res/蹇繘.ico new file mode 100644 index 0000000..54f2acb Binary files /dev/null and b/Src/CH91PayloadSoftware/res/蹇繘.ico differ diff --git a/Src/CH91PayloadSoftware/res/鎱㈡斁.ico b/Src/CH91PayloadSoftware/res/鎱㈡斁.ico new file mode 100644 index 0000000..456c2c3 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/鎱㈡斁.ico differ diff --git a/Src/CH91PayloadSoftware/res/鎵撳紑鏂囦欢.ico b/Src/CH91PayloadSoftware/res/鎵撳紑鏂囦欢.ico new file mode 100644 index 0000000..804f5f0 Binary files /dev/null and b/Src/CH91PayloadSoftware/res/鎵撳紑鏂囦欢.ico differ diff --git a/Src/CH91PayloadSoftware/res/鎾斁.ico b/Src/CH91PayloadSoftware/res/鎾斁.ico new file mode 100644 index 0000000..b52219e Binary files /dev/null and b/Src/CH91PayloadSoftware/res/鎾斁.ico differ diff --git a/Src/CH91PayloadSoftware/res/鏆傚仠.ico b/Src/CH91PayloadSoftware/res/鏆傚仠.ico new file mode 100644 index 0000000..ea2513c Binary files /dev/null and b/Src/CH91PayloadSoftware/res/鏆傚仠.ico differ diff --git a/Src/CH91PayloadSoftware/resource.h b/Src/CH91PayloadSoftware/resource.h new file mode 100644 index 0000000..99cf08b Binary files /dev/null and b/Src/CH91PayloadSoftware/resource.h differ diff --git a/Src/CH91PayloadSoftware/stdafx.cpp b/Src/CH91PayloadSoftware/stdafx.cpp new file mode 100644 index 0000000..02ec43c --- /dev/null +++ b/Src/CH91PayloadSoftware/stdafx.cpp @@ -0,0 +1,8 @@ + +// stdafx.cpp : 只包括标准包含文件的源文件 +// CH91PayloadSoftware.pch 将作为预编译头 +// stdafx.obj 将包含预编译类型信息 + +#include "stdafx.h" + + diff --git a/Src/CH91PayloadSoftware/stdafx.h b/Src/CH91PayloadSoftware/stdafx.h new file mode 100644 index 0000000..0f549b4 --- /dev/null +++ b/Src/CH91PayloadSoftware/stdafx.h @@ -0,0 +1,57 @@ + +// stdafx.h : 标准系统包含文件的包含文件, +// 或是经常使用但不常更改的 +// 特定于项目的包含文件 + +#pragma once + +#ifndef _SECURE_ATL +#define _SECURE_ATL 1 +#endif + +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // 从 Windows 头中排除极少使用的资料 +#endif + +#include "targetver.h" +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 某些 CString 构造函数将是显式的 + +// 关闭 MFC 对某些常见但经常可放心忽略的警告消息的隐藏 +#define _AFX_ALL_WARNINGS + +#include // MFC 核心组件和标准组件 +#include // MFC 扩展 + + +#include // MFC 自动化类 + + + +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC 对 Internet Explorer 4 公共控件的支持 +#endif +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC 对 Windows 公共控件的支持 +#endif // _AFX_NO_AFXCMN_SUPPORT + +#include // 功能区和控件条的 MFC 支持 +#include + + + + + + + + +#ifdef _UNICODE +#if defined _M_IX86 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") +#elif defined _M_X64 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") +#else +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") +#endif +#endif + + diff --git a/Src/CH91PayloadSoftware/targetver.h b/Src/CH91PayloadSoftware/targetver.h new file mode 100644 index 0000000..7a7d2c8 --- /dev/null +++ b/Src/CH91PayloadSoftware/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。 + +// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将 +// WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。 + +#include diff --git a/Src/CH91PayloadSoftware/tracker.h b/Src/CH91PayloadSoftware/tracker.h new file mode 100644 index 0000000..41b5ea3 --- /dev/null +++ b/Src/CH91PayloadSoftware/tracker.h @@ -0,0 +1,39 @@ +/* + * File: BasicTracker.h + * Author: Joao F. Henriques, Joao Faro, Christian Bailer + * Contact address: henriques@isr.uc.pt, joaopfaro@gmail.com, Christian.Bailer@dfki.de + * Instute of Systems and Robotics- University of COimbra / Department Augmented Vision DFKI + * + * This source code is provided for for research purposes only. For a commercial license or a different use case please contact us. + * You are not allowed to publish the unmodified sourcecode on your own e.g. on your webpage. Please refer to the official download page instead. + * If you want to publish a modified/extended version e.g. because you wrote a publication with a modified version of the sourcecode you need our + * permission (Please contact us for the permission). + * + * We reserve the right to change the license of this sourcecode anytime to BSD, GPL or LGPL. + * By using the sourcecode you agree to possible restrictions and requirements of these three license models so that the license can be changed + * anytime without you knowledge. + */ + + + +#pragma once + +#include +#include + +class Tracker +{ +public: + Tracker() {} + virtual ~Tracker() { } + + virtual void init(const cv::Rect &roi, cv::Mat image) = 0; + virtual cv::Rect update( cv::Mat image)=0; + + +protected: + cv::Rect_ _roi; +}; + + + diff --git a/Src/Decoder_H264_ALL/D3D/include/D2D1.h b/Src/Decoder_H264_ALL/D3D/include/D2D1.h new file mode 100644 index 0000000..e8768df --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D2D1.h @@ -0,0 +1,6996 @@ +//--------------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This file is automatically generated. Please do not edit it directly. +// +// File name: D2D1.h +//--------------------------------------------------------------------------- +#pragma once + + +#ifndef _D2D1_H_ +#define _D2D1_H_ + +#ifndef COM_NO_WINDOWS_H +#include +#endif // #ifndef COM_NO_WINDOWS_H +#include +#include +#include +#include +#include +#ifndef D2D_NO_INCLUDE_D3D10 +#include +#endif // #ifndef D2D_NO_INCLUDE_D3D10 + +#ifndef D2D_USE_C_DEFINITIONS + +// +// We use the 'C' definitions if C++ is not defined +// +#ifndef __cplusplus +#define D2D_USE_C_DEFINITIONS +#endif + +#endif // #ifndef D2D_USE_C_DEFINITIONS + +#ifndef D2D1_DECLARE_INTERFACE +#define D2D1_DECLARE_INTERFACE(X) DECLSPEC_UUID(X) DECLSPEC_NOVTABLE +#endif + +// +// Forward declarations here +// + +typedef interface IDWriteTextFormat IDWriteTextFormat; +typedef interface IDWriteTextLayout IDWriteTextLayout; +typedef interface IDWriteRenderingParams IDWriteRenderingParams; +typedef interface IDXGISurface IDXGISurface; +typedef interface IWICBitmap IWICBitmap; +typedef interface IWICBitmapSource IWICBitmapSource; + +typedef struct DWRITE_GLYPH_RUN DWRITE_GLYPH_RUN; + +#ifndef D2D_USE_C_DEFINITIONS + +interface ID2D1Factory; +interface ID2D1RenderTarget; +interface ID2D1BitmapRenderTarget; +interface ID2D1SimplifiedGeometrySink; +interface ID2D1TessellationSink; +interface ID2D1Geometry; +interface ID2D1Brush; + +#else + +typedef interface ID2D1Factory ID2D1Factory; +typedef interface ID2D1RenderTarget ID2D1RenderTarget; +typedef interface ID2D1BitmapRenderTarget ID2D1BitmapRenderTarget; +typedef interface ID2D1SimplifiedGeometrySink ID2D1SimplifiedGeometrySink;; +typedef interface ID2D1TessellationSink ID2D1TessellationSink; +typedef interface ID2D1Geometry ID2D1Geometry; +typedef interface ID2D1Brush ID2D1Brush; + +#endif + +#define D2D1_INVALID_TAG ULONGLONG_MAX +#define D2D1_DEFAULT_FLATTENING_TOLERANCE (0.25f) + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_ALPHA_MODE +// +// Synopsis: +// Qualifies how alpha is to be treated in a bitmap or render target containing +// alpha. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_ALPHA_MODE +{ + + // + // Alpha mode should be determined implicitly. Some target surfaces do not supply + // or imply this information in which case alpha must be specified. + // + D2D1_ALPHA_MODE_UNKNOWN = 0, + + // + // Treat the alpha as premultipled. + // + D2D1_ALPHA_MODE_PREMULTIPLIED = 1, + + // + // Opacity is in the 'A' component only. + // + D2D1_ALPHA_MODE_STRAIGHT = 2, + + // + // Ignore any alpha channel information. + // + D2D1_ALPHA_MODE_IGNORE = 3, + D2D1_ALPHA_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_ALPHA_MODE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_GAMMA +// +// Synopsis: +// This determines what gamma is used for interpolation/blending. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_GAMMA +{ + + // + // Colors are manipulated in 2.2 gamma color space. + // + D2D1_GAMMA_2_2 = 0, + + // + // Colors are manipulated in 1.0 gamma color space. + // + D2D1_GAMMA_1_0 = 1, + D2D1_GAMMA_FORCE_DWORD = 0xffffffff + +} D2D1_GAMMA; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_OPACITY_MASK_CONTENT +// +// Synopsis: +// Specifies what the contents are of an opacity mask. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_OPACITY_MASK_CONTENT +{ + + // + // The mask contains geometries or bitmaps. + // + D2D1_OPACITY_MASK_CONTENT_GRAPHICS = 0, + + // + // The mask contains text rendered using one of the natural text modes. + // + D2D1_OPACITY_MASK_CONTENT_TEXT_NATURAL = 1, + + // + // The mask contains text rendered using one of the GDI compatible text modes. + // + D2D1_OPACITY_MASK_CONTENT_TEXT_GDI_COMPATIBLE = 2, + D2D1_OPACITY_MASK_CONTENT_FORCE_DWORD = 0xffffffff + +} D2D1_OPACITY_MASK_CONTENT; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_EXTEND_MODE +// +// Synopsis: +// Enum which descibes how to sample from a source outside it's base tile. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_EXTEND_MODE +{ + + // + // Extend the edges of the source out by clamping sample points outside the source + // to the edges. + // + D2D1_EXTEND_MODE_CLAMP = 0, + + // + // The base tile is drawn untransformed and the remainder are filled by repeating + // the base tile. + // + D2D1_EXTEND_MODE_WRAP = 1, + + // + // The same as wrap, but alternate tiles are flipped The base tile is drawn + // untransformed. + // + D2D1_EXTEND_MODE_MIRROR = 2, + D2D1_EXTEND_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_EXTEND_MODE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_ANTIALIAS_MODE +// +// Synopsis: +// Enum which descibes the manner in which we render edges of non-text primitives. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_ANTIALIAS_MODE +{ + + // + // The edges of each primitive are antialiased sequentially. + // + D2D1_ANTIALIAS_MODE_PER_PRIMITIVE = 0, + + // + // Each pixel is rendered if its pixel center is contained by the geometry. + // + D2D1_ANTIALIAS_MODE_ALIASED = 1, + D2D1_ANTIALIAS_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_ANTIALIAS_MODE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_TEXT_ANTIALIAS_MODE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_TEXT_ANTIALIAS_MODE +{ + + // + // Render text using the current system setting. + // + D2D1_TEXT_ANTIALIAS_MODE_DEFAULT = 0, + + // + // Render text using ClearType. + // + D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE = 1, + + // + // Render text using gray-scale. + // + D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE = 2, + + // + // Render text aliased. + // + D2D1_TEXT_ANTIALIAS_MODE_ALIASED = 3, + D2D1_TEXT_ANTIALIAS_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_TEXT_ANTIALIAS_MODE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_BITMAP_INTERPOLATION_MODE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_BITMAP_INTERPOLATION_MODE +{ + + // + // Nearest Neighbor filtering. Also known as nearest pixel or nearest point + // sampling. + // + D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0, + + // + // Linear filtering. + // + D2D1_BITMAP_INTERPOLATION_MODE_LINEAR = 1, + D2D1_BITMAP_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_BITMAP_INTERPOLATION_MODE; + + +//+----------------------------------------------------------------------------- +// +// Flag: +// D2D1_DRAW_TEXT_OPTIONS +// +// Synopsis: +// Modifications made to the draw text call that influence how the text is +// rendered. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_DRAW_TEXT_OPTIONS +{ + + // + // Do not snap the baseline of the text vertically. + // + D2D1_DRAW_TEXT_OPTIONS_NO_SNAP = 0x00000001, + + // + // Clip the text to the content bounds. + // + D2D1_DRAW_TEXT_OPTIONS_CLIP = 0x00000002, + D2D1_DRAW_TEXT_OPTIONS_NONE = 0x00000000, + D2D1_DRAW_TEXT_OPTIONS_FORCE_DWORD = 0xffffffff + +} D2D1_DRAW_TEXT_OPTIONS; + +DEFINE_ENUM_FLAG_OPERATORS(D2D1_DRAW_TEXT_OPTIONS); + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_PIXEL_FORMAT +// +//------------------------------------------------------------------------------ +typedef struct D2D1_PIXEL_FORMAT +{ + DXGI_FORMAT format; + D2D1_ALPHA_MODE alphaMode; + +} D2D1_PIXEL_FORMAT; + +typedef D2D_POINT_2U D2D1_POINT_2U; +typedef D2D_POINT_2F D2D1_POINT_2F; +typedef D2D_RECT_F D2D1_RECT_F; +typedef D2D_RECT_U D2D1_RECT_U; +typedef D2D_SIZE_F D2D1_SIZE_F; +typedef D2D_SIZE_U D2D1_SIZE_U; +typedef D2D_COLOR_F D2D1_COLOR_F; +typedef D2D_MATRIX_3X2_F D2D1_MATRIX_3X2_F; +typedef UINT64 D2D1_TAG; + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_BITMAP_PROPERTIES +// +//------------------------------------------------------------------------------ +typedef struct D2D1_BITMAP_PROPERTIES +{ + D2D1_PIXEL_FORMAT pixelFormat; + FLOAT dpiX; + FLOAT dpiY; + +} D2D1_BITMAP_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_GRADIENT_STOP +// +//------------------------------------------------------------------------------ +typedef struct D2D1_GRADIENT_STOP +{ + FLOAT position; + D2D1_COLOR_F color; + +} D2D1_GRADIENT_STOP; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_BRUSH_PROPERTIES +// +//------------------------------------------------------------------------------ +typedef struct D2D1_BRUSH_PROPERTIES +{ + FLOAT opacity; + D2D1_MATRIX_3X2_F transform; + +} D2D1_BRUSH_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_BITMAP_BRUSH_PROPERTIES +// +//------------------------------------------------------------------------------ +typedef struct D2D1_BITMAP_BRUSH_PROPERTIES +{ + D2D1_EXTEND_MODE extendModeX; + D2D1_EXTEND_MODE extendModeY; + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode; + +} D2D1_BITMAP_BRUSH_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES +// +//------------------------------------------------------------------------------ +typedef struct D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES +{ + D2D1_POINT_2F startPoint; + D2D1_POINT_2F endPoint; + +} D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES +// +//------------------------------------------------------------------------------ +typedef struct D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES +{ + D2D1_POINT_2F center; + D2D1_POINT_2F gradientOriginOffset; + FLOAT radiusX; + FLOAT radiusY; + +} D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_ARC_SIZE +// +// Synopsis: +// Differentiates which of the two possible arcs could match the given arc +// parameters. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_ARC_SIZE +{ + D2D1_ARC_SIZE_SMALL = 0, + D2D1_ARC_SIZE_LARGE = 1, + D2D1_ARC_SIZE_FORCE_DWORD = 0xffffffff + +} D2D1_ARC_SIZE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_CAP_STYLE +// +// Synopsis: +// Enum which descibes the drawing of the ends of a line. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_CAP_STYLE +{ + + // + // Flat line cap. + // + D2D1_CAP_STYLE_FLAT = 0, + + // + // Square line cap. + // + D2D1_CAP_STYLE_SQUARE = 1, + + // + // Round line cap. + // + D2D1_CAP_STYLE_ROUND = 2, + + // + // Triangle line cap. + // + D2D1_CAP_STYLE_TRIANGLE = 3, + D2D1_CAP_STYLE_FORCE_DWORD = 0xffffffff + +} D2D1_CAP_STYLE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_DASH_STYLE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_DASH_STYLE +{ + D2D1_DASH_STYLE_SOLID = 0, + D2D1_DASH_STYLE_DASH = 1, + D2D1_DASH_STYLE_DOT = 2, + D2D1_DASH_STYLE_DASH_DOT = 3, + D2D1_DASH_STYLE_DASH_DOT_DOT = 4, + D2D1_DASH_STYLE_CUSTOM = 5, + D2D1_DASH_STYLE_FORCE_DWORD = 0xffffffff + +} D2D1_DASH_STYLE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_LINE_JOIN +// +// Synopsis: +// Enum which descibes the drawing of the corners on the line. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_LINE_JOIN +{ + + // + // Miter join. + // + D2D1_LINE_JOIN_MITER = 0, + + // + // Bevel join. + // + D2D1_LINE_JOIN_BEVEL = 1, + + // + // Round join. + // + D2D1_LINE_JOIN_ROUND = 2, + + // + // Miter/Bevel join. + // + D2D1_LINE_JOIN_MITER_OR_BEVEL = 3, + D2D1_LINE_JOIN_FORCE_DWORD = 0xffffffff + +} D2D1_LINE_JOIN; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_COMBINE_MODE +// +// Synopsis: +// This enumeration describes the type of combine operation to be performed. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_COMBINE_MODE +{ + + // + // Produce a geometry representing the set of points contained in either + // the first or the second geometry. + // + D2D1_COMBINE_MODE_UNION = 0, + + // + // Produce a geometry representing the set of points common to the first + // and the second geometries. + // + D2D1_COMBINE_MODE_INTERSECT = 1, + + // + // Produce a geometry representing the set of points contained in the + // first geometry or the second geometry, but not both. + // + D2D1_COMBINE_MODE_XOR = 2, + + // + // Produce a geometry representing the set of points contained in the + // first geometry but not the second geometry. + // + D2D1_COMBINE_MODE_EXCLUDE = 3, + D2D1_COMBINE_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_COMBINE_MODE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_GEOMETRY_RELATION +// +//------------------------------------------------------------------------------ +typedef enum D2D1_GEOMETRY_RELATION +{ + + // + // The relation between the geometries couldn't be determined. This value is never + // returned by any D2D method. + // + D2D1_GEOMETRY_RELATION_UNKNOWN = 0, + + // + // The two geometries do not intersect at all. + // + D2D1_GEOMETRY_RELATION_DISJOINT = 1, + + // + // The passed in geometry is entirely contained by the object. + // + D2D1_GEOMETRY_RELATION_IS_CONTAINED = 2, + + // + // The object entirely contains the passed in geometry. + // + D2D1_GEOMETRY_RELATION_CONTAINS = 3, + + // + // The two geometries overlap but neither completely contains the other. + // + D2D1_GEOMETRY_RELATION_OVERLAP = 4, + D2D1_GEOMETRY_RELATION_FORCE_DWORD = 0xffffffff + +} D2D1_GEOMETRY_RELATION; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_GEOMETRY_SIMPLIFICATION_OPTION +// +// Synopsis: +// Specifies how simple the output of a simplified geometry sink should be. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_GEOMETRY_SIMPLIFICATION_OPTION +{ + D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES = 0, + D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES = 1, + D2D1_GEOMETRY_SIMPLIFICATION_OPTION_FORCE_DWORD = 0xffffffff + +} D2D1_GEOMETRY_SIMPLIFICATION_OPTION; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_FIGURE_BEGIN +// +// Synopsis: +// Indicates whether the given figure is filled or hollow. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_FIGURE_BEGIN +{ + D2D1_FIGURE_BEGIN_FILLED = 0, + D2D1_FIGURE_BEGIN_HOLLOW = 1, + D2D1_FIGURE_BEGIN_FORCE_DWORD = 0xffffffff + +} D2D1_FIGURE_BEGIN; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_FIGURE_END +// +// Synopsis: +// Indicates whether the figure ir open or closed on its end point. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_FIGURE_END +{ + D2D1_FIGURE_END_OPEN = 0, + D2D1_FIGURE_END_CLOSED = 1, + D2D1_FIGURE_END_FORCE_DWORD = 0xffffffff + +} D2D1_FIGURE_END; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_BEZIER_SEGMENT +// +// Synopsis: +// Describes a cubic bezier in a path. +// +//------------------------------------------------------------------------------ +typedef struct D2D1_BEZIER_SEGMENT +{ + D2D1_POINT_2F point1; + D2D1_POINT_2F point2; + D2D1_POINT_2F point3; + +} D2D1_BEZIER_SEGMENT; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_TRIANGLE +// +// Synopsis: +// Describes a triangle. +// +//------------------------------------------------------------------------------ +typedef struct D2D1_TRIANGLE +{ + D2D1_POINT_2F point1; + D2D1_POINT_2F point2; + D2D1_POINT_2F point3; + +} D2D1_TRIANGLE; + + +//+----------------------------------------------------------------------------- +// +// Flag: +// D2D1_PATH_SEGMENT +// +// Synopsis: +// Indicates whether the given segment should be stroked, or, if the join between +// this segment and the previous one should be smooth. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_PATH_SEGMENT +{ + D2D1_PATH_SEGMENT_NONE = 0x00000000, + D2D1_PATH_SEGMENT_FORCE_UNSTROKED = 0x00000001, + D2D1_PATH_SEGMENT_FORCE_ROUND_LINE_JOIN = 0x00000002, + D2D1_PATH_SEGMENT_FORCE_DWORD = 0xffffffff + +} D2D1_PATH_SEGMENT; + +DEFINE_ENUM_FLAG_OPERATORS(D2D1_PATH_SEGMENT); + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_SWEEP_DIRECTION +// +//------------------------------------------------------------------------------ +typedef enum D2D1_SWEEP_DIRECTION +{ + D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE = 0, + D2D1_SWEEP_DIRECTION_CLOCKWISE = 1, + D2D1_SWEEP_DIRECTION_FORCE_DWORD = 0xffffffff + +} D2D1_SWEEP_DIRECTION; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_FILL_MODE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_FILL_MODE +{ + D2D1_FILL_MODE_ALTERNATE = 0, + D2D1_FILL_MODE_WINDING = 1, + D2D1_FILL_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_FILL_MODE; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_ARC_SEGMENT +// +// Synopsis: +// Describes an arc that is defined as part of a path. +// +//------------------------------------------------------------------------------ +typedef struct D2D1_ARC_SEGMENT +{ + D2D1_POINT_2F point; + D2D1_SIZE_F size; + FLOAT rotationAngle; + D2D1_SWEEP_DIRECTION sweepDirection; + D2D1_ARC_SIZE arcSize; + +} D2D1_ARC_SEGMENT; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_QUADRATIC_BEZIER_SEGMENT +// +//------------------------------------------------------------------------------ +typedef struct D2D1_QUADRATIC_BEZIER_SEGMENT +{ + D2D1_POINT_2F point1; + D2D1_POINT_2F point2; + +} D2D1_QUADRATIC_BEZIER_SEGMENT; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_ELLIPSE +// +//------------------------------------------------------------------------------ +typedef struct D2D1_ELLIPSE +{ + D2D1_POINT_2F point; + FLOAT radiusX; + FLOAT radiusY; + +} D2D1_ELLIPSE; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_ROUNDED_RECT +// +//------------------------------------------------------------------------------ +typedef struct D2D1_ROUNDED_RECT +{ + D2D1_RECT_F rect; + FLOAT radiusX; + FLOAT radiusY; + +} D2D1_ROUNDED_RECT; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_STROKE_STYLE_PROPERTIES +// +// Synopsis: +// Properties, aside from the width, that allow geometric penning to be specified. +// +//------------------------------------------------------------------------------ +typedef struct D2D1_STROKE_STYLE_PROPERTIES +{ + D2D1_CAP_STYLE startCap; + D2D1_CAP_STYLE endCap; + D2D1_CAP_STYLE dashCap; + D2D1_LINE_JOIN lineJoin; + FLOAT miterLimit; + D2D1_DASH_STYLE dashStyle; + FLOAT dashOffset; + +} D2D1_STROKE_STYLE_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Flag: +// D2D1_LAYER_OPTIONS +// +// Synopsis: +// Specified options that can be applied when a layer resource is applied to create +// a layer. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_LAYER_OPTIONS +{ + D2D1_LAYER_OPTIONS_NONE = 0x00000000, + + // + // The layer will render correctly for ClearType text. If the render target was set + // to ClearType previously, the layer will continue to render ClearType. If the + // render target was set to ClearType and this option is not specified, the render + // target will be set to render gray-scale until the layer is popped. The caller + // can override this default by calling SetTextAntialiasMode while within the + // layer. This flag is slightly slower than the default. + // + D2D1_LAYER_OPTIONS_INITIALIZE_FOR_CLEARTYPE = 0x00000001, + D2D1_LAYER_OPTIONS_FORCE_DWORD = 0xffffffff + +} D2D1_LAYER_OPTIONS; + +DEFINE_ENUM_FLAG_OPERATORS(D2D1_LAYER_OPTIONS); + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_LAYER_PARAMETERS +// +//------------------------------------------------------------------------------ +typedef struct D2D1_LAYER_PARAMETERS +{ + + // + // The rectangular clip that will be applied to the layer. The clip is affected by + // the world transform. Content outside of the content bounds will not render. + // + D2D1_RECT_F contentBounds; + + // + // A general mask that can be optionally applied to the content. Content not inside + // the fill of the mask will not be rendered. + // + __field_ecount_opt(1) ID2D1Geometry *geometricMask; + + // + // Specifies whether the mask should be aliased or antialiased. + // + D2D1_ANTIALIAS_MODE maskAntialiasMode; + + // + // An additional transform that may be applied to the mask in addition to the + // current world transform. + // + D2D1_MATRIX_3X2_F maskTransform; + + // + // The opacity with which all of the content in the layer will be blended back to + // the target when the layer is popped. + // + FLOAT opacity; + + // + // An additional brush that can be applied to the layer. Only the opacity channel + // is sampled from this brush and multiplied both with the layer content and the + // over-all layer opacity. + // + __field_ecount_opt(1) ID2D1Brush *opacityBrush; + + // + // Specifies if ClearType will be rendered into the layer. + // + D2D1_LAYER_OPTIONS layerOptions; + +} D2D1_LAYER_PARAMETERS; + + +//+----------------------------------------------------------------------------- +// +// Flag: +// D2D1_WINDOW_STATE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_WINDOW_STATE +{ + D2D1_WINDOW_STATE_NONE = 0x0000000, + D2D1_WINDOW_STATE_OCCLUDED = 0x0000001, + D2D1_WINDOW_STATE_FORCE_DWORD = 0xffffffff + +} D2D1_WINDOW_STATE; + +DEFINE_ENUM_FLAG_OPERATORS(D2D1_WINDOW_STATE); + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_RENDER_TARGET_TYPE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_RENDER_TARGET_TYPE +{ + + // + // D2D is free to choose the render target type for the caller. + // + D2D1_RENDER_TARGET_TYPE_DEFAULT = 0, + + // + // The render target will render using the CPU. + // + D2D1_RENDER_TARGET_TYPE_SOFTWARE = 1, + + // + // The render target will render using the GPU. + // + D2D1_RENDER_TARGET_TYPE_HARDWARE = 2, + D2D1_RENDER_TARGET_TYPE_FORCE_DWORD = 0xffffffff + +} D2D1_RENDER_TARGET_TYPE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_FEATURE_LEVEL +// +//------------------------------------------------------------------------------ +typedef enum D2D1_FEATURE_LEVEL +{ + + // + // The caller does not require a particular underlying D3D device level. + // + D2D1_FEATURE_LEVEL_DEFAULT = 0, + + // + // The D3D device level is DX9 compatible. + // + D2D1_FEATURE_LEVEL_9 = D3D10_FEATURE_LEVEL_9_1, + + // + // The D3D device level is DX10 compatible. + // + D2D1_FEATURE_LEVEL_10 = D3D10_FEATURE_LEVEL_10_0, + D2D1_FEATURE_LEVEL_FORCE_DWORD = 0xffffffff + +} D2D1_FEATURE_LEVEL; + + +//+----------------------------------------------------------------------------- +// +// Flag: +// D2D1_RENDER_TARGET_USAGE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_RENDER_TARGET_USAGE +{ + D2D1_RENDER_TARGET_USAGE_NONE = 0x00000000, + + // + // Rendering will occur locally, if a terminal-services session is established, the + // bitmap updates will be sent to the terminal services client. + // + D2D1_RENDER_TARGET_USAGE_FORCE_BITMAP_REMOTING = 0x00000001, + + // + // The render target will allow a call to GetDC on the IGdiInteropRenderTarget + // interface. Rendering will also occur locally. + // + D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE = 0x00000002, + D2D1_RENDER_TARGET_USAGE_FORCE_DWORD = 0xffffffff + +} D2D1_RENDER_TARGET_USAGE; + +DEFINE_ENUM_FLAG_OPERATORS(D2D1_RENDER_TARGET_USAGE); + + +//+----------------------------------------------------------------------------- +// +// Flag: +// D2D1_PRESENT_OPTIONS +// +// Synopsis: +// Describes how present should behave. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_PRESENT_OPTIONS +{ + D2D1_PRESENT_OPTIONS_NONE = 0x00000000, + + // + // Keep the target contents intact through present. + // + D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS = 0x00000001, + + // + // Do not wait for display refresh to commit changes to display. + // + D2D1_PRESENT_OPTIONS_IMMEDIATELY = 0x00000002, + D2D1_PRESENT_OPTIONS_FORCE_DWORD = 0xffffffff + +} D2D1_PRESENT_OPTIONS; + +DEFINE_ENUM_FLAG_OPERATORS(D2D1_PRESENT_OPTIONS); + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_RENDER_TARGET_PROPERTIES +// +//------------------------------------------------------------------------------ +typedef struct D2D1_RENDER_TARGET_PROPERTIES +{ + D2D1_RENDER_TARGET_TYPE type; + D2D1_PIXEL_FORMAT pixelFormat; + FLOAT dpiX; + FLOAT dpiY; + D2D1_RENDER_TARGET_USAGE usage; + D2D1_FEATURE_LEVEL minLevel; + +} D2D1_RENDER_TARGET_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_HWND_RENDER_TARGET_PROPERTIES +// +//------------------------------------------------------------------------------ +typedef struct D2D1_HWND_RENDER_TARGET_PROPERTIES +{ + HWND hwnd; + D2D1_SIZE_U pixelSize; + D2D1_PRESENT_OPTIONS presentOptions; + +} D2D1_HWND_RENDER_TARGET_PROPERTIES; + + +//+----------------------------------------------------------------------------- +// +// Flag: +// D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS +// +//------------------------------------------------------------------------------ +typedef enum D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS +{ + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE = 0x00000000, + + // + // The compatible render target will allow a call to GetDC on the + // IGdiInteropRenderTarget interface. This can be specified even if the parent + // render target is not GDI compatible. + // + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_GDI_COMPATIBLE = 0x00000001, + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_FORCE_DWORD = 0xffffffff + +} D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS; + +DEFINE_ENUM_FLAG_OPERATORS(D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS); + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_DRAWING_STATE_DESCRIPTION +// +// Synopsis: +// Allows the drawing state to be atomically created. This also specifies the +// drawing state that is saved into an IDrawingStateBlock object. +// +//------------------------------------------------------------------------------ +typedef struct D2D1_DRAWING_STATE_DESCRIPTION +{ + D2D1_ANTIALIAS_MODE antialiasMode; + D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode; + D2D1_TAG tag1; + D2D1_TAG tag2; + D2D1_MATRIX_3X2_F transform; + +} D2D1_DRAWING_STATE_DESCRIPTION; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_DC_INITIALIZE_MODE +// +//------------------------------------------------------------------------------ +typedef enum D2D1_DC_INITIALIZE_MODE +{ + + // + // The contents of the D2D render target will be copied to the DC. + // + D2D1_DC_INITIALIZE_MODE_COPY = 0, + + // + // The contents of the DC will be cleared. + // + D2D1_DC_INITIALIZE_MODE_CLEAR = 1, + D2D1_DC_INITIALIZE_MODE_FORCE_DWORD = 0xffffffff + +} D2D1_DC_INITIALIZE_MODE; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_DEBUG_LEVEL +// +// Synopsis: +// Indicates the debug level to be outputed by the debug layer. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_DEBUG_LEVEL +{ + D2D1_DEBUG_LEVEL_NONE = 0, + D2D1_DEBUG_LEVEL_ERROR = 1, + D2D1_DEBUG_LEVEL_WARNING = 2, + D2D1_DEBUG_LEVEL_INFORMATION = 3, + D2D1_DEBUG_LEVEL_FORCE_DWORD = 0xffffffff + +} D2D1_DEBUG_LEVEL; + + +//+----------------------------------------------------------------------------- +// +// Enum: +// D2D1_FACTORY_TYPE +// +// Synopsis: +// Specifies the threading model of the created factory and all of its derived +// resources. +// +//------------------------------------------------------------------------------ +typedef enum D2D1_FACTORY_TYPE +{ + + // + // The resulting factory and derived resources may only be invoked serially. + // Reference counts on resources are interlocked, however, resource and render + // target state is not protected from multi-threaded access. + // + D2D1_FACTORY_TYPE_SINGLE_THREADED = 0, + + // + // The resulting factory may be invoked from multiple threads. Returned resources + // use interlocked reference counting and their state is protected. + // + D2D1_FACTORY_TYPE_MULTI_THREADED = 1, + D2D1_FACTORY_TYPE_FORCE_DWORD = 0xffffffff + +} D2D1_FACTORY_TYPE; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D1_FACTORY_OPTIONS +// +// Synopsis: +// Allows additional parameters for factory creation. +// +//------------------------------------------------------------------------------ +typedef struct D2D1_FACTORY_OPTIONS +{ + + // + // Requests a certain level of debugging information from the debug layer. This + // parameter is ignored if the debug layer DLL is not present. + // + D2D1_DEBUG_LEVEL debugLevel; + +} D2D1_FACTORY_OPTIONS; + + +#ifndef D2D_USE_C_DEFINITIONS + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1Resource +// +// Synopsis: +// The root interface for all resources in D2D. +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd90691-12e2-11dc-9fed-001143a055f9") ID2D1Resource : public IUnknown +{ + + + // + // Retrieve the factory associated with this resource. + // + STDMETHOD_(void, GetFactory)( + __deref_out ID2D1Factory **factory + ) CONST PURE; +}; // interface ID2D1Resource + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1Bitmap +// +// Synopsis: +// Root bitmap resource, linearly scaled on a draw call. +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("a2296057-ea42-4099-983b-539fb6505426") ID2D1Bitmap : public ID2D1Resource +{ + + + // + // Returns the size of the bitmap in resolution independent units. + // + STDMETHOD_(D2D1_SIZE_F, GetSize)( + ) CONST PURE; + + + // + // Returns the size of the bitmap in resolution dependent units, (pixels). + // + STDMETHOD_(D2D1_SIZE_U, GetPixelSize)( + ) CONST PURE; + + + // + // Retrieve the format of the bitmap. + // + STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)( + ) CONST PURE; + + + // + // Return the DPI of the bitmap. + // + STDMETHOD_(void, GetDpi)( + __out FLOAT *dpiX, + __out FLOAT *dpiY + ) CONST PURE; + + STDMETHOD(CopyFromBitmap)( + __in_opt CONST D2D1_POINT_2U *destPoint, + __in ID2D1Bitmap *bitmap, + __in_opt CONST D2D1_RECT_U *srcRect + ) PURE; + + STDMETHOD(CopyFromRenderTarget)( + __in_opt CONST D2D1_POINT_2U *destPoint, + __in ID2D1RenderTarget *renderTarget, + __in_opt CONST D2D1_RECT_U *srcRect + ) PURE; + + STDMETHOD(CopyFromMemory)( + __in_opt CONST D2D1_RECT_U *dstRect, + __in CONST void *srcData, + UINT32 pitch + ) PURE; +}; // interface ID2D1Bitmap + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1GradientStopCollection +// +// Synopsis: +// Represents an collection of gradient stops that can then be the source resource +// for either a linear or radial gradient brush. +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a7-12e2-11dc-9fed-001143a055f9") ID2D1GradientStopCollection : public ID2D1Resource +{ + + + // + // Returns the number of stops in the gradient. + // + STDMETHOD_(UINT32, GetGradientStopCount)( + ) CONST PURE; + + + // + // Copies the gradient stops from the collection into the caller's interface. + // + STDMETHOD_(void, GetGradientStops)( + __out_ecount(gradientStopsCount) D2D1_GRADIENT_STOP *gradientStops, + UINT gradientStopsCount + ) CONST PURE; + + + // + // Returns whether the interpolation occurs with 1.0 or 2.2 gamma. + // + STDMETHOD_(D2D1_GAMMA, GetColorInterpolationGamma)( + ) CONST PURE; + + STDMETHOD_(D2D1_EXTEND_MODE, GetExtendMode)( + ) CONST PURE; +}; // interface ID2D1GradientStopCollection + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1Brush +// +// Synopsis: +// The root brush interface. All brushes can be used to fill or pen a geometry. +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a8-12e2-11dc-9fed-001143a055f9") ID2D1Brush : public ID2D1Resource +{ + + + // + // Sets the opacity for when the brush is drawn over the entire fill of the brush. + // + STDMETHOD_(void, SetOpacity)( + FLOAT opacity + ) PURE; + + + // + // Sets the transform that applies to everything drawn by the brush. + // + STDMETHOD_(void, SetTransform)( + __in CONST D2D1_MATRIX_3X2_F *transform + ) PURE; + + STDMETHOD_(FLOAT, GetOpacity)( + ) CONST PURE; + + STDMETHOD_(void, GetTransform)( + __out D2D1_MATRIX_3X2_F *transform + ) CONST PURE; + + void + SetTransform( + CONST D2D1_MATRIX_3X2_F &transform + ) + { + SetTransform(&transform); + } +}; // interface ID2D1Brush + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1BitmapBrush +// +// Synopsis: +// A bitmap brush allows a bitmap to be used to fill a geometry. +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906aa-12e2-11dc-9fed-001143a055f9") ID2D1BitmapBrush : public ID2D1Brush +{ + + + // + // Sets how the bitmap is to be treated outside of its natural extent on the X + // axis. + // + STDMETHOD_(void, SetExtendModeX)( + D2D1_EXTEND_MODE extendModeX + ) PURE; + + + // + // Sets how the bitmap is to be treated outside of its natural extent on the X + // axis. + // + STDMETHOD_(void, SetExtendModeY)( + D2D1_EXTEND_MODE extendModeY + ) PURE; + + + // + // Sets the interpolation mode used when this brush is used. + // + STDMETHOD_(void, SetInterpolationMode)( + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode + ) PURE; + + + // + // Sets the bitmap associated as the source of this brush. + // + STDMETHOD_(void, SetBitmap)( + __in ID2D1Bitmap *bitmap + ) PURE; + + STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeX)( + ) CONST PURE; + + STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeY)( + ) CONST PURE; + + STDMETHOD_(D2D1_BITMAP_INTERPOLATION_MODE, GetInterpolationMode)( + ) CONST PURE; + + STDMETHOD_(void, GetBitmap)( + __deref_out ID2D1Bitmap **bitmap + ) CONST PURE; +}; // interface ID2D1BitmapBrush + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1SolidColorBrush +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a9-12e2-11dc-9fed-001143a055f9") ID2D1SolidColorBrush : public ID2D1Brush +{ + + STDMETHOD_(void, SetColor)( + __in CONST D2D1_COLOR_F *color + ) PURE; + + STDMETHOD_(D2D1_COLOR_F, GetColor)( + ) CONST PURE; + + void + SetColor( + CONST D2D1_COLOR_F &color + ) + { + SetColor(&color); + } +}; // interface ID2D1SolidColorBrush + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1LinearGradientBrush +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906ab-12e2-11dc-9fed-001143a055f9") ID2D1LinearGradientBrush : public ID2D1Brush +{ + + STDMETHOD_(void, SetStartPoint)( + D2D1_POINT_2F startPoint + ) PURE; + + + // + // Sets the end point of the gradient in local coordinate space. This is not + // influenced by the geometry being filled. + // + STDMETHOD_(void, SetEndPoint)( + D2D1_POINT_2F endPoint + ) PURE; + + STDMETHOD_(D2D1_POINT_2F, GetStartPoint)( + ) CONST PURE; + + STDMETHOD_(D2D1_POINT_2F, GetEndPoint)( + ) CONST PURE; + + STDMETHOD_(void, GetGradientStopCollection)( + __deref_out ID2D1GradientStopCollection **gradientStopCollection + ) CONST PURE; +}; // interface ID2D1LinearGradientBrush + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1RadialGradientBrush +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906ac-12e2-11dc-9fed-001143a055f9") ID2D1RadialGradientBrush : public ID2D1Brush +{ + + + // + // Sets the center of the radial gradient. This will be in local coordinates and + // will not depend on the geometry being filled. + // + STDMETHOD_(void, SetCenter)( + D2D1_POINT_2F center + ) PURE; + + + // + // Sets offset of the origin relative to the radial gradient center. + // + STDMETHOD_(void, SetGradientOriginOffset)( + D2D1_POINT_2F gradientOriginOffset + ) PURE; + + STDMETHOD_(void, SetRadiusX)( + FLOAT radiusX + ) PURE; + + STDMETHOD_(void, SetRadiusY)( + FLOAT radiusY + ) PURE; + + STDMETHOD_(D2D1_POINT_2F, GetCenter)( + ) CONST PURE; + + STDMETHOD_(D2D1_POINT_2F, GetGradientOriginOffset)( + ) CONST PURE; + + STDMETHOD_(FLOAT, GetRadiusX)( + ) CONST PURE; + + STDMETHOD_(FLOAT, GetRadiusY)( + ) CONST PURE; + + STDMETHOD_(void, GetGradientStopCollection)( + __deref_out ID2D1GradientStopCollection **gradientStopCollection + ) CONST PURE; +}; // interface ID2D1RadialGradientBrush + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1StrokeStyle +// +// Synopsis: +// Resource interface that holds pen style properties. +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd9069d-12e2-11dc-9fed-001143a055f9") ID2D1StrokeStyle : public ID2D1Resource +{ + + STDMETHOD_(D2D1_CAP_STYLE, GetStartCap)( + ) CONST PURE; + + STDMETHOD_(D2D1_CAP_STYLE, GetEndCap)( + ) CONST PURE; + + STDMETHOD_(D2D1_CAP_STYLE, GetDashCap)( + ) CONST PURE; + + STDMETHOD_(FLOAT, GetMiterLimit)( + ) CONST PURE; + + STDMETHOD_(D2D1_LINE_JOIN, GetLineJoin)( + ) CONST PURE; + + STDMETHOD_(FLOAT, GetDashOffset)( + ) CONST PURE; + + STDMETHOD_(D2D1_DASH_STYLE, GetDashStyle)( + ) CONST PURE; + + STDMETHOD_(UINT32, GetDashesCount)( + ) CONST PURE; + + + // + // Returns the dashes from the object into a user allocated array. The user must + // call GetDashesCount to retrieve the required size. + // + STDMETHOD_(void, GetDashes)( + __out_ecount(dashesCount) FLOAT *dashes, + UINT dashesCount + ) CONST PURE; +}; // interface ID2D1StrokeStyle + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1Geometry +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a1-12e2-11dc-9fed-001143a055f9") ID2D1Geometry : public ID2D1Resource +{ + + + // + // Retrieve the bounds of the geometry, with an optional applied transform. + // + STDMETHOD(GetBounds)( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out D2D1_RECT_F *bounds + ) CONST PURE; + + + // + // Get the bounds of the corresponding geometry after it has been widened or have + // an optional pen style applied. + // + STDMETHOD(GetWidenedBounds)( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out D2D1_RECT_F *bounds + ) CONST PURE; + + + // + // Checks to see whether the corresponding penned and widened geometry contains the + // given point. + // + STDMETHOD(StrokeContainsPoint)( + D2D1_POINT_2F point, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out BOOL *contains + ) CONST PURE; + + + // + // Test whether the given fill of this geometry would contain this point. + // + STDMETHOD(FillContainsPoint)( + D2D1_POINT_2F point, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out BOOL *contains + ) CONST PURE; + + + // + // Compare how one geometry intersects or contains another geometry. + // + STDMETHOD(CompareWithGeometry)( + __in ID2D1Geometry *inputGeometry, + __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform, + FLOAT flatteningTolerance, + __out D2D1_GEOMETRY_RELATION *relation + ) CONST PURE; + + + // + // Converts a geometry to a simplified geometry that has arcs and quadratic beziers + // removed. + // + STDMETHOD(Simplify)( + D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST PURE; + + + // + // Tessellates a geometry into triangles. + // + STDMETHOD(Tessellate)( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1TessellationSink *tessellationSink + ) CONST PURE; + + + // + // Performs a combine operation between the two geometries to produce a resulting + // geometry. + // + STDMETHOD(CombineWithGeometry)( + __in ID2D1Geometry *inputGeometry, + D2D1_COMBINE_MODE combineMode, + __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST PURE; + + + // + // Computes the outline of the geometry. The result is written back into a + // simplified geometry sink. + // + STDMETHOD(Outline)( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST PURE; + + + // + // Computes the area of the geometry. + // + STDMETHOD(ComputeArea)( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out FLOAT *area + ) CONST PURE; + + + // + // Computes the length of the geometry. + // + STDMETHOD(ComputeLength)( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out FLOAT *length + ) CONST PURE; + + + // + // Computes the point and tangent a given distance along the path. + // + STDMETHOD(ComputePointAtLength)( + FLOAT length, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out_opt D2D1_POINT_2F *point, + __out_opt D2D1_POINT_2F *unitTangentVector + ) CONST PURE; + + + // + // Get the geometry and widen it as well as apply an optional pen style. + // + STDMETHOD(Widen)( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST PURE; + + + // + // Retrieve the bounds of the geometry, with an optional applied transform. + // + HRESULT + GetBounds( + CONST D2D1_MATRIX_3X2_F &worldTransform, + __out D2D1_RECT_F *bounds + ) CONST + { + return GetBounds(&worldTransform, bounds); + } + + + // + // Get the bounds of the corresponding geometry after it has been widened or have + // an optional pen style applied. + // + HRESULT + GetWidenedBounds( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __out D2D1_RECT_F *bounds + ) CONST + { + return GetWidenedBounds(strokeWidth, strokeStyle, &worldTransform, flatteningTolerance, bounds); + } + + + // + // Get the bounds of the corresponding geometry after it has been widened or have + // an optional pen style applied. + // + HRESULT + GetWidenedBounds( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out D2D1_RECT_F *bounds + ) CONST + { + return GetWidenedBounds(strokeWidth, strokeStyle, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, bounds); + } + + + // + // Get the bounds of the corresponding geometry after it has been widened or have + // an optional pen style applied. + // + HRESULT + GetWidenedBounds( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + CONST D2D1_MATRIX_3X2_F &worldTransform, + __out D2D1_RECT_F *bounds + ) CONST + { + return GetWidenedBounds(strokeWidth, strokeStyle, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, bounds); + } + + HRESULT + StrokeContainsPoint( + D2D1_POINT_2F point, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __out BOOL *contains + ) CONST + { + return StrokeContainsPoint(point, strokeWidth, strokeStyle, &worldTransform, flatteningTolerance, contains); + } + + + // + // Checks to see whether the corresponding penned and widened geometry contains the + // given point. + // + HRESULT + StrokeContainsPoint( + D2D1_POINT_2F point, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out BOOL *contains + ) CONST + { + return StrokeContainsPoint(point, strokeWidth, strokeStyle, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains); + } + + HRESULT + StrokeContainsPoint( + D2D1_POINT_2F point, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + CONST D2D1_MATRIX_3X2_F &worldTransform, + __out BOOL *contains + ) CONST + { + return StrokeContainsPoint(point, strokeWidth, strokeStyle, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains); + } + + HRESULT + FillContainsPoint( + D2D1_POINT_2F point, + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __out BOOL *contains + ) CONST + { + return FillContainsPoint(point, &worldTransform, flatteningTolerance, contains); + } + + + // + // Test whether the given fill of this geometry would contain this point. + // + HRESULT + FillContainsPoint( + D2D1_POINT_2F point, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out BOOL *contains + ) CONST + { + return FillContainsPoint(point, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains); + } + + HRESULT + FillContainsPoint( + D2D1_POINT_2F point, + CONST D2D1_MATRIX_3X2_F &worldTransform, + __out BOOL *contains + ) CONST + { + return FillContainsPoint(point, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, contains); + } + + + // + // Compare how one geometry intersects or contains another geometry. + // + HRESULT + CompareWithGeometry( + __in ID2D1Geometry *inputGeometry, + CONST D2D1_MATRIX_3X2_F &inputGeometryTransform, + FLOAT flatteningTolerance, + __out D2D1_GEOMETRY_RELATION *relation + ) CONST + { + return CompareWithGeometry(inputGeometry, &inputGeometryTransform, flatteningTolerance, relation); + } + + + // + // Compare how one geometry intersects or contains another geometry. + // + HRESULT + CompareWithGeometry( + __in ID2D1Geometry *inputGeometry, + __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform, + __out D2D1_GEOMETRY_RELATION *relation + ) CONST + { + return CompareWithGeometry(inputGeometry, inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, relation); + } + + + // + // Compare how one geometry intersects or contains another geometry. + // + HRESULT + CompareWithGeometry( + __in ID2D1Geometry *inputGeometry, + CONST D2D1_MATRIX_3X2_F &inputGeometryTransform, + __out D2D1_GEOMETRY_RELATION *relation + ) CONST + { + return CompareWithGeometry(inputGeometry, &inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, relation); + } + + + // + // Converts a geometry to a simplified geometry that has arcs and quadratic beziers + // removed. + // + HRESULT + Simplify( + D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Simplify(simplificationOption, &worldTransform, flatteningTolerance, geometrySink); + } + + + // + // Converts a geometry to a simplified geometry that has arcs and quadratic beziers + // removed. + // + HRESULT + Simplify( + D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Simplify(simplificationOption, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } + + + // + // Converts a geometry to a simplified geometry that has arcs and quadratic beziers + // removed. + // + HRESULT + Simplify( + D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, + CONST D2D1_MATRIX_3X2_F &worldTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Simplify(simplificationOption, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } + + + // + // Tessellates a geometry into triangles. + // + HRESULT + Tessellate( + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __in ID2D1TessellationSink *tessellationSink + ) CONST + { + return Tessellate(&worldTransform, flatteningTolerance, tessellationSink); + } + + + // + // Tessellates a geometry into triangles. + // + HRESULT + Tessellate( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __in ID2D1TessellationSink *tessellationSink + ) CONST + { + return Tessellate(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, tessellationSink); + } + + + // + // Tessellates a geometry into triangles. + // + HRESULT + Tessellate( + CONST D2D1_MATRIX_3X2_F &worldTransform, + __in ID2D1TessellationSink *tessellationSink + ) CONST + { + return Tessellate(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, tessellationSink); + } + + + // + // Performs a combine operation between the two geometries to produce a resulting + // geometry. + // + HRESULT + CombineWithGeometry( + __in ID2D1Geometry *inputGeometry, + D2D1_COMBINE_MODE combineMode, + CONST D2D1_MATRIX_3X2_F &inputGeometryTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return CombineWithGeometry(inputGeometry, combineMode, &inputGeometryTransform, flatteningTolerance, geometrySink); + } + + + // + // Performs a combine operation between the two geometries to produce a resulting + // geometry. + // + HRESULT + CombineWithGeometry( + __in ID2D1Geometry *inputGeometry, + D2D1_COMBINE_MODE combineMode, + __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return CombineWithGeometry(inputGeometry, combineMode, inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } + + + // + // Performs a combine operation between the two geometries to produce a resulting + // geometry. + // + HRESULT + CombineWithGeometry( + __in ID2D1Geometry *inputGeometry, + D2D1_COMBINE_MODE combineMode, + CONST D2D1_MATRIX_3X2_F &inputGeometryTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return CombineWithGeometry(inputGeometry, combineMode, &inputGeometryTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } + + + // + // Computes the outline of the geometry. The result is written back into a + // simplified geometry sink. + // + HRESULT + Outline( + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Outline(&worldTransform, flatteningTolerance, geometrySink); + } + + + // + // Computes the outline of the geometry. The result is written back into a + // simplified geometry sink. + // + HRESULT + Outline( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Outline(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } + + + // + // Computes the outline of the geometry. The result is written back into a + // simplified geometry sink. + // + HRESULT + Outline( + CONST D2D1_MATRIX_3X2_F &worldTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Outline(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } + + + // + // Computes the area of the geometry. + // + HRESULT + ComputeArea( + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __out FLOAT *area + ) CONST + { + return ComputeArea(&worldTransform, flatteningTolerance, area); + } + + + // + // Computes the area of the geometry. + // + HRESULT + ComputeArea( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out FLOAT *area + ) CONST + { + return ComputeArea(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, area); + } + + + // + // Computes the area of the geometry. + // + HRESULT + ComputeArea( + CONST D2D1_MATRIX_3X2_F &worldTransform, + __out FLOAT *area + ) CONST + { + return ComputeArea(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, area); + } + + + // + // Computes the length of the geometry. + // + HRESULT + ComputeLength( + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __out FLOAT *length + ) CONST + { + return ComputeLength(&worldTransform, flatteningTolerance, length); + } + + + // + // Computes the length of the geometry. + // + HRESULT + ComputeLength( + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out FLOAT *length + ) CONST + { + return ComputeLength(worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, length); + } + + + // + // Computes the length of the geometry. + // + HRESULT + ComputeLength( + CONST D2D1_MATRIX_3X2_F &worldTransform, + __out FLOAT *length + ) CONST + { + return ComputeLength(&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, length); + } + + + // + // Computes the point and tangent a given distance along the path. + // + HRESULT + ComputePointAtLength( + FLOAT length, + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __out_opt D2D1_POINT_2F *point, + __out_opt D2D1_POINT_2F *unitTangentVector + ) CONST + { + return ComputePointAtLength(length, &worldTransform, flatteningTolerance, point, unitTangentVector); + } + + + // + // Computes the point and tangent a given distance along the path. + // + HRESULT + ComputePointAtLength( + FLOAT length, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out_opt D2D1_POINT_2F *point, + __out_opt D2D1_POINT_2F *unitTangentVector + ) CONST + { + return ComputePointAtLength(length, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, point, unitTangentVector); + } + + + // + // Computes the point and tangent a given distance along the path. + // + HRESULT + ComputePointAtLength( + FLOAT length, + CONST D2D1_MATRIX_3X2_F &worldTransform, + __out_opt D2D1_POINT_2F *point, + __out_opt D2D1_POINT_2F *unitTangentVector + ) CONST + { + return ComputePointAtLength(length, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, point, unitTangentVector); + } + + + // + // Get the geometry and widen it as well as apply an optional pen style. + // + HRESULT + Widen( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + CONST D2D1_MATRIX_3X2_F &worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Widen(strokeWidth, strokeStyle, &worldTransform, flatteningTolerance, geometrySink); + } + + + // + // Get the geometry and widen it as well as apply an optional pen style. + // + HRESULT + Widen( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Widen(strokeWidth, strokeStyle, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } + + + // + // Get the geometry and widen it as well as apply an optional pen style. + // + HRESULT + Widen( + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + CONST D2D1_MATRIX_3X2_F &worldTransform, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) CONST + { + return Widen(strokeWidth, strokeStyle, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); + } +}; // interface ID2D1Geometry + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1RectangleGeometry +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a2-12e2-11dc-9fed-001143a055f9") ID2D1RectangleGeometry : public ID2D1Geometry +{ + + STDMETHOD_(void, GetRect)( + __out D2D1_RECT_F *rect + ) CONST PURE; +}; // interface ID2D1RectangleGeometry + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1RoundedRectangleGeometry +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a3-12e2-11dc-9fed-001143a055f9") ID2D1RoundedRectangleGeometry : public ID2D1Geometry +{ + + STDMETHOD_(void, GetRoundedRect)( + __out D2D1_ROUNDED_RECT *roundedRect + ) CONST PURE; +}; // interface ID2D1RoundedRectangleGeometry + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1EllipseGeometry +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a4-12e2-11dc-9fed-001143a055f9") ID2D1EllipseGeometry : public ID2D1Geometry +{ + + STDMETHOD_(void, GetEllipse)( + __out D2D1_ELLIPSE *ellipse + ) CONST PURE; +}; // interface ID2D1EllipseGeometry + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1GeometryGroup +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a6-12e2-11dc-9fed-001143a055f9") ID2D1GeometryGroup : public ID2D1Geometry +{ + + STDMETHOD_(D2D1_FILL_MODE, GetFillMode)( + ) CONST PURE; + + STDMETHOD_(UINT32, GetSourceGeometryCount)( + ) CONST PURE; + + STDMETHOD_(void, GetSourceGeometries)( + __out_ecount(geometriesCount) ID2D1Geometry **geometries, + UINT geometriesCount + ) CONST PURE; +}; // interface ID2D1GeometryGroup + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1TransformedGeometry +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906bb-12e2-11dc-9fed-001143a055f9") ID2D1TransformedGeometry : public ID2D1Geometry +{ + + STDMETHOD_(void, GetSourceGeometry)( + __deref_out ID2D1Geometry **sourceGeometry + ) CONST PURE; + + STDMETHOD_(void, GetTransform)( + __out D2D1_MATRIX_3X2_F *transform + ) CONST PURE; +}; // interface ID2D1TransformedGeometry + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1SimplifiedGeometrySink +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd9069e-12e2-11dc-9fed-001143a055f9") ID2D1SimplifiedGeometrySink : public IUnknown +{ + + STDMETHOD_(void, SetFillMode)( + D2D1_FILL_MODE fillMode + ) PURE; + + STDMETHOD_(void, SetSegmentFlags)( + D2D1_PATH_SEGMENT vertexFlags + ) PURE; + + STDMETHOD_(void, BeginFigure)( + D2D1_POINT_2F startPoint, + D2D1_FIGURE_BEGIN figureBegin + ) PURE; + + STDMETHOD_(void, AddLines)( + __in_ecount(pointsCount) CONST D2D1_POINT_2F *points, + UINT pointsCount + ) PURE; + + STDMETHOD_(void, AddBeziers)( + __in_ecount(beziersCount) CONST D2D1_BEZIER_SEGMENT *beziers, + UINT beziersCount + ) PURE; + + STDMETHOD_(void, EndFigure)( + D2D1_FIGURE_END figureEnd + ) PURE; + + STDMETHOD(Close)( + ) PURE; +}; // interface ID2D1SimplifiedGeometrySink + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1GeometrySink +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd9069f-12e2-11dc-9fed-001143a055f9") ID2D1GeometrySink : public ID2D1SimplifiedGeometrySink +{ + + STDMETHOD_(void, AddLine)( + D2D1_POINT_2F point + ) PURE; + + STDMETHOD_(void, AddBezier)( + __in CONST D2D1_BEZIER_SEGMENT *bezier + ) PURE; + + STDMETHOD_(void, AddQuadraticBezier)( + __in CONST D2D1_QUADRATIC_BEZIER_SEGMENT *bezier + ) PURE; + + STDMETHOD_(void, AddQuadraticBeziers)( + __in_ecount(beziersCount) CONST D2D1_QUADRATIC_BEZIER_SEGMENT *beziers, + UINT beziersCount + ) PURE; + + STDMETHOD_(void, AddArc)( + __in CONST D2D1_ARC_SEGMENT *arc + ) PURE; + + void + AddBezier( + CONST D2D1_BEZIER_SEGMENT &bezier + ) + { + AddBezier(&bezier); + } + + void + AddQuadraticBezier( + CONST D2D1_QUADRATIC_BEZIER_SEGMENT &bezier + ) + { + AddQuadraticBezier(&bezier); + } + + void + AddArc( + CONST D2D1_ARC_SEGMENT &arc + ) + { + AddArc(&arc); + } +}; // interface ID2D1GeometrySink + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1TessellationSink +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906c1-12e2-11dc-9fed-001143a055f9") ID2D1TessellationSink : public IUnknown +{ + + STDMETHOD_(void, AddTriangles)( + __in_ecount(trianglesCount) CONST D2D1_TRIANGLE *triangles, + UINT trianglesCount + ) PURE; + + STDMETHOD(Close)( + ) PURE; +}; // interface ID2D1TessellationSink + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1PathGeometry +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906a5-12e2-11dc-9fed-001143a055f9") ID2D1PathGeometry : public ID2D1Geometry +{ + + + // + // Opens a geometry sink that will be used to create this path geometry. + // + STDMETHOD(Open)( + __deref_out ID2D1GeometrySink **geometrySink + ) PURE; + + + // + // Retrieve the contents of this geometry. The caller passes an implementation of a + // ID2D1GeometrySink interface to receive the data. + // + STDMETHOD(Stream)( + __in ID2D1GeometrySink *geometrySink + ) CONST PURE; + + STDMETHOD(GetSegmentCount)( + __out UINT32 *count + ) CONST PURE; + + STDMETHOD(GetFigureCount)( + __out UINT32 *count + ) CONST PURE; +}; // interface ID2D1PathGeometry + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1Mesh +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd906c2-12e2-11dc-9fed-001143a055f9") ID2D1Mesh : public ID2D1Resource +{ + + + // + // Opens the mesh for population. + // + STDMETHOD(Open)( + __deref_out ID2D1TessellationSink **tessellationSink + ) PURE; +}; // interface ID2D1Mesh + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1Layer +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd9069b-12e2-11dc-9fed-001143a055f9") ID2D1Layer : public ID2D1Resource +{ + + STDMETHOD_(D2D1_SIZE_F, GetSize)( + ) CONST PURE; +}; // interface ID2D1Layer + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1DrawingStateBlock +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("28506e39-ebf6-46a1-bb47-fd85565ab957") ID2D1DrawingStateBlock : public ID2D1Resource +{ + + + // + // Retrieves the state currently contained within this state block resource. + // + STDMETHOD_(void, GetDescription)( + __out D2D1_DRAWING_STATE_DESCRIPTION *stateDescription + ) CONST PURE; + + + // + // Sets the state description of this state block resource. + // + STDMETHOD_(void, SetDescription)( + __in CONST D2D1_DRAWING_STATE_DESCRIPTION *stateDescription + ) PURE; + + + // + // Sets the text rendering parameters of this state block resource. + // + STDMETHOD_(void, SetTextRenderingParams)( + __in_opt IDWriteRenderingParams *textRenderingParams = NULL + ) PURE; + + + // + // Retrieves the text rendering parameters contained within this state block + // resource. If a NULL text rendering parameter was specified, NULL will be + // returned. + // + STDMETHOD_(void, GetTextRenderingParams)( + __deref_out_opt IDWriteRenderingParams **textRenderingParams + ) CONST PURE; + + void + SetDescription( + CONST D2D1_DRAWING_STATE_DESCRIPTION &stateDescription + ) + { + SetDescription(&stateDescription); + } +}; // interface ID2D1DrawingStateBlock + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1RenderTarget +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd90694-12e2-11dc-9fed-001143a055f9") ID2D1RenderTarget : public ID2D1Resource +{ + + + // + // Create a D2D bitmap by copying from memory, or create uninitialized. + // + STDMETHOD(CreateBitmap)( + D2D1_SIZE_U size, + __in_opt CONST void *srcData, + UINT32 pitch, + __in CONST D2D1_BITMAP_PROPERTIES *bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) PURE; + + + // + // Create a D2D bitmap by copying a WIC bitmap. + // + STDMETHOD(CreateBitmapFromWicBitmap)( + __in IWICBitmapSource *wicBitmapSource, + __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) PURE; + + + // + // Create a D2D bitmap by sharing bits from another resource. The bitmap must be + // compatible with the render target for the call to succeed. + // For example, an IWICBitmap can be shared with a software target, or a DXGI + // surface can be shared with a DXGI render target. + // + STDMETHOD(CreateSharedBitmap)( + __in REFIID riid, + __inout void *data, + __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) PURE; + + + // + // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill + // or pen a geometry. + // + STDMETHOD(CreateBitmapBrush)( + __in ID2D1Bitmap *bitmap, + __in_opt CONST D2D1_BITMAP_BRUSH_PROPERTIES *bitmapBrushProperties, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __deref_out ID2D1BitmapBrush **bitmapBrush + ) PURE; + + STDMETHOD(CreateSolidColorBrush)( + __in CONST D2D1_COLOR_F *color, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __deref_out ID2D1SolidColorBrush **solidColorBrush + ) PURE; + + + // + // A gradient stop collection represents a set of stops in an ideal unit length. + // This is the source resource for a linear gradient and radial gradient brush. + // + STDMETHOD(CreateGradientStopCollection)( + __in_ecount(gradientStopsCount) CONST D2D1_GRADIENT_STOP *gradientStops, + __range(>=,1) UINT gradientStopsCount, + + // + // Specifies which space the color interpolation occurs in. + // + D2D1_GAMMA colorInterpolationGamma, + + // + // Specifies how the gradient will be extended outside of the unit length. + // + D2D1_EXTEND_MODE extendMode, + __deref_out ID2D1GradientStopCollection **gradientStopCollection + ) PURE; + + STDMETHOD(CreateLinearGradientBrush)( + __in CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *linearGradientBrushProperties, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1LinearGradientBrush **linearGradientBrush + ) PURE; + + STDMETHOD(CreateRadialGradientBrush)( + __in CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES *radialGradientBrushProperties, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1RadialGradientBrush **radialGradientBrush + ) PURE; + + + // + // Creates a bitmap render target whose bitmap can be used as a source for + // rendering in the API. + // + STDMETHOD(CreateCompatibleRenderTarget)( + + // + // The requested size of the target in DIPs. If the pixel size is not specified, + // the DPI is inherited from the parent target. However, the render target will + // never contain a fractional number of pixels. + // + __in_opt CONST D2D1_SIZE_F *desiredSize, + + // + // The requested size of the render target in pixels. If the DIP size is also + // specified, the DPI is calculated from these two values. If the desired size is + // not specified, the DPI is inherited from the parent render target. If neither + // value is specified, the compatible render target will be the same size and have + // the same DPI as the parent target. + // + __in_opt CONST D2D1_SIZE_U *desiredPixelSize, + + // + // The desired pixel format. The format must be compatible with the parent render + // target type. If the format is not specified, it will be inherited from the + // parent render target. + // + __in_opt CONST D2D1_PIXEL_FORMAT *desiredFormat, + + // + // Allows the caller to retrieve a GDI compatible render target. + // + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options, + + // + // The returned bitmap render target. + // + __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget + ) PURE; + + + // + // Creates a layer resource that can be used on any target and which will resize + // under the covers if necessary. + // + STDMETHOD(CreateLayer)( + + // + // The resolution independent minimum size hint for the layer resource. Specify + // this to prevent unwanted reallocation of the layer backing store. The size is in + // DIPs, but, it is unaffected by the current world transform. If the size is + // unspecified, the returned resource is a placeholder and the backing store will + // be allocated to be the minimum size that can hold the content when the layer is + // pushed. + // + __in_opt CONST D2D1_SIZE_F *size, + __deref_out ID2D1Layer **layer + ) PURE; + + + // + // Create a D2D mesh. + // + STDMETHOD(CreateMesh)( + __deref_out ID2D1Mesh **mesh + ) PURE; + + STDMETHOD_(void, DrawLine)( + D2D1_POINT_2F point0, + D2D1_POINT_2F point1, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) PURE; + + STDMETHOD_(void, DrawRectangle)( + __in CONST D2D1_RECT_F *rect, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) PURE; + + STDMETHOD_(void, FillRectangle)( + __in CONST D2D1_RECT_F *rect, + __in ID2D1Brush *brush + ) PURE; + + STDMETHOD_(void, DrawRoundedRectangle)( + __in CONST D2D1_ROUNDED_RECT *roundedRect, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) PURE; + + STDMETHOD_(void, FillRoundedRectangle)( + __in CONST D2D1_ROUNDED_RECT *roundedRect, + __in ID2D1Brush *brush + ) PURE; + + STDMETHOD_(void, DrawEllipse)( + __in CONST D2D1_ELLIPSE *ellipse, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) PURE; + + STDMETHOD_(void, FillEllipse)( + __in CONST D2D1_ELLIPSE *ellipse, + __in ID2D1Brush *brush + ) PURE; + + STDMETHOD_(void, DrawGeometry)( + __in ID2D1Geometry *geometry, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) PURE; + + STDMETHOD_(void, FillGeometry)( + __in ID2D1Geometry *geometry, + __in ID2D1Brush *brush, + + // + // An optionally specified opacity brush. Only the alpha channel of the + // corresponding brush will be sampled and will be applied to the entire fill of + // the geometry. If this brush is specified, the fill brush must be a bitmap brush + // with an extend mode of D2D1_EXTEND_MODE_CLAMP. + // + __in_opt ID2D1Brush *opacityBrush = NULL + ) PURE; + + + // + // Fill a mesh. Since meshes can only render aliased content, the render target + // antialiasing mode must be set to aliased. + // + STDMETHOD_(void, FillMesh)( + __in ID2D1Mesh *mesh, + __in ID2D1Brush *brush + ) PURE; + + + // + // Fill using the opacity channel of the supplied bitmap as a mask. The alpha + // channel of the bitmap is used to represent the coverage of the geometry at each + // pixel, and this is filled appropriately with the brush. The render target + // antialiasing mode must be set to aliased. + // + STDMETHOD_(void, FillOpacityMask)( + __in ID2D1Bitmap *opacityMask, + __in ID2D1Brush *brush, + D2D1_OPACITY_MASK_CONTENT content, + __in_opt CONST D2D1_RECT_F *destinationRectangle = NULL, + __in_opt CONST D2D1_RECT_F *sourceRectangle = NULL + ) PURE; + + STDMETHOD_(void, DrawBitmap)( + __in ID2D1Bitmap *bitmap, + __in_opt CONST D2D1_RECT_F *destinationRectangle = NULL, + FLOAT opacity = 1.0f, + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR, + __in_opt CONST D2D1_RECT_F *sourceRectangle = NULL + ) PURE; + + + // + // Draws the text within the given layout rectangle and by default also snaps and + // clips it to the content bounds. + // + STDMETHOD_(void, DrawText)( + __in_ecount(stringLength) CONST WCHAR *string, + UINT stringLength, + __in IDWriteTextFormat *textFormat, + __in CONST D2D1_RECT_F *layoutRect, + __in ID2D1Brush *defaultForegroundBrush, + D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE, + DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL + ) PURE; + + + // + // Draw a snapped text layout object. Since the layout is not subsequently changed, + // this can be more effecient than DrawText when drawing the same layout + // repeatedly. + // + STDMETHOD_(void, DrawTextLayout)( + D2D1_POINT_2F origin, + __in IDWriteTextLayout *textLayout, + __in ID2D1Brush *defaultForegroundBrush, + + // + // The specified text options. NOTE: By default the text is clipped to the layout + // bounds. This is derived from the origin and the layout bounds of the + // corresponding IDWriteTextLayout object. + // + D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE + ) PURE; + + STDMETHOD_(void, DrawGlyphRun)( + D2D1_POINT_2F baselineOrigin, + __in CONST DWRITE_GLYPH_RUN *glyphRun, + __in ID2D1Brush *foregroundBrush, + DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL + ) PURE; + + STDMETHOD_(void, SetTransform)( + __in CONST D2D1_MATRIX_3X2_F *transform + ) PURE; + + STDMETHOD_(void, GetTransform)( + __out D2D1_MATRIX_3X2_F *transform + ) CONST PURE; + + STDMETHOD_(void, SetAntialiasMode)( + D2D1_ANTIALIAS_MODE antialiasMode + ) PURE; + + STDMETHOD_(D2D1_ANTIALIAS_MODE, GetAntialiasMode)( + ) CONST PURE; + + STDMETHOD_(void, SetTextAntialiasMode)( + D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode + ) PURE; + + STDMETHOD_(D2D1_TEXT_ANTIALIAS_MODE, GetTextAntialiasMode)( + ) CONST PURE; + + STDMETHOD_(void, SetTextRenderingParams)( + __in_opt IDWriteRenderingParams *textRenderingParams = NULL + ) PURE; + + + // + // Retrieve the text render parameters. NOTE: If NULL is specified to + // SetTextRenderingParameters, NULL will be returned. + // + STDMETHOD_(void, GetTextRenderingParams)( + __deref_out_opt IDWriteRenderingParams **textRenderingParams + ) CONST PURE; + + + // + // Set a tag to correspond to the succeeding primitives. If an error occurs + // rendering a primtive, the tags can be returned from the Flush or EndDraw call. + // + STDMETHOD_(void, SetTags)( + D2D1_TAG tag1, + D2D1_TAG tag2 + ) PURE; + + + // + // Retrieves the currently set tags. This does not retrieve the tags corresponding + // to any primitive that is in error. + // + STDMETHOD_(void, GetTags)( + __out_opt D2D1_TAG *tag1 = NULL, + __out_opt D2D1_TAG *tag2 = NULL + ) CONST PURE; + + + // + // Start a layer of drawing calls. The way in which the layer must be resolved is + // specified first as well as the logical resource that stores the layer + // parameters. The supplied layer resource might grow if the specified content + // cannot fit inside it. The layer will grow monitonically on each axis. + // + STDMETHOD_(void, PushLayer)( + __in CONST D2D1_LAYER_PARAMETERS *layerParameters, + __in ID2D1Layer *layer + ) PURE; + + + // + // Ends a layer that was defined with particular layer resources. + // + STDMETHOD_(void, PopLayer)( + ) PURE; + + STDMETHOD(Flush)( + __out_opt D2D1_TAG *tag1 = NULL, + __out_opt D2D1_TAG *tag2 = NULL + ) PURE; + + + // + // Gets the current drawing state and saves it into the supplied + // IDrawingStatckBlock. + // + STDMETHOD_(void, SaveDrawingState)( + __inout ID2D1DrawingStateBlock *drawingStateBlock + ) CONST PURE; + + + // + // Copies the state stored in the block interface. + // + STDMETHOD_(void, RestoreDrawingState)( + __in ID2D1DrawingStateBlock *drawingStateBlock + ) PURE; + + + // + // Pushes a clip. The clip can be antialiased. The clip must be axis aligned. If + // the current world transform is not axis preserving, then the bounding box of the + // transformed clip rect will be used. The clip will remain in effect until a + // PopAxisAligned clip call is made. + // + STDMETHOD_(void, PushAxisAlignedClip)( + __in CONST D2D1_RECT_F *clipRect, + D2D1_ANTIALIAS_MODE antialiasMode + ) PURE; + + STDMETHOD_(void, PopAxisAlignedClip)( + ) PURE; + + STDMETHOD_(void, Clear)( + __in_opt CONST D2D1_COLOR_F *clearColor = NULL + ) PURE; + + + // + // Start drawing on this render target. Draw calls can only be issued between a + // BeginDraw and EndDraw call. + // + STDMETHOD_(void, BeginDraw)( + ) PURE; + + + // + // Ends drawing on the render target, error results can be retrieved at this time, + // or when calling flush. + // + STDMETHOD(EndDraw)( + __out_opt D2D1_TAG *tag1 = NULL, + __out_opt D2D1_TAG *tag2 = NULL + ) PURE; + + STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)( + ) CONST PURE; + + + // + // Sets the DPI on the render target. This results in the render target being + // interpretted to a different scale. Neither DPI can be negative. If zero is + // specified for both, the system DPI is chosen. If one is zero and the other + // unspecified, the DPI is not changed. + // + STDMETHOD_(void, SetDpi)( + FLOAT dpiX, + FLOAT dpiY + ) PURE; + + + // + // Return the current DPI from the target. + // + STDMETHOD_(void, GetDpi)( + __out FLOAT *dpiX, + __out FLOAT *dpiY + ) CONST PURE; + + + // + // Returns the size of the render target in DIPs. + // + STDMETHOD_(D2D1_SIZE_F, GetSize)( + ) CONST PURE; + + + // + // Returns the size of the render target in pixels. + // + STDMETHOD_(D2D1_SIZE_U, GetPixelSize)( + ) CONST PURE; + + + // + // Returns the maximum bitmap and render target size that is guaranteed to be + // supported by the render target. + // + STDMETHOD_(UINT32, GetMaximumBitmapSize)( + ) CONST PURE; + + + // + // Returns true if the given properties are supported by this render target. The + // DPI is ignored. NOTE: If the render target type is software, then neither + // D2D1_FEATURE_LEVEL_9 nor D2D1_FEATURE_LEVEL_10 will be considered to be + // supported. + // + STDMETHOD_(BOOL, IsSupported)( + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties + ) CONST PURE; + + HRESULT + CreateBitmap( + D2D1_SIZE_U size, + __in_opt CONST void *srcData, + UINT32 pitch, + CONST D2D1_BITMAP_PROPERTIES &bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) + { + return CreateBitmap(size, srcData, pitch, &bitmapProperties, bitmap); + } + + HRESULT + CreateBitmap( + D2D1_SIZE_U size, + CONST D2D1_BITMAP_PROPERTIES &bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) + { + return CreateBitmap(size, NULL, 0, &bitmapProperties, bitmap); + } + + + // + // Create a D2D bitmap by copying a WIC bitmap. + // + HRESULT + CreateBitmapFromWicBitmap( + __in IWICBitmapSource *wicBitmapSource, + CONST D2D1_BITMAP_PROPERTIES &bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) + { + return CreateBitmapFromWicBitmap(wicBitmapSource, &bitmapProperties, bitmap); + } + + + // + // Create a D2D bitmap by copying a WIC bitmap. + // + HRESULT + CreateBitmapFromWicBitmap( + __in IWICBitmapSource *wicBitmapSource, + __deref_out ID2D1Bitmap **bitmap + ) + { + return CreateBitmapFromWicBitmap(wicBitmapSource, NULL, bitmap); + } + + + // + // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill + // or pen a geometry. + // + HRESULT + CreateBitmapBrush( + __in ID2D1Bitmap *bitmap, + __deref_out ID2D1BitmapBrush **bitmapBrush + ) + { + return CreateBitmapBrush(bitmap, NULL, NULL, bitmapBrush); + } + + + // + // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill + // or pen a geometry. + // + HRESULT + CreateBitmapBrush( + __in ID2D1Bitmap *bitmap, + CONST D2D1_BITMAP_BRUSH_PROPERTIES &bitmapBrushProperties, + __deref_out ID2D1BitmapBrush **bitmapBrush + ) + { + return CreateBitmapBrush(bitmap, &bitmapBrushProperties, NULL, bitmapBrush); + } + + + // + // Creates a bitmap brush. The bitmap is scaled, rotated, skewed or tiled to fill + // or pen a geometry. + // + HRESULT + CreateBitmapBrush( + __in ID2D1Bitmap *bitmap, + CONST D2D1_BITMAP_BRUSH_PROPERTIES &bitmapBrushProperties, + CONST D2D1_BRUSH_PROPERTIES &brushProperties, + __deref_out ID2D1BitmapBrush **bitmapBrush + ) + { + return CreateBitmapBrush(bitmap, &bitmapBrushProperties, &brushProperties, bitmapBrush); + } + + HRESULT + CreateSolidColorBrush( + CONST D2D1_COLOR_F &color, + __deref_out ID2D1SolidColorBrush **solidColorBrush + ) + { + return CreateSolidColorBrush(&color, NULL, solidColorBrush); + } + + HRESULT + CreateSolidColorBrush( + CONST D2D1_COLOR_F &color, + CONST D2D1_BRUSH_PROPERTIES &brushProperties, + __deref_out ID2D1SolidColorBrush **solidColorBrush + ) + { + return CreateSolidColorBrush(&color, &brushProperties, solidColorBrush); + } + + HRESULT + CreateGradientStopCollection( + __in_ecount(gradientStopsCount) CONST D2D1_GRADIENT_STOP *gradientStops, + UINT gradientStopsCount, + __deref_out ID2D1GradientStopCollection **gradientStopCollection + ) + { + return CreateGradientStopCollection(gradientStops, gradientStopsCount, D2D1_GAMMA_2_2, D2D1_EXTEND_MODE_CLAMP, gradientStopCollection); + } + + HRESULT + CreateLinearGradientBrush( + CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES &linearGradientBrushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1LinearGradientBrush **linearGradientBrush + ) + { + return CreateLinearGradientBrush(&linearGradientBrushProperties, NULL, gradientStopCollection, linearGradientBrush); + } + + HRESULT + CreateLinearGradientBrush( + CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES &linearGradientBrushProperties, + CONST D2D1_BRUSH_PROPERTIES &brushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1LinearGradientBrush **linearGradientBrush + ) + { + return CreateLinearGradientBrush(&linearGradientBrushProperties, &brushProperties, gradientStopCollection, linearGradientBrush); + } + + HRESULT + CreateRadialGradientBrush( + CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES &radialGradientBrushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1RadialGradientBrush **radialGradientBrush + ) + { + return CreateRadialGradientBrush(&radialGradientBrushProperties, NULL, gradientStopCollection, radialGradientBrush); + } + + HRESULT + CreateRadialGradientBrush( + CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES &radialGradientBrushProperties, + CONST D2D1_BRUSH_PROPERTIES &brushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1RadialGradientBrush **radialGradientBrush + ) + { + return CreateRadialGradientBrush(&radialGradientBrushProperties, &brushProperties, gradientStopCollection, radialGradientBrush); + } + + HRESULT + CreateCompatibleRenderTarget( + __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget + ) + { + return CreateCompatibleRenderTarget(NULL, NULL, NULL, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget); + } + + HRESULT + CreateCompatibleRenderTarget( + D2D1_SIZE_F desiredSize, + __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget + ) + { + return CreateCompatibleRenderTarget(&desiredSize, NULL, NULL, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget); + } + + HRESULT + CreateCompatibleRenderTarget( + D2D1_SIZE_F desiredSize, + D2D1_SIZE_U desiredPixelSize, + __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget + ) + { + return CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, NULL, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget); + } + + HRESULT + CreateCompatibleRenderTarget( + D2D1_SIZE_F desiredSize, + D2D1_SIZE_U desiredPixelSize, + D2D1_PIXEL_FORMAT desiredFormat, + __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget + ) + { + return CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, &desiredFormat, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, bitmapRenderTarget); + } + + HRESULT + CreateCompatibleRenderTarget( + D2D1_SIZE_F desiredSize, + D2D1_SIZE_U desiredPixelSize, + D2D1_PIXEL_FORMAT desiredFormat, + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options, + __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget + ) + { + return CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, &desiredFormat, options, bitmapRenderTarget); + } + + HRESULT + CreateLayer( + D2D1_SIZE_F size, + __deref_out ID2D1Layer **layer + ) + { + return CreateLayer(&size, layer); + } + + HRESULT + CreateLayer( + __deref_out ID2D1Layer **layer + ) + { + return CreateLayer(NULL, layer); + } + + void + DrawRectangle( + CONST D2D1_RECT_F &rect, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) + { + DrawRectangle(&rect, brush, strokeWidth, strokeStyle); + } + + void + FillRectangle( + CONST D2D1_RECT_F &rect, + __in ID2D1Brush *brush + ) + { + FillRectangle(&rect, brush); + } + + void + DrawRoundedRectangle( + CONST D2D1_ROUNDED_RECT &roundedRect, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) + { + DrawRoundedRectangle(&roundedRect, brush, strokeWidth, strokeStyle); + } + + void + FillRoundedRectangle( + CONST D2D1_ROUNDED_RECT &roundedRect, + __in ID2D1Brush *brush + ) + { + FillRoundedRectangle(&roundedRect, brush); + } + + void + DrawEllipse( + CONST D2D1_ELLIPSE &ellipse, + __in ID2D1Brush *brush, + FLOAT strokeWidth = 1.0f, + __in_opt ID2D1StrokeStyle *strokeStyle = NULL + ) + { + DrawEllipse(&ellipse, brush, strokeWidth, strokeStyle); + } + + void + FillEllipse( + CONST D2D1_ELLIPSE &ellipse, + __in ID2D1Brush *brush + ) + { + FillEllipse(&ellipse, brush); + } + + void + FillOpacityMask( + __in ID2D1Bitmap *opacityMask, + __in ID2D1Brush *brush, + D2D1_OPACITY_MASK_CONTENT content, + CONST D2D1_RECT_F &destinationRectangle, + CONST D2D1_RECT_F &sourceRectangle + ) + { + FillOpacityMask(opacityMask, brush, content, &destinationRectangle, &sourceRectangle); + } + + void + DrawBitmap( + __in ID2D1Bitmap *bitmap, + CONST D2D1_RECT_F &destinationRectangle, + FLOAT opacity = 1.0f, + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR, + __in_opt CONST D2D1_RECT_F *sourceRectangle = NULL + ) + { + DrawBitmap(bitmap, &destinationRectangle, opacity, interpolationMode, sourceRectangle); + } + + void + DrawBitmap( + __in ID2D1Bitmap *bitmap, + CONST D2D1_RECT_F &destinationRectangle, + FLOAT opacity, + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode, + CONST D2D1_RECT_F &sourceRectangle + ) + { + DrawBitmap(bitmap, &destinationRectangle, opacity, interpolationMode, &sourceRectangle); + } + + void + SetTransform( + CONST D2D1_MATRIX_3X2_F &transform + ) + { + SetTransform(&transform); + } + + void + PushLayer( + CONST D2D1_LAYER_PARAMETERS &layerParameters, + __in ID2D1Layer *layer + ) + { + PushLayer(&layerParameters, layer); + } + + void + PushAxisAlignedClip( + CONST D2D1_RECT_F &clipRect, + D2D1_ANTIALIAS_MODE antialiasMode + ) + { + return PushAxisAlignedClip(&clipRect, antialiasMode); + } + + void + Clear( + CONST D2D1_COLOR_F &clearColor + ) + { + return Clear(&clearColor); + } + + + // + // Draws the text within the given layout rectangle and by default also snaps and + // clips it. + // + void + DrawText( + __in_ecount(stringLength) CONST WCHAR *string, + UINT stringLength, + __in IDWriteTextFormat *textFormat, + CONST D2D1_RECT_F &layoutRect, + __in ID2D1Brush *defaultForegroundBrush, + D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE, + DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL + ) + { + return DrawText(string, stringLength, textFormat, &layoutRect, defaultForegroundBrush, options, measuringMode); + } + + BOOL + IsSupported( + CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties + ) CONST + { + return IsSupported(&renderTargetProperties); + } +}; // interface ID2D1RenderTarget + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1BitmapRenderTarget +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd90695-12e2-11dc-9fed-001143a055f9") ID2D1BitmapRenderTarget : public ID2D1RenderTarget +{ + + STDMETHOD(GetBitmap)( + __deref_out ID2D1Bitmap **bitmap + ) PURE; +}; // interface ID2D1BitmapRenderTarget + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1HwndRenderTarget +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("2cd90698-12e2-11dc-9fed-001143a055f9") ID2D1HwndRenderTarget : public ID2D1RenderTarget +{ + + STDMETHOD_(D2D1_WINDOW_STATE, CheckWindowState)( + ) PURE; + + + // + // Resize the buffer underlying the render target. This operation might fail if + // there is insufficent video memory or system memory, or if the render target is + // resized beyond the maximum bitmap size. If the method fails, the render target + // will be placed in a zombie state and D2DERR_RECREATE_TARGET will be returned + // from it when EndDraw is called. In addition an appropriate failure result will + // be returned from Resize. + // + STDMETHOD(Resize)( + __in CONST D2D1_SIZE_U *pixelSize + ) PURE; + + STDMETHOD_(HWND, GetHwnd)( + ) CONST PURE; + + HRESULT + Resize( + CONST D2D1_SIZE_U &pixelSize + ) + { + return Resize(&pixelSize); + } +}; // interface ID2D1HwndRenderTarget + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1GdiInteropRenderTarget +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("e0db51c3-6f77-4bae-b3d5-e47509b35838") ID2D1GdiInteropRenderTarget : public IUnknown +{ + + STDMETHOD(GetDC)( + D2D1_DC_INITIALIZE_MODE mode, + __out HDC *hdc + ) PURE; + + STDMETHOD(ReleaseDC)( + __in_opt CONST RECT *update + ) PURE; +}; // interface ID2D1GdiInteropRenderTarget + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1DCRenderTarget +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("1c51bc64-de61-46fd-9899-63a5d8f03950") ID2D1DCRenderTarget : public ID2D1RenderTarget +{ + + STDMETHOD(BindDC)( + __in CONST HDC hDC, + __in CONST RECT *pSubRect + ) PURE; +}; // interface ID2D1DCRenderTarget + + + +//+----------------------------------------------------------------------------- +// +// Interface: +// ID2D1Factory +// +// Synopsis: +// The root factory interface for all of D2D's objects. +// +//------------------------------------------------------------------------------ +interface D2D1_DECLARE_INTERFACE("06152247-6f50-465a-9245-118bfd3b6007") ID2D1Factory : public IUnknown +{ + + + // + // Cause the factory to refresh any system metrics that it might have been snapped + // on factory creation. + // + STDMETHOD(ReloadSystemMetrics)( + ) PURE; + + + // + // Retrieves the current desktop DPI. To refresh this, call ReloadSystemMetrics. + // + STDMETHOD_(void, GetDesktopDpi)( + __out FLOAT *dpiX, + __out FLOAT *dpiY + ) PURE; + + STDMETHOD(CreateRectangleGeometry)( + __in CONST D2D1_RECT_F *rectangle, + __deref_out ID2D1RectangleGeometry **rectangleGeometry + ) PURE; + + STDMETHOD(CreateRoundedRectangleGeometry)( + __in CONST D2D1_ROUNDED_RECT *roundedRectangle, + __deref_out ID2D1RoundedRectangleGeometry **roundedRectangleGeometry + ) PURE; + + STDMETHOD(CreateEllipseGeometry)( + __in CONST D2D1_ELLIPSE *ellipse, + __deref_out ID2D1EllipseGeometry **ellipseGeometry + ) PURE; + + + // + // Create a geometry which holds other geometries. + // + STDMETHOD(CreateGeometryGroup)( + D2D1_FILL_MODE fillMode, + __in_ecount(geometriesCount) ID2D1Geometry **geometries, + UINT geometriesCount, + __deref_out ID2D1GeometryGroup **geometryGroup + ) PURE; + + STDMETHOD(CreateTransformedGeometry)( + __in ID2D1Geometry *sourceGeometry, + __in CONST D2D1_MATRIX_3X2_F *transform, + __deref_out ID2D1TransformedGeometry **transformedGeometry + ) PURE; + + + // + // Returns an initially empty path geometry interface. A geometry sink is created + // off the interface to populate it. + // + STDMETHOD(CreatePathGeometry)( + __deref_out ID2D1PathGeometry **pathGeometry + ) PURE; + + + // + // Allows a non-default stroke style to be specified for a given geometry at draw + // time. + // + STDMETHOD(CreateStrokeStyle)( + __in CONST D2D1_STROKE_STYLE_PROPERTIES *strokeStyleProperties, + __in_ecount_opt(dashesCount) CONST FLOAT *dashes, + UINT dashesCount, + __deref_out ID2D1StrokeStyle **strokeStyle + ) PURE; + + + // + // Creates a new drawing state block, this can be used in subsequent + // SaveDrawingState and RestoreDrawingState operations on the render target. + // + STDMETHOD(CreateDrawingStateBlock)( + __in_opt CONST D2D1_DRAWING_STATE_DESCRIPTION *drawingStateDescription, + __in_opt IDWriteRenderingParams *textRenderingParams, + __deref_out ID2D1DrawingStateBlock **drawingStateBlock + ) PURE; + + + // + // Creates a render target which is a source of bitmaps. + // + STDMETHOD(CreateWicBitmapRenderTarget)( + __in IWICBitmap *target, + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __deref_out ID2D1RenderTarget **renderTarget + ) PURE; + + + // + // Creates a render target that appears on the display. + // + STDMETHOD(CreateHwndRenderTarget)( + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __in CONST D2D1_HWND_RENDER_TARGET_PROPERTIES *hwndRenderTargetProperties, + __deref_out ID2D1HwndRenderTarget **hwndRenderTarget + ) PURE; + + + // + // Creates a render target that draws to a DXGI Surface. The device that owns the + // surface is used for rendering. + // + STDMETHOD(CreateDxgiSurfaceRenderTarget)( + __in IDXGISurface *dxgiSurface, + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __deref_out ID2D1RenderTarget **renderTarget + ) PURE; + + + // + // Creates a render target that draws to a GDI device context. + // + STDMETHOD(CreateDCRenderTarget)( + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __deref_out ID2D1DCRenderTarget **dcRenderTarget + ) PURE; + + HRESULT + CreateRectangleGeometry( + CONST D2D1_RECT_F &rectangle, + __deref_out ID2D1RectangleGeometry **rectangleGeometry + ) + { + return CreateRectangleGeometry(&rectangle, rectangleGeometry); + } + + HRESULT + CreateRoundedRectangleGeometry( + CONST D2D1_ROUNDED_RECT &roundedRectangle, + __deref_out ID2D1RoundedRectangleGeometry **roundedRectangleGeometry + ) + { + return CreateRoundedRectangleGeometry(&roundedRectangle, roundedRectangleGeometry); + } + + HRESULT + CreateEllipseGeometry( + CONST D2D1_ELLIPSE &ellipse, + __deref_out ID2D1EllipseGeometry **ellipseGeometry + ) + { + return CreateEllipseGeometry(&ellipse, ellipseGeometry); + } + + HRESULT + CreateTransformedGeometry( + __in ID2D1Geometry *sourceGeometry, + CONST D2D1_MATRIX_3X2_F &transform, + __deref_out ID2D1TransformedGeometry **transformedGeometry + ) + { + return CreateTransformedGeometry(sourceGeometry, &transform, transformedGeometry); + } + + HRESULT + CreateStrokeStyle( + CONST D2D1_STROKE_STYLE_PROPERTIES &strokeStyleProperties, + __in_ecount(dashesCount) CONST FLOAT *dashes, + UINT dashesCount, + __deref_out ID2D1StrokeStyle **strokeStyle + ) + { + return CreateStrokeStyle(&strokeStyleProperties, dashes, dashesCount, strokeStyle); + } + + HRESULT + CreateDrawingStateBlock( + CONST D2D1_DRAWING_STATE_DESCRIPTION &drawingStateDescription, + __deref_out ID2D1DrawingStateBlock **drawingStateBlock + ) + { + return CreateDrawingStateBlock(&drawingStateDescription, NULL, drawingStateBlock); + } + + HRESULT + CreateDrawingStateBlock( + __deref_out ID2D1DrawingStateBlock **drawingStateBlock + ) + { + return CreateDrawingStateBlock(NULL, NULL, drawingStateBlock); + } + + HRESULT + CreateWicBitmapRenderTarget( + __in IWICBitmap *target, + CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties, + __deref_out ID2D1RenderTarget **renderTarget + ) + { + return CreateWicBitmapRenderTarget(target, &renderTargetProperties, renderTarget); + } + + HRESULT + CreateHwndRenderTarget( + CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties, + CONST D2D1_HWND_RENDER_TARGET_PROPERTIES &hwndRenderTargetProperties, + __deref_out ID2D1HwndRenderTarget **hwndRenderTarget + ) + { + return CreateHwndRenderTarget(&renderTargetProperties, &hwndRenderTargetProperties, hwndRenderTarget); + } + + HRESULT + CreateDxgiSurfaceRenderTarget( + __in IDXGISurface *dxgiSurface, + CONST D2D1_RENDER_TARGET_PROPERTIES &renderTargetProperties, + __deref_out ID2D1RenderTarget **renderTarget + ) + { + return CreateDxgiSurfaceRenderTarget(dxgiSurface, &renderTargetProperties, renderTarget); + } +}; // interface ID2D1Factory + + + +#endif + + +EXTERN_C CONST IID IID_ID2D1Resource; +EXTERN_C CONST IID IID_ID2D1Bitmap; +EXTERN_C CONST IID IID_ID2D1GradientStopCollection; +EXTERN_C CONST IID IID_ID2D1Brush; +EXTERN_C CONST IID IID_ID2D1BitmapBrush; +EXTERN_C CONST IID IID_ID2D1SolidColorBrush; +EXTERN_C CONST IID IID_ID2D1LinearGradientBrush; +EXTERN_C CONST IID IID_ID2D1RadialGradientBrush; +EXTERN_C CONST IID IID_ID2D1StrokeStyle; +EXTERN_C CONST IID IID_ID2D1Geometry; +EXTERN_C CONST IID IID_ID2D1RectangleGeometry; +EXTERN_C CONST IID IID_ID2D1RoundedRectangleGeometry; +EXTERN_C CONST IID IID_ID2D1EllipseGeometry; +EXTERN_C CONST IID IID_ID2D1GeometryGroup; +EXTERN_C CONST IID IID_ID2D1TransformedGeometry; +EXTERN_C CONST IID IID_ID2D1SimplifiedGeometrySink; +EXTERN_C CONST IID IID_ID2D1GeometrySink; +EXTERN_C CONST IID IID_ID2D1TessellationSink; +EXTERN_C CONST IID IID_ID2D1PathGeometry; +EXTERN_C CONST IID IID_ID2D1Mesh; +EXTERN_C CONST IID IID_ID2D1Layer; +EXTERN_C CONST IID IID_ID2D1DrawingStateBlock; +EXTERN_C CONST IID IID_ID2D1RenderTarget; +EXTERN_C CONST IID IID_ID2D1BitmapRenderTarget; +EXTERN_C CONST IID IID_ID2D1HwndRenderTarget; +EXTERN_C CONST IID IID_ID2D1GdiInteropRenderTarget; +EXTERN_C CONST IID IID_ID2D1DCRenderTarget; +EXTERN_C CONST IID IID_ID2D1Factory; + + +#ifdef D2D_USE_C_DEFINITIONS + + +typedef interface ID2D1Resource ID2D1Resource; + +typedef struct ID2D1ResourceVtbl +{ + + IUnknownVtbl Base; + + + STDMETHOD_(void, GetFactory)( + ID2D1Resource *This, + __deref_out ID2D1Factory **factory + ) PURE; +} ID2D1ResourceVtbl; + +interface ID2D1Resource +{ + CONST struct ID2D1ResourceVtbl *lpVtbl; +}; + + +#define ID2D1Resource_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1Resource_AddRef(This) \ + ((This)->lpVtbl->Base.AddRef((IUnknown *)This)) + +#define ID2D1Resource_Release(This) \ + ((This)->lpVtbl->Base.Release((IUnknown *)This)) + +#define ID2D1Resource_GetFactory(This, factory) \ + ((This)->lpVtbl->GetFactory(This, factory)) + +typedef interface ID2D1Bitmap ID2D1Bitmap; + +typedef struct ID2D1BitmapVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD_(D2D1_SIZE_F, GetSize)( + ID2D1Bitmap *This + ) PURE; + + STDMETHOD_(D2D1_SIZE_U, GetPixelSize)( + ID2D1Bitmap *This + ) PURE; + + STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)( + ID2D1Bitmap *This + ) PURE; + + STDMETHOD_(void, GetDpi)( + ID2D1Bitmap *This, + __out FLOAT *dpiX, + __out FLOAT *dpiY + ) PURE; + + STDMETHOD(CopyFromBitmap)( + ID2D1Bitmap *This, + __in_opt CONST D2D1_POINT_2U *destPoint, + __in ID2D1Bitmap *bitmap, + __in_opt CONST D2D1_RECT_U *srcRect + ) PURE; + + STDMETHOD(CopyFromRenderTarget)( + ID2D1Bitmap *This, + __in_opt CONST D2D1_POINT_2U *destPoint, + __in ID2D1RenderTarget *renderTarget, + __in_opt CONST D2D1_RECT_U *srcRect + ) PURE; + + STDMETHOD(CopyFromMemory)( + ID2D1Bitmap *This, + __in_opt CONST D2D1_RECT_U *dstRect, + __in CONST void *srcData, + UINT32 pitch + ) PURE; +} ID2D1BitmapVtbl; + +interface ID2D1Bitmap +{ + CONST struct ID2D1BitmapVtbl *lpVtbl; +}; + + +#define ID2D1Bitmap_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1Bitmap_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1Bitmap_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1Bitmap_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1Bitmap_GetSize(This) \ + ((This)->lpVtbl->GetSize(This)) + +#define ID2D1Bitmap_GetPixelSize(This) \ + ((This)->lpVtbl->GetPixelSize(This)) + +#define ID2D1Bitmap_GetPixelFormat(This) \ + ((This)->lpVtbl->GetPixelFormat(This)) + +#define ID2D1Bitmap_GetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->GetDpi(This, dpiX, dpiY)) + +#define ID2D1Bitmap_CopyFromBitmap(This, destPoint, bitmap, srcRect) \ + ((This)->lpVtbl->CopyFromBitmap(This, destPoint, bitmap, srcRect)) + +#define ID2D1Bitmap_CopyFromRenderTarget(This, destPoint, renderTarget, srcRect) \ + ((This)->lpVtbl->CopyFromRenderTarget(This, destPoint, renderTarget, srcRect)) + +#define ID2D1Bitmap_CopyFromMemory(This, dstRect, srcData, pitch) \ + ((This)->lpVtbl->CopyFromMemory(This, dstRect, srcData, pitch)) + +typedef interface ID2D1GradientStopCollection ID2D1GradientStopCollection; + +typedef struct ID2D1GradientStopCollectionVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD_(UINT32, GetGradientStopCount)( + ID2D1GradientStopCollection *This + ) PURE; + + STDMETHOD_(void, GetGradientStops)( + ID2D1GradientStopCollection *This, + __out_ecount(gradientStopsCount) D2D1_GRADIENT_STOP *gradientStops, + UINT gradientStopsCount + ) PURE; + + STDMETHOD_(D2D1_GAMMA, GetColorInterpolationGamma)( + ID2D1GradientStopCollection *This + ) PURE; + + STDMETHOD_(D2D1_EXTEND_MODE, GetExtendMode)( + ID2D1GradientStopCollection *This + ) PURE; +} ID2D1GradientStopCollectionVtbl; + +interface ID2D1GradientStopCollection +{ + CONST struct ID2D1GradientStopCollectionVtbl *lpVtbl; +}; + + +#define ID2D1GradientStopCollection_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1GradientStopCollection_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1GradientStopCollection_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1GradientStopCollection_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1GradientStopCollection_GetGradientStopCount(This) \ + ((This)->lpVtbl->GetGradientStopCount(This)) + +#define ID2D1GradientStopCollection_GetGradientStops(This, gradientStops, gradientStopsCount) \ + ((This)->lpVtbl->GetGradientStops(This, gradientStops, gradientStopsCount)) + +#define ID2D1GradientStopCollection_GetColorInterpolationGamma(This) \ + ((This)->lpVtbl->GetColorInterpolationGamma(This)) + +#define ID2D1GradientStopCollection_GetExtendMode(This) \ + ((This)->lpVtbl->GetExtendMode(This)) + +typedef interface ID2D1Brush ID2D1Brush; + +typedef struct ID2D1BrushVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD_(void, SetOpacity)( + ID2D1Brush *This, + FLOAT opacity + ) PURE; + + STDMETHOD_(void, SetTransform)( + ID2D1Brush *This, + __in CONST D2D1_MATRIX_3X2_F *transform + ) PURE; + + STDMETHOD_(FLOAT, GetOpacity)( + ID2D1Brush *This + ) PURE; + + STDMETHOD_(void, GetTransform)( + ID2D1Brush *This, + __out D2D1_MATRIX_3X2_F *transform + ) PURE; +} ID2D1BrushVtbl; + +interface ID2D1Brush +{ + CONST struct ID2D1BrushVtbl *lpVtbl; +}; + + +#define ID2D1Brush_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1Brush_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1Brush_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1Brush_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1Brush_SetOpacity(This, opacity) \ + ((This)->lpVtbl->SetOpacity(This, opacity)) + +#define ID2D1Brush_SetTransform(This, transform) \ + ((This)->lpVtbl->SetTransform(This, transform)) + +#define ID2D1Brush_GetOpacity(This) \ + ((This)->lpVtbl->GetOpacity(This)) + +#define ID2D1Brush_GetTransform(This, transform) \ + ((This)->lpVtbl->GetTransform(This, transform)) + +typedef interface ID2D1BitmapBrush ID2D1BitmapBrush; + +typedef struct ID2D1BitmapBrushVtbl +{ + + ID2D1BrushVtbl Base; + + + STDMETHOD_(void, SetExtendModeX)( + ID2D1BitmapBrush *This, + D2D1_EXTEND_MODE extendModeX + ) PURE; + + STDMETHOD_(void, SetExtendModeY)( + ID2D1BitmapBrush *This, + D2D1_EXTEND_MODE extendModeY + ) PURE; + + STDMETHOD_(void, SetInterpolationMode)( + ID2D1BitmapBrush *This, + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode + ) PURE; + + STDMETHOD_(void, SetBitmap)( + ID2D1BitmapBrush *This, + __in ID2D1Bitmap *bitmap + ) PURE; + + STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeX)( + ID2D1BitmapBrush *This + ) PURE; + + STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeY)( + ID2D1BitmapBrush *This + ) PURE; + + STDMETHOD_(D2D1_BITMAP_INTERPOLATION_MODE, GetInterpolationMode)( + ID2D1BitmapBrush *This + ) PURE; + + STDMETHOD_(void, GetBitmap)( + ID2D1BitmapBrush *This, + __deref_out ID2D1Bitmap **bitmap + ) PURE; +} ID2D1BitmapBrushVtbl; + +interface ID2D1BitmapBrush +{ + CONST struct ID2D1BitmapBrushVtbl *lpVtbl; +}; + + +#define ID2D1BitmapBrush_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1BitmapBrush_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1BitmapBrush_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1BitmapBrush_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1BitmapBrush_SetOpacity(This, opacity) \ + ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity)) + +#define ID2D1BitmapBrush_SetTransform(This, transform) \ + ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1BitmapBrush_GetOpacity(This) \ + ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This)) + +#define ID2D1BitmapBrush_GetTransform(This, transform) \ + ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1BitmapBrush_SetExtendModeX(This, extendModeX) \ + ((This)->lpVtbl->SetExtendModeX(This, extendModeX)) + +#define ID2D1BitmapBrush_SetExtendModeY(This, extendModeY) \ + ((This)->lpVtbl->SetExtendModeY(This, extendModeY)) + +#define ID2D1BitmapBrush_SetInterpolationMode(This, interpolationMode) \ + ((This)->lpVtbl->SetInterpolationMode(This, interpolationMode)) + +#define ID2D1BitmapBrush_SetBitmap(This, bitmap) \ + ((This)->lpVtbl->SetBitmap(This, bitmap)) + +#define ID2D1BitmapBrush_GetExtendModeX(This) \ + ((This)->lpVtbl->GetExtendModeX(This)) + +#define ID2D1BitmapBrush_GetExtendModeY(This) \ + ((This)->lpVtbl->GetExtendModeY(This)) + +#define ID2D1BitmapBrush_GetInterpolationMode(This) \ + ((This)->lpVtbl->GetInterpolationMode(This)) + +#define ID2D1BitmapBrush_GetBitmap(This, bitmap) \ + ((This)->lpVtbl->GetBitmap(This, bitmap)) + +typedef interface ID2D1SolidColorBrush ID2D1SolidColorBrush; + +typedef struct ID2D1SolidColorBrushVtbl +{ + + ID2D1BrushVtbl Base; + + + STDMETHOD_(void, SetColor)( + ID2D1SolidColorBrush *This, + __in CONST D2D1_COLOR_F *color + ) PURE; + + STDMETHOD_(D2D1_COLOR_F, GetColor)( + ID2D1SolidColorBrush *This + ) PURE; +} ID2D1SolidColorBrushVtbl; + +interface ID2D1SolidColorBrush +{ + CONST struct ID2D1SolidColorBrushVtbl *lpVtbl; +}; + + +#define ID2D1SolidColorBrush_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1SolidColorBrush_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1SolidColorBrush_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1SolidColorBrush_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1SolidColorBrush_SetOpacity(This, opacity) \ + ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity)) + +#define ID2D1SolidColorBrush_SetTransform(This, transform) \ + ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1SolidColorBrush_GetOpacity(This) \ + ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This)) + +#define ID2D1SolidColorBrush_GetTransform(This, transform) \ + ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1SolidColorBrush_SetColor(This, color) \ + ((This)->lpVtbl->SetColor(This, color)) + +#define ID2D1SolidColorBrush_GetColor(This) \ + ((This)->lpVtbl->GetColor(This)) + +typedef interface ID2D1LinearGradientBrush ID2D1LinearGradientBrush; + +typedef struct ID2D1LinearGradientBrushVtbl +{ + + ID2D1BrushVtbl Base; + + + STDMETHOD_(void, SetStartPoint)( + ID2D1LinearGradientBrush *This, + D2D1_POINT_2F startPoint + ) PURE; + + STDMETHOD_(void, SetEndPoint)( + ID2D1LinearGradientBrush *This, + D2D1_POINT_2F endPoint + ) PURE; + + STDMETHOD_(D2D1_POINT_2F, GetStartPoint)( + ID2D1LinearGradientBrush *This + ) PURE; + + STDMETHOD_(D2D1_POINT_2F, GetEndPoint)( + ID2D1LinearGradientBrush *This + ) PURE; + + STDMETHOD_(void, GetGradientStopCollection)( + ID2D1LinearGradientBrush *This, + __deref_out ID2D1GradientStopCollection **gradientStopCollection + ) PURE; +} ID2D1LinearGradientBrushVtbl; + +interface ID2D1LinearGradientBrush +{ + CONST struct ID2D1LinearGradientBrushVtbl *lpVtbl; +}; + + +#define ID2D1LinearGradientBrush_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1LinearGradientBrush_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1LinearGradientBrush_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1LinearGradientBrush_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1LinearGradientBrush_SetOpacity(This, opacity) \ + ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity)) + +#define ID2D1LinearGradientBrush_SetTransform(This, transform) \ + ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1LinearGradientBrush_GetOpacity(This) \ + ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This)) + +#define ID2D1LinearGradientBrush_GetTransform(This, transform) \ + ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1LinearGradientBrush_SetStartPoint(This, startPoint) \ + ((This)->lpVtbl->SetStartPoint(This, startPoint)) + +#define ID2D1LinearGradientBrush_SetEndPoint(This, endPoint) \ + ((This)->lpVtbl->SetEndPoint(This, endPoint)) + +#define ID2D1LinearGradientBrush_GetStartPoint(This) \ + ((This)->lpVtbl->GetStartPoint(This)) + +#define ID2D1LinearGradientBrush_GetEndPoint(This) \ + ((This)->lpVtbl->GetEndPoint(This)) + +#define ID2D1LinearGradientBrush_GetGradientStopCollection(This, gradientStopCollection) \ + ((This)->lpVtbl->GetGradientStopCollection(This, gradientStopCollection)) + +typedef interface ID2D1RadialGradientBrush ID2D1RadialGradientBrush; + +typedef struct ID2D1RadialGradientBrushVtbl +{ + + ID2D1BrushVtbl Base; + + + STDMETHOD_(void, SetCenter)( + ID2D1RadialGradientBrush *This, + D2D1_POINT_2F center + ) PURE; + + STDMETHOD_(void, SetGradientOriginOffset)( + ID2D1RadialGradientBrush *This, + D2D1_POINT_2F gradientOriginOffset + ) PURE; + + STDMETHOD_(void, SetRadiusX)( + ID2D1RadialGradientBrush *This, + FLOAT radiusX + ) PURE; + + STDMETHOD_(void, SetRadiusY)( + ID2D1RadialGradientBrush *This, + FLOAT radiusY + ) PURE; + + STDMETHOD_(D2D1_POINT_2F, GetCenter)( + ID2D1RadialGradientBrush *This + ) PURE; + + STDMETHOD_(D2D1_POINT_2F, GetGradientOriginOffset)( + ID2D1RadialGradientBrush *This + ) PURE; + + STDMETHOD_(FLOAT, GetRadiusX)( + ID2D1RadialGradientBrush *This + ) PURE; + + STDMETHOD_(FLOAT, GetRadiusY)( + ID2D1RadialGradientBrush *This + ) PURE; + + STDMETHOD_(void, GetGradientStopCollection)( + ID2D1RadialGradientBrush *This, + __deref_out ID2D1GradientStopCollection **gradientStopCollection + ) PURE; +} ID2D1RadialGradientBrushVtbl; + +interface ID2D1RadialGradientBrush +{ + CONST struct ID2D1RadialGradientBrushVtbl *lpVtbl; +}; + + +#define ID2D1RadialGradientBrush_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1RadialGradientBrush_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1RadialGradientBrush_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1RadialGradientBrush_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1RadialGradientBrush_SetOpacity(This, opacity) \ + ((This)->lpVtbl->Base.SetOpacity((ID2D1Brush *)This, opacity)) + +#define ID2D1RadialGradientBrush_SetTransform(This, transform) \ + ((This)->lpVtbl->Base.SetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1RadialGradientBrush_GetOpacity(This) \ + ((This)->lpVtbl->Base.GetOpacity((ID2D1Brush *)This)) + +#define ID2D1RadialGradientBrush_GetTransform(This, transform) \ + ((This)->lpVtbl->Base.GetTransform((ID2D1Brush *)This, transform)) + +#define ID2D1RadialGradientBrush_SetCenter(This, center) \ + ((This)->lpVtbl->SetCenter(This, center)) + +#define ID2D1RadialGradientBrush_SetGradientOriginOffset(This, gradientOriginOffset) \ + ((This)->lpVtbl->SetGradientOriginOffset(This, gradientOriginOffset)) + +#define ID2D1RadialGradientBrush_SetRadiusX(This, radiusX) \ + ((This)->lpVtbl->SetRadiusX(This, radiusX)) + +#define ID2D1RadialGradientBrush_SetRadiusY(This, radiusY) \ + ((This)->lpVtbl->SetRadiusY(This, radiusY)) + +#define ID2D1RadialGradientBrush_GetCenter(This) \ + ((This)->lpVtbl->GetCenter(This)) + +#define ID2D1RadialGradientBrush_GetGradientOriginOffset(This) \ + ((This)->lpVtbl->GetGradientOriginOffset(This)) + +#define ID2D1RadialGradientBrush_GetRadiusX(This) \ + ((This)->lpVtbl->GetRadiusX(This)) + +#define ID2D1RadialGradientBrush_GetRadiusY(This) \ + ((This)->lpVtbl->GetRadiusY(This)) + +#define ID2D1RadialGradientBrush_GetGradientStopCollection(This, gradientStopCollection) \ + ((This)->lpVtbl->GetGradientStopCollection(This, gradientStopCollection)) + +typedef interface ID2D1StrokeStyle ID2D1StrokeStyle; + +typedef struct ID2D1StrokeStyleVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD_(D2D1_CAP_STYLE, GetStartCap)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(D2D1_CAP_STYLE, GetEndCap)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(D2D1_CAP_STYLE, GetDashCap)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(FLOAT, GetMiterLimit)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(D2D1_LINE_JOIN, GetLineJoin)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(FLOAT, GetDashOffset)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(D2D1_DASH_STYLE, GetDashStyle)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(UINT32, GetDashesCount)( + ID2D1StrokeStyle *This + ) PURE; + + STDMETHOD_(void, GetDashes)( + ID2D1StrokeStyle *This, + __out_ecount(dashesCount) FLOAT *dashes, + UINT dashesCount + ) PURE; +} ID2D1StrokeStyleVtbl; + +interface ID2D1StrokeStyle +{ + CONST struct ID2D1StrokeStyleVtbl *lpVtbl; +}; + + +#define ID2D1StrokeStyle_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1StrokeStyle_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1StrokeStyle_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1StrokeStyle_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1StrokeStyle_GetStartCap(This) \ + ((This)->lpVtbl->GetStartCap(This)) + +#define ID2D1StrokeStyle_GetEndCap(This) \ + ((This)->lpVtbl->GetEndCap(This)) + +#define ID2D1StrokeStyle_GetDashCap(This) \ + ((This)->lpVtbl->GetDashCap(This)) + +#define ID2D1StrokeStyle_GetMiterLimit(This) \ + ((This)->lpVtbl->GetMiterLimit(This)) + +#define ID2D1StrokeStyle_GetLineJoin(This) \ + ((This)->lpVtbl->GetLineJoin(This)) + +#define ID2D1StrokeStyle_GetDashOffset(This) \ + ((This)->lpVtbl->GetDashOffset(This)) + +#define ID2D1StrokeStyle_GetDashStyle(This) \ + ((This)->lpVtbl->GetDashStyle(This)) + +#define ID2D1StrokeStyle_GetDashesCount(This) \ + ((This)->lpVtbl->GetDashesCount(This)) + +#define ID2D1StrokeStyle_GetDashes(This, dashes, dashesCount) \ + ((This)->lpVtbl->GetDashes(This, dashes, dashesCount)) + +typedef interface ID2D1Geometry ID2D1Geometry; + +typedef struct ID2D1GeometryVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD(GetBounds)( + ID2D1Geometry *This, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + __out D2D1_RECT_F *bounds + ) PURE; + + STDMETHOD(GetWidenedBounds)( + ID2D1Geometry *This, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out D2D1_RECT_F *bounds + ) PURE; + + STDMETHOD(StrokeContainsPoint)( + ID2D1Geometry *This, + D2D1_POINT_2F point, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out BOOL *contains + ) PURE; + + STDMETHOD(FillContainsPoint)( + ID2D1Geometry *This, + D2D1_POINT_2F point, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out BOOL *contains + ) PURE; + + STDMETHOD(CompareWithGeometry)( + ID2D1Geometry *This, + __in ID2D1Geometry *inputGeometry, + __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform, + FLOAT flatteningTolerance, + __out D2D1_GEOMETRY_RELATION *relation + ) PURE; + + STDMETHOD(Simplify)( + ID2D1Geometry *This, + D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) PURE; + + STDMETHOD(Tessellate)( + ID2D1Geometry *This, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1TessellationSink *tessellationSink + ) PURE; + + STDMETHOD(CombineWithGeometry)( + ID2D1Geometry *This, + __in ID2D1Geometry *inputGeometry, + D2D1_COMBINE_MODE combineMode, + __in_opt CONST D2D1_MATRIX_3X2_F *inputGeometryTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) PURE; + + STDMETHOD(Outline)( + ID2D1Geometry *This, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) PURE; + + STDMETHOD(ComputeArea)( + ID2D1Geometry *This, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out FLOAT *area + ) PURE; + + STDMETHOD(ComputeLength)( + ID2D1Geometry *This, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out FLOAT *length + ) PURE; + + STDMETHOD(ComputePointAtLength)( + ID2D1Geometry *This, + FLOAT length, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __out_opt D2D1_POINT_2F *point, + __out_opt D2D1_POINT_2F *unitTangentVector + ) PURE; + + STDMETHOD(Widen)( + ID2D1Geometry *This, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle, + __in_opt CONST D2D1_MATRIX_3X2_F *worldTransform, + FLOAT flatteningTolerance, + __in ID2D1SimplifiedGeometrySink *geometrySink + ) PURE; +} ID2D1GeometryVtbl; + +interface ID2D1Geometry +{ + CONST struct ID2D1GeometryVtbl *lpVtbl; +}; + + +#define ID2D1Geometry_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1Geometry_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1Geometry_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1Geometry_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1Geometry_GetBounds(This, worldTransform, bounds) \ + ((This)->lpVtbl->GetBounds(This, worldTransform, bounds)) + +#define ID2D1Geometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \ + ((This)->lpVtbl->GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds)) + +#define ID2D1Geometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains)) + +#define ID2D1Geometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains)) + +#define ID2D1Geometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \ + ((This)->lpVtbl->CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation)) + +#define ID2D1Geometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1Geometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \ + ((This)->lpVtbl->Tessellate(This, worldTransform, flatteningTolerance, tessellationSink)) + +#define ID2D1Geometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink)) + +#define ID2D1Geometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Outline(This, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1Geometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \ + ((This)->lpVtbl->ComputeArea(This, worldTransform, flatteningTolerance, area)) + +#define ID2D1Geometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \ + ((This)->lpVtbl->ComputeLength(This, worldTransform, flatteningTolerance, length)) + +#define ID2D1Geometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \ + ((This)->lpVtbl->ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector)) + +#define ID2D1Geometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink)) + +typedef interface ID2D1RectangleGeometry ID2D1RectangleGeometry; + +typedef struct ID2D1RectangleGeometryVtbl +{ + + ID2D1GeometryVtbl Base; + + + STDMETHOD_(void, GetRect)( + ID2D1RectangleGeometry *This, + __out D2D1_RECT_F *rect + ) PURE; +} ID2D1RectangleGeometryVtbl; + +interface ID2D1RectangleGeometry +{ + CONST struct ID2D1RectangleGeometryVtbl *lpVtbl; +}; + + +#define ID2D1RectangleGeometry_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1RectangleGeometry_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1RectangleGeometry_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1RectangleGeometry_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1RectangleGeometry_GetBounds(This, worldTransform, bounds) \ + ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds)) + +#define ID2D1RectangleGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \ + ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds)) + +#define ID2D1RectangleGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains)) + +#define ID2D1RectangleGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains)) + +#define ID2D1RectangleGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \ + ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation)) + +#define ID2D1RectangleGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RectangleGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \ + ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink)) + +#define ID2D1RectangleGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RectangleGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RectangleGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \ + ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area)) + +#define ID2D1RectangleGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \ + ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length)) + +#define ID2D1RectangleGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \ + ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector)) + +#define ID2D1RectangleGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RectangleGeometry_GetRect(This, rect) \ + ((This)->lpVtbl->GetRect(This, rect)) + +typedef interface ID2D1RoundedRectangleGeometry ID2D1RoundedRectangleGeometry; + +typedef struct ID2D1RoundedRectangleGeometryVtbl +{ + + ID2D1GeometryVtbl Base; + + + STDMETHOD_(void, GetRoundedRect)( + ID2D1RoundedRectangleGeometry *This, + __out D2D1_ROUNDED_RECT *roundedRect + ) PURE; +} ID2D1RoundedRectangleGeometryVtbl; + +interface ID2D1RoundedRectangleGeometry +{ + CONST struct ID2D1RoundedRectangleGeometryVtbl *lpVtbl; +}; + + +#define ID2D1RoundedRectangleGeometry_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1RoundedRectangleGeometry_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1RoundedRectangleGeometry_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1RoundedRectangleGeometry_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1RoundedRectangleGeometry_GetBounds(This, worldTransform, bounds) \ + ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds)) + +#define ID2D1RoundedRectangleGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \ + ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds)) + +#define ID2D1RoundedRectangleGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains)) + +#define ID2D1RoundedRectangleGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains)) + +#define ID2D1RoundedRectangleGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \ + ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation)) + +#define ID2D1RoundedRectangleGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RoundedRectangleGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \ + ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink)) + +#define ID2D1RoundedRectangleGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RoundedRectangleGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RoundedRectangleGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \ + ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area)) + +#define ID2D1RoundedRectangleGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \ + ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length)) + +#define ID2D1RoundedRectangleGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \ + ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector)) + +#define ID2D1RoundedRectangleGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1RoundedRectangleGeometry_GetRoundedRect(This, roundedRect) \ + ((This)->lpVtbl->GetRoundedRect(This, roundedRect)) + +typedef interface ID2D1EllipseGeometry ID2D1EllipseGeometry; + +typedef struct ID2D1EllipseGeometryVtbl +{ + + ID2D1GeometryVtbl Base; + + + STDMETHOD_(void, GetEllipse)( + ID2D1EllipseGeometry *This, + __out D2D1_ELLIPSE *ellipse + ) PURE; +} ID2D1EllipseGeometryVtbl; + +interface ID2D1EllipseGeometry +{ + CONST struct ID2D1EllipseGeometryVtbl *lpVtbl; +}; + + +#define ID2D1EllipseGeometry_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1EllipseGeometry_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1EllipseGeometry_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1EllipseGeometry_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1EllipseGeometry_GetBounds(This, worldTransform, bounds) \ + ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds)) + +#define ID2D1EllipseGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \ + ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds)) + +#define ID2D1EllipseGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains)) + +#define ID2D1EllipseGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains)) + +#define ID2D1EllipseGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \ + ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation)) + +#define ID2D1EllipseGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1EllipseGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \ + ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink)) + +#define ID2D1EllipseGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink)) + +#define ID2D1EllipseGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1EllipseGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \ + ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area)) + +#define ID2D1EllipseGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \ + ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length)) + +#define ID2D1EllipseGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \ + ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector)) + +#define ID2D1EllipseGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1EllipseGeometry_GetEllipse(This, ellipse) \ + ((This)->lpVtbl->GetEllipse(This, ellipse)) + +typedef interface ID2D1GeometryGroup ID2D1GeometryGroup; + +typedef struct ID2D1GeometryGroupVtbl +{ + + ID2D1GeometryVtbl Base; + + + STDMETHOD_(D2D1_FILL_MODE, GetFillMode)( + ID2D1GeometryGroup *This + ) PURE; + + STDMETHOD_(UINT32, GetSourceGeometryCount)( + ID2D1GeometryGroup *This + ) PURE; + + STDMETHOD_(void, GetSourceGeometries)( + ID2D1GeometryGroup *This, + __out_ecount(geometriesCount) ID2D1Geometry **geometries, + UINT geometriesCount + ) PURE; +} ID2D1GeometryGroupVtbl; + +interface ID2D1GeometryGroup +{ + CONST struct ID2D1GeometryGroupVtbl *lpVtbl; +}; + + +#define ID2D1GeometryGroup_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1GeometryGroup_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1GeometryGroup_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1GeometryGroup_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1GeometryGroup_GetBounds(This, worldTransform, bounds) \ + ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds)) + +#define ID2D1GeometryGroup_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \ + ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds)) + +#define ID2D1GeometryGroup_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains)) + +#define ID2D1GeometryGroup_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains)) + +#define ID2D1GeometryGroup_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \ + ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation)) + +#define ID2D1GeometryGroup_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1GeometryGroup_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \ + ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink)) + +#define ID2D1GeometryGroup_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink)) + +#define ID2D1GeometryGroup_Outline(This, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1GeometryGroup_ComputeArea(This, worldTransform, flatteningTolerance, area) \ + ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area)) + +#define ID2D1GeometryGroup_ComputeLength(This, worldTransform, flatteningTolerance, length) \ + ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length)) + +#define ID2D1GeometryGroup_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \ + ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector)) + +#define ID2D1GeometryGroup_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1GeometryGroup_GetFillMode(This) \ + ((This)->lpVtbl->GetFillMode(This)) + +#define ID2D1GeometryGroup_GetSourceGeometryCount(This) \ + ((This)->lpVtbl->GetSourceGeometryCount(This)) + +#define ID2D1GeometryGroup_GetSourceGeometries(This, geometries, geometriesCount) \ + ((This)->lpVtbl->GetSourceGeometries(This, geometries, geometriesCount)) + +typedef interface ID2D1TransformedGeometry ID2D1TransformedGeometry; + +typedef struct ID2D1TransformedGeometryVtbl +{ + + ID2D1GeometryVtbl Base; + + + STDMETHOD_(void, GetSourceGeometry)( + ID2D1TransformedGeometry *This, + __deref_out ID2D1Geometry **sourceGeometry + ) PURE; + + STDMETHOD_(void, GetTransform)( + ID2D1TransformedGeometry *This, + __out D2D1_MATRIX_3X2_F *transform + ) PURE; +} ID2D1TransformedGeometryVtbl; + +interface ID2D1TransformedGeometry +{ + CONST struct ID2D1TransformedGeometryVtbl *lpVtbl; +}; + + +#define ID2D1TransformedGeometry_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1TransformedGeometry_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1TransformedGeometry_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1TransformedGeometry_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1TransformedGeometry_GetBounds(This, worldTransform, bounds) \ + ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds)) + +#define ID2D1TransformedGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \ + ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds)) + +#define ID2D1TransformedGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains)) + +#define ID2D1TransformedGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains)) + +#define ID2D1TransformedGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \ + ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation)) + +#define ID2D1TransformedGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1TransformedGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \ + ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink)) + +#define ID2D1TransformedGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink)) + +#define ID2D1TransformedGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1TransformedGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \ + ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area)) + +#define ID2D1TransformedGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \ + ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length)) + +#define ID2D1TransformedGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \ + ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector)) + +#define ID2D1TransformedGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1TransformedGeometry_GetSourceGeometry(This, sourceGeometry) \ + ((This)->lpVtbl->GetSourceGeometry(This, sourceGeometry)) + +#define ID2D1TransformedGeometry_GetTransform(This, transform) \ + ((This)->lpVtbl->GetTransform(This, transform)) + +typedef interface ID2D1SimplifiedGeometrySink ID2D1SimplifiedGeometrySink; + +typedef struct ID2D1SimplifiedGeometrySinkVtbl +{ + + IUnknownVtbl Base; + + + STDMETHOD_(void, SetFillMode)( + ID2D1SimplifiedGeometrySink *This, + D2D1_FILL_MODE fillMode + ) PURE; + + STDMETHOD_(void, SetSegmentFlags)( + ID2D1SimplifiedGeometrySink *This, + D2D1_PATH_SEGMENT vertexFlags + ) PURE; + + STDMETHOD_(void, BeginFigure)( + ID2D1SimplifiedGeometrySink *This, + D2D1_POINT_2F startPoint, + D2D1_FIGURE_BEGIN figureBegin + ) PURE; + + STDMETHOD_(void, AddLines)( + ID2D1SimplifiedGeometrySink *This, + __in_ecount(pointsCount) CONST D2D1_POINT_2F *points, + UINT pointsCount + ) PURE; + + STDMETHOD_(void, AddBeziers)( + ID2D1SimplifiedGeometrySink *This, + __in_ecount(beziersCount) CONST D2D1_BEZIER_SEGMENT *beziers, + UINT beziersCount + ) PURE; + + STDMETHOD_(void, EndFigure)( + ID2D1SimplifiedGeometrySink *This, + D2D1_FIGURE_END figureEnd + ) PURE; + + STDMETHOD(Close)( + ID2D1SimplifiedGeometrySink *This + ) PURE; +} ID2D1SimplifiedGeometrySinkVtbl; + +interface ID2D1SimplifiedGeometrySink +{ + CONST struct ID2D1SimplifiedGeometrySinkVtbl *lpVtbl; +}; + + +#define ID2D1SimplifiedGeometrySink_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1SimplifiedGeometrySink_AddRef(This) \ + ((This)->lpVtbl->Base.AddRef((IUnknown *)This)) + +#define ID2D1SimplifiedGeometrySink_Release(This) \ + ((This)->lpVtbl->Base.Release((IUnknown *)This)) + +#define ID2D1SimplifiedGeometrySink_SetFillMode(This, fillMode) \ + ((This)->lpVtbl->SetFillMode(This, fillMode)) + +#define ID2D1SimplifiedGeometrySink_SetSegmentFlags(This, vertexFlags) \ + ((This)->lpVtbl->SetSegmentFlags(This, vertexFlags)) + +#define ID2D1SimplifiedGeometrySink_BeginFigure(This, startPoint, figureBegin) \ + ((This)->lpVtbl->BeginFigure(This, startPoint, figureBegin)) + +#define ID2D1SimplifiedGeometrySink_AddLines(This, points, pointsCount) \ + ((This)->lpVtbl->AddLines(This, points, pointsCount)) + +#define ID2D1SimplifiedGeometrySink_AddBeziers(This, beziers, beziersCount) \ + ((This)->lpVtbl->AddBeziers(This, beziers, beziersCount)) + +#define ID2D1SimplifiedGeometrySink_EndFigure(This, figureEnd) \ + ((This)->lpVtbl->EndFigure(This, figureEnd)) + +#define ID2D1SimplifiedGeometrySink_Close(This) \ + ((This)->lpVtbl->Close(This)) + +typedef interface ID2D1GeometrySink ID2D1GeometrySink; + +typedef struct ID2D1GeometrySinkVtbl +{ + + ID2D1SimplifiedGeometrySinkVtbl Base; + + + STDMETHOD_(void, AddLine)( + ID2D1GeometrySink *This, + D2D1_POINT_2F point + ) PURE; + + STDMETHOD_(void, AddBezier)( + ID2D1GeometrySink *This, + __in CONST D2D1_BEZIER_SEGMENT *bezier + ) PURE; + + STDMETHOD_(void, AddQuadraticBezier)( + ID2D1GeometrySink *This, + __in CONST D2D1_QUADRATIC_BEZIER_SEGMENT *bezier + ) PURE; + + STDMETHOD_(void, AddQuadraticBeziers)( + ID2D1GeometrySink *This, + __in_ecount(beziersCount) CONST D2D1_QUADRATIC_BEZIER_SEGMENT *beziers, + UINT beziersCount + ) PURE; + + STDMETHOD_(void, AddArc)( + ID2D1GeometrySink *This, + __in CONST D2D1_ARC_SEGMENT *arc + ) PURE; +} ID2D1GeometrySinkVtbl; + +interface ID2D1GeometrySink +{ + CONST struct ID2D1GeometrySinkVtbl *lpVtbl; +}; + + +#define ID2D1GeometrySink_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1GeometrySink_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1GeometrySink_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1GeometrySink_SetFillMode(This, fillMode) \ + ((This)->lpVtbl->Base.SetFillMode((ID2D1SimplifiedGeometrySink *)This, fillMode)) + +#define ID2D1GeometrySink_SetSegmentFlags(This, vertexFlags) \ + ((This)->lpVtbl->Base.SetSegmentFlags((ID2D1SimplifiedGeometrySink *)This, vertexFlags)) + +#define ID2D1GeometrySink_BeginFigure(This, startPoint, figureBegin) \ + ((This)->lpVtbl->Base.BeginFigure((ID2D1SimplifiedGeometrySink *)This, startPoint, figureBegin)) + +#define ID2D1GeometrySink_AddLines(This, points, pointsCount) \ + ((This)->lpVtbl->Base.AddLines((ID2D1SimplifiedGeometrySink *)This, points, pointsCount)) + +#define ID2D1GeometrySink_AddBeziers(This, beziers, beziersCount) \ + ((This)->lpVtbl->Base.AddBeziers((ID2D1SimplifiedGeometrySink *)This, beziers, beziersCount)) + +#define ID2D1GeometrySink_EndFigure(This, figureEnd) \ + ((This)->lpVtbl->Base.EndFigure((ID2D1SimplifiedGeometrySink *)This, figureEnd)) + +#define ID2D1GeometrySink_Close(This) \ + ((This)->lpVtbl->Base.Close((ID2D1SimplifiedGeometrySink *)This)) + +#define ID2D1GeometrySink_AddLine(This, point) \ + ((This)->lpVtbl->AddLine(This, point)) + +#define ID2D1GeometrySink_AddBezier(This, bezier) \ + ((This)->lpVtbl->AddBezier(This, bezier)) + +#define ID2D1GeometrySink_AddQuadraticBezier(This, bezier) \ + ((This)->lpVtbl->AddQuadraticBezier(This, bezier)) + +#define ID2D1GeometrySink_AddQuadraticBeziers(This, beziers, beziersCount) \ + ((This)->lpVtbl->AddQuadraticBeziers(This, beziers, beziersCount)) + +#define ID2D1GeometrySink_AddArc(This, arc) \ + ((This)->lpVtbl->AddArc(This, arc)) + +typedef interface ID2D1TessellationSink ID2D1TessellationSink; + +typedef struct ID2D1TessellationSinkVtbl +{ + + IUnknownVtbl Base; + + + STDMETHOD_(void, AddTriangles)( + ID2D1TessellationSink *This, + __in_ecount(trianglesCount) CONST D2D1_TRIANGLE *triangles, + UINT trianglesCount + ) PURE; + + STDMETHOD(Close)( + ID2D1TessellationSink *This + ) PURE; +} ID2D1TessellationSinkVtbl; + +interface ID2D1TessellationSink +{ + CONST struct ID2D1TessellationSinkVtbl *lpVtbl; +}; + + +#define ID2D1TessellationSink_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1TessellationSink_AddRef(This) \ + ((This)->lpVtbl->Base.AddRef((IUnknown *)This)) + +#define ID2D1TessellationSink_Release(This) \ + ((This)->lpVtbl->Base.Release((IUnknown *)This)) + +#define ID2D1TessellationSink_AddTriangles(This, triangles, trianglesCount) \ + ((This)->lpVtbl->AddTriangles(This, triangles, trianglesCount)) + +#define ID2D1TessellationSink_Close(This) \ + ((This)->lpVtbl->Close(This)) + +typedef interface ID2D1PathGeometry ID2D1PathGeometry; + +typedef struct ID2D1PathGeometryVtbl +{ + + ID2D1GeometryVtbl Base; + + + STDMETHOD(Open)( + ID2D1PathGeometry *This, + __deref_out ID2D1GeometrySink **geometrySink + ) PURE; + + STDMETHOD(Stream)( + ID2D1PathGeometry *This, + __in ID2D1GeometrySink *geometrySink + ) PURE; + + STDMETHOD(GetSegmentCount)( + ID2D1PathGeometry *This, + __out UINT32 *count + ) PURE; + + STDMETHOD(GetFigureCount)( + ID2D1PathGeometry *This, + __out UINT32 *count + ) PURE; +} ID2D1PathGeometryVtbl; + +interface ID2D1PathGeometry +{ + CONST struct ID2D1PathGeometryVtbl *lpVtbl; +}; + + +#define ID2D1PathGeometry_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1PathGeometry_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1PathGeometry_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1PathGeometry_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1PathGeometry_GetBounds(This, worldTransform, bounds) \ + ((This)->lpVtbl->Base.GetBounds((ID2D1Geometry *)This, worldTransform, bounds)) + +#define ID2D1PathGeometry_GetWidenedBounds(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds) \ + ((This)->lpVtbl->Base.GetWidenedBounds((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, bounds)) + +#define ID2D1PathGeometry_StrokeContainsPoint(This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.StrokeContainsPoint((ID2D1Geometry *)This, point, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, contains)) + +#define ID2D1PathGeometry_FillContainsPoint(This, point, worldTransform, flatteningTolerance, contains) \ + ((This)->lpVtbl->Base.FillContainsPoint((ID2D1Geometry *)This, point, worldTransform, flatteningTolerance, contains)) + +#define ID2D1PathGeometry_CompareWithGeometry(This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation) \ + ((This)->lpVtbl->Base.CompareWithGeometry((ID2D1Geometry *)This, inputGeometry, inputGeometryTransform, flatteningTolerance, relation)) + +#define ID2D1PathGeometry_Simplify(This, simplificationOption, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Simplify((ID2D1Geometry *)This, simplificationOption, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1PathGeometry_Tessellate(This, worldTransform, flatteningTolerance, tessellationSink) \ + ((This)->lpVtbl->Base.Tessellate((ID2D1Geometry *)This, worldTransform, flatteningTolerance, tessellationSink)) + +#define ID2D1PathGeometry_CombineWithGeometry(This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.CombineWithGeometry((ID2D1Geometry *)This, inputGeometry, combineMode, inputGeometryTransform, flatteningTolerance, geometrySink)) + +#define ID2D1PathGeometry_Outline(This, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Outline((ID2D1Geometry *)This, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1PathGeometry_ComputeArea(This, worldTransform, flatteningTolerance, area) \ + ((This)->lpVtbl->Base.ComputeArea((ID2D1Geometry *)This, worldTransform, flatteningTolerance, area)) + +#define ID2D1PathGeometry_ComputeLength(This, worldTransform, flatteningTolerance, length) \ + ((This)->lpVtbl->Base.ComputeLength((ID2D1Geometry *)This, worldTransform, flatteningTolerance, length)) + +#define ID2D1PathGeometry_ComputePointAtLength(This, length, worldTransform, flatteningTolerance, point, unitTangentVector) \ + ((This)->lpVtbl->Base.ComputePointAtLength((ID2D1Geometry *)This, length, worldTransform, flatteningTolerance, point, unitTangentVector)) + +#define ID2D1PathGeometry_Widen(This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink) \ + ((This)->lpVtbl->Base.Widen((ID2D1Geometry *)This, strokeWidth, strokeStyle, worldTransform, flatteningTolerance, geometrySink)) + +#define ID2D1PathGeometry_Open(This, geometrySink) \ + ((This)->lpVtbl->Open(This, geometrySink)) + +#define ID2D1PathGeometry_Stream(This, geometrySink) \ + ((This)->lpVtbl->Stream(This, geometrySink)) + +#define ID2D1PathGeometry_GetSegmentCount(This, count) \ + ((This)->lpVtbl->GetSegmentCount(This, count)) + +#define ID2D1PathGeometry_GetFigureCount(This, count) \ + ((This)->lpVtbl->GetFigureCount(This, count)) + +typedef interface ID2D1Mesh ID2D1Mesh; + +typedef struct ID2D1MeshVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD(Open)( + ID2D1Mesh *This, + __deref_out ID2D1TessellationSink **tessellationSink + ) PURE; +} ID2D1MeshVtbl; + +interface ID2D1Mesh +{ + CONST struct ID2D1MeshVtbl *lpVtbl; +}; + + +#define ID2D1Mesh_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1Mesh_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1Mesh_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1Mesh_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1Mesh_Open(This, tessellationSink) \ + ((This)->lpVtbl->Open(This, tessellationSink)) + +typedef interface ID2D1Layer ID2D1Layer; + +typedef struct ID2D1LayerVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD_(D2D1_SIZE_F, GetSize)( + ID2D1Layer *This + ) PURE; +} ID2D1LayerVtbl; + +interface ID2D1Layer +{ + CONST struct ID2D1LayerVtbl *lpVtbl; +}; + + +#define ID2D1Layer_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1Layer_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1Layer_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1Layer_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1Layer_GetSize(This) \ + ((This)->lpVtbl->GetSize(This)) + +typedef interface ID2D1DrawingStateBlock ID2D1DrawingStateBlock; + +typedef struct ID2D1DrawingStateBlockVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD_(void, GetDescription)( + ID2D1DrawingStateBlock *This, + __out D2D1_DRAWING_STATE_DESCRIPTION *stateDescription + ) PURE; + + STDMETHOD_(void, SetDescription)( + ID2D1DrawingStateBlock *This, + __in CONST D2D1_DRAWING_STATE_DESCRIPTION *stateDescription + ) PURE; + + STDMETHOD_(void, SetTextRenderingParams)( + ID2D1DrawingStateBlock *This, + __in_opt IDWriteRenderingParams *textRenderingParams + ) PURE; + + STDMETHOD_(void, GetTextRenderingParams)( + ID2D1DrawingStateBlock *This, + __deref_out_opt IDWriteRenderingParams **textRenderingParams + ) PURE; +} ID2D1DrawingStateBlockVtbl; + +interface ID2D1DrawingStateBlock +{ + CONST struct ID2D1DrawingStateBlockVtbl *lpVtbl; +}; + + +#define ID2D1DrawingStateBlock_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1DrawingStateBlock_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1DrawingStateBlock_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1DrawingStateBlock_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1DrawingStateBlock_GetDescription(This, stateDescription) \ + ((This)->lpVtbl->GetDescription(This, stateDescription)) + +#define ID2D1DrawingStateBlock_SetDescription(This, stateDescription) \ + ((This)->lpVtbl->SetDescription(This, stateDescription)) + +#define ID2D1DrawingStateBlock_SetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->SetTextRenderingParams(This, textRenderingParams)) + +#define ID2D1DrawingStateBlock_GetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->GetTextRenderingParams(This, textRenderingParams)) + +typedef interface ID2D1RenderTarget ID2D1RenderTarget; + +typedef struct ID2D1RenderTargetVtbl +{ + + ID2D1ResourceVtbl Base; + + + STDMETHOD(CreateBitmap)( + ID2D1RenderTarget *This, + D2D1_SIZE_U size, + __in_opt CONST void *srcData, + UINT32 pitch, + __in CONST D2D1_BITMAP_PROPERTIES *bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) PURE; + + STDMETHOD(CreateBitmapFromWicBitmap)( + ID2D1RenderTarget *This, + __in IWICBitmapSource *wicBitmapSource, + __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) PURE; + + STDMETHOD(CreateSharedBitmap)( + ID2D1RenderTarget *This, + __in REFIID riid, + __inout void *data, + __in_opt CONST D2D1_BITMAP_PROPERTIES *bitmapProperties, + __deref_out ID2D1Bitmap **bitmap + ) PURE; + + STDMETHOD(CreateBitmapBrush)( + ID2D1RenderTarget *This, + __in ID2D1Bitmap *bitmap, + __in_opt CONST D2D1_BITMAP_BRUSH_PROPERTIES *bitmapBrushProperties, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __deref_out ID2D1BitmapBrush **bitmapBrush + ) PURE; + + STDMETHOD(CreateSolidColorBrush)( + ID2D1RenderTarget *This, + __in CONST D2D1_COLOR_F *color, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __deref_out ID2D1SolidColorBrush **solidColorBrush + ) PURE; + + STDMETHOD(CreateGradientStopCollection)( + ID2D1RenderTarget *This, + __in_ecount(gradientStopsCount) CONST D2D1_GRADIENT_STOP *gradientStops, + __range(>=,1) UINT gradientStopsCount, + D2D1_GAMMA colorInterpolationGamma, + D2D1_EXTEND_MODE extendMode, + __deref_out ID2D1GradientStopCollection **gradientStopCollection + ) PURE; + + STDMETHOD(CreateLinearGradientBrush)( + ID2D1RenderTarget *This, + __in CONST D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *linearGradientBrushProperties, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1LinearGradientBrush **linearGradientBrush + ) PURE; + + STDMETHOD(CreateRadialGradientBrush)( + ID2D1RenderTarget *This, + __in CONST D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES *radialGradientBrushProperties, + __in_opt CONST D2D1_BRUSH_PROPERTIES *brushProperties, + __in ID2D1GradientStopCollection *gradientStopCollection, + __deref_out ID2D1RadialGradientBrush **radialGradientBrush + ) PURE; + + STDMETHOD(CreateCompatibleRenderTarget)( + ID2D1RenderTarget *This, + __in_opt CONST D2D1_SIZE_F *desiredSize, + __in_opt CONST D2D1_SIZE_U *desiredPixelSize, + __in_opt CONST D2D1_PIXEL_FORMAT *desiredFormat, + D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options, + __deref_out ID2D1BitmapRenderTarget **bitmapRenderTarget + ) PURE; + + STDMETHOD(CreateLayer)( + ID2D1RenderTarget *This, + __in_opt CONST D2D1_SIZE_F *size, + __deref_out ID2D1Layer **layer + ) PURE; + + STDMETHOD(CreateMesh)( + ID2D1RenderTarget *This, + __deref_out ID2D1Mesh **mesh + ) PURE; + + STDMETHOD_(void, DrawLine)( + ID2D1RenderTarget *This, + D2D1_POINT_2F point0, + D2D1_POINT_2F point1, + __in ID2D1Brush *brush, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle + ) PURE; + + STDMETHOD_(void, DrawRectangle)( + ID2D1RenderTarget *This, + __in CONST D2D1_RECT_F *rect, + __in ID2D1Brush *brush, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle + ) PURE; + + STDMETHOD_(void, FillRectangle)( + ID2D1RenderTarget *This, + __in CONST D2D1_RECT_F *rect, + __in ID2D1Brush *brush + ) PURE; + + STDMETHOD_(void, DrawRoundedRectangle)( + ID2D1RenderTarget *This, + __in CONST D2D1_ROUNDED_RECT *roundedRect, + __in ID2D1Brush *brush, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle + ) PURE; + + STDMETHOD_(void, FillRoundedRectangle)( + ID2D1RenderTarget *This, + __in CONST D2D1_ROUNDED_RECT *roundedRect, + __in ID2D1Brush *brush + ) PURE; + + STDMETHOD_(void, DrawEllipse)( + ID2D1RenderTarget *This, + __in CONST D2D1_ELLIPSE *ellipse, + __in ID2D1Brush *brush, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle + ) PURE; + + STDMETHOD_(void, FillEllipse)( + ID2D1RenderTarget *This, + __in CONST D2D1_ELLIPSE *ellipse, + __in ID2D1Brush *brush + ) PURE; + + STDMETHOD_(void, DrawGeometry)( + ID2D1RenderTarget *This, + __in ID2D1Geometry *geometry, + __in ID2D1Brush *brush, + FLOAT strokeWidth, + __in_opt ID2D1StrokeStyle *strokeStyle + ) PURE; + + STDMETHOD_(void, FillGeometry)( + ID2D1RenderTarget *This, + __in ID2D1Geometry *geometry, + __in ID2D1Brush *brush, + __in_opt ID2D1Brush *opacityBrush + ) PURE; + + STDMETHOD_(void, FillMesh)( + ID2D1RenderTarget *This, + __in ID2D1Mesh *mesh, + __in ID2D1Brush *brush + ) PURE; + + STDMETHOD_(void, FillOpacityMask)( + ID2D1RenderTarget *This, + __in ID2D1Bitmap *opacityMask, + __in ID2D1Brush *brush, + D2D1_OPACITY_MASK_CONTENT content, + __in_opt CONST D2D1_RECT_F *destinationRectangle, + __in_opt CONST D2D1_RECT_F *sourceRectangle + ) PURE; + + STDMETHOD_(void, DrawBitmap)( + ID2D1RenderTarget *This, + __in ID2D1Bitmap *bitmap, + __in_opt CONST D2D1_RECT_F *destinationRectangle, + FLOAT opacity, + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode, + __in_opt CONST D2D1_RECT_F *sourceRectangle + ) PURE; + + STDMETHOD_(void, DrawText)( + ID2D1RenderTarget *This, + __in_ecount(stringLength) CONST WCHAR *string, + UINT stringLength, + __in IDWriteTextFormat *textFormat, + __in CONST D2D1_RECT_F *layoutRect, + __in ID2D1Brush *defaultForegroundBrush, + D2D1_DRAW_TEXT_OPTIONS options, + DWRITE_MEASURING_MODE measuringMode + ) PURE; + + STDMETHOD_(void, DrawTextLayout)( + ID2D1RenderTarget *This, + D2D1_POINT_2F origin, + __in IDWriteTextLayout *textLayout, + __in ID2D1Brush *defaultForegroundBrush, + D2D1_DRAW_TEXT_OPTIONS options + ) PURE; + + STDMETHOD_(void, DrawGlyphRun)( + ID2D1RenderTarget *This, + D2D1_POINT_2F baselineOrigin, + __in CONST DWRITE_GLYPH_RUN *glyphRun, + __in ID2D1Brush *foregroundBrush, + DWRITE_MEASURING_MODE measuringMode + ) PURE; + + STDMETHOD_(void, SetTransform)( + ID2D1RenderTarget *This, + __in CONST D2D1_MATRIX_3X2_F *transform + ) PURE; + + STDMETHOD_(void, GetTransform)( + ID2D1RenderTarget *This, + __out D2D1_MATRIX_3X2_F *transform + ) PURE; + + STDMETHOD_(void, SetAntialiasMode)( + ID2D1RenderTarget *This, + D2D1_ANTIALIAS_MODE antialiasMode + ) PURE; + + STDMETHOD_(D2D1_ANTIALIAS_MODE, GetAntialiasMode)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD_(void, SetTextAntialiasMode)( + ID2D1RenderTarget *This, + D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode + ) PURE; + + STDMETHOD_(D2D1_TEXT_ANTIALIAS_MODE, GetTextAntialiasMode)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD_(void, SetTextRenderingParams)( + ID2D1RenderTarget *This, + __in_opt IDWriteRenderingParams *textRenderingParams + ) PURE; + + STDMETHOD_(void, GetTextRenderingParams)( + ID2D1RenderTarget *This, + __deref_out_opt IDWriteRenderingParams **textRenderingParams + ) PURE; + + STDMETHOD_(void, SetTags)( + ID2D1RenderTarget *This, + D2D1_TAG tag1, + D2D1_TAG tag2 + ) PURE; + + STDMETHOD_(void, GetTags)( + ID2D1RenderTarget *This, + __out_opt D2D1_TAG *tag1, + __out_opt D2D1_TAG *tag2 + ) PURE; + + STDMETHOD_(void, PushLayer)( + ID2D1RenderTarget *This, + __in CONST D2D1_LAYER_PARAMETERS *layerParameters, + __in ID2D1Layer *layer + ) PURE; + + STDMETHOD_(void, PopLayer)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD(Flush)( + ID2D1RenderTarget *This, + __out_opt D2D1_TAG *tag1, + __out_opt D2D1_TAG *tag2 + ) PURE; + + STDMETHOD_(void, SaveDrawingState)( + ID2D1RenderTarget *This, + __inout ID2D1DrawingStateBlock *drawingStateBlock + ) PURE; + + STDMETHOD_(void, RestoreDrawingState)( + ID2D1RenderTarget *This, + __in ID2D1DrawingStateBlock *drawingStateBlock + ) PURE; + + STDMETHOD_(void, PushAxisAlignedClip)( + ID2D1RenderTarget *This, + __in CONST D2D1_RECT_F *clipRect, + D2D1_ANTIALIAS_MODE antialiasMode + ) PURE; + + STDMETHOD_(void, PopAxisAlignedClip)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD_(void, Clear)( + ID2D1RenderTarget *This, + __in_opt CONST D2D1_COLOR_F *clearColor + ) PURE; + + STDMETHOD_(void, BeginDraw)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD(EndDraw)( + ID2D1RenderTarget *This, + __out_opt D2D1_TAG *tag1, + __out_opt D2D1_TAG *tag2 + ) PURE; + + STDMETHOD_(D2D1_PIXEL_FORMAT, GetPixelFormat)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD_(void, SetDpi)( + ID2D1RenderTarget *This, + FLOAT dpiX, + FLOAT dpiY + ) PURE; + + STDMETHOD_(void, GetDpi)( + ID2D1RenderTarget *This, + __out FLOAT *dpiX, + __out FLOAT *dpiY + ) PURE; + + STDMETHOD_(D2D1_SIZE_F, GetSize)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD_(D2D1_SIZE_U, GetPixelSize)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD_(UINT32, GetMaximumBitmapSize)( + ID2D1RenderTarget *This + ) PURE; + + STDMETHOD_(BOOL, IsSupported)( + ID2D1RenderTarget *This, + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties + ) PURE; +} ID2D1RenderTargetVtbl; + +interface ID2D1RenderTarget +{ + CONST struct ID2D1RenderTargetVtbl *lpVtbl; +}; + + +#define ID2D1RenderTarget_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1RenderTarget_AddRef(This) \ + ((This)->lpVtbl->Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1RenderTarget_Release(This) \ + ((This)->lpVtbl->Base.Base.Release((IUnknown *)This)) + +#define ID2D1RenderTarget_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1RenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \ + ((This)->lpVtbl->CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap)) + +#define ID2D1RenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \ + ((This)->lpVtbl->CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap)) + +#define ID2D1RenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \ + ((This)->lpVtbl->CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap)) + +#define ID2D1RenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \ + ((This)->lpVtbl->CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush)) + +#define ID2D1RenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \ + ((This)->lpVtbl->CreateSolidColorBrush(This, color, brushProperties, solidColorBrush)) + +#define ID2D1RenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \ + ((This)->lpVtbl->CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection)) + +#define ID2D1RenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \ + ((This)->lpVtbl->CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush)) + +#define ID2D1RenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \ + ((This)->lpVtbl->CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush)) + +#define ID2D1RenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \ + ((This)->lpVtbl->CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget)) + +#define ID2D1RenderTarget_CreateLayer(This, size, layer) \ + ((This)->lpVtbl->CreateLayer(This, size, layer)) + +#define ID2D1RenderTarget_CreateMesh(This, mesh) \ + ((This)->lpVtbl->CreateMesh(This, mesh)) + +#define ID2D1RenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle)) + +#define ID2D1RenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->DrawRectangle(This, rect, brush, strokeWidth, strokeStyle)) + +#define ID2D1RenderTarget_FillRectangle(This, rect, brush) \ + ((This)->lpVtbl->FillRectangle(This, rect, brush)) + +#define ID2D1RenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle)) + +#define ID2D1RenderTarget_FillRoundedRectangle(This, roundedRect, brush) \ + ((This)->lpVtbl->FillRoundedRectangle(This, roundedRect, brush)) + +#define ID2D1RenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle)) + +#define ID2D1RenderTarget_FillEllipse(This, ellipse, brush) \ + ((This)->lpVtbl->FillEllipse(This, ellipse, brush)) + +#define ID2D1RenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle)) + +#define ID2D1RenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \ + ((This)->lpVtbl->FillGeometry(This, geometry, brush, opacityBrush)) + +#define ID2D1RenderTarget_FillMesh(This, mesh, brush) \ + ((This)->lpVtbl->FillMesh(This, mesh, brush)) + +#define ID2D1RenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \ + ((This)->lpVtbl->FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle)) + +#define ID2D1RenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \ + ((This)->lpVtbl->DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle)) + +#define ID2D1RenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \ + ((This)->lpVtbl->DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode)) + +#define ID2D1RenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \ + ((This)->lpVtbl->DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options)) + +#define ID2D1RenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \ + ((This)->lpVtbl->DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode)) + +#define ID2D1RenderTarget_SetTransform(This, transform) \ + ((This)->lpVtbl->SetTransform(This, transform)) + +#define ID2D1RenderTarget_GetTransform(This, transform) \ + ((This)->lpVtbl->GetTransform(This, transform)) + +#define ID2D1RenderTarget_SetAntialiasMode(This, antialiasMode) \ + ((This)->lpVtbl->SetAntialiasMode(This, antialiasMode)) + +#define ID2D1RenderTarget_GetAntialiasMode(This) \ + ((This)->lpVtbl->GetAntialiasMode(This)) + +#define ID2D1RenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \ + ((This)->lpVtbl->SetTextAntialiasMode(This, textAntialiasMode)) + +#define ID2D1RenderTarget_GetTextAntialiasMode(This) \ + ((This)->lpVtbl->GetTextAntialiasMode(This)) + +#define ID2D1RenderTarget_SetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->SetTextRenderingParams(This, textRenderingParams)) + +#define ID2D1RenderTarget_GetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->GetTextRenderingParams(This, textRenderingParams)) + +#define ID2D1RenderTarget_SetTags(This, tag1, tag2) \ + ((This)->lpVtbl->SetTags(This, tag1, tag2)) + +#define ID2D1RenderTarget_GetTags(This, tag1, tag2) \ + ((This)->lpVtbl->GetTags(This, tag1, tag2)) + +#define ID2D1RenderTarget_PushLayer(This, layerParameters, layer) \ + ((This)->lpVtbl->PushLayer(This, layerParameters, layer)) + +#define ID2D1RenderTarget_PopLayer(This) \ + ((This)->lpVtbl->PopLayer(This)) + +#define ID2D1RenderTarget_Flush(This, tag1, tag2) \ + ((This)->lpVtbl->Flush(This, tag1, tag2)) + +#define ID2D1RenderTarget_SaveDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->SaveDrawingState(This, drawingStateBlock)) + +#define ID2D1RenderTarget_RestoreDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->RestoreDrawingState(This, drawingStateBlock)) + +#define ID2D1RenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \ + ((This)->lpVtbl->PushAxisAlignedClip(This, clipRect, antialiasMode)) + +#define ID2D1RenderTarget_PopAxisAlignedClip(This) \ + ((This)->lpVtbl->PopAxisAlignedClip(This)) + +#define ID2D1RenderTarget_Clear(This, clearColor) \ + ((This)->lpVtbl->Clear(This, clearColor)) + +#define ID2D1RenderTarget_BeginDraw(This) \ + ((This)->lpVtbl->BeginDraw(This)) + +#define ID2D1RenderTarget_EndDraw(This, tag1, tag2) \ + ((This)->lpVtbl->EndDraw(This, tag1, tag2)) + +#define ID2D1RenderTarget_GetPixelFormat(This) \ + ((This)->lpVtbl->GetPixelFormat(This)) + +#define ID2D1RenderTarget_SetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->SetDpi(This, dpiX, dpiY)) + +#define ID2D1RenderTarget_GetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->GetDpi(This, dpiX, dpiY)) + +#define ID2D1RenderTarget_GetSize(This) \ + ((This)->lpVtbl->GetSize(This)) + +#define ID2D1RenderTarget_GetPixelSize(This) \ + ((This)->lpVtbl->GetPixelSize(This)) + +#define ID2D1RenderTarget_GetMaximumBitmapSize(This) \ + ((This)->lpVtbl->GetMaximumBitmapSize(This)) + +#define ID2D1RenderTarget_IsSupported(This, renderTargetProperties) \ + ((This)->lpVtbl->IsSupported(This, renderTargetProperties)) + +typedef interface ID2D1BitmapRenderTarget ID2D1BitmapRenderTarget; + +typedef struct ID2D1BitmapRenderTargetVtbl +{ + + ID2D1RenderTargetVtbl Base; + + + STDMETHOD(GetBitmap)( + ID2D1BitmapRenderTarget *This, + __deref_out ID2D1Bitmap **bitmap + ) PURE; +} ID2D1BitmapRenderTargetVtbl; + +interface ID2D1BitmapRenderTarget +{ + CONST struct ID2D1BitmapRenderTargetVtbl *lpVtbl; +}; + + +#define ID2D1BitmapRenderTarget_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1BitmapRenderTarget_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1BitmapRenderTarget_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1BitmapRenderTarget_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1BitmapRenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateBitmap((ID2D1RenderTarget *)This, size, srcData, pitch, bitmapProperties, bitmap)) + +#define ID2D1BitmapRenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateBitmapFromWicBitmap((ID2D1RenderTarget *)This, wicBitmapSource, bitmapProperties, bitmap)) + +#define ID2D1BitmapRenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateSharedBitmap((ID2D1RenderTarget *)This, riid, data, bitmapProperties, bitmap)) + +#define ID2D1BitmapRenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \ + ((This)->lpVtbl->Base.CreateBitmapBrush((ID2D1RenderTarget *)This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush)) + +#define ID2D1BitmapRenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \ + ((This)->lpVtbl->Base.CreateSolidColorBrush((ID2D1RenderTarget *)This, color, brushProperties, solidColorBrush)) + +#define ID2D1BitmapRenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \ + ((This)->lpVtbl->Base.CreateGradientStopCollection((ID2D1RenderTarget *)This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection)) + +#define ID2D1BitmapRenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \ + ((This)->lpVtbl->Base.CreateLinearGradientBrush((ID2D1RenderTarget *)This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush)) + +#define ID2D1BitmapRenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \ + ((This)->lpVtbl->Base.CreateRadialGradientBrush((ID2D1RenderTarget *)This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush)) + +#define ID2D1BitmapRenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \ + ((This)->lpVtbl->Base.CreateCompatibleRenderTarget((ID2D1RenderTarget *)This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget)) + +#define ID2D1BitmapRenderTarget_CreateLayer(This, size, layer) \ + ((This)->lpVtbl->Base.CreateLayer((ID2D1RenderTarget *)This, size, layer)) + +#define ID2D1BitmapRenderTarget_CreateMesh(This, mesh) \ + ((This)->lpVtbl->Base.CreateMesh((ID2D1RenderTarget *)This, mesh)) + +#define ID2D1BitmapRenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawLine((ID2D1RenderTarget *)This, point0, point1, brush, strokeWidth, strokeStyle)) + +#define ID2D1BitmapRenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawRectangle((ID2D1RenderTarget *)This, rect, brush, strokeWidth, strokeStyle)) + +#define ID2D1BitmapRenderTarget_FillRectangle(This, rect, brush) \ + ((This)->lpVtbl->Base.FillRectangle((ID2D1RenderTarget *)This, rect, brush)) + +#define ID2D1BitmapRenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush, strokeWidth, strokeStyle)) + +#define ID2D1BitmapRenderTarget_FillRoundedRectangle(This, roundedRect, brush) \ + ((This)->lpVtbl->Base.FillRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush)) + +#define ID2D1BitmapRenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawEllipse((ID2D1RenderTarget *)This, ellipse, brush, strokeWidth, strokeStyle)) + +#define ID2D1BitmapRenderTarget_FillEllipse(This, ellipse, brush) \ + ((This)->lpVtbl->Base.FillEllipse((ID2D1RenderTarget *)This, ellipse, brush)) + +#define ID2D1BitmapRenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawGeometry((ID2D1RenderTarget *)This, geometry, brush, strokeWidth, strokeStyle)) + +#define ID2D1BitmapRenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \ + ((This)->lpVtbl->Base.FillGeometry((ID2D1RenderTarget *)This, geometry, brush, opacityBrush)) + +#define ID2D1BitmapRenderTarget_FillMesh(This, mesh, brush) \ + ((This)->lpVtbl->Base.FillMesh((ID2D1RenderTarget *)This, mesh, brush)) + +#define ID2D1BitmapRenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \ + ((This)->lpVtbl->Base.FillOpacityMask((ID2D1RenderTarget *)This, opacityMask, brush, content, destinationRectangle, sourceRectangle)) + +#define ID2D1BitmapRenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \ + ((This)->lpVtbl->Base.DrawBitmap((ID2D1RenderTarget *)This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle)) + +#define ID2D1BitmapRenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \ + ((This)->lpVtbl->Base.DrawText((ID2D1RenderTarget *)This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode)) + +#define ID2D1BitmapRenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \ + ((This)->lpVtbl->Base.DrawTextLayout((ID2D1RenderTarget *)This, origin, textLayout, defaultForegroundBrush, options)) + +#define ID2D1BitmapRenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \ + ((This)->lpVtbl->Base.DrawGlyphRun((ID2D1RenderTarget *)This, baselineOrigin, glyphRun, foregroundBrush, measuringMode)) + +#define ID2D1BitmapRenderTarget_SetTransform(This, transform) \ + ((This)->lpVtbl->Base.SetTransform((ID2D1RenderTarget *)This, transform)) + +#define ID2D1BitmapRenderTarget_GetTransform(This, transform) \ + ((This)->lpVtbl->Base.GetTransform((ID2D1RenderTarget *)This, transform)) + +#define ID2D1BitmapRenderTarget_SetAntialiasMode(This, antialiasMode) \ + ((This)->lpVtbl->Base.SetAntialiasMode((ID2D1RenderTarget *)This, antialiasMode)) + +#define ID2D1BitmapRenderTarget_GetAntialiasMode(This) \ + ((This)->lpVtbl->Base.GetAntialiasMode((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \ + ((This)->lpVtbl->Base.SetTextAntialiasMode((ID2D1RenderTarget *)This, textAntialiasMode)) + +#define ID2D1BitmapRenderTarget_GetTextAntialiasMode(This) \ + ((This)->lpVtbl->Base.GetTextAntialiasMode((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_SetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->Base.SetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams)) + +#define ID2D1BitmapRenderTarget_GetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->Base.GetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams)) + +#define ID2D1BitmapRenderTarget_SetTags(This, tag1, tag2) \ + ((This)->lpVtbl->Base.SetTags((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1BitmapRenderTarget_GetTags(This, tag1, tag2) \ + ((This)->lpVtbl->Base.GetTags((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1BitmapRenderTarget_PushLayer(This, layerParameters, layer) \ + ((This)->lpVtbl->Base.PushLayer((ID2D1RenderTarget *)This, layerParameters, layer)) + +#define ID2D1BitmapRenderTarget_PopLayer(This) \ + ((This)->lpVtbl->Base.PopLayer((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_Flush(This, tag1, tag2) \ + ((This)->lpVtbl->Base.Flush((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1BitmapRenderTarget_SaveDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->Base.SaveDrawingState((ID2D1RenderTarget *)This, drawingStateBlock)) + +#define ID2D1BitmapRenderTarget_RestoreDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->Base.RestoreDrawingState((ID2D1RenderTarget *)This, drawingStateBlock)) + +#define ID2D1BitmapRenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \ + ((This)->lpVtbl->Base.PushAxisAlignedClip((ID2D1RenderTarget *)This, clipRect, antialiasMode)) + +#define ID2D1BitmapRenderTarget_PopAxisAlignedClip(This) \ + ((This)->lpVtbl->Base.PopAxisAlignedClip((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_Clear(This, clearColor) \ + ((This)->lpVtbl->Base.Clear((ID2D1RenderTarget *)This, clearColor)) + +#define ID2D1BitmapRenderTarget_BeginDraw(This) \ + ((This)->lpVtbl->Base.BeginDraw((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_EndDraw(This, tag1, tag2) \ + ((This)->lpVtbl->Base.EndDraw((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1BitmapRenderTarget_GetPixelFormat(This) \ + ((This)->lpVtbl->Base.GetPixelFormat((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_SetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->Base.SetDpi((ID2D1RenderTarget *)This, dpiX, dpiY)) + +#define ID2D1BitmapRenderTarget_GetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->Base.GetDpi((ID2D1RenderTarget *)This, dpiX, dpiY)) + +#define ID2D1BitmapRenderTarget_GetSize(This) \ + ((This)->lpVtbl->Base.GetSize((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_GetPixelSize(This) \ + ((This)->lpVtbl->Base.GetPixelSize((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_GetMaximumBitmapSize(This) \ + ((This)->lpVtbl->Base.GetMaximumBitmapSize((ID2D1RenderTarget *)This)) + +#define ID2D1BitmapRenderTarget_IsSupported(This, renderTargetProperties) \ + ((This)->lpVtbl->Base.IsSupported((ID2D1RenderTarget *)This, renderTargetProperties)) + +#define ID2D1BitmapRenderTarget_GetBitmap(This, bitmap) \ + ((This)->lpVtbl->GetBitmap(This, bitmap)) + +typedef interface ID2D1HwndRenderTarget ID2D1HwndRenderTarget; + +typedef struct ID2D1HwndRenderTargetVtbl +{ + + ID2D1RenderTargetVtbl Base; + + + STDMETHOD_(D2D1_WINDOW_STATE, CheckWindowState)( + ID2D1HwndRenderTarget *This + ) PURE; + + STDMETHOD(Resize)( + ID2D1HwndRenderTarget *This, + __in CONST D2D1_SIZE_U *pixelSize + ) PURE; + + STDMETHOD_(HWND, GetHwnd)( + ID2D1HwndRenderTarget *This + ) PURE; +} ID2D1HwndRenderTargetVtbl; + +interface ID2D1HwndRenderTarget +{ + CONST struct ID2D1HwndRenderTargetVtbl *lpVtbl; +}; + + +#define ID2D1HwndRenderTarget_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1HwndRenderTarget_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1HwndRenderTarget_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1HwndRenderTarget_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1HwndRenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateBitmap((ID2D1RenderTarget *)This, size, srcData, pitch, bitmapProperties, bitmap)) + +#define ID2D1HwndRenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateBitmapFromWicBitmap((ID2D1RenderTarget *)This, wicBitmapSource, bitmapProperties, bitmap)) + +#define ID2D1HwndRenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateSharedBitmap((ID2D1RenderTarget *)This, riid, data, bitmapProperties, bitmap)) + +#define ID2D1HwndRenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \ + ((This)->lpVtbl->Base.CreateBitmapBrush((ID2D1RenderTarget *)This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush)) + +#define ID2D1HwndRenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \ + ((This)->lpVtbl->Base.CreateSolidColorBrush((ID2D1RenderTarget *)This, color, brushProperties, solidColorBrush)) + +#define ID2D1HwndRenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \ + ((This)->lpVtbl->Base.CreateGradientStopCollection((ID2D1RenderTarget *)This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection)) + +#define ID2D1HwndRenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \ + ((This)->lpVtbl->Base.CreateLinearGradientBrush((ID2D1RenderTarget *)This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush)) + +#define ID2D1HwndRenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \ + ((This)->lpVtbl->Base.CreateRadialGradientBrush((ID2D1RenderTarget *)This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush)) + +#define ID2D1HwndRenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \ + ((This)->lpVtbl->Base.CreateCompatibleRenderTarget((ID2D1RenderTarget *)This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget)) + +#define ID2D1HwndRenderTarget_CreateLayer(This, size, layer) \ + ((This)->lpVtbl->Base.CreateLayer((ID2D1RenderTarget *)This, size, layer)) + +#define ID2D1HwndRenderTarget_CreateMesh(This, mesh) \ + ((This)->lpVtbl->Base.CreateMesh((ID2D1RenderTarget *)This, mesh)) + +#define ID2D1HwndRenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawLine((ID2D1RenderTarget *)This, point0, point1, brush, strokeWidth, strokeStyle)) + +#define ID2D1HwndRenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawRectangle((ID2D1RenderTarget *)This, rect, brush, strokeWidth, strokeStyle)) + +#define ID2D1HwndRenderTarget_FillRectangle(This, rect, brush) \ + ((This)->lpVtbl->Base.FillRectangle((ID2D1RenderTarget *)This, rect, brush)) + +#define ID2D1HwndRenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush, strokeWidth, strokeStyle)) + +#define ID2D1HwndRenderTarget_FillRoundedRectangle(This, roundedRect, brush) \ + ((This)->lpVtbl->Base.FillRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush)) + +#define ID2D1HwndRenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawEllipse((ID2D1RenderTarget *)This, ellipse, brush, strokeWidth, strokeStyle)) + +#define ID2D1HwndRenderTarget_FillEllipse(This, ellipse, brush) \ + ((This)->lpVtbl->Base.FillEllipse((ID2D1RenderTarget *)This, ellipse, brush)) + +#define ID2D1HwndRenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawGeometry((ID2D1RenderTarget *)This, geometry, brush, strokeWidth, strokeStyle)) + +#define ID2D1HwndRenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \ + ((This)->lpVtbl->Base.FillGeometry((ID2D1RenderTarget *)This, geometry, brush, opacityBrush)) + +#define ID2D1HwndRenderTarget_FillMesh(This, mesh, brush) \ + ((This)->lpVtbl->Base.FillMesh((ID2D1RenderTarget *)This, mesh, brush)) + +#define ID2D1HwndRenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \ + ((This)->lpVtbl->Base.FillOpacityMask((ID2D1RenderTarget *)This, opacityMask, brush, content, destinationRectangle, sourceRectangle)) + +#define ID2D1HwndRenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \ + ((This)->lpVtbl->Base.DrawBitmap((ID2D1RenderTarget *)This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle)) + +#define ID2D1HwndRenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \ + ((This)->lpVtbl->Base.DrawText((ID2D1RenderTarget *)This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode)) + +#define ID2D1HwndRenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \ + ((This)->lpVtbl->Base.DrawTextLayout((ID2D1RenderTarget *)This, origin, textLayout, defaultForegroundBrush, options)) + +#define ID2D1HwndRenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \ + ((This)->lpVtbl->Base.DrawGlyphRun((ID2D1RenderTarget *)This, baselineOrigin, glyphRun, foregroundBrush, measuringMode)) + +#define ID2D1HwndRenderTarget_SetTransform(This, transform) \ + ((This)->lpVtbl->Base.SetTransform((ID2D1RenderTarget *)This, transform)) + +#define ID2D1HwndRenderTarget_GetTransform(This, transform) \ + ((This)->lpVtbl->Base.GetTransform((ID2D1RenderTarget *)This, transform)) + +#define ID2D1HwndRenderTarget_SetAntialiasMode(This, antialiasMode) \ + ((This)->lpVtbl->Base.SetAntialiasMode((ID2D1RenderTarget *)This, antialiasMode)) + +#define ID2D1HwndRenderTarget_GetAntialiasMode(This) \ + ((This)->lpVtbl->Base.GetAntialiasMode((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \ + ((This)->lpVtbl->Base.SetTextAntialiasMode((ID2D1RenderTarget *)This, textAntialiasMode)) + +#define ID2D1HwndRenderTarget_GetTextAntialiasMode(This) \ + ((This)->lpVtbl->Base.GetTextAntialiasMode((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_SetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->Base.SetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams)) + +#define ID2D1HwndRenderTarget_GetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->Base.GetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams)) + +#define ID2D1HwndRenderTarget_SetTags(This, tag1, tag2) \ + ((This)->lpVtbl->Base.SetTags((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1HwndRenderTarget_GetTags(This, tag1, tag2) \ + ((This)->lpVtbl->Base.GetTags((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1HwndRenderTarget_PushLayer(This, layerParameters, layer) \ + ((This)->lpVtbl->Base.PushLayer((ID2D1RenderTarget *)This, layerParameters, layer)) + +#define ID2D1HwndRenderTarget_PopLayer(This) \ + ((This)->lpVtbl->Base.PopLayer((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_Flush(This, tag1, tag2) \ + ((This)->lpVtbl->Base.Flush((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1HwndRenderTarget_SaveDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->Base.SaveDrawingState((ID2D1RenderTarget *)This, drawingStateBlock)) + +#define ID2D1HwndRenderTarget_RestoreDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->Base.RestoreDrawingState((ID2D1RenderTarget *)This, drawingStateBlock)) + +#define ID2D1HwndRenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \ + ((This)->lpVtbl->Base.PushAxisAlignedClip((ID2D1RenderTarget *)This, clipRect, antialiasMode)) + +#define ID2D1HwndRenderTarget_PopAxisAlignedClip(This) \ + ((This)->lpVtbl->Base.PopAxisAlignedClip((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_Clear(This, clearColor) \ + ((This)->lpVtbl->Base.Clear((ID2D1RenderTarget *)This, clearColor)) + +#define ID2D1HwndRenderTarget_BeginDraw(This) \ + ((This)->lpVtbl->Base.BeginDraw((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_EndDraw(This, tag1, tag2) \ + ((This)->lpVtbl->Base.EndDraw((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1HwndRenderTarget_GetPixelFormat(This) \ + ((This)->lpVtbl->Base.GetPixelFormat((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_SetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->Base.SetDpi((ID2D1RenderTarget *)This, dpiX, dpiY)) + +#define ID2D1HwndRenderTarget_GetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->Base.GetDpi((ID2D1RenderTarget *)This, dpiX, dpiY)) + +#define ID2D1HwndRenderTarget_GetSize(This) \ + ((This)->lpVtbl->Base.GetSize((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_GetPixelSize(This) \ + ((This)->lpVtbl->Base.GetPixelSize((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_GetMaximumBitmapSize(This) \ + ((This)->lpVtbl->Base.GetMaximumBitmapSize((ID2D1RenderTarget *)This)) + +#define ID2D1HwndRenderTarget_IsSupported(This, renderTargetProperties) \ + ((This)->lpVtbl->Base.IsSupported((ID2D1RenderTarget *)This, renderTargetProperties)) + +#define ID2D1HwndRenderTarget_CheckWindowState(This) \ + ((This)->lpVtbl->CheckWindowState(This)) + +#define ID2D1HwndRenderTarget_Resize(This, pixelSize) \ + ((This)->lpVtbl->Resize(This, pixelSize)) + +#define ID2D1HwndRenderTarget_GetHwnd(This) \ + ((This)->lpVtbl->GetHwnd(This)) + +typedef interface ID2D1GdiInteropRenderTarget ID2D1GdiInteropRenderTarget; + +typedef struct ID2D1GdiInteropRenderTargetVtbl +{ + + IUnknownVtbl Base; + + + STDMETHOD(GetDC)( + ID2D1GdiInteropRenderTarget *This, + D2D1_DC_INITIALIZE_MODE mode, + __out HDC *hdc + ) PURE; + + STDMETHOD(ReleaseDC)( + ID2D1GdiInteropRenderTarget *This, + __in_opt CONST RECT *update + ) PURE; +} ID2D1GdiInteropRenderTargetVtbl; + +interface ID2D1GdiInteropRenderTarget +{ + CONST struct ID2D1GdiInteropRenderTargetVtbl *lpVtbl; +}; + + +#define ID2D1GdiInteropRenderTarget_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1GdiInteropRenderTarget_AddRef(This) \ + ((This)->lpVtbl->Base.AddRef((IUnknown *)This)) + +#define ID2D1GdiInteropRenderTarget_Release(This) \ + ((This)->lpVtbl->Base.Release((IUnknown *)This)) + +#define ID2D1GdiInteropRenderTarget_GetDC(This, mode, hdc) \ + ((This)->lpVtbl->GetDC(This, mode, hdc)) + +#define ID2D1GdiInteropRenderTarget_ReleaseDC(This, update) \ + ((This)->lpVtbl->ReleaseDC(This, update)) + +typedef interface ID2D1DCRenderTarget ID2D1DCRenderTarget; + +typedef struct ID2D1DCRenderTargetVtbl +{ + + ID2D1RenderTargetVtbl Base; + + + STDMETHOD(BindDC)( + ID2D1DCRenderTarget *This, + __in CONST HDC hDC, + __in CONST RECT *pSubRect + ) PURE; +} ID2D1DCRenderTargetVtbl; + +interface ID2D1DCRenderTarget +{ + CONST struct ID2D1DCRenderTargetVtbl *lpVtbl; +}; + + +#define ID2D1DCRenderTarget_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.Base.Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1DCRenderTarget_AddRef(This) \ + ((This)->lpVtbl->Base.Base.Base.AddRef((IUnknown *)This)) + +#define ID2D1DCRenderTarget_Release(This) \ + ((This)->lpVtbl->Base.Base.Base.Release((IUnknown *)This)) + +#define ID2D1DCRenderTarget_GetFactory(This, factory) \ + ((This)->lpVtbl->Base.Base.GetFactory((ID2D1Resource *)This, factory)) + +#define ID2D1DCRenderTarget_CreateBitmap(This, size, srcData, pitch, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateBitmap((ID2D1RenderTarget *)This, size, srcData, pitch, bitmapProperties, bitmap)) + +#define ID2D1DCRenderTarget_CreateBitmapFromWicBitmap(This, wicBitmapSource, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateBitmapFromWicBitmap((ID2D1RenderTarget *)This, wicBitmapSource, bitmapProperties, bitmap)) + +#define ID2D1DCRenderTarget_CreateSharedBitmap(This, riid, data, bitmapProperties, bitmap) \ + ((This)->lpVtbl->Base.CreateSharedBitmap((ID2D1RenderTarget *)This, riid, data, bitmapProperties, bitmap)) + +#define ID2D1DCRenderTarget_CreateBitmapBrush(This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush) \ + ((This)->lpVtbl->Base.CreateBitmapBrush((ID2D1RenderTarget *)This, bitmap, bitmapBrushProperties, brushProperties, bitmapBrush)) + +#define ID2D1DCRenderTarget_CreateSolidColorBrush(This, color, brushProperties, solidColorBrush) \ + ((This)->lpVtbl->Base.CreateSolidColorBrush((ID2D1RenderTarget *)This, color, brushProperties, solidColorBrush)) + +#define ID2D1DCRenderTarget_CreateGradientStopCollection(This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection) \ + ((This)->lpVtbl->Base.CreateGradientStopCollection((ID2D1RenderTarget *)This, gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection)) + +#define ID2D1DCRenderTarget_CreateLinearGradientBrush(This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush) \ + ((This)->lpVtbl->Base.CreateLinearGradientBrush((ID2D1RenderTarget *)This, linearGradientBrushProperties, brushProperties, gradientStopCollection, linearGradientBrush)) + +#define ID2D1DCRenderTarget_CreateRadialGradientBrush(This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush) \ + ((This)->lpVtbl->Base.CreateRadialGradientBrush((ID2D1RenderTarget *)This, radialGradientBrushProperties, brushProperties, gradientStopCollection, radialGradientBrush)) + +#define ID2D1DCRenderTarget_CreateCompatibleRenderTarget(This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget) \ + ((This)->lpVtbl->Base.CreateCompatibleRenderTarget((ID2D1RenderTarget *)This, desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget)) + +#define ID2D1DCRenderTarget_CreateLayer(This, size, layer) \ + ((This)->lpVtbl->Base.CreateLayer((ID2D1RenderTarget *)This, size, layer)) + +#define ID2D1DCRenderTarget_CreateMesh(This, mesh) \ + ((This)->lpVtbl->Base.CreateMesh((ID2D1RenderTarget *)This, mesh)) + +#define ID2D1DCRenderTarget_DrawLine(This, point0, point1, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawLine((ID2D1RenderTarget *)This, point0, point1, brush, strokeWidth, strokeStyle)) + +#define ID2D1DCRenderTarget_DrawRectangle(This, rect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawRectangle((ID2D1RenderTarget *)This, rect, brush, strokeWidth, strokeStyle)) + +#define ID2D1DCRenderTarget_FillRectangle(This, rect, brush) \ + ((This)->lpVtbl->Base.FillRectangle((ID2D1RenderTarget *)This, rect, brush)) + +#define ID2D1DCRenderTarget_DrawRoundedRectangle(This, roundedRect, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush, strokeWidth, strokeStyle)) + +#define ID2D1DCRenderTarget_FillRoundedRectangle(This, roundedRect, brush) \ + ((This)->lpVtbl->Base.FillRoundedRectangle((ID2D1RenderTarget *)This, roundedRect, brush)) + +#define ID2D1DCRenderTarget_DrawEllipse(This, ellipse, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawEllipse((ID2D1RenderTarget *)This, ellipse, brush, strokeWidth, strokeStyle)) + +#define ID2D1DCRenderTarget_FillEllipse(This, ellipse, brush) \ + ((This)->lpVtbl->Base.FillEllipse((ID2D1RenderTarget *)This, ellipse, brush)) + +#define ID2D1DCRenderTarget_DrawGeometry(This, geometry, brush, strokeWidth, strokeStyle) \ + ((This)->lpVtbl->Base.DrawGeometry((ID2D1RenderTarget *)This, geometry, brush, strokeWidth, strokeStyle)) + +#define ID2D1DCRenderTarget_FillGeometry(This, geometry, brush, opacityBrush) \ + ((This)->lpVtbl->Base.FillGeometry((ID2D1RenderTarget *)This, geometry, brush, opacityBrush)) + +#define ID2D1DCRenderTarget_FillMesh(This, mesh, brush) \ + ((This)->lpVtbl->Base.FillMesh((ID2D1RenderTarget *)This, mesh, brush)) + +#define ID2D1DCRenderTarget_FillOpacityMask(This, opacityMask, brush, content, destinationRectangle, sourceRectangle) \ + ((This)->lpVtbl->Base.FillOpacityMask((ID2D1RenderTarget *)This, opacityMask, brush, content, destinationRectangle, sourceRectangle)) + +#define ID2D1DCRenderTarget_DrawBitmap(This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle) \ + ((This)->lpVtbl->Base.DrawBitmap((ID2D1RenderTarget *)This, bitmap, destinationRectangle, opacity, interpolationMode, sourceRectangle)) + +#define ID2D1DCRenderTarget_DrawText(This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode) \ + ((This)->lpVtbl->Base.DrawText((ID2D1RenderTarget *)This, string, stringLength, textFormat, layoutRect, defaultForegroundBrush, options, measuringMode)) + +#define ID2D1DCRenderTarget_DrawTextLayout(This, origin, textLayout, defaultForegroundBrush, options) \ + ((This)->lpVtbl->Base.DrawTextLayout((ID2D1RenderTarget *)This, origin, textLayout, defaultForegroundBrush, options)) + +#define ID2D1DCRenderTarget_DrawGlyphRun(This, baselineOrigin, glyphRun, foregroundBrush, measuringMode) \ + ((This)->lpVtbl->Base.DrawGlyphRun((ID2D1RenderTarget *)This, baselineOrigin, glyphRun, foregroundBrush, measuringMode)) + +#define ID2D1DCRenderTarget_SetTransform(This, transform) \ + ((This)->lpVtbl->Base.SetTransform((ID2D1RenderTarget *)This, transform)) + +#define ID2D1DCRenderTarget_GetTransform(This, transform) \ + ((This)->lpVtbl->Base.GetTransform((ID2D1RenderTarget *)This, transform)) + +#define ID2D1DCRenderTarget_SetAntialiasMode(This, antialiasMode) \ + ((This)->lpVtbl->Base.SetAntialiasMode((ID2D1RenderTarget *)This, antialiasMode)) + +#define ID2D1DCRenderTarget_GetAntialiasMode(This) \ + ((This)->lpVtbl->Base.GetAntialiasMode((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_SetTextAntialiasMode(This, textAntialiasMode) \ + ((This)->lpVtbl->Base.SetTextAntialiasMode((ID2D1RenderTarget *)This, textAntialiasMode)) + +#define ID2D1DCRenderTarget_GetTextAntialiasMode(This) \ + ((This)->lpVtbl->Base.GetTextAntialiasMode((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_SetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->Base.SetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams)) + +#define ID2D1DCRenderTarget_GetTextRenderingParams(This, textRenderingParams) \ + ((This)->lpVtbl->Base.GetTextRenderingParams((ID2D1RenderTarget *)This, textRenderingParams)) + +#define ID2D1DCRenderTarget_SetTags(This, tag1, tag2) \ + ((This)->lpVtbl->Base.SetTags((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1DCRenderTarget_GetTags(This, tag1, tag2) \ + ((This)->lpVtbl->Base.GetTags((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1DCRenderTarget_PushLayer(This, layerParameters, layer) \ + ((This)->lpVtbl->Base.PushLayer((ID2D1RenderTarget *)This, layerParameters, layer)) + +#define ID2D1DCRenderTarget_PopLayer(This) \ + ((This)->lpVtbl->Base.PopLayer((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_Flush(This, tag1, tag2) \ + ((This)->lpVtbl->Base.Flush((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1DCRenderTarget_SaveDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->Base.SaveDrawingState((ID2D1RenderTarget *)This, drawingStateBlock)) + +#define ID2D1DCRenderTarget_RestoreDrawingState(This, drawingStateBlock) \ + ((This)->lpVtbl->Base.RestoreDrawingState((ID2D1RenderTarget *)This, drawingStateBlock)) + +#define ID2D1DCRenderTarget_PushAxisAlignedClip(This, clipRect, antialiasMode) \ + ((This)->lpVtbl->Base.PushAxisAlignedClip((ID2D1RenderTarget *)This, clipRect, antialiasMode)) + +#define ID2D1DCRenderTarget_PopAxisAlignedClip(This) \ + ((This)->lpVtbl->Base.PopAxisAlignedClip((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_Clear(This, clearColor) \ + ((This)->lpVtbl->Base.Clear((ID2D1RenderTarget *)This, clearColor)) + +#define ID2D1DCRenderTarget_BeginDraw(This) \ + ((This)->lpVtbl->Base.BeginDraw((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_EndDraw(This, tag1, tag2) \ + ((This)->lpVtbl->Base.EndDraw((ID2D1RenderTarget *)This, tag1, tag2)) + +#define ID2D1DCRenderTarget_GetPixelFormat(This) \ + ((This)->lpVtbl->Base.GetPixelFormat((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_SetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->Base.SetDpi((ID2D1RenderTarget *)This, dpiX, dpiY)) + +#define ID2D1DCRenderTarget_GetDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->Base.GetDpi((ID2D1RenderTarget *)This, dpiX, dpiY)) + +#define ID2D1DCRenderTarget_GetSize(This) \ + ((This)->lpVtbl->Base.GetSize((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_GetPixelSize(This) \ + ((This)->lpVtbl->Base.GetPixelSize((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_GetMaximumBitmapSize(This) \ + ((This)->lpVtbl->Base.GetMaximumBitmapSize((ID2D1RenderTarget *)This)) + +#define ID2D1DCRenderTarget_IsSupported(This, renderTargetProperties) \ + ((This)->lpVtbl->Base.IsSupported((ID2D1RenderTarget *)This, renderTargetProperties)) + +#define ID2D1DCRenderTarget_BindDC(This, hDC, pSubRect) \ + ((This)->lpVtbl->BindDC(This, hDC, pSubRect)) + +typedef interface ID2D1Factory ID2D1Factory; + +typedef struct ID2D1FactoryVtbl +{ + + IUnknownVtbl Base; + + + STDMETHOD(ReloadSystemMetrics)( + ID2D1Factory *This + ) PURE; + + STDMETHOD_(void, GetDesktopDpi)( + ID2D1Factory *This, + __out FLOAT *dpiX, + __out FLOAT *dpiY + ) PURE; + + STDMETHOD(CreateRectangleGeometry)( + ID2D1Factory *This, + __in CONST D2D1_RECT_F *rectangle, + __deref_out ID2D1RectangleGeometry **rectangleGeometry + ) PURE; + + STDMETHOD(CreateRoundedRectangleGeometry)( + ID2D1Factory *This, + __in CONST D2D1_ROUNDED_RECT *roundedRectangle, + __deref_out ID2D1RoundedRectangleGeometry **roundedRectangleGeometry + ) PURE; + + STDMETHOD(CreateEllipseGeometry)( + ID2D1Factory *This, + __in CONST D2D1_ELLIPSE *ellipse, + __deref_out ID2D1EllipseGeometry **ellipseGeometry + ) PURE; + + STDMETHOD(CreateGeometryGroup)( + ID2D1Factory *This, + D2D1_FILL_MODE fillMode, + __in_ecount(geometriesCount) ID2D1Geometry **geometries, + UINT geometriesCount, + __deref_out ID2D1GeometryGroup **geometryGroup + ) PURE; + + STDMETHOD(CreateTransformedGeometry)( + ID2D1Factory *This, + __in ID2D1Geometry *sourceGeometry, + __in CONST D2D1_MATRIX_3X2_F *transform, + __deref_out ID2D1TransformedGeometry **transformedGeometry + ) PURE; + + STDMETHOD(CreatePathGeometry)( + ID2D1Factory *This, + __deref_out ID2D1PathGeometry **pathGeometry + ) PURE; + + STDMETHOD(CreateStrokeStyle)( + ID2D1Factory *This, + __in CONST D2D1_STROKE_STYLE_PROPERTIES *strokeStyleProperties, + __in_ecount_opt(dashesCount) CONST FLOAT *dashes, + UINT dashesCount, + __deref_out ID2D1StrokeStyle **strokeStyle + ) PURE; + + STDMETHOD(CreateDrawingStateBlock)( + ID2D1Factory *This, + __in_opt CONST D2D1_DRAWING_STATE_DESCRIPTION *drawingStateDescription, + __in_opt IDWriteRenderingParams *textRenderingParams, + __deref_out ID2D1DrawingStateBlock **drawingStateBlock + ) PURE; + + STDMETHOD(CreateWicBitmapRenderTarget)( + ID2D1Factory *This, + __in IWICBitmap *target, + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __deref_out ID2D1RenderTarget **renderTarget + ) PURE; + + STDMETHOD(CreateHwndRenderTarget)( + ID2D1Factory *This, + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __in CONST D2D1_HWND_RENDER_TARGET_PROPERTIES *hwndRenderTargetProperties, + __deref_out ID2D1HwndRenderTarget **hwndRenderTarget + ) PURE; + + STDMETHOD(CreateDxgiSurfaceRenderTarget)( + ID2D1Factory *This, + __in IDXGISurface *dxgiSurface, + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __deref_out ID2D1RenderTarget **renderTarget + ) PURE; + + STDMETHOD(CreateDCRenderTarget)( + ID2D1Factory *This, + __in CONST D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, + __deref_out ID2D1DCRenderTarget **dcRenderTarget + ) PURE; +} ID2D1FactoryVtbl; + +interface ID2D1Factory +{ + CONST struct ID2D1FactoryVtbl *lpVtbl; +}; + + +#define ID2D1Factory_QueryInterface(This, riid, ppv) \ + ((This)->lpVtbl->Base.QueryInterface((IUnknown *)This, riid, ppv)) + +#define ID2D1Factory_AddRef(This) \ + ((This)->lpVtbl->Base.AddRef((IUnknown *)This)) + +#define ID2D1Factory_Release(This) \ + ((This)->lpVtbl->Base.Release((IUnknown *)This)) + +#define ID2D1Factory_ReloadSystemMetrics(This) \ + ((This)->lpVtbl->ReloadSystemMetrics(This)) + +#define ID2D1Factory_GetDesktopDpi(This, dpiX, dpiY) \ + ((This)->lpVtbl->GetDesktopDpi(This, dpiX, dpiY)) + +#define ID2D1Factory_CreateRectangleGeometry(This, rectangle, rectangleGeometry) \ + ((This)->lpVtbl->CreateRectangleGeometry(This, rectangle, rectangleGeometry)) + +#define ID2D1Factory_CreateRoundedRectangleGeometry(This, roundedRectangle, roundedRectangleGeometry) \ + ((This)->lpVtbl->CreateRoundedRectangleGeometry(This, roundedRectangle, roundedRectangleGeometry)) + +#define ID2D1Factory_CreateEllipseGeometry(This, ellipse, ellipseGeometry) \ + ((This)->lpVtbl->CreateEllipseGeometry(This, ellipse, ellipseGeometry)) + +#define ID2D1Factory_CreateGeometryGroup(This, fillMode, geometries, geometriesCount, geometryGroup) \ + ((This)->lpVtbl->CreateGeometryGroup(This, fillMode, geometries, geometriesCount, geometryGroup)) + +#define ID2D1Factory_CreateTransformedGeometry(This, sourceGeometry, transform, transformedGeometry) \ + ((This)->lpVtbl->CreateTransformedGeometry(This, sourceGeometry, transform, transformedGeometry)) + +#define ID2D1Factory_CreatePathGeometry(This, pathGeometry) \ + ((This)->lpVtbl->CreatePathGeometry(This, pathGeometry)) + +#define ID2D1Factory_CreateStrokeStyle(This, strokeStyleProperties, dashes, dashesCount, strokeStyle) \ + ((This)->lpVtbl->CreateStrokeStyle(This, strokeStyleProperties, dashes, dashesCount, strokeStyle)) + +#define ID2D1Factory_CreateDrawingStateBlock(This, drawingStateDescription, textRenderingParams, drawingStateBlock) \ + ((This)->lpVtbl->CreateDrawingStateBlock(This, drawingStateDescription, textRenderingParams, drawingStateBlock)) + +#define ID2D1Factory_CreateWicBitmapRenderTarget(This, target, renderTargetProperties, renderTarget) \ + ((This)->lpVtbl->CreateWicBitmapRenderTarget(This, target, renderTargetProperties, renderTarget)) + +#define ID2D1Factory_CreateHwndRenderTarget(This, renderTargetProperties, hwndRenderTargetProperties, hwndRenderTarget) \ + ((This)->lpVtbl->CreateHwndRenderTarget(This, renderTargetProperties, hwndRenderTargetProperties, hwndRenderTarget)) + +#define ID2D1Factory_CreateDxgiSurfaceRenderTarget(This, dxgiSurface, renderTargetProperties, renderTarget) \ + ((This)->lpVtbl->CreateDxgiSurfaceRenderTarget(This, dxgiSurface, renderTargetProperties, renderTarget)) + +#define ID2D1Factory_CreateDCRenderTarget(This, renderTargetProperties, dcRenderTarget) \ + ((This)->lpVtbl->CreateDCRenderTarget(This, renderTargetProperties, dcRenderTarget)) + + +#endif + + +#ifdef __cplusplus +extern "C" +{ +#endif + + // + // This export cannot be in a namespace because compiler name mangling isn't consistent + // also, this must be 'C' callable. + // + HRESULT WINAPI + D2D1CreateFactory( + __in D2D1_FACTORY_TYPE factoryType, + __in REFIID riid, + __in_opt CONST D2D1_FACTORY_OPTIONS *pFactoryOptions, + __out void **ppIFactory + ); + + + void WINAPI + D2D1MakeRotateMatrix( + __in FLOAT angle, + __in D2D1_POINT_2F center, + __out D2D1_MATRIX_3X2_F *matrix + ); + + void WINAPI + D2D1MakeSkewMatrix( + __in FLOAT angleX, + __in FLOAT angleY, + __in D2D1_POINT_2F center, + __out D2D1_MATRIX_3X2_F *matrix + ); + + BOOL WINAPI + D2D1IsMatrixInvertible( + __in CONST D2D1_MATRIX_3X2_F *matrix + ); + + BOOL WINAPI + D2D1InvertMatrix( + __inout D2D1_MATRIX_3X2_F *matrix + ); + +#ifdef __cplusplus +} +#endif + +#ifndef D2D1FORCEINLINE +#define D2D1FORCEINLINE FORCEINLINE +#endif // #ifndef D2D1FORCEINLINE + + +#include + + +#ifndef D2D_USE_C_DEFINITIONS + +inline +HRESULT +D2D1CreateFactory( + __in D2D1_FACTORY_TYPE factoryType, + __in REFIID riid, + __out void **factory + ) +{ + return + D2D1CreateFactory( + factoryType, + riid, + NULL, + factory); +} + + +template +HRESULT +D2D1CreateFactory( + __in D2D1_FACTORY_TYPE factoryType, + __out Factory **factory + ) +{ + return + D2D1CreateFactory( + factoryType, + __uuidof(Factory), + reinterpret_cast(factory)); +} + +template +HRESULT +D2D1CreateFactory( + __in D2D1_FACTORY_TYPE factoryType, + __in CONST D2D1_FACTORY_OPTIONS &factoryOptions, + __out Factory **ppFactory + ) +{ + return + D2D1CreateFactory( + factoryType, + __uuidof(Factory), + &factoryOptions, + reinterpret_cast(ppFactory)); +} + +#endif // #ifndef D2D_USE_C_DEFINITIONS +#endif // #ifndef _D2D1_H_ diff --git a/Src/Decoder_H264_ALL/D3D/include/D2D1Helper.h b/Src/Decoder_H264_ALL/D3D/include/D2D1Helper.h new file mode 100644 index 0000000..2f54ea2 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D2D1Helper.h @@ -0,0 +1,948 @@ + +/*=========================================================================*\ + + Copyright (c) Microsoft Corporation. All rights reserved. + + File: D2D1helper.h + + Module Name: D2D + + Description: Helper files over the D2D interfaces and APIs. + +\*=========================================================================*/ +#pragma once + +#ifndef _D2D1_HELPER_H_ +#define _D2D1_HELPER_H_ + +#ifndef _D2D1_H_ +#include +#endif // #ifndef _D2D1_H_ + +#ifndef D2D_USE_C_DEFINITIONS + +namespace D2D1 +{ + // + // Forward declared IdentityMatrix function to allow matrix class to use + // these constructors. + // + D2D1FORCEINLINE + D2D1_MATRIX_3X2_F + IdentityMatrix(); + + // + // The default trait type for objects in D2D is float. + // + template + struct TypeTraits + { + typedef D2D1_POINT_2F Point; + typedef D2D1_SIZE_F Size; + typedef D2D1_RECT_F Rect; + }; + + template<> + struct TypeTraits + { + typedef D2D1_POINT_2U Point; + typedef D2D1_SIZE_U Size; + typedef D2D1_RECT_U Rect; + }; + + static inline + FLOAT FloatMax() + { + #ifdef FLT_MAX + return FLT_MAX; + #else + return 3.402823466e+38F; + #endif + } + + // + // Construction helpers + // + template + D2D1FORCEINLINE + typename TypeTraits::Point + Point2( + Type x, + Type y + ) + { + typename TypeTraits::Point point = { x, y }; + + return point; + } + + D2D1FORCEINLINE + D2D1_POINT_2F + Point2F( + FLOAT x = 0.f, + FLOAT y = 0.f + ) + { + return Point2(x, y); + } + + D2D1FORCEINLINE + D2D1_POINT_2U + Point2U( + UINT32 x = 0, + UINT32 y = 0 + ) + { + return Point2(x, y); + } + + template + D2D1FORCEINLINE + typename TypeTraits::Size + Size( + Type width, + Type height + ) + { + typename TypeTraits::Size size = { width, height }; + + return size; + } + + D2D1FORCEINLINE + D2D1_SIZE_F + SizeF( + FLOAT width = 0.f, + FLOAT height = 0.f + ) + { + return Size(width, height); + } + + D2D1FORCEINLINE + D2D1_SIZE_U + SizeU( + UINT32 width = 0, + UINT32 height = 0 + ) + { + return Size(width, height); + } + + template + D2D1FORCEINLINE + typename TypeTraits::Rect + Rect( + Type left, + Type top, + Type right, + Type bottom + ) + { + typename TypeTraits::Rect rect = { left, top, right, bottom }; + + return rect; + } + + D2D1FORCEINLINE + D2D1_RECT_F + RectF( + FLOAT left = 0.f, + FLOAT top = 0.f, + FLOAT right = 0.f, + FLOAT bottom = 0.f + ) + { + return Rect(left, top, right, bottom); + } + + D2D1FORCEINLINE + D2D1_RECT_U + RectU( + UINT32 left = 0, + UINT32 top = 0, + UINT32 right = 0, + UINT32 bottom = 0 + ) + { + return Rect(left, top, right, bottom); + } + + D2D1FORCEINLINE + D2D1_RECT_F + InfiniteRect() + { + D2D1_RECT_F rect = { -FloatMax(), -FloatMax(), FloatMax(), FloatMax() }; + + return rect; + } + + D2D1FORCEINLINE + D2D1_ARC_SEGMENT + ArcSegment( + __in CONST D2D1_POINT_2F &point, + __in CONST D2D1_SIZE_F &size, + __in FLOAT rotationAngle, + __in D2D1_SWEEP_DIRECTION sweepDirection, + __in D2D1_ARC_SIZE arcSize + ) + { + D2D1_ARC_SEGMENT arcSegment = { point, size, rotationAngle, sweepDirection, arcSize }; + + return arcSegment; + } + + D2D1FORCEINLINE + D2D1_BEZIER_SEGMENT + BezierSegment( + __in CONST D2D1_POINT_2F &point1, + __in CONST D2D1_POINT_2F &point2, + __in CONST D2D1_POINT_2F &point3 + ) + { + D2D1_BEZIER_SEGMENT bezierSegment = { point1, point2, point3 }; + + return bezierSegment; + } + + D2D1FORCEINLINE + D2D1_ELLIPSE + Ellipse( + __in CONST D2D1_POINT_2F ¢er, + FLOAT radiusX, + FLOAT radiusY + ) + { + D2D1_ELLIPSE ellipse; + + ellipse.point = center; + ellipse.radiusX = radiusX; + ellipse.radiusY = radiusY; + + return ellipse; + } + + D2D1FORCEINLINE + D2D1_ROUNDED_RECT + RoundedRect( + __in CONST D2D1_RECT_F &rect, + FLOAT radiusX, + FLOAT radiusY + ) + { + D2D1_ROUNDED_RECT roundedRect; + + roundedRect.rect = rect; + roundedRect.radiusX = radiusX; + roundedRect.radiusY = radiusY; + + return roundedRect; + } + + D2D1FORCEINLINE + D2D1_BRUSH_PROPERTIES + BrushProperties( + __in FLOAT opacity = 1.0, + __in CONST D2D1_MATRIX_3X2_F &transform = D2D1::IdentityMatrix() + ) + { + D2D1_BRUSH_PROPERTIES brushProperties; + + brushProperties.opacity = opacity; + brushProperties.transform = transform; + + return brushProperties; + } + + D2D1FORCEINLINE + D2D1_GRADIENT_STOP + GradientStop( + FLOAT position, + __in CONST D2D1_COLOR_F &color + ) + { + D2D1_GRADIENT_STOP gradientStop = { position, color }; + + return gradientStop; + } + + D2D1FORCEINLINE + D2D1_QUADRATIC_BEZIER_SEGMENT + QuadraticBezierSegment( + __in CONST D2D1_POINT_2F &point1, + __in CONST D2D1_POINT_2F &point2 + ) + { + D2D1_QUADRATIC_BEZIER_SEGMENT quadraticBezier = { point1, point2 }; + + return quadraticBezier; + } + + D2D1FORCEINLINE + D2D1_STROKE_STYLE_PROPERTIES + StrokeStyleProperties( + D2D1_CAP_STYLE startCap = D2D1_CAP_STYLE_FLAT, + D2D1_CAP_STYLE endCap = D2D1_CAP_STYLE_FLAT, + D2D1_CAP_STYLE dashCap = D2D1_CAP_STYLE_FLAT, + D2D1_LINE_JOIN lineJoin = D2D1_LINE_JOIN_MITER, + FLOAT miterLimit = 10.0f, + D2D1_DASH_STYLE dashStyle = D2D1_DASH_STYLE_SOLID, + FLOAT dashOffset = 0.0f + ) + { + D2D1_STROKE_STYLE_PROPERTIES strokeStyleProperties; + + strokeStyleProperties.startCap = startCap; + strokeStyleProperties.endCap = endCap; + strokeStyleProperties.dashCap = dashCap; + strokeStyleProperties.lineJoin = lineJoin; + strokeStyleProperties.miterLimit = miterLimit; + strokeStyleProperties.dashStyle = dashStyle; + strokeStyleProperties.dashOffset = dashOffset; + + return strokeStyleProperties; + } + + D2D1FORCEINLINE + D2D1_BITMAP_BRUSH_PROPERTIES + BitmapBrushProperties( + D2D1_EXTEND_MODE extendModeX = D2D1_EXTEND_MODE_CLAMP, + D2D1_EXTEND_MODE extendModeY = D2D1_EXTEND_MODE_CLAMP, + D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR + ) + { + D2D1_BITMAP_BRUSH_PROPERTIES bitmapBrushProperties; + + bitmapBrushProperties.extendModeX = extendModeX; + bitmapBrushProperties.extendModeY = extendModeY; + bitmapBrushProperties.interpolationMode = interpolationMode; + + return bitmapBrushProperties; + } + + D2D1FORCEINLINE + D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES + LinearGradientBrushProperties( + __in CONST D2D1_POINT_2F &startPoint, + __in CONST D2D1_POINT_2F &endPoint + ) + { + D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES linearGradientBrushProperties; + + linearGradientBrushProperties.startPoint = startPoint; + linearGradientBrushProperties.endPoint = endPoint; + + return linearGradientBrushProperties; + } + + D2D1FORCEINLINE + D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES + RadialGradientBrushProperties( + __in CONST D2D1_POINT_2F ¢er, + __in CONST D2D1_POINT_2F &gradientOriginOffset, + FLOAT radiusX, + FLOAT radiusY + ) + { + D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES radialGradientBrushProperties; + + radialGradientBrushProperties.center = center; + radialGradientBrushProperties.gradientOriginOffset = gradientOriginOffset; + radialGradientBrushProperties.radiusX = radiusX; + radialGradientBrushProperties.radiusY = radiusY; + + return radialGradientBrushProperties; + } + + // + // PixelFormat + // + D2D1FORCEINLINE + D2D1_PIXEL_FORMAT + PixelFormat( + __in DXGI_FORMAT dxgiFormat = DXGI_FORMAT_UNKNOWN, + __in D2D1_ALPHA_MODE alphaMode = D2D1_ALPHA_MODE_UNKNOWN + ) + { + D2D1_PIXEL_FORMAT pixelFormat; + + pixelFormat.format = dxgiFormat; + pixelFormat.alphaMode = alphaMode; + + return pixelFormat; + } + + // + // Bitmaps + // + D2D1FORCEINLINE + D2D1_BITMAP_PROPERTIES + BitmapProperties( + CONST D2D1_PIXEL_FORMAT &pixelFormat = D2D1::PixelFormat(), + FLOAT dpiX = 96.0f, + FLOAT dpiY = 96.0f + ) + { + D2D1_BITMAP_PROPERTIES bitmapProperties; + + bitmapProperties.pixelFormat = pixelFormat; + bitmapProperties.dpiX = dpiX; + bitmapProperties.dpiY = dpiY; + + return bitmapProperties; + } + + // + // Render Targets + // + D2D1FORCEINLINE + D2D1_RENDER_TARGET_PROPERTIES + RenderTargetProperties( + D2D1_RENDER_TARGET_TYPE type = D2D1_RENDER_TARGET_TYPE_DEFAULT, + __in CONST D2D1_PIXEL_FORMAT &pixelFormat = D2D1::PixelFormat(), + FLOAT dpiX = 0.0, + FLOAT dpiY = 0.0, + D2D1_RENDER_TARGET_USAGE usage = D2D1_RENDER_TARGET_USAGE_NONE, + D2D1_FEATURE_LEVEL minLevel = D2D1_FEATURE_LEVEL_DEFAULT + ) + { + D2D1_RENDER_TARGET_PROPERTIES renderTargetProperties; + + renderTargetProperties.type = type; + renderTargetProperties.pixelFormat = pixelFormat; + renderTargetProperties.dpiX = dpiX; + renderTargetProperties.dpiY = dpiY; + renderTargetProperties.usage = usage; + renderTargetProperties.minLevel = minLevel; + + return renderTargetProperties; + } + + D2D1FORCEINLINE + D2D1_HWND_RENDER_TARGET_PROPERTIES + HwndRenderTargetProperties( + __in HWND hwnd, + __in D2D1_SIZE_U pixelSize = D2D1::Size(static_cast(0), static_cast(0)), + __in D2D1_PRESENT_OPTIONS presentOptions = D2D1_PRESENT_OPTIONS_NONE + ) + { + D2D1_HWND_RENDER_TARGET_PROPERTIES hwndRenderTargetProperties; + + hwndRenderTargetProperties.hwnd = hwnd; + hwndRenderTargetProperties.pixelSize = pixelSize; + hwndRenderTargetProperties.presentOptions = presentOptions; + + return hwndRenderTargetProperties; + } + + D2D1FORCEINLINE + D2D1_LAYER_PARAMETERS + LayerParameters( + __in CONST D2D1_RECT_F &contentBounds = D2D1::InfiniteRect(), + __in_opt ID2D1Geometry *geometricMask = NULL, + D2D1_ANTIALIAS_MODE maskAntialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, + D2D1_MATRIX_3X2_F maskTransform = D2D1::IdentityMatrix(), + FLOAT opacity = 1.0, + __in_opt ID2D1Brush *opacityBrush = NULL, + D2D1_LAYER_OPTIONS layerOptions = D2D1_LAYER_OPTIONS_NONE + ) + { + D2D1_LAYER_PARAMETERS layerParameters = { 0 }; + + layerParameters.contentBounds = contentBounds; + layerParameters.geometricMask = geometricMask; + layerParameters.maskAntialiasMode = maskAntialiasMode; + layerParameters.maskTransform = maskTransform; + layerParameters.opacity = opacity; + layerParameters.opacityBrush = opacityBrush; + layerParameters.layerOptions = layerOptions; + + return layerParameters; + } + + D2D1FORCEINLINE + D2D1_DRAWING_STATE_DESCRIPTION + DrawingStateDescription( + D2D1_ANTIALIAS_MODE antialiasMode = D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, + D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode = D2D1_TEXT_ANTIALIAS_MODE_DEFAULT, + D2D1_TAG tag1 = 0, + D2D1_TAG tag2 = 0, + __in const D2D1_MATRIX_3X2_F &transform = D2D1::IdentityMatrix() + ) + { + D2D1_DRAWING_STATE_DESCRIPTION drawingStateDescription; + + drawingStateDescription.antialiasMode = antialiasMode; + drawingStateDescription.textAntialiasMode = textAntialiasMode; + drawingStateDescription.tag1 = tag1; + drawingStateDescription.tag2 = tag2; + drawingStateDescription.transform = transform; + + return drawingStateDescription; + } + + // + // Colors, this enum defines a set of predefined colors. + // + class ColorF : public D2D1_COLOR_F + { + public: + + enum Enum + { + AliceBlue = 0xF0F8FF, + AntiqueWhite = 0xFAEBD7, + Aqua = 0x00FFFF, + Aquamarine = 0x7FFFD4, + Azure = 0xF0FFFF, + Beige = 0xF5F5DC, + Bisque = 0xFFE4C4, + Black = 0x000000, + BlanchedAlmond = 0xFFEBCD, + Blue = 0x0000FF, + BlueViolet = 0x8A2BE2, + Brown = 0xA52A2A, + BurlyWood = 0xDEB887, + CadetBlue = 0x5F9EA0, + Chartreuse = 0x7FFF00, + Chocolate = 0xD2691E, + Coral = 0xFF7F50, + CornflowerBlue = 0x6495ED, + Cornsilk = 0xFFF8DC, + Crimson = 0xDC143C, + Cyan = 0x00FFFF, + DarkBlue = 0x00008B, + DarkCyan = 0x008B8B, + DarkGoldenrod = 0xB8860B, + DarkGray = 0xA9A9A9, + DarkGreen = 0x006400, + DarkKhaki = 0xBDB76B, + DarkMagenta = 0x8B008B, + DarkOliveGreen = 0x556B2F, + DarkOrange = 0xFF8C00, + DarkOrchid = 0x9932CC, + DarkRed = 0x8B0000, + DarkSalmon = 0xE9967A, + DarkSeaGreen = 0x8FBC8F, + DarkSlateBlue = 0x483D8B, + DarkSlateGray = 0x2F4F4F, + DarkTurquoise = 0x00CED1, + DarkViolet = 0x9400D3, + DeepPink = 0xFF1493, + DeepSkyBlue = 0x00BFFF, + DimGray = 0x696969, + DodgerBlue = 0x1E90FF, + Firebrick = 0xB22222, + FloralWhite = 0xFFFAF0, + ForestGreen = 0x228B22, + Fuchsia = 0xFF00FF, + Gainsboro = 0xDCDCDC, + GhostWhite = 0xF8F8FF, + Gold = 0xFFD700, + Goldenrod = 0xDAA520, + Gray = 0x808080, + Green = 0x008000, + GreenYellow = 0xADFF2F, + Honeydew = 0xF0FFF0, + HotPink = 0xFF69B4, + IndianRed = 0xCD5C5C, + Indigo = 0x4B0082, + Ivory = 0xFFFFF0, + Khaki = 0xF0E68C, + Lavender = 0xE6E6FA, + LavenderBlush = 0xFFF0F5, + LawnGreen = 0x7CFC00, + LemonChiffon = 0xFFFACD, + LightBlue = 0xADD8E6, + LightCoral = 0xF08080, + LightCyan = 0xE0FFFF, + LightGoldenrodYellow = 0xFAFAD2, + LightGreen = 0x90EE90, + LightGray = 0xD3D3D3, + LightPink = 0xFFB6C1, + LightSalmon = 0xFFA07A, + LightSeaGreen = 0x20B2AA, + LightSkyBlue = 0x87CEFA, + LightSlateGray = 0x778899, + LightSteelBlue = 0xB0C4DE, + LightYellow = 0xFFFFE0, + Lime = 0x00FF00, + LimeGreen = 0x32CD32, + Linen = 0xFAF0E6, + Magenta = 0xFF00FF, + Maroon = 0x800000, + MediumAquamarine = 0x66CDAA, + MediumBlue = 0x0000CD, + MediumOrchid = 0xBA55D3, + MediumPurple = 0x9370DB, + MediumSeaGreen = 0x3CB371, + MediumSlateBlue = 0x7B68EE, + MediumSpringGreen = 0x00FA9A, + MediumTurquoise = 0x48D1CC, + MediumVioletRed = 0xC71585, + MidnightBlue = 0x191970, + MintCream = 0xF5FFFA, + MistyRose = 0xFFE4E1, + Moccasin = 0xFFE4B5, + NavajoWhite = 0xFFDEAD, + Navy = 0x000080, + OldLace = 0xFDF5E6, + Olive = 0x808000, + OliveDrab = 0x6B8E23, + Orange = 0xFFA500, + OrangeRed = 0xFF4500, + Orchid = 0xDA70D6, + PaleGoldenrod = 0xEEE8AA, + PaleGreen = 0x98FB98, + PaleTurquoise = 0xAFEEEE, + PaleVioletRed = 0xDB7093, + PapayaWhip = 0xFFEFD5, + PeachPuff = 0xFFDAB9, + Peru = 0xCD853F, + Pink = 0xFFC0CB, + Plum = 0xDDA0DD, + PowderBlue = 0xB0E0E6, + Purple = 0x800080, + Red = 0xFF0000, + RosyBrown = 0xBC8F8F, + RoyalBlue = 0x4169E1, + SaddleBrown = 0x8B4513, + Salmon = 0xFA8072, + SandyBrown = 0xF4A460, + SeaGreen = 0x2E8B57, + SeaShell = 0xFFF5EE, + Sienna = 0xA0522D, + Silver = 0xC0C0C0, + SkyBlue = 0x87CEEB, + SlateBlue = 0x6A5ACD, + SlateGray = 0x708090, + Snow = 0xFFFAFA, + SpringGreen = 0x00FF7F, + SteelBlue = 0x4682B4, + Tan = 0xD2B48C, + Teal = 0x008080, + Thistle = 0xD8BFD8, + Tomato = 0xFF6347, + Turquoise = 0x40E0D0, + Violet = 0xEE82EE, + Wheat = 0xF5DEB3, + White = 0xFFFFFF, + WhiteSmoke = 0xF5F5F5, + Yellow = 0xFFFF00, + YellowGreen = 0x9ACD32, + }; + + // + // Construct a color, note that the alpha value from the "rgb" component + // is never used. + // + D2D1FORCEINLINE + ColorF( + UINT32 rgb, + FLOAT a = 1.0 + ) + { + Init(rgb, a); + } + + D2D1FORCEINLINE + ColorF( + Enum knownColor, + FLOAT a = 1.0 + ) + { + Init(knownColor, a); + } + + D2D1FORCEINLINE + ColorF( + FLOAT r, + FLOAT g, + FLOAT b, + FLOAT a = 1.0 + ) + { + this->r = r; + this->g = g; + this->b = b; + this->a = a; + } + + private: + + D2D1FORCEINLINE + void + Init( + UINT32 rgb, + FLOAT a + ) + { + this->r = static_cast((rgb & sc_redMask) >> sc_redShift) / 255.f; + this->g = static_cast((rgb & sc_greenMask) >> sc_greenShift) / 255.f; + this->b = static_cast((rgb & sc_blueMask) >> sc_blueShift) / 255.f; + this->a = a; + } + + static const UINT32 sc_redShift = 16; + static const UINT32 sc_greenShift = 8; + static const UINT32 sc_blueShift = 0; + + static const UINT32 sc_redMask = 0xff << sc_redShift; + static const UINT32 sc_greenMask = 0xff << sc_greenShift; + static const UINT32 sc_blueMask = 0xff << sc_blueShift; + }; + + class Matrix3x2F : public D2D1_MATRIX_3X2_F + { + public: + + D2D1FORCEINLINE + Matrix3x2F( + FLOAT _11, + FLOAT _12, + FLOAT _21, + FLOAT _22, + FLOAT _31, + FLOAT _32 + ) + { + this->_11 = _11; + this->_12 = _12; + this->_21 = _21; + this->_22 = _22; + this->_31 = _31; + this->_32 = _32; + } + + // + // Creates an identity matrix + // + D2D1FORCEINLINE + Matrix3x2F( + ) + { + } + + // + // Named quasi-constructors + // + static D2D1FORCEINLINE + Matrix3x2F + Identity() + { + Matrix3x2F identity; + + identity._11 = 1.f; + identity._12 = 0.f; + identity._21 = 0.f; + identity._22 = 1.f; + identity._31 = 0.f; + identity._32 = 0.f; + + return identity; + } + + static D2D1FORCEINLINE + Matrix3x2F + Translation( + D2D1_SIZE_F size + ) + { + Matrix3x2F translation; + + translation._11 = 1.0; translation._12 = 0.0; + translation._21 = 0.0; translation._22 = 1.0; + translation._31 = size.width; translation._32 = size.height; + + return translation; + } + + static D2D1FORCEINLINE + Matrix3x2F + Translation( + FLOAT x, + FLOAT y + ) + { + return Translation(SizeF(x, y)); + } + + + static D2D1FORCEINLINE + Matrix3x2F + Scale( + D2D1_SIZE_F size, + D2D1_POINT_2F center = D2D1::Point2F() + ) + { + Matrix3x2F scale; + + scale._11 = size.width; scale._12 = 0.0; + scale._21 = 0.0; scale._22 = size.height; + scale._31 = center.x - size.width * center.x; + scale._32 = center.y - size.height * center.y; + + return scale; + } + + static D2D1FORCEINLINE + Matrix3x2F + Scale( + FLOAT x, + FLOAT y, + D2D1_POINT_2F center = D2D1::Point2F() + ) + { + return Scale(SizeF(x, y), center); + } + + static D2D1FORCEINLINE + Matrix3x2F + Rotation( + FLOAT angle, + D2D1_POINT_2F center = D2D1::Point2F() + ) + { + Matrix3x2F rotation; + + D2D1MakeRotateMatrix(angle, center, &rotation); + + return rotation; + } + + static D2D1FORCEINLINE + Matrix3x2F + Skew( + FLOAT angleX, + FLOAT angleY, + D2D1_POINT_2F center = D2D1::Point2F() + ) + { + Matrix3x2F skew; + + D2D1MakeSkewMatrix(angleX, angleY, center, &skew); + + return skew; + } + + // + // Functions for convertion from the base D2D1_MATRIX_3X2_F to this type + // without making a copy + // + static inline const Matrix3x2F* ReinterpretBaseType(const D2D1_MATRIX_3X2_F *pMatrix) + { + return static_cast(pMatrix); + } + + static inline Matrix3x2F* ReinterpretBaseType(D2D1_MATRIX_3X2_F *pMatrix) + { + return static_cast(pMatrix); + } + + inline + FLOAT + Determinant() const + { + return (_11 * _22) - (_12 * _21); + } + + inline + bool + IsInvertible() const + { + return !!D2D1IsMatrixInvertible(this); + } + + inline + bool + Invert() + { + return !!D2D1InvertMatrix(this); + } + + inline + bool + IsIdentity() const + { + return _11 == 1.f && _12 == 0.f + && _21 == 0.f && _22 == 1.f + && _31 == 0.f && _32 == 0.f; + } + + inline + void SetProduct( + const Matrix3x2F &a, + const Matrix3x2F &b + ) + { + _11 = a._11 * b._11 + a._12 * b._21; + _12 = a._11 * b._12 + a._12 * b._22; + _21 = a._21 * b._11 + a._22 * b._21; + _22 = a._21 * b._12 + a._22 * b._22; + _31 = a._31 * b._11 + a._32 * b._21 + b._31; + _32 = a._31 * b._12 + a._32 * b._22 + b._32; + } + + D2D1FORCEINLINE + Matrix3x2F + operator*( + const Matrix3x2F &matrix + ) const + { + Matrix3x2F result; + + result.SetProduct(*this, matrix); + + return result; + } + + D2D1FORCEINLINE + D2D1_POINT_2F + TransformPoint( + D2D1_POINT_2F point + ) const + { + D2D1_POINT_2F result = + { + point.x * _11 + point.y * _21 + _31, + point.x * _12 + point.y * _22 + _32 + }; + + return result; + } + }; + + D2D1FORCEINLINE + D2D1_POINT_2F + operator*( + const D2D1_POINT_2F &point, + const D2D1_MATRIX_3X2_F &matrix + ) + { + return Matrix3x2F::ReinterpretBaseType(&matrix)->TransformPoint(point); + } + + D2D1_MATRIX_3X2_F + IdentityMatrix() + { + return Matrix3x2F::Identity(); + } + +} // namespace D2D1 + +D2D1FORCEINLINE +D2D1_MATRIX_3X2_F +operator*( + const D2D1_MATRIX_3X2_F &matrix1, + const D2D1_MATRIX_3X2_F &matrix2 + ) +{ + return + (*D2D1::Matrix3x2F::ReinterpretBaseType(&matrix1)) * + (*D2D1::Matrix3x2F::ReinterpretBaseType(&matrix2)); +} + +#endif // #ifndef D2D_USE_C_DEFINITIONS + +#endif // #ifndef _D2D1_HELPER_H_ + diff --git a/Src/Decoder_H264_ALL/D3D/include/D2DBaseTypes.h b/Src/Decoder_H264_ALL/D3D/include/D2DBaseTypes.h new file mode 100644 index 0000000..c2ff5bb --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D2DBaseTypes.h @@ -0,0 +1,145 @@ +//--------------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This file is automatically generated. Please do not edit it directly. +// +// File name: D2DBaseTypes.h +//--------------------------------------------------------------------------- +#pragma once + + +#ifndef _D2DBASETYPES_INCLUDED +#define _D2DBASETYPES_INCLUDED + +#ifndef COM_NO_WINDOWS_H +#include +#endif // #ifndef COM_NO_WINDOWS_H + +#ifndef D3DCOLORVALUE_DEFINED + +//+----------------------------------------------------------------------------- +// +// Struct: +// D3DCOLORVALUE +// +//------------------------------------------------------------------------------ +typedef struct D3DCOLORVALUE +{ + FLOAT r; + FLOAT g; + FLOAT b; + FLOAT a; + +} D3DCOLORVALUE; + +#define D3DCOLORVALUE_DEFINED +#endif + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D_POINT_2U +// +//------------------------------------------------------------------------------ +typedef struct D2D_POINT_2U +{ + UINT32 x; + UINT32 y; + +} D2D_POINT_2U; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D_POINT_2F +// +//------------------------------------------------------------------------------ +typedef struct D2D_POINT_2F +{ + FLOAT x; + FLOAT y; + +} D2D_POINT_2F; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D_RECT_F +// +//------------------------------------------------------------------------------ +typedef struct D2D_RECT_F +{ + FLOAT left; + FLOAT top; + FLOAT right; + FLOAT bottom; + +} D2D_RECT_F; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D_RECT_U +// +//------------------------------------------------------------------------------ +typedef struct D2D_RECT_U +{ + UINT32 left; + UINT32 top; + UINT32 right; + UINT32 bottom; + +} D2D_RECT_U; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D_SIZE_F +// +//------------------------------------------------------------------------------ +typedef struct D2D_SIZE_F +{ + FLOAT width; + FLOAT height; + +} D2D_SIZE_F; + + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D_SIZE_U +// +//------------------------------------------------------------------------------ +typedef struct D2D_SIZE_U +{ + UINT32 width; + UINT32 height; + +} D2D_SIZE_U; + +typedef D3DCOLORVALUE D2D_COLOR_F; + +//+----------------------------------------------------------------------------- +// +// Struct: +// D2D_MATRIX_3X2_F +// +//------------------------------------------------------------------------------ +typedef struct D2D_MATRIX_3X2_F +{ + FLOAT _11; + FLOAT _12; + FLOAT _21; + FLOAT _22; + FLOAT _31; + FLOAT _32; + +} D2D_MATRIX_3X2_F; + +#endif // #ifndef _D2DBASETYPES_INCLUDED diff --git a/Src/Decoder_H264_ALL/D3D/include/D2Derr.h b/Src/Decoder_H264_ALL/D3D/include/D2Derr.h new file mode 100644 index 0000000..afbaa36 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D2Derr.h @@ -0,0 +1,206 @@ +/*=========================================================================*\ + + Copyright (c) Microsoft Corporation. All rights reserved. + +\*=========================================================================*/ + +#pragma once + +/*=========================================================================*\ + D2D Status Codes +\*=========================================================================*/ + +#define FACILITY_D2D 0x899 + +#define MAKE_D2DHR( sev, code )\ + MAKE_HRESULT( sev, FACILITY_D2D, (code) ) + +#define MAKE_D2DHR_ERR( code )\ + MAKE_D2DHR( 1, code ) + + +//+---------------------------------------------------------------------------- +// +// D2D error codes +// +//------------------------------------------------------------------------------ + +// +// Error codes shared with WINCODECS +// + +// +// The pixel format is not supported. +// +#define D2DERR_UNSUPPORTED_PIXEL_FORMAT WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT + +// +// Error codes that were already returned in prior versions and were part of the +// MIL facility. + +// +// Error codes mapped from WIN32 where there isn't already another HRESULT based +// define +// + +// +// The supplied buffer was too small to accomodate the data. +// +#define D2DERR_INSUFFICIENT_BUFFER HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) + + +// +// D2D specific codes +// + +// +// The object was not in the correct state to process the method. +// +#define D2DERR_WRONG_STATE MAKE_D2DHR_ERR(0x001) + +// +// The object has not yet been initialized. +// +#define D2DERR_NOT_INITIALIZED MAKE_D2DHR_ERR(0x002) + +// +// The requested opertion is not supported. +// +#define D2DERR_UNSUPPORTED_OPERATION MAKE_D2DHR_ERR(0x003) + +// +// The geomery scanner failed to process the data. +// +#define D2DERR_SCANNER_FAILED MAKE_D2DHR_ERR(0x004) + +// +// D2D could not access the screen. +// +#define D2DERR_SCREEN_ACCESS_DENIED MAKE_D2DHR_ERR(0x005) + +// +// A valid display state could not be determined. +// +#define D2DERR_DISPLAY_STATE_INVALID MAKE_D2DHR_ERR(0x006) + +// +// The supplied vector is vero. +// +#define D2DERR_ZERO_VECTOR MAKE_D2DHR_ERR(0x007) + +// +// An internal error (D2D bug) occurred. On checked builds, we would assert. +// +// The application should close this instance of D2D and should consider +// restarting its process. +// +#define D2DERR_INTERNAL_ERROR MAKE_D2DHR_ERR(0x008) + +// +// The display format we need to render is not supported by the +// hardware device. +// +#define D2DERR_DISPLAY_FORMAT_NOT_SUPPORTED MAKE_D2DHR_ERR(0x009) + +// +// A call to this method is invalid. +// +#define D2DERR_INVALID_CALL MAKE_D2DHR_ERR(0x00A) + +// +// No HW rendering device is available for this operation. +// +#define D2DERR_NO_HARDWARE_DEVICE MAKE_D2DHR_ERR(0x00B) + +// +// There has been a presentation error that may be recoverable. The caller +// needs to recreate, rerender the entire frame, and reattempt present. +// +#define D2DERR_RECREATE_TARGET MAKE_D2DHR_ERR(0x00C) + +// +// Shader construction failed because it was too complex. +// +#define D2DERR_TOO_MANY_SHADER_ELEMENTS MAKE_D2DHR_ERR(0x00D) + +// +// Shader compilation failed. +// +#define D2DERR_SHADER_COMPILE_FAILED MAKE_D2DHR_ERR(0x00E) + +// +// Requested DX surface size exceeded maximum texture size. +// +#define D2DERR_MAX_TEXTURE_SIZE_EXCEEDED MAKE_D2DHR_ERR(0x00F) + +// +// The requested D2D version is not supported. +// +#define D2DERR_UNSUPPORTED_VERSION MAKE_D2DHR_ERR(0x010) + +// +// Invalid number. +// +#define D2DERR_BAD_NUMBER MAKE_D2DHR_ERR(0x0011) + +// +// Objects used together must be created from the same factory instance. +// +#define D2DERR_WRONG_FACTORY MAKE_D2DHR_ERR(0x012) + +// +// A layer resource can only be in use once at any point in time. +// +#define D2DERR_LAYER_ALREADY_IN_USE MAKE_D2DHR_ERR(0x013) + +// +// The pop call did not match the corresponding push call +// +#define D2DERR_POP_CALL_DID_NOT_MATCH_PUSH MAKE_D2DHR_ERR(0x014) + +// +// The resource was realized on the wrong render target +// +#define D2DERR_WRONG_RESOURCE_DOMAIN MAKE_D2DHR_ERR(0x015) + +// +// The push and pop calls were unbalanced +// +#define D2DERR_PUSH_POP_UNBALANCED MAKE_D2DHR_ERR(0x016) + +// +// Attempt to copy from a render target while a layer or clip rect is applied +// +#define D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT MAKE_D2DHR_ERR(0x017) + +// +// The brush types are incompatible for the call. +// +#define D2DERR_INCOMPATIBLE_BRUSH_TYPES MAKE_D2DHR_ERR(0x018) + +// +// An unknown win32 failure occurred. +// +#define D2DERR_WIN32_ERROR MAKE_D2DHR_ERR(0x019) + +// +// The render target is not compatible with GDI +// +#define D2DERR_TARGET_NOT_GDI_COMPATIBLE MAKE_D2DHR_ERR(0x01A) + +// +// A text client drawing effect object is of the wrong type +// +#define D2DERR_TEXT_EFFECT_IS_WRONG_TYPE MAKE_D2DHR_ERR(0x01B) + +// +// The application is holding a reference to the IDWriteTextRenderer interface +// after the corresponding DrawText or DrawTextLayout call has returned. The +// IDWriteTextRenderer instance will be zombied. +// +#define D2DERR_TEXT_RENDERER_NOT_RELEASED MAKE_D2DHR_ERR(0x01C) + +// +// The requested size is larger than the guaranteed supported texture size. +// +#define D2DERR_EXCEEDS_MAX_BITMAP_SIZE MAKE_D2DHR_ERR(0x01D) diff --git a/Src/Decoder_H264_ALL/D3D/include/D3D10.h b/Src/Decoder_H264_ALL/D3D/include/D3D10.h new file mode 100644 index 0000000..e9d9dca --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3D10.h @@ -0,0 +1,6762 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * + *-------------------------------------------------------------------------------------*/ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0555 */ +/* Compiler settings for d3d10.idl: + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 7.00.0555 + protocol : all , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d10_h__ +#define __d3d10_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ID3D10DeviceChild_FWD_DEFINED__ +#define __ID3D10DeviceChild_FWD_DEFINED__ +typedef interface ID3D10DeviceChild ID3D10DeviceChild; +#endif /* __ID3D10DeviceChild_FWD_DEFINED__ */ + + +#ifndef __ID3D10DepthStencilState_FWD_DEFINED__ +#define __ID3D10DepthStencilState_FWD_DEFINED__ +typedef interface ID3D10DepthStencilState ID3D10DepthStencilState; +#endif /* __ID3D10DepthStencilState_FWD_DEFINED__ */ + + +#ifndef __ID3D10BlendState_FWD_DEFINED__ +#define __ID3D10BlendState_FWD_DEFINED__ +typedef interface ID3D10BlendState ID3D10BlendState; +#endif /* __ID3D10BlendState_FWD_DEFINED__ */ + + +#ifndef __ID3D10RasterizerState_FWD_DEFINED__ +#define __ID3D10RasterizerState_FWD_DEFINED__ +typedef interface ID3D10RasterizerState ID3D10RasterizerState; +#endif /* __ID3D10RasterizerState_FWD_DEFINED__ */ + + +#ifndef __ID3D10Resource_FWD_DEFINED__ +#define __ID3D10Resource_FWD_DEFINED__ +typedef interface ID3D10Resource ID3D10Resource; +#endif /* __ID3D10Resource_FWD_DEFINED__ */ + + +#ifndef __ID3D10Buffer_FWD_DEFINED__ +#define __ID3D10Buffer_FWD_DEFINED__ +typedef interface ID3D10Buffer ID3D10Buffer; +#endif /* __ID3D10Buffer_FWD_DEFINED__ */ + + +#ifndef __ID3D10Texture1D_FWD_DEFINED__ +#define __ID3D10Texture1D_FWD_DEFINED__ +typedef interface ID3D10Texture1D ID3D10Texture1D; +#endif /* __ID3D10Texture1D_FWD_DEFINED__ */ + + +#ifndef __ID3D10Texture2D_FWD_DEFINED__ +#define __ID3D10Texture2D_FWD_DEFINED__ +typedef interface ID3D10Texture2D ID3D10Texture2D; +#endif /* __ID3D10Texture2D_FWD_DEFINED__ */ + + +#ifndef __ID3D10Texture3D_FWD_DEFINED__ +#define __ID3D10Texture3D_FWD_DEFINED__ +typedef interface ID3D10Texture3D ID3D10Texture3D; +#endif /* __ID3D10Texture3D_FWD_DEFINED__ */ + + +#ifndef __ID3D10View_FWD_DEFINED__ +#define __ID3D10View_FWD_DEFINED__ +typedef interface ID3D10View ID3D10View; +#endif /* __ID3D10View_FWD_DEFINED__ */ + + +#ifndef __ID3D10ShaderResourceView_FWD_DEFINED__ +#define __ID3D10ShaderResourceView_FWD_DEFINED__ +typedef interface ID3D10ShaderResourceView ID3D10ShaderResourceView; +#endif /* __ID3D10ShaderResourceView_FWD_DEFINED__ */ + + +#ifndef __ID3D10RenderTargetView_FWD_DEFINED__ +#define __ID3D10RenderTargetView_FWD_DEFINED__ +typedef interface ID3D10RenderTargetView ID3D10RenderTargetView; +#endif /* __ID3D10RenderTargetView_FWD_DEFINED__ */ + + +#ifndef __ID3D10DepthStencilView_FWD_DEFINED__ +#define __ID3D10DepthStencilView_FWD_DEFINED__ +typedef interface ID3D10DepthStencilView ID3D10DepthStencilView; +#endif /* __ID3D10DepthStencilView_FWD_DEFINED__ */ + + +#ifndef __ID3D10VertexShader_FWD_DEFINED__ +#define __ID3D10VertexShader_FWD_DEFINED__ +typedef interface ID3D10VertexShader ID3D10VertexShader; +#endif /* __ID3D10VertexShader_FWD_DEFINED__ */ + + +#ifndef __ID3D10GeometryShader_FWD_DEFINED__ +#define __ID3D10GeometryShader_FWD_DEFINED__ +typedef interface ID3D10GeometryShader ID3D10GeometryShader; +#endif /* __ID3D10GeometryShader_FWD_DEFINED__ */ + + +#ifndef __ID3D10PixelShader_FWD_DEFINED__ +#define __ID3D10PixelShader_FWD_DEFINED__ +typedef interface ID3D10PixelShader ID3D10PixelShader; +#endif /* __ID3D10PixelShader_FWD_DEFINED__ */ + + +#ifndef __ID3D10InputLayout_FWD_DEFINED__ +#define __ID3D10InputLayout_FWD_DEFINED__ +typedef interface ID3D10InputLayout ID3D10InputLayout; +#endif /* __ID3D10InputLayout_FWD_DEFINED__ */ + + +#ifndef __ID3D10SamplerState_FWD_DEFINED__ +#define __ID3D10SamplerState_FWD_DEFINED__ +typedef interface ID3D10SamplerState ID3D10SamplerState; +#endif /* __ID3D10SamplerState_FWD_DEFINED__ */ + + +#ifndef __ID3D10Asynchronous_FWD_DEFINED__ +#define __ID3D10Asynchronous_FWD_DEFINED__ +typedef interface ID3D10Asynchronous ID3D10Asynchronous; +#endif /* __ID3D10Asynchronous_FWD_DEFINED__ */ + + +#ifndef __ID3D10Query_FWD_DEFINED__ +#define __ID3D10Query_FWD_DEFINED__ +typedef interface ID3D10Query ID3D10Query; +#endif /* __ID3D10Query_FWD_DEFINED__ */ + + +#ifndef __ID3D10Predicate_FWD_DEFINED__ +#define __ID3D10Predicate_FWD_DEFINED__ +typedef interface ID3D10Predicate ID3D10Predicate; +#endif /* __ID3D10Predicate_FWD_DEFINED__ */ + + +#ifndef __ID3D10Counter_FWD_DEFINED__ +#define __ID3D10Counter_FWD_DEFINED__ +typedef interface ID3D10Counter ID3D10Counter; +#endif /* __ID3D10Counter_FWD_DEFINED__ */ + + +#ifndef __ID3D10Device_FWD_DEFINED__ +#define __ID3D10Device_FWD_DEFINED__ +typedef interface ID3D10Device ID3D10Device; +#endif /* __ID3D10Device_FWD_DEFINED__ */ + + +#ifndef __ID3D10Multithread_FWD_DEFINED__ +#define __ID3D10Multithread_FWD_DEFINED__ +typedef interface ID3D10Multithread ID3D10Multithread; +#endif /* __ID3D10Multithread_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "dxgi.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d10_0000_0000 */ +/* [local] */ + +#ifndef _D3D10_CONSTANTS +#define _D3D10_CONSTANTS +#define D3D10_16BIT_INDEX_STRIP_CUT_VALUE ( 0xffff ) + +#define D3D10_32BIT_INDEX_STRIP_CUT_VALUE ( 0xffffffff ) + +#define D3D10_8BIT_INDEX_STRIP_CUT_VALUE ( 0xff ) + +#define D3D10_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT ( 9 ) + +#define D3D10_CLIP_OR_CULL_DISTANCE_COUNT ( 8 ) + +#define D3D10_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT ( 2 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT ( 14 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS ( 4 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT ( 15 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT ( 15 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT ( 64 ) + +#define D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT ( 1 ) + +#define D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS ( 1 ) + +#define D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT ( 128 ) + +#define D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST ( 1 ) + +#define D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT ( 128 ) + +#define D3D10_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS ( 1 ) + +#define D3D10_COMMONSHADER_SAMPLER_REGISTER_COUNT ( 16 ) + +#define D3D10_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D10_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT ( 16 ) + +#define D3D10_COMMONSHADER_SUBROUTINE_NESTING_LIMIT ( 32 ) + +#define D3D10_COMMONSHADER_TEMP_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_COMMONSHADER_TEMP_REGISTER_COUNT ( 4096 ) + +#define D3D10_COMMONSHADER_TEMP_REGISTER_READS_PER_INST ( 3 ) + +#define D3D10_COMMONSHADER_TEMP_REGISTER_READ_PORTS ( 3 ) + +#define D3D10_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX ( 10 ) + +#define D3D10_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN ( -10 ) + +#define D3D10_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE ( -8 ) + +#define D3D10_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE ( 7 ) + +#define D3D10_DEFAULT_BLEND_FACTOR_ALPHA ( 1.0f ) +#define D3D10_DEFAULT_BLEND_FACTOR_BLUE ( 1.0f ) +#define D3D10_DEFAULT_BLEND_FACTOR_GREEN ( 1.0f ) +#define D3D10_DEFAULT_BLEND_FACTOR_RED ( 1.0f ) +#define D3D10_DEFAULT_BORDER_COLOR_COMPONENT ( 0.0f ) +#define D3D10_DEFAULT_DEPTH_BIAS ( 0 ) + +#define D3D10_DEFAULT_DEPTH_BIAS_CLAMP ( 0.0f ) +#define D3D10_DEFAULT_MAX_ANISOTROPY ( 16.0f ) +#define D3D10_DEFAULT_MIP_LOD_BIAS ( 0.0f ) +#define D3D10_DEFAULT_RENDER_TARGET_ARRAY_INDEX ( 0 ) + +#define D3D10_DEFAULT_SAMPLE_MASK ( 0xffffffff ) + +#define D3D10_DEFAULT_SCISSOR_ENDX ( 0 ) + +#define D3D10_DEFAULT_SCISSOR_ENDY ( 0 ) + +#define D3D10_DEFAULT_SCISSOR_STARTX ( 0 ) + +#define D3D10_DEFAULT_SCISSOR_STARTY ( 0 ) + +#define D3D10_DEFAULT_SLOPE_SCALED_DEPTH_BIAS ( 0.0f ) +#define D3D10_DEFAULT_STENCIL_READ_MASK ( 0xff ) + +#define D3D10_DEFAULT_STENCIL_REFERENCE ( 0 ) + +#define D3D10_DEFAULT_STENCIL_WRITE_MASK ( 0xff ) + +#define D3D10_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX ( 0 ) + +#define D3D10_DEFAULT_VIEWPORT_HEIGHT ( 0 ) + +#define D3D10_DEFAULT_VIEWPORT_MAX_DEPTH ( 0.0f ) +#define D3D10_DEFAULT_VIEWPORT_MIN_DEPTH ( 0.0f ) +#define D3D10_DEFAULT_VIEWPORT_TOPLEFTX ( 0 ) + +#define D3D10_DEFAULT_VIEWPORT_TOPLEFTY ( 0 ) + +#define D3D10_DEFAULT_VIEWPORT_WIDTH ( 0 ) + +#define D3D10_FLOAT16_FUSED_TOLERANCE_IN_ULP ( 0.6 ) +#define D3D10_FLOAT32_MAX ( 3.402823466e+38f ) +#define D3D10_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP ( 0.6f ) +#define D3D10_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR ( 2.4f ) +#define D3D10_FLOAT_TO_SRGB_EXPONENT_NUMERATOR ( 1.0f ) +#define D3D10_FLOAT_TO_SRGB_OFFSET ( 0.055f ) +#define D3D10_FLOAT_TO_SRGB_SCALE_1 ( 12.92f ) +#define D3D10_FLOAT_TO_SRGB_SCALE_2 ( 1.055f ) +#define D3D10_FLOAT_TO_SRGB_THRESHOLD ( 0.0031308f ) +#define D3D10_FTOI_INSTRUCTION_MAX_INPUT ( 2147483647.999f ) +#define D3D10_FTOI_INSTRUCTION_MIN_INPUT ( -2147483648.999f ) +#define D3D10_FTOU_INSTRUCTION_MAX_INPUT ( 4294967295.999f ) +#define D3D10_FTOU_INSTRUCTION_MIN_INPUT ( 0.0f ) +#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS ( 1 ) + +#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_COUNT ( 1 ) + +#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST ( 2 ) + +#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_GS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_GS_INPUT_REGISTER_COUNT ( 16 ) + +#define D3D10_GS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D10_GS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_GS_INPUT_REGISTER_VERTICES ( 6 ) + +#define D3D10_GS_OUTPUT_ELEMENTS ( 32 ) + +#define D3D10_GS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_GS_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D10_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES ( 0 ) + +#define D3D10_IA_DEFAULT_PRIMITIVE_TOPOLOGY ( 0 ) + +#define D3D10_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES ( 0 ) + +#define D3D10_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT ( 1 ) + +#define D3D10_IA_INSTANCE_ID_BIT_COUNT ( 32 ) + +#define D3D10_IA_INTEGER_ARITHMETIC_BIT_COUNT ( 32 ) + +#define D3D10_IA_PRIMITIVE_ID_BIT_COUNT ( 32 ) + +#define D3D10_IA_VERTEX_ID_BIT_COUNT ( 32 ) + +#define D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT ( 16 ) + +#define D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS ( 64 ) + +#define D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ( 16 ) + +#define D3D10_INTEGER_DIVIDE_BY_ZERO_QUOTIENT ( 0xffffffff ) + +#define D3D10_INTEGER_DIVIDE_BY_ZERO_REMAINDER ( 0xffffffff ) + +#define D3D10_LINEAR_GAMMA ( 1.0f ) +#define D3D10_MAX_BORDER_COLOR_COMPONENT ( 1.0f ) +#define D3D10_MAX_DEPTH ( 1.0f ) +#define D3D10_MAX_MAXANISOTROPY ( 16 ) + +#define D3D10_MAX_MULTISAMPLE_SAMPLE_COUNT ( 32 ) + +#define D3D10_MAX_POSITION_VALUE ( 3.402823466e+34f ) +#define D3D10_MAX_TEXTURE_DIMENSION_2_TO_EXP ( 17 ) + +#define D3D10_MIN_BORDER_COLOR_COMPONENT ( 0.0f ) +#define D3D10_MIN_DEPTH ( 0.0f ) +#define D3D10_MIN_MAXANISOTROPY ( 0 ) + +#define D3D10_MIP_LOD_BIAS_MAX ( 15.99f ) +#define D3D10_MIP_LOD_BIAS_MIN ( -16.0f ) +#define D3D10_MIP_LOD_FRACTIONAL_BIT_COUNT ( 6 ) + +#define D3D10_MIP_LOD_RANGE_BIT_COUNT ( 8 ) + +#define D3D10_MULTISAMPLE_ANTIALIAS_LINE_WIDTH ( 1.4f ) +#define D3D10_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT ( 0 ) + +#define D3D10_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 13 ) + +#define D3D10_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 15 ) + +#define D3D10_PS_FRONTFACING_DEFAULT_VALUE ( 0xffffffff ) + +#define D3D10_PS_FRONTFACING_FALSE_VALUE ( 0 ) + +#define D3D10_PS_FRONTFACING_TRUE_VALUE ( 0xffffffff ) + +#define D3D10_PS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_PS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D10_PS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D10_PS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.0f ) +#define D3D10_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS ( 1 ) + +#define D3D10_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_PS_OUTPUT_DEPTH_REGISTER_COUNT ( 1 ) + +#define D3D10_PS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_PS_OUTPUT_REGISTER_COUNT ( 8 ) + +#define D3D10_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.5f ) +#define D3D10_REQ_BLEND_OBJECT_COUNT_PER_CONTEXT ( 4096 ) + +#define D3D10_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP ( 27 ) + +#define D3D10_REQ_CONSTANT_BUFFER_ELEMENT_COUNT ( 4096 ) + +#define D3D10_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_CONTEXT ( 4096 ) + +#define D3D10_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP ( 32 ) + +#define D3D10_REQ_DRAW_VERTEX_COUNT_2_TO_EXP ( 32 ) + +#define D3D10_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION ( 8192 ) + +#define D3D10_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT ( 1024 ) + +#define D3D10_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT ( 4096 ) + +#define D3D10_REQ_MAXANISOTROPY ( 16 ) + +#define D3D10_REQ_MIP_LEVELS ( 14 ) + +#define D3D10_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES ( 2048 ) + +#define D3D10_REQ_RASTERIZER_OBJECT_COUNT_PER_CONTEXT ( 4096 ) + +#define D3D10_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH ( 8192 ) + +#define D3D10_REQ_RESOURCE_SIZE_IN_MEGABYTES ( 128 ) + +#define D3D10_REQ_RESOURCE_VIEW_COUNT_PER_CONTEXT_2_TO_EXP ( 20 ) + +#define D3D10_REQ_SAMPLER_OBJECT_COUNT_PER_CONTEXT ( 4096 ) + +#define D3D10_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION ( 512 ) + +#define D3D10_REQ_TEXTURE1D_U_DIMENSION ( 8192 ) + +#define D3D10_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION ( 512 ) + +#define D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION ( 8192 ) + +#define D3D10_REQ_TEXTURE3D_U_V_OR_W_DIMENSION ( 2048 ) + +#define D3D10_REQ_TEXTURECUBE_DIMENSION ( 8192 ) + +#define D3D10_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL ( 0 ) + +#define D3D10_SHADER_MAJOR_VERSION ( 4 ) + +#define D3D10_SHADER_MINOR_VERSION ( 0 ) + +#define D3D10_SHIFT_INSTRUCTION_PAD_VALUE ( 0 ) + +#define D3D10_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT ( 5 ) + +#define D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ( 8 ) + +#define D3D10_SO_BUFFER_MAX_STRIDE_IN_BYTES ( 2048 ) + +#define D3D10_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES ( 256 ) + +#define D3D10_SO_BUFFER_SLOT_COUNT ( 4 ) + +#define D3D10_SO_DDI_REGISTER_INDEX_DENOTING_GAP ( 0xffffffff ) + +#define D3D10_SO_MULTIPLE_BUFFER_ELEMENTS_PER_BUFFER ( 1 ) + +#define D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ( 64 ) + +#define D3D10_SRGB_GAMMA ( 2.2f ) +#define D3D10_SRGB_TO_FLOAT_DENOMINATOR_1 ( 12.92f ) +#define D3D10_SRGB_TO_FLOAT_DENOMINATOR_2 ( 1.055f ) +#define D3D10_SRGB_TO_FLOAT_EXPONENT ( 2.4f ) +#define D3D10_SRGB_TO_FLOAT_OFFSET ( 0.055f ) +#define D3D10_SRGB_TO_FLOAT_THRESHOLD ( 0.04045f ) +#define D3D10_SRGB_TO_FLOAT_TOLERANCE_IN_ULP ( 0.5f ) +#define D3D10_STANDARD_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_STANDARD_COMPONENT_BIT_COUNT_DOUBLED ( 64 ) + +#define D3D10_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE ( 4 ) + +#define D3D10_STANDARD_PIXEL_COMPONENT_COUNT ( 128 ) + +#define D3D10_STANDARD_PIXEL_ELEMENT_COUNT ( 32 ) + +#define D3D10_STANDARD_VECTOR_SIZE ( 4 ) + +#define D3D10_STANDARD_VERTEX_ELEMENT_COUNT ( 16 ) + +#define D3D10_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT ( 64 ) + +#define D3D10_SUBPIXEL_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D10_SUBTEXEL_FRACTIONAL_BIT_COUNT ( 6 ) + +#define D3D10_TEXEL_ADDRESS_RANGE_BIT_COUNT ( 18 ) + +#define D3D10_UNBOUND_MEMORY_ACCESS_RESULT ( 0 ) + +#define D3D10_VIEWPORT_AND_SCISSORRECT_MAX_INDEX ( 15 ) + +#define D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE ( 16 ) + +#define D3D10_VIEWPORT_BOUNDS_MAX ( 16383 ) + +#define D3D10_VIEWPORT_BOUNDS_MIN ( -16384 ) + +#define D3D10_VS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_VS_INPUT_REGISTER_COUNT ( 16 ) + +#define D3D10_VS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D10_VS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D10_VS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D10_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_VS_OUTPUT_REGISTER_COUNT ( 16 ) + +#define D3D10_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT ( 10 ) + +#define D3D10_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP ( 25 ) + +#define D3D10_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP ( 25 ) + +#define D3D_MAJOR_VERSION ( 10 ) + +#define D3D_MINOR_VERSION ( 0 ) + +#define D3D_SPEC_DATE_DAY ( 8 ) + +#define D3D_SPEC_DATE_MONTH ( 8 ) + +#define D3D_SPEC_DATE_YEAR ( 2006 ) + +#define D3D_SPEC_VERSION ( 1.050005 ) +#endif +#if !defined( __d3d10_1_h__ ) && !(D3D10_HEADER_MINOR_VERSION >= 1) +#define D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT +#define D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT +#endif +#define _FACD3D10 ( 0x879 ) + +#define _FACD3D10DEBUG ( ( _FACD3D10 + 1 ) ) + +#define MAKE_D3D10_HRESULT( code ) MAKE_HRESULT( 1, _FACD3D10, code ) +#define MAKE_D3D10_STATUS( code ) MAKE_HRESULT( 0, _FACD3D10, code ) +#define D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS MAKE_D3D10_HRESULT(1) +#define D3D10_ERROR_FILE_NOT_FOUND MAKE_D3D10_HRESULT(2) +#if __SAL_H_FULL_VER < 140050727 +#undef __in_range +#undef __in_xcount_opt +#define __in_range(x, y) +#define __in_xcount_opt(x) +#endif +typedef +enum D3D10_INPUT_CLASSIFICATION + { D3D10_INPUT_PER_VERTEX_DATA = 0, + D3D10_INPUT_PER_INSTANCE_DATA = 1 + } D3D10_INPUT_CLASSIFICATION; + +#define D3D10_APPEND_ALIGNED_ELEMENT ( 0xffffffff ) + +typedef struct D3D10_INPUT_ELEMENT_DESC + { + LPCSTR SemanticName; + UINT SemanticIndex; + DXGI_FORMAT Format; + UINT InputSlot; + UINT AlignedByteOffset; + D3D10_INPUT_CLASSIFICATION InputSlotClass; + UINT InstanceDataStepRate; + } D3D10_INPUT_ELEMENT_DESC; + +typedef +enum D3D10_FILL_MODE + { D3D10_FILL_WIREFRAME = 2, + D3D10_FILL_SOLID = 3 + } D3D10_FILL_MODE; + +typedef +enum D3D10_PRIMITIVE_TOPOLOGY + { D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED = 0, + D3D10_PRIMITIVE_TOPOLOGY_POINTLIST = 1, + D3D10_PRIMITIVE_TOPOLOGY_LINELIST = 2, + D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP = 3, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5, + D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10, + D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13 + } D3D10_PRIMITIVE_TOPOLOGY; + +typedef +enum D3D10_PRIMITIVE + { D3D10_PRIMITIVE_UNDEFINED = 0, + D3D10_PRIMITIVE_POINT = 1, + D3D10_PRIMITIVE_LINE = 2, + D3D10_PRIMITIVE_TRIANGLE = 3, + D3D10_PRIMITIVE_LINE_ADJ = 6, + D3D10_PRIMITIVE_TRIANGLE_ADJ = 7 + } D3D10_PRIMITIVE; + +typedef +enum D3D10_CULL_MODE + { D3D10_CULL_NONE = 1, + D3D10_CULL_FRONT = 2, + D3D10_CULL_BACK = 3 + } D3D10_CULL_MODE; + +typedef struct D3D10_SO_DECLARATION_ENTRY + { + LPCSTR SemanticName; + UINT SemanticIndex; + BYTE StartComponent; + BYTE ComponentCount; + BYTE OutputSlot; + } D3D10_SO_DECLARATION_ENTRY; + +typedef struct D3D10_VIEWPORT + { + INT TopLeftX; + INT TopLeftY; + UINT Width; + UINT Height; + FLOAT MinDepth; + FLOAT MaxDepth; + } D3D10_VIEWPORT; + +typedef +enum D3D10_RESOURCE_DIMENSION + { D3D10_RESOURCE_DIMENSION_UNKNOWN = 0, + D3D10_RESOURCE_DIMENSION_BUFFER = 1, + D3D10_RESOURCE_DIMENSION_TEXTURE1D = 2, + D3D10_RESOURCE_DIMENSION_TEXTURE2D = 3, + D3D10_RESOURCE_DIMENSION_TEXTURE3D = 4 + } D3D10_RESOURCE_DIMENSION; + +typedef +enum D3D10_SRV_DIMENSION + { D3D10_SRV_DIMENSION_UNKNOWN = 0, + D3D10_SRV_DIMENSION_BUFFER = 1, + D3D10_SRV_DIMENSION_TEXTURE1D = 2, + D3D10_SRV_DIMENSION_TEXTURE1DARRAY = 3, + D3D10_SRV_DIMENSION_TEXTURE2D = 4, + D3D10_SRV_DIMENSION_TEXTURE2DARRAY = 5, + D3D10_SRV_DIMENSION_TEXTURE2DMS = 6, + D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D10_SRV_DIMENSION_TEXTURE3D = 8, + D3D10_SRV_DIMENSION_TEXTURECUBE = 9 + } D3D10_SRV_DIMENSION; + +typedef +enum D3D10_DSV_DIMENSION + { D3D10_DSV_DIMENSION_UNKNOWN = 0, + D3D10_DSV_DIMENSION_TEXTURE1D = 1, + D3D10_DSV_DIMENSION_TEXTURE1DARRAY = 2, + D3D10_DSV_DIMENSION_TEXTURE2D = 3, + D3D10_DSV_DIMENSION_TEXTURE2DARRAY = 4, + D3D10_DSV_DIMENSION_TEXTURE2DMS = 5, + D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY = 6 + } D3D10_DSV_DIMENSION; + +typedef +enum D3D10_RTV_DIMENSION + { D3D10_RTV_DIMENSION_UNKNOWN = 0, + D3D10_RTV_DIMENSION_BUFFER = 1, + D3D10_RTV_DIMENSION_TEXTURE1D = 2, + D3D10_RTV_DIMENSION_TEXTURE1DARRAY = 3, + D3D10_RTV_DIMENSION_TEXTURE2D = 4, + D3D10_RTV_DIMENSION_TEXTURE2DARRAY = 5, + D3D10_RTV_DIMENSION_TEXTURE2DMS = 6, + D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D10_RTV_DIMENSION_TEXTURE3D = 8 + } D3D10_RTV_DIMENSION; + +typedef +enum D3D10_USAGE + { D3D10_USAGE_DEFAULT = 0, + D3D10_USAGE_IMMUTABLE = 1, + D3D10_USAGE_DYNAMIC = 2, + D3D10_USAGE_STAGING = 3 + } D3D10_USAGE; + +typedef +enum D3D10_BIND_FLAG + { D3D10_BIND_VERTEX_BUFFER = 0x1L, + D3D10_BIND_INDEX_BUFFER = 0x2L, + D3D10_BIND_CONSTANT_BUFFER = 0x4L, + D3D10_BIND_SHADER_RESOURCE = 0x8L, + D3D10_BIND_STREAM_OUTPUT = 0x10L, + D3D10_BIND_RENDER_TARGET = 0x20L, + D3D10_BIND_DEPTH_STENCIL = 0x40L + } D3D10_BIND_FLAG; + +typedef +enum D3D10_CPU_ACCESS_FLAG + { D3D10_CPU_ACCESS_WRITE = 0x10000L, + D3D10_CPU_ACCESS_READ = 0x20000L + } D3D10_CPU_ACCESS_FLAG; + +typedef +enum D3D10_RESOURCE_MISC_FLAG + { D3D10_RESOURCE_MISC_GENERATE_MIPS = 0x1L, + D3D10_RESOURCE_MISC_SHARED = 0x2L, + D3D10_RESOURCE_MISC_TEXTURECUBE = 0x4L, + D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x10L, + D3D10_RESOURCE_MISC_GDI_COMPATIBLE = 0x20L + } D3D10_RESOURCE_MISC_FLAG; + +typedef +enum D3D10_MAP + { D3D10_MAP_READ = 1, + D3D10_MAP_WRITE = 2, + D3D10_MAP_READ_WRITE = 3, + D3D10_MAP_WRITE_DISCARD = 4, + D3D10_MAP_WRITE_NO_OVERWRITE = 5 + } D3D10_MAP; + +typedef +enum D3D10_MAP_FLAG + { D3D10_MAP_FLAG_DO_NOT_WAIT = 0x100000L + } D3D10_MAP_FLAG; + +typedef +enum D3D10_RAISE_FLAG + { D3D10_RAISE_FLAG_DRIVER_INTERNAL_ERROR = 0x1L + } D3D10_RAISE_FLAG; + +typedef +enum D3D10_CLEAR_FLAG + { D3D10_CLEAR_DEPTH = 0x1L, + D3D10_CLEAR_STENCIL = 0x2L + } D3D10_CLEAR_FLAG; + +typedef RECT D3D10_RECT; + +typedef struct D3D10_BOX + { + UINT left; + UINT top; + UINT front; + UINT right; + UINT bottom; + UINT back; + } D3D10_BOX; + + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D10DeviceChild_INTERFACE_DEFINED__ +#define __ID3D10DeviceChild_INTERFACE_DEFINED__ + +/* interface ID3D10DeviceChild */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10DeviceChild; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C00-342C-4106-A19F-4F2704F689F0") + ID3D10DeviceChild : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE GetDevice( + /* [annotation] */ + __out ID3D10Device **ppDevice) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10DeviceChildVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10DeviceChild * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10DeviceChild * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10DeviceChild * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10DeviceChild * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10DeviceChild * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10DeviceChild * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10DeviceChild * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D10DeviceChildVtbl; + + interface ID3D10DeviceChild + { + CONST_VTBL struct ID3D10DeviceChildVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10DeviceChild_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10DeviceChild_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10DeviceChild_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10DeviceChild_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10DeviceChild_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10DeviceChild_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10DeviceChild_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10DeviceChild_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0001 */ +/* [local] */ + +typedef +enum D3D10_COMPARISON_FUNC + { D3D10_COMPARISON_NEVER = 1, + D3D10_COMPARISON_LESS = 2, + D3D10_COMPARISON_EQUAL = 3, + D3D10_COMPARISON_LESS_EQUAL = 4, + D3D10_COMPARISON_GREATER = 5, + D3D10_COMPARISON_NOT_EQUAL = 6, + D3D10_COMPARISON_GREATER_EQUAL = 7, + D3D10_COMPARISON_ALWAYS = 8 + } D3D10_COMPARISON_FUNC; + +typedef +enum D3D10_DEPTH_WRITE_MASK + { D3D10_DEPTH_WRITE_MASK_ZERO = 0, + D3D10_DEPTH_WRITE_MASK_ALL = 1 + } D3D10_DEPTH_WRITE_MASK; + +typedef +enum D3D10_STENCIL_OP + { D3D10_STENCIL_OP_KEEP = 1, + D3D10_STENCIL_OP_ZERO = 2, + D3D10_STENCIL_OP_REPLACE = 3, + D3D10_STENCIL_OP_INCR_SAT = 4, + D3D10_STENCIL_OP_DECR_SAT = 5, + D3D10_STENCIL_OP_INVERT = 6, + D3D10_STENCIL_OP_INCR = 7, + D3D10_STENCIL_OP_DECR = 8 + } D3D10_STENCIL_OP; + +typedef struct D3D10_DEPTH_STENCILOP_DESC + { + D3D10_STENCIL_OP StencilFailOp; + D3D10_STENCIL_OP StencilDepthFailOp; + D3D10_STENCIL_OP StencilPassOp; + D3D10_COMPARISON_FUNC StencilFunc; + } D3D10_DEPTH_STENCILOP_DESC; + +typedef struct D3D10_DEPTH_STENCIL_DESC + { + BOOL DepthEnable; + D3D10_DEPTH_WRITE_MASK DepthWriteMask; + D3D10_COMPARISON_FUNC DepthFunc; + BOOL StencilEnable; + UINT8 StencilReadMask; + UINT8 StencilWriteMask; + D3D10_DEPTH_STENCILOP_DESC FrontFace; + D3D10_DEPTH_STENCILOP_DESC BackFace; + } D3D10_DEPTH_STENCIL_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0001_v0_0_s_ifspec; + +#ifndef __ID3D10DepthStencilState_INTERFACE_DEFINED__ +#define __ID3D10DepthStencilState_INTERFACE_DEFINED__ + +/* interface ID3D10DepthStencilState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10DepthStencilState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2B4B1CC8-A4AD-41f8-8322-CA86FC3EC675") + ID3D10DepthStencilState : public ID3D10DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_DEPTH_STENCIL_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10DepthStencilStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10DepthStencilState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10DepthStencilState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10DepthStencilState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10DepthStencilState * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10DepthStencilState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10DepthStencilState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10DepthStencilState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10DepthStencilState * This, + /* [annotation] */ + __out D3D10_DEPTH_STENCIL_DESC *pDesc); + + END_INTERFACE + } ID3D10DepthStencilStateVtbl; + + interface ID3D10DepthStencilState + { + CONST_VTBL struct ID3D10DepthStencilStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10DepthStencilState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10DepthStencilState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10DepthStencilState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10DepthStencilState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10DepthStencilState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10DepthStencilState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10DepthStencilState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10DepthStencilState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10DepthStencilState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0002 */ +/* [local] */ + +typedef +enum D3D10_BLEND + { D3D10_BLEND_ZERO = 1, + D3D10_BLEND_ONE = 2, + D3D10_BLEND_SRC_COLOR = 3, + D3D10_BLEND_INV_SRC_COLOR = 4, + D3D10_BLEND_SRC_ALPHA = 5, + D3D10_BLEND_INV_SRC_ALPHA = 6, + D3D10_BLEND_DEST_ALPHA = 7, + D3D10_BLEND_INV_DEST_ALPHA = 8, + D3D10_BLEND_DEST_COLOR = 9, + D3D10_BLEND_INV_DEST_COLOR = 10, + D3D10_BLEND_SRC_ALPHA_SAT = 11, + D3D10_BLEND_BLEND_FACTOR = 14, + D3D10_BLEND_INV_BLEND_FACTOR = 15, + D3D10_BLEND_SRC1_COLOR = 16, + D3D10_BLEND_INV_SRC1_COLOR = 17, + D3D10_BLEND_SRC1_ALPHA = 18, + D3D10_BLEND_INV_SRC1_ALPHA = 19 + } D3D10_BLEND; + +typedef +enum D3D10_BLEND_OP + { D3D10_BLEND_OP_ADD = 1, + D3D10_BLEND_OP_SUBTRACT = 2, + D3D10_BLEND_OP_REV_SUBTRACT = 3, + D3D10_BLEND_OP_MIN = 4, + D3D10_BLEND_OP_MAX = 5 + } D3D10_BLEND_OP; + +typedef +enum D3D10_COLOR_WRITE_ENABLE + { D3D10_COLOR_WRITE_ENABLE_RED = 1, + D3D10_COLOR_WRITE_ENABLE_GREEN = 2, + D3D10_COLOR_WRITE_ENABLE_BLUE = 4, + D3D10_COLOR_WRITE_ENABLE_ALPHA = 8, + D3D10_COLOR_WRITE_ENABLE_ALL = ( ( ( D3D10_COLOR_WRITE_ENABLE_RED | D3D10_COLOR_WRITE_ENABLE_GREEN ) | D3D10_COLOR_WRITE_ENABLE_BLUE ) | D3D10_COLOR_WRITE_ENABLE_ALPHA ) + } D3D10_COLOR_WRITE_ENABLE; + +typedef struct D3D10_BLEND_DESC + { + BOOL AlphaToCoverageEnable; + BOOL BlendEnable[ 8 ]; + D3D10_BLEND SrcBlend; + D3D10_BLEND DestBlend; + D3D10_BLEND_OP BlendOp; + D3D10_BLEND SrcBlendAlpha; + D3D10_BLEND DestBlendAlpha; + D3D10_BLEND_OP BlendOpAlpha; + UINT8 RenderTargetWriteMask[ 8 ]; + } D3D10_BLEND_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0002_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0002_v0_0_s_ifspec; + +#ifndef __ID3D10BlendState_INTERFACE_DEFINED__ +#define __ID3D10BlendState_INTERFACE_DEFINED__ + +/* interface ID3D10BlendState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10BlendState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("EDAD8D19-8A35-4d6d-8566-2EA276CDE161") + ID3D10BlendState : public ID3D10DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_BLEND_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10BlendStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10BlendState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10BlendState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10BlendState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10BlendState * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10BlendState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10BlendState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10BlendState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10BlendState * This, + /* [annotation] */ + __out D3D10_BLEND_DESC *pDesc); + + END_INTERFACE + } ID3D10BlendStateVtbl; + + interface ID3D10BlendState + { + CONST_VTBL struct ID3D10BlendStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10BlendState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10BlendState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10BlendState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10BlendState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10BlendState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10BlendState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10BlendState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10BlendState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10BlendState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0003 */ +/* [local] */ + +typedef struct D3D10_RASTERIZER_DESC + { + D3D10_FILL_MODE FillMode; + D3D10_CULL_MODE CullMode; + BOOL FrontCounterClockwise; + INT DepthBias; + FLOAT DepthBiasClamp; + FLOAT SlopeScaledDepthBias; + BOOL DepthClipEnable; + BOOL ScissorEnable; + BOOL MultisampleEnable; + BOOL AntialiasedLineEnable; + } D3D10_RASTERIZER_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0003_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0003_v0_0_s_ifspec; + +#ifndef __ID3D10RasterizerState_INTERFACE_DEFINED__ +#define __ID3D10RasterizerState_INTERFACE_DEFINED__ + +/* interface ID3D10RasterizerState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10RasterizerState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("A2A07292-89AF-4345-BE2E-C53D9FBB6E9F") + ID3D10RasterizerState : public ID3D10DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_RASTERIZER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10RasterizerStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10RasterizerState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10RasterizerState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10RasterizerState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10RasterizerState * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10RasterizerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10RasterizerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10RasterizerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10RasterizerState * This, + /* [annotation] */ + __out D3D10_RASTERIZER_DESC *pDesc); + + END_INTERFACE + } ID3D10RasterizerStateVtbl; + + interface ID3D10RasterizerState + { + CONST_VTBL struct ID3D10RasterizerStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10RasterizerState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10RasterizerState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10RasterizerState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10RasterizerState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10RasterizerState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10RasterizerState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10RasterizerState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10RasterizerState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10RasterizerState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0004 */ +/* [local] */ + +#if !defined( D3D10_NO_HELPERS ) && defined( __cplusplus ) +inline UINT D3D10CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT MipLevels ) +{ return MipSlice + ArraySlice * MipLevels; } +#endif +typedef struct D3D10_SUBRESOURCE_DATA + { + const void *pSysMem; + UINT SysMemPitch; + UINT SysMemSlicePitch; + } D3D10_SUBRESOURCE_DATA; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0004_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0004_v0_0_s_ifspec; + +#ifndef __ID3D10Resource_INTERFACE_DEFINED__ +#define __ID3D10Resource_INTERFACE_DEFINED__ + +/* interface ID3D10Resource */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Resource; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C01-342C-4106-A19F-4F2704F689F0") + ID3D10Resource : public ID3D10DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetType( + /* [annotation] */ + __out D3D10_RESOURCE_DIMENSION *rType) = 0; + + virtual void STDMETHODCALLTYPE SetEvictionPriority( + /* [annotation] */ + __in UINT EvictionPriority) = 0; + + virtual UINT STDMETHODCALLTYPE GetEvictionPriority( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10ResourceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Resource * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Resource * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Resource * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Resource * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Resource * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Resource * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Resource * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D10Resource * This, + /* [annotation] */ + __out D3D10_RESOURCE_DIMENSION *rType); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D10Resource * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D10Resource * This); + + END_INTERFACE + } ID3D10ResourceVtbl; + + interface ID3D10Resource + { + CONST_VTBL struct ID3D10ResourceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Resource_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Resource_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Resource_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Resource_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Resource_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Resource_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Resource_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Resource_GetType(This,rType) \ + ( (This)->lpVtbl -> GetType(This,rType) ) + +#define ID3D10Resource_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D10Resource_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Resource_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0005 */ +/* [local] */ + +typedef struct D3D10_BUFFER_DESC + { + UINT ByteWidth; + D3D10_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + } D3D10_BUFFER_DESC; + +#if !defined( D3D10_NO_HELPERS ) && defined( __cplusplus ) +struct CD3D10_BUFFER_DESC : public D3D10_BUFFER_DESC +{ + CD3D10_BUFFER_DESC() + {} + explicit CD3D10_BUFFER_DESC( const D3D10_BUFFER_DESC& o ) : + D3D10_BUFFER_DESC( o ) + {} + explicit CD3D10_BUFFER_DESC( + UINT byteWidth, + UINT bindFlags, + D3D10_USAGE usage = D3D10_USAGE_DEFAULT, + UINT cpuaccessFlags = 0, + UINT miscFlags = 0 ) + { + ByteWidth = byteWidth; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags ; + MiscFlags = miscFlags; + } + ~CD3D10_BUFFER_DESC() {} + operator const D3D10_BUFFER_DESC&() const { return *this; } +}; +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0005_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0005_v0_0_s_ifspec; + +#ifndef __ID3D10Buffer_INTERFACE_DEFINED__ +#define __ID3D10Buffer_INTERFACE_DEFINED__ + +/* interface ID3D10Buffer */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Buffer; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C02-342C-4106-A19F-4F2704F689F0") + ID3D10Buffer : public ID3D10Resource + { + public: + virtual HRESULT STDMETHODCALLTYPE Map( + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out void **ppData) = 0; + + virtual void STDMETHODCALLTYPE Unmap( void) = 0; + + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_BUFFER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10BufferVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Buffer * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Buffer * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Buffer * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Buffer * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Buffer * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Buffer * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Buffer * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D10Buffer * This, + /* [annotation] */ + __out D3D10_RESOURCE_DIMENSION *rType); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D10Buffer * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D10Buffer * This); + + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D10Buffer * This, + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out void **ppData); + + void ( STDMETHODCALLTYPE *Unmap )( + ID3D10Buffer * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10Buffer * This, + /* [annotation] */ + __out D3D10_BUFFER_DESC *pDesc); + + END_INTERFACE + } ID3D10BufferVtbl; + + interface ID3D10Buffer + { + CONST_VTBL struct ID3D10BufferVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Buffer_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Buffer_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Buffer_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Buffer_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Buffer_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Buffer_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Buffer_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Buffer_GetType(This,rType) \ + ( (This)->lpVtbl -> GetType(This,rType) ) + +#define ID3D10Buffer_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D10Buffer_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D10Buffer_Map(This,MapType,MapFlags,ppData) \ + ( (This)->lpVtbl -> Map(This,MapType,MapFlags,ppData) ) + +#define ID3D10Buffer_Unmap(This) \ + ( (This)->lpVtbl -> Unmap(This) ) + +#define ID3D10Buffer_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Buffer_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0006 */ +/* [local] */ + +typedef struct D3D10_TEXTURE1D_DESC + { + UINT Width; + UINT MipLevels; + UINT ArraySize; + DXGI_FORMAT Format; + D3D10_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + } D3D10_TEXTURE1D_DESC; + +#if !defined( D3D10_NO_HELPERS ) && defined( __cplusplus ) +struct CD3D10_TEXTURE1D_DESC : public D3D10_TEXTURE1D_DESC +{ + CD3D10_TEXTURE1D_DESC() + {} + explicit CD3D10_TEXTURE1D_DESC( const D3D10_TEXTURE1D_DESC& o ) : + D3D10_TEXTURE1D_DESC( o ) + {} + explicit CD3D10_TEXTURE1D_DESC( + DXGI_FORMAT format, + UINT width, + UINT arraySize = 1, + UINT mipLevels = 0, + UINT bindFlags = D3D10_BIND_SHADER_RESOURCE, + D3D10_USAGE usage = D3D10_USAGE_DEFAULT, + UINT cpuaccessFlags= 0, + UINT miscFlags = 0 ) + { + Width = width; + MipLevels = mipLevels; + ArraySize = arraySize; + Format = format; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags; + MiscFlags = miscFlags; + } + ~CD3D10_TEXTURE1D_DESC() {} + operator const D3D10_TEXTURE1D_DESC&() const { return *this; } +}; +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0006_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0006_v0_0_s_ifspec; + +#ifndef __ID3D10Texture1D_INTERFACE_DEFINED__ +#define __ID3D10Texture1D_INTERFACE_DEFINED__ + +/* interface ID3D10Texture1D */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Texture1D; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C03-342C-4106-A19F-4F2704F689F0") + ID3D10Texture1D : public ID3D10Resource + { + public: + virtual HRESULT STDMETHODCALLTYPE Map( + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out void **ppData) = 0; + + virtual void STDMETHODCALLTYPE Unmap( + /* [annotation] */ + __in UINT Subresource) = 0; + + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_TEXTURE1D_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10Texture1DVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Texture1D * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Texture1D * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Texture1D * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Texture1D * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Texture1D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Texture1D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Texture1D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D10Texture1D * This, + /* [annotation] */ + __out D3D10_RESOURCE_DIMENSION *rType); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D10Texture1D * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D10Texture1D * This); + + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D10Texture1D * This, + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out void **ppData); + + void ( STDMETHODCALLTYPE *Unmap )( + ID3D10Texture1D * This, + /* [annotation] */ + __in UINT Subresource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10Texture1D * This, + /* [annotation] */ + __out D3D10_TEXTURE1D_DESC *pDesc); + + END_INTERFACE + } ID3D10Texture1DVtbl; + + interface ID3D10Texture1D + { + CONST_VTBL struct ID3D10Texture1DVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Texture1D_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Texture1D_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Texture1D_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Texture1D_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Texture1D_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Texture1D_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Texture1D_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Texture1D_GetType(This,rType) \ + ( (This)->lpVtbl -> GetType(This,rType) ) + +#define ID3D10Texture1D_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D10Texture1D_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D10Texture1D_Map(This,Subresource,MapType,MapFlags,ppData) \ + ( (This)->lpVtbl -> Map(This,Subresource,MapType,MapFlags,ppData) ) + +#define ID3D10Texture1D_Unmap(This,Subresource) \ + ( (This)->lpVtbl -> Unmap(This,Subresource) ) + +#define ID3D10Texture1D_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Texture1D_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0007 */ +/* [local] */ + +typedef struct D3D10_TEXTURE2D_DESC + { + UINT Width; + UINT Height; + UINT MipLevels; + UINT ArraySize; + DXGI_FORMAT Format; + DXGI_SAMPLE_DESC SampleDesc; + D3D10_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + } D3D10_TEXTURE2D_DESC; + +#if !defined( D3D10_NO_HELPERS ) && defined( __cplusplus ) +struct CD3D10_TEXTURE2D_DESC : public D3D10_TEXTURE2D_DESC +{ + CD3D10_TEXTURE2D_DESC() + {} + explicit CD3D10_TEXTURE2D_DESC( const D3D10_TEXTURE2D_DESC& o ) : + D3D10_TEXTURE2D_DESC( o ) + {} + explicit CD3D10_TEXTURE2D_DESC( + DXGI_FORMAT format, + UINT width, + UINT height, + UINT arraySize = 1, + UINT mipLevels = 0, + UINT bindFlags = D3D10_BIND_SHADER_RESOURCE, + D3D10_USAGE usage = D3D10_USAGE_DEFAULT, + UINT cpuaccessFlags = 0, + UINT sampleCount = 1, + UINT sampleQuality = 0, + UINT miscFlags = 0 ) + { + Width = width; + Height = height; + MipLevels = mipLevels; + ArraySize = arraySize; + Format = format; + SampleDesc.Count = sampleCount; + SampleDesc.Quality = sampleQuality; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags; + MiscFlags = miscFlags; + } + ~CD3D10_TEXTURE2D_DESC() {} + operator const D3D10_TEXTURE2D_DESC&() const { return *this; } +}; +#endif +typedef struct D3D10_MAPPED_TEXTURE2D + { + void *pData; + UINT RowPitch; + } D3D10_MAPPED_TEXTURE2D; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0007_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0007_v0_0_s_ifspec; + +#ifndef __ID3D10Texture2D_INTERFACE_DEFINED__ +#define __ID3D10Texture2D_INTERFACE_DEFINED__ + +/* interface ID3D10Texture2D */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Texture2D; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C04-342C-4106-A19F-4F2704F689F0") + ID3D10Texture2D : public ID3D10Resource + { + public: + virtual HRESULT STDMETHODCALLTYPE Map( + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out D3D10_MAPPED_TEXTURE2D *pMappedTex2D) = 0; + + virtual void STDMETHODCALLTYPE Unmap( + /* [annotation] */ + __in UINT Subresource) = 0; + + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_TEXTURE2D_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10Texture2DVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Texture2D * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Texture2D * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Texture2D * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Texture2D * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Texture2D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Texture2D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Texture2D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D10Texture2D * This, + /* [annotation] */ + __out D3D10_RESOURCE_DIMENSION *rType); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D10Texture2D * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D10Texture2D * This); + + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D10Texture2D * This, + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out D3D10_MAPPED_TEXTURE2D *pMappedTex2D); + + void ( STDMETHODCALLTYPE *Unmap )( + ID3D10Texture2D * This, + /* [annotation] */ + __in UINT Subresource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10Texture2D * This, + /* [annotation] */ + __out D3D10_TEXTURE2D_DESC *pDesc); + + END_INTERFACE + } ID3D10Texture2DVtbl; + + interface ID3D10Texture2D + { + CONST_VTBL struct ID3D10Texture2DVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Texture2D_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Texture2D_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Texture2D_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Texture2D_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Texture2D_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Texture2D_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Texture2D_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Texture2D_GetType(This,rType) \ + ( (This)->lpVtbl -> GetType(This,rType) ) + +#define ID3D10Texture2D_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D10Texture2D_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D10Texture2D_Map(This,Subresource,MapType,MapFlags,pMappedTex2D) \ + ( (This)->lpVtbl -> Map(This,Subresource,MapType,MapFlags,pMappedTex2D) ) + +#define ID3D10Texture2D_Unmap(This,Subresource) \ + ( (This)->lpVtbl -> Unmap(This,Subresource) ) + +#define ID3D10Texture2D_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Texture2D_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0008 */ +/* [local] */ + +typedef struct D3D10_TEXTURE3D_DESC + { + UINT Width; + UINT Height; + UINT Depth; + UINT MipLevels; + DXGI_FORMAT Format; + D3D10_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + } D3D10_TEXTURE3D_DESC; + +#if !defined( D3D10_NO_HELPERS ) && defined( __cplusplus ) +struct CD3D10_TEXTURE3D_DESC : public D3D10_TEXTURE3D_DESC +{ + CD3D10_TEXTURE3D_DESC() + {} + explicit CD3D10_TEXTURE3D_DESC( const D3D10_TEXTURE3D_DESC& o ) : + D3D10_TEXTURE3D_DESC( o ) + {} + explicit CD3D10_TEXTURE3D_DESC( + DXGI_FORMAT format, + UINT width, + UINT height, + UINT depth, + UINT mipLevels = 0, + UINT bindFlags = D3D10_BIND_SHADER_RESOURCE, + D3D10_USAGE usage = D3D10_USAGE_DEFAULT, + UINT cpuaccessFlags = 0, + UINT miscFlags = 0 ) + { + Width = width; + Height = height; + Depth = depth; + MipLevels = mipLevels; + Format = format; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags; + MiscFlags = miscFlags; + } + ~CD3D10_TEXTURE3D_DESC() {} + operator const D3D10_TEXTURE3D_DESC&() const { return *this; } +}; +#endif +typedef struct D3D10_MAPPED_TEXTURE3D + { + void *pData; + UINT RowPitch; + UINT DepthPitch; + } D3D10_MAPPED_TEXTURE3D; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0008_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0008_v0_0_s_ifspec; + +#ifndef __ID3D10Texture3D_INTERFACE_DEFINED__ +#define __ID3D10Texture3D_INTERFACE_DEFINED__ + +/* interface ID3D10Texture3D */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Texture3D; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C05-342C-4106-A19F-4F2704F689F0") + ID3D10Texture3D : public ID3D10Resource + { + public: + virtual HRESULT STDMETHODCALLTYPE Map( + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out D3D10_MAPPED_TEXTURE3D *pMappedTex3D) = 0; + + virtual void STDMETHODCALLTYPE Unmap( + /* [annotation] */ + __in UINT Subresource) = 0; + + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_TEXTURE3D_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10Texture3DVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Texture3D * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Texture3D * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Texture3D * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Texture3D * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Texture3D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Texture3D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Texture3D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D10Texture3D * This, + /* [annotation] */ + __out D3D10_RESOURCE_DIMENSION *rType); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D10Texture3D * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D10Texture3D * This); + + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D10Texture3D * This, + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D10_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out D3D10_MAPPED_TEXTURE3D *pMappedTex3D); + + void ( STDMETHODCALLTYPE *Unmap )( + ID3D10Texture3D * This, + /* [annotation] */ + __in UINT Subresource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10Texture3D * This, + /* [annotation] */ + __out D3D10_TEXTURE3D_DESC *pDesc); + + END_INTERFACE + } ID3D10Texture3DVtbl; + + interface ID3D10Texture3D + { + CONST_VTBL struct ID3D10Texture3DVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Texture3D_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Texture3D_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Texture3D_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Texture3D_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Texture3D_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Texture3D_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Texture3D_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Texture3D_GetType(This,rType) \ + ( (This)->lpVtbl -> GetType(This,rType) ) + +#define ID3D10Texture3D_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D10Texture3D_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D10Texture3D_Map(This,Subresource,MapType,MapFlags,pMappedTex3D) \ + ( (This)->lpVtbl -> Map(This,Subresource,MapType,MapFlags,pMappedTex3D) ) + +#define ID3D10Texture3D_Unmap(This,Subresource) \ + ( (This)->lpVtbl -> Unmap(This,Subresource) ) + +#define ID3D10Texture3D_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Texture3D_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0009 */ +/* [local] */ + +typedef +enum D3D10_TEXTURECUBE_FACE + { D3D10_TEXTURECUBE_FACE_POSITIVE_X = 0, + D3D10_TEXTURECUBE_FACE_NEGATIVE_X = 1, + D3D10_TEXTURECUBE_FACE_POSITIVE_Y = 2, + D3D10_TEXTURECUBE_FACE_NEGATIVE_Y = 3, + D3D10_TEXTURECUBE_FACE_POSITIVE_Z = 4, + D3D10_TEXTURECUBE_FACE_NEGATIVE_Z = 5 + } D3D10_TEXTURECUBE_FACE; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0009_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0009_v0_0_s_ifspec; + +#ifndef __ID3D10View_INTERFACE_DEFINED__ +#define __ID3D10View_INTERFACE_DEFINED__ + +/* interface ID3D10View */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10View; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C902B03F-60A7-49BA-9936-2A3AB37A7E33") + ID3D10View : public ID3D10DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetResource( + /* [annotation] */ + __out ID3D10Resource **ppResource) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10ViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10View * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10View * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10View * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10View * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10View * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10View * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10View * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D10View * This, + /* [annotation] */ + __out ID3D10Resource **ppResource); + + END_INTERFACE + } ID3D10ViewVtbl; + + interface ID3D10View + { + CONST_VTBL struct ID3D10ViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10View_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10View_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10View_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10View_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10View_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10View_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10View_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10View_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10View_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0010 */ +/* [local] */ + +typedef struct D3D10_BUFFER_SRV + { + union + { + UINT FirstElement; + UINT ElementOffset; + } ; + union + { + UINT NumElements; + UINT ElementWidth; + } ; + } D3D10_BUFFER_SRV; + +typedef struct D3D10_TEX1D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D10_TEX1D_SRV; + +typedef struct D3D10_TEX1D_ARRAY_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX1D_ARRAY_SRV; + +typedef struct D3D10_TEX2D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D10_TEX2D_SRV; + +typedef struct D3D10_TEX2D_ARRAY_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX2D_ARRAY_SRV; + +typedef struct D3D10_TEX3D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D10_TEX3D_SRV; + +typedef struct D3D10_TEXCUBE_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D10_TEXCUBE_SRV; + +typedef struct D3D10_TEX2DMS_SRV + { + UINT UnusedField_NothingToDefine; + } D3D10_TEX2DMS_SRV; + +typedef struct D3D10_TEX2DMS_ARRAY_SRV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX2DMS_ARRAY_SRV; + +typedef struct D3D10_SHADER_RESOURCE_VIEW_DESC + { + DXGI_FORMAT Format; + D3D10_SRV_DIMENSION ViewDimension; + union + { + D3D10_BUFFER_SRV Buffer; + D3D10_TEX1D_SRV Texture1D; + D3D10_TEX1D_ARRAY_SRV Texture1DArray; + D3D10_TEX2D_SRV Texture2D; + D3D10_TEX2D_ARRAY_SRV Texture2DArray; + D3D10_TEX2DMS_SRV Texture2DMS; + D3D10_TEX2DMS_ARRAY_SRV Texture2DMSArray; + D3D10_TEX3D_SRV Texture3D; + D3D10_TEXCUBE_SRV TextureCube; + } ; + } D3D10_SHADER_RESOURCE_VIEW_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0010_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0010_v0_0_s_ifspec; + +#ifndef __ID3D10ShaderResourceView_INTERFACE_DEFINED__ +#define __ID3D10ShaderResourceView_INTERFACE_DEFINED__ + +/* interface ID3D10ShaderResourceView */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10ShaderResourceView; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C07-342C-4106-A19F-4F2704F689F0") + ID3D10ShaderResourceView : public ID3D10View + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10ShaderResourceViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10ShaderResourceView * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10ShaderResourceView * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10ShaderResourceView * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10ShaderResourceView * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10ShaderResourceView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10ShaderResourceView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10ShaderResourceView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D10ShaderResourceView * This, + /* [annotation] */ + __out ID3D10Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10ShaderResourceView * This, + /* [annotation] */ + __out D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc); + + END_INTERFACE + } ID3D10ShaderResourceViewVtbl; + + interface ID3D10ShaderResourceView + { + CONST_VTBL struct ID3D10ShaderResourceViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10ShaderResourceView_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10ShaderResourceView_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10ShaderResourceView_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10ShaderResourceView_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10ShaderResourceView_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10ShaderResourceView_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10ShaderResourceView_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10ShaderResourceView_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D10ShaderResourceView_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10ShaderResourceView_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0011 */ +/* [local] */ + +typedef struct D3D10_BUFFER_RTV + { + union + { + UINT FirstElement; + UINT ElementOffset; + } ; + union + { + UINT NumElements; + UINT ElementWidth; + } ; + } D3D10_BUFFER_RTV; + +typedef struct D3D10_TEX1D_RTV + { + UINT MipSlice; + } D3D10_TEX1D_RTV; + +typedef struct D3D10_TEX1D_ARRAY_RTV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX1D_ARRAY_RTV; + +typedef struct D3D10_TEX2D_RTV + { + UINT MipSlice; + } D3D10_TEX2D_RTV; + +typedef struct D3D10_TEX2DMS_RTV + { + UINT UnusedField_NothingToDefine; + } D3D10_TEX2DMS_RTV; + +typedef struct D3D10_TEX2D_ARRAY_RTV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX2D_ARRAY_RTV; + +typedef struct D3D10_TEX2DMS_ARRAY_RTV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX2DMS_ARRAY_RTV; + +typedef struct D3D10_TEX3D_RTV + { + UINT MipSlice; + UINT FirstWSlice; + UINT WSize; + } D3D10_TEX3D_RTV; + +typedef struct D3D10_RENDER_TARGET_VIEW_DESC + { + DXGI_FORMAT Format; + D3D10_RTV_DIMENSION ViewDimension; + union + { + D3D10_BUFFER_RTV Buffer; + D3D10_TEX1D_RTV Texture1D; + D3D10_TEX1D_ARRAY_RTV Texture1DArray; + D3D10_TEX2D_RTV Texture2D; + D3D10_TEX2D_ARRAY_RTV Texture2DArray; + D3D10_TEX2DMS_RTV Texture2DMS; + D3D10_TEX2DMS_ARRAY_RTV Texture2DMSArray; + D3D10_TEX3D_RTV Texture3D; + } ; + } D3D10_RENDER_TARGET_VIEW_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0011_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0011_v0_0_s_ifspec; + +#ifndef __ID3D10RenderTargetView_INTERFACE_DEFINED__ +#define __ID3D10RenderTargetView_INTERFACE_DEFINED__ + +/* interface ID3D10RenderTargetView */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10RenderTargetView; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C08-342C-4106-A19F-4F2704F689F0") + ID3D10RenderTargetView : public ID3D10View + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_RENDER_TARGET_VIEW_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10RenderTargetViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10RenderTargetView * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10RenderTargetView * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10RenderTargetView * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10RenderTargetView * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10RenderTargetView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10RenderTargetView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10RenderTargetView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D10RenderTargetView * This, + /* [annotation] */ + __out ID3D10Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10RenderTargetView * This, + /* [annotation] */ + __out D3D10_RENDER_TARGET_VIEW_DESC *pDesc); + + END_INTERFACE + } ID3D10RenderTargetViewVtbl; + + interface ID3D10RenderTargetView + { + CONST_VTBL struct ID3D10RenderTargetViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10RenderTargetView_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10RenderTargetView_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10RenderTargetView_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10RenderTargetView_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10RenderTargetView_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10RenderTargetView_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10RenderTargetView_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10RenderTargetView_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D10RenderTargetView_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10RenderTargetView_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0012 */ +/* [local] */ + +typedef struct D3D10_TEX1D_DSV + { + UINT MipSlice; + } D3D10_TEX1D_DSV; + +typedef struct D3D10_TEX1D_ARRAY_DSV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX1D_ARRAY_DSV; + +typedef struct D3D10_TEX2D_DSV + { + UINT MipSlice; + } D3D10_TEX2D_DSV; + +typedef struct D3D10_TEX2D_ARRAY_DSV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX2D_ARRAY_DSV; + +typedef struct D3D10_TEX2DMS_DSV + { + UINT UnusedField_NothingToDefine; + } D3D10_TEX2DMS_DSV; + +typedef struct D3D10_TEX2DMS_ARRAY_DSV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D10_TEX2DMS_ARRAY_DSV; + +typedef struct D3D10_DEPTH_STENCIL_VIEW_DESC + { + DXGI_FORMAT Format; + D3D10_DSV_DIMENSION ViewDimension; + union + { + D3D10_TEX1D_DSV Texture1D; + D3D10_TEX1D_ARRAY_DSV Texture1DArray; + D3D10_TEX2D_DSV Texture2D; + D3D10_TEX2D_ARRAY_DSV Texture2DArray; + D3D10_TEX2DMS_DSV Texture2DMS; + D3D10_TEX2DMS_ARRAY_DSV Texture2DMSArray; + } ; + } D3D10_DEPTH_STENCIL_VIEW_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0012_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0012_v0_0_s_ifspec; + +#ifndef __ID3D10DepthStencilView_INTERFACE_DEFINED__ +#define __ID3D10DepthStencilView_INTERFACE_DEFINED__ + +/* interface ID3D10DepthStencilView */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10DepthStencilView; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C09-342C-4106-A19F-4F2704F689F0") + ID3D10DepthStencilView : public ID3D10View + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10DepthStencilViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10DepthStencilView * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10DepthStencilView * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10DepthStencilView * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10DepthStencilView * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10DepthStencilView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10DepthStencilView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10DepthStencilView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D10DepthStencilView * This, + /* [annotation] */ + __out ID3D10Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10DepthStencilView * This, + /* [annotation] */ + __out D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc); + + END_INTERFACE + } ID3D10DepthStencilViewVtbl; + + interface ID3D10DepthStencilView + { + CONST_VTBL struct ID3D10DepthStencilViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10DepthStencilView_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10DepthStencilView_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10DepthStencilView_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10DepthStencilView_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10DepthStencilView_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10DepthStencilView_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10DepthStencilView_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10DepthStencilView_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D10DepthStencilView_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10DepthStencilView_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10VertexShader_INTERFACE_DEFINED__ +#define __ID3D10VertexShader_INTERFACE_DEFINED__ + +/* interface ID3D10VertexShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10VertexShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C0A-342C-4106-A19F-4F2704F689F0") + ID3D10VertexShader : public ID3D10DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D10VertexShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10VertexShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10VertexShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10VertexShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10VertexShader * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10VertexShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10VertexShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10VertexShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D10VertexShaderVtbl; + + interface ID3D10VertexShader + { + CONST_VTBL struct ID3D10VertexShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10VertexShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10VertexShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10VertexShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10VertexShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10VertexShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10VertexShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10VertexShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10VertexShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10GeometryShader_INTERFACE_DEFINED__ +#define __ID3D10GeometryShader_INTERFACE_DEFINED__ + +/* interface ID3D10GeometryShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10GeometryShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6316BE88-54CD-4040-AB44-20461BC81F68") + ID3D10GeometryShader : public ID3D10DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D10GeometryShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10GeometryShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10GeometryShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10GeometryShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10GeometryShader * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10GeometryShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10GeometryShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10GeometryShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D10GeometryShaderVtbl; + + interface ID3D10GeometryShader + { + CONST_VTBL struct ID3D10GeometryShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10GeometryShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10GeometryShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10GeometryShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10GeometryShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10GeometryShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10GeometryShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10GeometryShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10GeometryShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10PixelShader_INTERFACE_DEFINED__ +#define __ID3D10PixelShader_INTERFACE_DEFINED__ + +/* interface ID3D10PixelShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10PixelShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4968B601-9D00-4cde-8346-8E7F675819B6") + ID3D10PixelShader : public ID3D10DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D10PixelShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10PixelShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10PixelShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10PixelShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10PixelShader * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10PixelShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10PixelShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10PixelShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D10PixelShaderVtbl; + + interface ID3D10PixelShader + { + CONST_VTBL struct ID3D10PixelShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10PixelShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10PixelShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10PixelShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10PixelShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10PixelShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10PixelShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10PixelShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10PixelShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10InputLayout_INTERFACE_DEFINED__ +#define __ID3D10InputLayout_INTERFACE_DEFINED__ + +/* interface ID3D10InputLayout */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10InputLayout; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C0B-342C-4106-A19F-4F2704F689F0") + ID3D10InputLayout : public ID3D10DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D10InputLayoutVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10InputLayout * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10InputLayout * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10InputLayout * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10InputLayout * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10InputLayout * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10InputLayout * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10InputLayout * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D10InputLayoutVtbl; + + interface ID3D10InputLayout + { + CONST_VTBL struct ID3D10InputLayoutVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10InputLayout_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10InputLayout_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10InputLayout_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10InputLayout_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10InputLayout_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10InputLayout_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10InputLayout_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10InputLayout_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0017 */ +/* [local] */ + +typedef +enum D3D10_FILTER + { D3D10_FILTER_MIN_MAG_MIP_POINT = 0, + D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1, + D3D10_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4, + D3D10_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5, + D3D10_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10, + D3D10_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, + D3D10_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14, + D3D10_FILTER_MIN_MAG_MIP_LINEAR = 0x15, + D3D10_FILTER_ANISOTROPIC = 0x55, + D3D10_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80, + D3D10_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81, + D3D10_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84, + D3D10_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85, + D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90, + D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91, + D3D10_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94, + D3D10_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95, + D3D10_FILTER_COMPARISON_ANISOTROPIC = 0xd5, + D3D10_FILTER_TEXT_1BIT = 0x80000000 + } D3D10_FILTER; + +typedef +enum D3D10_FILTER_TYPE + { D3D10_FILTER_TYPE_POINT = 0, + D3D10_FILTER_TYPE_LINEAR = 1 + } D3D10_FILTER_TYPE; + +#define D3D10_FILTER_TYPE_MASK ( 0x3 ) + +#define D3D10_MIN_FILTER_SHIFT ( 4 ) + +#define D3D10_MAG_FILTER_SHIFT ( 2 ) + +#define D3D10_MIP_FILTER_SHIFT ( 0 ) + +#define D3D10_COMPARISON_FILTERING_BIT ( 0x80 ) + +#define D3D10_ANISOTROPIC_FILTERING_BIT ( 0x40 ) + +#define D3D10_TEXT_1BIT_BIT ( 0x80000000 ) + +#define D3D10_ENCODE_BASIC_FILTER( min, mag, mip, bComparison ) \ + ( ( D3D10_FILTER ) ( \ + ( ( bComparison ) ? D3D10_COMPARISON_FILTERING_BIT : 0 ) | \ + ( ( ( min ) & D3D10_FILTER_TYPE_MASK ) << D3D10_MIN_FILTER_SHIFT ) | \ + ( ( ( mag ) & D3D10_FILTER_TYPE_MASK ) << D3D10_MAG_FILTER_SHIFT ) | \ + ( ( ( mip ) & D3D10_FILTER_TYPE_MASK ) << D3D10_MIP_FILTER_SHIFT ) ) ) +#define D3D10_ENCODE_ANISOTROPIC_FILTER( bComparison ) \ + ( ( D3D10_FILTER ) ( \ + D3D10_ANISOTROPIC_FILTERING_BIT | \ + D3D10_ENCODE_BASIC_FILTER( D3D10_FILTER_TYPE_LINEAR, \ + D3D10_FILTER_TYPE_LINEAR, \ + D3D10_FILTER_TYPE_LINEAR, \ + bComparison ) ) ) +#define D3D10_DECODE_MIN_FILTER( d3d10Filter ) \ + ( ( D3D10_FILTER_TYPE ) \ + ( ( ( d3d10Filter ) >> D3D10_MIN_FILTER_SHIFT ) & D3D10_FILTER_TYPE_MASK ) ) +#define D3D10_DECODE_MAG_FILTER( d3d10Filter ) \ + ( ( D3D10_FILTER_TYPE ) \ + ( ( ( d3d10Filter ) >> D3D10_MAG_FILTER_SHIFT ) & D3D10_FILTER_TYPE_MASK ) ) +#define D3D10_DECODE_MIP_FILTER( d3d10Filter ) \ + ( ( D3D10_FILTER_TYPE ) \ + ( ( ( d3d10Filter ) >> D3D10_MIP_FILTER_SHIFT ) & D3D10_FILTER_TYPE_MASK ) ) +#define D3D10_DECODE_IS_COMPARISON_FILTER( d3d10Filter ) \ + ( ( d3d10Filter ) & D3D10_COMPARISON_FILTERING_BIT ) +#define D3D10_DECODE_IS_ANISOTROPIC_FILTER( d3d10Filter ) \ + ( ( ( d3d10Filter ) & D3D10_ANISOTROPIC_FILTERING_BIT ) && \ + ( D3D10_FILTER_TYPE_LINEAR == D3D10_DECODE_MIN_FILTER( d3d10Filter ) ) && \ + ( D3D10_FILTER_TYPE_LINEAR == D3D10_DECODE_MAG_FILTER( d3d10Filter ) ) && \ + ( D3D10_FILTER_TYPE_LINEAR == D3D10_DECODE_MIP_FILTER( d3d10Filter ) ) ) +#define D3D10_DECODE_IS_TEXT_1BIT_FILTER( d3d10Filter ) \ + ( ( d3d10Filter ) == D3D10_TEXT_1BIT_BIT ) +typedef +enum D3D10_TEXTURE_ADDRESS_MODE + { D3D10_TEXTURE_ADDRESS_WRAP = 1, + D3D10_TEXTURE_ADDRESS_MIRROR = 2, + D3D10_TEXTURE_ADDRESS_CLAMP = 3, + D3D10_TEXTURE_ADDRESS_BORDER = 4, + D3D10_TEXTURE_ADDRESS_MIRROR_ONCE = 5 + } D3D10_TEXTURE_ADDRESS_MODE; + +typedef struct D3D10_SAMPLER_DESC + { + D3D10_FILTER Filter; + D3D10_TEXTURE_ADDRESS_MODE AddressU; + D3D10_TEXTURE_ADDRESS_MODE AddressV; + D3D10_TEXTURE_ADDRESS_MODE AddressW; + FLOAT MipLODBias; + UINT MaxAnisotropy; + D3D10_COMPARISON_FUNC ComparisonFunc; + FLOAT BorderColor[ 4 ]; + FLOAT MinLOD; + FLOAT MaxLOD; + } D3D10_SAMPLER_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0017_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0017_v0_0_s_ifspec; + +#ifndef __ID3D10SamplerState_INTERFACE_DEFINED__ +#define __ID3D10SamplerState_INTERFACE_DEFINED__ + +/* interface ID3D10SamplerState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10SamplerState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C0C-342C-4106-A19F-4F2704F689F0") + ID3D10SamplerState : public ID3D10DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_SAMPLER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10SamplerStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10SamplerState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10SamplerState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10SamplerState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10SamplerState * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10SamplerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10SamplerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10SamplerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10SamplerState * This, + /* [annotation] */ + __out D3D10_SAMPLER_DESC *pDesc); + + END_INTERFACE + } ID3D10SamplerStateVtbl; + + interface ID3D10SamplerState + { + CONST_VTBL struct ID3D10SamplerStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10SamplerState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10SamplerState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10SamplerState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10SamplerState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10SamplerState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10SamplerState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10SamplerState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10SamplerState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10SamplerState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0018 */ +/* [local] */ + +typedef +enum D3D10_FORMAT_SUPPORT + { D3D10_FORMAT_SUPPORT_BUFFER = 0x1, + D3D10_FORMAT_SUPPORT_IA_VERTEX_BUFFER = 0x2, + D3D10_FORMAT_SUPPORT_IA_INDEX_BUFFER = 0x4, + D3D10_FORMAT_SUPPORT_SO_BUFFER = 0x8, + D3D10_FORMAT_SUPPORT_TEXTURE1D = 0x10, + D3D10_FORMAT_SUPPORT_TEXTURE2D = 0x20, + D3D10_FORMAT_SUPPORT_TEXTURE3D = 0x40, + D3D10_FORMAT_SUPPORT_TEXTURECUBE = 0x80, + D3D10_FORMAT_SUPPORT_SHADER_LOAD = 0x100, + D3D10_FORMAT_SUPPORT_SHADER_SAMPLE = 0x200, + D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON = 0x400, + D3D10_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT = 0x800, + D3D10_FORMAT_SUPPORT_MIP = 0x1000, + D3D10_FORMAT_SUPPORT_MIP_AUTOGEN = 0x2000, + D3D10_FORMAT_SUPPORT_RENDER_TARGET = 0x4000, + D3D10_FORMAT_SUPPORT_BLENDABLE = 0x8000, + D3D10_FORMAT_SUPPORT_DEPTH_STENCIL = 0x10000, + D3D10_FORMAT_SUPPORT_CPU_LOCKABLE = 0x20000, + D3D10_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE = 0x40000, + D3D10_FORMAT_SUPPORT_DISPLAY = 0x80000, + D3D10_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = 0x100000, + D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = 0x200000, + D3D10_FORMAT_SUPPORT_MULTISAMPLE_LOAD = 0x400000, + D3D10_FORMAT_SUPPORT_SHADER_GATHER = 0x800000, + D3D10_FORMAT_SUPPORT_BACK_BUFFER_CAST = 0x1000000 + } D3D10_FORMAT_SUPPORT; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0018_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0018_v0_0_s_ifspec; + +#ifndef __ID3D10Asynchronous_INTERFACE_DEFINED__ +#define __ID3D10Asynchronous_INTERFACE_DEFINED__ + +/* interface ID3D10Asynchronous */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Asynchronous; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C0D-342C-4106-A19F-4F2704F689F0") + ID3D10Asynchronous : public ID3D10DeviceChild + { + public: + virtual void STDMETHODCALLTYPE Begin( void) = 0; + + virtual void STDMETHODCALLTYPE End( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetData( + /* [annotation] */ + __out_bcount_opt(DataSize) void *pData, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in UINT GetDataFlags) = 0; + + virtual UINT STDMETHODCALLTYPE GetDataSize( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10AsynchronousVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Asynchronous * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Asynchronous * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Asynchronous * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Asynchronous * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Asynchronous * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Asynchronous * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Asynchronous * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *Begin )( + ID3D10Asynchronous * This); + + void ( STDMETHODCALLTYPE *End )( + ID3D10Asynchronous * This); + + HRESULT ( STDMETHODCALLTYPE *GetData )( + ID3D10Asynchronous * This, + /* [annotation] */ + __out_bcount_opt(DataSize) void *pData, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in UINT GetDataFlags); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D10Asynchronous * This); + + END_INTERFACE + } ID3D10AsynchronousVtbl; + + interface ID3D10Asynchronous + { + CONST_VTBL struct ID3D10AsynchronousVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Asynchronous_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Asynchronous_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Asynchronous_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Asynchronous_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Asynchronous_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Asynchronous_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Asynchronous_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Asynchronous_Begin(This) \ + ( (This)->lpVtbl -> Begin(This) ) + +#define ID3D10Asynchronous_End(This) \ + ( (This)->lpVtbl -> End(This) ) + +#define ID3D10Asynchronous_GetData(This,pData,DataSize,GetDataFlags) \ + ( (This)->lpVtbl -> GetData(This,pData,DataSize,GetDataFlags) ) + +#define ID3D10Asynchronous_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Asynchronous_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0019 */ +/* [local] */ + +typedef +enum D3D10_ASYNC_GETDATA_FLAG + { D3D10_ASYNC_GETDATA_DONOTFLUSH = 0x1 + } D3D10_ASYNC_GETDATA_FLAG; + +typedef +enum D3D10_QUERY + { D3D10_QUERY_EVENT = 0, + D3D10_QUERY_OCCLUSION = ( D3D10_QUERY_EVENT + 1 ) , + D3D10_QUERY_TIMESTAMP = ( D3D10_QUERY_OCCLUSION + 1 ) , + D3D10_QUERY_TIMESTAMP_DISJOINT = ( D3D10_QUERY_TIMESTAMP + 1 ) , + D3D10_QUERY_PIPELINE_STATISTICS = ( D3D10_QUERY_TIMESTAMP_DISJOINT + 1 ) , + D3D10_QUERY_OCCLUSION_PREDICATE = ( D3D10_QUERY_PIPELINE_STATISTICS + 1 ) , + D3D10_QUERY_SO_STATISTICS = ( D3D10_QUERY_OCCLUSION_PREDICATE + 1 ) , + D3D10_QUERY_SO_OVERFLOW_PREDICATE = ( D3D10_QUERY_SO_STATISTICS + 1 ) + } D3D10_QUERY; + +typedef +enum D3D10_QUERY_MISC_FLAG + { D3D10_QUERY_MISC_PREDICATEHINT = 0x1 + } D3D10_QUERY_MISC_FLAG; + +typedef struct D3D10_QUERY_DESC + { + D3D10_QUERY Query; + UINT MiscFlags; + } D3D10_QUERY_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0019_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0019_v0_0_s_ifspec; + +#ifndef __ID3D10Query_INTERFACE_DEFINED__ +#define __ID3D10Query_INTERFACE_DEFINED__ + +/* interface ID3D10Query */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Query; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C0E-342C-4106-A19F-4F2704F689F0") + ID3D10Query : public ID3D10Asynchronous + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_QUERY_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10QueryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Query * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Query * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Query * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Query * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Query * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Query * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Query * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *Begin )( + ID3D10Query * This); + + void ( STDMETHODCALLTYPE *End )( + ID3D10Query * This); + + HRESULT ( STDMETHODCALLTYPE *GetData )( + ID3D10Query * This, + /* [annotation] */ + __out_bcount_opt(DataSize) void *pData, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in UINT GetDataFlags); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D10Query * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10Query * This, + /* [annotation] */ + __out D3D10_QUERY_DESC *pDesc); + + END_INTERFACE + } ID3D10QueryVtbl; + + interface ID3D10Query + { + CONST_VTBL struct ID3D10QueryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Query_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Query_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Query_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Query_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Query_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Query_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Query_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Query_Begin(This) \ + ( (This)->lpVtbl -> Begin(This) ) + +#define ID3D10Query_End(This) \ + ( (This)->lpVtbl -> End(This) ) + +#define ID3D10Query_GetData(This,pData,DataSize,GetDataFlags) \ + ( (This)->lpVtbl -> GetData(This,pData,DataSize,GetDataFlags) ) + +#define ID3D10Query_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + + +#define ID3D10Query_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Query_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10Predicate_INTERFACE_DEFINED__ +#define __ID3D10Predicate_INTERFACE_DEFINED__ + +/* interface ID3D10Predicate */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Predicate; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C10-342C-4106-A19F-4F2704F689F0") + ID3D10Predicate : public ID3D10Query + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D10PredicateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Predicate * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Predicate * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Predicate * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Predicate * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Predicate * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Predicate * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Predicate * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *Begin )( + ID3D10Predicate * This); + + void ( STDMETHODCALLTYPE *End )( + ID3D10Predicate * This); + + HRESULT ( STDMETHODCALLTYPE *GetData )( + ID3D10Predicate * This, + /* [annotation] */ + __out_bcount_opt(DataSize) void *pData, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in UINT GetDataFlags); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D10Predicate * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10Predicate * This, + /* [annotation] */ + __out D3D10_QUERY_DESC *pDesc); + + END_INTERFACE + } ID3D10PredicateVtbl; + + interface ID3D10Predicate + { + CONST_VTBL struct ID3D10PredicateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Predicate_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Predicate_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Predicate_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Predicate_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Predicate_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Predicate_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Predicate_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Predicate_Begin(This) \ + ( (This)->lpVtbl -> Begin(This) ) + +#define ID3D10Predicate_End(This) \ + ( (This)->lpVtbl -> End(This) ) + +#define ID3D10Predicate_GetData(This,pData,DataSize,GetDataFlags) \ + ( (This)->lpVtbl -> GetData(This,pData,DataSize,GetDataFlags) ) + +#define ID3D10Predicate_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + + +#define ID3D10Predicate_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Predicate_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0021 */ +/* [local] */ + +typedef struct D3D10_QUERY_DATA_TIMESTAMP_DISJOINT + { + UINT64 Frequency; + BOOL Disjoint; + } D3D10_QUERY_DATA_TIMESTAMP_DISJOINT; + +typedef struct D3D10_QUERY_DATA_PIPELINE_STATISTICS + { + UINT64 IAVertices; + UINT64 IAPrimitives; + UINT64 VSInvocations; + UINT64 GSInvocations; + UINT64 GSPrimitives; + UINT64 CInvocations; + UINT64 CPrimitives; + UINT64 PSInvocations; + } D3D10_QUERY_DATA_PIPELINE_STATISTICS; + +typedef struct D3D10_QUERY_DATA_SO_STATISTICS + { + UINT64 NumPrimitivesWritten; + UINT64 PrimitivesStorageNeeded; + } D3D10_QUERY_DATA_SO_STATISTICS; + +typedef +enum D3D10_COUNTER + { D3D10_COUNTER_GPU_IDLE = 0, + D3D10_COUNTER_VERTEX_PROCESSING = ( D3D10_COUNTER_GPU_IDLE + 1 ) , + D3D10_COUNTER_GEOMETRY_PROCESSING = ( D3D10_COUNTER_VERTEX_PROCESSING + 1 ) , + D3D10_COUNTER_PIXEL_PROCESSING = ( D3D10_COUNTER_GEOMETRY_PROCESSING + 1 ) , + D3D10_COUNTER_OTHER_GPU_PROCESSING = ( D3D10_COUNTER_PIXEL_PROCESSING + 1 ) , + D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION = ( D3D10_COUNTER_OTHER_GPU_PROCESSING + 1 ) , + D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION = ( D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION + 1 ) , + D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION = ( D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION + 1 ) , + D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION = ( D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION + 1 ) , + D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION = ( D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION + 1 ) , + D3D10_COUNTER_VS_MEMORY_LIMITED = ( D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION + 1 ) , + D3D10_COUNTER_VS_COMPUTATION_LIMITED = ( D3D10_COUNTER_VS_MEMORY_LIMITED + 1 ) , + D3D10_COUNTER_GS_MEMORY_LIMITED = ( D3D10_COUNTER_VS_COMPUTATION_LIMITED + 1 ) , + D3D10_COUNTER_GS_COMPUTATION_LIMITED = ( D3D10_COUNTER_GS_MEMORY_LIMITED + 1 ) , + D3D10_COUNTER_PS_MEMORY_LIMITED = ( D3D10_COUNTER_GS_COMPUTATION_LIMITED + 1 ) , + D3D10_COUNTER_PS_COMPUTATION_LIMITED = ( D3D10_COUNTER_PS_MEMORY_LIMITED + 1 ) , + D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE = ( D3D10_COUNTER_PS_COMPUTATION_LIMITED + 1 ) , + D3D10_COUNTER_TEXTURE_CACHE_HIT_RATE = ( D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE + 1 ) , + D3D10_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000 + } D3D10_COUNTER; + +typedef +enum D3D10_COUNTER_TYPE + { D3D10_COUNTER_TYPE_FLOAT32 = 0, + D3D10_COUNTER_TYPE_UINT16 = ( D3D10_COUNTER_TYPE_FLOAT32 + 1 ) , + D3D10_COUNTER_TYPE_UINT32 = ( D3D10_COUNTER_TYPE_UINT16 + 1 ) , + D3D10_COUNTER_TYPE_UINT64 = ( D3D10_COUNTER_TYPE_UINT32 + 1 ) + } D3D10_COUNTER_TYPE; + +typedef struct D3D10_COUNTER_DESC + { + D3D10_COUNTER Counter; + UINT MiscFlags; + } D3D10_COUNTER_DESC; + +typedef struct D3D10_COUNTER_INFO + { + D3D10_COUNTER LastDeviceDependentCounter; + UINT NumSimultaneousCounters; + UINT8 NumDetectableParallelUnits; + } D3D10_COUNTER_INFO; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0021_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0021_v0_0_s_ifspec; + +#ifndef __ID3D10Counter_INTERFACE_DEFINED__ +#define __ID3D10Counter_INTERFACE_DEFINED__ + +/* interface ID3D10Counter */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Counter; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C11-342C-4106-A19F-4F2704F689F0") + ID3D10Counter : public ID3D10Asynchronous + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D10_COUNTER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10CounterVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Counter * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Counter * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Counter * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10Counter * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Counter * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Counter * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Counter * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *Begin )( + ID3D10Counter * This); + + void ( STDMETHODCALLTYPE *End )( + ID3D10Counter * This); + + HRESULT ( STDMETHODCALLTYPE *GetData )( + ID3D10Counter * This, + /* [annotation] */ + __out_bcount_opt(DataSize) void *pData, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in UINT GetDataFlags); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D10Counter * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10Counter * This, + /* [annotation] */ + __out D3D10_COUNTER_DESC *pDesc); + + END_INTERFACE + } ID3D10CounterVtbl; + + interface ID3D10Counter + { + CONST_VTBL struct ID3D10CounterVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Counter_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Counter_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Counter_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Counter_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10Counter_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Counter_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Counter_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10Counter_Begin(This) \ + ( (This)->lpVtbl -> Begin(This) ) + +#define ID3D10Counter_End(This) \ + ( (This)->lpVtbl -> End(This) ) + +#define ID3D10Counter_GetData(This,pData,DataSize,GetDataFlags) \ + ( (This)->lpVtbl -> GetData(This,pData,DataSize,GetDataFlags) ) + +#define ID3D10Counter_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + + +#define ID3D10Counter_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Counter_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10Device_INTERFACE_DEFINED__ +#define __ID3D10Device_INTERFACE_DEFINED__ + +/* interface ID3D10Device */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Device; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C0F-342C-4106-A19F-4F2704F689F0") + ID3D10Device : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE VSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE PSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE PSSetShader( + /* [annotation] */ + __in_opt ID3D10PixelShader *pPixelShader) = 0; + + virtual void STDMETHODCALLTYPE PSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE VSSetShader( + /* [annotation] */ + __in_opt ID3D10VertexShader *pVertexShader) = 0; + + virtual void STDMETHODCALLTYPE DrawIndexed( + /* [annotation] */ + __in UINT IndexCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation) = 0; + + virtual void STDMETHODCALLTYPE Draw( + /* [annotation] */ + __in UINT VertexCount, + /* [annotation] */ + __in UINT StartVertexLocation) = 0; + + virtual void STDMETHODCALLTYPE PSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE IASetInputLayout( + /* [annotation] */ + __in_opt ID3D10InputLayout *pInputLayout) = 0; + + virtual void STDMETHODCALLTYPE IASetVertexBuffers( + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppVertexBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pStrides, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pOffsets) = 0; + + virtual void STDMETHODCALLTYPE IASetIndexBuffer( + /* [annotation] */ + __in_opt ID3D10Buffer *pIndexBuffer, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT Offset) = 0; + + virtual void STDMETHODCALLTYPE DrawIndexedInstanced( + /* [annotation] */ + __in UINT IndexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation) = 0; + + virtual void STDMETHODCALLTYPE DrawInstanced( + /* [annotation] */ + __in UINT VertexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation) = 0; + + virtual void STDMETHODCALLTYPE GSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE GSSetShader( + /* [annotation] */ + __in_opt ID3D10GeometryShader *pShader) = 0; + + virtual void STDMETHODCALLTYPE IASetPrimitiveTopology( + /* [annotation] */ + __in D3D10_PRIMITIVE_TOPOLOGY Topology) = 0; + + virtual void STDMETHODCALLTYPE VSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE VSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE SetPredication( + /* [annotation] */ + __in_opt ID3D10Predicate *pPredicate, + /* [annotation] */ + __in BOOL PredicateValue) = 0; + + virtual void STDMETHODCALLTYPE GSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE GSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE OMSetRenderTargets( + /* [annotation] */ + __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __in_ecount_opt(NumViews) ID3D10RenderTargetView *const *ppRenderTargetViews, + /* [annotation] */ + __in_opt ID3D10DepthStencilView *pDepthStencilView) = 0; + + virtual void STDMETHODCALLTYPE OMSetBlendState( + /* [annotation] */ + __in_opt ID3D10BlendState *pBlendState, + /* [annotation] */ + __in const FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __in UINT SampleMask) = 0; + + virtual void STDMETHODCALLTYPE OMSetDepthStencilState( + /* [annotation] */ + __in_opt ID3D10DepthStencilState *pDepthStencilState, + /* [annotation] */ + __in UINT StencilRef) = 0; + + virtual void STDMETHODCALLTYPE SOSetTargets( + /* [annotation] */ + __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT) UINT NumBuffers, + /* [annotation] */ + __in_ecount_opt(NumBuffers) ID3D10Buffer *const *ppSOTargets, + /* [annotation] */ + __in_ecount_opt(NumBuffers) const UINT *pOffsets) = 0; + + virtual void STDMETHODCALLTYPE DrawAuto( void) = 0; + + virtual void STDMETHODCALLTYPE RSSetState( + /* [annotation] */ + __in_opt ID3D10RasterizerState *pRasterizerState) = 0; + + virtual void STDMETHODCALLTYPE RSSetViewports( + /* [annotation] */ + __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + /* [annotation] */ + __in_ecount_opt(NumViewports) const D3D10_VIEWPORT *pViewports) = 0; + + virtual void STDMETHODCALLTYPE RSSetScissorRects( + /* [annotation] */ + __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + /* [annotation] */ + __in_ecount_opt(NumRects) const D3D10_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE CopySubresourceRegion( + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in UINT DstX, + /* [annotation] */ + __in UINT DstY, + /* [annotation] */ + __in UINT DstZ, + /* [annotation] */ + __in ID3D10Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in_opt const D3D10_BOX *pSrcBox) = 0; + + virtual void STDMETHODCALLTYPE CopyResource( + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in ID3D10Resource *pSrcResource) = 0; + + virtual void STDMETHODCALLTYPE UpdateSubresource( + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in_opt const D3D10_BOX *pDstBox, + /* [annotation] */ + __in const void *pSrcData, + /* [annotation] */ + __in UINT SrcRowPitch, + /* [annotation] */ + __in UINT SrcDepthPitch) = 0; + + virtual void STDMETHODCALLTYPE ClearRenderTargetView( + /* [annotation] */ + __in ID3D10RenderTargetView *pRenderTargetView, + /* [annotation] */ + __in const FLOAT ColorRGBA[ 4 ]) = 0; + + virtual void STDMETHODCALLTYPE ClearDepthStencilView( + /* [annotation] */ + __in ID3D10DepthStencilView *pDepthStencilView, + /* [annotation] */ + __in UINT ClearFlags, + /* [annotation] */ + __in FLOAT Depth, + /* [annotation] */ + __in UINT8 Stencil) = 0; + + virtual void STDMETHODCALLTYPE GenerateMips( + /* [annotation] */ + __in ID3D10ShaderResourceView *pShaderResourceView) = 0; + + virtual void STDMETHODCALLTYPE ResolveSubresource( + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in ID3D10Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in DXGI_FORMAT Format) = 0; + + virtual void STDMETHODCALLTYPE VSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE PSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE PSGetShader( + /* [annotation] */ + __out ID3D10PixelShader **ppPixelShader) = 0; + + virtual void STDMETHODCALLTYPE PSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE VSGetShader( + /* [annotation] */ + __out ID3D10VertexShader **ppVertexShader) = 0; + + virtual void STDMETHODCALLTYPE PSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE IAGetInputLayout( + /* [annotation] */ + __out ID3D10InputLayout **ppInputLayout) = 0; + + virtual void STDMETHODCALLTYPE IAGetVertexBuffers( + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D10Buffer **ppVertexBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pStrides, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets) = 0; + + virtual void STDMETHODCALLTYPE IAGetIndexBuffer( + /* [annotation] */ + __out_opt ID3D10Buffer **pIndexBuffer, + /* [annotation] */ + __out_opt DXGI_FORMAT *Format, + /* [annotation] */ + __out_opt UINT *Offset) = 0; + + virtual void STDMETHODCALLTYPE GSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE GSGetShader( + /* [annotation] */ + __out ID3D10GeometryShader **ppGeometryShader) = 0; + + virtual void STDMETHODCALLTYPE IAGetPrimitiveTopology( + /* [annotation] */ + __out D3D10_PRIMITIVE_TOPOLOGY *pTopology) = 0; + + virtual void STDMETHODCALLTYPE VSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE VSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE GetPredication( + /* [annotation] */ + __out_opt ID3D10Predicate **ppPredicate, + /* [annotation] */ + __out_opt BOOL *pPredicateValue) = 0; + + virtual void STDMETHODCALLTYPE GSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE GSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE OMGetRenderTargets( + /* [annotation] */ + __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __out_ecount_opt(NumViews) ID3D10RenderTargetView **ppRenderTargetViews, + /* [annotation] */ + __out_opt ID3D10DepthStencilView **ppDepthStencilView) = 0; + + virtual void STDMETHODCALLTYPE OMGetBlendState( + /* [annotation] */ + __out_opt ID3D10BlendState **ppBlendState, + /* [annotation] */ + __out_opt FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __out_opt UINT *pSampleMask) = 0; + + virtual void STDMETHODCALLTYPE OMGetDepthStencilState( + /* [annotation] */ + __out_opt ID3D10DepthStencilState **ppDepthStencilState, + /* [annotation] */ + __out_opt UINT *pStencilRef) = 0; + + virtual void STDMETHODCALLTYPE SOGetTargets( + /* [annotation] */ + __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D10Buffer **ppSOTargets, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets) = 0; + + virtual void STDMETHODCALLTYPE RSGetState( + /* [annotation] */ + __out ID3D10RasterizerState **ppRasterizerState) = 0; + + virtual void STDMETHODCALLTYPE RSGetViewports( + /* [annotation] */ + __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumViewports, + /* [annotation] */ + __out_ecount_opt(*NumViewports) D3D10_VIEWPORT *pViewports) = 0; + + virtual void STDMETHODCALLTYPE RSGetScissorRects( + /* [annotation] */ + __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumRects, + /* [annotation] */ + __out_ecount_opt(*NumRects) D3D10_RECT *pRects) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDeviceRemovedReason( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetExceptionMode( + UINT RaiseFlags) = 0; + + virtual UINT STDMETHODCALLTYPE GetExceptionMode( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData) = 0; + + virtual void STDMETHODCALLTYPE ClearState( void) = 0; + + virtual void STDMETHODCALLTYPE Flush( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateBuffer( + /* [annotation] */ + __in const D3D10_BUFFER_DESC *pDesc, + /* [annotation] */ + __in_opt const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D10Buffer **ppBuffer) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateTexture1D( + /* [annotation] */ + __in const D3D10_TEXTURE1D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture1D **ppTexture1D) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateTexture2D( + /* [annotation] */ + __in const D3D10_TEXTURE2D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture2D **ppTexture2D) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateTexture3D( + /* [annotation] */ + __in const D3D10_TEXTURE3D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture3D **ppTexture3D) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView( + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10ShaderResourceView **ppSRView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateRenderTargetView( + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_RENDER_TARGET_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10RenderTargetView **ppRTView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilView( + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10DepthStencilView **ppDepthStencilView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateInputLayout( + /* [annotation] */ + __in_ecount(NumElements) const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements, + /* [annotation] */ + __in const void *pShaderBytecodeWithInputSignature, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10InputLayout **ppInputLayout) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVertexShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10VertexShader **ppVertexShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateGeometryShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10GeometryShader **ppGeometryShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateGeometryShaderWithStreamOutput( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_ecount_opt(NumEntries) const D3D10_SO_DECLARATION_ENTRY *pSODeclaration, + /* [annotation] */ + __in_range( 0, D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ) UINT NumEntries, + /* [annotation] */ + __in UINT OutputStreamStride, + /* [annotation] */ + __out_opt ID3D10GeometryShader **ppGeometryShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePixelShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10PixelShader **ppPixelShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateBlendState( + /* [annotation] */ + __in const D3D10_BLEND_DESC *pBlendStateDesc, + /* [annotation] */ + __out_opt ID3D10BlendState **ppBlendState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilState( + /* [annotation] */ + __in const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc, + /* [annotation] */ + __out_opt ID3D10DepthStencilState **ppDepthStencilState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateRasterizerState( + /* [annotation] */ + __in const D3D10_RASTERIZER_DESC *pRasterizerDesc, + /* [annotation] */ + __out_opt ID3D10RasterizerState **ppRasterizerState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSamplerState( + /* [annotation] */ + __in const D3D10_SAMPLER_DESC *pSamplerDesc, + /* [annotation] */ + __out_opt ID3D10SamplerState **ppSamplerState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateQuery( + /* [annotation] */ + __in const D3D10_QUERY_DESC *pQueryDesc, + /* [annotation] */ + __out_opt ID3D10Query **ppQuery) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePredicate( + /* [annotation] */ + __in const D3D10_QUERY_DESC *pPredicateDesc, + /* [annotation] */ + __out_opt ID3D10Predicate **ppPredicate) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCounter( + /* [annotation] */ + __in const D3D10_COUNTER_DESC *pCounterDesc, + /* [annotation] */ + __out_opt ID3D10Counter **ppCounter) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckFormatSupport( + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __out UINT *pFormatSupport) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckMultisampleQualityLevels( + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT SampleCount, + /* [annotation] */ + __out UINT *pNumQualityLevels) = 0; + + virtual void STDMETHODCALLTYPE CheckCounterInfo( + /* [annotation] */ + __out D3D10_COUNTER_INFO *pCounterInfo) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckCounter( + /* [annotation] */ + __in const D3D10_COUNTER_DESC *pDesc, + /* [annotation] */ + __out D3D10_COUNTER_TYPE *pType, + /* [annotation] */ + __out UINT *pActiveCounters, + /* [annotation] */ + __out_ecount_opt(*pNameLength) LPSTR szName, + /* [annotation] */ + __inout_opt UINT *pNameLength, + /* [annotation] */ + __out_ecount_opt(*pUnitsLength) LPSTR szUnits, + /* [annotation] */ + __inout_opt UINT *pUnitsLength, + /* [annotation] */ + __out_ecount_opt(*pDescriptionLength) LPSTR szDescription, + /* [annotation] */ + __inout_opt UINT *pDescriptionLength) = 0; + + virtual UINT STDMETHODCALLTYPE GetCreationFlags( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE OpenSharedResource( + /* [annotation] */ + __in HANDLE hResource, + /* [annotation] */ + __in REFIID ReturnedInterface, + /* [annotation] */ + __out_opt void **ppResource) = 0; + + virtual void STDMETHODCALLTYPE SetTextFilterSize( + /* [annotation] */ + __in UINT Width, + /* [annotation] */ + __in UINT Height) = 0; + + virtual void STDMETHODCALLTYPE GetTextFilterSize( + /* [annotation] */ + __out_opt UINT *pWidth, + /* [annotation] */ + __out_opt UINT *pHeight) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10DeviceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Device * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Device * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Device * This); + + void ( STDMETHODCALLTYPE *VSSetConstantBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *PSSetShaderResources )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *PSSetShader )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10PixelShader *pPixelShader); + + void ( STDMETHODCALLTYPE *PSSetSamplers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *VSSetShader )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10VertexShader *pVertexShader); + + void ( STDMETHODCALLTYPE *DrawIndexed )( + ID3D10Device * This, + /* [annotation] */ + __in UINT IndexCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation); + + void ( STDMETHODCALLTYPE *Draw )( + ID3D10Device * This, + /* [annotation] */ + __in UINT VertexCount, + /* [annotation] */ + __in UINT StartVertexLocation); + + void ( STDMETHODCALLTYPE *PSSetConstantBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *IASetInputLayout )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10InputLayout *pInputLayout); + + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppVertexBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pStrides, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pOffsets); + + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10Buffer *pIndexBuffer, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT Offset); + + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D10Device * This, + /* [annotation] */ + __in UINT IndexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation); + + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D10Device * This, + /* [annotation] */ + __in UINT VertexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation); + + void ( STDMETHODCALLTYPE *GSSetConstantBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *GSSetShader )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10GeometryShader *pShader); + + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D10Device * This, + /* [annotation] */ + __in D3D10_PRIMITIVE_TOPOLOGY Topology); + + void ( STDMETHODCALLTYPE *VSSetShaderResources )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *VSSetSamplers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10Predicate *pPredicate, + /* [annotation] */ + __in BOOL PredicateValue); + + void ( STDMETHODCALLTYPE *GSSetShaderResources )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *GSSetSamplers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __in_ecount_opt(NumViews) ID3D10RenderTargetView *const *ppRenderTargetViews, + /* [annotation] */ + __in_opt ID3D10DepthStencilView *pDepthStencilView); + + void ( STDMETHODCALLTYPE *OMSetBlendState )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10BlendState *pBlendState, + /* [annotation] */ + __in const FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __in UINT SampleMask); + + void ( STDMETHODCALLTYPE *OMSetDepthStencilState )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10DepthStencilState *pDepthStencilState, + /* [annotation] */ + __in UINT StencilRef); + + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT) UINT NumBuffers, + /* [annotation] */ + __in_ecount_opt(NumBuffers) ID3D10Buffer *const *ppSOTargets, + /* [annotation] */ + __in_ecount_opt(NumBuffers) const UINT *pOffsets); + + void ( STDMETHODCALLTYPE *DrawAuto )( + ID3D10Device * This); + + void ( STDMETHODCALLTYPE *RSSetState )( + ID3D10Device * This, + /* [annotation] */ + __in_opt ID3D10RasterizerState *pRasterizerState); + + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D10Device * This, + /* [annotation] */ + __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + /* [annotation] */ + __in_ecount_opt(NumViewports) const D3D10_VIEWPORT *pViewports); + + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D10Device * This, + /* [annotation] */ + __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + /* [annotation] */ + __in_ecount_opt(NumRects) const D3D10_RECT *pRects); + + void ( STDMETHODCALLTYPE *CopySubresourceRegion )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in UINT DstX, + /* [annotation] */ + __in UINT DstY, + /* [annotation] */ + __in UINT DstZ, + /* [annotation] */ + __in ID3D10Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in_opt const D3D10_BOX *pSrcBox); + + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in ID3D10Resource *pSrcResource); + + void ( STDMETHODCALLTYPE *UpdateSubresource )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in_opt const D3D10_BOX *pDstBox, + /* [annotation] */ + __in const void *pSrcData, + /* [annotation] */ + __in UINT SrcRowPitch, + /* [annotation] */ + __in UINT SrcDepthPitch); + + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10RenderTargetView *pRenderTargetView, + /* [annotation] */ + __in const FLOAT ColorRGBA[ 4 ]); + + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10DepthStencilView *pDepthStencilView, + /* [annotation] */ + __in UINT ClearFlags, + /* [annotation] */ + __in FLOAT Depth, + /* [annotation] */ + __in UINT8 Stencil); + + void ( STDMETHODCALLTYPE *GenerateMips )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10ShaderResourceView *pShaderResourceView); + + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in ID3D10Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in DXGI_FORMAT Format); + + void ( STDMETHODCALLTYPE *VSGetConstantBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *PSGetShaderResources )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *PSGetShader )( + ID3D10Device * This, + /* [annotation] */ + __out ID3D10PixelShader **ppPixelShader); + + void ( STDMETHODCALLTYPE *PSGetSamplers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *VSGetShader )( + ID3D10Device * This, + /* [annotation] */ + __out ID3D10VertexShader **ppVertexShader); + + void ( STDMETHODCALLTYPE *PSGetConstantBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *IAGetInputLayout )( + ID3D10Device * This, + /* [annotation] */ + __out ID3D10InputLayout **ppInputLayout); + + void ( STDMETHODCALLTYPE *IAGetVertexBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D10Buffer **ppVertexBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pStrides, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets); + + void ( STDMETHODCALLTYPE *IAGetIndexBuffer )( + ID3D10Device * This, + /* [annotation] */ + __out_opt ID3D10Buffer **pIndexBuffer, + /* [annotation] */ + __out_opt DXGI_FORMAT *Format, + /* [annotation] */ + __out_opt UINT *Offset); + + void ( STDMETHODCALLTYPE *GSGetConstantBuffers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *GSGetShader )( + ID3D10Device * This, + /* [annotation] */ + __out ID3D10GeometryShader **ppGeometryShader); + + void ( STDMETHODCALLTYPE *IAGetPrimitiveTopology )( + ID3D10Device * This, + /* [annotation] */ + __out D3D10_PRIMITIVE_TOPOLOGY *pTopology); + + void ( STDMETHODCALLTYPE *VSGetShaderResources )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *VSGetSamplers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *GetPredication )( + ID3D10Device * This, + /* [annotation] */ + __out_opt ID3D10Predicate **ppPredicate, + /* [annotation] */ + __out_opt BOOL *pPredicateValue); + + void ( STDMETHODCALLTYPE *GSGetShaderResources )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *GSGetSamplers )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *OMGetRenderTargets )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __out_ecount_opt(NumViews) ID3D10RenderTargetView **ppRenderTargetViews, + /* [annotation] */ + __out_opt ID3D10DepthStencilView **ppDepthStencilView); + + void ( STDMETHODCALLTYPE *OMGetBlendState )( + ID3D10Device * This, + /* [annotation] */ + __out_opt ID3D10BlendState **ppBlendState, + /* [annotation] */ + __out_opt FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __out_opt UINT *pSampleMask); + + void ( STDMETHODCALLTYPE *OMGetDepthStencilState )( + ID3D10Device * This, + /* [annotation] */ + __out_opt ID3D10DepthStencilState **ppDepthStencilState, + /* [annotation] */ + __out_opt UINT *pStencilRef); + + void ( STDMETHODCALLTYPE *SOGetTargets )( + ID3D10Device * This, + /* [annotation] */ + __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D10Buffer **ppSOTargets, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets); + + void ( STDMETHODCALLTYPE *RSGetState )( + ID3D10Device * This, + /* [annotation] */ + __out ID3D10RasterizerState **ppRasterizerState); + + void ( STDMETHODCALLTYPE *RSGetViewports )( + ID3D10Device * This, + /* [annotation] */ + __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumViewports, + /* [annotation] */ + __out_ecount_opt(*NumViewports) D3D10_VIEWPORT *pViewports); + + void ( STDMETHODCALLTYPE *RSGetScissorRects )( + ID3D10Device * This, + /* [annotation] */ + __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumRects, + /* [annotation] */ + __out_ecount_opt(*NumRects) D3D10_RECT *pRects); + + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D10Device * This); + + HRESULT ( STDMETHODCALLTYPE *SetExceptionMode )( + ID3D10Device * This, + UINT RaiseFlags); + + UINT ( STDMETHODCALLTYPE *GetExceptionMode )( + ID3D10Device * This); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Device * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Device * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Device * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *ClearState )( + ID3D10Device * This); + + void ( STDMETHODCALLTYPE *Flush )( + ID3D10Device * This); + + HRESULT ( STDMETHODCALLTYPE *CreateBuffer )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_BUFFER_DESC *pDesc, + /* [annotation] */ + __in_opt const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D10Buffer **ppBuffer); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture1D )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_TEXTURE1D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture1D **ppTexture1D); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture2D )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_TEXTURE2D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture2D **ppTexture2D); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture3D )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_TEXTURE3D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture3D **ppTexture3D); + + HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10ShaderResourceView **ppSRView); + + HRESULT ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_RENDER_TARGET_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10RenderTargetView **ppRTView); + + HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D10Device * This, + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10DepthStencilView **ppDepthStencilView); + + HRESULT ( STDMETHODCALLTYPE *CreateInputLayout )( + ID3D10Device * This, + /* [annotation] */ + __in_ecount(NumElements) const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements, + /* [annotation] */ + __in const void *pShaderBytecodeWithInputSignature, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10InputLayout **ppInputLayout); + + HRESULT ( STDMETHODCALLTYPE *CreateVertexShader )( + ID3D10Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10VertexShader **ppVertexShader); + + HRESULT ( STDMETHODCALLTYPE *CreateGeometryShader )( + ID3D10Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10GeometryShader **ppGeometryShader); + + HRESULT ( STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput )( + ID3D10Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_ecount_opt(NumEntries) const D3D10_SO_DECLARATION_ENTRY *pSODeclaration, + /* [annotation] */ + __in_range( 0, D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ) UINT NumEntries, + /* [annotation] */ + __in UINT OutputStreamStride, + /* [annotation] */ + __out_opt ID3D10GeometryShader **ppGeometryShader); + + HRESULT ( STDMETHODCALLTYPE *CreatePixelShader )( + ID3D10Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10PixelShader **ppPixelShader); + + HRESULT ( STDMETHODCALLTYPE *CreateBlendState )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_BLEND_DESC *pBlendStateDesc, + /* [annotation] */ + __out_opt ID3D10BlendState **ppBlendState); + + HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilState )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc, + /* [annotation] */ + __out_opt ID3D10DepthStencilState **ppDepthStencilState); + + HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_RASTERIZER_DESC *pRasterizerDesc, + /* [annotation] */ + __out_opt ID3D10RasterizerState **ppRasterizerState); + + HRESULT ( STDMETHODCALLTYPE *CreateSamplerState )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_SAMPLER_DESC *pSamplerDesc, + /* [annotation] */ + __out_opt ID3D10SamplerState **ppSamplerState); + + HRESULT ( STDMETHODCALLTYPE *CreateQuery )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_QUERY_DESC *pQueryDesc, + /* [annotation] */ + __out_opt ID3D10Query **ppQuery); + + HRESULT ( STDMETHODCALLTYPE *CreatePredicate )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_QUERY_DESC *pPredicateDesc, + /* [annotation] */ + __out_opt ID3D10Predicate **ppPredicate); + + HRESULT ( STDMETHODCALLTYPE *CreateCounter )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_COUNTER_DESC *pCounterDesc, + /* [annotation] */ + __out_opt ID3D10Counter **ppCounter); + + HRESULT ( STDMETHODCALLTYPE *CheckFormatSupport )( + ID3D10Device * This, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __out UINT *pFormatSupport); + + HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels )( + ID3D10Device * This, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT SampleCount, + /* [annotation] */ + __out UINT *pNumQualityLevels); + + void ( STDMETHODCALLTYPE *CheckCounterInfo )( + ID3D10Device * This, + /* [annotation] */ + __out D3D10_COUNTER_INFO *pCounterInfo); + + HRESULT ( STDMETHODCALLTYPE *CheckCounter )( + ID3D10Device * This, + /* [annotation] */ + __in const D3D10_COUNTER_DESC *pDesc, + /* [annotation] */ + __out D3D10_COUNTER_TYPE *pType, + /* [annotation] */ + __out UINT *pActiveCounters, + /* [annotation] */ + __out_ecount_opt(*pNameLength) LPSTR szName, + /* [annotation] */ + __inout_opt UINT *pNameLength, + /* [annotation] */ + __out_ecount_opt(*pUnitsLength) LPSTR szUnits, + /* [annotation] */ + __inout_opt UINT *pUnitsLength, + /* [annotation] */ + __out_ecount_opt(*pDescriptionLength) LPSTR szDescription, + /* [annotation] */ + __inout_opt UINT *pDescriptionLength); + + UINT ( STDMETHODCALLTYPE *GetCreationFlags )( + ID3D10Device * This); + + HRESULT ( STDMETHODCALLTYPE *OpenSharedResource )( + ID3D10Device * This, + /* [annotation] */ + __in HANDLE hResource, + /* [annotation] */ + __in REFIID ReturnedInterface, + /* [annotation] */ + __out_opt void **ppResource); + + void ( STDMETHODCALLTYPE *SetTextFilterSize )( + ID3D10Device * This, + /* [annotation] */ + __in UINT Width, + /* [annotation] */ + __in UINT Height); + + void ( STDMETHODCALLTYPE *GetTextFilterSize )( + ID3D10Device * This, + /* [annotation] */ + __out_opt UINT *pWidth, + /* [annotation] */ + __out_opt UINT *pHeight); + + END_INTERFACE + } ID3D10DeviceVtbl; + + interface ID3D10Device + { + CONST_VTBL struct ID3D10DeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Device_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Device_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Device_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Device_VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device_PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device_PSSetShader(This,pPixelShader) \ + ( (This)->lpVtbl -> PSSetShader(This,pPixelShader) ) + +#define ID3D10Device_PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device_VSSetShader(This,pVertexShader) \ + ( (This)->lpVtbl -> VSSetShader(This,pVertexShader) ) + +#define ID3D10Device_DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) \ + ( (This)->lpVtbl -> DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) ) + +#define ID3D10Device_Draw(This,VertexCount,StartVertexLocation) \ + ( (This)->lpVtbl -> Draw(This,VertexCount,StartVertexLocation) ) + +#define ID3D10Device_PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device_IASetInputLayout(This,pInputLayout) \ + ( (This)->lpVtbl -> IASetInputLayout(This,pInputLayout) ) + +#define ID3D10Device_IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) ) + +#define ID3D10Device_IASetIndexBuffer(This,pIndexBuffer,Format,Offset) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pIndexBuffer,Format,Offset) ) + +#define ID3D10Device_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D10Device_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D10Device_GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device_GSSetShader(This,pShader) \ + ( (This)->lpVtbl -> GSSetShader(This,pShader) ) + +#define ID3D10Device_IASetPrimitiveTopology(This,Topology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,Topology) ) + +#define ID3D10Device_VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device_VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device_SetPredication(This,pPredicate,PredicateValue) \ + ( (This)->lpVtbl -> SetPredication(This,pPredicate,PredicateValue) ) + +#define ID3D10Device_GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device_GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device_OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) ) + +#define ID3D10Device_OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) \ + ( (This)->lpVtbl -> OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) ) + +#define ID3D10Device_OMSetDepthStencilState(This,pDepthStencilState,StencilRef) \ + ( (This)->lpVtbl -> OMSetDepthStencilState(This,pDepthStencilState,StencilRef) ) + +#define ID3D10Device_SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) \ + ( (This)->lpVtbl -> SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) ) + +#define ID3D10Device_DrawAuto(This) \ + ( (This)->lpVtbl -> DrawAuto(This) ) + +#define ID3D10Device_RSSetState(This,pRasterizerState) \ + ( (This)->lpVtbl -> RSSetState(This,pRasterizerState) ) + +#define ID3D10Device_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D10Device_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D10Device_CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) \ + ( (This)->lpVtbl -> CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) ) + +#define ID3D10Device_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D10Device_UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ + ( (This)->lpVtbl -> UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) + +#define ID3D10Device_ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) ) + +#define ID3D10Device_ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) ) + +#define ID3D10Device_GenerateMips(This,pShaderResourceView) \ + ( (This)->lpVtbl -> GenerateMips(This,pShaderResourceView) ) + +#define ID3D10Device_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D10Device_VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device_PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device_PSGetShader(This,ppPixelShader) \ + ( (This)->lpVtbl -> PSGetShader(This,ppPixelShader) ) + +#define ID3D10Device_PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device_VSGetShader(This,ppVertexShader) \ + ( (This)->lpVtbl -> VSGetShader(This,ppVertexShader) ) + +#define ID3D10Device_PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device_IAGetInputLayout(This,ppInputLayout) \ + ( (This)->lpVtbl -> IAGetInputLayout(This,ppInputLayout) ) + +#define ID3D10Device_IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \ + ( (This)->lpVtbl -> IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) ) + +#define ID3D10Device_IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) \ + ( (This)->lpVtbl -> IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) ) + +#define ID3D10Device_GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device_GSGetShader(This,ppGeometryShader) \ + ( (This)->lpVtbl -> GSGetShader(This,ppGeometryShader) ) + +#define ID3D10Device_IAGetPrimitiveTopology(This,pTopology) \ + ( (This)->lpVtbl -> IAGetPrimitiveTopology(This,pTopology) ) + +#define ID3D10Device_VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device_VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device_GetPredication(This,ppPredicate,pPredicateValue) \ + ( (This)->lpVtbl -> GetPredication(This,ppPredicate,pPredicateValue) ) + +#define ID3D10Device_GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device_GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device_OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) \ + ( (This)->lpVtbl -> OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) ) + +#define ID3D10Device_OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) \ + ( (This)->lpVtbl -> OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) ) + +#define ID3D10Device_OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) \ + ( (This)->lpVtbl -> OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) ) + +#define ID3D10Device_SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets) \ + ( (This)->lpVtbl -> SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets) ) + +#define ID3D10Device_RSGetState(This,ppRasterizerState) \ + ( (This)->lpVtbl -> RSGetState(This,ppRasterizerState) ) + +#define ID3D10Device_RSGetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSGetViewports(This,NumViewports,pViewports) ) + +#define ID3D10Device_RSGetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSGetScissorRects(This,NumRects,pRects) ) + +#define ID3D10Device_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D10Device_SetExceptionMode(This,RaiseFlags) \ + ( (This)->lpVtbl -> SetExceptionMode(This,RaiseFlags) ) + +#define ID3D10Device_GetExceptionMode(This) \ + ( (This)->lpVtbl -> GetExceptionMode(This) ) + +#define ID3D10Device_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Device_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Device_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D10Device_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D10Device_Flush(This) \ + ( (This)->lpVtbl -> Flush(This) ) + +#define ID3D10Device_CreateBuffer(This,pDesc,pInitialData,ppBuffer) \ + ( (This)->lpVtbl -> CreateBuffer(This,pDesc,pInitialData,ppBuffer) ) + +#define ID3D10Device_CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) \ + ( (This)->lpVtbl -> CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) ) + +#define ID3D10Device_CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) \ + ( (This)->lpVtbl -> CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) ) + +#define ID3D10Device_CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) \ + ( (This)->lpVtbl -> CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) ) + +#define ID3D10Device_CreateShaderResourceView(This,pResource,pDesc,ppSRView) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,ppSRView) ) + +#define ID3D10Device_CreateRenderTargetView(This,pResource,pDesc,ppRTView) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,ppRTView) ) + +#define ID3D10Device_CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) ) + +#define ID3D10Device_CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) \ + ( (This)->lpVtbl -> CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) ) + +#define ID3D10Device_CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader) \ + ( (This)->lpVtbl -> CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader) ) + +#define ID3D10Device_CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader) \ + ( (This)->lpVtbl -> CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader) ) + +#define ID3D10Device_CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader) \ + ( (This)->lpVtbl -> CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader) ) + +#define ID3D10Device_CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader) \ + ( (This)->lpVtbl -> CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader) ) + +#define ID3D10Device_CreateBlendState(This,pBlendStateDesc,ppBlendState) \ + ( (This)->lpVtbl -> CreateBlendState(This,pBlendStateDesc,ppBlendState) ) + +#define ID3D10Device_CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) \ + ( (This)->lpVtbl -> CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) ) + +#define ID3D10Device_CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) \ + ( (This)->lpVtbl -> CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) ) + +#define ID3D10Device_CreateSamplerState(This,pSamplerDesc,ppSamplerState) \ + ( (This)->lpVtbl -> CreateSamplerState(This,pSamplerDesc,ppSamplerState) ) + +#define ID3D10Device_CreateQuery(This,pQueryDesc,ppQuery) \ + ( (This)->lpVtbl -> CreateQuery(This,pQueryDesc,ppQuery) ) + +#define ID3D10Device_CreatePredicate(This,pPredicateDesc,ppPredicate) \ + ( (This)->lpVtbl -> CreatePredicate(This,pPredicateDesc,ppPredicate) ) + +#define ID3D10Device_CreateCounter(This,pCounterDesc,ppCounter) \ + ( (This)->lpVtbl -> CreateCounter(This,pCounterDesc,ppCounter) ) + +#define ID3D10Device_CheckFormatSupport(This,Format,pFormatSupport) \ + ( (This)->lpVtbl -> CheckFormatSupport(This,Format,pFormatSupport) ) + +#define ID3D10Device_CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) \ + ( (This)->lpVtbl -> CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) ) + +#define ID3D10Device_CheckCounterInfo(This,pCounterInfo) \ + ( (This)->lpVtbl -> CheckCounterInfo(This,pCounterInfo) ) + +#define ID3D10Device_CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) \ + ( (This)->lpVtbl -> CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) ) + +#define ID3D10Device_GetCreationFlags(This) \ + ( (This)->lpVtbl -> GetCreationFlags(This) ) + +#define ID3D10Device_OpenSharedResource(This,hResource,ReturnedInterface,ppResource) \ + ( (This)->lpVtbl -> OpenSharedResource(This,hResource,ReturnedInterface,ppResource) ) + +#define ID3D10Device_SetTextFilterSize(This,Width,Height) \ + ( (This)->lpVtbl -> SetTextFilterSize(This,Width,Height) ) + +#define ID3D10Device_GetTextFilterSize(This,pWidth,pHeight) \ + ( (This)->lpVtbl -> GetTextFilterSize(This,pWidth,pHeight) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Device_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10Multithread_INTERFACE_DEFINED__ +#define __ID3D10Multithread_INTERFACE_DEFINED__ + +/* interface ID3D10Multithread */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Multithread; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4E00-342C-4106-A19F-4F2704F689F0") + ID3D10Multithread : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE Enter( void) = 0; + + virtual void STDMETHODCALLTYPE Leave( void) = 0; + + virtual BOOL STDMETHODCALLTYPE SetMultithreadProtected( + /* [annotation] */ + __in BOOL bMTProtect) = 0; + + virtual BOOL STDMETHODCALLTYPE GetMultithreadProtected( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10MultithreadVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Multithread * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Multithread * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Multithread * This); + + void ( STDMETHODCALLTYPE *Enter )( + ID3D10Multithread * This); + + void ( STDMETHODCALLTYPE *Leave )( + ID3D10Multithread * This); + + BOOL ( STDMETHODCALLTYPE *SetMultithreadProtected )( + ID3D10Multithread * This, + /* [annotation] */ + __in BOOL bMTProtect); + + BOOL ( STDMETHODCALLTYPE *GetMultithreadProtected )( + ID3D10Multithread * This); + + END_INTERFACE + } ID3D10MultithreadVtbl; + + interface ID3D10Multithread + { + CONST_VTBL struct ID3D10MultithreadVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Multithread_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Multithread_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Multithread_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Multithread_Enter(This) \ + ( (This)->lpVtbl -> Enter(This) ) + +#define ID3D10Multithread_Leave(This) \ + ( (This)->lpVtbl -> Leave(This) ) + +#define ID3D10Multithread_SetMultithreadProtected(This,bMTProtect) \ + ( (This)->lpVtbl -> SetMultithreadProtected(This,bMTProtect) ) + +#define ID3D10Multithread_GetMultithreadProtected(This) \ + ( (This)->lpVtbl -> GetMultithreadProtected(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Multithread_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_0000_0024 */ +/* [local] */ + +typedef +enum D3D10_CREATE_DEVICE_FLAG + { D3D10_CREATE_DEVICE_SINGLETHREADED = 0x1, + D3D10_CREATE_DEVICE_DEBUG = 0x2, + D3D10_CREATE_DEVICE_SWITCH_TO_REF = 0x4, + D3D10_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8, + D3D10_CREATE_DEVICE_ALLOW_NULL_FROM_MAP = 0x10, + D3D10_CREATE_DEVICE_BGRA_SUPPORT = 0x20, + D3D10_CREATE_DEVICE_STRICT_VALIDATION = 0x200 + } D3D10_CREATE_DEVICE_FLAG; + + +#define D3D10_SDK_VERSION ( 29 ) + +#if !defined( D3D10_IGNORE_SDK_LAYERS ) +#include "d3d10sdklayers.h" +#endif +#include "d3d10misc.h" +#include "d3d10shader.h" +#include "d3d10effect.h" +DEFINE_GUID(IID_ID3D10DeviceChild,0x9B7E4C00,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10DepthStencilState,0x2B4B1CC8,0xA4AD,0x41f8,0x83,0x22,0xCA,0x86,0xFC,0x3E,0xC6,0x75); +DEFINE_GUID(IID_ID3D10BlendState,0xEDAD8D19,0x8A35,0x4d6d,0x85,0x66,0x2E,0xA2,0x76,0xCD,0xE1,0x61); +DEFINE_GUID(IID_ID3D10RasterizerState,0xA2A07292,0x89AF,0x4345,0xBE,0x2E,0xC5,0x3D,0x9F,0xBB,0x6E,0x9F); +DEFINE_GUID(IID_ID3D10Resource,0x9B7E4C01,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Buffer,0x9B7E4C02,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Texture1D,0x9B7E4C03,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Texture2D,0x9B7E4C04,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Texture3D,0x9B7E4C05,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10View,0xC902B03F,0x60A7,0x49BA,0x99,0x36,0x2A,0x3A,0xB3,0x7A,0x7E,0x33); +DEFINE_GUID(IID_ID3D10ShaderResourceView,0x9B7E4C07,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10RenderTargetView,0x9B7E4C08,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10DepthStencilView,0x9B7E4C09,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10VertexShader,0x9B7E4C0A,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10GeometryShader,0x6316BE88,0x54CD,0x4040,0xAB,0x44,0x20,0x46,0x1B,0xC8,0x1F,0x68); +DEFINE_GUID(IID_ID3D10PixelShader,0x4968B601,0x9D00,0x4cde,0x83,0x46,0x8E,0x7F,0x67,0x58,0x19,0xB6); +DEFINE_GUID(IID_ID3D10InputLayout,0x9B7E4C0B,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10SamplerState,0x9B7E4C0C,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Asynchronous,0x9B7E4C0D,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Query,0x9B7E4C0E,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Predicate,0x9B7E4C10,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Counter,0x9B7E4C11,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Device,0x9B7E4C0F,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Multithread,0x9B7E4E00,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0024_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_0000_0024_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3D10_1.h b/Src/Decoder_H264_ALL/D3D/include/D3D10_1.h new file mode 100644 index 0000000..a155198 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3D10_1.h @@ -0,0 +1,1796 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0555 */ +/* Compiler settings for d3d10_1.idl: + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 7.00.0555 + protocol : all , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d10_1_h__ +#define __d3d10_1_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ID3D10BlendState1_FWD_DEFINED__ +#define __ID3D10BlendState1_FWD_DEFINED__ +typedef interface ID3D10BlendState1 ID3D10BlendState1; +#endif /* __ID3D10BlendState1_FWD_DEFINED__ */ + + +#ifndef __ID3D10ShaderResourceView1_FWD_DEFINED__ +#define __ID3D10ShaderResourceView1_FWD_DEFINED__ +typedef interface ID3D10ShaderResourceView1 ID3D10ShaderResourceView1; +#endif /* __ID3D10ShaderResourceView1_FWD_DEFINED__ */ + + +#ifndef __ID3D10Device1_FWD_DEFINED__ +#define __ID3D10Device1_FWD_DEFINED__ +typedef interface ID3D10Device1 ID3D10Device1; +#endif /* __ID3D10Device1_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d10_1_0000_0000 */ +/* [local] */ + +#if defined( __d3d10_h__ ) && !defined( D3D10_ARBITRARY_HEADER_ORDERING ) +#error d3d10.h is included before d3d10_1.h, and it will confuse tools that honor SAL annotations. \ +If possibly targeting d3d10.1, include d3d10_1.h instead of d3d10.h, or ensure d3d10_1.h is included before d3d10.h +#endif +#ifndef _D3D10_1_CONSTANTS +#define _D3D10_1_CONSTANTS +#define D3D10_1_DEFAULT_SAMPLE_MASK ( 0xffffffff ) + +#define D3D10_1_FLOAT16_FUSED_TOLERANCE_IN_ULP ( 0.6 ) +#define D3D10_1_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP ( 0.6f ) +#define D3D10_1_GS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT ( 32 ) + +#define D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS ( 128 ) + +#define D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ( 32 ) + +#define D3D10_1_PS_OUTPUT_MASK_REGISTER_COMPONENTS ( 1 ) + +#define D3D10_1_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D10_1_PS_OUTPUT_MASK_REGISTER_COUNT ( 1 ) + +#define D3D10_1_SHADER_MAJOR_VERSION ( 4 ) + +#define D3D10_1_SHADER_MINOR_VERSION ( 1 ) + +#define D3D10_1_SO_BUFFER_MAX_STRIDE_IN_BYTES ( 2048 ) + +#define D3D10_1_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES ( 256 ) + +#define D3D10_1_SO_BUFFER_SLOT_COUNT ( 4 ) + +#define D3D10_1_SO_MULTIPLE_BUFFER_ELEMENTS_PER_BUFFER ( 1 ) + +#define D3D10_1_SO_SINGLE_BUFFER_COMPONENT_LIMIT ( 64 ) + +#define D3D10_1_STANDARD_VERTEX_ELEMENT_COUNT ( 32 ) + +#define D3D10_1_SUBPIXEL_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D10_1_VS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D10_1_VS_OUTPUT_REGISTER_COUNT ( 32 ) + +#endif +#include "d3d10.h" // + +typedef +enum D3D10_FEATURE_LEVEL1 + { D3D10_FEATURE_LEVEL_10_0 = 0xa000, + D3D10_FEATURE_LEVEL_10_1 = 0xa100, + D3D10_FEATURE_LEVEL_9_1 = 0x9100, + D3D10_FEATURE_LEVEL_9_2 = 0x9200, + D3D10_FEATURE_LEVEL_9_3 = 0x9300 + } D3D10_FEATURE_LEVEL1; + +typedef struct D3D10_RENDER_TARGET_BLEND_DESC1 + { + BOOL BlendEnable; + D3D10_BLEND SrcBlend; + D3D10_BLEND DestBlend; + D3D10_BLEND_OP BlendOp; + D3D10_BLEND SrcBlendAlpha; + D3D10_BLEND DestBlendAlpha; + D3D10_BLEND_OP BlendOpAlpha; + UINT8 RenderTargetWriteMask; + } D3D10_RENDER_TARGET_BLEND_DESC1; + +typedef struct D3D10_BLEND_DESC1 + { + BOOL AlphaToCoverageEnable; + BOOL IndependentBlendEnable; + D3D10_RENDER_TARGET_BLEND_DESC1 RenderTarget[ 8 ]; + } D3D10_BLEND_DESC1; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D10BlendState1_INTERFACE_DEFINED__ +#define __ID3D10BlendState1_INTERFACE_DEFINED__ + +/* interface ID3D10BlendState1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10BlendState1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("EDAD8D99-8A35-4d6d-8566-2EA276CDE161") + ID3D10BlendState1 : public ID3D10BlendState + { + public: + virtual void STDMETHODCALLTYPE GetDesc1( + /* [annotation] */ + __out D3D10_BLEND_DESC1 *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10BlendState1Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10BlendState1 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10BlendState1 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10BlendState1 * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10BlendState1 * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10BlendState1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10BlendState1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10BlendState1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10BlendState1 * This, + /* [annotation] */ + __out D3D10_BLEND_DESC *pDesc); + + void ( STDMETHODCALLTYPE *GetDesc1 )( + ID3D10BlendState1 * This, + /* [annotation] */ + __out D3D10_BLEND_DESC1 *pDesc); + + END_INTERFACE + } ID3D10BlendState1Vtbl; + + interface ID3D10BlendState1 + { + CONST_VTBL struct ID3D10BlendState1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10BlendState1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10BlendState1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10BlendState1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10BlendState1_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10BlendState1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10BlendState1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10BlendState1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10BlendState1_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + + +#define ID3D10BlendState1_GetDesc1(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc1(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10BlendState1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_1_0000_0001 */ +/* [local] */ + +typedef struct D3D10_TEXCUBE_ARRAY_SRV1 + { + UINT MostDetailedMip; + UINT MipLevels; + UINT First2DArrayFace; + UINT NumCubes; + } D3D10_TEXCUBE_ARRAY_SRV1; + +typedef +enum D3D10_SRV_DIMENSION1 + { D3D10_1_SRV_DIMENSION_UNKNOWN = 0, + D3D10_1_SRV_DIMENSION_BUFFER = 1, + D3D10_1_SRV_DIMENSION_TEXTURE1D = 2, + D3D10_1_SRV_DIMENSION_TEXTURE1DARRAY = 3, + D3D10_1_SRV_DIMENSION_TEXTURE2D = 4, + D3D10_1_SRV_DIMENSION_TEXTURE2DARRAY = 5, + D3D10_1_SRV_DIMENSION_TEXTURE2DMS = 6, + D3D10_1_SRV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D10_1_SRV_DIMENSION_TEXTURE3D = 8, + D3D10_1_SRV_DIMENSION_TEXTURECUBE = 9, + D3D10_1_SRV_DIMENSION_TEXTURECUBEARRAY = 10 + } D3D10_SRV_DIMENSION1; + +typedef struct D3D10_SHADER_RESOURCE_VIEW_DESC1 + { + DXGI_FORMAT Format; + D3D10_SRV_DIMENSION1 ViewDimension; + union + { + D3D10_BUFFER_SRV Buffer; + D3D10_TEX1D_SRV Texture1D; + D3D10_TEX1D_ARRAY_SRV Texture1DArray; + D3D10_TEX2D_SRV Texture2D; + D3D10_TEX2D_ARRAY_SRV Texture2DArray; + D3D10_TEX2DMS_SRV Texture2DMS; + D3D10_TEX2DMS_ARRAY_SRV Texture2DMSArray; + D3D10_TEX3D_SRV Texture3D; + D3D10_TEXCUBE_SRV TextureCube; + D3D10_TEXCUBE_ARRAY_SRV1 TextureCubeArray; + } ; + } D3D10_SHADER_RESOURCE_VIEW_DESC1; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0001_v0_0_s_ifspec; + +#ifndef __ID3D10ShaderResourceView1_INTERFACE_DEFINED__ +#define __ID3D10ShaderResourceView1_INTERFACE_DEFINED__ + +/* interface ID3D10ShaderResourceView1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10ShaderResourceView1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C87-342C-4106-A19F-4F2704F689F0") + ID3D10ShaderResourceView1 : public ID3D10ShaderResourceView + { + public: + virtual void STDMETHODCALLTYPE GetDesc1( + /* [annotation] */ + __out D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10ShaderResourceView1Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10ShaderResourceView1 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10ShaderResourceView1 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10ShaderResourceView1 * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D10ShaderResourceView1 * This, + /* [annotation] */ + __out ID3D10Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10ShaderResourceView1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10ShaderResourceView1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10ShaderResourceView1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D10ShaderResourceView1 * This, + /* [annotation] */ + __out ID3D10Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D10ShaderResourceView1 * This, + /* [annotation] */ + __out D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc); + + void ( STDMETHODCALLTYPE *GetDesc1 )( + ID3D10ShaderResourceView1 * This, + /* [annotation] */ + __out D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc); + + END_INTERFACE + } ID3D10ShaderResourceView1Vtbl; + + interface ID3D10ShaderResourceView1 + { + CONST_VTBL struct ID3D10ShaderResourceView1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10ShaderResourceView1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10ShaderResourceView1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10ShaderResourceView1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10ShaderResourceView1_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D10ShaderResourceView1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10ShaderResourceView1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10ShaderResourceView1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D10ShaderResourceView1_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D10ShaderResourceView1_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + + +#define ID3D10ShaderResourceView1_GetDesc1(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc1(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10ShaderResourceView1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_1_0000_0002 */ +/* [local] */ + +typedef +enum D3D10_STANDARD_MULTISAMPLE_QUALITY_LEVELS + { D3D10_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff, + D3D10_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe + } D3D10_STANDARD_MULTISAMPLE_QUALITY_LEVELS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0002_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0002_v0_0_s_ifspec; + +#ifndef __ID3D10Device1_INTERFACE_DEFINED__ +#define __ID3D10Device1_INTERFACE_DEFINED__ + +/* interface ID3D10Device1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Device1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4C8F-342C-4106-A19F-4F2704F689F0") + ID3D10Device1 : public ID3D10Device + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView1( + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc, + /* [annotation] */ + __out_opt ID3D10ShaderResourceView1 **ppSRView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateBlendState1( + /* [annotation] */ + __in const D3D10_BLEND_DESC1 *pBlendStateDesc, + /* [annotation] */ + __out_opt ID3D10BlendState1 **ppBlendState) = 0; + + virtual D3D10_FEATURE_LEVEL1 STDMETHODCALLTYPE GetFeatureLevel( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10Device1Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Device1 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Device1 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Device1 * This); + + void ( STDMETHODCALLTYPE *VSSetConstantBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *PSSetShaderResources )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *PSSetShader )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10PixelShader *pPixelShader); + + void ( STDMETHODCALLTYPE *PSSetSamplers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *VSSetShader )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10VertexShader *pVertexShader); + + void ( STDMETHODCALLTYPE *DrawIndexed )( + ID3D10Device1 * This, + /* [annotation] */ + __in UINT IndexCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation); + + void ( STDMETHODCALLTYPE *Draw )( + ID3D10Device1 * This, + /* [annotation] */ + __in UINT VertexCount, + /* [annotation] */ + __in UINT StartVertexLocation); + + void ( STDMETHODCALLTYPE *PSSetConstantBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *IASetInputLayout )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10InputLayout *pInputLayout); + + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppVertexBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pStrides, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pOffsets); + + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10Buffer *pIndexBuffer, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT Offset); + + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D10Device1 * This, + /* [annotation] */ + __in UINT IndexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation); + + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D10Device1 * This, + /* [annotation] */ + __in UINT VertexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation); + + void ( STDMETHODCALLTYPE *GSSetConstantBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D10Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *GSSetShader )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10GeometryShader *pShader); + + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D10Device1 * This, + /* [annotation] */ + __in D3D10_PRIMITIVE_TOPOLOGY Topology); + + void ( STDMETHODCALLTYPE *VSSetShaderResources )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *VSSetSamplers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10Predicate *pPredicate, + /* [annotation] */ + __in BOOL PredicateValue); + + void ( STDMETHODCALLTYPE *GSSetShaderResources )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D10ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *GSSetSamplers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D10SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __in_ecount_opt(NumViews) ID3D10RenderTargetView *const *ppRenderTargetViews, + /* [annotation] */ + __in_opt ID3D10DepthStencilView *pDepthStencilView); + + void ( STDMETHODCALLTYPE *OMSetBlendState )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10BlendState *pBlendState, + /* [annotation] */ + __in const FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __in UINT SampleMask); + + void ( STDMETHODCALLTYPE *OMSetDepthStencilState )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10DepthStencilState *pDepthStencilState, + /* [annotation] */ + __in UINT StencilRef); + + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT) UINT NumBuffers, + /* [annotation] */ + __in_ecount_opt(NumBuffers) ID3D10Buffer *const *ppSOTargets, + /* [annotation] */ + __in_ecount_opt(NumBuffers) const UINT *pOffsets); + + void ( STDMETHODCALLTYPE *DrawAuto )( + ID3D10Device1 * This); + + void ( STDMETHODCALLTYPE *RSSetState )( + ID3D10Device1 * This, + /* [annotation] */ + __in_opt ID3D10RasterizerState *pRasterizerState); + + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + /* [annotation] */ + __in_ecount_opt(NumViewports) const D3D10_VIEWPORT *pViewports); + + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + /* [annotation] */ + __in_ecount_opt(NumRects) const D3D10_RECT *pRects); + + void ( STDMETHODCALLTYPE *CopySubresourceRegion )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in UINT DstX, + /* [annotation] */ + __in UINT DstY, + /* [annotation] */ + __in UINT DstZ, + /* [annotation] */ + __in ID3D10Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in_opt const D3D10_BOX *pSrcBox); + + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in ID3D10Resource *pSrcResource); + + void ( STDMETHODCALLTYPE *UpdateSubresource )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in_opt const D3D10_BOX *pDstBox, + /* [annotation] */ + __in const void *pSrcData, + /* [annotation] */ + __in UINT SrcRowPitch, + /* [annotation] */ + __in UINT SrcDepthPitch); + + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10RenderTargetView *pRenderTargetView, + /* [annotation] */ + __in const FLOAT ColorRGBA[ 4 ]); + + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10DepthStencilView *pDepthStencilView, + /* [annotation] */ + __in UINT ClearFlags, + /* [annotation] */ + __in FLOAT Depth, + /* [annotation] */ + __in UINT8 Stencil); + + void ( STDMETHODCALLTYPE *GenerateMips )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10ShaderResourceView *pShaderResourceView); + + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in ID3D10Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in DXGI_FORMAT Format); + + void ( STDMETHODCALLTYPE *VSGetConstantBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *PSGetShaderResources )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *PSGetShader )( + ID3D10Device1 * This, + /* [annotation] */ + __out ID3D10PixelShader **ppPixelShader); + + void ( STDMETHODCALLTYPE *PSGetSamplers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *VSGetShader )( + ID3D10Device1 * This, + /* [annotation] */ + __out ID3D10VertexShader **ppVertexShader); + + void ( STDMETHODCALLTYPE *PSGetConstantBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *IAGetInputLayout )( + ID3D10Device1 * This, + /* [annotation] */ + __out ID3D10InputLayout **ppInputLayout); + + void ( STDMETHODCALLTYPE *IAGetVertexBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D10Buffer **ppVertexBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pStrides, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets); + + void ( STDMETHODCALLTYPE *IAGetIndexBuffer )( + ID3D10Device1 * This, + /* [annotation] */ + __out_opt ID3D10Buffer **pIndexBuffer, + /* [annotation] */ + __out_opt DXGI_FORMAT *Format, + /* [annotation] */ + __out_opt UINT *Offset); + + void ( STDMETHODCALLTYPE *GSGetConstantBuffers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D10Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *GSGetShader )( + ID3D10Device1 * This, + /* [annotation] */ + __out ID3D10GeometryShader **ppGeometryShader); + + void ( STDMETHODCALLTYPE *IAGetPrimitiveTopology )( + ID3D10Device1 * This, + /* [annotation] */ + __out D3D10_PRIMITIVE_TOPOLOGY *pTopology); + + void ( STDMETHODCALLTYPE *VSGetShaderResources )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *VSGetSamplers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *GetPredication )( + ID3D10Device1 * This, + /* [annotation] */ + __out_opt ID3D10Predicate **ppPredicate, + /* [annotation] */ + __out_opt BOOL *pPredicateValue); + + void ( STDMETHODCALLTYPE *GSGetShaderResources )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D10ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *GSGetSamplers )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D10SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *OMGetRenderTargets )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __out_ecount_opt(NumViews) ID3D10RenderTargetView **ppRenderTargetViews, + /* [annotation] */ + __out_opt ID3D10DepthStencilView **ppDepthStencilView); + + void ( STDMETHODCALLTYPE *OMGetBlendState )( + ID3D10Device1 * This, + /* [annotation] */ + __out_opt ID3D10BlendState **ppBlendState, + /* [annotation] */ + __out_opt FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __out_opt UINT *pSampleMask); + + void ( STDMETHODCALLTYPE *OMGetDepthStencilState )( + ID3D10Device1 * This, + /* [annotation] */ + __out_opt ID3D10DepthStencilState **ppDepthStencilState, + /* [annotation] */ + __out_opt UINT *pStencilRef); + + void ( STDMETHODCALLTYPE *SOGetTargets )( + ID3D10Device1 * This, + /* [annotation] */ + __in_range( 0, D3D10_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D10Buffer **ppSOTargets, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets); + + void ( STDMETHODCALLTYPE *RSGetState )( + ID3D10Device1 * This, + /* [annotation] */ + __out ID3D10RasterizerState **ppRasterizerState); + + void ( STDMETHODCALLTYPE *RSGetViewports )( + ID3D10Device1 * This, + /* [annotation] */ + __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumViewports, + /* [annotation] */ + __out_ecount_opt(*NumViewports) D3D10_VIEWPORT *pViewports); + + void ( STDMETHODCALLTYPE *RSGetScissorRects )( + ID3D10Device1 * This, + /* [annotation] */ + __inout /*_range(0, D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *NumRects, + /* [annotation] */ + __out_ecount_opt(*NumRects) D3D10_RECT *pRects); + + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D10Device1 * This); + + HRESULT ( STDMETHODCALLTYPE *SetExceptionMode )( + ID3D10Device1 * This, + UINT RaiseFlags); + + UINT ( STDMETHODCALLTYPE *GetExceptionMode )( + ID3D10Device1 * This); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D10Device1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D10Device1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D10Device1 * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *ClearState )( + ID3D10Device1 * This); + + void ( STDMETHODCALLTYPE *Flush )( + ID3D10Device1 * This); + + HRESULT ( STDMETHODCALLTYPE *CreateBuffer )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_BUFFER_DESC *pDesc, + /* [annotation] */ + __in_opt const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D10Buffer **ppBuffer); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture1D )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_TEXTURE1D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture1D **ppTexture1D); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture2D )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_TEXTURE2D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture2D **ppTexture2D); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture3D )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_TEXTURE3D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels) const D3D10_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out ID3D10Texture3D **ppTexture3D); + + HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10ShaderResourceView **ppSRView); + + HRESULT ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_RENDER_TARGET_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10RenderTargetView **ppRTView); + + HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D10DepthStencilView **ppDepthStencilView); + + HRESULT ( STDMETHODCALLTYPE *CreateInputLayout )( + ID3D10Device1 * This, + /* [annotation] */ + __in_ecount(NumElements) const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs, + /* [annotation] */ + __in_range( 0, D3D10_1_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements, + /* [annotation] */ + __in const void *pShaderBytecodeWithInputSignature, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10InputLayout **ppInputLayout); + + HRESULT ( STDMETHODCALLTYPE *CreateVertexShader )( + ID3D10Device1 * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10VertexShader **ppVertexShader); + + HRESULT ( STDMETHODCALLTYPE *CreateGeometryShader )( + ID3D10Device1 * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10GeometryShader **ppGeometryShader); + + HRESULT ( STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput )( + ID3D10Device1 * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_ecount_opt(NumEntries) const D3D10_SO_DECLARATION_ENTRY *pSODeclaration, + /* [annotation] */ + __in_range( 0, D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT ) UINT NumEntries, + /* [annotation] */ + __in UINT OutputStreamStride, + /* [annotation] */ + __out_opt ID3D10GeometryShader **ppGeometryShader); + + HRESULT ( STDMETHODCALLTYPE *CreatePixelShader )( + ID3D10Device1 * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D10PixelShader **ppPixelShader); + + HRESULT ( STDMETHODCALLTYPE *CreateBlendState )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_BLEND_DESC *pBlendStateDesc, + /* [annotation] */ + __out_opt ID3D10BlendState **ppBlendState); + + HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilState )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc, + /* [annotation] */ + __out_opt ID3D10DepthStencilState **ppDepthStencilState); + + HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_RASTERIZER_DESC *pRasterizerDesc, + /* [annotation] */ + __out_opt ID3D10RasterizerState **ppRasterizerState); + + HRESULT ( STDMETHODCALLTYPE *CreateSamplerState )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_SAMPLER_DESC *pSamplerDesc, + /* [annotation] */ + __out_opt ID3D10SamplerState **ppSamplerState); + + HRESULT ( STDMETHODCALLTYPE *CreateQuery )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_QUERY_DESC *pQueryDesc, + /* [annotation] */ + __out_opt ID3D10Query **ppQuery); + + HRESULT ( STDMETHODCALLTYPE *CreatePredicate )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_QUERY_DESC *pPredicateDesc, + /* [annotation] */ + __out_opt ID3D10Predicate **ppPredicate); + + HRESULT ( STDMETHODCALLTYPE *CreateCounter )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_COUNTER_DESC *pCounterDesc, + /* [annotation] */ + __out_opt ID3D10Counter **ppCounter); + + HRESULT ( STDMETHODCALLTYPE *CheckFormatSupport )( + ID3D10Device1 * This, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __out UINT *pFormatSupport); + + HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels )( + ID3D10Device1 * This, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT SampleCount, + /* [annotation] */ + __out UINT *pNumQualityLevels); + + void ( STDMETHODCALLTYPE *CheckCounterInfo )( + ID3D10Device1 * This, + /* [annotation] */ + __out D3D10_COUNTER_INFO *pCounterInfo); + + HRESULT ( STDMETHODCALLTYPE *CheckCounter )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_COUNTER_DESC *pDesc, + /* [annotation] */ + __out D3D10_COUNTER_TYPE *pType, + /* [annotation] */ + __out UINT *pActiveCounters, + /* [annotation] */ + __out_ecount_opt(*pNameLength) LPSTR szName, + /* [annotation] */ + __inout_opt UINT *pNameLength, + /* [annotation] */ + __out_ecount_opt(*pUnitsLength) LPSTR szUnits, + /* [annotation] */ + __inout_opt UINT *pUnitsLength, + /* [annotation] */ + __out_ecount_opt(*pDescriptionLength) LPSTR szDescription, + /* [annotation] */ + __inout_opt UINT *pDescriptionLength); + + UINT ( STDMETHODCALLTYPE *GetCreationFlags )( + ID3D10Device1 * This); + + HRESULT ( STDMETHODCALLTYPE *OpenSharedResource )( + ID3D10Device1 * This, + /* [annotation] */ + __in HANDLE hResource, + /* [annotation] */ + __in REFIID ReturnedInterface, + /* [annotation] */ + __out_opt void **ppResource); + + void ( STDMETHODCALLTYPE *SetTextFilterSize )( + ID3D10Device1 * This, + /* [annotation] */ + __in UINT Width, + /* [annotation] */ + __in UINT Height); + + void ( STDMETHODCALLTYPE *GetTextFilterSize )( + ID3D10Device1 * This, + /* [annotation] */ + __out_opt UINT *pWidth, + /* [annotation] */ + __out_opt UINT *pHeight); + + HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView1 )( + ID3D10Device1 * This, + /* [annotation] */ + __in ID3D10Resource *pResource, + /* [annotation] */ + __in_opt const D3D10_SHADER_RESOURCE_VIEW_DESC1 *pDesc, + /* [annotation] */ + __out_opt ID3D10ShaderResourceView1 **ppSRView); + + HRESULT ( STDMETHODCALLTYPE *CreateBlendState1 )( + ID3D10Device1 * This, + /* [annotation] */ + __in const D3D10_BLEND_DESC1 *pBlendStateDesc, + /* [annotation] */ + __out_opt ID3D10BlendState1 **ppBlendState); + + D3D10_FEATURE_LEVEL1 ( STDMETHODCALLTYPE *GetFeatureLevel )( + ID3D10Device1 * This); + + END_INTERFACE + } ID3D10Device1Vtbl; + + interface ID3D10Device1 + { + CONST_VTBL struct ID3D10Device1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Device1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Device1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Device1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Device1_VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device1_PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device1_PSSetShader(This,pPixelShader) \ + ( (This)->lpVtbl -> PSSetShader(This,pPixelShader) ) + +#define ID3D10Device1_PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device1_VSSetShader(This,pVertexShader) \ + ( (This)->lpVtbl -> VSSetShader(This,pVertexShader) ) + +#define ID3D10Device1_DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) \ + ( (This)->lpVtbl -> DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) ) + +#define ID3D10Device1_Draw(This,VertexCount,StartVertexLocation) \ + ( (This)->lpVtbl -> Draw(This,VertexCount,StartVertexLocation) ) + +#define ID3D10Device1_PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device1_IASetInputLayout(This,pInputLayout) \ + ( (This)->lpVtbl -> IASetInputLayout(This,pInputLayout) ) + +#define ID3D10Device1_IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) ) + +#define ID3D10Device1_IASetIndexBuffer(This,pIndexBuffer,Format,Offset) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pIndexBuffer,Format,Offset) ) + +#define ID3D10Device1_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D10Device1_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D10Device1_GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device1_GSSetShader(This,pShader) \ + ( (This)->lpVtbl -> GSSetShader(This,pShader) ) + +#define ID3D10Device1_IASetPrimitiveTopology(This,Topology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,Topology) ) + +#define ID3D10Device1_VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device1_VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device1_SetPredication(This,pPredicate,PredicateValue) \ + ( (This)->lpVtbl -> SetPredication(This,pPredicate,PredicateValue) ) + +#define ID3D10Device1_GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device1_GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device1_OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) ) + +#define ID3D10Device1_OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) \ + ( (This)->lpVtbl -> OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) ) + +#define ID3D10Device1_OMSetDepthStencilState(This,pDepthStencilState,StencilRef) \ + ( (This)->lpVtbl -> OMSetDepthStencilState(This,pDepthStencilState,StencilRef) ) + +#define ID3D10Device1_SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) \ + ( (This)->lpVtbl -> SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) ) + +#define ID3D10Device1_DrawAuto(This) \ + ( (This)->lpVtbl -> DrawAuto(This) ) + +#define ID3D10Device1_RSSetState(This,pRasterizerState) \ + ( (This)->lpVtbl -> RSSetState(This,pRasterizerState) ) + +#define ID3D10Device1_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D10Device1_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D10Device1_CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) \ + ( (This)->lpVtbl -> CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) ) + +#define ID3D10Device1_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D10Device1_UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ + ( (This)->lpVtbl -> UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) + +#define ID3D10Device1_ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) ) + +#define ID3D10Device1_ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) ) + +#define ID3D10Device1_GenerateMips(This,pShaderResourceView) \ + ( (This)->lpVtbl -> GenerateMips(This,pShaderResourceView) ) + +#define ID3D10Device1_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D10Device1_VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device1_PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device1_PSGetShader(This,ppPixelShader) \ + ( (This)->lpVtbl -> PSGetShader(This,ppPixelShader) ) + +#define ID3D10Device1_PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device1_VSGetShader(This,ppVertexShader) \ + ( (This)->lpVtbl -> VSGetShader(This,ppVertexShader) ) + +#define ID3D10Device1_PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device1_IAGetInputLayout(This,ppInputLayout) \ + ( (This)->lpVtbl -> IAGetInputLayout(This,ppInputLayout) ) + +#define ID3D10Device1_IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \ + ( (This)->lpVtbl -> IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) ) + +#define ID3D10Device1_IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) \ + ( (This)->lpVtbl -> IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) ) + +#define ID3D10Device1_GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D10Device1_GSGetShader(This,ppGeometryShader) \ + ( (This)->lpVtbl -> GSGetShader(This,ppGeometryShader) ) + +#define ID3D10Device1_IAGetPrimitiveTopology(This,pTopology) \ + ( (This)->lpVtbl -> IAGetPrimitiveTopology(This,pTopology) ) + +#define ID3D10Device1_VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device1_VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device1_GetPredication(This,ppPredicate,pPredicateValue) \ + ( (This)->lpVtbl -> GetPredication(This,ppPredicate,pPredicateValue) ) + +#define ID3D10Device1_GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D10Device1_GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D10Device1_OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) \ + ( (This)->lpVtbl -> OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) ) + +#define ID3D10Device1_OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) \ + ( (This)->lpVtbl -> OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) ) + +#define ID3D10Device1_OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) \ + ( (This)->lpVtbl -> OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) ) + +#define ID3D10Device1_SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets) \ + ( (This)->lpVtbl -> SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets) ) + +#define ID3D10Device1_RSGetState(This,ppRasterizerState) \ + ( (This)->lpVtbl -> RSGetState(This,ppRasterizerState) ) + +#define ID3D10Device1_RSGetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSGetViewports(This,NumViewports,pViewports) ) + +#define ID3D10Device1_RSGetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSGetScissorRects(This,NumRects,pRects) ) + +#define ID3D10Device1_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D10Device1_SetExceptionMode(This,RaiseFlags) \ + ( (This)->lpVtbl -> SetExceptionMode(This,RaiseFlags) ) + +#define ID3D10Device1_GetExceptionMode(This) \ + ( (This)->lpVtbl -> GetExceptionMode(This) ) + +#define ID3D10Device1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D10Device1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D10Device1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D10Device1_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D10Device1_Flush(This) \ + ( (This)->lpVtbl -> Flush(This) ) + +#define ID3D10Device1_CreateBuffer(This,pDesc,pInitialData,ppBuffer) \ + ( (This)->lpVtbl -> CreateBuffer(This,pDesc,pInitialData,ppBuffer) ) + +#define ID3D10Device1_CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) \ + ( (This)->lpVtbl -> CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) ) + +#define ID3D10Device1_CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) \ + ( (This)->lpVtbl -> CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) ) + +#define ID3D10Device1_CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) \ + ( (This)->lpVtbl -> CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) ) + +#define ID3D10Device1_CreateShaderResourceView(This,pResource,pDesc,ppSRView) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,ppSRView) ) + +#define ID3D10Device1_CreateRenderTargetView(This,pResource,pDesc,ppRTView) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,ppRTView) ) + +#define ID3D10Device1_CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) ) + +#define ID3D10Device1_CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) \ + ( (This)->lpVtbl -> CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) ) + +#define ID3D10Device1_CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader) \ + ( (This)->lpVtbl -> CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader) ) + +#define ID3D10Device1_CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader) \ + ( (This)->lpVtbl -> CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader) ) + +#define ID3D10Device1_CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader) \ + ( (This)->lpVtbl -> CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader) ) + +#define ID3D10Device1_CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader) \ + ( (This)->lpVtbl -> CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader) ) + +#define ID3D10Device1_CreateBlendState(This,pBlendStateDesc,ppBlendState) \ + ( (This)->lpVtbl -> CreateBlendState(This,pBlendStateDesc,ppBlendState) ) + +#define ID3D10Device1_CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) \ + ( (This)->lpVtbl -> CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) ) + +#define ID3D10Device1_CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) \ + ( (This)->lpVtbl -> CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) ) + +#define ID3D10Device1_CreateSamplerState(This,pSamplerDesc,ppSamplerState) \ + ( (This)->lpVtbl -> CreateSamplerState(This,pSamplerDesc,ppSamplerState) ) + +#define ID3D10Device1_CreateQuery(This,pQueryDesc,ppQuery) \ + ( (This)->lpVtbl -> CreateQuery(This,pQueryDesc,ppQuery) ) + +#define ID3D10Device1_CreatePredicate(This,pPredicateDesc,ppPredicate) \ + ( (This)->lpVtbl -> CreatePredicate(This,pPredicateDesc,ppPredicate) ) + +#define ID3D10Device1_CreateCounter(This,pCounterDesc,ppCounter) \ + ( (This)->lpVtbl -> CreateCounter(This,pCounterDesc,ppCounter) ) + +#define ID3D10Device1_CheckFormatSupport(This,Format,pFormatSupport) \ + ( (This)->lpVtbl -> CheckFormatSupport(This,Format,pFormatSupport) ) + +#define ID3D10Device1_CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) \ + ( (This)->lpVtbl -> CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) ) + +#define ID3D10Device1_CheckCounterInfo(This,pCounterInfo) \ + ( (This)->lpVtbl -> CheckCounterInfo(This,pCounterInfo) ) + +#define ID3D10Device1_CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) \ + ( (This)->lpVtbl -> CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) ) + +#define ID3D10Device1_GetCreationFlags(This) \ + ( (This)->lpVtbl -> GetCreationFlags(This) ) + +#define ID3D10Device1_OpenSharedResource(This,hResource,ReturnedInterface,ppResource) \ + ( (This)->lpVtbl -> OpenSharedResource(This,hResource,ReturnedInterface,ppResource) ) + +#define ID3D10Device1_SetTextFilterSize(This,Width,Height) \ + ( (This)->lpVtbl -> SetTextFilterSize(This,Width,Height) ) + +#define ID3D10Device1_GetTextFilterSize(This,pWidth,pHeight) \ + ( (This)->lpVtbl -> GetTextFilterSize(This,pWidth,pHeight) ) + + +#define ID3D10Device1_CreateShaderResourceView1(This,pResource,pDesc,ppSRView) \ + ( (This)->lpVtbl -> CreateShaderResourceView1(This,pResource,pDesc,ppSRView) ) + +#define ID3D10Device1_CreateBlendState1(This,pBlendStateDesc,ppBlendState) \ + ( (This)->lpVtbl -> CreateBlendState1(This,pBlendStateDesc,ppBlendState) ) + +#define ID3D10Device1_GetFeatureLevel(This) \ + ( (This)->lpVtbl -> GetFeatureLevel(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Device1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10_1_0000_0003 */ +/* [local] */ + +#define D3D10_1_SDK_VERSION ( ( 0 + 0x20 ) ) + +#include "d3d10_1shader.h" + +/////////////////////////////////////////////////////////////////////////// +// D3D10CreateDevice1 +// ------------------ +// +// pAdapter +// If NULL, D3D10CreateDevice1 will choose the primary adapter and +// create a new instance from a temporarily created IDXGIFactory. +// If non-NULL, D3D10CreateDevice1 will register the appropriate +// device, if necessary (via IDXGIAdapter::RegisterDrver), before +// creating the device. +// DriverType +// Specifies the driver type to be created: hardware, reference or +// null. +// Software +// HMODULE of a DLL implementing a software rasterizer. Must be NULL for +// non-Software driver types. +// Flags +// Any of those documented for D3D10CreateDeviceAndSwapChain1. +// HardwareLevel +// Any of those documented for D3D10CreateDeviceAndSwapChain1. +// SDKVersion +// SDK version. Use the D3D10_1_SDK_VERSION macro. +// ppDevice +// Pointer to returned interface. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory +// IDXGIFactory::EnumAdapters +// IDXGIAdapter::RegisterDriver +// D3D10CreateDevice1 +// +/////////////////////////////////////////////////////////////////////////// +typedef HRESULT (WINAPI* PFN_D3D10_CREATE_DEVICE1)(IDXGIAdapter *, + D3D10_DRIVER_TYPE, HMODULE, UINT, D3D10_FEATURE_LEVEL1, UINT, ID3D10Device1**); + +HRESULT WINAPI D3D10CreateDevice1( + IDXGIAdapter *pAdapter, + D3D10_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + D3D10_FEATURE_LEVEL1 HardwareLevel, + UINT SDKVersion, + ID3D10Device1 **ppDevice); + +/////////////////////////////////////////////////////////////////////////// +// D3D10CreateDeviceAndSwapChain1 +// ------------------------------ +// +// ppAdapter +// If NULL, D3D10CreateDevice1 will choose the primary adapter and +// create a new instance from a temporarily created IDXGIFactory. +// If non-NULL, D3D10CreateDevice1 will register the appropriate +// device, if necessary (via IDXGIAdapter::RegisterDrver), before +// creating the device. +// DriverType +// Specifies the driver type to be created: hardware, reference or +// null. +// Software +// HMODULE of a DLL implementing a software rasterizer. Must be NULL for +// non-Software driver types. +// Flags +// Any of those documented for D3D10CreateDevice1. +// HardwareLevel +// Any of: +// D3D10_CREATE_LEVEL_10_0 +// D3D10_CREATE_LEVEL_10_1 +// SDKVersion +// SDK version. Use the D3D10_1_SDK_VERSION macro. +// pSwapChainDesc +// Swap chain description, may be NULL. +// ppSwapChain +// Pointer to returned interface. May be NULL. +// ppDevice +// Pointer to returned interface. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory +// IDXGIFactory::EnumAdapters +// IDXGIAdapter::RegisterDriver +// D3D10CreateDevice1 +// IDXGIFactory::CreateSwapChain +// +/////////////////////////////////////////////////////////////////////////// +typedef HRESULT (WINAPI* PFN_D3D10_CREATE_DEVICE_AND_SWAP_CHAIN1)(IDXGIAdapter *, + D3D10_DRIVER_TYPE, HMODULE, UINT, D3D10_FEATURE_LEVEL1, UINT, DXGI_SWAP_CHAIN_DESC *, IDXGISwapChain **, ID3D10Device1 **); + +HRESULT WINAPI D3D10CreateDeviceAndSwapChain1( + IDXGIAdapter *pAdapter, + D3D10_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + D3D10_FEATURE_LEVEL1 HardwareLevel, + UINT SDKVersion, + DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, + IDXGISwapChain **ppSwapChain, + ID3D10Device1 **ppDevice); +DEFINE_GUID(IID_ID3D10BlendState1,0xEDAD8D99,0x8A35,0x4d6d,0x85,0x66,0x2E,0xA2,0x76,0xCD,0xE1,0x61); +DEFINE_GUID(IID_ID3D10ShaderResourceView1,0x9B7E4C87,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10Device1,0x9B7E4C8F,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0003_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10_1_0000_0003_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3D10_1shader.h b/Src/Decoder_H264_ALL/D3D/include/D3D10_1shader.h new file mode 100644 index 0000000..3fa6f90 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3D10_1shader.h @@ -0,0 +1,300 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3D10_1Shader.h +// Content: D3D10.1 Shader Types and APIs +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3D10_1SHADER_H__ +#define __D3D10_1SHADER_H__ + +#include "d3d10shader.h" + +//---------------------------------------------------------------------------- +// Shader debugging structures +//---------------------------------------------------------------------------- + +typedef enum _D3D10_SHADER_DEBUG_REGTYPE +{ + D3D10_SHADER_DEBUG_REG_INPUT, + D3D10_SHADER_DEBUG_REG_OUTPUT, + D3D10_SHADER_DEBUG_REG_CBUFFER, + D3D10_SHADER_DEBUG_REG_TBUFFER, + D3D10_SHADER_DEBUG_REG_TEMP, + D3D10_SHADER_DEBUG_REG_TEMPARRAY, + D3D10_SHADER_DEBUG_REG_TEXTURE, + D3D10_SHADER_DEBUG_REG_SAMPLER, + D3D10_SHADER_DEBUG_REG_IMMEDIATECBUFFER, + D3D10_SHADER_DEBUG_REG_LITERAL, + D3D10_SHADER_DEBUG_REG_UNUSED, + D3D11_SHADER_DEBUG_REG_INTERFACE_POINTERS, + D3D10_SHADER_DEBUG_REG_FORCE_DWORD = 0x7fffffff, +} D3D10_SHADER_DEBUG_REGTYPE; + +typedef enum _D3D10_SHADER_DEBUG_SCOPETYPE +{ + D3D10_SHADER_DEBUG_SCOPE_GLOBAL, + D3D10_SHADER_DEBUG_SCOPE_BLOCK, + D3D10_SHADER_DEBUG_SCOPE_FORLOOP, + D3D10_SHADER_DEBUG_SCOPE_STRUCT, + D3D10_SHADER_DEBUG_SCOPE_FUNC_PARAMS, + D3D10_SHADER_DEBUG_SCOPE_STATEBLOCK, + D3D10_SHADER_DEBUG_SCOPE_NAMESPACE, + D3D10_SHADER_DEBUG_SCOPE_ANNOTATION, + D3D10_SHADER_DEBUG_SCOPE_FORCE_DWORD = 0x7fffffff, +} D3D10_SHADER_DEBUG_SCOPETYPE; + +typedef enum _D3D10_SHADER_DEBUG_VARTYPE +{ + D3D10_SHADER_DEBUG_VAR_VARIABLE, + D3D10_SHADER_DEBUG_VAR_FUNCTION, + D3D10_SHADER_DEBUG_VAR_FORCE_DWORD = 0x7fffffff, +} D3D10_SHADER_DEBUG_VARTYPE; + +///////////////////////////////////////////////////////////////////// +// These are the serialized structures that get written to the file +///////////////////////////////////////////////////////////////////// + +typedef struct _D3D10_SHADER_DEBUG_TOKEN_INFO +{ + UINT File; // offset into file list + UINT Line; // line # + UINT Column; // column # + + UINT TokenLength; + UINT TokenId; // offset to LPCSTR of length TokenLength in string datastore +} D3D10_SHADER_DEBUG_TOKEN_INFO; + +// Variable list +typedef struct _D3D10_SHADER_DEBUG_VAR_INFO +{ + // Index into token list for declaring identifier + UINT TokenId; + D3D10_SHADER_VARIABLE_TYPE Type; + // register and component for this variable, only valid/necessary for arrays + UINT Register; + UINT Component; + // gives the original variable that declared this variable + UINT ScopeVar; + // this variable's offset in its ScopeVar + UINT ScopeVarOffset; +} D3D10_SHADER_DEBUG_VAR_INFO; + +typedef struct _D3D10_SHADER_DEBUG_INPUT_INFO +{ + // index into array of variables of variable to initialize + UINT Var; + // input, cbuffer, tbuffer + D3D10_SHADER_DEBUG_REGTYPE InitialRegisterSet; + // set to cbuffer or tbuffer slot, geometry shader input primitive #, + // identifying register for indexable temp, or -1 + UINT InitialBank; + // -1 if temp, otherwise gives register in register set + UINT InitialRegister; + // -1 if temp, otherwise gives component + UINT InitialComponent; + // initial value if literal + UINT InitialValue; +} D3D10_SHADER_DEBUG_INPUT_INFO; + +typedef struct _D3D10_SHADER_DEBUG_SCOPEVAR_INFO +{ + // Index into variable token + UINT TokenId; + + D3D10_SHADER_DEBUG_VARTYPE VarType; // variable or function (different namespaces) + D3D10_SHADER_VARIABLE_CLASS Class; + UINT Rows; // number of rows (matrices) + UINT Columns; // number of columns (vectors and matrices) + + // In an array of structures, one struct member scope is provided, and + // you'll have to add the array stride times the index to the variable + // index you find, then find that variable in this structure's list of + // variables. + + // gives a scope to look up struct members. -1 if not a struct + UINT StructMemberScope; + + // number of array indices + UINT uArrayIndices; // a[3][2][1] has 3 indices + // maximum array index for each index + // offset to UINT[uArrayIndices] in UINT datastore + UINT ArrayElements; // a[3][2][1] has {3, 2, 1} + // how many variables each array index moves + // offset to UINT[uArrayIndices] in UINT datastore + UINT ArrayStrides; // a[3][2][1] has {2, 1, 1} + + UINT uVariables; + // index of the first variable, later variables are offsets from this one + UINT uFirstVariable; +} D3D10_SHADER_DEBUG_SCOPEVAR_INFO; + +// scope data, this maps variable names to debug variables (useful for the watch window) +typedef struct _D3D10_SHADER_DEBUG_SCOPE_INFO +{ + D3D10_SHADER_DEBUG_SCOPETYPE ScopeType; + UINT Name; // offset to name of scope in strings list + UINT uNameLen; // length of name string + UINT uVariables; + UINT VariableData; // Offset to UINT[uVariables] indexing the Scope Variable list +} D3D10_SHADER_DEBUG_SCOPE_INFO; + +// instruction outputs +typedef struct _D3D10_SHADER_DEBUG_OUTPUTVAR +{ + // index variable being written to, if -1 it's not going to a variable + UINT Var; + // range data that the compiler expects to be true + UINT uValueMin, uValueMax; + INT iValueMin, iValueMax; + FLOAT fValueMin, fValueMax; + + BOOL bNaNPossible, bInfPossible; +} D3D10_SHADER_DEBUG_OUTPUTVAR; + +typedef struct _D3D10_SHADER_DEBUG_OUTPUTREG_INFO +{ + // Only temp, indexable temp, and output are valid here + D3D10_SHADER_DEBUG_REGTYPE OutputRegisterSet; + // -1 means no output + UINT OutputReg; + // if a temp array, identifier for which one + UINT TempArrayReg; + // -1 means masked out + UINT OutputComponents[4]; + D3D10_SHADER_DEBUG_OUTPUTVAR OutputVars[4]; + // when indexing the output, get the value of this register, then add + // that to uOutputReg. If uIndexReg is -1, then there is no index. + // find the variable whose register is the sum (by looking in the ScopeVar) + // and component matches, then set it. This should only happen for indexable + // temps and outputs. + UINT IndexReg; + UINT IndexComp; +} D3D10_SHADER_DEBUG_OUTPUTREG_INFO; + +// per instruction data +typedef struct _D3D10_SHADER_DEBUG_INST_INFO +{ + UINT Id; // Which instruction this is in the bytecode + UINT Opcode; // instruction type + + // 0, 1, or 2 + UINT uOutputs; + + // up to two outputs per instruction + D3D10_SHADER_DEBUG_OUTPUTREG_INFO pOutputs[2]; + + // index into the list of tokens for this instruction's token + UINT TokenId; + + // how many function calls deep this instruction is + UINT NestingLevel; + + // list of scopes from outer-most to inner-most + // Number of scopes + UINT Scopes; + UINT ScopeInfo; // Offset to UINT[uScopes] specifying indices of the ScopeInfo Array + + // list of variables accessed by this instruction + // Number of variables + UINT AccessedVars; + UINT AccessedVarsInfo; // Offset to UINT[AccessedVars] specifying indices of the ScopeVariableInfo Array +} D3D10_SHADER_DEBUG_INST_INFO; + +typedef struct _D3D10_SHADER_DEBUG_FILE_INFO +{ + UINT FileName; // Offset to LPCSTR for file name + UINT FileNameLen; // Length of file name + UINT FileData; // Offset to LPCSTR of length FileLen + UINT FileLen; // Length of file +} D3D10_SHADER_DEBUG_FILE_INFO; + +typedef struct _D3D10_SHADER_DEBUG_INFO +{ + UINT Size; // sizeof(D3D10_SHADER_DEBUG_INFO) + UINT Creator; // Offset to LPCSTR for compiler version + UINT EntrypointName; // Offset to LPCSTR for Entry point name + UINT ShaderTarget; // Offset to LPCSTR for shader target + UINT CompileFlags; // flags used to compile + UINT Files; // number of included files + UINT FileInfo; // Offset to D3D10_SHADER_DEBUG_FILE_INFO[Files] + UINT Instructions; // number of instructions + UINT InstructionInfo; // Offset to D3D10_SHADER_DEBUG_INST_INFO[Instructions] + UINT Variables; // number of variables + UINT VariableInfo; // Offset to D3D10_SHADER_DEBUG_VAR_INFO[Variables] + UINT InputVariables; // number of variables to initialize before running + UINT InputVariableInfo; // Offset to D3D10_SHADER_DEBUG_INPUT_INFO[InputVariables] + UINT Tokens; // number of tokens to initialize + UINT TokenInfo; // Offset to D3D10_SHADER_DEBUG_TOKEN_INFO[Tokens] + UINT Scopes; // number of scopes + UINT ScopeInfo; // Offset to D3D10_SHADER_DEBUG_SCOPE_INFO[Scopes] + UINT ScopeVariables; // number of variables declared + UINT ScopeVariableInfo; // Offset to D3D10_SHADER_DEBUG_SCOPEVAR_INFO[Scopes] + UINT UintOffset; // Offset to the UINT datastore, all UINT offsets are from this offset + UINT StringOffset; // Offset to the string datastore, all string offsets are from this offset +} D3D10_SHADER_DEBUG_INFO; + +//---------------------------------------------------------------------------- +// ID3D10ShaderReflection1: +//---------------------------------------------------------------------------- + +// +// Interface definitions +// + +typedef interface ID3D10ShaderReflection1 ID3D10ShaderReflection1; +typedef interface ID3D10ShaderReflection1 *LPD3D10SHADERREFLECTION1; + +// {C3457783-A846-47CE-9520-CEA6F66E7447} +DEFINE_GUID(IID_ID3D10ShaderReflection1, +0xc3457783, 0xa846, 0x47ce, 0x95, 0x20, 0xce, 0xa6, 0xf6, 0x6e, 0x74, 0x47); + +#undef INTERFACE +#define INTERFACE ID3D10ShaderReflection1 + +DECLARE_INTERFACE_(ID3D10ShaderReflection1, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE; + + STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDescByName)(THIS_ LPCSTR Name, D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE; + + STDMETHOD(GetMovInstructionCount)(THIS_ UINT* pCount) PURE; + STDMETHOD(GetMovcInstructionCount)(THIS_ UINT* pCount) PURE; + STDMETHOD(GetConversionInstructionCount)(THIS_ UINT* pCount) PURE; + STDMETHOD(GetBitwiseInstructionCount)(THIS_ UINT* pCount) PURE; + + STDMETHOD(GetGSInputPrimitive)(THIS_ D3D10_PRIMITIVE* pPrim) PURE; + STDMETHOD(IsLevel9Shader)(THIS_ BOOL* pbLevel9Shader) PURE; + STDMETHOD(IsSampleFrequencyShader)(THIS_ BOOL* pbSampleFrequency) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3D10_1SHADER_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3D10effect.h b/Src/Decoder_H264_ALL/D3D/include/D3D10effect.h new file mode 100644 index 0000000..7387854 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3D10effect.h @@ -0,0 +1,1455 @@ + +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3D10Effect.h +// Content: D3D10 Stateblock/Effect Types & APIs +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3D10EFFECT_H__ +#define __D3D10EFFECT_H__ + +#include "d3d10.h" + +////////////////////////////////////////////////////////////////////////////// +// File contents: +// +// 1) Stateblock enums, structs, interfaces, flat APIs +// 2) Effect enums, structs, interfaces, flat APIs +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3D10_DEVICE_STATE_TYPES: +// +// Used in ID3D10StateBlockMask function calls +// +//---------------------------------------------------------------------------- + +typedef enum _D3D10_DEVICE_STATE_TYPES +{ + + D3D10_DST_SO_BUFFERS=1, // Single-value state (atomical gets/sets) + D3D10_DST_OM_RENDER_TARGETS, // Single-value state (atomical gets/sets) + D3D10_DST_OM_DEPTH_STENCIL_STATE, // Single-value state + D3D10_DST_OM_BLEND_STATE, // Single-value state + + D3D10_DST_VS, // Single-value state + D3D10_DST_VS_SAMPLERS, // Count: D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT + D3D10_DST_VS_SHADER_RESOURCES, // Count: D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + D3D10_DST_VS_CONSTANT_BUFFERS, // Count: + + D3D10_DST_GS, // Single-value state + D3D10_DST_GS_SAMPLERS, // Count: D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT + D3D10_DST_GS_SHADER_RESOURCES, // Count: D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + D3D10_DST_GS_CONSTANT_BUFFERS, // Count: D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + + D3D10_DST_PS, // Single-value state + D3D10_DST_PS_SAMPLERS, // Count: D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT + D3D10_DST_PS_SHADER_RESOURCES, // Count: D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT + D3D10_DST_PS_CONSTANT_BUFFERS, // Count: D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT + + D3D10_DST_IA_VERTEX_BUFFERS, // Count: D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT + D3D10_DST_IA_INDEX_BUFFER, // Single-value state + D3D10_DST_IA_INPUT_LAYOUT, // Single-value state + D3D10_DST_IA_PRIMITIVE_TOPOLOGY, // Single-value state + + D3D10_DST_RS_VIEWPORTS, // Single-value state (atomical gets/sets) + D3D10_DST_RS_SCISSOR_RECTS, // Single-value state (atomical gets/sets) + D3D10_DST_RS_RASTERIZER_STATE, // Single-value state + + D3D10_DST_PREDICATION, // Single-value state +} D3D10_DEVICE_STATE_TYPES; + +//---------------------------------------------------------------------------- +// D3D10_DEVICE_STATE_TYPES: +// +// Used in ID3D10StateBlockMask function calls +// +//---------------------------------------------------------------------------- + +#ifndef D3D10_BYTES_FROM_BITS +#define D3D10_BYTES_FROM_BITS(x) (((x) + 7) / 8) +#endif // D3D10_BYTES_FROM_BITS + +typedef struct _D3D10_STATE_BLOCK_MASK +{ + BYTE VS; + BYTE VSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)]; + BYTE VSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)]; + BYTE VSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)]; + + BYTE GS; + BYTE GSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)]; + BYTE GSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)]; + BYTE GSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)]; + + BYTE PS; + BYTE PSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)]; + BYTE PSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)]; + BYTE PSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)]; + + BYTE IAVertexBuffers[D3D10_BYTES_FROM_BITS(D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT)]; + BYTE IAIndexBuffer; + BYTE IAInputLayout; + BYTE IAPrimitiveTopology; + + BYTE OMRenderTargets; + BYTE OMDepthStencilState; + BYTE OMBlendState; + + BYTE RSViewports; + BYTE RSScissorRects; + BYTE RSRasterizerState; + + BYTE SOBuffers; + + BYTE Predication; +} D3D10_STATE_BLOCK_MASK; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10StateBlock ////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10StateBlock ID3D10StateBlock; +typedef interface ID3D10StateBlock *LPD3D10STATEBLOCK; + +// {0803425A-57F5-4dd6-9465-A87570834A08} +DEFINE_GUID(IID_ID3D10StateBlock, +0x803425a, 0x57f5, 0x4dd6, 0x94, 0x65, 0xa8, 0x75, 0x70, 0x83, 0x4a, 0x8); + +#undef INTERFACE +#define INTERFACE ID3D10StateBlock + +DECLARE_INTERFACE_(ID3D10StateBlock, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD(Capture)(THIS) PURE; + STDMETHOD(Apply)(THIS) PURE; + STDMETHOD(ReleaseAllDeviceObjects)(THIS) PURE; + STDMETHOD(GetDevice)(THIS_ ID3D10Device **ppDevice) PURE; +}; + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +//---------------------------------------------------------------------------- +// D3D10_STATE_BLOCK_MASK and manipulation functions +// ------------------------------------------------- +// +// These functions exist to facilitate working with the D3D10_STATE_BLOCK_MASK +// structure. +// +// D3D10_STATE_BLOCK_MASK *pResult or *pMask +// The state block mask to operate on +// +// D3D10_STATE_BLOCK_MASK *pA, *pB +// The source state block masks for the binary union/intersect/difference +// operations. +// +// D3D10_DEVICE_STATE_TYPES StateType +// The specific state type to enable/disable/query +// +// UINT RangeStart, RangeLength, Entry +// The specific bit or range of bits for a given state type to operate on. +// Consult the comments for D3D10_DEVICE_STATE_TYPES and +// D3D10_STATE_BLOCK_MASK for information on the valid bit ranges for +// each state. +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10StateBlockMaskUnion(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult); +HRESULT WINAPI D3D10StateBlockMaskIntersect(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult); +HRESULT WINAPI D3D10StateBlockMaskDifference(D3D10_STATE_BLOCK_MASK *pA, D3D10_STATE_BLOCK_MASK *pB, D3D10_STATE_BLOCK_MASK *pResult); +HRESULT WINAPI D3D10StateBlockMaskEnableCapture(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT RangeStart, UINT RangeLength); +HRESULT WINAPI D3D10StateBlockMaskDisableCapture(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT RangeStart, UINT RangeLength); +HRESULT WINAPI D3D10StateBlockMaskEnableAll(D3D10_STATE_BLOCK_MASK *pMask); +HRESULT WINAPI D3D10StateBlockMaskDisableAll(D3D10_STATE_BLOCK_MASK *pMask); +BOOL WINAPI D3D10StateBlockMaskGetSetting(D3D10_STATE_BLOCK_MASK *pMask, D3D10_DEVICE_STATE_TYPES StateType, UINT Entry); + +//---------------------------------------------------------------------------- +// D3D10CreateStateBlock +// --------------------- +// +// Creates a state block object based on the mask settings specified +// in a D3D10_STATE_BLOCK_MASK structure. +// +// ID3D10Device *pDevice +// The device interface to associate with this state block +// +// D3D10_STATE_BLOCK_MASK *pStateBlockMask +// A bit mask whose settings are used to generate a state block +// object. +// +// ID3D10StateBlock **ppStateBlock +// The resulting state block object. This object will save/restore +// only those pieces of state that were set in the state block +// bit mask +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10CreateStateBlock(ID3D10Device *pDevice, D3D10_STATE_BLOCK_MASK *pStateBlockMask, ID3D10StateBlock **ppStateBlock); + +#ifdef __cplusplus +} +#endif //__cplusplus + +//---------------------------------------------------------------------------- +// D3D10_COMPILE & D3D10_EFFECT flags: +// ------------------------------------- +// +// These flags are passed in when creating an effect, and affect +// either compilation behavior or runtime effect behavior +// +// D3D10_EFFECT_COMPILE_CHILD_EFFECT +// Compile this .fx file to a child effect. Child effects have no initializers +// for any shared values as these are initialied in the master effect (pool). +// +// D3D10_EFFECT_COMPILE_ALLOW_SLOW_OPS +// By default, performance mode is enabled. Performance mode disallows +// mutable state objects by preventing non-literal expressions from appearing in +// state object definitions. Specifying this flag will disable the mode and allow +// for mutable state objects. +// +// D3D10_EFFECT_SINGLE_THREADED +// Do not attempt to synchronize with other threads loading effects into the +// same pool. +// +//---------------------------------------------------------------------------- + +#define D3D10_EFFECT_COMPILE_CHILD_EFFECT (1 << 0) +#define D3D10_EFFECT_COMPILE_ALLOW_SLOW_OPS (1 << 1) +#define D3D10_EFFECT_SINGLE_THREADED (1 << 3) + + +//---------------------------------------------------------------------------- +// D3D10_EFFECT_VARIABLE flags: +// ---------------------------- +// +// These flags describe an effect variable (global or annotation), +// and are returned in D3D10_EFFECT_VARIABLE_DESC::Flags. +// +// D3D10_EFFECT_VARIABLE_POOLED +// Indicates that the this variable or constant buffer resides +// in an effect pool. If this flag is not set, then the variable resides +// in a standalone effect (if ID3D10Effect::GetPool returns NULL) +// or a child effect (if ID3D10Effect::GetPool returns non-NULL) +// +// D3D10_EFFECT_VARIABLE_ANNOTATION +// Indicates that this is an annotation on a technique, pass, or global +// variable. Otherwise, this is a global variable. Annotations cannot +// be shared. +// +// D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT +// Indicates that the variable has been explicitly bound using the +// register keyword. +//---------------------------------------------------------------------------- + +#define D3D10_EFFECT_VARIABLE_POOLED (1 << 0) +#define D3D10_EFFECT_VARIABLE_ANNOTATION (1 << 1) +#define D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT (1 << 2) + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectType ////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3D10_EFFECT_TYPE_DESC: +// +// Retrieved by ID3D10EffectType::GetDesc() +//---------------------------------------------------------------------------- + +typedef struct _D3D10_EFFECT_TYPE_DESC +{ + LPCSTR TypeName; // Name of the type + // (e.g. "float4" or "MyStruct") + + D3D10_SHADER_VARIABLE_CLASS Class; // (e.g. scalar, vector, object, etc.) + D3D10_SHADER_VARIABLE_TYPE Type; // (e.g. float, texture, vertexshader, etc.) + + UINT Elements; // Number of elements in this type + // (0 if not an array) + UINT Members; // Number of members + // (0 if not a structure) + UINT Rows; // Number of rows in this type + // (0 if not a numeric primitive) + UINT Columns; // Number of columns in this type + // (0 if not a numeric primitive) + + UINT PackedSize; // Number of bytes required to represent + // this data type, when tightly packed + UINT UnpackedSize; // Number of bytes occupied by this data + // type, when laid out in a constant buffer + UINT Stride; // Number of bytes to seek between elements, + // when laid out in a constant buffer +} D3D10_EFFECT_TYPE_DESC; + +typedef interface ID3D10EffectType ID3D10EffectType; +typedef interface ID3D10EffectType *LPD3D10EFFECTTYPE; + +// {4E9E1DDC-CD9D-4772-A837-00180B9B88FD} +DEFINE_GUID(IID_ID3D10EffectType, +0x4e9e1ddc, 0xcd9d, 0x4772, 0xa8, 0x37, 0x0, 0x18, 0xb, 0x9b, 0x88, 0xfd); + +#undef INTERFACE +#define INTERFACE ID3D10EffectType + +DECLARE_INTERFACE(ID3D10EffectType) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_TYPE_DESC *pDesc) PURE; + STDMETHOD_(ID3D10EffectType*, GetMemberTypeByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectType*, GetMemberTypeByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectType*, GetMemberTypeBySemantic)(THIS_ LPCSTR Semantic) PURE; + STDMETHOD_(LPCSTR, GetMemberName)(THIS_ UINT Index) PURE; + STDMETHOD_(LPCSTR, GetMemberSemantic)(THIS_ UINT Index) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectVariable ////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3D10_EFFECT_VARIABLE_DESC: +// +// Retrieved by ID3D10EffectVariable::GetDesc() +//---------------------------------------------------------------------------- + +typedef struct _D3D10_EFFECT_VARIABLE_DESC +{ + LPCSTR Name; // Name of this variable, annotation, + // or structure member + LPCSTR Semantic; // Semantic string of this variable + // or structure member (NULL for + // annotations or if not present) + + UINT Flags; // D3D10_EFFECT_VARIABLE_* flags + UINT Annotations; // Number of annotations on this variable + // (always 0 for annotations) + + UINT BufferOffset; // Offset into containing cbuffer or tbuffer + // (always 0 for annotations or variables + // not in constant buffers) + + UINT ExplicitBindPoint; // Used if the variable has been explicitly bound + // using the register keyword. Check Flags for + // D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT; +} D3D10_EFFECT_VARIABLE_DESC; + +typedef interface ID3D10EffectVariable ID3D10EffectVariable; +typedef interface ID3D10EffectVariable *LPD3D10EFFECTVARIABLE; + +// {AE897105-00E6-45bf-BB8E-281DD6DB8E1B} +DEFINE_GUID(IID_ID3D10EffectVariable, +0xae897105, 0xe6, 0x45bf, 0xbb, 0x8e, 0x28, 0x1d, 0xd6, 0xdb, 0x8e, 0x1b); + +#undef INTERFACE +#define INTERFACE ID3D10EffectVariable + +// Forward defines +typedef interface ID3D10EffectScalarVariable ID3D10EffectScalarVariable; +typedef interface ID3D10EffectVectorVariable ID3D10EffectVectorVariable; +typedef interface ID3D10EffectMatrixVariable ID3D10EffectMatrixVariable; +typedef interface ID3D10EffectStringVariable ID3D10EffectStringVariable; +typedef interface ID3D10EffectShaderResourceVariable ID3D10EffectShaderResourceVariable; +typedef interface ID3D10EffectRenderTargetViewVariable ID3D10EffectRenderTargetViewVariable; +typedef interface ID3D10EffectDepthStencilViewVariable ID3D10EffectDepthStencilViewVariable; +typedef interface ID3D10EffectConstantBuffer ID3D10EffectConstantBuffer; +typedef interface ID3D10EffectShaderVariable ID3D10EffectShaderVariable; +typedef interface ID3D10EffectBlendVariable ID3D10EffectBlendVariable; +typedef interface ID3D10EffectDepthStencilVariable ID3D10EffectDepthStencilVariable; +typedef interface ID3D10EffectRasterizerVariable ID3D10EffectRasterizerVariable; +typedef interface ID3D10EffectSamplerVariable ID3D10EffectSamplerVariable; + +DECLARE_INTERFACE(ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectScalarVariable //////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectScalarVariable ID3D10EffectScalarVariable; +typedef interface ID3D10EffectScalarVariable *LPD3D10EFFECTSCALARVARIABLE; + +// {00E48F7B-D2C8-49e8-A86C-022DEE53431F} +DEFINE_GUID(IID_ID3D10EffectScalarVariable, +0xe48f7b, 0xd2c8, 0x49e8, 0xa8, 0x6c, 0x2, 0x2d, 0xee, 0x53, 0x43, 0x1f); + +#undef INTERFACE +#define INTERFACE ID3D10EffectScalarVariable + +DECLARE_INTERFACE_(ID3D10EffectScalarVariable, ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE; + + STDMETHOD(SetFloat)(THIS_ float Value) PURE; + STDMETHOD(GetFloat)(THIS_ float *pValue) PURE; + + STDMETHOD(SetFloatArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetFloatArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(SetInt)(THIS_ int Value) PURE; + STDMETHOD(GetInt)(THIS_ int *pValue) PURE; + + STDMETHOD(SetIntArray)(THIS_ int *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetIntArray)(THIS_ int *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(SetBool)(THIS_ BOOL Value) PURE; + STDMETHOD(GetBool)(THIS_ BOOL *pValue) PURE; + + STDMETHOD(SetBoolArray)(THIS_ BOOL *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetBoolArray)(THIS_ BOOL *pData, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectVectorVariable //////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectVectorVariable ID3D10EffectVectorVariable; +typedef interface ID3D10EffectVectorVariable *LPD3D10EFFECTVECTORVARIABLE; + +// {62B98C44-1F82-4c67-BCD0-72CF8F217E81} +DEFINE_GUID(IID_ID3D10EffectVectorVariable, +0x62b98c44, 0x1f82, 0x4c67, 0xbc, 0xd0, 0x72, 0xcf, 0x8f, 0x21, 0x7e, 0x81); + +#undef INTERFACE +#define INTERFACE ID3D10EffectVectorVariable + +DECLARE_INTERFACE_(ID3D10EffectVectorVariable, ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE; + + STDMETHOD(SetBoolVector) (THIS_ BOOL *pData) PURE; + STDMETHOD(SetIntVector) (THIS_ int *pData) PURE; + STDMETHOD(SetFloatVector)(THIS_ float *pData) PURE; + + STDMETHOD(GetBoolVector) (THIS_ BOOL *pData) PURE; + STDMETHOD(GetIntVector) (THIS_ int *pData) PURE; + STDMETHOD(GetFloatVector)(THIS_ float *pData) PURE; + + STDMETHOD(SetBoolVectorArray) (THIS_ BOOL *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(SetIntVectorArray) (THIS_ int *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(SetFloatVectorArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(GetBoolVectorArray) (THIS_ BOOL *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetIntVectorArray) (THIS_ int *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetFloatVectorArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectMatrixVariable //////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectMatrixVariable ID3D10EffectMatrixVariable; +typedef interface ID3D10EffectMatrixVariable *LPD3D10EFFECTMATRIXVARIABLE; + +// {50666C24-B82F-4eed-A172-5B6E7E8522E0} +DEFINE_GUID(IID_ID3D10EffectMatrixVariable, +0x50666c24, 0xb82f, 0x4eed, 0xa1, 0x72, 0x5b, 0x6e, 0x7e, 0x85, 0x22, 0xe0); + +#undef INTERFACE +#define INTERFACE ID3D10EffectMatrixVariable + +DECLARE_INTERFACE_(ID3D10EffectMatrixVariable, ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT ByteOffset, UINT ByteCount) PURE; + + STDMETHOD(SetMatrix)(THIS_ float *pData) PURE; + STDMETHOD(GetMatrix)(THIS_ float *pData) PURE; + + STDMETHOD(SetMatrixArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetMatrixArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(SetMatrixTranspose)(THIS_ float *pData) PURE; + STDMETHOD(GetMatrixTranspose)(THIS_ float *pData) PURE; + + STDMETHOD(SetMatrixTransposeArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetMatrixTransposeArray)(THIS_ float *pData, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectStringVariable //////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectStringVariable ID3D10EffectStringVariable; +typedef interface ID3D10EffectStringVariable *LPD3D10EFFECTSTRINGVARIABLE; + +// {71417501-8DF9-4e0a-A78A-255F9756BAFF} +DEFINE_GUID(IID_ID3D10EffectStringVariable, +0x71417501, 0x8df9, 0x4e0a, 0xa7, 0x8a, 0x25, 0x5f, 0x97, 0x56, 0xba, 0xff); + +#undef INTERFACE +#define INTERFACE ID3D10EffectStringVariable + +DECLARE_INTERFACE_(ID3D10EffectStringVariable, ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(GetString)(THIS_ LPCSTR *ppString) PURE; + STDMETHOD(GetStringArray)(THIS_ LPCSTR *ppStrings, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectShaderResourceVariable //////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectShaderResourceVariable ID3D10EffectShaderResourceVariable; +typedef interface ID3D10EffectShaderResourceVariable *LPD3D10EFFECTSHADERRESOURCEVARIABLE; + +// {C0A7157B-D872-4b1d-8073-EFC2ACD4B1FC} +DEFINE_GUID(IID_ID3D10EffectShaderResourceVariable, +0xc0a7157b, 0xd872, 0x4b1d, 0x80, 0x73, 0xef, 0xc2, 0xac, 0xd4, 0xb1, 0xfc); + + +#undef INTERFACE +#define INTERFACE ID3D10EffectShaderResourceVariable + +DECLARE_INTERFACE_(ID3D10EffectShaderResourceVariable, ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(SetResource)(THIS_ ID3D10ShaderResourceView *pResource) PURE; + STDMETHOD(GetResource)(THIS_ ID3D10ShaderResourceView **ppResource) PURE; + + STDMETHOD(SetResourceArray)(THIS_ ID3D10ShaderResourceView **ppResources, UINT Offset, UINT Count) PURE; + STDMETHOD(GetResourceArray)(THIS_ ID3D10ShaderResourceView **ppResources, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectRenderTargetViewVariable ////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectRenderTargetViewVariable ID3D10EffectRenderTargetViewVariable; +typedef interface ID3D10EffectRenderTargetViewVariable *LPD3D10EFFECTRENDERTARGETVIEWVARIABLE; + +// {28CA0CC3-C2C9-40bb-B57F-67B737122B17} +DEFINE_GUID(IID_ID3D10EffectRenderTargetViewVariable, +0x28ca0cc3, 0xc2c9, 0x40bb, 0xb5, 0x7f, 0x67, 0xb7, 0x37, 0x12, 0x2b, 0x17); + +#undef INTERFACE +#define INTERFACE ID3D10EffectRenderTargetViewVariable + +DECLARE_INTERFACE_(ID3D10EffectRenderTargetViewVariable, ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(SetRenderTarget)(THIS_ ID3D10RenderTargetView *pResource) PURE; + STDMETHOD(GetRenderTarget)(THIS_ ID3D10RenderTargetView **ppResource) PURE; + + STDMETHOD(SetRenderTargetArray)(THIS_ ID3D10RenderTargetView **ppResources, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRenderTargetArray)(THIS_ ID3D10RenderTargetView **ppResources, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectDepthStencilViewVariable ////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectDepthStencilViewVariable ID3D10EffectDepthStencilViewVariable; +typedef interface ID3D10EffectDepthStencilViewVariable *LPD3D10EFFECTDEPTHSTENCILVIEWVARIABLE; + +// {3E02C918-CC79-4985-B622-2D92AD701623} +DEFINE_GUID(IID_ID3D10EffectDepthStencilViewVariable, +0x3e02c918, 0xcc79, 0x4985, 0xb6, 0x22, 0x2d, 0x92, 0xad, 0x70, 0x16, 0x23); + +#undef INTERFACE +#define INTERFACE ID3D10EffectDepthStencilViewVariable + +DECLARE_INTERFACE_(ID3D10EffectDepthStencilViewVariable, ID3D10EffectVariable) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(SetDepthStencil)(THIS_ ID3D10DepthStencilView *pResource) PURE; + STDMETHOD(GetDepthStencil)(THIS_ ID3D10DepthStencilView **ppResource) PURE; + + STDMETHOD(SetDepthStencilArray)(THIS_ ID3D10DepthStencilView **ppResources, UINT Offset, UINT Count) PURE; + STDMETHOD(GetDepthStencilArray)(THIS_ ID3D10DepthStencilView **ppResources, UINT Offset, UINT Count) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectConstantBuffer //////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectConstantBuffer ID3D10EffectConstantBuffer; +typedef interface ID3D10EffectConstantBuffer *LPD3D10EFFECTCONSTANTBUFFER; + +// {56648F4D-CC8B-4444-A5AD-B5A3D76E91B3} +DEFINE_GUID(IID_ID3D10EffectConstantBuffer, +0x56648f4d, 0xcc8b, 0x4444, 0xa5, 0xad, 0xb5, 0xa3, 0xd7, 0x6e, 0x91, 0xb3); + +#undef INTERFACE +#define INTERFACE ID3D10EffectConstantBuffer + +DECLARE_INTERFACE_(ID3D10EffectConstantBuffer, ID3D10EffectVariable) +{ + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(SetConstantBuffer)(THIS_ ID3D10Buffer *pConstantBuffer) PURE; + STDMETHOD(GetConstantBuffer)(THIS_ ID3D10Buffer **ppConstantBuffer) PURE; + + STDMETHOD(SetTextureBuffer)(THIS_ ID3D10ShaderResourceView *pTextureBuffer) PURE; + STDMETHOD(GetTextureBuffer)(THIS_ ID3D10ShaderResourceView **ppTextureBuffer) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectShaderVariable //////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3D10_EFFECT_SHADER_DESC: +// +// Retrieved by ID3D10EffectShaderVariable::GetShaderDesc() +//---------------------------------------------------------------------------- + +typedef struct _D3D10_EFFECT_SHADER_DESC +{ + CONST BYTE *pInputSignature; // Passed into CreateInputLayout, + // valid on VS and GS only + + BOOL IsInline; // Is this an anonymous shader variable + // resulting from an inline shader assignment? + + + // -- The following fields are not valid after Optimize() -- + CONST BYTE *pBytecode; // Shader bytecode + UINT BytecodeLength; + + LPCSTR SODecl; // Stream out declaration string (for GS with SO) + + UINT NumInputSignatureEntries; // Number of entries in the input signature + UINT NumOutputSignatureEntries; // Number of entries in the output signature +} D3D10_EFFECT_SHADER_DESC; + + +typedef interface ID3D10EffectShaderVariable ID3D10EffectShaderVariable; +typedef interface ID3D10EffectShaderVariable *LPD3D10EFFECTSHADERVARIABLE; + +// {80849279-C799-4797-8C33-0407A07D9E06} +DEFINE_GUID(IID_ID3D10EffectShaderVariable, +0x80849279, 0xc799, 0x4797, 0x8c, 0x33, 0x4, 0x7, 0xa0, 0x7d, 0x9e, 0x6); + +#undef INTERFACE +#define INTERFACE ID3D10EffectShaderVariable + +DECLARE_INTERFACE_(ID3D10EffectShaderVariable, ID3D10EffectVariable) +{ + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(GetShaderDesc)(THIS_ UINT ShaderIndex, D3D10_EFFECT_SHADER_DESC *pDesc) PURE; + + STDMETHOD(GetVertexShader)(THIS_ UINT ShaderIndex, ID3D10VertexShader **ppVS) PURE; + STDMETHOD(GetGeometryShader)(THIS_ UINT ShaderIndex, ID3D10GeometryShader **ppGS) PURE; + STDMETHOD(GetPixelShader)(THIS_ UINT ShaderIndex, ID3D10PixelShader **ppPS) PURE; + + STDMETHOD(GetInputSignatureElementDesc)(THIS_ UINT ShaderIndex, UINT Element, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + STDMETHOD(GetOutputSignatureElementDesc)(THIS_ UINT ShaderIndex, UINT Element, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectBlendVariable ///////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectBlendVariable ID3D10EffectBlendVariable; +typedef interface ID3D10EffectBlendVariable *LPD3D10EFFECTBLENDVARIABLE; + +// {1FCD2294-DF6D-4eae-86B3-0E9160CFB07B} +DEFINE_GUID(IID_ID3D10EffectBlendVariable, +0x1fcd2294, 0xdf6d, 0x4eae, 0x86, 0xb3, 0xe, 0x91, 0x60, 0xcf, 0xb0, 0x7b); + +#undef INTERFACE +#define INTERFACE ID3D10EffectBlendVariable + +DECLARE_INTERFACE_(ID3D10EffectBlendVariable, ID3D10EffectVariable) +{ + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(GetBlendState)(THIS_ UINT Index, ID3D10BlendState **ppBlendState) PURE; + STDMETHOD(GetBackingStore)(THIS_ UINT Index, D3D10_BLEND_DESC *pBlendDesc) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectDepthStencilVariable ////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectDepthStencilVariable ID3D10EffectDepthStencilVariable; +typedef interface ID3D10EffectDepthStencilVariable *LPD3D10EFFECTDEPTHSTENCILVARIABLE; + +// {AF482368-330A-46a5-9A5C-01C71AF24C8D} +DEFINE_GUID(IID_ID3D10EffectDepthStencilVariable, +0xaf482368, 0x330a, 0x46a5, 0x9a, 0x5c, 0x1, 0xc7, 0x1a, 0xf2, 0x4c, 0x8d); + +#undef INTERFACE +#define INTERFACE ID3D10EffectDepthStencilVariable + +DECLARE_INTERFACE_(ID3D10EffectDepthStencilVariable, ID3D10EffectVariable) +{ + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(GetDepthStencilState)(THIS_ UINT Index, ID3D10DepthStencilState **ppDepthStencilState) PURE; + STDMETHOD(GetBackingStore)(THIS_ UINT Index, D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectRasterizerVariable //////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectRasterizerVariable ID3D10EffectRasterizerVariable; +typedef interface ID3D10EffectRasterizerVariable *LPD3D10EFFECTRASTERIZERVARIABLE; + +// {21AF9F0E-4D94-4ea9-9785-2CB76B8C0B34} +DEFINE_GUID(IID_ID3D10EffectRasterizerVariable, +0x21af9f0e, 0x4d94, 0x4ea9, 0x97, 0x85, 0x2c, 0xb7, 0x6b, 0x8c, 0xb, 0x34); + +#undef INTERFACE +#define INTERFACE ID3D10EffectRasterizerVariable + +DECLARE_INTERFACE_(ID3D10EffectRasterizerVariable, ID3D10EffectVariable) +{ + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(GetRasterizerState)(THIS_ UINT Index, ID3D10RasterizerState **ppRasterizerState) PURE; + STDMETHOD(GetBackingStore)(THIS_ UINT Index, D3D10_RASTERIZER_DESC *pRasterizerDesc) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectSamplerVariable /////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectSamplerVariable ID3D10EffectSamplerVariable; +typedef interface ID3D10EffectSamplerVariable *LPD3D10EFFECTSAMPLERVARIABLE; + +// {6530D5C7-07E9-4271-A418-E7CE4BD1E480} +DEFINE_GUID(IID_ID3D10EffectSamplerVariable, +0x6530d5c7, 0x7e9, 0x4271, 0xa4, 0x18, 0xe7, 0xce, 0x4b, 0xd1, 0xe4, 0x80); + +#undef INTERFACE +#define INTERFACE ID3D10EffectSamplerVariable + +DECLARE_INTERFACE_(ID3D10EffectSamplerVariable, ID3D10EffectVariable) +{ + STDMETHOD_(ID3D10EffectType*, GetType)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetElement)(THIS_ UINT Index) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE; + + STDMETHOD_(ID3D10EffectScalarVariable*, AsScalar)(THIS) PURE; + STDMETHOD_(ID3D10EffectVectorVariable*, AsVector)(THIS) PURE; + STDMETHOD_(ID3D10EffectMatrixVariable*, AsMatrix)(THIS) PURE; + STDMETHOD_(ID3D10EffectStringVariable*, AsString)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE; + STDMETHOD_(ID3D10EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE; + STDMETHOD_(ID3D10EffectShaderVariable*, AsShader)(THIS) PURE; + STDMETHOD_(ID3D10EffectBlendVariable*, AsBlend)(THIS) PURE; + STDMETHOD_(ID3D10EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE; + STDMETHOD_(ID3D10EffectRasterizerVariable*, AsRasterizer)(THIS) PURE; + STDMETHOD_(ID3D10EffectSamplerVariable*, AsSampler)(THIS) PURE; + + STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE; + + STDMETHOD(GetSampler)(THIS_ UINT Index, ID3D10SamplerState **ppSampler) PURE; + STDMETHOD(GetBackingStore)(THIS_ UINT Index, D3D10_SAMPLER_DESC *pSamplerDesc) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectPass ////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3D10_PASS_DESC: +// +// Retrieved by ID3D10EffectPass::GetDesc() +//---------------------------------------------------------------------------- + +typedef struct _D3D10_PASS_DESC +{ + LPCSTR Name; // Name of this pass (NULL if not anonymous) + UINT Annotations; // Number of annotations on this pass + + BYTE *pIAInputSignature; // Signature from VS or GS (if there is no VS) + // or NULL if neither exists + SIZE_T IAInputSignatureSize; // Singature size in bytes + + UINT StencilRef; // Specified in SetDepthStencilState() + UINT SampleMask; // Specified in SetBlendState() + FLOAT BlendFactor[4]; // Specified in SetBlendState() +} D3D10_PASS_DESC; + +//---------------------------------------------------------------------------- +// D3D10_PASS_SHADER_DESC: +// +// Retrieved by ID3D10EffectPass::Get**ShaderDesc() +//---------------------------------------------------------------------------- + +typedef struct _D3D10_PASS_SHADER_DESC +{ + ID3D10EffectShaderVariable *pShaderVariable; // The variable that this shader came from. + // If this is an inline shader assignment, + // the returned interface will be an + // anonymous shader variable, which is + // not retrievable any other way. It's + // name in the variable description will + // be "$Anonymous". + // If there is no assignment of this type in + // the pass block, pShaderVariable != NULL, + // but pShaderVariable->IsValid() == FALSE. + + UINT ShaderIndex; // The element of pShaderVariable (if an array) + // or 0 if not applicable +} D3D10_PASS_SHADER_DESC; + +typedef interface ID3D10EffectPass ID3D10EffectPass; +typedef interface ID3D10EffectPass *LPD3D10EFFECTPASS; + +// {5CFBEB89-1A06-46e0-B282-E3F9BFA36A54} +DEFINE_GUID(IID_ID3D10EffectPass, +0x5cfbeb89, 0x1a06, 0x46e0, 0xb2, 0x82, 0xe3, 0xf9, 0xbf, 0xa3, 0x6a, 0x54); + +#undef INTERFACE +#define INTERFACE ID3D10EffectPass + +DECLARE_INTERFACE(ID3D10EffectPass) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_PASS_DESC *pDesc) PURE; + + STDMETHOD(GetVertexShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *pDesc) PURE; + STDMETHOD(GetGeometryShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *pDesc) PURE; + STDMETHOD(GetPixelShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD(Apply)(THIS_ UINT Flags) PURE; + + STDMETHOD(ComputeStateBlockMask)(THIS_ D3D10_STATE_BLOCK_MASK *pStateBlockMask) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectTechnique ///////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3D10_TECHNIQUE_DESC: +// +// Retrieved by ID3D10EffectTechnique::GetDesc() +//---------------------------------------------------------------------------- + +typedef struct _D3D10_TECHNIQUE_DESC +{ + LPCSTR Name; // Name of this technique (NULL if not anonymous) + UINT Passes; // Number of passes contained within + UINT Annotations; // Number of annotations on this technique +} D3D10_TECHNIQUE_DESC; + +typedef interface ID3D10EffectTechnique ID3D10EffectTechnique; +typedef interface ID3D10EffectTechnique *LPD3D10EFFECTTECHNIQUE; + +// {DB122CE8-D1C9-4292-B237-24ED3DE8B175} +DEFINE_GUID(IID_ID3D10EffectTechnique, +0xdb122ce8, 0xd1c9, 0x4292, 0xb2, 0x37, 0x24, 0xed, 0x3d, 0xe8, 0xb1, 0x75); + +#undef INTERFACE +#define INTERFACE ID3D10EffectTechnique + +DECLARE_INTERFACE(ID3D10EffectTechnique) +{ + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3D10_TECHNIQUE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectPass*, GetPassByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectPass*, GetPassByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD(ComputeStateBlockMask)(THIS_ D3D10_STATE_BLOCK_MASK *pStateBlockMask) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10Effect ////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3D10_EFFECT_DESC: +// +// Retrieved by ID3D10Effect::GetDesc() +//---------------------------------------------------------------------------- + +typedef struct _D3D10_EFFECT_DESC +{ + + BOOL IsChildEffect; // TRUE if this is a child effect, + // FALSE if this is standalone or an effect pool. + + UINT ConstantBuffers; // Number of constant buffers in this effect, + // excluding the effect pool. + UINT SharedConstantBuffers; // Number of constant buffers shared in this + // effect's pool. + + UINT GlobalVariables; // Number of global variables in this effect, + // excluding the effect pool. + UINT SharedGlobalVariables; // Number of global variables shared in this + // effect's pool. + + UINT Techniques; // Number of techniques in this effect, + // excluding the effect pool. +} D3D10_EFFECT_DESC; + +typedef interface ID3D10Effect ID3D10Effect; +typedef interface ID3D10Effect *LPD3D10EFFECT; + +// {51B0CA8B-EC0B-4519-870D-8EE1CB5017C7} +DEFINE_GUID(IID_ID3D10Effect, +0x51b0ca8b, 0xec0b, 0x4519, 0x87, 0xd, 0x8e, 0xe1, 0xcb, 0x50, 0x17, 0xc7); + +#undef INTERFACE +#define INTERFACE ID3D10Effect + +DECLARE_INTERFACE_(ID3D10Effect, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD_(BOOL, IsValid)(THIS) PURE; + STDMETHOD_(BOOL, IsPool)(THIS) PURE; + + // Managing D3D Device + STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE; + + // New Reflection APIs + STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10EffectConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD_(ID3D10EffectVariable*, GetVariableByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(ID3D10EffectVariable*, GetVariableBySemantic)(THIS_ LPCSTR Semantic) PURE; + + STDMETHOD_(ID3D10EffectTechnique*, GetTechniqueByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10EffectTechnique*, GetTechniqueByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD(Optimize)(THIS) PURE; + STDMETHOD_(BOOL, IsOptimized)(THIS) PURE; + +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3D10EffectPool ////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10EffectPool ID3D10EffectPool; +typedef interface ID3D10EffectPool *LPD3D10EFFECTPOOL; + +// {9537AB04-3250-412e-8213-FCD2F8677933} +DEFINE_GUID(IID_ID3D10EffectPool, +0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33); + +#undef INTERFACE +#define INTERFACE ID3D10EffectPool + +DECLARE_INTERFACE_(ID3D10EffectPool, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD_(ID3D10Effect*, AsEffect)(THIS) PURE; + + // No public methods +}; + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +//---------------------------------------------------------------------------- +// D3D10CreateEffectFromXXXX: +// -------------------------- +// Creates an effect from a binary effect or file +// +// Parameters: +// +// [in] +// +// +// pData +// Blob of effect data, either ASCII (uncompiled, for D3D10CompileEffectFromMemory) or binary (compiled, for D3D10CreateEffect*) +// DataLength +// Length of the data blob +// +// pSrcFileName +// Name of the ASCII Effect file pData was obtained from +// +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// HLSLFlags +// Compilation flags pertaining to shaders and data types, honored by +// the HLSL compiler +// FXFlags +// Compilation flags pertaining to Effect compilation, honored +// by the Effect compiler +// pDevice +// Pointer to the D3D10 device on which to create Effect resources +// pEffectPool +// Pointer to an Effect pool to share variables with or NULL +// +// [out] +// +// ppEffect +// Address of the newly created Effect interface +// ppEffectPool +// Address of the newly created Effect pool interface +// ppErrors +// If non-NULL, address of a buffer with error messages that occurred +// during parsing or compilation +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10CompileEffectFromMemory(void *pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, UINT HLSLFlags, UINT FXFlags, + ID3D10Blob **ppCompiledEffect, ID3D10Blob **ppErrors); + +HRESULT WINAPI D3D10CreateEffectFromMemory(void *pData, SIZE_T DataLength, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool *pEffectPool, ID3D10Effect **ppEffect); + +HRESULT WINAPI D3D10CreateEffectPoolFromMemory(void *pData, SIZE_T DataLength, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool **ppEffectPool); + + +//---------------------------------------------------------------------------- +// D3D10DisassembleEffect: +// ----------------------- +// Takes an effect interface, and returns a buffer containing text assembly. +// +// Parameters: +// pEffect +// Pointer to the runtime effect interface. +// EnableColorCode +// Emit HTML tags for color coding the output? +// ppDisassembly +// Returns a buffer containing the disassembled effect. +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10DisassembleEffect(ID3D10Effect *pEffect, BOOL EnableColorCode, ID3D10Blob **ppDisassembly); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3D10EFFECT_H__ + + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3D10shader.h b/Src/Decoder_H264_ALL/D3D/include/D3D10shader.h new file mode 100644 index 0000000..67b9e5d --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3D10shader.h @@ -0,0 +1,748 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3D10Shader.h +// Content: D3D10 Shader Types and APIs +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3D10SHADER_H__ +#define __D3D10SHADER_H__ + +#include "d3d10.h" + + +//--------------------------------------------------------------------------- +// D3D10_TX_VERSION: +// -------------- +// Version token used to create a procedural texture filler in effects +// Used by D3D10Fill[]TX functions +//--------------------------------------------------------------------------- +#define D3D10_TX_VERSION(_Major,_Minor) (('T' << 24) | ('X' << 16) | ((_Major) << 8) | (_Minor)) + + +//---------------------------------------------------------------------------- +// D3D10SHADER flags: +// ----------------- +// D3D10_SHADER_DEBUG +// Insert debug file/line/type/symbol information. +// +// D3D10_SHADER_SKIP_VALIDATION +// Do not validate the generated code against known capabilities and +// constraints. This option is only recommended when compiling shaders +// you KNOW will work. (ie. have compiled before without this option.) +// Shaders are always validated by D3D before they are set to the device. +// +// D3D10_SHADER_SKIP_OPTIMIZATION +// Instructs the compiler to skip optimization steps during code generation. +// Unless you are trying to isolate a problem in your code using this option +// is not recommended. +// +// D3D10_SHADER_PACK_MATRIX_ROW_MAJOR +// Unless explicitly specified, matrices will be packed in row-major order +// on input and output from the shader. +// +// D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR +// Unless explicitly specified, matrices will be packed in column-major +// order on input and output from the shader. This is generally more +// efficient, since it allows vector-matrix multiplication to be performed +// using a series of dot-products. +// +// D3D10_SHADER_PARTIAL_PRECISION +// Force all computations in resulting shader to occur at partial precision. +// This may result in faster evaluation of shaders on some hardware. +// +// D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT +// Force compiler to compile against the next highest available software +// target for vertex shaders. This flag also turns optimizations off, +// and debugging on. +// +// D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT +// Force compiler to compile against the next highest available software +// target for pixel shaders. This flag also turns optimizations off, +// and debugging on. +// +// D3D10_SHADER_NO_PRESHADER +// Disables Preshaders. Using this flag will cause the compiler to not +// pull out static expression for evaluation on the host cpu +// +// D3D10_SHADER_AVOID_FLOW_CONTROL +// Hint compiler to avoid flow-control constructs where possible. +// +// D3D10_SHADER_PREFER_FLOW_CONTROL +// Hint compiler to prefer flow-control constructs where possible. +// +// D3D10_SHADER_ENABLE_STRICTNESS +// By default, the HLSL/Effect compilers are not strict on deprecated syntax. +// Specifying this flag enables the strict mode. Deprecated syntax may be +// removed in a future release, and enabling syntax is a good way to make sure +// your shaders comply to the latest spec. +// +// D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY +// This enables older shaders to compile to 4_0 targets. +// +//---------------------------------------------------------------------------- + +#define D3D10_SHADER_DEBUG (1 << 0) +#define D3D10_SHADER_SKIP_VALIDATION (1 << 1) +#define D3D10_SHADER_SKIP_OPTIMIZATION (1 << 2) +#define D3D10_SHADER_PACK_MATRIX_ROW_MAJOR (1 << 3) +#define D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR (1 << 4) +#define D3D10_SHADER_PARTIAL_PRECISION (1 << 5) +#define D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT (1 << 6) +#define D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT (1 << 7) +#define D3D10_SHADER_NO_PRESHADER (1 << 8) +#define D3D10_SHADER_AVOID_FLOW_CONTROL (1 << 9) +#define D3D10_SHADER_PREFER_FLOW_CONTROL (1 << 10) +#define D3D10_SHADER_ENABLE_STRICTNESS (1 << 11) +#define D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12) +#define D3D10_SHADER_IEEE_STRICTNESS (1 << 13) +#define D3D10_SHADER_WARNINGS_ARE_ERRORS (1 << 18) + + +// optimization level flags +#define D3D10_SHADER_OPTIMIZATION_LEVEL0 (1 << 14) +#define D3D10_SHADER_OPTIMIZATION_LEVEL1 0 +#define D3D10_SHADER_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15)) +#define D3D10_SHADER_OPTIMIZATION_LEVEL3 (1 << 15) + + + + +//---------------------------------------------------------------------------- +// D3D10_SHADER_MACRO: +// ---------- +// Preprocessor macro definition. The application pass in a NULL-terminated +// array of this structure to various D3D10 APIs. This enables the application +// to #define tokens at runtime, before the file is parsed. +//---------------------------------------------------------------------------- + +typedef struct _D3D10_SHADER_MACRO +{ + LPCSTR Name; + LPCSTR Definition; + +} D3D10_SHADER_MACRO, *LPD3D10_SHADER_MACRO; + + +//---------------------------------------------------------------------------- +// D3D10_SHADER_VARIABLE_CLASS: +//---------------------------------------------------------------------------- + +typedef enum _D3D10_SHADER_VARIABLE_CLASS +{ + D3D10_SVC_SCALAR, + D3D10_SVC_VECTOR, + D3D10_SVC_MATRIX_ROWS, + D3D10_SVC_MATRIX_COLUMNS, + D3D10_SVC_OBJECT, + D3D10_SVC_STRUCT, + + D3D11_SVC_INTERFACE_CLASS, + D3D11_SVC_INTERFACE_POINTER, + + // force 32-bit size enum + D3D10_SVC_FORCE_DWORD = 0x7fffffff + +} D3D10_SHADER_VARIABLE_CLASS, *LPD3D10_SHADER_VARIABLE_CLASS; + +typedef enum _D3D10_SHADER_VARIABLE_FLAGS +{ + D3D10_SVF_USERPACKED = 1, + D3D10_SVF_USED = 2, + + D3D11_SVF_INTERFACE_POINTER = 4, + D3D11_SVF_INTERFACE_PARAMETER = 8, + + // force 32-bit size enum + D3D10_SVF_FORCE_DWORD = 0x7fffffff + +} D3D10_SHADER_VARIABLE_FLAGS, *LPD3D10_SHADER_VARIABLE_FLAGS; + +//---------------------------------------------------------------------------- +// D3D10_SHADER_VARIABLE_TYPE: +//---------------------------------------------------------------------------- +typedef enum _D3D10_SHADER_VARIABLE_TYPE +{ + D3D10_SVT_VOID = 0, + D3D10_SVT_BOOL = 1, + D3D10_SVT_INT = 2, + D3D10_SVT_FLOAT = 3, + D3D10_SVT_STRING = 4, + D3D10_SVT_TEXTURE = 5, + D3D10_SVT_TEXTURE1D = 6, + D3D10_SVT_TEXTURE2D = 7, + D3D10_SVT_TEXTURE3D = 8, + D3D10_SVT_TEXTURECUBE = 9, + D3D10_SVT_SAMPLER = 10, + D3D10_SVT_PIXELSHADER = 15, + D3D10_SVT_VERTEXSHADER = 16, + D3D10_SVT_UINT = 19, + D3D10_SVT_UINT8 = 20, + D3D10_SVT_GEOMETRYSHADER = 21, + D3D10_SVT_RASTERIZER = 22, + D3D10_SVT_DEPTHSTENCIL = 23, + D3D10_SVT_BLEND = 24, + D3D10_SVT_BUFFER = 25, + D3D10_SVT_CBUFFER = 26, + D3D10_SVT_TBUFFER = 27, + D3D10_SVT_TEXTURE1DARRAY = 28, + D3D10_SVT_TEXTURE2DARRAY = 29, + D3D10_SVT_RENDERTARGETVIEW = 30, + D3D10_SVT_DEPTHSTENCILVIEW = 31, + + D3D10_SVT_TEXTURE2DMS = 32, + D3D10_SVT_TEXTURE2DMSARRAY = 33, + + D3D10_SVT_TEXTURECUBEARRAY = 34, + + D3D11_SVT_HULLSHADER = 35, + D3D11_SVT_DOMAINSHADER = 36, + + D3D11_SVT_INTERFACE_POINTER = 37, + D3D11_SVT_COMPUTESHADER = 38, + + D3D11_SVT_DOUBLE = 39, + + D3D11_SVT_RWTEXTURE1D, + D3D11_SVT_RWTEXTURE1DARRAY, + D3D11_SVT_RWTEXTURE2D, + D3D11_SVT_RWTEXTURE2DARRAY, + D3D11_SVT_RWTEXTURE3D, + D3D11_SVT_RWBUFFER, + + D3D11_SVT_BYTEADDRESS_BUFFER, + D3D11_SVT_RWBYTEADDRESS_BUFFER, + D3D11_SVT_STRUCTURED_BUFFER, + D3D11_SVT_RWSTRUCTURED_BUFFER, + D3D11_SVT_APPEND_STRUCTURED_BUFFER, + D3D11_SVT_CONSUME_STRUCTURED_BUFFER, + + // force 32-bit size enum + D3D10_SVT_FORCE_DWORD = 0x7fffffff + +} D3D10_SHADER_VARIABLE_TYPE, *LPD3D10_SHADER_VARIABLE_TYPE; + +typedef enum _D3D10_SHADER_INPUT_FLAGS +{ + D3D10_SIF_USERPACKED = 1, + D3D10_SIF_COMPARISON_SAMPLER = 2, // is this a comparison sampler? + D3D10_SIF_TEXTURE_COMPONENT_0 = 4, // this 2-bit value encodes c - 1, where c + D3D10_SIF_TEXTURE_COMPONENT_1 = 8, // is the number of components in the texture + D3D10_SIF_TEXTURE_COMPONENTS = 12, + + // force 32-bit size enum + D3D10_SIF_FORCE_DWORD = 0x7fffffff +} D3D10_SHADER_INPUT_FLAGS, *LPD3D10_SHADER_INPUT_FLAGS; + +//---------------------------------------------------------------------------- +// D3D10_SHADER_INPUT_TYPE +//---------------------------------------------------------------------------- +typedef enum _D3D10_SHADER_INPUT_TYPE +{ + D3D10_SIT_CBUFFER, + D3D10_SIT_TBUFFER, + D3D10_SIT_TEXTURE, + D3D10_SIT_SAMPLER, + D3D11_SIT_UAV_RWTYPED, + D3D11_SIT_STRUCTURED, + D3D11_SIT_UAV_RWSTRUCTURED, + D3D11_SIT_BYTEADDRESS, + D3D11_SIT_UAV_RWBYTEADDRESS, + D3D11_SIT_UAV_APPEND_STRUCTURED, + D3D11_SIT_UAV_CONSUME_STRUCTURED, + D3D11_SIT_UAV_RWSTRUCTURED_WITH_COUNTER, +} D3D10_SHADER_INPUT_TYPE, *LPD3D10_SHADER_INPUT_TYPE; + +typedef enum _D3D10_SHADER_CBUFFER_FLAGS +{ + D3D10_CBF_USERPACKED = 1, + + // force 32-bit size enum + D3D10_CBF_FORCE_DWORD = 0x7fffffff +} D3D10_SHADER_CBUFFER_FLAGS, *LPD3D10_SHADER_CBUFFER_FLAGS; + +typedef enum _D3D10_CBUFFER_TYPE +{ + D3D10_CT_CBUFFER, + D3D10_CT_TBUFFER, +} D3D10_CBUFFER_TYPE, *LPD3D10_CBUFFER_TYPE; + +typedef enum D3D10_NAME +{ + D3D10_NAME_UNDEFINED = 0, + + // Names meaningful to both HLSL and hardware + D3D10_NAME_POSITION = 1, + D3D10_NAME_CLIP_DISTANCE = 2, + D3D10_NAME_CULL_DISTANCE = 3, + D3D10_NAME_RENDER_TARGET_ARRAY_INDEX = 4, + D3D10_NAME_VIEWPORT_ARRAY_INDEX = 5, + D3D10_NAME_VERTEX_ID = 6, + D3D10_NAME_PRIMITIVE_ID = 7, + D3D10_NAME_INSTANCE_ID = 8, + D3D10_NAME_IS_FRONT_FACE = 9, + D3D10_NAME_SAMPLE_INDEX = 10, + D3D11_NAME_FINAL_QUAD_EDGE_TESSFACTOR = 11, + D3D11_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = 12, + D3D11_NAME_FINAL_TRI_EDGE_TESSFACTOR = 13, + D3D11_NAME_FINAL_TRI_INSIDE_TESSFACTOR = 14, + D3D11_NAME_FINAL_LINE_DETAIL_TESSFACTOR = 15, + D3D11_NAME_FINAL_LINE_DENSITY_TESSFACTOR = 16, + + // Names meaningful to HLSL only + D3D10_NAME_TARGET = 64, + D3D10_NAME_DEPTH = 65, + D3D10_NAME_COVERAGE = 66, + D3D11_NAME_DEPTH_GREATER_EQUAL = 67, + D3D11_NAME_DEPTH_LESS_EQUAL = 68, + +} D3D10_NAME; + +typedef enum D3D10_RESOURCE_RETURN_TYPE +{ + D3D10_RETURN_TYPE_UNORM = 1, + D3D10_RETURN_TYPE_SNORM = 2, + D3D10_RETURN_TYPE_SINT = 3, + D3D10_RETURN_TYPE_UINT = 4, + D3D10_RETURN_TYPE_FLOAT = 5, + D3D10_RETURN_TYPE_MIXED = 6, +} D3D10_RESOURCE_RETURN_TYPE; + +typedef enum D3D10_REGISTER_COMPONENT_TYPE +{ + D3D10_REGISTER_COMPONENT_UNKNOWN = 0, + D3D10_REGISTER_COMPONENT_UINT32 = 1, + D3D10_REGISTER_COMPONENT_SINT32 = 2, + D3D10_REGISTER_COMPONENT_FLOAT32 = 3 +} D3D10_REGISTER_COMPONENT_TYPE; + + +//---------------------------------------------------------------------------- +// D3D10_INCLUDE_TYPE: +//---------------------------------------------------------------------------- + +typedef enum _D3D10_INCLUDE_TYPE +{ + D3D10_INCLUDE_LOCAL, + D3D10_INCLUDE_SYSTEM, + + // force 32-bit size enum + D3D10_INCLUDE_FORCE_DWORD = 0x7fffffff + +} D3D10_INCLUDE_TYPE, *LPD3D10_INCLUDE_TYPE; + + +//---------------------------------------------------------------------------- +// ID3D10Include: +// ------------- +// This interface is intended to be implemented by the application, and can +// be used by various D3D10 APIs. This enables application-specific handling +// of #include directives in source files. +// +// Open() +// Opens an include file. If successful, it should fill in ppData and +// pBytes. The data pointer returned must remain valid until Close is +// subsequently called. The name of the file is encoded in UTF-8 format. +// Close() +// Closes an include file. If Open was successful, Close is guaranteed +// to be called before the API using this interface returns. +//---------------------------------------------------------------------------- + +typedef interface ID3D10Include ID3D10Include; +typedef interface ID3D10Include *LPD3D10INCLUDE; + +#undef INTERFACE +#define INTERFACE ID3D10Include + +DECLARE_INTERFACE(ID3D10Include) +{ + STDMETHOD(Open)(THIS_ D3D10_INCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) PURE; + STDMETHOD(Close)(THIS_ LPCVOID pData) PURE; +}; + + +//---------------------------------------------------------------------------- +// ID3D10ShaderReflection: +//---------------------------------------------------------------------------- + +// +// Structure definitions +// + +typedef struct _D3D10_SHADER_DESC +{ + UINT Version; // Shader version + LPCSTR Creator; // Creator string + UINT Flags; // Shader compilation/parse flags + + UINT ConstantBuffers; // Number of constant buffers + UINT BoundResources; // Number of bound resources + UINT InputParameters; // Number of parameters in the input signature + UINT OutputParameters; // Number of parameters in the output signature + + UINT InstructionCount; // Number of emitted instructions + UINT TempRegisterCount; // Number of temporary registers used + UINT TempArrayCount; // Number of temporary arrays used + UINT DefCount; // Number of constant defines + UINT DclCount; // Number of declarations (input + output) + UINT TextureNormalInstructions; // Number of non-categorized texture instructions + UINT TextureLoadInstructions; // Number of texture load instructions + UINT TextureCompInstructions; // Number of texture comparison instructions + UINT TextureBiasInstructions; // Number of texture bias instructions + UINT TextureGradientInstructions; // Number of texture gradient instructions + UINT FloatInstructionCount; // Number of floating point arithmetic instructions used + UINT IntInstructionCount; // Number of signed integer arithmetic instructions used + UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used + UINT StaticFlowControlCount; // Number of static flow control instructions used + UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used + UINT MacroInstructionCount; // Number of macro instructions used + UINT ArrayInstructionCount; // Number of array instructions used + UINT CutInstructionCount; // Number of cut instructions used + UINT EmitInstructionCount; // Number of emit instructions used + D3D10_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology + UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count +} D3D10_SHADER_DESC; + +typedef struct _D3D10_SHADER_BUFFER_DESC +{ + LPCSTR Name; // Name of the constant buffer + D3D10_CBUFFER_TYPE Type; // Indicates that this is a CBuffer or TBuffer + UINT Variables; // Number of member variables + UINT Size; // Size of CB (in bytes) + UINT uFlags; // Buffer description flags +} D3D10_SHADER_BUFFER_DESC; + +typedef struct _D3D10_SHADER_VARIABLE_DESC +{ + LPCSTR Name; // Name of the variable + UINT StartOffset; // Offset in constant buffer's backing store + UINT Size; // Size of variable (in bytes) + UINT uFlags; // Variable flags + LPVOID DefaultValue; // Raw pointer to default value +} D3D10_SHADER_VARIABLE_DESC; + +typedef struct _D3D10_SHADER_TYPE_DESC +{ + D3D10_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.) + D3D10_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.) + UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable) + UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable) + UINT Elements; // Number of elements (0 if not an array) + UINT Members; // Number of members (0 if not a structure) + UINT Offset; // Offset from the start of structure (0 if not a structure member) +} D3D10_SHADER_TYPE_DESC; + +typedef struct _D3D10_SHADER_INPUT_BIND_DESC +{ + LPCSTR Name; // Name of the resource + D3D10_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.) + UINT BindPoint; // Starting bind point + UINT BindCount; // Number of contiguous bind points (for arrays) + + UINT uFlags; // Input binding flags + D3D10_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture) + D3D10_SRV_DIMENSION Dimension; // Dimension (if texture) + UINT NumSamples; // Number of samples (0 if not MS texture) +} D3D10_SHADER_INPUT_BIND_DESC; + +typedef struct _D3D10_SIGNATURE_PARAMETER_DESC +{ + LPCSTR SemanticName; // Name of the semantic + UINT SemanticIndex; // Index of the semantic + UINT Register; // Number of member variables + D3D10_NAME SystemValueType;// A predefined system value, or D3D10_NAME_UNDEFINED if not applicable + D3D10_REGISTER_COMPONENT_TYPE ComponentType;// Scalar type (e.g. uint, float, etc.) + BYTE Mask; // Mask to indicate which components of the register + // are used (combination of D3D10_COMPONENT_MASK values) + BYTE ReadWriteMask; // Mask to indicate whether a given component is + // never written (if this is an output signature) or + // always read (if this is an input signature). + // (combination of D3D10_COMPONENT_MASK values) + +} D3D10_SIGNATURE_PARAMETER_DESC; + + +// +// Interface definitions +// + +typedef interface ID3D10ShaderReflectionType ID3D10ShaderReflectionType; +typedef interface ID3D10ShaderReflectionType *LPD3D10SHADERREFLECTIONTYPE; + +// {C530AD7D-9B16-4395-A979-BA2ECFF83ADD} +DEFINE_GUID(IID_ID3D10ShaderReflectionType, +0xc530ad7d, 0x9b16, 0x4395, 0xa9, 0x79, 0xba, 0x2e, 0xcf, 0xf8, 0x3a, 0xdd); + +#undef INTERFACE +#define INTERFACE ID3D10ShaderReflectionType + +DECLARE_INTERFACE(ID3D10ShaderReflectionType) +{ + STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_TYPE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10ShaderReflectionType*, GetMemberTypeByName)(THIS_ LPCSTR Name) PURE; + STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ UINT Index) PURE; +}; + +typedef interface ID3D10ShaderReflectionVariable ID3D10ShaderReflectionVariable; +typedef interface ID3D10ShaderReflectionVariable *LPD3D10SHADERREFLECTIONVARIABLE; + +// {1BF63C95-2650-405d-99C1-3636BD1DA0A1} +DEFINE_GUID(IID_ID3D10ShaderReflectionVariable, +0x1bf63c95, 0x2650, 0x405d, 0x99, 0xc1, 0x36, 0x36, 0xbd, 0x1d, 0xa0, 0xa1); + +#undef INTERFACE +#define INTERFACE ID3D10ShaderReflectionVariable + +DECLARE_INTERFACE(ID3D10ShaderReflectionVariable) +{ + STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10ShaderReflectionType*, GetType)(THIS) PURE; +}; + +typedef interface ID3D10ShaderReflectionConstantBuffer ID3D10ShaderReflectionConstantBuffer; +typedef interface ID3D10ShaderReflectionConstantBuffer *LPD3D10SHADERREFLECTIONCONSTANTBUFFER; + +// {66C66A94-DDDD-4b62-A66A-F0DA33C2B4D0} +DEFINE_GUID(IID_ID3D10ShaderReflectionConstantBuffer, +0x66c66a94, 0xdddd, 0x4b62, 0xa6, 0x6a, 0xf0, 0xda, 0x33, 0xc2, 0xb4, 0xd0); + +#undef INTERFACE +#define INTERFACE ID3D10ShaderReflectionConstantBuffer + +DECLARE_INTERFACE(ID3D10ShaderReflectionConstantBuffer) +{ + STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_BUFFER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE; +}; + +typedef interface ID3D10ShaderReflection ID3D10ShaderReflection; +typedef interface ID3D10ShaderReflection *LPD3D10SHADERREFLECTION; + +// {D40E20B6-F8F7-42ad-AB20-4BAF8F15DFAA} +DEFINE_GUID(IID_ID3D10ShaderReflection, +0xd40e20b6, 0xf8f7, 0x42ad, 0xab, 0x20, 0x4b, 0xaf, 0x8f, 0x15, 0xdf, 0xaa); + +#undef INTERFACE +#define INTERFACE ID3D10ShaderReflection + +DECLARE_INTERFACE_(ID3D10ShaderReflection, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE; + STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE; + + STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + +}; + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +//---------------------------------------------------------------------------- +// D3D10CompileShader: +// ------------------ +// Compiles a shader. +// +// Parameters: +// pSrcFile +// Source file name. +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module. +// pSrcData +// Pointer to source code. +// SrcDataLen +// Size of source code, in bytes. +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// pFunctionName +// Name of the entrypoint function where execution should begin. +// pProfile +// Instruction set to be used when generating code. The D3D10 entry +// point currently supports only "vs_4_0", "ps_4_0", and "gs_4_0". +// Flags +// See D3D10_SHADER_xxx flags. +// ppShader +// Returns a buffer containing the created shader. This buffer contains +// the compiled shader code, as well as any embedded debug and symbol +// table info. (See D3D10GetShaderConstantTable) +// ppErrorMsgs +// Returns a buffer containing a listing of errors and warnings that were +// encountered during the compile. If you are running in a debugger, +// these are the same messages you will see in your debug output. +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10CompileShader(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs); + +//---------------------------------------------------------------------------- +// D3D10DisassembleShader: +// ---------------------- +// Takes a binary shader, and returns a buffer containing text assembly. +// +// Parameters: +// pShader +// Pointer to the shader byte code. +// BytecodeLength +// Size of the shader byte code in bytes. +// EnableColorCode +// Emit HTML tags for color coding the output? +// pComments +// Pointer to a comment string to include at the top of the shader. +// ppDisassembly +// Returns a buffer containing the disassembled shader. +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10DisassembleShader(CONST void *pShader, SIZE_T BytecodeLength, BOOL EnableColorCode, LPCSTR pComments, ID3D10Blob** ppDisassembly); + + +//---------------------------------------------------------------------------- +// D3D10GetPixelShaderProfile/D3D10GetVertexShaderProfile/D3D10GetGeometryShaderProfile: +// ----------------------------------------------------- +// Returns the name of the HLSL profile best suited to a given device. +// +// Parameters: +// pDevice +// Pointer to the device in question +//---------------------------------------------------------------------------- + +LPCSTR WINAPI D3D10GetPixelShaderProfile(ID3D10Device *pDevice); + +LPCSTR WINAPI D3D10GetVertexShaderProfile(ID3D10Device *pDevice); + +LPCSTR WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *pDevice); + +//---------------------------------------------------------------------------- +// D3D10ReflectShader: +// ------------------ +// Creates a shader reflection object that can be used to retrieve information +// about a compiled shader +// +// Parameters: +// pShaderBytecode +// Pointer to a compiled shader (same pointer that is passed into +// ID3D10Device::CreateShader) +// BytecodeLength +// Length of the shader bytecode buffer +// ppReflector +// [out] Returns a ID3D10ShaderReflection object that can be used to +// retrieve shader resource and constant buffer information +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10ReflectShader(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10ShaderReflection **ppReflector); + +//---------------------------------------------------------------------------- +// D3D10PreprocessShader +// --------------------- +// Creates a shader reflection object that can be used to retrieve information +// about a compiled shader +// +// Parameters: +// pSrcData +// Pointer to source code +// SrcDataLen +// Size of source code, in bytes +// pFileName +// Source file name (used for error output) +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when assembling +// from file, and will error when assembling from resource or memory. +// ppShaderText +// Returns a buffer containing a single large string that represents +// the resulting formatted token stream +// ppErrorMsgs +// Returns a buffer containing a listing of errors and warnings that were +// encountered during assembly. If you are running in a debugger, +// these are the same messages you will see in your debug output. +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10PreprocessShader(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs); + +////////////////////////////////////////////////////////////////////////// +// +// Shader blob manipulation routines +// --------------------------------- +// +// void *pShaderBytecode - a buffer containing the result of an HLSL +// compilation. Typically this opaque buffer contains several +// discrete sections including the shader executable code, the input +// signature, and the output signature. This can typically be retrieved +// by calling ID3D10Blob::GetBufferPointer() on the returned blob +// from HLSL's compile APIs. +// +// UINT BytecodeLength - the length of pShaderBytecode. This can +// typically be retrieved by calling ID3D10Blob::GetBufferSize() +// on the returned blob from HLSL's compile APIs. +// +// ID3D10Blob **ppSignatureBlob(s) - a newly created buffer that +// contains only the signature portions of the original bytecode. +// This is a copy; the original bytecode is not modified. You may +// specify NULL for this parameter to have the bytecode validated +// for the presence of the corresponding signatures without actually +// copying them and creating a new blob. +// +// Returns E_INVALIDARG if any required parameters are NULL +// Returns E_FAIL is the bytecode is corrupt or missing signatures +// Returns S_OK on success +// +////////////////////////////////////////////////////////////////////////// + +HRESULT WINAPI D3D10GetInputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob); +HRESULT WINAPI D3D10GetOutputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob); +HRESULT WINAPI D3D10GetInputAndOutputSignatureBlob(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob **ppSignatureBlob); + +//---------------------------------------------------------------------------- +// D3D10GetShaderDebugInfo: +// ----------------------- +// Gets shader debug info. Debug info is generated by D3D10CompileShader and is +// embedded in the body of the shader. +// +// Parameters: +// pShaderBytecode +// Pointer to the function bytecode +// BytecodeLength +// Length of the shader bytecode buffer +// ppDebugInfo +// Buffer used to return debug info. For information about the layout +// of this buffer, see definition of D3D10_SHADER_DEBUG_INFO above. +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3D10GetShaderDebugInfo(CONST void *pShaderBytecode, SIZE_T BytecodeLength, ID3D10Blob** ppDebugInfo); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3D10SHADER_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3D11.h b/Src/Decoder_H264_ALL/D3D/include/D3D11.h new file mode 100644 index 0000000..1d853c8 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3D11.h @@ -0,0 +1,10333 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * + *-------------------------------------------------------------------------------------*/ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0555 */ +/* Compiler settings for d3d11.idl: + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 7.00.0555 + protocol : all , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d11_h__ +#define __d3d11_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ID3D11DeviceChild_FWD_DEFINED__ +#define __ID3D11DeviceChild_FWD_DEFINED__ +typedef interface ID3D11DeviceChild ID3D11DeviceChild; +#endif /* __ID3D11DeviceChild_FWD_DEFINED__ */ + + +#ifndef __ID3D11DepthStencilState_FWD_DEFINED__ +#define __ID3D11DepthStencilState_FWD_DEFINED__ +typedef interface ID3D11DepthStencilState ID3D11DepthStencilState; +#endif /* __ID3D11DepthStencilState_FWD_DEFINED__ */ + + +#ifndef __ID3D11BlendState_FWD_DEFINED__ +#define __ID3D11BlendState_FWD_DEFINED__ +typedef interface ID3D11BlendState ID3D11BlendState; +#endif /* __ID3D11BlendState_FWD_DEFINED__ */ + + +#ifndef __ID3D11RasterizerState_FWD_DEFINED__ +#define __ID3D11RasterizerState_FWD_DEFINED__ +typedef interface ID3D11RasterizerState ID3D11RasterizerState; +#endif /* __ID3D11RasterizerState_FWD_DEFINED__ */ + + +#ifndef __ID3D11Resource_FWD_DEFINED__ +#define __ID3D11Resource_FWD_DEFINED__ +typedef interface ID3D11Resource ID3D11Resource; +#endif /* __ID3D11Resource_FWD_DEFINED__ */ + + +#ifndef __ID3D11Buffer_FWD_DEFINED__ +#define __ID3D11Buffer_FWD_DEFINED__ +typedef interface ID3D11Buffer ID3D11Buffer; +#endif /* __ID3D11Buffer_FWD_DEFINED__ */ + + +#ifndef __ID3D11Texture1D_FWD_DEFINED__ +#define __ID3D11Texture1D_FWD_DEFINED__ +typedef interface ID3D11Texture1D ID3D11Texture1D; +#endif /* __ID3D11Texture1D_FWD_DEFINED__ */ + + +#ifndef __ID3D11Texture2D_FWD_DEFINED__ +#define __ID3D11Texture2D_FWD_DEFINED__ +typedef interface ID3D11Texture2D ID3D11Texture2D; +#endif /* __ID3D11Texture2D_FWD_DEFINED__ */ + + +#ifndef __ID3D11Texture3D_FWD_DEFINED__ +#define __ID3D11Texture3D_FWD_DEFINED__ +typedef interface ID3D11Texture3D ID3D11Texture3D; +#endif /* __ID3D11Texture3D_FWD_DEFINED__ */ + + +#ifndef __ID3D11View_FWD_DEFINED__ +#define __ID3D11View_FWD_DEFINED__ +typedef interface ID3D11View ID3D11View; +#endif /* __ID3D11View_FWD_DEFINED__ */ + + +#ifndef __ID3D11ShaderResourceView_FWD_DEFINED__ +#define __ID3D11ShaderResourceView_FWD_DEFINED__ +typedef interface ID3D11ShaderResourceView ID3D11ShaderResourceView; +#endif /* __ID3D11ShaderResourceView_FWD_DEFINED__ */ + + +#ifndef __ID3D11RenderTargetView_FWD_DEFINED__ +#define __ID3D11RenderTargetView_FWD_DEFINED__ +typedef interface ID3D11RenderTargetView ID3D11RenderTargetView; +#endif /* __ID3D11RenderTargetView_FWD_DEFINED__ */ + + +#ifndef __ID3D11DepthStencilView_FWD_DEFINED__ +#define __ID3D11DepthStencilView_FWD_DEFINED__ +typedef interface ID3D11DepthStencilView ID3D11DepthStencilView; +#endif /* __ID3D11DepthStencilView_FWD_DEFINED__ */ + + +#ifndef __ID3D11UnorderedAccessView_FWD_DEFINED__ +#define __ID3D11UnorderedAccessView_FWD_DEFINED__ +typedef interface ID3D11UnorderedAccessView ID3D11UnorderedAccessView; +#endif /* __ID3D11UnorderedAccessView_FWD_DEFINED__ */ + + +#ifndef __ID3D11VertexShader_FWD_DEFINED__ +#define __ID3D11VertexShader_FWD_DEFINED__ +typedef interface ID3D11VertexShader ID3D11VertexShader; +#endif /* __ID3D11VertexShader_FWD_DEFINED__ */ + + +#ifndef __ID3D11HullShader_FWD_DEFINED__ +#define __ID3D11HullShader_FWD_DEFINED__ +typedef interface ID3D11HullShader ID3D11HullShader; +#endif /* __ID3D11HullShader_FWD_DEFINED__ */ + + +#ifndef __ID3D11DomainShader_FWD_DEFINED__ +#define __ID3D11DomainShader_FWD_DEFINED__ +typedef interface ID3D11DomainShader ID3D11DomainShader; +#endif /* __ID3D11DomainShader_FWD_DEFINED__ */ + + +#ifndef __ID3D11GeometryShader_FWD_DEFINED__ +#define __ID3D11GeometryShader_FWD_DEFINED__ +typedef interface ID3D11GeometryShader ID3D11GeometryShader; +#endif /* __ID3D11GeometryShader_FWD_DEFINED__ */ + + +#ifndef __ID3D11PixelShader_FWD_DEFINED__ +#define __ID3D11PixelShader_FWD_DEFINED__ +typedef interface ID3D11PixelShader ID3D11PixelShader; +#endif /* __ID3D11PixelShader_FWD_DEFINED__ */ + + +#ifndef __ID3D11ComputeShader_FWD_DEFINED__ +#define __ID3D11ComputeShader_FWD_DEFINED__ +typedef interface ID3D11ComputeShader ID3D11ComputeShader; +#endif /* __ID3D11ComputeShader_FWD_DEFINED__ */ + + +#ifndef __ID3D11InputLayout_FWD_DEFINED__ +#define __ID3D11InputLayout_FWD_DEFINED__ +typedef interface ID3D11InputLayout ID3D11InputLayout; +#endif /* __ID3D11InputLayout_FWD_DEFINED__ */ + + +#ifndef __ID3D11SamplerState_FWD_DEFINED__ +#define __ID3D11SamplerState_FWD_DEFINED__ +typedef interface ID3D11SamplerState ID3D11SamplerState; +#endif /* __ID3D11SamplerState_FWD_DEFINED__ */ + + +#ifndef __ID3D11Asynchronous_FWD_DEFINED__ +#define __ID3D11Asynchronous_FWD_DEFINED__ +typedef interface ID3D11Asynchronous ID3D11Asynchronous; +#endif /* __ID3D11Asynchronous_FWD_DEFINED__ */ + + +#ifndef __ID3D11Query_FWD_DEFINED__ +#define __ID3D11Query_FWD_DEFINED__ +typedef interface ID3D11Query ID3D11Query; +#endif /* __ID3D11Query_FWD_DEFINED__ */ + + +#ifndef __ID3D11Predicate_FWD_DEFINED__ +#define __ID3D11Predicate_FWD_DEFINED__ +typedef interface ID3D11Predicate ID3D11Predicate; +#endif /* __ID3D11Predicate_FWD_DEFINED__ */ + + +#ifndef __ID3D11Counter_FWD_DEFINED__ +#define __ID3D11Counter_FWD_DEFINED__ +typedef interface ID3D11Counter ID3D11Counter; +#endif /* __ID3D11Counter_FWD_DEFINED__ */ + + +#ifndef __ID3D11ClassInstance_FWD_DEFINED__ +#define __ID3D11ClassInstance_FWD_DEFINED__ +typedef interface ID3D11ClassInstance ID3D11ClassInstance; +#endif /* __ID3D11ClassInstance_FWD_DEFINED__ */ + + +#ifndef __ID3D11ClassLinkage_FWD_DEFINED__ +#define __ID3D11ClassLinkage_FWD_DEFINED__ +typedef interface ID3D11ClassLinkage ID3D11ClassLinkage; +#endif /* __ID3D11ClassLinkage_FWD_DEFINED__ */ + + +#ifndef __ID3D11CommandList_FWD_DEFINED__ +#define __ID3D11CommandList_FWD_DEFINED__ +typedef interface ID3D11CommandList ID3D11CommandList; +#endif /* __ID3D11CommandList_FWD_DEFINED__ */ + + +#ifndef __ID3D11DeviceContext_FWD_DEFINED__ +#define __ID3D11DeviceContext_FWD_DEFINED__ +typedef interface ID3D11DeviceContext ID3D11DeviceContext; +#endif /* __ID3D11DeviceContext_FWD_DEFINED__ */ + + +#ifndef __ID3D11Device_FWD_DEFINED__ +#define __ID3D11Device_FWD_DEFINED__ +typedef interface ID3D11Device ID3D11Device; +#endif /* __ID3D11Device_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "dxgi.h" +#include "d3dcommon.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d11_0000_0000 */ +/* [local] */ + +#ifndef _D3D11_CONSTANTS +#define _D3D11_CONSTANTS +#define D3D11_16BIT_INDEX_STRIP_CUT_VALUE ( 0xffff ) + +#define D3D11_32BIT_INDEX_STRIP_CUT_VALUE ( 0xffffffff ) + +#define D3D11_8BIT_INDEX_STRIP_CUT_VALUE ( 0xff ) + +#define D3D11_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT ( 9 ) + +#define D3D11_CLIP_OR_CULL_DISTANCE_COUNT ( 8 ) + +#define D3D11_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT ( 2 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT ( 14 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS ( 4 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT ( 15 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT ( 15 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D11_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT ( 64 ) + +#define D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT ( 1 ) + +#define D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT ( 128 ) + +#define D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST ( 1 ) + +#define D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT ( 128 ) + +#define D3D11_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_COMMONSHADER_SAMPLER_REGISTER_COUNT ( 16 ) + +#define D3D11_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D11_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT ( 16 ) + +#define D3D11_COMMONSHADER_SUBROUTINE_NESTING_LIMIT ( 32 ) + +#define D3D11_COMMONSHADER_TEMP_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_COMMONSHADER_TEMP_REGISTER_COUNT ( 4096 ) + +#define D3D11_COMMONSHADER_TEMP_REGISTER_READS_PER_INST ( 3 ) + +#define D3D11_COMMONSHADER_TEMP_REGISTER_READ_PORTS ( 3 ) + +#define D3D11_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX ( 10 ) + +#define D3D11_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN ( -10 ) + +#define D3D11_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE ( -8 ) + +#define D3D11_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE ( 7 ) + +#define D3D11_CS_4_X_BUCKET00_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 256 ) + +#define D3D11_CS_4_X_BUCKET00_MAX_NUM_THREADS_PER_GROUP ( 64 ) + +#define D3D11_CS_4_X_BUCKET01_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 240 ) + +#define D3D11_CS_4_X_BUCKET01_MAX_NUM_THREADS_PER_GROUP ( 68 ) + +#define D3D11_CS_4_X_BUCKET02_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 224 ) + +#define D3D11_CS_4_X_BUCKET02_MAX_NUM_THREADS_PER_GROUP ( 72 ) + +#define D3D11_CS_4_X_BUCKET03_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 208 ) + +#define D3D11_CS_4_X_BUCKET03_MAX_NUM_THREADS_PER_GROUP ( 76 ) + +#define D3D11_CS_4_X_BUCKET04_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 192 ) + +#define D3D11_CS_4_X_BUCKET04_MAX_NUM_THREADS_PER_GROUP ( 84 ) + +#define D3D11_CS_4_X_BUCKET05_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 176 ) + +#define D3D11_CS_4_X_BUCKET05_MAX_NUM_THREADS_PER_GROUP ( 92 ) + +#define D3D11_CS_4_X_BUCKET06_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 160 ) + +#define D3D11_CS_4_X_BUCKET06_MAX_NUM_THREADS_PER_GROUP ( 100 ) + +#define D3D11_CS_4_X_BUCKET07_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 144 ) + +#define D3D11_CS_4_X_BUCKET07_MAX_NUM_THREADS_PER_GROUP ( 112 ) + +#define D3D11_CS_4_X_BUCKET08_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 128 ) + +#define D3D11_CS_4_X_BUCKET08_MAX_NUM_THREADS_PER_GROUP ( 128 ) + +#define D3D11_CS_4_X_BUCKET09_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 112 ) + +#define D3D11_CS_4_X_BUCKET09_MAX_NUM_THREADS_PER_GROUP ( 144 ) + +#define D3D11_CS_4_X_BUCKET10_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 96 ) + +#define D3D11_CS_4_X_BUCKET10_MAX_NUM_THREADS_PER_GROUP ( 168 ) + +#define D3D11_CS_4_X_BUCKET11_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 80 ) + +#define D3D11_CS_4_X_BUCKET11_MAX_NUM_THREADS_PER_GROUP ( 204 ) + +#define D3D11_CS_4_X_BUCKET12_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 64 ) + +#define D3D11_CS_4_X_BUCKET12_MAX_NUM_THREADS_PER_GROUP ( 256 ) + +#define D3D11_CS_4_X_BUCKET13_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 48 ) + +#define D3D11_CS_4_X_BUCKET13_MAX_NUM_THREADS_PER_GROUP ( 340 ) + +#define D3D11_CS_4_X_BUCKET14_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 32 ) + +#define D3D11_CS_4_X_BUCKET14_MAX_NUM_THREADS_PER_GROUP ( 512 ) + +#define D3D11_CS_4_X_BUCKET15_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 16 ) + +#define D3D11_CS_4_X_BUCKET15_MAX_NUM_THREADS_PER_GROUP ( 768 ) + +#define D3D11_CS_4_X_DISPATCH_MAX_THREAD_GROUPS_IN_Z_DIMENSION ( 1 ) + +#define D3D11_CS_4_X_RAW_UAV_BYTE_ALIGNMENT ( 256 ) + +#define D3D11_CS_4_X_THREAD_GROUP_MAX_THREADS_PER_GROUP ( 768 ) + +#define D3D11_CS_4_X_THREAD_GROUP_MAX_X ( 768 ) + +#define D3D11_CS_4_X_THREAD_GROUP_MAX_Y ( 768 ) + +#define D3D11_CS_4_X_UAV_REGISTER_COUNT ( 1 ) + +#define D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION ( 65535 ) + +#define D3D11_CS_TGSM_REGISTER_COUNT ( 8192 ) + +#define D3D11_CS_TGSM_REGISTER_READS_PER_INST ( 1 ) + +#define D3D11_CS_TGSM_RESOURCE_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_CS_TGSM_RESOURCE_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_CS_THREAD_GROUP_MAX_THREADS_PER_GROUP ( 1024 ) + +#define D3D11_CS_THREAD_GROUP_MAX_X ( 1024 ) + +#define D3D11_CS_THREAD_GROUP_MAX_Y ( 1024 ) + +#define D3D11_CS_THREAD_GROUP_MAX_Z ( 64 ) + +#define D3D11_CS_THREAD_GROUP_MIN_X ( 1 ) + +#define D3D11_CS_THREAD_GROUP_MIN_Y ( 1 ) + +#define D3D11_CS_THREAD_GROUP_MIN_Z ( 1 ) + +#define D3D11_CS_THREAD_LOCAL_TEMP_REGISTER_POOL ( 16384 ) + +#define D3D11_DEFAULT_BLEND_FACTOR_ALPHA ( 1.0f ) +#define D3D11_DEFAULT_BLEND_FACTOR_BLUE ( 1.0f ) +#define D3D11_DEFAULT_BLEND_FACTOR_GREEN ( 1.0f ) +#define D3D11_DEFAULT_BLEND_FACTOR_RED ( 1.0f ) +#define D3D11_DEFAULT_BORDER_COLOR_COMPONENT ( 0.0f ) +#define D3D11_DEFAULT_DEPTH_BIAS ( 0 ) + +#define D3D11_DEFAULT_DEPTH_BIAS_CLAMP ( 0.0f ) +#define D3D11_DEFAULT_MAX_ANISOTROPY ( 16 ) +#define D3D11_DEFAULT_MIP_LOD_BIAS ( 0.0f ) +#define D3D11_DEFAULT_RENDER_TARGET_ARRAY_INDEX ( 0 ) + +#define D3D11_DEFAULT_SAMPLE_MASK ( 0xffffffff ) + +#define D3D11_DEFAULT_SCISSOR_ENDX ( 0 ) + +#define D3D11_DEFAULT_SCISSOR_ENDY ( 0 ) + +#define D3D11_DEFAULT_SCISSOR_STARTX ( 0 ) + +#define D3D11_DEFAULT_SCISSOR_STARTY ( 0 ) + +#define D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS ( 0.0f ) +#define D3D11_DEFAULT_STENCIL_READ_MASK ( 0xff ) + +#define D3D11_DEFAULT_STENCIL_REFERENCE ( 0 ) + +#define D3D11_DEFAULT_STENCIL_WRITE_MASK ( 0xff ) + +#define D3D11_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX ( 0 ) + +#define D3D11_DEFAULT_VIEWPORT_HEIGHT ( 0 ) + +#define D3D11_DEFAULT_VIEWPORT_MAX_DEPTH ( 0.0f ) +#define D3D11_DEFAULT_VIEWPORT_MIN_DEPTH ( 0.0f ) +#define D3D11_DEFAULT_VIEWPORT_TOPLEFTX ( 0 ) + +#define D3D11_DEFAULT_VIEWPORT_TOPLEFTY ( 0 ) + +#define D3D11_DEFAULT_VIEWPORT_WIDTH ( 0 ) + +#define D3D11_DS_INPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS ( 3968 ) + +#define D3D11_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_DS_INPUT_CONTROL_POINT_REGISTER_COUNT ( 32 ) + +#define D3D11_DS_INPUT_CONTROL_POINT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_DS_INPUT_CONTROL_POINT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENTS ( 3 ) + +#define D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_COUNT ( 1 ) + +#define D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_DS_INPUT_DOMAIN_POINT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_COUNT ( 32 ) + +#define D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_DS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_DS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_DS_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_FLOAT16_FUSED_TOLERANCE_IN_ULP ( 0.6 ) +#define D3D11_FLOAT32_MAX ( 3.402823466e+38f ) +#define D3D11_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP ( 0.6f ) +#define D3D11_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR ( 2.4f ) +#define D3D11_FLOAT_TO_SRGB_EXPONENT_NUMERATOR ( 1.0f ) +#define D3D11_FLOAT_TO_SRGB_OFFSET ( 0.055f ) +#define D3D11_FLOAT_TO_SRGB_SCALE_1 ( 12.92f ) +#define D3D11_FLOAT_TO_SRGB_SCALE_2 ( 1.055f ) +#define D3D11_FLOAT_TO_SRGB_THRESHOLD ( 0.0031308f ) +#define D3D11_FTOI_INSTRUCTION_MAX_INPUT ( 2147483647.999f ) +#define D3D11_FTOI_INSTRUCTION_MIN_INPUT ( -2147483648.999f ) +#define D3D11_FTOU_INSTRUCTION_MAX_INPUT ( 4294967295.999f ) +#define D3D11_FTOU_INSTRUCTION_MIN_INPUT ( 0.0f ) +#define D3D11_GS_INPUT_INSTANCE_ID_READS_PER_INST ( 2 ) + +#define D3D11_GS_INPUT_INSTANCE_ID_READ_PORTS ( 1 ) + +#define D3D11_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_GS_INPUT_INSTANCE_ID_REGISTER_COUNT ( 1 ) + +#define D3D11_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_GS_INPUT_PRIM_CONST_REGISTER_COUNT ( 1 ) + +#define D3D11_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_GS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_GS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_GS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_GS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_GS_INPUT_REGISTER_VERTICES ( 32 ) + +#define D3D11_GS_MAX_INSTANCE_COUNT ( 32 ) + +#define D3D11_GS_MAX_OUTPUT_VERTEX_COUNT_ACROSS_INSTANCES ( 1024 ) + +#define D3D11_GS_OUTPUT_ELEMENTS ( 32 ) + +#define D3D11_GS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_GS_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_HS_CONTROL_POINT_PHASE_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_HS_CONTROL_POINT_PHASE_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_HS_CONTROL_POINT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_HS_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_HS_CONTROL_POINT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_HS_CONTROL_POINT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_HS_FORK_PHASE_INSTANCE_COUNT_UPPER_BOUND ( 0xffffffff ) + +#define D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COUNT ( 1 ) + +#define D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COUNT ( 1 ) + +#define D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_COUNT ( 1 ) + +#define D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_HS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_HS_JOIN_PHASE_INSTANCE_COUNT_UPPER_BOUND ( 0xffffffff ) + +#define D3D11_HS_MAXTESSFACTOR_LOWER_BOUND ( 1.0f ) +#define D3D11_HS_MAXTESSFACTOR_UPPER_BOUND ( 64.0f ) +#define D3D11_HS_OUTPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS ( 3968 ) + +#define D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COUNT ( 1 ) + +#define D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COUNT ( 32 ) + +#define D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES ( 0 ) + +#define D3D11_IA_DEFAULT_PRIMITIVE_TOPOLOGY ( 0 ) + +#define D3D11_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES ( 0 ) + +#define D3D11_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT ( 1 ) + +#define D3D11_IA_INSTANCE_ID_BIT_COUNT ( 32 ) + +#define D3D11_IA_INTEGER_ARITHMETIC_BIT_COUNT ( 32 ) + +#define D3D11_IA_PATCH_MAX_CONTROL_POINT_COUNT ( 32 ) + +#define D3D11_IA_PRIMITIVE_ID_BIT_COUNT ( 32 ) + +#define D3D11_IA_VERTEX_ID_BIT_COUNT ( 32 ) + +#define D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT ( 32 ) + +#define D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS ( 128 ) + +#define D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ( 32 ) + +#define D3D11_INTEGER_DIVIDE_BY_ZERO_QUOTIENT ( 0xffffffff ) + +#define D3D11_INTEGER_DIVIDE_BY_ZERO_REMAINDER ( 0xffffffff ) + +#define D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL ( 0xffffffff ) + +#define D3D11_KEEP_UNORDERED_ACCESS_VIEWS ( 0xffffffff ) + +#define D3D11_LINEAR_GAMMA ( 1.0f ) +#define D3D11_MAJOR_VERSION ( 11 ) + +#define D3D11_MAX_BORDER_COLOR_COMPONENT ( 1.0f ) +#define D3D11_MAX_DEPTH ( 1.0f ) +#define D3D11_MAX_MAXANISOTROPY ( 16 ) + +#define D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT ( 32 ) + +#define D3D11_MAX_POSITION_VALUE ( 3.402823466e+34f ) +#define D3D11_MAX_TEXTURE_DIMENSION_2_TO_EXP ( 17 ) + +#define D3D11_MINOR_VERSION ( 0 ) + +#define D3D11_MIN_BORDER_COLOR_COMPONENT ( 0.0f ) +#define D3D11_MIN_DEPTH ( 0.0f ) +#define D3D11_MIN_MAXANISOTROPY ( 0 ) + +#define D3D11_MIP_LOD_BIAS_MAX ( 15.99f ) +#define D3D11_MIP_LOD_BIAS_MIN ( -16.0f ) +#define D3D11_MIP_LOD_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D11_MIP_LOD_RANGE_BIT_COUNT ( 8 ) + +#define D3D11_MULTISAMPLE_ANTIALIAS_LINE_WIDTH ( 1.4f ) +#define D3D11_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT ( 0 ) + +#define D3D11_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 15 ) + +#define D3D11_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 16 ) + +#define D3D11_PS_CS_UAV_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_PS_CS_UAV_REGISTER_COUNT ( 8 ) + +#define D3D11_PS_CS_UAV_REGISTER_READS_PER_INST ( 1 ) + +#define D3D11_PS_CS_UAV_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_PS_FRONTFACING_DEFAULT_VALUE ( 0xffffffff ) + +#define D3D11_PS_FRONTFACING_FALSE_VALUE ( 0 ) + +#define D3D11_PS_FRONTFACING_TRUE_VALUE ( 0xffffffff ) + +#define D3D11_PS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_PS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_PS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_PS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.0f ) +#define D3D11_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_PS_OUTPUT_DEPTH_REGISTER_COUNT ( 1 ) + +#define D3D11_PS_OUTPUT_MASK_REGISTER_COMPONENTS ( 1 ) + +#define D3D11_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_PS_OUTPUT_MASK_REGISTER_COUNT ( 1 ) + +#define D3D11_PS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_PS_OUTPUT_REGISTER_COUNT ( 8 ) + +#define D3D11_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.5f ) +#define D3D11_RAW_UAV_SRV_BYTE_ALIGNMENT ( 16 ) + +#define D3D11_REQ_BLEND_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D11_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP ( 27 ) + +#define D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT ( 4096 ) + +#define D3D11_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D11_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP ( 32 ) + +#define D3D11_REQ_DRAW_VERTEX_COUNT_2_TO_EXP ( 32 ) + +#define D3D11_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION ( 16384 ) + +#define D3D11_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT ( 1024 ) + +#define D3D11_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT ( 4096 ) + +#define D3D11_REQ_MAXANISOTROPY ( 16 ) + +#define D3D11_REQ_MIP_LEVELS ( 15 ) + +#define D3D11_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES ( 2048 ) + +#define D3D11_REQ_RASTERIZER_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D11_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH ( 16384 ) + +#define D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_A_TERM ( 128 ) + +#define D3D11_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_B_TERM ( 0.25f ) +#define D3D11_REQ_RESOURCE_VIEW_COUNT_PER_DEVICE_2_TO_EXP ( 20 ) + +#define D3D11_REQ_SAMPLER_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D11_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION ( 2048 ) + +#define D3D11_REQ_TEXTURE1D_U_DIMENSION ( 16384 ) + +#define D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION ( 2048 ) + +#define D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION ( 16384 ) + +#define D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION ( 2048 ) + +#define D3D11_REQ_TEXTURECUBE_DIMENSION ( 16384 ) + +#define D3D11_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL ( 0 ) + +#define D3D11_SHADER_MAJOR_VERSION ( 5 ) + +#define D3D11_SHADER_MAX_INSTANCES ( 65535 ) + +#define D3D11_SHADER_MAX_INTERFACES ( 253 ) + +#define D3D11_SHADER_MAX_INTERFACE_CALL_SITES ( 4096 ) + +#define D3D11_SHADER_MAX_TYPES ( 65535 ) + +#define D3D11_SHADER_MINOR_VERSION ( 0 ) + +#define D3D11_SHIFT_INSTRUCTION_PAD_VALUE ( 0 ) + +#define D3D11_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT ( 5 ) + +#define D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ( 8 ) + +#define D3D11_SO_BUFFER_MAX_STRIDE_IN_BYTES ( 2048 ) + +#define D3D11_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES ( 512 ) + +#define D3D11_SO_BUFFER_SLOT_COUNT ( 4 ) + +#define D3D11_SO_DDI_REGISTER_INDEX_DENOTING_GAP ( 0xffffffff ) + +#define D3D11_SO_NO_RASTERIZED_STREAM ( 0xffffffff ) + +#define D3D11_SO_OUTPUT_COMPONENT_COUNT ( 128 ) + +#define D3D11_SO_STREAM_COUNT ( 4 ) + +#define D3D11_SPEC_DATE_DAY ( 04 ) + +#define D3D11_SPEC_DATE_MONTH ( 06 ) + +#define D3D11_SPEC_DATE_YEAR ( 2009 ) + +#define D3D11_SPEC_VERSION ( 1.0 ) +#define D3D11_SRGB_GAMMA ( 2.2f ) +#define D3D11_SRGB_TO_FLOAT_DENOMINATOR_1 ( 12.92f ) +#define D3D11_SRGB_TO_FLOAT_DENOMINATOR_2 ( 1.055f ) +#define D3D11_SRGB_TO_FLOAT_EXPONENT ( 2.4f ) +#define D3D11_SRGB_TO_FLOAT_OFFSET ( 0.055f ) +#define D3D11_SRGB_TO_FLOAT_THRESHOLD ( 0.04045f ) +#define D3D11_SRGB_TO_FLOAT_TOLERANCE_IN_ULP ( 0.5f ) +#define D3D11_STANDARD_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_STANDARD_COMPONENT_BIT_COUNT_DOUBLED ( 64 ) + +#define D3D11_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE ( 4 ) + +#define D3D11_STANDARD_PIXEL_COMPONENT_COUNT ( 128 ) + +#define D3D11_STANDARD_PIXEL_ELEMENT_COUNT ( 32 ) + +#define D3D11_STANDARD_VECTOR_SIZE ( 4 ) + +#define D3D11_STANDARD_VERTEX_ELEMENT_COUNT ( 32 ) + +#define D3D11_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT ( 64 ) + +#define D3D11_SUBPIXEL_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D11_SUBTEXEL_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D11_TESSELLATOR_MAX_EVEN_TESSELLATION_FACTOR ( 64 ) + +#define D3D11_TESSELLATOR_MAX_ISOLINE_DENSITY_TESSELLATION_FACTOR ( 64 ) + +#define D3D11_TESSELLATOR_MAX_ODD_TESSELLATION_FACTOR ( 63 ) + +#define D3D11_TESSELLATOR_MAX_TESSELLATION_FACTOR ( 64 ) + +#define D3D11_TESSELLATOR_MIN_EVEN_TESSELLATION_FACTOR ( 2 ) + +#define D3D11_TESSELLATOR_MIN_ISOLINE_DENSITY_TESSELLATION_FACTOR ( 1 ) + +#define D3D11_TESSELLATOR_MIN_ODD_TESSELLATION_FACTOR ( 1 ) + +#define D3D11_TEXEL_ADDRESS_RANGE_BIT_COUNT ( 16 ) + +#define D3D11_UNBOUND_MEMORY_ACCESS_RESULT ( 0 ) + +#define D3D11_VIEWPORT_AND_SCISSORRECT_MAX_INDEX ( 15 ) + +#define D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE ( 16 ) + +#define D3D11_VIEWPORT_BOUNDS_MAX ( 32767 ) + +#define D3D11_VIEWPORT_BOUNDS_MIN ( -32768 ) + +#define D3D11_VS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_VS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_VS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D11_VS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D11_VS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D11_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D11_VS_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D11_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT ( 10 ) + +#define D3D11_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP ( 25 ) + +#define D3D11_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP ( 25 ) + +#endif +#define _FACD3D11 ( 0x87c ) + +#define _FACD3D11DEBUG ( ( _FACD3D11 + 1 ) ) + +#define MAKE_D3D11_HRESULT( code ) MAKE_HRESULT( 1, _FACD3D11, code ) +#define MAKE_D3D11_STATUS( code ) MAKE_HRESULT( 0, _FACD3D11, code ) +#define D3D11_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS MAKE_D3D11_HRESULT(1) +#define D3D11_ERROR_FILE_NOT_FOUND MAKE_D3D11_HRESULT(2) +#define D3D11_ERROR_TOO_MANY_UNIQUE_VIEW_OBJECTS MAKE_D3D11_HRESULT(3) +#define D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD MAKE_D3D11_HRESULT(4) +#if __SAL_H_FULL_VER < 140050727 +#undef __in_range +#undef __in_xcount_opt +#define __in_range(x, y) +#define __in_xcount_opt(x) +#endif +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_DEFAULT {}; +extern const DECLSPEC_SELECTANY CD3D11_DEFAULT D3D11_DEFAULT; +extern "C"{ +#endif +typedef +enum D3D11_INPUT_CLASSIFICATION + { D3D11_INPUT_PER_VERTEX_DATA = 0, + D3D11_INPUT_PER_INSTANCE_DATA = 1 + } D3D11_INPUT_CLASSIFICATION; + +#define D3D11_APPEND_ALIGNED_ELEMENT ( 0xffffffff ) + +typedef struct D3D11_INPUT_ELEMENT_DESC + { + LPCSTR SemanticName; + UINT SemanticIndex; + DXGI_FORMAT Format; + UINT InputSlot; + UINT AlignedByteOffset; + D3D11_INPUT_CLASSIFICATION InputSlotClass; + UINT InstanceDataStepRate; + } D3D11_INPUT_ELEMENT_DESC; + +typedef +enum D3D11_FILL_MODE + { D3D11_FILL_WIREFRAME = 2, + D3D11_FILL_SOLID = 3 + } D3D11_FILL_MODE; + +typedef +enum D3D11_PRIMITIVE_TOPOLOGY + { D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED = 0, + D3D11_PRIMITIVE_TOPOLOGY_POINTLIST = 1, + D3D11_PRIMITIVE_TOPOLOGY_LINELIST = 2, + D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP = 3, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5, + D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10, + D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13, + D3D11_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33, + D3D11_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = 34, + D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = 35, + D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = 36, + D3D11_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = 37, + D3D11_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = 38, + D3D11_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = 39, + D3D11_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = 40, + D3D11_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = 41, + D3D11_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = 42, + D3D11_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = 43, + D3D11_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = 44, + D3D11_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = 45, + D3D11_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = 46, + D3D11_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = 47, + D3D11_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = 48, + D3D11_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = 49, + D3D11_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = 50, + D3D11_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = 51, + D3D11_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = 52, + D3D11_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = 53, + D3D11_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = 54, + D3D11_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = 55, + D3D11_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = 56, + D3D11_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = 57, + D3D11_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = 58, + D3D11_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = 59, + D3D11_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = 60, + D3D11_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = 61, + D3D11_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = 62, + D3D11_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = 63, + D3D11_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = 64 + } D3D11_PRIMITIVE_TOPOLOGY; + +typedef +enum D3D11_PRIMITIVE + { D3D11_PRIMITIVE_UNDEFINED = 0, + D3D11_PRIMITIVE_POINT = 1, + D3D11_PRIMITIVE_LINE = 2, + D3D11_PRIMITIVE_TRIANGLE = 3, + D3D11_PRIMITIVE_LINE_ADJ = 6, + D3D11_PRIMITIVE_TRIANGLE_ADJ = 7, + D3D11_PRIMITIVE_1_CONTROL_POINT_PATCH = 8, + D3D11_PRIMITIVE_2_CONTROL_POINT_PATCH = 9, + D3D11_PRIMITIVE_3_CONTROL_POINT_PATCH = 10, + D3D11_PRIMITIVE_4_CONTROL_POINT_PATCH = 11, + D3D11_PRIMITIVE_5_CONTROL_POINT_PATCH = 12, + D3D11_PRIMITIVE_6_CONTROL_POINT_PATCH = 13, + D3D11_PRIMITIVE_7_CONTROL_POINT_PATCH = 14, + D3D11_PRIMITIVE_8_CONTROL_POINT_PATCH = 15, + D3D11_PRIMITIVE_9_CONTROL_POINT_PATCH = 16, + D3D11_PRIMITIVE_10_CONTROL_POINT_PATCH = 17, + D3D11_PRIMITIVE_11_CONTROL_POINT_PATCH = 18, + D3D11_PRIMITIVE_12_CONTROL_POINT_PATCH = 19, + D3D11_PRIMITIVE_13_CONTROL_POINT_PATCH = 20, + D3D11_PRIMITIVE_14_CONTROL_POINT_PATCH = 21, + D3D11_PRIMITIVE_15_CONTROL_POINT_PATCH = 22, + D3D11_PRIMITIVE_16_CONTROL_POINT_PATCH = 23, + D3D11_PRIMITIVE_17_CONTROL_POINT_PATCH = 24, + D3D11_PRIMITIVE_18_CONTROL_POINT_PATCH = 25, + D3D11_PRIMITIVE_19_CONTROL_POINT_PATCH = 26, + D3D11_PRIMITIVE_20_CONTROL_POINT_PATCH = 27, + D3D11_PRIMITIVE_21_CONTROL_POINT_PATCH = 28, + D3D11_PRIMITIVE_22_CONTROL_POINT_PATCH = 29, + D3D11_PRIMITIVE_23_CONTROL_POINT_PATCH = 30, + D3D11_PRIMITIVE_24_CONTROL_POINT_PATCH = 31, + D3D11_PRIMITIVE_25_CONTROL_POINT_PATCH = 32, + D3D11_PRIMITIVE_26_CONTROL_POINT_PATCH = 33, + D3D11_PRIMITIVE_27_CONTROL_POINT_PATCH = 34, + D3D11_PRIMITIVE_28_CONTROL_POINT_PATCH = 35, + D3D11_PRIMITIVE_29_CONTROL_POINT_PATCH = 36, + D3D11_PRIMITIVE_30_CONTROL_POINT_PATCH = 37, + D3D11_PRIMITIVE_31_CONTROL_POINT_PATCH = 38, + D3D11_PRIMITIVE_32_CONTROL_POINT_PATCH = 39 + } D3D11_PRIMITIVE; + +typedef +enum D3D11_CULL_MODE + { D3D11_CULL_NONE = 1, + D3D11_CULL_FRONT = 2, + D3D11_CULL_BACK = 3 + } D3D11_CULL_MODE; + +typedef struct D3D11_SO_DECLARATION_ENTRY + { + UINT Stream; + LPCSTR SemanticName; + UINT SemanticIndex; + BYTE StartComponent; + BYTE ComponentCount; + BYTE OutputSlot; + } D3D11_SO_DECLARATION_ENTRY; + +typedef struct D3D11_VIEWPORT + { + FLOAT TopLeftX; + FLOAT TopLeftY; + FLOAT Width; + FLOAT Height; + FLOAT MinDepth; + FLOAT MaxDepth; + } D3D11_VIEWPORT; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +inline bool operator==( const D3D11_VIEWPORT& l, const D3D11_VIEWPORT& r ) +{ + return l.TopLeftX == r.TopLeftX && l.TopLeftY == r.TopLeftY && l.Width == r.Width && + l.Height == r.Height && l.MinDepth == r.MinDepth && l.MaxDepth == r.MaxDepth; +} +inline bool operator!=( const D3D11_VIEWPORT& l, const D3D11_VIEWPORT& r ) +{ return !( l == r ); } +extern "C"{ +#endif +typedef +enum D3D11_RESOURCE_DIMENSION + { D3D11_RESOURCE_DIMENSION_UNKNOWN = 0, + D3D11_RESOURCE_DIMENSION_BUFFER = 1, + D3D11_RESOURCE_DIMENSION_TEXTURE1D = 2, + D3D11_RESOURCE_DIMENSION_TEXTURE2D = 3, + D3D11_RESOURCE_DIMENSION_TEXTURE3D = 4 + } D3D11_RESOURCE_DIMENSION; + +typedef +enum D3D11_SRV_DIMENSION + { D3D11_SRV_DIMENSION_UNKNOWN = 0, + D3D11_SRV_DIMENSION_BUFFER = 1, + D3D11_SRV_DIMENSION_TEXTURE1D = 2, + D3D11_SRV_DIMENSION_TEXTURE1DARRAY = 3, + D3D11_SRV_DIMENSION_TEXTURE2D = 4, + D3D11_SRV_DIMENSION_TEXTURE2DARRAY = 5, + D3D11_SRV_DIMENSION_TEXTURE2DMS = 6, + D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D11_SRV_DIMENSION_TEXTURE3D = 8, + D3D11_SRV_DIMENSION_TEXTURECUBE = 9, + D3D11_SRV_DIMENSION_TEXTURECUBEARRAY = 10, + D3D11_SRV_DIMENSION_BUFFEREX = 11 + } D3D11_SRV_DIMENSION; + +typedef +enum D3D11_DSV_DIMENSION + { D3D11_DSV_DIMENSION_UNKNOWN = 0, + D3D11_DSV_DIMENSION_TEXTURE1D = 1, + D3D11_DSV_DIMENSION_TEXTURE1DARRAY = 2, + D3D11_DSV_DIMENSION_TEXTURE2D = 3, + D3D11_DSV_DIMENSION_TEXTURE2DARRAY = 4, + D3D11_DSV_DIMENSION_TEXTURE2DMS = 5, + D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY = 6 + } D3D11_DSV_DIMENSION; + +typedef +enum D3D11_RTV_DIMENSION + { D3D11_RTV_DIMENSION_UNKNOWN = 0, + D3D11_RTV_DIMENSION_BUFFER = 1, + D3D11_RTV_DIMENSION_TEXTURE1D = 2, + D3D11_RTV_DIMENSION_TEXTURE1DARRAY = 3, + D3D11_RTV_DIMENSION_TEXTURE2D = 4, + D3D11_RTV_DIMENSION_TEXTURE2DARRAY = 5, + D3D11_RTV_DIMENSION_TEXTURE2DMS = 6, + D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D11_RTV_DIMENSION_TEXTURE3D = 8 + } D3D11_RTV_DIMENSION; + +typedef +enum D3D11_UAV_DIMENSION + { D3D11_UAV_DIMENSION_UNKNOWN = 0, + D3D11_UAV_DIMENSION_BUFFER = 1, + D3D11_UAV_DIMENSION_TEXTURE1D = 2, + D3D11_UAV_DIMENSION_TEXTURE1DARRAY = 3, + D3D11_UAV_DIMENSION_TEXTURE2D = 4, + D3D11_UAV_DIMENSION_TEXTURE2DARRAY = 5, + D3D11_UAV_DIMENSION_TEXTURE3D = 8 + } D3D11_UAV_DIMENSION; + +typedef +enum D3D11_USAGE + { D3D11_USAGE_DEFAULT = 0, + D3D11_USAGE_IMMUTABLE = 1, + D3D11_USAGE_DYNAMIC = 2, + D3D11_USAGE_STAGING = 3 + } D3D11_USAGE; + +typedef +enum D3D11_BIND_FLAG + { D3D11_BIND_VERTEX_BUFFER = 0x1L, + D3D11_BIND_INDEX_BUFFER = 0x2L, + D3D11_BIND_CONSTANT_BUFFER = 0x4L, + D3D11_BIND_SHADER_RESOURCE = 0x8L, + D3D11_BIND_STREAM_OUTPUT = 0x10L, + D3D11_BIND_RENDER_TARGET = 0x20L, + D3D11_BIND_DEPTH_STENCIL = 0x40L, + D3D11_BIND_UNORDERED_ACCESS = 0x80L + } D3D11_BIND_FLAG; + +typedef +enum D3D11_CPU_ACCESS_FLAG + { D3D11_CPU_ACCESS_WRITE = 0x10000L, + D3D11_CPU_ACCESS_READ = 0x20000L + } D3D11_CPU_ACCESS_FLAG; + +typedef +enum D3D11_RESOURCE_MISC_FLAG + { D3D11_RESOURCE_MISC_GENERATE_MIPS = 0x1L, + D3D11_RESOURCE_MISC_SHARED = 0x2L, + D3D11_RESOURCE_MISC_TEXTURECUBE = 0x4L, + D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS = 0x10L, + D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS = 0x20L, + D3D11_RESOURCE_MISC_BUFFER_STRUCTURED = 0x40L, + D3D11_RESOURCE_MISC_RESOURCE_CLAMP = 0x80L, + D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x100L, + D3D11_RESOURCE_MISC_GDI_COMPATIBLE = 0x200L + } D3D11_RESOURCE_MISC_FLAG; + +typedef +enum D3D11_MAP + { D3D11_MAP_READ = 1, + D3D11_MAP_WRITE = 2, + D3D11_MAP_READ_WRITE = 3, + D3D11_MAP_WRITE_DISCARD = 4, + D3D11_MAP_WRITE_NO_OVERWRITE = 5 + } D3D11_MAP; + +typedef +enum D3D11_MAP_FLAG + { D3D11_MAP_FLAG_DO_NOT_WAIT = 0x100000L + } D3D11_MAP_FLAG; + +typedef +enum D3D11_RAISE_FLAG + { D3D11_RAISE_FLAG_DRIVER_INTERNAL_ERROR = 0x1L + } D3D11_RAISE_FLAG; + +typedef +enum D3D11_CLEAR_FLAG + { D3D11_CLEAR_DEPTH = 0x1L, + D3D11_CLEAR_STENCIL = 0x2L + } D3D11_CLEAR_FLAG; + +typedef RECT D3D11_RECT; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_RECT : public D3D11_RECT +{ + CD3D11_RECT() + {} + explicit CD3D11_RECT( const D3D11_RECT& o ) : + D3D11_RECT( o ) + {} + explicit CD3D11_RECT( + LONG Left, + LONG Top, + LONG Right, + LONG Bottom ) + { + left = Left; + top = Top; + right = Right; + bottom = Bottom; + } + ~CD3D11_RECT() {} + operator const D3D11_RECT&() const { return *this; } +}; +inline bool operator==( const D3D11_RECT& l, const D3D11_RECT& r ) +{ + return l.left == r.left && l.top == r.top && + l.right == r.right && l.bottom == r.bottom; +} +inline bool operator!=( const D3D11_RECT& l, const D3D11_RECT& r ) +{ return !( l == r ); } +extern "C"{ +#endif +typedef struct D3D11_BOX + { + UINT left; + UINT top; + UINT front; + UINT right; + UINT bottom; + UINT back; + } D3D11_BOX; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_BOX : public D3D11_BOX +{ + CD3D11_BOX() + {} + explicit CD3D11_BOX( const D3D11_BOX& o ) : + D3D11_BOX( o ) + {} + explicit CD3D11_BOX( + LONG Left, + LONG Top, + LONG Front, + LONG Right, + LONG Bottom, + LONG Back ) + { + left = Left; + top = Top; + front = Front; + right = Right; + bottom = Bottom; + back = Back; + } + ~CD3D11_BOX() {} + operator const D3D11_BOX&() const { return *this; } +}; +inline bool operator==( const D3D11_BOX& l, const D3D11_BOX& r ) +{ + return l.left == r.left && l.top == r.top && l.front == r.front && + l.right == r.right && l.bottom == r.bottom && l.back == r.back; +} +inline bool operator!=( const D3D11_BOX& l, const D3D11_BOX& r ) +{ return !( l == r ); } +extern "C"{ +#endif + + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D11DeviceChild_INTERFACE_DEFINED__ +#define __ID3D11DeviceChild_INTERFACE_DEFINED__ + +/* interface ID3D11DeviceChild */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11DeviceChild; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1841e5c8-16b0-489b-bcc8-44cfb0d5deae") + ID3D11DeviceChild : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE GetDevice( + /* [annotation] */ + __out ID3D11Device **ppDevice) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11DeviceChildVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11DeviceChild * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11DeviceChild * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11DeviceChild * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11DeviceChild * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11DeviceChild * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11DeviceChild * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11DeviceChild * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11DeviceChildVtbl; + + interface ID3D11DeviceChild + { + CONST_VTBL struct ID3D11DeviceChildVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11DeviceChild_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11DeviceChild_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11DeviceChild_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11DeviceChild_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11DeviceChild_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11DeviceChild_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11DeviceChild_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11DeviceChild_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0001 */ +/* [local] */ + +typedef +enum D3D11_COMPARISON_FUNC + { D3D11_COMPARISON_NEVER = 1, + D3D11_COMPARISON_LESS = 2, + D3D11_COMPARISON_EQUAL = 3, + D3D11_COMPARISON_LESS_EQUAL = 4, + D3D11_COMPARISON_GREATER = 5, + D3D11_COMPARISON_NOT_EQUAL = 6, + D3D11_COMPARISON_GREATER_EQUAL = 7, + D3D11_COMPARISON_ALWAYS = 8 + } D3D11_COMPARISON_FUNC; + +typedef +enum D3D11_DEPTH_WRITE_MASK + { D3D11_DEPTH_WRITE_MASK_ZERO = 0, + D3D11_DEPTH_WRITE_MASK_ALL = 1 + } D3D11_DEPTH_WRITE_MASK; + +typedef +enum D3D11_STENCIL_OP + { D3D11_STENCIL_OP_KEEP = 1, + D3D11_STENCIL_OP_ZERO = 2, + D3D11_STENCIL_OP_REPLACE = 3, + D3D11_STENCIL_OP_INCR_SAT = 4, + D3D11_STENCIL_OP_DECR_SAT = 5, + D3D11_STENCIL_OP_INVERT = 6, + D3D11_STENCIL_OP_INCR = 7, + D3D11_STENCIL_OP_DECR = 8 + } D3D11_STENCIL_OP; + +typedef struct D3D11_DEPTH_STENCILOP_DESC + { + D3D11_STENCIL_OP StencilFailOp; + D3D11_STENCIL_OP StencilDepthFailOp; + D3D11_STENCIL_OP StencilPassOp; + D3D11_COMPARISON_FUNC StencilFunc; + } D3D11_DEPTH_STENCILOP_DESC; + +typedef struct D3D11_DEPTH_STENCIL_DESC + { + BOOL DepthEnable; + D3D11_DEPTH_WRITE_MASK DepthWriteMask; + D3D11_COMPARISON_FUNC DepthFunc; + BOOL StencilEnable; + UINT8 StencilReadMask; + UINT8 StencilWriteMask; + D3D11_DEPTH_STENCILOP_DESC FrontFace; + D3D11_DEPTH_STENCILOP_DESC BackFace; + } D3D11_DEPTH_STENCIL_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_DEPTH_STENCIL_DESC : public D3D11_DEPTH_STENCIL_DESC +{ + CD3D11_DEPTH_STENCIL_DESC() + {} + explicit CD3D11_DEPTH_STENCIL_DESC( const D3D11_DEPTH_STENCIL_DESC& o ) : + D3D11_DEPTH_STENCIL_DESC( o ) + {} + explicit CD3D11_DEPTH_STENCIL_DESC( CD3D11_DEFAULT ) + { + DepthEnable = TRUE; + DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL; + DepthFunc = D3D11_COMPARISON_LESS; + StencilEnable = FALSE; + StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK; + StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK; + const D3D11_DEPTH_STENCILOP_DESC defaultStencilOp = + { D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_ALWAYS }; + FrontFace = defaultStencilOp; + BackFace = defaultStencilOp; + } + explicit CD3D11_DEPTH_STENCIL_DESC( + BOOL depthEnable, + D3D11_DEPTH_WRITE_MASK depthWriteMask, + D3D11_COMPARISON_FUNC depthFunc, + BOOL stencilEnable, + UINT8 stencilReadMask, + UINT8 stencilWriteMask, + D3D11_STENCIL_OP frontStencilFailOp, + D3D11_STENCIL_OP frontStencilDepthFailOp, + D3D11_STENCIL_OP frontStencilPassOp, + D3D11_COMPARISON_FUNC frontStencilFunc, + D3D11_STENCIL_OP backStencilFailOp, + D3D11_STENCIL_OP backStencilDepthFailOp, + D3D11_STENCIL_OP backStencilPassOp, + D3D11_COMPARISON_FUNC backStencilFunc ) + { + DepthEnable = depthEnable; + DepthWriteMask = depthWriteMask; + DepthFunc = depthFunc; + StencilEnable = stencilEnable; + StencilReadMask = stencilReadMask; + StencilWriteMask = stencilWriteMask; + FrontFace.StencilFailOp = frontStencilFailOp; + FrontFace.StencilDepthFailOp = frontStencilDepthFailOp; + FrontFace.StencilPassOp = frontStencilPassOp; + FrontFace.StencilFunc = frontStencilFunc; + BackFace.StencilFailOp = backStencilFailOp; + BackFace.StencilDepthFailOp = backStencilDepthFailOp; + BackFace.StencilPassOp = backStencilPassOp; + BackFace.StencilFunc = backStencilFunc; + } + ~CD3D11_DEPTH_STENCIL_DESC() {} + operator const D3D11_DEPTH_STENCIL_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0001_v0_0_s_ifspec; + +#ifndef __ID3D11DepthStencilState_INTERFACE_DEFINED__ +#define __ID3D11DepthStencilState_INTERFACE_DEFINED__ + +/* interface ID3D11DepthStencilState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11DepthStencilState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("03823efb-8d8f-4e1c-9aa2-f64bb2cbfdf1") + ID3D11DepthStencilState : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_DEPTH_STENCIL_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11DepthStencilStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11DepthStencilState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11DepthStencilState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11DepthStencilState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11DepthStencilState * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11DepthStencilState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11DepthStencilState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11DepthStencilState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11DepthStencilState * This, + /* [annotation] */ + __out D3D11_DEPTH_STENCIL_DESC *pDesc); + + END_INTERFACE + } ID3D11DepthStencilStateVtbl; + + interface ID3D11DepthStencilState + { + CONST_VTBL struct ID3D11DepthStencilStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11DepthStencilState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11DepthStencilState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11DepthStencilState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11DepthStencilState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11DepthStencilState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11DepthStencilState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11DepthStencilState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11DepthStencilState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11DepthStencilState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0002 */ +/* [local] */ + +typedef +enum D3D11_BLEND + { D3D11_BLEND_ZERO = 1, + D3D11_BLEND_ONE = 2, + D3D11_BLEND_SRC_COLOR = 3, + D3D11_BLEND_INV_SRC_COLOR = 4, + D3D11_BLEND_SRC_ALPHA = 5, + D3D11_BLEND_INV_SRC_ALPHA = 6, + D3D11_BLEND_DEST_ALPHA = 7, + D3D11_BLEND_INV_DEST_ALPHA = 8, + D3D11_BLEND_DEST_COLOR = 9, + D3D11_BLEND_INV_DEST_COLOR = 10, + D3D11_BLEND_SRC_ALPHA_SAT = 11, + D3D11_BLEND_BLEND_FACTOR = 14, + D3D11_BLEND_INV_BLEND_FACTOR = 15, + D3D11_BLEND_SRC1_COLOR = 16, + D3D11_BLEND_INV_SRC1_COLOR = 17, + D3D11_BLEND_SRC1_ALPHA = 18, + D3D11_BLEND_INV_SRC1_ALPHA = 19 + } D3D11_BLEND; + +typedef +enum D3D11_BLEND_OP + { D3D11_BLEND_OP_ADD = 1, + D3D11_BLEND_OP_SUBTRACT = 2, + D3D11_BLEND_OP_REV_SUBTRACT = 3, + D3D11_BLEND_OP_MIN = 4, + D3D11_BLEND_OP_MAX = 5 + } D3D11_BLEND_OP; + +typedef +enum D3D11_COLOR_WRITE_ENABLE + { D3D11_COLOR_WRITE_ENABLE_RED = 1, + D3D11_COLOR_WRITE_ENABLE_GREEN = 2, + D3D11_COLOR_WRITE_ENABLE_BLUE = 4, + D3D11_COLOR_WRITE_ENABLE_ALPHA = 8, + D3D11_COLOR_WRITE_ENABLE_ALL = ( ( ( D3D11_COLOR_WRITE_ENABLE_RED | D3D11_COLOR_WRITE_ENABLE_GREEN ) | D3D11_COLOR_WRITE_ENABLE_BLUE ) | D3D11_COLOR_WRITE_ENABLE_ALPHA ) + } D3D11_COLOR_WRITE_ENABLE; + +typedef struct D3D11_RENDER_TARGET_BLEND_DESC + { + BOOL BlendEnable; + D3D11_BLEND SrcBlend; + D3D11_BLEND DestBlend; + D3D11_BLEND_OP BlendOp; + D3D11_BLEND SrcBlendAlpha; + D3D11_BLEND DestBlendAlpha; + D3D11_BLEND_OP BlendOpAlpha; + UINT8 RenderTargetWriteMask; + } D3D11_RENDER_TARGET_BLEND_DESC; + +typedef struct D3D11_BLEND_DESC + { + BOOL AlphaToCoverageEnable; + BOOL IndependentBlendEnable; + D3D11_RENDER_TARGET_BLEND_DESC RenderTarget[ 8 ]; + } D3D11_BLEND_DESC; + +/* Note, the array size for RenderTarget[] above is D3D11_SIMULTANEOUS_RENDERTARGET_COUNT. + IDL processing/generation of this header replaces the define; this comment is merely explaining what happened. */ +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_BLEND_DESC : public D3D11_BLEND_DESC +{ + CD3D11_BLEND_DESC() + {} + explicit CD3D11_BLEND_DESC( const D3D11_BLEND_DESC& o ) : + D3D11_BLEND_DESC( o ) + {} + explicit CD3D11_BLEND_DESC( CD3D11_DEFAULT ) + { + AlphaToCoverageEnable = FALSE; + IndependentBlendEnable = FALSE; + const D3D11_RENDER_TARGET_BLEND_DESC defaultRenderTargetBlendDesc = + { + FALSE, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_COLOR_WRITE_ENABLE_ALL, + }; + for (UINT i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + RenderTarget[ i ] = defaultRenderTargetBlendDesc; + } + ~CD3D11_BLEND_DESC() {} + operator const D3D11_BLEND_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0002_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0002_v0_0_s_ifspec; + +#ifndef __ID3D11BlendState_INTERFACE_DEFINED__ +#define __ID3D11BlendState_INTERFACE_DEFINED__ + +/* interface ID3D11BlendState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11BlendState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("75b68faa-347d-4159-8f45-a0640f01cd9a") + ID3D11BlendState : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_BLEND_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11BlendStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11BlendState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11BlendState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11BlendState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11BlendState * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11BlendState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11BlendState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11BlendState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11BlendState * This, + /* [annotation] */ + __out D3D11_BLEND_DESC *pDesc); + + END_INTERFACE + } ID3D11BlendStateVtbl; + + interface ID3D11BlendState + { + CONST_VTBL struct ID3D11BlendStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11BlendState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11BlendState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11BlendState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11BlendState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11BlendState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11BlendState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11BlendState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11BlendState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11BlendState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0003 */ +/* [local] */ + +typedef struct D3D11_RASTERIZER_DESC + { + D3D11_FILL_MODE FillMode; + D3D11_CULL_MODE CullMode; + BOOL FrontCounterClockwise; + INT DepthBias; + FLOAT DepthBiasClamp; + FLOAT SlopeScaledDepthBias; + BOOL DepthClipEnable; + BOOL ScissorEnable; + BOOL MultisampleEnable; + BOOL AntialiasedLineEnable; + } D3D11_RASTERIZER_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_RASTERIZER_DESC : public D3D11_RASTERIZER_DESC +{ + CD3D11_RASTERIZER_DESC() + {} + explicit CD3D11_RASTERIZER_DESC( const D3D11_RASTERIZER_DESC& o ) : + D3D11_RASTERIZER_DESC( o ) + {} + explicit CD3D11_RASTERIZER_DESC( CD3D11_DEFAULT ) + { + FillMode = D3D11_FILL_SOLID; + CullMode = D3D11_CULL_BACK; + FrontCounterClockwise = FALSE; + DepthBias = D3D11_DEFAULT_DEPTH_BIAS; + DepthBiasClamp = D3D11_DEFAULT_DEPTH_BIAS_CLAMP; + SlopeScaledDepthBias = D3D11_DEFAULT_SLOPE_SCALED_DEPTH_BIAS; + DepthClipEnable = TRUE; + ScissorEnable = FALSE; + MultisampleEnable = FALSE; + AntialiasedLineEnable = FALSE; + } + explicit CD3D11_RASTERIZER_DESC( + D3D11_FILL_MODE fillMode, + D3D11_CULL_MODE cullMode, + BOOL frontCounterClockwise, + INT depthBias, + FLOAT depthBiasClamp, + FLOAT slopeScaledDepthBias, + BOOL depthClipEnable, + BOOL scissorEnable, + BOOL multisampleEnable, + BOOL antialiasedLineEnable ) + { + FillMode = fillMode; + CullMode = cullMode; + FrontCounterClockwise = frontCounterClockwise; + DepthBias = depthBias; + DepthBiasClamp = depthBiasClamp; + SlopeScaledDepthBias = slopeScaledDepthBias; + DepthClipEnable = depthClipEnable; + ScissorEnable = scissorEnable; + MultisampleEnable = multisampleEnable; + AntialiasedLineEnable = antialiasedLineEnable; + } + ~CD3D11_RASTERIZER_DESC() {} + operator const D3D11_RASTERIZER_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0003_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0003_v0_0_s_ifspec; + +#ifndef __ID3D11RasterizerState_INTERFACE_DEFINED__ +#define __ID3D11RasterizerState_INTERFACE_DEFINED__ + +/* interface ID3D11RasterizerState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11RasterizerState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9bb4ab81-ab1a-4d8f-b506-fc04200b6ee7") + ID3D11RasterizerState : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_RASTERIZER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11RasterizerStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11RasterizerState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11RasterizerState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11RasterizerState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11RasterizerState * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11RasterizerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11RasterizerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11RasterizerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11RasterizerState * This, + /* [annotation] */ + __out D3D11_RASTERIZER_DESC *pDesc); + + END_INTERFACE + } ID3D11RasterizerStateVtbl; + + interface ID3D11RasterizerState + { + CONST_VTBL struct ID3D11RasterizerStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11RasterizerState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11RasterizerState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11RasterizerState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11RasterizerState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11RasterizerState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11RasterizerState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11RasterizerState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11RasterizerState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11RasterizerState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0004 */ +/* [local] */ + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +inline UINT D3D11CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT MipLevels ) +{ return MipSlice + ArraySlice * MipLevels; } +extern "C"{ +#endif +typedef struct D3D11_SUBRESOURCE_DATA + { + const void *pSysMem; + UINT SysMemPitch; + UINT SysMemSlicePitch; + } D3D11_SUBRESOURCE_DATA; + +typedef struct D3D11_MAPPED_SUBRESOURCE + { + void *pData; + UINT RowPitch; + UINT DepthPitch; + } D3D11_MAPPED_SUBRESOURCE; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0004_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0004_v0_0_s_ifspec; + +#ifndef __ID3D11Resource_INTERFACE_DEFINED__ +#define __ID3D11Resource_INTERFACE_DEFINED__ + +/* interface ID3D11Resource */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Resource; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("dc8e63f3-d12b-4952-b47b-5e45026a862d") + ID3D11Resource : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetType( + /* [annotation] */ + __out D3D11_RESOURCE_DIMENSION *pResourceDimension) = 0; + + virtual void STDMETHODCALLTYPE SetEvictionPriority( + /* [annotation] */ + __in UINT EvictionPriority) = 0; + + virtual UINT STDMETHODCALLTYPE GetEvictionPriority( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11ResourceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Resource * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Resource * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Resource * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Resource * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Resource * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Resource * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Resource * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D11Resource * This, + /* [annotation] */ + __out D3D11_RESOURCE_DIMENSION *pResourceDimension); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D11Resource * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D11Resource * This); + + END_INTERFACE + } ID3D11ResourceVtbl; + + interface ID3D11Resource + { + CONST_VTBL struct ID3D11ResourceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Resource_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Resource_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Resource_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Resource_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Resource_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Resource_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Resource_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Resource_GetType(This,pResourceDimension) \ + ( (This)->lpVtbl -> GetType(This,pResourceDimension) ) + +#define ID3D11Resource_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D11Resource_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Resource_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0005 */ +/* [local] */ + +typedef struct D3D11_BUFFER_DESC + { + UINT ByteWidth; + D3D11_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + UINT StructureByteStride; + } D3D11_BUFFER_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_BUFFER_DESC : public D3D11_BUFFER_DESC +{ + CD3D11_BUFFER_DESC() + {} + explicit CD3D11_BUFFER_DESC( const D3D11_BUFFER_DESC& o ) : + D3D11_BUFFER_DESC( o ) + {} + explicit CD3D11_BUFFER_DESC( + UINT byteWidth, + UINT bindFlags, + D3D11_USAGE usage = D3D11_USAGE_DEFAULT, + UINT cpuaccessFlags = 0, + UINT miscFlags = 0, + UINT structureByteStride = 0 ) + { + ByteWidth = byteWidth; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags ; + MiscFlags = miscFlags; + StructureByteStride = structureByteStride; + } + ~CD3D11_BUFFER_DESC() {} + operator const D3D11_BUFFER_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0005_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0005_v0_0_s_ifspec; + +#ifndef __ID3D11Buffer_INTERFACE_DEFINED__ +#define __ID3D11Buffer_INTERFACE_DEFINED__ + +/* interface ID3D11Buffer */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Buffer; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("48570b85-d1ee-4fcd-a250-eb350722b037") + ID3D11Buffer : public ID3D11Resource + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_BUFFER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11BufferVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Buffer * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Buffer * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Buffer * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Buffer * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Buffer * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Buffer * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Buffer * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D11Buffer * This, + /* [annotation] */ + __out D3D11_RESOURCE_DIMENSION *pResourceDimension); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D11Buffer * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D11Buffer * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11Buffer * This, + /* [annotation] */ + __out D3D11_BUFFER_DESC *pDesc); + + END_INTERFACE + } ID3D11BufferVtbl; + + interface ID3D11Buffer + { + CONST_VTBL struct ID3D11BufferVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Buffer_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Buffer_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Buffer_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Buffer_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Buffer_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Buffer_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Buffer_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Buffer_GetType(This,pResourceDimension) \ + ( (This)->lpVtbl -> GetType(This,pResourceDimension) ) + +#define ID3D11Buffer_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D11Buffer_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D11Buffer_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Buffer_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0006 */ +/* [local] */ + +typedef struct D3D11_TEXTURE1D_DESC + { + UINT Width; + UINT MipLevels; + UINT ArraySize; + DXGI_FORMAT Format; + D3D11_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + } D3D11_TEXTURE1D_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_TEXTURE1D_DESC : public D3D11_TEXTURE1D_DESC +{ + CD3D11_TEXTURE1D_DESC() + {} + explicit CD3D11_TEXTURE1D_DESC( const D3D11_TEXTURE1D_DESC& o ) : + D3D11_TEXTURE1D_DESC( o ) + {} + explicit CD3D11_TEXTURE1D_DESC( + DXGI_FORMAT format, + UINT width, + UINT arraySize = 1, + UINT mipLevels = 0, + UINT bindFlags = D3D11_BIND_SHADER_RESOURCE, + D3D11_USAGE usage = D3D11_USAGE_DEFAULT, + UINT cpuaccessFlags= 0, + UINT miscFlags = 0 ) + { + Width = width; + MipLevels = mipLevels; + ArraySize = arraySize; + Format = format; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags; + MiscFlags = miscFlags; + } + ~CD3D11_TEXTURE1D_DESC() {} + operator const D3D11_TEXTURE1D_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0006_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0006_v0_0_s_ifspec; + +#ifndef __ID3D11Texture1D_INTERFACE_DEFINED__ +#define __ID3D11Texture1D_INTERFACE_DEFINED__ + +/* interface ID3D11Texture1D */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Texture1D; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("f8fb5c27-c6b3-4f75-a4c8-439af2ef564c") + ID3D11Texture1D : public ID3D11Resource + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_TEXTURE1D_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11Texture1DVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Texture1D * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Texture1D * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Texture1D * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Texture1D * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Texture1D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Texture1D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Texture1D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D11Texture1D * This, + /* [annotation] */ + __out D3D11_RESOURCE_DIMENSION *pResourceDimension); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D11Texture1D * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D11Texture1D * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11Texture1D * This, + /* [annotation] */ + __out D3D11_TEXTURE1D_DESC *pDesc); + + END_INTERFACE + } ID3D11Texture1DVtbl; + + interface ID3D11Texture1D + { + CONST_VTBL struct ID3D11Texture1DVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Texture1D_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Texture1D_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Texture1D_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Texture1D_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Texture1D_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Texture1D_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Texture1D_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Texture1D_GetType(This,pResourceDimension) \ + ( (This)->lpVtbl -> GetType(This,pResourceDimension) ) + +#define ID3D11Texture1D_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D11Texture1D_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D11Texture1D_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Texture1D_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0007 */ +/* [local] */ + +typedef struct D3D11_TEXTURE2D_DESC + { + UINT Width; + UINT Height; + UINT MipLevels; + UINT ArraySize; + DXGI_FORMAT Format; + DXGI_SAMPLE_DESC SampleDesc; + D3D11_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + } D3D11_TEXTURE2D_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_TEXTURE2D_DESC : public D3D11_TEXTURE2D_DESC +{ + CD3D11_TEXTURE2D_DESC() + {} + explicit CD3D11_TEXTURE2D_DESC( const D3D11_TEXTURE2D_DESC& o ) : + D3D11_TEXTURE2D_DESC( o ) + {} + explicit CD3D11_TEXTURE2D_DESC( + DXGI_FORMAT format, + UINT width, + UINT height, + UINT arraySize = 1, + UINT mipLevels = 0, + UINT bindFlags = D3D11_BIND_SHADER_RESOURCE, + D3D11_USAGE usage = D3D11_USAGE_DEFAULT, + UINT cpuaccessFlags = 0, + UINT sampleCount = 1, + UINT sampleQuality = 0, + UINT miscFlags = 0 ) + { + Width = width; + Height = height; + MipLevels = mipLevels; + ArraySize = arraySize; + Format = format; + SampleDesc.Count = sampleCount; + SampleDesc.Quality = sampleQuality; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags; + MiscFlags = miscFlags; + } + ~CD3D11_TEXTURE2D_DESC() {} + operator const D3D11_TEXTURE2D_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0007_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0007_v0_0_s_ifspec; + +#ifndef __ID3D11Texture2D_INTERFACE_DEFINED__ +#define __ID3D11Texture2D_INTERFACE_DEFINED__ + +/* interface ID3D11Texture2D */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Texture2D; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6f15aaf2-d208-4e89-9ab4-489535d34f9c") + ID3D11Texture2D : public ID3D11Resource + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_TEXTURE2D_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11Texture2DVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Texture2D * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Texture2D * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Texture2D * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Texture2D * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Texture2D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Texture2D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Texture2D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D11Texture2D * This, + /* [annotation] */ + __out D3D11_RESOURCE_DIMENSION *pResourceDimension); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D11Texture2D * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D11Texture2D * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11Texture2D * This, + /* [annotation] */ + __out D3D11_TEXTURE2D_DESC *pDesc); + + END_INTERFACE + } ID3D11Texture2DVtbl; + + interface ID3D11Texture2D + { + CONST_VTBL struct ID3D11Texture2DVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Texture2D_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Texture2D_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Texture2D_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Texture2D_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Texture2D_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Texture2D_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Texture2D_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Texture2D_GetType(This,pResourceDimension) \ + ( (This)->lpVtbl -> GetType(This,pResourceDimension) ) + +#define ID3D11Texture2D_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D11Texture2D_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D11Texture2D_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Texture2D_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0008 */ +/* [local] */ + +typedef struct D3D11_TEXTURE3D_DESC + { + UINT Width; + UINT Height; + UINT Depth; + UINT MipLevels; + DXGI_FORMAT Format; + D3D11_USAGE Usage; + UINT BindFlags; + UINT CPUAccessFlags; + UINT MiscFlags; + } D3D11_TEXTURE3D_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_TEXTURE3D_DESC : public D3D11_TEXTURE3D_DESC +{ + CD3D11_TEXTURE3D_DESC() + {} + explicit CD3D11_TEXTURE3D_DESC( const D3D11_TEXTURE3D_DESC& o ) : + D3D11_TEXTURE3D_DESC( o ) + {} + explicit CD3D11_TEXTURE3D_DESC( + DXGI_FORMAT format, + UINT width, + UINT height, + UINT depth, + UINT mipLevels = 0, + UINT bindFlags = D3D11_BIND_SHADER_RESOURCE, + D3D11_USAGE usage = D3D11_USAGE_DEFAULT, + UINT cpuaccessFlags = 0, + UINT miscFlags = 0 ) + { + Width = width; + Height = height; + Depth = depth; + MipLevels = mipLevels; + Format = format; + Usage = usage; + BindFlags = bindFlags; + CPUAccessFlags = cpuaccessFlags; + MiscFlags = miscFlags; + } + ~CD3D11_TEXTURE3D_DESC() {} + operator const D3D11_TEXTURE3D_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0008_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0008_v0_0_s_ifspec; + +#ifndef __ID3D11Texture3D_INTERFACE_DEFINED__ +#define __ID3D11Texture3D_INTERFACE_DEFINED__ + +/* interface ID3D11Texture3D */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Texture3D; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("037e866e-f56d-4357-a8af-9dabbe6e250e") + ID3D11Texture3D : public ID3D11Resource + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_TEXTURE3D_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11Texture3DVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Texture3D * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Texture3D * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Texture3D * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Texture3D * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Texture3D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Texture3D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Texture3D * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetType )( + ID3D11Texture3D * This, + /* [annotation] */ + __out D3D11_RESOURCE_DIMENSION *pResourceDimension); + + void ( STDMETHODCALLTYPE *SetEvictionPriority )( + ID3D11Texture3D * This, + /* [annotation] */ + __in UINT EvictionPriority); + + UINT ( STDMETHODCALLTYPE *GetEvictionPriority )( + ID3D11Texture3D * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11Texture3D * This, + /* [annotation] */ + __out D3D11_TEXTURE3D_DESC *pDesc); + + END_INTERFACE + } ID3D11Texture3DVtbl; + + interface ID3D11Texture3D + { + CONST_VTBL struct ID3D11Texture3DVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Texture3D_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Texture3D_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Texture3D_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Texture3D_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Texture3D_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Texture3D_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Texture3D_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Texture3D_GetType(This,pResourceDimension) \ + ( (This)->lpVtbl -> GetType(This,pResourceDimension) ) + +#define ID3D11Texture3D_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define ID3D11Texture3D_GetEvictionPriority(This) \ + ( (This)->lpVtbl -> GetEvictionPriority(This) ) + + +#define ID3D11Texture3D_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Texture3D_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0009 */ +/* [local] */ + +typedef +enum D3D11_TEXTURECUBE_FACE + { D3D11_TEXTURECUBE_FACE_POSITIVE_X = 0, + D3D11_TEXTURECUBE_FACE_NEGATIVE_X = 1, + D3D11_TEXTURECUBE_FACE_POSITIVE_Y = 2, + D3D11_TEXTURECUBE_FACE_NEGATIVE_Y = 3, + D3D11_TEXTURECUBE_FACE_POSITIVE_Z = 4, + D3D11_TEXTURECUBE_FACE_NEGATIVE_Z = 5 + } D3D11_TEXTURECUBE_FACE; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0009_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0009_v0_0_s_ifspec; + +#ifndef __ID3D11View_INTERFACE_DEFINED__ +#define __ID3D11View_INTERFACE_DEFINED__ + +/* interface ID3D11View */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11View; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("839d1216-bb2e-412b-b7f4-a9dbebe08ed1") + ID3D11View : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetResource( + /* [annotation] */ + __out ID3D11Resource **ppResource) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11ViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11View * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11View * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11View * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11View * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11View * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11View * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11View * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D11View * This, + /* [annotation] */ + __out ID3D11Resource **ppResource); + + END_INTERFACE + } ID3D11ViewVtbl; + + interface ID3D11View + { + CONST_VTBL struct ID3D11ViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11View_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11View_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11View_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11View_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11View_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11View_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11View_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11View_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11View_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0010 */ +/* [local] */ + +typedef struct D3D11_BUFFER_SRV + { + union + { + UINT FirstElement; + UINT ElementOffset; + } ; + union + { + UINT NumElements; + UINT ElementWidth; + } ; + } D3D11_BUFFER_SRV; + +typedef +enum D3D11_BUFFEREX_SRV_FLAG + { D3D11_BUFFEREX_SRV_FLAG_RAW = 0x1 + } D3D11_BUFFEREX_SRV_FLAG; + +typedef struct D3D11_BUFFEREX_SRV + { + UINT FirstElement; + UINT NumElements; + UINT Flags; + } D3D11_BUFFEREX_SRV; + +typedef struct D3D11_TEX1D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D11_TEX1D_SRV; + +typedef struct D3D11_TEX1D_ARRAY_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX1D_ARRAY_SRV; + +typedef struct D3D11_TEX2D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D11_TEX2D_SRV; + +typedef struct D3D11_TEX2D_ARRAY_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX2D_ARRAY_SRV; + +typedef struct D3D11_TEX3D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D11_TEX3D_SRV; + +typedef struct D3D11_TEXCUBE_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + } D3D11_TEXCUBE_SRV; + +typedef struct D3D11_TEXCUBE_ARRAY_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + UINT First2DArrayFace; + UINT NumCubes; + } D3D11_TEXCUBE_ARRAY_SRV; + +typedef struct D3D11_TEX2DMS_SRV + { + UINT UnusedField_NothingToDefine; + } D3D11_TEX2DMS_SRV; + +typedef struct D3D11_TEX2DMS_ARRAY_SRV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX2DMS_ARRAY_SRV; + +typedef struct D3D11_SHADER_RESOURCE_VIEW_DESC + { + DXGI_FORMAT Format; + D3D11_SRV_DIMENSION ViewDimension; + union + { + D3D11_BUFFER_SRV Buffer; + D3D11_TEX1D_SRV Texture1D; + D3D11_TEX1D_ARRAY_SRV Texture1DArray; + D3D11_TEX2D_SRV Texture2D; + D3D11_TEX2D_ARRAY_SRV Texture2DArray; + D3D11_TEX2DMS_SRV Texture2DMS; + D3D11_TEX2DMS_ARRAY_SRV Texture2DMSArray; + D3D11_TEX3D_SRV Texture3D; + D3D11_TEXCUBE_SRV TextureCube; + D3D11_TEXCUBE_ARRAY_SRV TextureCubeArray; + D3D11_BUFFEREX_SRV BufferEx; + } ; + } D3D11_SHADER_RESOURCE_VIEW_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_SHADER_RESOURCE_VIEW_DESC : public D3D11_SHADER_RESOURCE_VIEW_DESC +{ + CD3D11_SHADER_RESOURCE_VIEW_DESC() + {} + explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( const D3D11_SHADER_RESOURCE_VIEW_DESC& o ) : + D3D11_SHADER_RESOURCE_VIEW_DESC( o ) + {} + explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( + D3D11_SRV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mostDetailedMip = 0, // FirstElement for BUFFER + UINT mipLevels = -1, // NumElements for BUFFER + UINT firstArraySlice = 0, // First2DArrayFace for TEXTURECUBEARRAY + UINT arraySize = -1, // NumCubes for TEXTURECUBEARRAY + UINT flags = 0 ) // BUFFEREX only + { + Format = format; + ViewDimension = viewDimension; + switch (viewDimension) + { + case D3D11_SRV_DIMENSION_BUFFER: + Buffer.FirstElement = mostDetailedMip; + Buffer.NumElements = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURE1D: + Texture1D.MostDetailedMip = mostDetailedMip; + Texture1D.MipLevels = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MostDetailedMip = mostDetailedMip; + Texture1DArray.MipLevels = mipLevels; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + case D3D11_SRV_DIMENSION_TEXTURE2D: + Texture2D.MostDetailedMip = mostDetailedMip; + Texture2D.MipLevels = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MostDetailedMip = mostDetailedMip; + Texture2DArray.MipLevels = mipLevels; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + case D3D11_SRV_DIMENSION_TEXTURE2DMS: + break; + case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY: + Texture2DMSArray.FirstArraySlice = firstArraySlice; + Texture2DMSArray.ArraySize = arraySize; + break; + case D3D11_SRV_DIMENSION_TEXTURE3D: + Texture3D.MostDetailedMip = mostDetailedMip; + Texture3D.MipLevels = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURECUBE: + TextureCube.MostDetailedMip = mostDetailedMip; + TextureCube.MipLevels = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY: + TextureCubeArray.MostDetailedMip = mostDetailedMip; + TextureCubeArray.MipLevels = mipLevels; + TextureCubeArray.First2DArrayFace = firstArraySlice; + TextureCubeArray.NumCubes = arraySize; + break; + case D3D11_SRV_DIMENSION_BUFFEREX: + BufferEx.FirstElement = mostDetailedMip; + BufferEx.NumElements = mipLevels; + BufferEx.Flags = flags; + break; + default: break; + } + } + explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( + __in ID3D11Buffer*, + DXGI_FORMAT format, + UINT firstElement, + UINT numElements, + UINT flags = 0 ) + { + Format = format; + ViewDimension = D3D11_SRV_DIMENSION_BUFFEREX; + BufferEx.FirstElement = firstElement; + BufferEx.NumElements = numElements; + BufferEx.Flags = flags; + } + explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( + __in ID3D11Texture1D* pTex1D, + D3D11_SRV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mostDetailedMip = 0, + UINT mipLevels = -1, + UINT firstArraySlice = 0, + UINT arraySize = -1 ) + { + ViewDimension = viewDimension; + if (DXGI_FORMAT_UNKNOWN == format || -1 == mipLevels || + (-1 == arraySize && D3D11_SRV_DIMENSION_TEXTURE1DARRAY == viewDimension)) + { + D3D11_TEXTURE1D_DESC TexDesc; + pTex1D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip; + if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice; + } + Format = format; + switch (viewDimension) + { + case D3D11_SRV_DIMENSION_TEXTURE1D: + Texture1D.MostDetailedMip = mostDetailedMip; + Texture1D.MipLevels = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MostDetailedMip = mostDetailedMip; + Texture1DArray.MipLevels = mipLevels; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + default: break; + } + } + explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( + __in ID3D11Texture2D* pTex2D, + D3D11_SRV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mostDetailedMip = 0, + UINT mipLevels = -1, + UINT firstArraySlice = 0, // First2DArrayFace for TEXTURECUBEARRAY + UINT arraySize = -1 ) // NumCubes for TEXTURECUBEARRAY + { + ViewDimension = viewDimension; + if (DXGI_FORMAT_UNKNOWN == format || + (-1 == mipLevels && + D3D11_SRV_DIMENSION_TEXTURE2DMS != viewDimension && + D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY != viewDimension) || + (-1 == arraySize && + (D3D11_SRV_DIMENSION_TEXTURE2DARRAY == viewDimension || + D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY == viewDimension || + D3D11_SRV_DIMENSION_TEXTURECUBEARRAY == viewDimension))) + { + D3D11_TEXTURE2D_DESC TexDesc; + pTex2D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip; + if (-1 == arraySize) + { + arraySize = TexDesc.ArraySize - firstArraySlice; + if (D3D11_SRV_DIMENSION_TEXTURECUBEARRAY == viewDimension) arraySize /= 6; + } + } + Format = format; + switch (viewDimension) + { + case D3D11_SRV_DIMENSION_TEXTURE2D: + Texture2D.MostDetailedMip = mostDetailedMip; + Texture2D.MipLevels = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MostDetailedMip = mostDetailedMip; + Texture2DArray.MipLevels = mipLevels; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + case D3D11_SRV_DIMENSION_TEXTURE2DMS: + break; + case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY: + Texture2DMSArray.FirstArraySlice = firstArraySlice; + Texture2DMSArray.ArraySize = arraySize; + break; + case D3D11_SRV_DIMENSION_TEXTURECUBE: + TextureCube.MostDetailedMip = mostDetailedMip; + TextureCube.MipLevels = mipLevels; + break; + case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY: + TextureCubeArray.MostDetailedMip = mostDetailedMip; + TextureCubeArray.MipLevels = mipLevels; + TextureCubeArray.First2DArrayFace = firstArraySlice; + TextureCubeArray.NumCubes = arraySize; + break; + default: break; + } + } + explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( + __in ID3D11Texture3D* pTex3D, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mostDetailedMip = 0, + UINT mipLevels = -1 ) + { + ViewDimension = D3D11_SRV_DIMENSION_TEXTURE3D; + if (DXGI_FORMAT_UNKNOWN == format || -1 == mipLevels) + { + D3D11_TEXTURE3D_DESC TexDesc; + pTex3D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip; + } + Format = format; + Texture3D.MostDetailedMip = mostDetailedMip; + Texture3D.MipLevels = mipLevels; + } + ~CD3D11_SHADER_RESOURCE_VIEW_DESC() {} + operator const D3D11_SHADER_RESOURCE_VIEW_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0010_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0010_v0_0_s_ifspec; + +#ifndef __ID3D11ShaderResourceView_INTERFACE_DEFINED__ +#define __ID3D11ShaderResourceView_INTERFACE_DEFINED__ + +/* interface ID3D11ShaderResourceView */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11ShaderResourceView; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("b0e06fe0-8192-4e1a-b1ca-36d7414710b2") + ID3D11ShaderResourceView : public ID3D11View + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11ShaderResourceViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11ShaderResourceView * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11ShaderResourceView * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11ShaderResourceView * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11ShaderResourceView * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11ShaderResourceView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11ShaderResourceView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11ShaderResourceView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D11ShaderResourceView * This, + /* [annotation] */ + __out ID3D11Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11ShaderResourceView * This, + /* [annotation] */ + __out D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc); + + END_INTERFACE + } ID3D11ShaderResourceViewVtbl; + + interface ID3D11ShaderResourceView + { + CONST_VTBL struct ID3D11ShaderResourceViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11ShaderResourceView_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11ShaderResourceView_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11ShaderResourceView_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11ShaderResourceView_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11ShaderResourceView_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11ShaderResourceView_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11ShaderResourceView_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11ShaderResourceView_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D11ShaderResourceView_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11ShaderResourceView_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0011 */ +/* [local] */ + +typedef struct D3D11_BUFFER_RTV + { + union + { + UINT FirstElement; + UINT ElementOffset; + } ; + union + { + UINT NumElements; + UINT ElementWidth; + } ; + } D3D11_BUFFER_RTV; + +typedef struct D3D11_TEX1D_RTV + { + UINT MipSlice; + } D3D11_TEX1D_RTV; + +typedef struct D3D11_TEX1D_ARRAY_RTV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX1D_ARRAY_RTV; + +typedef struct D3D11_TEX2D_RTV + { + UINT MipSlice; + } D3D11_TEX2D_RTV; + +typedef struct D3D11_TEX2DMS_RTV + { + UINT UnusedField_NothingToDefine; + } D3D11_TEX2DMS_RTV; + +typedef struct D3D11_TEX2D_ARRAY_RTV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX2D_ARRAY_RTV; + +typedef struct D3D11_TEX2DMS_ARRAY_RTV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX2DMS_ARRAY_RTV; + +typedef struct D3D11_TEX3D_RTV + { + UINT MipSlice; + UINT FirstWSlice; + UINT WSize; + } D3D11_TEX3D_RTV; + +typedef struct D3D11_RENDER_TARGET_VIEW_DESC + { + DXGI_FORMAT Format; + D3D11_RTV_DIMENSION ViewDimension; + union + { + D3D11_BUFFER_RTV Buffer; + D3D11_TEX1D_RTV Texture1D; + D3D11_TEX1D_ARRAY_RTV Texture1DArray; + D3D11_TEX2D_RTV Texture2D; + D3D11_TEX2D_ARRAY_RTV Texture2DArray; + D3D11_TEX2DMS_RTV Texture2DMS; + D3D11_TEX2DMS_ARRAY_RTV Texture2DMSArray; + D3D11_TEX3D_RTV Texture3D; + } ; + } D3D11_RENDER_TARGET_VIEW_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_RENDER_TARGET_VIEW_DESC : public D3D11_RENDER_TARGET_VIEW_DESC +{ + CD3D11_RENDER_TARGET_VIEW_DESC() + {} + explicit CD3D11_RENDER_TARGET_VIEW_DESC( const D3D11_RENDER_TARGET_VIEW_DESC& o ) : + D3D11_RENDER_TARGET_VIEW_DESC( o ) + {} + explicit CD3D11_RENDER_TARGET_VIEW_DESC( + D3D11_RTV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, // FirstElement for BUFFER + UINT firstArraySlice = 0, // NumElements for BUFFER, FirstWSlice for TEXTURE3D + UINT arraySize = -1 ) // WSize for TEXTURE3D + { + Format = format; + ViewDimension = viewDimension; + switch (viewDimension) + { + case D3D11_RTV_DIMENSION_BUFFER: + Buffer.FirstElement = mipSlice; + Buffer.NumElements = firstArraySlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE1D: + Texture1D.MipSlice = mipSlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MipSlice = mipSlice; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + case D3D11_RTV_DIMENSION_TEXTURE2D: + Texture2D.MipSlice = mipSlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MipSlice = mipSlice; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + case D3D11_RTV_DIMENSION_TEXTURE2DMS: + break; + case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY: + Texture2DMSArray.FirstArraySlice = firstArraySlice; + Texture2DMSArray.ArraySize = arraySize; + break; + case D3D11_RTV_DIMENSION_TEXTURE3D: + Texture3D.MipSlice = mipSlice; + Texture3D.FirstWSlice = firstArraySlice; + Texture3D.WSize = arraySize; + break; + default: break; + } + } + explicit CD3D11_RENDER_TARGET_VIEW_DESC( + __in ID3D11Buffer*, + DXGI_FORMAT format, + UINT firstElement, + UINT numElements ) + { + Format = format; + ViewDimension = D3D11_RTV_DIMENSION_BUFFER; + Buffer.FirstElement = firstElement; + Buffer.NumElements = numElements; + } + explicit CD3D11_RENDER_TARGET_VIEW_DESC( + __in ID3D11Texture1D* pTex1D, + D3D11_RTV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstArraySlice = 0, + UINT arraySize = -1 ) + { + ViewDimension = viewDimension; + if (DXGI_FORMAT_UNKNOWN == format || + (-1 == arraySize && D3D11_RTV_DIMENSION_TEXTURE1DARRAY == viewDimension)) + { + D3D11_TEXTURE1D_DESC TexDesc; + pTex1D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice; + } + Format = format; + switch (viewDimension) + { + case D3D11_RTV_DIMENSION_TEXTURE1D: + Texture1D.MipSlice = mipSlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MipSlice = mipSlice; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + default: break; + } + } + explicit CD3D11_RENDER_TARGET_VIEW_DESC( + __in ID3D11Texture2D* pTex2D, + D3D11_RTV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstArraySlice = 0, + UINT arraySize = -1 ) + { + ViewDimension = viewDimension; + if (DXGI_FORMAT_UNKNOWN == format || + (-1 == arraySize && + (D3D11_RTV_DIMENSION_TEXTURE2DARRAY == viewDimension || + D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY == viewDimension))) + { + D3D11_TEXTURE2D_DESC TexDesc; + pTex2D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice; + } + Format = format; + switch (viewDimension) + { + case D3D11_RTV_DIMENSION_TEXTURE2D: + Texture2D.MipSlice = mipSlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MipSlice = mipSlice; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + case D3D11_RTV_DIMENSION_TEXTURE2DMS: + break; + case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY: + Texture2DMSArray.FirstArraySlice = firstArraySlice; + Texture2DMSArray.ArraySize = arraySize; + break; + default: break; + } + } + explicit CD3D11_RENDER_TARGET_VIEW_DESC( + __in ID3D11Texture3D* pTex3D, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstWSlice = 0, + UINT wSize = -1 ) + { + ViewDimension = D3D11_RTV_DIMENSION_TEXTURE3D; + if (DXGI_FORMAT_UNKNOWN == format || -1 == wSize) + { + D3D11_TEXTURE3D_DESC TexDesc; + pTex3D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == wSize) wSize = TexDesc.Depth - firstWSlice; + } + Format = format; + Texture3D.MipSlice = mipSlice; + Texture3D.FirstWSlice = firstWSlice; + Texture3D.WSize = wSize; + } + ~CD3D11_RENDER_TARGET_VIEW_DESC() {} + operator const D3D11_RENDER_TARGET_VIEW_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0011_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0011_v0_0_s_ifspec; + +#ifndef __ID3D11RenderTargetView_INTERFACE_DEFINED__ +#define __ID3D11RenderTargetView_INTERFACE_DEFINED__ + +/* interface ID3D11RenderTargetView */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11RenderTargetView; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("dfdba067-0b8d-4865-875b-d7b4516cc164") + ID3D11RenderTargetView : public ID3D11View + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_RENDER_TARGET_VIEW_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11RenderTargetViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11RenderTargetView * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11RenderTargetView * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11RenderTargetView * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11RenderTargetView * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11RenderTargetView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11RenderTargetView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11RenderTargetView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D11RenderTargetView * This, + /* [annotation] */ + __out ID3D11Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11RenderTargetView * This, + /* [annotation] */ + __out D3D11_RENDER_TARGET_VIEW_DESC *pDesc); + + END_INTERFACE + } ID3D11RenderTargetViewVtbl; + + interface ID3D11RenderTargetView + { + CONST_VTBL struct ID3D11RenderTargetViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11RenderTargetView_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11RenderTargetView_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11RenderTargetView_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11RenderTargetView_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11RenderTargetView_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11RenderTargetView_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11RenderTargetView_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11RenderTargetView_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D11RenderTargetView_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11RenderTargetView_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0012 */ +/* [local] */ + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_VIEWPORT : public D3D11_VIEWPORT +{ + CD3D11_VIEWPORT() + {} + explicit CD3D11_VIEWPORT( const D3D11_VIEWPORT& o ) : + D3D11_VIEWPORT( o ) + {} + explicit CD3D11_VIEWPORT( + FLOAT topLeftX, + FLOAT topLeftY, + FLOAT width, + FLOAT height, + FLOAT minDepth = D3D11_MIN_DEPTH, + FLOAT maxDepth = D3D11_MAX_DEPTH ) + { + TopLeftX = topLeftX; + TopLeftY = topLeftY; + Width = width; + Height = height; + MinDepth = minDepth; + MaxDepth = maxDepth; + } + explicit CD3D11_VIEWPORT( + __in ID3D11Buffer*, + __in ID3D11RenderTargetView* pRTView, + FLOAT topLeftX = 0.0f, + FLOAT minDepth = D3D11_MIN_DEPTH, + FLOAT maxDepth = D3D11_MAX_DEPTH ) + { + D3D11_RENDER_TARGET_VIEW_DESC RTVDesc; + pRTView->GetDesc( &RTVDesc ); + UINT NumElements = 0; + switch (RTVDesc.ViewDimension) + { + case D3D11_RTV_DIMENSION_BUFFER: + NumElements = RTVDesc.Buffer.NumElements; + break; + default: break; + } + TopLeftX = topLeftX; + TopLeftY = 0.0f; + Width = NumElements - topLeftX; + Height = 1.0f; + MinDepth = minDepth; + MaxDepth = maxDepth; + } + explicit CD3D11_VIEWPORT( + __in ID3D11Texture1D* pTex1D, + __in ID3D11RenderTargetView* pRTView, + FLOAT topLeftX = 0.0f, + FLOAT minDepth = D3D11_MIN_DEPTH, + FLOAT maxDepth = D3D11_MAX_DEPTH ) + { + D3D11_TEXTURE1D_DESC TexDesc; + pTex1D->GetDesc( &TexDesc ); + D3D11_RENDER_TARGET_VIEW_DESC RTVDesc; + pRTView->GetDesc( &RTVDesc ); + UINT MipSlice = 0; + switch (RTVDesc.ViewDimension) + { + case D3D11_RTV_DIMENSION_TEXTURE1D: + MipSlice = RTVDesc.Texture1D.MipSlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE1DARRAY: + MipSlice = RTVDesc.Texture1DArray.MipSlice; + break; + default: break; + } + const UINT SubResourceWidth = TexDesc.Width / (UINT( 1 ) << MipSlice); + TopLeftX = topLeftX; + TopLeftY = 0.0f; + Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX; + Height = 1.0f; + MinDepth = minDepth; + MaxDepth = maxDepth; + } + explicit CD3D11_VIEWPORT( + __in ID3D11Texture2D* pTex2D, + __in ID3D11RenderTargetView* pRTView, + FLOAT topLeftX = 0.0f, + FLOAT topLeftY = 0.0f, + FLOAT minDepth = D3D11_MIN_DEPTH, + FLOAT maxDepth = D3D11_MAX_DEPTH ) + { + D3D11_TEXTURE2D_DESC TexDesc; + pTex2D->GetDesc( &TexDesc ); + D3D11_RENDER_TARGET_VIEW_DESC RTVDesc; + pRTView->GetDesc( &RTVDesc ); + UINT MipSlice = 0; + switch (RTVDesc.ViewDimension) + { + case D3D11_RTV_DIMENSION_TEXTURE2D: + MipSlice = RTVDesc.Texture2D.MipSlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE2DARRAY: + MipSlice = RTVDesc.Texture2DArray.MipSlice; + break; + case D3D11_RTV_DIMENSION_TEXTURE2DMS: + case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY: + break; + default: break; + } + const UINT SubResourceWidth = TexDesc.Width / (UINT( 1 ) << MipSlice); + const UINT SubResourceHeight = TexDesc.Height / (UINT( 1 ) << MipSlice); + TopLeftX = topLeftX; + TopLeftY = topLeftY; + Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX; + Height = (SubResourceHeight ? SubResourceHeight : 1) - topLeftY; + MinDepth = minDepth; + MaxDepth = maxDepth; + } + explicit CD3D11_VIEWPORT( + __in ID3D11Texture3D* pTex3D, + __in ID3D11RenderTargetView* pRTView, + FLOAT topLeftX = 0.0f, + FLOAT topLeftY = 0.0f, + FLOAT minDepth = D3D11_MIN_DEPTH, + FLOAT maxDepth = D3D11_MAX_DEPTH ) + { + D3D11_TEXTURE3D_DESC TexDesc; + pTex3D->GetDesc( &TexDesc ); + D3D11_RENDER_TARGET_VIEW_DESC RTVDesc; + pRTView->GetDesc( &RTVDesc ); + UINT MipSlice = 0; + switch (RTVDesc.ViewDimension) + { + case D3D11_RTV_DIMENSION_TEXTURE3D: + MipSlice = RTVDesc.Texture3D.MipSlice; + break; + default: break; + } + const UINT SubResourceWidth = TexDesc.Width / (UINT( 1 ) << MipSlice); + const UINT SubResourceHeight = TexDesc.Height / (UINT( 1 ) << MipSlice); + TopLeftX = topLeftX; + TopLeftY = topLeftY; + Width = (SubResourceWidth ? SubResourceWidth : 1) - topLeftX; + Height = (SubResourceHeight ? SubResourceHeight : 1) - topLeftY; + MinDepth = minDepth; + MaxDepth = maxDepth; + } + ~CD3D11_VIEWPORT() {} + operator const D3D11_VIEWPORT&() const { return *this; } +}; +extern "C"{ +#endif +typedef struct D3D11_TEX1D_DSV + { + UINT MipSlice; + } D3D11_TEX1D_DSV; + +typedef struct D3D11_TEX1D_ARRAY_DSV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX1D_ARRAY_DSV; + +typedef struct D3D11_TEX2D_DSV + { + UINT MipSlice; + } D3D11_TEX2D_DSV; + +typedef struct D3D11_TEX2D_ARRAY_DSV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX2D_ARRAY_DSV; + +typedef struct D3D11_TEX2DMS_DSV + { + UINT UnusedField_NothingToDefine; + } D3D11_TEX2DMS_DSV; + +typedef struct D3D11_TEX2DMS_ARRAY_DSV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX2DMS_ARRAY_DSV; + +typedef +enum D3D11_DSV_FLAG + { D3D11_DSV_READ_ONLY_DEPTH = 0x1L, + D3D11_DSV_READ_ONLY_STENCIL = 0x2L + } D3D11_DSV_FLAG; + +typedef struct D3D11_DEPTH_STENCIL_VIEW_DESC + { + DXGI_FORMAT Format; + D3D11_DSV_DIMENSION ViewDimension; + UINT Flags; + union + { + D3D11_TEX1D_DSV Texture1D; + D3D11_TEX1D_ARRAY_DSV Texture1DArray; + D3D11_TEX2D_DSV Texture2D; + D3D11_TEX2D_ARRAY_DSV Texture2DArray; + D3D11_TEX2DMS_DSV Texture2DMS; + D3D11_TEX2DMS_ARRAY_DSV Texture2DMSArray; + } ; + } D3D11_DEPTH_STENCIL_VIEW_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_DEPTH_STENCIL_VIEW_DESC : public D3D11_DEPTH_STENCIL_VIEW_DESC +{ + CD3D11_DEPTH_STENCIL_VIEW_DESC() + {} + explicit CD3D11_DEPTH_STENCIL_VIEW_DESC( const D3D11_DEPTH_STENCIL_VIEW_DESC& o ) : + D3D11_DEPTH_STENCIL_VIEW_DESC( o ) + {} + explicit CD3D11_DEPTH_STENCIL_VIEW_DESC( + D3D11_DSV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstArraySlice = 0, + UINT arraySize = -1, + UINT flags = 0 ) + { + Format = format; + ViewDimension = viewDimension; + Flags = flags; + switch (viewDimension) + { + case D3D11_DSV_DIMENSION_TEXTURE1D: + Texture1D.MipSlice = mipSlice; + break; + case D3D11_DSV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MipSlice = mipSlice; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + case D3D11_DSV_DIMENSION_TEXTURE2D: + Texture2D.MipSlice = mipSlice; + break; + case D3D11_DSV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MipSlice = mipSlice; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + case D3D11_DSV_DIMENSION_TEXTURE2DMS: + break; + case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY: + Texture2DMSArray.FirstArraySlice = firstArraySlice; + Texture2DMSArray.ArraySize = arraySize; + break; + default: break; + } + } + explicit CD3D11_DEPTH_STENCIL_VIEW_DESC( + __in ID3D11Texture1D* pTex1D, + D3D11_DSV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstArraySlice = 0, + UINT arraySize = -1, + UINT flags = 0 ) + { + ViewDimension = viewDimension; + Flags = flags; + if (DXGI_FORMAT_UNKNOWN == format || + (-1 == arraySize && D3D11_DSV_DIMENSION_TEXTURE1DARRAY == viewDimension)) + { + D3D11_TEXTURE1D_DESC TexDesc; + pTex1D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice; + } + Format = format; + switch (viewDimension) + { + case D3D11_DSV_DIMENSION_TEXTURE1D: + Texture1D.MipSlice = mipSlice; + break; + case D3D11_DSV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MipSlice = mipSlice; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + default: break; + } + } + explicit CD3D11_DEPTH_STENCIL_VIEW_DESC( + __in ID3D11Texture2D* pTex2D, + D3D11_DSV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstArraySlice = 0, + UINT arraySize = -1, + UINT flags = 0 ) + { + ViewDimension = viewDimension; + Flags = flags; + if (DXGI_FORMAT_UNKNOWN == format || + (-1 == arraySize && + (D3D11_DSV_DIMENSION_TEXTURE2DARRAY == viewDimension || + D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY == viewDimension))) + { + D3D11_TEXTURE2D_DESC TexDesc; + pTex2D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice; + } + Format = format; + switch (viewDimension) + { + case D3D11_DSV_DIMENSION_TEXTURE2D: + Texture2D.MipSlice = mipSlice; + break; + case D3D11_DSV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MipSlice = mipSlice; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + case D3D11_DSV_DIMENSION_TEXTURE2DMS: + break; + case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY: + Texture2DMSArray.FirstArraySlice = firstArraySlice; + Texture2DMSArray.ArraySize = arraySize; + break; + default: break; + } + } + ~CD3D11_DEPTH_STENCIL_VIEW_DESC() {} + operator const D3D11_DEPTH_STENCIL_VIEW_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0012_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0012_v0_0_s_ifspec; + +#ifndef __ID3D11DepthStencilView_INTERFACE_DEFINED__ +#define __ID3D11DepthStencilView_INTERFACE_DEFINED__ + +/* interface ID3D11DepthStencilView */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11DepthStencilView; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9fdac92a-1876-48c3-afad-25b94f84a9b6") + ID3D11DepthStencilView : public ID3D11View + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11DepthStencilViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11DepthStencilView * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11DepthStencilView * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11DepthStencilView * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11DepthStencilView * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11DepthStencilView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11DepthStencilView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11DepthStencilView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D11DepthStencilView * This, + /* [annotation] */ + __out ID3D11Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11DepthStencilView * This, + /* [annotation] */ + __out D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc); + + END_INTERFACE + } ID3D11DepthStencilViewVtbl; + + interface ID3D11DepthStencilView + { + CONST_VTBL struct ID3D11DepthStencilViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11DepthStencilView_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11DepthStencilView_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11DepthStencilView_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11DepthStencilView_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11DepthStencilView_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11DepthStencilView_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11DepthStencilView_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11DepthStencilView_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D11DepthStencilView_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11DepthStencilView_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0013 */ +/* [local] */ + +typedef +enum D3D11_BUFFER_UAV_FLAG + { D3D11_BUFFER_UAV_FLAG_RAW = 0x1, + D3D11_BUFFER_UAV_FLAG_APPEND = 0x2, + D3D11_BUFFER_UAV_FLAG_COUNTER = 0x4 + } D3D11_BUFFER_UAV_FLAG; + +typedef struct D3D11_BUFFER_UAV + { + UINT FirstElement; + UINT NumElements; + UINT Flags; + } D3D11_BUFFER_UAV; + +typedef struct D3D11_TEX1D_UAV + { + UINT MipSlice; + } D3D11_TEX1D_UAV; + +typedef struct D3D11_TEX1D_ARRAY_UAV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX1D_ARRAY_UAV; + +typedef struct D3D11_TEX2D_UAV + { + UINT MipSlice; + } D3D11_TEX2D_UAV; + +typedef struct D3D11_TEX2D_ARRAY_UAV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D11_TEX2D_ARRAY_UAV; + +typedef struct D3D11_TEX3D_UAV + { + UINT MipSlice; + UINT FirstWSlice; + UINT WSize; + } D3D11_TEX3D_UAV; + +typedef struct D3D11_UNORDERED_ACCESS_VIEW_DESC + { + DXGI_FORMAT Format; + D3D11_UAV_DIMENSION ViewDimension; + union + { + D3D11_BUFFER_UAV Buffer; + D3D11_TEX1D_UAV Texture1D; + D3D11_TEX1D_ARRAY_UAV Texture1DArray; + D3D11_TEX2D_UAV Texture2D; + D3D11_TEX2D_ARRAY_UAV Texture2DArray; + D3D11_TEX3D_UAV Texture3D; + } ; + } D3D11_UNORDERED_ACCESS_VIEW_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_UNORDERED_ACCESS_VIEW_DESC : public D3D11_UNORDERED_ACCESS_VIEW_DESC +{ + CD3D11_UNORDERED_ACCESS_VIEW_DESC() + {} + explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( const D3D11_UNORDERED_ACCESS_VIEW_DESC& o ) : + D3D11_UNORDERED_ACCESS_VIEW_DESC( o ) + {} + explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( + D3D11_UAV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, // FirstElement for BUFFER + UINT firstArraySlice = 0, // NumElements for BUFFER, FirstWSlice for TEXTURE3D + UINT arraySize = -1, // WSize for TEXTURE3D + UINT flags = 0 ) // BUFFER only + { + Format = format; + ViewDimension = viewDimension; + switch (viewDimension) + { + case D3D11_UAV_DIMENSION_BUFFER: + Buffer.FirstElement = mipSlice; + Buffer.NumElements = firstArraySlice; + Buffer.Flags = flags; + break; + case D3D11_UAV_DIMENSION_TEXTURE1D: + Texture1D.MipSlice = mipSlice; + break; + case D3D11_UAV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MipSlice = mipSlice; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + case D3D11_UAV_DIMENSION_TEXTURE2D: + Texture2D.MipSlice = mipSlice; + break; + case D3D11_UAV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MipSlice = mipSlice; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + case D3D11_UAV_DIMENSION_TEXTURE3D: + Texture3D.MipSlice = mipSlice; + Texture3D.FirstWSlice = firstArraySlice; + Texture3D.WSize = arraySize; + break; + default: break; + } + } + explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( + __in ID3D11Buffer*, + DXGI_FORMAT format, + UINT firstElement, + UINT numElements, + UINT flags = 0 ) + { + Format = format; + ViewDimension = D3D11_UAV_DIMENSION_BUFFER; + Buffer.FirstElement = firstElement; + Buffer.NumElements = numElements; + Buffer.Flags = flags; + } + explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( + __in ID3D11Texture1D* pTex1D, + D3D11_UAV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstArraySlice = 0, + UINT arraySize = -1 ) + { + ViewDimension = viewDimension; + if (DXGI_FORMAT_UNKNOWN == format || + (-1 == arraySize && D3D11_UAV_DIMENSION_TEXTURE1DARRAY == viewDimension)) + { + D3D11_TEXTURE1D_DESC TexDesc; + pTex1D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice; + } + Format = format; + switch (viewDimension) + { + case D3D11_UAV_DIMENSION_TEXTURE1D: + Texture1D.MipSlice = mipSlice; + break; + case D3D11_UAV_DIMENSION_TEXTURE1DARRAY: + Texture1DArray.MipSlice = mipSlice; + Texture1DArray.FirstArraySlice = firstArraySlice; + Texture1DArray.ArraySize = arraySize; + break; + default: break; + } + } + explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( + __in ID3D11Texture2D* pTex2D, + D3D11_UAV_DIMENSION viewDimension, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstArraySlice = 0, + UINT arraySize = -1 ) + { + ViewDimension = viewDimension; + if (DXGI_FORMAT_UNKNOWN == format || + (-1 == arraySize && D3D11_UAV_DIMENSION_TEXTURE2DARRAY == viewDimension)) + { + D3D11_TEXTURE2D_DESC TexDesc; + pTex2D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice; + } + Format = format; + switch (viewDimension) + { + case D3D11_UAV_DIMENSION_TEXTURE2D: + Texture2D.MipSlice = mipSlice; + break; + case D3D11_UAV_DIMENSION_TEXTURE2DARRAY: + Texture2DArray.MipSlice = mipSlice; + Texture2DArray.FirstArraySlice = firstArraySlice; + Texture2DArray.ArraySize = arraySize; + break; + default: break; + } + } + explicit CD3D11_UNORDERED_ACCESS_VIEW_DESC( + __in ID3D11Texture3D* pTex3D, + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN, + UINT mipSlice = 0, + UINT firstWSlice = 0, + UINT wSize = -1 ) + { + ViewDimension = D3D11_UAV_DIMENSION_TEXTURE3D; + if (DXGI_FORMAT_UNKNOWN == format || -1 == wSize) + { + D3D11_TEXTURE3D_DESC TexDesc; + pTex3D->GetDesc( &TexDesc ); + if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format; + if (-1 == wSize) wSize = TexDesc.Depth - firstWSlice; + } + Format = format; + Texture3D.MipSlice = mipSlice; + Texture3D.FirstWSlice = firstWSlice; + Texture3D.WSize = wSize; + } + ~CD3D11_UNORDERED_ACCESS_VIEW_DESC() {} + operator const D3D11_UNORDERED_ACCESS_VIEW_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0013_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0013_v0_0_s_ifspec; + +#ifndef __ID3D11UnorderedAccessView_INTERFACE_DEFINED__ +#define __ID3D11UnorderedAccessView_INTERFACE_DEFINED__ + +/* interface ID3D11UnorderedAccessView */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11UnorderedAccessView; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("28acf509-7f5c-48f6-8611-f316010a6380") + ID3D11UnorderedAccessView : public ID3D11View + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11UnorderedAccessViewVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11UnorderedAccessView * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11UnorderedAccessView * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11UnorderedAccessView * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11UnorderedAccessView * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11UnorderedAccessView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11UnorderedAccessView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11UnorderedAccessView * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetResource )( + ID3D11UnorderedAccessView * This, + /* [annotation] */ + __out ID3D11Resource **ppResource); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11UnorderedAccessView * This, + /* [annotation] */ + __out D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc); + + END_INTERFACE + } ID3D11UnorderedAccessViewVtbl; + + interface ID3D11UnorderedAccessView + { + CONST_VTBL struct ID3D11UnorderedAccessViewVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11UnorderedAccessView_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11UnorderedAccessView_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11UnorderedAccessView_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11UnorderedAccessView_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11UnorderedAccessView_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11UnorderedAccessView_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11UnorderedAccessView_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11UnorderedAccessView_GetResource(This,ppResource) \ + ( (This)->lpVtbl -> GetResource(This,ppResource) ) + + +#define ID3D11UnorderedAccessView_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11UnorderedAccessView_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11VertexShader_INTERFACE_DEFINED__ +#define __ID3D11VertexShader_INTERFACE_DEFINED__ + +/* interface ID3D11VertexShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11VertexShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3b301d64-d678-4289-8897-22f8928b72f3") + ID3D11VertexShader : public ID3D11DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11VertexShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11VertexShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11VertexShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11VertexShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11VertexShader * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11VertexShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11VertexShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11VertexShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11VertexShaderVtbl; + + interface ID3D11VertexShader + { + CONST_VTBL struct ID3D11VertexShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11VertexShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11VertexShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11VertexShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11VertexShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11VertexShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11VertexShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11VertexShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11VertexShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11HullShader_INTERFACE_DEFINED__ +#define __ID3D11HullShader_INTERFACE_DEFINED__ + +/* interface ID3D11HullShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11HullShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8e5c6061-628a-4c8e-8264-bbe45cb3d5dd") + ID3D11HullShader : public ID3D11DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11HullShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11HullShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11HullShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11HullShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11HullShader * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11HullShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11HullShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11HullShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11HullShaderVtbl; + + interface ID3D11HullShader + { + CONST_VTBL struct ID3D11HullShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11HullShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11HullShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11HullShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11HullShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11HullShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11HullShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11HullShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11HullShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11DomainShader_INTERFACE_DEFINED__ +#define __ID3D11DomainShader_INTERFACE_DEFINED__ + +/* interface ID3D11DomainShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11DomainShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("f582c508-0f36-490c-9977-31eece268cfa") + ID3D11DomainShader : public ID3D11DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11DomainShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11DomainShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11DomainShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11DomainShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11DomainShader * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11DomainShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11DomainShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11DomainShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11DomainShaderVtbl; + + interface ID3D11DomainShader + { + CONST_VTBL struct ID3D11DomainShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11DomainShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11DomainShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11DomainShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11DomainShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11DomainShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11DomainShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11DomainShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11DomainShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11GeometryShader_INTERFACE_DEFINED__ +#define __ID3D11GeometryShader_INTERFACE_DEFINED__ + +/* interface ID3D11GeometryShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11GeometryShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("38325b96-effb-4022-ba02-2e795b70275c") + ID3D11GeometryShader : public ID3D11DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11GeometryShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11GeometryShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11GeometryShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11GeometryShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11GeometryShader * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11GeometryShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11GeometryShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11GeometryShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11GeometryShaderVtbl; + + interface ID3D11GeometryShader + { + CONST_VTBL struct ID3D11GeometryShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11GeometryShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11GeometryShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11GeometryShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11GeometryShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11GeometryShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11GeometryShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11GeometryShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11GeometryShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11PixelShader_INTERFACE_DEFINED__ +#define __ID3D11PixelShader_INTERFACE_DEFINED__ + +/* interface ID3D11PixelShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11PixelShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("ea82e40d-51dc-4f33-93d4-db7c9125ae8c") + ID3D11PixelShader : public ID3D11DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11PixelShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11PixelShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11PixelShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11PixelShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11PixelShader * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11PixelShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11PixelShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11PixelShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11PixelShaderVtbl; + + interface ID3D11PixelShader + { + CONST_VTBL struct ID3D11PixelShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11PixelShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11PixelShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11PixelShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11PixelShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11PixelShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11PixelShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11PixelShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11PixelShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11ComputeShader_INTERFACE_DEFINED__ +#define __ID3D11ComputeShader_INTERFACE_DEFINED__ + +/* interface ID3D11ComputeShader */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11ComputeShader; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4f5b196e-c2bd-495e-bd01-1fded38e4969") + ID3D11ComputeShader : public ID3D11DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11ComputeShaderVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11ComputeShader * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11ComputeShader * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11ComputeShader * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11ComputeShader * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11ComputeShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11ComputeShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11ComputeShader * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11ComputeShaderVtbl; + + interface ID3D11ComputeShader + { + CONST_VTBL struct ID3D11ComputeShaderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11ComputeShader_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11ComputeShader_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11ComputeShader_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11ComputeShader_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11ComputeShader_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11ComputeShader_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11ComputeShader_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11ComputeShader_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11InputLayout_INTERFACE_DEFINED__ +#define __ID3D11InputLayout_INTERFACE_DEFINED__ + +/* interface ID3D11InputLayout */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11InputLayout; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("e4819ddc-4cf0-4025-bd26-5de82a3e07b7") + ID3D11InputLayout : public ID3D11DeviceChild + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11InputLayoutVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11InputLayout * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11InputLayout * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11InputLayout * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11InputLayout * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11InputLayout * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11InputLayout * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11InputLayout * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + END_INTERFACE + } ID3D11InputLayoutVtbl; + + interface ID3D11InputLayout + { + CONST_VTBL struct ID3D11InputLayoutVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11InputLayout_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11InputLayout_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11InputLayout_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11InputLayout_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11InputLayout_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11InputLayout_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11InputLayout_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11InputLayout_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0021 */ +/* [local] */ + +typedef +enum D3D11_FILTER + { D3D11_FILTER_MIN_MAG_MIP_POINT = 0, + D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1, + D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4, + D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5, + D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10, + D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, + D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14, + D3D11_FILTER_MIN_MAG_MIP_LINEAR = 0x15, + D3D11_FILTER_ANISOTROPIC = 0x55, + D3D11_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80, + D3D11_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81, + D3D11_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84, + D3D11_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85, + D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90, + D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91, + D3D11_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94, + D3D11_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95, + D3D11_FILTER_COMPARISON_ANISOTROPIC = 0xd5 + } D3D11_FILTER; + +typedef +enum D3D11_FILTER_TYPE + { D3D11_FILTER_TYPE_POINT = 0, + D3D11_FILTER_TYPE_LINEAR = 1 + } D3D11_FILTER_TYPE; + +#define D3D11_FILTER_TYPE_MASK ( 0x3 ) + +#define D3D11_MIN_FILTER_SHIFT ( 4 ) + +#define D3D11_MAG_FILTER_SHIFT ( 2 ) + +#define D3D11_MIP_FILTER_SHIFT ( 0 ) + +#define D3D11_COMPARISON_FILTERING_BIT ( 0x80 ) + +#define D3D11_ANISOTROPIC_FILTERING_BIT ( 0x40 ) + +#define D3D11_ENCODE_BASIC_FILTER( min, mag, mip, bComparison ) \ + ( ( D3D11_FILTER ) ( \ + ( ( bComparison ) ? D3D11_COMPARISON_FILTERING_BIT : 0 ) | \ + ( ( ( min ) & D3D11_FILTER_TYPE_MASK ) << D3D11_MIN_FILTER_SHIFT ) | \ + ( ( ( mag ) & D3D11_FILTER_TYPE_MASK ) << D3D11_MAG_FILTER_SHIFT ) | \ + ( ( ( mip ) & D3D11_FILTER_TYPE_MASK ) << D3D11_MIP_FILTER_SHIFT ) ) ) +#define D3D11_ENCODE_ANISOTROPIC_FILTER( bComparison ) \ + ( ( D3D11_FILTER ) ( \ + D3D11_ANISOTROPIC_FILTERING_BIT | \ + D3D11_ENCODE_BASIC_FILTER( D3D11_FILTER_TYPE_LINEAR, \ + D3D11_FILTER_TYPE_LINEAR, \ + D3D11_FILTER_TYPE_LINEAR, \ + bComparison ) ) ) +#define D3D11_DECODE_MIN_FILTER( d3d11Filter ) \ + ( ( D3D11_FILTER_TYPE ) \ + ( ( ( d3d11Filter ) >> D3D11_MIN_FILTER_SHIFT ) & D3D11_FILTER_TYPE_MASK ) ) +#define D3D11_DECODE_MAG_FILTER( d3d11Filter ) \ + ( ( D3D11_FILTER_TYPE ) \ + ( ( ( d3d11Filter ) >> D3D11_MAG_FILTER_SHIFT ) & D3D11_FILTER_TYPE_MASK ) ) +#define D3D11_DECODE_MIP_FILTER( d3d11Filter ) \ + ( ( D3D11_FILTER_TYPE ) \ + ( ( ( d3d11Filter ) >> D3D11_MIP_FILTER_SHIFT ) & D3D11_FILTER_TYPE_MASK ) ) +#define D3D11_DECODE_IS_COMPARISON_FILTER( d3d11Filter ) \ + ( ( d3d11Filter ) & D3D11_COMPARISON_FILTERING_BIT ) +#define D3D11_DECODE_IS_ANISOTROPIC_FILTER( d3d11Filter ) \ + ( ( ( d3d11Filter ) & D3D11_ANISOTROPIC_FILTERING_BIT ) && \ + ( D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MIN_FILTER( d3d11Filter ) ) && \ + ( D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MAG_FILTER( d3d11Filter ) ) && \ + ( D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MIP_FILTER( d3d11Filter ) ) ) +typedef +enum D3D11_TEXTURE_ADDRESS_MODE + { D3D11_TEXTURE_ADDRESS_WRAP = 1, + D3D11_TEXTURE_ADDRESS_MIRROR = 2, + D3D11_TEXTURE_ADDRESS_CLAMP = 3, + D3D11_TEXTURE_ADDRESS_BORDER = 4, + D3D11_TEXTURE_ADDRESS_MIRROR_ONCE = 5 + } D3D11_TEXTURE_ADDRESS_MODE; + +typedef struct D3D11_SAMPLER_DESC + { + D3D11_FILTER Filter; + D3D11_TEXTURE_ADDRESS_MODE AddressU; + D3D11_TEXTURE_ADDRESS_MODE AddressV; + D3D11_TEXTURE_ADDRESS_MODE AddressW; + FLOAT MipLODBias; + UINT MaxAnisotropy; + D3D11_COMPARISON_FUNC ComparisonFunc; + FLOAT BorderColor[ 4 ]; + FLOAT MinLOD; + FLOAT MaxLOD; + } D3D11_SAMPLER_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_SAMPLER_DESC : public D3D11_SAMPLER_DESC +{ + CD3D11_SAMPLER_DESC() + {} + explicit CD3D11_SAMPLER_DESC( const D3D11_SAMPLER_DESC& o ) : + D3D11_SAMPLER_DESC( o ) + {} + explicit CD3D11_SAMPLER_DESC( CD3D11_DEFAULT ) + { + Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; + AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; + AddressV = D3D11_TEXTURE_ADDRESS_CLAMP; + AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; + MipLODBias = 0; + MaxAnisotropy = 1; + ComparisonFunc = D3D11_COMPARISON_NEVER; + BorderColor[ 0 ] = 1.0f; + BorderColor[ 1 ] = 1.0f; + BorderColor[ 2 ] = 1.0f; + BorderColor[ 3 ] = 1.0f; + MinLOD = -3.402823466e+38F; // -FLT_MAX + MaxLOD = 3.402823466e+38F; // FLT_MAX + } + explicit CD3D11_SAMPLER_DESC( + D3D11_FILTER filter, + D3D11_TEXTURE_ADDRESS_MODE addressU, + D3D11_TEXTURE_ADDRESS_MODE addressV, + D3D11_TEXTURE_ADDRESS_MODE addressW, + FLOAT mipLODBias, + UINT maxAnisotropy, + D3D11_COMPARISON_FUNC comparisonFunc, + __in_ecount_opt( 4 ) const FLOAT* borderColor, // RGBA + FLOAT minLOD, + FLOAT maxLOD ) + { + Filter = filter; + AddressU = addressU; + AddressV = addressV; + AddressW = addressW; + MipLODBias = mipLODBias; + MaxAnisotropy = maxAnisotropy; + ComparisonFunc = comparisonFunc; + const float defaultColor[ 4 ] = { 1.0f, 1.0f, 1.0f, 1.0f }; + if (!borderColor) borderColor = defaultColor; + BorderColor[ 0 ] = borderColor[ 0 ]; + BorderColor[ 1 ] = borderColor[ 1 ]; + BorderColor[ 2 ] = borderColor[ 2 ]; + BorderColor[ 3 ] = borderColor[ 3 ]; + MinLOD = minLOD; + MaxLOD = maxLOD; + } + ~CD3D11_SAMPLER_DESC() {} + operator const D3D11_SAMPLER_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0021_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0021_v0_0_s_ifspec; + +#ifndef __ID3D11SamplerState_INTERFACE_DEFINED__ +#define __ID3D11SamplerState_INTERFACE_DEFINED__ + +/* interface ID3D11SamplerState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11SamplerState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("da6fea51-564c-4487-9810-f0d0f9b4e3a5") + ID3D11SamplerState : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_SAMPLER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11SamplerStateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11SamplerState * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11SamplerState * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11SamplerState * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11SamplerState * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11SamplerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11SamplerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11SamplerState * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11SamplerState * This, + /* [annotation] */ + __out D3D11_SAMPLER_DESC *pDesc); + + END_INTERFACE + } ID3D11SamplerStateVtbl; + + interface ID3D11SamplerState + { + CONST_VTBL struct ID3D11SamplerStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11SamplerState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11SamplerState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11SamplerState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11SamplerState_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11SamplerState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11SamplerState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11SamplerState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11SamplerState_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11SamplerState_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0022 */ +/* [local] */ + +typedef +enum D3D11_FORMAT_SUPPORT + { D3D11_FORMAT_SUPPORT_BUFFER = 0x1, + D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER = 0x2, + D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER = 0x4, + D3D11_FORMAT_SUPPORT_SO_BUFFER = 0x8, + D3D11_FORMAT_SUPPORT_TEXTURE1D = 0x10, + D3D11_FORMAT_SUPPORT_TEXTURE2D = 0x20, + D3D11_FORMAT_SUPPORT_TEXTURE3D = 0x40, + D3D11_FORMAT_SUPPORT_TEXTURECUBE = 0x80, + D3D11_FORMAT_SUPPORT_SHADER_LOAD = 0x100, + D3D11_FORMAT_SUPPORT_SHADER_SAMPLE = 0x200, + D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON = 0x400, + D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT = 0x800, + D3D11_FORMAT_SUPPORT_MIP = 0x1000, + D3D11_FORMAT_SUPPORT_MIP_AUTOGEN = 0x2000, + D3D11_FORMAT_SUPPORT_RENDER_TARGET = 0x4000, + D3D11_FORMAT_SUPPORT_BLENDABLE = 0x8000, + D3D11_FORMAT_SUPPORT_DEPTH_STENCIL = 0x10000, + D3D11_FORMAT_SUPPORT_CPU_LOCKABLE = 0x20000, + D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE = 0x40000, + D3D11_FORMAT_SUPPORT_DISPLAY = 0x80000, + D3D11_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = 0x100000, + D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = 0x200000, + D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD = 0x400000, + D3D11_FORMAT_SUPPORT_SHADER_GATHER = 0x800000, + D3D11_FORMAT_SUPPORT_BACK_BUFFER_CAST = 0x1000000, + D3D11_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW = 0x2000000, + D3D11_FORMAT_SUPPORT_SHADER_GATHER_COMPARISON = 0x4000000 + } D3D11_FORMAT_SUPPORT; + +typedef +enum D3D11_FORMAT_SUPPORT2 + { D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_ADD = 0x1, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS = 0x2, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE = 0x4, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE = 0x8, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX = 0x10, + D3D11_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX = 0x20, + D3D11_FORMAT_SUPPORT2_UAV_TYPED_LOAD = 0x40, + D3D11_FORMAT_SUPPORT2_UAV_TYPED_STORE = 0x80 + } D3D11_FORMAT_SUPPORT2; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0022_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0022_v0_0_s_ifspec; + +#ifndef __ID3D11Asynchronous_INTERFACE_DEFINED__ +#define __ID3D11Asynchronous_INTERFACE_DEFINED__ + +/* interface ID3D11Asynchronous */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Asynchronous; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4b35d0cd-1e15-4258-9c98-1b1333f6dd3b") + ID3D11Asynchronous : public ID3D11DeviceChild + { + public: + virtual UINT STDMETHODCALLTYPE GetDataSize( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11AsynchronousVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Asynchronous * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Asynchronous * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Asynchronous * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Asynchronous * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Asynchronous * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Asynchronous * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Asynchronous * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D11Asynchronous * This); + + END_INTERFACE + } ID3D11AsynchronousVtbl; + + interface ID3D11Asynchronous + { + CONST_VTBL struct ID3D11AsynchronousVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Asynchronous_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Asynchronous_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Asynchronous_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Asynchronous_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Asynchronous_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Asynchronous_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Asynchronous_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Asynchronous_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Asynchronous_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0023 */ +/* [local] */ + +typedef +enum D3D11_ASYNC_GETDATA_FLAG + { D3D11_ASYNC_GETDATA_DONOTFLUSH = 0x1 + } D3D11_ASYNC_GETDATA_FLAG; + +typedef +enum D3D11_QUERY + { D3D11_QUERY_EVENT = 0, + D3D11_QUERY_OCCLUSION = ( D3D11_QUERY_EVENT + 1 ) , + D3D11_QUERY_TIMESTAMP = ( D3D11_QUERY_OCCLUSION + 1 ) , + D3D11_QUERY_TIMESTAMP_DISJOINT = ( D3D11_QUERY_TIMESTAMP + 1 ) , + D3D11_QUERY_PIPELINE_STATISTICS = ( D3D11_QUERY_TIMESTAMP_DISJOINT + 1 ) , + D3D11_QUERY_OCCLUSION_PREDICATE = ( D3D11_QUERY_PIPELINE_STATISTICS + 1 ) , + D3D11_QUERY_SO_STATISTICS = ( D3D11_QUERY_OCCLUSION_PREDICATE + 1 ) , + D3D11_QUERY_SO_OVERFLOW_PREDICATE = ( D3D11_QUERY_SO_STATISTICS + 1 ) , + D3D11_QUERY_SO_STATISTICS_STREAM0 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE + 1 ) , + D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0 = ( D3D11_QUERY_SO_STATISTICS_STREAM0 + 1 ) , + D3D11_QUERY_SO_STATISTICS_STREAM1 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0 + 1 ) , + D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1 = ( D3D11_QUERY_SO_STATISTICS_STREAM1 + 1 ) , + D3D11_QUERY_SO_STATISTICS_STREAM2 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1 + 1 ) , + D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2 = ( D3D11_QUERY_SO_STATISTICS_STREAM2 + 1 ) , + D3D11_QUERY_SO_STATISTICS_STREAM3 = ( D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2 + 1 ) , + D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM3 = ( D3D11_QUERY_SO_STATISTICS_STREAM3 + 1 ) + } D3D11_QUERY; + +typedef +enum D3D11_QUERY_MISC_FLAG + { D3D11_QUERY_MISC_PREDICATEHINT = 0x1 + } D3D11_QUERY_MISC_FLAG; + +typedef struct D3D11_QUERY_DESC + { + D3D11_QUERY Query; + UINT MiscFlags; + } D3D11_QUERY_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_QUERY_DESC : public D3D11_QUERY_DESC +{ + CD3D11_QUERY_DESC() + {} + explicit CD3D11_QUERY_DESC( const D3D11_QUERY_DESC& o ) : + D3D11_QUERY_DESC( o ) + {} + explicit CD3D11_QUERY_DESC( + D3D11_QUERY query, + UINT miscFlags = 0 ) + { + Query = query; + MiscFlags = miscFlags; + } + ~CD3D11_QUERY_DESC() {} + operator const D3D11_QUERY_DESC&() const { return *this; } +}; +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0023_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0023_v0_0_s_ifspec; + +#ifndef __ID3D11Query_INTERFACE_DEFINED__ +#define __ID3D11Query_INTERFACE_DEFINED__ + +/* interface ID3D11Query */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Query; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("d6c00747-87b7-425e-b84d-44d108560afd") + ID3D11Query : public ID3D11Asynchronous + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_QUERY_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11QueryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Query * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Query * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Query * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Query * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Query * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Query * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Query * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D11Query * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11Query * This, + /* [annotation] */ + __out D3D11_QUERY_DESC *pDesc); + + END_INTERFACE + } ID3D11QueryVtbl; + + interface ID3D11Query + { + CONST_VTBL struct ID3D11QueryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Query_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Query_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Query_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Query_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Query_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Query_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Query_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Query_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + + +#define ID3D11Query_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Query_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11Predicate_INTERFACE_DEFINED__ +#define __ID3D11Predicate_INTERFACE_DEFINED__ + +/* interface ID3D11Predicate */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Predicate; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9eb576dd-9f77-4d86-81aa-8bab5fe490e2") + ID3D11Predicate : public ID3D11Query + { + public: + }; + +#else /* C style interface */ + + typedef struct ID3D11PredicateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Predicate * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Predicate * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Predicate * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Predicate * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Predicate * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Predicate * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Predicate * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D11Predicate * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11Predicate * This, + /* [annotation] */ + __out D3D11_QUERY_DESC *pDesc); + + END_INTERFACE + } ID3D11PredicateVtbl; + + interface ID3D11Predicate + { + CONST_VTBL struct ID3D11PredicateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Predicate_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Predicate_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Predicate_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Predicate_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Predicate_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Predicate_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Predicate_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Predicate_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + + +#define ID3D11Predicate_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Predicate_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0025 */ +/* [local] */ + +typedef struct D3D11_QUERY_DATA_TIMESTAMP_DISJOINT + { + UINT64 Frequency; + BOOL Disjoint; + } D3D11_QUERY_DATA_TIMESTAMP_DISJOINT; + +typedef struct D3D11_QUERY_DATA_PIPELINE_STATISTICS + { + UINT64 IAVertices; + UINT64 IAPrimitives; + UINT64 VSInvocations; + UINT64 GSInvocations; + UINT64 GSPrimitives; + UINT64 CInvocations; + UINT64 CPrimitives; + UINT64 PSInvocations; + UINT64 HSInvocations; + UINT64 DSInvocations; + UINT64 CSInvocations; + } D3D11_QUERY_DATA_PIPELINE_STATISTICS; + +typedef struct D3D11_QUERY_DATA_SO_STATISTICS + { + UINT64 NumPrimitivesWritten; + UINT64 PrimitivesStorageNeeded; + } D3D11_QUERY_DATA_SO_STATISTICS; + +typedef +enum D3D11_COUNTER + { D3D11_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000 + } D3D11_COUNTER; + +typedef +enum D3D11_COUNTER_TYPE + { D3D11_COUNTER_TYPE_FLOAT32 = 0, + D3D11_COUNTER_TYPE_UINT16 = ( D3D11_COUNTER_TYPE_FLOAT32 + 1 ) , + D3D11_COUNTER_TYPE_UINT32 = ( D3D11_COUNTER_TYPE_UINT16 + 1 ) , + D3D11_COUNTER_TYPE_UINT64 = ( D3D11_COUNTER_TYPE_UINT32 + 1 ) + } D3D11_COUNTER_TYPE; + +typedef struct D3D11_COUNTER_DESC + { + D3D11_COUNTER Counter; + UINT MiscFlags; + } D3D11_COUNTER_DESC; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +struct CD3D11_COUNTER_DESC : public D3D11_COUNTER_DESC +{ + CD3D11_COUNTER_DESC() + {} + explicit CD3D11_COUNTER_DESC( const D3D11_COUNTER_DESC& o ) : + D3D11_COUNTER_DESC( o ) + {} + explicit CD3D11_COUNTER_DESC( + D3D11_COUNTER counter, + UINT miscFlags = 0 ) + { + Counter = counter; + MiscFlags = miscFlags; + } + ~CD3D11_COUNTER_DESC() {} + operator const D3D11_COUNTER_DESC&() const { return *this; } +}; +extern "C"{ +#endif +typedef struct D3D11_COUNTER_INFO + { + D3D11_COUNTER LastDeviceDependentCounter; + UINT NumSimultaneousCounters; + UINT8 NumDetectableParallelUnits; + } D3D11_COUNTER_INFO; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0025_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0025_v0_0_s_ifspec; + +#ifndef __ID3D11Counter_INTERFACE_DEFINED__ +#define __ID3D11Counter_INTERFACE_DEFINED__ + +/* interface ID3D11Counter */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Counter; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6e8c49fb-a371-4770-b440-29086022b741") + ID3D11Counter : public ID3D11Asynchronous + { + public: + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_COUNTER_DESC *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11CounterVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Counter * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Counter * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Counter * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11Counter * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Counter * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Counter * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Counter * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + UINT ( STDMETHODCALLTYPE *GetDataSize )( + ID3D11Counter * This); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11Counter * This, + /* [annotation] */ + __out D3D11_COUNTER_DESC *pDesc); + + END_INTERFACE + } ID3D11CounterVtbl; + + interface ID3D11Counter + { + CONST_VTBL struct ID3D11CounterVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Counter_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Counter_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Counter_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Counter_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11Counter_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Counter_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Counter_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11Counter_GetDataSize(This) \ + ( (This)->lpVtbl -> GetDataSize(This) ) + + +#define ID3D11Counter_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Counter_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0026 */ +/* [local] */ + +typedef +enum D3D11_STANDARD_MULTISAMPLE_QUALITY_LEVELS + { D3D11_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff, + D3D11_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe + } D3D11_STANDARD_MULTISAMPLE_QUALITY_LEVELS; + +typedef +enum D3D11_DEVICE_CONTEXT_TYPE + { D3D11_DEVICE_CONTEXT_IMMEDIATE = 0, + D3D11_DEVICE_CONTEXT_DEFERRED = ( D3D11_DEVICE_CONTEXT_IMMEDIATE + 1 ) + } D3D11_DEVICE_CONTEXT_TYPE; + +typedef struct D3D11_CLASS_INSTANCE_DESC + { + UINT InstanceId; + UINT InstanceIndex; + UINT TypeId; + UINT ConstantBuffer; + UINT BaseConstantBufferOffset; + UINT BaseTexture; + UINT BaseSampler; + BOOL Created; + } D3D11_CLASS_INSTANCE_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0026_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0026_v0_0_s_ifspec; + +#ifndef __ID3D11ClassInstance_INTERFACE_DEFINED__ +#define __ID3D11ClassInstance_INTERFACE_DEFINED__ + +/* interface ID3D11ClassInstance */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11ClassInstance; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("a6cd7faa-b0b7-4a2f-9436-8662a65797cb") + ID3D11ClassInstance : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE GetClassLinkage( + /* [annotation] */ + __out ID3D11ClassLinkage **ppLinkage) = 0; + + virtual void STDMETHODCALLTYPE GetDesc( + /* [annotation] */ + __out D3D11_CLASS_INSTANCE_DESC *pDesc) = 0; + + virtual void STDMETHODCALLTYPE GetInstanceName( + /* [annotation] */ + __out_ecount_opt(*pBufferLength) LPSTR pInstanceName, + /* [annotation] */ + __inout SIZE_T *pBufferLength) = 0; + + virtual void STDMETHODCALLTYPE GetTypeName( + /* [annotation] */ + __out_ecount_opt(*pBufferLength) LPSTR pTypeName, + /* [annotation] */ + __inout SIZE_T *pBufferLength) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11ClassInstanceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11ClassInstance * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11ClassInstance * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11ClassInstance * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11ClassInstance * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11ClassInstance * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11ClassInstance * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11ClassInstance * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *GetClassLinkage )( + ID3D11ClassInstance * This, + /* [annotation] */ + __out ID3D11ClassLinkage **ppLinkage); + + void ( STDMETHODCALLTYPE *GetDesc )( + ID3D11ClassInstance * This, + /* [annotation] */ + __out D3D11_CLASS_INSTANCE_DESC *pDesc); + + void ( STDMETHODCALLTYPE *GetInstanceName )( + ID3D11ClassInstance * This, + /* [annotation] */ + __out_ecount_opt(*pBufferLength) LPSTR pInstanceName, + /* [annotation] */ + __inout SIZE_T *pBufferLength); + + void ( STDMETHODCALLTYPE *GetTypeName )( + ID3D11ClassInstance * This, + /* [annotation] */ + __out_ecount_opt(*pBufferLength) LPSTR pTypeName, + /* [annotation] */ + __inout SIZE_T *pBufferLength); + + END_INTERFACE + } ID3D11ClassInstanceVtbl; + + interface ID3D11ClassInstance + { + CONST_VTBL struct ID3D11ClassInstanceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11ClassInstance_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11ClassInstance_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11ClassInstance_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11ClassInstance_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11ClassInstance_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11ClassInstance_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11ClassInstance_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11ClassInstance_GetClassLinkage(This,ppLinkage) \ + ( (This)->lpVtbl -> GetClassLinkage(This,ppLinkage) ) + +#define ID3D11ClassInstance_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#define ID3D11ClassInstance_GetInstanceName(This,pInstanceName,pBufferLength) \ + ( (This)->lpVtbl -> GetInstanceName(This,pInstanceName,pBufferLength) ) + +#define ID3D11ClassInstance_GetTypeName(This,pTypeName,pBufferLength) \ + ( (This)->lpVtbl -> GetTypeName(This,pTypeName,pBufferLength) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11ClassInstance_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11ClassLinkage_INTERFACE_DEFINED__ +#define __ID3D11ClassLinkage_INTERFACE_DEFINED__ + +/* interface ID3D11ClassLinkage */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11ClassLinkage; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("ddf57cba-9543-46e4-a12b-f207a0fe7fed") + ID3D11ClassLinkage : public ID3D11DeviceChild + { + public: + virtual HRESULT STDMETHODCALLTYPE GetClassInstance( + /* [annotation] */ + __in LPCSTR pClassInstanceName, + /* [annotation] */ + __in UINT InstanceIndex, + /* [annotation] */ + __out ID3D11ClassInstance **ppInstance) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateClassInstance( + /* [annotation] */ + __in LPCSTR pClassTypeName, + /* [annotation] */ + __in UINT ConstantBufferOffset, + /* [annotation] */ + __in UINT ConstantVectorOffset, + /* [annotation] */ + __in UINT TextureOffset, + /* [annotation] */ + __in UINT SamplerOffset, + /* [annotation] */ + __out ID3D11ClassInstance **ppInstance) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11ClassLinkageVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11ClassLinkage * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11ClassLinkage * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11ClassLinkage * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11ClassLinkage * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11ClassLinkage * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11ClassLinkage * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11ClassLinkage * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + HRESULT ( STDMETHODCALLTYPE *GetClassInstance )( + ID3D11ClassLinkage * This, + /* [annotation] */ + __in LPCSTR pClassInstanceName, + /* [annotation] */ + __in UINT InstanceIndex, + /* [annotation] */ + __out ID3D11ClassInstance **ppInstance); + + HRESULT ( STDMETHODCALLTYPE *CreateClassInstance )( + ID3D11ClassLinkage * This, + /* [annotation] */ + __in LPCSTR pClassTypeName, + /* [annotation] */ + __in UINT ConstantBufferOffset, + /* [annotation] */ + __in UINT ConstantVectorOffset, + /* [annotation] */ + __in UINT TextureOffset, + /* [annotation] */ + __in UINT SamplerOffset, + /* [annotation] */ + __out ID3D11ClassInstance **ppInstance); + + END_INTERFACE + } ID3D11ClassLinkageVtbl; + + interface ID3D11ClassLinkage + { + CONST_VTBL struct ID3D11ClassLinkageVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11ClassLinkage_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11ClassLinkage_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11ClassLinkage_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11ClassLinkage_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11ClassLinkage_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11ClassLinkage_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11ClassLinkage_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11ClassLinkage_GetClassInstance(This,pClassInstanceName,InstanceIndex,ppInstance) \ + ( (This)->lpVtbl -> GetClassInstance(This,pClassInstanceName,InstanceIndex,ppInstance) ) + +#define ID3D11ClassLinkage_CreateClassInstance(This,pClassTypeName,ConstantBufferOffset,ConstantVectorOffset,TextureOffset,SamplerOffset,ppInstance) \ + ( (This)->lpVtbl -> CreateClassInstance(This,pClassTypeName,ConstantBufferOffset,ConstantVectorOffset,TextureOffset,SamplerOffset,ppInstance) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11ClassLinkage_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11CommandList_INTERFACE_DEFINED__ +#define __ID3D11CommandList_INTERFACE_DEFINED__ + +/* interface ID3D11CommandList */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11CommandList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("a24bc4d1-769e-43f7-8013-98ff566c18e2") + ID3D11CommandList : public ID3D11DeviceChild + { + public: + virtual UINT STDMETHODCALLTYPE GetContextFlags( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11CommandListVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11CommandList * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11CommandList * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11CommandList * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11CommandList * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11CommandList * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11CommandList * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11CommandList * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + UINT ( STDMETHODCALLTYPE *GetContextFlags )( + ID3D11CommandList * This); + + END_INTERFACE + } ID3D11CommandListVtbl; + + interface ID3D11CommandList + { + CONST_VTBL struct ID3D11CommandListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11CommandList_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11CommandList_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11CommandList_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11CommandList_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11CommandList_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11CommandList_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11CommandList_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11CommandList_GetContextFlags(This) \ + ( (This)->lpVtbl -> GetContextFlags(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11CommandList_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0029 */ +/* [local] */ + +typedef +enum D3D11_FEATURE + { D3D11_FEATURE_THREADING = 0, + D3D11_FEATURE_DOUBLES = ( D3D11_FEATURE_THREADING + 1 ) , + D3D11_FEATURE_FORMAT_SUPPORT = ( D3D11_FEATURE_DOUBLES + 1 ) , + D3D11_FEATURE_FORMAT_SUPPORT2 = ( D3D11_FEATURE_FORMAT_SUPPORT + 1 ) , + D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS = ( D3D11_FEATURE_FORMAT_SUPPORT2 + 1 ) + } D3D11_FEATURE; + +typedef struct D3D11_FEATURE_DATA_THREADING + { + BOOL DriverConcurrentCreates; + BOOL DriverCommandLists; + } D3D11_FEATURE_DATA_THREADING; + +typedef struct D3D11_FEATURE_DATA_DOUBLES + { + BOOL DoublePrecisionFloatShaderOps; + } D3D11_FEATURE_DATA_DOUBLES; + +typedef struct D3D11_FEATURE_DATA_FORMAT_SUPPORT + { + DXGI_FORMAT InFormat; + UINT OutFormatSupport; + } D3D11_FEATURE_DATA_FORMAT_SUPPORT; + +typedef struct D3D11_FEATURE_DATA_FORMAT_SUPPORT2 + { + DXGI_FORMAT InFormat; + UINT OutFormatSupport2; + } D3D11_FEATURE_DATA_FORMAT_SUPPORT2; + +typedef struct D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS + { + BOOL ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x; + } D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0029_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0029_v0_0_s_ifspec; + +#ifndef __ID3D11DeviceContext_INTERFACE_DEFINED__ +#define __ID3D11DeviceContext_INTERFACE_DEFINED__ + +/* interface ID3D11DeviceContext */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11DeviceContext; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c0bfa96c-e089-44fb-8eaf-26f8796190da") + ID3D11DeviceContext : public ID3D11DeviceChild + { + public: + virtual void STDMETHODCALLTYPE VSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE PSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE PSSetShader( + /* [annotation] */ + __in_opt ID3D11PixelShader *pPixelShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE PSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE VSSetShader( + /* [annotation] */ + __in_opt ID3D11VertexShader *pVertexShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE DrawIndexed( + /* [annotation] */ + __in UINT IndexCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation) = 0; + + virtual void STDMETHODCALLTYPE Draw( + /* [annotation] */ + __in UINT VertexCount, + /* [annotation] */ + __in UINT StartVertexLocation) = 0; + + virtual HRESULT STDMETHODCALLTYPE Map( + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D11_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out D3D11_MAPPED_SUBRESOURCE *pMappedResource) = 0; + + virtual void STDMETHODCALLTYPE Unmap( + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in UINT Subresource) = 0; + + virtual void STDMETHODCALLTYPE PSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE IASetInputLayout( + /* [annotation] */ + __in_opt ID3D11InputLayout *pInputLayout) = 0; + + virtual void STDMETHODCALLTYPE IASetVertexBuffers( + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppVertexBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pStrides, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pOffsets) = 0; + + virtual void STDMETHODCALLTYPE IASetIndexBuffer( + /* [annotation] */ + __in_opt ID3D11Buffer *pIndexBuffer, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT Offset) = 0; + + virtual void STDMETHODCALLTYPE DrawIndexedInstanced( + /* [annotation] */ + __in UINT IndexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation) = 0; + + virtual void STDMETHODCALLTYPE DrawInstanced( + /* [annotation] */ + __in UINT VertexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation) = 0; + + virtual void STDMETHODCALLTYPE GSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE GSSetShader( + /* [annotation] */ + __in_opt ID3D11GeometryShader *pShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE IASetPrimitiveTopology( + /* [annotation] */ + __in D3D11_PRIMITIVE_TOPOLOGY Topology) = 0; + + virtual void STDMETHODCALLTYPE VSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE VSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE Begin( + /* [annotation] */ + __in ID3D11Asynchronous *pAsync) = 0; + + virtual void STDMETHODCALLTYPE End( + /* [annotation] */ + __in ID3D11Asynchronous *pAsync) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetData( + /* [annotation] */ + __in ID3D11Asynchronous *pAsync, + /* [annotation] */ + __out_bcount_opt( DataSize ) void *pData, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in UINT GetDataFlags) = 0; + + virtual void STDMETHODCALLTYPE SetPredication( + /* [annotation] */ + __in_opt ID3D11Predicate *pPredicate, + /* [annotation] */ + __in BOOL PredicateValue) = 0; + + virtual void STDMETHODCALLTYPE GSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE GSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE OMSetRenderTargets( + /* [annotation] */ + __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __in_ecount_opt(NumViews) ID3D11RenderTargetView *const *ppRenderTargetViews, + /* [annotation] */ + __in_opt ID3D11DepthStencilView *pDepthStencilView) = 0; + + virtual void STDMETHODCALLTYPE OMSetRenderTargetsAndUnorderedAccessViews( + /* [annotation] */ + __in UINT NumRTVs, + /* [annotation] */ + __in_ecount_opt(NumRTVs) ID3D11RenderTargetView *const *ppRenderTargetViews, + /* [annotation] */ + __in_opt ID3D11DepthStencilView *pDepthStencilView, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot, + /* [annotation] */ + __in UINT NumUAVs, + /* [annotation] */ + __in_ecount_opt(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, + /* [annotation] */ + __in_ecount_opt(NumUAVs) const UINT *pUAVInitialCounts) = 0; + + virtual void STDMETHODCALLTYPE OMSetBlendState( + /* [annotation] */ + __in_opt ID3D11BlendState *pBlendState, + /* [annotation] */ + __in_opt const FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __in UINT SampleMask) = 0; + + virtual void STDMETHODCALLTYPE OMSetDepthStencilState( + /* [annotation] */ + __in_opt ID3D11DepthStencilState *pDepthStencilState, + /* [annotation] */ + __in UINT StencilRef) = 0; + + virtual void STDMETHODCALLTYPE SOSetTargets( + /* [annotation] */ + __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT) UINT NumBuffers, + /* [annotation] */ + __in_ecount_opt(NumBuffers) ID3D11Buffer *const *ppSOTargets, + /* [annotation] */ + __in_ecount_opt(NumBuffers) const UINT *pOffsets) = 0; + + virtual void STDMETHODCALLTYPE DrawAuto( void) = 0; + + virtual void STDMETHODCALLTYPE DrawIndexedInstancedIndirect( + /* [annotation] */ + __in ID3D11Buffer *pBufferForArgs, + /* [annotation] */ + __in UINT AlignedByteOffsetForArgs) = 0; + + virtual void STDMETHODCALLTYPE DrawInstancedIndirect( + /* [annotation] */ + __in ID3D11Buffer *pBufferForArgs, + /* [annotation] */ + __in UINT AlignedByteOffsetForArgs) = 0; + + virtual void STDMETHODCALLTYPE Dispatch( + /* [annotation] */ + __in UINT ThreadGroupCountX, + /* [annotation] */ + __in UINT ThreadGroupCountY, + /* [annotation] */ + __in UINT ThreadGroupCountZ) = 0; + + virtual void STDMETHODCALLTYPE DispatchIndirect( + /* [annotation] */ + __in ID3D11Buffer *pBufferForArgs, + /* [annotation] */ + __in UINT AlignedByteOffsetForArgs) = 0; + + virtual void STDMETHODCALLTYPE RSSetState( + /* [annotation] */ + __in_opt ID3D11RasterizerState *pRasterizerState) = 0; + + virtual void STDMETHODCALLTYPE RSSetViewports( + /* [annotation] */ + __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + /* [annotation] */ + __in_ecount_opt(NumViewports) const D3D11_VIEWPORT *pViewports) = 0; + + virtual void STDMETHODCALLTYPE RSSetScissorRects( + /* [annotation] */ + __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + /* [annotation] */ + __in_ecount_opt(NumRects) const D3D11_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE CopySubresourceRegion( + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in UINT DstX, + /* [annotation] */ + __in UINT DstY, + /* [annotation] */ + __in UINT DstZ, + /* [annotation] */ + __in ID3D11Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in_opt const D3D11_BOX *pSrcBox) = 0; + + virtual void STDMETHODCALLTYPE CopyResource( + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in ID3D11Resource *pSrcResource) = 0; + + virtual void STDMETHODCALLTYPE UpdateSubresource( + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in_opt const D3D11_BOX *pDstBox, + /* [annotation] */ + __in const void *pSrcData, + /* [annotation] */ + __in UINT SrcRowPitch, + /* [annotation] */ + __in UINT SrcDepthPitch) = 0; + + virtual void STDMETHODCALLTYPE CopyStructureCount( + /* [annotation] */ + __in ID3D11Buffer *pDstBuffer, + /* [annotation] */ + __in UINT DstAlignedByteOffset, + /* [annotation] */ + __in ID3D11UnorderedAccessView *pSrcView) = 0; + + virtual void STDMETHODCALLTYPE ClearRenderTargetView( + /* [annotation] */ + __in ID3D11RenderTargetView *pRenderTargetView, + /* [annotation] */ + __in const FLOAT ColorRGBA[ 4 ]) = 0; + + virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewUint( + /* [annotation] */ + __in ID3D11UnorderedAccessView *pUnorderedAccessView, + /* [annotation] */ + __in const UINT Values[ 4 ]) = 0; + + virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewFloat( + /* [annotation] */ + __in ID3D11UnorderedAccessView *pUnorderedAccessView, + /* [annotation] */ + __in const FLOAT Values[ 4 ]) = 0; + + virtual void STDMETHODCALLTYPE ClearDepthStencilView( + /* [annotation] */ + __in ID3D11DepthStencilView *pDepthStencilView, + /* [annotation] */ + __in UINT ClearFlags, + /* [annotation] */ + __in FLOAT Depth, + /* [annotation] */ + __in UINT8 Stencil) = 0; + + virtual void STDMETHODCALLTYPE GenerateMips( + /* [annotation] */ + __in ID3D11ShaderResourceView *pShaderResourceView) = 0; + + virtual void STDMETHODCALLTYPE SetResourceMinLOD( + /* [annotation] */ + __in ID3D11Resource *pResource, + FLOAT MinLOD) = 0; + + virtual FLOAT STDMETHODCALLTYPE GetResourceMinLOD( + /* [annotation] */ + __in ID3D11Resource *pResource) = 0; + + virtual void STDMETHODCALLTYPE ResolveSubresource( + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in ID3D11Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in DXGI_FORMAT Format) = 0; + + virtual void STDMETHODCALLTYPE ExecuteCommandList( + /* [annotation] */ + __in ID3D11CommandList *pCommandList, + BOOL RestoreContextState) = 0; + + virtual void STDMETHODCALLTYPE HSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE HSSetShader( + /* [annotation] */ + __in_opt ID3D11HullShader *pHullShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE HSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE HSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE DSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE DSSetShader( + /* [annotation] */ + __in_opt ID3D11DomainShader *pDomainShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE DSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE DSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE CSSetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE CSSetUnorderedAccessViews( + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot ) UINT NumUAVs, + /* [annotation] */ + __in_ecount(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, + /* [annotation] */ + __in_ecount(NumUAVs) const UINT *pUAVInitialCounts) = 0; + + virtual void STDMETHODCALLTYPE CSSetShader( + /* [annotation] */ + __in_opt ID3D11ComputeShader *pComputeShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE CSSetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE CSSetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE VSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE PSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE PSGetShader( + /* [annotation] */ + __out ID3D11PixelShader **ppPixelShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE PSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE VSGetShader( + /* [annotation] */ + __out ID3D11VertexShader **ppVertexShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE PSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE IAGetInputLayout( + /* [annotation] */ + __out ID3D11InputLayout **ppInputLayout) = 0; + + virtual void STDMETHODCALLTYPE IAGetVertexBuffers( + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D11Buffer **ppVertexBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pStrides, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets) = 0; + + virtual void STDMETHODCALLTYPE IAGetIndexBuffer( + /* [annotation] */ + __out_opt ID3D11Buffer **pIndexBuffer, + /* [annotation] */ + __out_opt DXGI_FORMAT *Format, + /* [annotation] */ + __out_opt UINT *Offset) = 0; + + virtual void STDMETHODCALLTYPE GSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE GSGetShader( + /* [annotation] */ + __out ID3D11GeometryShader **ppGeometryShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE IAGetPrimitiveTopology( + /* [annotation] */ + __out D3D11_PRIMITIVE_TOPOLOGY *pTopology) = 0; + + virtual void STDMETHODCALLTYPE VSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE VSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE GetPredication( + /* [annotation] */ + __out_opt ID3D11Predicate **ppPredicate, + /* [annotation] */ + __out_opt BOOL *pPredicateValue) = 0; + + virtual void STDMETHODCALLTYPE GSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE GSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE OMGetRenderTargets( + /* [annotation] */ + __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __out_ecount_opt(NumViews) ID3D11RenderTargetView **ppRenderTargetViews, + /* [annotation] */ + __out_opt ID3D11DepthStencilView **ppDepthStencilView) = 0; + + virtual void STDMETHODCALLTYPE OMGetRenderTargetsAndUnorderedAccessViews( + /* [annotation] */ + __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumRTVs, + /* [annotation] */ + __out_ecount_opt(NumRTVs) ID3D11RenderTargetView **ppRenderTargetViews, + /* [annotation] */ + __out_opt ID3D11DepthStencilView **ppDepthStencilView, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot ) UINT NumUAVs, + /* [annotation] */ + __out_ecount_opt(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews) = 0; + + virtual void STDMETHODCALLTYPE OMGetBlendState( + /* [annotation] */ + __out_opt ID3D11BlendState **ppBlendState, + /* [annotation] */ + __out_opt FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __out_opt UINT *pSampleMask) = 0; + + virtual void STDMETHODCALLTYPE OMGetDepthStencilState( + /* [annotation] */ + __out_opt ID3D11DepthStencilState **ppDepthStencilState, + /* [annotation] */ + __out_opt UINT *pStencilRef) = 0; + + virtual void STDMETHODCALLTYPE SOGetTargets( + /* [annotation] */ + __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppSOTargets) = 0; + + virtual void STDMETHODCALLTYPE RSGetState( + /* [annotation] */ + __out ID3D11RasterizerState **ppRasterizerState) = 0; + + virtual void STDMETHODCALLTYPE RSGetViewports( + /* [annotation] */ + __inout /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumViewports, + /* [annotation] */ + __out_ecount_opt(*pNumViewports) D3D11_VIEWPORT *pViewports) = 0; + + virtual void STDMETHODCALLTYPE RSGetScissorRects( + /* [annotation] */ + __inout /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumRects, + /* [annotation] */ + __out_ecount_opt(*pNumRects) D3D11_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE HSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE HSGetShader( + /* [annotation] */ + __out ID3D11HullShader **ppHullShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE HSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE HSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE DSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE DSGetShader( + /* [annotation] */ + __out ID3D11DomainShader **ppDomainShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE DSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE DSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE CSGetShaderResources( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews) = 0; + + virtual void STDMETHODCALLTYPE CSGetUnorderedAccessViews( + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot ) UINT NumUAVs, + /* [annotation] */ + __out_ecount(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews) = 0; + + virtual void STDMETHODCALLTYPE CSGetShader( + /* [annotation] */ + __out ID3D11ComputeShader **ppComputeShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances) = 0; + + virtual void STDMETHODCALLTYPE CSGetSamplers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers) = 0; + + virtual void STDMETHODCALLTYPE CSGetConstantBuffers( + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers) = 0; + + virtual void STDMETHODCALLTYPE ClearState( void) = 0; + + virtual void STDMETHODCALLTYPE Flush( void) = 0; + + virtual D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE GetType( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetContextFlags( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE FinishCommandList( + BOOL RestoreDeferredContextState, + /* [annotation] */ + __out_opt ID3D11CommandList **ppCommandList) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11DeviceContextVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11DeviceContext * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11DeviceContext * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11DeviceContext * This); + + void ( STDMETHODCALLTYPE *GetDevice )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11Device **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt( *pDataSize ) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt( DataSize ) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + void ( STDMETHODCALLTYPE *VSSetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *PSSetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *PSSetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11PixelShader *pPixelShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances); + + void ( STDMETHODCALLTYPE *PSSetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *VSSetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11VertexShader *pVertexShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances); + + void ( STDMETHODCALLTYPE *DrawIndexed )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in UINT IndexCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation); + + void ( STDMETHODCALLTYPE *Draw )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in UINT VertexCount, + /* [annotation] */ + __in UINT StartVertexLocation); + + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in UINT Subresource, + /* [annotation] */ + __in D3D11_MAP MapType, + /* [annotation] */ + __in UINT MapFlags, + /* [annotation] */ + __out D3D11_MAPPED_SUBRESOURCE *pMappedResource); + + void ( STDMETHODCALLTYPE *Unmap )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in UINT Subresource); + + void ( STDMETHODCALLTYPE *PSSetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *IASetInputLayout )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11InputLayout *pInputLayout); + + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppVertexBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pStrides, + /* [annotation] */ + __in_ecount(NumBuffers) const UINT *pOffsets); + + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11Buffer *pIndexBuffer, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT Offset); + + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in UINT IndexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartIndexLocation, + /* [annotation] */ + __in INT BaseVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation); + + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in UINT VertexCountPerInstance, + /* [annotation] */ + __in UINT InstanceCount, + /* [annotation] */ + __in UINT StartVertexLocation, + /* [annotation] */ + __in UINT StartInstanceLocation); + + void ( STDMETHODCALLTYPE *GSSetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *GSSetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11GeometryShader *pShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances); + + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in D3D11_PRIMITIVE_TOPOLOGY Topology); + + void ( STDMETHODCALLTYPE *VSSetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *VSSetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *Begin )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Asynchronous *pAsync); + + void ( STDMETHODCALLTYPE *End )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Asynchronous *pAsync); + + HRESULT ( STDMETHODCALLTYPE *GetData )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Asynchronous *pAsync, + /* [annotation] */ + __out_bcount_opt( DataSize ) void *pData, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in UINT GetDataFlags); + + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11Predicate *pPredicate, + /* [annotation] */ + __in BOOL PredicateValue); + + void ( STDMETHODCALLTYPE *GSSetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *GSSetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __in_ecount_opt(NumViews) ID3D11RenderTargetView *const *ppRenderTargetViews, + /* [annotation] */ + __in_opt ID3D11DepthStencilView *pDepthStencilView); + + void ( STDMETHODCALLTYPE *OMSetRenderTargetsAndUnorderedAccessViews )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in UINT NumRTVs, + /* [annotation] */ + __in_ecount_opt(NumRTVs) ID3D11RenderTargetView *const *ppRenderTargetViews, + /* [annotation] */ + __in_opt ID3D11DepthStencilView *pDepthStencilView, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot, + /* [annotation] */ + __in UINT NumUAVs, + /* [annotation] */ + __in_ecount_opt(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, + /* [annotation] */ + __in_ecount_opt(NumUAVs) const UINT *pUAVInitialCounts); + + void ( STDMETHODCALLTYPE *OMSetBlendState )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11BlendState *pBlendState, + /* [annotation] */ + __in_opt const FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __in UINT SampleMask); + + void ( STDMETHODCALLTYPE *OMSetDepthStencilState )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11DepthStencilState *pDepthStencilState, + /* [annotation] */ + __in UINT StencilRef); + + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT) UINT NumBuffers, + /* [annotation] */ + __in_ecount_opt(NumBuffers) ID3D11Buffer *const *ppSOTargets, + /* [annotation] */ + __in_ecount_opt(NumBuffers) const UINT *pOffsets); + + void ( STDMETHODCALLTYPE *DrawAuto )( + ID3D11DeviceContext * This); + + void ( STDMETHODCALLTYPE *DrawIndexedInstancedIndirect )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Buffer *pBufferForArgs, + /* [annotation] */ + __in UINT AlignedByteOffsetForArgs); + + void ( STDMETHODCALLTYPE *DrawInstancedIndirect )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Buffer *pBufferForArgs, + /* [annotation] */ + __in UINT AlignedByteOffsetForArgs); + + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in UINT ThreadGroupCountX, + /* [annotation] */ + __in UINT ThreadGroupCountY, + /* [annotation] */ + __in UINT ThreadGroupCountZ); + + void ( STDMETHODCALLTYPE *DispatchIndirect )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Buffer *pBufferForArgs, + /* [annotation] */ + __in UINT AlignedByteOffsetForArgs); + + void ( STDMETHODCALLTYPE *RSSetState )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11RasterizerState *pRasterizerState); + + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + /* [annotation] */ + __in_ecount_opt(NumViewports) const D3D11_VIEWPORT *pViewports); + + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + /* [annotation] */ + __in_ecount_opt(NumRects) const D3D11_RECT *pRects); + + void ( STDMETHODCALLTYPE *CopySubresourceRegion )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in UINT DstX, + /* [annotation] */ + __in UINT DstY, + /* [annotation] */ + __in UINT DstZ, + /* [annotation] */ + __in ID3D11Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in_opt const D3D11_BOX *pSrcBox); + + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in ID3D11Resource *pSrcResource); + + void ( STDMETHODCALLTYPE *UpdateSubresource )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in_opt const D3D11_BOX *pDstBox, + /* [annotation] */ + __in const void *pSrcData, + /* [annotation] */ + __in UINT SrcRowPitch, + /* [annotation] */ + __in UINT SrcDepthPitch); + + void ( STDMETHODCALLTYPE *CopyStructureCount )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Buffer *pDstBuffer, + /* [annotation] */ + __in UINT DstAlignedByteOffset, + /* [annotation] */ + __in ID3D11UnorderedAccessView *pSrcView); + + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11RenderTargetView *pRenderTargetView, + /* [annotation] */ + __in const FLOAT ColorRGBA[ 4 ]); + + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11UnorderedAccessView *pUnorderedAccessView, + /* [annotation] */ + __in const UINT Values[ 4 ]); + + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11UnorderedAccessView *pUnorderedAccessView, + /* [annotation] */ + __in const FLOAT Values[ 4 ]); + + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11DepthStencilView *pDepthStencilView, + /* [annotation] */ + __in UINT ClearFlags, + /* [annotation] */ + __in FLOAT Depth, + /* [annotation] */ + __in UINT8 Stencil); + + void ( STDMETHODCALLTYPE *GenerateMips )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11ShaderResourceView *pShaderResourceView); + + void ( STDMETHODCALLTYPE *SetResourceMinLOD )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pResource, + FLOAT MinLOD); + + FLOAT ( STDMETHODCALLTYPE *GetResourceMinLOD )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pResource); + + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11Resource *pDstResource, + /* [annotation] */ + __in UINT DstSubresource, + /* [annotation] */ + __in ID3D11Resource *pSrcResource, + /* [annotation] */ + __in UINT SrcSubresource, + /* [annotation] */ + __in DXGI_FORMAT Format); + + void ( STDMETHODCALLTYPE *ExecuteCommandList )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in ID3D11CommandList *pCommandList, + BOOL RestoreContextState); + + void ( STDMETHODCALLTYPE *HSSetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *HSSetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11HullShader *pHullShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances); + + void ( STDMETHODCALLTYPE *HSSetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *HSSetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *DSSetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *DSSetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11DomainShader *pDomainShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances); + + void ( STDMETHODCALLTYPE *DSSetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *DSSetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *CSSetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __in_ecount(NumViews) ID3D11ShaderResourceView *const *ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *CSSetUnorderedAccessViews )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot ) UINT NumUAVs, + /* [annotation] */ + __in_ecount(NumUAVs) ID3D11UnorderedAccessView *const *ppUnorderedAccessViews, + /* [annotation] */ + __in_ecount(NumUAVs) const UINT *pUAVInitialCounts); + + void ( STDMETHODCALLTYPE *CSSetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_opt ID3D11ComputeShader *pComputeShader, + /* [annotation] */ + __in_ecount_opt(NumClassInstances) ID3D11ClassInstance *const *ppClassInstances, + UINT NumClassInstances); + + void ( STDMETHODCALLTYPE *CSSetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __in_ecount(NumSamplers) ID3D11SamplerState *const *ppSamplers); + + void ( STDMETHODCALLTYPE *CSSetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __in_ecount(NumBuffers) ID3D11Buffer *const *ppConstantBuffers); + + void ( STDMETHODCALLTYPE *VSGetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *PSGetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *PSGetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11PixelShader **ppPixelShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances); + + void ( STDMETHODCALLTYPE *PSGetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *VSGetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11VertexShader **ppVertexShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances); + + void ( STDMETHODCALLTYPE *PSGetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *IAGetInputLayout )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11InputLayout **ppInputLayout); + + void ( STDMETHODCALLTYPE *IAGetVertexBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) ID3D11Buffer **ppVertexBuffers, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pStrides, + /* [annotation] */ + __out_ecount_opt(NumBuffers) UINT *pOffsets); + + void ( STDMETHODCALLTYPE *IAGetIndexBuffer )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out_opt ID3D11Buffer **pIndexBuffer, + /* [annotation] */ + __out_opt DXGI_FORMAT *Format, + /* [annotation] */ + __out_opt UINT *Offset); + + void ( STDMETHODCALLTYPE *GSGetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *GSGetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11GeometryShader **ppGeometryShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances); + + void ( STDMETHODCALLTYPE *IAGetPrimitiveTopology )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out D3D11_PRIMITIVE_TOPOLOGY *pTopology); + + void ( STDMETHODCALLTYPE *VSGetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *VSGetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *GetPredication )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out_opt ID3D11Predicate **ppPredicate, + /* [annotation] */ + __out_opt BOOL *pPredicateValue); + + void ( STDMETHODCALLTYPE *GSGetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *GSGetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *OMGetRenderTargets )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumViews, + /* [annotation] */ + __out_ecount_opt(NumViews) ID3D11RenderTargetView **ppRenderTargetViews, + /* [annotation] */ + __out_opt ID3D11DepthStencilView **ppDepthStencilView); + + void ( STDMETHODCALLTYPE *OMGetRenderTargetsAndUnorderedAccessViews )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT ) UINT NumRTVs, + /* [annotation] */ + __out_ecount_opt(NumRTVs) ID3D11RenderTargetView **ppRenderTargetViews, + /* [annotation] */ + __out_opt ID3D11DepthStencilView **ppDepthStencilView, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT UAVStartSlot, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - UAVStartSlot ) UINT NumUAVs, + /* [annotation] */ + __out_ecount_opt(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews); + + void ( STDMETHODCALLTYPE *OMGetBlendState )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out_opt ID3D11BlendState **ppBlendState, + /* [annotation] */ + __out_opt FLOAT BlendFactor[ 4 ], + /* [annotation] */ + __out_opt UINT *pSampleMask); + + void ( STDMETHODCALLTYPE *OMGetDepthStencilState )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out_opt ID3D11DepthStencilState **ppDepthStencilState, + /* [annotation] */ + __out_opt UINT *pStencilRef); + + void ( STDMETHODCALLTYPE *SOGetTargets )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppSOTargets); + + void ( STDMETHODCALLTYPE *RSGetState )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11RasterizerState **ppRasterizerState); + + void ( STDMETHODCALLTYPE *RSGetViewports )( + ID3D11DeviceContext * This, + /* [annotation] */ + __inout /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumViewports, + /* [annotation] */ + __out_ecount_opt(*pNumViewports) D3D11_VIEWPORT *pViewports); + + void ( STDMETHODCALLTYPE *RSGetScissorRects )( + ID3D11DeviceContext * This, + /* [annotation] */ + __inout /*_range(0, D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE )*/ UINT *pNumRects, + /* [annotation] */ + __out_ecount_opt(*pNumRects) D3D11_RECT *pRects); + + void ( STDMETHODCALLTYPE *HSGetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *HSGetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11HullShader **ppHullShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances); + + void ( STDMETHODCALLTYPE *HSGetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *HSGetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *DSGetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *DSGetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11DomainShader **ppDomainShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances); + + void ( STDMETHODCALLTYPE *DSGetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *DSGetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *CSGetShaderResources )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - StartSlot ) UINT NumViews, + /* [annotation] */ + __out_ecount(NumViews) ID3D11ShaderResourceView **ppShaderResourceViews); + + void ( STDMETHODCALLTYPE *CSGetUnorderedAccessViews )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_PS_CS_UAV_REGISTER_COUNT - StartSlot ) UINT NumUAVs, + /* [annotation] */ + __out_ecount(NumUAVs) ID3D11UnorderedAccessView **ppUnorderedAccessViews); + + void ( STDMETHODCALLTYPE *CSGetShader )( + ID3D11DeviceContext * This, + /* [annotation] */ + __out ID3D11ComputeShader **ppComputeShader, + /* [annotation] */ + __out_ecount_opt(*pNumClassInstances) ID3D11ClassInstance **ppClassInstances, + /* [annotation] */ + __inout_opt UINT *pNumClassInstances); + + void ( STDMETHODCALLTYPE *CSGetSamplers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT - StartSlot ) UINT NumSamplers, + /* [annotation] */ + __out_ecount(NumSamplers) ID3D11SamplerState **ppSamplers); + + void ( STDMETHODCALLTYPE *CSGetConstantBuffers )( + ID3D11DeviceContext * This, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - 1 ) UINT StartSlot, + /* [annotation] */ + __in_range( 0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT - StartSlot ) UINT NumBuffers, + /* [annotation] */ + __out_ecount(NumBuffers) ID3D11Buffer **ppConstantBuffers); + + void ( STDMETHODCALLTYPE *ClearState )( + ID3D11DeviceContext * This); + + void ( STDMETHODCALLTYPE *Flush )( + ID3D11DeviceContext * This); + + D3D11_DEVICE_CONTEXT_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D11DeviceContext * This); + + UINT ( STDMETHODCALLTYPE *GetContextFlags )( + ID3D11DeviceContext * This); + + HRESULT ( STDMETHODCALLTYPE *FinishCommandList )( + ID3D11DeviceContext * This, + BOOL RestoreDeferredContextState, + /* [annotation] */ + __out_opt ID3D11CommandList **ppCommandList); + + END_INTERFACE + } ID3D11DeviceContextVtbl; + + interface ID3D11DeviceContext + { + CONST_VTBL struct ID3D11DeviceContextVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11DeviceContext_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11DeviceContext_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11DeviceContext_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11DeviceContext_GetDevice(This,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,ppDevice) ) + +#define ID3D11DeviceContext_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11DeviceContext_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11DeviceContext_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + + +#define ID3D11DeviceContext_VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_PSSetShader(This,pPixelShader,ppClassInstances,NumClassInstances) \ + ( (This)->lpVtbl -> PSSetShader(This,pPixelShader,ppClassInstances,NumClassInstances) ) + +#define ID3D11DeviceContext_PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_VSSetShader(This,pVertexShader,ppClassInstances,NumClassInstances) \ + ( (This)->lpVtbl -> VSSetShader(This,pVertexShader,ppClassInstances,NumClassInstances) ) + +#define ID3D11DeviceContext_DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) \ + ( (This)->lpVtbl -> DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) ) + +#define ID3D11DeviceContext_Draw(This,VertexCount,StartVertexLocation) \ + ( (This)->lpVtbl -> Draw(This,VertexCount,StartVertexLocation) ) + +#define ID3D11DeviceContext_Map(This,pResource,Subresource,MapType,MapFlags,pMappedResource) \ + ( (This)->lpVtbl -> Map(This,pResource,Subresource,MapType,MapFlags,pMappedResource) ) + +#define ID3D11DeviceContext_Unmap(This,pResource,Subresource) \ + ( (This)->lpVtbl -> Unmap(This,pResource,Subresource) ) + +#define ID3D11DeviceContext_PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_IASetInputLayout(This,pInputLayout) \ + ( (This)->lpVtbl -> IASetInputLayout(This,pInputLayout) ) + +#define ID3D11DeviceContext_IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) ) + +#define ID3D11DeviceContext_IASetIndexBuffer(This,pIndexBuffer,Format,Offset) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pIndexBuffer,Format,Offset) ) + +#define ID3D11DeviceContext_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D11DeviceContext_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D11DeviceContext_GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_GSSetShader(This,pShader,ppClassInstances,NumClassInstances) \ + ( (This)->lpVtbl -> GSSetShader(This,pShader,ppClassInstances,NumClassInstances) ) + +#define ID3D11DeviceContext_IASetPrimitiveTopology(This,Topology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,Topology) ) + +#define ID3D11DeviceContext_VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_Begin(This,pAsync) \ + ( (This)->lpVtbl -> Begin(This,pAsync) ) + +#define ID3D11DeviceContext_End(This,pAsync) \ + ( (This)->lpVtbl -> End(This,pAsync) ) + +#define ID3D11DeviceContext_GetData(This,pAsync,pData,DataSize,GetDataFlags) \ + ( (This)->lpVtbl -> GetData(This,pAsync,pData,DataSize,GetDataFlags) ) + +#define ID3D11DeviceContext_SetPredication(This,pPredicate,PredicateValue) \ + ( (This)->lpVtbl -> SetPredication(This,pPredicate,PredicateValue) ) + +#define ID3D11DeviceContext_GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) ) + +#define ID3D11DeviceContext_OMSetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,pDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) \ + ( (This)->lpVtbl -> OMSetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,pDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) ) + +#define ID3D11DeviceContext_OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) \ + ( (This)->lpVtbl -> OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) ) + +#define ID3D11DeviceContext_OMSetDepthStencilState(This,pDepthStencilState,StencilRef) \ + ( (This)->lpVtbl -> OMSetDepthStencilState(This,pDepthStencilState,StencilRef) ) + +#define ID3D11DeviceContext_SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) \ + ( (This)->lpVtbl -> SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) ) + +#define ID3D11DeviceContext_DrawAuto(This) \ + ( (This)->lpVtbl -> DrawAuto(This) ) + +#define ID3D11DeviceContext_DrawIndexedInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \ + ( (This)->lpVtbl -> DrawIndexedInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) ) + +#define ID3D11DeviceContext_DrawInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \ + ( (This)->lpVtbl -> DrawInstancedIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) ) + +#define ID3D11DeviceContext_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D11DeviceContext_DispatchIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) \ + ( (This)->lpVtbl -> DispatchIndirect(This,pBufferForArgs,AlignedByteOffsetForArgs) ) + +#define ID3D11DeviceContext_RSSetState(This,pRasterizerState) \ + ( (This)->lpVtbl -> RSSetState(This,pRasterizerState) ) + +#define ID3D11DeviceContext_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D11DeviceContext_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D11DeviceContext_CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) \ + ( (This)->lpVtbl -> CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) ) + +#define ID3D11DeviceContext_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D11DeviceContext_UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ + ( (This)->lpVtbl -> UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) + +#define ID3D11DeviceContext_CopyStructureCount(This,pDstBuffer,DstAlignedByteOffset,pSrcView) \ + ( (This)->lpVtbl -> CopyStructureCount(This,pDstBuffer,DstAlignedByteOffset,pSrcView) ) + +#define ID3D11DeviceContext_ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) ) + +#define ID3D11DeviceContext_ClearUnorderedAccessViewUint(This,pUnorderedAccessView,Values) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,pUnorderedAccessView,Values) ) + +#define ID3D11DeviceContext_ClearUnorderedAccessViewFloat(This,pUnorderedAccessView,Values) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,pUnorderedAccessView,Values) ) + +#define ID3D11DeviceContext_ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) ) + +#define ID3D11DeviceContext_GenerateMips(This,pShaderResourceView) \ + ( (This)->lpVtbl -> GenerateMips(This,pShaderResourceView) ) + +#define ID3D11DeviceContext_SetResourceMinLOD(This,pResource,MinLOD) \ + ( (This)->lpVtbl -> SetResourceMinLOD(This,pResource,MinLOD) ) + +#define ID3D11DeviceContext_GetResourceMinLOD(This,pResource) \ + ( (This)->lpVtbl -> GetResourceMinLOD(This,pResource) ) + +#define ID3D11DeviceContext_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D11DeviceContext_ExecuteCommandList(This,pCommandList,RestoreContextState) \ + ( (This)->lpVtbl -> ExecuteCommandList(This,pCommandList,RestoreContextState) ) + +#define ID3D11DeviceContext_HSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> HSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_HSSetShader(This,pHullShader,ppClassInstances,NumClassInstances) \ + ( (This)->lpVtbl -> HSSetShader(This,pHullShader,ppClassInstances,NumClassInstances) ) + +#define ID3D11DeviceContext_HSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> HSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_HSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> HSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_DSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> DSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_DSSetShader(This,pDomainShader,ppClassInstances,NumClassInstances) \ + ( (This)->lpVtbl -> DSSetShader(This,pDomainShader,ppClassInstances,NumClassInstances) ) + +#define ID3D11DeviceContext_DSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> DSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_DSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> DSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_CSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> CSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_CSSetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) \ + ( (This)->lpVtbl -> CSSetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews,pUAVInitialCounts) ) + +#define ID3D11DeviceContext_CSSetShader(This,pComputeShader,ppClassInstances,NumClassInstances) \ + ( (This)->lpVtbl -> CSSetShader(This,pComputeShader,ppClassInstances,NumClassInstances) ) + +#define ID3D11DeviceContext_CSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> CSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_CSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> CSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_PSGetShader(This,ppPixelShader,ppClassInstances,pNumClassInstances) \ + ( (This)->lpVtbl -> PSGetShader(This,ppPixelShader,ppClassInstances,pNumClassInstances) ) + +#define ID3D11DeviceContext_PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_VSGetShader(This,ppVertexShader,ppClassInstances,pNumClassInstances) \ + ( (This)->lpVtbl -> VSGetShader(This,ppVertexShader,ppClassInstances,pNumClassInstances) ) + +#define ID3D11DeviceContext_PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_IAGetInputLayout(This,ppInputLayout) \ + ( (This)->lpVtbl -> IAGetInputLayout(This,ppInputLayout) ) + +#define ID3D11DeviceContext_IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) \ + ( (This)->lpVtbl -> IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) ) + +#define ID3D11DeviceContext_IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) \ + ( (This)->lpVtbl -> IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) ) + +#define ID3D11DeviceContext_GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_GSGetShader(This,ppGeometryShader,ppClassInstances,pNumClassInstances) \ + ( (This)->lpVtbl -> GSGetShader(This,ppGeometryShader,ppClassInstances,pNumClassInstances) ) + +#define ID3D11DeviceContext_IAGetPrimitiveTopology(This,pTopology) \ + ( (This)->lpVtbl -> IAGetPrimitiveTopology(This,pTopology) ) + +#define ID3D11DeviceContext_VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_GetPredication(This,ppPredicate,pPredicateValue) \ + ( (This)->lpVtbl -> GetPredication(This,ppPredicate,pPredicateValue) ) + +#define ID3D11DeviceContext_GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) \ + ( (This)->lpVtbl -> OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) ) + +#define ID3D11DeviceContext_OMGetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,ppDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews) \ + ( (This)->lpVtbl -> OMGetRenderTargetsAndUnorderedAccessViews(This,NumRTVs,ppRenderTargetViews,ppDepthStencilView,UAVStartSlot,NumUAVs,ppUnorderedAccessViews) ) + +#define ID3D11DeviceContext_OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) \ + ( (This)->lpVtbl -> OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) ) + +#define ID3D11DeviceContext_OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) \ + ( (This)->lpVtbl -> OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) ) + +#define ID3D11DeviceContext_SOGetTargets(This,NumBuffers,ppSOTargets) \ + ( (This)->lpVtbl -> SOGetTargets(This,NumBuffers,ppSOTargets) ) + +#define ID3D11DeviceContext_RSGetState(This,ppRasterizerState) \ + ( (This)->lpVtbl -> RSGetState(This,ppRasterizerState) ) + +#define ID3D11DeviceContext_RSGetViewports(This,pNumViewports,pViewports) \ + ( (This)->lpVtbl -> RSGetViewports(This,pNumViewports,pViewports) ) + +#define ID3D11DeviceContext_RSGetScissorRects(This,pNumRects,pRects) \ + ( (This)->lpVtbl -> RSGetScissorRects(This,pNumRects,pRects) ) + +#define ID3D11DeviceContext_HSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> HSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_HSGetShader(This,ppHullShader,ppClassInstances,pNumClassInstances) \ + ( (This)->lpVtbl -> HSGetShader(This,ppHullShader,ppClassInstances,pNumClassInstances) ) + +#define ID3D11DeviceContext_HSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> HSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_HSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> HSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_DSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> DSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_DSGetShader(This,ppDomainShader,ppClassInstances,pNumClassInstances) \ + ( (This)->lpVtbl -> DSGetShader(This,ppDomainShader,ppClassInstances,pNumClassInstances) ) + +#define ID3D11DeviceContext_DSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> DSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_DSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> DSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_CSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) \ + ( (This)->lpVtbl -> CSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) ) + +#define ID3D11DeviceContext_CSGetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews) \ + ( (This)->lpVtbl -> CSGetUnorderedAccessViews(This,StartSlot,NumUAVs,ppUnorderedAccessViews) ) + +#define ID3D11DeviceContext_CSGetShader(This,ppComputeShader,ppClassInstances,pNumClassInstances) \ + ( (This)->lpVtbl -> CSGetShader(This,ppComputeShader,ppClassInstances,pNumClassInstances) ) + +#define ID3D11DeviceContext_CSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) \ + ( (This)->lpVtbl -> CSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) ) + +#define ID3D11DeviceContext_CSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) \ + ( (This)->lpVtbl -> CSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) ) + +#define ID3D11DeviceContext_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D11DeviceContext_Flush(This) \ + ( (This)->lpVtbl -> Flush(This) ) + +#define ID3D11DeviceContext_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + +#define ID3D11DeviceContext_GetContextFlags(This) \ + ( (This)->lpVtbl -> GetContextFlags(This) ) + +#define ID3D11DeviceContext_FinishCommandList(This,RestoreDeferredContextState,ppCommandList) \ + ( (This)->lpVtbl -> FinishCommandList(This,RestoreDeferredContextState,ppCommandList) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11DeviceContext_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11Device_INTERFACE_DEFINED__ +#define __ID3D11Device_INTERFACE_DEFINED__ + +/* interface ID3D11Device */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Device; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("db6f6ddb-ac77-4e88-8253-819df9bbf140") + ID3D11Device : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateBuffer( + /* [annotation] */ + __in const D3D11_BUFFER_DESC *pDesc, + /* [annotation] */ + __in_opt const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Buffer **ppBuffer) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateTexture1D( + /* [annotation] */ + __in const D3D11_TEXTURE1D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Texture1D **ppTexture1D) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateTexture2D( + /* [annotation] */ + __in const D3D11_TEXTURE2D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Texture2D **ppTexture2D) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateTexture3D( + /* [annotation] */ + __in const D3D11_TEXTURE3D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels) const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Texture3D **ppTexture3D) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView( + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11ShaderResourceView **ppSRView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateUnorderedAccessView( + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11UnorderedAccessView **ppUAView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateRenderTargetView( + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_RENDER_TARGET_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11RenderTargetView **ppRTView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilView( + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11DepthStencilView **ppDepthStencilView) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateInputLayout( + /* [annotation] */ + __in_ecount(NumElements) const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements, + /* [annotation] */ + __in const void *pShaderBytecodeWithInputSignature, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D11InputLayout **ppInputLayout) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVertexShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11VertexShader **ppVertexShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateGeometryShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11GeometryShader **ppGeometryShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateGeometryShaderWithStreamOutput( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_ecount_opt(NumEntries) const D3D11_SO_DECLARATION_ENTRY *pSODeclaration, + /* [annotation] */ + __in_range( 0, D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT ) UINT NumEntries, + /* [annotation] */ + __in_ecount_opt(NumStrides) const UINT *pBufferStrides, + /* [annotation] */ + __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumStrides, + /* [annotation] */ + __in UINT RasterizedStream, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11GeometryShader **ppGeometryShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePixelShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11PixelShader **ppPixelShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateHullShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11HullShader **ppHullShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDomainShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11DomainShader **ppDomainShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateComputeShader( + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11ComputeShader **ppComputeShader) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateClassLinkage( + /* [annotation] */ + __out ID3D11ClassLinkage **ppLinkage) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateBlendState( + /* [annotation] */ + __in const D3D11_BLEND_DESC *pBlendStateDesc, + /* [annotation] */ + __out_opt ID3D11BlendState **ppBlendState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilState( + /* [annotation] */ + __in const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc, + /* [annotation] */ + __out_opt ID3D11DepthStencilState **ppDepthStencilState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateRasterizerState( + /* [annotation] */ + __in const D3D11_RASTERIZER_DESC *pRasterizerDesc, + /* [annotation] */ + __out_opt ID3D11RasterizerState **ppRasterizerState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSamplerState( + /* [annotation] */ + __in const D3D11_SAMPLER_DESC *pSamplerDesc, + /* [annotation] */ + __out_opt ID3D11SamplerState **ppSamplerState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateQuery( + /* [annotation] */ + __in const D3D11_QUERY_DESC *pQueryDesc, + /* [annotation] */ + __out_opt ID3D11Query **ppQuery) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePredicate( + /* [annotation] */ + __in const D3D11_QUERY_DESC *pPredicateDesc, + /* [annotation] */ + __out_opt ID3D11Predicate **ppPredicate) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCounter( + /* [annotation] */ + __in const D3D11_COUNTER_DESC *pCounterDesc, + /* [annotation] */ + __out_opt ID3D11Counter **ppCounter) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDeferredContext( + UINT ContextFlags, + /* [annotation] */ + __out_opt ID3D11DeviceContext **ppDeferredContext) = 0; + + virtual HRESULT STDMETHODCALLTYPE OpenSharedResource( + /* [annotation] */ + __in HANDLE hResource, + /* [annotation] */ + __in REFIID ReturnedInterface, + /* [annotation] */ + __out_opt void **ppResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckFormatSupport( + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __out UINT *pFormatSupport) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckMultisampleQualityLevels( + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT SampleCount, + /* [annotation] */ + __out UINT *pNumQualityLevels) = 0; + + virtual void STDMETHODCALLTYPE CheckCounterInfo( + /* [annotation] */ + __out D3D11_COUNTER_INFO *pCounterInfo) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckCounter( + /* [annotation] */ + __in const D3D11_COUNTER_DESC *pDesc, + /* [annotation] */ + __out D3D11_COUNTER_TYPE *pType, + /* [annotation] */ + __out UINT *pActiveCounters, + /* [annotation] */ + __out_ecount_opt(*pNameLength) LPSTR szName, + /* [annotation] */ + __inout_opt UINT *pNameLength, + /* [annotation] */ + __out_ecount_opt(*pUnitsLength) LPSTR szUnits, + /* [annotation] */ + __inout_opt UINT *pUnitsLength, + /* [annotation] */ + __out_ecount_opt(*pDescriptionLength) LPSTR szDescription, + /* [annotation] */ + __inout_opt UINT *pDescriptionLength) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport( + D3D11_FEATURE Feature, + /* [annotation] */ + __out_bcount(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData) = 0; + + virtual D3D_FEATURE_LEVEL STDMETHODCALLTYPE GetFeatureLevel( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetCreationFlags( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDeviceRemovedReason( void) = 0; + + virtual void STDMETHODCALLTYPE GetImmediateContext( + /* [annotation] */ + __out ID3D11DeviceContext **ppImmediateContext) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetExceptionMode( + UINT RaiseFlags) = 0; + + virtual UINT STDMETHODCALLTYPE GetExceptionMode( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11DeviceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Device * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Device * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Device * This); + + HRESULT ( STDMETHODCALLTYPE *CreateBuffer )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_BUFFER_DESC *pDesc, + /* [annotation] */ + __in_opt const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Buffer **ppBuffer); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture1D )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_TEXTURE1D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Texture1D **ppTexture1D); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture2D )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_TEXTURE2D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels * pDesc->ArraySize) const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Texture2D **ppTexture2D); + + HRESULT ( STDMETHODCALLTYPE *CreateTexture3D )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_TEXTURE3D_DESC *pDesc, + /* [annotation] */ + __in_xcount_opt(pDesc->MipLevels) const D3D11_SUBRESOURCE_DATA *pInitialData, + /* [annotation] */ + __out_opt ID3D11Texture3D **ppTexture3D); + + HRESULT ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D11Device * This, + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11ShaderResourceView **ppSRView); + + HRESULT ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D11Device * This, + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_UNORDERED_ACCESS_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11UnorderedAccessView **ppUAView); + + HRESULT ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D11Device * This, + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_RENDER_TARGET_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11RenderTargetView **ppRTView); + + HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D11Device * This, + /* [annotation] */ + __in ID3D11Resource *pResource, + /* [annotation] */ + __in_opt const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc, + /* [annotation] */ + __out_opt ID3D11DepthStencilView **ppDepthStencilView); + + HRESULT ( STDMETHODCALLTYPE *CreateInputLayout )( + ID3D11Device * This, + /* [annotation] */ + __in_ecount(NumElements) const D3D11_INPUT_ELEMENT_DESC *pInputElementDescs, + /* [annotation] */ + __in_range( 0, D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ) UINT NumElements, + /* [annotation] */ + __in const void *pShaderBytecodeWithInputSignature, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __out_opt ID3D11InputLayout **ppInputLayout); + + HRESULT ( STDMETHODCALLTYPE *CreateVertexShader )( + ID3D11Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11VertexShader **ppVertexShader); + + HRESULT ( STDMETHODCALLTYPE *CreateGeometryShader )( + ID3D11Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11GeometryShader **ppGeometryShader); + + HRESULT ( STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput )( + ID3D11Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_ecount_opt(NumEntries) const D3D11_SO_DECLARATION_ENTRY *pSODeclaration, + /* [annotation] */ + __in_range( 0, D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT ) UINT NumEntries, + /* [annotation] */ + __in_ecount_opt(NumStrides) const UINT *pBufferStrides, + /* [annotation] */ + __in_range( 0, D3D11_SO_BUFFER_SLOT_COUNT ) UINT NumStrides, + /* [annotation] */ + __in UINT RasterizedStream, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11GeometryShader **ppGeometryShader); + + HRESULT ( STDMETHODCALLTYPE *CreatePixelShader )( + ID3D11Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11PixelShader **ppPixelShader); + + HRESULT ( STDMETHODCALLTYPE *CreateHullShader )( + ID3D11Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11HullShader **ppHullShader); + + HRESULT ( STDMETHODCALLTYPE *CreateDomainShader )( + ID3D11Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11DomainShader **ppDomainShader); + + HRESULT ( STDMETHODCALLTYPE *CreateComputeShader )( + ID3D11Device * This, + /* [annotation] */ + __in const void *pShaderBytecode, + /* [annotation] */ + __in SIZE_T BytecodeLength, + /* [annotation] */ + __in_opt ID3D11ClassLinkage *pClassLinkage, + /* [annotation] */ + __out_opt ID3D11ComputeShader **ppComputeShader); + + HRESULT ( STDMETHODCALLTYPE *CreateClassLinkage )( + ID3D11Device * This, + /* [annotation] */ + __out ID3D11ClassLinkage **ppLinkage); + + HRESULT ( STDMETHODCALLTYPE *CreateBlendState )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_BLEND_DESC *pBlendStateDesc, + /* [annotation] */ + __out_opt ID3D11BlendState **ppBlendState); + + HRESULT ( STDMETHODCALLTYPE *CreateDepthStencilState )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_DEPTH_STENCIL_DESC *pDepthStencilDesc, + /* [annotation] */ + __out_opt ID3D11DepthStencilState **ppDepthStencilState); + + HRESULT ( STDMETHODCALLTYPE *CreateRasterizerState )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_RASTERIZER_DESC *pRasterizerDesc, + /* [annotation] */ + __out_opt ID3D11RasterizerState **ppRasterizerState); + + HRESULT ( STDMETHODCALLTYPE *CreateSamplerState )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_SAMPLER_DESC *pSamplerDesc, + /* [annotation] */ + __out_opt ID3D11SamplerState **ppSamplerState); + + HRESULT ( STDMETHODCALLTYPE *CreateQuery )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_QUERY_DESC *pQueryDesc, + /* [annotation] */ + __out_opt ID3D11Query **ppQuery); + + HRESULT ( STDMETHODCALLTYPE *CreatePredicate )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_QUERY_DESC *pPredicateDesc, + /* [annotation] */ + __out_opt ID3D11Predicate **ppPredicate); + + HRESULT ( STDMETHODCALLTYPE *CreateCounter )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_COUNTER_DESC *pCounterDesc, + /* [annotation] */ + __out_opt ID3D11Counter **ppCounter); + + HRESULT ( STDMETHODCALLTYPE *CreateDeferredContext )( + ID3D11Device * This, + UINT ContextFlags, + /* [annotation] */ + __out_opt ID3D11DeviceContext **ppDeferredContext); + + HRESULT ( STDMETHODCALLTYPE *OpenSharedResource )( + ID3D11Device * This, + /* [annotation] */ + __in HANDLE hResource, + /* [annotation] */ + __in REFIID ReturnedInterface, + /* [annotation] */ + __out_opt void **ppResource); + + HRESULT ( STDMETHODCALLTYPE *CheckFormatSupport )( + ID3D11Device * This, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __out UINT *pFormatSupport); + + HRESULT ( STDMETHODCALLTYPE *CheckMultisampleQualityLevels )( + ID3D11Device * This, + /* [annotation] */ + __in DXGI_FORMAT Format, + /* [annotation] */ + __in UINT SampleCount, + /* [annotation] */ + __out UINT *pNumQualityLevels); + + void ( STDMETHODCALLTYPE *CheckCounterInfo )( + ID3D11Device * This, + /* [annotation] */ + __out D3D11_COUNTER_INFO *pCounterInfo); + + HRESULT ( STDMETHODCALLTYPE *CheckCounter )( + ID3D11Device * This, + /* [annotation] */ + __in const D3D11_COUNTER_DESC *pDesc, + /* [annotation] */ + __out D3D11_COUNTER_TYPE *pType, + /* [annotation] */ + __out UINT *pActiveCounters, + /* [annotation] */ + __out_ecount_opt(*pNameLength) LPSTR szName, + /* [annotation] */ + __inout_opt UINT *pNameLength, + /* [annotation] */ + __out_ecount_opt(*pUnitsLength) LPSTR szUnits, + /* [annotation] */ + __inout_opt UINT *pUnitsLength, + /* [annotation] */ + __out_ecount_opt(*pDescriptionLength) LPSTR szDescription, + /* [annotation] */ + __inout_opt UINT *pDescriptionLength); + + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D11Device * This, + D3D11_FEATURE Feature, + /* [annotation] */ + __out_bcount(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D11Device * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __inout UINT *pDataSize, + /* [annotation] */ + __out_bcount_opt(*pDataSize) void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D11Device * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in UINT DataSize, + /* [annotation] */ + __in_bcount_opt(DataSize) const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D11Device * This, + /* [annotation] */ + __in REFGUID guid, + /* [annotation] */ + __in_opt const IUnknown *pData); + + D3D_FEATURE_LEVEL ( STDMETHODCALLTYPE *GetFeatureLevel )( + ID3D11Device * This); + + UINT ( STDMETHODCALLTYPE *GetCreationFlags )( + ID3D11Device * This); + + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D11Device * This); + + void ( STDMETHODCALLTYPE *GetImmediateContext )( + ID3D11Device * This, + /* [annotation] */ + __out ID3D11DeviceContext **ppImmediateContext); + + HRESULT ( STDMETHODCALLTYPE *SetExceptionMode )( + ID3D11Device * This, + UINT RaiseFlags); + + UINT ( STDMETHODCALLTYPE *GetExceptionMode )( + ID3D11Device * This); + + END_INTERFACE + } ID3D11DeviceVtbl; + + interface ID3D11Device + { + CONST_VTBL struct ID3D11DeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Device_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Device_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Device_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Device_CreateBuffer(This,pDesc,pInitialData,ppBuffer) \ + ( (This)->lpVtbl -> CreateBuffer(This,pDesc,pInitialData,ppBuffer) ) + +#define ID3D11Device_CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) \ + ( (This)->lpVtbl -> CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) ) + +#define ID3D11Device_CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) \ + ( (This)->lpVtbl -> CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) ) + +#define ID3D11Device_CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) \ + ( (This)->lpVtbl -> CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) ) + +#define ID3D11Device_CreateShaderResourceView(This,pResource,pDesc,ppSRView) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,ppSRView) ) + +#define ID3D11Device_CreateUnorderedAccessView(This,pResource,pDesc,ppUAView) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pDesc,ppUAView) ) + +#define ID3D11Device_CreateRenderTargetView(This,pResource,pDesc,ppRTView) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,ppRTView) ) + +#define ID3D11Device_CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) ) + +#define ID3D11Device_CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) \ + ( (This)->lpVtbl -> CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) ) + +#define ID3D11Device_CreateVertexShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppVertexShader) \ + ( (This)->lpVtbl -> CreateVertexShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppVertexShader) ) + +#define ID3D11Device_CreateGeometryShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppGeometryShader) \ + ( (This)->lpVtbl -> CreateGeometryShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppGeometryShader) ) + +#define ID3D11Device_CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,pBufferStrides,NumStrides,RasterizedStream,pClassLinkage,ppGeometryShader) \ + ( (This)->lpVtbl -> CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,pBufferStrides,NumStrides,RasterizedStream,pClassLinkage,ppGeometryShader) ) + +#define ID3D11Device_CreatePixelShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppPixelShader) \ + ( (This)->lpVtbl -> CreatePixelShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppPixelShader) ) + +#define ID3D11Device_CreateHullShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppHullShader) \ + ( (This)->lpVtbl -> CreateHullShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppHullShader) ) + +#define ID3D11Device_CreateDomainShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppDomainShader) \ + ( (This)->lpVtbl -> CreateDomainShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppDomainShader) ) + +#define ID3D11Device_CreateComputeShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppComputeShader) \ + ( (This)->lpVtbl -> CreateComputeShader(This,pShaderBytecode,BytecodeLength,pClassLinkage,ppComputeShader) ) + +#define ID3D11Device_CreateClassLinkage(This,ppLinkage) \ + ( (This)->lpVtbl -> CreateClassLinkage(This,ppLinkage) ) + +#define ID3D11Device_CreateBlendState(This,pBlendStateDesc,ppBlendState) \ + ( (This)->lpVtbl -> CreateBlendState(This,pBlendStateDesc,ppBlendState) ) + +#define ID3D11Device_CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) \ + ( (This)->lpVtbl -> CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) ) + +#define ID3D11Device_CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) \ + ( (This)->lpVtbl -> CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) ) + +#define ID3D11Device_CreateSamplerState(This,pSamplerDesc,ppSamplerState) \ + ( (This)->lpVtbl -> CreateSamplerState(This,pSamplerDesc,ppSamplerState) ) + +#define ID3D11Device_CreateQuery(This,pQueryDesc,ppQuery) \ + ( (This)->lpVtbl -> CreateQuery(This,pQueryDesc,ppQuery) ) + +#define ID3D11Device_CreatePredicate(This,pPredicateDesc,ppPredicate) \ + ( (This)->lpVtbl -> CreatePredicate(This,pPredicateDesc,ppPredicate) ) + +#define ID3D11Device_CreateCounter(This,pCounterDesc,ppCounter) \ + ( (This)->lpVtbl -> CreateCounter(This,pCounterDesc,ppCounter) ) + +#define ID3D11Device_CreateDeferredContext(This,ContextFlags,ppDeferredContext) \ + ( (This)->lpVtbl -> CreateDeferredContext(This,ContextFlags,ppDeferredContext) ) + +#define ID3D11Device_OpenSharedResource(This,hResource,ReturnedInterface,ppResource) \ + ( (This)->lpVtbl -> OpenSharedResource(This,hResource,ReturnedInterface,ppResource) ) + +#define ID3D11Device_CheckFormatSupport(This,Format,pFormatSupport) \ + ( (This)->lpVtbl -> CheckFormatSupport(This,Format,pFormatSupport) ) + +#define ID3D11Device_CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) \ + ( (This)->lpVtbl -> CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) ) + +#define ID3D11Device_CheckCounterInfo(This,pCounterInfo) \ + ( (This)->lpVtbl -> CheckCounterInfo(This,pCounterInfo) ) + +#define ID3D11Device_CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) \ + ( (This)->lpVtbl -> CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) ) + +#define ID3D11Device_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D11Device_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D11Device_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D11Device_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D11Device_GetFeatureLevel(This) \ + ( (This)->lpVtbl -> GetFeatureLevel(This) ) + +#define ID3D11Device_GetCreationFlags(This) \ + ( (This)->lpVtbl -> GetCreationFlags(This) ) + +#define ID3D11Device_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D11Device_GetImmediateContext(This,ppImmediateContext) \ + ( (This)->lpVtbl -> GetImmediateContext(This,ppImmediateContext) ) + +#define ID3D11Device_SetExceptionMode(This,RaiseFlags) \ + ( (This)->lpVtbl -> SetExceptionMode(This,RaiseFlags) ) + +#define ID3D11Device_GetExceptionMode(This) \ + ( (This)->lpVtbl -> GetExceptionMode(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Device_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11_0000_0031 */ +/* [local] */ + +typedef +enum D3D11_CREATE_DEVICE_FLAG + { D3D11_CREATE_DEVICE_SINGLETHREADED = 0x1, + D3D11_CREATE_DEVICE_DEBUG = 0x2, + D3D11_CREATE_DEVICE_SWITCH_TO_REF = 0x4, + D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8, + D3D11_CREATE_DEVICE_BGRA_SUPPORT = 0x20 + } D3D11_CREATE_DEVICE_FLAG; + +#define D3D11_SDK_VERSION ( 7 ) + +#include "d3d10_1.h" +#if !defined( D3D11_IGNORE_SDK_LAYERS ) +#include "d3d11sdklayers.h" +#endif +#include "d3d10misc.h" +#include "d3d10shader.h" +#include "d3d10effect.h" +#include "d3d10_1shader.h" + +/////////////////////////////////////////////////////////////////////////// +// D3D11CreateDevice +// ------------------ +// +// pAdapter +// If NULL, D3D11CreateDevice will choose the primary adapter and +// create a new instance from a temporarily created IDXGIFactory. +// If non-NULL, D3D11CreateDevice will register the appropriate +// device, if necessary (via IDXGIAdapter::RegisterDrver), before +// creating the device. +// DriverType +// Specifies the driver type to be created: hardware, reference or +// null. +// Software +// HMODULE of a DLL implementing a software rasterizer. Must be NULL for +// non-Software driver types. +// Flags +// Any of those documented for D3D11CreateDeviceAndSwapChain. +// pFeatureLevels +// Any of those documented for D3D11CreateDeviceAndSwapChain. +// FeatureLevels +// Size of feature levels array. +// SDKVersion +// SDK version. Use the D3D11_SDK_VERSION macro. +// ppDevice +// Pointer to returned interface. May be NULL. +// pFeatureLevel +// Pointer to returned feature level. May be NULL. +// ppImmediateContext +// Pointer to returned interface. May be NULL. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory1 +// IDXGIFactory::EnumAdapters +// IDXGIAdapter::RegisterDriver +// D3D11CreateDevice +// +/////////////////////////////////////////////////////////////////////////// +typedef HRESULT (WINAPI* PFN_D3D11_CREATE_DEVICE)( __in_opt IDXGIAdapter*, + D3D_DRIVER_TYPE, HMODULE, UINT, + __in_ecount_opt( FeatureLevels ) CONST D3D_FEATURE_LEVEL*, + UINT FeatureLevels, UINT, __out_opt ID3D11Device**, + __out_opt D3D_FEATURE_LEVEL*, __out_opt ID3D11DeviceContext** ); + +HRESULT WINAPI D3D11CreateDevice( + __in_opt IDXGIAdapter* pAdapter, + D3D_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + __in_ecount_opt( FeatureLevels ) CONST D3D_FEATURE_LEVEL* pFeatureLevels, + UINT FeatureLevels, + UINT SDKVersion, + __out_opt ID3D11Device** ppDevice, + __out_opt D3D_FEATURE_LEVEL* pFeatureLevel, + __out_opt ID3D11DeviceContext** ppImmediateContext ); + +/////////////////////////////////////////////////////////////////////////// +// D3D11CreateDeviceAndSwapChain +// ------------------------------ +// +// ppAdapter +// If NULL, D3D11CreateDevice will choose the primary adapter and +// create a new instance from a temporarily created IDXGIFactory. +// If non-NULL, D3D11CreateDevice will register the appropriate +// device, if necessary (via IDXGIAdapter::RegisterDrver), before +// creating the device. +// DriverType +// Specifies the driver type to be created: hardware, reference or +// null. +// Software +// HMODULE of a DLL implementing a software rasterizer. Must be NULL for +// non-Software driver types. +// Flags +// Any of those documented for D3D11CreateDevice. +// pFeatureLevels +// Array of any of the following: +// D3D_FEATURE_LEVEL_11_0 +// D3D_FEATURE_LEVEL_10_1 +// D3D_FEATURE_LEVEL_10_0 +// D3D_FEATURE_LEVEL_9_3 +// D3D_FEATURE_LEVEL_9_2 +// D3D_FEATURE_LEVEL_9_1 +// Order indicates sequence in which instantiation will be attempted. If +// NULL, then the implied order is the same as previously listed (i.e. +// prefer most features available). +// FeatureLevels +// Size of feature levels array. +// SDKVersion +// SDK version. Use the D3D11_SDK_VERSION macro. +// pSwapChainDesc +// Swap chain description, may be NULL. +// ppSwapChain +// Pointer to returned interface. May be NULL. +// ppDevice +// Pointer to returned interface. May be NULL. +// pFeatureLevel +// Pointer to returned feature level. May be NULL. +// ppImmediateContext +// Pointer to returned interface. May be NULL. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory1 +// IDXGIFactory::EnumAdapters +// IDXGIAdapter::RegisterDriver +// D3D11CreateDevice +// IDXGIFactory::CreateSwapChain +// +/////////////////////////////////////////////////////////////////////////// +typedef HRESULT (WINAPI* PFN_D3D11_CREATE_DEVICE_AND_SWAP_CHAIN)( __in_opt IDXGIAdapter*, + D3D_DRIVER_TYPE, HMODULE, UINT, + __in_ecount_opt( FeatureLevels ) CONST D3D_FEATURE_LEVEL*, + UINT FeatureLevels, UINT, __in_opt CONST DXGI_SWAP_CHAIN_DESC*, + __out_opt IDXGISwapChain**, __out_opt ID3D11Device**, + __out_opt D3D_FEATURE_LEVEL*, __out_opt ID3D11DeviceContext** ); + +HRESULT WINAPI D3D11CreateDeviceAndSwapChain( + __in_opt IDXGIAdapter* pAdapter, + D3D_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + __in_ecount_opt( FeatureLevels ) CONST D3D_FEATURE_LEVEL* pFeatureLevels, + UINT FeatureLevels, + UINT SDKVersion, + __in_opt CONST DXGI_SWAP_CHAIN_DESC* pSwapChainDesc, + __out_opt IDXGISwapChain** ppSwapChain, + __out_opt ID3D11Device** ppDevice, + __out_opt D3D_FEATURE_LEVEL* pFeatureLevel, + __out_opt ID3D11DeviceContext** ppImmediateContext ); + +DEFINE_GUID(IID_ID3D11DeviceChild,0x1841e5c8,0x16b0,0x489b,0xbc,0xc8,0x44,0xcf,0xb0,0xd5,0xde,0xae); +DEFINE_GUID(IID_ID3D11DepthStencilState,0x03823efb,0x8d8f,0x4e1c,0x9a,0xa2,0xf6,0x4b,0xb2,0xcb,0xfd,0xf1); +DEFINE_GUID(IID_ID3D11BlendState,0x75b68faa,0x347d,0x4159,0x8f,0x45,0xa0,0x64,0x0f,0x01,0xcd,0x9a); +DEFINE_GUID(IID_ID3D11RasterizerState,0x9bb4ab81,0xab1a,0x4d8f,0xb5,0x06,0xfc,0x04,0x20,0x0b,0x6e,0xe7); +DEFINE_GUID(IID_ID3D11Resource,0xdc8e63f3,0xd12b,0x4952,0xb4,0x7b,0x5e,0x45,0x02,0x6a,0x86,0x2d); +DEFINE_GUID(IID_ID3D11Buffer,0x48570b85,0xd1ee,0x4fcd,0xa2,0x50,0xeb,0x35,0x07,0x22,0xb0,0x37); +DEFINE_GUID(IID_ID3D11Texture1D,0xf8fb5c27,0xc6b3,0x4f75,0xa4,0xc8,0x43,0x9a,0xf2,0xef,0x56,0x4c); +DEFINE_GUID(IID_ID3D11Texture2D,0x6f15aaf2,0xd208,0x4e89,0x9a,0xb4,0x48,0x95,0x35,0xd3,0x4f,0x9c); +DEFINE_GUID(IID_ID3D11Texture3D,0x037e866e,0xf56d,0x4357,0xa8,0xaf,0x9d,0xab,0xbe,0x6e,0x25,0x0e); +DEFINE_GUID(IID_ID3D11View,0x839d1216,0xbb2e,0x412b,0xb7,0xf4,0xa9,0xdb,0xeb,0xe0,0x8e,0xd1); +DEFINE_GUID(IID_ID3D11ShaderResourceView,0xb0e06fe0,0x8192,0x4e1a,0xb1,0xca,0x36,0xd7,0x41,0x47,0x10,0xb2); +DEFINE_GUID(IID_ID3D11RenderTargetView,0xdfdba067,0x0b8d,0x4865,0x87,0x5b,0xd7,0xb4,0x51,0x6c,0xc1,0x64); +DEFINE_GUID(IID_ID3D11DepthStencilView,0x9fdac92a,0x1876,0x48c3,0xaf,0xad,0x25,0xb9,0x4f,0x84,0xa9,0xb6); +DEFINE_GUID(IID_ID3D11UnorderedAccessView,0x28acf509,0x7f5c,0x48f6,0x86,0x11,0xf3,0x16,0x01,0x0a,0x63,0x80); +DEFINE_GUID(IID_ID3D11VertexShader,0x3b301d64,0xd678,0x4289,0x88,0x97,0x22,0xf8,0x92,0x8b,0x72,0xf3); +DEFINE_GUID(IID_ID3D11HullShader,0x8e5c6061,0x628a,0x4c8e,0x82,0x64,0xbb,0xe4,0x5c,0xb3,0xd5,0xdd); +DEFINE_GUID(IID_ID3D11DomainShader,0xf582c508,0x0f36,0x490c,0x99,0x77,0x31,0xee,0xce,0x26,0x8c,0xfa); +DEFINE_GUID(IID_ID3D11GeometryShader,0x38325b96,0xeffb,0x4022,0xba,0x02,0x2e,0x79,0x5b,0x70,0x27,0x5c); +DEFINE_GUID(IID_ID3D11PixelShader,0xea82e40d,0x51dc,0x4f33,0x93,0xd4,0xdb,0x7c,0x91,0x25,0xae,0x8c); +DEFINE_GUID(IID_ID3D11ComputeShader,0x4f5b196e,0xc2bd,0x495e,0xbd,0x01,0x1f,0xde,0xd3,0x8e,0x49,0x69); +DEFINE_GUID(IID_ID3D11InputLayout,0xe4819ddc,0x4cf0,0x4025,0xbd,0x26,0x5d,0xe8,0x2a,0x3e,0x07,0xb7); +DEFINE_GUID(IID_ID3D11SamplerState,0xda6fea51,0x564c,0x4487,0x98,0x10,0xf0,0xd0,0xf9,0xb4,0xe3,0xa5); +DEFINE_GUID(IID_ID3D11Asynchronous,0x4b35d0cd,0x1e15,0x4258,0x9c,0x98,0x1b,0x13,0x33,0xf6,0xdd,0x3b); +DEFINE_GUID(IID_ID3D11Query,0xd6c00747,0x87b7,0x425e,0xb8,0x4d,0x44,0xd1,0x08,0x56,0x0a,0xfd); +DEFINE_GUID(IID_ID3D11Predicate,0x9eb576dd,0x9f77,0x4d86,0x81,0xaa,0x8b,0xab,0x5f,0xe4,0x90,0xe2); +DEFINE_GUID(IID_ID3D11Counter,0x6e8c49fb,0xa371,0x4770,0xb4,0x40,0x29,0x08,0x60,0x22,0xb7,0x41); +DEFINE_GUID(IID_ID3D11ClassInstance,0xa6cd7faa,0xb0b7,0x4a2f,0x94,0x36,0x86,0x62,0xa6,0x57,0x97,0xcb); +DEFINE_GUID(IID_ID3D11ClassLinkage,0xddf57cba,0x9543,0x46e4,0xa1,0x2b,0xf2,0x07,0xa0,0xfe,0x7f,0xed); +DEFINE_GUID(IID_ID3D11CommandList,0xa24bc4d1,0x769e,0x43f7,0x80,0x13,0x98,0xff,0x56,0x6c,0x18,0xe2); +DEFINE_GUID(IID_ID3D11DeviceContext,0xc0bfa96c,0xe089,0x44fb,0x8e,0xaf,0x26,0xf8,0x79,0x61,0x90,0xda); +DEFINE_GUID(IID_ID3D11Device,0xdb6f6ddb,0xac77,0x4e88,0x82,0x53,0x81,0x9d,0xf9,0xbb,0xf1,0x40); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0031_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11_0000_0031_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3D11SDKLayers.h b/Src/Decoder_H264_ALL/D3D/include/D3D11SDKLayers.h new file mode 100644 index 0000000..5970f81 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3D11SDKLayers.h @@ -0,0 +1,1669 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0555 */ +/* Compiler settings for d3d11sdklayers.idl: + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 7.00.0555 + protocol : all , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d11sdklayers_h__ +#define __d3d11sdklayers_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ID3D11Debug_FWD_DEFINED__ +#define __ID3D11Debug_FWD_DEFINED__ +typedef interface ID3D11Debug ID3D11Debug; +#endif /* __ID3D11Debug_FWD_DEFINED__ */ + + +#ifndef __ID3D11SwitchToRef_FWD_DEFINED__ +#define __ID3D11SwitchToRef_FWD_DEFINED__ +typedef interface ID3D11SwitchToRef ID3D11SwitchToRef; +#endif /* __ID3D11SwitchToRef_FWD_DEFINED__ */ + + +#ifndef __ID3D11InfoQueue_FWD_DEFINED__ +#define __ID3D11InfoQueue_FWD_DEFINED__ +typedef interface ID3D11InfoQueue ID3D11InfoQueue; +#endif /* __ID3D11InfoQueue_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "d3d11.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d11sdklayers_0000_0000 */ +/* [local] */ + +#define D3D11_SDK_LAYERS_VERSION ( 1 ) + +#define D3D11_DEBUG_FEATURE_FLUSH_PER_RENDER_OP ( 0x1 ) + +#define D3D11_DEBUG_FEATURE_FINISH_PER_RENDER_OP ( 0x2 ) + +#define D3D11_DEBUG_FEATURE_PRESENT_PER_RENDER_OP ( 0x4 ) + +typedef +enum D3D11_RLDO_FLAGS + { D3D11_RLDO_SUMMARY = 0x1, + D3D11_RLDO_DETAIL = 0x2 + } D3D11_RLDO_FLAGS; + +#if !defined( D3D11_NO_HELPERS ) && defined( __cplusplus ) +} +inline D3D11_RLDO_FLAGS operator~( D3D11_RLDO_FLAGS a ) +{ return D3D11_RLDO_FLAGS( ~UINT( a ) ); } +inline D3D11_RLDO_FLAGS operator&( D3D11_RLDO_FLAGS a, D3D11_RLDO_FLAGS b ) +{ return D3D11_RLDO_FLAGS( UINT( a ) & UINT( b ) ); } +inline D3D11_RLDO_FLAGS operator|( D3D11_RLDO_FLAGS a, D3D11_RLDO_FLAGS b ) +{ return D3D11_RLDO_FLAGS( UINT( a ) | UINT( b ) ); } +inline D3D11_RLDO_FLAGS operator^( D3D11_RLDO_FLAGS a, D3D11_RLDO_FLAGS b ) +{ return D3D11_RLDO_FLAGS( UINT( a ) ^ UINT( b ) ); } +inline D3D11_RLDO_FLAGS& operator&=( D3D11_RLDO_FLAGS& a, D3D11_RLDO_FLAGS b ) +{ a = a & b; return a; } +inline D3D11_RLDO_FLAGS& operator|=( D3D11_RLDO_FLAGS& a, D3D11_RLDO_FLAGS b ) +{ a = a | b; return a; } +inline D3D11_RLDO_FLAGS& operator^=( D3D11_RLDO_FLAGS& a, D3D11_RLDO_FLAGS b ) +{ a = a ^ b; return a; } +extern "C"{ +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D11Debug_INTERFACE_DEFINED__ +#define __ID3D11Debug_INTERFACE_DEFINED__ + +/* interface ID3D11Debug */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11Debug; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("79cf2233-7536-4948-9d36-1e4692dc5760") + ID3D11Debug : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetFeatureMask( + UINT Mask) = 0; + + virtual UINT STDMETHODCALLTYPE GetFeatureMask( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPresentPerRenderOpDelay( + UINT Milliseconds) = 0; + + virtual UINT STDMETHODCALLTYPE GetPresentPerRenderOpDelay( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetSwapChain( + /* [annotation] */ + __in_opt IDXGISwapChain *pSwapChain) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetSwapChain( + /* [annotation] */ + __out IDXGISwapChain **ppSwapChain) = 0; + + virtual HRESULT STDMETHODCALLTYPE ValidateContext( + /* [annotation] */ + __in ID3D11DeviceContext *pContext) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReportLiveDeviceObjects( + D3D11_RLDO_FLAGS Flags) = 0; + + virtual HRESULT STDMETHODCALLTYPE ValidateContextForDispatch( + /* [annotation] */ + __in ID3D11DeviceContext *pContext) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11DebugVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11Debug * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11Debug * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11Debug * This); + + HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )( + ID3D11Debug * This, + UINT Mask); + + UINT ( STDMETHODCALLTYPE *GetFeatureMask )( + ID3D11Debug * This); + + HRESULT ( STDMETHODCALLTYPE *SetPresentPerRenderOpDelay )( + ID3D11Debug * This, + UINT Milliseconds); + + UINT ( STDMETHODCALLTYPE *GetPresentPerRenderOpDelay )( + ID3D11Debug * This); + + HRESULT ( STDMETHODCALLTYPE *SetSwapChain )( + ID3D11Debug * This, + /* [annotation] */ + __in_opt IDXGISwapChain *pSwapChain); + + HRESULT ( STDMETHODCALLTYPE *GetSwapChain )( + ID3D11Debug * This, + /* [annotation] */ + __out IDXGISwapChain **ppSwapChain); + + HRESULT ( STDMETHODCALLTYPE *ValidateContext )( + ID3D11Debug * This, + /* [annotation] */ + __in ID3D11DeviceContext *pContext); + + HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )( + ID3D11Debug * This, + D3D11_RLDO_FLAGS Flags); + + HRESULT ( STDMETHODCALLTYPE *ValidateContextForDispatch )( + ID3D11Debug * This, + /* [annotation] */ + __in ID3D11DeviceContext *pContext); + + END_INTERFACE + } ID3D11DebugVtbl; + + interface ID3D11Debug + { + CONST_VTBL struct ID3D11DebugVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11Debug_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11Debug_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11Debug_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11Debug_SetFeatureMask(This,Mask) \ + ( (This)->lpVtbl -> SetFeatureMask(This,Mask) ) + +#define ID3D11Debug_GetFeatureMask(This) \ + ( (This)->lpVtbl -> GetFeatureMask(This) ) + +#define ID3D11Debug_SetPresentPerRenderOpDelay(This,Milliseconds) \ + ( (This)->lpVtbl -> SetPresentPerRenderOpDelay(This,Milliseconds) ) + +#define ID3D11Debug_GetPresentPerRenderOpDelay(This) \ + ( (This)->lpVtbl -> GetPresentPerRenderOpDelay(This) ) + +#define ID3D11Debug_SetSwapChain(This,pSwapChain) \ + ( (This)->lpVtbl -> SetSwapChain(This,pSwapChain) ) + +#define ID3D11Debug_GetSwapChain(This,ppSwapChain) \ + ( (This)->lpVtbl -> GetSwapChain(This,ppSwapChain) ) + +#define ID3D11Debug_ValidateContext(This,pContext) \ + ( (This)->lpVtbl -> ValidateContext(This,pContext) ) + +#define ID3D11Debug_ReportLiveDeviceObjects(This,Flags) \ + ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) ) + +#define ID3D11Debug_ValidateContextForDispatch(This,pContext) \ + ( (This)->lpVtbl -> ValidateContextForDispatch(This,pContext) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11Debug_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D11SwitchToRef_INTERFACE_DEFINED__ +#define __ID3D11SwitchToRef_INTERFACE_DEFINED__ + +/* interface ID3D11SwitchToRef */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11SwitchToRef; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1ef337e3-58e7-4f83-a692-db221f5ed47e") + ID3D11SwitchToRef : public IUnknown + { + public: + virtual BOOL STDMETHODCALLTYPE SetUseRef( + BOOL UseRef) = 0; + + virtual BOOL STDMETHODCALLTYPE GetUseRef( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11SwitchToRefVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11SwitchToRef * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11SwitchToRef * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11SwitchToRef * This); + + BOOL ( STDMETHODCALLTYPE *SetUseRef )( + ID3D11SwitchToRef * This, + BOOL UseRef); + + BOOL ( STDMETHODCALLTYPE *GetUseRef )( + ID3D11SwitchToRef * This); + + END_INTERFACE + } ID3D11SwitchToRefVtbl; + + interface ID3D11SwitchToRef + { + CONST_VTBL struct ID3D11SwitchToRefVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11SwitchToRef_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11SwitchToRef_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11SwitchToRef_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11SwitchToRef_SetUseRef(This,UseRef) \ + ( (This)->lpVtbl -> SetUseRef(This,UseRef) ) + +#define ID3D11SwitchToRef_GetUseRef(This) \ + ( (This)->lpVtbl -> GetUseRef(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11SwitchToRef_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11sdklayers_0000_0002 */ +/* [local] */ + +typedef +enum D3D11_MESSAGE_CATEGORY + { D3D11_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0, + D3D11_MESSAGE_CATEGORY_MISCELLANEOUS = ( D3D11_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1 ) , + D3D11_MESSAGE_CATEGORY_INITIALIZATION = ( D3D11_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) , + D3D11_MESSAGE_CATEGORY_CLEANUP = ( D3D11_MESSAGE_CATEGORY_INITIALIZATION + 1 ) , + D3D11_MESSAGE_CATEGORY_COMPILATION = ( D3D11_MESSAGE_CATEGORY_CLEANUP + 1 ) , + D3D11_MESSAGE_CATEGORY_STATE_CREATION = ( D3D11_MESSAGE_CATEGORY_COMPILATION + 1 ) , + D3D11_MESSAGE_CATEGORY_STATE_SETTING = ( D3D11_MESSAGE_CATEGORY_STATE_CREATION + 1 ) , + D3D11_MESSAGE_CATEGORY_STATE_GETTING = ( D3D11_MESSAGE_CATEGORY_STATE_SETTING + 1 ) , + D3D11_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( D3D11_MESSAGE_CATEGORY_STATE_GETTING + 1 ) , + D3D11_MESSAGE_CATEGORY_EXECUTION = ( D3D11_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 ) + } D3D11_MESSAGE_CATEGORY; + +typedef +enum D3D11_MESSAGE_SEVERITY + { D3D11_MESSAGE_SEVERITY_CORRUPTION = 0, + D3D11_MESSAGE_SEVERITY_ERROR = ( D3D11_MESSAGE_SEVERITY_CORRUPTION + 1 ) , + D3D11_MESSAGE_SEVERITY_WARNING = ( D3D11_MESSAGE_SEVERITY_ERROR + 1 ) , + D3D11_MESSAGE_SEVERITY_INFO = ( D3D11_MESSAGE_SEVERITY_WARNING + 1 ) + } D3D11_MESSAGE_SEVERITY; + +typedef +enum D3D11_MESSAGE_ID + { D3D11_MESSAGE_ID_UNKNOWN = 0, + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_UNKNOWN + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_STRING_FROM_APPLICATION = ( D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_THIS = ( D3D11_MESSAGE_ID_STRING_FROM_APPLICATION + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER1 = ( D3D11_MESSAGE_ID_CORRUPTED_THIS + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER2 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER1 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER3 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER2 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER4 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER3 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER5 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER4 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER6 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER5 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER7 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER6 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER8 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER7 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER9 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER8 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER10 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER9 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER11 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER10 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER12 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER11 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER13 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER12 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER14 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER13 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_PARAMETER15 = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER14 + 1 ) , + D3D11_MESSAGE_ID_CORRUPTED_MULTITHREADING = ( D3D11_MESSAGE_ID_CORRUPTED_PARAMETER15 + 1 ) , + D3D11_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CORRUPTED_MULTITHREADING + 1 ) , + D3D11_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = ( D3D11_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = ( D3D11_MESSAGE_ID_GETPRIVATEDATA_MOREDATA + 1 ) , + D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA + 1 ) , + D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN + 1 ) , + D3D11_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_NULLDESC = ( D3D11_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_NULLDESC = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_NULLDESC = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_NULLDESC = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT + 1 ) , + D3D11_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX + 1 ) , + D3D11_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE + 1 ) , + D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC + 1 ) , + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY + 1 ) , + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED = ( D3D11_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED + 1 ) , + D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE = ( D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE + 1 ) , + D3D11_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID = ( D3D11_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT = ( D3D11_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR = ( D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT + 1 ) , + D3D11_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH = ( D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR + 1 ) , + D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH = ( D3D11_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH + 1 ) , + D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE = ( D3D11_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID + 1 ) , + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX + 1 ) , + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE + 1 ) , + D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE + 1 ) , + D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE = ( D3D11_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE + 1 ) , + D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE + 1 ) , + D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE = ( D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE + 1 ) , + D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE = ( D3D11_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE + 1 ) , + D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID = ( D3D11_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID + 1 ) , + D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID + 1 ) , + D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE + 1 ) , + D3D11_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED + 1 ) , + D3D11_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED + 1 ) , + D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED + 1 ) , + D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED + 1 ) , + D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED + 1 ) , + D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED + 1 ) , + D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED + 1 ) , + D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED = ( D3D11_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED + 1 ) , + D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED = ( D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED + 1 ) , + D3D11_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS = ( D3D11_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED + 1 ) , + D3D11_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS + 1 ) , + D3D11_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE = ( D3D11_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN + 1 ) , + D3D11_MESSAGE_ID_REF_THREADING_MODE = ( D3D11_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE + 1 ) , + D3D11_MESSAGE_ID_REF_UMDRIVER_EXCEPTION = ( D3D11_MESSAGE_ID_REF_THREADING_MODE + 1 ) , + D3D11_MESSAGE_ID_REF_KMDRIVER_EXCEPTION = ( D3D11_MESSAGE_ID_REF_UMDRIVER_EXCEPTION + 1 ) , + D3D11_MESSAGE_ID_REF_HARDWARE_EXCEPTION = ( D3D11_MESSAGE_ID_REF_KMDRIVER_EXCEPTION + 1 ) , + D3D11_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE = ( D3D11_MESSAGE_ID_REF_HARDWARE_EXCEPTION + 1 ) , + D3D11_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER = ( D3D11_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE + 1 ) , + D3D11_MESSAGE_ID_REF_OUT_OF_MEMORY = ( D3D11_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER + 1 ) , + D3D11_MESSAGE_ID_REF_INFO = ( D3D11_MESSAGE_ID_REF_OUT_OF_MEMORY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_REF_INFO + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY = ( D3D11_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + 1 ) , + D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + 1 ) , + D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT + 1 ) , + D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT + 1 ) , + D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT + 1 ) , + D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN = ( D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D11_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) , + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW = ( D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY = ( D3D11_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY + 1 ) , + D3D11_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY + 1 ) , + D3D11_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER = ( D3D11_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED = ( D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER + 1 ) , + D3D11_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D11_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED + 1 ) , + D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) , + D3D11_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN = ( D3D11_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATECOUNTER_NULLDESC = ( D3D11_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN + 1 ) , + D3D11_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER = ( D3D11_MESSAGE_ID_CREATECOUNTER_NULLDESC + 1 ) , + D3D11_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D11_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER + 1 ) , + D3D11_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE = ( D3D11_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) , + D3D11_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED = ( D3D11_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE + 1 ) , + D3D11_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION = ( D3D11_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_QUERY_BEGIN_DUPLICATE = ( D3D11_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION + 1 ) , + D3D11_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS = ( D3D11_MESSAGE_ID_QUERY_BEGIN_DUPLICATE + 1 ) , + D3D11_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION = ( D3D11_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS + 1 ) , + D3D11_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS = ( D3D11_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION + 1 ) , + D3D11_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN = ( D3D11_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS + 1 ) , + D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE = ( D3D11_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN + 1 ) , + D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS = ( D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE + 1 ) , + D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL = ( D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE = ( D3D11_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = ( D3D11_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT + 1 ) , + D3D11_MESSAGE_ID_D3D10_MESSAGES_END = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_D3D10L9_MESSAGES_START = 0x100000, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED = ( D3D11_MESSAGE_ID_D3D10L9_MESSAGES_START + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY + 1 ) , + D3D11_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE + 1 ) , + D3D11_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D11_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D11_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS = ( D3D11_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE = ( D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE + 1 ) , + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS = ( D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE + 1 ) , + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS + 1 ) , + D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS = ( D3D11_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY = ( D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS + 1 ) , + D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK = ( D3D11_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY + 1 ) , + D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK = ( D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK + 1 ) , + D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT = ( D3D11_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE = ( D3D11_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE + 1 ) , + D3D11_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE = ( D3D11_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD = ( D3D11_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER = ( D3D11_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE = ( D3D11_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE = ( D3D11_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES = ( D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED = ( D3D11_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES + 1 ) , + D3D11_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED + 1 ) , + D3D11_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND = ( D3D11_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND + 1 ) , + D3D11_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE = ( D3D11_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE + 1 ) , + D3D11_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 = ( D3D11_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED = ( D3D11_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 + 1 ) , + D3D11_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO = ( D3D11_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION = ( D3D11_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED = ( D3D11_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION + 1 ) , + D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR = ( D3D11_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA = ( D3D11_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR + 1 ) , + D3D11_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP = ( D3D11_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA + 1 ) , + D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP + 1 ) , + D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT = ( D3D11_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_D3D10L9_MESSAGES_END = ( D3D11_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT + 1 ) , + D3D11_MESSAGE_ID_D3D11_MESSAGES_START = 0x200000, + D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS = ( D3D11_MESSAGE_ID_D3D11_MESSAGES_START + 1 ) , + D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS + 1 ) , + D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_COMMANDLISTFLAGS = ( D3D11_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_SINGLETHREADED = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_COMMANDLISTFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_SINGLETHREADED + 1 ) , + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_CALL_RETURN = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_INVALID_CALL_RETURN + 1 ) , + D3D11_MESSAGE_ID_FINISHDISPLAYLIST_ONIMMEDIATECONTEXT = ( D3D11_MESSAGE_ID_CREATEDEFERREDCONTEXT_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_FINISHDISPLAYLIST_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_FINISHDISPLAYLIST_ONIMMEDIATECONTEXT + 1 ) , + D3D11_MESSAGE_ID_FINISHDISPLAYLIST_INVALID_CALL_RETURN = ( D3D11_MESSAGE_ID_FINISHDISPLAYLIST_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM = ( D3D11_MESSAGE_ID_FINISHDISPLAYLIST_INVALID_CALL_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES + 1 ) , + D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D11_MESSAGE_ID_HSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_HSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL = ( D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL + 1 ) , + D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_HSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_HSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_HSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_HSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_HSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL = ( D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL + 1 ) , + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_DSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_DSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEFERRED_CONTEXT_REMOVAL_PROCESS_AT_FAULT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER = ( D3D11_MESSAGE_ID_DEFERRED_CONTEXT_REMOVAL_PROCESS_AT_FAULT + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE = ( D3D11_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS = ( D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED = ( D3D11_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN = ( D3D11_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD = ( D3D11_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE = ( D3D11_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD + 1 ) , + D3D11_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED = ( D3D11_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS = ( D3D11_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_CREATE_CONTEXT = ( D3D11_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_LIVE_CONTEXT = ( D3D11_MESSAGE_ID_CREATE_CONTEXT + 1 ) , + D3D11_MESSAGE_ID_DESTROY_CONTEXT = ( D3D11_MESSAGE_ID_LIVE_CONTEXT + 1 ) , + D3D11_MESSAGE_ID_CREATE_BUFFER = ( D3D11_MESSAGE_ID_DESTROY_CONTEXT + 1 ) , + D3D11_MESSAGE_ID_LIVE_BUFFER = ( D3D11_MESSAGE_ID_CREATE_BUFFER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_BUFFER = ( D3D11_MESSAGE_ID_LIVE_BUFFER + 1 ) , + D3D11_MESSAGE_ID_CREATE_TEXTURE1D = ( D3D11_MESSAGE_ID_DESTROY_BUFFER + 1 ) , + D3D11_MESSAGE_ID_LIVE_TEXTURE1D = ( D3D11_MESSAGE_ID_CREATE_TEXTURE1D + 1 ) , + D3D11_MESSAGE_ID_DESTROY_TEXTURE1D = ( D3D11_MESSAGE_ID_LIVE_TEXTURE1D + 1 ) , + D3D11_MESSAGE_ID_CREATE_TEXTURE2D = ( D3D11_MESSAGE_ID_DESTROY_TEXTURE1D + 1 ) , + D3D11_MESSAGE_ID_LIVE_TEXTURE2D = ( D3D11_MESSAGE_ID_CREATE_TEXTURE2D + 1 ) , + D3D11_MESSAGE_ID_DESTROY_TEXTURE2D = ( D3D11_MESSAGE_ID_LIVE_TEXTURE2D + 1 ) , + D3D11_MESSAGE_ID_CREATE_TEXTURE3D = ( D3D11_MESSAGE_ID_DESTROY_TEXTURE2D + 1 ) , + D3D11_MESSAGE_ID_LIVE_TEXTURE3D = ( D3D11_MESSAGE_ID_CREATE_TEXTURE3D + 1 ) , + D3D11_MESSAGE_ID_DESTROY_TEXTURE3D = ( D3D11_MESSAGE_ID_LIVE_TEXTURE3D + 1 ) , + D3D11_MESSAGE_ID_CREATE_SHADERRESOURCEVIEW = ( D3D11_MESSAGE_ID_DESTROY_TEXTURE3D + 1 ) , + D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW = ( D3D11_MESSAGE_ID_CREATE_SHADERRESOURCEVIEW + 1 ) , + D3D11_MESSAGE_ID_DESTROY_SHADERRESOURCEVIEW = ( D3D11_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW + 1 ) , + D3D11_MESSAGE_ID_CREATE_RENDERTARGETVIEW = ( D3D11_MESSAGE_ID_DESTROY_SHADERRESOURCEVIEW + 1 ) , + D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW = ( D3D11_MESSAGE_ID_CREATE_RENDERTARGETVIEW + 1 ) , + D3D11_MESSAGE_ID_DESTROY_RENDERTARGETVIEW = ( D3D11_MESSAGE_ID_LIVE_RENDERTARGETVIEW + 1 ) , + D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILVIEW = ( D3D11_MESSAGE_ID_DESTROY_RENDERTARGETVIEW + 1 ) , + D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW = ( D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILVIEW + 1 ) , + D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILVIEW = ( D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW + 1 ) , + D3D11_MESSAGE_ID_CREATE_VERTEXSHADER = ( D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILVIEW + 1 ) , + D3D11_MESSAGE_ID_LIVE_VERTEXSHADER = ( D3D11_MESSAGE_ID_CREATE_VERTEXSHADER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_VERTEXSHADER = ( D3D11_MESSAGE_ID_LIVE_VERTEXSHADER + 1 ) , + D3D11_MESSAGE_ID_CREATE_HULLSHADER = ( D3D11_MESSAGE_ID_DESTROY_VERTEXSHADER + 1 ) , + D3D11_MESSAGE_ID_LIVE_HULLSHADER = ( D3D11_MESSAGE_ID_CREATE_HULLSHADER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_HULLSHADER = ( D3D11_MESSAGE_ID_LIVE_HULLSHADER + 1 ) , + D3D11_MESSAGE_ID_CREATE_DOMAINSHADER = ( D3D11_MESSAGE_ID_DESTROY_HULLSHADER + 1 ) , + D3D11_MESSAGE_ID_LIVE_DOMAINSHADER = ( D3D11_MESSAGE_ID_CREATE_DOMAINSHADER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_DOMAINSHADER = ( D3D11_MESSAGE_ID_LIVE_DOMAINSHADER + 1 ) , + D3D11_MESSAGE_ID_CREATE_GEOMETRYSHADER = ( D3D11_MESSAGE_ID_DESTROY_DOMAINSHADER + 1 ) , + D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER = ( D3D11_MESSAGE_ID_CREATE_GEOMETRYSHADER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_GEOMETRYSHADER = ( D3D11_MESSAGE_ID_LIVE_GEOMETRYSHADER + 1 ) , + D3D11_MESSAGE_ID_CREATE_PIXELSHADER = ( D3D11_MESSAGE_ID_DESTROY_GEOMETRYSHADER + 1 ) , + D3D11_MESSAGE_ID_LIVE_PIXELSHADER = ( D3D11_MESSAGE_ID_CREATE_PIXELSHADER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_PIXELSHADER = ( D3D11_MESSAGE_ID_LIVE_PIXELSHADER + 1 ) , + D3D11_MESSAGE_ID_CREATE_INPUTLAYOUT = ( D3D11_MESSAGE_ID_DESTROY_PIXELSHADER + 1 ) , + D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT = ( D3D11_MESSAGE_ID_CREATE_INPUTLAYOUT + 1 ) , + D3D11_MESSAGE_ID_DESTROY_INPUTLAYOUT = ( D3D11_MESSAGE_ID_LIVE_INPUTLAYOUT + 1 ) , + D3D11_MESSAGE_ID_CREATE_SAMPLER = ( D3D11_MESSAGE_ID_DESTROY_INPUTLAYOUT + 1 ) , + D3D11_MESSAGE_ID_LIVE_SAMPLER = ( D3D11_MESSAGE_ID_CREATE_SAMPLER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_SAMPLER = ( D3D11_MESSAGE_ID_LIVE_SAMPLER + 1 ) , + D3D11_MESSAGE_ID_CREATE_BLENDSTATE = ( D3D11_MESSAGE_ID_DESTROY_SAMPLER + 1 ) , + D3D11_MESSAGE_ID_LIVE_BLENDSTATE = ( D3D11_MESSAGE_ID_CREATE_BLENDSTATE + 1 ) , + D3D11_MESSAGE_ID_DESTROY_BLENDSTATE = ( D3D11_MESSAGE_ID_LIVE_BLENDSTATE + 1 ) , + D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILSTATE = ( D3D11_MESSAGE_ID_DESTROY_BLENDSTATE + 1 ) , + D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE = ( D3D11_MESSAGE_ID_CREATE_DEPTHSTENCILSTATE + 1 ) , + D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILSTATE = ( D3D11_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE + 1 ) , + D3D11_MESSAGE_ID_CREATE_RASTERIZERSTATE = ( D3D11_MESSAGE_ID_DESTROY_DEPTHSTENCILSTATE + 1 ) , + D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE = ( D3D11_MESSAGE_ID_CREATE_RASTERIZERSTATE + 1 ) , + D3D11_MESSAGE_ID_DESTROY_RASTERIZERSTATE = ( D3D11_MESSAGE_ID_LIVE_RASTERIZERSTATE + 1 ) , + D3D11_MESSAGE_ID_CREATE_QUERY = ( D3D11_MESSAGE_ID_DESTROY_RASTERIZERSTATE + 1 ) , + D3D11_MESSAGE_ID_LIVE_QUERY = ( D3D11_MESSAGE_ID_CREATE_QUERY + 1 ) , + D3D11_MESSAGE_ID_DESTROY_QUERY = ( D3D11_MESSAGE_ID_LIVE_QUERY + 1 ) , + D3D11_MESSAGE_ID_CREATE_PREDICATE = ( D3D11_MESSAGE_ID_DESTROY_QUERY + 1 ) , + D3D11_MESSAGE_ID_LIVE_PREDICATE = ( D3D11_MESSAGE_ID_CREATE_PREDICATE + 1 ) , + D3D11_MESSAGE_ID_DESTROY_PREDICATE = ( D3D11_MESSAGE_ID_LIVE_PREDICATE + 1 ) , + D3D11_MESSAGE_ID_CREATE_COUNTER = ( D3D11_MESSAGE_ID_DESTROY_PREDICATE + 1 ) , + D3D11_MESSAGE_ID_LIVE_COUNTER = ( D3D11_MESSAGE_ID_CREATE_COUNTER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_COUNTER = ( D3D11_MESSAGE_ID_LIVE_COUNTER + 1 ) , + D3D11_MESSAGE_ID_CREATE_COMMANDLIST = ( D3D11_MESSAGE_ID_DESTROY_COUNTER + 1 ) , + D3D11_MESSAGE_ID_LIVE_COMMANDLIST = ( D3D11_MESSAGE_ID_CREATE_COMMANDLIST + 1 ) , + D3D11_MESSAGE_ID_DESTROY_COMMANDLIST = ( D3D11_MESSAGE_ID_LIVE_COMMANDLIST + 1 ) , + D3D11_MESSAGE_ID_CREATE_CLASSINSTANCE = ( D3D11_MESSAGE_ID_DESTROY_COMMANDLIST + 1 ) , + D3D11_MESSAGE_ID_LIVE_CLASSINSTANCE = ( D3D11_MESSAGE_ID_CREATE_CLASSINSTANCE + 1 ) , + D3D11_MESSAGE_ID_DESTROY_CLASSINSTANCE = ( D3D11_MESSAGE_ID_LIVE_CLASSINSTANCE + 1 ) , + D3D11_MESSAGE_ID_CREATE_CLASSLINKAGE = ( D3D11_MESSAGE_ID_DESTROY_CLASSINSTANCE + 1 ) , + D3D11_MESSAGE_ID_LIVE_CLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATE_CLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_DESTROY_CLASSLINKAGE = ( D3D11_MESSAGE_ID_LIVE_CLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_LIVE_DEVICE = ( D3D11_MESSAGE_ID_DESTROY_CLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY = ( D3D11_MESSAGE_ID_LIVE_DEVICE + 1 ) , + D3D11_MESSAGE_ID_CREATE_COMPUTESHADER = ( D3D11_MESSAGE_ID_LIVE_OBJECT_SUMMARY + 1 ) , + D3D11_MESSAGE_ID_LIVE_COMPUTESHADER = ( D3D11_MESSAGE_ID_CREATE_COMPUTESHADER + 1 ) , + D3D11_MESSAGE_ID_DESTROY_COMPUTESHADER = ( D3D11_MESSAGE_ID_LIVE_COMPUTESHADER + 1 ) , + D3D11_MESSAGE_ID_CREATE_UNORDEREDACCESSVIEW = ( D3D11_MESSAGE_ID_DESTROY_COMPUTESHADER + 1 ) , + D3D11_MESSAGE_ID_LIVE_UNORDEREDACCESSVIEW = ( D3D11_MESSAGE_ID_CREATE_UNORDEREDACCESSVIEW + 1 ) , + D3D11_MESSAGE_ID_DESTROY_UNORDEREDACCESSVIEW = ( D3D11_MESSAGE_ID_LIVE_UNORDEREDACCESSVIEW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACES_FEATURELEVEL = ( D3D11_MESSAGE_ID_DESTROY_UNORDEREDACCESSVIEW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACE_COUNT_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACES_FEATURELEVEL + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INTERFACE_COUNT_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_INDEX = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_TYPE = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_INDEX + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_DATA = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_TYPE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_UNBOUND_INSTANCE_DATA = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INVALID_INSTANCE_DATA + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETSHADER_INSTANCE_DATA_BINDINGS = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_UNBOUND_INSTANCE_DATA + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATESHADER_CLASSLINKAGE_FULL = ( D3D11_MESSAGE_ID_DEVICE_SETSHADER_INSTANCE_DATA_BINDINGS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE = ( D3D11_MESSAGE_ID_DEVICE_CREATESHADER_CLASSLINKAGE_FULL + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE = ( D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_HAZARD = ( D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D11_MESSAGE_ID_CSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_CSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL = ( D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL + 1 ) , + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY + 1 ) , + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERTYPE = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERTYPE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE + 1 ) , + D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D11_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE = ( D3D11_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS = ( D3D11_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_HAZARD = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT + 1 ) , + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS + 1 ) , + D3D11_MESSAGE_ID_CSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP + 1 ) , + D3D11_MESSAGE_ID_PSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_CSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN = ( D3D11_MESSAGE_ID_PSSETUNORDEREDACCESSVIEWS_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_HAZARD = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_HAZARD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS = ( D3D11_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY + 1 ) , + D3D11_MESSAGE_ID_CREATESHADERRESESOURCEVIEW_TOOMANYOBJECTS = ( D3D11_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER = ( D3D11_MESSAGE_ID_CREATESHADERRESESOURCEVIEW_TOOMANYOBJECTS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDCONTEXT = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDCONTEXT + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDMINLOD = ( D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDRESOURCE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDCONTEXT = ( D3D11_MESSAGE_ID_DEVICE_SETRESOURCEMINLOD_INVALIDMINLOD + 1 ) , + D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDRESOURCE = ( D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDCONTEXT + 1 ) , + D3D11_MESSAGE_ID_OMSETDEPTHSTENCIL_UNBINDDELETINGOBJECT = ( D3D11_MESSAGE_ID_DEVICE_GETRESOURCEMINLOD_INVALIDRESOURCE + 1 ) , + D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY = ( D3D11_MESSAGE_ID_OMSETDEPTHSTENCIL_UNBINDDELETINGOBJECT + 1 ) , + D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY + 1 ) , + D3D11_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED = ( D3D11_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH = ( D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED = ( D3D11_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET = ( D3D11_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET + 1 ) , + D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET + 1 ) , + D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE + 1 ) , + D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED = ( D3D11_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDVIEW = ( D3D11_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDOFFSET = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDVIEW + 1 ) , + D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_TOOMANYVIEWS = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_INVALIDOFFSET + 1 ) , + D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT = ( D3D11_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSVIEWS_TOOMANYVIEWS + 1 ) , + D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED = ( D3D11_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT + 1 ) , + D3D11_MESSAGE_ID_REF_WARNING = ( D3D11_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED + 1 ) , + D3D11_MESSAGE_ID_D3D11_MESSAGES_END = ( D3D11_MESSAGE_ID_REF_WARNING + 1 ) + } D3D11_MESSAGE_ID; + +typedef struct D3D11_MESSAGE + { + D3D11_MESSAGE_CATEGORY Category; + D3D11_MESSAGE_SEVERITY Severity; + D3D11_MESSAGE_ID ID; + const char *pDescription; + SIZE_T DescriptionByteLength; + } D3D11_MESSAGE; + +typedef struct D3D11_INFO_QUEUE_FILTER_DESC + { + UINT NumCategories; + D3D11_MESSAGE_CATEGORY *pCategoryList; + UINT NumSeverities; + D3D11_MESSAGE_SEVERITY *pSeverityList; + UINT NumIDs; + D3D11_MESSAGE_ID *pIDList; + } D3D11_INFO_QUEUE_FILTER_DESC; + +typedef struct D3D11_INFO_QUEUE_FILTER + { + D3D11_INFO_QUEUE_FILTER_DESC AllowList; + D3D11_INFO_QUEUE_FILTER_DESC DenyList; + } D3D11_INFO_QUEUE_FILTER; + +#define D3D11_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024 + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0002_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0002_v0_0_s_ifspec; + +#ifndef __ID3D11InfoQueue_INTERFACE_DEFINED__ +#define __ID3D11InfoQueue_INTERFACE_DEFINED__ + +/* interface ID3D11InfoQueue */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D11InfoQueue; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6543dbb6-1b48-42f5-ab82-e97ec74326f6") + ID3D11InfoQueue : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit( + /* [annotation] */ + __in UINT64 MessageCountLimit) = 0; + + virtual void STDMETHODCALLTYPE ClearStoredMessages( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetMessage( + /* [annotation] */ + __in UINT64 MessageIndex, + /* [annotation] */ + __out_bcount_opt(*pMessageByteLength) D3D11_MESSAGE *pMessage, + /* [annotation] */ + __inout SIZE_T *pMessageByteLength) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries( + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetStorageFilter( + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength) = 0; + + virtual void STDMETHODCALLTYPE ClearStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushStorageFilter( + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual void STDMETHODCALLTYPE PopStorageFilter( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries( + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter( + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength) = 0; + + virtual void STDMETHODCALLTYPE ClearRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter( + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual void STDMETHODCALLTYPE PopRetrievalFilter( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddMessage( + /* [annotation] */ + __in D3D11_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in D3D11_MESSAGE_ID ID, + /* [annotation] */ + __in LPCSTR pDescription) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage( + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in LPCSTR pDescription) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory( + /* [annotation] */ + __in D3D11_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in BOOL bEnable) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity( + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in BOOL bEnable) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnID( + /* [annotation] */ + __in D3D11_MESSAGE_ID ID, + /* [annotation] */ + __in BOOL bEnable) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory( + /* [annotation] */ + __in D3D11_MESSAGE_CATEGORY Category) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity( + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnID( + /* [annotation] */ + __in D3D11_MESSAGE_ID ID) = 0; + + virtual void STDMETHODCALLTYPE SetMuteDebugOutput( + /* [annotation] */ + __in BOOL bMute) = 0; + + virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D11InfoQueueVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D11InfoQueue * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D11InfoQueue * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in UINT64 MessageCountLimit); + + void ( STDMETHODCALLTYPE *ClearStoredMessages )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *GetMessage )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in UINT64 MessageIndex, + /* [annotation] */ + __out_bcount_opt(*pMessageByteLength) D3D11_MESSAGE *pMessage, + /* [annotation] */ + __inout SIZE_T *pMessageByteLength); + + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )( + ID3D11InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )( + ID3D11InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )( + ID3D11InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )( + ID3D11InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )( + ID3D11InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter); + + HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )( + ID3D11InfoQueue * This, + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength); + + void ( STDMETHODCALLTYPE *ClearStorageFilter )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter); + + void ( STDMETHODCALLTYPE *PopStorageFilter )( + ID3D11InfoQueue * This); + + UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter); + + HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )( + ID3D11InfoQueue * This, + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D11_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength); + + void ( STDMETHODCALLTYPE *ClearRetrievalFilter )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_INFO_QUEUE_FILTER *pFilter); + + void ( STDMETHODCALLTYPE *PopRetrievalFilter )( + ID3D11InfoQueue * This); + + UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )( + ID3D11InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *AddMessage )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in D3D11_MESSAGE_ID ID, + /* [annotation] */ + __in LPCSTR pDescription); + + HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in LPCSTR pDescription); + + HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in BOOL bEnable); + + HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in BOOL bEnable); + + HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_ID ID, + /* [annotation] */ + __in BOOL bEnable); + + BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_CATEGORY Category); + + BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_SEVERITY Severity); + + BOOL ( STDMETHODCALLTYPE *GetBreakOnID )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in D3D11_MESSAGE_ID ID); + + void ( STDMETHODCALLTYPE *SetMuteDebugOutput )( + ID3D11InfoQueue * This, + /* [annotation] */ + __in BOOL bMute); + + BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )( + ID3D11InfoQueue * This); + + END_INTERFACE + } ID3D11InfoQueueVtbl; + + interface ID3D11InfoQueue + { + CONST_VTBL struct ID3D11InfoQueueVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D11InfoQueue_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D11InfoQueue_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D11InfoQueue_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D11InfoQueue_SetMessageCountLimit(This,MessageCountLimit) \ + ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) ) + +#define ID3D11InfoQueue_ClearStoredMessages(This) \ + ( (This)->lpVtbl -> ClearStoredMessages(This) ) + +#define ID3D11InfoQueue_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \ + ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) ) + +#define ID3D11InfoQueue_GetNumMessagesAllowedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) ) + +#define ID3D11InfoQueue_GetNumMessagesDeniedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) ) + +#define ID3D11InfoQueue_GetNumStoredMessages(This) \ + ( (This)->lpVtbl -> GetNumStoredMessages(This) ) + +#define ID3D11InfoQueue_GetNumStoredMessagesAllowedByRetrievalFilter(This) \ + ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) ) + +#define ID3D11InfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) ) + +#define ID3D11InfoQueue_GetMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetMessageCountLimit(This) ) + +#define ID3D11InfoQueue_AddStorageFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) ) + +#define ID3D11InfoQueue_GetStorageFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D11InfoQueue_ClearStorageFilter(This) \ + ( (This)->lpVtbl -> ClearStorageFilter(This) ) + +#define ID3D11InfoQueue_PushEmptyStorageFilter(This) \ + ( (This)->lpVtbl -> PushEmptyStorageFilter(This) ) + +#define ID3D11InfoQueue_PushCopyOfStorageFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) ) + +#define ID3D11InfoQueue_PushStorageFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) ) + +#define ID3D11InfoQueue_PopStorageFilter(This) \ + ( (This)->lpVtbl -> PopStorageFilter(This) ) + +#define ID3D11InfoQueue_GetStorageFilterStackSize(This) \ + ( (This)->lpVtbl -> GetStorageFilterStackSize(This) ) + +#define ID3D11InfoQueue_AddRetrievalFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) ) + +#define ID3D11InfoQueue_GetRetrievalFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D11InfoQueue_ClearRetrievalFilter(This) \ + ( (This)->lpVtbl -> ClearRetrievalFilter(This) ) + +#define ID3D11InfoQueue_PushEmptyRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) ) + +#define ID3D11InfoQueue_PushCopyOfRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) ) + +#define ID3D11InfoQueue_PushRetrievalFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) ) + +#define ID3D11InfoQueue_PopRetrievalFilter(This) \ + ( (This)->lpVtbl -> PopRetrievalFilter(This) ) + +#define ID3D11InfoQueue_GetRetrievalFilterStackSize(This) \ + ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) ) + +#define ID3D11InfoQueue_AddMessage(This,Category,Severity,ID,pDescription) \ + ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) ) + +#define ID3D11InfoQueue_AddApplicationMessage(This,Severity,pDescription) \ + ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) ) + +#define ID3D11InfoQueue_SetBreakOnCategory(This,Category,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) ) + +#define ID3D11InfoQueue_SetBreakOnSeverity(This,Severity,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) ) + +#define ID3D11InfoQueue_SetBreakOnID(This,ID,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) ) + +#define ID3D11InfoQueue_GetBreakOnCategory(This,Category) \ + ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) ) + +#define ID3D11InfoQueue_GetBreakOnSeverity(This,Severity) \ + ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) ) + +#define ID3D11InfoQueue_GetBreakOnID(This,ID) \ + ( (This)->lpVtbl -> GetBreakOnID(This,ID) ) + +#define ID3D11InfoQueue_SetMuteDebugOutput(This,bMute) \ + ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) ) + +#define ID3D11InfoQueue_GetMuteDebugOutput(This) \ + ( (This)->lpVtbl -> GetMuteDebugOutput(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D11InfoQueue_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d11sdklayers_0000_0003 */ +/* [local] */ + +#define D3D11_REGKEY_PATH __TEXT("Software\\Microsoft\\Direct3D") +#define D3D11_MUTE_DEBUG_OUTPUT __TEXT("MuteDebugOutput") +#define D3D11_ENABLE_BREAK_ON_MESSAGE __TEXT("EnableBreakOnMessage") +#define D3D11_INFOQUEUE_STORAGE_FILTER_OVERRIDE __TEXT("InfoQueueStorageFilterOverride") +#define D3D11_MUTE_CATEGORY __TEXT("Mute_CATEGORY_%s") +#define D3D11_MUTE_SEVERITY __TEXT("Mute_SEVERITY_%s") +#define D3D11_MUTE_ID_STRING __TEXT("Mute_ID_%s") +#define D3D11_MUTE_ID_DECIMAL __TEXT("Mute_ID_%d") +#define D3D11_UNMUTE_SEVERITY_INFO __TEXT("Unmute_SEVERITY_INFO") +#define D3D11_BREAKON_CATEGORY __TEXT("BreakOn_CATEGORY_%s") +#define D3D11_BREAKON_SEVERITY __TEXT("BreakOn_SEVERITY_%s") +#define D3D11_BREAKON_ID_STRING __TEXT("BreakOn_ID_%s") +#define D3D11_BREAKON_ID_DECIMAL __TEXT("BreakOn_ID_%d") +#define D3D11_APPSIZE_STRING __TEXT("Size") +#define D3D11_APPNAME_STRING __TEXT("Name") +DEFINE_GUID(IID_ID3D11Debug,0x79cf2233,0x7536,0x4948,0x9d,0x36,0x1e,0x46,0x92,0xdc,0x57,0x60); +DEFINE_GUID(IID_ID3D11SwitchToRef,0x1ef337e3,0x58e7,0x4f83,0xa6,0x92,0xdb,0x22,0x1f,0x5e,0xd4,0x7e); +DEFINE_GUID(IID_ID3D11InfoQueue,0x6543dbb6,0x1b48,0x42f5,0xab,0x82,0xe9,0x7e,0xc7,0x43,0x26,0xf6); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0003_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d11sdklayers_0000_0003_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3D11Shader.h b/Src/Decoder_H264_ALL/D3D/include/D3D11Shader.h new file mode 100644 index 0000000..e0071d8 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3D11Shader.h @@ -0,0 +1,322 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3D11Shader.h +// Content: D3D11 Shader Types and APIs +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3D11SHADER_H__ +#define __D3D11SHADER_H__ + +#include "d3d10_1shader.h" + + +typedef enum D3D11_SHADER_VERSION_TYPE +{ + D3D11_SHVER_PIXEL_SHADER = 0, + D3D11_SHVER_VERTEX_SHADER = 1, + D3D11_SHVER_GEOMETRY_SHADER = 2, + + // D3D11 Shaders + D3D11_SHVER_HULL_SHADER = 3, + D3D11_SHVER_DOMAIN_SHADER = 4, + D3D11_SHVER_COMPUTE_SHADER = 5, +} D3D11_SHADER_VERSION_TYPE; + +#define D3D11_SHVER_GET_TYPE(_Version) \ + (((_Version) >> 16) & 0xffff) +#define D3D11_SHVER_GET_MAJOR(_Version) \ + (((_Version) >> 4) & 0xf) +#define D3D11_SHVER_GET_MINOR(_Version) \ + (((_Version) >> 0) & 0xf) + +typedef enum D3D11_RESOURCE_RETURN_TYPE +{ + D3D11_RETURN_TYPE_UNORM = 1, + D3D11_RETURN_TYPE_SNORM = 2, + D3D11_RETURN_TYPE_SINT = 3, + D3D11_RETURN_TYPE_UINT = 4, + D3D11_RETURN_TYPE_FLOAT = 5, + D3D11_RETURN_TYPE_MIXED = 6, + D3D11_RETURN_TYPE_DOUBLE = 7, + D3D11_RETURN_TYPE_CONTINUED = 8, +} D3D11_RESOURCE_RETURN_TYPE; + +typedef enum _D3D11_CBUFFER_TYPE +{ + D3D11_CT_CBUFFER, + D3D11_CT_TBUFFER, + D3D11_CT_INTERFACE_POINTERS, + D3D11_CT_RESOURCE_BIND_INFO, +} D3D11_CBUFFER_TYPE, *LPD3D11_CBUFFER_TYPE; + + +typedef struct _D3D11_SIGNATURE_PARAMETER_DESC +{ + LPCSTR SemanticName; // Name of the semantic + UINT SemanticIndex; // Index of the semantic + UINT Register; // Number of member variables + D3D10_NAME SystemValueType;// A predefined system value, or D3D10_NAME_UNDEFINED if not applicable + D3D10_REGISTER_COMPONENT_TYPE ComponentType;// Scalar type (e.g. uint, float, etc.) + BYTE Mask; // Mask to indicate which components of the register + // are used (combination of D3D10_COMPONENT_MASK values) + BYTE ReadWriteMask; // Mask to indicate whether a given component is + // never written (if this is an output signature) or + // always read (if this is an input signature). + // (combination of D3D10_COMPONENT_MASK values) + UINT Stream; // Stream index +} D3D11_SIGNATURE_PARAMETER_DESC; + +typedef struct _D3D11_SHADER_BUFFER_DESC +{ + LPCSTR Name; // Name of the constant buffer + D3D11_CBUFFER_TYPE Type; // Indicates type of buffer content + UINT Variables; // Number of member variables + UINT Size; // Size of CB (in bytes) + UINT uFlags; // Buffer description flags +} D3D11_SHADER_BUFFER_DESC; + +typedef struct _D3D11_SHADER_VARIABLE_DESC +{ + LPCSTR Name; // Name of the variable + UINT StartOffset; // Offset in constant buffer's backing store + UINT Size; // Size of variable (in bytes) + UINT uFlags; // Variable flags + LPVOID DefaultValue; // Raw pointer to default value + UINT StartTexture; // First texture index (or -1 if no textures used) + UINT TextureSize; // Number of texture slots possibly used. + UINT StartSampler; // First sampler index (or -1 if no textures used) + UINT SamplerSize; // Number of sampler slots possibly used. +} D3D11_SHADER_VARIABLE_DESC; + +typedef struct _D3D11_SHADER_TYPE_DESC +{ + D3D10_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.) + D3D10_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.) + UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable) + UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable) + UINT Elements; // Number of elements (0 if not an array) + UINT Members; // Number of members (0 if not a structure) + UINT Offset; // Offset from the start of structure (0 if not a structure member) + LPCSTR Name; // Name of type, can be NULL +} D3D11_SHADER_TYPE_DESC; + +typedef enum D3D11_TESSELLATOR_DOMAIN +{ + D3D11_TESSELLATOR_DOMAIN_UNDEFINED = 0, + D3D11_TESSELLATOR_DOMAIN_ISOLINE = 1, + D3D11_TESSELLATOR_DOMAIN_TRI = 2, + D3D11_TESSELLATOR_DOMAIN_QUAD = 3 +} D3D11_TESSELLATOR_DOMAIN; + +typedef enum D3D11_TESSELLATOR_PARTITIONING +{ + D3D11_TESSELLATOR_PARTITIONING_UNDEFINED = 0, + D3D11_TESSELLATOR_PARTITIONING_INTEGER = 1, + D3D11_TESSELLATOR_PARTITIONING_POW2 = 2, + D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3, + D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4 +} D3D11_TESSELLATOR_PARTITIONING; + +typedef enum D3D11_TESSELLATOR_OUTPUT_PRIMITIVE +{ + D3D11_TESSELLATOR_OUTPUT_UNDEFINED = 0, + D3D11_TESSELLATOR_OUTPUT_POINT = 1, + D3D11_TESSELLATOR_OUTPUT_LINE = 2, + D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3, + D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4 +} D3D11_TESSELLATOR_OUTPUT_PRIMITIVE; + +typedef struct _D3D11_SHADER_DESC +{ + UINT Version; // Shader version + LPCSTR Creator; // Creator string + UINT Flags; // Shader compilation/parse flags + + UINT ConstantBuffers; // Number of constant buffers + UINT BoundResources; // Number of bound resources + UINT InputParameters; // Number of parameters in the input signature + UINT OutputParameters; // Number of parameters in the output signature + + UINT InstructionCount; // Number of emitted instructions + UINT TempRegisterCount; // Number of temporary registers used + UINT TempArrayCount; // Number of temporary arrays used + UINT DefCount; // Number of constant defines + UINT DclCount; // Number of declarations (input + output) + UINT TextureNormalInstructions; // Number of non-categorized texture instructions + UINT TextureLoadInstructions; // Number of texture load instructions + UINT TextureCompInstructions; // Number of texture comparison instructions + UINT TextureBiasInstructions; // Number of texture bias instructions + UINT TextureGradientInstructions; // Number of texture gradient instructions + UINT FloatInstructionCount; // Number of floating point arithmetic instructions used + UINT IntInstructionCount; // Number of signed integer arithmetic instructions used + UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used + UINT StaticFlowControlCount; // Number of static flow control instructions used + UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used + UINT MacroInstructionCount; // Number of macro instructions used + UINT ArrayInstructionCount; // Number of array instructions used + UINT CutInstructionCount; // Number of cut instructions used + UINT EmitInstructionCount; // Number of emit instructions used + D3D10_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology + UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count + D3D11_PRIMITIVE InputPrimitive; // GS/HS input primitive + UINT PatchConstantParameters; // Number of parameters in the patch constant signature + UINT cGSInstanceCount; // Number of Geometry shader instances + UINT cControlPoints; // Number of control points in the HS->DS stage + D3D11_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator + D3D11_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator + D3D11_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline) + // instruction counts + UINT cBarrierInstructions; // Number of barrier instructions in a compute shader + UINT cInterlockedInstructions; // Number of interlocked instructions + UINT cTextureStoreInstructions; // Number of texture writes +} D3D11_SHADER_DESC; + +typedef struct _D3D11_SHADER_INPUT_BIND_DESC +{ + LPCSTR Name; // Name of the resource + D3D10_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.) + UINT BindPoint; // Starting bind point + UINT BindCount; // Number of contiguous bind points (for arrays) + + UINT uFlags; // Input binding flags + D3D11_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture) + D3D10_SRV_DIMENSION Dimension; // Dimension (if texture) + UINT NumSamples; // Number of samples (0 if not MS texture) +} D3D11_SHADER_INPUT_BIND_DESC; + + +////////////////////////////////////////////////////////////////////////////// +// Interfaces //////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D11ShaderReflectionType ID3D11ShaderReflectionType; +typedef interface ID3D11ShaderReflectionType *LPD3D11SHADERREFLECTIONTYPE; + +typedef interface ID3D11ShaderReflectionVariable ID3D11ShaderReflectionVariable; +typedef interface ID3D11ShaderReflectionVariable *LPD3D11SHADERREFLECTIONVARIABLE; + +typedef interface ID3D11ShaderReflectionConstantBuffer ID3D11ShaderReflectionConstantBuffer; +typedef interface ID3D11ShaderReflectionConstantBuffer *LPD3D11SHADERREFLECTIONCONSTANTBUFFER; + +typedef interface ID3D11ShaderReflection ID3D11ShaderReflection; +typedef interface ID3D11ShaderReflection *LPD3D11SHADERREFLECTION; + +// {6E6FFA6A-9BAE-4613-A51E-91652D508C21} +DEFINE_GUID(IID_ID3D11ShaderReflectionType, +0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21); + +#undef INTERFACE +#define INTERFACE ID3D11ShaderReflectionType + +DECLARE_INTERFACE(ID3D11ShaderReflectionType) +{ + STDMETHOD(GetDesc)(THIS_ __out D3D11_SHADER_TYPE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ __in UINT Index) PURE; + STDMETHOD_(ID3D11ShaderReflectionType*, GetMemberTypeByName)(THIS_ __in LPCSTR Name) PURE; + STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ __in UINT Index) PURE; + + STDMETHOD(IsEqual)(THIS_ __in ID3D11ShaderReflectionType* pType) PURE; + STDMETHOD_(ID3D11ShaderReflectionType*, GetSubType)(THIS) PURE; + STDMETHOD_(ID3D11ShaderReflectionType*, GetBaseClass)(THIS) PURE; + STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE; + STDMETHOD_(ID3D11ShaderReflectionType*, GetInterfaceByIndex)(THIS_ __in UINT uIndex) PURE; + STDMETHOD(IsOfType)(THIS_ __in ID3D11ShaderReflectionType* pType) PURE; + STDMETHOD(ImplementsInterface)(THIS_ __in ID3D11ShaderReflectionType* pBase) PURE; +}; + +// {51F23923-F3E5-4BD1-91CB-606177D8DB4C} +DEFINE_GUID(IID_ID3D11ShaderReflectionVariable, +0x51f23923, 0xf3e5, 0x4bd1, 0x91, 0xcb, 0x60, 0x61, 0x77, 0xd8, 0xdb, 0x4c); + +#undef INTERFACE +#define INTERFACE ID3D11ShaderReflectionVariable + +DECLARE_INTERFACE(ID3D11ShaderReflectionVariable) +{ + STDMETHOD(GetDesc)(THIS_ __out D3D11_SHADER_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D11ShaderReflectionType*, GetType)(THIS) PURE; + STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE; + + STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ __in UINT uArrayIndex) PURE; +}; + +// {EB62D63D-93DD-4318-8AE8-C6F83AD371B8} +DEFINE_GUID(IID_ID3D11ShaderReflectionConstantBuffer, +0xeb62d63d, 0x93dd, 0x4318, 0x8a, 0xe8, 0xc6, 0xf8, 0x3a, 0xd3, 0x71, 0xb8); + +#undef INTERFACE +#define INTERFACE ID3D11ShaderReflectionConstantBuffer + +DECLARE_INTERFACE(ID3D11ShaderReflectionConstantBuffer) +{ + STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_BUFFER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByIndex)(THIS_ __in UINT Index) PURE; + STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ __in LPCSTR Name) PURE; +}; + +// {17F27486-A342-4D10-8842-AB0874E7F670} +DEFINE_GUID(IID_ID3D11ShaderReflection, +0x17f27486, 0xa342, 0x4d10, 0x88, 0x42, 0xab, 0x08, 0x74, 0xe7, 0xf6, 0x70); + +#undef INTERFACE +#define INTERFACE ID3D11ShaderReflection + +DECLARE_INTERFACE_(ID3D11ShaderReflection, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ __in REFIID iid, + __out LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD(GetDesc)(THIS_ __out D3D11_SHADER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ __in UINT Index) PURE; + STDMETHOD_(ID3D11ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ __in LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDesc)(THIS_ __in UINT ResourceIndex, + __out D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE; + + STDMETHOD(GetInputParameterDesc)(THIS_ __in UINT ParameterIndex, + __out D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + STDMETHOD(GetOutputParameterDesc)(THIS_ __in UINT ParameterIndex, + __out D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + STDMETHOD(GetPatchConstantParameterDesc)(THIS_ __in UINT ParameterIndex, + __out D3D11_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D11ShaderReflectionVariable*, GetVariableByName)(THIS_ __in LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDescByName)(THIS_ __in LPCSTR Name, + __out D3D11_SHADER_INPUT_BIND_DESC *pDesc) PURE; + + STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE; + STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE; + STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE; + STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE; + + STDMETHOD_(D3D10_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE; + STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE; + + STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE; + STDMETHOD(GetMinFeatureLevel)(THIS_ __out enum D3D_FEATURE_LEVEL* pLevel) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3D11SHADER_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3DCSX.h b/Src/Decoder_H264_ALL/D3D/include/D3DCSX.h new file mode 100644 index 0000000..cd590f5 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3DCSX.h @@ -0,0 +1,396 @@ + +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3DX11GPGPU.h +// Content: D3DX11 General Purpose GPU computing algorithms +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3DX11GPGPU_H__ +#define __D3DX11GPGPU_H__ + +#include "d3dx11.h" + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + + + + + +////////////////////////////////////////////////////////////////////////////// + +typedef enum D3DX11_SCAN_DATA_TYPE +{ + D3DX11_SCAN_DATA_TYPE_FLOAT = 1, + D3DX11_SCAN_DATA_TYPE_INT, + D3DX11_SCAN_DATA_TYPE_UINT, +} D3DX11_SCAN_DATA_TYPE; + +typedef enum D3DX11_SCAN_OPCODE +{ + D3DX11_SCAN_OPCODE_ADD = 1, + D3DX11_SCAN_OPCODE_MIN, + D3DX11_SCAN_OPCODE_MAX, + D3DX11_SCAN_OPCODE_MUL, + D3DX11_SCAN_OPCODE_AND, + D3DX11_SCAN_OPCODE_OR, + D3DX11_SCAN_OPCODE_XOR, +} D3DX11_SCAN_OPCODE; + +typedef enum D3DX11_SCAN_DIRECTION +{ + D3DX11_SCAN_DIRECTION_FORWARD = 1, + D3DX11_SCAN_DIRECTION_BACKWARD, +} D3DX11_SCAN_DIRECTION; + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX11Scan: +////////////////////////////////////////////////////////////////////////////// + +// {5089b68f-e71d-4d38-be8e-f363b95a9405} +DEFINE_GUID(IID_ID3DX11Scan, 0x5089b68f, 0xe71d, 0x4d38, 0xbe, 0x8e, 0xf3, 0x63, 0xb9, 0x5a, 0x94, 0x05); + +#undef INTERFACE +#define INTERFACE ID3DX11Scan + +DECLARE_INTERFACE_(ID3DX11Scan, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX11Scan + + STDMETHOD(SetScanDirection)(THIS_ D3DX11_SCAN_DIRECTION Direction) PURE; + + //============================================================================= + // Performs an unsegmented scan of a sequence in-place or out-of-place + // ElementType element type + // OpCode binary operation + // Direction scan direction + // ElementScanSize size of scan, in elements + // pSrc input sequence on the device. pSrc==pDst for in-place scans + // pDst output sequence on the device + //============================================================================= + STDMETHOD(Scan)( THIS_ + D3DX11_SCAN_DATA_TYPE ElementType, + D3DX11_SCAN_OPCODE OpCode, + UINT ElementScanSize, + __in ID3D11UnorderedAccessView* pSrc, + __in ID3D11UnorderedAccessView* pDst + ) PURE; + + //============================================================================= + // Performs a multiscan of a sequence in-place or out-of-place + // ElementType element type + // OpCode binary operation + // Direction scan direction + // ElementScanSize size of scan, in elements + // ElementScanPitch pitch of the next scan, in elements + // ScanCount number of scans in a multiscan + // pSrc input sequence on the device. pSrc==pDst for in-place scans + // pDst output sequence on the device + //============================================================================= + STDMETHOD(Multiscan)( THIS_ + D3DX11_SCAN_DATA_TYPE ElementType, + D3DX11_SCAN_OPCODE OpCode, + UINT ElementScanSize, + UINT ElementScanPitch, + UINT ScanCount, + __in ID3D11UnorderedAccessView* pSrc, + __in ID3D11UnorderedAccessView* pDst + ) PURE; +}; + + +//============================================================================= +// Creates a scan context +// pDevice the device context +// MaxElementScanSize maximum single scan size, in elements (FLOAT, UINT, or INT) +// MaxScanCount maximum number of scans in multiscan +// ppScanContext new scan context +//============================================================================= +HRESULT WINAPI D3DX11CreateScan( + __in ID3D11DeviceContext* pDeviceContext, + UINT MaxElementScanSize, + UINT MaxScanCount, + __out ID3DX11Scan** ppScan ); + + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX11SegmentedScan: +////////////////////////////////////////////////////////////////////////////// + +// {a915128c-d954-4c79-bfe1-64db923194d6} +DEFINE_GUID(IID_ID3DX11SegmentedScan, 0xa915128c, 0xd954, 0x4c79, 0xbf, 0xe1, 0x64, 0xdb, 0x92, 0x31, 0x94, 0xd6); + +#undef INTERFACE +#define INTERFACE ID3DX11SegmentedScan + +DECLARE_INTERFACE_(ID3DX11SegmentedScan, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX11SegmentedScan + + STDMETHOD(SetScanDirection)(THIS_ D3DX11_SCAN_DIRECTION Direction) PURE; + + //============================================================================= + // Performs a segscan of a sequence in-place or out-of-place + // ElementType element type + // OpCode binary operation + // Direction scan direction + // pSrcElementFlags compact array of bits, one per element of pSrc. A set value + // indicates the start of a new segment. + // ElementScanSize size of scan, in elements + // pSrc input sequence on the device. pSrc==pDst for in-place scans + // pDst output sequence on the device + //============================================================================= + STDMETHOD(SegScan)( THIS_ + D3DX11_SCAN_DATA_TYPE ElementType, + D3DX11_SCAN_OPCODE OpCode, + UINT ElementScanSize, + __in_opt ID3D11UnorderedAccessView* pSrc, + __in ID3D11UnorderedAccessView* pSrcElementFlags, + __in ID3D11UnorderedAccessView* pDst + ) PURE; +}; + + +//============================================================================= +// Creates a segmented scan context +// pDevice the device context +// MaxElementScanSize maximum single scan size, in elements (FLOAT, UINT, or INT) +// ppScanContext new scan context +//============================================================================= +HRESULT WINAPI D3DX11CreateSegmentedScan( + __in ID3D11DeviceContext* pDeviceContext, + UINT MaxElementScanSize, + __out ID3DX11SegmentedScan** ppScan ); + + + +////////////////////////////////////////////////////////////////////////////// + +#define D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS 4 +#define D3DX11_FFT_MAX_TEMP_BUFFERS 4 +#define D3DX11_FFT_MAX_DIMENSIONS 32 + + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX11FFT: +////////////////////////////////////////////////////////////////////////////// + +// {b3f7a938-4c93-4310-a675-b30d6de50553} +DEFINE_GUID(IID_ID3DX11FFT, 0xb3f7a938, 0x4c93, 0x4310, 0xa6, 0x75, 0xb3, 0x0d, 0x6d, 0xe5, 0x05, 0x53); + +#undef INTERFACE +#define INTERFACE ID3DX11FFT + +DECLARE_INTERFACE_(ID3DX11FFT, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX11FFT + + // scale for forward transform (defaults to 1 if set to 0) + STDMETHOD(SetForwardScale)(THIS_ FLOAT ForwardScale) PURE; + STDMETHOD_(FLOAT, GetForwardScale)(THIS) PURE; + + // scale for inverse transform (defaults to 1/N if set to 0, where N is + // the product of the transformed dimension lengths + STDMETHOD(SetInverseScale)(THIS_ FLOAT InverseScale) PURE; + STDMETHOD_(FLOAT, GetInverseScale)(THIS) PURE; + + //------------------------------------------------------------------------------ + // Attaches buffers to the context and performs any required precomputation. + // The buffers must be no smaller than the corresponding buffer sizes returned + // by D3DX11CreateFFT*(). Temp buffers may beshared between multiple contexts, + // though care should be taken to concurrently execute multiple FFTs which share + // temp buffers. + // + // NumTempBuffers number of buffers in ppTempBuffers + // ppTempBuffers temp buffers to attach + // NumPrecomputeBuffers number of buffers in ppPrecomputeBufferSizes + // ppPrecomputeBufferSizes buffers to hold precomputed data + STDMETHOD(AttachBuffersAndPrecompute)( THIS_ + __in_range(0,D3DX11_FFT_MAX_TEMP_BUFFERS) UINT NumTempBuffers, + __in_ecount(NumTempBuffers) ID3D11UnorderedAccessView*const* ppTempBuffers, + __in_range(0,D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS) UINT NumPrecomputeBuffers, + __in_ecount(NumPrecomputeBuffers) ID3D11UnorderedAccessView*const* ppPrecomputeBufferSizes ) PURE; + + //------------------------------------------------------------------------------ + // Call after buffers have been attached to the context, pInput and *ppOuput can + // be one of the temp buffers. If *ppOutput == NULL, then the computation will ping-pong + // between temp buffers and the last buffer written to is stored at *ppOutput. + // Otherwise, *ppOutput is used as the output buffer (which may incur an extra copy). + // + // The format of complex data is interleaved components, e.g. (Real0, Imag0), + // (Real1, Imag1) ... etc. Data is stored in row major order + // + // pInputBuffer view onto input buffer + // ppOutpuBuffert pointer to view of output buffer + STDMETHOD(ForwardTransform)( THIS_ + __in const ID3D11UnorderedAccessView* pInputBuffer, + __inout ID3D11UnorderedAccessView** ppOutputBuffer ) PURE; + + STDMETHOD(InverseTransform)( THIS_ + __in const ID3D11UnorderedAccessView* pInputBuffer, + __inout ID3D11UnorderedAccessView** ppOutputBuffer ) PURE; +}; + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX11FFT Creation Routines +////////////////////////////////////////////////////////////////////////////// + +typedef enum D3DX11_FFT_DATA_TYPE +{ + D3DX11_FFT_DATA_TYPE_REAL, + D3DX11_FFT_DATA_TYPE_COMPLEX, +} D3DX11_FFT_DATA_TYPE; + +typedef enum D3DX11_FFT_DIM_MASK +{ + D3DX11_FFT_DIM_MASK_1D = 0x1, + D3DX11_FFT_DIM_MASK_2D = 0x3, + D3DX11_FFT_DIM_MASK_3D = 0x7, +} D3DX11_FFT_DIM_MASK; + +typedef struct D3DX11_FFT_DESC +{ + UINT NumDimensions; // number of dimensions + UINT ElementLengths[D3DX11_FFT_MAX_DIMENSIONS]; // length of each dimension + UINT DimensionMask; // a bit set for each dimensions to transform + // (see D3DX11_FFT_DIM_MASK for common masks) + D3DX11_FFT_DATA_TYPE Type; // type of the elements in spatial domain +} D3DX11_FFT_DESC; + + +//------------------------------------------------------------------------------ +// NumTempBufferSizes Number of temporary buffers needed +// pTempBufferSizes Minimum sizes (in FLOATs) of temporary buffers +// NumPrecomputeBufferSizes Number of precompute buffers needed +// pPrecomputeBufferSizes minimum sizes (in FLOATs) for precompute buffers +//------------------------------------------------------------------------------ + +typedef struct D3DX11_FFT_BUFFER_INFO +{ + __range(0,D3DX11_FFT_MAX_TEMP_BUFFERS) UINT NumTempBufferSizes; + UINT TempBufferFloatSizes[D3DX11_FFT_MAX_TEMP_BUFFERS]; + __range(0,D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS) UINT NumPrecomputeBufferSizes; + UINT PrecomputeBufferFloatSizes[D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS]; +} D3DX11_FFT_BUFFER_INFO; + + +typedef enum D3DX11_FFT_CREATE_FLAG +{ + D3DX11_FFT_CREATE_FLAG_NO_PRECOMPUTE_BUFFERS = 0x01L, // do not precompute values and store into buffers +} D3DX11_FFT_CREATE_FLAG; + + +//------------------------------------------------------------------------------ +// Creates an ID3DX11FFT COM interface object and returns a pointer to it at *ppFFT. +// The descriptor describes the shape of the data as well as the scaling factors +// that should be used for forward and inverse transforms. +// The FFT computation may require temporaries that act as ping-pong buffers +// and for other purposes. aTempSizes is a list of the sizes required for +// temporaries. Likewise, some data may need to be precomputed and the sizes +// of those sizes are returned in aPrecomputedBufferSizes. +// +// To perform a computation, follow these steps: +// 1) Create the FFT context object +// 2) Precompute (and Attach temp working buffers of at least the required size) +// 3) Call Compute() on some input data +// +// Compute() may be called repeatedly with different inputs and transform +// directions. When finished with the FFT work, release the FFT interface() +// +// Device Direct3DDeviceContext to use in +// pDesc Descriptor for FFT transform in +// Count the number of 1D FFTs to perform in +// Flags See D3DX11_FFT_CREATE_FLAG in +// pBufferInfo Pointer to BUFFER_INFO struct, filled by funciton out +// ppFFT Pointer to returned context pointer out +//------------------------------------------------------------------------------ + +HRESULT D3DX11CreateFFT( + ID3D11DeviceContext* pDeviceContext, + __in const D3DX11_FFT_DESC* pDesc, + UINT Flags, + __out D3DX11_FFT_BUFFER_INFO* pBufferInfo, + __out ID3DX11FFT** ppFFT + ); + +HRESULT D3DX11CreateFFT1DReal( + ID3D11DeviceContext* pDeviceContext, + UINT X, + UINT Flags, + __out D3DX11_FFT_BUFFER_INFO* pBufferInfo, + __out ID3DX11FFT** ppFFT + ); +HRESULT D3DX11CreateFFT1DComplex( + ID3D11DeviceContext* pDeviceContext, + UINT X, + UINT Flags, + __out D3DX11_FFT_BUFFER_INFO* pBufferInfo, + __out ID3DX11FFT** ppFFT + ); +HRESULT D3DX11CreateFFT2DReal( + ID3D11DeviceContext* pDeviceContext, + UINT X, + UINT Y, + UINT Flags, + __out D3DX11_FFT_BUFFER_INFO* pBufferInfo, + __out ID3DX11FFT** ppFFT + ); +HRESULT D3DX11CreateFFT2DComplex( + ID3D11DeviceContext* pDeviceContext, + UINT X, + UINT Y, + UINT Flags, + __out D3DX11_FFT_BUFFER_INFO* pBufferInfo, + __out ID3DX11FFT** ppFFT + ); +HRESULT D3DX11CreateFFT3DReal( + ID3D11DeviceContext* pDeviceContext, + UINT X, + UINT Y, + UINT Z, + UINT Flags, + __out D3DX11_FFT_BUFFER_INFO* pBufferInfo, + __out ID3DX11FFT** ppFFT + ); +HRESULT D3DX11CreateFFT3DComplex( + ID3D11DeviceContext* pDeviceContext, + UINT X, + UINT Y, + UINT Z, + UINT Flags, + __out D3DX11_FFT_BUFFER_INFO* pBufferInfo, + __out ID3DX11FFT** ppFFT + ); + + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX11GPGPU_H__ + + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3DX10.h b/Src/Decoder_H264_ALL/D3D/include/D3DX10.h new file mode 100644 index 0000000..5cdcd51 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3DX10.h @@ -0,0 +1,72 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx10.h +// Content: D3DX10 utility library +// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __D3DX10_INTERNAL__ +#error Incorrect D3DX10 header used +#endif + +#ifndef __D3DX10_H__ +#define __D3DX10_H__ + + +// Defines +#include +#include + +#define D3DX10_DEFAULT ((UINT) -1) +#define D3DX10_FROM_FILE ((UINT) -3) +#define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3) + +#ifndef D3DX10INLINE +#ifdef _MSC_VER + #if (_MSC_VER >= 1200) + #define D3DX10INLINE __forceinline + #else + #define D3DX10INLINE __inline + #endif +#else + #ifdef __cplusplus + #define D3DX10INLINE inline + #else + #define D3DX10INLINE + #endif +#endif +#endif + + + +// Includes +#include "d3d10.h" +#include "d3dx10.h" +#include "d3dx10math.h" +#include "d3dx10core.h" +#include "d3dx10tex.h" +#include "d3dx10mesh.h" +#include "d3dx10async.h" + + +// Errors +#define _FACDD 0x876 +#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) + +enum _D3DX10_ERR { + D3DX10_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900), + D3DX10_ERR_INVALID_MESH = MAKE_DDHRESULT(2901), + D3DX10_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902), + D3DX10_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903), + D3DX10_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904), + D3DX10_ERR_INVALID_DATA = MAKE_DDHRESULT(2905), + D3DX10_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906), + D3DX10_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907), + D3DX10_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908), +}; + + +#endif //__D3DX10_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3DX10core.h b/Src/Decoder_H264_ALL/D3D/include/D3DX10core.h new file mode 100644 index 0000000..1d47d82 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3DX10core.h @@ -0,0 +1,444 @@ +/////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx10core.h +// Content: D3DX10 core types and functions +// +/////////////////////////////////////////////////////////////////////////// + +#include "d3dx10.h" + +#ifndef __D3DX10CORE_H__ +#define __D3DX10CORE_H__ + +// Current name of the DLL shipped in the same SDK as this header. + + +#define D3DX10_DLL_W L"d3dx10_42.dll" +#define D3DX10_DLL_A "d3dx10_42.dll" + +#ifdef UNICODE + #define D3DX10_DLL D3DX10_DLL_W +#else + #define D3DX10_DLL D3DX10_DLL_A +#endif + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +/////////////////////////////////////////////////////////////////////////// +// D3DX10_SDK_VERSION: +// ----------------- +// This identifier is passed to D3DX10CheckVersion in order to ensure that an +// application was built against the correct header files and lib files. +// This number is incremented whenever a header (or other) change would +// require applications to be rebuilt. If the version doesn't match, +// D3DX10CreateVersion will return FALSE. (The number itself has no meaning.) +/////////////////////////////////////////////////////////////////////////// + + +#define D3DX10_SDK_VERSION 42 + + +/////////////////////////////////////////////////////////////////////////// +// D3DX10CreateDevice +// D3DX10CreateDeviceAndSwapChain +// D3DX10GetFeatureLevel1 +/////////////////////////////////////////////////////////////////////////// +HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *pAdapter, + D3D10_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + ID3D10Device **ppDevice); + +HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *pAdapter, + D3D10_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, + IDXGISwapChain **ppSwapChain, + ID3D10Device **ppDevice); + +typedef interface ID3D10Device1 ID3D10Device1; +HRESULT WINAPI D3DX10GetFeatureLevel1(ID3D10Device *pDevice, ID3D10Device1 **ppDevice1); + + +#ifdef D3D_DIAG_DLL +BOOL WINAPI D3DX10DebugMute(BOOL Mute); +#endif +HRESULT WINAPI D3DX10CheckVersion(UINT D3DSdkVersion, UINT D3DX10SdkVersion); + +#ifdef __cplusplus +} +#endif //__cplusplus + + +////////////////////////////////////////////////////////////////////////////// +// D3DX10_SPRITE flags: +// ----------------- +// D3DX10_SPRITE_SAVE_STATE +// Specifies device state should be saved and restored in Begin/End. +// D3DX10SPRITE_SORT_TEXTURE +// Sprites are sorted by texture prior to drawing. This is recommended when +// drawing non-overlapping sprites of uniform depth. For example, drawing +// screen-aligned text with ID3DX10Font. +// D3DX10SPRITE_SORT_DEPTH_FRONT_TO_BACK +// Sprites are sorted by depth front-to-back prior to drawing. This is +// recommended when drawing opaque sprites of varying depths. +// D3DX10SPRITE_SORT_DEPTH_BACK_TO_FRONT +// Sprites are sorted by depth back-to-front prior to drawing. This is +// recommended when drawing transparent sprites of varying depths. +// D3DX10SPRITE_ADDREF_TEXTURES +// AddRef/Release all textures passed in to DrawSpritesBuffered +////////////////////////////////////////////////////////////////////////////// + +typedef enum _D3DX10_SPRITE_FLAG +{ + D3DX10_SPRITE_SORT_TEXTURE = 0x01, + D3DX10_SPRITE_SORT_DEPTH_BACK_TO_FRONT = 0x02, + D3DX10_SPRITE_SORT_DEPTH_FRONT_TO_BACK = 0x04, + D3DX10_SPRITE_SAVE_STATE = 0x08, + D3DX10_SPRITE_ADDREF_TEXTURES = 0x10, +} D3DX10_SPRITE_FLAG; + +typedef struct _D3DX10_SPRITE +{ + D3DXMATRIX matWorld; + + D3DXVECTOR2 TexCoord; + D3DXVECTOR2 TexSize; + + D3DXCOLOR ColorModulate; + + ID3D10ShaderResourceView *pTexture; + UINT TextureIndex; +} D3DX10_SPRITE; + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX10Sprite: +// ------------ +// This object intends to provide an easy way to drawing sprites using D3D. +// +// Begin - +// Prepares device for drawing sprites. +// +// Draw - +// Draws a sprite +// +// Flush - +// Forces all batched sprites to submitted to the device. +// +// End - +// Restores device state to how it was when Begin was called. +// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3DX10Sprite ID3DX10Sprite; +typedef interface ID3DX10Sprite *LPD3DX10SPRITE; + + +// {BA0B762D-8D28-43ec-B9DC-2F84443B0614} +DEFINE_GUID(IID_ID3DX10Sprite, +0xba0b762d, 0x8d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14); + + +#undef INTERFACE +#define INTERFACE ID3DX10Sprite + +DECLARE_INTERFACE_(ID3DX10Sprite, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX10Sprite + STDMETHOD(Begin)(THIS_ UINT flags) PURE; + + STDMETHOD(DrawSpritesBuffered)(THIS_ D3DX10_SPRITE *pSprites, UINT cSprites) PURE; + STDMETHOD(Flush)(THIS) PURE; + + STDMETHOD(DrawSpritesImmediate)(THIS_ D3DX10_SPRITE *pSprites, UINT cSprites, UINT cbSprite, UINT flags) PURE; + STDMETHOD(End)(THIS) PURE; + + STDMETHOD(GetViewTransform)(THIS_ D3DXMATRIX *pViewTransform) PURE; + STDMETHOD(SetViewTransform)(THIS_ D3DXMATRIX *pViewTransform) PURE; + STDMETHOD(GetProjectionTransform)(THIS_ D3DXMATRIX *pProjectionTransform) PURE; + STDMETHOD(SetProjectionTransform)(THIS_ D3DXMATRIX *pProjectionTransform) PURE; + + STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE; +}; + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI + D3DX10CreateSprite( + ID3D10Device* pDevice, + UINT cDeviceBufferSize, + LPD3DX10SPRITE* ppSprite); + +#ifdef __cplusplus +} +#endif //__cplusplus + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX10ThreadPump: +////////////////////////////////////////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ID3DX10DataLoader + +DECLARE_INTERFACE(ID3DX10DataLoader) +{ + STDMETHOD(Load)(THIS) PURE; + STDMETHOD(Decompress)(THIS_ void **ppData, SIZE_T *pcBytes) PURE; + STDMETHOD(Destroy)(THIS) PURE; +}; + +#undef INTERFACE +#define INTERFACE ID3DX10DataProcessor + +DECLARE_INTERFACE(ID3DX10DataProcessor) +{ + STDMETHOD(Process)(THIS_ void *pData, SIZE_T cBytes) PURE; + STDMETHOD(CreateDeviceObject)(THIS_ void **ppDataObject) PURE; + STDMETHOD(Destroy)(THIS) PURE; +}; + +// {C93FECFA-6967-478a-ABBC-402D90621FCB} +DEFINE_GUID(IID_ID3DX10ThreadPump, +0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb); + +#undef INTERFACE +#define INTERFACE ID3DX10ThreadPump + +DECLARE_INTERFACE_(ID3DX10ThreadPump, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX10ThreadPump + STDMETHOD(AddWorkItem)(THIS_ ID3DX10DataLoader *pDataLoader, ID3DX10DataProcessor *pDataProcessor, HRESULT *pHResult, void **ppDeviceObject) PURE; + STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE; + + STDMETHOD(WaitForAllItems)(THIS) PURE; + STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT iWorkItemCount); + + STDMETHOD(PurgeAllItems)(THIS) PURE; + STDMETHOD(GetQueueStatus)(THIS_ UINT *pIoQueue, UINT *pProcessQueue, UINT *pDeviceQueue) PURE; + +}; + +HRESULT WINAPI D3DX10CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX10ThreadPump **ppThreadPump); + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX10Font: +// ---------- +// Font objects contain the textures and resources needed to render a specific +// font on a specific device. +// +// GetGlyphData - +// Returns glyph cache data, for a given glyph. +// +// PreloadCharacters/PreloadGlyphs/PreloadText - +// Preloads glyphs into the glyph cache textures. +// +// DrawText - +// Draws formatted text on a D3D device. Some parameters are +// surprisingly similar to those of GDI's DrawText function. See GDI +// documentation for a detailed description of these parameters. +// If pSprite is NULL, an internal sprite object will be used. +// +////////////////////////////////////////////////////////////////////////////// + +typedef struct _D3DX10_FONT_DESCA +{ + INT Height; + UINT Width; + UINT Weight; + UINT MipLevels; + BOOL Italic; + BYTE CharSet; + BYTE OutputPrecision; + BYTE Quality; + BYTE PitchAndFamily; + CHAR FaceName[LF_FACESIZE]; + +} D3DX10_FONT_DESCA, *LPD3DX10_FONT_DESCA; + +typedef struct _D3DX10_FONT_DESCW +{ + INT Height; + UINT Width; + UINT Weight; + UINT MipLevels; + BOOL Italic; + BYTE CharSet; + BYTE OutputPrecision; + BYTE Quality; + BYTE PitchAndFamily; + WCHAR FaceName[LF_FACESIZE]; + +} D3DX10_FONT_DESCW, *LPD3DX10_FONT_DESCW; + +#ifdef UNICODE +typedef D3DX10_FONT_DESCW D3DX10_FONT_DESC; +typedef LPD3DX10_FONT_DESCW LPD3DX10_FONT_DESC; +#else +typedef D3DX10_FONT_DESCA D3DX10_FONT_DESC; +typedef LPD3DX10_FONT_DESCA LPD3DX10_FONT_DESC; +#endif + + +typedef interface ID3DX10Font ID3DX10Font; +typedef interface ID3DX10Font *LPD3DX10FONT; + + +// {D79DBB70-5F21-4d36-BBC2-FF525C213CDC} +DEFINE_GUID(IID_ID3DX10Font, +0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc); + + +#undef INTERFACE +#define INTERFACE ID3DX10Font + +DECLARE_INTERFACE_(ID3DX10Font, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX10Font + STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE; + STDMETHOD(GetDescA)(THIS_ D3DX10_FONT_DESCA *pDesc) PURE; + STDMETHOD(GetDescW)(THIS_ D3DX10_FONT_DESCW *pDesc) PURE; + STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *pTextMetrics) PURE; + STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *pTextMetrics) PURE; + + STDMETHOD_(HDC, GetDC)(THIS) PURE; + STDMETHOD(GetGlyphData)(THIS_ UINT Glyph, ID3D10ShaderResourceView** ppTexture, RECT *pBlackBox, POINT *pCellInc) PURE; + + STDMETHOD(PreloadCharacters)(THIS_ UINT First, UINT Last) PURE; + STDMETHOD(PreloadGlyphs)(THIS_ UINT First, UINT Last) PURE; + STDMETHOD(PreloadTextA)(THIS_ LPCSTR pString, INT Count) PURE; + STDMETHOD(PreloadTextW)(THIS_ LPCWSTR pString, INT Count) PURE; + + STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DX10SPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, UINT Format, D3DXCOLOR Color) PURE; + STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DX10SPRITE pSprite, LPCWSTR pString, INT Count, LPRECT pRect, UINT Format, D3DXCOLOR Color) PURE; + +#ifdef __cplusplus +#ifdef UNICODE + HRESULT WINAPI_INLINE GetDesc(D3DX10_FONT_DESCW *pDesc) { return GetDescW(pDesc); } + HRESULT WINAPI_INLINE PreloadText(LPCWSTR pString, INT Count) { return PreloadTextW(pString, Count); } +#else + HRESULT WINAPI_INLINE GetDesc(D3DX10_FONT_DESCA *pDesc) { return GetDescA(pDesc); } + HRESULT WINAPI_INLINE PreloadText(LPCSTR pString, INT Count) { return PreloadTextA(pString, Count); } +#endif +#endif //__cplusplus +}; + +#ifndef GetTextMetrics +#ifdef UNICODE +#define GetTextMetrics GetTextMetricsW +#else +#define GetTextMetrics GetTextMetricsA +#endif +#endif + +#ifndef DrawText +#ifdef UNICODE +#define DrawText DrawTextW +#else +#define DrawText DrawTextA +#endif +#endif + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +HRESULT WINAPI + D3DX10CreateFontA( + ID3D10Device* pDevice, + INT Height, + UINT Width, + UINT Weight, + UINT MipLevels, + BOOL Italic, + UINT CharSet, + UINT OutputPrecision, + UINT Quality, + UINT PitchAndFamily, + LPCSTR pFaceName, + LPD3DX10FONT* ppFont); + +HRESULT WINAPI + D3DX10CreateFontW( + ID3D10Device* pDevice, + INT Height, + UINT Width, + UINT Weight, + UINT MipLevels, + BOOL Italic, + UINT CharSet, + UINT OutputPrecision, + UINT Quality, + UINT PitchAndFamily, + LPCWSTR pFaceName, + LPD3DX10FONT* ppFont); + +#ifdef UNICODE +#define D3DX10CreateFont D3DX10CreateFontW +#else +#define D3DX10CreateFont D3DX10CreateFontA +#endif + + +HRESULT WINAPI + D3DX10CreateFontIndirectA( + ID3D10Device* pDevice, + CONST D3DX10_FONT_DESCA* pDesc, + LPD3DX10FONT* ppFont); + +HRESULT WINAPI + D3DX10CreateFontIndirectW( + ID3D10Device* pDevice, + CONST D3DX10_FONT_DESCW* pDesc, + LPD3DX10FONT* ppFont); + +#ifdef UNICODE +#define D3DX10CreateFontIndirect D3DX10CreateFontIndirectW +#else +#define D3DX10CreateFontIndirect D3DX10CreateFontIndirectA +#endif + +HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *pDevice); + +#ifdef __cplusplus +} +#endif //__cplusplus + +/////////////////////////////////////////////////////////////////////////// + +#define _FACD3D 0x876 +#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) +#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code ) + +#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) +#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540) + +#endif //__D3DX10CORE_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3DX10math.h b/Src/Decoder_H264_ALL/D3D/include/D3DX10math.h new file mode 100644 index 0000000..a4b8e2d --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3DX10math.h @@ -0,0 +1,1866 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: D3DX10math.h +// Content: D3DX10 math types and functions +// +////////////////////////////////////////////////////////////////////////////// + +#include "D3DX10.h" + +// D3DX10 and D3DX9 math look the same. You can include either one into your project. +// We are intentionally using the header define from D3DX9 math to prevent double-inclusion. +#ifndef __D3DX9MATH_H__ +#define __D3DX9MATH_H__ + +#include +#if _MSC_VER >= 1200 +#pragma warning(push) +#endif +#pragma warning(disable:4201) // anonymous unions warning + +//=========================================================================== +// +// Type definitions from D3D9 +// +//=========================================================================== + +#ifndef D3DVECTOR_DEFINED +typedef struct _D3DVECTOR { + float x; + float y; + float z; +} D3DVECTOR; +#define D3DVECTOR_DEFINED +#endif + +#ifndef D3DMATRIX_DEFINED +typedef struct _D3DMATRIX { + union { + struct { + float _11, _12, _13, _14; + float _21, _22, _23, _24; + float _31, _32, _33, _34; + float _41, _42, _43, _44; + + }; + float m[4][4]; + }; +} D3DMATRIX; +#define D3DMATRIX_DEFINED +#endif + +//=========================================================================== +// +// General purpose utilities +// +//=========================================================================== +#define D3DX_PI (3.14159265358979323846) +#define D3DX_1BYPI ( 1.0 / D3DX_PI ) + +#define D3DXToRadian( degree ) ((degree) * (D3DX_PI / 180.0)) +#define D3DXToDegree( radian ) ((radian) * (180.0 / D3DX_PI)) + + + +//=========================================================================== +// +// 16 bit floating point numbers +// +//=========================================================================== + +#define D3DX_16F_DIG 3 // # of decimal digits of precision +#define D3DX_16F_EPSILON 4.8875809e-4f // smallest such that 1.0 + epsilon != 1.0 +#define D3DX_16F_MANT_DIG 11 // # of bits in mantissa +#define D3DX_16F_MAX 6.550400e+004 // max value +#define D3DX_16F_MAX_10_EXP 4 // max decimal exponent +#define D3DX_16F_MAX_EXP 15 // max binary exponent +#define D3DX_16F_MIN 6.1035156e-5f // min positive value +#define D3DX_16F_MIN_10_EXP (-4) // min decimal exponent +#define D3DX_16F_MIN_EXP (-14) // min binary exponent +#define D3DX_16F_RADIX 2 // exponent radix +#define D3DX_16F_ROUNDS 1 // addition rounding: near +#define D3DX_16F_SIGN_MASK 0x8000 +#define D3DX_16F_EXP_MASK 0x7C00 +#define D3DX_16F_FRAC_MASK 0x03FF + +typedef struct D3DXFLOAT16 +{ +#ifdef __cplusplus +public: + D3DXFLOAT16() {}; + D3DXFLOAT16( FLOAT ); + D3DXFLOAT16( CONST D3DXFLOAT16& ); + + // casting + operator FLOAT (); + + // binary operators + BOOL operator == ( CONST D3DXFLOAT16& ) const; + BOOL operator != ( CONST D3DXFLOAT16& ) const; + +protected: +#endif //__cplusplus + WORD value; +} D3DXFLOAT16, *LPD3DXFLOAT16; + + + +//=========================================================================== +// +// Vectors +// +//=========================================================================== + + +//-------------------------- +// 2D Vector +//-------------------------- +typedef struct D3DXVECTOR2 +{ +#ifdef __cplusplus +public: + D3DXVECTOR2() {}; + D3DXVECTOR2( CONST FLOAT * ); + D3DXVECTOR2( CONST D3DXFLOAT16 * ); + D3DXVECTOR2( FLOAT x, FLOAT y ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXVECTOR2& operator += ( CONST D3DXVECTOR2& ); + D3DXVECTOR2& operator -= ( CONST D3DXVECTOR2& ); + D3DXVECTOR2& operator *= ( FLOAT ); + D3DXVECTOR2& operator /= ( FLOAT ); + + // unary operators + D3DXVECTOR2 operator + () const; + D3DXVECTOR2 operator - () const; + + // binary operators + D3DXVECTOR2 operator + ( CONST D3DXVECTOR2& ) const; + D3DXVECTOR2 operator - ( CONST D3DXVECTOR2& ) const; + D3DXVECTOR2 operator * ( FLOAT ) const; + D3DXVECTOR2 operator / ( FLOAT ) const; + + friend D3DXVECTOR2 operator * ( FLOAT, CONST D3DXVECTOR2& ); + + BOOL operator == ( CONST D3DXVECTOR2& ) const; + BOOL operator != ( CONST D3DXVECTOR2& ) const; + + +public: +#endif //__cplusplus + FLOAT x, y; +} D3DXVECTOR2, *LPD3DXVECTOR2; + + + +//-------------------------- +// 2D Vector (16 bit) +//-------------------------- + +typedef struct D3DXVECTOR2_16F +{ +#ifdef __cplusplus +public: + D3DXVECTOR2_16F() {}; + D3DXVECTOR2_16F( CONST FLOAT * ); + D3DXVECTOR2_16F( CONST D3DXFLOAT16 * ); + D3DXVECTOR2_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y ); + + // casting + operator D3DXFLOAT16* (); + operator CONST D3DXFLOAT16* () const; + + // binary operators + BOOL operator == ( CONST D3DXVECTOR2_16F& ) const; + BOOL operator != ( CONST D3DXVECTOR2_16F& ) const; + +public: +#endif //__cplusplus + D3DXFLOAT16 x, y; + +} D3DXVECTOR2_16F, *LPD3DXVECTOR2_16F; + + + +//-------------------------- +// 3D Vector +//-------------------------- +#ifdef __cplusplus +typedef struct D3DXVECTOR3 : public D3DVECTOR +{ +public: + D3DXVECTOR3() {}; + D3DXVECTOR3( CONST FLOAT * ); + D3DXVECTOR3( CONST D3DVECTOR& ); + D3DXVECTOR3( CONST D3DXFLOAT16 * ); + D3DXVECTOR3( FLOAT x, FLOAT y, FLOAT z ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& ); + D3DXVECTOR3& operator -= ( CONST D3DXVECTOR3& ); + D3DXVECTOR3& operator *= ( FLOAT ); + D3DXVECTOR3& operator /= ( FLOAT ); + + // unary operators + D3DXVECTOR3 operator + () const; + D3DXVECTOR3 operator - () const; + + // binary operators + D3DXVECTOR3 operator + ( CONST D3DXVECTOR3& ) const; + D3DXVECTOR3 operator - ( CONST D3DXVECTOR3& ) const; + D3DXVECTOR3 operator * ( FLOAT ) const; + D3DXVECTOR3 operator / ( FLOAT ) const; + + friend D3DXVECTOR3 operator * ( FLOAT, CONST struct D3DXVECTOR3& ); + + BOOL operator == ( CONST D3DXVECTOR3& ) const; + BOOL operator != ( CONST D3DXVECTOR3& ) const; + +} D3DXVECTOR3, *LPD3DXVECTOR3; + +#else //!__cplusplus +typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3; +#endif //!__cplusplus + + + +//-------------------------- +// 3D Vector (16 bit) +//-------------------------- +typedef struct D3DXVECTOR3_16F +{ +#ifdef __cplusplus +public: + D3DXVECTOR3_16F() {}; + D3DXVECTOR3_16F( CONST FLOAT * ); + D3DXVECTOR3_16F( CONST D3DVECTOR& ); + D3DXVECTOR3_16F( CONST D3DXFLOAT16 * ); + D3DXVECTOR3_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y, CONST D3DXFLOAT16 &z ); + + // casting + operator D3DXFLOAT16* (); + operator CONST D3DXFLOAT16* () const; + + // binary operators + BOOL operator == ( CONST D3DXVECTOR3_16F& ) const; + BOOL operator != ( CONST D3DXVECTOR3_16F& ) const; + +public: +#endif //__cplusplus + D3DXFLOAT16 x, y, z; + +} D3DXVECTOR3_16F, *LPD3DXVECTOR3_16F; + + + +//-------------------------- +// 4D Vector +//-------------------------- +typedef struct D3DXVECTOR4 +{ +#ifdef __cplusplus +public: + D3DXVECTOR4() {}; + D3DXVECTOR4( CONST FLOAT* ); + D3DXVECTOR4( CONST D3DXFLOAT16* ); + D3DXVECTOR4( CONST D3DVECTOR& xyz, FLOAT w ); + D3DXVECTOR4( FLOAT x, FLOAT y, FLOAT z, FLOAT w ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXVECTOR4& operator += ( CONST D3DXVECTOR4& ); + D3DXVECTOR4& operator -= ( CONST D3DXVECTOR4& ); + D3DXVECTOR4& operator *= ( FLOAT ); + D3DXVECTOR4& operator /= ( FLOAT ); + + // unary operators + D3DXVECTOR4 operator + () const; + D3DXVECTOR4 operator - () const; + + // binary operators + D3DXVECTOR4 operator + ( CONST D3DXVECTOR4& ) const; + D3DXVECTOR4 operator - ( CONST D3DXVECTOR4& ) const; + D3DXVECTOR4 operator * ( FLOAT ) const; + D3DXVECTOR4 operator / ( FLOAT ) const; + + friend D3DXVECTOR4 operator * ( FLOAT, CONST D3DXVECTOR4& ); + + BOOL operator == ( CONST D3DXVECTOR4& ) const; + BOOL operator != ( CONST D3DXVECTOR4& ) const; + +public: +#endif //__cplusplus + FLOAT x, y, z, w; +} D3DXVECTOR4, *LPD3DXVECTOR4; + + +//-------------------------- +// 4D Vector (16 bit) +//-------------------------- +typedef struct D3DXVECTOR4_16F +{ +#ifdef __cplusplus +public: + D3DXVECTOR4_16F() {}; + D3DXVECTOR4_16F( CONST FLOAT * ); + D3DXVECTOR4_16F( CONST D3DXFLOAT16* ); + D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& xyz, CONST D3DXFLOAT16& w ); + D3DXVECTOR4_16F( CONST D3DXFLOAT16& x, CONST D3DXFLOAT16& y, CONST D3DXFLOAT16& z, CONST D3DXFLOAT16& w ); + + // casting + operator D3DXFLOAT16* (); + operator CONST D3DXFLOAT16* () const; + + // binary operators + BOOL operator == ( CONST D3DXVECTOR4_16F& ) const; + BOOL operator != ( CONST D3DXVECTOR4_16F& ) const; + +public: +#endif //__cplusplus + D3DXFLOAT16 x, y, z, w; + +} D3DXVECTOR4_16F, *LPD3DXVECTOR4_16F; + + + +//=========================================================================== +// +// Matrices +// +//=========================================================================== +#ifdef __cplusplus +typedef struct D3DXMATRIX : public D3DMATRIX +{ +public: + D3DXMATRIX() {}; + D3DXMATRIX( CONST FLOAT * ); + D3DXMATRIX( CONST D3DMATRIX& ); + D3DXMATRIX( CONST D3DXFLOAT16 * ); + D3DXMATRIX( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, + FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, + FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, + FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ); + + + // access grants + FLOAT& operator () ( UINT Row, UINT Col ); + FLOAT operator () ( UINT Row, UINT Col ) const; + + // casting operators + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXMATRIX& operator *= ( CONST D3DXMATRIX& ); + D3DXMATRIX& operator += ( CONST D3DXMATRIX& ); + D3DXMATRIX& operator -= ( CONST D3DXMATRIX& ); + D3DXMATRIX& operator *= ( FLOAT ); + D3DXMATRIX& operator /= ( FLOAT ); + + // unary operators + D3DXMATRIX operator + () const; + D3DXMATRIX operator - () const; + + // binary operators + D3DXMATRIX operator * ( CONST D3DXMATRIX& ) const; + D3DXMATRIX operator + ( CONST D3DXMATRIX& ) const; + D3DXMATRIX operator - ( CONST D3DXMATRIX& ) const; + D3DXMATRIX operator * ( FLOAT ) const; + D3DXMATRIX operator / ( FLOAT ) const; + + friend D3DXMATRIX operator * ( FLOAT, CONST D3DXMATRIX& ); + + BOOL operator == ( CONST D3DXMATRIX& ) const; + BOOL operator != ( CONST D3DXMATRIX& ) const; + +} D3DXMATRIX, *LPD3DXMATRIX; + +#else //!__cplusplus +typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX; +#endif //!__cplusplus + + +//--------------------------------------------------------------------------- +// Aligned Matrices +// +// This class helps keep matrices 16-byte aligned as preferred by P4 cpus. +// It aligns matrices on the stack and on the heap or in global scope. +// It does this using __declspec(align(16)) which works on VC7 and on VC 6 +// with the processor pack. Unfortunately there is no way to detect the +// latter so this is turned on only on VC7. On other compilers this is the +// the same as D3DXMATRIX. +// +// Using this class on a compiler that does not actually do the alignment +// can be dangerous since it will not expose bugs that ignore alignment. +// E.g if an object of this class in inside a struct or class, and some code +// memcopys data in it assuming tight packing. This could break on a compiler +// that eventually start aligning the matrix. +//--------------------------------------------------------------------------- +#ifdef __cplusplus +typedef struct _D3DXMATRIXA16 : public D3DXMATRIX +{ + _D3DXMATRIXA16() {}; + _D3DXMATRIXA16( CONST FLOAT * ); + _D3DXMATRIXA16( CONST D3DMATRIX& ); + _D3DXMATRIXA16( CONST D3DXFLOAT16 * ); + _D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, + FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, + FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, + FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ); + + // new operators + void* operator new ( size_t ); + void* operator new[] ( size_t ); + + // delete operators + void operator delete ( void* ); // These are NOT virtual; Do not + void operator delete[] ( void* ); // cast to D3DXMATRIX and delete. + + // assignment operators + _D3DXMATRIXA16& operator = ( CONST D3DXMATRIX& ); + +} _D3DXMATRIXA16; + +#else //!__cplusplus +typedef D3DXMATRIX _D3DXMATRIXA16; +#endif //!__cplusplus + + + +#if _MSC_VER >= 1300 // VC7 +#define D3DX_ALIGN16 __declspec(align(16)) +#else +#define D3DX_ALIGN16 // Earlier compiler may not understand this, do nothing. +#endif + +typedef D3DX_ALIGN16 _D3DXMATRIXA16 D3DXMATRIXA16, *LPD3DXMATRIXA16; + + + +//=========================================================================== +// +// Quaternions +// +//=========================================================================== +typedef struct D3DXQUATERNION +{ +#ifdef __cplusplus +public: + D3DXQUATERNION() {}; + D3DXQUATERNION( CONST FLOAT * ); + D3DXQUATERNION( CONST D3DXFLOAT16 * ); + D3DXQUATERNION( FLOAT x, FLOAT y, FLOAT z, FLOAT w ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXQUATERNION& operator += ( CONST D3DXQUATERNION& ); + D3DXQUATERNION& operator -= ( CONST D3DXQUATERNION& ); + D3DXQUATERNION& operator *= ( CONST D3DXQUATERNION& ); + D3DXQUATERNION& operator *= ( FLOAT ); + D3DXQUATERNION& operator /= ( FLOAT ); + + // unary operators + D3DXQUATERNION operator + () const; + D3DXQUATERNION operator - () const; + + // binary operators + D3DXQUATERNION operator + ( CONST D3DXQUATERNION& ) const; + D3DXQUATERNION operator - ( CONST D3DXQUATERNION& ) const; + D3DXQUATERNION operator * ( CONST D3DXQUATERNION& ) const; + D3DXQUATERNION operator * ( FLOAT ) const; + D3DXQUATERNION operator / ( FLOAT ) const; + + friend D3DXQUATERNION operator * (FLOAT, CONST D3DXQUATERNION& ); + + BOOL operator == ( CONST D3DXQUATERNION& ) const; + BOOL operator != ( CONST D3DXQUATERNION& ) const; + +#endif //__cplusplus + FLOAT x, y, z, w; +} D3DXQUATERNION, *LPD3DXQUATERNION; + + +//=========================================================================== +// +// Planes +// +//=========================================================================== +typedef struct D3DXPLANE +{ +#ifdef __cplusplus +public: + D3DXPLANE() {}; + D3DXPLANE( CONST FLOAT* ); + D3DXPLANE( CONST D3DXFLOAT16* ); + D3DXPLANE( FLOAT a, FLOAT b, FLOAT c, FLOAT d ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXPLANE& operator *= ( FLOAT ); + D3DXPLANE& operator /= ( FLOAT ); + + // unary operators + D3DXPLANE operator + () const; + D3DXPLANE operator - () const; + + // binary operators + D3DXPLANE operator * ( FLOAT ) const; + D3DXPLANE operator / ( FLOAT ) const; + + friend D3DXPLANE operator * ( FLOAT, CONST D3DXPLANE& ); + + BOOL operator == ( CONST D3DXPLANE& ) const; + BOOL operator != ( CONST D3DXPLANE& ) const; + +#endif //__cplusplus + FLOAT a, b, c, d; +} D3DXPLANE, *LPD3DXPLANE; + + +//=========================================================================== +// +// Colors +// +//=========================================================================== + +typedef struct D3DXCOLOR +{ +#ifdef __cplusplus +public: + D3DXCOLOR() {}; + D3DXCOLOR( UINT argb ); + D3DXCOLOR( CONST FLOAT * ); + D3DXCOLOR( CONST D3DXFLOAT16 * ); + D3DXCOLOR( FLOAT r, FLOAT g, FLOAT b, FLOAT a ); + + // casting + operator UINT () const; + + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXCOLOR& operator += ( CONST D3DXCOLOR& ); + D3DXCOLOR& operator -= ( CONST D3DXCOLOR& ); + D3DXCOLOR& operator *= ( FLOAT ); + D3DXCOLOR& operator /= ( FLOAT ); + + // unary operators + D3DXCOLOR operator + () const; + D3DXCOLOR operator - () const; + + // binary operators + D3DXCOLOR operator + ( CONST D3DXCOLOR& ) const; + D3DXCOLOR operator - ( CONST D3DXCOLOR& ) const; + D3DXCOLOR operator * ( FLOAT ) const; + D3DXCOLOR operator / ( FLOAT ) const; + + friend D3DXCOLOR operator * ( FLOAT, CONST D3DXCOLOR& ); + + BOOL operator == ( CONST D3DXCOLOR& ) const; + BOOL operator != ( CONST D3DXCOLOR& ) const; + +#endif //__cplusplus + FLOAT r, g, b, a; +} D3DXCOLOR, *LPD3DXCOLOR; + + + +//=========================================================================== +// +// D3DX math functions: +// +// NOTE: +// * All these functions can take the same object as in and out parameters. +// +// * Out parameters are typically also returned as return values, so that +// the output of one function may be used as a parameter to another. +// +//=========================================================================== + +//-------------------------- +// Float16 +//-------------------------- + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Converts an array 32-bit floats to 16-bit floats +D3DXFLOAT16* WINAPI D3DXFloat32To16Array + ( D3DXFLOAT16 *pOut, CONST FLOAT *pIn, UINT n ); + +// Converts an array 16-bit floats to 32-bit floats +FLOAT* WINAPI D3DXFloat16To32Array + ( __out_ecount(n) FLOAT *pOut, __in_ecount(n) CONST D3DXFLOAT16 *pIn, UINT n ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// 2D Vector +//-------------------------- + +// inline + +FLOAT D3DXVec2Length + ( CONST D3DXVECTOR2 *pV ); + +FLOAT D3DXVec2LengthSq + ( CONST D3DXVECTOR2 *pV ); + +FLOAT D3DXVec2Dot + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +// Z component of ((x1,y1,0) cross (x2,y2,0)) +FLOAT D3DXVec2CCW + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +D3DXVECTOR2* D3DXVec2Add + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +D3DXVECTOR2* D3DXVec2Subtract + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +// Minimize each component. x = min(x1, x2), y = min(y1, y2) +D3DXVECTOR2* D3DXVec2Minimize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +// Maximize each component. x = max(x1, x2), y = max(y1, y2) +D3DXVECTOR2* D3DXVec2Maximize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +D3DXVECTOR2* D3DXVec2Scale + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s ); + +// Linear interpolation. V1 + s(V2-V1) +D3DXVECTOR2* D3DXVec2Lerp + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, + FLOAT s ); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +D3DXVECTOR2* WINAPI D3DXVec2Normalize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV ); + +// Hermite interpolation between position V1, tangent T1 (when s == 0) +// and position V2, tangent T2 (when s == 1). +D3DXVECTOR2* WINAPI D3DXVec2Hermite + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pT1, + CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pT2, FLOAT s ); + +// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) +D3DXVECTOR2* WINAPI D3DXVec2CatmullRom + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV0, CONST D3DXVECTOR2 *pV1, + CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT s ); + +// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) +D3DXVECTOR2* WINAPI D3DXVec2BaryCentric + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, + CONST D3DXVECTOR2 *pV3, FLOAT f, FLOAT g); + +// Transform (x, y, 0, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec2Transform + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, 0, 1) by matrix, project result back into w=1. +D3DXVECTOR2* WINAPI D3DXVec2TransformCoord + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, 0, 0) by matrix. +D3DXVECTOR2* WINAPI D3DXVec2TransformNormal + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); + +// Transform Array (x, y, 0, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec2TransformArray + ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n); + +// Transform Array (x, y, 0, 1) by matrix, project result back into w=1. +D3DXVECTOR2* WINAPI D3DXVec2TransformCoordArray + ( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Transform Array (x, y, 0, 0) by matrix. +D3DXVECTOR2* WINAPI D3DXVec2TransformNormalArray + ( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + + + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// 3D Vector +//-------------------------- + +// inline + +FLOAT D3DXVec3Length + ( CONST D3DXVECTOR3 *pV ); + +FLOAT D3DXVec3LengthSq + ( CONST D3DXVECTOR3 *pV ); + +FLOAT D3DXVec3Dot + ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Cross + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Add + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Subtract + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +// Minimize each component. x = min(x1, x2), y = min(y1, y2), ... +D3DXVECTOR3* D3DXVec3Minimize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +// Maximize each component. x = max(x1, x2), y = max(y1, y2), ... +D3DXVECTOR3* D3DXVec3Maximize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Scale + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s); + +// Linear interpolation. V1 + s(V2-V1) +D3DXVECTOR3* D3DXVec3Lerp + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + FLOAT s ); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +D3DXVECTOR3* WINAPI D3DXVec3Normalize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV ); + +// Hermite interpolation between position V1, tangent T1 (when s == 0) +// and position V2, tangent T2 (when s == 1). +D3DXVECTOR3* WINAPI D3DXVec3Hermite + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pT1, + CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pT2, FLOAT s ); + +// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) +D3DXVECTOR3* WINAPI D3DXVec3CatmullRom + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV0, CONST D3DXVECTOR3 *pV1, + CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT s ); + +// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) +D3DXVECTOR3* WINAPI D3DXVec3BaryCentric + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + CONST D3DXVECTOR3 *pV3, FLOAT f, FLOAT g); + +// Transform (x, y, z, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec3Transform + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, z, 1) by matrix, project result back into w=1. +D3DXVECTOR3* WINAPI D3DXVec3TransformCoord + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, z, 0) by matrix. If you transforming a normal by a +// non-affine matrix, the matrix you pass to this function should be the +// transpose of the inverse of the matrix you would use to transform a coord. +D3DXVECTOR3* WINAPI D3DXVec3TransformNormal + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); + + +// Transform Array (x, y, z, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec3TransformArray + ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Transform Array (x, y, z, 1) by matrix, project result back into w=1. +D3DXVECTOR3* WINAPI D3DXVec3TransformCoordArray + ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Transform (x, y, z, 0) by matrix. If you transforming a normal by a +// non-affine matrix, the matrix you pass to this function should be the +// transpose of the inverse of the matrix you would use to transform a coord. +D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray + ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Project vector from object space into screen space +D3DXVECTOR3* WINAPI D3DXVec3Project + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3D10_VIEWPORT *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld); + +// Project vector from screen space into object space +D3DXVECTOR3* WINAPI D3DXVec3Unproject + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3D10_VIEWPORT *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld); + +// Project vector Array from object space into screen space +D3DXVECTOR3* WINAPI D3DXVec3ProjectArray + ( D3DXVECTOR3 *pOut, UINT OutStride,CONST D3DXVECTOR3 *pV, UINT VStride,CONST D3D10_VIEWPORT *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n); + +// Project vector Array from screen space into object space +D3DXVECTOR3* WINAPI D3DXVec3UnprojectArray + ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3D10_VIEWPORT *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n); + + +#ifdef __cplusplus +} +#endif + + + +//-------------------------- +// 4D Vector +//-------------------------- + +// inline + +FLOAT D3DXVec4Length + ( CONST D3DXVECTOR4 *pV ); + +FLOAT D3DXVec4LengthSq + ( CONST D3DXVECTOR4 *pV ); + +FLOAT D3DXVec4Dot + ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 ); + +D3DXVECTOR4* D3DXVec4Add + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +D3DXVECTOR4* D3DXVec4Subtract + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +// Minimize each component. x = min(x1, x2), y = min(y1, y2), ... +D3DXVECTOR4* D3DXVec4Minimize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +// Maximize each component. x = max(x1, x2), y = max(y1, y2), ... +D3DXVECTOR4* D3DXVec4Maximize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +D3DXVECTOR4* D3DXVec4Scale + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s); + +// Linear interpolation. V1 + s(V2-V1) +D3DXVECTOR4* D3DXVec4Lerp + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + FLOAT s ); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Cross-product in 4 dimensions. +D3DXVECTOR4* WINAPI D3DXVec4Cross + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + CONST D3DXVECTOR4 *pV3); + +D3DXVECTOR4* WINAPI D3DXVec4Normalize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV ); + +// Hermite interpolation between position V1, tangent T1 (when s == 0) +// and position V2, tangent T2 (when s == 1). +D3DXVECTOR4* WINAPI D3DXVec4Hermite + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pT1, + CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pT2, FLOAT s ); + +// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) +D3DXVECTOR4* WINAPI D3DXVec4CatmullRom + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV0, CONST D3DXVECTOR4 *pV1, + CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT s ); + +// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) +D3DXVECTOR4* WINAPI D3DXVec4BaryCentric + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + CONST D3DXVECTOR4 *pV3, FLOAT f, FLOAT g); + +// Transform vector by matrix. +D3DXVECTOR4* WINAPI D3DXVec4Transform + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM ); + +// Transform vector array by matrix. +D3DXVECTOR4* WINAPI D3DXVec4TransformArray + ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR4 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// 4D Matrix +//-------------------------- + +// inline + +D3DXMATRIX* D3DXMatrixIdentity + ( D3DXMATRIX *pOut ); + +BOOL D3DXMatrixIsIdentity + ( CONST D3DXMATRIX *pM ); + + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +FLOAT WINAPI D3DXMatrixDeterminant + ( CONST D3DXMATRIX *pM ); + +HRESULT WINAPI D3DXMatrixDecompose + ( D3DXVECTOR3 *pOutScale, D3DXQUATERNION *pOutRotation, + D3DXVECTOR3 *pOutTranslation, CONST D3DXMATRIX *pM ); + +D3DXMATRIX* WINAPI D3DXMatrixTranspose + ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM ); + +// Matrix multiplication. The result represents the transformation M2 +// followed by the transformation M1. (Out = M1 * M2) +D3DXMATRIX* WINAPI D3DXMatrixMultiply + ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ); + +// Matrix multiplication, followed by a transpose. (Out = T(M1 * M2)) +D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose + ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ); + +// Calculate inverse of matrix. Inversion my fail, in which case NULL will +// be returned. The determinant of pM is also returned it pfDeterminant +// is non-NULL. +D3DXMATRIX* WINAPI D3DXMatrixInverse + ( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM ); + +// Build a matrix which scales by (sx, sy, sz) +D3DXMATRIX* WINAPI D3DXMatrixScaling + ( D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz ); + +// Build a matrix which translates by (x, y, z) +D3DXMATRIX* WINAPI D3DXMatrixTranslation + ( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z ); + +// Build a matrix which rotates around the X axis +D3DXMATRIX* WINAPI D3DXMatrixRotationX + ( D3DXMATRIX *pOut, FLOAT Angle ); + +// Build a matrix which rotates around the Y axis +D3DXMATRIX* WINAPI D3DXMatrixRotationY + ( D3DXMATRIX *pOut, FLOAT Angle ); + +// Build a matrix which rotates around the Z axis +D3DXMATRIX* WINAPI D3DXMatrixRotationZ + ( D3DXMATRIX *pOut, FLOAT Angle ); + +// Build a matrix which rotates around an arbitrary axis +D3DXMATRIX* WINAPI D3DXMatrixRotationAxis + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ); + +// Build a matrix from a quaternion +D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion + ( D3DXMATRIX *pOut, CONST D3DXQUATERNION *pQ); + +// Yaw around the Y axis, a pitch around the X axis, +// and a roll around the Z axis. +D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll + ( D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ); + +// Build transformation matrix. NULL arguments are treated as identity. +// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixTransformation + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter, + CONST D3DXQUATERNION *pScalingRotation, CONST D3DXVECTOR3 *pScaling, + CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation, + CONST D3DXVECTOR3 *pTranslation); + +// Build 2D transformation matrix in XY plane. NULL arguments are treated as identity. +// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixTransformation2D + ( D3DXMATRIX *pOut, CONST D3DXVECTOR2* pScalingCenter, + FLOAT ScalingRotation, CONST D3DXVECTOR2* pScaling, + CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation, + CONST D3DXVECTOR2* pTranslation); + +// Build affine transformation matrix. NULL arguments are treated as identity. +// Mout = Ms * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation + ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter, + CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation); + +// Build 2D affine transformation matrix in XY plane. NULL arguments are treated as identity. +// Mout = Ms * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D + ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR2* pRotationCenter, + FLOAT Rotation, CONST D3DXVECTOR2* pTranslation); + +// Build a lookat matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixLookAtRH + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, + CONST D3DXVECTOR3 *pUp ); + +// Build a lookat matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixLookAtLH + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, + CONST D3DXVECTOR3 *pUp ); + +// Build a perspective projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH + ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH + ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build a perspective projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build an ortho projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoRH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build an ortho projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoLH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build an ortho projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build an ortho projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build a matrix which flattens geometry into a plane, as if casting +// a shadow from a light. +D3DXMATRIX* WINAPI D3DXMatrixShadow + ( D3DXMATRIX *pOut, CONST D3DXVECTOR4 *pLight, + CONST D3DXPLANE *pPlane ); + +// Build a matrix which reflects the coordinate system about a plane +D3DXMATRIX* WINAPI D3DXMatrixReflect + ( D3DXMATRIX *pOut, CONST D3DXPLANE *pPlane ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// Quaternion +//-------------------------- + +// inline + +FLOAT D3DXQuaternionLength + ( CONST D3DXQUATERNION *pQ ); + +// Length squared, or "norm" +FLOAT D3DXQuaternionLengthSq + ( CONST D3DXQUATERNION *pQ ); + +FLOAT D3DXQuaternionDot + ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 ); + +// (0, 0, 0, 1) +D3DXQUATERNION* D3DXQuaternionIdentity + ( D3DXQUATERNION *pOut ); + +BOOL D3DXQuaternionIsIdentity + ( CONST D3DXQUATERNION *pQ ); + +// (-x, -y, -z, w) +D3DXQUATERNION* D3DXQuaternionConjugate + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Compute a quaternin's axis and angle of rotation. Expects unit quaternions. +void WINAPI D3DXQuaternionToAxisAngle + ( CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle ); + +// Build a quaternion from a rotation matrix. +D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix + ( D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM); + +// Rotation about arbitrary axis. +D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis + ( D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ); + +// Yaw around the Y axis, a pitch around the X axis, +// and a roll around the Z axis. +D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll + ( D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ); + +// Quaternion multiplication. The result represents the rotation Q2 +// followed by the rotation Q1. (Out = Q2 * Q1) +D3DXQUATERNION* WINAPI D3DXQuaternionMultiply + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2 ); + +D3DXQUATERNION* WINAPI D3DXQuaternionNormalize + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Conjugate and re-norm +D3DXQUATERNION* WINAPI D3DXQuaternionInverse + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Expects unit quaternions. +// if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v) +D3DXQUATERNION* WINAPI D3DXQuaternionLn + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Expects pure quaternions. (w == 0) w is ignored in calculation. +// if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v) +D3DXQUATERNION* WINAPI D3DXQuaternionExp + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Spherical linear interpolation between Q1 (t == 0) and Q2 (t == 1). +// Expects unit quaternions. +D3DXQUATERNION* WINAPI D3DXQuaternionSlerp + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2, FLOAT t ); + +// Spherical quadrangle interpolation. +// Slerp(Slerp(Q1, C, t), Slerp(A, B, t), 2t(1-t)) +D3DXQUATERNION* WINAPI D3DXQuaternionSquad + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pA, CONST D3DXQUATERNION *pB, + CONST D3DXQUATERNION *pC, FLOAT t ); + +// Setup control points for spherical quadrangle interpolation +// from Q1 to Q2. The control points are chosen in such a way +// to ensure the continuity of tangents with adjacent segments. +void WINAPI D3DXQuaternionSquadSetup + ( D3DXQUATERNION *pAOut, D3DXQUATERNION *pBOut, D3DXQUATERNION *pCOut, + CONST D3DXQUATERNION *pQ0, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3 ); + +// Barycentric interpolation. +// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g)) +D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3, + FLOAT f, FLOAT g ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// Plane +//-------------------------- + +// inline + +// ax + by + cz + dw +FLOAT D3DXPlaneDot + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV); + +// ax + by + cz + d +FLOAT D3DXPlaneDotCoord + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV); + +// ax + by + cz +FLOAT D3DXPlaneDotNormal + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV); + +D3DXPLANE* D3DXPlaneScale + (D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Normalize plane (so that |a,b,c| == 1) +D3DXPLANE* WINAPI D3DXPlaneNormalize + ( D3DXPLANE *pOut, CONST D3DXPLANE *pP); + +// Find the intersection between a plane and a line. If the line is +// parallel to the plane, NULL is returned. +D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine + ( D3DXVECTOR3 *pOut, CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV1, + CONST D3DXVECTOR3 *pV2); + +// Construct a plane from a point and a normal +D3DXPLANE* WINAPI D3DXPlaneFromPointNormal + ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pPoint, CONST D3DXVECTOR3 *pNormal); + +// Construct a plane from 3 points +D3DXPLANE* WINAPI D3DXPlaneFromPoints + ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + CONST D3DXVECTOR3 *pV3); + +// Transform a plane by a matrix. The vector (a,b,c) must be normal. +// M should be the inverse transpose of the transformation desired. +D3DXPLANE* WINAPI D3DXPlaneTransform + ( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM ); + +// Transform an array of planes by a matrix. The vectors (a,b,c) must be normal. +// M should be the inverse transpose of the transformation desired. +D3DXPLANE* WINAPI D3DXPlaneTransformArray + ( D3DXPLANE *pOut, UINT OutStride, CONST D3DXPLANE *pP, UINT PStride, CONST D3DXMATRIX *pM, UINT n ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// Color +//-------------------------- + +// inline + +// (1-r, 1-g, 1-b, a) +D3DXCOLOR* D3DXColorNegative + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC); + +D3DXCOLOR* D3DXColorAdd + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); + +D3DXCOLOR* D3DXColorSubtract + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); + +D3DXCOLOR* D3DXColorScale + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s); + +// (r1*r2, g1*g2, b1*b2, a1*a2) +D3DXCOLOR* D3DXColorModulate + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); + +// Linear interpolation of r,g,b, and a. C1 + s(C2-C1) +D3DXCOLOR* D3DXColorLerp + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Interpolate r,g,b between desaturated color and color. +// DesaturatedColor + s(Color - DesaturatedColor) +D3DXCOLOR* WINAPI D3DXColorAdjustSaturation + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s); + +// Interpolate r,g,b between 50% grey and color. Grey + s(Color - Grey) +D3DXCOLOR* WINAPI D3DXColorAdjustContrast + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT c); + +#ifdef __cplusplus +} +#endif + + + + +//-------------------------- +// Misc +//-------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +// Calculate Fresnel term given the cosine of theta (likely obtained by +// taking the dot of two normals), and the refraction index of the material. +FLOAT WINAPI D3DXFresnelTerm + (FLOAT CosTheta, FLOAT RefractionIndex); + +#ifdef __cplusplus +} +#endif + + + +//=========================================================================== +// +// Matrix Stack +// +//=========================================================================== + +typedef interface ID3DXMatrixStack ID3DXMatrixStack; +typedef interface ID3DXMatrixStack *LPD3DXMATRIXSTACK; + +// {C7885BA7-F990-4fe7-922D-8515E477DD85} +DEFINE_GUID(IID_ID3DXMatrixStack, +0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85); + + +#undef INTERFACE +#define INTERFACE ID3DXMatrixStack + +DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown) +{ + // + // IUnknown methods + // + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + // + // ID3DXMatrixStack methods + // + + // Pops the top of the stack, returns the current top + // *after* popping the top. + STDMETHOD(Pop)(THIS) PURE; + + // Pushes the stack by one, duplicating the current matrix. + STDMETHOD(Push)(THIS) PURE; + + // Loads identity in the current matrix. + STDMETHOD(LoadIdentity)(THIS) PURE; + + // Loads the given matrix into the current matrix + STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; + + // Right-Multiplies the given matrix to the current matrix. + // (transformation is about the current world origin) + STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; + + // Left-Multiplies the given matrix to the current matrix + // (transformation is about the local origin of the object) + STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE; + + // Right multiply the current matrix with the computed rotation + // matrix, counterclockwise about the given axis with the given angle. + // (rotation is about the current world origin) + STDMETHOD(RotateAxis) + (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; + + // Left multiply the current matrix with the computed rotation + // matrix, counterclockwise about the given axis with the given angle. + // (rotation is about the local origin of the object) + STDMETHOD(RotateAxisLocal) + (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; + + // Right multiply the current matrix with the computed rotation + // matrix. All angles are counterclockwise. (rotation is about the + // current world origin) + + // The rotation is composed of a yaw around the Y axis, a pitch around + // the X axis, and a roll around the Z axis. + STDMETHOD(RotateYawPitchRoll) + (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; + + // Left multiply the current matrix with the computed rotation + // matrix. All angles are counterclockwise. (rotation is about the + // local origin of the object) + + // The rotation is composed of a yaw around the Y axis, a pitch around + // the X axis, and a roll around the Z axis. + STDMETHOD(RotateYawPitchRollLocal) + (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; + + // Right multiply the current matrix with the computed scale + // matrix. (transformation is about the current world origin) + STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + + // Left multiply the current matrix with the computed scale + // matrix. (transformation is about the local origin of the object) + STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + + // Right multiply the current matrix with the computed translation + // matrix. (transformation is about the current world origin) + STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE; + + // Left multiply the current matrix with the computed translation + // matrix. (transformation is about the local origin of the object) + STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + + // Obtain the current matrix at the top of the stack + STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +HRESULT WINAPI + D3DXCreateMatrixStack( + UINT Flags, + LPD3DXMATRIXSTACK* ppStack); + +#ifdef __cplusplus +} +#endif + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +//============================================================================ +// +// Basic Spherical Harmonic math routines +// +//============================================================================ + +#define D3DXSH_MINORDER 2 +#define D3DXSH_MAXORDER 6 + +//============================================================================ +// +// D3DXSHEvalDirection: +// -------------------- +// Evaluates the Spherical Harmonic basis functions +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Direction to evaluate in - assumed to be normalized +// +//============================================================================ + +FLOAT* WINAPI D3DXSHEvalDirection + ( FLOAT *pOut, UINT Order, CONST D3DXVECTOR3 *pDir ); + +//============================================================================ +// +// D3DXSHRotate: +// -------------------- +// Rotates SH vector by a rotation matrix +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned (should not alias with pIn.) +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pMatrix +// Matrix used for rotation - rotation sub matrix should be orthogonal +// and have a unit determinant. +// pIn +// Input SH coeffs (rotated), incorect results if this is also output. +// +//============================================================================ + +FLOAT* WINAPI D3DXSHRotate + ( __out_ecount(Order*Order) FLOAT *pOut, UINT Order, CONST D3DXMATRIX *pMatrix, CONST FLOAT *pIn ); + +//============================================================================ +// +// D3DXSHRotateZ: +// -------------------- +// Rotates the SH vector in the Z axis by an angle +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned (should not alias with pIn.) +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// Angle +// Angle in radians to rotate around the Z axis. +// pIn +// Input SH coeffs (rotated), incorect results if this is also output. +// +//============================================================================ + + +FLOAT* WINAPI D3DXSHRotateZ + ( FLOAT *pOut, UINT Order, FLOAT Angle, CONST FLOAT *pIn ); + +//============================================================================ +// +// D3DXSHAdd: +// -------------------- +// Adds two SH vectors, pOut[i] = pA[i] + pB[i]; +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pA +// Input SH coeffs. +// pB +// Input SH coeffs (second vector.) +// +//============================================================================ + +FLOAT* WINAPI D3DXSHAdd + ( __out_ecount(Order*Order) FLOAT *pOut, UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ); + +//============================================================================ +// +// D3DXSHScale: +// -------------------- +// Adds two SH vectors, pOut[i] = pA[i]*Scale; +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pIn +// Input SH coeffs. +// Scale +// Scale factor. +// +//============================================================================ + +FLOAT* WINAPI D3DXSHScale + ( __out_ecount(Order*Order) FLOAT *pOut, UINT Order, CONST FLOAT *pIn, CONST FLOAT Scale ); + +//============================================================================ +// +// D3DXSHDot: +// -------------------- +// Computes the dot product of two SH vectors +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pA +// Input SH coeffs. +// pB +// Second set of input SH coeffs. +// +//============================================================================ + +FLOAT WINAPI D3DXSHDot + ( UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ); + +//============================================================================ +// +// D3DXSHMultiply[O]: +// -------------------- +// Computes the product of two functions represented using SH (f and g), where: +// pOut[i] = int(y_i(s) * f(s) * g(s)), where y_i(s) is the ith SH basis +// function, f(s) and g(s) are SH functions (sum_i(y_i(s)*c_i)). The order O +// determines the lengths of the arrays, where there should always be O^2 +// coefficients. In general the product of two SH functions of order O generates +// and SH function of order 2*O - 1, but we truncate the result. This means +// that the product commutes (f*g == g*f) but doesn't associate +// (f*(g*h) != (f*g)*h. +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// pF +// Input SH coeffs for first function. +// pG +// Second set of input SH coeffs. +// +//============================================================================ + +__out_ecount(4) FLOAT* WINAPI D3DXSHMultiply2(__out_ecount(4) FLOAT *pOut,__in_ecount(4) CONST FLOAT *pF,__in_ecount(4) CONST FLOAT *pG); +__out_ecount(9) FLOAT* WINAPI D3DXSHMultiply3(__out_ecount(9) FLOAT *pOut,__in_ecount(9) CONST FLOAT *pF,__in_ecount(9) CONST FLOAT *pG); +__out_ecount(16) FLOAT* WINAPI D3DXSHMultiply4(__out_ecount(16) FLOAT *pOut,__in_ecount(16) CONST FLOAT *pF,__in_ecount(16) CONST FLOAT *pG); +__out_ecount(25) FLOAT* WINAPI D3DXSHMultiply5(__out_ecount(25) FLOAT *pOut,__in_ecount(25) CONST FLOAT *pF,__in_ecount(25) CONST FLOAT *pG); +__out_ecount(36) FLOAT* WINAPI D3DXSHMultiply6(__out_ecount(36) FLOAT *pOut,__in_ecount(36) CONST FLOAT *pF,__in_ecount(36) CONST FLOAT *pG); + + +//============================================================================ +// +// Basic Spherical Harmonic lighting routines +// +//============================================================================ + +//============================================================================ +// +// D3DXSHEvalDirectionalLight: +// -------------------- +// Evaluates a directional light and returns spectral SH data. The output +// vector is computed so that if the intensity of R/G/B is unit the resulting +// exit radiance of a point directly under the light on a diffuse object with +// an albedo of 1 would be 1.0. This will compute 3 spectral samples, pROut +// has to be specified, while pGout and pBout are optional. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Direction light is coming from (assumed to be normalized.) +// RIntensity +// Red intensity of light. +// GIntensity +// Green intensity of light. +// BIntensity +// Blue intensity of light. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green (optional.) +// pBOut +// Output SH vector for Blue (optional.) +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalDirectionalLight + ( UINT Order, CONST D3DXVECTOR3 *pDir, + FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, + __out_ecount_opt(Order*Order) FLOAT *pROut, + __out_ecount_opt(Order*Order) FLOAT *pGOut, + __out_ecount_opt(Order*Order) FLOAT *pBOut ); + +//============================================================================ +// +// D3DXSHEvalSphericalLight: +// -------------------- +// Evaluates a spherical light and returns spectral SH data. There is no +// normalization of the intensity of the light like there is for directional +// lights, care has to be taken when specifiying the intensities. This will +// compute 3 spectral samples, pROut has to be specified, while pGout and +// pBout are optional. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pPos +// Position of light - reciever is assumed to be at the origin. +// Radius +// Radius of the spherical light source. +// RIntensity +// Red intensity of light. +// GIntensity +// Green intensity of light. +// BIntensity +// Blue intensity of light. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green (optional.) +// pBOut +// Output SH vector for Blue (optional.) +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalSphericalLight + ( UINT Order, CONST D3DXVECTOR3 *pPos, FLOAT Radius, + FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, + __out_ecount_opt(Order*Order) FLOAT *pROut, + __out_ecount_opt(Order*Order) FLOAT *pGOut, + __out_ecount_opt(Order*Order) FLOAT *pBOut ); + +//============================================================================ +// +// D3DXSHEvalConeLight: +// -------------------- +// Evaluates a light that is a cone of constant intensity and returns spectral +// SH data. The output vector is computed so that if the intensity of R/G/B is +// unit the resulting exit radiance of a point directly under the light oriented +// in the cone direction on a diffuse object with an albedo of 1 would be 1.0. +// This will compute 3 spectral samples, pROut has to be specified, while pGout +// and pBout are optional. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Direction light is coming from (assumed to be normalized.) +// Radius +// Radius of cone in radians. +// RIntensity +// Red intensity of light. +// GIntensity +// Green intensity of light. +// BIntensity +// Blue intensity of light. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green (optional.) +// pBOut +// Output SH vector for Blue (optional.) +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalConeLight + ( UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT Radius, + FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, + __out_ecount_opt(Order*Order) FLOAT *pROut, + __out_ecount_opt(Order*Order) FLOAT *pGOut, + __out_ecount_opt(Order*Order) FLOAT *pBOut ); + +//============================================================================ +// +// D3DXSHEvalHemisphereLight: +// -------------------- +// Evaluates a light that is a linear interpolant between two colors over the +// sphere. The interpolant is linear along the axis of the two points, not +// over the surface of the sphere (ie: if the axis was (0,0,1) it is linear in +// Z, not in the azimuthal angle.) The resulting spherical lighting function +// is normalized so that a point on a perfectly diffuse surface with no +// shadowing and a normal pointed in the direction pDir would result in exit +// radiance with a value of 1 if the top color was white and the bottom color +// was black. This is a very simple model where Top represents the intensity +// of the "sky" and Bottom represents the intensity of the "ground". +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Axis of the hemisphere. +// Top +// Color of the upper hemisphere. +// Bottom +// Color of the lower hemisphere. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green +// pBOut +// Output SH vector for Blue +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalHemisphereLight + ( UINT Order, CONST D3DXVECTOR3 *pDir, D3DXCOLOR Top, D3DXCOLOR Bottom, + __out_ecount_opt(Order*Order) FLOAT *pROut, + __out_ecount_opt(Order*Order) FLOAT *pGOut, + __out_ecount_opt(Order*Order) FLOAT *pBOut ); + +// Math intersection functions + +BOOL WINAPI D3DXIntersectTri +( + CONST D3DXVECTOR3 *p0, // Triangle vertex 0 position + CONST D3DXVECTOR3 *p1, // Triangle vertex 1 position + CONST D3DXVECTOR3 *p2, // Triangle vertex 2 position + CONST D3DXVECTOR3 *pRayPos, // Ray origin + CONST D3DXVECTOR3 *pRayDir, // Ray direction + FLOAT *pU, // Barycentric Hit Coordinates + FLOAT *pV, // Barycentric Hit Coordinates + FLOAT *pDist); // Ray-Intersection Parameter Distance + +BOOL WINAPI + D3DXSphereBoundProbe( + CONST D3DXVECTOR3 *pCenter, + FLOAT Radius, + CONST D3DXVECTOR3 *pRayPosition, + CONST D3DXVECTOR3 *pRayDirection); + +BOOL WINAPI + D3DXBoxBoundProbe( + CONST D3DXVECTOR3 *pMin, + CONST D3DXVECTOR3 *pMax, + CONST D3DXVECTOR3 *pRayPosition, + CONST D3DXVECTOR3 *pRayDirection); + +HRESULT WINAPI + D3DXComputeBoundingSphere( + CONST D3DXVECTOR3 *pFirstPosition, // pointer to first position + DWORD NumVertices, + DWORD dwStride, // count in bytes to subsequent position vectors + D3DXVECTOR3 *pCenter, + FLOAT *pRadius); + +HRESULT WINAPI + D3DXComputeBoundingBox( + CONST D3DXVECTOR3 *pFirstPosition, // pointer to first position + DWORD NumVertices, + DWORD dwStride, // count in bytes to subsequent position vectors + D3DXVECTOR3 *pMin, + D3DXVECTOR3 *pMax); + + +/////////////////////////////////////////////////////////////////////////// +// CPU Optimization: +/////////////////////////////////////////////////////////////////////////// + +//------------------------------------------------------------------------- +// D3DX_CPU_OPTIMIZATION flags: +// ---------------------------- +// D3DX_NOT_OPTIMIZED Use Intel Pentium optimizations +// D3DX_3DNOW_OPTIMIZED Use AMD 3DNow optimizations +// D3DX_SSE_OPTIMIZED Use Intel Pentium III SSE optimizations +// D3DX_SSE2_OPTIMIZED Use Intel Pentium IV SSE2 optimizations +//------------------------------------------------------------------------- + + +typedef enum _D3DX_CPU_OPTIMIZATION +{ + D3DX_NOT_OPTIMIZED = 0, + D3DX_3DNOW_OPTIMIZED, + D3DX_SSE2_OPTIMIZED, + D3DX_SSE_OPTIMIZED +} D3DX_CPU_OPTIMIZATION; + + +//------------------------------------------------------------------------- +// D3DXCpuOptimizations: +// --------------------- +// Enables or disables CPU optimizations. Returns the type of CPU, which +// was detected, and for which optimizations exist. +// +// Parameters: +// Enable +// TRUE to enable CPU optimizations. FALSE to disable. +//------------------------------------------------------------------------- + +D3DX_CPU_OPTIMIZATION WINAPI + D3DXCpuOptimizations(BOOL Enable); + +#ifdef __cplusplus +} +#endif + + +#include "D3DX10math.inl" + +#if _MSC_VER >= 1200 +#pragma warning(pop) +#else +#pragma warning(default:4201) +#endif + +#endif // __D3DX9MATH_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3DX10math.inl b/Src/Decoder_H264_ALL/D3D/include/D3DX10math.inl new file mode 100644 index 0000000..56f1163 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3DX10math.inl @@ -0,0 +1,2228 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx10math.inl +// Content: D3DX10 math inline functions +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3DXMATH_INL__ +#define __D3DXMATH_INL__ + + +//=========================================================================== +// +// Inline Class Methods +// +//=========================================================================== + +#ifdef __cplusplus + +//-------------------------- +// Float16 +//-------------------------- + +D3DX10INLINE +D3DXFLOAT16::D3DXFLOAT16( FLOAT f ) +{ + D3DXFloat32To16Array(this, &f, 1); +} + +D3DX10INLINE +D3DXFLOAT16::D3DXFLOAT16( CONST D3DXFLOAT16& f ) +{ + value = f.value; +} + +// casting +D3DX10INLINE +D3DXFLOAT16::operator FLOAT () +{ + FLOAT f; + D3DXFloat16To32Array(&f, this, 1); + return f; +} + +// binary operators +D3DX10INLINE BOOL +D3DXFLOAT16::operator == ( CONST D3DXFLOAT16& f ) const +{ + // At least one is NaN + if(((value & D3DX_16F_EXP_MASK) == D3DX_16F_EXP_MASK && (value & D3DX_16F_FRAC_MASK)) + || ((f.value & D3DX_16F_EXP_MASK) == D3DX_16F_EXP_MASK && (f.value & D3DX_16F_FRAC_MASK))) + return false; + // +/- Zero + else if((value & ~D3DX_16F_SIGN_MASK) == 0 && (f.value & ~D3DX_16F_SIGN_MASK) == 0) + return true; + else + return value == f.value; +} + +D3DX10INLINE BOOL +D3DXFLOAT16::operator != ( CONST D3DXFLOAT16& f ) const +{ + // At least one is NaN + if(((value & D3DX_16F_EXP_MASK) == D3DX_16F_EXP_MASK && (value & D3DX_16F_FRAC_MASK)) + || ((f.value & D3DX_16F_EXP_MASK) == D3DX_16F_EXP_MASK && (f.value & D3DX_16F_FRAC_MASK))) + return true; + // +/- Zero + else if((value & ~D3DX_16F_SIGN_MASK) == 0 && (f.value & ~D3DX_16F_SIGN_MASK) == 0) + return false; + else + return value != f.value; +} + + +//-------------------------- +// 2D Vector +//-------------------------- + +D3DX10INLINE +D3DXVECTOR2::D3DXVECTOR2( CONST FLOAT *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; +} + +D3DX10INLINE +D3DXVECTOR2::D3DXVECTOR2( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 2); +} + +D3DX10INLINE +D3DXVECTOR2::D3DXVECTOR2( FLOAT fx, FLOAT fy ) +{ + x = fx; + y = fy; +} + + +// casting +D3DX10INLINE +D3DXVECTOR2::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DX10INLINE +D3DXVECTOR2::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DX10INLINE D3DXVECTOR2& +D3DXVECTOR2::operator += ( CONST D3DXVECTOR2& v ) +{ + x += v.x; + y += v.y; + return *this; +} + +D3DX10INLINE D3DXVECTOR2& +D3DXVECTOR2::operator -= ( CONST D3DXVECTOR2& v ) +{ + x -= v.x; + y -= v.y; + return *this; +} + +D3DX10INLINE D3DXVECTOR2& +D3DXVECTOR2::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + return *this; +} + +D3DX10INLINE D3DXVECTOR2& +D3DXVECTOR2::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + return *this; +} + + +// unary operators +D3DX10INLINE D3DXVECTOR2 +D3DXVECTOR2::operator + () const +{ + return *this; +} + +D3DX10INLINE D3DXVECTOR2 +D3DXVECTOR2::operator - () const +{ + return D3DXVECTOR2(-x, -y); +} + + +// binary operators +D3DX10INLINE D3DXVECTOR2 +D3DXVECTOR2::operator + ( CONST D3DXVECTOR2& v ) const +{ + return D3DXVECTOR2(x + v.x, y + v.y); +} + +D3DX10INLINE D3DXVECTOR2 +D3DXVECTOR2::operator - ( CONST D3DXVECTOR2& v ) const +{ + return D3DXVECTOR2(x - v.x, y - v.y); +} + +D3DX10INLINE D3DXVECTOR2 +D3DXVECTOR2::operator * ( FLOAT f ) const +{ + return D3DXVECTOR2(x * f, y * f); +} + +D3DX10INLINE D3DXVECTOR2 +D3DXVECTOR2::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXVECTOR2(x * fInv, y * fInv); +} + +D3DX10INLINE D3DXVECTOR2 +operator * ( FLOAT f, CONST D3DXVECTOR2& v ) +{ + return D3DXVECTOR2(f * v.x, f * v.y); +} + +D3DX10INLINE BOOL +D3DXVECTOR2::operator == ( CONST D3DXVECTOR2& v ) const +{ + return x == v.x && y == v.y; +} + +D3DX10INLINE BOOL +D3DXVECTOR2::operator != ( CONST D3DXVECTOR2& v ) const +{ + return x != v.x || y != v.y; +} + + + +//-------------------------- +// 2D Vector (16 bit) +//-------------------------- + +D3DX10INLINE +D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST FLOAT *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat32To16Array(&x, pf, 2); +} + +D3DX10INLINE +D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + *((UINT *) &x) = *((UINT *) &pf[0]); +} + +D3DX10INLINE +D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy ) +{ + x = fx; + y = fy; +} + + +// casting +D3DX10INLINE +D3DXVECTOR2_16F::operator D3DXFLOAT16* () +{ + return (D3DXFLOAT16*) &x; +} + +D3DX10INLINE +D3DXVECTOR2_16F::operator CONST D3DXFLOAT16* () const +{ + return (CONST D3DXFLOAT16*) &x; +} + + +// binary operators +D3DX10INLINE BOOL +D3DXVECTOR2_16F::operator == ( CONST D3DXVECTOR2_16F &v ) const +{ + return x == v.x && y == v.y; +} + +D3DX10INLINE BOOL +D3DXVECTOR2_16F::operator != ( CONST D3DXVECTOR2_16F &v ) const +{ + return x != v.x || y != v.y; +} + + +//-------------------------- +// 3D Vector +//-------------------------- +D3DX10INLINE +D3DXVECTOR3::D3DXVECTOR3( CONST FLOAT *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; + z = pf[2]; +} + +D3DX10INLINE +D3DXVECTOR3::D3DXVECTOR3( CONST D3DVECTOR& v ) +{ + x = v.x; + y = v.y; + z = v.z; +} + +D3DX10INLINE +D3DXVECTOR3::D3DXVECTOR3( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 3); +} + +D3DX10INLINE +D3DXVECTOR3::D3DXVECTOR3( FLOAT fx, FLOAT fy, FLOAT fz ) +{ + x = fx; + y = fy; + z = fz; +} + + +// casting +D3DX10INLINE +D3DXVECTOR3::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DX10INLINE +D3DXVECTOR3::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DX10INLINE D3DXVECTOR3& +D3DXVECTOR3::operator += ( CONST D3DXVECTOR3& v ) +{ + x += v.x; + y += v.y; + z += v.z; + return *this; +} + +D3DX10INLINE D3DXVECTOR3& +D3DXVECTOR3::operator -= ( CONST D3DXVECTOR3& v ) +{ + x -= v.x; + y -= v.y; + z -= v.z; + return *this; +} + +D3DX10INLINE D3DXVECTOR3& +D3DXVECTOR3::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + z *= f; + return *this; +} + +D3DX10INLINE D3DXVECTOR3& +D3DXVECTOR3::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + z *= fInv; + return *this; +} + + +// unary operators +D3DX10INLINE D3DXVECTOR3 +D3DXVECTOR3::operator + () const +{ + return *this; +} + +D3DX10INLINE D3DXVECTOR3 +D3DXVECTOR3::operator - () const +{ + return D3DXVECTOR3(-x, -y, -z); +} + + +// binary operators +D3DX10INLINE D3DXVECTOR3 +D3DXVECTOR3::operator + ( CONST D3DXVECTOR3& v ) const +{ + return D3DXVECTOR3(x + v.x, y + v.y, z + v.z); +} + +D3DX10INLINE D3DXVECTOR3 +D3DXVECTOR3::operator - ( CONST D3DXVECTOR3& v ) const +{ + return D3DXVECTOR3(x - v.x, y - v.y, z - v.z); +} + +D3DX10INLINE D3DXVECTOR3 +D3DXVECTOR3::operator * ( FLOAT f ) const +{ + return D3DXVECTOR3(x * f, y * f, z * f); +} + +D3DX10INLINE D3DXVECTOR3 +D3DXVECTOR3::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXVECTOR3(x * fInv, y * fInv, z * fInv); +} + + +D3DX10INLINE D3DXVECTOR3 +operator * ( FLOAT f, CONST struct D3DXVECTOR3& v ) +{ + return D3DXVECTOR3(f * v.x, f * v.y, f * v.z); +} + + +D3DX10INLINE BOOL +D3DXVECTOR3::operator == ( CONST D3DXVECTOR3& v ) const +{ + return x == v.x && y == v.y && z == v.z; +} + +D3DX10INLINE BOOL +D3DXVECTOR3::operator != ( CONST D3DXVECTOR3& v ) const +{ + return x != v.x || y != v.y || z != v.z; +} + + + +//-------------------------- +// 3D Vector (16 bit) +//-------------------------- + +D3DX10INLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST FLOAT *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat32To16Array(&x, pf, 3); +} + +D3DX10INLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DVECTOR& v ) +{ + D3DXFloat32To16Array(&x, &v.x, 1); + D3DXFloat32To16Array(&y, &v.y, 1); + D3DXFloat32To16Array(&z, &v.z, 1); +} + +D3DX10INLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + *((UINT *) &x) = *((UINT *) &pf[0]); + *((WORD *) &z) = *((WORD *) &pf[2]); +} + +D3DX10INLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy, CONST D3DXFLOAT16 &fz ) +{ + x = fx; + y = fy; + z = fz; +} + + +// casting +D3DX10INLINE +D3DXVECTOR3_16F::operator D3DXFLOAT16* () +{ + return (D3DXFLOAT16*) &x; +} + +D3DX10INLINE +D3DXVECTOR3_16F::operator CONST D3DXFLOAT16* () const +{ + return (CONST D3DXFLOAT16*) &x; +} + + +// binary operators +D3DX10INLINE BOOL +D3DXVECTOR3_16F::operator == ( CONST D3DXVECTOR3_16F &v ) const +{ + return x == v.x && y == v.y && z == v.z; +} + +D3DX10INLINE BOOL +D3DXVECTOR3_16F::operator != ( CONST D3DXVECTOR3_16F &v ) const +{ + return x != v.x || y != v.y || z != v.z; +} + + +//-------------------------- +// 4D Vector +//-------------------------- +D3DX10INLINE +D3DXVECTOR4::D3DXVECTOR4( CONST FLOAT *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; + z = pf[2]; + w = pf[3]; +} + +D3DX10INLINE +D3DXVECTOR4::D3DXVECTOR4( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 4); +} + +D3DX10INLINE +D3DXVECTOR4::D3DXVECTOR4( CONST D3DVECTOR& v, FLOAT f ) +{ + x = v.x; + y = v.y; + z = v.z; + w = f; +} + +D3DX10INLINE +D3DXVECTOR4::D3DXVECTOR4( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw ) +{ + x = fx; + y = fy; + z = fz; + w = fw; +} + + +// casting +D3DX10INLINE +D3DXVECTOR4::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DX10INLINE +D3DXVECTOR4::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DX10INLINE D3DXVECTOR4& +D3DXVECTOR4::operator += ( CONST D3DXVECTOR4& v ) +{ + x += v.x; + y += v.y; + z += v.z; + w += v.w; + return *this; +} + +D3DX10INLINE D3DXVECTOR4& +D3DXVECTOR4::operator -= ( CONST D3DXVECTOR4& v ) +{ + x -= v.x; + y -= v.y; + z -= v.z; + w -= v.w; + return *this; +} + +D3DX10INLINE D3DXVECTOR4& +D3DXVECTOR4::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + z *= f; + w *= f; + return *this; +} + +D3DX10INLINE D3DXVECTOR4& +D3DXVECTOR4::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + z *= fInv; + w *= fInv; + return *this; +} + + +// unary operators +D3DX10INLINE D3DXVECTOR4 +D3DXVECTOR4::operator + () const +{ + return *this; +} + +D3DX10INLINE D3DXVECTOR4 +D3DXVECTOR4::operator - () const +{ + return D3DXVECTOR4(-x, -y, -z, -w); +} + + +// binary operators +D3DX10INLINE D3DXVECTOR4 +D3DXVECTOR4::operator + ( CONST D3DXVECTOR4& v ) const +{ + return D3DXVECTOR4(x + v.x, y + v.y, z + v.z, w + v.w); +} + +D3DX10INLINE D3DXVECTOR4 +D3DXVECTOR4::operator - ( CONST D3DXVECTOR4& v ) const +{ + return D3DXVECTOR4(x - v.x, y - v.y, z - v.z, w - v.w); +} + +D3DX10INLINE D3DXVECTOR4 +D3DXVECTOR4::operator * ( FLOAT f ) const +{ + return D3DXVECTOR4(x * f, y * f, z * f, w * f); +} + +D3DX10INLINE D3DXVECTOR4 +D3DXVECTOR4::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXVECTOR4(x * fInv, y * fInv, z * fInv, w * fInv); +} + +D3DX10INLINE D3DXVECTOR4 +operator * ( FLOAT f, CONST D3DXVECTOR4& v ) +{ + return D3DXVECTOR4(f * v.x, f * v.y, f * v.z, f * v.w); +} + + +D3DX10INLINE BOOL +D3DXVECTOR4::operator == ( CONST D3DXVECTOR4& v ) const +{ + return x == v.x && y == v.y && z == v.z && w == v.w; +} + +D3DX10INLINE BOOL +D3DXVECTOR4::operator != ( CONST D3DXVECTOR4& v ) const +{ + return x != v.x || y != v.y || z != v.z || w != v.w; +} + + + +//-------------------------- +// 4D Vector (16 bit) +//-------------------------- + +D3DX10INLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST FLOAT *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat32To16Array(&x, pf, 4); +} + +D3DX10INLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + *((UINT *) &x) = *((UINT *) &pf[0]); + *((UINT *) &z) = *((UINT *) &pf[2]); +} + +D3DX10INLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& v, CONST D3DXFLOAT16& f ) +{ + x = v.x; + y = v.y; + z = v.z; + w = f; +} + +D3DX10INLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy, CONST D3DXFLOAT16 &fz, CONST D3DXFLOAT16 &fw ) +{ + x = fx; + y = fy; + z = fz; + w = fw; +} + + +// casting +D3DX10INLINE +D3DXVECTOR4_16F::operator D3DXFLOAT16* () +{ + return (D3DXFLOAT16*) &x; +} + +D3DX10INLINE +D3DXVECTOR4_16F::operator CONST D3DXFLOAT16* () const +{ + return (CONST D3DXFLOAT16*) &x; +} + + +// binary operators +D3DX10INLINE BOOL +D3DXVECTOR4_16F::operator == ( CONST D3DXVECTOR4_16F &v ) const +{ + return x == v.x && y == v.y && z == v.z && w == v.w; +} + +D3DX10INLINE BOOL +D3DXVECTOR4_16F::operator != ( CONST D3DXVECTOR4_16F &v ) const +{ + return x != v.x || y != v.y || z != v.z || w != v.w; +} + + +//-------------------------- +// Matrix +//-------------------------- +D3DX10INLINE +D3DXMATRIX::D3DXMATRIX( CONST FLOAT* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + memcpy(&_11, pf, sizeof(D3DXMATRIX)); +} + +D3DX10INLINE +D3DXMATRIX::D3DXMATRIX( CONST D3DMATRIX& mat ) +{ + memcpy(&_11, &mat, sizeof(D3DXMATRIX)); +} + +D3DX10INLINE +D3DXMATRIX::D3DXMATRIX( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&_11, pf, 16); +} + +D3DX10INLINE +D3DXMATRIX::D3DXMATRIX( FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14, + FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24, + FLOAT f31, FLOAT f32, FLOAT f33, FLOAT f34, + FLOAT f41, FLOAT f42, FLOAT f43, FLOAT f44 ) +{ + _11 = f11; _12 = f12; _13 = f13; _14 = f14; + _21 = f21; _22 = f22; _23 = f23; _24 = f24; + _31 = f31; _32 = f32; _33 = f33; _34 = f34; + _41 = f41; _42 = f42; _43 = f43; _44 = f44; +} + + + +// access grants +D3DX10INLINE FLOAT& +D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) +{ + return m[iRow][iCol]; +} + +D3DX10INLINE FLOAT +D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) const +{ + return m[iRow][iCol]; +} + + +// casting operators +D3DX10INLINE +D3DXMATRIX::operator FLOAT* () +{ + return (FLOAT *) &_11; +} + +D3DX10INLINE +D3DXMATRIX::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &_11; +} + + +// assignment operators +D3DX10INLINE D3DXMATRIX& +D3DXMATRIX::operator *= ( CONST D3DXMATRIX& mat ) +{ + D3DXMatrixMultiply(this, this, &mat); + return *this; +} + +D3DX10INLINE D3DXMATRIX& +D3DXMATRIX::operator += ( CONST D3DXMATRIX& mat ) +{ + _11 += mat._11; _12 += mat._12; _13 += mat._13; _14 += mat._14; + _21 += mat._21; _22 += mat._22; _23 += mat._23; _24 += mat._24; + _31 += mat._31; _32 += mat._32; _33 += mat._33; _34 += mat._34; + _41 += mat._41; _42 += mat._42; _43 += mat._43; _44 += mat._44; + return *this; +} + +D3DX10INLINE D3DXMATRIX& +D3DXMATRIX::operator -= ( CONST D3DXMATRIX& mat ) +{ + _11 -= mat._11; _12 -= mat._12; _13 -= mat._13; _14 -= mat._14; + _21 -= mat._21; _22 -= mat._22; _23 -= mat._23; _24 -= mat._24; + _31 -= mat._31; _32 -= mat._32; _33 -= mat._33; _34 -= mat._34; + _41 -= mat._41; _42 -= mat._42; _43 -= mat._43; _44 -= mat._44; + return *this; +} + +D3DX10INLINE D3DXMATRIX& +D3DXMATRIX::operator *= ( FLOAT f ) +{ + _11 *= f; _12 *= f; _13 *= f; _14 *= f; + _21 *= f; _22 *= f; _23 *= f; _24 *= f; + _31 *= f; _32 *= f; _33 *= f; _34 *= f; + _41 *= f; _42 *= f; _43 *= f; _44 *= f; + return *this; +} + +D3DX10INLINE D3DXMATRIX& +D3DXMATRIX::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + _11 *= fInv; _12 *= fInv; _13 *= fInv; _14 *= fInv; + _21 *= fInv; _22 *= fInv; _23 *= fInv; _24 *= fInv; + _31 *= fInv; _32 *= fInv; _33 *= fInv; _34 *= fInv; + _41 *= fInv; _42 *= fInv; _43 *= fInv; _44 *= fInv; + return *this; +} + + +// unary operators +D3DX10INLINE D3DXMATRIX +D3DXMATRIX::operator + () const +{ + return *this; +} + +D3DX10INLINE D3DXMATRIX +D3DXMATRIX::operator - () const +{ + return D3DXMATRIX(-_11, -_12, -_13, -_14, + -_21, -_22, -_23, -_24, + -_31, -_32, -_33, -_34, + -_41, -_42, -_43, -_44); +} + + +// binary operators +D3DX10INLINE D3DXMATRIX +D3DXMATRIX::operator * ( CONST D3DXMATRIX& mat ) const +{ + D3DXMATRIX matT; + D3DXMatrixMultiply(&matT, this, &mat); + return matT; +} + +D3DX10INLINE D3DXMATRIX +D3DXMATRIX::operator + ( CONST D3DXMATRIX& mat ) const +{ + return D3DXMATRIX(_11 + mat._11, _12 + mat._12, _13 + mat._13, _14 + mat._14, + _21 + mat._21, _22 + mat._22, _23 + mat._23, _24 + mat._24, + _31 + mat._31, _32 + mat._32, _33 + mat._33, _34 + mat._34, + _41 + mat._41, _42 + mat._42, _43 + mat._43, _44 + mat._44); +} + +D3DX10INLINE D3DXMATRIX +D3DXMATRIX::operator - ( CONST D3DXMATRIX& mat ) const +{ + return D3DXMATRIX(_11 - mat._11, _12 - mat._12, _13 - mat._13, _14 - mat._14, + _21 - mat._21, _22 - mat._22, _23 - mat._23, _24 - mat._24, + _31 - mat._31, _32 - mat._32, _33 - mat._33, _34 - mat._34, + _41 - mat._41, _42 - mat._42, _43 - mat._43, _44 - mat._44); +} + +D3DX10INLINE D3DXMATRIX +D3DXMATRIX::operator * ( FLOAT f ) const +{ + return D3DXMATRIX(_11 * f, _12 * f, _13 * f, _14 * f, + _21 * f, _22 * f, _23 * f, _24 * f, + _31 * f, _32 * f, _33 * f, _34 * f, + _41 * f, _42 * f, _43 * f, _44 * f); +} + +D3DX10INLINE D3DXMATRIX +D3DXMATRIX::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXMATRIX(_11 * fInv, _12 * fInv, _13 * fInv, _14 * fInv, + _21 * fInv, _22 * fInv, _23 * fInv, _24 * fInv, + _31 * fInv, _32 * fInv, _33 * fInv, _34 * fInv, + _41 * fInv, _42 * fInv, _43 * fInv, _44 * fInv); +} + + +D3DX10INLINE D3DXMATRIX +operator * ( FLOAT f, CONST D3DXMATRIX& mat ) +{ + return D3DXMATRIX(f * mat._11, f * mat._12, f * mat._13, f * mat._14, + f * mat._21, f * mat._22, f * mat._23, f * mat._24, + f * mat._31, f * mat._32, f * mat._33, f * mat._34, + f * mat._41, f * mat._42, f * mat._43, f * mat._44); +} + + +D3DX10INLINE BOOL +D3DXMATRIX::operator == ( CONST D3DXMATRIX& mat ) const +{ + return 0 == memcmp(this, &mat, sizeof(D3DXMATRIX)); +} + +D3DX10INLINE BOOL +D3DXMATRIX::operator != ( CONST D3DXMATRIX& mat ) const +{ + return 0 != memcmp(this, &mat, sizeof(D3DXMATRIX)); +} + + + +//-------------------------- +// Aligned Matrices +//-------------------------- + +D3DX10INLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( CONST FLOAT* f ) : + D3DXMATRIX( f ) +{ +} + +D3DX10INLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( CONST D3DMATRIX& m ) : + D3DXMATRIX( m ) +{ +} + +D3DX10INLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( CONST D3DXFLOAT16* f ) : + D3DXMATRIX( f ) +{ +} + +D3DX10INLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, + FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, + FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, + FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ) : + D3DXMATRIX(_11, _12, _13, _14, + _21, _22, _23, _24, + _31, _32, _33, _34, + _41, _42, _43, _44) +{ +} + +#ifndef SIZE_MAX +#define SIZE_MAX ((SIZE_T)-1) +#endif + +D3DX10INLINE void* +_D3DXMATRIXA16::operator new( size_t s ) +{ + if (s > (SIZE_MAX-16)) + return NULL; + LPBYTE p = ::new BYTE[s + 16]; + if (p) + { + BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15)); + p += offset; + p[-1] = offset; + } + return p; +} + +D3DX10INLINE void* +_D3DXMATRIXA16::operator new[]( size_t s ) +{ + if (s > (SIZE_MAX-16)) + return NULL; + LPBYTE p = ::new BYTE[s + 16]; + if (p) + { + BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15)); + p += offset; + p[-1] = offset; + } + return p; +} + +D3DX10INLINE void +_D3DXMATRIXA16::operator delete(void* p) +{ + if(p) + { + BYTE* pb = static_cast(p); + pb -= pb[-1]; + ::delete [] pb; + } +} + +D3DX10INLINE void +_D3DXMATRIXA16::operator delete[](void* p) +{ + if(p) + { + BYTE* pb = static_cast(p); + pb -= pb[-1]; + ::delete [] pb; + } +} + +D3DX10INLINE _D3DXMATRIXA16& +_D3DXMATRIXA16::operator=(CONST D3DXMATRIX& rhs) +{ + memcpy(&_11, &rhs, sizeof(D3DXMATRIX)); + return *this; +} + + +//-------------------------- +// Quaternion +//-------------------------- + +D3DX10INLINE +D3DXQUATERNION::D3DXQUATERNION( CONST FLOAT* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; + z = pf[2]; + w = pf[3]; +} + +D3DX10INLINE +D3DXQUATERNION::D3DXQUATERNION( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 4); +} + +D3DX10INLINE +D3DXQUATERNION::D3DXQUATERNION( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw ) +{ + x = fx; + y = fy; + z = fz; + w = fw; +} + + +// casting +D3DX10INLINE +D3DXQUATERNION::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DX10INLINE +D3DXQUATERNION::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DX10INLINE D3DXQUATERNION& +D3DXQUATERNION::operator += ( CONST D3DXQUATERNION& q ) +{ + x += q.x; + y += q.y; + z += q.z; + w += q.w; + return *this; +} + +D3DX10INLINE D3DXQUATERNION& +D3DXQUATERNION::operator -= ( CONST D3DXQUATERNION& q ) +{ + x -= q.x; + y -= q.y; + z -= q.z; + w -= q.w; + return *this; +} + +D3DX10INLINE D3DXQUATERNION& +D3DXQUATERNION::operator *= ( CONST D3DXQUATERNION& q ) +{ + D3DXQuaternionMultiply(this, this, &q); + return *this; +} + +D3DX10INLINE D3DXQUATERNION& +D3DXQUATERNION::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + z *= f; + w *= f; + return *this; +} + +D3DX10INLINE D3DXQUATERNION& +D3DXQUATERNION::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + z *= fInv; + w *= fInv; + return *this; +} + + +// unary operators +D3DX10INLINE D3DXQUATERNION +D3DXQUATERNION::operator + () const +{ + return *this; +} + +D3DX10INLINE D3DXQUATERNION +D3DXQUATERNION::operator - () const +{ + return D3DXQUATERNION(-x, -y, -z, -w); +} + + +// binary operators +D3DX10INLINE D3DXQUATERNION +D3DXQUATERNION::operator + ( CONST D3DXQUATERNION& q ) const +{ + return D3DXQUATERNION(x + q.x, y + q.y, z + q.z, w + q.w); +} + +D3DX10INLINE D3DXQUATERNION +D3DXQUATERNION::operator - ( CONST D3DXQUATERNION& q ) const +{ + return D3DXQUATERNION(x - q.x, y - q.y, z - q.z, w - q.w); +} + +D3DX10INLINE D3DXQUATERNION +D3DXQUATERNION::operator * ( CONST D3DXQUATERNION& q ) const +{ + D3DXQUATERNION qT; + D3DXQuaternionMultiply(&qT, this, &q); + return qT; +} + +D3DX10INLINE D3DXQUATERNION +D3DXQUATERNION::operator * ( FLOAT f ) const +{ + return D3DXQUATERNION(x * f, y * f, z * f, w * f); +} + +D3DX10INLINE D3DXQUATERNION +D3DXQUATERNION::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXQUATERNION(x * fInv, y * fInv, z * fInv, w * fInv); +} + + +D3DX10INLINE D3DXQUATERNION +operator * (FLOAT f, CONST D3DXQUATERNION& q ) +{ + return D3DXQUATERNION(f * q.x, f * q.y, f * q.z, f * q.w); +} + + +D3DX10INLINE BOOL +D3DXQUATERNION::operator == ( CONST D3DXQUATERNION& q ) const +{ + return x == q.x && y == q.y && z == q.z && w == q.w; +} + +D3DX10INLINE BOOL +D3DXQUATERNION::operator != ( CONST D3DXQUATERNION& q ) const +{ + return x != q.x || y != q.y || z != q.z || w != q.w; +} + + + +//-------------------------- +// Plane +//-------------------------- + +D3DX10INLINE +D3DXPLANE::D3DXPLANE( CONST FLOAT* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + a = pf[0]; + b = pf[1]; + c = pf[2]; + d = pf[3]; +} + +D3DX10INLINE +D3DXPLANE::D3DXPLANE( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&a, pf, 4); +} + +D3DX10INLINE +D3DXPLANE::D3DXPLANE( FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd ) +{ + a = fa; + b = fb; + c = fc; + d = fd; +} + + +// casting +D3DX10INLINE +D3DXPLANE::operator FLOAT* () +{ + return (FLOAT *) &a; +} + +D3DX10INLINE +D3DXPLANE::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &a; +} + + +// assignment operators +D3DX10INLINE D3DXPLANE& +D3DXPLANE::operator *= ( FLOAT f ) +{ + a *= f; + b *= f; + c *= f; + d *= f; + return *this; +} + +D3DX10INLINE D3DXPLANE& +D3DXPLANE::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + a *= fInv; + b *= fInv; + c *= fInv; + d *= fInv; + return *this; +} + + +// unary operators +D3DX10INLINE D3DXPLANE +D3DXPLANE::operator + () const +{ + return *this; +} + +D3DX10INLINE D3DXPLANE +D3DXPLANE::operator - () const +{ + return D3DXPLANE(-a, -b, -c, -d); +} + + +// binary operators +D3DX10INLINE D3DXPLANE +D3DXPLANE::operator * ( FLOAT f ) const +{ + return D3DXPLANE(a * f, b * f, c * f, d * f); +} + +D3DX10INLINE D3DXPLANE +D3DXPLANE::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXPLANE(a * fInv, b * fInv, c * fInv, d * fInv); +} + +D3DX10INLINE D3DXPLANE +operator * (FLOAT f, CONST D3DXPLANE& p ) +{ + return D3DXPLANE(f * p.a, f * p.b, f * p.c, f * p.d); +} + +D3DX10INLINE BOOL +D3DXPLANE::operator == ( CONST D3DXPLANE& p ) const +{ + return a == p.a && b == p.b && c == p.c && d == p.d; +} + +D3DX10INLINE BOOL +D3DXPLANE::operator != ( CONST D3DXPLANE& p ) const +{ + return a != p.a || b != p.b || c != p.c || d != p.d; +} + + + + +//-------------------------- +// Color +//-------------------------- + +D3DX10INLINE +D3DXCOLOR::D3DXCOLOR( UINT dw ) +{ + CONST FLOAT f = 1.0f / 255.0f; + r = f * (FLOAT) (unsigned char) (dw >> 16); + g = f * (FLOAT) (unsigned char) (dw >> 8); + b = f * (FLOAT) (unsigned char) (dw >> 0); + a = f * (FLOAT) (unsigned char) (dw >> 24); +} + +D3DX10INLINE +D3DXCOLOR::D3DXCOLOR( CONST FLOAT* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + r = pf[0]; + g = pf[1]; + b = pf[2]; + a = pf[3]; +} + +D3DX10INLINE +D3DXCOLOR::D3DXCOLOR( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX10_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&r, pf, 4); +} + +D3DX10INLINE +D3DXCOLOR::D3DXCOLOR( FLOAT fr, FLOAT fg, FLOAT fb, FLOAT fa ) +{ + r = fr; + g = fg; + b = fb; + a = fa; +} + + +// casting +D3DX10INLINE +D3DXCOLOR::operator UINT () const +{ + UINT dwR = r >= 1.0f ? 0xff : r <= 0.0f ? 0x00 : (UINT) (r * 255.0f + 0.5f); + UINT dwG = g >= 1.0f ? 0xff : g <= 0.0f ? 0x00 : (UINT) (g * 255.0f + 0.5f); + UINT dwB = b >= 1.0f ? 0xff : b <= 0.0f ? 0x00 : (UINT) (b * 255.0f + 0.5f); + UINT dwA = a >= 1.0f ? 0xff : a <= 0.0f ? 0x00 : (UINT) (a * 255.0f + 0.5f); + + return (dwA << 24) | (dwR << 16) | (dwG << 8) | (dwB << 0); +} + + +D3DX10INLINE +D3DXCOLOR::operator FLOAT * () +{ + return (FLOAT *) &r; +} + +D3DX10INLINE +D3DXCOLOR::operator CONST FLOAT * () const +{ + return (CONST FLOAT *) &r; +} + +// assignment operators +D3DX10INLINE D3DXCOLOR& +D3DXCOLOR::operator += ( CONST D3DXCOLOR& c ) +{ + r += c.r; + g += c.g; + b += c.b; + a += c.a; + return *this; +} + +D3DX10INLINE D3DXCOLOR& +D3DXCOLOR::operator -= ( CONST D3DXCOLOR& c ) +{ + r -= c.r; + g -= c.g; + b -= c.b; + a -= c.a; + return *this; +} + +D3DX10INLINE D3DXCOLOR& +D3DXCOLOR::operator *= ( FLOAT f ) +{ + r *= f; + g *= f; + b *= f; + a *= f; + return *this; +} + +D3DX10INLINE D3DXCOLOR& +D3DXCOLOR::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + r *= fInv; + g *= fInv; + b *= fInv; + a *= fInv; + return *this; +} + + +// unary operators +D3DX10INLINE D3DXCOLOR +D3DXCOLOR::operator + () const +{ + return *this; +} + +D3DX10INLINE D3DXCOLOR +D3DXCOLOR::operator - () const +{ + return D3DXCOLOR(-r, -g, -b, -a); +} + + +// binary operators +D3DX10INLINE D3DXCOLOR +D3DXCOLOR::operator + ( CONST D3DXCOLOR& c ) const +{ + return D3DXCOLOR(r + c.r, g + c.g, b + c.b, a + c.a); +} + +D3DX10INLINE D3DXCOLOR +D3DXCOLOR::operator - ( CONST D3DXCOLOR& c ) const +{ + return D3DXCOLOR(r - c.r, g - c.g, b - c.b, a - c.a); +} + +D3DX10INLINE D3DXCOLOR +D3DXCOLOR::operator * ( FLOAT f ) const +{ + return D3DXCOLOR(r * f, g * f, b * f, a * f); +} + +D3DX10INLINE D3DXCOLOR +D3DXCOLOR::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXCOLOR(r * fInv, g * fInv, b * fInv, a * fInv); +} + + +D3DX10INLINE D3DXCOLOR +operator * (FLOAT f, CONST D3DXCOLOR& c ) +{ + return D3DXCOLOR(f * c.r, f * c.g, f * c.b, f * c.a); +} + + +D3DX10INLINE BOOL +D3DXCOLOR::operator == ( CONST D3DXCOLOR& c ) const +{ + return r == c.r && g == c.g && b == c.b && a == c.a; +} + +D3DX10INLINE BOOL +D3DXCOLOR::operator != ( CONST D3DXCOLOR& c ) const +{ + return r != c.r || g != c.g || b != c.b || a != c.a; +} + + +#endif //__cplusplus + + + +//=========================================================================== +// +// Inline functions +// +//=========================================================================== + + +//-------------------------- +// 2D Vector +//-------------------------- + +D3DX10INLINE FLOAT D3DXVec2Length + ( CONST D3DXVECTOR2 *pV ) +{ +#ifdef D3DX10_DEBUG + if(!pV) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pV->x * pV->x + pV->y * pV->y); +#else + return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y); +#endif +} + +D3DX10INLINE FLOAT D3DXVec2LengthSq + ( CONST D3DXVECTOR2 *pV ) +{ +#ifdef D3DX10_DEBUG + if(!pV) + return 0.0f; +#endif + + return pV->x * pV->x + pV->y * pV->y; +} + +D3DX10INLINE FLOAT D3DXVec2Dot + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->x + pV1->y * pV2->y; +} + +D3DX10INLINE FLOAT D3DXVec2CCW + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->y - pV1->y * pV2->x; +} + +D3DX10INLINE D3DXVECTOR2* D3DXVec2Add + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + pV2->x; + pOut->y = pV1->y + pV2->y; + return pOut; +} + +D3DX10INLINE D3DXVECTOR2* D3DXVec2Subtract + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x - pV2->x; + pOut->y = pV1->y - pV2->y; + return pOut; +} + +D3DX10INLINE D3DXVECTOR2* D3DXVec2Minimize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; + return pOut; +} + +D3DX10INLINE D3DXVECTOR2* D3DXVec2Maximize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; + return pOut; +} + +D3DX10INLINE D3DXVECTOR2* D3DXVec2Scale + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV) + return NULL; +#endif + + pOut->x = pV->x * s; + pOut->y = pV->y * s; + return pOut; +} + +D3DX10INLINE D3DXVECTOR2* D3DXVec2Lerp + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, + FLOAT s ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + s * (pV2->x - pV1->x); + pOut->y = pV1->y + s * (pV2->y - pV1->y); + return pOut; +} + + +//-------------------------- +// 3D Vector +//-------------------------- + +D3DX10INLINE FLOAT D3DXVec3Length + ( CONST D3DXVECTOR3 *pV ) +{ +#ifdef D3DX10_DEBUG + if(!pV) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z); +#else + return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z); +#endif +} + +D3DX10INLINE FLOAT D3DXVec3LengthSq + ( CONST D3DXVECTOR3 *pV ) +{ +#ifdef D3DX10_DEBUG + if(!pV) + return 0.0f; +#endif + + return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z; +} + +D3DX10INLINE FLOAT D3DXVec3Dot + ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z; +} + +D3DX10INLINE D3DXVECTOR3* D3DXVec3Cross + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ + D3DXVECTOR3 v; + +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + v.x = pV1->y * pV2->z - pV1->z * pV2->y; + v.y = pV1->z * pV2->x - pV1->x * pV2->z; + v.z = pV1->x * pV2->y - pV1->y * pV2->x; + + *pOut = v; + return pOut; +} + +D3DX10INLINE D3DXVECTOR3* D3DXVec3Add + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + pV2->x; + pOut->y = pV1->y + pV2->y; + pOut->z = pV1->z + pV2->z; + return pOut; +} + +D3DX10INLINE D3DXVECTOR3* D3DXVec3Subtract + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x - pV2->x; + pOut->y = pV1->y - pV2->y; + pOut->z = pV1->z - pV2->z; + return pOut; +} + +D3DX10INLINE D3DXVECTOR3* D3DXVec3Minimize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z; + return pOut; +} + +D3DX10INLINE D3DXVECTOR3* D3DXVec3Maximize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z; + return pOut; +} + +D3DX10INLINE D3DXVECTOR3* D3DXVec3Scale + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV) + return NULL; +#endif + + pOut->x = pV->x * s; + pOut->y = pV->y * s; + pOut->z = pV->z * s; + return pOut; +} + +D3DX10INLINE D3DXVECTOR3* D3DXVec3Lerp + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + FLOAT s ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + s * (pV2->x - pV1->x); + pOut->y = pV1->y + s * (pV2->y - pV1->y); + pOut->z = pV1->z + s * (pV2->z - pV1->z); + return pOut; +} + + +//-------------------------- +// 4D Vector +//-------------------------- + +D3DX10INLINE FLOAT D3DXVec4Length + ( CONST D3DXVECTOR4 *pV ) +{ +#ifdef D3DX10_DEBUG + if(!pV) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w); +#else + return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w); +#endif +} + +D3DX10INLINE FLOAT D3DXVec4LengthSq + ( CONST D3DXVECTOR4 *pV ) +{ +#ifdef D3DX10_DEBUG + if(!pV) + return 0.0f; +#endif + + return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w; +} + +D3DX10INLINE FLOAT D3DXVec4Dot + ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 ) +{ +#ifdef D3DX10_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z + pV1->w * pV2->w; +} + +D3DX10INLINE D3DXVECTOR4* D3DXVec4Add + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + pV2->x; + pOut->y = pV1->y + pV2->y; + pOut->z = pV1->z + pV2->z; + pOut->w = pV1->w + pV2->w; + return pOut; +} + +D3DX10INLINE D3DXVECTOR4* D3DXVec4Subtract + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x - pV2->x; + pOut->y = pV1->y - pV2->y; + pOut->z = pV1->z - pV2->z; + pOut->w = pV1->w - pV2->w; + return pOut; +} + +D3DX10INLINE D3DXVECTOR4* D3DXVec4Minimize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z; + pOut->w = pV1->w < pV2->w ? pV1->w : pV2->w; + return pOut; +} + +D3DX10INLINE D3DXVECTOR4* D3DXVec4Maximize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z; + pOut->w = pV1->w > pV2->w ? pV1->w : pV2->w; + return pOut; +} + +D3DX10INLINE D3DXVECTOR4* D3DXVec4Scale + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV) + return NULL; +#endif + + pOut->x = pV->x * s; + pOut->y = pV->y * s; + pOut->z = pV->z * s; + pOut->w = pV->w * s; + return pOut; +} + +D3DX10INLINE D3DXVECTOR4* D3DXVec4Lerp + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + FLOAT s ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + s * (pV2->x - pV1->x); + pOut->y = pV1->y + s * (pV2->y - pV1->y); + pOut->z = pV1->z + s * (pV2->z - pV1->z); + pOut->w = pV1->w + s * (pV2->w - pV1->w); + return pOut; +} + + +//-------------------------- +// 4D Matrix +//-------------------------- + +D3DX10INLINE D3DXMATRIX* D3DXMatrixIdentity + ( D3DXMATRIX *pOut ) +{ +#ifdef D3DX10_DEBUG + if(!pOut) + return NULL; +#endif + + pOut->m[0][1] = pOut->m[0][2] = pOut->m[0][3] = + pOut->m[1][0] = pOut->m[1][2] = pOut->m[1][3] = + pOut->m[2][0] = pOut->m[2][1] = pOut->m[2][3] = + pOut->m[3][0] = pOut->m[3][1] = pOut->m[3][2] = 0.0f; + + pOut->m[0][0] = pOut->m[1][1] = pOut->m[2][2] = pOut->m[3][3] = 1.0f; + return pOut; +} + + +D3DX10INLINE BOOL D3DXMatrixIsIdentity + ( CONST D3DXMATRIX *pM ) +{ +#ifdef D3DX10_DEBUG + if(!pM) + return FALSE; +#endif + + return pM->m[0][0] == 1.0f && pM->m[0][1] == 0.0f && pM->m[0][2] == 0.0f && pM->m[0][3] == 0.0f && + pM->m[1][0] == 0.0f && pM->m[1][1] == 1.0f && pM->m[1][2] == 0.0f && pM->m[1][3] == 0.0f && + pM->m[2][0] == 0.0f && pM->m[2][1] == 0.0f && pM->m[2][2] == 1.0f && pM->m[2][3] == 0.0f && + pM->m[3][0] == 0.0f && pM->m[3][1] == 0.0f && pM->m[3][2] == 0.0f && pM->m[3][3] == 1.0f; +} + + +//-------------------------- +// Quaternion +//-------------------------- + +D3DX10INLINE FLOAT D3DXQuaternionLength + ( CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX10_DEBUG + if(!pQ) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w); +#else + return (FLOAT) sqrt(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w); +#endif +} + +D3DX10INLINE FLOAT D3DXQuaternionLengthSq + ( CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX10_DEBUG + if(!pQ) + return 0.0f; +#endif + + return pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w; +} + +D3DX10INLINE FLOAT D3DXQuaternionDot + ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 ) +{ +#ifdef D3DX10_DEBUG + if(!pQ1 || !pQ2) + return 0.0f; +#endif + + return pQ1->x * pQ2->x + pQ1->y * pQ2->y + pQ1->z * pQ2->z + pQ1->w * pQ2->w; +} + + +D3DX10INLINE D3DXQUATERNION* D3DXQuaternionIdentity + ( D3DXQUATERNION *pOut ) +{ +#ifdef D3DX10_DEBUG + if(!pOut) + return NULL; +#endif + + pOut->x = pOut->y = pOut->z = 0.0f; + pOut->w = 1.0f; + return pOut; +} + +D3DX10INLINE BOOL D3DXQuaternionIsIdentity + ( CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX10_DEBUG + if(!pQ) + return FALSE; +#endif + + return pQ->x == 0.0f && pQ->y == 0.0f && pQ->z == 0.0f && pQ->w == 1.0f; +} + + +D3DX10INLINE D3DXQUATERNION* D3DXQuaternionConjugate + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pQ) + return NULL; +#endif + + pOut->x = -pQ->x; + pOut->y = -pQ->y; + pOut->z = -pQ->z; + pOut->w = pQ->w; + return pOut; +} + + +//-------------------------- +// Plane +//-------------------------- + +D3DX10INLINE FLOAT D3DXPlaneDot + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV) +{ +#ifdef D3DX10_DEBUG + if(!pP || !pV) + return 0.0f; +#endif + + return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d * pV->w; +} + +D3DX10INLINE FLOAT D3DXPlaneDotCoord + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV) +{ +#ifdef D3DX10_DEBUG + if(!pP || !pV) + return 0.0f; +#endif + + return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d; +} + +D3DX10INLINE FLOAT D3DXPlaneDotNormal + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV) +{ +#ifdef D3DX10_DEBUG + if(!pP || !pV) + return 0.0f; +#endif + + return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z; +} + +D3DX10INLINE D3DXPLANE* D3DXPlaneScale + (D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pP) + return NULL; +#endif + + pOut->a = pP->a * s; + pOut->b = pP->b * s; + pOut->c = pP->c * s; + pOut->d = pP->d * s; + return pOut; +} + + +//-------------------------- +// Color +//-------------------------- + +D3DX10INLINE D3DXCOLOR* D3DXColorNegative + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pC) + return NULL; +#endif + + pOut->r = 1.0f - pC->r; + pOut->g = 1.0f - pC->g; + pOut->b = 1.0f - pC->b; + pOut->a = pC->a; + return pOut; +} + +D3DX10INLINE D3DXCOLOR* D3DXColorAdd + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r + pC2->r; + pOut->g = pC1->g + pC2->g; + pOut->b = pC1->b + pC2->b; + pOut->a = pC1->a + pC2->a; + return pOut; +} + +D3DX10INLINE D3DXCOLOR* D3DXColorSubtract + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r - pC2->r; + pOut->g = pC1->g - pC2->g; + pOut->b = pC1->b - pC2->b; + pOut->a = pC1->a - pC2->a; + return pOut; +} + +D3DX10INLINE D3DXCOLOR* D3DXColorScale + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pC) + return NULL; +#endif + + pOut->r = pC->r * s; + pOut->g = pC->g * s; + pOut->b = pC->b * s; + pOut->a = pC->a * s; + return pOut; +} + +D3DX10INLINE D3DXCOLOR* D3DXColorModulate + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r * pC2->r; + pOut->g = pC1->g * pC2->g; + pOut->b = pC1->b * pC2->b; + pOut->a = pC1->a * pC2->a; + return pOut; +} + +D3DX10INLINE D3DXCOLOR* D3DXColorLerp + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s) +{ +#ifdef D3DX10_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r + s * (pC2->r - pC1->r); + pOut->g = pC1->g + s * (pC2->g - pC1->g); + pOut->b = pC1->b + s * (pC2->b - pC1->b); + pOut->a = pC1->a + s * (pC2->a - pC1->a); + return pOut; +} + + +#endif // __D3DXMATH_INL__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3DX10mesh.h b/Src/Decoder_H264_ALL/D3D/include/D3DX10mesh.h new file mode 100644 index 0000000..e5fed8f --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3DX10mesh.h @@ -0,0 +1,286 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx10mesh.h +// Content: D3DX10 mesh types and functions +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx10.h" + +#ifndef __D3DX10MESH_H__ +#define __D3DX10MESH_H__ + +// {7ED943DD-52E8-40b5-A8D8-76685C406330} +DEFINE_GUID(IID_ID3DX10BaseMesh, +0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30); + +// {04B0D117-1041-46b1-AA8A-3952848BA22E} +DEFINE_GUID(IID_ID3DX10MeshBuffer, +0x4b0d117, 0x1041, 0x46b1, 0xaa, 0x8a, 0x39, 0x52, 0x84, 0x8b, 0xa2, 0x2e); + +// {4020E5C2-1403-4929-883F-E2E849FAC195} +DEFINE_GUID(IID_ID3DX10Mesh, +0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95); + +// {8875769A-D579-4088-AAEB-534D1AD84E96} +DEFINE_GUID(IID_ID3DX10PMesh, +0x8875769a, 0xd579, 0x4088, 0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96); + +// {667EA4C7-F1CD-4386-B523-7C0290B83CC5} +DEFINE_GUID(IID_ID3DX10SPMesh, +0x667ea4c7, 0xf1cd, 0x4386, 0xb5, 0x23, 0x7c, 0x2, 0x90, 0xb8, 0x3c, 0xc5); + +// {3CE6CC22-DBF2-44f4-894D-F9C34A337139} +DEFINE_GUID(IID_ID3DX10PatchMesh, +0x3ce6cc22, 0xdbf2, 0x44f4, 0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39); + + +// Mesh options - lower 3 bytes only, upper byte used by _D3DX10MESHOPT option flags +enum _D3DX10_MESH { + D3DX10_MESH_32_BIT = 0x001, // If set, then use 32 bit indices, if not set use 16 bit indices. + D3DX10_MESH_GS_ADJACENCY = 0x004, // If set, mesh contains GS adjacency info. Not valid on input. + +}; + +typedef struct _D3DX10_ATTRIBUTE_RANGE +{ + UINT AttribId; + UINT FaceStart; + UINT FaceCount; + UINT VertexStart; + UINT VertexCount; +} D3DX10_ATTRIBUTE_RANGE; + +typedef D3DX10_ATTRIBUTE_RANGE* LPD3DX10_ATTRIBUTE_RANGE; + +typedef enum _D3DX10_MESH_DISCARD_FLAGS +{ + D3DX10_MESH_DISCARD_ATTRIBUTE_BUFFER = 0x01, + D3DX10_MESH_DISCARD_ATTRIBUTE_TABLE = 0x02, + D3DX10_MESH_DISCARD_POINTREPS = 0x04, + D3DX10_MESH_DISCARD_ADJACENCY = 0x08, + D3DX10_MESH_DISCARD_DEVICE_BUFFERS = 0x10, + +} D3DX10_MESH_DISCARD_FLAGS; + +typedef struct _D3DX10_WELD_EPSILONS +{ + FLOAT Position; // NOTE: This does NOT replace the epsilon in GenerateAdjacency + // in general, it should be the same value or greater than the one passed to GeneratedAdjacency + FLOAT BlendWeights; + FLOAT Normal; + FLOAT PSize; + FLOAT Specular; + FLOAT Diffuse; + FLOAT Texcoord[8]; + FLOAT Tangent; + FLOAT Binormal; + FLOAT TessFactor; +} D3DX10_WELD_EPSILONS; + +typedef D3DX10_WELD_EPSILONS* LPD3DX10_WELD_EPSILONS; + +typedef struct _D3DX10_INTERSECT_INFO +{ + UINT FaceIndex; // index of face intersected + FLOAT U; // Barycentric Hit Coordinates + FLOAT V; // Barycentric Hit Coordinates + FLOAT Dist; // Ray-Intersection Parameter Distance +} D3DX10_INTERSECT_INFO, *LPD3DX10_INTERSECT_INFO; + +// ID3DX10MeshBuffer is used by D3DX10Mesh vertex and index buffers +#undef INTERFACE +#define INTERFACE ID3DX10MeshBuffer + +DECLARE_INTERFACE_(ID3DX10MeshBuffer, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX10MeshBuffer + STDMETHOD(Map)(THIS_ void **ppData, SIZE_T *pSize) PURE; + STDMETHOD(Unmap)(THIS) PURE; + STDMETHOD_(SIZE_T, GetSize)(THIS) PURE; +}; + +// D3DX10 Mesh interfaces +#undef INTERFACE +#define INTERFACE ID3DX10Mesh + +DECLARE_INTERFACE_(ID3DX10Mesh, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX10Mesh + STDMETHOD_(UINT, GetFaceCount)(THIS) PURE; + STDMETHOD_(UINT, GetVertexCount)(THIS) PURE; + STDMETHOD_(UINT, GetVertexBufferCount)(THIS) PURE; + STDMETHOD_(UINT, GetFlags)(THIS) PURE; + STDMETHOD(GetVertexDescription)(THIS_ CONST D3D10_INPUT_ELEMENT_DESC **ppDesc, UINT *pDeclCount) PURE; + + STDMETHOD(SetVertexData)(THIS_ UINT iBuffer, CONST void *pData) PURE; + STDMETHOD(GetVertexBuffer)(THIS_ UINT iBuffer, ID3DX10MeshBuffer **ppVertexBuffer) PURE; + + STDMETHOD(SetIndexData)(THIS_ CONST void *pData, UINT cIndices) PURE; + STDMETHOD(GetIndexBuffer)(THIS_ ID3DX10MeshBuffer **ppIndexBuffer) PURE; + + STDMETHOD(SetAttributeData)(THIS_ CONST UINT *pData) PURE; + STDMETHOD(GetAttributeBuffer)(THIS_ ID3DX10MeshBuffer **ppAttributeBuffer) PURE; + + STDMETHOD(SetAttributeTable)(THIS_ CONST D3DX10_ATTRIBUTE_RANGE *pAttribTable, UINT cAttribTableSize) PURE; + STDMETHOD(GetAttributeTable)(THIS_ D3DX10_ATTRIBUTE_RANGE *pAttribTable, UINT *pAttribTableSize) PURE; + + STDMETHOD(GenerateAdjacencyAndPointReps)(THIS_ FLOAT Epsilon) PURE; + STDMETHOD(GenerateGSAdjacency)(THIS) PURE; + + STDMETHOD(SetAdjacencyData)(THIS_ CONST UINT *pAdjacency) PURE; + STDMETHOD(GetAdjacencyBuffer)(THIS_ ID3DX10MeshBuffer **ppAdjacency) PURE; + + STDMETHOD(SetPointRepData)(THIS_ CONST UINT *pPointReps) PURE; + STDMETHOD(GetPointRepBuffer)(THIS_ ID3DX10MeshBuffer **ppPointReps) PURE; + + STDMETHOD(Discard)(THIS_ D3DX10_MESH_DISCARD_FLAGS dwDiscard) PURE; + STDMETHOD(CloneMesh)(THIS_ UINT Flags, LPCSTR pPosSemantic, CONST D3D10_INPUT_ELEMENT_DESC *pDesc, UINT DeclCount, ID3DX10Mesh** ppCloneMesh) PURE; + + STDMETHOD(Optimize)(THIS_ UINT Flags, UINT * pFaceRemap, LPD3D10BLOB *ppVertexRemap) PURE; + STDMETHOD(GenerateAttributeBufferFromTable)(THIS) PURE; + + STDMETHOD(Intersect)(THIS_ D3DXVECTOR3 *pRayPos, D3DXVECTOR3 *pRayDir, + UINT *pHitCount, UINT *pFaceIndex, float *pU, float *pV, float *pDist, ID3D10Blob **ppAllHits); + STDMETHOD(IntersectSubset)(THIS_ UINT AttribId, D3DXVECTOR3 *pRayPos, D3DXVECTOR3 *pRayDir, + UINT *pHitCount, UINT *pFaceIndex, float *pU, float *pV, float *pDist, ID3D10Blob **ppAllHits); + + // ID3DX10Mesh - Device functions + STDMETHOD(CommitToDevice)(THIS) PURE; + STDMETHOD(DrawSubset)(THIS_ UINT AttribId) PURE; + STDMETHOD(DrawSubsetInstanced)(THIS_ UINT AttribId, UINT InstanceCount, UINT StartInstanceLocation) PURE; + + STDMETHOD(GetDeviceVertexBuffer)(THIS_ UINT iBuffer, ID3D10Buffer **ppVertexBuffer) PURE; + STDMETHOD(GetDeviceIndexBuffer)(THIS_ ID3D10Buffer **ppIndexBuffer) PURE; +}; + + +// Flat API +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI + D3DX10CreateMesh( + ID3D10Device *pDevice, + CONST D3D10_INPUT_ELEMENT_DESC *pDeclaration, + UINT DeclCount, + LPCSTR pPositionSemantic, + UINT VertexCount, + UINT FaceCount, + UINT Options, + ID3DX10Mesh **ppMesh); + +#ifdef __cplusplus +} +#endif //__cplusplus + + +// ID3DX10Mesh::Optimize options - upper byte only, lower 3 bytes used from _D3DX10MESH option flags +enum _D3DX10_MESHOPT { + D3DX10_MESHOPT_COMPACT = 0x01000000, + D3DX10_MESHOPT_ATTR_SORT = 0x02000000, + D3DX10_MESHOPT_VERTEX_CACHE = 0x04000000, + D3DX10_MESHOPT_STRIP_REORDER = 0x08000000, + D3DX10_MESHOPT_IGNORE_VERTS = 0x10000000, // optimize faces only, don't touch vertices + D3DX10_MESHOPT_DO_NOT_SPLIT = 0x20000000, // do not split vertices shared between attribute groups when attribute sorting + D3DX10_MESHOPT_DEVICE_INDEPENDENT = 0x00400000, // Only affects VCache. uses a static known good cache size for all cards + + // D3DX10_MESHOPT_SHAREVB has been removed, please use D3DX10MESH_VB_SHARE instead + +}; + + +////////////////////////////////////////////////////////////////////////// +// ID3DXSkinInfo +////////////////////////////////////////////////////////////////////////// + +// {420BD604-1C76-4a34-A466-E45D0658A32C} +DEFINE_GUID(IID_ID3DX10SkinInfo, +0x420bd604, 0x1c76, 0x4a34, 0xa4, 0x66, 0xe4, 0x5d, 0x6, 0x58, 0xa3, 0x2c); + +// scaling modes for ID3DX10SkinInfo::Compact() & ID3DX10SkinInfo::UpdateMesh() +#define D3DX10_SKININFO_NO_SCALING 0 +#define D3DX10_SKININFO_SCALE_TO_1 1 +#define D3DX10_SKININFO_SCALE_TO_TOTAL 2 + +typedef struct _D3DX10_SKINNING_CHANNEL +{ + UINT SrcOffset; + UINT DestOffset; + BOOL IsNormal; +} D3DX10_SKINNING_CHANNEL; + +#undef INTERFACE +#define INTERFACE ID3DX10SkinInfo + +typedef struct ID3DX10SkinInfo *LPD3DX10SKININFO; + +DECLARE_INTERFACE_(ID3DX10SkinInfo, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD_(UINT , GetNumVertices)(THIS) PURE; + STDMETHOD_(UINT , GetNumBones)(THIS) PURE; + STDMETHOD_(UINT , GetMaxBoneInfluences)(THIS) PURE; + + STDMETHOD(AddVertices)(THIS_ UINT Count) PURE; + STDMETHOD(RemapVertices)(THIS_ UINT NewVertexCount, UINT *pVertexRemap) PURE; + + STDMETHOD(AddBones)(THIS_ UINT Count) PURE; + STDMETHOD(RemoveBone)(THIS_ UINT Index) PURE; + STDMETHOD(RemapBones)(THIS_ UINT NewBoneCount, UINT *pBoneRemap) PURE; + + STDMETHOD(AddBoneInfluences)(THIS_ UINT BoneIndex, UINT InfluenceCount, UINT *pIndices, float *pWeights) PURE; + STDMETHOD(ClearBoneInfluences)(THIS_ UINT BoneIndex) PURE; + STDMETHOD_(UINT , GetBoneInfluenceCount)(THIS_ UINT BoneIndex) PURE; + STDMETHOD(GetBoneInfluences)(THIS_ UINT BoneIndex, UINT Offset, UINT Count, UINT *pDestIndices, float *pDestWeights) PURE; + STDMETHOD(FindBoneInfluenceIndex)(THIS_ UINT BoneIndex, UINT VertexIndex, UINT *pInfluenceIndex) PURE; + STDMETHOD(SetBoneInfluence)(THIS_ UINT BoneIndex, UINT InfluenceIndex, float Weight) PURE; + STDMETHOD(GetBoneInfluence)(THIS_ UINT BoneIndex, UINT InfluenceIndex, float *pWeight) PURE; + + STDMETHOD(Compact)(THIS_ UINT MaxPerVertexInfluences, UINT ScaleMode, float MinWeight) PURE; + STDMETHOD(DoSoftwareSkinning)(UINT StartVertex, UINT VertexCount, void *pSrcVertices, UINT SrcStride, void *pDestVertices, UINT DestStride, D3DXMATRIX *pBoneMatrices, D3DXMATRIX *pInverseTransposeBoneMatrices, D3DX10_SKINNING_CHANNEL *pChannelDescs, UINT NumChannels) PURE; +}; + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI + D3DX10CreateSkinInfo(LPD3DX10SKININFO* ppSkinInfo); + +#ifdef __cplusplus +} +#endif //__cplusplus + +typedef struct _D3DX10_ATTRIBUTE_WEIGHTS +{ + FLOAT Position; + FLOAT Boundary; + FLOAT Normal; + FLOAT Diffuse; + FLOAT Specular; + FLOAT Texcoord[8]; + FLOAT Tangent; + FLOAT Binormal; +} D3DX10_ATTRIBUTE_WEIGHTS, *LPD3DX10_ATTRIBUTE_WEIGHTS; + +#endif //__D3DX10MESH_H__ + + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3DX10tex.h b/Src/Decoder_H264_ALL/D3D/include/D3DX10tex.h new file mode 100644 index 0000000..a6d8bb9 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3DX10tex.h @@ -0,0 +1,766 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx10tex.h +// Content: D3DX10 texturing APIs +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx10.h" + +#ifndef __D3DX10TEX_H__ +#define __D3DX10TEX_H__ + + +//---------------------------------------------------------------------------- +// D3DX10_FILTER flags: +// ------------------ +// +// A valid filter must contain one of these values: +// +// D3DX10_FILTER_NONE +// No scaling or filtering will take place. Pixels outside the bounds +// of the source image are assumed to be transparent black. +// D3DX10_FILTER_POINT +// Each destination pixel is computed by sampling the nearest pixel +// from the source image. +// D3DX10_FILTER_LINEAR +// Each destination pixel is computed by linearly interpolating between +// the nearest pixels in the source image. This filter works best +// when the scale on each axis is less than 2. +// D3DX10_FILTER_TRIANGLE +// Every pixel in the source image contributes equally to the +// destination image. This is the slowest of all the filters. +// D3DX10_FILTER_BOX +// Each pixel is computed by averaging a 2x2(x2) box pixels from +// the source image. Only works when the dimensions of the +// destination are half those of the source. (as with mip maps) +// +// And can be OR'd with any of these optional flags: +// +// D3DX10_FILTER_MIRROR_U +// Indicates that pixels off the edge of the texture on the U-axis +// should be mirrored, not wraped. +// D3DX10_FILTER_MIRROR_V +// Indicates that pixels off the edge of the texture on the V-axis +// should be mirrored, not wraped. +// D3DX10_FILTER_MIRROR_W +// Indicates that pixels off the edge of the texture on the W-axis +// should be mirrored, not wraped. +// D3DX10_FILTER_MIRROR +// Same as specifying D3DX10_FILTER_MIRROR_U | D3DX10_FILTER_MIRROR_V | +// D3DX10_FILTER_MIRROR_V +// D3DX10_FILTER_DITHER +// Dithers the resulting image using a 4x4 order dither pattern. +// D3DX10_FILTER_SRGB_IN +// Denotes that the input data is in sRGB (gamma 2.2) colorspace. +// D3DX10_FILTER_SRGB_OUT +// Denotes that the output data is in sRGB (gamma 2.2) colorspace. +// D3DX10_FILTER_SRGB +// Same as specifying D3DX10_FILTER_SRGB_IN | D3DX10_FILTER_SRGB_OUT +// +//---------------------------------------------------------------------------- + +typedef enum D3DX10_FILTER_FLAG +{ + D3DX10_FILTER_NONE = (1 << 0), + D3DX10_FILTER_POINT = (2 << 0), + D3DX10_FILTER_LINEAR = (3 << 0), + D3DX10_FILTER_TRIANGLE = (4 << 0), + D3DX10_FILTER_BOX = (5 << 0), + + D3DX10_FILTER_MIRROR_U = (1 << 16), + D3DX10_FILTER_MIRROR_V = (2 << 16), + D3DX10_FILTER_MIRROR_W = (4 << 16), + D3DX10_FILTER_MIRROR = (7 << 16), + + D3DX10_FILTER_DITHER = (1 << 19), + D3DX10_FILTER_DITHER_DIFFUSION= (2 << 19), + + D3DX10_FILTER_SRGB_IN = (1 << 21), + D3DX10_FILTER_SRGB_OUT = (2 << 21), + D3DX10_FILTER_SRGB = (3 << 21), +} D3DX10_FILTER_FLAG; + +//---------------------------------------------------------------------------- +// D3DX10_NORMALMAP flags: +// --------------------- +// These flags are used to control how D3DX10ComputeNormalMap generates normal +// maps. Any number of these flags may be OR'd together in any combination. +// +// D3DX10_NORMALMAP_MIRROR_U +// Indicates that pixels off the edge of the texture on the U-axis +// should be mirrored, not wraped. +// D3DX10_NORMALMAP_MIRROR_V +// Indicates that pixels off the edge of the texture on the V-axis +// should be mirrored, not wraped. +// D3DX10_NORMALMAP_MIRROR +// Same as specifying D3DX10_NORMALMAP_MIRROR_U | D3DX10_NORMALMAP_MIRROR_V +// D3DX10_NORMALMAP_INVERTSIGN +// Inverts the direction of each normal +// D3DX10_NORMALMAP_COMPUTE_OCCLUSION +// Compute the per pixel Occlusion term and encodes it into the alpha. +// An Alpha of 1 means that the pixel is not obscured in anyway, and +// an alpha of 0 would mean that the pixel is completly obscured. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX10_NORMALMAP_FLAG +{ + D3DX10_NORMALMAP_MIRROR_U = (1 << 16), + D3DX10_NORMALMAP_MIRROR_V = (2 << 16), + D3DX10_NORMALMAP_MIRROR = (3 << 16), + D3DX10_NORMALMAP_INVERTSIGN = (8 << 16), + D3DX10_NORMALMAP_COMPUTE_OCCLUSION = (16 << 16), +} D3DX10_NORMALMAP_FLAG; + +//---------------------------------------------------------------------------- +// D3DX10_CHANNEL flags: +// ------------------- +// These flags are used by functions which operate on or more channels +// in a texture. +// +// D3DX10_CHANNEL_RED +// Indicates the red channel should be used +// D3DX10_CHANNEL_BLUE +// Indicates the blue channel should be used +// D3DX10_CHANNEL_GREEN +// Indicates the green channel should be used +// D3DX10_CHANNEL_ALPHA +// Indicates the alpha channel should be used +// D3DX10_CHANNEL_LUMINANCE +// Indicates the luminaces of the red green and blue channels should be +// used. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX10_CHANNEL_FLAG +{ + D3DX10_CHANNEL_RED = (1 << 0), + D3DX10_CHANNEL_BLUE = (1 << 1), + D3DX10_CHANNEL_GREEN = (1 << 2), + D3DX10_CHANNEL_ALPHA = (1 << 3), + D3DX10_CHANNEL_LUMINANCE = (1 << 4), +} D3DX10_CHANNEL_FLAG; + + + +//---------------------------------------------------------------------------- +// D3DX10_IMAGE_FILE_FORMAT: +// --------------------- +// This enum is used to describe supported image file formats. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX10_IMAGE_FILE_FORMAT +{ + D3DX10_IFF_BMP = 0, + D3DX10_IFF_JPG = 1, + D3DX10_IFF_PNG = 3, + D3DX10_IFF_DDS = 4, + D3DX10_IFF_TIFF = 10, + D3DX10_IFF_GIF = 11, + D3DX10_IFF_WMP = 12, + D3DX10_IFF_FORCE_DWORD = 0x7fffffff + +} D3DX10_IMAGE_FILE_FORMAT; + + +//---------------------------------------------------------------------------- +// D3DX10_SAVE_TEXTURE_FLAG: +// --------------------- +// This enum is used to support texture saving options. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX10_SAVE_TEXTURE_FLAG +{ + D3DX10_STF_USEINPUTBLOB = 0x0001, +} D3DX10_SAVE_TEXTURE_FLAG; + + + +//---------------------------------------------------------------------------- +// D3DX10_IMAGE_INFO: +// --------------- +// This structure is used to return a rough description of what the +// the original contents of an image file looked like. +// +// Width +// Width of original image in pixels +// Height +// Height of original image in pixels +// Depth +// Depth of original image in pixels +// ArraySize +// Array size in textures +// MipLevels +// Number of mip levels in original image +// MiscFlags +// Miscellaneous flags +// Format +// D3D format which most closely describes the data in original image +// ResourceDimension +// D3D10_RESOURCE_DIMENSION representing the dimension of texture stored in the file. +// D3D10_RESOURCE_DIMENSION_TEXTURE1D, 2D, 3D +// ImageFileFormat +// D3DX10_IMAGE_FILE_FORMAT representing the format of the image file. +//---------------------------------------------------------------------------- + +typedef struct D3DX10_IMAGE_INFO +{ + UINT Width; + UINT Height; + UINT Depth; + UINT ArraySize; + UINT MipLevels; + UINT MiscFlags; + DXGI_FORMAT Format; + D3D10_RESOURCE_DIMENSION ResourceDimension; + D3DX10_IMAGE_FILE_FORMAT ImageFileFormat; +} D3DX10_IMAGE_INFO; + + + + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + + +////////////////////////////////////////////////////////////////////////////// +// Image File APIs /////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DX10_IMAGE_LOAD_INFO: +// --------------- +// This structure can be optionally passed in to texture loader APIs to +// control how textures get loaded. Pass in D3DX10_DEFAULT for any of these +// to have D3DX automatically pick defaults based on the source file. +// +// Width +// Rescale texture to Width texels wide +// Height +// Rescale texture to Height texels high +// Depth +// Rescale texture to Depth texels deep +// FirstMipLevel +// First mip level to load +// MipLevels +// Number of mip levels to load after the first level +// Usage +// D3D10_USAGE flag for the new texture +// BindFlags +// D3D10 Bind flags for the new texture +// CpuAccessFlags +// D3D10 CPU Access flags for the new texture +// MiscFlags +// Reserved. Must be 0 +// Format +// Resample texture to the specified format +// Filter +// Filter the texture using the specified filter (only when resampling) +// MipFilter +// Filter the texture mip levels using the specified filter (only if +// generating mips) +// pSrcInfo +// (optional) pointer to a D3DX10_IMAGE_INFO structure that will get +// populated with source image information +//---------------------------------------------------------------------------- + + +typedef struct D3DX10_IMAGE_LOAD_INFO +{ + UINT Width; + UINT Height; + UINT Depth; + UINT FirstMipLevel; + UINT MipLevels; + D3D10_USAGE Usage; + UINT BindFlags; + UINT CpuAccessFlags; + UINT MiscFlags; + DXGI_FORMAT Format; + UINT Filter; + UINT MipFilter; + D3DX10_IMAGE_INFO* pSrcInfo; + +#ifdef __cplusplus + D3DX10_IMAGE_LOAD_INFO() + { + Width = D3DX10_DEFAULT; + Height = D3DX10_DEFAULT; + Depth = D3DX10_DEFAULT; + FirstMipLevel = D3DX10_DEFAULT; + MipLevels = D3DX10_DEFAULT; + Usage = (D3D10_USAGE) D3DX10_DEFAULT; + BindFlags = D3DX10_DEFAULT; + CpuAccessFlags = D3DX10_DEFAULT; + MiscFlags = D3DX10_DEFAULT; + Format = DXGI_FORMAT_FROM_FILE; + Filter = D3DX10_DEFAULT; + MipFilter = D3DX10_DEFAULT; + pSrcInfo = NULL; + } +#endif + +} D3DX10_IMAGE_LOAD_INFO; + +//------------------------------------------------------------------------------- +// GetImageInfoFromFile/Resource/Memory: +// ------------------------------ +// Fills in a D3DX10_IMAGE_INFO struct with information about an image file. +// +// Parameters: +// pSrcFile +// File name of the source image. +// pSrcModule +// Module where resource is located, or NULL for module associated +// with image the os used to create the current process. +// pSrcResource +// Resource name. +// pSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// pPump +// Optional pointer to a thread pump object to use. +// pSrcInfo +// Pointer to a D3DX10_IMAGE_INFO structure to be filled in with the +// description of the data in the source image file. +// pHResult +// Pointer to a memory location to receive the return value upon completion. +// Maybe NULL if not needed. +// If pPump != NULL, pHResult must be a valid memory location until the +// the asynchronous execution completes. +//------------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX10GetImageInfoFromFileA( + LPCSTR pSrcFile, + ID3DX10ThreadPump* pPump, + D3DX10_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX10GetImageInfoFromFileW( + LPCWSTR pSrcFile, + ID3DX10ThreadPump* pPump, + D3DX10_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10GetImageInfoFromFile D3DX10GetImageInfoFromFileW +#else +#define D3DX10GetImageInfoFromFile D3DX10GetImageInfoFromFileA +#endif + + +HRESULT WINAPI + D3DX10GetImageInfoFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + ID3DX10ThreadPump* pPump, + D3DX10_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX10GetImageInfoFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + ID3DX10ThreadPump* pPump, + D3DX10_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10GetImageInfoFromResource D3DX10GetImageInfoFromResourceW +#else +#define D3DX10GetImageInfoFromResource D3DX10GetImageInfoFromResourceA +#endif + + +HRESULT WINAPI + D3DX10GetImageInfoFromMemory( + LPCVOID pSrcData, + SIZE_T SrcDataSize, + ID3DX10ThreadPump* pPump, + D3DX10_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + + +////////////////////////////////////////////////////////////////////////////// +// Create/Save Texture APIs ////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DX10CreateTextureFromFile/Resource/Memory: +// D3DX10CreateShaderResourceViewFromFile/Resource/Memory: +// ----------------------------------- +// Create a texture object from a file or resource. +// +// Parameters: +// +// pDevice +// The D3D device with which the texture is going to be used. +// pSrcFile +// File name. +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module +// pvSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// pLoadInfo +// Optional pointer to a D3DX10_IMAGE_LOAD_INFO structure that +// contains additional loader parameters. +// pPump +// Optional pointer to a thread pump object to use. +// ppTexture +// [out] Created texture object. +// ppShaderResourceView +// [out] Shader resource view object created. +// pHResult +// Pointer to a memory location to receive the return value upon completion. +// Maybe NULL if not needed. +// If pPump != NULL, pHResult must be a valid memory location until the +// the asynchronous execution completes. +// +//---------------------------------------------------------------------------- + + +// FromFile + +HRESULT WINAPI + D3DX10CreateShaderResourceViewFromFileA( + ID3D10Device* pDevice, + LPCSTR pSrcFile, + D3DX10_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX10CreateShaderResourceViewFromFileW( + ID3D10Device* pDevice, + LPCWSTR pSrcFile, + D3DX10_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10CreateShaderResourceViewFromFile D3DX10CreateShaderResourceViewFromFileW +#else +#define D3DX10CreateShaderResourceViewFromFile D3DX10CreateShaderResourceViewFromFileA +#endif + +HRESULT WINAPI + D3DX10CreateTextureFromFileA( + ID3D10Device* pDevice, + LPCSTR pSrcFile, + D3DX10_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10Resource** ppTexture, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX10CreateTextureFromFileW( + ID3D10Device* pDevice, + LPCWSTR pSrcFile, + D3DX10_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10Resource** ppTexture, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10CreateTextureFromFile D3DX10CreateTextureFromFileW +#else +#define D3DX10CreateTextureFromFile D3DX10CreateTextureFromFileA +#endif + + +// FromResource (resources in dll/exes) + +HRESULT WINAPI + D3DX10CreateShaderResourceViewFromResourceA( + ID3D10Device* pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + D3DX10_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX10CreateShaderResourceViewFromResourceW( + ID3D10Device* pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + D3DX10_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10CreateShaderResourceViewFromResource D3DX10CreateShaderResourceViewFromResourceW +#else +#define D3DX10CreateShaderResourceViewFromResource D3DX10CreateShaderResourceViewFromResourceA +#endif + +HRESULT WINAPI + D3DX10CreateTextureFromResourceA( + ID3D10Device* pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + D3DX10_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10Resource** ppTexture, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX10CreateTextureFromResourceW( + ID3D10Device* pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + D3DX10_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10Resource** ppTexture, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10CreateTextureFromResource D3DX10CreateTextureFromResourceW +#else +#define D3DX10CreateTextureFromResource D3DX10CreateTextureFromResourceA +#endif + + +// FromFileInMemory + +HRESULT WINAPI + D3DX10CreateShaderResourceViewFromMemory( + ID3D10Device* pDevice, + LPCVOID pSrcData, + SIZE_T SrcDataSize, + D3DX10_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX10CreateTextureFromMemory( + ID3D10Device* pDevice, + LPCVOID pSrcData, + SIZE_T SrcDataSize, + D3DX10_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX10ThreadPump* pPump, + ID3D10Resource** ppTexture, + HRESULT* pHResult); + + +////////////////////////////////////////////////////////////////////////////// +// Misc Texture APIs ///////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DX10_TEXTURE_LOAD_INFO: +// ------------------------ +// +//---------------------------------------------------------------------------- + +typedef struct _D3DX10_TEXTURE_LOAD_INFO +{ + D3D10_BOX *pSrcBox; + D3D10_BOX *pDstBox; + UINT SrcFirstMip; + UINT DstFirstMip; + UINT NumMips; + UINT SrcFirstElement; + UINT DstFirstElement; + UINT NumElements; + UINT Filter; + UINT MipFilter; + +#ifdef __cplusplus + _D3DX10_TEXTURE_LOAD_INFO() + { + pSrcBox = NULL; + pDstBox = NULL; + SrcFirstMip = 0; + DstFirstMip = 0; + NumMips = D3DX10_DEFAULT; + SrcFirstElement = 0; + DstFirstElement = 0; + NumElements = D3DX10_DEFAULT; + Filter = D3DX10_DEFAULT; + MipFilter = D3DX10_DEFAULT; + } +#endif + +} D3DX10_TEXTURE_LOAD_INFO; + + +//---------------------------------------------------------------------------- +// D3DX10LoadTextureFromTexture: +// ---------------------------- +// Load a texture from a texture. +// +// Parameters: +// +//---------------------------------------------------------------------------- + + +HRESULT WINAPI + D3DX10LoadTextureFromTexture( + ID3D10Resource *pSrcTexture, + D3DX10_TEXTURE_LOAD_INFO *pLoadInfo, + ID3D10Resource *pDstTexture); + + +//---------------------------------------------------------------------------- +// D3DX10FilterTexture: +// ------------------ +// Filters mipmaps levels of a texture. +// +// Parameters: +// pBaseTexture +// The texture object to be filtered +// SrcLevel +// The level whose image is used to generate the subsequent levels. +// MipFilter +// D3DX10_FILTER flags controlling how each miplevel is filtered. +// Or D3DX10_DEFAULT for D3DX10_FILTER_BOX, +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX10FilterTexture( + ID3D10Resource *pTexture, + UINT SrcLevel, + UINT MipFilter); + + +//---------------------------------------------------------------------------- +// D3DX10SaveTextureToFile: +// ---------------------- +// Save a texture to a file. +// +// Parameters: +// pDestFile +// File name of the destination file +// DestFormat +// D3DX10_IMAGE_FILE_FORMAT specifying file format to use when saving. +// pSrcTexture +// Source texture, containing the image to be saved +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX10SaveTextureToFileA( + ID3D10Resource *pSrcTexture, + D3DX10_IMAGE_FILE_FORMAT DestFormat, + LPCSTR pDestFile); + +HRESULT WINAPI + D3DX10SaveTextureToFileW( + ID3D10Resource *pSrcTexture, + D3DX10_IMAGE_FILE_FORMAT DestFormat, + LPCWSTR pDestFile); + +#ifdef UNICODE +#define D3DX10SaveTextureToFile D3DX10SaveTextureToFileW +#else +#define D3DX10SaveTextureToFile D3DX10SaveTextureToFileA +#endif + + +//---------------------------------------------------------------------------- +// D3DX10SaveTextureToMemory: +// ---------------------- +// Save a texture to a blob. +// +// Parameters: +// pSrcTexture +// Source texture, containing the image to be saved +// DestFormat +// D3DX10_IMAGE_FILE_FORMAT specifying file format to use when saving. +// ppDestBuf +// address of a d3dxbuffer pointer to return the image data +// Flags +// optional flags +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX10SaveTextureToMemory( + ID3D10Resource* pSrcTexture, + D3DX10_IMAGE_FILE_FORMAT DestFormat, + LPD3D10BLOB* ppDestBuf, + UINT Flags); + + +//---------------------------------------------------------------------------- +// D3DX10ComputeNormalMap: +// --------------------- +// Converts a height map into a normal map. The (x,y,z) components of each +// normal are mapped to the (r,g,b) channels of the output texture. +// +// Parameters +// pSrcTexture +// Pointer to the source heightmap texture +// Flags +// D3DX10_NORMALMAP flags +// Channel +// D3DX10_CHANNEL specifying source of height information +// Amplitude +// The constant value which the height information is multiplied by. +// pDestTexture +// Pointer to the destination texture +//--------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX10ComputeNormalMap( + ID3D10Texture2D *pSrcTexture, + UINT Flags, + UINT Channel, + FLOAT Amplitude, + ID3D10Texture2D *pDestTexture); + + +//---------------------------------------------------------------------------- +// D3DX10SHProjectCubeMap: +// ---------------------- +// Projects a function represented in a cube map into spherical harmonics. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pCubeMap +// CubeMap that is going to be projected into spherical harmonics +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green +// pBOut +// Output SH vector for Blue +// +//--------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX10SHProjectCubeMap( + __in_range(2,6) UINT Order, + ID3D10Texture2D *pCubeMap, + __out_ecount(Order*Order) FLOAT *pROut, + __out_ecount_opt(Order*Order) FLOAT *pGOut, + __out_ecount_opt(Order*Order) FLOAT *pBOut); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX10TEX_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3DX11.h b/Src/Decoder_H264_ALL/D3D/include/D3DX11.h new file mode 100644 index 0000000..103c782 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3DX11.h @@ -0,0 +1,74 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx11.h +// Content: D3DX11 utility library +// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __D3DX11_INTERNAL__ +#error Incorrect D3DX11 header used +#endif + +#ifndef __D3DX11_H__ +#define __D3DX11_H__ + + +// Defines +#include +#include + +#ifdef ALLOW_THROWING_NEW +#include +#endif + +#define D3DX11_DEFAULT ((UINT) -1) +#define D3DX11_FROM_FILE ((UINT) -3) +#define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3) + +#ifndef D3DX11INLINE +#ifdef _MSC_VER + #if (_MSC_VER >= 1200) + #define D3DX11INLINE __forceinline + #else + #define D3DX11INLINE __inline + #endif +#else + #ifdef __cplusplus + #define D3DX11INLINE inline + #else + #define D3DX11INLINE + #endif +#endif +#endif + + + +// Includes +#include "d3d11.h" +#include "d3dx11.h" +#include "d3dx11core.h" +#include "d3dx11tex.h" +#include "d3dx11async.h" + + +// Errors +#define _FACDD 0x876 +#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) + +enum _D3DX11_ERR { + D3DX11_ERR_CANNOT_MODIFY_INDEX_BUFFER = MAKE_DDHRESULT(2900), + D3DX11_ERR_INVALID_MESH = MAKE_DDHRESULT(2901), + D3DX11_ERR_CANNOT_ATTR_SORT = MAKE_DDHRESULT(2902), + D3DX11_ERR_SKINNING_NOT_SUPPORTED = MAKE_DDHRESULT(2903), + D3DX11_ERR_TOO_MANY_INFLUENCES = MAKE_DDHRESULT(2904), + D3DX11_ERR_INVALID_DATA = MAKE_DDHRESULT(2905), + D3DX11_ERR_LOADED_MESH_HAS_NO_DATA = MAKE_DDHRESULT(2906), + D3DX11_ERR_DUPLICATE_NAMED_FRAGMENT = MAKE_DDHRESULT(2907), + D3DX11_ERR_CANNOT_REMOVE_LAST_ITEM = MAKE_DDHRESULT(2908), +}; + + +#endif //__D3DX11_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3DX11async.h b/Src/Decoder_H264_ALL/D3D/include/D3DX11async.h new file mode 100644 index 0000000..4586c55 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3DX11async.h @@ -0,0 +1,164 @@ + +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3DX11Async.h +// Content: D3DX11 Asynchronous Shader loaders / compilers +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3DX11ASYNC_H__ +#define __D3DX11ASYNC_H__ + +#include "d3dx11.h" + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +//---------------------------------------------------------------------------- +// D3DX11Compile: +// ------------------ +// Compiles an effect or shader. +// +// Parameters: +// pSrcFile +// Source file name. +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module. +// pSrcData +// Pointer to source code. +// SrcDataLen +// Size of source code, in bytes. +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// pFunctionName +// Name of the entrypoint function where execution should begin. +// pProfile +// Instruction set to be used when generating code. Currently supported +// profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "vs_3_0", +// "vs_3_sw", "vs_4_0", "vs_4_1", +// "ps_2_0", "ps_2_a", "ps_2_b", "ps_2_sw", "ps_3_0", +// "ps_3_sw", "ps_4_0", "ps_4_1", +// "gs_4_0", "gs_4_1", +// "tx_1_0", +// "fx_4_0", "fx_4_1" +// Note that this entrypoint does not compile fx_2_0 targets, for that +// you need to use the D3DX9 function. +// Flags1 +// See D3D10_SHADER_xxx flags. +// Flags2 +// See D3D10_EFFECT_xxx flags. +// ppShader +// Returns a buffer containing the created shader. This buffer contains +// the compiled shader code, as well as any embedded debug and symbol +// table info. (See D3D10GetShaderConstantTable) +// ppErrorMsgs +// Returns a buffer containing a listing of errors and warnings that were +// encountered during the compile. If you are running in a debugger, +// these are the same messages you will see in your debug output. +// pHResult +// Pointer to a memory location to receive the return value upon completion. +// Maybe NULL if not needed. +// If pPump != NULL, pHResult must be a valid memory location until the +// the asynchronous execution completes. +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3DX11CompileFromFileA(LPCSTR pSrcFile,CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX11CompileFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11CompileFromFile D3DX11CompileFromFileW +#else +#define D3DX11CompileFromFile D3DX11CompileFromFileA +#endif + +HRESULT WINAPI D3DX11CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX11CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11CompileFromResource D3DX11CompileFromResourceW +#else +#define D3DX11CompileFromResource D3DX11CompileFromResourceA +#endif + +HRESULT WINAPI D3DX11CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX11ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX11PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX11PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX11PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX11PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX11PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX11ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11PreprocessShaderFromFile D3DX11PreprocessShaderFromFileW +#define D3DX11PreprocessShaderFromResource D3DX11PreprocessShaderFromResourceW +#else +#define D3DX11PreprocessShaderFromFile D3DX11PreprocessShaderFromFileA +#define D3DX11PreprocessShaderFromResource D3DX11PreprocessShaderFromResourceA +#endif + +//---------------------------------------------------------------------------- +// Async processors +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3DX11CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, + ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX11DataProcessor **ppProcessor); + +HRESULT WINAPI D3DX11CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX11DataProcessor **ppProcessor); + +//---------------------------------------------------------------------------- +// D3DX11 Asynchronous texture I/O (advanced mode) +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3DX11CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX11DataLoader **ppDataLoader); +HRESULT WINAPI D3DX11CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX11DataLoader **ppDataLoader); +HRESULT WINAPI D3DX11CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX11DataLoader **ppDataLoader); +HRESULT WINAPI D3DX11CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX11DataLoader **ppDataLoader); +HRESULT WINAPI D3DX11CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX11DataLoader **ppDataLoader); + +#ifdef UNICODE +#define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderW +#define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderW +#else +#define D3DX11CreateAsyncFileLoader D3DX11CreateAsyncFileLoaderA +#define D3DX11CreateAsyncResourceLoader D3DX11CreateAsyncResourceLoaderA +#endif + +HRESULT WINAPI D3DX11CreateAsyncTextureProcessor(ID3D11Device *pDevice, D3DX11_IMAGE_LOAD_INFO *pLoadInfo, ID3DX11DataProcessor **ppDataProcessor); +HRESULT WINAPI D3DX11CreateAsyncTextureInfoProcessor(D3DX11_IMAGE_INFO *pImageInfo, ID3DX11DataProcessor **ppDataProcessor); +HRESULT WINAPI D3DX11CreateAsyncShaderResourceViewProcessor(ID3D11Device *pDevice, D3DX11_IMAGE_LOAD_INFO *pLoadInfo, ID3DX11DataProcessor **ppDataProcessor); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX11ASYNC_H__ + + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3DX11core.h b/Src/Decoder_H264_ALL/D3D/include/D3DX11core.h new file mode 100644 index 0000000..d10594e --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3DX11core.h @@ -0,0 +1,128 @@ +/////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx11core.h +// Content: D3DX11 core types and functions +// +/////////////////////////////////////////////////////////////////////////// + +#include "d3dx11.h" + +#ifndef __D3DX11CORE_H__ +#define __D3DX11CORE_H__ + +// Current name of the DLL shipped in the same SDK as this header. + + +#define D3DX11_DLL_W L"d3dx11_42.dll" +#define D3DX11_DLL_A "d3dx11_42.dll" + +#ifdef UNICODE + #define D3DX11_DLL D3DX11_DLL_W +#else + #define D3DX11_DLL D3DX11_DLL_A +#endif + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +/////////////////////////////////////////////////////////////////////////// +// D3DX11_SDK_VERSION: +// ----------------- +// This identifier is passed to D3DX11CheckVersion in order to ensure that an +// application was built against the correct header files and lib files. +// This number is incremented whenever a header (or other) change would +// require applications to be rebuilt. If the version doesn't match, +// D3DX11CreateVersion will return FALSE. (The number itself has no meaning.) +/////////////////////////////////////////////////////////////////////////// + + +#define D3DX11_SDK_VERSION 42 + + +#ifdef D3D_DIAG_DLL +BOOL WINAPI D3DX11DebugMute(BOOL Mute); +#endif +HRESULT WINAPI D3DX11CheckVersion(UINT D3DSdkVersion, UINT D3DX11SdkVersion); + +#ifdef __cplusplus +} +#endif //__cplusplus + + + +////////////////////////////////////////////////////////////////////////////// +// ID3DX11ThreadPump: +////////////////////////////////////////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ID3DX11DataLoader + +DECLARE_INTERFACE(ID3DX11DataLoader) +{ + STDMETHOD(Load)(THIS) PURE; + STDMETHOD(Decompress)(THIS_ void **ppData, SIZE_T *pcBytes) PURE; + STDMETHOD(Destroy)(THIS) PURE; +}; + +#undef INTERFACE +#define INTERFACE ID3DX11DataProcessor + +DECLARE_INTERFACE(ID3DX11DataProcessor) +{ + STDMETHOD(Process)(THIS_ void *pData, SIZE_T cBytes) PURE; + STDMETHOD(CreateDeviceObject)(THIS_ void **ppDataObject) PURE; + STDMETHOD(Destroy)(THIS) PURE; +}; + +// {C93FECFA-6967-478a-ABBC-402D90621FCB} +DEFINE_GUID(IID_ID3DX11ThreadPump, +0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb); + +#undef INTERFACE +#define INTERFACE ID3DX11ThreadPump + +DECLARE_INTERFACE_(ID3DX11ThreadPump, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DX11ThreadPump + STDMETHOD(AddWorkItem)(THIS_ ID3DX11DataLoader *pDataLoader, ID3DX11DataProcessor *pDataProcessor, HRESULT *pHResult, void **ppDeviceObject) PURE; + STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE; + + STDMETHOD(WaitForAllItems)(THIS) PURE; + STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT iWorkItemCount); + + STDMETHOD(PurgeAllItems)(THIS) PURE; + STDMETHOD(GetQueueStatus)(THIS_ UINT *pIoQueue, UINT *pProcessQueue, UINT *pDeviceQueue) PURE; + +}; + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI D3DX11CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX11ThreadPump **ppThreadPump); + +HRESULT WINAPI D3DX11UnsetAllDeviceObjects(ID3D11DeviceContext *pContext); + +#ifdef __cplusplus +} +#endif //__cplusplus + +/////////////////////////////////////////////////////////////////////////// + +#define _FACD3D 0x876 +#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) +#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code ) + +#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) +#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540) + +#endif //__D3DX11CORE_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3DX11tex.h b/Src/Decoder_H264_ALL/D3D/include/D3DX11tex.h new file mode 100644 index 0000000..16c0409 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3DX11tex.h @@ -0,0 +1,772 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx11tex.h +// Content: D3DX11 texturing APIs +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx11.h" + +#ifndef __D3DX11TEX_H__ +#define __D3DX11TEX_H__ + + +//---------------------------------------------------------------------------- +// D3DX11_FILTER flags: +// ------------------ +// +// A valid filter must contain one of these values: +// +// D3DX11_FILTER_NONE +// No scaling or filtering will take place. Pixels outside the bounds +// of the source image are assumed to be transparent black. +// D3DX11_FILTER_POINT +// Each destination pixel is computed by sampling the nearest pixel +// from the source image. +// D3DX11_FILTER_LINEAR +// Each destination pixel is computed by linearly interpolating between +// the nearest pixels in the source image. This filter works best +// when the scale on each axis is less than 2. +// D3DX11_FILTER_TRIANGLE +// Every pixel in the source image contributes equally to the +// destination image. This is the slowest of all the filters. +// D3DX11_FILTER_BOX +// Each pixel is computed by averaging a 2x2(x2) box pixels from +// the source image. Only works when the dimensions of the +// destination are half those of the source. (as with mip maps) +// +// And can be OR'd with any of these optional flags: +// +// D3DX11_FILTER_MIRROR_U +// Indicates that pixels off the edge of the texture on the U-axis +// should be mirrored, not wraped. +// D3DX11_FILTER_MIRROR_V +// Indicates that pixels off the edge of the texture on the V-axis +// should be mirrored, not wraped. +// D3DX11_FILTER_MIRROR_W +// Indicates that pixels off the edge of the texture on the W-axis +// should be mirrored, not wraped. +// D3DX11_FILTER_MIRROR +// Same as specifying D3DX11_FILTER_MIRROR_U | D3DX11_FILTER_MIRROR_V | +// D3DX11_FILTER_MIRROR_V +// D3DX11_FILTER_DITHER +// Dithers the resulting image using a 4x4 order dither pattern. +// D3DX11_FILTER_SRGB_IN +// Denotes that the input data is in sRGB (gamma 2.2) colorspace. +// D3DX11_FILTER_SRGB_OUT +// Denotes that the output data is in sRGB (gamma 2.2) colorspace. +// D3DX11_FILTER_SRGB +// Same as specifying D3DX11_FILTER_SRGB_IN | D3DX11_FILTER_SRGB_OUT +// +//---------------------------------------------------------------------------- + +typedef enum D3DX11_FILTER_FLAG +{ + D3DX11_FILTER_NONE = (1 << 0), + D3DX11_FILTER_POINT = (2 << 0), + D3DX11_FILTER_LINEAR = (3 << 0), + D3DX11_FILTER_TRIANGLE = (4 << 0), + D3DX11_FILTER_BOX = (5 << 0), + + D3DX11_FILTER_MIRROR_U = (1 << 16), + D3DX11_FILTER_MIRROR_V = (2 << 16), + D3DX11_FILTER_MIRROR_W = (4 << 16), + D3DX11_FILTER_MIRROR = (7 << 16), + + D3DX11_FILTER_DITHER = (1 << 19), + D3DX11_FILTER_DITHER_DIFFUSION= (2 << 19), + + D3DX11_FILTER_SRGB_IN = (1 << 21), + D3DX11_FILTER_SRGB_OUT = (2 << 21), + D3DX11_FILTER_SRGB = (3 << 21), +} D3DX11_FILTER_FLAG; + +//---------------------------------------------------------------------------- +// D3DX11_NORMALMAP flags: +// --------------------- +// These flags are used to control how D3DX11ComputeNormalMap generates normal +// maps. Any number of these flags may be OR'd together in any combination. +// +// D3DX11_NORMALMAP_MIRROR_U +// Indicates that pixels off the edge of the texture on the U-axis +// should be mirrored, not wraped. +// D3DX11_NORMALMAP_MIRROR_V +// Indicates that pixels off the edge of the texture on the V-axis +// should be mirrored, not wraped. +// D3DX11_NORMALMAP_MIRROR +// Same as specifying D3DX11_NORMALMAP_MIRROR_U | D3DX11_NORMALMAP_MIRROR_V +// D3DX11_NORMALMAP_INVERTSIGN +// Inverts the direction of each normal +// D3DX11_NORMALMAP_COMPUTE_OCCLUSION +// Compute the per pixel Occlusion term and encodes it into the alpha. +// An Alpha of 1 means that the pixel is not obscured in anyway, and +// an alpha of 0 would mean that the pixel is completly obscured. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX11_NORMALMAP_FLAG +{ + D3DX11_NORMALMAP_MIRROR_U = (1 << 16), + D3DX11_NORMALMAP_MIRROR_V = (2 << 16), + D3DX11_NORMALMAP_MIRROR = (3 << 16), + D3DX11_NORMALMAP_INVERTSIGN = (8 << 16), + D3DX11_NORMALMAP_COMPUTE_OCCLUSION = (16 << 16), +} D3DX11_NORMALMAP_FLAG; + +//---------------------------------------------------------------------------- +// D3DX11_CHANNEL flags: +// ------------------- +// These flags are used by functions which operate on or more channels +// in a texture. +// +// D3DX11_CHANNEL_RED +// Indicates the red channel should be used +// D3DX11_CHANNEL_BLUE +// Indicates the blue channel should be used +// D3DX11_CHANNEL_GREEN +// Indicates the green channel should be used +// D3DX11_CHANNEL_ALPHA +// Indicates the alpha channel should be used +// D3DX11_CHANNEL_LUMINANCE +// Indicates the luminaces of the red green and blue channels should be +// used. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX11_CHANNEL_FLAG +{ + D3DX11_CHANNEL_RED = (1 << 0), + D3DX11_CHANNEL_BLUE = (1 << 1), + D3DX11_CHANNEL_GREEN = (1 << 2), + D3DX11_CHANNEL_ALPHA = (1 << 3), + D3DX11_CHANNEL_LUMINANCE = (1 << 4), +} D3DX11_CHANNEL_FLAG; + + + +//---------------------------------------------------------------------------- +// D3DX11_IMAGE_FILE_FORMAT: +// --------------------- +// This enum is used to describe supported image file formats. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX11_IMAGE_FILE_FORMAT +{ + D3DX11_IFF_BMP = 0, + D3DX11_IFF_JPG = 1, + D3DX11_IFF_PNG = 3, + D3DX11_IFF_DDS = 4, + D3DX11_IFF_TIFF = 10, + D3DX11_IFF_GIF = 11, + D3DX11_IFF_WMP = 12, + D3DX11_IFF_FORCE_DWORD = 0x7fffffff + +} D3DX11_IMAGE_FILE_FORMAT; + + +//---------------------------------------------------------------------------- +// D3DX11_SAVE_TEXTURE_FLAG: +// --------------------- +// This enum is used to support texture saving options. +// +//---------------------------------------------------------------------------- + +typedef enum D3DX11_SAVE_TEXTURE_FLAG +{ + D3DX11_STF_USEINPUTBLOB = 0x0001, +} D3DX11_SAVE_TEXTURE_FLAG; + + +//---------------------------------------------------------------------------- +// D3DX11_IMAGE_INFO: +// --------------- +// This structure is used to return a rough description of what the +// the original contents of an image file looked like. +// +// Width +// Width of original image in pixels +// Height +// Height of original image in pixels +// Depth +// Depth of original image in pixels +// ArraySize +// Array size in textures +// MipLevels +// Number of mip levels in original image +// MiscFlags +// Miscellaneous flags +// Format +// D3D format which most closely describes the data in original image +// ResourceDimension +// D3D11_RESOURCE_DIMENSION representing the dimension of texture stored in the file. +// D3D11_RESOURCE_DIMENSION_TEXTURE1D, 2D, 3D +// ImageFileFormat +// D3DX11_IMAGE_FILE_FORMAT representing the format of the image file. +//---------------------------------------------------------------------------- + +typedef struct D3DX11_IMAGE_INFO +{ + UINT Width; + UINT Height; + UINT Depth; + UINT ArraySize; + UINT MipLevels; + UINT MiscFlags; + DXGI_FORMAT Format; + D3D11_RESOURCE_DIMENSION ResourceDimension; + D3DX11_IMAGE_FILE_FORMAT ImageFileFormat; +} D3DX11_IMAGE_INFO; + + + + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + + +////////////////////////////////////////////////////////////////////////////// +// Image File APIs /////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DX11_IMAGE_LOAD_INFO: +// --------------- +// This structure can be optionally passed in to texture loader APIs to +// control how textures get loaded. Pass in D3DX11_DEFAULT for any of these +// to have D3DX automatically pick defaults based on the source file. +// +// Width +// Rescale texture to Width texels wide +// Height +// Rescale texture to Height texels high +// Depth +// Rescale texture to Depth texels deep +// FirstMipLevel +// First mip level to load +// MipLevels +// Number of mip levels to load after the first level +// Usage +// D3D11_USAGE flag for the new texture +// BindFlags +// D3D11 Bind flags for the new texture +// CpuAccessFlags +// D3D11 CPU Access flags for the new texture +// MiscFlags +// Reserved. Must be 0 +// Format +// Resample texture to the specified format +// Filter +// Filter the texture using the specified filter (only when resampling) +// MipFilter +// Filter the texture mip levels using the specified filter (only if +// generating mips) +// pSrcInfo +// (optional) pointer to a D3DX11_IMAGE_INFO structure that will get +// populated with source image information +//---------------------------------------------------------------------------- + + +typedef struct D3DX11_IMAGE_LOAD_INFO +{ + UINT Width; + UINT Height; + UINT Depth; + UINT FirstMipLevel; + UINT MipLevels; + D3D11_USAGE Usage; + UINT BindFlags; + UINT CpuAccessFlags; + UINT MiscFlags; + DXGI_FORMAT Format; + UINT Filter; + UINT MipFilter; + D3DX11_IMAGE_INFO* pSrcInfo; + +#ifdef __cplusplus + D3DX11_IMAGE_LOAD_INFO() + { + Width = D3DX11_DEFAULT; + Height = D3DX11_DEFAULT; + Depth = D3DX11_DEFAULT; + FirstMipLevel = D3DX11_DEFAULT; + MipLevels = D3DX11_DEFAULT; + Usage = (D3D11_USAGE) D3DX11_DEFAULT; + BindFlags = D3DX11_DEFAULT; + CpuAccessFlags = D3DX11_DEFAULT; + MiscFlags = D3DX11_DEFAULT; + Format = DXGI_FORMAT_FROM_FILE; + Filter = D3DX11_DEFAULT; + MipFilter = D3DX11_DEFAULT; + pSrcInfo = NULL; + } +#endif + +} D3DX11_IMAGE_LOAD_INFO; + +//------------------------------------------------------------------------------- +// GetImageInfoFromFile/Resource/Memory: +// ------------------------------ +// Fills in a D3DX11_IMAGE_INFO struct with information about an image file. +// +// Parameters: +// pSrcFile +// File name of the source image. +// pSrcModule +// Module where resource is located, or NULL for module associated +// with image the os used to create the current process. +// pSrcResource +// Resource name. +// pSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// pPump +// Optional pointer to a thread pump object to use. +// pSrcInfo +// Pointer to a D3DX11_IMAGE_INFO structure to be filled in with the +// description of the data in the source image file. +// pHResult +// Pointer to a memory location to receive the return value upon completion. +// Maybe NULL if not needed. +// If pPump != NULL, pHResult must be a valid memory location until the +// the asynchronous execution completes. +//------------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX11GetImageInfoFromFileA( + LPCSTR pSrcFile, + ID3DX11ThreadPump* pPump, + D3DX11_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX11GetImageInfoFromFileW( + LPCWSTR pSrcFile, + ID3DX11ThreadPump* pPump, + D3DX11_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11GetImageInfoFromFile D3DX11GetImageInfoFromFileW +#else +#define D3DX11GetImageInfoFromFile D3DX11GetImageInfoFromFileA +#endif + + +HRESULT WINAPI + D3DX11GetImageInfoFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + ID3DX11ThreadPump* pPump, + D3DX11_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX11GetImageInfoFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + ID3DX11ThreadPump* pPump, + D3DX11_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11GetImageInfoFromResource D3DX11GetImageInfoFromResourceW +#else +#define D3DX11GetImageInfoFromResource D3DX11GetImageInfoFromResourceA +#endif + + +HRESULT WINAPI + D3DX11GetImageInfoFromMemory( + LPCVOID pSrcData, + SIZE_T SrcDataSize, + ID3DX11ThreadPump* pPump, + D3DX11_IMAGE_INFO* pSrcInfo, + HRESULT* pHResult); + + +////////////////////////////////////////////////////////////////////////////// +// Create/Save Texture APIs ////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DX11CreateTextureFromFile/Resource/Memory: +// D3DX11CreateShaderResourceViewFromFile/Resource/Memory: +// ----------------------------------- +// Create a texture object from a file or resource. +// +// Parameters: +// +// pDevice +// The D3D device with which the texture is going to be used. +// pSrcFile +// File name. +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module +// pvSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// pLoadInfo +// Optional pointer to a D3DX11_IMAGE_LOAD_INFO structure that +// contains additional loader parameters. +// pPump +// Optional pointer to a thread pump object to use. +// ppTexture +// [out] Created texture object. +// ppShaderResourceView +// [out] Shader resource view object created. +// pHResult +// Pointer to a memory location to receive the return value upon completion. +// Maybe NULL if not needed. +// If pPump != NULL, pHResult must be a valid memory location until the +// the asynchronous execution completes. +// +//---------------------------------------------------------------------------- + + +// FromFile + +HRESULT WINAPI + D3DX11CreateShaderResourceViewFromFileA( + ID3D11Device* pDevice, + LPCSTR pSrcFile, + D3DX11_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX11CreateShaderResourceViewFromFileW( + ID3D11Device* pDevice, + LPCWSTR pSrcFile, + D3DX11_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11CreateShaderResourceViewFromFile D3DX11CreateShaderResourceViewFromFileW +#else +#define D3DX11CreateShaderResourceViewFromFile D3DX11CreateShaderResourceViewFromFileA +#endif + +HRESULT WINAPI + D3DX11CreateTextureFromFileA( + ID3D11Device* pDevice, + LPCSTR pSrcFile, + D3DX11_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11Resource** ppTexture, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX11CreateTextureFromFileW( + ID3D11Device* pDevice, + LPCWSTR pSrcFile, + D3DX11_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11Resource** ppTexture, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11CreateTextureFromFile D3DX11CreateTextureFromFileW +#else +#define D3DX11CreateTextureFromFile D3DX11CreateTextureFromFileA +#endif + + +// FromResource (resources in dll/exes) + +HRESULT WINAPI + D3DX11CreateShaderResourceViewFromResourceA( + ID3D11Device* pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + D3DX11_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX11CreateShaderResourceViewFromResourceW( + ID3D11Device* pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + D3DX11_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11CreateShaderResourceViewFromResource D3DX11CreateShaderResourceViewFromResourceW +#else +#define D3DX11CreateShaderResourceViewFromResource D3DX11CreateShaderResourceViewFromResourceA +#endif + +HRESULT WINAPI + D3DX11CreateTextureFromResourceA( + ID3D11Device* pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + D3DX11_IMAGE_LOAD_INFO *pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11Resource** ppTexture, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX11CreateTextureFromResourceW( + ID3D11Device* pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + D3DX11_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11Resource** ppTexture, + HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX11CreateTextureFromResource D3DX11CreateTextureFromResourceW +#else +#define D3DX11CreateTextureFromResource D3DX11CreateTextureFromResourceA +#endif + + +// FromFileInMemory + +HRESULT WINAPI + D3DX11CreateShaderResourceViewFromMemory( + ID3D11Device* pDevice, + LPCVOID pSrcData, + SIZE_T SrcDataSize, + D3DX11_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11ShaderResourceView** ppShaderResourceView, + HRESULT* pHResult); + +HRESULT WINAPI + D3DX11CreateTextureFromMemory( + ID3D11Device* pDevice, + LPCVOID pSrcData, + SIZE_T SrcDataSize, + D3DX11_IMAGE_LOAD_INFO* pLoadInfo, + ID3DX11ThreadPump* pPump, + ID3D11Resource** ppTexture, + HRESULT* pHResult); + + +////////////////////////////////////////////////////////////////////////////// +// Misc Texture APIs ///////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DX11_TEXTURE_LOAD_INFO: +// ------------------------ +// +//---------------------------------------------------------------------------- + +typedef struct _D3DX11_TEXTURE_LOAD_INFO +{ + D3D11_BOX *pSrcBox; + D3D11_BOX *pDstBox; + UINT SrcFirstMip; + UINT DstFirstMip; + UINT NumMips; + UINT SrcFirstElement; + UINT DstFirstElement; + UINT NumElements; + UINT Filter; + UINT MipFilter; + +#ifdef __cplusplus + _D3DX11_TEXTURE_LOAD_INFO() + { + pSrcBox = NULL; + pDstBox = NULL; + SrcFirstMip = 0; + DstFirstMip = 0; + NumMips = D3DX11_DEFAULT; + SrcFirstElement = 0; + DstFirstElement = 0; + NumElements = D3DX11_DEFAULT; + Filter = D3DX11_DEFAULT; + MipFilter = D3DX11_DEFAULT; + } +#endif + +} D3DX11_TEXTURE_LOAD_INFO; + + +//---------------------------------------------------------------------------- +// D3DX11LoadTextureFromTexture: +// ---------------------------- +// Load a texture from a texture. +// +// Parameters: +// +//---------------------------------------------------------------------------- + + +HRESULT WINAPI + D3DX11LoadTextureFromTexture( + ID3D11DeviceContext *pContext, + ID3D11Resource *pSrcTexture, + D3DX11_TEXTURE_LOAD_INFO *pLoadInfo, + ID3D11Resource *pDstTexture); + + +//---------------------------------------------------------------------------- +// D3DX11FilterTexture: +// ------------------ +// Filters mipmaps levels of a texture. +// +// Parameters: +// pBaseTexture +// The texture object to be filtered +// SrcLevel +// The level whose image is used to generate the subsequent levels. +// MipFilter +// D3DX11_FILTER flags controlling how each miplevel is filtered. +// Or D3DX11_DEFAULT for D3DX11_FILTER_BOX, +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX11FilterTexture( + ID3D11DeviceContext *pContext, + ID3D11Resource *pTexture, + UINT SrcLevel, + UINT MipFilter); + + +//---------------------------------------------------------------------------- +// D3DX11SaveTextureToFile: +// ---------------------- +// Save a texture to a file. +// +// Parameters: +// pDestFile +// File name of the destination file +// DestFormat +// D3DX11_IMAGE_FILE_FORMAT specifying file format to use when saving. +// pSrcTexture +// Source texture, containing the image to be saved +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX11SaveTextureToFileA( + ID3D11DeviceContext *pContext, + ID3D11Resource *pSrcTexture, + D3DX11_IMAGE_FILE_FORMAT DestFormat, + LPCSTR pDestFile); + +HRESULT WINAPI + D3DX11SaveTextureToFileW( + ID3D11DeviceContext *pContext, + ID3D11Resource *pSrcTexture, + D3DX11_IMAGE_FILE_FORMAT DestFormat, + LPCWSTR pDestFile); + +#ifdef UNICODE +#define D3DX11SaveTextureToFile D3DX11SaveTextureToFileW +#else +#define D3DX11SaveTextureToFile D3DX11SaveTextureToFileA +#endif + + +//---------------------------------------------------------------------------- +// D3DX11SaveTextureToMemory: +// ---------------------- +// Save a texture to a blob. +// +// Parameters: +// pSrcTexture +// Source texture, containing the image to be saved +// DestFormat +// D3DX11_IMAGE_FILE_FORMAT specifying file format to use when saving. +// ppDestBuf +// address of a d3dxbuffer pointer to return the image data +// Flags +// optional flags +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX11SaveTextureToMemory( + ID3D11DeviceContext *pContext, + ID3D11Resource* pSrcTexture, + D3DX11_IMAGE_FILE_FORMAT DestFormat, + ID3D10Blob** ppDestBuf, + UINT Flags); + + +//---------------------------------------------------------------------------- +// D3DX11ComputeNormalMap: +// --------------------- +// Converts a height map into a normal map. The (x,y,z) components of each +// normal are mapped to the (r,g,b) channels of the output texture. +// +// Parameters +// pSrcTexture +// Pointer to the source heightmap texture +// Flags +// D3DX11_NORMALMAP flags +// Channel +// D3DX11_CHANNEL specifying source of height information +// Amplitude +// The constant value which the height information is multiplied by. +// pDestTexture +// Pointer to the destination texture +//--------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX11ComputeNormalMap( + ID3D11DeviceContext *pContext, + ID3D11Texture2D *pSrcTexture, + UINT Flags, + UINT Channel, + FLOAT Amplitude, + ID3D11Texture2D *pDestTexture); + + +//---------------------------------------------------------------------------- +// D3DX11SHProjectCubeMap: +// ---------------------- +// Projects a function represented in a cube map into spherical harmonics. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pCubeMap +// CubeMap that is going to be projected into spherical harmonics +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green +// pBOut +// Output SH vector for Blue +// +//--------------------------------------------------------------------------- + +HRESULT WINAPI + D3DX11SHProjectCubeMap( + ID3D11DeviceContext *pContext, + __in_range(2,6) UINT Order, + ID3D11Texture2D *pCubeMap, + __out_ecount(Order*Order) FLOAT *pROut, + __out_ecount_opt(Order*Order) FLOAT *pGOut, + __out_ecount_opt(Order*Order) FLOAT *pBOut); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX11TEX_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3Dcommon.h b/Src/Decoder_H264_ALL/D3D/include/D3Dcommon.h new file mode 100644 index 0000000..1da83df --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3Dcommon.h @@ -0,0 +1,95 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0555 */ +/* Compiler settings for d3dcommon.idl: + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 7.00.0555 + protocol : all , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + + +#ifndef __d3dcommon_h__ +#define __d3dcommon_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3dcommon_0000_0000 */ +/* [local] */ + +typedef +enum D3D_DRIVER_TYPE + { D3D_DRIVER_TYPE_UNKNOWN = 0, + D3D_DRIVER_TYPE_HARDWARE = ( D3D_DRIVER_TYPE_UNKNOWN + 1 ) , + D3D_DRIVER_TYPE_REFERENCE = ( D3D_DRIVER_TYPE_HARDWARE + 1 ) , + D3D_DRIVER_TYPE_NULL = ( D3D_DRIVER_TYPE_REFERENCE + 1 ) , + D3D_DRIVER_TYPE_SOFTWARE = ( D3D_DRIVER_TYPE_NULL + 1 ) , + D3D_DRIVER_TYPE_WARP = ( D3D_DRIVER_TYPE_SOFTWARE + 1 ) + } D3D_DRIVER_TYPE; + +typedef +enum D3D_FEATURE_LEVEL + { D3D_FEATURE_LEVEL_9_1 = 0x9100, + D3D_FEATURE_LEVEL_9_2 = 0x9200, + D3D_FEATURE_LEVEL_9_3 = 0x9300, + D3D_FEATURE_LEVEL_10_0 = 0xa000, + D3D_FEATURE_LEVEL_10_1 = 0xa100, + D3D_FEATURE_LEVEL_11_0 = 0xb000 + } D3D_FEATURE_LEVEL; + +DEFINE_GUID(WKPDID_D3DDebugObjectName,0x429b8c22,0x9188,0x4b0c,0x87,0x42,0xac,0xb0,0xbf,0x85,0xc2,0x00); + + +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/Src/Decoder_H264_ALL/D3D/include/D3Dcompiler.h b/Src/Decoder_H264_ALL/D3D/include/D3Dcompiler.h new file mode 100644 index 0000000..c854de3 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/D3Dcompiler.h @@ -0,0 +1,224 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3DCompiler.h +// Content: D3D Compilation Types and APIs +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3DCOMPILER_H__ +#define __D3DCOMPILER_H__ + +// Current name of the DLL shipped in the same SDK as this header. + + +#define D3DCOMPILER_DLL_W L"d3dcompiler_42.dll" +#define D3DCOMPILER_DLL_A "d3dcompiler_42.dll" + +#ifdef UNICODE + #define D3DCOMPILER_DLL D3DCOMPILER_DLL_W +#else + #define D3DCOMPILER_DLL D3DCOMPILER_DLL_A +#endif + +#include "d3d11shader.h" + +// The compilation APIs are generally not tied to particular +// versions of D3D, thus their names and types don't reflect +// a particular version number unless it is necessary to +// do so. However, for compatibility with previous compilation +// API definitions some of the neutral types are simply +// redefinitions of older types. +typedef struct _D3D10_SHADER_MACRO D3D_SHADER_MACRO; +typedef enum _D3D10_INCLUDE_TYPE D3D_INCLUDE_TYPE; +typedef interface ID3D10Blob ID3DBlob; +typedef ID3DBlob* LPD3DBLOB; +typedef interface ID3D10Include ID3DInclude; +typedef ID3DInclude* LPD3DINCLUDE; + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +//---------------------------------------------------------------------------- +// D3DCompile: +// ---------- +// Compile source text into bytecode appropriate for the given target. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DCompile(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __in_opt LPCSTR pSourceName, + __in_xcount_opt(pDefines->Name != NULL) CONST D3D_SHADER_MACRO* pDefines, + __in_opt LPD3DINCLUDE pInclude, + __in LPCSTR pEntrypoint, + __in LPCSTR pTarget, + __in UINT Flags1, + __in UINT Flags2, + __out LPD3DBLOB* ppCode, + __out_opt LPD3DBLOB* ppErrorMsgs); + +typedef HRESULT (WINAPI *pD3DCompile) + (LPCVOID pSrcData, + SIZE_T SrcDataSize, + LPCSTR pFileName, + CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, + LPCSTR pEntrypoint, + LPCSTR pTarget, + UINT Flags1, + UINT Flags2, + LPD3D10BLOB* ppCode, + LPD3D10BLOB* ppErrorMsgs); + +//---------------------------------------------------------------------------- +// D3DPreprocess: +// ---------- +// Process source text with the compiler's preprocessor and return +// the resulting text. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DPreprocess(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __in_opt LPCSTR pSourceName, + __in_opt CONST D3D_SHADER_MACRO* pDefines, + __in_opt LPD3DINCLUDE pInclude, + __out LPD3DBLOB* ppCodeText, + __out_opt LPD3DBLOB* ppErrorMsgs); + +typedef HRESULT (WINAPI *pD3DPreprocess) + (LPCVOID pSrcData, + SIZE_T SrcDataSize, + LPCSTR pFileName, + CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, + LPD3D10BLOB* ppCodeText, + LPD3D10BLOB* ppErrorMsgs); + +//---------------------------------------------------------------------------- +// D3DGetDebugInfo: +// ----------------------- +// Gets shader debug info. Debug info is generated by D3DCompile and is +// embedded in the body of the shader. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DGetDebugInfo(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __out LPD3DBLOB* ppDebugInfo); + +//---------------------------------------------------------------------------- +// D3DReflect: +// ---------- +// Shader code contains metadata that can be inspected via the +// reflection APIs. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DReflect(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __in REFIID pInterface, + __out void** ppReflector); + +//---------------------------------------------------------------------------- +// D3DDisassemble: +// ---------------------- +// Takes a binary shader and returns a buffer containing text assembly. +//---------------------------------------------------------------------------- + +#define D3D_DISASM_ENABLE_COLOR_CODE 0x00000001 +#define D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS 0x00000002 +#define D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING 0x00000004 +#define D3D_DISASM_ENABLE_INSTRUCTION_CYCLE 0x00000008 + +HRESULT WINAPI +D3DDisassemble(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __in UINT Flags, + __in_opt LPCSTR szComments, + __out LPD3DBLOB* ppDisassembly); + +typedef HRESULT (WINAPI *pD3DDisassemble) + (__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __in UINT Flags, + __in_opt LPCSTR szComments, + __out LPD3DBLOB* ppDisassembly); + +//---------------------------------------------------------------------------- +// D3DDisassemble10Effect: +// ----------------------- +// Takes a D3D10 effect interface and returns a +// buffer containing text assembly. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DDisassemble10Effect(__in ID3D10Effect *pEffect, + __in UINT Flags, + __out LPD3DBLOB* ppDisassembly); + +//---------------------------------------------------------------------------- +// D3DGetInputSignatureBlob: +// ----------------------- +// Retrieve the input signature from a compilation result. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DGetInputSignatureBlob(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __out LPD3DBLOB* ppSignatureBlob); + +//---------------------------------------------------------------------------- +// D3DGetOutputSignatureBlob: +// ----------------------- +// Retrieve the output signature from a compilation result. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DGetOutputSignatureBlob(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __out LPD3DBLOB* ppSignatureBlob); + +//---------------------------------------------------------------------------- +// D3DGetInputAndOutputSignatureBlob: +// ----------------------- +// Retrieve the input and output signatures from a compilation result. +//---------------------------------------------------------------------------- + +HRESULT WINAPI +D3DGetInputAndOutputSignatureBlob(__in_bcount(SrcDataSize) LPCVOID pSrcData, + __in SIZE_T SrcDataSize, + __out LPD3DBLOB* ppSignatureBlob); + +//---------------------------------------------------------------------------- +// D3DStripShader: +// ----------------------- +// Removes unwanted blobs from a compilation result +//---------------------------------------------------------------------------- + +typedef enum D3DCOMPILER_STRIP_FLAGS +{ + D3DCOMPILER_STRIP_REFLECTION_DATA = 1, + D3DCOMPILER_STRIP_DEBUG_INFO = 2, + D3DCOMPILER_STRIP_TEST_BLOBS = 4, + D3DCOMPILER_STRIP_FORCE_DWORD = 0x7fffffff, +} D3DCOMPILER_STRIP_FLAGS; + +HRESULT WINAPI +D3DStripShader(__in_bcount(BytecodeLength) LPCVOID pShaderBytecode, + __in SIZE_T BytecodeLength, + __in UINT uStripFlags, + __out LPD3DBLOB* ppStrippedBlob); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif // #ifndef __D3DCOMPILER_H__ diff --git a/Src/Decoder_H264_ALL/D3D/include/DWrite.h b/Src/Decoder_H264_ALL/D3D/include/DWrite.h new file mode 100644 index 0000000..fc3b637 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/DWrite.h @@ -0,0 +1,4995 @@ +//+-------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Abstract: +// DirectX Typography Services public API definitions. +// +//---------------------------------------------------------------------------- + +#ifndef DWRITE_H_INCLUDED +#define DWRITE_H_INCLUDED + +#if _MSC_VER > 1000 +#pragma once +#endif + +#ifndef DWRITE_NO_WINDOWS_H + +#include +#include + +#endif // DWRITE_NO_WINDOWS_H + +#include + +#ifndef DWRITE_DECLARE_INTERFACE +#define DWRITE_DECLARE_INTERFACE(iid) DECLSPEC_UUID(iid) DECLSPEC_NOVTABLE +#endif + +#ifndef DWRITE_EXPORT +#define DWRITE_EXPORT __declspec(dllimport) WINAPI +#endif + +/// +/// The type of a font represented by a single font file. +/// Font formats that consist of multiple files, e.g. Type 1 .PFM and .PFB, have +/// separate enum values for each of the file type. +/// +enum DWRITE_FONT_FILE_TYPE +{ + /// + /// Font type is not recognized by the DirectWrite font system. + /// + DWRITE_FONT_FILE_TYPE_UNKNOWN, + + /// + /// OpenType font with CFF outlines. + /// + DWRITE_FONT_FILE_TYPE_CFF, + + /// + /// OpenType font with TrueType outlines. + /// + DWRITE_FONT_FILE_TYPE_TRUETYPE, + + /// + /// OpenType font that contains a TrueType collection. + /// + DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION, + + /// + /// Type 1 PFM font. + /// + DWRITE_FONT_FILE_TYPE_TYPE1_PFM, + + /// + /// Type 1 PFB font. + /// + DWRITE_FONT_FILE_TYPE_TYPE1_PFB, + + /// + /// Vector .FON font. + /// + DWRITE_FONT_FILE_TYPE_VECTOR, + + /// + /// Bitmap .FON font. + /// + DWRITE_FONT_FILE_TYPE_BITMAP +}; + +/// +/// The file format of a complete font face. +/// Font formats that consist of multiple files, e.g. Type 1 .PFM and .PFB, have +/// a single enum entry. +/// +enum DWRITE_FONT_FACE_TYPE +{ + /// + /// OpenType font face with CFF outlines. + /// + DWRITE_FONT_FACE_TYPE_CFF, + + /// + /// OpenType font face with TrueType outlines. + /// + DWRITE_FONT_FACE_TYPE_TRUETYPE, + + /// + /// OpenType font face that is a part of a TrueType collection. + /// + DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION, + + /// + /// A Type 1 font face. + /// + DWRITE_FONT_FACE_TYPE_TYPE1, + + /// + /// A vector .FON format font face. + /// + DWRITE_FONT_FACE_TYPE_VECTOR, + + /// + /// A bitmap .FON format font face. + /// + DWRITE_FONT_FACE_TYPE_BITMAP, + + /// + /// Font face type is not recognized by the DirectWrite font system. + /// + DWRITE_FONT_FACE_TYPE_UNKNOWN +}; + +/// +/// Specifies algorithmic style simulations to be applied to the font face. +/// Bold and oblique simulations can be combined via bitwise OR operation. +/// +enum DWRITE_FONT_SIMULATIONS +{ + /// + /// No simulations are performed. + /// + DWRITE_FONT_SIMULATIONS_NONE = 0x0000, + + /// + /// Algorithmic emboldening is performed. + /// + DWRITE_FONT_SIMULATIONS_BOLD = 0x0001, + + /// + /// Algorithmic italicization is performed. + /// + DWRITE_FONT_SIMULATIONS_OBLIQUE = 0x0002 +}; + +#ifdef DEFINE_ENUM_FLAG_OPERATORS +DEFINE_ENUM_FLAG_OPERATORS(DWRITE_FONT_SIMULATIONS); +#endif + +/// +/// The font weight enumeration describes common values for degree of blackness or thickness of strokes of characters in a font. +/// Font weight values less than 1 or greater than 999 are considered to be invalid, and they are rejected by font API functions. +/// +enum DWRITE_FONT_WEIGHT +{ + /// + /// Predefined font weight : Thin (100). + /// + DWRITE_FONT_WEIGHT_THIN = 100, + + /// + /// Predefined font weight : Extra-light (200). + /// + DWRITE_FONT_WEIGHT_EXTRA_LIGHT = 200, + + /// + /// Predefined font weight : Ultra-light (200). + /// + DWRITE_FONT_WEIGHT_ULTRA_LIGHT = 200, + + /// + /// Predefined font weight : Light (300). + /// + DWRITE_FONT_WEIGHT_LIGHT = 300, + + /// + /// Predefined font weight : Normal (400). + /// + DWRITE_FONT_WEIGHT_NORMAL = 400, + + /// + /// Predefined font weight : Regular (400). + /// + DWRITE_FONT_WEIGHT_REGULAR = 400, + + /// + /// Predefined font weight : Medium (500). + /// + DWRITE_FONT_WEIGHT_MEDIUM = 500, + + /// + /// Predefined font weight : Demi-bold (600). + /// + DWRITE_FONT_WEIGHT_DEMI_BOLD = 600, + + /// + /// Predefined font weight : Semi-bold (600). + /// + DWRITE_FONT_WEIGHT_SEMI_BOLD = 600, + + /// + /// Predefined font weight : Bold (700). + /// + DWRITE_FONT_WEIGHT_BOLD = 700, + + /// + /// Predefined font weight : Extra-bold (800). + /// + DWRITE_FONT_WEIGHT_EXTRA_BOLD = 800, + + /// + /// Predefined font weight : Ultra-bold (800). + /// + DWRITE_FONT_WEIGHT_ULTRA_BOLD = 800, + + /// + /// Predefined font weight : Black (900). + /// + DWRITE_FONT_WEIGHT_BLACK = 900, + + /// + /// Predefined font weight : Heavy (900). + /// + DWRITE_FONT_WEIGHT_HEAVY = 900, + + /// + /// Predefined font weight : Extra-black (950). + /// + DWRITE_FONT_WEIGHT_EXTRA_BLACK = 950, + + /// + /// Predefined font weight : Ultra-black (950). + /// + DWRITE_FONT_WEIGHT_ULTRA_BLACK = 950 +}; + +/// +/// The font stretch enumeration describes relative change from the normal aspect ratio +/// as specified by a font designer for the glyphs in a font. +/// Values less than 1 or greater than 9 are considered to be invalid, and they are rejected by font API functions. +/// +enum DWRITE_FONT_STRETCH +{ + /// + /// Predefined font stretch : Not known (0). + /// + DWRITE_FONT_STRETCH_UNDEFINED = 0, + + /// + /// Predefined font stretch : Ultra-condensed (1). + /// + DWRITE_FONT_STRETCH_ULTRA_CONDENSED = 1, + + /// + /// Predefined font stretch : Extra-condensed (2). + /// + DWRITE_FONT_STRETCH_EXTRA_CONDENSED = 2, + + /// + /// Predefined font stretch : Condensed (3). + /// + DWRITE_FONT_STRETCH_CONDENSED = 3, + + /// + /// Predefined font stretch : Semi-condensed (4). + /// + DWRITE_FONT_STRETCH_SEMI_CONDENSED = 4, + + /// + /// Predefined font stretch : Normal (5). + /// + DWRITE_FONT_STRETCH_NORMAL = 5, + + /// + /// Predefined font stretch : Medium (5). + /// + DWRITE_FONT_STRETCH_MEDIUM = 5, + + /// + /// Predefined font stretch : Semi-expanded (6). + /// + DWRITE_FONT_STRETCH_SEMI_EXPANDED = 6, + + /// + /// Predefined font stretch : Expanded (7). + /// + DWRITE_FONT_STRETCH_EXPANDED = 7, + + /// + /// Predefined font stretch : Extra-expanded (8). + /// + DWRITE_FONT_STRETCH_EXTRA_EXPANDED = 8, + + /// + /// Predefined font stretch : Ultra-expanded (9). + /// + DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9 +}; + +/// +/// The font style enumeration describes the slope style of a font face, such as Normal, Italic or Oblique. +/// Values other than the ones defined in the enumeration are considered to be invalid, and they are rejected by font API functions. +/// +enum DWRITE_FONT_STYLE +{ + /// + /// Font slope style : Normal. + /// + DWRITE_FONT_STYLE_NORMAL, + + /// + /// Font slope style : Oblique. + /// + DWRITE_FONT_STYLE_OBLIQUE, + + /// + /// Font slope style : Italic. + /// + DWRITE_FONT_STYLE_ITALIC + +}; + +/// +/// The informational string enumeration identifies a string in a font. +/// +enum DWRITE_INFORMATIONAL_STRING_ID +{ + /// + /// Unspecified name ID. + /// + DWRITE_INFORMATIONAL_STRING_NONE, + + /// + /// Copyright notice provided by the font. + /// + DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE, + + /// + /// String containing a version number. + /// + DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS, + + /// + /// Trademark information provided by the font. + /// + DWRITE_INFORMATIONAL_STRING_TRADEMARK, + + /// + /// Name of the font manufacturer. + /// + DWRITE_INFORMATIONAL_STRING_MANUFACTURER, + + /// + /// Name of the font designer. + /// + DWRITE_INFORMATIONAL_STRING_DESIGNER, + + /// + /// URL of font designer (with protocol, e.g., http://, ftp://). + /// + DWRITE_INFORMATIONAL_STRING_DESIGNER_URL, + + /// + /// Description of the font. Can contain revision information, usage recommendations, history, features, etc. + /// + DWRITE_INFORMATIONAL_STRING_DESCRIPTION, + + /// + /// URL of font vendor (with protocol, e.g., http://, ftp://). If a unique serial number is embedded in the URL, it can be used to register the font. + /// + DWRITE_INFORMATIONAL_STRING_FONT_VENDOR_URL, + + /// + /// Description of how the font may be legally used, or different example scenarios for licensed use. This field should be written in plain language, not legalese. + /// + DWRITE_INFORMATIONAL_STRING_LICENSE_DESCRIPTION, + + /// + /// URL where additional licensing information can be found. + /// + DWRITE_INFORMATIONAL_STRING_LICENSE_INFO_URL, + + /// + /// GDI-compatible family name. Because GDI allows a maximum of four fonts per family, fonts in the same family may have different GDI-compatible family names + /// (e.g., "Arial", "Arial Narrow", "Arial Black"). + /// + DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, + + /// + /// GDI-compatible subfamily name. + /// + DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES, + + /// + /// Family name preferred by the designer. This enables font designers to group more than four fonts in a single family without losing compatibility with + /// GDI. This name is typically only present if it differs from the GDI-compatible family name. + /// + DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES, + + /// + /// Subfamily name preferred by the designer. This name is typically only present if it differs from the GDI-compatible subfamily name. + /// + DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES, + + /// + /// Sample text. This can be the font name or any other text that the designer thinks is the best example to display the font in. + /// + DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT +}; + + +/// +/// The DWRITE_FONT_METRICS structure specifies the metrics of a font face that +/// are applicable to all glyphs within the font face. +/// +struct DWRITE_FONT_METRICS +{ + /// + /// The number of font design units per em unit. + /// Font files use their own coordinate system of font design units. + /// A font design unit is the smallest measurable unit in the em square, + /// an imaginary square that is used to size and align glyphs. + /// The concept of em square is used as a reference scale factor when defining font size and device transformation semantics. + /// The size of one em square is also commonly used to compute the paragraph identation value. + /// + UINT16 designUnitsPerEm; + + /// + /// Ascent value of the font face in font design units. + /// Ascent is the distance from the top of font character alignment box to English baseline. + /// + UINT16 ascent; + + /// + /// Descent value of the font face in font design units. + /// Descent is the distance from the bottom of font character alignment box to English baseline. + /// + UINT16 descent; + + /// + /// Line gap in font design units. + /// Recommended additional white space to add between lines to improve legibility. The recommended line spacing + /// (baseline-to-baseline distance) is thus the sum of ascent, descent, and lineGap. The line gap is usually + /// positive or zero but can be negative, in which case the recommended line spacing is less than the height + /// of the character alignment box. + /// + INT16 lineGap; + + /// + /// Cap height value of the font face in font design units. + /// Cap height is the distance from English baseline to the top of a typical English capital. + /// Capital "H" is often used as a reference character for the purpose of calculating the cap height value. + /// + UINT16 capHeight; + + /// + /// x-height value of the font face in font design units. + /// x-height is the distance from English baseline to the top of lowercase letter "x", or a similar lowercase character. + /// + UINT16 xHeight; + + /// + /// The underline position value of the font face in font design units. + /// Underline position is the position of underline relative to the English baseline. + /// The value is usually made negative in order to place the underline below the baseline. + /// + INT16 underlinePosition; + + /// + /// The suggested underline thickness value of the font face in font design units. + /// + UINT16 underlineThickness; + + /// + /// The strikethrough position value of the font face in font design units. + /// Strikethrough position is the position of strikethrough relative to the English baseline. + /// The value is usually made positive in order to place the strikethrough above the baseline. + /// + INT16 strikethroughPosition; + + /// + /// The suggested strikethrough thickness value of the font face in font design units. + /// + UINT16 strikethroughThickness; +}; + +/// +/// The DWRITE_GLYPH_METRICS structure specifies the metrics of an individual glyph. +/// The units depend on how the metrics are obtained. +/// +struct DWRITE_GLYPH_METRICS +{ + /// + /// Specifies the X offset from the glyph origin to the left edge of the black box. + /// The glyph origin is the current horizontal writing position. + /// A negative value means the black box extends to the left of the origin (often true for lowercase italic 'f'). + /// + INT32 leftSideBearing; + + /// + /// Specifies the X offset from the origin of the current glyph to the origin of the next glyph when writing horizontally. + /// + UINT32 advanceWidth; + + /// + /// Specifies the X offset from the right edge of the black box to the origin of the next glyph when writing horizontally. + /// The value is negative when the right edge of the black box overhangs the layout box. + /// + INT32 rightSideBearing; + + /// + /// Specifies the vertical offset from the vertical origin to the top of the black box. + /// Thus, a positive value adds whitespace whereas a negative value means the glyph overhangs the top of the layout box. + /// + INT32 topSideBearing; + + /// + /// Specifies the Y offset from the vertical origin of the current glyph to the vertical origin of the next glyph when writing vertically. + /// (Note that the term "origin" by itself denotes the horizontal origin. The vertical origin is different. + /// Its Y coordinate is specified by verticalOriginY value, + /// and its X coordinate is half the advanceWidth to the right of the horizontal origin). + /// + UINT32 advanceHeight; + + /// + /// Specifies the vertical distance from the black box's bottom edge to the advance height. + /// Positive when the bottom edge of the black box is within the layout box. + /// Negative when the bottom edge of black box overhangs the layout box. + /// + INT32 bottomSideBearing; + + /// + /// Specifies the Y coordinate of a glyph's vertical origin, in the font's design coordinate system. + /// The y coordinate of a glyph's vertical origin is the sum of the glyph's top side bearing + /// and the top (i.e. yMax) of the glyph's bounding box. + /// + INT32 verticalOriginY; +}; + +/// +/// Optional adjustment to a glyph's position. An glyph offset changes the position of a glyph without affecting +/// the pen position. Offsets are in logical, pre-transform units. +/// +struct DWRITE_GLYPH_OFFSET +{ + /// + /// Offset in the advance direction of the run. A positive advance offset moves the glyph to the right + /// (in pre-transform coordinates) if the run is left-to-right or to the left if the run is right-to-left. + /// + FLOAT advanceOffset; + + /// + /// Offset in the ascent direction, i.e., the direction ascenders point. A positive ascender offset moves + /// the glyph up (in pre-transform coordinates). + /// + FLOAT ascenderOffset; +}; + +/// +/// Specifies the type of DirectWrite factory object. +/// DirectWrite factory contains internal state such as font loader registration and cached font data. +/// In most cases it is recommended to use the shared factory object, because it allows multiple components +/// that use DirectWrite to share internal DirectWrite state and reduce memory usage. +/// However, there are cases when it is desirable to reduce the impact of a component, +/// such as a plug-in from an untrusted source, on the rest of the process by sandboxing and isolating it +/// from the rest of the process components. In such cases, it is recommended to use an isolated factory for the sandboxed +/// component. +/// +enum DWRITE_FACTORY_TYPE +{ + /// + /// Shared factory allow for re-use of cached font data across multiple in process components. + /// Such factories also take advantage of cross process font caching components for better performance. + /// + DWRITE_FACTORY_TYPE_SHARED, + + /// + /// Objects created from the isolated factory do not interact with internal DirectWrite state from other components. + /// + DWRITE_FACTORY_TYPE_ISOLATED +}; + +// Creates an OpenType tag as a 32bit integer such that +// the first character in the tag is the lowest byte, +// (least significant on little endian architectures) +// which can be used to compare with tags in the font file. +// This macro is compatible with DWRITE_FONT_FEATURE_TAG. +// +// Example: DWRITE_MAKE_OPENTYPE_TAG('c','c','m','p') +// Dword: 0x706D6363 +// +#define DWRITE_MAKE_OPENTYPE_TAG(a,b,c,d) ( \ + (static_cast(static_cast(d)) << 24) | \ + (static_cast(static_cast(c)) << 16) | \ + (static_cast(static_cast(b)) << 8) | \ + static_cast(static_cast(a))) + +interface IDWriteFontFileStream; + +/// +/// Font file loader interface handles loading font file resources of a particular type from a key. +/// The font file loader interface is recommended to be implemented by a singleton object. +/// IMPORTANT: font file loader implementations must not register themselves with DirectWrite factory +/// inside their constructors and must not unregister themselves in their destructors, because +/// registration and unregistraton operations increment and decrement the object reference count respectively. +/// Instead, registration and unregistration of font file loaders with DirectWrite factory should be performed +/// outside of the font file loader implementation as a separate step. +/// +interface DWRITE_DECLARE_INTERFACE("727cad4e-d6af-4c9e-8a08-d695b11caa49") IDWriteFontFileLoader : public IUnknown +{ + /// + /// Creates a font file stream object that encapsulates an open file resource. + /// The resource is closed when the last reference to fontFileStream is released. + /// + /// Font file reference key that uniquely identifies the font file resource + /// within the scope of the font loader being used. + /// Size of font file reference key in bytes. + /// Pointer to the newly created font file stream. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateStreamFromKey)( + __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, + UINT32 fontFileReferenceKeySize, + __out IDWriteFontFileStream** fontFileStream + ) PURE; +}; + +/// +/// A built-in implementation of IDWriteFontFileLoader interface that operates on local font files +/// and exposes local font file information from the font file reference key. +/// Font file references created using CreateFontFileReference use this font file loader. +/// +interface DWRITE_DECLARE_INTERFACE("b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2") IDWriteLocalFontFileLoader : public IDWriteFontFileLoader +{ + /// + /// Obtains the length of the absolute file path from the font file reference key. + /// + /// Font file reference key that uniquely identifies the local font file + /// within the scope of the font loader being used. + /// Size of font file reference key in bytes. + /// Length of the file path string not including the terminated NULL character. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFilePathLengthFromKey)( + __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, + UINT32 fontFileReferenceKeySize, + __out UINT32* filePathLength + ) PURE; + + /// + /// Obtains the absolute font file path from the font file reference key. + /// + /// Font file reference key that uniquely identifies the local font file + /// within the scope of the font loader being used. + /// Size of font file reference key in bytes. + /// Character array that receives the local file path. + /// Size of the filePath array in character count including the terminated NULL character. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFilePathFromKey)( + __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, + UINT32 fontFileReferenceKeySize, + __out_ecount_z(filePathSize) WCHAR* filePath, + UINT32 filePathSize + ) PURE; + + /// + /// Obtains the last write time of the file from the font file reference key. + /// + /// Font file reference key that uniquely identifies the local font file + /// within the scope of the font loader being used. + /// Size of font file reference key in bytes. + /// Last modified time of the font file. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLastWriteTimeFromKey)( + __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, + UINT32 fontFileReferenceKeySize, + __out FILETIME* lastWriteTime + ) PURE; +}; + +/// +/// The interface for loading font file data. +/// +interface DWRITE_DECLARE_INTERFACE("6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0") IDWriteFontFileStream : public IUnknown +{ + /// + /// Reads a fragment from a file. + /// + /// Receives the pointer to the start of the font file fragment. + /// Offset of the fragment from the beginning of the font file. + /// Size of the fragment in bytes. + /// The client defined context to be passed to the ReleaseFileFragment. + /// + /// Standard HRESULT error code. + /// + /// + /// IMPORTANT: ReadFileFragment() implementations must check whether the requested file fragment + /// is within the file bounds. Otherwise, an error should be returned from ReadFileFragment. + /// + STDMETHOD(ReadFileFragment)( + __deref_out_bcount(fragmentSize) void const** fragmentStart, + UINT64 fileOffset, + UINT64 fragmentSize, + __out void** fragmentContext + ) PURE; + + /// + /// Releases a fragment from a file. + /// + /// The client defined context of a font fragment returned from ReadFileFragment. + STDMETHOD_(void, ReleaseFileFragment)( + void* fragmentContext + ) PURE; + + /// + /// Obtains the total size of a file. + /// + /// Receives the total size of the file. + /// + /// Standard HRESULT error code. + /// + /// + /// Implementing GetFileSize() for asynchronously loaded font files may require + /// downloading the complete file contents, therefore this method should only be used for operations that + /// either require complete font file to be loaded (e.g., copying a font file) or need to make + /// decisions based on the value of the file size (e.g., validation against a persisted file size). + /// + STDMETHOD(GetFileSize)( + __out UINT64* fileSize + ) PURE; + + /// + /// Obtains the last modified time of the file. The last modified time is used by DirectWrite font selection algorithms + /// to determine whether one font resource is more up to date than another one. + /// + /// Receives the last modifed time of the file in the format that represents + /// the number of 100-nanosecond intervals since January 1, 1601 (UTC). + /// + /// Standard HRESULT error code. For resources that don't have a concept of the last modified time, the implementation of + /// GetLastWriteTime should return E_NOTIMPL. + /// + STDMETHOD(GetLastWriteTime)( + __out UINT64* lastWriteTime + ) PURE; +}; + +/// +/// The interface that represents a reference to a font file. +/// +interface DWRITE_DECLARE_INTERFACE("739d886a-cef5-47dc-8769-1a8b41bebbb0") IDWriteFontFile : public IUnknown +{ + /// + /// This method obtains the pointer to the reference key of a font file. The pointer is only valid until the object that refers to it is released. + /// + /// Pointer to the font file reference key. + /// IMPORTANT: The pointer value is valid until the font file reference object it is obtained from is released. + /// Size of font file reference key in bytes. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetReferenceKey)( + __deref_out_bcount(*fontFileReferenceKeySize) void const** fontFileReferenceKey, + __out UINT32* fontFileReferenceKeySize + ) PURE; + + /// + /// Obtains the file loader associated with a font file object. + /// + /// The font file loader associated with the font file object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLoader)( + __out IDWriteFontFileLoader** fontFileLoader + ) PURE; + + /// + /// Analyzes a file and returns whether it represents a font, and whether the font type is supported by the font system. + /// + /// TRUE if the font type is supported by the font system, FALSE otherwise. + /// The type of the font file. Note that even if isSupportedFontType is FALSE, + /// the fontFileType value may be different from DWRITE_FONT_FILE_TYPE_UNKNOWN. + /// The type of the font face that can be constructed from the font file. + /// Note that even if isSupportedFontType is FALSE, the fontFaceType value may be different from + /// DWRITE_FONT_FACE_TYPE_UNKNOWN. + /// Number of font faces contained in the font file. + /// + /// Standard HRESULT error code if there was a processing error during analysis. + /// + /// + /// IMPORTANT: certain font file types are recognized, but not supported by the font system. + /// For example, the font system will recognize a file as a Type 1 font file, + /// but will not be able to construct a font face object from it. In such situations, Analyze will set + /// isSupportedFontType output parameter to FALSE. + /// + STDMETHOD(Analyze)( + __out BOOL* isSupportedFontType, + __out DWRITE_FONT_FILE_TYPE* fontFileType, + __out_opt DWRITE_FONT_FACE_TYPE* fontFaceType, + __out UINT32* numberOfFaces + ) PURE; +}; + +/// +/// Represents the internal structure of a device pixel (i.e., the physical arrangement of red, +/// green, and blue color components) that is assumed for purposes of rendering text. +/// +#ifndef DWRITE_PIXEL_GEOMETRY_DEFINED +enum DWRITE_PIXEL_GEOMETRY +{ + /// + /// The red, green, and blue color components of each pixel are assumed to occupy the same point. + /// + DWRITE_PIXEL_GEOMETRY_FLAT, + + /// + /// Each pixel comprises three vertical stripes, with red on the left, green in the center, and + /// blue on the right. This is the most common pixel geometry for LCD monitors. + /// + DWRITE_PIXEL_GEOMETRY_RGB, + + /// + /// Each pixel comprises three vertical stripes, with blue on the left, green in the center, and + /// red on the right. + /// + DWRITE_PIXEL_GEOMETRY_BGR +}; +#define DWRITE_PIXEL_GEOMETRY_DEFINED +#endif + +/// +/// Represents a method of rendering glyphs. +/// +enum DWRITE_RENDERING_MODE +{ + /// + /// Specifies that the rendering mode is determined automatically based on the font and size. + /// + DWRITE_RENDERING_MODE_DEFAULT, + + /// + /// Specifies that no anti-aliasing is performed. Each pixel is either set to the foreground + /// color of the text or retains the color of the background. + /// + DWRITE_RENDERING_MODE_ALIASED, + + /// + /// Specifies ClearType rendering with the same metrics as aliased text. Glyphs can only + /// be positioned on whole-pixel boundaries. + /// + DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC, + + /// + /// Specifies ClearType rendering with the same metrics as text rendering using GDI using a font + /// created with CLEARTYPE_NATURAL_QUALITY. Glyph metrics are closer to their ideal values than + /// with aliased text, but glyphs are still positioned on whole-pixel boundaries. + /// + DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL, + + /// + /// Specifies ClearType rendering with anti-aliasing in the horizontal dimension only. This is + /// typically used with small to medium font sizes (up to 16 ppem). + /// + DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL, + + /// + /// Specifies ClearType rendering with anti-aliasing in both horizontal and vertical dimensions. + /// This is typically used at larger sizes to makes curves and diagonal lines look smoother, at + /// the expense of some softness. + /// + DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC, + + /// + /// Specifies that rendering should bypass the rasterizer and use the outlines directly. This is + /// typically used at very large sizes. + /// + DWRITE_RENDERING_MODE_OUTLINE +}; + +/// +/// The DWRITE_MATRIX structure specifies the graphics transform to be applied +/// to rendered glyphs. +/// +struct DWRITE_MATRIX +{ + /// + /// Horizontal scaling / cosine of rotation + /// + FLOAT m11; + + /// + /// Vertical shear / sine of rotation + /// + FLOAT m12; + + /// + /// Horizontal shear / negative sine of rotation + /// + FLOAT m21; + + /// + /// Vertical scaling / cosine of rotation + /// + FLOAT m22; + + /// + /// Horizontal shift (always orthogonal regardless of rotation) + /// + FLOAT dx; + + /// + /// Vertical shift (always orthogonal regardless of rotation) + /// + FLOAT dy; +}; + +/// +/// The interface that represents text rendering settings for glyph rasterization and filtering. +/// +interface DWRITE_DECLARE_INTERFACE("2f0da53a-2add-47cd-82ee-d9ec34688e75") IDWriteRenderingParams : public IUnknown +{ + /// + /// Gets the gamma value used for gamma correction. Valid values must be + /// greater than zero and cannot exceed 256. + /// + STDMETHOD_(FLOAT, GetGamma)() PURE; + + /// + /// Gets the amount of contrast enhancement. Valid values are greater than + /// or equal to zero. + /// + STDMETHOD_(FLOAT, GetEnhancedContrast)() PURE; + + /// + /// Gets the ClearType level. Valid values range from 0.0f (no ClearType) + /// to 1.0f (full ClearType). + /// + STDMETHOD_(FLOAT, GetClearTypeLevel)() PURE; + + /// + /// Gets the pixel geometry. + /// + STDMETHOD_(DWRITE_PIXEL_GEOMETRY, GetPixelGeometry)() PURE; + + /// + /// Gets the rendering mode. + /// + STDMETHOD_(DWRITE_RENDERING_MODE, GetRenderingMode)() PURE; +}; + +// Forward declarations of D2D types +interface ID2D1SimplifiedGeometrySink; + +typedef ID2D1SimplifiedGeometrySink IDWriteGeometrySink; + +/// +/// The interface that represents an absolute reference to a font face. +/// It contains font face type, appropriate file references and face identification data. +/// Various font data such as metrics, names and glyph outlines is obtained from IDWriteFontFace. +/// +interface DWRITE_DECLARE_INTERFACE("5f49804d-7024-4d43-bfa9-d25984f53849") IDWriteFontFace : public IUnknown +{ + /// + /// Obtains the file format type of a font face. + /// + STDMETHOD_(DWRITE_FONT_FACE_TYPE, GetType)() PURE; + + /// + /// Obtains the font files representing a font face. + /// + /// The number of files representing the font face. + /// User provided array that stores pointers to font files representing the font face. + /// This parameter can be NULL if the user is only interested in the number of files representing the font face. + /// This API increments reference count of the font file pointers returned according to COM conventions, and the client + /// should release them when finished. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFiles)( + __inout UINT32* numberOfFiles, + __out_ecount_opt(*numberOfFiles) IDWriteFontFile** fontFiles + ) PURE; + + /// + /// Obtains the zero-based index of the font face in its font file or files. If the font files contain a single face, + /// the return value is zero. + /// + STDMETHOD_(UINT32, GetIndex)() PURE; + + /// + /// Obtains the algorithmic style simulation flags of a font face. + /// + STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)() PURE; + + /// + /// Determines whether the font is a symbol font. + /// + STDMETHOD_(BOOL, IsSymbolFont)() PURE; + + /// + /// Obtains design units and common metrics for the font face. + /// These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations. + /// + /// Points to a DWRITE_FONT_METRICS structure to fill in. + /// The metrics returned by this function are in font design units. + STDMETHOD_(void, GetMetrics)( + __out DWRITE_FONT_METRICS* fontFaceMetrics + ) PURE; + + /// + /// Obtains the number of glyphs in the font face. + /// + STDMETHOD_(UINT16, GetGlyphCount)() PURE; + + /// + /// Obtains ideal glyph metrics in font design units. Design glyphs metrics are used for glyph positioning. + /// + /// An array of glyph indices to compute the metrics for. + /// The number of elements in the glyphIndices array. + /// Array of DWRITE_GLYPH_METRICS structures filled by this function. + /// The metrics returned by this function are in font design units. + /// Indicates whether the font is being used in a sideways run. + /// This can affect the glyph metrics if the font has oblique simulation + /// because sideways oblique simulation differs from non-sideways oblique simulation. + /// + /// Standard HRESULT error code. If any of the input glyph indices are outside of the valid glyph index range + /// for the current font face, E_INVALIDARG will be returned. + /// + STDMETHOD(GetDesignGlyphMetrics)( + __in_ecount(glyphCount) UINT16 const* glyphIndices, + UINT32 glyphCount, + __out_ecount(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics, + BOOL isSideways = FALSE + ) PURE; + + /// + /// Returns the nominal mapping of UCS4 Unicode code points to glyph indices as defined by the font 'CMAP' table. + /// Note that this mapping is primarily provided for line layout engines built on top of the physical font API. + /// Because of OpenType glyph substitution and line layout character substitution, the nominal conversion does not always correspond + /// to how a Unicode string will map to glyph indices when rendering using a particular font face. + /// Also, note that Unicode Variant Selectors provide for alternate mappings for character to glyph. + /// This call will always return the default variant. + /// + /// An array of USC4 code points to obtain nominal glyph indices from. + /// The number of elements in the codePoints array. + /// Array of nominal glyph indices filled by this function. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetGlyphIndices)( + __in_ecount(codePointCount) UINT32 const* codePoints, + UINT32 codePointCount, + __out_ecount(codePointCount) UINT16* glyphIndices + ) PURE; + + /// + /// Finds the specified OpenType font table if it exists and returns a pointer to it. + /// The function accesses the underling font data via the IDWriteFontStream interface + /// implemented by the font file loader. + /// + /// Four character tag of table to find. + /// Use the DWRITE_MAKE_OPENTYPE_TAG() macro to create it. + /// Unlike GDI, it does not support the special TTCF and null tags to access the whole font. + /// + /// Pointer to base of table in memory. + /// The pointer is only valid so long as the FontFace used to get the font table still exists + /// (not any other FontFace, even if it actually refers to the same physical font). + /// + /// Byte size of table. + /// + /// Opaque context which must be freed by calling ReleaseFontTable. + /// The context actually comes from the lower level IDWriteFontFileStream, + /// which may be implemented by the application or DWrite itself. + /// It is possible for a NULL tableContext to be returned, especially if + /// the implementation directly memory maps the whole file. + /// Nevertheless, always release it later, and do not use it as a test for function success. + /// The same table can be queried multiple times, + /// but each returned context can be different, so release each separately. + /// + /// True if table exists. + /// + /// Standard HRESULT error code. + /// If a table can not be found, the function will not return an error, but the size will be 0, table NULL, and exists = FALSE. + /// The context does not need to be freed if the table was not found. + /// + /// + /// The context for the same tag may be different for each call, + /// so each one must be held and released separately. + /// + STDMETHOD(TryGetFontTable)( + __in UINT32 openTypeTableTag, + __deref_out_bcount(*tableSize) const void** tableData, + __out UINT32* tableSize, + __out void** tableContext, + __out BOOL* exists + ) PURE; + + /// + /// Releases the table obtained earlier from TryGetFontTable. + /// + /// Opaque context from TryGetFontTable. + /// + /// Standard HRESULT error code. + /// + STDMETHOD_(void, ReleaseFontTable)( + __in void* tableContext + ) PURE; + + /// + /// Computes the outline of a run of glyphs by calling back to the outline sink interface. + /// + /// Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch. + /// Array of glyph indices. + /// Optional array of glyph advances in DIPs. + /// Optional array of glyph offsets. + /// Number of glyphs. + /// If true, specifies that glyphs are rotated 90 degrees to the left and vertical metrics are used. + /// A client can render a vertical run by specifying isSideways = true and rotating the resulting geometry 90 degrees to the + /// right using a transform. The isSideways and isRightToLeft parameters cannot both be true. + /// If true, specifies that the advance direction is right to left. By default, the advance direction + /// is left to right. + /// Interface the function calls back to draw each element of the geometry. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetGlyphRunOutline)( + FLOAT emSize, + __in_ecount(glyphCount) UINT16 const* glyphIndices, + __in_ecount_opt(glyphCount) FLOAT const* glyphAdvances, + __in_ecount_opt(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets, + UINT32 glyphCount, + BOOL isSideways, + BOOL isRightToLeft, + IDWriteGeometrySink* geometrySink + ) PURE; + + /// + /// Determines the recommended rendering mode for the font given the specified size and rendering parameters. + /// + /// Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch. + /// Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this + /// value is 1.0f. If the DPI is 120, this value is 120.0f/96. + /// Specifies measuring method that will be used for glyphs in the font. + /// Renderer implementations may choose different rendering modes for given measuring methods, but + /// best results are seen when the corresponding modes match: + /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL + /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC + /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL + /// + /// Rendering parameters object. This parameter is necessary in case the rendering parameters + /// object overrides the rendering mode. + /// Receives the recommended rendering mode to use. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetRecommendedRenderingMode)( + FLOAT emSize, + FLOAT pixelsPerDip, + DWRITE_MEASURING_MODE measuringMode, + IDWriteRenderingParams* renderingParams, + __out DWRITE_RENDERING_MODE* renderingMode + ) PURE; + + /// + /// Obtains design units and common metrics for the font face. + /// These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations. + /// + /// Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch. + /// Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this + /// value is 1.0f. If the DPI is 120, this value is 120.0f/96. + /// Optional transform applied to the glyphs and their positions. This transform is applied after the + /// scaling specified by the font size and pixelsPerDip. + /// Points to a DWRITE_FONT_METRICS structure to fill in. + /// The metrics returned by this function are in font design units. + STDMETHOD(GetGdiCompatibleMetrics)( + FLOAT emSize, + FLOAT pixelsPerDip, + __in_opt DWRITE_MATRIX const* transform, + __out DWRITE_FONT_METRICS* fontFaceMetrics + ) PURE; + + + /// + /// Obtains glyph metrics in font design units with the return values compatible with what GDI would produce. + /// Glyphs metrics are used for positioning of individual glyphs. + /// + /// Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch. + /// Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this + /// value is 1.0f. If the DPI is 120, this value is 120.0f/96. + /// Optional transform applied to the glyphs and their positions. This transform is applied after the + /// scaling specified by the font size and pixelsPerDip. + /// + /// When set to FALSE, the metrics are the same as the metrics of GDI aliased text. + /// When set to TRUE, the metrics are the same as the metrics of text measured by GDI using a font + /// created with CLEARTYPE_NATURAL_QUALITY. + /// + /// An array of glyph indices to compute the metrics for. + /// The number of elements in the glyphIndices array. + /// Array of DWRITE_GLYPH_METRICS structures filled by this function. + /// The metrics returned by this function are in font design units. + /// Indicates whether the font is being used in a sideways run. + /// This can affect the glyph metrics if the font has oblique simulation + /// because sideways oblique simulation differs from non-sideways oblique simulation. + /// + /// Standard HRESULT error code. If any of the input glyph indices are outside of the valid glyph index range + /// for the current font face, E_INVALIDARG will be returned. + /// + STDMETHOD(GetGdiCompatibleGlyphMetrics)( + FLOAT emSize, + FLOAT pixelsPerDip, + __in_opt DWRITE_MATRIX const* transform, + BOOL useGdiNatural, + __in_ecount(glyphCount) UINT16 const* glyphIndices, + UINT32 glyphCount, + __out_ecount(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics, + BOOL isSideways = FALSE + ) PURE; +}; + +interface IDWriteFactory; +interface IDWriteFontFileEnumerator; + +/// +/// The font collection loader interface is used to construct a collection of fonts given a particular type of key. +/// The font collection loader interface is recommended to be implemented by a singleton object. +/// IMPORTANT: font collection loader implementations must not register themselves with a DirectWrite factory +/// inside their constructors and must not unregister themselves in their destructors, because +/// registration and unregistraton operations increment and decrement the object reference count respectively. +/// Instead, registration and unregistration of font file loaders with DirectWrite factory should be performed +/// outside of the font file loader implementation as a separate step. +/// +interface DWRITE_DECLARE_INTERFACE("cca920e4-52f0-492b-bfa8-29c72ee0a468") IDWriteFontCollectionLoader : public IUnknown +{ + /// + /// Creates a font file enumerator object that encapsulates a collection of font files. + /// The font system calls back to this interface to create a font collection. + /// + /// Factory associated with the loader. + /// Font collection key that uniquely identifies the collection of font files within + /// the scope of the font collection loader being used. + /// Size of the font collection key in bytes. + /// Pointer to the newly created font file enumerator. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateEnumeratorFromKey)( + IDWriteFactory* factory, + __in_bcount(collectionKeySize) void const* collectionKey, + UINT32 collectionKeySize, + __out IDWriteFontFileEnumerator** fontFileEnumerator + ) PURE; +}; + +/// +/// The font file enumerator interface encapsulates a collection of font files. The font system uses this interface +/// to enumerate font files when building a font collection. +/// +interface DWRITE_DECLARE_INTERFACE("72755049-5ff7-435d-8348-4be97cfa6c7c") IDWriteFontFileEnumerator : public IUnknown +{ + /// + /// Advances to the next font file in the collection. When it is first created, the enumerator is positioned + /// before the first element of the collection and the first call to MoveNext advances to the first file. + /// + /// Receives the value TRUE if the enumerator advances to a file, or FALSE if + /// the enumerator advanced past the last file in the collection. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(MoveNext)( + __out BOOL* hasCurrentFile + ) PURE; + + /// + /// Gets a reference to the current font file. + /// + /// Pointer to the newly created font file object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetCurrentFontFile)( + __out IDWriteFontFile** fontFile + ) PURE; +}; + +/// +/// Represents a collection of strings indexed by locale name. +/// +interface DWRITE_DECLARE_INTERFACE("08256209-099a-4b34-b86d-c22b110e7771") IDWriteLocalizedStrings : public IUnknown +{ + /// + /// Gets the number of language/string pairs. + /// + STDMETHOD_(UINT32, GetCount)() PURE; + + /// + /// Gets the index of the item with the specified locale name. + /// + /// Locale name to look for. + /// Receives the zero-based index of the locale name/string pair. + /// Receives TRUE if the locale name exists or FALSE if not. + /// + /// Standard HRESULT error code. If the specified locale name does not exist, the return value is S_OK, + /// but *index is UINT_MAX and *exists is FALSE. + /// + STDMETHOD(FindLocaleName)( + __in_z WCHAR const* localeName, + __out UINT32* index, + __out BOOL* exists + ) PURE; + + /// + /// Gets the length in characters (not including the null terminator) of the locale name with the specified index. + /// + /// Zero-based index of the locale name. + /// Receives the length in characters, not including the null terminator. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLocaleNameLength)( + UINT32 index, + __out UINT32* length + ) PURE; + + /// + /// Copies the locale name with the specified index to the specified array. + /// + /// Zero-based index of the locale name. + /// Character array that receives the locale name. + /// Size of the array in characters. The size must include space for the terminating + /// null character. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLocaleName)( + UINT32 index, + __out_ecount_z(size) WCHAR* localeName, + UINT32 size + ) PURE; + + /// + /// Gets the length in characters (not including the null terminator) of the string with the specified index. + /// + /// Zero-based index of the string. + /// Receives the length in characters, not including the null terminator. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetStringLength)( + UINT32 index, + __out UINT32* length + ) PURE; + + /// + /// Copies the string with the specified index to the specified array. + /// + /// Zero-based index of the string. + /// Character array that receives the string. + /// Size of the array in characters. The size must include space for the terminating + /// null character. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetString)( + UINT32 index, + __out_ecount_z(size) WCHAR* stringBuffer, + UINT32 size + ) PURE; +}; + +interface IDWriteFontFamily; +interface IDWriteFont; + +/// +/// The IDWriteFontCollection encapsulates a collection of fonts. +/// +interface DWRITE_DECLARE_INTERFACE("a84cee02-3eea-4eee-a827-87c1a02a0fcc") IDWriteFontCollection : public IUnknown +{ + /// + /// Gets the number of font families in the collection. + /// + STDMETHOD_(UINT32, GetFontFamilyCount)() PURE; + + /// + /// Creates a font family object given a zero-based font family index. + /// + /// Zero-based index of the font family. + /// Receives a pointer the newly created font family object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontFamily)( + UINT32 index, + __out IDWriteFontFamily** fontFamily + ) PURE; + + /// + /// Finds the font family with the specified family name. + /// + /// Name of the font family. The name is not case-sensitive but must otherwise exactly match a family name in the collection. + /// Receives the zero-based index of the matching font family if the family name was found or UINT_MAX otherwise. + /// Receives TRUE if the family name exists or FALSE otherwise. + /// + /// Standard HRESULT error code. If the specified family name does not exist, the return value is S_OK, but *index is UINT_MAX and *exists is FALSE. + /// + STDMETHOD(FindFamilyName)( + __in_z WCHAR const* familyName, + __out UINT32* index, + __out BOOL* exists + ) PURE; + + /// + /// Gets the font object that corresponds to the same physical font as the specified font face object. The specified physical font must belong + /// to the font collection. + /// + /// Font face object that specifies the physical font. + /// Receives a pointer to the newly created font object if successful or NULL otherwise. + /// + /// Standard HRESULT error code. If the specified physical font is not part of the font collection the return value is DWRITE_E_NOFONT. + /// + STDMETHOD(GetFontFromFontFace)( + IDWriteFontFace* fontFace, + __out IDWriteFont** font + ) PURE; +}; + +/// +/// The IDWriteFontList interface represents a list of fonts. +/// +interface DWRITE_DECLARE_INTERFACE("1a0d8438-1d97-4ec1-aef9-a2fb86ed6acb") IDWriteFontList : public IUnknown +{ + /// + /// Gets the font collection that contains the fonts. + /// + /// Receives a pointer to the font collection object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontCollection)( + __out IDWriteFontCollection** fontCollection + ) PURE; + + /// + /// Gets the number of fonts in the font list. + /// + STDMETHOD_(UINT32, GetFontCount)() PURE; + + /// + /// Gets a font given its zero-based index. + /// + /// Zero-based index of the font in the font list. + /// Receives a pointer to the newly created font object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFont)( + UINT32 index, + __out IDWriteFont** font + ) PURE; +}; + +/// +/// The IDWriteFontFamily interface represents a set of fonts that share the same design but are differentiated +/// by weight, stretch, and style. +/// +interface DWRITE_DECLARE_INTERFACE("da20d8ef-812a-4c43-9802-62ec4abd7add") IDWriteFontFamily : public IDWriteFontList +{ + /// + /// Creates an localized strings object that contains the family names for the font family, indexed by locale name. + /// + /// Receives a pointer to the newly created localized strings object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFamilyNames)( + __out IDWriteLocalizedStrings** names + ) PURE; + + /// + /// Gets the font that best matches the specified properties. + /// + /// Requested font weight. + /// Requested font stretch. + /// Requested font style. + /// Receives a pointer to the newly created font object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFirstMatchingFont)( + DWRITE_FONT_WEIGHT weight, + DWRITE_FONT_STRETCH stretch, + DWRITE_FONT_STYLE style, + __out IDWriteFont** matchingFont + ) PURE; + + /// + /// Gets a list of fonts in the font family ranked in order of how well they match the specified properties. + /// + /// Requested font weight. + /// Requested font stretch. + /// Requested font style. + /// Receives a pointer to the newly created font list object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetMatchingFonts)( + DWRITE_FONT_WEIGHT weight, + DWRITE_FONT_STRETCH stretch, + DWRITE_FONT_STYLE style, + __out IDWriteFontList** matchingFonts + ) PURE; +}; + +/// +/// The IDWriteFont interface represents a physical font in a font collection. +/// +interface DWRITE_DECLARE_INTERFACE("acd16696-8c14-4f5d-877e-fe3fc1d32737") IDWriteFont : public IUnknown +{ + /// + /// Gets the font family to which the specified font belongs. + /// + /// Receives a pointer to the font family object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontFamily)( + __out IDWriteFontFamily** fontFamily + ) PURE; + + /// + /// Gets the weight of the specified font. + /// + STDMETHOD_(DWRITE_FONT_WEIGHT, GetWeight)() PURE; + + /// + /// Gets the stretch (aka. width) of the specified font. + /// + STDMETHOD_(DWRITE_FONT_STRETCH, GetStretch)() PURE; + + /// + /// Gets the style (aka. slope) of the specified font. + /// + STDMETHOD_(DWRITE_FONT_STYLE, GetStyle)() PURE; + + /// + /// Returns TRUE if the font is a symbol font or FALSE if not. + /// + STDMETHOD_(BOOL, IsSymbolFont)() PURE; + + /// + /// Gets a localized strings collection containing the face names for the font (e.g., Regular or Bold), indexed by locale name. + /// + /// Receives a pointer to the newly created localized strings object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFaceNames)( + __out IDWriteLocalizedStrings** names + ) PURE; + + /// + /// Gets a localized strings collection containing the specified informational strings, indexed by locale name. + /// + /// Identifies the string to get. + /// Receives a pointer to the newly created localized strings object. + /// Receives the value TRUE if the font contains the specified string ID or FALSE if not. + /// + /// Standard HRESULT error code. If the font does not contain the specified string, the return value is S_OK but + /// informationalStrings receives a NULL pointer and exists receives the value FALSE. + /// + STDMETHOD(GetInformationalStrings)( + DWRITE_INFORMATIONAL_STRING_ID informationalStringID, + __out IDWriteLocalizedStrings** informationalStrings, + __out BOOL* exists + ) PURE; + + /// + /// Gets a value that indicates what simulation are applied to the specified font. + /// + STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)() PURE; + + /// + /// Gets the metrics for the font. + /// + /// Receives the font metrics. + STDMETHOD_(void, GetMetrics)( + __out DWRITE_FONT_METRICS* fontMetrics + ) PURE; + + /// + /// Determines whether the font supports the specified character. + /// + /// Unicode (UCS-4) character value. + /// Receives the value TRUE if the font supports the specified character or FALSE if not. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(HasCharacter)( + UINT32 unicodeValue, + __out BOOL* exists + ) PURE; + + /// + /// Creates a font face object for the font. + /// + /// Receives a pointer to the newly created font face object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateFontFace)( + __out IDWriteFontFace** fontFace + ) PURE; +}; + +/// +/// Direction for how reading progresses. +/// +enum DWRITE_READING_DIRECTION +{ + /// + /// Reading progresses from left to right. + /// + DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, + + /// + /// Reading progresses from right to left. + /// + DWRITE_READING_DIRECTION_RIGHT_TO_LEFT +}; + +/// +/// Direction for how lines of text are placed relative to one another. +/// +enum DWRITE_FLOW_DIRECTION +{ + /// + /// Text lines are placed from top to bottom. + /// + DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM +}; + +/// +/// Alignment of paragraph text along the reading direction axis relative to +/// the leading and trailing edge of the layout box. +/// +enum DWRITE_TEXT_ALIGNMENT +{ + /// + /// The leading edge of the paragraph text is aligned to the layout box's leading edge. + /// + DWRITE_TEXT_ALIGNMENT_LEADING, + + /// + /// The trailing edge of the paragraph text is aligned to the layout box's trailing edge. + /// + DWRITE_TEXT_ALIGNMENT_TRAILING, + + /// + /// The center of the paragraph text is aligned to the center of the layout box. + /// + DWRITE_TEXT_ALIGNMENT_CENTER +}; + +/// +/// Alignment of paragraph text along the flow direction axis relative to the +/// flow's beginning and ending edge of the layout box. +/// +enum DWRITE_PARAGRAPH_ALIGNMENT +{ + /// + /// The first line of paragraph is aligned to the flow's beginning edge of the layout box. + /// + DWRITE_PARAGRAPH_ALIGNMENT_NEAR, + + /// + /// The last line of paragraph is aligned to the flow's ending edge of the layout box. + /// + DWRITE_PARAGRAPH_ALIGNMENT_FAR, + + /// + /// The center of the paragraph is aligned to the center of the flow of the layout box. + /// + DWRITE_PARAGRAPH_ALIGNMENT_CENTER +}; + +/// +/// Word wrapping in multiline paragraph. +/// +enum DWRITE_WORD_WRAPPING +{ + /// + /// Words are broken across lines to avoid text overflowing the layout box. + /// + DWRITE_WORD_WRAPPING_WRAP, + + /// + /// Words are kept within the same line even when it overflows the layout box. + /// This option is often used with scrolling to reveal overflow text. + /// + DWRITE_WORD_WRAPPING_NO_WRAP +}; + +/// +/// The method used for line spacing in layout. +/// +enum DWRITE_LINE_SPACING_METHOD +{ + /// + /// Line spacing depends solely on the content, growing to accomodate the size of fonts and inline objects. + /// + DWRITE_LINE_SPACING_METHOD_DEFAULT, + + /// + /// Lines are explicitly set to uniform spacing, regardless of contained font sizes. + /// This can be useful to avoid the uneven appearance that can occur from font fallback. + /// + DWRITE_LINE_SPACING_METHOD_UNIFORM +}; + +/// +/// Text granularity used to trim text overflowing the layout box. +/// +enum DWRITE_TRIMMING_GRANULARITY +{ + /// + /// No trimming occurs. Text flows beyond the layout width. + /// + DWRITE_TRIMMING_GRANULARITY_NONE, + + /// + /// Trimming occurs at character cluster boundary. + /// + DWRITE_TRIMMING_GRANULARITY_CHARACTER, + + /// + /// Trimming occurs at word boundary. + /// + DWRITE_TRIMMING_GRANULARITY_WORD +}; + +/// +/// Typographic feature of text supplied by the font. +/// +enum DWRITE_FONT_FEATURE_TAG +{ + DWRITE_FONT_FEATURE_TAG_ALTERNATIVE_FRACTIONS = 0x63726661, // 'afrc' + DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS_FROM_CAPITALS = 0x63703263, // 'c2pc' + DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS_FROM_CAPITALS = 0x63733263, // 'c2sc' + DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_ALTERNATES = 0x746c6163, // 'calt' + DWRITE_FONT_FEATURE_TAG_CASE_SENSITIVE_FORMS = 0x65736163, // 'case' + DWRITE_FONT_FEATURE_TAG_GLYPH_COMPOSITION_DECOMPOSITION = 0x706d6363, // 'ccmp' + DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_LIGATURES = 0x67696c63, // 'clig' + DWRITE_FONT_FEATURE_TAG_CAPITAL_SPACING = 0x70737063, // 'cpsp' + DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_SWASH = 0x68777363, // 'cswh' + DWRITE_FONT_FEATURE_TAG_CURSIVE_POSITIONING = 0x73727563, // 'curs' + DWRITE_FONT_FEATURE_TAG_DEFAULT = 0x746c6664, // 'dflt' + DWRITE_FONT_FEATURE_TAG_DISCRETIONARY_LIGATURES = 0x67696c64, // 'dlig' + DWRITE_FONT_FEATURE_TAG_EXPERT_FORMS = 0x74707865, // 'expt' + DWRITE_FONT_FEATURE_TAG_FRACTIONS = 0x63617266, // 'frac' + DWRITE_FONT_FEATURE_TAG_FULL_WIDTH = 0x64697766, // 'fwid' + DWRITE_FONT_FEATURE_TAG_HALF_FORMS = 0x666c6168, // 'half' + DWRITE_FONT_FEATURE_TAG_HALANT_FORMS = 0x6e6c6168, // 'haln' + DWRITE_FONT_FEATURE_TAG_ALTERNATE_HALF_WIDTH = 0x746c6168, // 'halt' + DWRITE_FONT_FEATURE_TAG_HISTORICAL_FORMS = 0x74736968, // 'hist' + DWRITE_FONT_FEATURE_TAG_HORIZONTAL_KANA_ALTERNATES = 0x616e6b68, // 'hkna' + DWRITE_FONT_FEATURE_TAG_HISTORICAL_LIGATURES = 0x67696c68, // 'hlig' + DWRITE_FONT_FEATURE_TAG_HALF_WIDTH = 0x64697768, // 'hwid' + DWRITE_FONT_FEATURE_TAG_HOJO_KANJI_FORMS = 0x6f6a6f68, // 'hojo' + DWRITE_FONT_FEATURE_TAG_JIS04_FORMS = 0x3430706a, // 'jp04' + DWRITE_FONT_FEATURE_TAG_JIS78_FORMS = 0x3837706a, // 'jp78' + DWRITE_FONT_FEATURE_TAG_JIS83_FORMS = 0x3338706a, // 'jp83' + DWRITE_FONT_FEATURE_TAG_JIS90_FORMS = 0x3039706a, // 'jp90' + DWRITE_FONT_FEATURE_TAG_KERNING = 0x6e72656b, // 'kern' + DWRITE_FONT_FEATURE_TAG_STANDARD_LIGATURES = 0x6167696c, // 'liga' + DWRITE_FONT_FEATURE_TAG_LINING_FIGURES = 0x6d756e6c, // 'lnum' + DWRITE_FONT_FEATURE_TAG_LOCALIZED_FORMS = 0x6c636f6c, // 'locl' + DWRITE_FONT_FEATURE_TAG_MARK_POSITIONING = 0x6b72616d, // 'mark' + DWRITE_FONT_FEATURE_TAG_MATHEMATICAL_GREEK = 0x6b72676d, // 'mgrk' + DWRITE_FONT_FEATURE_TAG_MARK_TO_MARK_POSITIONING = 0x6b6d6b6d, // 'mkmk' + DWRITE_FONT_FEATURE_TAG_ALTERNATE_ANNOTATION_FORMS = 0x746c616e, // 'nalt' + DWRITE_FONT_FEATURE_TAG_NLC_KANJI_FORMS = 0x6b636c6e, // 'nlck' + DWRITE_FONT_FEATURE_TAG_OLD_STYLE_FIGURES = 0x6d756e6f, // 'onum' + DWRITE_FONT_FEATURE_TAG_ORDINALS = 0x6e64726f, // 'ordn' + DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_ALTERNATE_WIDTH = 0x746c6170, // 'palt' + DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS = 0x70616370, // 'pcap' + DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_FIGURES = 0x6d756e70, // 'pnum' + DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_WIDTHS = 0x64697770, // 'pwid' + DWRITE_FONT_FEATURE_TAG_QUARTER_WIDTHS = 0x64697771, // 'qwid' + DWRITE_FONT_FEATURE_TAG_REQUIRED_LIGATURES = 0x67696c72, // 'rlig' + DWRITE_FONT_FEATURE_TAG_RUBY_NOTATION_FORMS = 0x79627572, // 'ruby' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_ALTERNATES = 0x746c6173, // 'salt' + DWRITE_FONT_FEATURE_TAG_SCIENTIFIC_INFERIORS = 0x666e6973, // 'sinf' + DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS = 0x70636d73, // 'smcp' + DWRITE_FONT_FEATURE_TAG_SIMPLIFIED_FORMS = 0x6c706d73, // 'smpl' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_1 = 0x31307373, // 'ss01' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_2 = 0x32307373, // 'ss02' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_3 = 0x33307373, // 'ss03' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_4 = 0x34307373, // 'ss04' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_5 = 0x35307373, // 'ss05' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_6 = 0x36307373, // 'ss06' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_7 = 0x37307373, // 'ss07' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_8 = 0x38307373, // 'ss08' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_9 = 0x39307373, // 'ss09' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_10 = 0x30317373, // 'ss10' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_11 = 0x31317373, // 'ss11' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_12 = 0x32317373, // 'ss12' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_13 = 0x33317373, // 'ss13' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_14 = 0x34317373, // 'ss14' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_15 = 0x35317373, // 'ss15' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_16 = 0x36317373, // 'ss16' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_17 = 0x37317373, // 'ss17' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_18 = 0x38317373, // 'ss18' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_19 = 0x39317373, // 'ss19' + DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_20 = 0x30327373, // 'ss20' + DWRITE_FONT_FEATURE_TAG_SUBSCRIPT = 0x73627573, // 'subs' + DWRITE_FONT_FEATURE_TAG_SUPERSCRIPT = 0x73707573, // 'sups' + DWRITE_FONT_FEATURE_TAG_SWASH = 0x68737773, // 'swsh' + DWRITE_FONT_FEATURE_TAG_TITLING = 0x6c746974, // 'titl' + DWRITE_FONT_FEATURE_TAG_TRADITIONAL_NAME_FORMS = 0x6d616e74, // 'tnam' + DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES = 0x6d756e74, // 'tnum' + DWRITE_FONT_FEATURE_TAG_TRADITIONAL_FORMS = 0x64617274, // 'trad' + DWRITE_FONT_FEATURE_TAG_THIRD_WIDTHS = 0x64697774, // 'twid' + DWRITE_FONT_FEATURE_TAG_UNICASE = 0x63696e75, // 'unic' + DWRITE_FONT_FEATURE_TAG_SLASHED_ZERO = 0x6f72657a, // 'zero' +}; + +/// +/// The DWRITE_TEXT_RANGE structure specifies a range of text positions where format is applied. +/// +struct DWRITE_TEXT_RANGE +{ + /// + /// The start text position of the range. + /// + UINT32 startPosition; + + /// + /// The number of text positions in the range. + /// + UINT32 length; +}; + +/// +/// The DWRITE_FONT_FEATURE structure specifies properties used to identify and execute typographic feature in the font. +/// +struct DWRITE_FONT_FEATURE +{ + /// + /// The feature OpenType name identifier. + /// + DWRITE_FONT_FEATURE_TAG nameTag; + + /// + /// Execution parameter of the feature. + /// + /// + /// The parameter should be non-zero to enable the feature. Once enabled, a feature can't be disabled again within + /// the same range. Features requiring a selector use this value to indicate the selector index. + /// + UINT32 parameter; +}; + +/// +/// Defines a set of typographic features to be applied during shaping. +/// Notice the character range which this feature list spans is specified +/// as a separate parameter to GetGlyphs. +/// +struct DWRITE_TYPOGRAPHIC_FEATURES +{ + /// + /// Array of font features. + /// + __field_ecount(featureCount) DWRITE_FONT_FEATURE* features; + + /// + /// The number of features. + /// + UINT32 featureCount; +}; + +/// +/// The DWRITE_TRIMMING structure specifies the trimming option for text overflowing the layout box. +/// +struct DWRITE_TRIMMING +{ + /// + /// Text granularity of which trimming applies. + /// + DWRITE_TRIMMING_GRANULARITY granularity; + + /// + /// Character code used as the delimiter signaling the beginning of the portion of text to be preserved, + /// most useful for path ellipsis, where the delimeter would be a slash. + /// + UINT32 delimiter; + + /// + /// How many occurences of the delimiter to step back. + /// + UINT32 delimiterCount; +}; + + +interface IDWriteTypography; +interface IDWriteInlineObject; + +/// +/// The format of text used for text layout purpose. +/// +/// +/// This object may not be thread-safe and it may carry the state of text format change. +/// +interface DWRITE_DECLARE_INTERFACE("9c906818-31d7-4fd3-a151-7c5e225db55a") IDWriteTextFormat : public IUnknown +{ + /// + /// Set alignment option of text relative to layout box's leading and trailing edge. + /// + /// Text alignment option + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetTextAlignment)( + DWRITE_TEXT_ALIGNMENT textAlignment + ) PURE; + + /// + /// Set alignment option of paragraph relative to layout box's top and bottom edge. + /// + /// Paragraph alignment option + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetParagraphAlignment)( + DWRITE_PARAGRAPH_ALIGNMENT paragraphAlignment + ) PURE; + + /// + /// Set word wrapping option. + /// + /// Word wrapping option + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetWordWrapping)( + DWRITE_WORD_WRAPPING wordWrapping + ) PURE; + + /// + /// Set paragraph reading direction. + /// + /// Text reading direction + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetReadingDirection)( + DWRITE_READING_DIRECTION readingDirection + ) PURE; + + /// + /// Set paragraph flow direction. + /// + /// Paragraph flow direction + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetFlowDirection)( + DWRITE_FLOW_DIRECTION flowDirection + ) PURE; + + /// + /// Set incremental tab stop position. + /// + /// The incremental tab stop value + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetIncrementalTabStop)( + FLOAT incrementalTabStop + ) PURE; + + /// + /// Set trimming options for any trailing text exceeding the layout width + /// or for any far text exceeding the layout height. + /// + /// Text trimming options. + /// Application-defined omission sign. This parameter may be NULL if no trimming sign is desired. + /// + /// Any inline object can be used for the trimming sign, but CreateEllipsisTrimmingSign + /// provides a typical ellipsis symbol. Trimming is also useful vertically for hiding + /// partial lines. + /// + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetTrimming)( + __in DWRITE_TRIMMING const* trimmingOptions, + IDWriteInlineObject* trimmingSign + ) PURE; + + /// + /// Set line spacing. + /// + /// How to determine line height. + /// The line height, or rather distance between one baseline to another. + /// Distance from top of line to baseline. A reasonable ratio to lineSpacing is 80%. + /// + /// For the default method, spacing depends solely on the content. + /// For uniform spacing, the given line height will override the content. + /// + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetLineSpacing)( + DWRITE_LINE_SPACING_METHOD lineSpacingMethod, + FLOAT lineSpacing, + FLOAT baseline + ) PURE; + + /// + /// Get alignment option of text relative to layout box's leading and trailing edge. + /// + STDMETHOD_(DWRITE_TEXT_ALIGNMENT, GetTextAlignment)() PURE; + + /// + /// Get alignment option of paragraph relative to layout box's top and bottom edge. + /// + STDMETHOD_(DWRITE_PARAGRAPH_ALIGNMENT, GetParagraphAlignment)() PURE; + + /// + /// Get word wrapping option. + /// + STDMETHOD_(DWRITE_WORD_WRAPPING, GetWordWrapping)() PURE; + + /// + /// Get paragraph reading direction. + /// + STDMETHOD_(DWRITE_READING_DIRECTION, GetReadingDirection)() PURE; + + /// + /// Get paragraph flow direction. + /// + STDMETHOD_(DWRITE_FLOW_DIRECTION, GetFlowDirection)() PURE; + + /// + /// Get incremental tab stop position. + /// + STDMETHOD_(FLOAT, GetIncrementalTabStop)() PURE; + + /// + /// Get trimming options for text overflowing the layout width. + /// + /// Text trimming options. + /// Trimming omission sign. This parameter may be NULL. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetTrimming)( + __out DWRITE_TRIMMING* trimmingOptions, + __out IDWriteInlineObject** trimmingSign + ) PURE; + + /// + /// Get line spacing. + /// + /// How line height is determined. + /// The line height, or rather distance between one baseline to another. + /// Distance from top of line to baseline. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLineSpacing)( + __out DWRITE_LINE_SPACING_METHOD* lineSpacingMethod, + __out FLOAT* lineSpacing, + __out FLOAT* baseline + ) PURE; + + /// + /// Get the font collection. + /// + /// The current font collection. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontCollection)( + __out IDWriteFontCollection** fontCollection + ) PURE; + + /// + /// Get the length of the font family name, in characters, not including the terminating NULL character. + /// + STDMETHOD_(UINT32, GetFontFamilyNameLength)() PURE; + + /// + /// Get a copy of the font family name. + /// + /// Character array that receives the current font family name + /// Size of the character array in character count including the terminated NULL character. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontFamilyName)( + __out_ecount_z(nameSize) WCHAR* fontFamilyName, + UINT32 nameSize + ) PURE; + + /// + /// Get the font weight. + /// + STDMETHOD_(DWRITE_FONT_WEIGHT, GetFontWeight)() PURE; + + /// + /// Get the font style. + /// + STDMETHOD_(DWRITE_FONT_STYLE, GetFontStyle)() PURE; + + /// + /// Get the font stretch. + /// + STDMETHOD_(DWRITE_FONT_STRETCH, GetFontStretch)() PURE; + + /// + /// Get the font em height. + /// + STDMETHOD_(FLOAT, GetFontSize)() PURE; + + /// + /// Get the length of the locale name, in characters, not including the terminating NULL character. + /// + STDMETHOD_(UINT32, GetLocaleNameLength)() PURE; + + /// + /// Get a copy of the locale name. + /// + /// Character array that receives the current locale name + /// Size of the character array in character count including the terminated NULL character. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLocaleName)( + __out_ecount_z(nameSize) WCHAR* localeName, + UINT32 nameSize + ) PURE; +}; + + +/// +/// Font typography setting. +/// +interface DWRITE_DECLARE_INTERFACE("55f1112b-1dc2-4b3c-9541-f46894ed85b6") IDWriteTypography : public IUnknown +{ + /// + /// Add font feature. + /// + /// The font feature to add. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(AddFontFeature)( + DWRITE_FONT_FEATURE fontFeature + ) PURE; + + /// + /// Get the number of font features. + /// + STDMETHOD_(UINT32, GetFontFeatureCount)() PURE; + + /// + /// Get the font feature at the specified index. + /// + /// The zero-based index of the font feature to get. + /// The font feature. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontFeature)( + UINT32 fontFeatureIndex, + __out DWRITE_FONT_FEATURE* fontFeature + ) PURE; +}; + +enum DWRITE_SCRIPT_SHAPES +{ + /// + /// No additional shaping requirement. Text is shaped with the writing system default behavior. + /// + DWRITE_SCRIPT_SHAPES_DEFAULT = 0, + + /// + /// Text should leave no visual on display i.e. control or format control characters. + /// + DWRITE_SCRIPT_SHAPES_NO_VISUAL = 1 +}; + +#ifdef DEFINE_ENUM_FLAG_OPERATORS +DEFINE_ENUM_FLAG_OPERATORS(DWRITE_SCRIPT_SHAPES); +#endif + +/// +/// Association of text and its writing system script as well as some display attributes. +/// +struct DWRITE_SCRIPT_ANALYSIS +{ + /// + /// Zero-based index representation of writing system script. + /// + UINT16 script; + + /// + /// Additional shaping requirement of text. + /// + DWRITE_SCRIPT_SHAPES shapes; +}; + +/// +/// Condition at the edges of inline object or text used to determine +/// line-breaking behavior. +/// +enum DWRITE_BREAK_CONDITION +{ + /// + /// Whether a break is allowed is determined by the condition of the + /// neighboring text span or inline object. + /// + DWRITE_BREAK_CONDITION_NEUTRAL, + + /// + /// A break is allowed, unless overruled by the condition of the + /// neighboring text span or inline object, either prohibited by a + /// May Not or forced by a Must. + /// + DWRITE_BREAK_CONDITION_CAN_BREAK, + + /// + /// There should be no break, unless overruled by a Must condition from + /// the neighboring text span or inline object. + /// + DWRITE_BREAK_CONDITION_MAY_NOT_BREAK, + + /// + /// The break must happen, regardless of the condition of the adjacent + /// text span or inline object. + /// + DWRITE_BREAK_CONDITION_MUST_BREAK +}; + +/// +/// Line breakpoint characteristics of a character. +/// +struct DWRITE_LINE_BREAKPOINT +{ + /// + /// Breaking condition before the character. + /// + UINT8 breakConditionBefore : 2; + + /// + /// Breaking condition after the character. + /// + UINT8 breakConditionAfter : 2; + + /// + /// The character is some form of whitespace, which may be meaningful + /// for justification. + /// + UINT8 isWhitespace : 1; + + /// + /// The character is a soft hyphen, often used to indicate hyphenation + /// points inside words. + /// + UINT8 isSoftHyphen : 1; + + UINT8 padding : 2; +}; + +/// +/// How to apply number substitution on digits and related punctuation. +/// +enum DWRITE_NUMBER_SUBSTITUTION_METHOD +{ + /// + /// Specifies that the substitution method should be determined based + /// on LOCALE_IDIGITSUBSTITUTION value of the specified text culture. + /// + DWRITE_NUMBER_SUBSTITUTION_METHOD_FROM_CULTURE, + + /// + /// If the culture is Arabic or Farsi, specifies that the number shape + /// depend on the context. Either traditional or nominal number shape + /// are used depending on the nearest preceding strong character or (if + /// there is none) the reading direction of the paragraph. + /// + DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL, + + /// + /// Specifies that code points 0x30-0x39 are always rendered as nominal numeral + /// shapes (ones of the European number), i.e., no substitution is performed. + /// + DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE, + + /// + /// Specifies that number are rendered using the national number shape + /// as specified by the LOCALE_SNATIVEDIGITS value of the specified text culture. + /// + DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL, + + /// + /// Specifies that number are rendered using the traditional shape + /// for the specified culture. For most cultures, this is the same as + /// NativeNational. However, NativeNational results in Latin number + /// for some Arabic cultures, whereas this value results in Arabic + /// number for all Arabic cultures. + /// + DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL +}; + +/// +/// Holds the appropriate digits and numeric punctuation for a given locale. +/// +interface DECLSPEC_UUID("14885CC9-BAB0-4f90-B6ED-5C366A2CD03D") DECLSPEC_NOVTABLE IDWriteNumberSubstitution : public IUnknown +{ +}; + +/// +/// Shaping output properties per input character. +/// +struct DWRITE_SHAPING_TEXT_PROPERTIES +{ + /// + /// This character can be shaped independently from the others + /// (usually set for the space character). + /// + UINT16 isShapedAlone : 1; + + /// + /// Reserved for use by shaping engine. + /// + UINT16 reserved : 15; +}; + +/// +/// Shaping output properties per output glyph. +/// +struct DWRITE_SHAPING_GLYPH_PROPERTIES +{ + /// + /// Justification class, whether to use spacing, kashidas, or + /// another method. This exists for backwards compatibility + /// with Uniscribe's SCRIPT_JUSTIFY enum. + /// + UINT16 justification : 4; + + /// + /// Indicates glyph is the first of a cluster. + /// + UINT16 isClusterStart : 1; + + /// + /// Glyph is a diacritic. + /// + UINT16 isDiacritic : 1; + + /// + /// Glyph has no width, blank, ZWJ, ZWNJ etc. + /// + UINT16 isZeroWidthSpace : 1; + + /// + /// Reserved for use by shaping engine. + /// + UINT16 reserved : 9; +}; + +/// +/// The interface implemented by the text analyzer's client to provide text to +/// the analyzer. It allows the separation between the logical view of text as +/// a continuous stream of characters identifiable by unique text positions, +/// and the actual memory layout of potentially discrete blocks of text in the +/// client's backing store. +/// +/// If any of these callbacks returns an error, the analysis functions will +/// stop prematurely and return a callback error. Rather than return E_NOTIMPL, +/// an application should stub the method and return a constant/null and S_OK. +/// +interface DECLSPEC_UUID("688e1a58-5094-47c8-adc8-fbcea60ae92b") DECLSPEC_NOVTABLE IDWriteTextAnalysisSource : public IUnknown +{ + /// + /// Get a block of text starting at the specified text position. + /// Returning NULL indicates the end of text - the position is after + /// the last character. This function is called iteratively for + /// each consecutive block, tying together several fragmented blocks + /// in the backing store into a virtual contiguous string. + /// + /// First position of the piece to obtain. All + /// positions are in UTF16 code-units, not whole characters, which + /// matters when supplementary characters are used. + /// Address that receives a pointer to the text block + /// at the specified position. + /// Number of UTF16 units of the retrieved chunk. + /// The returned length is not the length of the block, but the length + /// remaining in the block, from the given position until its end. + /// So querying for a position that is 75 positions into a 100 + /// postition block would return 25. + /// Pointer to the first character at the given text position. + /// NULL indicates no chunk available at the specified position, either + /// because textPosition >= the entire text content length or because the + /// queried position is not mapped into the app's backing store. + /// + /// Although apps can implement sparse textual content that only maps part of + /// the backing store, the app must map any text that is in the range passed + /// to any analysis functions. + /// + STDMETHOD(GetTextAtPosition)( + UINT32 textPosition, + __out WCHAR const** textString, + __out UINT32* textLength + ) PURE; + + /// + /// Get a block of text immediately preceding the specified position. + /// + /// Position immediately after the last position of the chunk to obtain. + /// Address that receives a pointer to the text block + /// at the specified position. + /// Number of UTF16 units of the retrieved block. + /// The length returned is from the given position to the front of + /// the block. + /// Pointer to the first character at (textPosition - textLength). + /// NULL indicates no chunk available at the specified position, either + /// because textPosition == 0,the textPosition > the entire text content + /// length, or the queried position is not mapped into the app's backing + /// store. + /// + /// Although apps can implement sparse textual content that only maps part of + /// the backing store, the app must map any text that is in the range passed + /// to any analysis functions. + /// + STDMETHOD(GetTextBeforePosition)( + UINT32 textPosition, + __out WCHAR const** textString, + __out UINT32* textLength + ) PURE; + + /// + /// Get paragraph reading direction. + /// + STDMETHOD_(DWRITE_READING_DIRECTION, GetParagraphReadingDirection)() PURE; + + /// + /// Get locale name on the range affected by it. + /// + /// Position to get the locale name of. + /// Receives the length from the given position up to the + /// next differing locale. + /// Address that receives a pointer to the locale + /// at the specified position. + /// + /// The localeName pointer must remain valid until the next call or until + /// the analysis returns. + /// + STDMETHOD(GetLocaleName)( + UINT32 textPosition, + __out UINT32* textLength, + __out_z WCHAR const** localeName + ) PURE; + + /// + /// Get number substitution on the range affected by it. + /// + /// Position to get the number substitution of. + /// Receives the length from the given position up to the + /// next differing number substitution. + /// Address that receives a pointer to the number substitution + /// at the specified position. + /// + /// Any implementation should return the number substitution with an + /// incremented ref count, and the analysis will release when finished + /// with it (either before the next call or before it returns). However, + /// the sink callback may hold onto it after that. + /// + STDMETHOD(GetNumberSubstitution)( + UINT32 textPosition, + __out UINT32* textLength, + __out IDWriteNumberSubstitution** numberSubstitution + ) PURE; +}; + +/// +/// The interface implemented by the text analyzer's client to receive the +/// output of a given text analysis. The Text analyzer disregards any current +/// state of the analysis sink, therefore a Set method call on a range +/// overwrites the previously set analysis result of the same range. +/// +interface DECLSPEC_UUID("5810cd44-0ca0-4701-b3fa-bec5182ae4f6") DECLSPEC_NOVTABLE IDWriteTextAnalysisSink : public IUnknown +{ + /// + /// Report script analysis for the text range. + /// + /// Starting position to report from. + /// Number of UTF16 units of the reported range. + /// Script analysis of characters in range. + /// + /// A successful code or error code to abort analysis. + /// + STDMETHOD(SetScriptAnalysis)( + UINT32 textPosition, + UINT32 textLength, + __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis + ) PURE; + + /// + /// Repport line-break opportunities for each character, starting from + /// the specified position. + /// + /// Starting position to report from. + /// Number of UTF16 units of the reported range. + /// Breaking conditions for each character. + /// + /// A successful code or error code to abort analysis. + /// + STDMETHOD(SetLineBreakpoints)( + UINT32 textPosition, + UINT32 textLength, + __in_ecount(textLength) DWRITE_LINE_BREAKPOINT const* lineBreakpoints + ) PURE; + + /// + /// Set bidirectional level on the range, called once per each + /// level run change (either explicit or resolved implicit). + /// + /// Starting position to report from. + /// Number of UTF16 units of the reported range. + /// Explicit level from embedded control codes + /// RLE/RLO/LRE/LRO/PDF, determined before any additional rules. + /// Final implicit level considering the + /// explicit level and characters' natural directionality, after all + /// Bidi rules have been applied. + /// + /// A successful code or error code to abort analysis. + /// + STDMETHOD(SetBidiLevel)( + UINT32 textPosition, + UINT32 textLength, + UINT8 explicitLevel, + UINT8 resolvedLevel + ) PURE; + + /// + /// Set number substitution on the range. + /// + /// Starting position to report from. + /// Number of UTF16 units of the reported range. + /// The number substitution applicable to + /// the returned range of text. The sink callback may hold onto it by + /// incrementing its ref count. + /// + /// A successful code or error code to abort analysis. + /// + /// + /// Unlike script and bidi analysis, where every character passed to the + /// analyzer has a result, this will only be called for those ranges where + /// substitution is applicable. For any other range, you will simply not + /// be called. + /// + STDMETHOD(SetNumberSubstitution)( + UINT32 textPosition, + UINT32 textLength, + __notnull IDWriteNumberSubstitution* numberSubstitution + ) PURE; +}; + +/// +/// Analyzes various text properties for complex script processing. +/// +interface DWRITE_DECLARE_INTERFACE("b7e6163e-7f46-43b4-84b3-e4e6249c365d") IDWriteTextAnalyzer : public IUnknown +{ + /// + /// Analyzes a text range for script boundaries, reading text attributes + /// from the source and reporting the Unicode script ID to the sink + /// callback SetScript. + /// + /// Source object to analyze. + /// Starting position within the source object. + /// Length to analyze. + /// Callback object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(AnalyzeScript)( + IDWriteTextAnalysisSource* analysisSource, + UINT32 textPosition, + UINT32 textLength, + IDWriteTextAnalysisSink* analysisSink + ) PURE; + + /// + /// Analyzes a text range for script directionality, reading attributes + /// from the source and reporting levels to the sink callback SetBidiLevel. + /// + /// Source object to analyze. + /// Starting position within the source object. + /// Length to analyze. + /// Callback object. + /// + /// Standard HRESULT error code. + /// + /// + /// While the function can handle multiple paragraphs, the text range + /// should not arbitrarily split the middle of paragraphs. Otherwise the + /// returned levels may be wrong, since the Bidi algorithm is meant to + /// apply to the paragraph as a whole. + /// + /// + /// Embedded control codes (LRE/LRO/RLE/RLO/PDF) are taken into account. + /// + STDMETHOD(AnalyzeBidi)( + IDWriteTextAnalysisSource* analysisSource, + UINT32 textPosition, + UINT32 textLength, + IDWriteTextAnalysisSink* analysisSink + ) PURE; + + /// + /// Analyzes a text range for spans where number substitution is applicable, + /// reading attributes from the source and reporting substitutable ranges + /// to the sink callback SetNumberSubstitution. + /// + /// Source object to analyze. + /// Starting position within the source object. + /// Length to analyze. + /// Callback object. + /// + /// Standard HRESULT error code. + /// + /// + /// While the function can handle multiple ranges of differing number + /// substitutions, the text ranges should not arbitrarily split the + /// middle of numbers. Otherwise it will treat the numbers separately + /// and will not translate any intervening punctuation. + /// + /// + /// Embedded control codes (LRE/LRO/RLE/RLO/PDF) are taken into account. + /// + STDMETHOD(AnalyzeNumberSubstitution)( + IDWriteTextAnalysisSource* analysisSource, + UINT32 textPosition, + UINT32 textLength, + IDWriteTextAnalysisSink* analysisSink + ) PURE; + + /// + /// Analyzes a text range for potential breakpoint opportunities, reading + /// attributes from the source and reporting breakpoint opportunities to + /// the sink callback SetLineBreakpoints. + /// + /// Source object to analyze. + /// Starting position within the source object. + /// Length to analyze. + /// Callback object. + /// + /// Standard HRESULT error code. + /// + /// + /// While the function can handle multiple paragraphs, the text range + /// should not arbitrarily split the middle of paragraphs, unless the + /// given text span is considered a whole unit. Otherwise the + /// returned properties for the first and last characters will + /// inappropriately allow breaks. + /// + /// + /// Special cases include the first, last, and surrogate characters. Any + /// text span is treated as if adjacent to inline objects on either side. + /// So the rules with contingent-break opportunities are used, where the + /// edge between text and inline objects is always treated as a potential + /// break opportunity, dependent on any overriding rules of the adjacent + /// objects to prohibit or force the break (see Unicode TR #14). + /// Surrogate pairs never break between. + /// + STDMETHOD(AnalyzeLineBreakpoints)( + IDWriteTextAnalysisSource* analysisSource, + UINT32 textPosition, + UINT32 textLength, + IDWriteTextAnalysisSink* analysisSink + ) PURE; + + /// + /// Parses the input text string and maps it to the set of glyphs and associated glyph data + /// according to the font and the writing system's rendering rules. + /// + /// The string to convert to glyphs. + /// The length of textString. + /// The font face to get glyphs from. + /// Set to true if the text is intended to be + /// drawn vertically. + /// Set to TRUE for right-to-left text. + /// Script analysis result from AnalyzeScript. + /// The locale to use when selecting glyphs. + /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs. + /// If this is NULL then the default mapping based on the script is used. + /// Optional number substitution which + /// selects the appropriate glyphs for digits and related numeric characters, + /// depending on the results obtained from AnalyzeNumberSubstitution. Passing + /// null indicates that no substitution is needed and that the digits should + /// receive nominal glyphs. + /// An array of pointers to the sets of typographic + /// features to use in each feature range. + /// The length of each feature range, in characters. + /// The sum of all lengths should be equal to textLength. + /// The number of feature ranges. + /// The maximum number of glyphs that can be + /// returned. + /// The mapping from character ranges to glyph + /// ranges. + /// Per-character output properties. + /// Output glyph indices. + /// Per-glyph output properties. + /// The actual number of glyphs returned if + /// the call succeeds. + /// + /// Standard HRESULT error code. + /// + /// + /// Note that the mapping from characters to glyphs is, in general, many- + /// to-many. The recommended estimate for the per-glyph output buffers is + /// (3 * textLength / 2 + 16). This is not guaranteed to be sufficient. + /// + /// The value of the actualGlyphCount parameter is only valid if the call + /// succeeds. In the event that maxGlyphCount is not big enough + /// E_NOT_SUFFICIENT_BUFFER, which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), + /// will be returned. The application should allocate a larger buffer and try again. + /// + STDMETHOD(GetGlyphs)( + __in_ecount(textLength) WCHAR const* textString, + UINT32 textLength, + IDWriteFontFace* fontFace, + BOOL isSideways, + BOOL isRightToLeft, + __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis, + __in_z_opt WCHAR const* localeName, + __maybenull IDWriteNumberSubstitution* numberSubstitution, + __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features, + __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths, + UINT32 featureRanges, + UINT32 maxGlyphCount, + __out_ecount(textLength) UINT16* clusterMap, + __out_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps, + __out_ecount(maxGlyphCount) UINT16* glyphIndices, + __out_ecount(maxGlyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProps, + __out UINT32* actualGlyphCount + ) PURE; + + /// + /// Place glyphs output from the GetGlyphs method according to the font + /// and the writing system's rendering rules. + /// + /// The original string the glyphs came from. + /// The mapping from character ranges to glyph + /// ranges. Returned by GetGlyphs. + /// Per-character properties. Returned by + /// GetGlyphs. + /// The length of textString. + /// Glyph indices. See GetGlyphs + /// Per-glyph properties. See GetGlyphs + /// The number of glyphs. + /// The font face the glyphs came from. + /// Logical font size in DIP's. + /// Set to true if the text is intended to be + /// drawn vertically. + /// Set to TRUE for right-to-left text. + /// Script analysis result from AnalyzeScript. + /// The locale to use when selecting glyphs. + /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs. + /// If this is NULL then the default mapping based on the script is used. + /// An array of pointers to the sets of typographic + /// features to use in each feature range. + /// The length of each feature range, in characters. + /// The sum of all lengths should be equal to textLength. + /// The number of feature ranges. + /// The advance width of each glyph. + /// The offset of the origin of each glyph. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetGlyphPlacements)( + __in_ecount(textLength) WCHAR const* textString, + __in_ecount(textLength) UINT16 const* clusterMap, + __in_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps, + UINT32 textLength, + __in_ecount(glyphCount) UINT16 const* glyphIndices, + __in_ecount(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps, + UINT32 glyphCount, + IDWriteFontFace * fontFace, + FLOAT fontEmSize, + BOOL isSideways, + BOOL isRightToLeft, + __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis, + __in_z_opt WCHAR const* localeName, + __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features, + __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths, + UINT32 featureRanges, + __out_ecount(glyphCount) FLOAT* glyphAdvances, + __out_ecount(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets + ) PURE; + + /// + /// Place glyphs output from the GetGlyphs method according to the font + /// and the writing system's rendering rules. + /// + /// The original string the glyphs came from. + /// The mapping from character ranges to glyph + /// ranges. Returned by GetGlyphs. + /// Per-character properties. Returned by + /// GetGlyphs. + /// The length of textString. + /// Glyph indices. See GetGlyphs + /// Per-glyph properties. See GetGlyphs + /// The number of glyphs. + /// The font face the glyphs came from. + /// Logical font size in DIP's. + /// Number of physical pixels per DIP. For example, if the DPI of the rendering surface is 96 this + /// value is 1.0f. If the DPI is 120, this value is 120.0f/96. + /// Optional transform applied to the glyphs and their positions. This transform is applied after the + /// scaling specified by the font size and pixelsPerDip. + /// + /// When set to FALSE, the metrics are the same as the metrics of GDI aliased text. + /// When set to TRUE, the metrics are the same as the metrics of text measured by GDI using a font + /// created with CLEARTYPE_NATURAL_QUALITY. + /// + /// Set to true if the text is intended to be + /// drawn vertically. + /// Set to TRUE for right-to-left text. + /// Script analysis result from AnalyzeScript. + /// The locale to use when selecting glyphs. + /// e.g. the same character may map to different glyphs for ja-jp vs zh-chs. + /// If this is NULL then the default mapping based on the script is used. + /// An array of pointers to the sets of typographic + /// features to use in each feature range. + /// The length of each feature range, in characters. + /// The sum of all lengths should be equal to textLength. + /// The number of feature ranges. + /// The advance width of each glyph. + /// The offset of the origin of each glyph. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetGdiCompatibleGlyphPlacements)( + __in_ecount(textLength) WCHAR const* textString, + __in_ecount(textLength) UINT16 const* clusterMap, + __in_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps, + UINT32 textLength, + __in_ecount(glyphCount) UINT16 const* glyphIndices, + __in_ecount(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps, + UINT32 glyphCount, + IDWriteFontFace * fontFace, + FLOAT fontEmSize, + FLOAT pixelsPerDip, + __in_opt DWRITE_MATRIX const* transform, + BOOL useGdiNatural, + BOOL isSideways, + BOOL isRightToLeft, + __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis, + __in_z_opt WCHAR const* localeName, + __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features, + __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths, + UINT32 featureRanges, + __out_ecount(glyphCount) FLOAT* glyphAdvances, + __out_ecount(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets + ) PURE; +}; + +/// +/// The DWRITE_GLYPH_RUN structure contains the information needed by renderers +/// to draw glyph runs. All coordinates are in device independent pixels (DIPs). +/// +struct DWRITE_GLYPH_RUN +{ + /// + /// The physical font face to draw with. + /// + __notnull IDWriteFontFace* fontFace; + + /// + /// Logical size of the font in DIPs, not points (equals 1/96 inch). + /// + FLOAT fontEmSize; + + /// + /// The number of glyphs. + /// + UINT32 glyphCount; + + /// + /// The indices to render. + /// + __field_ecount(glyphCount) UINT16 const* glyphIndices; + + /// + /// Glyph advance widths. + /// + __field_ecount_opt(glyphCount) FLOAT const* glyphAdvances; + + /// + /// Glyph offsets. + /// + __field_ecount_opt(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets; + + /// + /// If true, specifies that glyphs are rotated 90 degrees to the left and + /// vertical metrics are used. Vertical writing is achieved by specifying + /// isSideways = true and rotating the entire run 90 degrees to the right + /// via a rotate transform. + /// + BOOL isSideways; + + /// + /// The implicit resolved bidi level of the run. Odd levels indicate + /// right-to-left languages like Hebrew and Arabic, while even levels + /// indicate left-to-right languages like English and Japanese (when + /// written horizontally). For right-to-left languages, the text origin + /// is on the right, and text should be drawn to the left. + /// + UINT32 bidiLevel; +}; + +/// +/// The DWRITE_GLYPH_RUN_DESCRIPTION structure contains additional properties +/// related to those in DWRITE_GLYPH_RUN. +/// +struct DWRITE_GLYPH_RUN_DESCRIPTION +{ + /// + /// The locale name associated with this run. + /// + __nullterminated WCHAR const* localeName; + + /// + /// The text associated with the glyphs. + /// + __field_ecount(stringLength) WCHAR const* string; + + /// + /// The number of characters (UTF16 code-units). + /// Note that this may be different than the number of glyphs. + /// + UINT32 stringLength; + + /// + /// An array of indices to the glyph indices array, of the first glyphs of + /// all the glyph clusters of the glyphs to render. + /// + __field_ecount(stringLength) UINT16 const* clusterMap; + + /// + /// Corresponding text position in the original string + /// this glyph run came from. + /// + UINT32 textPosition; +}; + +/// +/// The DWRITE_UNDERLINE structure contains about the size and placement of +/// underlines. All coordinates are in device independent pixels (DIPs). +/// +struct DWRITE_UNDERLINE +{ + /// + /// Width of the underline, measured parallel to the baseline. + /// + FLOAT width; + + /// + /// Thickness of the underline, measured perpendicular to the + /// baseline. + /// + FLOAT thickness; + + /// + /// Offset of the underline from the baseline. + /// A positive offset represents a position below the baseline and + /// a negative offset is above. + /// + FLOAT offset; + + /// + /// Height of the tallest run where the underline applies. + /// + FLOAT runHeight; + + /// + /// Reading direction of the text associated with the underline. This + /// value is used to interpret whether the width value runs horizontally + /// or vertically. + /// + DWRITE_READING_DIRECTION readingDirection; + + /// + /// Flow direction of the text associated with the underline. This value + /// is used to interpret whether the thickness value advances top to + /// bottom, left to right, or right to left. + /// + DWRITE_FLOW_DIRECTION flowDirection; + + /// + /// Locale of the text the underline is being drawn under. Can be + /// pertinent where the locale affects how the underline is drawn. + /// For example, in vertical text, the underline belongs on the + /// left for Chinese but on the right for Japanese. + /// This choice is completely left up to higher levels. + /// + __nullterminated WCHAR const* localeName; + + /// + /// The measuring mode can be useful to the renderer to determine how + /// underlines are rendered, e.g. rounding the thickness to a whole pixel + /// in GDI-compatible modes. + /// + DWRITE_MEASURING_MODE measuringMode; +}; + +/// +/// The DWRITE_STRIKETHROUGH structure contains about the size and placement of +/// strickthroughs. All coordinates are in device independent pixels (DIPs). +/// +struct DWRITE_STRIKETHROUGH +{ + /// + /// Width of the strikethrough, measured parallel to the baseline. + /// + FLOAT width; + + /// + /// Thickness of the strikethrough, measured perpendicular to the + /// baseline. + /// + FLOAT thickness; + + /// + /// Offset of the stikethrough from the baseline. + /// A positive offset represents a position below the baseline and + /// a negative offset is above. + /// + FLOAT offset; + + /// + /// Reading direction of the text associated with the strikethrough. This + /// value is used to interpret whether the width value runs horizontally + /// or vertically. + /// + DWRITE_READING_DIRECTION readingDirection; + + /// + /// Flow direction of the text associated with the strikethrough. This + /// value is used to interpret whether the thickness value advances top to + /// bottom, left to right, or right to left. + /// + DWRITE_FLOW_DIRECTION flowDirection; + + /// + /// Locale of the range. Can be pertinent where the locale affects the style. + /// + __nullterminated WCHAR const* localeName; + + /// + /// The measuring mode can be useful to the renderer to determine how + /// underlines are rendered, e.g. rounding the thickness to a whole pixel + /// in GDI-compatible modes. + /// + DWRITE_MEASURING_MODE measuringMode; +}; + +/// +/// The DWRITE_LINE_METRICS structure contains information about a formatted +/// line of text. +/// +struct DWRITE_LINE_METRICS +{ + /// + /// The number of total text positions in the line. + /// This includes any trailing whitespace and newline characters. + /// + UINT32 length; + + /// + /// The number of whitespace positions at the end of the line. Newline + /// sequences are considered whitespace. + /// + UINT32 trailingWhitespaceLength; + + /// + /// The number of characters in the newline sequence at the end of the line. + /// If the count is zero, then the line was either wrapped or it is the + /// end of the text. + /// + UINT32 newlineLength; + + /// + /// Height of the line as measured from top to bottom. + /// + FLOAT height; + + /// + /// Distance from the top of the line to its baseline. + /// + FLOAT baseline; + + /// + /// The line is trimmed. + /// + BOOL isTrimmed; +}; + + +/// +/// The DWRITE_CLUSTER_METRICS structure contains information about a glyph cluster. +/// +struct DWRITE_CLUSTER_METRICS +{ + /// + /// The total advance width of all glyphs in the cluster. + /// + FLOAT width; + + /// + /// The number of text positions in the cluster. + /// + UINT16 length; + + /// + /// Indicate whether line can be broken right after the cluster. + /// + UINT16 canWrapLineAfter : 1; + + /// + /// Indicate whether the cluster corresponds to whitespace character. + /// + UINT16 isWhitespace : 1; + + /// + /// Indicate whether the cluster corresponds to a newline character. + /// + UINT16 isNewline : 1; + + /// + /// Indicate whether the cluster corresponds to soft hyphen character. + /// + UINT16 isSoftHyphen : 1; + + /// + /// Indicate whether the cluster is read from right to left. + /// + UINT16 isRightToLeft : 1; + + UINT16 padding : 11; +}; + + +/// +/// Overall metrics associated with text after layout. +/// All coordinates are in device independent pixels (DIPs). +/// +struct DWRITE_TEXT_METRICS +{ + /// + /// Left-most point of formatted text relative to layout box + /// (excluding any glyph overhang). + /// + FLOAT left; + + /// + /// Top-most point of formatted text relative to layout box + /// (excluding any glyph overhang). + /// + FLOAT top; + + /// + /// The width of the formatted text ignoring trailing whitespace + /// at the end of each line. + /// + FLOAT width; + + /// + /// The width of the formatted text taking into account the + /// trailing whitespace at the end of each line. + /// + FLOAT widthIncludingTrailingWhitespace; + + /// + /// The height of the formatted text. The height of an empty string + /// is determined by the size of the default font's line height. + /// + FLOAT height; + + /// + /// Initial width given to the layout. Depending on whether the text + /// was wrapped or not, it can be either larger or smaller than the + /// text content width. + /// + FLOAT layoutWidth; + + /// + /// Initial height given to the layout. Depending on the length of the + /// text, it may be larger or smaller than the text content height. + /// + FLOAT layoutHeight; + + /// + /// The maximum reordering count of any line of text, used + /// to calculate the most number of hit-testing boxes needed. + /// If the layout has no bidirectional text or no text at all, + /// the minimum level is 1. + /// + UINT32 maxBidiReorderingDepth; + + /// + /// Total number of lines. + /// + UINT32 lineCount; +}; + + +/// +/// Properties describing the geometric measurement of an +/// application-defined inline object. +/// +struct DWRITE_INLINE_OBJECT_METRICS +{ + /// + /// Width of the inline object. + /// + FLOAT width; + + /// + /// Height of the inline object as measured from top to bottom. + /// + FLOAT height; + + /// + /// Distance from the top of the object to the baseline where it is lined up with the adjacent text. + /// If the baseline is at the bottom, baseline simply equals height. + /// + FLOAT baseline; + + /// + /// Flag indicating whether the object is to be placed upright or alongside the text baseline + /// for vertical text. + /// + BOOL supportsSideways; +}; + + +/// +/// The DWRITE_OVERHANG_METRICS structure holds how much any visible pixels +/// (in DIPs) overshoot each side of the layout or inline objects. +/// +/// +/// Positive overhangs indicate that the visible area extends outside the layout +/// box or inline object, while negative values mean there is whitespace inside. +/// The returned values are unaffected by rendering transforms or pixel snapping. +/// Additionally, they may not exactly match final target's pixel bounds after +/// applying grid fitting and hinting. +/// +struct DWRITE_OVERHANG_METRICS +{ + /// + /// The distance from the left-most visible DIP to its left alignment edge. + /// + FLOAT left; + + /// + /// The distance from the top-most visible DIP to its top alignment edge. + /// + FLOAT top; + + /// + /// The distance from the right-most visible DIP to its right alignment edge. + /// + FLOAT right; + + /// + /// The distance from the bottom-most visible DIP to its bottom alignment edge. + /// + FLOAT bottom; +}; + + +/// +/// Geometry enclosing of text positions. +/// +struct DWRITE_HIT_TEST_METRICS +{ + /// + /// First text position within the geometry. + /// + UINT32 textPosition; + + /// + /// Number of text positions within the geometry. + /// + UINT32 length; + + /// + /// Left position of the top-left coordinate of the geometry. + /// + FLOAT left; + + /// + /// Top position of the top-left coordinate of the geometry. + /// + FLOAT top; + + /// + /// Geometry's width. + /// + FLOAT width; + + /// + /// Geometry's height. + /// + FLOAT height; + + /// + /// Bidi level of text positions enclosed within the geometry. + /// + UINT32 bidiLevel; + + /// + /// Geometry encloses text? + /// + BOOL isText; + + /// + /// Range is trimmed. + /// + BOOL isTrimmed; +}; + + +interface IDWriteTextRenderer; + + +/// +/// The IDWriteInlineObject interface wraps an application defined inline graphic, +/// allowing DWrite to query metrics as if it was a glyph inline with the text. +/// +interface DWRITE_DECLARE_INTERFACE("8339FDE3-106F-47ab-8373-1C6295EB10B3") IDWriteInlineObject : public IUnknown +{ + /// + /// The application implemented rendering callback (IDWriteTextRenderer::DrawInlineObject) + /// can use this to draw the inline object without needing to cast or query the object + /// type. The text layout does not call this method directly. + /// + /// The context passed to IDWriteTextLayout::Draw. + /// The renderer passed to IDWriteTextLayout::Draw as the object's containing parent. + /// X-coordinate at the top-left corner of the inline object. + /// Y-coordinate at the top-left corner of the inline object. + /// The object should be drawn on its side. + /// The object is in an right-to-left context and should be drawn flipped. + /// The drawing effect set in IDWriteTextLayout::SetDrawingEffect. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(Draw)( + __maybenull void* clientDrawingContext, + IDWriteTextRenderer* renderer, + FLOAT originX, + FLOAT originY, + BOOL isSideways, + BOOL isRightToLeft, + __maybenull IUnknown* clientDrawingEffect + ) PURE; + + /// + /// TextLayout calls this callback function to get the measurement of the inline object. + /// + /// Returned metrics + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetMetrics)( + __out DWRITE_INLINE_OBJECT_METRICS* metrics + ) PURE; + + /// + /// TextLayout calls this callback function to get the visible extents (in DIPs) of the inline object. + /// In the case of a simple bitmap, with no padding and no overhang, all the overhangs will + /// simply be zeroes. + /// + /// Overshoot of visible extents (in DIPs) outside the object. + /// + /// Standard HRESULT error code. + /// + /// + /// The overhangs should be returned relative to the reported size of the object + /// (DWRITE_INLINE_OBJECT_METRICS::width/height), and should not be baseline + /// adjusted. If you have an image that is actually 100x100 DIPs, but you want it + /// slightly inset (perhaps it has a glow) by 20 DIPs on each side, you would + /// return a width/height of 60x60 and four overhangs of 20 DIPs. + /// + STDMETHOD(GetOverhangMetrics)( + __out DWRITE_OVERHANG_METRICS* overhangs + ) PURE; + + /// + /// Layout uses this to determine the line breaking behavior of the inline object + /// amidst the text. + /// + /// Line-breaking condition between the object and the content immediately preceding it. + /// Line-breaking condition between the object and the content immediately following it. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetBreakConditions)( + __out DWRITE_BREAK_CONDITION* breakConditionBefore, + __out DWRITE_BREAK_CONDITION* breakConditionAfter + ) PURE; +}; + +/// +/// The IDWritePixelSnapping interface defines the pixel snapping properties of a text renderer. +/// +interface DWRITE_DECLARE_INTERFACE("eaf3a2da-ecf4-4d24-b644-b34f6842024b") IDWritePixelSnapping : public IUnknown +{ + /// + /// Determines whether pixel snapping is disabled. The recommended default is FALSE, + /// unless doing animation that requires subpixel vertical placement. + /// + /// The context passed to IDWriteTextLayout::Draw. + /// Receives TRUE if pixel snapping is disabled or FALSE if it not. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(IsPixelSnappingDisabled)( + __maybenull void* clientDrawingContext, + __out BOOL* isDisabled + ) PURE; + + /// + /// Gets the current transform that maps abstract coordinates to DIPs, + /// which may disable pixel snapping upon any rotation or shear. + /// + /// The context passed to IDWriteTextLayout::Draw. + /// Receives the transform. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetCurrentTransform)( + __maybenull void* clientDrawingContext, + __out DWRITE_MATRIX* transform + ) PURE; + + /// + /// Gets the number of physical pixels per DIP. A DIP (device-independent pixel) is 1/96 inch, + /// so the pixelsPerDip value is the number of logical pixels per inch divided by 96 (yielding + /// a value of 1 for 96 DPI and 1.25 for 120). + /// + /// The context passed to IDWriteTextLayout::Draw. + /// Receives the number of physical pixels per DIP. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetPixelsPerDip)( + __maybenull void* clientDrawingContext, + __out FLOAT* pixelsPerDip + ) PURE; +}; + +/// +/// The IDWriteTextLayout interface represents a set of application-defined +/// callbacks that perform rendering of text, inline objects, and decorations +/// such as underlines. +/// +interface DWRITE_DECLARE_INTERFACE("ef8a8135-5cc6-45fe-8825-c5a0724eb819") IDWriteTextRenderer : public IDWritePixelSnapping +{ + /// + /// IDWriteTextLayout::Draw calls this function to instruct the client to + /// render a run of glyphs. + /// + /// The context passed to + /// IDWriteTextLayout::Draw. + /// X-coordinate of the baseline. + /// Y-coordinate of the baseline. + /// Specifies measuring method for glyphs in the run. + /// Renderer implementations may choose different rendering modes for given measuring methods, + /// but best results are seen when the rendering mode matches the corresponding measuring mode: + /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL + /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC + /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL + /// + /// The glyph run to draw. + /// Properties of the characters + /// associated with this run. + /// The drawing effect set in + /// IDWriteTextLayout::SetDrawingEffect. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(DrawGlyphRun)( + __maybenull void* clientDrawingContext, + FLOAT baselineOriginX, + FLOAT baselineOriginY, + DWRITE_MEASURING_MODE measuringMode, + __in DWRITE_GLYPH_RUN const* glyphRun, + __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription, + __maybenull IUnknown* clientDrawingEffect + ) PURE; + + /// + /// IDWriteTextLayout::Draw calls this function to instruct the client to draw + /// an underline. + /// + /// The context passed to + /// IDWriteTextLayout::Draw. + /// X-coordinate of the baseline. + /// Y-coordinate of the baseline. + /// Underline logical information. + /// The drawing effect set in + /// IDWriteTextLayout::SetDrawingEffect. + /// + /// Standard HRESULT error code. + /// + /// + /// A single underline can be broken into multiple calls, depending on + /// how the formatting changes attributes. If font sizes/styles change + /// within an underline, the thickness and offset will be averaged + /// weighted according to characters. + /// To get the correct top coordinate of the underline rect, add underline::offset + /// to the baseline's Y. Otherwise the underline will be immediately under the text. + /// The x coordinate will always be passed as the left side, regardless + /// of text directionality. This simplifies drawing and reduces the + /// problem of round-off that could potentially cause gaps or a double + /// stamped alpha blend. To avoid alpha overlap, round the end points + /// to the nearest device pixel. + /// + STDMETHOD(DrawUnderline)( + __maybenull void* clientDrawingContext, + FLOAT baselineOriginX, + FLOAT baselineOriginY, + __in DWRITE_UNDERLINE const* underline, + __maybenull IUnknown* clientDrawingEffect + ) PURE; + + /// + /// IDWriteTextLayout::Draw calls this function to instruct the client to draw + /// a strikethrough. + /// + /// The context passed to + /// IDWriteTextLayout::Draw. + /// X-coordinate of the baseline. + /// Y-coordinate of the baseline. + /// Strikethrough logical information. + /// The drawing effect set in + /// IDWriteTextLayout::SetDrawingEffect. + /// + /// Standard HRESULT error code. + /// + /// + /// A single strikethrough can be broken into multiple calls, depending on + /// how the formatting changes attributes. Strikethrough is not averaged + /// across font sizes/styles changes. + /// To get the correct top coordinate of the strikethrough rect, + /// add strikethrough::offset to the baseline's Y. + /// Like underlines, the x coordinate will always be passed as the left side, + /// regardless of text directionality. + /// + STDMETHOD(DrawStrikethrough)( + __maybenull void* clientDrawingContext, + FLOAT baselineOriginX, + FLOAT baselineOriginY, + __in DWRITE_STRIKETHROUGH const* strikethrough, + __maybenull IUnknown* clientDrawingEffect + ) PURE; + + /// + /// IDWriteTextLayout::Draw calls this application callback when it needs to + /// draw an inline object. + /// + /// The context passed to IDWriteTextLayout::Draw. + /// X-coordinate at the top-left corner of the inline object. + /// Y-coordinate at the top-left corner of the inline object. + /// The object set using IDWriteTextLayout::SetInlineObject. + /// The object should be drawn on its side. + /// The object is in an right-to-left context and should be drawn flipped. + /// The drawing effect set in + /// IDWriteTextLayout::SetDrawingEffect. + /// + /// Standard HRESULT error code. + /// + /// + /// The right-to-left flag is a hint for those cases where it would look + /// strange for the image to be shown normally (like an arrow pointing to + /// right to indicate a submenu). + /// + STDMETHOD(DrawInlineObject)( + __maybenull void* clientDrawingContext, + FLOAT originX, + FLOAT originY, + IDWriteInlineObject* inlineObject, + BOOL isSideways, + BOOL isRightToLeft, + __maybenull IUnknown* clientDrawingEffect + ) PURE; +}; + +/// +/// The IDWriteTextLayout interface represents a block of text after it has +/// been fully analyzed and formatted. +/// +/// All coordinates are in device independent pixels (DIPs). +/// +interface DWRITE_DECLARE_INTERFACE("53737037-6d14-410b-9bfe-0b182bb70961") IDWriteTextLayout : public IDWriteTextFormat +{ + /// + /// Set layout maximum width + /// + /// Layout maximum width + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetMaxWidth)( + FLOAT maxWidth + ) PURE; + + /// + /// Set layout maximum height + /// + /// Layout maximum height + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetMaxHeight)( + FLOAT maxHeight + ) PURE; + + /// + /// Set the font collection. + /// + /// The font collection to set + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetFontCollection)( + IDWriteFontCollection* fontCollection, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set null-terminated font family name. + /// + /// Font family name + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetFontFamilyName)( + __in_z WCHAR const* fontFamilyName, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set font weight. + /// + /// Font weight + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetFontWeight)( + DWRITE_FONT_WEIGHT fontWeight, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set font style. + /// + /// Font style + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetFontStyle)( + DWRITE_FONT_STYLE fontStyle, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set font stretch. + /// + /// font stretch + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetFontStretch)( + DWRITE_FONT_STRETCH fontStretch, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set font em height. + /// + /// Font em height + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetFontSize)( + FLOAT fontSize, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set underline. + /// + /// The Boolean flag indicates whether underline takes place + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetUnderline)( + BOOL hasUnderline, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set strikethrough. + /// + /// The Boolean flag indicates whether strikethrough takes place + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetStrikethrough)( + BOOL hasStrikethrough, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set application-defined drawing effect. + /// + /// Pointer to an application-defined drawing effect. + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + /// + /// This drawing effect is associated with the specified range and will be passed back + /// to the application via the callback when the range is drawn at drawing time. + /// + STDMETHOD(SetDrawingEffect)( + IUnknown* drawingEffect, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set inline object. + /// + /// Pointer to an application-implemented inline object. + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + /// + /// This inline object applies to the specified range and will be passed back + /// to the application via the DrawInlineObject callback when the range is drawn. + /// Any text in that range will be suppressed. + /// + STDMETHOD(SetInlineObject)( + IDWriteInlineObject* inlineObject, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set font typography features. + /// + /// Pointer to font typography setting. + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetTypography)( + IDWriteTypography* typography, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Set locale name. + /// + /// Locale name + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetLocaleName)( + __in_z WCHAR const* localeName, + DWRITE_TEXT_RANGE textRange + ) PURE; + + /// + /// Get layout maximum width + /// + STDMETHOD_(FLOAT, GetMaxWidth)() PURE; + + /// + /// Get layout maximum height + /// + STDMETHOD_(FLOAT, GetMaxHeight)() PURE; + + /// + /// Get the font collection where the current position is at. + /// + /// The current text position. + /// The current font collection + /// Text range to which this change applies. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontCollection)( + UINT32 currentPosition, + __out IDWriteFontCollection** fontCollection, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the length of the font family name where the current position is at. + /// + /// The current text position. + /// Size of the character array in character count not including the terminated NULL character. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontFamilyNameLength)( + UINT32 currentPosition, + __out UINT32* nameLength, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Copy the font family name where the current position is at. + /// + /// The current text position. + /// Character array that receives the current font family name + /// Size of the character array in character count including the terminated NULL character. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontFamilyName)( + UINT32 currentPosition, + __out_ecount_z(nameSize) WCHAR* fontFamilyName, + UINT32 nameSize, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the font weight where the current position is at. + /// + /// The current text position. + /// The current font weight + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontWeight)( + UINT32 currentPosition, + __out DWRITE_FONT_WEIGHT* fontWeight, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the font style where the current position is at. + /// + /// The current text position. + /// The current font style + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontStyle)( + UINT32 currentPosition, + __out DWRITE_FONT_STYLE* fontStyle, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the font stretch where the current position is at. + /// + /// The current text position. + /// The current font stretch + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontStretch)( + UINT32 currentPosition, + __out DWRITE_FONT_STRETCH* fontStretch, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the font em height where the current position is at. + /// + /// The current text position. + /// The current font em height + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetFontSize)( + UINT32 currentPosition, + __out FLOAT* fontSize, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the underline presence where the current position is at. + /// + /// The current text position. + /// The Boolean flag indicates whether text is underlined. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetUnderline)( + UINT32 currentPosition, + __out BOOL* hasUnderline, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the strikethrough presence where the current position is at. + /// + /// The current text position. + /// The Boolean flag indicates whether text has strikethrough. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetStrikethrough)( + UINT32 currentPosition, + __out BOOL* hasStrikethrough, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the application-defined drawing effect where the current position is at. + /// + /// The current text position. + /// The current application-defined drawing effect. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetDrawingEffect)( + UINT32 currentPosition, + __out IUnknown** drawingEffect, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the inline object at the given position. + /// + /// The given text position. + /// The inline object. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetInlineObject)( + UINT32 currentPosition, + __out IDWriteInlineObject** inlineObject, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the typography setting where the current position is at. + /// + /// The current text position. + /// The current typography setting. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetTypography)( + UINT32 currentPosition, + __out IDWriteTypography** typography, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the length of the locale name where the current position is at. + /// + /// The current text position. + /// Size of the character array in character count not including the terminated NULL character. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLocaleNameLength)( + UINT32 currentPosition, + __out UINT32* nameLength, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Get the locale name where the current position is at. + /// + /// The current text position. + /// Character array that receives the current locale name + /// Size of the character array in character count including the terminated NULL character. + /// The position range of the current format. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetLocaleName)( + UINT32 currentPosition, + __out_ecount_z(nameSize) WCHAR* localeName, + UINT32 nameSize, + __out_opt DWRITE_TEXT_RANGE* textRange = NULL + ) PURE; + + /// + /// Initiate drawing of the text. + /// + /// An application defined value + /// included in rendering callbacks. + /// The set of application-defined callbacks that do + /// the actual rendering. + /// X-coordinate of the layout's left side. + /// Y-coordinate of the layout's top side. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(Draw)( + __maybenull void* clientDrawingContext, + IDWriteTextRenderer* renderer, + FLOAT originX, + FLOAT originY + ) PURE; + + /// + /// GetLineMetrics returns properties of each line. + /// + /// The array to fill with line information. + /// The maximum size of the lineMetrics array. + /// The actual size of the lineMetrics + /// array that is needed. + /// + /// Standard HRESULT error code. + /// + /// + /// If maxLineCount is not large enough E_NOT_SUFFICIENT_BUFFER, + /// which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), + /// is returned and *actualLineCount is set to the number of lines + /// needed. + /// + STDMETHOD(GetLineMetrics)( + __out_ecount_opt(maxLineCount) DWRITE_LINE_METRICS* lineMetrics, + UINT32 maxLineCount, + __out UINT32* actualLineCount + ) PURE; + + /// + /// GetMetrics retrieves overall metrics for the formatted string. + /// + /// The returned metrics. + /// + /// Standard HRESULT error code. + /// + /// + /// Drawing effects like underline and strikethrough do not contribute + /// to the text size, which is essentially the sum of advance widths and + /// line heights. Additionally, visible swashes and other graphic + /// adornments may extend outside the returned width and height. + /// + STDMETHOD(GetMetrics)( + __out DWRITE_TEXT_METRICS* textMetrics + ) PURE; + + /// + /// GetOverhangMetrics returns the overhangs (in DIPs) of the layout and all + /// objects contained in it, including text glyphs and inline objects. + /// + /// Overshoots of visible extents (in DIPs) outside the layout. + /// + /// Standard HRESULT error code. + /// + /// + /// Any underline and strikethrough do not contribute to the black box + /// determination, since these are actually drawn by the renderer, which + /// is allowed to draw them in any variety of styles. + /// + STDMETHOD(GetOverhangMetrics)( + __out DWRITE_OVERHANG_METRICS* overhangs + ) PURE; + + /// + /// Retrieve logical properties and measurement of each cluster. + /// + /// The array to fill with cluster information. + /// The maximum size of the clusterMetrics array. + /// The actual size of the clusterMetrics array that is needed. + /// + /// Standard HRESULT error code. + /// + /// + /// If maxClusterCount is not large enough E_NOT_SUFFICIENT_BUFFER, + /// which is equivalent to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), + /// is returned and *actualClusterCount is set to the number of clusters + /// needed. + /// + STDMETHOD(GetClusterMetrics)( + __out_ecount_opt(maxClusterCount) DWRITE_CLUSTER_METRICS* clusterMetrics, + UINT32 maxClusterCount, + __out UINT32* actualClusterCount + ) PURE; + + /// + /// Determines the minimum possible width the layout can be set to without + /// emergency breaking between the characters of whole words. + /// + /// Minimum width. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(DetermineMinWidth)( + __out FLOAT* minWidth + ) PURE; + + /// + /// Given a coordinate (in DIPs) relative to the top-left of the layout box, + /// this returns the corresponding hit-test metrics of the text string where + /// the hit-test has occurred. This is useful for mapping mouse clicks to caret + /// positions. When the given coordinate is outside the text string, the function + /// sets the output value *isInside to false but returns the nearest character + /// position. + /// + /// X coordinate to hit-test, relative to the top-left location of the layout box. + /// Y coordinate to hit-test, relative to the top-left location of the layout box. + /// Output flag indicating whether the hit-test location is at the leading or the trailing + /// side of the character. When the output *isInside value is set to false, this value is set according to the output + /// *position value to represent the edge closest to the hit-test location. + /// Output flag indicating whether the hit-test location is inside the text string. + /// When false, the position nearest the text's edge is returned. + /// Output geometry fully enclosing the hit-test location. When the output *isInside value + /// is set to false, this structure represents the geometry enclosing the edge closest to the hit-test location. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(HitTestPoint)( + FLOAT pointX, + FLOAT pointY, + __out BOOL* isTrailingHit, + __out BOOL* isInside, + __out DWRITE_HIT_TEST_METRICS* hitTestMetrics + ) PURE; + + /// + /// Given a text position and whether the caret is on the leading or trailing + /// edge of that position, this returns the corresponding coordinate (in DIPs) + /// relative to the top-left of the layout box. This is most useful for drawing + /// the caret's current position, but it could also be used to anchor an IME to the + /// typed text or attach a floating menu near the point of interest. It may also be + /// used to programmatically obtain the geometry of a particular text position + /// for UI automation. + /// + /// Text position to get the coordinate of. + /// Flag indicating whether the location is of the leading or the trailing side of the specified text position. + /// Output caret X, relative to the top-left of the layout box. + /// Output caret Y, relative to the top-left of the layout box. + /// Output geometry fully enclosing the specified text position. + /// + /// Standard HRESULT error code. + /// + /// + /// When drawing a caret at the returned X,Y, it should should be centered on X + /// and drawn from the Y coordinate down. The height will be the size of the + /// hit-tested text (which can vary in size within a line). + /// Reading direction also affects which side of the character the caret is drawn. + /// However, the returned X coordinate will be correct for either case. + /// You can get a text length back that is larger than a single character. + /// This happens for complex scripts when multiple characters form a single cluster, + /// when diacritics join their base character, or when you test a surrogate pair. + /// + STDMETHOD(HitTestTextPosition)( + UINT32 textPosition, + BOOL isTrailingHit, + __out FLOAT* pointX, + __out FLOAT* pointY, + __out DWRITE_HIT_TEST_METRICS* hitTestMetrics + ) PURE; + + /// + /// The application calls this function to get a set of hit-test metrics + /// corresponding to a range of text positions. The main usage for this + /// is to draw highlighted selection of the text string. + /// + /// The function returns E_NOT_SUFFICIENT_BUFFER, which is equivalent to + /// HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), when the buffer size of + /// hitTestMetrics is too small to hold all the regions calculated by the + /// function. In such situation, the function sets the output value + /// *actualHitTestMetricsCount to the number of geometries calculated. + /// The application is responsible to allocate a new buffer of greater + /// size and call the function again. + /// + /// A good value to use as an initial value for maxHitTestMetricsCount may + /// be calculated from the following equation: + /// maxHitTestMetricsCount = lineCount * maxBidiReorderingDepth + /// + /// where lineCount is obtained from the value of the output argument + /// *actualLineCount from the function IDWriteTextLayout::GetLineMetrics, + /// and the maxBidiReorderingDepth value from the DWRITE_TEXT_METRICS + /// structure of the output argument *textMetrics from the function + /// IDWriteFactory::CreateTextLayout. + /// + /// First text position of the specified range. + /// Number of positions of the specified range. + /// Offset of the X origin (left of the layout box) which is added to each of the hit-test metrics returned. + /// Offset of the Y origin (top of the layout box) which is added to each of the hit-test metrics returned. + /// Pointer to a buffer of the output geometry fully enclosing the specified position range. + /// Maximum number of distinct metrics it could hold in its buffer memory. + /// Actual number of metrics returned or needed. + /// + /// Standard HRESULT error code. + /// + /// + /// There are no gaps in the returned metrics. While there could be visual gaps, + /// depending on bidi ordering, each range is contiguous and reports all the text, + /// including any hidden characters and trimmed text. + /// The height of each returned range will be the same within each line, regardless + /// of how the font sizes vary. + /// + STDMETHOD(HitTestTextRange)( + UINT32 textPosition, + UINT32 textLength, + FLOAT originX, + FLOAT originY, + __out_ecount_opt(maxHitTestMetricsCount) DWRITE_HIT_TEST_METRICS* hitTestMetrics, + UINT32 maxHitTestMetricsCount, + __out UINT32* actualHitTestMetricsCount + ) PURE; +}; + +/// +/// Encapsulates a 32-bit device independent bitmap and device context, which can be used for rendering glyphs. +/// +interface DWRITE_DECLARE_INTERFACE("5e5a32a3-8dff-4773-9ff6-0696eab77267") IDWriteBitmapRenderTarget : public IUnknown +{ + /// + /// Draws a run of glyphs to the bitmap. + /// + /// Horizontal position of the baseline origin, in DIPs, relative to the upper-left corner of the DIB. + /// Vertical position of the baseline origin, in DIPs, relative to the upper-left corner of the DIB. + /// Specifies measuring method for glyphs in the run. + /// Renderer implementations may choose different rendering modes for different measuring methods, for example + /// DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL for DWRITE_MEASURING_MODE_NATURAL, + /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC for DWRITE_MEASURING_MODE_GDI_CLASSIC, and + /// DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL for DWRITE_MEASURING_MODE_GDI_NATURAL. + /// + /// Structure containing the properties of the glyph run. + /// Object that controls rendering behavior. + /// Specifies the foreground color of the text. + /// Optional rectangle that receives the bounding box (in pixels not DIPs) of all the pixels affected by + /// drawing the glyph run. The black box rectangle may extend beyond the dimensions of the bitmap. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(DrawGlyphRun)( + FLOAT baselineOriginX, + FLOAT baselineOriginY, + DWRITE_MEASURING_MODE measuringMode, + __in DWRITE_GLYPH_RUN const* glyphRun, + IDWriteRenderingParams* renderingParams, + COLORREF textColor, + __out_opt RECT* blackBoxRect = NULL + ) PURE; + + /// + /// Gets a handle to the memory device context. + /// + /// + /// Returns the device context handle. + /// + /// + /// An application can use the device context to draw using GDI functions. An application can obtain the bitmap handle + /// (HBITMAP) by calling GetCurrentObject. An application that wants information about the underlying bitmap, including + /// a pointer to the pixel data, can call GetObject to fill in a DIBSECTION structure. The bitmap is always a 32-bit + /// top-down DIB. + /// + STDMETHOD_(HDC, GetMemoryDC)() PURE; + + /// + /// Gets the number of bitmap pixels per DIP. A DIP (device-independent pixel) is 1/96 inch so this value is the number + /// if pixels per inch divided by 96. + /// + /// + /// Returns the number of bitmap pixels per DIP. + /// + STDMETHOD_(FLOAT, GetPixelsPerDip)() PURE; + + /// + /// Sets the number of bitmap pixels per DIP. A DIP (device-independent pixel) is 1/96 inch so this value is the number + /// if pixels per inch divided by 96. + /// + /// Specifies the number of pixels per DIP. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetPixelsPerDip)( + FLOAT pixelsPerDip + ) PURE; + + /// + /// Gets the transform that maps abstract coordinate to DIPs. By default this is the identity + /// transform. Note that this is unrelated to the world transform of the underlying device + /// context. + /// + /// Receives the transform. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetCurrentTransform)( + __out DWRITE_MATRIX* transform + ) PURE; + + /// + /// Sets the transform that maps abstract coordinate to DIPs. This does not affect the world + /// transform of the underlying device context. + /// + /// Specifies the new transform. This parameter can be NULL, in which + /// case the identity transform is implied. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(SetCurrentTransform)( + __in_opt DWRITE_MATRIX const* transform + ) PURE; + + /// + /// Gets the dimensions of the bitmap. + /// + /// Receives the size of the bitmap in pixels. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetSize)( + __out SIZE* size + ) PURE; + + /// + /// Resizes the bitmap. + /// + /// New bitmap width, in pixels. + /// New bitmap height, in pixels. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(Resize)( + UINT32 width, + UINT32 height + ) PURE; +}; + +/// +/// The GDI interop interface provides interoperability with GDI. +/// +interface DWRITE_DECLARE_INTERFACE("1edd9491-9853-4299-898f-6432983b6f3a") IDWriteGdiInterop : public IUnknown +{ + /// + /// Creates a font object that matches the properties specified by the LOGFONT structure. + /// + /// Structure containing a GDI-compatible font description. + /// Receives a newly created font object if successful, or NULL in case of error. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateFontFromLOGFONT)( + __in LOGFONTW const* logFont, + __out IDWriteFont** font + ) PURE; + + /// + /// Initializes a LOGFONT structure based on the GDI-compatible properties of the specified font. + /// + /// Specifies a font in the system font collection. + /// Structure that receives a GDI-compatible font description. + /// Contains TRUE if the specified font object is part of the system font collection + /// or FALSE otherwise. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(ConvertFontToLOGFONT)( + IDWriteFont* font, + __out LOGFONTW* logFont, + __out BOOL* isSystemFont + ) PURE; + + /// + /// Initializes a LOGFONT structure based on the GDI-compatible properties of the specified font. + /// + /// Specifies a font face. + /// Structure that receives a GDI-compatible font description. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(ConvertFontFaceToLOGFONT)( + IDWriteFontFace* font, + __out LOGFONTW* logFont + ) PURE; + + /// + /// Creates a font face object that corresponds to the currently selected HFONT. + /// + /// Handle to a device context into which a font has been selected. It is assumed that the client + /// has already performed font mapping and that the font selected into the DC is the actual font that would be used + /// for rendering glyphs. + /// Contains the newly created font face object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateFontFaceFromHdc)( + HDC hdc, + __out IDWriteFontFace** fontFace + ) PURE; + + /// + /// Creates an object that encapsulates a bitmap and memory DC which can be used for rendering glyphs. + /// + /// Optional device context used to create a compatible memory DC. + /// Width of the bitmap. + /// Height of the bitmap. + /// Receives a pointer to the newly created render target. + STDMETHOD(CreateBitmapRenderTarget)( + __in_opt HDC hdc, + UINT32 width, + UINT32 height, + __out IDWriteBitmapRenderTarget** renderTarget + ) PURE; +}; + +/// +/// The DWRITE_TEXTURE_TYPE enumeration identifies a type of alpha texture. An alpha texture is a bitmap of alpha values, each +/// representing the darkness (i.e., opacity) of a pixel or subpixel. +/// +enum DWRITE_TEXTURE_TYPE +{ + /// + /// Specifies an alpha texture for aliased text rendering (i.e., bi-level, where each pixel is either fully opaque or fully transparent), + /// with one byte per pixel. + /// + DWRITE_TEXTURE_ALIASED_1x1, + + /// + /// Specifies an alpha texture for ClearType text rendering, with three bytes per pixel in the horizontal dimension and + /// one byte per pixel in the vertical dimension. + /// + DWRITE_TEXTURE_CLEARTYPE_3x1 +}; + +/// +/// Maximum alpha value in a texture returned by IDWriteGlyphRunAnalysis::CreateAlphaTexture. +/// +#define DWRITE_ALPHA_MAX 255 + +/// +/// Interface that encapsulates information used to render a glyph run. +/// +interface DWRITE_DECLARE_INTERFACE("7d97dbf7-e085-42d4-81e3-6a883bded118") IDWriteGlyphRunAnalysis : public IUnknown +{ + /// + /// Gets the bounding rectangle of the physical pixels affected by the glyph run. + /// + /// Specifies the type of texture requested. If a bi-level texture is requested, the + /// bounding rectangle includes only bi-level glyphs. Otherwise, the bounding rectangle includes only anti-aliased + /// glyphs. + /// Receives the bounding rectangle, or an empty rectangle if there are no glyphs + /// if the specified type. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetAlphaTextureBounds)( + DWRITE_TEXTURE_TYPE textureType, + __out RECT* textureBounds + ) PURE; + + /// + /// Creates an alpha texture of the specified type. + /// + /// Specifies the type of texture requested. If a bi-level texture is requested, the + /// texture contains only bi-level glyphs. Otherwise, the texture contains only anti-aliased glyphs. + /// Specifies the bounding rectangle of the texture, which can be different than + /// the bounding rectangle returned by GetAlphaTextureBounds. + /// Receives the array of alpha values. + /// Size of the alphaValues array. The minimum size depends on the dimensions of the + /// rectangle and the type of texture requested. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateAlphaTexture)( + DWRITE_TEXTURE_TYPE textureType, + __in RECT const* textureBounds, + __out_bcount(bufferSize) BYTE* alphaValues, + UINT32 bufferSize + ) PURE; + + /// + /// Gets properties required for ClearType blending. + /// + /// Rendering parameters object. In most cases, the values returned in the output + /// parameters are based on the properties of this object. The exception is if a GDI-compatible rendering mode + /// is specified. + /// Receives the gamma value to use for gamma correction. + /// Receives the enhanced contrast value. + /// Receives the ClearType level. + STDMETHOD(GetAlphaBlendParams)( + IDWriteRenderingParams* renderingParams, + __out FLOAT* blendGamma, + __out FLOAT* blendEnhancedContrast, + __out FLOAT* blendClearTypeLevel + ) PURE; +}; + +/// +/// The root factory interface for all DWrite objects. +/// +interface DWRITE_DECLARE_INTERFACE("b859ee5a-d838-4b5b-a2e8-1adc7d93db48") IDWriteFactory : public IUnknown +{ + /// + /// Gets a font collection representing the set of installed fonts. + /// + /// Receives a pointer to the system font collection object, or NULL in case of failure. + /// If this parameter is nonzero, the function performs an immediate check for changes to the set of + /// installed fonts. If this parameter is FALSE, the function will still detect changes if the font cache service is running, but + /// there may be some latency. For example, an application might specify TRUE if it has itself just installed a font and wants to + /// be sure the font collection contains that font. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetSystemFontCollection)( + __out IDWriteFontCollection** fontCollection, + BOOL checkForUpdates = FALSE + ) PURE; + + /// + /// Creates a font collection using a custom font collection loader. + /// + /// Application-defined font collection loader, which must have been previously + /// registered using RegisterFontCollectionLoader. + /// Key used by the loader to identify a collection of font files. + /// Size in bytes of the collection key. + /// Receives a pointer to the system font collection object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateCustomFontCollection)( + IDWriteFontCollectionLoader* collectionLoader, + __in_bcount(collectionKeySize) void const* collectionKey, + UINT32 collectionKeySize, + __out IDWriteFontCollection** fontCollection + ) PURE; + + /// + /// Registers a custom font collection loader with the factory object. + /// + /// Application-defined font collection loader. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(RegisterFontCollectionLoader)( + IDWriteFontCollectionLoader* fontCollectionLoader + ) PURE; + + /// + /// Unregisters a custom font collection loader that was previously registered using RegisterFontCollectionLoader. + /// + /// Application-defined font collection loader. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(UnregisterFontCollectionLoader)( + IDWriteFontCollectionLoader* fontCollectionLoader + ) PURE; + + /// + /// CreateFontFileReference creates a font file reference object from a local font file. + /// + /// Absolute file path. Subsequent operations on the constructed object may fail + /// if the user provided filePath doesn't correspond to a valid file on the disk. + /// Last modified time of the input file path. If the parameter is omitted, + /// the function will access the font file to obtain its last write time, so the clients are encouraged to specify this value + /// to avoid extra disk access. Subsequent operations on the constructed object may fail + /// if the user provided lastWriteTime doesn't match the file on the disk. + /// Contains newly created font file reference object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateFontFileReference)( + __in_z WCHAR const* filePath, + __in_opt FILETIME const* lastWriteTime, + __out IDWriteFontFile** fontFile + ) PURE; + + /// + /// CreateCustomFontFileReference creates a reference to an application specific font file resource. + /// This function enables an application or a document to use a font without having to install it on the system. + /// The fontFileReferenceKey has to be unique only in the scope of the fontFileLoader used in this call. + /// + /// Font file reference key that uniquely identifies the font file resource + /// during the lifetime of fontFileLoader. + /// Size of font file reference key in bytes. + /// Font file loader that will be used by the font system to load data from the file identified by + /// fontFileReferenceKey. + /// Contains the newly created font file object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + /// + /// This function is provided for cases when an application or a document needs to use a font + /// without having to install it on the system. fontFileReferenceKey has to be unique only in the scope + /// of the fontFileLoader used in this call. + /// + STDMETHOD(CreateCustomFontFileReference)( + __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey, + UINT32 fontFileReferenceKeySize, + IDWriteFontFileLoader* fontFileLoader, + __out IDWriteFontFile** fontFile + ) PURE; + + /// + /// Creates a font face object. + /// + /// The file format of the font face. + /// The number of font files require to represent the font face. + /// Font files representing the font face. Since IDWriteFontFace maintains its own references + /// to the input font file objects, it's OK to release them after this call. + /// The zero based index of a font face in cases when the font files contain a collection of font faces. + /// If the font files contain a single face, this value should be zero. + /// Font face simulation flags for algorithmic emboldening and italicization. + /// Contains the newly created font face object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateFontFace)( + DWRITE_FONT_FACE_TYPE fontFaceType, + UINT32 numberOfFiles, + __in_ecount(numberOfFiles) IDWriteFontFile* const* fontFiles, + UINT32 faceIndex, + DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags, + __out IDWriteFontFace** fontFace + ) PURE; + + /// + /// Creates a rendering parameters object with default settings for the primary monitor. + /// + /// Holds the newly created rendering parameters object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateRenderingParams)( + __out IDWriteRenderingParams** renderingParams + ) PURE; + + /// + /// Creates a rendering parameters object with default settings for the specified monitor. + /// + /// The monitor to read the default values from. + /// Holds the newly created rendering parameters object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateMonitorRenderingParams)( + HMONITOR monitor, + __out IDWriteRenderingParams** renderingParams + ) PURE; + + /// + /// Creates a rendering parameters object with the specified properties. + /// + /// The gamma value used for gamma correction, which must be greater than zero and cannot exceed 256. + /// The amount of contrast enhancement, zero or greater. + /// The degree of ClearType level, from 0.0f (no ClearType) to 1.0f (full ClearType). + /// The geometry of a device pixel. + /// Method of rendering glyphs. In most cases, this should be DWRITE_RENDERING_MODE_DEFAULT to automatically use an appropriate mode. + /// Holds the newly created rendering parameters object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateCustomRenderingParams)( + FLOAT gamma, + FLOAT enhancedContrast, + FLOAT clearTypeLevel, + DWRITE_PIXEL_GEOMETRY pixelGeometry, + DWRITE_RENDERING_MODE renderingMode, + __out IDWriteRenderingParams** renderingParams + ) PURE; + + /// + /// Registers a font file loader with DirectWrite. + /// + /// Pointer to the implementation of the IDWriteFontFileLoader for a particular file resource type. + /// + /// Standard HRESULT error code. + /// + /// + /// This function registers a font file loader with DirectWrite. + /// Font file loader interface handles loading font file resources of a particular type from a key. + /// The font file loader interface is recommended to be implemented by a singleton object. + /// A given instance can only be registered once. + /// Succeeding attempts will return an error that it has already been registered. + /// IMPORTANT: font file loader implementations must not register themselves with DirectWrite + /// inside their constructors and must not unregister themselves in their destructors, because + /// registration and unregistraton operations increment and decrement the object reference count respectively. + /// Instead, registration and unregistration of font file loaders with DirectWrite should be performed + /// outside of the font file loader implementation as a separate step. + /// + STDMETHOD(RegisterFontFileLoader)( + IDWriteFontFileLoader* fontFileLoader + ) PURE; + + /// + /// Unregisters a font file loader that was previously registered with the DirectWrite font system using RegisterFontFileLoader. + /// + /// Pointer to the file loader that was previously registered with the DirectWrite font system using RegisterFontFileLoader. + /// + /// This function will succeed if the user loader is requested to be removed. + /// It will fail if the pointer to the file loader identifies a standard DirectWrite loader, + /// or a loader that is never registered or has already been unregistered. + /// + /// + /// This function unregisters font file loader callbacks with the DirectWrite font system. + /// The font file loader interface is recommended to be implemented by a singleton object. + /// IMPORTANT: font file loader implementations must not register themselves with DirectWrite + /// inside their constructors and must not unregister themselves in their destructors, because + /// registration and unregistraton operations increment and decrement the object reference count respectively. + /// Instead, registration and unregistration of font file loaders with DirectWrite should be performed + /// outside of the font file loader implementation as a separate step. + /// + STDMETHOD(UnregisterFontFileLoader)( + IDWriteFontFileLoader* fontFileLoader + ) PURE; + + /// + /// Create a text format object used for text layout. + /// + /// Name of the font family + /// Font collection. NULL indicates the system font collection. + /// Font weight + /// Font style + /// Font stretch + /// Logical size of the font in DIP units. A DIP ("device-independent pixel") equals 1/96 inch. + /// Locale name + /// Contains newly created text format object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateTextFormat)( + __in_z WCHAR const* fontFamilyName, + __maybenull IDWriteFontCollection* fontCollection, + DWRITE_FONT_WEIGHT fontWeight, + DWRITE_FONT_STYLE fontStyle, + DWRITE_FONT_STRETCH fontStretch, + FLOAT fontSize, + __in_z WCHAR const* localeName, + __out IDWriteTextFormat** textFormat + ) PURE; + + /// + /// Create a typography object used in conjunction with text format for text layout. + /// + /// Contains newly created typography object, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateTypography)( + __out IDWriteTypography** typography + ) PURE; + + /// + /// Create an object used for interoperability with GDI. + /// + /// Receives the GDI interop object if successful, or NULL in case of failure. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(GetGdiInterop)( + __out IDWriteGdiInterop** gdiInterop + ) PURE; + + /// + /// CreateTextLayout takes a string, format, and associated constraints + /// and produces and object representing the fully analyzed + /// and formatted result. + /// + /// The string to layout. + /// The length of the string. + /// The format to apply to the string. + /// Width of the layout box. + /// Height of the layout box. + /// The resultant object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateTextLayout)( + __in_ecount(stringLength) WCHAR const* string, + UINT32 stringLength, + IDWriteTextFormat* textFormat, + FLOAT maxWidth, + FLOAT maxHeight, + __out IDWriteTextLayout** textLayout + ) PURE; + + /// + /// CreateGdiCompatibleTextLayout takes a string, format, and associated constraints + /// and produces and object representing the result formatted for a particular display resolution + /// and measuring method. The resulting text layout should only be used for the intended resolution, + /// and for cases where text scalability is desired, CreateTextLayout should be used instead. + /// + /// The string to layout. + /// The length of the string. + /// The format to apply to the string. + /// Width of the layout box. + /// Height of the layout box. + /// Number of physical pixels per DIP. For example, if rendering onto a 96 DPI device then pixelsPerDip + /// is 1. If rendering onto a 120 DPI device then pixelsPerDip is 120/96. + /// Optional transform applied to the glyphs and their positions. This transform is applied after the + /// scaling specified the font size and pixelsPerDip. + /// + /// When set to FALSE, instructs the text layout to use the same metrics as GDI aliased text. + /// When set to TRUE, instructs the text layout to use the same metrics as text measured by GDI using a font + /// created with CLEARTYPE_NATURAL_QUALITY. + /// + /// The resultant object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateGdiCompatibleTextLayout)( + __in_ecount(stringLength) WCHAR const* string, + UINT32 stringLength, + IDWriteTextFormat* textFormat, + FLOAT layoutWidth, + FLOAT layoutHeight, + FLOAT pixelsPerDip, + __in_opt DWRITE_MATRIX const* transform, + BOOL useGdiNatural, + __out IDWriteTextLayout** textLayout + ) PURE; + + /// + /// The application may call this function to create an inline object for trimming, using an ellipsis as the omission sign. + /// The ellipsis will be created using the current settings of the format, including base font, style, and any effects. + /// Alternate omission signs can be created by the application by implementing IDWriteInlineObject. + /// + /// Text format used as a template for the omission sign. + /// Created omission sign. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateEllipsisTrimmingSign)( + IDWriteTextFormat* textFormat, + __out IDWriteInlineObject** trimmingSign + ) PURE; + + /// + /// Return an interface to perform text analysis with. + /// + /// The resultant object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateTextAnalyzer)( + __out IDWriteTextAnalyzer** textAnalyzer + ) PURE; + + /// + /// Creates a number substitution object using a locale name, + /// substitution method, and whether to ignore user overrides (uses NLS + /// defaults for the given culture instead). + /// + /// Method of number substitution to use. + /// Which locale to obtain the digits from. + /// Ignore the user's settings and use the locale defaults + /// Receives a pointer to the newly created object. + STDMETHOD(CreateNumberSubstitution)( + __in DWRITE_NUMBER_SUBSTITUTION_METHOD substitutionMethod, + __in_z WCHAR const* localeName, + __in BOOL ignoreUserOverride, + __out IDWriteNumberSubstitution** numberSubstitution + ) PURE; + + /// + /// Creates a glyph run analysis object, which encapsulates information + /// used to render a glyph run. + /// + /// Structure specifying the properties of the glyph run. + /// Number of physical pixels per DIP. For example, if rendering onto a 96 DPI bitmap then pixelsPerDip + /// is 1. If rendering onto a 120 DPI bitmap then pixelsPerDip is 120/96. + /// Optional transform applied to the glyphs and their positions. This transform is applied after the + /// scaling specified the emSize and pixelsPerDip. + /// Specifies the rendering mode, which must be one of the raster rendering modes (i.e., not default + /// and not outline). + /// Specifies the method to measure glyphs. + /// Horizontal position of the baseline origin, in DIPs. + /// Vertical position of the baseline origin, in DIPs. + /// Receives a pointer to the newly created object. + /// + /// Standard HRESULT error code. + /// + STDMETHOD(CreateGlyphRunAnalysis)( + __in DWRITE_GLYPH_RUN const* glyphRun, + FLOAT pixelsPerDip, + __in_opt DWRITE_MATRIX const* transform, + DWRITE_RENDERING_MODE renderingMode, + DWRITE_MEASURING_MODE measuringMode, + FLOAT baselineOriginX, + FLOAT baselineOriginY, + __out IDWriteGlyphRunAnalysis** glyphRunAnalysis + ) PURE; + +}; // interface IDWriteFactory + +/// +/// Creates a DirectWrite factory object that is used for subsequent creation of individual DirectWrite objects. +/// +/// Identifies whether the factory object will be shared or isolated. +/// Identifies the DirectWrite factory interface, such as __uuidof(IDWriteFactory). +/// Receives the DirectWrite factory object. +/// +/// Standard HRESULT error code. +/// +/// +/// Obtains DirectWrite factory object that is used for subsequent creation of individual DirectWrite classes. +/// DirectWrite factory contains internal state such as font loader registration and cached font data. +/// In most cases it is recommended to use the shared factory object, because it allows multiple components +/// that use DirectWrite to share internal DirectWrite state and reduce memory usage. +/// However, there are cases when it is desirable to reduce the impact of a component, +/// such as a plug-in from an untrusted source, on the rest of the process by sandboxing and isolating it +/// from the rest of the process components. In such cases, it is recommended to use an isolated factory for the sandboxed +/// component. +/// +EXTERN_C HRESULT DWRITE_EXPORT DWriteCreateFactory( + __in DWRITE_FACTORY_TYPE factoryType, + __in REFIID iid, + __out IUnknown **factory + ); + +// Macros used to define DirectWrite error codes. +#define FACILITY_DWRITE 0x898 +#define DWRITE_ERR_BASE 0x5000 +#define MAKE_DWRITE_HR(severity, code) MAKE_HRESULT(severity, FACILITY_DWRITE, (DWRITE_ERR_BASE + code)) +#define MAKE_DWRITE_HR_ERR(code) MAKE_DWRITE_HR(SEVERITY_ERROR, code) + +/// +/// Indicates an error in an input file such as a font file. +/// +#define DWRITE_E_FILEFORMAT MAKE_DWRITE_HR_ERR(0x000) + +/// +/// Indicates an error originating in DirectWrite code, which is not expected to occur but is safe to recover from. +/// +#define DWRITE_E_UNEXPECTED MAKE_DWRITE_HR_ERR(0x001) + +/// +/// Indicates the specified font does not exist. +/// +#define DWRITE_E_NOFONT MAKE_DWRITE_HR_ERR(0x002) + +/// +/// A font file could not be opened because the file, directory, network location, drive, or other storage +/// location does not exist or is unavailable. +/// +#define DWRITE_E_FILENOTFOUND MAKE_DWRITE_HR_ERR(0x003) + +/// +/// A font file exists but could not be opened due to access denied, sharing violation, or similar error. +/// +#define DWRITE_E_FILEACCESS MAKE_DWRITE_HR_ERR(0x004) + +/// +/// A font collection is obsolete due to changes in the system. +/// +#define DWRITE_E_FONTCOLLECTIONOBSOLETE MAKE_DWRITE_HR_ERR(0x005) + +/// +/// The given interface is already registered. +/// +#define DWRITE_E_ALREADYREGISTERED MAKE_DWRITE_HR_ERR(0x006) + +#endif /* DWRITE_H_INCLUDED */ diff --git a/Src/Decoder_H264_ALL/D3D/include/DXGI.h b/Src/Decoder_H264_ALL/D3D/include/DXGI.h new file mode 100644 index 0000000..1466b04 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/DXGI.h @@ -0,0 +1,2641 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0555 */ +/* Compiler settings for dxgi.idl: + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 7.00.0555 + protocol : all , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __dxgi_h__ +#define __dxgi_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __IDXGIObject_FWD_DEFINED__ +#define __IDXGIObject_FWD_DEFINED__ +typedef interface IDXGIObject IDXGIObject; +#endif /* __IDXGIObject_FWD_DEFINED__ */ + + +#ifndef __IDXGIDeviceSubObject_FWD_DEFINED__ +#define __IDXGIDeviceSubObject_FWD_DEFINED__ +typedef interface IDXGIDeviceSubObject IDXGIDeviceSubObject; +#endif /* __IDXGIDeviceSubObject_FWD_DEFINED__ */ + + +#ifndef __IDXGIResource_FWD_DEFINED__ +#define __IDXGIResource_FWD_DEFINED__ +typedef interface IDXGIResource IDXGIResource; +#endif /* __IDXGIResource_FWD_DEFINED__ */ + + +#ifndef __IDXGIKeyedMutex_FWD_DEFINED__ +#define __IDXGIKeyedMutex_FWD_DEFINED__ +typedef interface IDXGIKeyedMutex IDXGIKeyedMutex; +#endif /* __IDXGIKeyedMutex_FWD_DEFINED__ */ + + +#ifndef __IDXGISurface_FWD_DEFINED__ +#define __IDXGISurface_FWD_DEFINED__ +typedef interface IDXGISurface IDXGISurface; +#endif /* __IDXGISurface_FWD_DEFINED__ */ + + +#ifndef __IDXGISurface1_FWD_DEFINED__ +#define __IDXGISurface1_FWD_DEFINED__ +typedef interface IDXGISurface1 IDXGISurface1; +#endif /* __IDXGISurface1_FWD_DEFINED__ */ + + +#ifndef __IDXGIAdapter_FWD_DEFINED__ +#define __IDXGIAdapter_FWD_DEFINED__ +typedef interface IDXGIAdapter IDXGIAdapter; +#endif /* __IDXGIAdapter_FWD_DEFINED__ */ + + +#ifndef __IDXGIOutput_FWD_DEFINED__ +#define __IDXGIOutput_FWD_DEFINED__ +typedef interface IDXGIOutput IDXGIOutput; +#endif /* __IDXGIOutput_FWD_DEFINED__ */ + + +#ifndef __IDXGISwapChain_FWD_DEFINED__ +#define __IDXGISwapChain_FWD_DEFINED__ +typedef interface IDXGISwapChain IDXGISwapChain; +#endif /* __IDXGISwapChain_FWD_DEFINED__ */ + + +#ifndef __IDXGIFactory_FWD_DEFINED__ +#define __IDXGIFactory_FWD_DEFINED__ +typedef interface IDXGIFactory IDXGIFactory; +#endif /* __IDXGIFactory_FWD_DEFINED__ */ + + +#ifndef __IDXGIDevice_FWD_DEFINED__ +#define __IDXGIDevice_FWD_DEFINED__ +typedef interface IDXGIDevice IDXGIDevice; +#endif /* __IDXGIDevice_FWD_DEFINED__ */ + + +#ifndef __IDXGIFactory1_FWD_DEFINED__ +#define __IDXGIFactory1_FWD_DEFINED__ +typedef interface IDXGIFactory1 IDXGIFactory1; +#endif /* __IDXGIFactory1_FWD_DEFINED__ */ + + +#ifndef __IDXGIAdapter1_FWD_DEFINED__ +#define __IDXGIAdapter1_FWD_DEFINED__ +typedef interface IDXGIAdapter1 IDXGIAdapter1; +#endif /* __IDXGIAdapter1_FWD_DEFINED__ */ + + +#ifndef __IDXGIDevice1_FWD_DEFINED__ +#define __IDXGIDevice1_FWD_DEFINED__ +typedef interface IDXGIDevice1 IDXGIDevice1; +#endif /* __IDXGIDevice1_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "dxgitype.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_dxgi_0000_0000 */ +/* [local] */ + +#define DXGI_CPU_ACCESS_NONE ( 0 ) +#define DXGI_CPU_ACCESS_DYNAMIC ( 1 ) +#define DXGI_CPU_ACCESS_READ_WRITE ( 2 ) +#define DXGI_CPU_ACCESS_SCRATCH ( 3 ) +#define DXGI_CPU_ACCESS_FIELD 15 +#define DXGI_USAGE_SHADER_INPUT ( 1L << (0 + 4) ) +#define DXGI_USAGE_RENDER_TARGET_OUTPUT ( 1L << (1 + 4) ) +#define DXGI_USAGE_BACK_BUFFER ( 1L << (2 + 4) ) +#define DXGI_USAGE_SHARED ( 1L << (3 + 4) ) +#define DXGI_USAGE_READ_ONLY ( 1L << (4 + 4) ) +#define DXGI_USAGE_DISCARD_ON_PRESENT ( 1L << (5 + 4) ) +#define DXGI_USAGE_UNORDERED_ACCESS ( 1L << (6 + 4) ) +typedef UINT DXGI_USAGE; + +typedef struct DXGI_FRAME_STATISTICS + { + UINT PresentCount; + UINT PresentRefreshCount; + UINT SyncRefreshCount; + LARGE_INTEGER SyncQPCTime; + LARGE_INTEGER SyncGPUTime; + } DXGI_FRAME_STATISTICS; + +typedef struct DXGI_MAPPED_RECT + { + INT Pitch; + BYTE *pBits; + } DXGI_MAPPED_RECT; + +#ifdef __midl +typedef struct _LUID + { + DWORD LowPart; + LONG HighPart; + } LUID; + +typedef struct _LUID *PLUID; + +#endif +typedef struct DXGI_ADAPTER_DESC + { + WCHAR Description[ 128 ]; + UINT VendorId; + UINT DeviceId; + UINT SubSysId; + UINT Revision; + SIZE_T DedicatedVideoMemory; + SIZE_T DedicatedSystemMemory; + SIZE_T SharedSystemMemory; + LUID AdapterLuid; + } DXGI_ADAPTER_DESC; + +#if !defined(HMONITOR_DECLARED) && !defined(HMONITOR) && (WINVER < 0x0500) +#define HMONITOR_DECLARED +#if 0 +typedef HANDLE HMONITOR; + +#endif +DECLARE_HANDLE(HMONITOR); +#endif +typedef struct DXGI_OUTPUT_DESC + { + WCHAR DeviceName[ 32 ]; + RECT DesktopCoordinates; + BOOL AttachedToDesktop; + DXGI_MODE_ROTATION Rotation; + HMONITOR Monitor; + } DXGI_OUTPUT_DESC; + +typedef struct DXGI_SHARED_RESOURCE + { + HANDLE Handle; + } DXGI_SHARED_RESOURCE; + +#define DXGI_RESOURCE_PRIORITY_MINIMUM ( 0x28000000 ) + +#define DXGI_RESOURCE_PRIORITY_LOW ( 0x50000000 ) + +#define DXGI_RESOURCE_PRIORITY_NORMAL ( 0x78000000 ) + +#define DXGI_RESOURCE_PRIORITY_HIGH ( 0xa0000000 ) + +#define DXGI_RESOURCE_PRIORITY_MAXIMUM ( 0xc8000000 ) + +typedef +enum DXGI_RESIDENCY + { DXGI_RESIDENCY_FULLY_RESIDENT = 1, + DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2, + DXGI_RESIDENCY_EVICTED_TO_DISK = 3 + } DXGI_RESIDENCY; + +typedef struct DXGI_SURFACE_DESC + { + UINT Width; + UINT Height; + DXGI_FORMAT Format; + DXGI_SAMPLE_DESC SampleDesc; + } DXGI_SURFACE_DESC; + +typedef +enum DXGI_SWAP_EFFECT + { DXGI_SWAP_EFFECT_DISCARD = 0, + DXGI_SWAP_EFFECT_SEQUENTIAL = 1 + } DXGI_SWAP_EFFECT; + +typedef +enum DXGI_SWAP_CHAIN_FLAG + { DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 1, + DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 2, + DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE = 4 + } DXGI_SWAP_CHAIN_FLAG; + +typedef struct DXGI_SWAP_CHAIN_DESC + { + DXGI_MODE_DESC BufferDesc; + DXGI_SAMPLE_DESC SampleDesc; + DXGI_USAGE BufferUsage; + UINT BufferCount; + HWND OutputWindow; + BOOL Windowed; + DXGI_SWAP_EFFECT SwapEffect; + UINT Flags; + } DXGI_SWAP_CHAIN_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0000_v0_0_s_ifspec; + +#ifndef __IDXGIObject_INTERFACE_DEFINED__ +#define __IDXGIObject_INTERFACE_DEFINED__ + +/* interface IDXGIObject */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIObject; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("aec22fb8-76f3-4639-9be0-28eb43a67a2e") + IDXGIObject : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPrivateData( + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetParent( + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIObjectVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIObject * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIObject * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIObject * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIObject * This, + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIObject * This, + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIObject * This, + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIObject * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent); + + END_INTERFACE + } IDXGIObjectVtbl; + + interface IDXGIObject + { + CONST_VTBL struct IDXGIObjectVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIObject_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIObject_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIObject_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIObject_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIObject_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIObject_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIObject_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIObject_INTERFACE_DEFINED__ */ + + +#ifndef __IDXGIDeviceSubObject_INTERFACE_DEFINED__ +#define __IDXGIDeviceSubObject_INTERFACE_DEFINED__ + +/* interface IDXGIDeviceSubObject */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIDeviceSubObject; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3d3e0379-f9de-4d58-bb6c-18d62992f1a6") + IDXGIDeviceSubObject : public IDXGIObject + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDevice( + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppDevice) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIDeviceSubObjectVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIDeviceSubObject * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIDeviceSubObject * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIDeviceSubObject * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIDeviceSubObject * This, + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIDeviceSubObject * This, + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIDeviceSubObject * This, + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIDeviceSubObject * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + IDXGIDeviceSubObject * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppDevice); + + END_INTERFACE + } IDXGIDeviceSubObjectVtbl; + + interface IDXGIDeviceSubObject + { + CONST_VTBL struct IDXGIDeviceSubObjectVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIDeviceSubObject_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIDeviceSubObject_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIDeviceSubObject_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIDeviceSubObject_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIDeviceSubObject_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIDeviceSubObject_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIDeviceSubObject_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIDeviceSubObject_GetDevice(This,riid,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIDeviceSubObject_INTERFACE_DEFINED__ */ + + +#ifndef __IDXGIResource_INTERFACE_DEFINED__ +#define __IDXGIResource_INTERFACE_DEFINED__ + +/* interface IDXGIResource */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIResource; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("035f3ab4-482e-4e50-b41f-8a7f8bd8960b") + IDXGIResource : public IDXGIDeviceSubObject + { + public: + virtual HRESULT STDMETHODCALLTYPE GetSharedHandle( + /* [out] */ HANDLE *pSharedHandle) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetUsage( + /* [out] */ DXGI_USAGE *pUsage) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetEvictionPriority( + /* [in] */ UINT EvictionPriority) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetEvictionPriority( + /* [retval][out] */ UINT *pEvictionPriority) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIResourceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIResource * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIResource * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIResource * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIResource * This, + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIResource * This, + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIResource * This, + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIResource * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + IDXGIResource * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetSharedHandle )( + IDXGIResource * This, + /* [out] */ HANDLE *pSharedHandle); + + HRESULT ( STDMETHODCALLTYPE *GetUsage )( + IDXGIResource * This, + /* [out] */ DXGI_USAGE *pUsage); + + HRESULT ( STDMETHODCALLTYPE *SetEvictionPriority )( + IDXGIResource * This, + /* [in] */ UINT EvictionPriority); + + HRESULT ( STDMETHODCALLTYPE *GetEvictionPriority )( + IDXGIResource * This, + /* [retval][out] */ UINT *pEvictionPriority); + + END_INTERFACE + } IDXGIResourceVtbl; + + interface IDXGIResource + { + CONST_VTBL struct IDXGIResourceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIResource_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIResource_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIResource_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIResource_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIResource_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIResource_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIResource_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIResource_GetDevice(This,riid,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) ) + + +#define IDXGIResource_GetSharedHandle(This,pSharedHandle) \ + ( (This)->lpVtbl -> GetSharedHandle(This,pSharedHandle) ) + +#define IDXGIResource_GetUsage(This,pUsage) \ + ( (This)->lpVtbl -> GetUsage(This,pUsage) ) + +#define IDXGIResource_SetEvictionPriority(This,EvictionPriority) \ + ( (This)->lpVtbl -> SetEvictionPriority(This,EvictionPriority) ) + +#define IDXGIResource_GetEvictionPriority(This,pEvictionPriority) \ + ( (This)->lpVtbl -> GetEvictionPriority(This,pEvictionPriority) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIResource_INTERFACE_DEFINED__ */ + + +#ifndef __IDXGIKeyedMutex_INTERFACE_DEFINED__ +#define __IDXGIKeyedMutex_INTERFACE_DEFINED__ + +/* interface IDXGIKeyedMutex */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIKeyedMutex; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9d8e1289-d7b3-465f-8126-250e349af85d") + IDXGIKeyedMutex : public IDXGIDeviceSubObject + { + public: + virtual HRESULT STDMETHODCALLTYPE AcquireSync( + /* [in] */ UINT64 Key, + /* [in] */ DWORD dwMilliseconds) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReleaseSync( + /* [in] */ UINT64 Key) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIKeyedMutexVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIKeyedMutex * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIKeyedMutex * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIKeyedMutex * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIKeyedMutex * This, + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIKeyedMutex * This, + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIKeyedMutex * This, + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIKeyedMutex * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + IDXGIKeyedMutex * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *AcquireSync )( + IDXGIKeyedMutex * This, + /* [in] */ UINT64 Key, + /* [in] */ DWORD dwMilliseconds); + + HRESULT ( STDMETHODCALLTYPE *ReleaseSync )( + IDXGIKeyedMutex * This, + /* [in] */ UINT64 Key); + + END_INTERFACE + } IDXGIKeyedMutexVtbl; + + interface IDXGIKeyedMutex + { + CONST_VTBL struct IDXGIKeyedMutexVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIKeyedMutex_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIKeyedMutex_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIKeyedMutex_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIKeyedMutex_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIKeyedMutex_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIKeyedMutex_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIKeyedMutex_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIKeyedMutex_GetDevice(This,riid,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) ) + + +#define IDXGIKeyedMutex_AcquireSync(This,Key,dwMilliseconds) \ + ( (This)->lpVtbl -> AcquireSync(This,Key,dwMilliseconds) ) + +#define IDXGIKeyedMutex_ReleaseSync(This,Key) \ + ( (This)->lpVtbl -> ReleaseSync(This,Key) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIKeyedMutex_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0004 */ +/* [local] */ + +#define DXGI_MAP_READ ( 1UL ) + +#define DXGI_MAP_WRITE ( 2UL ) + +#define DXGI_MAP_DISCARD ( 4UL ) + + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0004_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0004_v0_0_s_ifspec; + +#ifndef __IDXGISurface_INTERFACE_DEFINED__ +#define __IDXGISurface_INTERFACE_DEFINED__ + +/* interface IDXGISurface */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGISurface; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("cafcb56c-6ac3-4889-bf47-9e23bbd260ec") + IDXGISurface : public IDXGIDeviceSubObject + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDesc( + /* [out] */ DXGI_SURFACE_DESC *pDesc) = 0; + + virtual HRESULT STDMETHODCALLTYPE Map( + /* [out] */ DXGI_MAPPED_RECT *pLockedRect, + /* [in] */ UINT MapFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE Unmap( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGISurfaceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGISurface * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGISurface * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGISurface * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGISurface * This, + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGISurface * This, + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGISurface * This, + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGISurface * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + IDXGISurface * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetDesc )( + IDXGISurface * This, + /* [out] */ DXGI_SURFACE_DESC *pDesc); + + HRESULT ( STDMETHODCALLTYPE *Map )( + IDXGISurface * This, + /* [out] */ DXGI_MAPPED_RECT *pLockedRect, + /* [in] */ UINT MapFlags); + + HRESULT ( STDMETHODCALLTYPE *Unmap )( + IDXGISurface * This); + + END_INTERFACE + } IDXGISurfaceVtbl; + + interface IDXGISurface + { + CONST_VTBL struct IDXGISurfaceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGISurface_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGISurface_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGISurface_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGISurface_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGISurface_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGISurface_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGISurface_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGISurface_GetDevice(This,riid,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) ) + + +#define IDXGISurface_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#define IDXGISurface_Map(This,pLockedRect,MapFlags) \ + ( (This)->lpVtbl -> Map(This,pLockedRect,MapFlags) ) + +#define IDXGISurface_Unmap(This) \ + ( (This)->lpVtbl -> Unmap(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGISurface_INTERFACE_DEFINED__ */ + + +#ifndef __IDXGISurface1_INTERFACE_DEFINED__ +#define __IDXGISurface1_INTERFACE_DEFINED__ + +/* interface IDXGISurface1 */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGISurface1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4AE63092-6327-4c1b-80AE-BFE12EA32B86") + IDXGISurface1 : public IDXGISurface + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDC( + /* [in] */ BOOL Discard, + /* [out] */ HDC *phdc) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReleaseDC( + /* [in] */ RECT *pDirtyRect) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGISurface1Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGISurface1 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGISurface1 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGISurface1 * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGISurface1 * This, + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGISurface1 * This, + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGISurface1 * This, + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGISurface1 * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + IDXGISurface1 * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *GetDesc )( + IDXGISurface1 * This, + /* [out] */ DXGI_SURFACE_DESC *pDesc); + + HRESULT ( STDMETHODCALLTYPE *Map )( + IDXGISurface1 * This, + /* [out] */ DXGI_MAPPED_RECT *pLockedRect, + /* [in] */ UINT MapFlags); + + HRESULT ( STDMETHODCALLTYPE *Unmap )( + IDXGISurface1 * This); + + HRESULT ( STDMETHODCALLTYPE *GetDC )( + IDXGISurface1 * This, + /* [in] */ BOOL Discard, + /* [out] */ HDC *phdc); + + HRESULT ( STDMETHODCALLTYPE *ReleaseDC )( + IDXGISurface1 * This, + /* [in] */ RECT *pDirtyRect); + + END_INTERFACE + } IDXGISurface1Vtbl; + + interface IDXGISurface1 + { + CONST_VTBL struct IDXGISurface1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGISurface1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGISurface1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGISurface1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGISurface1_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGISurface1_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGISurface1_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGISurface1_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGISurface1_GetDevice(This,riid,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) ) + + +#define IDXGISurface1_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#define IDXGISurface1_Map(This,pLockedRect,MapFlags) \ + ( (This)->lpVtbl -> Map(This,pLockedRect,MapFlags) ) + +#define IDXGISurface1_Unmap(This) \ + ( (This)->lpVtbl -> Unmap(This) ) + + +#define IDXGISurface1_GetDC(This,Discard,phdc) \ + ( (This)->lpVtbl -> GetDC(This,Discard,phdc) ) + +#define IDXGISurface1_ReleaseDC(This,pDirtyRect) \ + ( (This)->lpVtbl -> ReleaseDC(This,pDirtyRect) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGISurface1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0006 */ +/* [local] */ + + + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0006_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0006_v0_0_s_ifspec; + +#ifndef __IDXGIAdapter_INTERFACE_DEFINED__ +#define __IDXGIAdapter_INTERFACE_DEFINED__ + +/* interface IDXGIAdapter */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIAdapter; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2411e7e1-12ac-4ccf-bd14-9798e8534dc0") + IDXGIAdapter : public IDXGIObject + { + public: + virtual HRESULT STDMETHODCALLTYPE EnumOutputs( + /* [in] */ UINT Output, + /* [out][in] */ IDXGIOutput **ppOutput) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDesc( + /* [out] */ DXGI_ADAPTER_DESC *pDesc) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckInterfaceSupport( + /* [in] */ REFGUID InterfaceName, + /* [out] */ LARGE_INTEGER *pUMDVersion) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIAdapterVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIAdapter * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIAdapter * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIAdapter * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIAdapter * This, + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIAdapter * This, + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIAdapter * This, + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIAdapter * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *EnumOutputs )( + IDXGIAdapter * This, + /* [in] */ UINT Output, + /* [out][in] */ IDXGIOutput **ppOutput); + + HRESULT ( STDMETHODCALLTYPE *GetDesc )( + IDXGIAdapter * This, + /* [out] */ DXGI_ADAPTER_DESC *pDesc); + + HRESULT ( STDMETHODCALLTYPE *CheckInterfaceSupport )( + IDXGIAdapter * This, + /* [in] */ REFGUID InterfaceName, + /* [out] */ LARGE_INTEGER *pUMDVersion); + + END_INTERFACE + } IDXGIAdapterVtbl; + + interface IDXGIAdapter + { + CONST_VTBL struct IDXGIAdapterVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIAdapter_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIAdapter_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIAdapter_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIAdapter_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIAdapter_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIAdapter_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIAdapter_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIAdapter_EnumOutputs(This,Output,ppOutput) \ + ( (This)->lpVtbl -> EnumOutputs(This,Output,ppOutput) ) + +#define IDXGIAdapter_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#define IDXGIAdapter_CheckInterfaceSupport(This,InterfaceName,pUMDVersion) \ + ( (This)->lpVtbl -> CheckInterfaceSupport(This,InterfaceName,pUMDVersion) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIAdapter_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0007 */ +/* [local] */ + +#define DXGI_ENUM_MODES_INTERLACED ( 1UL ) + +#define DXGI_ENUM_MODES_SCALING ( 2UL ) + + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0007_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0007_v0_0_s_ifspec; + +#ifndef __IDXGIOutput_INTERFACE_DEFINED__ +#define __IDXGIOutput_INTERFACE_DEFINED__ + +/* interface IDXGIOutput */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIOutput; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("ae02eedb-c735-4690-8d52-5a8dc20213aa") + IDXGIOutput : public IDXGIObject + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDesc( + /* [out] */ DXGI_OUTPUT_DESC *pDesc) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDisplayModeList( + /* [in] */ DXGI_FORMAT EnumFormat, + /* [in] */ UINT Flags, + /* [out][in] */ UINT *pNumModes, + /* [out] */ DXGI_MODE_DESC *pDesc) = 0; + + virtual HRESULT STDMETHODCALLTYPE FindClosestMatchingMode( + /* [in] */ const DXGI_MODE_DESC *pModeToMatch, + /* [out] */ DXGI_MODE_DESC *pClosestMatch, + /* [in] */ IUnknown *pConcernedDevice) = 0; + + virtual HRESULT STDMETHODCALLTYPE WaitForVBlank( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE TakeOwnership( + /* [in] */ IUnknown *pDevice, + BOOL Exclusive) = 0; + + virtual void STDMETHODCALLTYPE ReleaseOwnership( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGammaControlCapabilities( + /* [out] */ DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetGammaControl( + /* [in] */ const DXGI_GAMMA_CONTROL *pArray) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGammaControl( + /* [out] */ DXGI_GAMMA_CONTROL *pArray) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetDisplaySurface( + /* [in] */ IDXGISurface *pScanoutSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDisplaySurfaceData( + /* [in] */ IDXGISurface *pDestination) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetFrameStatistics( + /* [out] */ DXGI_FRAME_STATISTICS *pStats) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIOutputVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIOutput * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIOutput * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIOutput * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIOutput * This, + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIOutput * This, + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIOutput * This, + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIOutput * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetDesc )( + IDXGIOutput * This, + /* [out] */ DXGI_OUTPUT_DESC *pDesc); + + HRESULT ( STDMETHODCALLTYPE *GetDisplayModeList )( + IDXGIOutput * This, + /* [in] */ DXGI_FORMAT EnumFormat, + /* [in] */ UINT Flags, + /* [out][in] */ UINT *pNumModes, + /* [out] */ DXGI_MODE_DESC *pDesc); + + HRESULT ( STDMETHODCALLTYPE *FindClosestMatchingMode )( + IDXGIOutput * This, + /* [in] */ const DXGI_MODE_DESC *pModeToMatch, + /* [out] */ DXGI_MODE_DESC *pClosestMatch, + /* [in] */ IUnknown *pConcernedDevice); + + HRESULT ( STDMETHODCALLTYPE *WaitForVBlank )( + IDXGIOutput * This); + + HRESULT ( STDMETHODCALLTYPE *TakeOwnership )( + IDXGIOutput * This, + /* [in] */ IUnknown *pDevice, + BOOL Exclusive); + + void ( STDMETHODCALLTYPE *ReleaseOwnership )( + IDXGIOutput * This); + + HRESULT ( STDMETHODCALLTYPE *GetGammaControlCapabilities )( + IDXGIOutput * This, + /* [out] */ DXGI_GAMMA_CONTROL_CAPABILITIES *pGammaCaps); + + HRESULT ( STDMETHODCALLTYPE *SetGammaControl )( + IDXGIOutput * This, + /* [in] */ const DXGI_GAMMA_CONTROL *pArray); + + HRESULT ( STDMETHODCALLTYPE *GetGammaControl )( + IDXGIOutput * This, + /* [out] */ DXGI_GAMMA_CONTROL *pArray); + + HRESULT ( STDMETHODCALLTYPE *SetDisplaySurface )( + IDXGIOutput * This, + /* [in] */ IDXGISurface *pScanoutSurface); + + HRESULT ( STDMETHODCALLTYPE *GetDisplaySurfaceData )( + IDXGIOutput * This, + /* [in] */ IDXGISurface *pDestination); + + HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )( + IDXGIOutput * This, + /* [out] */ DXGI_FRAME_STATISTICS *pStats); + + END_INTERFACE + } IDXGIOutputVtbl; + + interface IDXGIOutput + { + CONST_VTBL struct IDXGIOutputVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIOutput_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIOutput_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIOutput_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIOutput_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIOutput_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIOutput_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIOutput_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIOutput_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#define IDXGIOutput_GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) \ + ( (This)->lpVtbl -> GetDisplayModeList(This,EnumFormat,Flags,pNumModes,pDesc) ) + +#define IDXGIOutput_FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) \ + ( (This)->lpVtbl -> FindClosestMatchingMode(This,pModeToMatch,pClosestMatch,pConcernedDevice) ) + +#define IDXGIOutput_WaitForVBlank(This) \ + ( (This)->lpVtbl -> WaitForVBlank(This) ) + +#define IDXGIOutput_TakeOwnership(This,pDevice,Exclusive) \ + ( (This)->lpVtbl -> TakeOwnership(This,pDevice,Exclusive) ) + +#define IDXGIOutput_ReleaseOwnership(This) \ + ( (This)->lpVtbl -> ReleaseOwnership(This) ) + +#define IDXGIOutput_GetGammaControlCapabilities(This,pGammaCaps) \ + ( (This)->lpVtbl -> GetGammaControlCapabilities(This,pGammaCaps) ) + +#define IDXGIOutput_SetGammaControl(This,pArray) \ + ( (This)->lpVtbl -> SetGammaControl(This,pArray) ) + +#define IDXGIOutput_GetGammaControl(This,pArray) \ + ( (This)->lpVtbl -> GetGammaControl(This,pArray) ) + +#define IDXGIOutput_SetDisplaySurface(This,pScanoutSurface) \ + ( (This)->lpVtbl -> SetDisplaySurface(This,pScanoutSurface) ) + +#define IDXGIOutput_GetDisplaySurfaceData(This,pDestination) \ + ( (This)->lpVtbl -> GetDisplaySurfaceData(This,pDestination) ) + +#define IDXGIOutput_GetFrameStatistics(This,pStats) \ + ( (This)->lpVtbl -> GetFrameStatistics(This,pStats) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIOutput_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0008 */ +/* [local] */ + +#define DXGI_MAX_SWAP_CHAIN_BUFFERS ( 16 ) +#define DXGI_PRESENT_TEST 0x00000001UL +#define DXGI_PRESENT_DO_NOT_SEQUENCE 0x00000002UL +#define DXGI_PRESENT_RESTART 0x00000004UL + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0008_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0008_v0_0_s_ifspec; + +#ifndef __IDXGISwapChain_INTERFACE_DEFINED__ +#define __IDXGISwapChain_INTERFACE_DEFINED__ + +/* interface IDXGISwapChain */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGISwapChain; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("310d36a0-d2e7-4c0a-aa04-6a9d23b8886a") + IDXGISwapChain : public IDXGIDeviceSubObject + { + public: + virtual HRESULT STDMETHODCALLTYPE Present( + /* [in] */ UINT SyncInterval, + /* [in] */ UINT Flags) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetBuffer( + /* [in] */ UINT Buffer, + /* [in] */ REFIID riid, + /* [out][in] */ void **ppSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetFullscreenState( + /* [in] */ BOOL Fullscreen, + /* [in] */ IDXGIOutput *pTarget) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetFullscreenState( + /* [out] */ BOOL *pFullscreen, + /* [out] */ IDXGIOutput **ppTarget) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDesc( + /* [out] */ DXGI_SWAP_CHAIN_DESC *pDesc) = 0; + + virtual HRESULT STDMETHODCALLTYPE ResizeBuffers( + /* [in] */ UINT BufferCount, + /* [in] */ UINT Width, + /* [in] */ UINT Height, + /* [in] */ DXGI_FORMAT NewFormat, + /* [in] */ UINT SwapChainFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE ResizeTarget( + /* [in] */ const DXGI_MODE_DESC *pNewTargetParameters) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetContainingOutput( + IDXGIOutput **ppOutput) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetFrameStatistics( + /* [out] */ DXGI_FRAME_STATISTICS *pStats) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetLastPresentCount( + /* [out] */ UINT *pLastPresentCount) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGISwapChainVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGISwapChain * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGISwapChain * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGISwapChain * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGISwapChain * This, + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGISwapChain * This, + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGISwapChain * This, + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGISwapChain * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + IDXGISwapChain * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppDevice); + + HRESULT ( STDMETHODCALLTYPE *Present )( + IDXGISwapChain * This, + /* [in] */ UINT SyncInterval, + /* [in] */ UINT Flags); + + HRESULT ( STDMETHODCALLTYPE *GetBuffer )( + IDXGISwapChain * This, + /* [in] */ UINT Buffer, + /* [in] */ REFIID riid, + /* [out][in] */ void **ppSurface); + + HRESULT ( STDMETHODCALLTYPE *SetFullscreenState )( + IDXGISwapChain * This, + /* [in] */ BOOL Fullscreen, + /* [in] */ IDXGIOutput *pTarget); + + HRESULT ( STDMETHODCALLTYPE *GetFullscreenState )( + IDXGISwapChain * This, + /* [out] */ BOOL *pFullscreen, + /* [out] */ IDXGIOutput **ppTarget); + + HRESULT ( STDMETHODCALLTYPE *GetDesc )( + IDXGISwapChain * This, + /* [out] */ DXGI_SWAP_CHAIN_DESC *pDesc); + + HRESULT ( STDMETHODCALLTYPE *ResizeBuffers )( + IDXGISwapChain * This, + /* [in] */ UINT BufferCount, + /* [in] */ UINT Width, + /* [in] */ UINT Height, + /* [in] */ DXGI_FORMAT NewFormat, + /* [in] */ UINT SwapChainFlags); + + HRESULT ( STDMETHODCALLTYPE *ResizeTarget )( + IDXGISwapChain * This, + /* [in] */ const DXGI_MODE_DESC *pNewTargetParameters); + + HRESULT ( STDMETHODCALLTYPE *GetContainingOutput )( + IDXGISwapChain * This, + IDXGIOutput **ppOutput); + + HRESULT ( STDMETHODCALLTYPE *GetFrameStatistics )( + IDXGISwapChain * This, + /* [out] */ DXGI_FRAME_STATISTICS *pStats); + + HRESULT ( STDMETHODCALLTYPE *GetLastPresentCount )( + IDXGISwapChain * This, + /* [out] */ UINT *pLastPresentCount); + + END_INTERFACE + } IDXGISwapChainVtbl; + + interface IDXGISwapChain + { + CONST_VTBL struct IDXGISwapChainVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGISwapChain_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGISwapChain_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGISwapChain_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGISwapChain_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGISwapChain_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGISwapChain_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGISwapChain_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGISwapChain_GetDevice(This,riid,ppDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppDevice) ) + + +#define IDXGISwapChain_Present(This,SyncInterval,Flags) \ + ( (This)->lpVtbl -> Present(This,SyncInterval,Flags) ) + +#define IDXGISwapChain_GetBuffer(This,Buffer,riid,ppSurface) \ + ( (This)->lpVtbl -> GetBuffer(This,Buffer,riid,ppSurface) ) + +#define IDXGISwapChain_SetFullscreenState(This,Fullscreen,pTarget) \ + ( (This)->lpVtbl -> SetFullscreenState(This,Fullscreen,pTarget) ) + +#define IDXGISwapChain_GetFullscreenState(This,pFullscreen,ppTarget) \ + ( (This)->lpVtbl -> GetFullscreenState(This,pFullscreen,ppTarget) ) + +#define IDXGISwapChain_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#define IDXGISwapChain_ResizeBuffers(This,BufferCount,Width,Height,NewFormat,SwapChainFlags) \ + ( (This)->lpVtbl -> ResizeBuffers(This,BufferCount,Width,Height,NewFormat,SwapChainFlags) ) + +#define IDXGISwapChain_ResizeTarget(This,pNewTargetParameters) \ + ( (This)->lpVtbl -> ResizeTarget(This,pNewTargetParameters) ) + +#define IDXGISwapChain_GetContainingOutput(This,ppOutput) \ + ( (This)->lpVtbl -> GetContainingOutput(This,ppOutput) ) + +#define IDXGISwapChain_GetFrameStatistics(This,pStats) \ + ( (This)->lpVtbl -> GetFrameStatistics(This,pStats) ) + +#define IDXGISwapChain_GetLastPresentCount(This,pLastPresentCount) \ + ( (This)->lpVtbl -> GetLastPresentCount(This,pLastPresentCount) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGISwapChain_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0009 */ +/* [local] */ + +#define DXGI_MWA_NO_WINDOW_CHANGES ( 1 << 0 ) +#define DXGI_MWA_NO_ALT_ENTER ( 1 << 1 ) +#define DXGI_MWA_NO_PRINT_SCREEN ( 1 << 2 ) +#define DXGI_MWA_VALID ( 0x7 ) + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0009_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0009_v0_0_s_ifspec; + +#ifndef __IDXGIFactory_INTERFACE_DEFINED__ +#define __IDXGIFactory_INTERFACE_DEFINED__ + +/* interface IDXGIFactory */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7b7166ec-21c7-44ae-b21a-c9ae321ae369") + IDXGIFactory : public IDXGIObject + { + public: + virtual HRESULT STDMETHODCALLTYPE EnumAdapters( + /* [in] */ UINT Adapter, + /* [out] */ IDXGIAdapter **ppAdapter) = 0; + + virtual HRESULT STDMETHODCALLTYPE MakeWindowAssociation( + HWND WindowHandle, + UINT Flags) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetWindowAssociation( + HWND *pWindowHandle) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSwapChain( + IUnknown *pDevice, + DXGI_SWAP_CHAIN_DESC *pDesc, + IDXGISwapChain **ppSwapChain) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSoftwareAdapter( + /* [in] */ HMODULE Module, + /* [out] */ IDXGIAdapter **ppAdapter) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIFactory * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIFactory * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIFactory * This, + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIFactory * This, + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIFactory * This, + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIFactory * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *EnumAdapters )( + IDXGIFactory * This, + /* [in] */ UINT Adapter, + /* [out] */ IDXGIAdapter **ppAdapter); + + HRESULT ( STDMETHODCALLTYPE *MakeWindowAssociation )( + IDXGIFactory * This, + HWND WindowHandle, + UINT Flags); + + HRESULT ( STDMETHODCALLTYPE *GetWindowAssociation )( + IDXGIFactory * This, + HWND *pWindowHandle); + + HRESULT ( STDMETHODCALLTYPE *CreateSwapChain )( + IDXGIFactory * This, + IUnknown *pDevice, + DXGI_SWAP_CHAIN_DESC *pDesc, + IDXGISwapChain **ppSwapChain); + + HRESULT ( STDMETHODCALLTYPE *CreateSoftwareAdapter )( + IDXGIFactory * This, + /* [in] */ HMODULE Module, + /* [out] */ IDXGIAdapter **ppAdapter); + + END_INTERFACE + } IDXGIFactoryVtbl; + + interface IDXGIFactory + { + CONST_VTBL struct IDXGIFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIFactory_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIFactory_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIFactory_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIFactory_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIFactory_EnumAdapters(This,Adapter,ppAdapter) \ + ( (This)->lpVtbl -> EnumAdapters(This,Adapter,ppAdapter) ) + +#define IDXGIFactory_MakeWindowAssociation(This,WindowHandle,Flags) \ + ( (This)->lpVtbl -> MakeWindowAssociation(This,WindowHandle,Flags) ) + +#define IDXGIFactory_GetWindowAssociation(This,pWindowHandle) \ + ( (This)->lpVtbl -> GetWindowAssociation(This,pWindowHandle) ) + +#define IDXGIFactory_CreateSwapChain(This,pDevice,pDesc,ppSwapChain) \ + ( (This)->lpVtbl -> CreateSwapChain(This,pDevice,pDesc,ppSwapChain) ) + +#define IDXGIFactory_CreateSoftwareAdapter(This,Module,ppAdapter) \ + ( (This)->lpVtbl -> CreateSoftwareAdapter(This,Module,ppAdapter) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIFactory_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0010 */ +/* [local] */ + +HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **ppFactory); +HRESULT WINAPI CreateDXGIFactory1(REFIID riid, void **ppFactory); + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0010_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0010_v0_0_s_ifspec; + +#ifndef __IDXGIDevice_INTERFACE_DEFINED__ +#define __IDXGIDevice_INTERFACE_DEFINED__ + +/* interface IDXGIDevice */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIDevice; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("54ec77fa-1377-44e6-8c32-88fd5f44c84c") + IDXGIDevice : public IDXGIObject + { + public: + virtual HRESULT STDMETHODCALLTYPE GetAdapter( + /* [out] */ IDXGIAdapter **pAdapter) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSurface( + /* [in] */ const DXGI_SURFACE_DESC *pDesc, + /* [in] */ UINT NumSurfaces, + /* [in] */ DXGI_USAGE Usage, + /* [in] */ const DXGI_SHARED_RESOURCE *pSharedResource, + /* [out] */ IDXGISurface **ppSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE QueryResourceResidency( + /* [size_is][in] */ IUnknown *const *ppResources, + /* [size_is][out] */ DXGI_RESIDENCY *pResidencyStatus, + /* [in] */ UINT NumResources) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetGPUThreadPriority( + /* [in] */ INT Priority) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGPUThreadPriority( + /* [retval][out] */ INT *pPriority) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIDeviceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIDevice * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIDevice * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIDevice * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIDevice * This, + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIDevice * This, + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIDevice * This, + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIDevice * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetAdapter )( + IDXGIDevice * This, + /* [out] */ IDXGIAdapter **pAdapter); + + HRESULT ( STDMETHODCALLTYPE *CreateSurface )( + IDXGIDevice * This, + /* [in] */ const DXGI_SURFACE_DESC *pDesc, + /* [in] */ UINT NumSurfaces, + /* [in] */ DXGI_USAGE Usage, + /* [in] */ const DXGI_SHARED_RESOURCE *pSharedResource, + /* [out] */ IDXGISurface **ppSurface); + + HRESULT ( STDMETHODCALLTYPE *QueryResourceResidency )( + IDXGIDevice * This, + /* [size_is][in] */ IUnknown *const *ppResources, + /* [size_is][out] */ DXGI_RESIDENCY *pResidencyStatus, + /* [in] */ UINT NumResources); + + HRESULT ( STDMETHODCALLTYPE *SetGPUThreadPriority )( + IDXGIDevice * This, + /* [in] */ INT Priority); + + HRESULT ( STDMETHODCALLTYPE *GetGPUThreadPriority )( + IDXGIDevice * This, + /* [retval][out] */ INT *pPriority); + + END_INTERFACE + } IDXGIDeviceVtbl; + + interface IDXGIDevice + { + CONST_VTBL struct IDXGIDeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIDevice_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIDevice_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIDevice_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIDevice_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIDevice_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIDevice_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIDevice_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIDevice_GetAdapter(This,pAdapter) \ + ( (This)->lpVtbl -> GetAdapter(This,pAdapter) ) + +#define IDXGIDevice_CreateSurface(This,pDesc,NumSurfaces,Usage,pSharedResource,ppSurface) \ + ( (This)->lpVtbl -> CreateSurface(This,pDesc,NumSurfaces,Usage,pSharedResource,ppSurface) ) + +#define IDXGIDevice_QueryResourceResidency(This,ppResources,pResidencyStatus,NumResources) \ + ( (This)->lpVtbl -> QueryResourceResidency(This,ppResources,pResidencyStatus,NumResources) ) + +#define IDXGIDevice_SetGPUThreadPriority(This,Priority) \ + ( (This)->lpVtbl -> SetGPUThreadPriority(This,Priority) ) + +#define IDXGIDevice_GetGPUThreadPriority(This,pPriority) \ + ( (This)->lpVtbl -> GetGPUThreadPriority(This,pPriority) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIDevice_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0011 */ +/* [local] */ + +typedef +enum DXGI_ADAPTER_FLAG + { DXGI_ADAPTER_FLAG_NONE = 0, + DXGI_ADAPTER_FLAG_REMOTE = 1, + DXGI_ADAPTER_FLAG_FORCE_DWORD = 0xffffffff + } DXGI_ADAPTER_FLAG; + +typedef struct DXGI_ADAPTER_DESC1 + { + WCHAR Description[ 128 ]; + UINT VendorId; + UINT DeviceId; + UINT SubSysId; + UINT Revision; + SIZE_T DedicatedVideoMemory; + SIZE_T DedicatedSystemMemory; + SIZE_T SharedSystemMemory; + LUID AdapterLuid; + UINT Flags; + } DXGI_ADAPTER_DESC1; + +typedef struct DXGI_DISPLAY_COLOR_SPACE + { + FLOAT PrimaryCoordinates[ 8 ][ 2 ]; + FLOAT WhitePoints[ 16 ][ 2 ]; + } DXGI_DISPLAY_COLOR_SPACE; + + + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0011_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0011_v0_0_s_ifspec; + +#ifndef __IDXGIFactory1_INTERFACE_DEFINED__ +#define __IDXGIFactory1_INTERFACE_DEFINED__ + +/* interface IDXGIFactory1 */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIFactory1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("770aae78-f26f-4dba-a829-253c83d1b387") + IDXGIFactory1 : public IDXGIFactory + { + public: + virtual HRESULT STDMETHODCALLTYPE EnumAdapters1( + /* [in] */ UINT Adapter, + /* [out] */ IDXGIAdapter1 **ppAdapter) = 0; + + virtual BOOL STDMETHODCALLTYPE IsCurrent( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIFactory1Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIFactory1 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIFactory1 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIFactory1 * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIFactory1 * This, + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIFactory1 * This, + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIFactory1 * This, + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIFactory1 * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *EnumAdapters )( + IDXGIFactory1 * This, + /* [in] */ UINT Adapter, + /* [out] */ IDXGIAdapter **ppAdapter); + + HRESULT ( STDMETHODCALLTYPE *MakeWindowAssociation )( + IDXGIFactory1 * This, + HWND WindowHandle, + UINT Flags); + + HRESULT ( STDMETHODCALLTYPE *GetWindowAssociation )( + IDXGIFactory1 * This, + HWND *pWindowHandle); + + HRESULT ( STDMETHODCALLTYPE *CreateSwapChain )( + IDXGIFactory1 * This, + IUnknown *pDevice, + DXGI_SWAP_CHAIN_DESC *pDesc, + IDXGISwapChain **ppSwapChain); + + HRESULT ( STDMETHODCALLTYPE *CreateSoftwareAdapter )( + IDXGIFactory1 * This, + /* [in] */ HMODULE Module, + /* [out] */ IDXGIAdapter **ppAdapter); + + HRESULT ( STDMETHODCALLTYPE *EnumAdapters1 )( + IDXGIFactory1 * This, + /* [in] */ UINT Adapter, + /* [out] */ IDXGIAdapter1 **ppAdapter); + + BOOL ( STDMETHODCALLTYPE *IsCurrent )( + IDXGIFactory1 * This); + + END_INTERFACE + } IDXGIFactory1Vtbl; + + interface IDXGIFactory1 + { + CONST_VTBL struct IDXGIFactory1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIFactory1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIFactory1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIFactory1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIFactory1_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIFactory1_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIFactory1_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIFactory1_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIFactory1_EnumAdapters(This,Adapter,ppAdapter) \ + ( (This)->lpVtbl -> EnumAdapters(This,Adapter,ppAdapter) ) + +#define IDXGIFactory1_MakeWindowAssociation(This,WindowHandle,Flags) \ + ( (This)->lpVtbl -> MakeWindowAssociation(This,WindowHandle,Flags) ) + +#define IDXGIFactory1_GetWindowAssociation(This,pWindowHandle) \ + ( (This)->lpVtbl -> GetWindowAssociation(This,pWindowHandle) ) + +#define IDXGIFactory1_CreateSwapChain(This,pDevice,pDesc,ppSwapChain) \ + ( (This)->lpVtbl -> CreateSwapChain(This,pDevice,pDesc,ppSwapChain) ) + +#define IDXGIFactory1_CreateSoftwareAdapter(This,Module,ppAdapter) \ + ( (This)->lpVtbl -> CreateSoftwareAdapter(This,Module,ppAdapter) ) + + +#define IDXGIFactory1_EnumAdapters1(This,Adapter,ppAdapter) \ + ( (This)->lpVtbl -> EnumAdapters1(This,Adapter,ppAdapter) ) + +#define IDXGIFactory1_IsCurrent(This) \ + ( (This)->lpVtbl -> IsCurrent(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIFactory1_INTERFACE_DEFINED__ */ + + +#ifndef __IDXGIAdapter1_INTERFACE_DEFINED__ +#define __IDXGIAdapter1_INTERFACE_DEFINED__ + +/* interface IDXGIAdapter1 */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIAdapter1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("29038f61-3839-4626-91fd-086879011a05") + IDXGIAdapter1 : public IDXGIAdapter + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDesc1( + /* [out] */ DXGI_ADAPTER_DESC1 *pDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIAdapter1Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIAdapter1 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIAdapter1 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIAdapter1 * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIAdapter1 * This, + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIAdapter1 * This, + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIAdapter1 * This, + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIAdapter1 * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *EnumOutputs )( + IDXGIAdapter1 * This, + /* [in] */ UINT Output, + /* [out][in] */ IDXGIOutput **ppOutput); + + HRESULT ( STDMETHODCALLTYPE *GetDesc )( + IDXGIAdapter1 * This, + /* [out] */ DXGI_ADAPTER_DESC *pDesc); + + HRESULT ( STDMETHODCALLTYPE *CheckInterfaceSupport )( + IDXGIAdapter1 * This, + /* [in] */ REFGUID InterfaceName, + /* [out] */ LARGE_INTEGER *pUMDVersion); + + HRESULT ( STDMETHODCALLTYPE *GetDesc1 )( + IDXGIAdapter1 * This, + /* [out] */ DXGI_ADAPTER_DESC1 *pDesc); + + END_INTERFACE + } IDXGIAdapter1Vtbl; + + interface IDXGIAdapter1 + { + CONST_VTBL struct IDXGIAdapter1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIAdapter1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIAdapter1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIAdapter1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIAdapter1_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIAdapter1_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIAdapter1_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIAdapter1_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIAdapter1_EnumOutputs(This,Output,ppOutput) \ + ( (This)->lpVtbl -> EnumOutputs(This,Output,ppOutput) ) + +#define IDXGIAdapter1_GetDesc(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc(This,pDesc) ) + +#define IDXGIAdapter1_CheckInterfaceSupport(This,InterfaceName,pUMDVersion) \ + ( (This)->lpVtbl -> CheckInterfaceSupport(This,InterfaceName,pUMDVersion) ) + + +#define IDXGIAdapter1_GetDesc1(This,pDesc) \ + ( (This)->lpVtbl -> GetDesc1(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIAdapter1_INTERFACE_DEFINED__ */ + + +#ifndef __IDXGIDevice1_INTERFACE_DEFINED__ +#define __IDXGIDevice1_INTERFACE_DEFINED__ + +/* interface IDXGIDevice1 */ +/* [unique][local][uuid][object] */ + + +EXTERN_C const IID IID_IDXGIDevice1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("77db970f-6276-48ba-ba28-070143b4392c") + IDXGIDevice1 : public IDXGIDevice + { + public: + virtual HRESULT STDMETHODCALLTYPE SetMaximumFrameLatency( + /* [in] */ UINT MaxLatency) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetMaximumFrameLatency( + /* [out] */ UINT *pMaxLatency) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGIDevice1Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGIDevice1 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGIDevice1 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGIDevice1 * This); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + IDXGIDevice1 * This, + /* [in] */ REFGUID Name, + /* [in] */ UINT DataSize, + /* [in] */ const void *pData); + + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + IDXGIDevice1 * This, + /* [in] */ REFGUID Name, + /* [in] */ const IUnknown *pUnknown); + + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + IDXGIDevice1 * This, + /* [in] */ REFGUID Name, + /* [out][in] */ UINT *pDataSize, + /* [out] */ void *pData); + + HRESULT ( STDMETHODCALLTYPE *GetParent )( + IDXGIDevice1 * This, + /* [in] */ REFIID riid, + /* [retval][out] */ void **ppParent); + + HRESULT ( STDMETHODCALLTYPE *GetAdapter )( + IDXGIDevice1 * This, + /* [out] */ IDXGIAdapter **pAdapter); + + HRESULT ( STDMETHODCALLTYPE *CreateSurface )( + IDXGIDevice1 * This, + /* [in] */ const DXGI_SURFACE_DESC *pDesc, + /* [in] */ UINT NumSurfaces, + /* [in] */ DXGI_USAGE Usage, + /* [in] */ const DXGI_SHARED_RESOURCE *pSharedResource, + /* [out] */ IDXGISurface **ppSurface); + + HRESULT ( STDMETHODCALLTYPE *QueryResourceResidency )( + IDXGIDevice1 * This, + /* [size_is][in] */ IUnknown *const *ppResources, + /* [size_is][out] */ DXGI_RESIDENCY *pResidencyStatus, + /* [in] */ UINT NumResources); + + HRESULT ( STDMETHODCALLTYPE *SetGPUThreadPriority )( + IDXGIDevice1 * This, + /* [in] */ INT Priority); + + HRESULT ( STDMETHODCALLTYPE *GetGPUThreadPriority )( + IDXGIDevice1 * This, + /* [retval][out] */ INT *pPriority); + + HRESULT ( STDMETHODCALLTYPE *SetMaximumFrameLatency )( + IDXGIDevice1 * This, + /* [in] */ UINT MaxLatency); + + HRESULT ( STDMETHODCALLTYPE *GetMaximumFrameLatency )( + IDXGIDevice1 * This, + /* [out] */ UINT *pMaxLatency); + + END_INTERFACE + } IDXGIDevice1Vtbl; + + interface IDXGIDevice1 + { + CONST_VTBL struct IDXGIDevice1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGIDevice1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IDXGIDevice1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IDXGIDevice1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IDXGIDevice1_SetPrivateData(This,Name,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,Name,DataSize,pData) ) + +#define IDXGIDevice1_SetPrivateDataInterface(This,Name,pUnknown) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,Name,pUnknown) ) + +#define IDXGIDevice1_GetPrivateData(This,Name,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,Name,pDataSize,pData) ) + +#define IDXGIDevice1_GetParent(This,riid,ppParent) \ + ( (This)->lpVtbl -> GetParent(This,riid,ppParent) ) + + +#define IDXGIDevice1_GetAdapter(This,pAdapter) \ + ( (This)->lpVtbl -> GetAdapter(This,pAdapter) ) + +#define IDXGIDevice1_CreateSurface(This,pDesc,NumSurfaces,Usage,pSharedResource,ppSurface) \ + ( (This)->lpVtbl -> CreateSurface(This,pDesc,NumSurfaces,Usage,pSharedResource,ppSurface) ) + +#define IDXGIDevice1_QueryResourceResidency(This,ppResources,pResidencyStatus,NumResources) \ + ( (This)->lpVtbl -> QueryResourceResidency(This,ppResources,pResidencyStatus,NumResources) ) + +#define IDXGIDevice1_SetGPUThreadPriority(This,Priority) \ + ( (This)->lpVtbl -> SetGPUThreadPriority(This,Priority) ) + +#define IDXGIDevice1_GetGPUThreadPriority(This,pPriority) \ + ( (This)->lpVtbl -> GetGPUThreadPriority(This,pPriority) ) + + +#define IDXGIDevice1_SetMaximumFrameLatency(This,MaxLatency) \ + ( (This)->lpVtbl -> SetMaximumFrameLatency(This,MaxLatency) ) + +#define IDXGIDevice1_GetMaximumFrameLatency(This,pMaxLatency) \ + ( (This)->lpVtbl -> GetMaximumFrameLatency(This,pMaxLatency) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDXGIDevice1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxgi_0000_0014 */ +/* [local] */ + +#ifdef __cplusplus +#endif /*__cplusplus*/ +DEFINE_GUID(IID_IDXGIObject,0xaec22fb8,0x76f3,0x4639,0x9b,0xe0,0x28,0xeb,0x43,0xa6,0x7a,0x2e); +DEFINE_GUID(IID_IDXGIDeviceSubObject,0x3d3e0379,0xf9de,0x4d58,0xbb,0x6c,0x18,0xd6,0x29,0x92,0xf1,0xa6); +DEFINE_GUID(IID_IDXGIResource,0x035f3ab4,0x482e,0x4e50,0xb4,0x1f,0x8a,0x7f,0x8b,0xd8,0x96,0x0b); +DEFINE_GUID(IID_IDXGIKeyedMutex,0x9d8e1289,0xd7b3,0x465f,0x81,0x26,0x25,0x0e,0x34,0x9a,0xf8,0x5d); +DEFINE_GUID(IID_IDXGISurface,0xcafcb56c,0x6ac3,0x4889,0xbf,0x47,0x9e,0x23,0xbb,0xd2,0x60,0xec); +DEFINE_GUID(IID_IDXGISurface1,0x4AE63092,0x6327,0x4c1b,0x80,0xAE,0xBF,0xE1,0x2E,0xA3,0x2B,0x86); +DEFINE_GUID(IID_IDXGIAdapter,0x2411e7e1,0x12ac,0x4ccf,0xbd,0x14,0x97,0x98,0xe8,0x53,0x4d,0xc0); +DEFINE_GUID(IID_IDXGIOutput,0xae02eedb,0xc735,0x4690,0x8d,0x52,0x5a,0x8d,0xc2,0x02,0x13,0xaa); +DEFINE_GUID(IID_IDXGISwapChain,0x310d36a0,0xd2e7,0x4c0a,0xaa,0x04,0x6a,0x9d,0x23,0xb8,0x88,0x6a); +DEFINE_GUID(IID_IDXGIFactory,0x7b7166ec,0x21c7,0x44ae,0xb2,0x1a,0xc9,0xae,0x32,0x1a,0xe3,0x69); +DEFINE_GUID(IID_IDXGIDevice,0x54ec77fa,0x1377,0x44e6,0x8c,0x32,0x88,0xfd,0x5f,0x44,0xc8,0x4c); +DEFINE_GUID(IID_IDXGIFactory1,0x770aae78,0xf26f,0x4dba,0xa8,0x29,0x25,0x3c,0x83,0xd1,0xb3,0x87); +DEFINE_GUID(IID_IDXGIAdapter1,0x29038f61,0x3839,0x4626,0x91,0xfd,0x08,0x68,0x79,0x01,0x1a,0x05); +DEFINE_GUID(IID_IDXGIDevice1,0x77db970f,0x6276,0x48ba,0xba,0x28,0x07,0x01,0x43,0xb4,0x39,0x2c); + + +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0014_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxgi_0000_0014_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/Src/Decoder_H264_ALL/D3D/include/DXGIFormat.h b/Src/Decoder_H264_ALL/D3D/include/DXGIFormat.h new file mode 100644 index 0000000..e84f7f5 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/DXGIFormat.h @@ -0,0 +1,112 @@ + +#ifndef __dxgiformat_h__ +#define __dxgiformat_h__ + +#define DXGI_FORMAT_DEFINED 1 + +typedef enum DXGI_FORMAT +{ + DXGI_FORMAT_UNKNOWN = 0, + DXGI_FORMAT_R32G32B32A32_TYPELESS = 1, + DXGI_FORMAT_R32G32B32A32_FLOAT = 2, + DXGI_FORMAT_R32G32B32A32_UINT = 3, + DXGI_FORMAT_R32G32B32A32_SINT = 4, + DXGI_FORMAT_R32G32B32_TYPELESS = 5, + DXGI_FORMAT_R32G32B32_FLOAT = 6, + DXGI_FORMAT_R32G32B32_UINT = 7, + DXGI_FORMAT_R32G32B32_SINT = 8, + DXGI_FORMAT_R16G16B16A16_TYPELESS = 9, + DXGI_FORMAT_R16G16B16A16_FLOAT = 10, + DXGI_FORMAT_R16G16B16A16_UNORM = 11, + DXGI_FORMAT_R16G16B16A16_UINT = 12, + DXGI_FORMAT_R16G16B16A16_SNORM = 13, + DXGI_FORMAT_R16G16B16A16_SINT = 14, + DXGI_FORMAT_R32G32_TYPELESS = 15, + DXGI_FORMAT_R32G32_FLOAT = 16, + DXGI_FORMAT_R32G32_UINT = 17, + DXGI_FORMAT_R32G32_SINT = 18, + DXGI_FORMAT_R32G8X24_TYPELESS = 19, + DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20, + DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21, + DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22, + DXGI_FORMAT_R10G10B10A2_TYPELESS = 23, + DXGI_FORMAT_R10G10B10A2_UNORM = 24, + DXGI_FORMAT_R10G10B10A2_UINT = 25, + DXGI_FORMAT_R11G11B10_FLOAT = 26, + DXGI_FORMAT_R8G8B8A8_TYPELESS = 27, + DXGI_FORMAT_R8G8B8A8_UNORM = 28, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29, + DXGI_FORMAT_R8G8B8A8_UINT = 30, + DXGI_FORMAT_R8G8B8A8_SNORM = 31, + DXGI_FORMAT_R8G8B8A8_SINT = 32, + DXGI_FORMAT_R16G16_TYPELESS = 33, + DXGI_FORMAT_R16G16_FLOAT = 34, + DXGI_FORMAT_R16G16_UNORM = 35, + DXGI_FORMAT_R16G16_UINT = 36, + DXGI_FORMAT_R16G16_SNORM = 37, + DXGI_FORMAT_R16G16_SINT = 38, + DXGI_FORMAT_R32_TYPELESS = 39, + DXGI_FORMAT_D32_FLOAT = 40, + DXGI_FORMAT_R32_FLOAT = 41, + DXGI_FORMAT_R32_UINT = 42, + DXGI_FORMAT_R32_SINT = 43, + DXGI_FORMAT_R24G8_TYPELESS = 44, + DXGI_FORMAT_D24_UNORM_S8_UINT = 45, + DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46, + DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47, + DXGI_FORMAT_R8G8_TYPELESS = 48, + DXGI_FORMAT_R8G8_UNORM = 49, + DXGI_FORMAT_R8G8_UINT = 50, + DXGI_FORMAT_R8G8_SNORM = 51, + DXGI_FORMAT_R8G8_SINT = 52, + DXGI_FORMAT_R16_TYPELESS = 53, + DXGI_FORMAT_R16_FLOAT = 54, + DXGI_FORMAT_D16_UNORM = 55, + DXGI_FORMAT_R16_UNORM = 56, + DXGI_FORMAT_R16_UINT = 57, + DXGI_FORMAT_R16_SNORM = 58, + DXGI_FORMAT_R16_SINT = 59, + DXGI_FORMAT_R8_TYPELESS = 60, + DXGI_FORMAT_R8_UNORM = 61, + DXGI_FORMAT_R8_UINT = 62, + DXGI_FORMAT_R8_SNORM = 63, + DXGI_FORMAT_R8_SINT = 64, + DXGI_FORMAT_A8_UNORM = 65, + DXGI_FORMAT_R1_UNORM = 66, + DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67, + DXGI_FORMAT_R8G8_B8G8_UNORM = 68, + DXGI_FORMAT_G8R8_G8B8_UNORM = 69, + DXGI_FORMAT_BC1_TYPELESS = 70, + DXGI_FORMAT_BC1_UNORM = 71, + DXGI_FORMAT_BC1_UNORM_SRGB = 72, + DXGI_FORMAT_BC2_TYPELESS = 73, + DXGI_FORMAT_BC2_UNORM = 74, + DXGI_FORMAT_BC2_UNORM_SRGB = 75, + DXGI_FORMAT_BC3_TYPELESS = 76, + DXGI_FORMAT_BC3_UNORM = 77, + DXGI_FORMAT_BC3_UNORM_SRGB = 78, + DXGI_FORMAT_BC4_TYPELESS = 79, + DXGI_FORMAT_BC4_UNORM = 80, + DXGI_FORMAT_BC4_SNORM = 81, + DXGI_FORMAT_BC5_TYPELESS = 82, + DXGI_FORMAT_BC5_UNORM = 83, + DXGI_FORMAT_BC5_SNORM = 84, + DXGI_FORMAT_B5G6R5_UNORM = 85, + DXGI_FORMAT_B5G5R5A1_UNORM = 86, + DXGI_FORMAT_B8G8R8A8_UNORM = 87, + DXGI_FORMAT_B8G8R8X8_UNORM = 88, + DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89, + DXGI_FORMAT_B8G8R8A8_TYPELESS = 90, + DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91, + DXGI_FORMAT_B8G8R8X8_TYPELESS = 92, + DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93, + DXGI_FORMAT_BC6H_TYPELESS = 94, + DXGI_FORMAT_BC6H_UF16 = 95, + DXGI_FORMAT_BC6H_SF16 = 96, + DXGI_FORMAT_BC7_TYPELESS = 97, + DXGI_FORMAT_BC7_UNORM = 98, + DXGI_FORMAT_BC7_UNORM_SRGB = 99, + DXGI_FORMAT_FORCE_UINT = 0xffffffff +} DXGI_FORMAT; + +#endif // __dxgiformat_h__ diff --git a/Src/Decoder_H264_ALL/D3D/include/DXGIType.h b/Src/Decoder_H264_ALL/D3D/include/DXGIType.h new file mode 100644 index 0000000..89dd86a --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/DXGIType.h @@ -0,0 +1,123 @@ + +#ifndef __dxgitype_h__ +#define __dxgitype_h__ + + +#include "dxgiformat.h" + +#define _FACDXGI 0x87a +#define MAKE_DXGI_HRESULT(code) MAKE_HRESULT(1, _FACDXGI, code) +#define MAKE_DXGI_STATUS(code) MAKE_HRESULT(0, _FACDXGI, code) + +#define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1) +#define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2) +#define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4) +#define DXGI_STATUS_NO_DESKTOP_ACCESS MAKE_DXGI_STATUS(5) +#define DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_STATUS(6) +#define DXGI_STATUS_MODE_CHANGED MAKE_DXGI_STATUS(7) +#define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS MAKE_DXGI_STATUS(8) + + +#define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1) +#define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT(2) +#define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT(3) +#define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT(4) +#define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT(5) +#define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT(6) +#define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT(7) +#define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT(10) +#define DXGI_ERROR_FRAME_STATISTICS_DISJOINT MAKE_DXGI_HRESULT(11) +#define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_HRESULT(12) +#define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT(32) +#define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT(33) +#define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE MAKE_DXGI_HRESULT(34) +#define DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED MAKE_DXGI_HRESULT(35) +#define DXGI_ERROR_REMOTE_OUTOFMEMORY MAKE_DXGI_HRESULT(36) + + + +#define DXGI_CPU_ACCESS_NONE ( 0 ) +#define DXGI_CPU_ACCESS_DYNAMIC ( 1 ) +#define DXGI_CPU_ACCESS_READ_WRITE ( 2 ) +#define DXGI_CPU_ACCESS_SCRATCH ( 3 ) +#define DXGI_CPU_ACCESS_FIELD 15 + +#define DXGI_USAGE_SHADER_INPUT ( 1L << (0 + 4) ) +#define DXGI_USAGE_RENDER_TARGET_OUTPUT ( 1L << (1 + 4) ) +#define DXGI_USAGE_BACK_BUFFER ( 1L << (2 + 4) ) +#define DXGI_USAGE_SHARED ( 1L << (3 + 4) ) +#define DXGI_USAGE_READ_ONLY ( 1L << (4 + 4) ) +#define DXGI_USAGE_DISCARD_ON_PRESENT ( 1L << (5 + 4) ) +#define DXGI_USAGE_UNORDERED_ACCESS ( 1L << (6 + 4) ) + +typedef struct DXGI_RGB +{ + float Red; + float Green; + float Blue; +} DXGI_RGB; + +typedef struct DXGI_GAMMA_CONTROL +{ + DXGI_RGB Scale; + DXGI_RGB Offset; + DXGI_RGB GammaCurve[ 1025 ]; +} DXGI_GAMMA_CONTROL; + +typedef struct DXGI_GAMMA_CONTROL_CAPABILITIES +{ + BOOL ScaleAndOffsetSupported; + float MaxConvertedValue; + float MinConvertedValue; + UINT NumGammaControlPoints; + float ControlPointPositions[1025]; +} DXGI_GAMMA_CONTROL_CAPABILITIES; + +typedef struct DXGI_RATIONAL +{ + UINT Numerator; + UINT Denominator; +} DXGI_RATIONAL; + +typedef enum DXGI_MODE_SCANLINE_ORDER +{ + DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0, + DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1, + DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2, + DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3 +} DXGI_MODE_SCANLINE_ORDER; + +typedef enum DXGI_MODE_SCALING +{ + DXGI_MODE_SCALING_UNSPECIFIED = 0, + DXGI_MODE_SCALING_CENTERED = 1, + DXGI_MODE_SCALING_STRETCHED = 2 +} DXGI_MODE_SCALING; + +typedef enum DXGI_MODE_ROTATION +{ + DXGI_MODE_ROTATION_UNSPECIFIED = 0, + DXGI_MODE_ROTATION_IDENTITY = 1, + DXGI_MODE_ROTATION_ROTATE90 = 2, + DXGI_MODE_ROTATION_ROTATE180 = 3, + DXGI_MODE_ROTATION_ROTATE270 = 4 +} DXGI_MODE_ROTATION; + +typedef struct DXGI_MODE_DESC +{ + UINT Width; + UINT Height; + DXGI_RATIONAL RefreshRate; + DXGI_FORMAT Format; + DXGI_MODE_SCANLINE_ORDER ScanlineOrdering; + DXGI_MODE_SCALING Scaling; +} DXGI_MODE_DESC; + +typedef struct DXGI_SAMPLE_DESC +{ + UINT Count; + UINT Quality; +} DXGI_SAMPLE_DESC; + +#endif // __dxgitype_h__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/Dcommon.h b/Src/Decoder_H264_ALL/D3D/include/Dcommon.h new file mode 100644 index 0000000..4ecc5c1 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/Dcommon.h @@ -0,0 +1,65 @@ +//+-------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Abstract: +// Public API definitions for DWrite and D2D +// +//---------------------------------------------------------------------------- + +#ifndef DCOMMON_H_INCLUDED +#define DCOMMON_H_INCLUDED + +// +//These macros are defined in the Windows 7 SDK, however to enable development using the technical preview, +//they are included here temporarily. +// +#ifndef DEFINE_ENUM_FLAG_OPERATORS +#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \ +extern "C++" { \ +inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) | ((int)b)); } \ +inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \ +inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) & ((int)b)); } \ +inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \ +inline ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((int)a)); } \ +inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) ^ ((int)b)); } \ +inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \ +} +#endif + +#ifndef __field_ecount_opt +#define __field_ecount_opt(x) +#endif + +#ifndef __range +#define __range(x,y) +#endif + +#ifndef __field_ecount +#define __field_ecount(x) +#endif + +/// +/// The measuring method used for text layout. +/// +typedef enum DWRITE_MEASURING_MODE +{ + /// + /// Text is measured using glyph ideal metrics whose values are independent to the current display resolution. + /// + DWRITE_MEASURING_MODE_NATURAL, + + /// + /// Text is measured using glyph display compatible metrics whose values tuned for the current display resolution. + /// + DWRITE_MEASURING_MODE_GDI_CLASSIC, + + /// + /// Text is measured using the same glyph display metrics as text measured by GDI using a font + /// created with CLEARTYPE_NATURAL_QUALITY. + /// + DWRITE_MEASURING_MODE_GDI_NATURAL + +} DWRITE_MEASURING_MODE; + +#endif /* DCOMMON_H_INCLUDED */ diff --git a/Src/Decoder_H264_ALL/D3D/include/DxDiag.h b/Src/Decoder_H264_ALL/D3D/include/DxDiag.h new file mode 100644 index 0000000..602c88f --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/DxDiag.h @@ -0,0 +1,187 @@ +/*==========================================================================; + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: dxdiag.h + * Content: DirectX Diagnostic Tool include file + * + ****************************************************************************/ + +#ifndef _DXDIAG_H_ +#define _DXDIAG_H_ + +#include // for DECLARE_INTERFACE_ and HRESULT + +// This identifier is passed to IDxDiagProvider::Initialize in order to ensure that an +// application was built against the correct header files. This number is +// incremented whenever a header (or other) change would require applications +// to be rebuilt. If the version doesn't match, IDxDiagProvider::Initialize will fail. +// (The number itself has no meaning.) +#define DXDIAG_DX9_SDK_VERSION 111 + +#ifdef __cplusplus +extern "C" { +#endif + + +/**************************************************************************** + * + * DxDiag Errors + * + ****************************************************************************/ +#define DXDIAG_E_INSUFFICIENT_BUFFER ((HRESULT)0x8007007AL) // HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) + + +/**************************************************************************** + * + * DxDiag CLSIDs + * + ****************************************************************************/ + +// {A65B8071-3BFE-4213-9A5B-491DA4461CA7} +DEFINE_GUID(CLSID_DxDiagProvider, +0xA65B8071, 0x3BFE, 0x4213, 0x9A, 0x5B, 0x49, 0x1D, 0xA4, 0x46, 0x1C, 0xA7); + + +/**************************************************************************** + * + * DxDiag Interface IIDs + * + ****************************************************************************/ + +// {9C6B4CB0-23F8-49CC-A3ED-45A55000A6D2} +DEFINE_GUID(IID_IDxDiagProvider, +0x9C6B4CB0, 0x23F8, 0x49CC, 0xA3, 0xED, 0x45, 0xA5, 0x50, 0x00, 0xA6, 0xD2); + +// {0x7D0F462F-0x4064-0x4862-BC7F-933E5058C10F} +DEFINE_GUID(IID_IDxDiagContainer, +0x7D0F462F, 0x4064, 0x4862, 0xBC, 0x7F, 0x93, 0x3E, 0x50, 0x58, 0xC1, 0x0F); + + +/**************************************************************************** + * + * DxDiag Interface Pointer definitions + * + ****************************************************************************/ + +typedef struct IDxDiagProvider *LPDXDIAGPROVIDER, *PDXDIAGPROVIDER; + +typedef struct IDxDiagContainer *LPDXDIAGCONTAINER, *PDXDIAGCONTAINER; + + +/**************************************************************************** + * + * DxDiag Structures + * + ****************************************************************************/ + +typedef struct _DXDIAG_INIT_PARAMS +{ + DWORD dwSize; // Size of this structure. + DWORD dwDxDiagHeaderVersion; // Pass in DXDIAG_DX9_SDK_VERSION. This verifies + // the header and dll are correctly matched. + BOOL bAllowWHQLChecks; // If true, allow dxdiag to check if drivers are + // digital signed as logo'd by WHQL which may + // connect via internet to update WHQL certificates. + VOID* pReserved; // Reserved. Must be NULL. +} DXDIAG_INIT_PARAMS; + + +/**************************************************************************** + * + * DxDiag Application Interfaces + * + ****************************************************************************/ + +// +// COM definition for IDxDiagProvider +// +#undef INTERFACE // External COM Implementation +#define INTERFACE IDxDiagProvider +DECLARE_INTERFACE_(IDxDiagProvider,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /*** IDxDiagProvider methods ***/ + STDMETHOD(Initialize) (THIS_ DXDIAG_INIT_PARAMS* pParams) PURE; + STDMETHOD(GetRootContainer) (THIS_ IDxDiagContainer **ppInstance) PURE; +}; + + +// +// COM definition for IDxDiagContainer +// +#undef INTERFACE // External COM Implementation +#define INTERFACE IDxDiagContainer +DECLARE_INTERFACE_(IDxDiagContainer,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /*** IDxDiagContainer methods ***/ + STDMETHOD(GetNumberOfChildContainers) (THIS_ DWORD *pdwCount) PURE; + STDMETHOD(EnumChildContainerNames) (THIS_ DWORD dwIndex, LPWSTR pwszContainer, DWORD cchContainer) PURE; + STDMETHOD(GetChildContainer) (THIS_ LPCWSTR pwszContainer, IDxDiagContainer **ppInstance) PURE; + STDMETHOD(GetNumberOfProps) (THIS_ DWORD *pdwCount) PURE; + STDMETHOD(EnumPropNames) (THIS_ DWORD dwIndex, LPWSTR pwszPropName, DWORD cchPropName) PURE; + STDMETHOD(GetProp) (THIS_ LPCWSTR pwszPropName, VARIANT *pvarProp) PURE; +}; + + +/**************************************************************************** + * + * DxDiag application interface macros + * + ****************************************************************************/ + +#if !defined(__cplusplus) || defined(CINTERFACE) + +#define IDxDiagProvider_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDxDiagProvider_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDxDiagProvider_Release(p) (p)->lpVtbl->Release(p) +#define IDxDiagProvider_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDxDiagProvider_GetRootContainer(p,a) (p)->lpVtbl->GetRootContainer(p,a) + +#define IDxDiagContainer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDxDiagContainer_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDxDiagContainer_Release(p) (p)->lpVtbl->Release(p) +#define IDxDiagContainer_GetNumberOfChildContainers(p,a) (p)->lpVtbl->GetNumberOfChildContainers(p,a) +#define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->lpVtbl->EnumChildContainerNames(p,a,b,c) +#define IDxDiagContainer_GetChildContainer(p,a,b) (p)->lpVtbl->GetChildContainer(p,a,b) +#define IDxDiagContainer_GetNumberOfProps(p,a) (p)->lpVtbl->GetNumberOfProps(p,a) +#define IDxDiagContainer_EnumProps(p,a,b) (p)->lpVtbl->EnumProps(p,a,b,c) +#define IDxDiagContainer_GetProp(p,a,b) (p)->lpVtbl->GetProp(p,a,b) + +#else /* C++ */ + +#define IDxDiagProvider_QueryInterface(p,a,b) (p)->QueryInterface(p,a,b) +#define IDxDiagProvider_AddRef(p) (p)->AddRef(p) +#define IDxDiagProvider_Release(p) (p)->Release(p) +#define IDxDiagProvider_Initialize(p,a,b) (p)->Initialize(p,a,b) +#define IDxDiagProvider_GetRootContainer(p,a) (p)->GetRootContainer(p,a) + +#define IDxDiagContainer_QueryInterface(p,a,b) (p)->QueryInterface(p,a,b) +#define IDxDiagContainer_AddRef(p) (p)->AddRef(p) +#define IDxDiagContainer_Release(p) (p)->Release(p) +#define IDxDiagContainer_GetNumberOfChildContainers(p,a) (p)->GetNumberOfChildContainers(p,a) +#define IDxDiagContainer_EnumChildContainerNames(p,a,b,c) (p)->EnumChildContainerNames(p,a,b,c) +#define IDxDiagContainer_GetChildContainer(p,a,b) (p)->GetChildContainer(p,a,b) +#define IDxDiagContainer_GetNumberOfProps(p,a) (p)->GetNumberOfProps(p,a) +#define IDxDiagContainer_EnumProps(p,a,b) (p)->EnumProps(p,a,b,c) +#define IDxDiagContainer_GetProp(p,a,b) (p)->GetProp(p,a,b) + +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _DXDIAG_H_ */ + + diff --git a/Src/Decoder_H264_ALL/D3D/include/DxErr.h b/Src/Decoder_H264_ALL/D3D/include/DxErr.h new file mode 100644 index 0000000..2bd7591 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/DxErr.h @@ -0,0 +1,99 @@ +/*==========================================================================; + * + * + * File: dxerr.h + * Content: DirectX Error Library Include File + * + ****************************************************************************/ + +#ifndef _DXERR_H_ +#define _DXERR_H_ + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +// +// DXGetErrorString +// +// Desc: Converts a DirectX HRESULT to a string +// +// Args: HRESULT hr Can be any error code from +// XACT XAUDIO2 XAPO XINPUT DXGI D3D10 D3DX10 D3D9 D3DX9 DDRAW DSOUND DINPUT DSHOW +// +// Return: Converted string +// +const char* WINAPI DXGetErrorStringA(__in HRESULT hr); +const WCHAR* WINAPI DXGetErrorStringW(__in HRESULT hr); + +#ifdef UNICODE +#define DXGetErrorString DXGetErrorStringW +#else +#define DXGetErrorString DXGetErrorStringA +#endif + + +// +// DXGetErrorDescription +// +// Desc: Returns a string description of a DirectX HRESULT +// +// Args: HRESULT hr Can be any error code from +// XACT XAUDIO2 XAPO XINPUT DXGI D3D10 D3DX10 D3D9 D3DX9 DDRAW DSOUND DINPUT DSHOW +// +// Return: String description +// +const char* WINAPI DXGetErrorDescriptionA(__in HRESULT hr); +const WCHAR* WINAPI DXGetErrorDescriptionW(__in HRESULT hr); + +#ifdef UNICODE + #define DXGetErrorDescription DXGetErrorDescriptionW +#else + #define DXGetErrorDescription DXGetErrorDescriptionA +#endif + + +// +// DXTrace +// +// Desc: Outputs a formatted error message to the debug stream +// +// Args: CHAR* strFile The current file, typically passed in using the +// __FILE__ macro. +// DWORD dwLine The current line number, typically passed in using the +// __LINE__ macro. +// HRESULT hr An HRESULT that will be traced to the debug stream. +// CHAR* strMsg A string that will be traced to the debug stream (may be NULL) +// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info. +// +// Return: The hr that was passed in. +// +HRESULT WINAPI DXTraceA( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const char* strMsg, __in BOOL bPopMsgBox ); +HRESULT WINAPI DXTraceW( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const WCHAR* strMsg, __in BOOL bPopMsgBox ); + +#ifdef UNICODE +#define DXTrace DXTraceW +#else +#define DXTrace DXTraceA +#endif + + +// +// Helper macros +// +#if defined(DEBUG) | defined(_DEBUG) +#define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE ) +#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE ) +#define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE ) +#else +#define DXTRACE_MSG(str) (0L) +#define DXTRACE_ERR(str,hr) (hr) +#define DXTRACE_ERR_MSGBOX(str,hr) (hr) +#endif + + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif // _DXERR_H_ diff --git a/Src/Decoder_H264_ALL/D3D/include/PIXPlugin.h b/Src/Decoder_H264_ALL/D3D/include/PIXPlugin.h new file mode 100644 index 0000000..9c249af --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/PIXPlugin.h @@ -0,0 +1,120 @@ +//================================================================================================== +// PIXPlugin.h +// +// Microsoft PIX Plugin Header +// +// Copyright (c) Microsoft Corporation, All rights reserved +//================================================================================================== + +#pragma once + +#ifdef __cplusplus +extern "C" +{ +#endif + + +//================================================================================================== +// PIX_PLUGIN_SYSTEM_VERSION - Indicates version of the plugin interface the plugin is built with. +//================================================================================================== +#define PIX_PLUGIN_SYSTEM_VERSION 0x101 + + +//================================================================================================== +// PIXCOUNTERID - A unique identifier for each PIX plugin counter. +//================================================================================================== +typedef int PIXCOUNTERID; + + +//================================================================================================== +// PIXCOUNTERDATATYPE - Indicates what type of data the counter produces. +//================================================================================================== +enum PIXCOUNTERDATATYPE +{ + PCDT_RESERVED, + PCDT_FLOAT, + PCDT_INT, + PCDT_INT64, + PCDT_STRING, +}; + + +//================================================================================================== +// PIXPLUGININFO - This structure is filled out by PIXGetPluginInfo and passed back to PIX. +//================================================================================================== +struct PIXPLUGININFO +{ + // Filled in by caller: + HINSTANCE hinst; + + // Filled in by PIXGetPluginInfo: + WCHAR* pstrPluginName; // Name of plugin + int iPluginVersion; // Version of this particular plugin + int iPluginSystemVersion; // Version of PIX's plugin system this plugin was designed for +}; + + +//================================================================================================== +// PIXCOUNTERINFO - This structure is filled out by PIXGetCounterInfo and passed back to PIX +// to allow PIX to determine information about the counters in the plugin. +//================================================================================================== +struct PIXCOUNTERINFO +{ + PIXCOUNTERID counterID; // Used to uniquely ID this counter + WCHAR* pstrName; // String name of the counter + PIXCOUNTERDATATYPE pcdtDataType; // Data type returned by this counter +}; + + +//================================================================================================== +// PIXGetPluginInfo - This returns basic information about this plugin to PIX. +//================================================================================================== +BOOL WINAPI PIXGetPluginInfo( PIXPLUGININFO* pPIXPluginInfo ); + + +//================================================================================================== +// PIXGetCounterInfo - This returns an array of PIXCOUNTERINFO structs to PIX. +// These PIXCOUNTERINFOs allow PIX to enumerate the counters contained +// in this plugin. +//================================================================================================== +BOOL WINAPI PIXGetCounterInfo( DWORD* pdwReturnCounters, PIXCOUNTERINFO** ppCounterInfoList ); + + +//================================================================================================== +// PIXGetCounterDesc - This is called by PIX to request a description of the indicated counter. +//================================================================================================== +BOOL WINAPI PIXGetCounterDesc( PIXCOUNTERID id, WCHAR** ppstrCounterDesc ); + + +//================================================================================================== +// PIXBeginExperiment - This called by PIX once per counter when instrumentation starts. +//================================================================================================== +BOOL WINAPI PIXBeginExperiment( PIXCOUNTERID id, const WCHAR* pstrApplication ); + + +//================================================================================================== +// PIXEndFrame - This is called by PIX once per counter at the end of each frame to gather the +// counter value for that frame. Note that the pointer to the return data must +// continue to point to valid counter data until the next call to PIXEndFrame (or +// PIXEndExperiment) for the same counter. So do not set *ppReturnData to the same +// pointer for multiple counters, or point to a local variable that will go out of +// scope. See the sample PIX plugin for an example of how to structure a plugin +// properly. +//================================================================================================== +BOOL WINAPI PIXEndFrame( PIXCOUNTERID id, UINT iFrame, DWORD* pdwReturnBytes, BYTE** ppReturnData ); + + +//================================================================================================== +// PIXEndExperiment - This is called by PIX once per counter when instrumentation ends. +//================================================================================================== +BOOL WINAPI PIXEndExperiment( PIXCOUNTERID id ); + + +#ifdef __cplusplus +}; +#endif + +//================================================================================================== +// eof: PIXPlugin.h +//================================================================================================== + diff --git a/Src/Decoder_H264_ALL/D3D/include/X3DAudio.h b/Src/Decoder_H264_ALL/D3D/include/X3DAudio.h new file mode 100644 index 0000000..c25d98f --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/X3DAudio.h @@ -0,0 +1,316 @@ +/*-========================================================================-_ + | - X3DAUDIO - | + | Copyright (c) Microsoft Corporation. All rights reserved. | + |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| + |PROJECT: X3DAudio MODEL: Unmanaged User-mode | + |VERSION: 1.7 EXCEPT: No Exceptions | + |CLASS: N / A MINREQ: WinXP, Xbox360 | + |BASE: N / A DIALECT: MSC++ 14.00 | + |>------------------------------------------------------------------------<| + | DUTY: Cross-platform stand-alone 3D audio math library | + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ + NOTES: + 1. USE THE DEBUG DLL TO ENABLE PARAMETER VALIDATION VIA ASSERTS! + Here's how: + Copy X3DAudioDX_X.dll to where your application exists. + The debug DLL can be found under %WINDIR%\system32. + Rename X3DAudioDX_X.dll to X3DAudioX_X.dll to use the debug version. + + Only parameters required by DSP settings being calculated as + stipulated by the calculation control flags are validated. + + 2. Definition of terms: + LFE: Low Frequency Effect -- always omnidirectional. + LPF: Low Pass Filter, divided into two classifications: + Direct -- Applied to the direct signal path, + used for obstruction/occlusion effects. + Reverb -- Applied to the reverb signal path, + used for occlusion effects only. + + 3. Volume level is expressed as a linear amplitude scaler: + 1.0f represents no attenuation applied to the original signal, + 0.5f denotes an attenuation of 6dB, and 0.0f results in silence. + Amplification (volume > 1.0f) is also allowed, and is not clamped. + + LPF values range from 1.0f representing all frequencies pass through, + to 0.0f which results in silence as all frequencies are filtered out. + + 4. X3DAudio uses a left-handed Cartesian coordinate system with values + on the x-axis increasing from left to right, on the y-axis from + bottom to top, and on the z-axis from near to far. + Azimuths are measured clockwise from a given reference direction. + + Distance measurement is with respect to user-defined world units. + Applications may provide coordinates using any system of measure + as all non-normalized calculations are scale invariant, with such + operations natively occurring in user-defined world unit space. + Metric constants are supplied only as a convenience. + Distance is calculated using the Euclidean norm formula. + + 5. Only real values are permissible with functions using 32-bit + float parameters -- NAN and infinite values are not accepted. + All computation occurs in 32-bit precision mode. */ + +#pragma once +//---------------------------------------------------// +#include // general windows types +#if defined(_XBOX) + #include +#endif +#include // for D3DVECTOR + +// speaker geometry configuration flags, specifies assignment of channels to speaker positions, defined as per WAVEFORMATEXTENSIBLE.dwChannelMask +#if !defined(_SPEAKER_POSITIONS_) + #define _SPEAKER_POSITIONS_ + #define SPEAKER_FRONT_LEFT 0x00000001 + #define SPEAKER_FRONT_RIGHT 0x00000002 + #define SPEAKER_FRONT_CENTER 0x00000004 + #define SPEAKER_LOW_FREQUENCY 0x00000008 + #define SPEAKER_BACK_LEFT 0x00000010 + #define SPEAKER_BACK_RIGHT 0x00000020 + #define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040 + #define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080 + #define SPEAKER_BACK_CENTER 0x00000100 + #define SPEAKER_SIDE_LEFT 0x00000200 + #define SPEAKER_SIDE_RIGHT 0x00000400 + #define SPEAKER_TOP_CENTER 0x00000800 + #define SPEAKER_TOP_FRONT_LEFT 0x00001000 + #define SPEAKER_TOP_FRONT_CENTER 0x00002000 + #define SPEAKER_TOP_FRONT_RIGHT 0x00004000 + #define SPEAKER_TOP_BACK_LEFT 0x00008000 + #define SPEAKER_TOP_BACK_CENTER 0x00010000 + #define SPEAKER_TOP_BACK_RIGHT 0x00020000 + #define SPEAKER_RESERVED 0x7FFC0000 // bit mask locations reserved for future use + #define SPEAKER_ALL 0x80000000 // used to specify that any possible permutation of speaker configurations +#endif + +// standard speaker geometry configurations, used with X3DAudioInitialize +#if !defined(SPEAKER_MONO) + #define SPEAKER_MONO SPEAKER_FRONT_CENTER + #define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT) + #define SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY) + #define SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER) + #define SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) + #define SPEAKER_4POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) + #define SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) + #define SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER) + #define SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) + #define SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) +#endif + +// Xbox360 speaker geometry configuration, used with X3DAudioInitialize +#if defined(_XBOX) + #define SPEAKER_XBOX SPEAKER_5POINT1 +#endif + + +// size of instance handle in bytes +#define X3DAUDIO_HANDLE_BYTESIZE 20 + +// float math constants +#define X3DAUDIO_PI 3.141592654f +#define X3DAUDIO_2PI 6.283185307f + +// speed of sound in meters per second for dry air at approximately 20C, used with X3DAudioInitialize +#define X3DAUDIO_SPEED_OF_SOUND 343.5f + +// calculation control flags, used with X3DAudioCalculate +#define X3DAUDIO_CALCULATE_MATRIX 0x00000001 // enable matrix coefficient table calculation +#define X3DAUDIO_CALCULATE_DELAY 0x00000002 // enable delay time array calculation (stereo final mix only) +#define X3DAUDIO_CALCULATE_LPF_DIRECT 0x00000004 // enable LPF direct-path coefficient calculation +#define X3DAUDIO_CALCULATE_LPF_REVERB 0x00000008 // enable LPF reverb-path coefficient calculation +#define X3DAUDIO_CALCULATE_REVERB 0x00000010 // enable reverb send level calculation +#define X3DAUDIO_CALCULATE_DOPPLER 0x00000020 // enable doppler shift factor calculation +#define X3DAUDIO_CALCULATE_EMITTER_ANGLE 0x00000040 // enable emitter-to-listener interior angle calculation + +#define X3DAUDIO_CALCULATE_ZEROCENTER 0x00010000 // do not position to front center speaker, signal positioned to remaining speakers instead, front center destination channel will be zero in returned matrix coefficient table, valid only for matrix calculations with final mix formats that have a front center channel +#define X3DAUDIO_CALCULATE_REDIRECT_TO_LFE 0x00020000 // apply equal mix of all source channels to LFE destination channel, valid only for matrix calculations with sources that have no LFE channel and final mix formats that have an LFE channel + + +//-----------------------------------------------------// +#pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments + + +// primitive types +typedef float FLOAT32; // 32-bit IEEE float +typedef D3DVECTOR X3DAUDIO_VECTOR; // float 3D vector + +// instance handle of precalculated constants +typedef BYTE X3DAUDIO_HANDLE[X3DAUDIO_HANDLE_BYTESIZE]; + + +// Distance curve point: +// Defines a DSP setting at a given normalized distance. +typedef struct X3DAUDIO_DISTANCE_CURVE_POINT +{ + FLOAT32 Distance; // normalized distance, must be within [0.0f, 1.0f] + FLOAT32 DSPSetting; // DSP setting +} X3DAUDIO_DISTANCE_CURVE_POINT, *LPX3DAUDIO_DISTANCE_CURVE_POINT; + +// Distance curve: +// A piecewise curve made up of linear segments used to +// define DSP behaviour with respect to normalized distance. +// +// Note that curve point distances are normalized within [0.0f, 1.0f]. +// X3DAUDIO_EMITTER.CurveDistanceScaler must be used to scale the +// normalized distances to user-defined world units. +// For distances beyond CurveDistanceScaler * 1.0f, +// pPoints[PointCount-1].DSPSetting is used as the DSP setting. +// +// All distance curve spans must be such that: +// pPoints[k-1].DSPSetting + ((pPoints[k].DSPSetting-pPoints[k-1].DSPSetting) / (pPoints[k].Distance-pPoints[k-1].Distance)) * (pPoints[k].Distance-pPoints[k-1].Distance) != NAN or infinite values +// For all points in the distance curve where 1 <= k < PointCount. +typedef struct X3DAUDIO_DISTANCE_CURVE +{ + X3DAUDIO_DISTANCE_CURVE_POINT* pPoints; // distance curve point array, must have at least PointCount elements with no duplicates and be sorted in ascending order with respect to Distance + UINT32 PointCount; // number of distance curve points, must be >= 2 as all distance curves must have at least two endpoints, defining DSP settings at 0.0f and 1.0f normalized distance +} X3DAUDIO_DISTANCE_CURVE, *LPX3DAUDIO_DISTANCE_CURVE; +static const X3DAUDIO_DISTANCE_CURVE_POINT X3DAudioDefault_LinearCurvePoints[2] = { 0.0f, 1.0f, 1.0f, 0.0f }; +static const X3DAUDIO_DISTANCE_CURVE X3DAudioDefault_LinearCurve = { (X3DAUDIO_DISTANCE_CURVE_POINT*)&X3DAudioDefault_LinearCurvePoints[0], 2 }; + +// Cone: +// Specifies directionality for a listener or single-channel emitter by +// modifying DSP behaviour with respect to its front orientation. +// This is modeled using two sound cones: an inner cone and an outer cone. +// On/within the inner cone, DSP settings are scaled by the inner values. +// On/beyond the outer cone, DSP settings are scaled by the outer values. +// If on both the cones, DSP settings are scaled by the inner values only. +// Between the two cones, the scaler is linearly interpolated between the +// inner and outer values. Set both cone angles to 0 or X3DAUDIO_2PI for +// omnidirectionality using only the outer or inner values respectively. +typedef struct X3DAUDIO_CONE +{ + FLOAT32 InnerAngle; // inner cone angle in radians, must be within [0.0f, X3DAUDIO_2PI] + FLOAT32 OuterAngle; // outer cone angle in radians, must be within [InnerAngle, X3DAUDIO_2PI] + + FLOAT32 InnerVolume; // volume level scaler on/within inner cone, used only for matrix calculations, must be within [0.0f, 2.0f] when used + FLOAT32 OuterVolume; // volume level scaler on/beyond outer cone, used only for matrix calculations, must be within [0.0f, 2.0f] when used + FLOAT32 InnerLPF; // LPF (both direct and reverb paths) coefficient subtrahend on/within inner cone, used only for LPF (both direct and reverb paths) calculations, must be within [0.0f, 1.0f] when used + FLOAT32 OuterLPF; // LPF (both direct and reverb paths) coefficient subtrahend on/beyond outer cone, used only for LPF (both direct and reverb paths) calculations, must be within [0.0f, 1.0f] when used + FLOAT32 InnerReverb; // reverb send level scaler on/within inner cone, used only for reverb calculations, must be within [0.0f, 2.0f] when used + FLOAT32 OuterReverb; // reverb send level scaler on/beyond outer cone, used only for reverb calculations, must be within [0.0f, 2.0f] when used +} X3DAUDIO_CONE, *LPX3DAUDIO_CONE; +static const X3DAUDIO_CONE X3DAudioDefault_DirectionalCone = { X3DAUDIO_PI/2, X3DAUDIO_PI, 1.0f, 0.708f, 0.0f, 0.25f, 0.708f, 1.0f }; + + +// Listener: +// Defines a point of 3D audio reception. +// +// The cone is directed by the listener's front orientation. +typedef struct X3DAUDIO_LISTENER +{ + X3DAUDIO_VECTOR OrientFront; // orientation of front direction, used only for matrix and delay calculations or listeners with cones for matrix, LPF (both direct and reverb paths), and reverb calculations, must be normalized when used + X3DAUDIO_VECTOR OrientTop; // orientation of top direction, used only for matrix and delay calculations, must be orthonormal with OrientFront when used + + X3DAUDIO_VECTOR Position; // position in user-defined world units, does not affect Velocity + X3DAUDIO_VECTOR Velocity; // velocity vector in user-defined world units/second, used only for doppler calculations, does not affect Position + + X3DAUDIO_CONE* pCone; // sound cone, used only for matrix, LPF (both direct and reverb paths), and reverb calculations, NULL specifies omnidirectionality +} X3DAUDIO_LISTENER, *LPX3DAUDIO_LISTENER; + +// Emitter: +// Defines a 3D audio source, divided into two classifications: +// +// Single-point -- For use with single-channel sounds. +// Positioned at the emitter base, i.e. the channel radius +// and azimuth are ignored if the number of channels == 1. +// +// May be omnidirectional or directional using a cone. +// The cone originates from the emitter base position, +// and is directed by the emitter's front orientation. +// +// Multi-point -- For use with multi-channel sounds. +// Each non-LFE channel is positioned using an +// azimuth along the channel radius with respect to the +// front orientation vector in the plane orthogonal to the +// top orientation vector. An azimuth of X3DAUDIO_2PI +// specifies a channel is an LFE. Such channels are +// positioned at the emitter base and are calculated +// with respect to pLFECurve only, never pVolumeCurve. +// +// Multi-point emitters are always omnidirectional, +// i.e. the cone is ignored if the number of channels > 1. +// +// Note that many properties are shared among all channel points, +// locking certain behaviour with respect to the emitter base position. +// For example, doppler shift is always calculated with respect to the +// emitter base position and so is constant for all its channel points. +// Distance curve calculations are also with respect to the emitter base +// position, with the curves being calculated independently of each other. +// For instance, volume and LFE calculations do not affect one another. +typedef struct X3DAUDIO_EMITTER +{ + X3DAUDIO_CONE* pCone; // sound cone, used only with single-channel emitters for matrix, LPF (both direct and reverb paths), and reverb calculations, NULL specifies omnidirectionality + X3DAUDIO_VECTOR OrientFront; // orientation of front direction, used only for emitter angle calculations or with multi-channel emitters for matrix calculations or single-channel emitters with cones for matrix, LPF (both direct and reverb paths), and reverb calculations, must be normalized when used + X3DAUDIO_VECTOR OrientTop; // orientation of top direction, used only with multi-channel emitters for matrix calculations, must be orthonormal with OrientFront when used + + X3DAUDIO_VECTOR Position; // position in user-defined world units, does not affect Velocity + X3DAUDIO_VECTOR Velocity; // velocity vector in user-defined world units/second, used only for doppler calculations, does not affect Position + + FLOAT32 InnerRadius; // inner radius, must be within [0.0f, FLT_MAX] + FLOAT32 InnerRadiusAngle; // inner radius angle, must be within [0.0f, X3DAUDIO_PI/4.0) + + UINT32 ChannelCount; // number of sound channels, must be > 0 + FLOAT32 ChannelRadius; // channel radius, used only with multi-channel emitters for matrix calculations, must be >= 0.0f when used + FLOAT32* pChannelAzimuths; // channel azimuth array, used only with multi-channel emitters for matrix calculations, contains positions of each channel expressed in radians along the channel radius with respect to the front orientation vector in the plane orthogonal to the top orientation vector, or X3DAUDIO_2PI to specify an LFE channel, must have at least ChannelCount elements, all within [0.0f, X3DAUDIO_2PI] when used + + X3DAUDIO_DISTANCE_CURVE* pVolumeCurve; // volume level distance curve, used only for matrix calculations, NULL specifies a default curve that conforms to the inverse square law, calculated in user-defined world units with distances <= CurveDistanceScaler clamped to no attenuation + X3DAUDIO_DISTANCE_CURVE* pLFECurve; // LFE level distance curve, used only for matrix calculations, NULL specifies a default curve that conforms to the inverse square law, calculated in user-defined world units with distances <= CurveDistanceScaler clamped to no attenuation + X3DAUDIO_DISTANCE_CURVE* pLPFDirectCurve; // LPF direct-path coefficient distance curve, used only for LPF direct-path calculations, NULL specifies the default curve: [0.0f,1.0f], [1.0f,0.75f] + X3DAUDIO_DISTANCE_CURVE* pLPFReverbCurve; // LPF reverb-path coefficient distance curve, used only for LPF reverb-path calculations, NULL specifies the default curve: [0.0f,0.75f], [1.0f,0.75f] + X3DAUDIO_DISTANCE_CURVE* pReverbCurve; // reverb send level distance curve, used only for reverb calculations, NULL specifies the default curve: [0.0f,1.0f], [1.0f,0.0f] + + FLOAT32 CurveDistanceScaler; // curve distance scaler, used to scale normalized distance curves to user-defined world units and/or exaggerate their effect, used only for matrix, LPF (both direct and reverb paths), and reverb calculations, must be within [FLT_MIN, FLT_MAX] when used + FLOAT32 DopplerScaler; // doppler shift scaler, used to exaggerate doppler shift effect, used only for doppler calculations, must be within [0.0f, FLT_MAX] when used +} X3DAUDIO_EMITTER, *LPX3DAUDIO_EMITTER; + + +// DSP settings: +// Receives results from a call to X3DAudioCalculate to be sent +// to the low-level audio rendering API for 3D signal processing. +// +// The user is responsible for allocating the matrix coefficient table, +// delay time array, and initializing the channel counts when used. +typedef struct X3DAUDIO_DSP_SETTINGS +{ + FLOAT32* pMatrixCoefficients; // [inout] matrix coefficient table, receives an array representing the volume level used to send from source channel S to destination channel D, stored as pMatrixCoefficients[SrcChannelCount * D + S], must have at least SrcChannelCount*DstChannelCount elements + FLOAT32* pDelayTimes; // [inout] delay time array, receives delays for each destination channel in milliseconds, must have at least DstChannelCount elements (stereo final mix only) + UINT32 SrcChannelCount; // [in] number of source channels, must equal number of channels in respective emitter + UINT32 DstChannelCount; // [in] number of destination channels, must equal number of channels of the final mix + + FLOAT32 LPFDirectCoefficient; // [out] LPF direct-path coefficient + FLOAT32 LPFReverbCoefficient; // [out] LPF reverb-path coefficient + FLOAT32 ReverbLevel; // [out] reverb send level + FLOAT32 DopplerFactor; // [out] doppler shift factor, scales resampler ratio for doppler shift effect, where the effective frequency = DopplerFactor * original frequency + FLOAT32 EmitterToListenerAngle; // [out] emitter-to-listener interior angle, expressed in radians with respect to the emitter's front orientation + + FLOAT32 EmitterToListenerDistance; // [out] distance in user-defined world units from the emitter base to listener position, always calculated + FLOAT32 EmitterVelocityComponent; // [out] component of emitter velocity vector projected onto emitter->listener vector in user-defined world units/second, calculated only for doppler + FLOAT32 ListenerVelocityComponent; // [out] component of listener velocity vector projected onto emitter->listener vector in user-defined world units/second, calculated only for doppler +} X3DAUDIO_DSP_SETTINGS, *LPX3DAUDIO_DSP_SETTINGS; + + +//-------------------------------------------------------------// +// function storage-class attribute and calltype +#if defined(_XBOX) || defined(X3DAUDIOSTATIC) + #define X3DAUDIO_API_(type) EXTERN_C type STDAPIVCALLTYPE +#else + #if defined(X3DEXPORT) + #define X3DAUDIO_API_(type) EXTERN_C __declspec(dllexport) type STDAPIVCALLTYPE + #else + #define X3DAUDIO_API_(type) EXTERN_C __declspec(dllimport) type STDAPIVCALLTYPE + #endif +#endif +#define X3DAUDIO_IMP_(type) type STDMETHODVCALLTYPE + + +//-------------------------------------------------------// +// initializes instance handle +X3DAUDIO_API_(void) X3DAudioInitialize (UINT32 SpeakerChannelMask, FLOAT32 SpeedOfSound, __out X3DAUDIO_HANDLE Instance); + +// calculates DSP settings with respect to 3D parameters +X3DAUDIO_API_(void) X3DAudioCalculate (__in const X3DAUDIO_HANDLE Instance, __in const X3DAUDIO_LISTENER* pListener, __in const X3DAUDIO_EMITTER* pEmitter, UINT32 Flags, __inout X3DAUDIO_DSP_SETTINGS* pDSPSettings); + + +#pragma pack(pop) // revert packing alignment +//---------------------------------<-EOF->----------------------------------// diff --git a/Src/Decoder_H264_ALL/D3D/include/XAPO.h b/Src/Decoder_H264_ALL/D3D/include/XAPO.h new file mode 100644 index 0000000..17947d6 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/XAPO.h @@ -0,0 +1,645 @@ +/*-========================================================================-_ + | - XAPO - | + | Copyright (c) Microsoft Corporation. All rights reserved. | + |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| + |PROJECT: XAPO MODEL: Unmanaged User-mode | + |VERSION: 1.0 EXCEPT: No Exceptions | + |CLASS: N / A MINREQ: WinXP, Xbox360 | + |BASE: N / A DIALECT: MSC++ 14.00 | + |>------------------------------------------------------------------------<| + | DUTY: Cross-platform Audio Processing Object interfaces | + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ + NOTES: + 1. Definition of terms: + DSP: Digital Signal Processing. + + CBR: Constant BitRate -- DSP that consumes a constant number of + input samples to produce an output sample. + For example, a 22kHz to 44kHz resampler is CBR DSP. + Even though the number of input to output samples differ, + the ratio between input to output rate remains constant. + All user-defined XAPOs are assumed to be CBR as + XAudio2 only allows CBR DSP to be added to an effect chain. + + XAPO: Cross-platform Audio Processing Object -- + a thin wrapper that manages DSP code, allowing it + to be easily plugged into an XAudio2 effect chain. + + Frame: A block of samples, one per channel, + to be played simultaneously. + + In-Place: Processing such that the input buffer equals the + output buffer (i.e. input data modified directly). + This form of processing is generally more efficient + than using separate memory for input and output. + However, an XAPO may not perform format conversion + when processing in-place. + + 2. XAPO member variables are divided into three classifications: + Immutable: Set once via IXAPO::Initialize and remain + constant during the lifespan of the XAPO. + + Locked: May change before the XAPO is locked via + IXAPO::LockForProcess but remain constant + until IXAPO::UnlockForProcess is called. + + Dynamic: May change from one processing pass to the next, + usually via IXAPOParameters::SetParameters. + XAPOs should assign reasonable defaults to their dynamic + variables during IXAPO::Initialize/LockForProcess so + that calling IXAPOParameters::SetParameters is not + required before processing begins. + + When implementing an XAPO, determine the type of each variable and + initialize them in the appropriate method. Immutable variables are + generally preferable over locked which are preferable over dynamic. + That is, one should strive to minimize XAPO state changes for + best performance, maintainability, and ease of use. + + 3. To minimize glitches, the realtime audio processing thread must + not block. XAPO methods called by the realtime thread are commented + as non-blocking and therefore should not use blocking synchronization, + allocate memory, access the disk, etc. The XAPO interfaces were + designed to allow an effect implementer to move such operations + into other methods called on an application controlled thread. + + 4. Extending functionality is accomplished through the addition of new + COM interfaces. For example, if a new member is added to a parameter + structure, a new interface using the new structure should be added, + leaving the original interface unchanged. + This ensures consistent communication between future versions of + XAudio2 and various versions of XAPOs that may exist in an application. + + 5. All audio data is interleaved in XAudio2. + The default audio format for an effect chain is WAVE_FORMAT_IEEE_FLOAT. + + 6. User-defined XAPOs should assume all input and output buffers are + 16-byte aligned. + + 7. See XAPOBase.h for an XAPO base class which provides a default + implementation for most of the interface methods defined below. */ + +#pragma once +//---------------------------------------------------// +#include "comdecl.h" // for DEFINE_IID + +// XAPO interface IDs +DEFINE_IID(IXAPO, A90BC001, E897, E897, 55, E4, 9E, 47, 00, 00, 00, 00); +DEFINE_IID(IXAPOParameters, A90BC001, E897, E897, 55, E4, 9E, 47, 00, 00, 00, 01); + + +#if !defined(GUID_DEFS_ONLY) // ignore rest if only GUID definitions requested + #if defined(_XBOX) // general windows and COM declarations + #include + #include + #else + #include + #include + #endif + #include "audiodefs.h" // for WAVEFORMATEX etc. + + // XAPO error codes + #define FACILITY_XAPO 0x897 + #define XAPO_E_FORMAT_UNSUPPORTED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_XAPO, 0x01) // requested audio format unsupported + + // supported number of channels (samples per frame) range + #define XAPO_MIN_CHANNELS 1 + #define XAPO_MAX_CHANNELS 64 + + // supported framerate range + #define XAPO_MIN_FRAMERATE 1000 + #define XAPO_MAX_FRAMERATE 200000 + + // unicode string length, including terminator, used with XAPO_REGISTRATION_PROPERTIES + #define XAPO_REGISTRATION_STRING_LENGTH 256 + + + // XAPO property flags, used with XAPO_REGISTRATION_PROPERTIES.Flags: + // Number of channels of input and output buffers must match, + // applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat. + #define XAPO_FLAG_CHANNELS_MUST_MATCH 0x00000001 + + // Framerate of input and output buffers must match, + // applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat. + #define XAPO_FLAG_FRAMERATE_MUST_MATCH 0x00000002 + + // Bit depth of input and output buffers must match, + // applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat. + // Container size of input and output buffers must also match if + // XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat is WAVEFORMATEXTENSIBLE. + #define XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH 0x00000004 + + // Number of input and output buffers must match, + // applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS. + // + // Also, XAPO_REGISTRATION_PROPERTIES.MinInputBufferCount must + // equal XAPO_REGISTRATION_PROPERTIES.MinOutputBufferCount and + // XAPO_REGISTRATION_PROPERTIES.MaxInputBufferCount must equal + // XAPO_REGISTRATION_PROPERTIES.MaxOutputBufferCount when used. + #define XAPO_FLAG_BUFFERCOUNT_MUST_MATCH 0x00000008 + + // XAPO must be run in-place. Use this flag only if your DSP + // implementation cannot process separate input and output buffers. + // If set, the following flags must also be set: + // XAPO_FLAG_CHANNELS_MUST_MATCH + // XAPO_FLAG_FRAMERATE_MUST_MATCH + // XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH + // XAPO_FLAG_BUFFERCOUNT_MUST_MATCH + // XAPO_FLAG_INPLACE_SUPPORTED + // + // Multiple input and output buffers may be used with in-place XAPOs, + // though the input buffer count must equal the output buffer count. + // When multiple input/output buffers are used, the XAPO may assume + // input buffer [N] equals output buffer [N] for in-place processing. + #define XAPO_FLAG_INPLACE_REQUIRED 0x00000020 + + // XAPO may be run in-place. If the XAPO is used in a chain + // such that the requirements for XAPO_FLAG_INPLACE_REQUIRED are met, + // XAudio2 will ensure the XAPO is run in-place. If not met, XAudio2 + // will still run the XAPO albeit with separate input and output buffers. + // + // For example, consider an effect which may be ran in stereo->5.1 mode or + // mono->mono mode. When set to stereo->5.1, it will be run with separate + // input and output buffers as format conversion is not permitted in-place. + // However, if configured to run mono->mono, the same XAPO can be run + // in-place. Thus the same implementation may be conveniently reused + // for various input/output configurations, while taking advantage of + // in-place processing when possible. + #define XAPO_FLAG_INPLACE_SUPPORTED 0x00000010 + + +//-----------------------------------------------------// + #pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments + + + // XAPO registration properties, describes general XAPO characteristics, used with IXAPO::GetRegistrationProperties + typedef struct XAPO_REGISTRATION_PROPERTIES { + CLSID clsid; // COM class ID, used with CoCreate + WCHAR FriendlyName[XAPO_REGISTRATION_STRING_LENGTH]; // friendly name unicode string + WCHAR CopyrightInfo[XAPO_REGISTRATION_STRING_LENGTH]; // copyright information unicode string + UINT32 MajorVersion; // major version + UINT32 MinorVersion; // minor version + UINT32 Flags; // XAPO property flags, describes supported input/output configuration + UINT32 MinInputBufferCount; // minimum number of input buffers required for processing, can be 0 + UINT32 MaxInputBufferCount; // maximum number of input buffers supported for processing, must be >= MinInputBufferCount + UINT32 MinOutputBufferCount; // minimum number of output buffers required for processing, can be 0, must match MinInputBufferCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used + UINT32 MaxOutputBufferCount; // maximum number of output buffers supported for processing, must be >= MinOutputBufferCount, must match MaxInputBufferCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used + } XAPO_REGISTRATION_PROPERTIES; + + + // LockForProcess buffer parameters: + // Defines buffer parameters that remain constant while an XAPO is locked. + // Used with IXAPO::LockForProcess. + // + // For CBR XAPOs, MaxFrameCount is the only number of frames + // IXAPO::Process would have to handle for the respective buffer. + typedef struct XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS { + const WAVEFORMATEX* pFormat; // buffer audio format + UINT32 MaxFrameCount; // maximum number of frames in respective buffer that IXAPO::Process would have to handle, irrespective of dynamic variable settings, can be 0 + } XAPO_LOCKFORPROCESS_PARAMETERS; + + // Buffer flags: + // Describes assumed content of the respective buffer. + // Used with XAPO_PROCESS_BUFFER_PARAMETERS.BufferFlags. + // + // This meta-data can be used by an XAPO to implement + // optimizations that require knowledge of a buffer's content. + // + // For example, XAPOs that always produce silent output from silent input + // can check the flag on the input buffer to determine if any signal + // processing is necessary. If silent, the XAPO may simply set the flag + // on the output buffer to silent and return, optimizing out the work of + // processing silent data: XAPOs that generate silence for any reason may + // set the buffer's flag accordingly rather than writing out silent + // frames to the buffer itself. + // + // The flags represent what should be assumed is in the respective buffer. + // The flags may not reflect what is actually stored in memory. + typedef enum XAPO_BUFFER_FLAGS { + XAPO_BUFFER_SILENT, // silent data should be assumed, respective memory may be uninitialized + XAPO_BUFFER_VALID, // arbitrary data should be assumed (may or may not be silent frames), respective memory initialized + } XAPO_BUFFER_FLAGS; + + // Process buffer parameters: + // Defines buffer parameters that may change from one + // processing pass to the next. Used with IXAPO::Process. + // + // Note the byte size of the respective buffer must be at least: + // XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount * XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat->nBlockAlign + // + // Although the audio format and maximum size of the respective + // buffer is locked (defined by XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS), + // the actual memory address of the buffer given is permitted to change + // from one processing pass to the next. + // + // For CBR XAPOs, ValidFrameCount is constant while locked and equals + // the respective XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount. + typedef struct XAPO_PROCESS_BUFFER_PARAMETERS { + void* pBuffer; // audio data buffer, must be non-NULL + XAPO_BUFFER_FLAGS BufferFlags; // describes assumed content of pBuffer, does not affect ValidFrameCount + UINT32 ValidFrameCount; // number of frames of valid data, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs, does not affect BufferFlags + } XAPO_PROCESS_BUFFER_PARAMETERS; + + +//-------------------------------------------------------------// + // Memory allocation macros that allow one module to allocate memory and + // another to free it, by guaranteeing that the same heap manager is used + // regardless of differences between build environments of the two modules. + // + // Used by IXAPO methods that must allocate arbitrary sized structures + // such as WAVEFORMATEX that are subsequently returned to the application. + #if defined(_XBOX) + #define XAPO_ALLOC_ATTRIBUTES MAKE_XALLOC_ATTRIBUTES ( \ + 0, /* ObjectType */ \ + FALSE, /* HeapTracksAttributes */ \ + FALSE, /* MustSucceed */ \ + FALSE, /* FixedSize */ \ + eXALLOCAllocatorId_XAUDIO2, /* AllocatorId */ \ + XALLOC_ALIGNMENT_DEFAULT, /* Alignment */ \ + XALLOC_MEMPROTECT_READWRITE, /* MemoryProtect */ \ + FALSE, /* ZeroInitialize */ \ + XALLOC_MEMTYPE_HEAP /* MemoryType */ \ + ) + #define XAPOAlloc(size) XMemAlloc(size, XAPO_ALLOC_ATTRIBUTES) + #define XAPOFree(p) XMemFree(p, XAPO_ALLOC_ATTRIBUTES) + #else + #define XAPOAlloc(size) CoTaskMemAlloc(size) + #define XAPOFree(p) CoTaskMemFree(p) + #endif + + +//-----------------------------------------------------// + // IXAPO: + // The only mandatory XAPO COM interface -- a thin wrapper that manages + // DSP code, allowing it to be easily plugged into an XAudio2 effect chain. + #undef INTERFACE + #define INTERFACE IXAPO + DECLARE_INTERFACE_(IXAPO, IUnknown) { + //// + // DESCRIPTION: + // Allocates a copy of the registration properties of the XAPO. + // + // PARAMETERS: + // ppRegistrationProperties - [out] receives pointer to copy of registration properties, use XAPOFree to free structure, left untouched on failure + // + // RETURN VALUE: + // COM error code + //// + STDMETHOD(GetRegistrationProperties) (THIS_ __deref_out XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties) PURE; + + //// + // DESCRIPTION: + // Queries if an input/output configuration is supported. + // + // REMARKS: + // This method allows XAPOs to express dependency of input format + // with respect to output format. + // + // If the input/output format pair configuration is unsupported, + // this method also determines the nearest input format supported. + // Nearest meaning closest bit depth, framerate, and channel count, + // in that order of importance. + // + // The behaviour of this method should remain constant after the + // XAPO has been initialized. + // + // PARAMETERS: + // pOutputFormat - [in] output format known to be supported + // pRequestedInputFormat - [in] input format to examine + // ppSupportedInputFormat - [out] receives pointer to nearest input format supported if not NULL and input/output configuration unsupported, use XAPOFree to free structure, left untouched on any failure except XAPO_E_FORMAT_UNSUPPORTED + // + // RETURN VALUE: + // COM error code, including: + // S_OK - input/output configuration supported, ppSupportedInputFormat left untouched + // XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, ppSupportedInputFormat receives pointer to nearest input format supported if not NULL + // E_INVALIDARG - either audio format invalid, ppSupportedInputFormat left untouched + //// + STDMETHOD(IsInputFormatSupported) (THIS_ const WAVEFORMATEX* pOutputFormat, const WAVEFORMATEX* pRequestedInputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedInputFormat) PURE; + + //// + // DESCRIPTION: + // Queries if an input/output configuration is supported. + // + // REMARKS: + // This method allows XAPOs to express dependency of output format + // with respect to input format. + // + // If the input/output format pair configuration is unsupported, + // this method also determines the nearest output format supported. + // Nearest meaning closest bit depth, framerate, and channel count, + // in that order of importance. + // + // The behaviour of this method should remain constant after the + // XAPO has been initialized. + // + // PARAMETERS: + // pInputFormat - [in] input format known to be supported + // pRequestedOutputFormat - [in] output format to examine + // ppSupportedOutputFormat - [out] receives pointer to nearest output format supported if not NULL and input/output configuration unsupported, use XAPOFree to free structure, left untouched on any failure except XAPO_E_FORMAT_UNSUPPORTED + // + // RETURN VALUE: + // COM error code, including: + // S_OK - input/output configuration supported, ppSupportedOutputFormat left untouched + // XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, ppSupportedOutputFormat receives pointer to nearest output format supported if not NULL + // E_INVALIDARG - either audio format invalid, ppSupportedOutputFormat left untouched + //// + STDMETHOD(IsOutputFormatSupported) (THIS_ const WAVEFORMATEX* pInputFormat, const WAVEFORMATEX* pRequestedOutputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedOutputFormat) PURE; + + //// + // DESCRIPTION: + // Performs any effect-specific initialization if required. + // + // REMARKS: + // The contents of pData are defined by the XAPO. + // Immutable variables (constant during the lifespan of the XAPO) + // should be set once via this method. + // Once initialized, an XAPO cannot be initialized again. + // + // An XAPO should be initialized before passing it to XAudio2 + // as part of an effect chain. XAudio2 will not call this method; + // it exists for future content-driven initialization by XACT. + // + // PARAMETERS: + // pData - [in] effect-specific initialization parameters, may be NULL if DataByteSize == 0 + // DataByteSize - [in] size of pData in bytes, may be 0 if DataByteSize is NULL + // + // RETURN VALUE: + // COM error code + //// + STDMETHOD(Initialize) (THIS_ __in_bcount_opt(DataByteSize) const void* pData, UINT32 DataByteSize) PURE; + + //// + // DESCRIPTION: + // Resets variables dependent on frame history. + // + // REMARKS: + // All other variables remain unchanged, including variables set by + // IXAPOParameters::SetParameters. + // + // For example, an effect with delay should zero out its delay line + // during this method, but should not reallocate anything as the + // XAPO remains locked with a constant input/output configuration. + // + // XAudio2 calls this method only if the XAPO is locked. + // This method should not block as it is called from the + // realtime thread. + // + // PARAMETERS: + // void + // + // RETURN VALUE: + // void + //// + STDMETHOD_(void, Reset) (THIS) PURE; + + //// + // DESCRIPTION: + // Locks the XAPO to a specific input/output configuration, + // allowing it to do any final initialization before Process + // is called on the realtime thread. + // + // REMARKS: + // Once locked, the input/output configuration and any other locked + // variables remain constant until UnlockForProcess is called. + // + // XAPOs should assert the input/output configuration is supported + // and that any required effect-specific initialization is complete. + // IsInputFormatSupported, IsOutputFormatSupported, and Initialize + // should be called as necessary before this method is called. + // + // All internal memory buffers required for Process should be + // allocated by the time this method returns successfully + // as Process is non-blocking and should not allocate memory. + // + // Once locked, an XAPO cannot be locked again until + // UnLockForProcess is called. + // + // PARAMETERS: + // InputLockedParameterCount - [in] number of input buffers, must be within [XAPO_REGISTRATION_PROPERTIES.MinInputBufferCount, XAPO_REGISTRATION_PROPERTIES.MaxInputBufferCount] + // pInputLockedParameters - [in] array of input locked buffer parameter structures, may be NULL if InputLockedParameterCount == 0, otherwise must have InputLockedParameterCount elements + // OutputLockedParameterCount - [in] number of output buffers, must be within [XAPO_REGISTRATION_PROPERTIES.MinOutputBufferCount, XAPO_REGISTRATION_PROPERTIES.MaxOutputBufferCount], must match InputLockedParameterCount when XAPO_FLAG_BUFFERCOUNT_MUST_MATCH used + // pOutputLockedParameters - [in] array of output locked buffer parameter structures, may be NULL if OutputLockedParameterCount == 0, otherwise must have OutputLockedParameterCount elements + // + // RETURN VALUE: + // COM error code + //// + STDMETHOD(LockForProcess) (THIS_ UINT32 InputLockedParameterCount, __in_ecount_opt(InputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters, UINT32 OutputLockedParameterCount, __in_ecount_opt(OutputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters) PURE; + + //// + // DESCRIPTION: + // Opposite of LockForProcess. Variables allocated during + // LockForProcess should be deallocated by this method. + // + // REMARKS: + // Unlocking an XAPO allows an XAPO instance to be reused with + // different input/output configurations. + // + // PARAMETERS: + // void + // + // RETURN VALUE: + // void + //// + STDMETHOD_(void, UnlockForProcess) (THIS) PURE; + + //// + // DESCRIPTION: + // Runs the XAPO's DSP code on the given input/output buffers. + // + // REMARKS: + // In addition to writing to the output buffers as appropriate, + // an XAPO must set the BufferFlags and ValidFrameCount members + // of all elements in pOutputProcessParameters accordingly. + // + // ppInputProcessParameters will not necessarily be the same as + // ppOutputProcessParameters for in-place processing, rather + // the pBuffer members of each will point to the same memory. + // + // Multiple input/output buffers may be used with in-place XAPOs, + // though the input buffer count must equal the output buffer count. + // When multiple input/output buffers are used with in-place XAPOs, + // the XAPO may assume input buffer [N] equals output buffer [N]. + // + // When IsEnabled is FALSE, the XAPO should process thru. + // Thru processing means an XAPO should not apply its normal + // processing to the given input/output buffers during Process. + // It should instead pass data from input to output with as little + // modification possible. Effects that perform format conversion + // should continue to do so. The effect must ensure transitions + // between normal and thru processing do not introduce + // discontinuities into the signal. + // + // XAudio2 calls this method only if the XAPO is locked. + // This method should not block as it is called from the + // realtime thread. + // + // PARAMETERS: + // InputProcessParameterCount - [in] number of input buffers, matches respective InputLockedParameterCount parameter given to LockForProcess + // pInputProcessParameters - [in] array of input process buffer parameter structures, may be NULL if InputProcessParameterCount == 0, otherwise must have InputProcessParameterCount elements + // OutputProcessParameterCount - [in] number of output buffers, matches respective OutputLockedParameterCount parameter given to LockForProcess + // pOutputProcessParameters - [in/out] array of output process buffer parameter structures, may be NULL if OutputProcessParameterCount == 0, otherwise must have OutputProcessParameterCount elements + // IsEnabled - [in] TRUE to process normally, FALSE to process thru + // + // RETURN VALUE: + // void + //// + STDMETHOD_(void, Process) (THIS_ UINT32 InputProcessParameterCount, __in_ecount_opt(InputProcessParameterCount) const XAPO_PROCESS_BUFFER_PARAMETERS* pInputProcessParameters, UINT32 OutputProcessParameterCount, __inout_ecount_opt(OutputProcessParameterCount) XAPO_PROCESS_BUFFER_PARAMETERS* pOutputProcessParameters, BOOL IsEnabled) PURE; + + //// + // DESCRIPTION: + // Returns the number of input frames required to generate the + // requested number of output frames. + // + // REMARKS: + // XAudio2 may call this method to determine how many input frames + // an XAPO requires. This is constant for locked CBR XAPOs; + // this method need only be called once while an XAPO is locked. + // + // XAudio2 calls this method only if the XAPO is locked. + // This method should not block as it is called from the + // realtime thread. + // + // PARAMETERS: + // OutputFrameCount - [in] requested number of output frames, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs + // + // RETURN VALUE: + // number of input frames required + //// + STDMETHOD_(UINT32, CalcInputFrames) (THIS_ UINT32 OutputFrameCount) PURE; + + //// + // DESCRIPTION: + // Returns the number of output frames generated for the + // requested number of input frames. + // + // REMARKS: + // XAudio2 may call this method to determine how many output frames + // an XAPO will generate. This is constant for locked CBR XAPOs; + // this method need only be called once while an XAPO is locked. + // + // XAudio2 calls this method only if the XAPO is locked. + // This method should not block as it is called from the + // realtime thread. + // + // PARAMETERS: + // InputFrameCount - [in] requested number of input frames, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs + // + // RETURN VALUE: + // number of output frames generated + //// + STDMETHOD_(UINT32, CalcOutputFrames) (THIS_ UINT32 InputFrameCount) PURE; + }; + + + + // IXAPOParameters: + // Optional XAPO COM interface that allows an XAPO to use + // effect-specific parameters. + #undef INTERFACE + #define INTERFACE IXAPOParameters + DECLARE_INTERFACE_(IXAPOParameters, IUnknown) { + //// + // DESCRIPTION: + // Sets effect-specific parameters. + // + // REMARKS: + // This method may only be called on the realtime thread; + // no synchronization between it and IXAPO::Process is necessary. + // + // This method should not block as it is called from the + // realtime thread. + // + // PARAMETERS: + // pParameters - [in] effect-specific parameter block, must be != NULL + // ParameterByteSize - [in] size of pParameters in bytes, must be > 0 + // + // RETURN VALUE: + // void + //// + STDMETHOD_(void, SetParameters) (THIS_ __in_bcount(ParameterByteSize) const void* pParameters, UINT32 ParameterByteSize) PURE; + + //// + // DESCRIPTION: + // Gets effect-specific parameters. + // + // REMARKS: + // Unlike SetParameters, XAudio2 does not call this method on the + // realtime thread. Thus, the XAPO must protect variables shared + // with SetParameters/Process using appropriate synchronization. + // + // PARAMETERS: + // pParameters - [out] receives effect-specific parameter block, must be != NULL + // ParameterByteSize - [in] size of pParameters in bytes, must be > 0 + // + // RETURN VALUE: + // void + //// + STDMETHOD_(void, GetParameters) (THIS_ __out_bcount(ParameterByteSize) void* pParameters, UINT32 ParameterByteSize) PURE; + }; + + +//-------------------------------------------------------------// + // macros to allow XAPO interfaces to be used in C code + #if !defined(__cplusplus) + // IXAPO + #define IXAPO_QueryInterface(This, riid, ppInterface) \ + ( (This)->lpVtbl->QueryInterface(This, riid, ppInterface) ) + + #define IXAPO_AddRef(This) \ + ( (This)->lpVtbl->AddRef(This) ) + + #define IXAPO_Release(This) \ + ( (This)->lpVtbl->Release(This) ) + + #define IXAPO_GetRegistrationProperties(This, ppRegistrationProperties) \ + ( (This)->lpVtbl->GetRegistrationProperties(This, ppRegistrationProperties) ) + + #define IXAPO_IsInputFormatSupported(This, pOutputFormat, pRequestedInputFormat, ppSupportedInputFormat) \ + ( (This)->lpVtbl->IsInputFormatSupported(This, pOutputFormat, pRequestedInputFormat, ppSupportedInputFormat) ) + + #define IXAPO_IsOutputFormatSupported(This, pInputFormat, pRequestedOutputFormat, ppSupportedOutputFormat) \ + ( (This)->lpVtbl->IsOutputFormatSupported(This, pInputFormat, pRequestedOutputFormat, ppSupportedOutputFormat) ) + + #define IXAPO_Initialize(This, pData, DataByteSize) \ + ( (This)->lpVtbl->Initialize(This, pData, DataByteSize) ) + + #define IXAPO_Reset(This) \ + ( (This)->lpVtbl->Reset(This) ) + + #define IXAPO_LockForProcess(This, InputLockedParameterCount, pInputLockedParameters, OutputLockedParameterCount, pOutputLockedParameters) \ + ( (This)->lpVtbl->LockForProcess(This, InputLockedParameterCount, pInputLockedParameters, OutputLockedParameterCount, pOutputLockedParameters) ) + + #define IXAPO_UnlockForProcess(This) \ + ( (This)->lpVtbl->UnlockForProcess(This) ) + + #define IXAPO_Process(This, InputProcessParameterCount, pInputProcessParameters, OutputProcessParameterCount, pOutputProcessParameters, IsEnabled) \ + ( (This)->lpVtbl->Process(This, InputProcessParameterCount, pInputProcessParameters, OutputProcessParameterCount, pOutputProcessParameters, IsEnabled) ) + + #define IXAPO_CalcInputFrames(This, OutputFrameCount) \ + ( (This)->lpVtbl->CalcInputFrames(This, OutputFrameCount) ) + + #define IXAPO_CalcOutputFrames(This, InputFrameCount) \ + ( (This)->lpVtbl->CalcOutputFrames(This, InputFrameCount) ) + + + // IXAPOParameters + #define IXAPOParameters_QueryInterface(This, riid, ppInterface) \ + ( (This)->lpVtbl->QueryInterface(This, riid, ppInterface) ) + + #define IXAPOParameters_AddRef(This) \ + ( (This)->lpVtbl->AddRef(This) ) + + #define IXAPOParameters_Release(This) \ + ( (This)->lpVtbl->Release(This) ) + + #define IXAPOParameters_SetParameters(This, pParameters, ParameterByteSize) \ + ( (This)->lpVtbl->SetParameters(This, pParameters, ParameterByteSize) ) + + #define IXAPOParameters_GetParameters(This, pParameters, ParameterByteSize) \ + ( (This)->lpVtbl->GetParameters(This, pParameters, ParameterByteSize) ) + #endif // !defined(__cplusplus) + + + #pragma pack(pop) // revert packing alignment +#endif // !defined(GUID_DEFS_ONLY) +//---------------------------------<-EOF->----------------------------------// diff --git a/Src/Decoder_H264_ALL/D3D/include/XAPOBase.h b/Src/Decoder_H264_ALL/D3D/include/XAPOBase.h new file mode 100644 index 0000000..24c5c6f --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/XAPOBase.h @@ -0,0 +1,337 @@ +/*-========================================================================-_ + | - XAPO - | + | Copyright (c) Microsoft Corporation. All rights reserved. | + |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| + |PROJECT: XAPO MODEL: Unmanaged User-mode | + |VERSION: 1.0 EXCEPT: No Exceptions | + |CLASS: N / A MINREQ: WinXP, Xbox360 | + |BASE: N / A DIALECT: MSC++ 14.00 | + |>------------------------------------------------------------------------<| + | DUTY: XAPO base classes | + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ + NOTES: + 1. See XAPO.h for the rules governing XAPO interface behaviour. */ + +#pragma once +//---------------------------------------------------// +#include "XAPO.h" + +// default audio format ranges supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat +#define XAPOBASE_DEFAULT_FORMAT_TAG WAVE_FORMAT_IEEE_FLOAT // 32-bit float only, applies to WAVEFORMATEX.wFormatTag or WAVEFORMATEXTENSIBLE.SubFormat when used +#define XAPOBASE_DEFAULT_FORMAT_MIN_CHANNELS XAPO_MIN_CHANNELS // minimum channel count, applies to WAVEFORMATEX.nChannels +#define XAPOBASE_DEFAULT_FORMAT_MAX_CHANNELS XAPO_MAX_CHANNELS // maximum channel count, applies to WAVEFORMATEX.nChannels +#define XAPOBASE_DEFAULT_FORMAT_MIN_FRAMERATE XAPO_MIN_FRAMERATE // minimum framerate, applies to WAVEFORMATEX.nSamplesPerSec +#define XAPOBASE_DEFAULT_FORMAT_MAX_FRAMERATE XAPO_MAX_FRAMERATE // maximum framerate, applies to WAVEFORMATEX.nSamplesPerSec +#define XAPOBASE_DEFAULT_FORMAT_BITSPERSAMPLE 32 // 32-bit float only, applies to WAVEFORMATEX.wBitsPerSample and WAVEFORMATEXTENSIBLE.wValidBitsPerSample when used + +// default XAPO property flags supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS +#define XAPOBASE_DEFAULT_FLAG (XAPO_FLAG_CHANNELS_MUST_MATCH | XAPO_FLAG_FRAMERATE_MUST_MATCH | XAPO_FLAG_BITSPERSAMPLE_MUST_MATCH | XAPO_FLAG_BUFFERCOUNT_MUST_MATCH | XAPO_FLAG_INPLACE_SUPPORTED) + +// default number of input and output buffers supported, applies to XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS +#define XAPOBASE_DEFAULT_BUFFER_COUNT 1 + + +//-------------------------------------------------------------// +// assertion +#if !defined(XAPOASSERT) + #if XAPODEBUG + #define XAPOASSERT(exp) if (!(exp)) { OutputDebugStringA("XAPO ASSERT: " #exp ", {" __FUNCTION__ "}\n"); __debugbreak(); } + #else + #define XAPOASSERT(exp) __assume(exp) + #endif +#endif + + +//-----------------------------------------------------// +#pragma pack(push, 8) // set packing alignment to ensure consistency across arbitrary build environments, and ensure synchronization variables used by Interlocked functionality are correctly aligned + + +// primitive types +typedef float FLOAT32; // 32-bit IEEE float + + + //// + // DESCRIPTION: + // Default implementation of the IXAPO and IUnknown interfaces. + // Provides overridable implementations for all methods save IXAPO::Process. + //// +class __declspec(novtable) CXAPOBase: public IXAPO { +private: + const XAPO_REGISTRATION_PROPERTIES* m_pRegistrationProperties; // pointer to registration properties of the XAPO, set via constructor + + void* m_pfnMatrixMixFunction; // optimal matrix function pointer, used for thru processing + FLOAT32* m_pfl32MatrixCoefficients; // matrix coefficient table, used for thru processing + UINT32 m_nSrcFormatType; // input format type, used for thru processing + BOOL m_fIsScalarMatrix; // TRUE if m_pfl32MatrixCoefficients is diagonal matrix with all main diagonal entries equal, i.e. m_pfnMatrixMixFunction only used for type conversion (no channel conversion), used for thru processing + BOOL m_fIsLocked; // TRUE if XAPO locked via CXAPOBase.LockForProcess + + +protected: + LONG m_lReferenceCount; // COM reference count, must be aligned for atomic operations + + //// + // DESCRIPTION: + // Verifies an audio format falls within the default ranges supported. + // + // REMARKS: + // If pFormat is unsupported, and fOverwrite is TRUE, + // pFormat is overwritten with the nearest format supported. + // Nearest meaning closest bit depth, framerate, and channel count, + // in that order of importance. + // + // PARAMETERS: + // pFormat - [in/out] audio format to examine + // fOverwrite - [in] TRUE to overwrite pFormat if audio format unsupported + // + // RETURN VALUE: + // COM error code, including: + // S_OK - audio format supported, pFormat left untouched + // XAPO_E_FORMAT_UNSUPPORTED - audio format unsupported, pFormat overwritten with nearest audio format supported if fOverwrite TRUE + // E_INVALIDARG - audio format invalid, pFormat left untouched + //// + virtual HRESULT ValidateFormatDefault (__inout WAVEFORMATEX* pFormat, BOOL fOverwrite); + + //// + // DESCRIPTION: + // Verifies that an input/output format pair configuration is supported + // with respect to the XAPO property flags. + // + // REMARKS: + // If pRequestedFormat is unsupported, and fOverwrite is TRUE, + // pRequestedFormat is overwritten with the nearest format supported. + // Nearest meaning closest bit depth, framerate, and channel count, + // in that order of importance. + // + // PARAMETERS: + // pSupportedFormat - [in] audio format known to be supported + // pRequestedFormat - [in/out] audio format to examine, must be WAVEFORMATEXTENSIBLE if fOverwrite TRUE + // fOverwrite - [in] TRUE to overwrite pRequestedFormat if input/output configuration unsupported + // + // RETURN VALUE: + // COM error code, including: + // S_OK - input/output configuration supported, pRequestedFormat left untouched + // XAPO_E_FORMAT_UNSUPPORTED - input/output configuration unsupported, pRequestedFormat overwritten with nearest audio format supported if fOverwrite TRUE + // E_INVALIDARG - either audio format invalid, pRequestedFormat left untouched + //// + HRESULT ValidateFormatPair (const WAVEFORMATEX* pSupportedFormat, __inout WAVEFORMATEX* pRequestedFormat, BOOL fOverwrite); + + //// + // DESCRIPTION: + // This method may be called by an IXAPO::Process implementation + // for thru processing. It copies/mixes data from source to + // destination, making as few changes as possible to the audio data. + // + // REMARKS: + // However, this method is capable of channel upmix/downmix and uses + // the same matrix coefficient table used by windows Vista to do so. + // + // For in-place processing (input buffer == output buffer) + // this method does nothing. + // + // This method should be called only if the XAPO is locked and + // XAPO_FLAG_FRAMERATE_MUST_MATCH is used. + // + // PARAMETERS: + // pInputBuffer - [in] input buffer, format may be INT8, INT16, INT20 (contained in 24 or 32 bits), INT24 (contained in 24 or 32 bits), INT32, or FLOAT32 + // pOutputBuffer - [out] output buffer, format must be FLOAT32 + // FrameCount - [in] number of frames to process + // InputChannelCount - [in] number of input channels + // OutputChannelCount - [in] number of output channels + // MixWithOutput - [in] TRUE to mix with output, FALSE to overwrite output + // + // RETURN VALUE: + // void + //// + void ProcessThru (__in void* pInputBuffer, __inout FLOAT32* pOutputBuffer, UINT32 FrameCount, WORD InputChannelCount, WORD OutputChannelCount, BOOL MixWithOutput); + + // accessors + const XAPO_REGISTRATION_PROPERTIES* GetRegistrationPropertiesInternal () { return m_pRegistrationProperties; } + BOOL IsLocked () { return m_fIsLocked; } + + +public: + CXAPOBase (const XAPO_REGISTRATION_PROPERTIES* pRegistrationProperties); + virtual ~CXAPOBase (); + + // IUnknown methods: + // retrieves the requested interface pointer if supported + STDMETHOD(QueryInterface) (REFIID riid, __deref_out_opt void** ppInterface) + { + XAPOASSERT(ppInterface != NULL); + HRESULT hr = S_OK; + + if (riid == __uuidof(IXAPO)) { + *ppInterface = static_cast(this); + AddRef(); + } else if (riid == __uuidof(IUnknown)) { + *ppInterface = static_cast(this); + AddRef(); + } else { + *ppInterface = NULL; + hr = E_NOINTERFACE; + } + + return hr; + } + + // increments reference count + STDMETHOD_(ULONG, AddRef) () + { + return (ULONG)InterlockedIncrement(&m_lReferenceCount); + } + + // decrements reference count and deletes the object if the reference count falls to zero + STDMETHOD_(ULONG, Release) () + { + ULONG uTmpReferenceCount = (ULONG)InterlockedDecrement(&m_lReferenceCount); + if (uTmpReferenceCount == 0) { + delete this; + } + return uTmpReferenceCount; + } + + // IXAPO methods: + // Allocates a copy of the registration properties of the XAPO. + // This default implementation returns a copy of the registration + // properties given to the constructor, allocated via XAPOAlloc. + STDMETHOD(GetRegistrationProperties) (__deref_out XAPO_REGISTRATION_PROPERTIES** ppRegistrationProperties); + + // Queries if a specific input format is supported for a given output format. + // This default implementation assumes only the format described by the + // XAPOBASE_DEFAULT_FORMAT values are supported for both input and output. + STDMETHOD(IsInputFormatSupported) (const WAVEFORMATEX* pOutputFormat, const WAVEFORMATEX* pRequestedInputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedInputFormat); + + // Queries if a specific output format is supported for a given input format. + // This default implementation assumes only the format described by the + // XAPOBASE_DEFAULT_FORMAT values are supported for both input and output. + STDMETHOD(IsOutputFormatSupported) (const WAVEFORMATEX* pInputFormat, const WAVEFORMATEX* pRequestedOutputFormat, __deref_opt_out WAVEFORMATEX** ppSupportedOutputFormat); + + // Performs any effect-specific initialization. + // This default implementation is a no-op and only returns S_OK. + STDMETHOD(Initialize) (__in_bcount_opt(DataByteSize) const void*, UINT32 DataByteSize) + { + UNREFERENCED_PARAMETER(DataByteSize); + return S_OK; + } + + // Resets variables dependent on frame history. + // This default implementation is a no-op: this base class contains no + // relevant state to reset. + STDMETHOD_(void, Reset) () { return; } + + // Notifies XAPO of buffer formats Process() will be given. + // This default implementation performs basic input/output format + // validation against the XAPO's registration properties. + // Derived XAPOs should call the base implementation first. + STDMETHOD(LockForProcess) (UINT32 InputLockedParameterCount, __in_ecount_opt(InputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pInputLockedParameters, UINT32 OutputLockedParameterCount, __in_ecount_opt(OutputLockedParameterCount) const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS* pOutputLockedParameters); + + // Opposite of LockForProcess. + // Derived XAPOs should call the base implementation first. + STDMETHOD_(void, UnlockForProcess) (); + + // Returns the number of input frames required to generate the requested number of output frames. + // By default, this method returns the same number of frames it was passed. + STDMETHOD_(UINT32, CalcInputFrames) (UINT32 OutputFrameCount) { return OutputFrameCount; } + + // Returns the number of output frames generated for the requested number of input frames. + // By default, this method returns the same number of frames it was passed. + STDMETHOD_(UINT32, CalcOutputFrames) (UINT32 InputFrameCount) { return InputFrameCount; } +}; + + + + + +//--------------------------------------------------------------------------// + //// + // DESCRIPTION: + // Extends CXAPOBase, providing a default implementation of the + // IXAPOParameters interface with appropriate synchronization to + // protect variables shared between IXAPOParameters::GetParameters + // and IXAPOParameters::SetParameters/IXAPO::Process. + // + // This class is for parameter blocks whose size is larger than 4 bytes. + // For smaller parameter blocks, use atomic operations directly + // on the parameters for synchronization. + //// +class __declspec(novtable) CXAPOParametersBase: public CXAPOBase, public IXAPOParameters { +private: + BYTE* m_pParameterBlocks; // three contiguous process parameter blocks used for synchronization, user responsible for initialization of parameter blocks before IXAPO::Process/SetParameters/GetParameters called + BYTE* m_pCurrentParameters; // pointer to current process parameters, must be aligned for atomic operations + BYTE* m_pCurrentParametersInternal; // pointer to current process parameters (temp pointer read by SetParameters/BeginProcess/EndProcess) + UINT32 m_uCurrentParametersIndex; // index of current process parameters + UINT32 m_uParameterBlockByteSize; // size of a single parameter block in bytes, must be > 0 + BOOL m_fNewerResultsReady; // TRUE if there exists new processing results not yet picked up by GetParameters(), must be aligned for atomic operations + BOOL m_fProducer; // IXAPO::Process produces data to be returned by GetParameters(); SetParameters() disallowed + + +public: + //// + // PARAMETERS: + // pRegistrationProperties - [in] registration properties of the XAPO + // pParameterBlocks - [in] three contiguous process parameter blocks used for synchronization + // uParameterBlockByteSize - [in] size of one of the parameter blocks, must be > 0 + // fProducer - [in] TRUE if IXAPO::Process produces data to be returned by GetParameters() (SetParameters() and ParametersChanged() disallowed) + //// + CXAPOParametersBase (const XAPO_REGISTRATION_PROPERTIES* pRegistrationProperties, BYTE* pParameterBlocks, UINT32 uParameterBlockByteSize, BOOL fProducer); + virtual ~CXAPOParametersBase (); + + // IUnknown methods: + // retrieves the requested interface pointer if supported + STDMETHOD(QueryInterface) (REFIID riid, __deref_out_opt void** ppInterface) + { + XAPOASSERT(ppInterface != NULL); + HRESULT hr = S_OK; + + if (riid == __uuidof(IXAPOParameters)) { + *ppInterface = static_cast(this); + CXAPOBase::AddRef(); + } else { + hr = CXAPOBase::QueryInterface(riid, ppInterface); + } + + return hr; + } + + // increments reference count + STDMETHOD_(ULONG, AddRef)() { return CXAPOBase::AddRef(); } + + // decrements reference count and deletes the object if the reference count falls to zero + STDMETHOD_(ULONG, Release)() { return CXAPOBase::Release(); } + + // IXAPOParameters methods: + // Sets effect-specific parameters. + // This method may only be called on the realtime audio processing thread. + STDMETHOD_(void, SetParameters) (__in_bcount(ParameterByteSize) const void* pParameters, UINT32 ParameterByteSize); + + // Gets effect-specific parameters. + // This method may block and should not be called from the realtime thread. + // Get the current parameters via BeginProcess. + STDMETHOD_(void, GetParameters) (__out_bcount(ParameterByteSize) void* pParameters, UINT32 ParameterByteSize); + + // Called by SetParameters() to allow for user-defined parameter validation. + // SetParameters validates that ParameterByteSize == m_uParameterBlockByteSize + // so the user may assume/assert ParameterByteSize == m_uParameterBlockByteSize. + // This method should not block as it is called from the realtime thread. + virtual void OnSetParameters (const void*, UINT32) { } + + // Returns TRUE if SetParameters() has been called since the last processing pass. + // May only be used within the XAPO's IXAPO::Process implementation, + // before BeginProcess is called. + BOOL ParametersChanged (); + + // Returns latest process parameters. + // XAPOs must call this method within their IXAPO::Process + // implementation to access latest process parameters in threadsafe manner. + BYTE* BeginProcess (); + + // Notifies CXAPOParametersBase that the XAPO has finished accessing + // the latest process parameters. + // XAPOs must call this method within their IXAPO::Process + // implementation to access latest process parameters in threadsafe manner. + void EndProcess (); +}; + + +#pragma pack(pop) // revert packing alignment +//---------------------------------<-EOF->----------------------------------// diff --git a/Src/Decoder_H264_ALL/D3D/include/XAPOFX.h b/Src/Decoder_H264_ALL/D3D/include/XAPOFX.h new file mode 100644 index 0000000..a5dbeef --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/XAPOFX.h @@ -0,0 +1,167 @@ +/*-========================================================================-_ + | - XAPOFX - | + | Copyright (c) Microsoft Corporation. All rights reserved. | + |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| + |PROJECT: XAPOFX MODEL: Unmanaged User-mode | + |VERSION: 1.3 EXCEPT: No Exceptions | + |CLASS: N / A MINREQ: WinXP, Xbox360 | + |BASE: N / A DIALECT: MSC++ 14.00 | + |>------------------------------------------------------------------------<| + | DUTY: Cross-platform Audio Processing Objects | + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ + NOTES: + 1. USE THE DEBUG DLL TO ENABLE PARAMETER VALIDATION VIA ASSERTS! + Here's how: + Copy XAPOFXDX_X.dll to where your application exists. + The debug DLL can be found under %WINDIR%\system32. + Rename XAPOFXDX_X.dll to XAPOFXX_X.dll to use the debug version. */ + +#pragma once +//---------------------------------------------------// +#include "comdecl.h" // for DEFINE_CLSID + +// FX class IDs +DEFINE_CLSID(FXEQ, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 00); +DEFINE_CLSID(FXMasteringLimiter, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 01); +DEFINE_CLSID(FXReverb, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 02); +DEFINE_CLSID(FXEcho, A90BC001, E897, E897, 74, 39, 43, 55, 00, 00, 00, 03); + + +#if !defined(GUID_DEFS_ONLY) // ignore rest if only GUID definitions requested + #if defined(_XBOX) // general windows and COM declarations + #include + #include + #else + #include + #include + #endif + #include // float bounds + + + // EQ parameter bounds (inclusive), used with XEQ: + #define FXEQ_MIN_FRAMERATE 22000 + #define FXEQ_MAX_FRAMERATE 48000 + + #define FXEQ_MIN_FREQUENCY_CENTER 20.0f + #define FXEQ_MAX_FREQUENCY_CENTER 20000.0f + #define FXEQ_DEFAULT_FREQUENCY_CENTER_0 100.0f // band 0 + #define FXEQ_DEFAULT_FREQUENCY_CENTER_1 800.0f // band 1 + #define FXEQ_DEFAULT_FREQUENCY_CENTER_2 2000.0f // band 2 + #define FXEQ_DEFAULT_FREQUENCY_CENTER_3 10000.0f // band 3 + + #define FXEQ_MIN_GAIN 0.126f // -18dB + #define FXEQ_MAX_GAIN 7.94f // +18dB + #define FXEQ_DEFAULT_GAIN 1.0f // 0dB change, all bands + + #define FXEQ_MIN_BANDWIDTH 0.1f + #define FXEQ_MAX_BANDWIDTH 2.0f + #define FXEQ_DEFAULT_BANDWIDTH 1.0f // all bands + + + // Mastering limiter parameter bounds (inclusive), used with XMasteringLimiter: + #define FXMASTERINGLIMITER_MIN_RELEASE 1 + #define FXMASTERINGLIMITER_MAX_RELEASE 20 + #define FXMASTERINGLIMITER_DEFAULT_RELEASE 6 + + #define FXMASTERINGLIMITER_MIN_LOUDNESS 1 + #define FXMASTERINGLIMITER_MAX_LOUDNESS 1800 + #define FXMASTERINGLIMITER_DEFAULT_LOUDNESS 1000 + + + // Reverb parameter bounds (inclusive), used with XReverb: + #define FXREVERB_MIN_DIFFUSION 0.0f + #define FXREVERB_MAX_DIFFUSION 1.0f + #define FXREVERB_DEFAULT_DIFFUSION 0.9f + + #define FXREVERB_MIN_ROOMSIZE 0.0001f + #define FXREVERB_MAX_ROOMSIZE 1.0f + #define FXREVERB_DEFAULT_ROOMSIZE 0.6f + + + // Echo parameter bounds (inclusive), used with XEcho: + #define FXECHO_MIN_WETDRYMIX 0.0f + #define FXECHO_MAX_WETDRYMIX 1.0f + #define FXECHO_DEFAULT_WETDRYMIX 0.5f + + #define FXECHO_MIN_FEEDBACK 0.0f + #define FXECHO_MAX_FEEDBACK 1.0f + #define FXECHO_DEFAULT_FEEDBACK 0.5f + + #define FXECHO_MIN_DELAY 1.0f + #define FXECHO_MAX_DELAY 2000.0f + #define FXECHO_DEFAULT_DELAY 500.0f + + +//-----------------------------------------------------// + #pragma pack(push, 1) // set packing alignment to ensure consistency across arbitrary build environments + + + // EQ parameters (4 bands), used with IXAPOParameters::SetParameters: + // The EQ supports only FLOAT32 audio foramts. + // The framerate must be within [22000, 48000] Hz. + typedef struct FXEQ_PARAMETERS { + float FrequencyCenter0; // center frequency in Hz, band 0 + float Gain0; // boost/cut + float Bandwidth0; // bandwidth, region of EQ is center frequency +/- bandwidth/2 + float FrequencyCenter1; // band 1 + float Gain1; + float Bandwidth1; + float FrequencyCenter2; // band 2 + float Gain2; + float Bandwidth2; + float FrequencyCenter3; // band 3 + float Gain3; + float Bandwidth3; + } FXEQ_PARAMETERS; + + + // Mastering limiter parameters, used with IXAPOParameters::SetParameters: + // The mastering limiter supports only FLOAT32 audio formats. + typedef struct FXMASTERINGLIMITER_PARAMETERS { + UINT32 Release; // release time (tuning factor with no specific units) + UINT32 Loudness; // loudness target (threshold) + } FXMASTERINGLIMITER_PARAMETERS; + + + // Reverb parameters, used with IXAPOParameters::SetParameters: + // The reverb supports only FLOAT32 audio formats with the following + // channel configurations: + // Input: Mono Output: Mono + // Input: Stereo Output: Stereo + typedef struct FXREVERB_PARAMETERS { + float Diffusion; // diffusion + float RoomSize; // room size + } FXREVERB_PARAMETERS; + + + // Echo parameters, used with IXAPOParameters::SetParameters: + // The echo supports only FLOAT32 audio formats. + typedef struct FXECHO_PARAMETERS { + float WetDryMix; // ratio of wet (processed) signal to dry (original) signal + float Feedback; // amount of output fed back into input + float Delay; // delay (all channels) in milliseconds + } FXECHO_PARAMETERS; + + +//-------------------------------------------------------------// + // function storage-class attribute and calltype + #if defined(_XBOX) || !defined(FXDLL) + #define FX_API_(type) EXTERN_C type STDAPIVCALLTYPE + #else + #if defined(FXEXPORT) + #define FX_API_(type) EXTERN_C __declspec(dllexport) type STDAPIVCALLTYPE + #else + #define FX_API_(type) EXTERN_C __declspec(dllimport) type STDAPIVCALLTYPE + #endif + #endif + #define FX_IMP_(type) type STDMETHODVCALLTYPE + + +//-------------------------------------------------------// + // creates instance of requested XAPO, use Release to free instance + FX_API_(HRESULT) CreateFX (REFCLSID clsid, __deref_out IUnknown** pEffect); + + + #pragma pack(pop) // revert packing alignment +#endif // !defined(GUID_DEFS_ONLY) +//---------------------------------<-EOF->----------------------------------// diff --git a/Src/Decoder_H264_ALL/D3D/include/XDSP.h b/Src/Decoder_H264_ALL/D3D/include/XDSP.h new file mode 100644 index 0000000..6ed0dc5 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/XDSP.h @@ -0,0 +1,754 @@ +/*-========================================================================-_ + | - XDSP - | + | Copyright (c) Microsoft Corporation. All rights reserved. | + |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| + |PROJECT: XDSP MODEL: Unmanaged User-mode | + |VERSION: 1.2 EXCEPT: No Exceptions | + |CLASS: N / A MINREQ: WinXP, Xbox360 | + |BASE: N / A DIALECT: MSC++ 14.00 | + |>------------------------------------------------------------------------<| + | DUTY: DSP functions with CPU extension specific optimizations | + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ + NOTES: + 1. Definition of terms: + DSP: Digital Signal Processing. + FFT: Fast Fourier Transform. + Frame: A block of samples, one per channel, + to be played simultaneously. + + 2. All buffer parameters must be 16-byte aligned. + + 3. All FFT functions support only FLOAT32 audio. */ + +#pragma once +//---------------------------------------------------// +#include // general windows types +#include // trigonometric functions +#if defined(_XBOX) // SIMD intrinsics + #include +#else + #include +#endif + + +//-------------------------------------------------------------// +// assertion +#if !defined(DSPASSERT) + #if DBG + #define DSPASSERT(exp) if (!(exp)) { OutputDebugStringA("XDSP ASSERT: " #exp ", {" __FUNCTION__ "}\n"); __debugbreak(); } + #else + #define DSPASSERT(exp) __assume(exp) + #endif +#endif + +// true if n is a power of 2 +#if !defined(ISPOWEROF2) + #define ISPOWEROF2(n) ( ((n)&((n)-1)) == 0 && (n) != 0 ) +#endif + + +//-----------------------------------------------------------// +namespace XDSP { +#pragma warning(push) +#pragma warning(disable: 4328 4640) // disable "indirection alignment of formal parameter", "construction of local static object is not thread-safe" compile warnings + + +// Helper functions, used by the FFT functions. +// The application need not call them directly. + + // primitive types + typedef __m128 XVECTOR; + typedef XVECTOR& XVECTORREF; + typedef const XVECTOR& XVECTORREFC; + + + // Parallel multiplication of four complex numbers, assuming + // real and imaginary values are stored in separate vectors. + __forceinline void vmulComplex (__out XVECTORREF rResult, __out XVECTORREF iResult, __in XVECTORREFC r1, __in XVECTORREFC i1, __in XVECTORREFC r2, __in XVECTORREFC i2) + { + // (r1, i1) * (r2, i2) = (r1r2 - i1i2, r1i2 + r2i1) + XVECTOR vi1i2 = _mm_mul_ps(i1, i2); + XVECTOR vr1r2 = _mm_mul_ps(r1, r2); + XVECTOR vr1i2 = _mm_mul_ps(r1, i2); + XVECTOR vr2i1 = _mm_mul_ps(r2, i1); + rResult = _mm_sub_ps(vr1r2, vi1i2); // real: (r1*r2 - i1*i2) + iResult = _mm_add_ps(vr1i2, vr2i1); // imaginary: (r1*i2 + r2*i1) + } + __forceinline void vmulComplex (__inout XVECTORREF r1, __inout XVECTORREF i1, __in XVECTORREFC r2, __in XVECTORREFC i2) + { + // (r1, i1) * (r2, i2) = (r1r2 - i1i2, r1i2 + r2i1) + XVECTOR vi1i2 = _mm_mul_ps(i1, i2); + XVECTOR vr1r2 = _mm_mul_ps(r1, r2); + XVECTOR vr1i2 = _mm_mul_ps(r1, i2); + XVECTOR vr2i1 = _mm_mul_ps(r2, i1); + r1 = _mm_sub_ps(vr1r2, vi1i2); // real: (r1*r2 - i1*i2) + i1 = _mm_add_ps(vr1i2, vr2i1); // imaginary: (r1*i2 + r2*i1) + } + + + // Radix-4 decimation-in-time FFT butterfly. + // This version assumes that all four elements of the butterfly are + // adjacent in a single vector. + // + // Compute the product of the complex input vector and the + // 4-element DFT matrix: + // | 1 1 1 1 | | (r1X,i1X) | + // | 1 -j -1 j | | (r1Y,i1Y) | + // | 1 -1 1 -1 | | (r1Z,i1Z) | + // | 1 j -1 -j | | (r1W,i1W) | + // + // This matrix can be decomposed into two simpler ones to reduce the + // number of additions needed. The decomposed matrices look like this: + // | 1 0 1 0 | | 1 0 1 0 | + // | 0 1 0 -j | | 1 0 -1 0 | + // | 1 0 -1 0 | | 0 1 0 1 | + // | 0 1 0 j | | 0 1 0 -1 | + // + // Combine as follows: + // | 1 0 1 0 | | (r1X,i1X) | | (r1X + r1Z, i1X + i1Z) | + // Temp = | 1 0 -1 0 | * | (r1Y,i1Y) | = | (r1X - r1Z, i1X - i1Z) | + // | 0 1 0 1 | | (r1Z,i1Z) | | (r1Y + r1W, i1Y + i1W) | + // | 0 1 0 -1 | | (r1W,i1W) | | (r1Y - r1W, i1Y - i1W) | + // + // | 1 0 1 0 | | (rTempX,iTempX) | | (rTempX + rTempZ, iTempX + iTempZ) | + // Result = | 0 1 0 -j | * | (rTempY,iTempY) | = | (rTempY + iTempW, iTempY - rTempW) | + // | 1 0 -1 0 | | (rTempZ,iTempZ) | | (rTempX - rTempZ, iTempX - iTempZ) | + // | 0 1 0 j | | (rTempW,iTempW) | | (rTempY - iTempW, iTempY + rTempW) | + __forceinline void ButterflyDIT4_1 (__inout XVECTORREF r1, __inout XVECTORREF i1) + { + // sign constants for radix-4 butterflies + const static XVECTOR vDFT4SignBits1 = { 0.0f, -0.0f, 0.0f, -0.0f }; + const static XVECTOR vDFT4SignBits2 = { 0.0f, 0.0f, -0.0f, -0.0f }; + const static XVECTOR vDFT4SignBits3 = { 0.0f, -0.0f, -0.0f, 0.0f }; + + + // calculating Temp + XVECTOR rTemp = _mm_add_ps( _mm_shuffle_ps(r1, r1, _MM_SHUFFLE(1, 1, 0, 0)), // [r1X| r1X|r1Y| r1Y] + + _mm_xor_ps(_mm_shuffle_ps(r1, r1, _MM_SHUFFLE(3, 3, 2, 2)), vDFT4SignBits1) ); // [r1Z|-r1Z|r1W|-r1W] + XVECTOR iTemp = _mm_add_ps( _mm_shuffle_ps(i1, i1, _MM_SHUFFLE(1, 1, 0, 0)), // [i1X| i1X|i1Y| i1Y] + + _mm_xor_ps(_mm_shuffle_ps(i1, i1, _MM_SHUFFLE(3, 3, 2, 2)), vDFT4SignBits1) ); // [i1Z|-i1Z|i1W|-i1W] + + // calculating Result + XVECTOR rZrWiZiW = _mm_shuffle_ps(rTemp, iTemp, _MM_SHUFFLE(3, 2, 3, 2)); // [rTempZ|rTempW|iTempZ|iTempW] + XVECTOR rZiWrZiW = _mm_shuffle_ps(rZrWiZiW, rZrWiZiW, _MM_SHUFFLE(3, 0, 3, 0)); // [rTempZ|iTempW|rTempZ|iTempW] + XVECTOR iZrWiZrW = _mm_shuffle_ps(rZrWiZiW, rZrWiZiW, _MM_SHUFFLE(1, 2, 1, 2)); // [rTempZ|iTempW|rTempZ|iTempW] + r1 = _mm_add_ps( _mm_shuffle_ps(rTemp, rTemp, _MM_SHUFFLE(1, 0, 1, 0)), // [rTempX| rTempY| rTempX| rTempY] + + _mm_xor_ps(rZiWrZiW, vDFT4SignBits2) ); // [rTempZ| iTempW|-rTempZ|-iTempW] + i1 = _mm_add_ps( _mm_shuffle_ps(iTemp, iTemp, _MM_SHUFFLE(1, 0, 1, 0)), // [iTempX| iTempY| iTempX| iTempY] + + _mm_xor_ps(iZrWiZrW, vDFT4SignBits3) ); // [iTempZ|-rTempW|-iTempZ| rTempW] + } + + // Radix-4 decimation-in-time FFT butterfly. + // This version assumes that elements of the butterfly are + // in different vectors, so that each vector in the input + // contains elements from four different butterflies. + // The four separate butterflies are processed in parallel. + // + // The calculations here are the same as the ones in the single-vector + // radix-4 DFT, but instead of being done on a single vector (X,Y,Z,W) + // they are done in parallel on sixteen independent complex values. + // There is no interdependence between the vector elements: + // | 1 0 1 0 | | (rIn0,iIn0) | | (rIn0 + rIn2, iIn0 + iIn2) | + // | 1 0 -1 0 | * | (rIn1,iIn1) | = Temp = | (rIn0 - rIn2, iIn0 - iIn2) | + // | 0 1 0 1 | | (rIn2,iIn2) | | (rIn1 + rIn3, iIn1 + iIn3) | + // | 0 1 0 -1 | | (rIn3,iIn3) | | (rIn1 - rIn3, iIn1 - iIn3) | + // + // | 1 0 1 0 | | (rTemp0,iTemp0) | | (rTemp0 + rTemp2, iTemp0 + iTemp2) | + // Result = | 0 1 0 -j | * | (rTemp1,iTemp1) | = | (rTemp1 + iTemp3, iTemp1 - rTemp3) | + // | 1 0 -1 0 | | (rTemp2,iTemp2) | | (rTemp0 - rTemp2, iTemp0 - iTemp2) | + // | 0 1 0 j | | (rTemp3,iTemp3) | | (rTemp1 - iTemp3, iTemp1 + rTemp3) | + __forceinline void ButterflyDIT4_4 (__inout XVECTORREF r0, + __inout XVECTORREF r1, + __inout XVECTORREF r2, + __inout XVECTORREF r3, + __inout XVECTORREF i0, + __inout XVECTORREF i1, + __inout XVECTORREF i2, + __inout XVECTORREF i3, + __in_ecount(uStride*4) const XVECTOR* __restrict pUnityTableReal, + __in_ecount(uStride*4) const XVECTOR* __restrict pUnityTableImaginary, + const UINT32 uStride, const BOOL fLast) + { + DSPASSERT(pUnityTableReal != NULL); + DSPASSERT(pUnityTableImaginary != NULL); + DSPASSERT((UINT_PTR)pUnityTableReal % 16 == 0); + DSPASSERT((UINT_PTR)pUnityTableImaginary % 16 == 0); + DSPASSERT(ISPOWEROF2(uStride)); + + XVECTOR rTemp0, rTemp1, rTemp2, rTemp3, rTemp4, rTemp5, rTemp6, rTemp7; + XVECTOR iTemp0, iTemp1, iTemp2, iTemp3, iTemp4, iTemp5, iTemp6, iTemp7; + + + // calculating Temp + rTemp0 = _mm_add_ps(r0, r2); iTemp0 = _mm_add_ps(i0, i2); + rTemp2 = _mm_add_ps(r1, r3); iTemp2 = _mm_add_ps(i1, i3); + rTemp1 = _mm_sub_ps(r0, r2); iTemp1 = _mm_sub_ps(i0, i2); + rTemp3 = _mm_sub_ps(r1, r3); iTemp3 = _mm_sub_ps(i1, i3); + rTemp4 = _mm_add_ps(rTemp0, rTemp2); iTemp4 = _mm_add_ps(iTemp0, iTemp2); + rTemp5 = _mm_add_ps(rTemp1, iTemp3); iTemp5 = _mm_sub_ps(iTemp1, rTemp3); + rTemp6 = _mm_sub_ps(rTemp0, rTemp2); iTemp6 = _mm_sub_ps(iTemp0, iTemp2); + rTemp7 = _mm_sub_ps(rTemp1, iTemp3); iTemp7 = _mm_add_ps(iTemp1, rTemp3); + + // calculating Result + // vmulComplex(rTemp0, iTemp0, rTemp0, iTemp0, pUnityTableReal[0], pUnityTableImaginary[0]); // first one is always trivial + vmulComplex(rTemp5, iTemp5, pUnityTableReal[uStride], pUnityTableImaginary[uStride]); + vmulComplex(rTemp6, iTemp6, pUnityTableReal[uStride*2], pUnityTableImaginary[uStride*2]); + vmulComplex(rTemp7, iTemp7, pUnityTableReal[uStride*3], pUnityTableImaginary[uStride*3]); + if (fLast) { + ButterflyDIT4_1(rTemp4, iTemp4); + ButterflyDIT4_1(rTemp5, iTemp5); + ButterflyDIT4_1(rTemp6, iTemp6); + ButterflyDIT4_1(rTemp7, iTemp7); + } + + + r0 = rTemp4; i0 = iTemp4; + r1 = rTemp5; i1 = iTemp5; + r2 = rTemp6; i2 = iTemp6; + r3 = rTemp7; i3 = iTemp7; + } + +//-------------------------------------------------------// + + //// + // DESCRIPTION: + // 4-sample FFT. + // + // PARAMETERS: + // pReal - [inout] real components, must have at least uCount elements + // pImaginary - [inout] imaginary components, must have at least uCount elements + // uCount - [in] number of FFT iterations + // + // RETURN VALUE: + // void + //// + __forceinline void FFT4 (__inout_ecount(uCount) XVECTOR* __restrict pReal, __inout_ecount(uCount) XVECTOR* __restrict pImaginary, const UINT32 uCount=1) + { + DSPASSERT(pReal != NULL); + DSPASSERT(pImaginary != NULL); + DSPASSERT((UINT_PTR)pReal % 16 == 0); + DSPASSERT((UINT_PTR)pImaginary % 16 == 0); + DSPASSERT(ISPOWEROF2(uCount)); + + for (UINT32 uIndex=0; uIndex 16 + // uCount - [in] number of FFT iterations + // + // RETURN VALUE: + // void + //// + inline void FFT (__inout_ecount((uLength*uCount)/4) XVECTOR* __restrict pReal, __inout_ecount((uLength*uCount)/4) XVECTOR* __restrict pImaginary, __in_ecount(uLength*uCount) const XVECTOR* __restrict pUnityTable, const UINT32 uLength, const UINT32 uCount=1) + { + DSPASSERT(pReal != NULL); + DSPASSERT(pImaginary != NULL); + DSPASSERT(pUnityTable != NULL); + DSPASSERT((UINT_PTR)pReal % 16 == 0); + DSPASSERT((UINT_PTR)pImaginary % 16 == 0); + DSPASSERT((UINT_PTR)pUnityTable % 16 == 0); + DSPASSERT(uLength > 16); + DSPASSERT(ISPOWEROF2(uLength)); + DSPASSERT(ISPOWEROF2(uCount)); + + const XVECTOR* __restrict pUnityTableReal = pUnityTable; + const XVECTOR* __restrict pUnityTableImaginary = pUnityTable + (uLength>>2); + const UINT32 uTotal = uCount * uLength; + const UINT32 uTotal_vectors = uTotal >> 2; + const UINT32 uStage_vectors = uLength >> 2; + const UINT32 uStage_vectors_mask = uStage_vectors - 1; + const UINT32 uStride = uLength >> 4; // stride between butterfly elements + const UINT32 uStrideMask = uStride - 1; + const UINT32 uStride2 = uStride * 2; + const UINT32 uStride3 = uStride * 3; + const UINT32 uStrideInvMask = ~uStrideMask; + + + for (UINT32 uIndex=0; uIndex<(uTotal_vectors>>2); ++uIndex) { + const UINT32 n = ((uIndex & uStrideInvMask) << 2) + (uIndex & uStrideMask); + ButterflyDIT4_4(pReal[n], + pReal[n + uStride], + pReal[n + uStride2], + pReal[n + uStride3], + pImaginary[n ], + pImaginary[n + uStride], + pImaginary[n + uStride2], + pImaginary[n + uStride3], + pUnityTableReal + (n & uStage_vectors_mask), + pUnityTableImaginary + (n & uStage_vectors_mask), + uStride, FALSE); + } + + + if (uLength > 16*4) { + FFT(pReal, pImaginary, pUnityTable+(uLength>>1), uLength>>2, uCount*4); + } else if (uLength == 16*4) { + FFT16(pReal, pImaginary, uCount*4); + } else if (uLength == 8*4) { + FFT8(pReal, pImaginary, uCount*4); + } else if (uLength == 4*4) { + FFT4(pReal, pImaginary, uCount*4); + } + } + +//--------------------------------------------------------------------------// + //// + // DESCRIPTION: + // Initializes unity roots lookup table used by FFT functions. + // Once initialized, the table need not be initialized again unless a + // different FFT length is desired. + // + // REMARKS: + // The unity tables of FFT length 16 and below are hard coded into the + // respective FFT functions and so need not be initialized. + // + // PARAMETERS: + // pUnityTable - [out] unity table, receives unity roots lookup table, must have at least uLength elements + // uLength - [in] FFT length in frames, must be a power of 2 > 16 + // + // RETURN VALUE: + // void + //// +inline void FFTInitializeUnityTable (__out_ecount(uLength) XVECTOR* __restrict pUnityTable, UINT32 uLength) +{ + DSPASSERT(pUnityTable != NULL); + DSPASSERT(uLength > 16); + DSPASSERT(ISPOWEROF2(uLength)); + + FLOAT32* __restrict pfUnityTable = (FLOAT32* __restrict)pUnityTable; + + + // initialize unity table for recursive FFT lengths: uLength, uLength/4, uLength/16... > 16 + do { + FLOAT32 flStep = 6.283185307f / uLength; // 2PI / FFT length + uLength >>= 2; + + // pUnityTable[0 to uLength*4-1] contains real components for current FFT length + // pUnityTable[uLength*4 to uLength*8-1] contains imaginary components for current FFT length + for (UINT32 i=0; i<4; ++i) { + for (UINT32 j=0; j 16); +} + + + //// + // DESCRIPTION: + // The FFT functions generate output in bit reversed order. + // Use this function to re-arrange them into order of increasing frequency. + // + // REMARKS: + // + // PARAMETERS: + // pOutput - [out] output buffer, receives samples in order of increasing frequency, cannot overlap pInput, must have at least (1<= 2 + // + // RETURN VALUE: + // void + //// +inline void FFTUnswizzle (__out_ecount((1<= 2); + + FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput; + const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput; + const UINT32 uLength = UINT32(1 << uLog2Length); + + + if ((uLog2Length & 0x1) == 0) { + // even powers of two + for (UINT32 uIndex=0; uIndex> 2 ) | ( (n & 0x33333333) << 2 ); + n = ( (n & 0xf0f0f0f0) >> 4 ) | ( (n & 0x0f0f0f0f) << 4 ); + n = ( (n & 0xff00ff00) >> 8 ) | ( (n & 0x00ff00ff) << 8 ); + n = ( (n & 0xffff0000) >> 16 ) | ( (n & 0x0000ffff) << 16 ); + n >>= (32 - uLog2Length); + pfOutput[n] = pfInput[uIndex]; + } + } else { + // odd powers of two + for (UINT32 uIndex=0; uIndex>3); + n = ( (n & 0xcccccccc) >> 2 ) | ( (n & 0x33333333) << 2 ); + n = ( (n & 0xf0f0f0f0) >> 4 ) | ( (n & 0x0f0f0f0f) << 4 ); + n = ( (n & 0xff00ff00) >> 8 ) | ( (n & 0x00ff00ff) << 8 ); + n = ( (n & 0xffff0000) >> 16 ) | ( (n & 0x0000ffff) << 16 ); + n >>= (32 - (uLog2Length-3)); + n |= ((uIndex & 0x7) << (uLog2Length - 3)); + pfOutput[n] = pfInput[uIndex]; + } + } +} + + + //// + // DESCRIPTION: + // Convert complex components to polar form. + // + // PARAMETERS: + // pOutput - [out] output buffer, receives samples in polar form, must have at least uLength/4 elements + // pInputReal - [in] input buffer (real components), must have at least uLength/4 elements + // pInputImaginary - [in] input buffer (imaginary components), must have at least uLength/4 elements + // uLength - [in] FFT length in samples, must be a power of 2 >= 4 + // + // RETURN VALUE: + // void + //// +inline void FFTPolar (__out_ecount(uLength/4) XVECTOR* __restrict pOutput, __in_ecount(uLength/4) const XVECTOR* __restrict pInputReal, __in_ecount(uLength/4) const XVECTOR* __restrict pInputImaginary, const UINT32 uLength) +{ + DSPASSERT(pOutput != NULL); + DSPASSERT(pInputReal != NULL); + DSPASSERT(pInputImaginary != NULL); + DSPASSERT(uLength >= 4); + DSPASSERT(ISPOWEROF2(uLength)); + + FLOAT32 flOneOverLength = 1.0f / uLength; + + + // result = sqrtf((real/uLength)^2 + (imaginary/uLength)^2) * 2 + XVECTOR vOneOverLength = _mm_set_ps1(flOneOverLength); + + for (UINT32 uIndex=0; uIndex<(uLength>>2); ++uIndex) { + XVECTOR vReal = _mm_mul_ps(pInputReal[uIndex], vOneOverLength); + XVECTOR vImaginary = _mm_mul_ps(pInputImaginary[uIndex], vOneOverLength); + XVECTOR vRR = _mm_mul_ps(vReal, vReal); + XVECTOR vII = _mm_mul_ps(vImaginary, vImaginary); + XVECTOR vRRplusII = _mm_add_ps(vRR, vII); + XVECTOR vTotal = _mm_sqrt_ps(vRRplusII); + pOutput[uIndex] = _mm_add_ps(vTotal, vTotal); + } +} + + + + + +//--------------------------------------------------------------------------// + //// + // DESCRIPTION: + // Deinterleaves audio samples such that all samples corresponding to + + // + // REMARKS: + // For example, audio of the form [LRLRLR] becomes [LLLRRR]. + // + // PARAMETERS: + // pOutput - [out] output buffer, receives samples in deinterleaved form, cannot overlap pInput, must have at least (uChannelCount*uFrameCount)/4 elements + // pInput - [in] input buffer, cannot overlap pOutput, must have at least (uChannelCount*uFrameCount)/4 elements + // uChannelCount - [in] number of channels, must be > 1 + // uFrameCount - [in] number of frames of valid data, must be > 0 + // + // RETURN VALUE: + // void + //// +inline void Deinterleave (__out_ecount((uChannelCount*uFrameCount)/4) XVECTOR* __restrict pOutput, __in_ecount((uChannelCount*uFrameCount)/4) const XVECTOR* __restrict pInput, const UINT32 uChannelCount, const UINT32 uFrameCount) +{ + DSPASSERT(pOutput != NULL); + DSPASSERT(pInput != NULL); + DSPASSERT(uChannelCount > 1); + DSPASSERT(uFrameCount > 0); + + FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput; + const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput; + + + for (UINT32 uChannel=0; uChannel 1 + // uFrameCount - [in] number of frames of valid data, must be > 0 + // + // RETURN VALUE: + // void + //// +inline void Interleave (__out_ecount((uChannelCount*uFrameCount)/4) XVECTOR* __restrict pOutput, __in_ecount((uChannelCount*uFrameCount)/4) const XVECTOR* __restrict pInput, const UINT32 uChannelCount, const UINT32 uFrameCount) +{ + DSPASSERT(pOutput != NULL); + DSPASSERT(pInput != NULL); + DSPASSERT(uChannelCount > 1); + DSPASSERT(uFrameCount > 0); + + FLOAT32* __restrict pfOutput = (FLOAT32* __restrict)pOutput; + const FLOAT32* __restrict pfInput = (const FLOAT32* __restrict)pInput; + + + for (UINT32 uChannel=0; uChannel 0 && uChannelCount <= 6); + DSPASSERT(uLog2Length >= 2 && uLog2Length <= 9); + + XVECTOR vRealTemp[768]; + XVECTOR vImaginaryTemp[768]; + const UINT32 uLength = UINT32(1 << uLog2Length); + + + if (uChannelCount > 1) { + Deinterleave(vRealTemp, pReal, uChannelCount, uLength); + } else { + CopyMemory(vRealTemp, pReal, (uLength>>2)*sizeof(XVECTOR)); + } + for (UINT32 u=0; u>2); u++) { + vImaginaryTemp[u] = _mm_setzero_ps(); + } + + if (uLength > 16) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)], pUnityTable, uLength); + } + } else if (uLength == 16) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)]); + } + } else if (uLength == 8) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)]); + } + } else if (uLength == 4) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)]); + } + } + + for (UINT32 uChannel=0; uChannel>2)], &vRealTemp[uChannel*(uLength>>2)], uLog2Length); + FFTUnswizzle(&pImaginary[uChannel*(uLength>>2)], &vImaginaryTemp[uChannel*(uLength>>2)], uLog2Length); + } +} + + + //// + // DESCRIPTION: + // This function applies a 2^N-sample inverse FFT. + // Audio is interleaved if multichannel. + // + // PARAMETERS: + // pReal - [inout] real components, must have at least (1< 0 + // uLog2Length - [in] LOG (base 2) of FFT length in frames, must within [2, 10] + // + // RETURN VALUE: + // void + //// +inline void IFFTDeinterleaved (__inout_ecount((1< 0 && uChannelCount <= 6); + DSPASSERT(uLog2Length >= 2 && uLog2Length <= 9); + + XVECTOR vRealTemp[768]; + XVECTOR vImaginaryTemp[768]; + const UINT32 uLength = UINT32(1 << uLog2Length); + + + const XVECTOR vRnp = _mm_set_ps1(1.0f/uLength); + const XVECTOR vRnm = _mm_set_ps1(-1.0f/uLength); + for (UINT32 u=0; u>2); u++) { + vRealTemp[u] = _mm_mul_ps(pReal[u], vRnp); + vImaginaryTemp[u] = _mm_mul_ps(pImaginary[u], vRnm); + } + + if (uLength > 16) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)], pUnityTable, uLength); + } + } else if (uLength == 16) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)]); + } + } else if (uLength == 8) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)]); + } + } else if (uLength == 4) { + for (UINT32 uChannel=0; uChannel>2)], &vImaginaryTemp[uChannel*(uLength>>2)]); + } + } + + for (UINT32 uChannel=0; uChannel>2)], &vRealTemp[uChannel*(uLength>>2)], uLog2Length); + } + if (uChannelCount > 1) { + Interleave(pReal, vImaginaryTemp, uChannelCount, uLength); + } else { + CopyMemory(pReal, vImaginaryTemp, (uLength>>2)*sizeof(XVECTOR)); + } +} + + +#pragma warning(pop) +}; // namespace XDSP +//---------------------------------<-EOF->----------------------------------// + diff --git a/Src/Decoder_H264_ALL/D3D/include/XInput.h b/Src/Decoder_H264_ALL/D3D/include/XInput.h new file mode 100644 index 0000000..99a8dbd --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/XInput.h @@ -0,0 +1,258 @@ +/*************************************************************************** +* * +* XInput.h -- This module defines XBOX controller APIs * +* and constansts for the Windows platform. * +* * +* Copyright (c) Microsoft Corp. All rights reserved. * +* * +***************************************************************************/ +#ifndef _XINPUT_H_ +#define _XINPUT_H_ + +#include + +// Current name of the DLL shipped in the same SDK as this header. +// The name reflects the current version +#define XINPUT_DLL_A "xinput1_3.dll" +#define XINPUT_DLL_W L"xinput1_3.dll" +#ifdef UNICODE + #define XINPUT_DLL XINPUT_DLL_W +#else + #define XINPUT_DLL XINPUT_DLL_A +#endif + +// +// Device types available in XINPUT_CAPABILITIES +// +#define XINPUT_DEVTYPE_GAMEPAD 0x01 + +// +// Device subtypes available in XINPUT_CAPABILITIES +// +#define XINPUT_DEVSUBTYPE_GAMEPAD 0x01 +#define XINPUT_DEVSUBTYPE_WHEEL 0x02 +#define XINPUT_DEVSUBTYPE_ARCADE_STICK 0x03 +#define XINPUT_DEVSUBTYPE_FLIGHT_SICK 0x04 +#define XINPUT_DEVSUBTYPE_DANCE_PAD 0x05 +#define XINPUT_DEVSUBTYPE_GUITAR 0x06 +#define XINPUT_DEVSUBTYPE_DRUM_KIT 0x08 + +// +// Flags for XINPUT_CAPABILITIES +// +#define XINPUT_CAPS_VOICE_SUPPORTED 0x0004 + +// +// Constants for gamepad buttons +// +#define XINPUT_GAMEPAD_DPAD_UP 0x0001 +#define XINPUT_GAMEPAD_DPAD_DOWN 0x0002 +#define XINPUT_GAMEPAD_DPAD_LEFT 0x0004 +#define XINPUT_GAMEPAD_DPAD_RIGHT 0x0008 +#define XINPUT_GAMEPAD_START 0x0010 +#define XINPUT_GAMEPAD_BACK 0x0020 +#define XINPUT_GAMEPAD_LEFT_THUMB 0x0040 +#define XINPUT_GAMEPAD_RIGHT_THUMB 0x0080 +#define XINPUT_GAMEPAD_LEFT_SHOULDER 0x0100 +#define XINPUT_GAMEPAD_RIGHT_SHOULDER 0x0200 +#define XINPUT_GAMEPAD_A 0x1000 +#define XINPUT_GAMEPAD_B 0x2000 +#define XINPUT_GAMEPAD_X 0x4000 +#define XINPUT_GAMEPAD_Y 0x8000 + + +// +// Gamepad thresholds +// +#define XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE 7849 +#define XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE 8689 +#define XINPUT_GAMEPAD_TRIGGER_THRESHOLD 30 + +// +// Flags to pass to XInputGetCapabilities +// +#define XINPUT_FLAG_GAMEPAD 0x00000001 + +// +// Devices that support batteries +// +#define BATTERY_DEVTYPE_GAMEPAD 0x00 +#define BATTERY_DEVTYPE_HEADSET 0x01 + +// +// Flags for battery status level +// +#define BATTERY_TYPE_DISCONNECTED 0x00 // This device is not connected +#define BATTERY_TYPE_WIRED 0x01 // Wired device, no battery +#define BATTERY_TYPE_ALKALINE 0x02 // Alkaline battery source +#define BATTERY_TYPE_NIMH 0x03 // Nickel Metal Hydride battery source +#define BATTERY_TYPE_UNKNOWN 0xFF // Cannot determine the battery type + +// These are only valid for wireless, connected devices, with known battery types +// The amount of use time remaining depends on the type of device. +#define BATTERY_LEVEL_EMPTY 0x00 +#define BATTERY_LEVEL_LOW 0x01 +#define BATTERY_LEVEL_MEDIUM 0x02 +#define BATTERY_LEVEL_FULL 0x03 + +// User index definitions +#define XUSER_MAX_COUNT 4 + +#define XUSER_INDEX_ANY 0x000000FF + + +// +// Codes returned for the gamepad keystroke +// + +#define VK_PAD_A 0x5800 +#define VK_PAD_B 0x5801 +#define VK_PAD_X 0x5802 +#define VK_PAD_Y 0x5803 +#define VK_PAD_RSHOULDER 0x5804 +#define VK_PAD_LSHOULDER 0x5805 +#define VK_PAD_LTRIGGER 0x5806 +#define VK_PAD_RTRIGGER 0x5807 + +#define VK_PAD_DPAD_UP 0x5810 +#define VK_PAD_DPAD_DOWN 0x5811 +#define VK_PAD_DPAD_LEFT 0x5812 +#define VK_PAD_DPAD_RIGHT 0x5813 +#define VK_PAD_START 0x5814 +#define VK_PAD_BACK 0x5815 +#define VK_PAD_LTHUMB_PRESS 0x5816 +#define VK_PAD_RTHUMB_PRESS 0x5817 + +#define VK_PAD_LTHUMB_UP 0x5820 +#define VK_PAD_LTHUMB_DOWN 0x5821 +#define VK_PAD_LTHUMB_RIGHT 0x5822 +#define VK_PAD_LTHUMB_LEFT 0x5823 +#define VK_PAD_LTHUMB_UPLEFT 0x5824 +#define VK_PAD_LTHUMB_UPRIGHT 0x5825 +#define VK_PAD_LTHUMB_DOWNRIGHT 0x5826 +#define VK_PAD_LTHUMB_DOWNLEFT 0x5827 + +#define VK_PAD_RTHUMB_UP 0x5830 +#define VK_PAD_RTHUMB_DOWN 0x5831 +#define VK_PAD_RTHUMB_RIGHT 0x5832 +#define VK_PAD_RTHUMB_LEFT 0x5833 +#define VK_PAD_RTHUMB_UPLEFT 0x5834 +#define VK_PAD_RTHUMB_UPRIGHT 0x5835 +#define VK_PAD_RTHUMB_DOWNRIGHT 0x5836 +#define VK_PAD_RTHUMB_DOWNLEFT 0x5837 + +// +// Flags used in XINPUT_KEYSTROKE +// +#define XINPUT_KEYSTROKE_KEYDOWN 0x0001 +#define XINPUT_KEYSTROKE_KEYUP 0x0002 +#define XINPUT_KEYSTROKE_REPEAT 0x0004 + +// +// Structures used by XInput APIs +// +typedef struct _XINPUT_GAMEPAD +{ + WORD wButtons; + BYTE bLeftTrigger; + BYTE bRightTrigger; + SHORT sThumbLX; + SHORT sThumbLY; + SHORT sThumbRX; + SHORT sThumbRY; +} XINPUT_GAMEPAD, *PXINPUT_GAMEPAD; + +typedef struct _XINPUT_STATE +{ + DWORD dwPacketNumber; + XINPUT_GAMEPAD Gamepad; +} XINPUT_STATE, *PXINPUT_STATE; + +typedef struct _XINPUT_VIBRATION +{ + WORD wLeftMotorSpeed; + WORD wRightMotorSpeed; +} XINPUT_VIBRATION, *PXINPUT_VIBRATION; + +typedef struct _XINPUT_CAPABILITIES +{ + BYTE Type; + BYTE SubType; + WORD Flags; + XINPUT_GAMEPAD Gamepad; + XINPUT_VIBRATION Vibration; +} XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES; + +typedef struct _XINPUT_BATTERY_INFORMATION +{ + BYTE BatteryType; + BYTE BatteryLevel; +} XINPUT_BATTERY_INFORMATION, *PXINPUT_BATTERY_INFORMATION; + +typedef struct _XINPUT_KEYSTROKE +{ + WORD VirtualKey; + WCHAR Unicode; + WORD Flags; + BYTE UserIndex; + BYTE HidCode; +} XINPUT_KEYSTROKE, *PXINPUT_KEYSTROKE; + +// +// XInput APIs +// +#ifdef __cplusplus +extern "C" { +#endif + +DWORD WINAPI XInputGetState +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __out XINPUT_STATE* pState // Receives the current state +); + +DWORD WINAPI XInputSetState +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __in XINPUT_VIBRATION* pVibration // The vibration information to send to the controller +); + +DWORD WINAPI XInputGetCapabilities +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __in DWORD dwFlags, // Input flags that identify the device type + __out XINPUT_CAPABILITIES* pCapabilities // Receives the capabilities +); + +void WINAPI XInputEnable +( + __in BOOL enable // [in] Indicates whether xinput is enabled or disabled. +); + +DWORD WINAPI XInputGetDSoundAudioDeviceGuids +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __out GUID* pDSoundRenderGuid, // DSound device ID for render + __out GUID* pDSoundCaptureGuid // DSound device ID for capture +); + +DWORD WINAPI XInputGetBatteryInformation +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __in BYTE devType, // Which device on this user index + __out XINPUT_BATTERY_INFORMATION* pBatteryInformation // Contains the level and types of batteries +); + +DWORD WINAPI XInputGetKeystroke +( + __in DWORD dwUserIndex, // Index of the gamer associated with the device + __reserved DWORD dwReserved, // Reserved for future use + __out PXINPUT_KEYSTROKE pKeystroke // Pointer to an XINPUT_KEYSTROKE structure that receives an input event. +); + +#ifdef __cplusplus +} +#endif + +#endif //_XINPUT_H_ + diff --git a/Src/Decoder_H264_ALL/D3D/include/audiodefs.h b/Src/Decoder_H264_ALL/D3D/include/audiodefs.h new file mode 100644 index 0000000..ff995ec --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/audiodefs.h @@ -0,0 +1,263 @@ +/*************************************************************************** + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: audiodefs.h + * Content: Basic constants and data types for audio work. + * + * Remarks: This header file defines all of the audio format constants and + * structures required for XAudio2 and XACT work. Providing these + * in a single location avoids certain dependency problems in the + * legacy audio headers (mmreg.h, mmsystem.h, ksmedia.h). + * + * NOTE: Including the legacy headers after this one may cause a + * compilation error, because they define some of the same types + * defined here without preprocessor guards to avoid multiple + * definitions. If a source file needs one of the old headers, + * it must include it before including audiodefs.h. + * + ***************************************************************************/ + +#ifndef __AUDIODEFS_INCLUDED__ +#define __AUDIODEFS_INCLUDED__ + +#include // For WORD, DWORD, etc. + +#pragma pack(push, 1) // Pack structures to 1-byte boundaries + + +/************************************************************************** + * + * WAVEFORMATEX: Base structure for many audio formats. Format-specific + * extensions can be defined for particular formats by using a non-zero + * cbSize value and adding extra fields to the end of this structure. + * + ***************************************************************************/ + +#ifndef _WAVEFORMATEX_ + + #define _WAVEFORMATEX_ + typedef struct tWAVEFORMATEX + { + WORD wFormatTag; // Integer identifier of the format + WORD nChannels; // Number of audio channels + DWORD nSamplesPerSec; // Audio sample rate + DWORD nAvgBytesPerSec; // Bytes per second (possibly approximate) + WORD nBlockAlign; // Size in bytes of a sample block (all channels) + WORD wBitsPerSample; // Size in bits of a single per-channel sample + WORD cbSize; // Bytes of extra data appended to this struct + } WAVEFORMATEX; + +#endif + +// Defining pointer types outside of the #if block to make sure they are +// defined even if mmreg.h or mmsystem.h is #included before this file + +typedef WAVEFORMATEX *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX; +typedef const WAVEFORMATEX *PCWAVEFORMATEX, *LPCWAVEFORMATEX; + + +/************************************************************************** + * + * WAVEFORMATEXTENSIBLE: Extended version of WAVEFORMATEX that should be + * used as a basis for all new audio formats. The format tag is replaced + * with a GUID, allowing new formats to be defined without registering a + * format tag with Microsoft. There are also new fields that can be used + * to specify the spatial positions for each channel and the bit packing + * used for wide samples (e.g. 24-bit PCM samples in 32-bit containers). + * + ***************************************************************************/ + +#ifndef _WAVEFORMATEXTENSIBLE_ + + #define _WAVEFORMATEXTENSIBLE_ + typedef struct + { + WAVEFORMATEX Format; // Base WAVEFORMATEX data + union + { + WORD wValidBitsPerSample; // Valid bits in each sample container + WORD wSamplesPerBlock; // Samples per block of audio data; valid + // if wBitsPerSample=0 (but rarely used). + WORD wReserved; // Zero if neither case above applies. + } Samples; + DWORD dwChannelMask; // Positions of the audio channels + GUID SubFormat; // Format identifier GUID + } WAVEFORMATEXTENSIBLE; + +#endif + +typedef WAVEFORMATEXTENSIBLE *PWAVEFORMATEXTENSIBLE, *LPWAVEFORMATEXTENSIBLE; +typedef const WAVEFORMATEXTENSIBLE *PCWAVEFORMATEXTENSIBLE, *LPCWAVEFORMATEXTENSIBLE; + + + +/************************************************************************** + * + * Define the most common wave format tags used in WAVEFORMATEX formats. + * + ***************************************************************************/ + +#ifndef WAVE_FORMAT_PCM // Pulse Code Modulation + + // If WAVE_FORMAT_PCM is not defined, we need to define some legacy types + // for compatibility with the Windows mmreg.h / mmsystem.h header files. + + // Old general format structure (information common to all formats) + typedef struct waveformat_tag + { + WORD wFormatTag; + WORD nChannels; + DWORD nSamplesPerSec; + DWORD nAvgBytesPerSec; + WORD nBlockAlign; + } WAVEFORMAT, *PWAVEFORMAT, NEAR *NPWAVEFORMAT, FAR *LPWAVEFORMAT; + + // Specific format structure for PCM data + typedef struct pcmwaveformat_tag + { + WAVEFORMAT wf; + WORD wBitsPerSample; + } PCMWAVEFORMAT, *PPCMWAVEFORMAT, NEAR *NPPCMWAVEFORMAT, FAR *LPPCMWAVEFORMAT; + + #define WAVE_FORMAT_PCM 0x0001 + +#endif + +#ifndef WAVE_FORMAT_ADPCM // Microsoft Adaptive Differental PCM + + // Replicate the Microsoft ADPCM type definitions from mmreg.h. + + typedef struct adpcmcoef_tag + { + short iCoef1; + short iCoef2; + } ADPCMCOEFSET; + + #pragma warning(push) + #pragma warning(disable:4200) // Disable zero-sized array warnings + + typedef struct adpcmwaveformat_tag { + WAVEFORMATEX wfx; + WORD wSamplesPerBlock; + WORD wNumCoef; + ADPCMCOEFSET aCoef[]; // Always 7 coefficient pairs for MS ADPCM + } ADPCMWAVEFORMAT; + + #pragma warning(pop) + + #define WAVE_FORMAT_ADPCM 0x0002 + +#endif + +// Other frequently used format tags + +#ifndef WAVE_FORMAT_UNKNOWN + #define WAVE_FORMAT_UNKNOWN 0x0000 // Unknown or invalid format tag +#endif + +#ifndef WAVE_FORMAT_IEEE_FLOAT + #define WAVE_FORMAT_IEEE_FLOAT 0x0003 // 32-bit floating-point +#endif + +#ifndef WAVE_FORMAT_MPEGLAYER3 + #define WAVE_FORMAT_MPEGLAYER3 0x0055 // ISO/MPEG Layer3 +#endif + +#ifndef WAVE_FORMAT_DOLBY_AC3_SPDIF + #define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 // Dolby Audio Codec 3 over S/PDIF +#endif + +#ifndef WAVE_FORMAT_WMAUDIO2 + #define WAVE_FORMAT_WMAUDIO2 0x0161 // Windows Media Audio +#endif + +#ifndef WAVE_FORMAT_WMAUDIO3 + #define WAVE_FORMAT_WMAUDIO3 0x0162 // Windows Media Audio Pro +#endif + +#ifndef WAVE_FORMAT_WMASPDIF + #define WAVE_FORMAT_WMASPDIF 0x0164 // Windows Media Audio over S/PDIF +#endif + +#ifndef WAVE_FORMAT_EXTENSIBLE + #define WAVE_FORMAT_EXTENSIBLE 0xFFFE // All WAVEFORMATEXTENSIBLE formats +#endif + + +/************************************************************************** + * + * Define the most common wave format GUIDs used in WAVEFORMATEXTENSIBLE + * formats. Note that including the Windows ksmedia.h header after this + * one will cause build problems; this cannot be avoided, since ksmedia.h + * defines these macros without preprocessor guards. + * + ***************************************************************************/ + +#ifdef __cplusplus // uuid() and __uuidof() are only available in C++ + + #ifndef KSDATAFORMAT_SUBTYPE_PCM + struct __declspec(uuid("00000001-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_PCM_STRUCT; + #define KSDATAFORMAT_SUBTYPE_PCM __uuidof(KSDATAFORMAT_SUBTYPE_PCM_STRUCT) + #endif + + #ifndef KSDATAFORMAT_SUBTYPE_ADPCM + struct __declspec(uuid("00000002-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_ADPCM_STRUCT; + #define KSDATAFORMAT_SUBTYPE_ADPCM __uuidof(KSDATAFORMAT_SUBTYPE_ADPCM_STRUCT) + #endif + + #ifndef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT + struct __declspec(uuid("00000003-0000-0010-8000-00aa00389b71")) KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT; + #define KSDATAFORMAT_SUBTYPE_IEEE_FLOAT __uuidof(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT_STRUCT) + #endif + +#endif + + +/************************************************************************** + * + * Speaker positions used in the WAVEFORMATEXTENSIBLE dwChannelMask field. + * + ***************************************************************************/ + +#ifndef SPEAKER_FRONT_LEFT + #define SPEAKER_FRONT_LEFT 0x00000001 + #define SPEAKER_FRONT_RIGHT 0x00000002 + #define SPEAKER_FRONT_CENTER 0x00000004 + #define SPEAKER_LOW_FREQUENCY 0x00000008 + #define SPEAKER_BACK_LEFT 0x00000010 + #define SPEAKER_BACK_RIGHT 0x00000020 + #define SPEAKER_FRONT_LEFT_OF_CENTER 0x00000040 + #define SPEAKER_FRONT_RIGHT_OF_CENTER 0x00000080 + #define SPEAKER_BACK_CENTER 0x00000100 + #define SPEAKER_SIDE_LEFT 0x00000200 + #define SPEAKER_SIDE_RIGHT 0x00000400 + #define SPEAKER_TOP_CENTER 0x00000800 + #define SPEAKER_TOP_FRONT_LEFT 0x00001000 + #define SPEAKER_TOP_FRONT_CENTER 0x00002000 + #define SPEAKER_TOP_FRONT_RIGHT 0x00004000 + #define SPEAKER_TOP_BACK_LEFT 0x00008000 + #define SPEAKER_TOP_BACK_CENTER 0x00010000 + #define SPEAKER_TOP_BACK_RIGHT 0x00020000 + #define SPEAKER_RESERVED 0x7FFC0000 + #define SPEAKER_ALL 0x80000000 + #define _SPEAKER_POSITIONS_ +#endif + +#ifndef SPEAKER_STEREO + #define SPEAKER_MONO (SPEAKER_FRONT_CENTER) + #define SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT) + #define SPEAKER_2POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY) + #define SPEAKER_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER) + #define SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) + #define SPEAKER_4POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) + #define SPEAKER_5POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT) + #define SPEAKER_7POINT1 (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER) + #define SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) + #define SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT) +#endif + + +#pragma pack(pop) + +#endif // #ifndef __AUDIODEFS_INCLUDED__ diff --git a/Src/Decoder_H264_ALL/D3D/include/comdecl.h b/Src/Decoder_H264_ALL/D3D/include/comdecl.h new file mode 100644 index 0000000..2ae9a96 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/comdecl.h @@ -0,0 +1,59 @@ +// comdecl.h: Macros to facilitate COM interface and GUID declarations. +// Copyright (c) Microsoft Corporation. All rights reserved. + +#ifndef _COMDECL_H_ +#define _COMDECL_H_ + +#ifndef _XBOX + #include // For standard COM interface macros +#else + #pragma warning(push) + #pragma warning(disable:4061) + #include // Required by xobjbase.h + #include // Special definitions for Xbox build + #pragma warning(pop) +#endif + +// The DEFINE_CLSID() and DEFINE_IID() macros defined below allow COM GUIDs to +// be declared and defined in such a way that clients can obtain the GUIDs using +// either the __uuidof() extension or the old-style CLSID_Foo / IID_IFoo names. +// If using the latter approach, the client can also choose whether to get the +// GUID definitions by defining the INITGUID preprocessor constant or by linking +// to a GUID library. This works in either C or C++. + +#ifdef __cplusplus + + #define DECLSPEC_UUID_WRAPPER(x) __declspec(uuid(#x)) + #ifdef INITGUID + + #define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \ + EXTERN_C const GUID DECLSPEC_SELECTANY CLSID_##className = __uuidof(className) + + #define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \ + EXTERN_C const GUID DECLSPEC_SELECTANY IID_##interfaceName = __uuidof(interfaceName) + + #else // INITGUID + + #define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + class DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) className; \ + EXTERN_C const GUID CLSID_##className + + #define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + interface DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8) interfaceName; \ + EXTERN_C const GUID IID_##interfaceName + + #endif // INITGUID + +#else // __cplusplus + + #define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + DEFINE_GUID(CLSID_##className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8) + + #define DEFINE_IID(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + DEFINE_GUID(IID_##interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8) + +#endif // __cplusplus + +#endif // #ifndef _COMDECL_H_ diff --git a/Src/Decoder_H264_ALL/D3D/include/d3d.h b/Src/Decoder_H264_ALL/D3D/include/d3d.h new file mode 100644 index 0000000..eea7dff --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3d.h @@ -0,0 +1,1688 @@ +/*==========================================================================; + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: d3d.h + * Content: Direct3D include file + * + ****************************************************************************/ + +#ifndef _D3D_H_ +#define _D3D_H_ + +#ifndef DIRECT3D_VERSION +#define DIRECT3D_VERSION 0x0700 +#endif + +// include this file content only if compiling for <=DX7 interfaces +#if(DIRECT3D_VERSION < 0x0800) + + +#include + +#define COM_NO_WINDOWS_H +#include + +#define D3DAPI WINAPI + +/* + * Interface IID's + */ +#if defined( _WIN32 ) && !defined( _NO_COM) +DEFINE_GUID( IID_IDirect3D, 0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); +#if(DIRECT3D_VERSION >= 0x0500) +DEFINE_GUID( IID_IDirect3D2, 0x6aae1ec1,0x662a,0x11d0,0x88,0x9d,0x00,0xaa,0x00,0xbb,0xb7,0x6a); +#endif /* DIRECT3D_VERSION >= 0x0500 */ +#if(DIRECT3D_VERSION >= 0x0600) +DEFINE_GUID( IID_IDirect3D3, 0xbb223240,0xe72b,0x11d0,0xa9,0xb4,0x00,0xaa,0x00,0xc0,0x99,0x3e); +#endif /* DIRECT3D_VERSION >= 0x0600 */ +#if(DIRECT3D_VERSION >= 0x0700) +DEFINE_GUID( IID_IDirect3D7, 0xf5049e77,0x4861,0x11d2,0xa4,0x7,0x0,0xa0,0xc9,0x6,0x29,0xa8); +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +#if(DIRECT3D_VERSION >= 0x0500) +DEFINE_GUID( IID_IDirect3DRampDevice, 0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); +DEFINE_GUID( IID_IDirect3DRGBDevice, 0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); +DEFINE_GUID( IID_IDirect3DHALDevice, 0x84E63dE0,0x46AA,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); +DEFINE_GUID( IID_IDirect3DMMXDevice, 0x881949a1,0xd6f3,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 ); +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if(DIRECT3D_VERSION >= 0x0600) +DEFINE_GUID( IID_IDirect3DRefDevice, 0x50936643, 0x13e9, 0x11d1, 0x89, 0xaa, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); +DEFINE_GUID( IID_IDirect3DNullDevice, 0x8767df22, 0xbacc, 0x11d1, 0x89, 0x69, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); +#endif /* DIRECT3D_VERSION >= 0x0600 */ +#if(DIRECT3D_VERSION >= 0x0700) +DEFINE_GUID( IID_IDirect3DTnLHalDevice, 0xf5049e78, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +/* + * Internal Guid to distinguish requested MMX from MMX being used as an RGB rasterizer + */ + +DEFINE_GUID( IID_IDirect3DDevice, 0x64108800,0x957d,0X11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 ); +#if(DIRECT3D_VERSION >= 0x0500) +DEFINE_GUID( IID_IDirect3DDevice2, 0x93281501, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); +#endif /* DIRECT3D_VERSION >= 0x0500 */ +#if(DIRECT3D_VERSION >= 0x0600) +DEFINE_GUID( IID_IDirect3DDevice3, 0xb0ab3b60, 0x33d7, 0x11d1, 0xa9, 0x81, 0x0, 0xc0, 0x4f, 0xd7, 0xb1, 0x74); +#endif /* DIRECT3D_VERSION >= 0x0600 */ +#if(DIRECT3D_VERSION >= 0x0700) +DEFINE_GUID( IID_IDirect3DDevice7, 0xf5049e79, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +DEFINE_GUID( IID_IDirect3DTexture, 0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 ); +#if(DIRECT3D_VERSION >= 0x0500) +DEFINE_GUID( IID_IDirect3DTexture2, 0x93281502, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +DEFINE_GUID( IID_IDirect3DLight, 0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); + +DEFINE_GUID( IID_IDirect3DMaterial, 0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); +#if(DIRECT3D_VERSION >= 0x0500) +DEFINE_GUID( IID_IDirect3DMaterial2, 0x93281503, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); +#endif /* DIRECT3D_VERSION >= 0x0500 */ +#if(DIRECT3D_VERSION >= 0x0600) +DEFINE_GUID( IID_IDirect3DMaterial3, 0xca9c46f4, 0xd3c5, 0x11d1, 0xb7, 0x5a, 0x0, 0x60, 0x8, 0x52, 0xb3, 0x12); +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +DEFINE_GUID( IID_IDirect3DExecuteBuffer,0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); +DEFINE_GUID( IID_IDirect3DViewport, 0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E ); +#if(DIRECT3D_VERSION >= 0x0500) +DEFINE_GUID( IID_IDirect3DViewport2, 0x93281500, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29); +#endif /* DIRECT3D_VERSION >= 0x0500 */ +#if(DIRECT3D_VERSION >= 0x0600) +DEFINE_GUID( IID_IDirect3DViewport3, 0xb0ab3b61, 0x33d7, 0x11d1, 0xa9, 0x81, 0x0, 0xc0, 0x4f, 0xd7, 0xb1, 0x74); +#endif /* DIRECT3D_VERSION >= 0x0600 */ +#if(DIRECT3D_VERSION >= 0x0600) +DEFINE_GUID( IID_IDirect3DVertexBuffer, 0x7a503555, 0x4a83, 0x11d1, 0xa5, 0xdb, 0x0, 0xa0, 0xc9, 0x3, 0x67, 0xf8); +#endif /* DIRECT3D_VERSION >= 0x0600 */ +#if(DIRECT3D_VERSION >= 0x0700) +DEFINE_GUID( IID_IDirect3DVertexBuffer7, 0xf5049e7d, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8); +#endif /* DIRECT3D_VERSION >= 0x0700 */ +#endif + +#ifdef __cplusplus +struct IDirect3D; +struct IDirect3DDevice; +struct IDirect3DLight; +struct IDirect3DMaterial; +struct IDirect3DExecuteBuffer; +struct IDirect3DTexture; +struct IDirect3DViewport; +typedef struct IDirect3D *LPDIRECT3D; +typedef struct IDirect3DDevice *LPDIRECT3DDEVICE; +typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER; +typedef struct IDirect3DLight *LPDIRECT3DLIGHT; +typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL; +typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE; +typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT; + +#if(DIRECT3D_VERSION >= 0x0500) +struct IDirect3D2; +struct IDirect3DDevice2; +struct IDirect3DMaterial2; +struct IDirect3DTexture2; +struct IDirect3DViewport2; +typedef struct IDirect3D2 *LPDIRECT3D2; +typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2; +typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2; +typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2; +typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2; +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if(DIRECT3D_VERSION >= 0x0600) +struct IDirect3D3; +struct IDirect3DDevice3; +struct IDirect3DMaterial3; +struct IDirect3DViewport3; +struct IDirect3DVertexBuffer; +typedef struct IDirect3D3 *LPDIRECT3D3; +typedef struct IDirect3DDevice3 *LPDIRECT3DDEVICE3; +typedef struct IDirect3DMaterial3 *LPDIRECT3DMATERIAL3; +typedef struct IDirect3DViewport3 *LPDIRECT3DVIEWPORT3; +typedef struct IDirect3DVertexBuffer *LPDIRECT3DVERTEXBUFFER; +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +#if(DIRECT3D_VERSION >= 0x0700) +struct IDirect3D7; +struct IDirect3DDevice7; +struct IDirect3DVertexBuffer7; +typedef struct IDirect3D7 *LPDIRECT3D7; +typedef struct IDirect3DDevice7 *LPDIRECT3DDEVICE7; +typedef struct IDirect3DVertexBuffer7 *LPDIRECT3DVERTEXBUFFER7; +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +#else + +typedef struct IDirect3D *LPDIRECT3D; +typedef struct IDirect3DDevice *LPDIRECT3DDEVICE; +typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER; +typedef struct IDirect3DLight *LPDIRECT3DLIGHT; +typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL; +typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE; +typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT; + +#if(DIRECT3D_VERSION >= 0x0500) +typedef struct IDirect3D2 *LPDIRECT3D2; +typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2; +typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2; +typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2; +typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2; +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if(DIRECT3D_VERSION >= 0x0600) +typedef struct IDirect3D3 *LPDIRECT3D3; +typedef struct IDirect3DDevice3 *LPDIRECT3DDEVICE3; +typedef struct IDirect3DMaterial3 *LPDIRECT3DMATERIAL3; +typedef struct IDirect3DViewport3 *LPDIRECT3DVIEWPORT3; +typedef struct IDirect3DVertexBuffer *LPDIRECT3DVERTEXBUFFER; +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +#if(DIRECT3D_VERSION >= 0x0700) +typedef struct IDirect3D7 *LPDIRECT3D7; +typedef struct IDirect3DDevice7 *LPDIRECT3DDEVICE7; +typedef struct IDirect3DVertexBuffer7 *LPDIRECT3DVERTEXBUFFER7; +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +#endif + +#include "d3dtypes.h" +#include "d3dcaps.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Direct3D interfaces + */ +#undef INTERFACE +#define INTERFACE IDirect3D + +DECLARE_INTERFACE_(IDirect3D, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3D methods ***/ + STDMETHOD(Initialize)(THIS_ REFCLSID) PURE; + STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK,LPVOID) PURE; + STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT*,IUnknown*) PURE; + STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL*,IUnknown*) PURE; + STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT*,IUnknown*) PURE; + STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT) PURE; +}; + +typedef struct IDirect3D *LPDIRECT3D; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3D_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#define IDirect3D_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b) +#define IDirect3D_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b) +#define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) +#define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b) +#define IDirect3D_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b) +#else +#define IDirect3D_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D_AddRef(p) (p)->AddRef() +#define IDirect3D_Release(p) (p)->Release() +#define IDirect3D_Initialize(p,a) (p)->Initialize(a) +#define IDirect3D_EnumDevices(p,a,b) (p)->EnumDevices(a,b) +#define IDirect3D_CreateLight(p,a,b) (p)->CreateLight(a,b) +#define IDirect3D_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b) +#define IDirect3D_CreateViewport(p,a,b) (p)->CreateViewport(a,b) +#define IDirect3D_FindDevice(p,a,b) (p)->FindDevice(a,b) +#endif + +#if(DIRECT3D_VERSION >= 0x0500) +#undef INTERFACE +#define INTERFACE IDirect3D2 + +DECLARE_INTERFACE_(IDirect3D2, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3D2 methods ***/ + STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK,LPVOID) PURE; + STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT*,IUnknown*) PURE; + STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL2*,IUnknown*) PURE; + STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT2*,IUnknown*) PURE; + STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT) PURE; + STDMETHOD(CreateDevice)(THIS_ REFCLSID,LPDIRECTDRAWSURFACE,LPDIRECT3DDEVICE2*) PURE; +}; + +typedef struct IDirect3D2 *LPDIRECT3D2; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3D2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D2_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3D2_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b) +#define IDirect3D2_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b) +#define IDirect3D2_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) +#define IDirect3D2_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b) +#define IDirect3D2_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b) +#define IDirect3D2_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) +#else +#define IDirect3D2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D2_AddRef(p) (p)->AddRef() +#define IDirect3D2_Release(p) (p)->Release() +#define IDirect3D2_EnumDevices(p,a,b) (p)->EnumDevices(a,b) +#define IDirect3D2_CreateLight(p,a,b) (p)->CreateLight(a,b) +#define IDirect3D2_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b) +#define IDirect3D2_CreateViewport(p,a,b) (p)->CreateViewport(a,b) +#define IDirect3D2_FindDevice(p,a,b) (p)->FindDevice(a,b) +#define IDirect3D2_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) +#endif +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if(DIRECT3D_VERSION >= 0x0600) +#undef INTERFACE +#define INTERFACE IDirect3D3 + +DECLARE_INTERFACE_(IDirect3D3, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3D3 methods ***/ + STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK,LPVOID) PURE; + STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT*,LPUNKNOWN) PURE; + STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL3*,LPUNKNOWN) PURE; + STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT3*,LPUNKNOWN) PURE; + STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT) PURE; + STDMETHOD(CreateDevice)(THIS_ REFCLSID,LPDIRECTDRAWSURFACE4,LPDIRECT3DDEVICE3*,LPUNKNOWN) PURE; + STDMETHOD(CreateVertexBuffer)(THIS_ LPD3DVERTEXBUFFERDESC,LPDIRECT3DVERTEXBUFFER*,DWORD,LPUNKNOWN) PURE; + STDMETHOD(EnumZBufferFormats)(THIS_ REFCLSID,LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE; + STDMETHOD(EvictManagedTextures)(THIS) PURE; +}; + +typedef struct IDirect3D3 *LPDIRECT3D3; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3D3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D3_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D3_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3D3_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b) +#define IDirect3D3_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b) +#define IDirect3D3_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b) +#define IDirect3D3_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b) +#define IDirect3D3_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b) +#define IDirect3D3_CreateDevice(p,a,b,c,d) (p)->lpVtbl->CreateDevice(p,a,b,c,d) +#define IDirect3D3_CreateVertexBuffer(p,a,b,c,d) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d) +#define IDirect3D3_EnumZBufferFormats(p,a,b,c) (p)->lpVtbl->EnumZBufferFormats(p,a,b,c) +#define IDirect3D3_EvictManagedTextures(p) (p)->lpVtbl->EvictManagedTextures(p) +#else +#define IDirect3D3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D3_AddRef(p) (p)->AddRef() +#define IDirect3D3_Release(p) (p)->Release() +#define IDirect3D3_EnumDevices(p,a,b) (p)->EnumDevices(a,b) +#define IDirect3D3_CreateLight(p,a,b) (p)->CreateLight(a,b) +#define IDirect3D3_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b) +#define IDirect3D3_CreateViewport(p,a,b) (p)->CreateViewport(a,b) +#define IDirect3D3_FindDevice(p,a,b) (p)->FindDevice(a,b) +#define IDirect3D3_CreateDevice(p,a,b,c,d) (p)->CreateDevice(a,b,c,d) +#define IDirect3D3_CreateVertexBuffer(p,a,b,c,d) (p)->CreateVertexBuffer(a,b,c,d) +#define IDirect3D3_EnumZBufferFormats(p,a,b,c) (p)->EnumZBufferFormats(a,b,c) +#define IDirect3D3_EvictManagedTextures(p) (p)->EvictManagedTextures() +#endif +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +#if(DIRECT3D_VERSION >= 0x0700) +#undef INTERFACE +#define INTERFACE IDirect3D7 + +DECLARE_INTERFACE_(IDirect3D7, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3D7 methods ***/ + STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK7,LPVOID) PURE; + STDMETHOD(CreateDevice)(THIS_ REFCLSID,LPDIRECTDRAWSURFACE7,LPDIRECT3DDEVICE7*) PURE; + STDMETHOD(CreateVertexBuffer)(THIS_ LPD3DVERTEXBUFFERDESC,LPDIRECT3DVERTEXBUFFER7*,DWORD) PURE; + STDMETHOD(EnumZBufferFormats)(THIS_ REFCLSID,LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE; + STDMETHOD(EvictManagedTextures)(THIS) PURE; +}; + +typedef struct IDirect3D7 *LPDIRECT3D7; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3D7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D7_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D7_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3D7_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b) +#define IDirect3D7_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) +#define IDirect3D7_CreateVertexBuffer(p,a,b,c) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c) +#define IDirect3D7_EnumZBufferFormats(p,a,b,c) (p)->lpVtbl->EnumZBufferFormats(p,a,b,c) +#define IDirect3D7_EvictManagedTextures(p) (p)->lpVtbl->EvictManagedTextures(p) +#else +#define IDirect3D7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D7_AddRef(p) (p)->AddRef() +#define IDirect3D7_Release(p) (p)->Release() +#define IDirect3D7_EnumDevices(p,a,b) (p)->EnumDevices(a,b) +#define IDirect3D7_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) +#define IDirect3D7_CreateVertexBuffer(p,a,b,c) (p)->CreateVertexBuffer(a,b,c) +#define IDirect3D7_EnumZBufferFormats(p,a,b,c) (p)->EnumZBufferFormats(a,b,c) +#define IDirect3D7_EvictManagedTextures(p) (p)->EvictManagedTextures() +#endif +#endif /* DIRECT3D_VERSION >= 0x0700 */ +/* + * Direct3D Device interfaces + */ +#undef INTERFACE +#define INTERFACE IDirect3DDevice + +DECLARE_INTERFACE_(IDirect3DDevice, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DDevice methods ***/ + STDMETHOD(Initialize)(THIS_ LPDIRECT3D,LPGUID,LPD3DDEVICEDESC) PURE; + STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC,LPD3DDEVICEDESC) PURE; + STDMETHOD(SwapTextureHandles)(THIS_ LPDIRECT3DTEXTURE,LPDIRECT3DTEXTURE) PURE; + STDMETHOD(CreateExecuteBuffer)(THIS_ LPD3DEXECUTEBUFFERDESC,LPDIRECT3DEXECUTEBUFFER*,IUnknown*) PURE; + STDMETHOD(GetStats)(THIS_ LPD3DSTATS) PURE; + STDMETHOD(Execute)(THIS_ LPDIRECT3DEXECUTEBUFFER,LPDIRECT3DVIEWPORT,DWORD) PURE; + STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT) PURE; + STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT) PURE; + STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT,LPDIRECT3DVIEWPORT*,DWORD) PURE; + STDMETHOD(Pick)(THIS_ LPDIRECT3DEXECUTEBUFFER,LPDIRECT3DVIEWPORT,DWORD,LPD3DRECT) PURE; + STDMETHOD(GetPickRecords)(THIS_ LPDWORD,LPD3DPICKRECORD) PURE; + STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK,LPVOID) PURE; + STDMETHOD(CreateMatrix)(THIS_ LPD3DMATRIXHANDLE) PURE; + STDMETHOD(SetMatrix)(THIS_ D3DMATRIXHANDLE,const LPD3DMATRIX) PURE; + STDMETHOD(GetMatrix)(THIS_ D3DMATRIXHANDLE,LPD3DMATRIX) PURE; + STDMETHOD(DeleteMatrix)(THIS_ D3DMATRIXHANDLE) PURE; + STDMETHOD(BeginScene)(THIS) PURE; + STDMETHOD(EndScene)(THIS) PURE; + STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D*) PURE; +}; + +typedef struct IDirect3DDevice *LPDIRECT3DDEVICE; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDevice_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDevice_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DDevice_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirect3DDevice_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) +#define IDirect3DDevice_SwapTextureHandles(p,a,b) (p)->lpVtbl->SwapTextureHandles(p,a,b) +#define IDirect3DDevice_CreateExecuteBuffer(p,a,b,c) (p)->lpVtbl->CreateExecuteBuffer(p,a,b,c) +#define IDirect3DDevice_GetStats(p,a) (p)->lpVtbl->GetStats(p,a) +#define IDirect3DDevice_Execute(p,a,b,c) (p)->lpVtbl->Execute(p,a,b,c) +#define IDirect3DDevice_AddViewport(p,a) (p)->lpVtbl->AddViewport(p,a) +#define IDirect3DDevice_DeleteViewport(p,a) (p)->lpVtbl->DeleteViewport(p,a) +#define IDirect3DDevice_NextViewport(p,a,b,c) (p)->lpVtbl->NextViewport(p,a,b,c) +#define IDirect3DDevice_Pick(p,a,b,c,d) (p)->lpVtbl->Pick(p,a,b,c,d) +#define IDirect3DDevice_GetPickRecords(p,a,b) (p)->lpVtbl->GetPickRecords(p,a,b) +#define IDirect3DDevice_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b) +#define IDirect3DDevice_CreateMatrix(p,a) (p)->lpVtbl->CreateMatrix(p,a) +#define IDirect3DDevice_SetMatrix(p,a,b) (p)->lpVtbl->SetMatrix(p,a,b) +#define IDirect3DDevice_GetMatrix(p,a,b) (p)->lpVtbl->GetMatrix(p,a,b) +#define IDirect3DDevice_DeleteMatrix(p,a) (p)->lpVtbl->DeleteMatrix(p,a) +#define IDirect3DDevice_BeginScene(p) (p)->lpVtbl->BeginScene(p) +#define IDirect3DDevice_EndScene(p) (p)->lpVtbl->EndScene(p) +#define IDirect3DDevice_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) +#else +#define IDirect3DDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDevice_AddRef(p) (p)->AddRef() +#define IDirect3DDevice_Release(p) (p)->Release() +#define IDirect3DDevice_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirect3DDevice_GetCaps(p,a,b) (p)->GetCaps(a,b) +#define IDirect3DDevice_SwapTextureHandles(p,a,b) (p)->SwapTextureHandles(a,b) +#define IDirect3DDevice_CreateExecuteBuffer(p,a,b,c) (p)->CreateExecuteBuffer(a,b,c) +#define IDirect3DDevice_GetStats(p,a) (p)->GetStats(a) +#define IDirect3DDevice_Execute(p,a,b,c) (p)->Execute(a,b,c) +#define IDirect3DDevice_AddViewport(p,a) (p)->AddViewport(a) +#define IDirect3DDevice_DeleteViewport(p,a) (p)->DeleteViewport(a) +#define IDirect3DDevice_NextViewport(p,a,b,c) (p)->NextViewport(a,b,c) +#define IDirect3DDevice_Pick(p,a,b,c,d) (p)->Pick(a,b,c,d) +#define IDirect3DDevice_GetPickRecords(p,a,b) (p)->GetPickRecords(a,b) +#define IDirect3DDevice_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b) +#define IDirect3DDevice_CreateMatrix(p,a) (p)->CreateMatrix(a) +#define IDirect3DDevice_SetMatrix(p,a,b) (p)->SetMatrix(a,b) +#define IDirect3DDevice_GetMatrix(p,a,b) (p)->GetMatrix(a,b) +#define IDirect3DDevice_DeleteMatrix(p,a) (p)->DeleteMatrix(a) +#define IDirect3DDevice_BeginScene(p) (p)->BeginScene() +#define IDirect3DDevice_EndScene(p) (p)->EndScene() +#define IDirect3DDevice_GetDirect3D(p,a) (p)->GetDirect3D(a) +#endif + +#if(DIRECT3D_VERSION >= 0x0500) +#undef INTERFACE +#define INTERFACE IDirect3DDevice2 + +DECLARE_INTERFACE_(IDirect3DDevice2, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DDevice2 methods ***/ + STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC,LPD3DDEVICEDESC) PURE; + STDMETHOD(SwapTextureHandles)(THIS_ LPDIRECT3DTEXTURE2,LPDIRECT3DTEXTURE2) PURE; + STDMETHOD(GetStats)(THIS_ LPD3DSTATS) PURE; + STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT2) PURE; + STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT2) PURE; + STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT2,LPDIRECT3DVIEWPORT2*,DWORD) PURE; + STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK,LPVOID) PURE; + STDMETHOD(BeginScene)(THIS) PURE; + STDMETHOD(EndScene)(THIS) PURE; + STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D2*) PURE; + STDMETHOD(SetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT2) PURE; + STDMETHOD(GetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT2 *) PURE; + STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE,DWORD) PURE; + STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE *) PURE; + STDMETHOD(Begin)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,DWORD) PURE; + STDMETHOD(BeginIndexed)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(Vertex)(THIS_ LPVOID) PURE; + STDMETHOD(Index)(THIS_ WORD) PURE; + STDMETHOD(End)(THIS_ DWORD) PURE; + STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE,LPDWORD) PURE; + STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE,DWORD) PURE; + STDMETHOD(GetLightState)(THIS_ D3DLIGHTSTATETYPE,LPDWORD) PURE; + STDMETHOD(SetLightState)(THIS_ D3DLIGHTSTATETYPE,DWORD) PURE; + STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; + STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; + STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; + STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,LPWORD,DWORD,DWORD) PURE; + STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; + STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; +}; + +typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DDevice2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDevice2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDevice2_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DDevice2_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) +#define IDirect3DDevice2_SwapTextureHandles(p,a,b) (p)->lpVtbl->SwapTextureHandles(p,a,b) +#define IDirect3DDevice2_GetStats(p,a) (p)->lpVtbl->GetStats(p,a) +#define IDirect3DDevice2_AddViewport(p,a) (p)->lpVtbl->AddViewport(p,a) +#define IDirect3DDevice2_DeleteViewport(p,a) (p)->lpVtbl->DeleteViewport(p,a) +#define IDirect3DDevice2_NextViewport(p,a,b,c) (p)->lpVtbl->NextViewport(p,a,b,c) +#define IDirect3DDevice2_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b) +#define IDirect3DDevice2_BeginScene(p) (p)->lpVtbl->BeginScene(p) +#define IDirect3DDevice2_EndScene(p) (p)->lpVtbl->EndScene(p) +#define IDirect3DDevice2_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) +#define IDirect3DDevice2_SetCurrentViewport(p,a) (p)->lpVtbl->SetCurrentViewport(p,a) +#define IDirect3DDevice2_GetCurrentViewport(p,a) (p)->lpVtbl->GetCurrentViewport(p,a) +#define IDirect3DDevice2_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) +#define IDirect3DDevice2_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a) +#define IDirect3DDevice2_Begin(p,a,b,c) (p)->lpVtbl->Begin(p,a,b,c) +#define IDirect3DDevice2_BeginIndexed(p,a,b,c,d,e) (p)->lpVtbl->BeginIndexed(p,a,b,c,d,e) +#define IDirect3DDevice2_Vertex(p,a) (p)->lpVtbl->Vertex(p,a) +#define IDirect3DDevice2_Index(p,a) (p)->lpVtbl->Index(p,a) +#define IDirect3DDevice2_End(p,a) (p)->lpVtbl->End(p,a) +#define IDirect3DDevice2_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) +#define IDirect3DDevice2_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) +#define IDirect3DDevice2_GetLightState(p,a,b) (p)->lpVtbl->GetLightState(p,a,b) +#define IDirect3DDevice2_SetLightState(p,a,b) (p)->lpVtbl->SetLightState(p,a,b) +#define IDirect3DDevice2_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) +#define IDirect3DDevice2_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) +#define IDirect3DDevice2_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) +#define IDirect3DDevice2_DrawPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitive(p,a,b,c,d,e) +#define IDirect3DDevice2_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f,g) +#define IDirect3DDevice2_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) +#define IDirect3DDevice2_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) +#else +#define IDirect3DDevice2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDevice2_AddRef(p) (p)->AddRef() +#define IDirect3DDevice2_Release(p) (p)->Release() +#define IDirect3DDevice2_GetCaps(p,a,b) (p)->GetCaps(a,b) +#define IDirect3DDevice2_SwapTextureHandles(p,a,b) (p)->SwapTextureHandles(a,b) +#define IDirect3DDevice2_GetStats(p,a) (p)->GetStats(a) +#define IDirect3DDevice2_AddViewport(p,a) (p)->AddViewport(a) +#define IDirect3DDevice2_DeleteViewport(p,a) (p)->DeleteViewport(a) +#define IDirect3DDevice2_NextViewport(p,a,b,c) (p)->NextViewport(a,b,c) +#define IDirect3DDevice2_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b) +#define IDirect3DDevice2_BeginScene(p) (p)->BeginScene() +#define IDirect3DDevice2_EndScene(p) (p)->EndScene() +#define IDirect3DDevice2_GetDirect3D(p,a) (p)->GetDirect3D(a) +#define IDirect3DDevice2_SetCurrentViewport(p,a) (p)->SetCurrentViewport(a) +#define IDirect3DDevice2_GetCurrentViewport(p,a) (p)->GetCurrentViewport(a) +#define IDirect3DDevice2_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) +#define IDirect3DDevice2_GetRenderTarget(p,a) (p)->GetRenderTarget(a) +#define IDirect3DDevice2_Begin(p,a,b,c) (p)->Begin(a,b,c) +#define IDirect3DDevice2_BeginIndexed(p,a,b,c,d,e) (p)->BeginIndexed(a,b,c,d,e) +#define IDirect3DDevice2_Vertex(p,a) (p)->Vertex(a) +#define IDirect3DDevice2_Index(p,a) (p)->Index(a) +#define IDirect3DDevice2_End(p,a) (p)->End(a) +#define IDirect3DDevice2_GetRenderState(p,a,b) (p)->GetRenderState(a,b) +#define IDirect3DDevice2_SetRenderState(p,a,b) (p)->SetRenderState(a,b) +#define IDirect3DDevice2_GetLightState(p,a,b) (p)->GetLightState(a,b) +#define IDirect3DDevice2_SetLightState(p,a,b) (p)->SetLightState(a,b) +#define IDirect3DDevice2_SetTransform(p,a,b) (p)->SetTransform(a,b) +#define IDirect3DDevice2_GetTransform(p,a,b) (p)->GetTransform(a,b) +#define IDirect3DDevice2_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) +#define IDirect3DDevice2_DrawPrimitive(p,a,b,c,d,e) (p)->DrawPrimitive(a,b,c,d,e) +#define IDirect3DDevice2_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitive(a,b,c,d,e,f,g) +#define IDirect3DDevice2_SetClipStatus(p,a) (p)->SetClipStatus(a) +#define IDirect3DDevice2_GetClipStatus(p,a) (p)->GetClipStatus(a) +#endif +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if(DIRECT3D_VERSION >= 0x0600) +#undef INTERFACE +#define INTERFACE IDirect3DDevice3 + +DECLARE_INTERFACE_(IDirect3DDevice3, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DDevice3 methods ***/ + STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC,LPD3DDEVICEDESC) PURE; + STDMETHOD(GetStats)(THIS_ LPD3DSTATS) PURE; + STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT3) PURE; + STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT3) PURE; + STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT3,LPDIRECT3DVIEWPORT3*,DWORD) PURE; + STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE; + STDMETHOD(BeginScene)(THIS) PURE; + STDMETHOD(EndScene)(THIS) PURE; + STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D3*) PURE; + STDMETHOD(SetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT3) PURE; + STDMETHOD(GetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT3 *) PURE; + STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE4,DWORD) PURE; + STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE4 *) PURE; + STDMETHOD(Begin)(THIS_ D3DPRIMITIVETYPE,DWORD,DWORD) PURE; + STDMETHOD(BeginIndexed)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(Vertex)(THIS_ LPVOID) PURE; + STDMETHOD(Index)(THIS_ WORD) PURE; + STDMETHOD(End)(THIS_ DWORD) PURE; + STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE,LPDWORD) PURE; + STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE,DWORD) PURE; + STDMETHOD(GetLightState)(THIS_ D3DLIGHTSTATETYPE,LPDWORD) PURE; + STDMETHOD(SetLightState)(THIS_ D3DLIGHTSTATETYPE,DWORD) PURE; + STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; + STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; + STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; + STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,LPWORD,DWORD,DWORD) PURE; + STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; + STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; + STDMETHOD(DrawPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,DWORD) PURE; + STDMETHOD(DrawIndexedPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPWORD,DWORD,DWORD) PURE; + STDMETHOD(DrawPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER,DWORD,DWORD,DWORD) PURE; + STDMETHOD(DrawIndexedPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER,LPWORD,DWORD,DWORD) PURE; + STDMETHOD(ComputeSphereVisibility)(THIS_ LPD3DVECTOR,LPD3DVALUE,DWORD,DWORD,LPDWORD) PURE; + STDMETHOD(GetTexture)(THIS_ DWORD,LPDIRECT3DTEXTURE2 *) PURE; + STDMETHOD(SetTexture)(THIS_ DWORD,LPDIRECT3DTEXTURE2) PURE; + STDMETHOD(GetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,LPDWORD) PURE; + STDMETHOD(SetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,DWORD) PURE; + STDMETHOD(ValidateDevice)(THIS_ LPDWORD) PURE; +}; + +typedef struct IDirect3DDevice3 *LPDIRECT3DDEVICE3; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DDevice3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDevice3_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDevice3_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DDevice3_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) +#define IDirect3DDevice3_GetStats(p,a) (p)->lpVtbl->GetStats(p,a) +#define IDirect3DDevice3_AddViewport(p,a) (p)->lpVtbl->AddViewport(p,a) +#define IDirect3DDevice3_DeleteViewport(p,a) (p)->lpVtbl->DeleteViewport(p,a) +#define IDirect3DDevice3_NextViewport(p,a,b,c) (p)->lpVtbl->NextViewport(p,a,b,c) +#define IDirect3DDevice3_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b) +#define IDirect3DDevice3_BeginScene(p) (p)->lpVtbl->BeginScene(p) +#define IDirect3DDevice3_EndScene(p) (p)->lpVtbl->EndScene(p) +#define IDirect3DDevice3_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) +#define IDirect3DDevice3_SetCurrentViewport(p,a) (p)->lpVtbl->SetCurrentViewport(p,a) +#define IDirect3DDevice3_GetCurrentViewport(p,a) (p)->lpVtbl->GetCurrentViewport(p,a) +#define IDirect3DDevice3_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) +#define IDirect3DDevice3_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a) +#define IDirect3DDevice3_Begin(p,a,b,c) (p)->lpVtbl->Begin(p,a,b,c) +#define IDirect3DDevice3_BeginIndexed(p,a,b,c,d,e) (p)->lpVtbl->BeginIndexed(p,a,b,c,d,e) +#define IDirect3DDevice3_Vertex(p,a) (p)->lpVtbl->Vertex(p,a) +#define IDirect3DDevice3_Index(p,a) (p)->lpVtbl->Index(p,a) +#define IDirect3DDevice3_End(p,a) (p)->lpVtbl->End(p,a) +#define IDirect3DDevice3_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) +#define IDirect3DDevice3_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) +#define IDirect3DDevice3_GetLightState(p,a,b) (p)->lpVtbl->GetLightState(p,a,b) +#define IDirect3DDevice3_SetLightState(p,a,b) (p)->lpVtbl->SetLightState(p,a,b) +#define IDirect3DDevice3_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) +#define IDirect3DDevice3_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) +#define IDirect3DDevice3_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) +#define IDirect3DDevice3_DrawPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitive(p,a,b,c,d,e) +#define IDirect3DDevice3_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f,g) +#define IDirect3DDevice3_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) +#define IDirect3DDevice3_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) +#define IDirect3DDevice3_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveStrided(p,a,b,c,d,e) +#define IDirect3DDevice3_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) +#define IDirect3DDevice3_DrawPrimitiveVB(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveVB(p,a,b,c,d,e) +#define IDirect3DDevice3_DrawIndexedPrimitiveVB(p,a,b,c,d,e) (p)->lpVtbl->DrawIndexedPrimitiveVB(p,a,b,c,d,e) +#define IDirect3DDevice3_ComputeSphereVisibility(p,a,b,c,d,e) (p)->lpVtbl->ComputeSphereVisibility(p,a,b,c,d,e) +#define IDirect3DDevice3_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) +#define IDirect3DDevice3_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) +#define IDirect3DDevice3_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) +#define IDirect3DDevice3_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) +#define IDirect3DDevice3_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) +#else +#define IDirect3DDevice3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDevice3_AddRef(p) (p)->AddRef() +#define IDirect3DDevice3_Release(p) (p)->Release() +#define IDirect3DDevice3_GetCaps(p,a,b) (p)->GetCaps(a,b) +#define IDirect3DDevice3_GetStats(p,a) (p)->GetStats(a) +#define IDirect3DDevice3_AddViewport(p,a) (p)->AddViewport(a) +#define IDirect3DDevice3_DeleteViewport(p,a) (p)->DeleteViewport(a) +#define IDirect3DDevice3_NextViewport(p,a,b,c) (p)->NextViewport(a,b,c) +#define IDirect3DDevice3_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b) +#define IDirect3DDevice3_BeginScene(p) (p)->BeginScene() +#define IDirect3DDevice3_EndScene(p) (p)->EndScene() +#define IDirect3DDevice3_GetDirect3D(p,a) (p)->GetDirect3D(a) +#define IDirect3DDevice3_SetCurrentViewport(p,a) (p)->SetCurrentViewport(a) +#define IDirect3DDevice3_GetCurrentViewport(p,a) (p)->GetCurrentViewport(a) +#define IDirect3DDevice3_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) +#define IDirect3DDevice3_GetRenderTarget(p,a) (p)->GetRenderTarget(a) +#define IDirect3DDevice3_Begin(p,a,b,c) (p)->Begin(a,b,c) +#define IDirect3DDevice3_BeginIndexed(p,a,b,c,d,e) (p)->BeginIndexed(a,b,c,d,e) +#define IDirect3DDevice3_Vertex(p,a) (p)->Vertex(a) +#define IDirect3DDevice3_Index(p,a) (p)->Index(a) +#define IDirect3DDevice3_End(p,a) (p)->End(a) +#define IDirect3DDevice3_GetRenderState(p,a,b) (p)->GetRenderState(a,b) +#define IDirect3DDevice3_SetRenderState(p,a,b) (p)->SetRenderState(a,b) +#define IDirect3DDevice3_GetLightState(p,a,b) (p)->GetLightState(a,b) +#define IDirect3DDevice3_SetLightState(p,a,b) (p)->SetLightState(a,b) +#define IDirect3DDevice3_SetTransform(p,a,b) (p)->SetTransform(a,b) +#define IDirect3DDevice3_GetTransform(p,a,b) (p)->GetTransform(a,b) +#define IDirect3DDevice3_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) +#define IDirect3DDevice3_DrawPrimitive(p,a,b,c,d,e) (p)->DrawPrimitive(a,b,c,d,e) +#define IDirect3DDevice3_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitive(a,b,c,d,e,f,g) +#define IDirect3DDevice3_SetClipStatus(p,a) (p)->SetClipStatus(a) +#define IDirect3DDevice3_GetClipStatus(p,a) (p)->GetClipStatus(a) +#define IDirect3DDevice3_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->DrawPrimitiveStrided(a,b,c,d,e) +#define IDirect3DDevice3_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitiveStrided(a,b,c,d,e,f,g) +#define IDirect3DDevice3_DrawPrimitiveVB(p,a,b,c,d,e) (p)->DrawPrimitiveVB(a,b,c,d,e) +#define IDirect3DDevice3_DrawIndexedPrimitiveVB(p,a,b,c,d,e) (p)->DrawIndexedPrimitiveVB(a,b,c,d,e) +#define IDirect3DDevice3_ComputeSphereVisibility(p,a,b,c,d,e) (p)->ComputeSphereVisibility(a,b,c,d,e) +#define IDirect3DDevice3_GetTexture(p,a,b) (p)->GetTexture(a,b) +#define IDirect3DDevice3_SetTexture(p,a,b) (p)->SetTexture(a,b) +#define IDirect3DDevice3_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) +#define IDirect3DDevice3_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) +#define IDirect3DDevice3_ValidateDevice(p,a) (p)->ValidateDevice(a) +#endif +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +#if(DIRECT3D_VERSION >= 0x0700) +#undef INTERFACE +#define INTERFACE IDirect3DDevice7 + +DECLARE_INTERFACE_(IDirect3DDevice7, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DDevice7 methods ***/ + STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC7) PURE; + STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE; + STDMETHOD(BeginScene)(THIS) PURE; + STDMETHOD(EndScene)(THIS) PURE; + STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D7*) PURE; + STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE7,DWORD) PURE; + STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE7 *) PURE; + STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD,D3DCOLOR,D3DVALUE,DWORD) PURE; + STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; + STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; + STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT7) PURE; + STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE; + STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT7) PURE; + STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL7) PURE; + STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL7) PURE; + STDMETHOD(SetLight)(THIS_ DWORD,LPD3DLIGHT7) PURE; + STDMETHOD(GetLight)(THIS_ DWORD,LPD3DLIGHT7) PURE; + STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE,DWORD) PURE; + STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE,LPDWORD) PURE; + STDMETHOD(BeginStateBlock)(THIS) PURE; + STDMETHOD(EndStateBlock)(THIS_ LPDWORD) PURE; + STDMETHOD(PreLoad)(THIS_ LPDIRECTDRAWSURFACE7) PURE; + STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,LPWORD,DWORD,DWORD) PURE; + STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; + STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE; + STDMETHOD(DrawPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,DWORD) PURE; + STDMETHOD(DrawIndexedPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPWORD,DWORD,DWORD) PURE; + STDMETHOD(DrawPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER7,DWORD,DWORD,DWORD) PURE; + STDMETHOD(DrawIndexedPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER7,DWORD,DWORD,LPWORD,DWORD,DWORD) PURE; + STDMETHOD(ComputeSphereVisibility)(THIS_ LPD3DVECTOR,LPD3DVALUE,DWORD,DWORD,LPDWORD) PURE; + STDMETHOD(GetTexture)(THIS_ DWORD,LPDIRECTDRAWSURFACE7 *) PURE; + STDMETHOD(SetTexture)(THIS_ DWORD,LPDIRECTDRAWSURFACE7) PURE; + STDMETHOD(GetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,LPDWORD) PURE; + STDMETHOD(SetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,DWORD) PURE; + STDMETHOD(ValidateDevice)(THIS_ LPDWORD) PURE; + STDMETHOD(ApplyStateBlock)(THIS_ DWORD) PURE; + STDMETHOD(CaptureStateBlock)(THIS_ DWORD) PURE; + STDMETHOD(DeleteStateBlock)(THIS_ DWORD) PURE; + STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE,LPDWORD) PURE; + STDMETHOD(Load)(THIS_ LPDIRECTDRAWSURFACE7,LPPOINT,LPDIRECTDRAWSURFACE7,LPRECT,DWORD) PURE; + STDMETHOD(LightEnable)(THIS_ DWORD,BOOL) PURE; + STDMETHOD(GetLightEnable)(THIS_ DWORD,BOOL*) PURE; + STDMETHOD(SetClipPlane)(THIS_ DWORD,D3DVALUE*) PURE; + STDMETHOD(GetClipPlane)(THIS_ DWORD,D3DVALUE*) PURE; + STDMETHOD(GetInfo)(THIS_ DWORD,LPVOID,DWORD) PURE; +}; + +typedef struct IDirect3DDevice7 *LPDIRECT3DDEVICE7; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DDevice7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDevice7_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDevice7_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DDevice7_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirect3DDevice7_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b) +#define IDirect3DDevice7_BeginScene(p) (p)->lpVtbl->BeginScene(p) +#define IDirect3DDevice7_EndScene(p) (p)->lpVtbl->EndScene(p) +#define IDirect3DDevice7_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) +#define IDirect3DDevice7_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) +#define IDirect3DDevice7_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a) +#define IDirect3DDevice7_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) +#define IDirect3DDevice7_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) +#define IDirect3DDevice7_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) +#define IDirect3DDevice7_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) +#define IDirect3DDevice7_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) +#define IDirect3DDevice7_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) +#define IDirect3DDevice7_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DDevice7_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) +#define IDirect3DDevice7_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) +#define IDirect3DDevice7_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) +#define IDirect3DDevice7_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) +#define IDirect3DDevice7_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) +#define IDirect3DDevice7_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) +#define IDirect3DDevice7_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) +#define IDirect3DDevice7_PreLoad(p,a) (p)->lpVtbl->PreLoad(p,a) +#define IDirect3DDevice7_DrawPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitive(p,a,b,c,d,e) +#define IDirect3DDevice7_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f,g) +#define IDirect3DDevice7_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) +#define IDirect3DDevice7_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) +#define IDirect3DDevice7_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveStrided(p,a,b,c,d,e) +#define IDirect3DDevice7_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) +#define IDirect3DDevice7_DrawPrimitiveVB(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveVB(p,a,b,c,d,e) +#define IDirect3DDevice7_DrawIndexedPrimitiveVB(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitiveVB(p,a,b,c,d,e,f,g) +#define IDirect3DDevice7_ComputeSphereVisibility(p,a,b,c,d,e) (p)->lpVtbl->ComputeSphereVisibility(p,a,b,c,d,e) +#define IDirect3DDevice7_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) +#define IDirect3DDevice7_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) +#define IDirect3DDevice7_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) +#define IDirect3DDevice7_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) +#define IDirect3DDevice7_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) +#define IDirect3DDevice7_ApplyStateBlock(p,a) (p)->lpVtbl->ApplyStateBlock(p,a) +#define IDirect3DDevice7_CaptureStateBlock(p,a) (p)->lpVtbl->CaptureStateBlock(p,a) +#define IDirect3DDevice7_DeleteStateBlock(p,a) (p)->lpVtbl->DeleteStateBlock(p,a) +#define IDirect3DDevice7_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) +#define IDirect3DDevice7_Load(p,a,b,c,d,e) (p)->lpVtbl->Load(p,a,b,c,d,e) +#define IDirect3DDevice7_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) +#define IDirect3DDevice7_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) +#define IDirect3DDevice7_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) +#define IDirect3DDevice7_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) +#define IDirect3DDevice7_GetInfo(p,a,b,c) (p)->lpVtbl->GetInfo(p,a,b,c) +#else +#define IDirect3DDevice7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDevice7_AddRef(p) (p)->AddRef() +#define IDirect3DDevice7_Release(p) (p)->Release() +#define IDirect3DDevice7_GetCaps(p,a) (p)->GetCaps(a) +#define IDirect3DDevice7_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b) +#define IDirect3DDevice7_BeginScene(p) (p)->BeginScene() +#define IDirect3DDevice7_EndScene(p) (p)->EndScene() +#define IDirect3DDevice7_GetDirect3D(p,a) (p)->GetDirect3D(a) +#define IDirect3DDevice7_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) +#define IDirect3DDevice7_GetRenderTarget(p,a) (p)->GetRenderTarget(a) +#define IDirect3DDevice7_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) +#define IDirect3DDevice7_SetTransform(p,a,b) (p)->SetTransform(a,b) +#define IDirect3DDevice7_GetTransform(p,a,b) (p)->GetTransform(a,b) +#define IDirect3DDevice7_SetViewport(p,a) (p)->SetViewport(a) +#define IDirect3DDevice7_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) +#define IDirect3DDevice7_GetViewport(p,a) (p)->GetViewport(a) +#define IDirect3DDevice7_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DDevice7_GetMaterial(p,a) (p)->GetMaterial(a) +#define IDirect3DDevice7_SetLight(p,a,b) (p)->SetLight(a,b) +#define IDirect3DDevice7_GetLight(p,a,b) (p)->GetLight(a,b) +#define IDirect3DDevice7_SetRenderState(p,a,b) (p)->SetRenderState(a,b) +#define IDirect3DDevice7_GetRenderState(p,a,b) (p)->GetRenderState(a,b) +#define IDirect3DDevice7_BeginStateBlock(p) (p)->BeginStateBlock() +#define IDirect3DDevice7_EndStateBlock(p,a) (p)->EndStateBlock(a) +#define IDirect3DDevice7_PreLoad(p,a) (p)->PreLoad(a) +#define IDirect3DDevice7_DrawPrimitive(p,a,b,c,d,e) (p)->DrawPrimitive(a,b,c,d,e) +#define IDirect3DDevice7_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitive(a,b,c,d,e,f,g) +#define IDirect3DDevice7_SetClipStatus(p,a) (p)->SetClipStatus(a) +#define IDirect3DDevice7_GetClipStatus(p,a) (p)->GetClipStatus(a) +#define IDirect3DDevice7_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->DrawPrimitiveStrided(a,b,c,d,e) +#define IDirect3DDevice7_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitiveStrided(a,b,c,d,e,f,g) +#define IDirect3DDevice7_DrawPrimitiveVB(p,a,b,c,d,e) (p)->DrawPrimitiveVB(a,b,c,d,e) +#define IDirect3DDevice7_DrawIndexedPrimitiveVB(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitiveVB(a,b,c,d,e,f,g) +#define IDirect3DDevice7_ComputeSphereVisibility(p,a,b,c,d,e) (p)->ComputeSphereVisibility(a,b,c,d,e) +#define IDirect3DDevice7_GetTexture(p,a,b) (p)->GetTexture(a,b) +#define IDirect3DDevice7_SetTexture(p,a,b) (p)->SetTexture(a,b) +#define IDirect3DDevice7_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) +#define IDirect3DDevice7_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) +#define IDirect3DDevice7_ValidateDevice(p,a) (p)->ValidateDevice(a) +#define IDirect3DDevice7_ApplyStateBlock(p,a) (p)->ApplyStateBlock(a) +#define IDirect3DDevice7_CaptureStateBlock(p,a) (p)->CaptureStateBlock(a) +#define IDirect3DDevice7_DeleteStateBlock(p,a) (p)->DeleteStateBlock(a) +#define IDirect3DDevice7_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) +#define IDirect3DDevice7_Load(p,a,b,c,d,e) (p)->Load(a,b,c,d,e) +#define IDirect3DDevice7_LightEnable(p,a,b) (p)->LightEnable(a,b) +#define IDirect3DDevice7_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) +#define IDirect3DDevice7_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) +#define IDirect3DDevice7_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) +#define IDirect3DDevice7_GetInfo(p,a,b,c) (p)->GetInfo(a,b,c) +#endif +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +/* + * Execute Buffer interface + */ +#undef INTERFACE +#define INTERFACE IDirect3DExecuteBuffer + +DECLARE_INTERFACE_(IDirect3DExecuteBuffer, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DExecuteBuffer methods ***/ + STDMETHOD(Initialize)(THIS_ LPDIRECT3DDEVICE,LPD3DEXECUTEBUFFERDESC) PURE; + STDMETHOD(Lock)(THIS_ LPD3DEXECUTEBUFFERDESC) PURE; + STDMETHOD(Unlock)(THIS) PURE; + STDMETHOD(SetExecuteData)(THIS_ LPD3DEXECUTEDATA) PURE; + STDMETHOD(GetExecuteData)(THIS_ LPD3DEXECUTEDATA) PURE; + STDMETHOD(Validate)(THIS_ LPDWORD,LPD3DVALIDATECALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(Optimize)(THIS_ DWORD) PURE; +}; + +typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DExecuteBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DExecuteBuffer_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DExecuteBuffer_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DExecuteBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirect3DExecuteBuffer_Lock(p,a) (p)->lpVtbl->Lock(p,a) +#define IDirect3DExecuteBuffer_Unlock(p) (p)->lpVtbl->Unlock(p) +#define IDirect3DExecuteBuffer_SetExecuteData(p,a) (p)->lpVtbl->SetExecuteData(p,a) +#define IDirect3DExecuteBuffer_GetExecuteData(p,a) (p)->lpVtbl->GetExecuteData(p,a) +#define IDirect3DExecuteBuffer_Validate(p,a,b,c,d) (p)->lpVtbl->Validate(p,a,b,c,d) +#define IDirect3DExecuteBuffer_Optimize(p,a) (p)->lpVtbl->Optimize(p,a) +#else +#define IDirect3DExecuteBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DExecuteBuffer_AddRef(p) (p)->AddRef() +#define IDirect3DExecuteBuffer_Release(p) (p)->Release() +#define IDirect3DExecuteBuffer_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirect3DExecuteBuffer_Lock(p,a) (p)->Lock(a) +#define IDirect3DExecuteBuffer_Unlock(p) (p)->Unlock() +#define IDirect3DExecuteBuffer_SetExecuteData(p,a) (p)->SetExecuteData(a) +#define IDirect3DExecuteBuffer_GetExecuteData(p,a) (p)->GetExecuteData(a) +#define IDirect3DExecuteBuffer_Validate(p,a,b,c,d) (p)->Validate(a,b,c,d) +#define IDirect3DExecuteBuffer_Optimize(p,a) (p)->Optimize(a) +#endif + +/* + * Light interfaces + */ +#undef INTERFACE +#define INTERFACE IDirect3DLight + +DECLARE_INTERFACE_(IDirect3DLight, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DLight methods ***/ + STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; + STDMETHOD(SetLight)(THIS_ LPD3DLIGHT) PURE; + STDMETHOD(GetLight)(THIS_ LPD3DLIGHT) PURE; +}; + +typedef struct IDirect3DLight *LPDIRECT3DLIGHT; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DLight_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DLight_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DLight_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DLight_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#define IDirect3DLight_SetLight(p,a) (p)->lpVtbl->SetLight(p,a) +#define IDirect3DLight_GetLight(p,a) (p)->lpVtbl->GetLight(p,a) +#else +#define IDirect3DLight_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DLight_AddRef(p) (p)->AddRef() +#define IDirect3DLight_Release(p) (p)->Release() +#define IDirect3DLight_Initialize(p,a) (p)->Initialize(a) +#define IDirect3DLight_SetLight(p,a) (p)->SetLight(a) +#define IDirect3DLight_GetLight(p,a) (p)->GetLight(a) +#endif + +/* + * Material interfaces + */ +#undef INTERFACE +#define INTERFACE IDirect3DMaterial + +DECLARE_INTERFACE_(IDirect3DMaterial, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DMaterial methods ***/ + STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; + STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL) PURE; + STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL) PURE; + STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE,LPD3DMATERIALHANDLE) PURE; + STDMETHOD(Reserve)(THIS) PURE; + STDMETHOD(Unreserve)(THIS) PURE; +}; + +typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DMaterial_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DMaterial_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DMaterial_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DMaterial_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#define IDirect3DMaterial_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DMaterial_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) +#define IDirect3DMaterial_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) +#define IDirect3DMaterial_Reserve(p) (p)->lpVtbl->Reserve(p) +#define IDirect3DMaterial_Unreserve(p) (p)->lpVtbl->Unreserve(p) +#else +#define IDirect3DMaterial_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DMaterial_AddRef(p) (p)->AddRef() +#define IDirect3DMaterial_Release(p) (p)->Release() +#define IDirect3DMaterial_Initialize(p,a) (p)->Initialize(a) +#define IDirect3DMaterial_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DMaterial_GetMaterial(p,a) (p)->GetMaterial(a) +#define IDirect3DMaterial_GetHandle(p,a,b) (p)->GetHandle(a,b) +#define IDirect3DMaterial_Reserve(p) (p)->Reserve() +#define IDirect3DMaterial_Unreserve(p) (p)->Unreserve() +#endif + +#if(DIRECT3D_VERSION >= 0x0500) +#undef INTERFACE +#define INTERFACE IDirect3DMaterial2 + +DECLARE_INTERFACE_(IDirect3DMaterial2, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DMaterial2 methods ***/ + STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL) PURE; + STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL) PURE; + STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE2,LPD3DMATERIALHANDLE) PURE; +}; + +typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DMaterial2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DMaterial2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DMaterial2_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DMaterial2_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DMaterial2_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) +#define IDirect3DMaterial2_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) +#else +#define IDirect3DMaterial2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DMaterial2_AddRef(p) (p)->AddRef() +#define IDirect3DMaterial2_Release(p) (p)->Release() +#define IDirect3DMaterial2_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DMaterial2_GetMaterial(p,a) (p)->GetMaterial(a) +#define IDirect3DMaterial2_GetHandle(p,a,b) (p)->GetHandle(a,b) +#endif +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if(DIRECT3D_VERSION >= 0x0600) +#undef INTERFACE +#define INTERFACE IDirect3DMaterial3 + +DECLARE_INTERFACE_(IDirect3DMaterial3, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DMaterial3 methods ***/ + STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL) PURE; + STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL) PURE; + STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE3,LPD3DMATERIALHANDLE) PURE; +}; + +typedef struct IDirect3DMaterial3 *LPDIRECT3DMATERIAL3; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DMaterial3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DMaterial3_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DMaterial3_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DMaterial3_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DMaterial3_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) +#define IDirect3DMaterial3_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) +#else +#define IDirect3DMaterial3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DMaterial3_AddRef(p) (p)->AddRef() +#define IDirect3DMaterial3_Release(p) (p)->Release() +#define IDirect3DMaterial3_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DMaterial3_GetMaterial(p,a) (p)->GetMaterial(a) +#define IDirect3DMaterial3_GetHandle(p,a,b) (p)->GetHandle(a,b) +#endif +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +/* + * Texture interfaces + */ +#undef INTERFACE +#define INTERFACE IDirect3DTexture + +DECLARE_INTERFACE_(IDirect3DTexture, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DTexture methods ***/ + STDMETHOD(Initialize)(THIS_ LPDIRECT3DDEVICE,LPDIRECTDRAWSURFACE) PURE; + STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE,LPD3DTEXTUREHANDLE) PURE; + STDMETHOD(PaletteChanged)(THIS_ DWORD,DWORD) PURE; + STDMETHOD(Load)(THIS_ LPDIRECT3DTEXTURE) PURE; + STDMETHOD(Unload)(THIS) PURE; +}; + +typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DTexture_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DTexture_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DTexture_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DTexture_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirect3DTexture_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) +#define IDirect3DTexture_PaletteChanged(p,a,b) (p)->lpVtbl->PaletteChanged(p,a,b) +#define IDirect3DTexture_Load(p,a) (p)->lpVtbl->Load(p,a) +#define IDirect3DTexture_Unload(p) (p)->lpVtbl->Unload(p) +#else +#define IDirect3DTexture_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DTexture_AddRef(p) (p)->AddRef() +#define IDirect3DTexture_Release(p) (p)->Release() +#define IDirect3DTexture_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirect3DTexture_GetHandle(p,a,b) (p)->GetHandle(a,b) +#define IDirect3DTexture_PaletteChanged(p,a,b) (p)->PaletteChanged(a,b) +#define IDirect3DTexture_Load(p,a) (p)->Load(a) +#define IDirect3DTexture_Unload(p) (p)->Unload() +#endif + +#if(DIRECT3D_VERSION >= 0x0500) +#undef INTERFACE +#define INTERFACE IDirect3DTexture2 + +DECLARE_INTERFACE_(IDirect3DTexture2, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DTexture2 methods ***/ + STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE2,LPD3DTEXTUREHANDLE) PURE; + STDMETHOD(PaletteChanged)(THIS_ DWORD,DWORD) PURE; + STDMETHOD(Load)(THIS_ LPDIRECT3DTEXTURE2) PURE; +}; + +typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DTexture2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DTexture2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DTexture2_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DTexture2_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b) +#define IDirect3DTexture2_PaletteChanged(p,a,b) (p)->lpVtbl->PaletteChanged(p,a,b) +#define IDirect3DTexture2_Load(p,a) (p)->lpVtbl->Load(p,a) +#else +#define IDirect3DTexture2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DTexture2_AddRef(p) (p)->AddRef() +#define IDirect3DTexture2_Release(p) (p)->Release() +#define IDirect3DTexture2_GetHandle(p,a,b) (p)->GetHandle(a,b) +#define IDirect3DTexture2_PaletteChanged(p,a,b) (p)->PaletteChanged(a,b) +#define IDirect3DTexture2_Load(p,a) (p)->Load(a) +#endif +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +/* + * Viewport interfaces + */ +#undef INTERFACE +#define INTERFACE IDirect3DViewport + +DECLARE_INTERFACE_(IDirect3DViewport, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DViewport methods ***/ + STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; + STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT) PURE; + STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT) PURE; + STDMETHOD(TransformVertices)(THIS_ DWORD,LPD3DTRANSFORMDATA,DWORD,LPDWORD) PURE; + STDMETHOD(LightElements)(THIS_ DWORD,LPD3DLIGHTDATA) PURE; + STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE) PURE; + STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE,LPBOOL) PURE; + STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; + STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE*,LPBOOL) PURE; + STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD) PURE; + STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT) PURE; + STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT) PURE; + STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT,LPDIRECT3DLIGHT*,DWORD) PURE; +}; + +typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DViewport_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DViewport_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DViewport_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DViewport_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#define IDirect3DViewport_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) +#define IDirect3DViewport_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) +#define IDirect3DViewport_TransformVertices(p,a,b,c,d) (p)->lpVtbl->TransformVertices(p,a,b,c,d) +#define IDirect3DViewport_LightElements(p,a,b) (p)->lpVtbl->LightElements(p,a,b) +#define IDirect3DViewport_SetBackground(p,a) (p)->lpVtbl->SetBackground(p,a) +#define IDirect3DViewport_GetBackground(p,a,b) (p)->lpVtbl->GetBackground(p,a,b) +#define IDirect3DViewport_SetBackgroundDepth(p,a) (p)->lpVtbl->SetBackgroundDepth(p,a) +#define IDirect3DViewport_GetBackgroundDepth(p,a,b) (p)->lpVtbl->GetBackgroundDepth(p,a,b) +#define IDirect3DViewport_Clear(p,a,b,c) (p)->lpVtbl->Clear(p,a,b,c) +#define IDirect3DViewport_AddLight(p,a) (p)->lpVtbl->AddLight(p,a) +#define IDirect3DViewport_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a) +#define IDirect3DViewport_NextLight(p,a,b,c) (p)->lpVtbl->NextLight(p,a,b,c) +#else +#define IDirect3DViewport_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DViewport_AddRef(p) (p)->AddRef() +#define IDirect3DViewport_Release(p) (p)->Release() +#define IDirect3DViewport_Initialize(p,a) (p)->Initialize(a) +#define IDirect3DViewport_GetViewport(p,a) (p)->GetViewport(a) +#define IDirect3DViewport_SetViewport(p,a) (p)->SetViewport(a) +#define IDirect3DViewport_TransformVertices(p,a,b,c,d) (p)->TransformVertices(a,b,c,d) +#define IDirect3DViewport_LightElements(p,a,b) (p)->LightElements(a,b) +#define IDirect3DViewport_SetBackground(p,a) (p)->SetBackground(a) +#define IDirect3DViewport_GetBackground(p,a,b) (p)->GetBackground(a,b) +#define IDirect3DViewport_SetBackgroundDepth(p,a) (p)->SetBackgroundDepth(a) +#define IDirect3DViewport_GetBackgroundDepth(p,a,b) (p)->GetBackgroundDepth(a,b) +#define IDirect3DViewport_Clear(p,a,b,c) (p)->Clear(a,b,c) +#define IDirect3DViewport_AddLight(p,a) (p)->AddLight(a) +#define IDirect3DViewport_DeleteLight(p,a) (p)->DeleteLight(a) +#define IDirect3DViewport_NextLight(p,a,b,c) (p)->NextLight(a,b,c) +#endif + +#if(DIRECT3D_VERSION >= 0x0500) +#undef INTERFACE +#define INTERFACE IDirect3DViewport2 + +DECLARE_INTERFACE_(IDirect3DViewport2, IDirect3DViewport) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DViewport methods ***/ + STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; + STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT) PURE; + STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT) PURE; + STDMETHOD(TransformVertices)(THIS_ DWORD,LPD3DTRANSFORMDATA,DWORD,LPDWORD) PURE; + STDMETHOD(LightElements)(THIS_ DWORD,LPD3DLIGHTDATA) PURE; + STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE) PURE; + STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE,LPBOOL) PURE; + STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; + STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE*,LPBOOL) PURE; + STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD) PURE; + STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT) PURE; + STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT) PURE; + STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT,LPDIRECT3DLIGHT*,DWORD) PURE; + STDMETHOD(GetViewport2)(THIS_ LPD3DVIEWPORT2) PURE; + STDMETHOD(SetViewport2)(THIS_ LPD3DVIEWPORT2) PURE; +}; + +typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DViewport2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DViewport2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DViewport2_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DViewport2_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#define IDirect3DViewport2_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) +#define IDirect3DViewport2_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) +#define IDirect3DViewport2_TransformVertices(p,a,b,c,d) (p)->lpVtbl->TransformVertices(p,a,b,c,d) +#define IDirect3DViewport2_LightElements(p,a,b) (p)->lpVtbl->LightElements(p,a,b) +#define IDirect3DViewport2_SetBackground(p,a) (p)->lpVtbl->SetBackground(p,a) +#define IDirect3DViewport2_GetBackground(p,a,b) (p)->lpVtbl->GetBackground(p,a,b) +#define IDirect3DViewport2_SetBackgroundDepth(p,a) (p)->lpVtbl->SetBackgroundDepth(p,a) +#define IDirect3DViewport2_GetBackgroundDepth(p,a,b) (p)->lpVtbl->GetBackgroundDepth(p,a,b) +#define IDirect3DViewport2_Clear(p,a,b,c) (p)->lpVtbl->Clear(p,a,b,c) +#define IDirect3DViewport2_AddLight(p,a) (p)->lpVtbl->AddLight(p,a) +#define IDirect3DViewport2_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a) +#define IDirect3DViewport2_NextLight(p,a,b,c) (p)->lpVtbl->NextLight(p,a,b,c) +#define IDirect3DViewport2_GetViewport2(p,a) (p)->lpVtbl->GetViewport2(p,a) +#define IDirect3DViewport2_SetViewport2(p,a) (p)->lpVtbl->SetViewport2(p,a) +#else +#define IDirect3DViewport2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DViewport2_AddRef(p) (p)->AddRef() +#define IDirect3DViewport2_Release(p) (p)->Release() +#define IDirect3DViewport2_Initialize(p,a) (p)->Initialize(a) +#define IDirect3DViewport2_GetViewport(p,a) (p)->GetViewport(a) +#define IDirect3DViewport2_SetViewport(p,a) (p)->SetViewport(a) +#define IDirect3DViewport2_TransformVertices(p,a,b,c,d) (p)->TransformVertices(a,b,c,d) +#define IDirect3DViewport2_LightElements(p,a,b) (p)->LightElements(a,b) +#define IDirect3DViewport2_SetBackground(p,a) (p)->SetBackground(a) +#define IDirect3DViewport2_GetBackground(p,a,b) (p)->GetBackground(a,b) +#define IDirect3DViewport2_SetBackgroundDepth(p,a) (p)->SetBackgroundDepth(a) +#define IDirect3DViewport2_GetBackgroundDepth(p,a,b) (p)->GetBackgroundDepth(a,b) +#define IDirect3DViewport2_Clear(p,a,b,c) (p)->Clear(a,b,c) +#define IDirect3DViewport2_AddLight(p,a) (p)->AddLight(a) +#define IDirect3DViewport2_DeleteLight(p,a) (p)->DeleteLight(a) +#define IDirect3DViewport2_NextLight(p,a,b,c) (p)->NextLight(a,b,c) +#define IDirect3DViewport2_GetViewport2(p,a) (p)->GetViewport2(a) +#define IDirect3DViewport2_SetViewport2(p,a) (p)->SetViewport2(a) +#endif +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if(DIRECT3D_VERSION >= 0x0600) + +#undef INTERFACE +#define INTERFACE IDirect3DViewport3 + +DECLARE_INTERFACE_(IDirect3DViewport3, IDirect3DViewport2) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DViewport2 methods ***/ + STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE; + STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT) PURE; + STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT) PURE; + STDMETHOD(TransformVertices)(THIS_ DWORD,LPD3DTRANSFORMDATA,DWORD,LPDWORD) PURE; + STDMETHOD(LightElements)(THIS_ DWORD,LPD3DLIGHTDATA) PURE; + STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE) PURE; + STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE,LPBOOL) PURE; + STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; + STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE*,LPBOOL) PURE; + STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD) PURE; + STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT) PURE; + STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT) PURE; + STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT,LPDIRECT3DLIGHT*,DWORD) PURE; + STDMETHOD(GetViewport2)(THIS_ LPD3DVIEWPORT2) PURE; + STDMETHOD(SetViewport2)(THIS_ LPD3DVIEWPORT2) PURE; + STDMETHOD(SetBackgroundDepth2)(THIS_ LPDIRECTDRAWSURFACE4) PURE; + STDMETHOD(GetBackgroundDepth2)(THIS_ LPDIRECTDRAWSURFACE4*,LPBOOL) PURE; + STDMETHOD(Clear2)(THIS_ DWORD,LPD3DRECT,DWORD,D3DCOLOR,D3DVALUE,DWORD) PURE; +}; + +typedef struct IDirect3DViewport3 *LPDIRECT3DVIEWPORT3; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DViewport3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DViewport3_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DViewport3_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DViewport3_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#define IDirect3DViewport3_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) +#define IDirect3DViewport3_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) +#define IDirect3DViewport3_TransformVertices(p,a,b,c,d) (p)->lpVtbl->TransformVertices(p,a,b,c,d) +#define IDirect3DViewport3_LightElements(p,a,b) (p)->lpVtbl->LightElements(p,a,b) +#define IDirect3DViewport3_SetBackground(p,a) (p)->lpVtbl->SetBackground(p,a) +#define IDirect3DViewport3_GetBackground(p,a,b) (p)->lpVtbl->GetBackground(p,a,b) +#define IDirect3DViewport3_SetBackgroundDepth(p,a) (p)->lpVtbl->SetBackgroundDepth(p,a) +#define IDirect3DViewport3_GetBackgroundDepth(p,a,b) (p)->lpVtbl->GetBackgroundDepth(p,a,b) +#define IDirect3DViewport3_Clear(p,a,b,c) (p)->lpVtbl->Clear(p,a,b,c) +#define IDirect3DViewport3_AddLight(p,a) (p)->lpVtbl->AddLight(p,a) +#define IDirect3DViewport3_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a) +#define IDirect3DViewport3_NextLight(p,a,b,c) (p)->lpVtbl->NextLight(p,a,b,c) +#define IDirect3DViewport3_GetViewport2(p,a) (p)->lpVtbl->GetViewport2(p,a) +#define IDirect3DViewport3_SetViewport2(p,a) (p)->lpVtbl->SetViewport2(p,a) +#define IDirect3DViewport3_SetBackgroundDepth2(p,a) (p)->lpVtbl->SetBackgroundDepth2(p,a) +#define IDirect3DViewport3_GetBackgroundDepth2(p,a,b) (p)->lpVtbl->GetBackgroundDepth2(p,a,b) +#define IDirect3DViewport3_Clear2(p,a,b,c,d,e,f) (p)->lpVtbl->Clear2(p,a,b,c,d,e,f) +#else +#define IDirect3DViewport3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DViewport3_AddRef(p) (p)->AddRef() +#define IDirect3DViewport3_Release(p) (p)->Release() +#define IDirect3DViewport3_Initialize(p,a) (p)->Initialize(a) +#define IDirect3DViewport3_GetViewport(p,a) (p)->GetViewport(a) +#define IDirect3DViewport3_SetViewport(p,a) (p)->SetViewport(a) +#define IDirect3DViewport3_TransformVertices(p,a,b,c,d) (p)->TransformVertices(a,b,c,d) +#define IDirect3DViewport3_LightElements(p,a,b) (p)->LightElements(a,b) +#define IDirect3DViewport3_SetBackground(p,a) (p)->SetBackground(a) +#define IDirect3DViewport3_GetBackground(p,a,b) (p)->GetBackground(a,b) +#define IDirect3DViewport3_SetBackgroundDepth(p,a) (p)->SetBackgroundDepth(a) +#define IDirect3DViewport3_GetBackgroundDepth(p,a,b) (p)->GetBackgroundDepth(a,b) +#define IDirect3DViewport3_Clear(p,a,b,c) (p)->Clear(a,b,c) +#define IDirect3DViewport3_AddLight(p,a) (p)->AddLight(a) +#define IDirect3DViewport3_DeleteLight(p,a) (p)->DeleteLight(a) +#define IDirect3DViewport3_NextLight(p,a,b,c) (p)->NextLight(a,b,c) +#define IDirect3DViewport3_GetViewport2(p,a) (p)->GetViewport2(a) +#define IDirect3DViewport3_SetViewport2(p,a) (p)->SetViewport2(a) +#define IDirect3DViewport3_SetBackgroundDepth2(p,a) (p)->SetBackgroundDepth2(a) +#define IDirect3DViewport3_GetBackgroundDepth2(p,a,b) (p)->GetBackgroundDepth2(a,b) +#define IDirect3DViewport3_Clear2(p,a,b,c,d,e,f) (p)->Clear2(a,b,c,d,e,f) +#endif +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +#if(DIRECT3D_VERSION >= 0x0600) +#undef INTERFACE +#define INTERFACE IDirect3DVertexBuffer + +DECLARE_INTERFACE_(IDirect3DVertexBuffer, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DVertexBuffer methods ***/ + STDMETHOD(Lock)(THIS_ DWORD,LPVOID*,LPDWORD) PURE; + STDMETHOD(Unlock)(THIS) PURE; + STDMETHOD(ProcessVertices)(THIS_ DWORD,DWORD,DWORD,LPDIRECT3DVERTEXBUFFER,DWORD,LPDIRECT3DDEVICE3,DWORD) PURE; + STDMETHOD(GetVertexBufferDesc)(THIS_ LPD3DVERTEXBUFFERDESC) PURE; + STDMETHOD(Optimize)(THIS_ LPDIRECT3DDEVICE3,DWORD) PURE; +}; + +typedef struct IDirect3DVertexBuffer *LPDIRECT3DVERTEXBUFFER; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVertexBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVertexBuffer_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVertexBuffer_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVertexBuffer_Lock(p,a,b,c) (p)->lpVtbl->Lock(p,a,b,c) +#define IDirect3DVertexBuffer_Unlock(p) (p)->lpVtbl->Unlock(p) +#define IDirect3DVertexBuffer_ProcessVertices(p,a,b,c,d,e,f,g) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f,g) +#define IDirect3DVertexBuffer_GetVertexBufferDesc(p,a) (p)->lpVtbl->GetVertexBufferDesc(p,a) +#define IDirect3DVertexBuffer_Optimize(p,a,b) (p)->lpVtbl->Optimize(p,a,b) +#else +#define IDirect3DVertexBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVertexBuffer_AddRef(p) (p)->AddRef() +#define IDirect3DVertexBuffer_Release(p) (p)->Release() +#define IDirect3DVertexBuffer_Lock(p,a,b,c) (p)->Lock(a,b,c) +#define IDirect3DVertexBuffer_Unlock(p) (p)->Unlock() +#define IDirect3DVertexBuffer_ProcessVertices(p,a,b,c,d,e,f,g) (p)->ProcessVertices(a,b,c,d,e,f,g) +#define IDirect3DVertexBuffer_GetVertexBufferDesc(p,a) (p)->GetVertexBufferDesc(a) +#define IDirect3DVertexBuffer_Optimize(p,a,b) (p)->Optimize(a,b) +#endif +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +#if(DIRECT3D_VERSION >= 0x0700) +#undef INTERFACE +#define INTERFACE IDirect3DVertexBuffer7 + +DECLARE_INTERFACE_(IDirect3DVertexBuffer7, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DVertexBuffer7 methods ***/ + STDMETHOD(Lock)(THIS_ DWORD,LPVOID*,LPDWORD) PURE; + STDMETHOD(Unlock)(THIS) PURE; + STDMETHOD(ProcessVertices)(THIS_ DWORD,DWORD,DWORD,LPDIRECT3DVERTEXBUFFER7,DWORD,LPDIRECT3DDEVICE7,DWORD) PURE; + STDMETHOD(GetVertexBufferDesc)(THIS_ LPD3DVERTEXBUFFERDESC) PURE; + STDMETHOD(Optimize)(THIS_ LPDIRECT3DDEVICE7,DWORD) PURE; + STDMETHOD(ProcessVerticesStrided)(THIS_ DWORD,DWORD,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPDIRECT3DDEVICE7,DWORD) PURE; +}; + +typedef struct IDirect3DVertexBuffer7 *LPDIRECT3DVERTEXBUFFER7; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVertexBuffer7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVertexBuffer7_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVertexBuffer7_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVertexBuffer7_Lock(p,a,b,c) (p)->lpVtbl->Lock(p,a,b,c) +#define IDirect3DVertexBuffer7_Unlock(p) (p)->lpVtbl->Unlock(p) +#define IDirect3DVertexBuffer7_ProcessVertices(p,a,b,c,d,e,f,g) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f,g) +#define IDirect3DVertexBuffer7_GetVertexBufferDesc(p,a) (p)->lpVtbl->GetVertexBufferDesc(p,a) +#define IDirect3DVertexBuffer7_Optimize(p,a,b) (p)->lpVtbl->Optimize(p,a,b) +#define IDirect3DVertexBuffer7_ProcessVerticesStrided(p,a,b,c,d,e,f,g) (p)->lpVtbl->ProcessVerticesStrided(p,a,b,c,d,e,f,g) +#else +#define IDirect3DVertexBuffer7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVertexBuffer7_AddRef(p) (p)->AddRef() +#define IDirect3DVertexBuffer7_Release(p) (p)->Release() +#define IDirect3DVertexBuffer7_Lock(p,a,b,c) (p)->Lock(a,b,c) +#define IDirect3DVertexBuffer7_Unlock(p) (p)->Unlock() +#define IDirect3DVertexBuffer7_ProcessVertices(p,a,b,c,d,e,f,g) (p)->ProcessVertices(a,b,c,d,e,f,g) +#define IDirect3DVertexBuffer7_GetVertexBufferDesc(p,a) (p)->GetVertexBufferDesc(a) +#define IDirect3DVertexBuffer7_Optimize(p,a,b) (p)->Optimize(a,b) +#define IDirect3DVertexBuffer7_ProcessVerticesStrided(p,a,b,c,d,e,f,g) (p)->ProcessVerticesStrided(a,b,c,d,e,f,g) +#endif +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +#if(DIRECT3D_VERSION >= 0x0500) +/**************************************************************************** + * + * Flags for IDirect3DDevice::NextViewport + * + ****************************************************************************/ + +/* + * Return the next viewport + */ +#define D3DNEXT_NEXT 0x00000001l + +/* + * Return the first viewport + */ +#define D3DNEXT_HEAD 0x00000002l + +/* + * Return the last viewport + */ +#define D3DNEXT_TAIL 0x00000004l + + +/**************************************************************************** + * + * Flags for DrawPrimitive/DrawIndexedPrimitive + * Also valid for Begin/BeginIndexed + * Also valid for VertexBuffer::CreateVertexBuffer + ****************************************************************************/ + +/* + * Wait until the device is ready to draw the primitive + * This will cause DP to not return DDERR_WASSTILLDRAWING + */ +#define D3DDP_WAIT 0x00000001l +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if (DIRECT3D_VERSION == 0x0500) +/* + * Hint that it is acceptable to render the primitive out of order. + */ +#define D3DDP_OUTOFORDER 0x00000002l +#endif + + +#if(DIRECT3D_VERSION >= 0x0500) +/* + * Hint that the primitives have been clipped by the application. + */ +#define D3DDP_DONOTCLIP 0x00000004l + +/* + * Hint that the extents need not be updated. + */ +#define D3DDP_DONOTUPDATEEXTENTS 0x00000008l +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if(DIRECT3D_VERSION >= 0x0600) + +/* + * Hint that the lighting should not be applied on vertices. + */ + +#define D3DDP_DONOTLIGHT 0x00000010l + +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +/* + * Direct3D Errors + * DirectDraw error codes are used when errors not specified here. + */ +#define D3D_OK DD_OK +#define D3DERR_BADMAJORVERSION MAKE_DDHRESULT(700) +#define D3DERR_BADMINORVERSION MAKE_DDHRESULT(701) + +#if(DIRECT3D_VERSION >= 0x0500) +/* + * An invalid device was requested by the application. + */ +#define D3DERR_INVALID_DEVICE MAKE_DDHRESULT(705) +#define D3DERR_INITFAILED MAKE_DDHRESULT(706) + +/* + * SetRenderTarget attempted on a device that was + * QI'd off the render target. + */ +#define D3DERR_DEVICEAGGREGATED MAKE_DDHRESULT(707) +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#define D3DERR_EXECUTE_CREATE_FAILED MAKE_DDHRESULT(710) +#define D3DERR_EXECUTE_DESTROY_FAILED MAKE_DDHRESULT(711) +#define D3DERR_EXECUTE_LOCK_FAILED MAKE_DDHRESULT(712) +#define D3DERR_EXECUTE_UNLOCK_FAILED MAKE_DDHRESULT(713) +#define D3DERR_EXECUTE_LOCKED MAKE_DDHRESULT(714) +#define D3DERR_EXECUTE_NOT_LOCKED MAKE_DDHRESULT(715) + +#define D3DERR_EXECUTE_FAILED MAKE_DDHRESULT(716) +#define D3DERR_EXECUTE_CLIPPED_FAILED MAKE_DDHRESULT(717) + +#define D3DERR_TEXTURE_NO_SUPPORT MAKE_DDHRESULT(720) +#define D3DERR_TEXTURE_CREATE_FAILED MAKE_DDHRESULT(721) +#define D3DERR_TEXTURE_DESTROY_FAILED MAKE_DDHRESULT(722) +#define D3DERR_TEXTURE_LOCK_FAILED MAKE_DDHRESULT(723) +#define D3DERR_TEXTURE_UNLOCK_FAILED MAKE_DDHRESULT(724) +#define D3DERR_TEXTURE_LOAD_FAILED MAKE_DDHRESULT(725) +#define D3DERR_TEXTURE_SWAP_FAILED MAKE_DDHRESULT(726) +#define D3DERR_TEXTURE_LOCKED MAKE_DDHRESULT(727) +#define D3DERR_TEXTURE_NOT_LOCKED MAKE_DDHRESULT(728) +#define D3DERR_TEXTURE_GETSURF_FAILED MAKE_DDHRESULT(729) + +#define D3DERR_MATRIX_CREATE_FAILED MAKE_DDHRESULT(730) +#define D3DERR_MATRIX_DESTROY_FAILED MAKE_DDHRESULT(731) +#define D3DERR_MATRIX_SETDATA_FAILED MAKE_DDHRESULT(732) +#define D3DERR_MATRIX_GETDATA_FAILED MAKE_DDHRESULT(733) +#define D3DERR_SETVIEWPORTDATA_FAILED MAKE_DDHRESULT(734) + +#if(DIRECT3D_VERSION >= 0x0500) +#define D3DERR_INVALIDCURRENTVIEWPORT MAKE_DDHRESULT(735) +#define D3DERR_INVALIDPRIMITIVETYPE MAKE_DDHRESULT(736) +#define D3DERR_INVALIDVERTEXTYPE MAKE_DDHRESULT(737) +#define D3DERR_TEXTURE_BADSIZE MAKE_DDHRESULT(738) +#define D3DERR_INVALIDRAMPTEXTURE MAKE_DDHRESULT(739) +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#define D3DERR_MATERIAL_CREATE_FAILED MAKE_DDHRESULT(740) +#define D3DERR_MATERIAL_DESTROY_FAILED MAKE_DDHRESULT(741) +#define D3DERR_MATERIAL_SETDATA_FAILED MAKE_DDHRESULT(742) +#define D3DERR_MATERIAL_GETDATA_FAILED MAKE_DDHRESULT(743) + +#if(DIRECT3D_VERSION >= 0x0500) +#define D3DERR_INVALIDPALETTE MAKE_DDHRESULT(744) + +#define D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY MAKE_DDHRESULT(745) +#define D3DERR_ZBUFF_NEEDS_VIDEOMEMORY MAKE_DDHRESULT(746) +#define D3DERR_SURFACENOTINVIDMEM MAKE_DDHRESULT(747) +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#define D3DERR_LIGHT_SET_FAILED MAKE_DDHRESULT(750) +#if(DIRECT3D_VERSION >= 0x0500) +#define D3DERR_LIGHTHASVIEWPORT MAKE_DDHRESULT(751) +#define D3DERR_LIGHTNOTINTHISVIEWPORT MAKE_DDHRESULT(752) +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#define D3DERR_SCENE_IN_SCENE MAKE_DDHRESULT(760) +#define D3DERR_SCENE_NOT_IN_SCENE MAKE_DDHRESULT(761) +#define D3DERR_SCENE_BEGIN_FAILED MAKE_DDHRESULT(762) +#define D3DERR_SCENE_END_FAILED MAKE_DDHRESULT(763) + +#if(DIRECT3D_VERSION >= 0x0500) +#define D3DERR_INBEGIN MAKE_DDHRESULT(770) +#define D3DERR_NOTINBEGIN MAKE_DDHRESULT(771) +#define D3DERR_NOVIEWPORTS MAKE_DDHRESULT(772) +#define D3DERR_VIEWPORTDATANOTSET MAKE_DDHRESULT(773) +#define D3DERR_VIEWPORTHASNODEVICE MAKE_DDHRESULT(774) +#define D3DERR_NOCURRENTVIEWPORT MAKE_DDHRESULT(775) +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if(DIRECT3D_VERSION >= 0x0600) +#define D3DERR_INVALIDVERTEXFORMAT MAKE_DDHRESULT(2048) + +/* + * Attempted to CreateTexture on a surface that had a color key + */ +#define D3DERR_COLORKEYATTACHED MAKE_DDHRESULT(2050) + +#define D3DERR_VERTEXBUFFEROPTIMIZED MAKE_DDHRESULT(2060) +#define D3DERR_VBUF_CREATE_FAILED MAKE_DDHRESULT(2061) +#define D3DERR_VERTEXBUFFERLOCKED MAKE_DDHRESULT(2062) +#define D3DERR_VERTEXBUFFERUNLOCKFAILED MAKE_DDHRESULT(2063) + +#define D3DERR_ZBUFFER_NOTPRESENT MAKE_DDHRESULT(2070) +#define D3DERR_STENCILBUFFER_NOTPRESENT MAKE_DDHRESULT(2071) + +#define D3DERR_WRONGTEXTUREFORMAT MAKE_DDHRESULT(2072) +#define D3DERR_UNSUPPORTEDCOLOROPERATION MAKE_DDHRESULT(2073) +#define D3DERR_UNSUPPORTEDCOLORARG MAKE_DDHRESULT(2074) +#define D3DERR_UNSUPPORTEDALPHAOPERATION MAKE_DDHRESULT(2075) +#define D3DERR_UNSUPPORTEDALPHAARG MAKE_DDHRESULT(2076) +#define D3DERR_TOOMANYOPERATIONS MAKE_DDHRESULT(2077) +#define D3DERR_CONFLICTINGTEXTUREFILTER MAKE_DDHRESULT(2078) +#define D3DERR_UNSUPPORTEDFACTORVALUE MAKE_DDHRESULT(2079) +#define D3DERR_CONFLICTINGRENDERSTATE MAKE_DDHRESULT(2081) +#define D3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_DDHRESULT(2082) +#define D3DERR_TOOMANYPRIMITIVES MAKE_DDHRESULT(2083) +#define D3DERR_INVALIDMATRIX MAKE_DDHRESULT(2084) +#define D3DERR_TOOMANYVERTICES MAKE_DDHRESULT(2085) +#define D3DERR_CONFLICTINGTEXTUREPALETTE MAKE_DDHRESULT(2086) + +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +#if(DIRECT3D_VERSION >= 0x0700) +#define D3DERR_INVALIDSTATEBLOCK MAKE_DDHRESULT(2100) +#define D3DERR_INBEGINSTATEBLOCK MAKE_DDHRESULT(2101) +#define D3DERR_NOTINBEGINSTATEBLOCK MAKE_DDHRESULT(2102) +#endif /* DIRECT3D_VERSION >= 0x0700 */ + + +#ifdef __cplusplus +}; +#endif + +#endif /* (DIRECT3D_VERSION < 0x0800) */ +#endif /* _D3D_H_ */ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3d10misc.h b/Src/Decoder_H264_ALL/D3D/include/d3d10misc.h new file mode 100644 index 0000000..fc6d406 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3d10misc.h @@ -0,0 +1,175 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3D10Misc.h +// Content: D3D10 Device Creation APIs +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3D10MISC_H__ +#define __D3D10MISC_H__ + +#include "d3d10.h" + +/////////////////////////////////////////////////////////////////////////// +// ID3D10Blob: +// ------------ +// The buffer object is used by D3D10 to return arbitrary size data. +// +// GetBufferPointer - +// Returns a pointer to the beginning of the buffer. +// +// GetBufferSize - +// Returns the size of the buffer, in bytes. +/////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D10Blob ID3D10Blob; +typedef interface ID3D10Blob *LPD3D10BLOB; + +// {8BA5FB08-5195-40e2-AC58-0D989C3A0102} +DEFINE_GUID(IID_ID3D10Blob, +0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2); + +#undef INTERFACE +#define INTERFACE ID3D10Blob + +DECLARE_INTERFACE_(ID3D10Blob, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3D10Blob + STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE; + STDMETHOD_(SIZE_T, GetBufferSize)(THIS) PURE; +}; + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +/////////////////////////////////////////////////////////////////////////// +// D3D10_DRIVER_TYPE +// ---------------- +// +// This identifier is used to determine the implementation of Direct3D10 +// to be used. +// +// Pass one of these values to D3D10CreateDevice +// +/////////////////////////////////////////////////////////////////////////// +typedef enum D3D10_DRIVER_TYPE +{ + D3D10_DRIVER_TYPE_HARDWARE = 0, + D3D10_DRIVER_TYPE_REFERENCE = 1, + D3D10_DRIVER_TYPE_NULL = 2, + D3D10_DRIVER_TYPE_SOFTWARE = 3, + D3D10_DRIVER_TYPE_WARP = 5, +} D3D10_DRIVER_TYPE; + +DEFINE_GUID(GUID_DeviceType, +0xd722fb4d, 0x7a68, 0x437a, 0xb2, 0x0c, 0x58, 0x04, 0xee, 0x24, 0x94, 0xa6); + +/////////////////////////////////////////////////////////////////////////// +// D3D10CreateDevice +// ------------------ +// +// pAdapter +// If NULL, D3D10CreateDevice will choose the primary adapter and +// create a new instance from a temporarily created IDXGIFactory. +// If non-NULL, D3D10CreateDevice will register the appropriate +// device, if necessary (via IDXGIAdapter::RegisterDrver), before +// creating the device. +// DriverType +// Specifies the driver type to be created: hardware, reference or +// null. +// Software +// HMODULE of a DLL implementing a software rasterizer. Must be NULL for +// non-Software driver types. +// Flags +// Any of those documented for D3D10CreateDevice. +// SDKVersion +// SDK version. Use the D3D10_SDK_VERSION macro. +// ppDevice +// Pointer to returned interface. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory +// IDXGIFactory::EnumAdapters +// IDXGIAdapter::RegisterDriver +// D3D10CreateDevice +// +/////////////////////////////////////////////////////////////////////////// +HRESULT WINAPI D3D10CreateDevice( + IDXGIAdapter *pAdapter, + D3D10_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + UINT SDKVersion, + ID3D10Device **ppDevice); + +/////////////////////////////////////////////////////////////////////////// +// D3D10CreateDeviceAndSwapChain +// ------------------------------ +// +// ppAdapter +// If NULL, D3D10CreateDevice will choose the primary adapter and +// create a new instance from a temporarily created IDXGIFactory. +// If non-NULL, D3D10CreateDevice will register the appropriate +// device, if necessary (via IDXGIAdapter::RegisterDrver), before +// creating the device. +// DriverType +// Specifies the driver type to be created: hardware, reference or +// null. +// Software +// HMODULE of a DLL implementing a software rasterizer. Must be NULL for +// non-Software driver types. +// Flags +// Any of those documented for D3D10CreateDevice. +// SDKVersion +// SDK version. Use the D3D10_SDK_VERSION macro. +// pSwapChainDesc +// Swap chain description, may be NULL. +// ppSwapChain +// Pointer to returned interface. May be NULL. +// ppDevice +// Pointer to returned interface. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory +// IDXGIFactory::EnumAdapters +// IDXGIAdapter::RegisterDriver +// D3D10CreateDevice +// IDXGIFactory::CreateSwapChain +// +/////////////////////////////////////////////////////////////////////////// +HRESULT WINAPI D3D10CreateDeviceAndSwapChain( + IDXGIAdapter *pAdapter, + D3D10_DRIVER_TYPE DriverType, + HMODULE Software, + UINT Flags, + UINT SDKVersion, + DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, + IDXGISwapChain **ppSwapChain, + ID3D10Device **ppDevice); + + +/////////////////////////////////////////////////////////////////////////// +// D3D10CreateBlob: +// ----------------- +// Creates a Buffer of n Bytes +////////////////////////////////////////////////////////////////////////// + +HRESULT WINAPI D3D10CreateBlob(SIZE_T NumBytes, LPD3D10BLOB *ppBuffer); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3D10EFFECT_H__ + + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3d10sdklayers.h b/Src/Decoder_H264_ALL/D3D/include/d3d10sdklayers.h new file mode 100644 index 0000000..ef432eb --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3d10sdklayers.h @@ -0,0 +1,1361 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0555 */ +/* Compiler settings for d3d10sdklayers.idl: + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 7.00.0555 + protocol : all , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d10sdklayers_h__ +#define __d3d10sdklayers_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ID3D10Debug_FWD_DEFINED__ +#define __ID3D10Debug_FWD_DEFINED__ +typedef interface ID3D10Debug ID3D10Debug; +#endif /* __ID3D10Debug_FWD_DEFINED__ */ + + +#ifndef __ID3D10SwitchToRef_FWD_DEFINED__ +#define __ID3D10SwitchToRef_FWD_DEFINED__ +typedef interface ID3D10SwitchToRef ID3D10SwitchToRef; +#endif /* __ID3D10SwitchToRef_FWD_DEFINED__ */ + + +#ifndef __ID3D10InfoQueue_FWD_DEFINED__ +#define __ID3D10InfoQueue_FWD_DEFINED__ +typedef interface ID3D10InfoQueue ID3D10InfoQueue; +#endif /* __ID3D10InfoQueue_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "dxgi.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d10sdklayers_0000_0000 */ +/* [local] */ + +#define D3D10_SDK_LAYERS_VERSION ( 11 ) + +#define D3D10_DEBUG_FEATURE_FLUSH_PER_RENDER_OP ( 0x1 ) + +#define D3D10_DEBUG_FEATURE_FINISH_PER_RENDER_OP ( 0x2 ) + +#define D3D10_DEBUG_FEATURE_PRESENT_PER_RENDER_OP ( 0x4 ) + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D10Debug_INTERFACE_DEFINED__ +#define __ID3D10Debug_INTERFACE_DEFINED__ + +/* interface ID3D10Debug */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Debug; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4E01-342C-4106-A19F-4F2704F689F0") + ID3D10Debug : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetFeatureMask( + UINT Mask) = 0; + + virtual UINT STDMETHODCALLTYPE GetFeatureMask( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPresentPerRenderOpDelay( + UINT Milliseconds) = 0; + + virtual UINT STDMETHODCALLTYPE GetPresentPerRenderOpDelay( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetSwapChain( + /* [annotation] */ + __in_opt IDXGISwapChain *pSwapChain) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetSwapChain( + /* [annotation] */ + __out IDXGISwapChain **ppSwapChain) = 0; + + virtual HRESULT STDMETHODCALLTYPE Validate( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10DebugVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Debug * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Debug * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Debug * This); + + HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )( + ID3D10Debug * This, + UINT Mask); + + UINT ( STDMETHODCALLTYPE *GetFeatureMask )( + ID3D10Debug * This); + + HRESULT ( STDMETHODCALLTYPE *SetPresentPerRenderOpDelay )( + ID3D10Debug * This, + UINT Milliseconds); + + UINT ( STDMETHODCALLTYPE *GetPresentPerRenderOpDelay )( + ID3D10Debug * This); + + HRESULT ( STDMETHODCALLTYPE *SetSwapChain )( + ID3D10Debug * This, + /* [annotation] */ + __in_opt IDXGISwapChain *pSwapChain); + + HRESULT ( STDMETHODCALLTYPE *GetSwapChain )( + ID3D10Debug * This, + /* [annotation] */ + __out IDXGISwapChain **ppSwapChain); + + HRESULT ( STDMETHODCALLTYPE *Validate )( + ID3D10Debug * This); + + END_INTERFACE + } ID3D10DebugVtbl; + + interface ID3D10Debug + { + CONST_VTBL struct ID3D10DebugVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Debug_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Debug_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Debug_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Debug_SetFeatureMask(This,Mask) \ + ( (This)->lpVtbl -> SetFeatureMask(This,Mask) ) + +#define ID3D10Debug_GetFeatureMask(This) \ + ( (This)->lpVtbl -> GetFeatureMask(This) ) + +#define ID3D10Debug_SetPresentPerRenderOpDelay(This,Milliseconds) \ + ( (This)->lpVtbl -> SetPresentPerRenderOpDelay(This,Milliseconds) ) + +#define ID3D10Debug_GetPresentPerRenderOpDelay(This) \ + ( (This)->lpVtbl -> GetPresentPerRenderOpDelay(This) ) + +#define ID3D10Debug_SetSwapChain(This,pSwapChain) \ + ( (This)->lpVtbl -> SetSwapChain(This,pSwapChain) ) + +#define ID3D10Debug_GetSwapChain(This,ppSwapChain) \ + ( (This)->lpVtbl -> GetSwapChain(This,ppSwapChain) ) + +#define ID3D10Debug_Validate(This) \ + ( (This)->lpVtbl -> Validate(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Debug_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D10SwitchToRef_INTERFACE_DEFINED__ +#define __ID3D10SwitchToRef_INTERFACE_DEFINED__ + +/* interface ID3D10SwitchToRef */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10SwitchToRef; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9B7E4E02-342C-4106-A19F-4F2704F689F0") + ID3D10SwitchToRef : public IUnknown + { + public: + virtual BOOL STDMETHODCALLTYPE SetUseRef( + BOOL UseRef) = 0; + + virtual BOOL STDMETHODCALLTYPE GetUseRef( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10SwitchToRefVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10SwitchToRef * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10SwitchToRef * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10SwitchToRef * This); + + BOOL ( STDMETHODCALLTYPE *SetUseRef )( + ID3D10SwitchToRef * This, + BOOL UseRef); + + BOOL ( STDMETHODCALLTYPE *GetUseRef )( + ID3D10SwitchToRef * This); + + END_INTERFACE + } ID3D10SwitchToRefVtbl; + + interface ID3D10SwitchToRef + { + CONST_VTBL struct ID3D10SwitchToRefVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10SwitchToRef_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10SwitchToRef_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10SwitchToRef_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10SwitchToRef_SetUseRef(This,UseRef) \ + ( (This)->lpVtbl -> SetUseRef(This,UseRef) ) + +#define ID3D10SwitchToRef_GetUseRef(This) \ + ( (This)->lpVtbl -> GetUseRef(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10SwitchToRef_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10sdklayers_0000_0002 */ +/* [local] */ + +typedef +enum D3D10_MESSAGE_CATEGORY + { D3D10_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0, + D3D10_MESSAGE_CATEGORY_MISCELLANEOUS = ( D3D10_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1 ) , + D3D10_MESSAGE_CATEGORY_INITIALIZATION = ( D3D10_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) , + D3D10_MESSAGE_CATEGORY_CLEANUP = ( D3D10_MESSAGE_CATEGORY_INITIALIZATION + 1 ) , + D3D10_MESSAGE_CATEGORY_COMPILATION = ( D3D10_MESSAGE_CATEGORY_CLEANUP + 1 ) , + D3D10_MESSAGE_CATEGORY_STATE_CREATION = ( D3D10_MESSAGE_CATEGORY_COMPILATION + 1 ) , + D3D10_MESSAGE_CATEGORY_STATE_SETTING = ( D3D10_MESSAGE_CATEGORY_STATE_CREATION + 1 ) , + D3D10_MESSAGE_CATEGORY_STATE_GETTING = ( D3D10_MESSAGE_CATEGORY_STATE_SETTING + 1 ) , + D3D10_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( D3D10_MESSAGE_CATEGORY_STATE_GETTING + 1 ) , + D3D10_MESSAGE_CATEGORY_EXECUTION = ( D3D10_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 ) + } D3D10_MESSAGE_CATEGORY; + +typedef +enum D3D10_MESSAGE_SEVERITY + { D3D10_MESSAGE_SEVERITY_CORRUPTION = 0, + D3D10_MESSAGE_SEVERITY_ERROR = ( D3D10_MESSAGE_SEVERITY_CORRUPTION + 1 ) , + D3D10_MESSAGE_SEVERITY_WARNING = ( D3D10_MESSAGE_SEVERITY_ERROR + 1 ) , + D3D10_MESSAGE_SEVERITY_INFO = ( D3D10_MESSAGE_SEVERITY_WARNING + 1 ) + } D3D10_MESSAGE_SEVERITY; + +typedef +enum D3D10_MESSAGE_ID + { D3D10_MESSAGE_ID_UNKNOWN = 0, + D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_UNKNOWN + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_HAZARD + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD = ( D3D10_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD + 1 ) , + D3D10_MESSAGE_ID_STRING_FROM_APPLICATION = ( D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_HAZARD + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_THIS = ( D3D10_MESSAGE_ID_STRING_FROM_APPLICATION + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER1 = ( D3D10_MESSAGE_ID_CORRUPTED_THIS + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER2 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER1 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER3 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER2 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER4 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER3 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER5 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER4 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER6 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER5 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER7 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER6 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER8 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER7 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER9 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER8 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER10 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER9 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER11 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER10 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER12 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER11 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER13 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER12 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER14 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER13 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_PARAMETER15 = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER14 + 1 ) , + D3D10_MESSAGE_ID_CORRUPTED_MULTITHREADING = ( D3D10_MESSAGE_ID_CORRUPTED_PARAMETER15 + 1 ) , + D3D10_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CORRUPTED_MULTITHREADING + 1 ) , + D3D10_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY + 1 ) , + D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETINPUTLAYOUT_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_IASETINDEXBUFFER_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSHADER_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_VSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSHADER_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_GSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_SOSETTARGETS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSHADER_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSHADERRESOURCES_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_PSSETSAMPLERS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_RSSETSTATE_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETBLENDSTATE_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETDEPTHSTENCILSTATE_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = ( D3D10_MESSAGE_ID_SETPREDICATION_UNBINDDELETINGOBJECT + 1 ) , + D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = ( D3D10_MESSAGE_ID_GETPRIVATEDATA_MOREDATA + 1 ) , + D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA + 1 ) , + D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN + 1 ) , + D3D10_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS + 1 ) , + D3D10_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDSAMPLES + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDUSAGE + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDINITIALDATA + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMIPLEVELS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_NULLDESC = ( D3D10_MESSAGE_ID_CREATEBUFFER_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS = ( D3D10_MESSAGE_ID_CREATEBUFFER_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATEBUFFER_INVALIDCONSTANTBUFFERBINDINGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATEBUFFER_LARGEALLOCATION + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNSUPPORTEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDSAMPLES + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDUSAGE + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDINITIALDATA + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMIPLEVELS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE1D_LARGEALLOCATION + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNSUPPORTEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDSAMPLES + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDUSAGE + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDINITIALDATA + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMIPLEVELS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE2D_LARGEALLOCATION + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNSUPPORTEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDSAMPLES + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDUSAGE + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_UNRECOGNIZEDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDCPUACCESSFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDBINDFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDINITIALDATA + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMIPLEVELS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_NULLDESC = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATETEXTURE3D_LARGEALLOCATION + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_TOOMANYOBJECTS + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_TOOMANYOBJECTS + 1 ) , + D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = ( D3D10_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_TOOMANYOBJECTS + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT + 1 ) , + D3D10_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY + 1 ) , + D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX + 1 ) , + D3D10_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE + 1 ) , + D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY + 1 ) , + D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = ( D3D10_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_TOOMANYOBJECTS + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC + 1 ) , + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_TOOMANYOBJECTS + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_TOOMANYOBJECTS + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_TOOMANYOBJECTS + 1 ) , + D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDQUERY + 1 ) , + D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_INVALIDMISCFLAGS + 1 ) , + D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_UNEXPECTEDMISCFLAG + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED = ( D3D10_MESSAGE_ID_CREATEQUERYORPREDICATE_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED = ( D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED + 1 ) , + D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE = ( D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_INVALIDBUFFER + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_OFFSET_TOO_LARGE + 1 ) , + D3D10_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID = ( D3D10_MESSAGE_ID_IASETINDEXBUFFER_INVALIDBUFFER + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_FORMAT_INVALID + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_TOO_LARGE + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_IASETINDEXBUFFER_OFFSET_UNALIGNED + 1 ) , + D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_VSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_VSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_GSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_GSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_GSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_SOSETTARGETS_INVALIDBUFFER + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_SOSETTARGETS_OFFSET_UNALIGNED + 1 ) , + D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D10_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_PSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT = ( D3D10_MESSAGE_ID_DEVICE_PSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR = ( D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT + 1 ) , + D3D10_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH = ( D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR + 1 ) , + D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH = ( D3D10_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH + 1 ) , + D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = ( D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_IAGETVERTEXBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_VSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_GSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_SOGETTARGETS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_PSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY = ( D3D10_MESSAGE_ID_DEVICE_RSGETVIEWPORTS_VIEWPORTS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RSGETSCISSORRECTS_RECTS_EMPTY + 1 ) , + D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE = ( D3D10_MESSAGE_ID_DEVICE_GENERATEMIPS_RESOURCE_INVALID + 1 ) , + D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCEBOX + 1 ) , + D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCE + 1 ) , + D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDDESTINATIONSTATE + 1 ) , + D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE = ( D3D10_MESSAGE_ID_COPYSUBRESOURCEREGION_INVALIDSOURCESTATE + 1 ) , + D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE + 1 ) , + D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE + 1 ) , + D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE = ( D3D10_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE + 1 ) , + D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID = ( D3D10_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID + 1 ) , + D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID + 1 ) , + D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE + 1 ) , + D3D10_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS + 1 ) , + D3D10_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED + 1 ) , + D3D10_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED + 1 ) , + D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS + 1 ) , + D3D10_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED + 1 ) , + D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED + 1 ) , + D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS + 1 ) , + D3D10_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED + 1 ) , + D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE = ( D3D10_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED + 1 ) , + D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS + 1 ) , + D3D10_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED + 1 ) , + D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE = ( D3D10_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN + 1 ) , + D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED = ( D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE + 1 ) , + D3D10_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED = ( D3D10_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED + 1 ) , + D3D10_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED = ( D3D10_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED + 1 ) , + D3D10_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS = ( D3D10_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED + 1 ) , + D3D10_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS + 1 ) , + D3D10_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE = ( D3D10_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN + 1 ) , + D3D10_MESSAGE_ID_REF_THREADING_MODE = ( D3D10_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE + 1 ) , + D3D10_MESSAGE_ID_REF_UMDRIVER_EXCEPTION = ( D3D10_MESSAGE_ID_REF_THREADING_MODE + 1 ) , + D3D10_MESSAGE_ID_REF_KMDRIVER_EXCEPTION = ( D3D10_MESSAGE_ID_REF_UMDRIVER_EXCEPTION + 1 ) , + D3D10_MESSAGE_ID_REF_HARDWARE_EXCEPTION = ( D3D10_MESSAGE_ID_REF_KMDRIVER_EXCEPTION + 1 ) , + D3D10_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE = ( D3D10_MESSAGE_ID_REF_HARDWARE_EXCEPTION + 1 ) , + D3D10_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER = ( D3D10_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE + 1 ) , + D3D10_MESSAGE_ID_REF_OUT_OF_MEMORY = ( D3D10_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER + 1 ) , + D3D10_MESSAGE_ID_REF_INFO = ( D3D10_MESSAGE_ID_REF_OUT_OF_MEMORY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_REF_INFO + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INPUTLAYOUT_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_CONSTANT_BUFFER_TOO_SMALL + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VIEW_DIMENSION_MISMATCH + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_BUFFER_TOO_SMALL + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_FORMAT_INVALID + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_GS_INPUT_PRIMITIVE_MISMATCH + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_RETURN_TYPE_MISMATCH + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_DRAW_POSITION_NOT_PRESENT + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY = ( D3D10_MESSAGE_ID_DEVICE_DRAW_BOUND_RESOURCE_MAPPED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_PRIMITIVETOPOLOGY + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_OFFSET_UNALIGNED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VERTEX_STRIDE_UNALIGNED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INDEX_OFFSET_UNALIGNED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SO_STRIDE_LARGER_THAN_BUFFER + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + 1 ) , + D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = ( D3D10_MESSAGE_ID_DEVICE_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + 1 ) , + D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = ( D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT + 1 ) , + D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = ( D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT + 1 ) , + D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN = ( D3D10_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT + 1 ) , + D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN + 1 ) , + D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN = ( D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET = ( D3D10_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D10_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET + 1 ) , + D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH = ( D3D10_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) , + D3D10_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW = ( D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH + 1 ) , + D3D10_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = ( D3D10_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH + 1 ) , + D3D10_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH + 1 ) , + D3D10_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY = ( D3D10_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY + 1 ) , + D3D10_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY + 1 ) , + D3D10_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATEQUERY_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER = ( D3D10_MESSAGE_ID_CREATEPREDICATE_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED = ( D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFRANGE_COUNTER + 1 ) , + D3D10_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D10_MESSAGE_ID_CREATECOUNTER_SIMULTANEOUS_ACTIVE_COUNTERS_EXHAUSTED + 1 ) , + D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN = ( D3D10_MESSAGE_ID_CREATECOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) , + D3D10_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN = ( D3D10_MESSAGE_ID_CREATECOUNTER_OUTOFMEMORY_RETURN + 1 ) , + D3D10_MESSAGE_ID_CREATECOUNTER_NULLDESC = ( D3D10_MESSAGE_ID_CREATECOUNTER_NONEXCLUSIVE_RETURN + 1 ) , + D3D10_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER = ( D3D10_MESSAGE_ID_CREATECOUNTER_NULLDESC + 1 ) , + D3D10_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER = ( D3D10_MESSAGE_ID_CHECKCOUNTER_OUTOFRANGE_COUNTER + 1 ) , + D3D10_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE = ( D3D10_MESSAGE_ID_CHECKCOUNTER_UNSUPPORTED_WELLKNOWN_COUNTER + 1 ) , + D3D10_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED = ( D3D10_MESSAGE_ID_SETPREDICATION_INVALID_PREDICATE_STATE + 1 ) , + D3D10_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION = ( D3D10_MESSAGE_ID_QUERY_BEGIN_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_QUERY_BEGIN_DUPLICATE = ( D3D10_MESSAGE_ID_PREDICATE_BEGIN_DURING_PREDICATION + 1 ) , + D3D10_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS = ( D3D10_MESSAGE_ID_QUERY_BEGIN_DUPLICATE + 1 ) , + D3D10_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION = ( D3D10_MESSAGE_ID_QUERY_BEGIN_ABANDONING_PREVIOUS_RESULTS + 1 ) , + D3D10_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS = ( D3D10_MESSAGE_ID_PREDICATE_END_DURING_PREDICATION + 1 ) , + D3D10_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN = ( D3D10_MESSAGE_ID_QUERY_END_ABANDONING_PREVIOUS_RESULTS + 1 ) , + D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE = ( D3D10_MESSAGE_ID_QUERY_END_WITHOUT_BEGIN + 1 ) , + D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS = ( D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_DATASIZE + 1 ) , + D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL = ( D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_FLAGS + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH = ( D3D10_MESSAGE_ID_QUERY_GETDATA_INVALID_CALL + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE = ( D3D10_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = ( D3D10_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE + 1 ) , + D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT + 1 ) , + D3D10_MESSAGE_ID_D3D10_MESSAGES_END = ( D3D10_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH + 1 ) , + D3D10_MESSAGE_ID_D3D10L9_MESSAGES_START = 0x100000, + D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED = ( D3D10_MESSAGE_ID_D3D10L9_MESSAGES_START + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_STENCIL_NO_TWO_SIDED + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthBiasClamp_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_COMPARISON_SUPPORT + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_EXCESSIVE_ANISOTROPY + 1 ) , + D3D10_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_OUT_OF_RANGE + 1 ) , + D3D10_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D10_MESSAGE_ID_VSSETSAMPLERS_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS = ( D3D10_MESSAGE_ID_VSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS = ( D3D10_MESSAGE_ID_PSSETSAMPLERS_TOO_MANY_SAMPLERS + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_ARRAYS + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_VB_AND_IB_BIND + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_TEXTURE_1D + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE = ( D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_OUT_OF_RANGE + 1 ) , + D3D10_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS = ( D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_SHADER_RESOURCE + 1 ) , + D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_TOO_MANY_RENDER_TARGETS + 1 ) , + D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_DIFFERING_BIT_DEPTHS + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS = ( D3D10_MESSAGE_ID_IASETVERTEXBUFFERS_BAD_BUFFER_INDEX + 1 ) , + D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED = ( D3D10_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_TOO_MANY_VIEWPORTS + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS = ( D3D10_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_ADJACENCY_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY = ( D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_TOO_MANY_SCISSORS + 1 ) , + D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK = ( D3D10_MESSAGE_ID_COPYRESOURCE_ONLY_TEXTURE_2D_WITHIN_GPU_MEMORY + 1 ) , + D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK = ( D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_3D_READBACK + 1 ) , + D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT = ( D3D10_MESSAGE_ID_COPYRESOURCE_NO_TEXTURE_ONLY_READBACK + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE = ( D3D10_MESSAGE_ID_CREATEINPUTLAYOUT_UNSUPPORTED_FORMAT + 1 ) , + D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_ALPHA_TO_COVERAGE + 1 ) , + D3D10_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE = ( D3D10_MESSAGE_ID_CREATERASTERIZERSTATE_DepthClipEnable_MUST_BE_TRUE + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD = ( D3D10_MESSAGE_ID_DRAWINDEXED_STARTINDEXLOCATION_MUST_BE_POSITIVE + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_MUST_USE_LOWEST_LOD + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MINLOD_MUST_NOT_BE_FRACTIONAL + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_MAXLOD_MUST_BE_FLT_MAX + 1 ) , + D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_FIRSTARRAYSLICE_MUST_BE_ZERO + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET = ( D3D10_MESSAGE_ID_CREATESHADERRESOURCEVIEW_CUBES_MUST_HAVE_6_SIDES + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER = ( D3D10_MESSAGE_ID_CREATERESOURCE_NOT_BINDABLE_AS_RENDER_TARGET + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_DWORD_INDEX_BUFFER + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE = ( D3D10_MESSAGE_ID_CREATERESOURCE_MSAA_PRECLUDES_SHADER_RESOURCE + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE = ( D3D10_MESSAGE_ID_CREATERESOURCE_PRESENTATION_PRECLUDES_SHADER_RESOURCE + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_BLEND_ENABLE + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_INDEPENDENT_WRITE_MASKS + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_STREAM_OUT + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES = ( D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_VB_IB_FOR_BUFFERS + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED = ( D3D10_MESSAGE_ID_CREATERESOURCE_NO_AUTOGEN_FOR_VOLUMES + 1 ) , + D3D10_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATERESOURCE_DXGI_FORMAT_R8G8B8A8_CANNOT_BE_SHARED + 1 ) , + D3D10_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_VSSHADERRESOURCES_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_GEOMETRY_SHADER_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_STREAM_OUT_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND = ( D3D10_MESSAGE_ID_TEXT_FILTER_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_SEPARATE_ALPHA_BLEND + 1 ) , + D3D10_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_NO_MRT_BLEND + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE = ( D3D10_MESSAGE_ID_CREATEBLENDSTATE_OPERATION_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_NO_MIRRORONCE + 1 ) , + D3D10_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 = ( D3D10_MESSAGE_ID_DRAWINSTANCED_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED = ( D3D10_MESSAGE_ID_DRAWINDEXEDINSTANCED_NOT_SUPPORTED_BELOW_9_3 + 1 ) , + D3D10_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO = ( D3D10_MESSAGE_ID_DRAWINDEXED_POINTLIST_UNSUPPORTED + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION = ( D3D10_MESSAGE_ID_SETBLENDSTATE_SAMPLE_MASK_CANNOT_BE_ZERO + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED = ( D3D10_MESSAGE_ID_CREATERESOURCE_DIMENSION_EXCEEDS_FEATURE_LEVEL_DEFINITION + 1 ) , + D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR = ( D3D10_MESSAGE_ID_CREATERESOURCE_ONLY_SINGLE_MIP_LEVEL_DEPTH_STENCIL_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA = ( D3D10_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_NEGATIVESCISSOR + 1 ) , + D3D10_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP = ( D3D10_MESSAGE_ID_SLOT_ZERO_MUST_BE_D3D10_INPUT_PER_VERTEX_DATA + 1 ) , + D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED = ( D3D10_MESSAGE_ID_CREATERESOURCE_NON_POW_2_MIPMAP + 1 ) , + D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT = ( D3D10_MESSAGE_ID_CREATESAMPLERSTATE_BORDER_NOT_SUPPORTED + 1 ) , + D3D10_MESSAGE_ID_D3D10L9_MESSAGES_END = ( D3D10_MESSAGE_ID_OMSETRENDERTARGETS_NO_SRGB_MRT + 1 ) + } D3D10_MESSAGE_ID; + +typedef struct D3D10_MESSAGE + { + D3D10_MESSAGE_CATEGORY Category; + D3D10_MESSAGE_SEVERITY Severity; + D3D10_MESSAGE_ID ID; + const char *pDescription; + SIZE_T DescriptionByteLength; + } D3D10_MESSAGE; + +typedef struct D3D10_INFO_QUEUE_FILTER_DESC + { + UINT NumCategories; + D3D10_MESSAGE_CATEGORY *pCategoryList; + UINT NumSeverities; + D3D10_MESSAGE_SEVERITY *pSeverityList; + UINT NumIDs; + D3D10_MESSAGE_ID *pIDList; + } D3D10_INFO_QUEUE_FILTER_DESC; + +typedef struct D3D10_INFO_QUEUE_FILTER + { + D3D10_INFO_QUEUE_FILTER_DESC AllowList; + D3D10_INFO_QUEUE_FILTER_DESC DenyList; + } D3D10_INFO_QUEUE_FILTER; + +#define D3D10_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024 + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0002_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0002_v0_0_s_ifspec; + +#ifndef __ID3D10InfoQueue_INTERFACE_DEFINED__ +#define __ID3D10InfoQueue_INTERFACE_DEFINED__ + +/* interface ID3D10InfoQueue */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10InfoQueue; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1b940b17-2642-4d1f-ab1f-b99bad0c395f") + ID3D10InfoQueue : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit( + /* [annotation] */ + __in UINT64 MessageCountLimit) = 0; + + virtual void STDMETHODCALLTYPE ClearStoredMessages( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetMessage( + /* [annotation] */ + __in UINT64 MessageIndex, + /* [annotation] */ + __out_bcount_opt(*pMessageByteLength) D3D10_MESSAGE *pMessage, + /* [annotation] */ + __inout SIZE_T *pMessageByteLength) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries( + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetStorageFilter( + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength) = 0; + + virtual void STDMETHODCALLTYPE ClearStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushStorageFilter( + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual void STDMETHODCALLTYPE PopStorageFilter( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries( + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter( + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength) = 0; + + virtual void STDMETHODCALLTYPE ClearRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter( + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual void STDMETHODCALLTYPE PopRetrievalFilter( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddMessage( + /* [annotation] */ + __in D3D10_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in D3D10_MESSAGE_ID ID, + /* [annotation] */ + __in LPCSTR pDescription) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage( + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in LPCSTR pDescription) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory( + /* [annotation] */ + __in D3D10_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in BOOL bEnable) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity( + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in BOOL bEnable) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnID( + /* [annotation] */ + __in D3D10_MESSAGE_ID ID, + /* [annotation] */ + __in BOOL bEnable) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory( + /* [annotation] */ + __in D3D10_MESSAGE_CATEGORY Category) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity( + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnID( + /* [annotation] */ + __in D3D10_MESSAGE_ID ID) = 0; + + virtual void STDMETHODCALLTYPE SetMuteDebugOutput( + /* [annotation] */ + __in BOOL bMute) = 0; + + virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ID3D10InfoQueueVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10InfoQueue * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10InfoQueue * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in UINT64 MessageCountLimit); + + void ( STDMETHODCALLTYPE *ClearStoredMessages )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *GetMessage )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in UINT64 MessageIndex, + /* [annotation] */ + __out_bcount_opt(*pMessageByteLength) D3D10_MESSAGE *pMessage, + /* [annotation] */ + __inout SIZE_T *pMessageByteLength); + + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )( + ID3D10InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )( + ID3D10InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )( + ID3D10InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )( + ID3D10InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )( + ID3D10InfoQueue * This); + + UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter); + + HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )( + ID3D10InfoQueue * This, + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength); + + void ( STDMETHODCALLTYPE *ClearStorageFilter )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter); + + void ( STDMETHODCALLTYPE *PopStorageFilter )( + ID3D10InfoQueue * This); + + UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter); + + HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )( + ID3D10InfoQueue * This, + /* [annotation] */ + __out_bcount_opt(*pFilterByteLength) D3D10_INFO_QUEUE_FILTER *pFilter, + /* [annotation] */ + __inout SIZE_T *pFilterByteLength); + + void ( STDMETHODCALLTYPE *ClearRetrievalFilter )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_INFO_QUEUE_FILTER *pFilter); + + void ( STDMETHODCALLTYPE *PopRetrievalFilter )( + ID3D10InfoQueue * This); + + UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )( + ID3D10InfoQueue * This); + + HRESULT ( STDMETHODCALLTYPE *AddMessage )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in D3D10_MESSAGE_ID ID, + /* [annotation] */ + __in LPCSTR pDescription); + + HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in LPCSTR pDescription); + + HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_CATEGORY Category, + /* [annotation] */ + __in BOOL bEnable); + + HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity, + /* [annotation] */ + __in BOOL bEnable); + + HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_ID ID, + /* [annotation] */ + __in BOOL bEnable); + + BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_CATEGORY Category); + + BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_SEVERITY Severity); + + BOOL ( STDMETHODCALLTYPE *GetBreakOnID )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in D3D10_MESSAGE_ID ID); + + void ( STDMETHODCALLTYPE *SetMuteDebugOutput )( + ID3D10InfoQueue * This, + /* [annotation] */ + __in BOOL bMute); + + BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )( + ID3D10InfoQueue * This); + + END_INTERFACE + } ID3D10InfoQueueVtbl; + + interface ID3D10InfoQueue + { + CONST_VTBL struct ID3D10InfoQueueVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10InfoQueue_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10InfoQueue_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10InfoQueue_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10InfoQueue_SetMessageCountLimit(This,MessageCountLimit) \ + ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) ) + +#define ID3D10InfoQueue_ClearStoredMessages(This) \ + ( (This)->lpVtbl -> ClearStoredMessages(This) ) + +#define ID3D10InfoQueue_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \ + ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) ) + +#define ID3D10InfoQueue_GetNumMessagesAllowedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) ) + +#define ID3D10InfoQueue_GetNumMessagesDeniedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) ) + +#define ID3D10InfoQueue_GetNumStoredMessages(This) \ + ( (This)->lpVtbl -> GetNumStoredMessages(This) ) + +#define ID3D10InfoQueue_GetNumStoredMessagesAllowedByRetrievalFilter(This) \ + ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) ) + +#define ID3D10InfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) ) + +#define ID3D10InfoQueue_GetMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetMessageCountLimit(This) ) + +#define ID3D10InfoQueue_AddStorageFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) ) + +#define ID3D10InfoQueue_GetStorageFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D10InfoQueue_ClearStorageFilter(This) \ + ( (This)->lpVtbl -> ClearStorageFilter(This) ) + +#define ID3D10InfoQueue_PushEmptyStorageFilter(This) \ + ( (This)->lpVtbl -> PushEmptyStorageFilter(This) ) + +#define ID3D10InfoQueue_PushCopyOfStorageFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) ) + +#define ID3D10InfoQueue_PushStorageFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) ) + +#define ID3D10InfoQueue_PopStorageFilter(This) \ + ( (This)->lpVtbl -> PopStorageFilter(This) ) + +#define ID3D10InfoQueue_GetStorageFilterStackSize(This) \ + ( (This)->lpVtbl -> GetStorageFilterStackSize(This) ) + +#define ID3D10InfoQueue_AddRetrievalFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) ) + +#define ID3D10InfoQueue_GetRetrievalFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D10InfoQueue_ClearRetrievalFilter(This) \ + ( (This)->lpVtbl -> ClearRetrievalFilter(This) ) + +#define ID3D10InfoQueue_PushEmptyRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) ) + +#define ID3D10InfoQueue_PushCopyOfRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) ) + +#define ID3D10InfoQueue_PushRetrievalFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) ) + +#define ID3D10InfoQueue_PopRetrievalFilter(This) \ + ( (This)->lpVtbl -> PopRetrievalFilter(This) ) + +#define ID3D10InfoQueue_GetRetrievalFilterStackSize(This) \ + ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) ) + +#define ID3D10InfoQueue_AddMessage(This,Category,Severity,ID,pDescription) \ + ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) ) + +#define ID3D10InfoQueue_AddApplicationMessage(This,Severity,pDescription) \ + ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) ) + +#define ID3D10InfoQueue_SetBreakOnCategory(This,Category,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) ) + +#define ID3D10InfoQueue_SetBreakOnSeverity(This,Severity,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) ) + +#define ID3D10InfoQueue_SetBreakOnID(This,ID,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) ) + +#define ID3D10InfoQueue_GetBreakOnCategory(This,Category) \ + ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) ) + +#define ID3D10InfoQueue_GetBreakOnSeverity(This,Severity) \ + ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) ) + +#define ID3D10InfoQueue_GetBreakOnID(This,ID) \ + ( (This)->lpVtbl -> GetBreakOnID(This,ID) ) + +#define ID3D10InfoQueue_SetMuteDebugOutput(This,bMute) \ + ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) ) + +#define ID3D10InfoQueue_GetMuteDebugOutput(This) \ + ( (This)->lpVtbl -> GetMuteDebugOutput(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10InfoQueue_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d10sdklayers_0000_0003 */ +/* [local] */ + +#define D3D10_REGKEY_PATH __TEXT("Software\\Microsoft\\Direct3D") +#define D3D10_MUTE_DEBUG_OUTPUT __TEXT("MuteDebugOutput") +#define D3D10_ENABLE_BREAK_ON_MESSAGE __TEXT("EnableBreakOnMessage") +#define D3D10_INFOQUEUE_STORAGE_FILTER_OVERRIDE __TEXT("InfoQueueStorageFilterOverride") +#define D3D10_MUTE_CATEGORY __TEXT("Mute_CATEGORY_%s") +#define D3D10_MUTE_SEVERITY __TEXT("Mute_SEVERITY_%s") +#define D3D10_MUTE_ID_STRING __TEXT("Mute_ID_%s") +#define D3D10_MUTE_ID_DECIMAL __TEXT("Mute_ID_%d") +#define D3D10_UNMUTE_SEVERITY_INFO __TEXT("Unmute_SEVERITY_INFO") +#define D3D10_BREAKON_CATEGORY __TEXT("BreakOn_CATEGORY_%s") +#define D3D10_BREAKON_SEVERITY __TEXT("BreakOn_SEVERITY_%s") +#define D3D10_BREAKON_ID_STRING __TEXT("BreakOn_ID_%s") +#define D3D10_BREAKON_ID_DECIMAL __TEXT("BreakOn_ID_%d") +#define D3D10_APPSIZE_STRING __TEXT("Size") +#define D3D10_APPNAME_STRING __TEXT("Name") +DEFINE_GUID(IID_ID3D10Debug,0x9B7E4E01,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10SwitchToRef,0x9B7E4E02,0x342C,0x4106,0xA1,0x9F,0x4F,0x27,0x04,0xF6,0x89,0xF0); +DEFINE_GUID(IID_ID3D10InfoQueue,0x1b940b17,0x2642,0x4d1f,0xab,0x1f,0xb9,0x9b,0xad,0x0c,0x39,0x5f); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0003_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d10sdklayers_0000_0003_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3d8.h b/Src/Decoder_H264_ALL/D3D/include/d3d8.h new file mode 100644 index 0000000..adf91eb --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3d8.h @@ -0,0 +1,1279 @@ +/*==========================================================================; + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: d3d8.h + * Content: Direct3D include file + * + ****************************************************************************/ + +#ifndef _D3D8_H_ +#define _D3D8_H_ + +#ifndef DIRECT3D_VERSION +#define DIRECT3D_VERSION 0x0800 +#endif //DIRECT3D_VERSION + +// include this file content only if compiling for DX8 interfaces +#if(DIRECT3D_VERSION >= 0x0800) + + +/* This identifier is passed to Direct3DCreate8 in order to ensure that an + * application was built against the correct header files. This number is + * incremented whenever a header (or other) change would require applications + * to be rebuilt. If the version doesn't match, Direct3DCreate8 will fail. + * (The number itself has no meaning.)*/ + +#define D3D_SDK_VERSION 220 + + +#include + +#define COM_NO_WINDOWS_H +#include + +#include + +#if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500) + #define HMONITOR_DECLARED + DECLARE_HANDLE(HMONITOR); +#endif + +#define D3DAPI WINAPI + +/* + * Interface IID's + */ +#if defined( _WIN32 ) && !defined( _NO_COM) + +/* IID_IDirect3D8 */ +/* {1DD9E8DA-1C77-4d40-B0CF-98FEFDFF9512} */ +DEFINE_GUID(IID_IDirect3D8, 0x1dd9e8da, 0x1c77, 0x4d40, 0xb0, 0xcf, 0x98, 0xfe, 0xfd, 0xff, 0x95, 0x12); + +/* IID_IDirect3DDevice8 */ +/* {7385E5DF-8FE8-41D5-86B6-D7B48547B6CF} */ +DEFINE_GUID(IID_IDirect3DDevice8, 0x7385e5df, 0x8fe8, 0x41d5, 0x86, 0xb6, 0xd7, 0xb4, 0x85, 0x47, 0xb6, 0xcf); + +/* IID_IDirect3DResource8 */ +/* {1B36BB7B-09B7-410a-B445-7D1430D7B33F} */ +DEFINE_GUID(IID_IDirect3DResource8, 0x1b36bb7b, 0x9b7, 0x410a, 0xb4, 0x45, 0x7d, 0x14, 0x30, 0xd7, 0xb3, 0x3f); + +/* IID_IDirect3DBaseTexture8 */ +/* {B4211CFA-51B9-4a9f-AB78-DB99B2BB678E} */ +DEFINE_GUID(IID_IDirect3DBaseTexture8, 0xb4211cfa, 0x51b9, 0x4a9f, 0xab, 0x78, 0xdb, 0x99, 0xb2, 0xbb, 0x67, 0x8e); + +/* IID_IDirect3DTexture8 */ +/* {E4CDD575-2866-4f01-B12E-7EECE1EC9358} */ +DEFINE_GUID(IID_IDirect3DTexture8, 0xe4cdd575, 0x2866, 0x4f01, 0xb1, 0x2e, 0x7e, 0xec, 0xe1, 0xec, 0x93, 0x58); + +/* IID_IDirect3DCubeTexture8 */ +/* {3EE5B968-2ACA-4c34-8BB5-7E0C3D19B750} */ +DEFINE_GUID(IID_IDirect3DCubeTexture8, 0x3ee5b968, 0x2aca, 0x4c34, 0x8b, 0xb5, 0x7e, 0x0c, 0x3d, 0x19, 0xb7, 0x50); + +/* IID_IDirect3DVolumeTexture8 */ +/* {4B8AAAFA-140F-42ba-9131-597EAFAA2EAD} */ +DEFINE_GUID(IID_IDirect3DVolumeTexture8, 0x4b8aaafa, 0x140f, 0x42ba, 0x91, 0x31, 0x59, 0x7e, 0xaf, 0xaa, 0x2e, 0xad); + +/* IID_IDirect3DVertexBuffer8 */ +/* {8AEEEAC7-05F9-44d4-B591-000B0DF1CB95} */ +DEFINE_GUID(IID_IDirect3DVertexBuffer8, 0x8aeeeac7, 0x05f9, 0x44d4, 0xb5, 0x91, 0x00, 0x0b, 0x0d, 0xf1, 0xcb, 0x95); + +/* IID_IDirect3DIndexBuffer8 */ +/* {0E689C9A-053D-44a0-9D92-DB0E3D750F86} */ +DEFINE_GUID(IID_IDirect3DIndexBuffer8, 0x0e689c9a, 0x053d, 0x44a0, 0x9d, 0x92, 0xdb, 0x0e, 0x3d, 0x75, 0x0f, 0x86); + +/* IID_IDirect3DSurface8 */ +/* {B96EEBCA-B326-4ea5-882F-2FF5BAE021DD} */ +DEFINE_GUID(IID_IDirect3DSurface8, 0xb96eebca, 0xb326, 0x4ea5, 0x88, 0x2f, 0x2f, 0xf5, 0xba, 0xe0, 0x21, 0xdd); + +/* IID_IDirect3DVolume8 */ +/* {BD7349F5-14F1-42e4-9C79-972380DB40C0} */ +DEFINE_GUID(IID_IDirect3DVolume8, 0xbd7349f5, 0x14f1, 0x42e4, 0x9c, 0x79, 0x97, 0x23, 0x80, 0xdb, 0x40, 0xc0); + +/* IID_IDirect3DSwapChain8 */ +/* {928C088B-76B9-4C6B-A536-A590853876CD} */ +DEFINE_GUID(IID_IDirect3DSwapChain8, 0x928c088b, 0x76b9, 0x4c6b, 0xa5, 0x36, 0xa5, 0x90, 0x85, 0x38, 0x76, 0xcd); + +#endif + +#ifdef __cplusplus + +interface IDirect3D8; +interface IDirect3DDevice8; + +interface IDirect3DResource8; +interface IDirect3DBaseTexture8; +interface IDirect3DTexture8; +interface IDirect3DVolumeTexture8; +interface IDirect3DCubeTexture8; + +interface IDirect3DVertexBuffer8; +interface IDirect3DIndexBuffer8; + +interface IDirect3DSurface8; +interface IDirect3DVolume8; + +interface IDirect3DSwapChain8; + +#endif + + +typedef interface IDirect3D8 IDirect3D8; +typedef interface IDirect3DDevice8 IDirect3DDevice8; +typedef interface IDirect3DResource8 IDirect3DResource8; +typedef interface IDirect3DBaseTexture8 IDirect3DBaseTexture8; +typedef interface IDirect3DTexture8 IDirect3DTexture8; +typedef interface IDirect3DVolumeTexture8 IDirect3DVolumeTexture8; +typedef interface IDirect3DCubeTexture8 IDirect3DCubeTexture8; +typedef interface IDirect3DVertexBuffer8 IDirect3DVertexBuffer8; +typedef interface IDirect3DIndexBuffer8 IDirect3DIndexBuffer8; +typedef interface IDirect3DSurface8 IDirect3DSurface8; +typedef interface IDirect3DVolume8 IDirect3DVolume8; +typedef interface IDirect3DSwapChain8 IDirect3DSwapChain8; + +#include "d3d8types.h" +#include "d3d8caps.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * DLL Function for creating a Direct3D8 object. This object supports + * enumeration and allows the creation of Direct3DDevice8 objects. + * Pass the value of the constant D3D_SDK_VERSION to this function, so + * that the run-time can validate that your application was compiled + * against the right headers. + */ + +IDirect3D8 * WINAPI Direct3DCreate8(UINT SDKVersion); + + +/* + * Direct3D interfaces + */ + + + + + + +#undef INTERFACE +#define INTERFACE IDirect3D8 + +DECLARE_INTERFACE_(IDirect3D8, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3D8 methods ***/ + STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE; + STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE; + STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER8* pIdentifier) PURE; + STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter) PURE; + STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter,UINT Mode,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter,D3DDEVTYPE CheckType,D3DFORMAT DisplayFormat,D3DFORMAT BackBufferFormat,BOOL Windowed) PURE; + STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) PURE; + STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType) PURE; + STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS8* pCaps) PURE; + STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE; + STDMETHOD(CreateDevice)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice8** ppReturnedDeviceInterface) PURE; +}; + +typedef struct IDirect3D8 *LPDIRECT3D8, *PDIRECT3D8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3D8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D8_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3D8_RegisterSoftwareDevice(p,a) (p)->lpVtbl->RegisterSoftwareDevice(p,a) +#define IDirect3D8_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p) +#define IDirect3D8_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c) +#define IDirect3D8_GetAdapterModeCount(p,a) (p)->lpVtbl->GetAdapterModeCount(p,a) +#define IDirect3D8_EnumAdapterModes(p,a,b,c) (p)->lpVtbl->EnumAdapterModes(p,a,b,c) +#define IDirect3D8_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b) +#define IDirect3D8_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e) +#define IDirect3D8_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f) +#define IDirect3D8_CheckDeviceMultiSampleType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e) +#define IDirect3D8_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e) +#define IDirect3D8_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c) +#define IDirect3D8_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a) +#define IDirect3D8_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f) +#else +#define IDirect3D8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D8_AddRef(p) (p)->AddRef() +#define IDirect3D8_Release(p) (p)->Release() +#define IDirect3D8_RegisterSoftwareDevice(p,a) (p)->RegisterSoftwareDevice(a) +#define IDirect3D8_GetAdapterCount(p) (p)->GetAdapterCount() +#define IDirect3D8_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c) +#define IDirect3D8_GetAdapterModeCount(p,a) (p)->GetAdapterModeCount(a) +#define IDirect3D8_EnumAdapterModes(p,a,b,c) (p)->EnumAdapterModes(a,b,c) +#define IDirect3D8_GetAdapterDisplayMode(p,a,b) (p)->GetAdapterDisplayMode(a,b) +#define IDirect3D8_CheckDeviceType(p,a,b,c,d,e) (p)->CheckDeviceType(a,b,c,d,e) +#define IDirect3D8_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->CheckDeviceFormat(a,b,c,d,e,f) +#define IDirect3D8_CheckDeviceMultiSampleType(p,a,b,c,d,e) (p)->CheckDeviceMultiSampleType(a,b,c,d,e) +#define IDirect3D8_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->CheckDepthStencilMatch(a,b,c,d,e) +#define IDirect3D8_GetDeviceCaps(p,a,b,c) (p)->GetDeviceCaps(a,b,c) +#define IDirect3D8_GetAdapterMonitor(p,a) (p)->GetAdapterMonitor(a) +#define IDirect3D8_CreateDevice(p,a,b,c,d,e,f) (p)->CreateDevice(a,b,c,d,e,f) +#endif + + + + + + + + + + + + + + + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DDevice8 + +DECLARE_INTERFACE_(IDirect3DDevice8, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DDevice8 methods ***/ + STDMETHOD(TestCooperativeLevel)(THIS) PURE; + STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE; + STDMETHOD(ResourceManagerDiscardBytes)(THIS_ DWORD Bytes) PURE; + STDMETHOD(GetDirect3D)(THIS_ IDirect3D8** ppD3D8) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS8* pCaps) PURE; + STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE; + STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface8* pCursorBitmap) PURE; + STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags) PURE; + STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE; + STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain8** pSwapChain) PURE; + STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT BackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer) PURE; + STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE; + STDMETHOD_(void, SetGammaRamp)(THIS_ DWORD Flags,CONST D3DGAMMARAMP* pRamp) PURE; + STDMETHOD_(void, GetGammaRamp)(THIS_ D3DGAMMARAMP* pRamp) PURE; + STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture8** ppTexture) PURE; + STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture8** ppVolumeTexture) PURE; + STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture8** ppCubeTexture) PURE; + STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer8** ppVertexBuffer) PURE; + STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer8** ppIndexBuffer) PURE; + STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,BOOL Lockable,IDirect3DSurface8** ppSurface) PURE; + STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,IDirect3DSurface8** ppSurface) PURE; + STDMETHOD(CreateImageSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,IDirect3DSurface8** ppSurface) PURE; + STDMETHOD(CopyRects)(THIS_ IDirect3DSurface8* pSourceSurface,CONST RECT* pSourceRectsArray,UINT cRects,IDirect3DSurface8* pDestinationSurface,CONST POINT* pDestPointsArray) PURE; + STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture8* pSourceTexture,IDirect3DBaseTexture8* pDestinationTexture) PURE; + STDMETHOD(GetFrontBuffer)(THIS_ IDirect3DSurface8* pDestSurface) PURE; + STDMETHOD(SetRenderTarget)(THIS_ IDirect3DSurface8* pRenderTarget,IDirect3DSurface8* pNewZStencil) PURE; + STDMETHOD(GetRenderTarget)(THIS_ IDirect3DSurface8** ppRenderTarget) PURE; + STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface8** ppZStencilSurface) PURE; + STDMETHOD(BeginScene)(THIS) PURE; + STDMETHOD(EndScene)(THIS) PURE; + STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) PURE; + STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) PURE; + STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) PURE; + STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*) PURE; + STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT8* pViewport) PURE; + STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT8* pViewport) PURE; + STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL8* pMaterial) PURE; + STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL8* pMaterial) PURE; + STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT8*) PURE; + STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT8*) PURE; + STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE; + STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE; + STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane) PURE; + STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane) PURE; + STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value) PURE; + STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue) PURE; + STDMETHOD(BeginStateBlock)(THIS) PURE; + STDMETHOD(EndStateBlock)(THIS_ DWORD* pToken) PURE; + STDMETHOD(ApplyStateBlock)(THIS_ DWORD Token) PURE; + STDMETHOD(CaptureStateBlock)(THIS_ DWORD Token) PURE; + STDMETHOD(DeleteStateBlock)(THIS_ DWORD Token) PURE; + STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,DWORD* pToken) PURE; + STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS8* pClipStatus) PURE; + STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS8* pClipStatus) PURE; + STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture8** ppTexture) PURE; + STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture8* pTexture) PURE; + STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE; + STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE; + STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE; + STDMETHOD(GetInfo)(THIS_ DWORD DevInfoID,void* pDevInfoStruct,DWORD DevInfoStructSize) PURE; + STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries) PURE; + STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE; + STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE; + STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE; + STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE; + STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE; + STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; + STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertexIndices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; + STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags) PURE; + STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pDeclaration,CONST DWORD* pFunction,DWORD* pHandle,DWORD Usage) PURE; + STDMETHOD(SetVertexShader)(THIS_ DWORD Handle) PURE; + STDMETHOD(GetVertexShader)(THIS_ DWORD* pHandle) PURE; + STDMETHOD(DeleteVertexShader)(THIS_ DWORD Handle) PURE; + STDMETHOD(SetVertexShaderConstant)(THIS_ DWORD Register,CONST void* pConstantData,DWORD ConstantCount) PURE; + STDMETHOD(GetVertexShaderConstant)(THIS_ DWORD Register,void* pConstantData,DWORD ConstantCount) PURE; + STDMETHOD(GetVertexShaderDeclaration)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(GetVertexShaderFunction)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer8* pStreamData,UINT Stride) PURE; + STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer8** ppStreamData,UINT* pStride) PURE; + STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer8* pIndexData,UINT BaseVertexIndex) PURE; + STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex) PURE; + STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,DWORD* pHandle) PURE; + STDMETHOD(SetPixelShader)(THIS_ DWORD Handle) PURE; + STDMETHOD(GetPixelShader)(THIS_ DWORD* pHandle) PURE; + STDMETHOD(DeletePixelShader)(THIS_ DWORD Handle) PURE; + STDMETHOD(SetPixelShaderConstant)(THIS_ DWORD Register,CONST void* pConstantData,DWORD ConstantCount) PURE; + STDMETHOD(GetPixelShaderConstant)(THIS_ DWORD Register,void* pConstantData,DWORD ConstantCount) PURE; + STDMETHOD(GetPixelShaderFunction)(THIS_ DWORD Handle,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE; + STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE; + STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; +}; + +typedef struct IDirect3DDevice8 *LPDIRECT3DDEVICE8, *PDIRECT3DDEVICE8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DDevice8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDevice8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDevice8_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DDevice8_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) +#define IDirect3DDevice8_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p) +#define IDirect3DDevice8_ResourceManagerDiscardBytes(p,a) (p)->lpVtbl->ResourceManagerDiscardBytes(p,a) +#define IDirect3DDevice8_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) +#define IDirect3DDevice8_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a) +#define IDirect3DDevice8_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) +#define IDirect3DDevice8_GetCreationParameters(p,a) (p)->lpVtbl->GetCreationParameters(p,a) +#define IDirect3DDevice8_SetCursorProperties(p,a,b,c) (p)->lpVtbl->SetCursorProperties(p,a,b,c) +#define IDirect3DDevice8_SetCursorPosition(p,a,b,c) (p)->lpVtbl->SetCursorPosition(p,a,b,c) +#define IDirect3DDevice8_ShowCursor(p,a) (p)->lpVtbl->ShowCursor(p,a) +#define IDirect3DDevice8_CreateAdditionalSwapChain(p,a,b) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b) +#define IDirect3DDevice8_Reset(p,a) (p)->lpVtbl->Reset(p,a) +#define IDirect3DDevice8_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) +#define IDirect3DDevice8_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) +#define IDirect3DDevice8_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) +#define IDirect3DDevice8_SetGammaRamp(p,a,b) (p)->lpVtbl->SetGammaRamp(p,a,b) +#define IDirect3DDevice8_GetGammaRamp(p,a) (p)->lpVtbl->GetGammaRamp(p,a) +#define IDirect3DDevice8_CreateTexture(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g) +#define IDirect3DDevice8_CreateVolumeTexture(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice8_CreateCubeTexture(p,a,b,c,d,e,f) (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f) +#define IDirect3DDevice8_CreateVertexBuffer(p,a,b,c,d,e) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e) +#define IDirect3DDevice8_CreateIndexBuffer(p,a,b,c,d,e) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e) +#define IDirect3DDevice8_CreateRenderTarget(p,a,b,c,d,e,f) (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f) +#define IDirect3DDevice8_CreateDepthStencilSurface(p,a,b,c,d,e) (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e) +#define IDirect3DDevice8_CreateImageSurface(p,a,b,c,d) (p)->lpVtbl->CreateImageSurface(p,a,b,c,d) +#define IDirect3DDevice8_CopyRects(p,a,b,c,d,e) (p)->lpVtbl->CopyRects(p,a,b,c,d,e) +#define IDirect3DDevice8_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) +#define IDirect3DDevice8_GetFrontBuffer(p,a) (p)->lpVtbl->GetFrontBuffer(p,a) +#define IDirect3DDevice8_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) +#define IDirect3DDevice8_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a) +#define IDirect3DDevice8_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a) +#define IDirect3DDevice8_BeginScene(p) (p)->lpVtbl->BeginScene(p) +#define IDirect3DDevice8_EndScene(p) (p)->lpVtbl->EndScene(p) +#define IDirect3DDevice8_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) +#define IDirect3DDevice8_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) +#define IDirect3DDevice8_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) +#define IDirect3DDevice8_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) +#define IDirect3DDevice8_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) +#define IDirect3DDevice8_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) +#define IDirect3DDevice8_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DDevice8_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) +#define IDirect3DDevice8_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) +#define IDirect3DDevice8_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) +#define IDirect3DDevice8_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) +#define IDirect3DDevice8_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) +#define IDirect3DDevice8_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) +#define IDirect3DDevice8_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) +#define IDirect3DDevice8_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) +#define IDirect3DDevice8_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) +#define IDirect3DDevice8_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) +#define IDirect3DDevice8_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) +#define IDirect3DDevice8_ApplyStateBlock(p,a) (p)->lpVtbl->ApplyStateBlock(p,a) +#define IDirect3DDevice8_CaptureStateBlock(p,a) (p)->lpVtbl->CaptureStateBlock(p,a) +#define IDirect3DDevice8_DeleteStateBlock(p,a) (p)->lpVtbl->DeleteStateBlock(p,a) +#define IDirect3DDevice8_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) +#define IDirect3DDevice8_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) +#define IDirect3DDevice8_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) +#define IDirect3DDevice8_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) +#define IDirect3DDevice8_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) +#define IDirect3DDevice8_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) +#define IDirect3DDevice8_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) +#define IDirect3DDevice8_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) +#define IDirect3DDevice8_GetInfo(p,a,b,c) (p)->lpVtbl->GetInfo(p,a,b,c) +#define IDirect3DDevice8_SetPaletteEntries(p,a,b) (p)->lpVtbl->SetPaletteEntries(p,a,b) +#define IDirect3DDevice8_GetPaletteEntries(p,a,b) (p)->lpVtbl->GetPaletteEntries(p,a,b) +#define IDirect3DDevice8_SetCurrentTexturePalette(p,a) (p)->lpVtbl->SetCurrentTexturePalette(p,a) +#define IDirect3DDevice8_GetCurrentTexturePalette(p,a) (p)->lpVtbl->GetCurrentTexturePalette(p,a) +#define IDirect3DDevice8_DrawPrimitive(p,a,b,c) (p)->lpVtbl->DrawPrimitive(p,a,b,c) +#define IDirect3DDevice8_DrawIndexedPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e) +#define IDirect3DDevice8_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d) +#define IDirect3DDevice8_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice8_ProcessVertices(p,a,b,c,d,e) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e) +#define IDirect3DDevice8_CreateVertexShader(p,a,b,c,d) (p)->lpVtbl->CreateVertexShader(p,a,b,c,d) +#define IDirect3DDevice8_SetVertexShader(p,a) (p)->lpVtbl->SetVertexShader(p,a) +#define IDirect3DDevice8_GetVertexShader(p,a) (p)->lpVtbl->GetVertexShader(p,a) +#define IDirect3DDevice8_DeleteVertexShader(p,a) (p)->lpVtbl->DeleteVertexShader(p,a) +#define IDirect3DDevice8_SetVertexShaderConstant(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstant(p,a,b,c) +#define IDirect3DDevice8_GetVertexShaderConstant(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstant(p,a,b,c) +#define IDirect3DDevice8_GetVertexShaderDeclaration(p,a,b,c) (p)->lpVtbl->GetVertexShaderDeclaration(p,a,b,c) +#define IDirect3DDevice8_GetVertexShaderFunction(p,a,b,c) (p)->lpVtbl->GetVertexShaderFunction(p,a,b,c) +#define IDirect3DDevice8_SetStreamSource(p,a,b,c) (p)->lpVtbl->SetStreamSource(p,a,b,c) +#define IDirect3DDevice8_GetStreamSource(p,a,b,c) (p)->lpVtbl->GetStreamSource(p,a,b,c) +#define IDirect3DDevice8_SetIndices(p,a,b) (p)->lpVtbl->SetIndices(p,a,b) +#define IDirect3DDevice8_GetIndices(p,a,b) (p)->lpVtbl->GetIndices(p,a,b) +#define IDirect3DDevice8_CreatePixelShader(p,a,b) (p)->lpVtbl->CreatePixelShader(p,a,b) +#define IDirect3DDevice8_SetPixelShader(p,a) (p)->lpVtbl->SetPixelShader(p,a) +#define IDirect3DDevice8_GetPixelShader(p,a) (p)->lpVtbl->GetPixelShader(p,a) +#define IDirect3DDevice8_DeletePixelShader(p,a) (p)->lpVtbl->DeletePixelShader(p,a) +#define IDirect3DDevice8_SetPixelShaderConstant(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstant(p,a,b,c) +#define IDirect3DDevice8_GetPixelShaderConstant(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstant(p,a,b,c) +#define IDirect3DDevice8_GetPixelShaderFunction(p,a,b,c) (p)->lpVtbl->GetPixelShaderFunction(p,a,b,c) +#define IDirect3DDevice8_DrawRectPatch(p,a,b,c) (p)->lpVtbl->DrawRectPatch(p,a,b,c) +#define IDirect3DDevice8_DrawTriPatch(p,a,b,c) (p)->lpVtbl->DrawTriPatch(p,a,b,c) +#define IDirect3DDevice8_DeletePatch(p,a) (p)->lpVtbl->DeletePatch(p,a) +#else +#define IDirect3DDevice8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDevice8_AddRef(p) (p)->AddRef() +#define IDirect3DDevice8_Release(p) (p)->Release() +#define IDirect3DDevice8_TestCooperativeLevel(p) (p)->TestCooperativeLevel() +#define IDirect3DDevice8_GetAvailableTextureMem(p) (p)->GetAvailableTextureMem() +#define IDirect3DDevice8_ResourceManagerDiscardBytes(p,a) (p)->ResourceManagerDiscardBytes(a) +#define IDirect3DDevice8_GetDirect3D(p,a) (p)->GetDirect3D(a) +#define IDirect3DDevice8_GetDeviceCaps(p,a) (p)->GetDeviceCaps(a) +#define IDirect3DDevice8_GetDisplayMode(p,a) (p)->GetDisplayMode(a) +#define IDirect3DDevice8_GetCreationParameters(p,a) (p)->GetCreationParameters(a) +#define IDirect3DDevice8_SetCursorProperties(p,a,b,c) (p)->SetCursorProperties(a,b,c) +#define IDirect3DDevice8_SetCursorPosition(p,a,b,c) (p)->SetCursorPosition(a,b,c) +#define IDirect3DDevice8_ShowCursor(p,a) (p)->ShowCursor(a) +#define IDirect3DDevice8_CreateAdditionalSwapChain(p,a,b) (p)->CreateAdditionalSwapChain(a,b) +#define IDirect3DDevice8_Reset(p,a) (p)->Reset(a) +#define IDirect3DDevice8_Present(p,a,b,c,d) (p)->Present(a,b,c,d) +#define IDirect3DDevice8_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) +#define IDirect3DDevice8_GetRasterStatus(p,a) (p)->GetRasterStatus(a) +#define IDirect3DDevice8_SetGammaRamp(p,a,b) (p)->SetGammaRamp(a,b) +#define IDirect3DDevice8_GetGammaRamp(p,a) (p)->GetGammaRamp(a) +#define IDirect3DDevice8_CreateTexture(p,a,b,c,d,e,f,g) (p)->CreateTexture(a,b,c,d,e,f,g) +#define IDirect3DDevice8_CreateVolumeTexture(p,a,b,c,d,e,f,g,h) (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h) +#define IDirect3DDevice8_CreateCubeTexture(p,a,b,c,d,e,f) (p)->CreateCubeTexture(a,b,c,d,e,f) +#define IDirect3DDevice8_CreateVertexBuffer(p,a,b,c,d,e) (p)->CreateVertexBuffer(a,b,c,d,e) +#define IDirect3DDevice8_CreateIndexBuffer(p,a,b,c,d,e) (p)->CreateIndexBuffer(a,b,c,d,e) +#define IDirect3DDevice8_CreateRenderTarget(p,a,b,c,d,e,f) (p)->CreateRenderTarget(a,b,c,d,e,f) +#define IDirect3DDevice8_CreateDepthStencilSurface(p,a,b,c,d,e) (p)->CreateDepthStencilSurface(a,b,c,d,e) +#define IDirect3DDevice8_CreateImageSurface(p,a,b,c,d) (p)->CreateImageSurface(a,b,c,d) +#define IDirect3DDevice8_CopyRects(p,a,b,c,d,e) (p)->CopyRects(a,b,c,d,e) +#define IDirect3DDevice8_UpdateTexture(p,a,b) (p)->UpdateTexture(a,b) +#define IDirect3DDevice8_GetFrontBuffer(p,a) (p)->GetFrontBuffer(a) +#define IDirect3DDevice8_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) +#define IDirect3DDevice8_GetRenderTarget(p,a) (p)->GetRenderTarget(a) +#define IDirect3DDevice8_GetDepthStencilSurface(p,a) (p)->GetDepthStencilSurface(a) +#define IDirect3DDevice8_BeginScene(p) (p)->BeginScene() +#define IDirect3DDevice8_EndScene(p) (p)->EndScene() +#define IDirect3DDevice8_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) +#define IDirect3DDevice8_SetTransform(p,a,b) (p)->SetTransform(a,b) +#define IDirect3DDevice8_GetTransform(p,a,b) (p)->GetTransform(a,b) +#define IDirect3DDevice8_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) +#define IDirect3DDevice8_SetViewport(p,a) (p)->SetViewport(a) +#define IDirect3DDevice8_GetViewport(p,a) (p)->GetViewport(a) +#define IDirect3DDevice8_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DDevice8_GetMaterial(p,a) (p)->GetMaterial(a) +#define IDirect3DDevice8_SetLight(p,a,b) (p)->SetLight(a,b) +#define IDirect3DDevice8_GetLight(p,a,b) (p)->GetLight(a,b) +#define IDirect3DDevice8_LightEnable(p,a,b) (p)->LightEnable(a,b) +#define IDirect3DDevice8_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) +#define IDirect3DDevice8_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) +#define IDirect3DDevice8_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) +#define IDirect3DDevice8_SetRenderState(p,a,b) (p)->SetRenderState(a,b) +#define IDirect3DDevice8_GetRenderState(p,a,b) (p)->GetRenderState(a,b) +#define IDirect3DDevice8_BeginStateBlock(p) (p)->BeginStateBlock() +#define IDirect3DDevice8_EndStateBlock(p,a) (p)->EndStateBlock(a) +#define IDirect3DDevice8_ApplyStateBlock(p,a) (p)->ApplyStateBlock(a) +#define IDirect3DDevice8_CaptureStateBlock(p,a) (p)->CaptureStateBlock(a) +#define IDirect3DDevice8_DeleteStateBlock(p,a) (p)->DeleteStateBlock(a) +#define IDirect3DDevice8_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) +#define IDirect3DDevice8_SetClipStatus(p,a) (p)->SetClipStatus(a) +#define IDirect3DDevice8_GetClipStatus(p,a) (p)->GetClipStatus(a) +#define IDirect3DDevice8_GetTexture(p,a,b) (p)->GetTexture(a,b) +#define IDirect3DDevice8_SetTexture(p,a,b) (p)->SetTexture(a,b) +#define IDirect3DDevice8_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) +#define IDirect3DDevice8_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) +#define IDirect3DDevice8_ValidateDevice(p,a) (p)->ValidateDevice(a) +#define IDirect3DDevice8_GetInfo(p,a,b,c) (p)->GetInfo(a,b,c) +#define IDirect3DDevice8_SetPaletteEntries(p,a,b) (p)->SetPaletteEntries(a,b) +#define IDirect3DDevice8_GetPaletteEntries(p,a,b) (p)->GetPaletteEntries(a,b) +#define IDirect3DDevice8_SetCurrentTexturePalette(p,a) (p)->SetCurrentTexturePalette(a) +#define IDirect3DDevice8_GetCurrentTexturePalette(p,a) (p)->GetCurrentTexturePalette(a) +#define IDirect3DDevice8_DrawPrimitive(p,a,b,c) (p)->DrawPrimitive(a,b,c) +#define IDirect3DDevice8_DrawIndexedPrimitive(p,a,b,c,d,e) (p)->DrawIndexedPrimitive(a,b,c,d,e) +#define IDirect3DDevice8_DrawPrimitiveUP(p,a,b,c,d) (p)->DrawPrimitiveUP(a,b,c,d) +#define IDirect3DDevice8_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h) +#define IDirect3DDevice8_ProcessVertices(p,a,b,c,d,e) (p)->ProcessVertices(a,b,c,d,e) +#define IDirect3DDevice8_CreateVertexShader(p,a,b,c,d) (p)->CreateVertexShader(a,b,c,d) +#define IDirect3DDevice8_SetVertexShader(p,a) (p)->SetVertexShader(a) +#define IDirect3DDevice8_GetVertexShader(p,a) (p)->GetVertexShader(a) +#define IDirect3DDevice8_DeleteVertexShader(p,a) (p)->DeleteVertexShader(a) +#define IDirect3DDevice8_SetVertexShaderConstant(p,a,b,c) (p)->SetVertexShaderConstant(a,b,c) +#define IDirect3DDevice8_GetVertexShaderConstant(p,a,b,c) (p)->GetVertexShaderConstant(a,b,c) +#define IDirect3DDevice8_GetVertexShaderDeclaration(p,a,b,c) (p)->GetVertexShaderDeclaration(a,b,c) +#define IDirect3DDevice8_GetVertexShaderFunction(p,a,b,c) (p)->GetVertexShaderFunction(a,b,c) +#define IDirect3DDevice8_SetStreamSource(p,a,b,c) (p)->SetStreamSource(a,b,c) +#define IDirect3DDevice8_GetStreamSource(p,a,b,c) (p)->GetStreamSource(a,b,c) +#define IDirect3DDevice8_SetIndices(p,a,b) (p)->SetIndices(a,b) +#define IDirect3DDevice8_GetIndices(p,a,b) (p)->GetIndices(a,b) +#define IDirect3DDevice8_CreatePixelShader(p,a,b) (p)->CreatePixelShader(a,b) +#define IDirect3DDevice8_SetPixelShader(p,a) (p)->SetPixelShader(a) +#define IDirect3DDevice8_GetPixelShader(p,a) (p)->GetPixelShader(a) +#define IDirect3DDevice8_DeletePixelShader(p,a) (p)->DeletePixelShader(a) +#define IDirect3DDevice8_SetPixelShaderConstant(p,a,b,c) (p)->SetPixelShaderConstant(a,b,c) +#define IDirect3DDevice8_GetPixelShaderConstant(p,a,b,c) (p)->GetPixelShaderConstant(a,b,c) +#define IDirect3DDevice8_GetPixelShaderFunction(p,a,b,c) (p)->GetPixelShaderFunction(a,b,c) +#define IDirect3DDevice8_DrawRectPatch(p,a,b,c) (p)->DrawRectPatch(a,b,c) +#define IDirect3DDevice8_DrawTriPatch(p,a,b,c) (p)->DrawTriPatch(a,b,c) +#define IDirect3DDevice8_DeletePatch(p,a) (p)->DeletePatch(a) +#endif + + + +#undef INTERFACE +#define INTERFACE IDirect3DSwapChain8 + +DECLARE_INTERFACE_(IDirect3DSwapChain8, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DSwapChain8 methods ***/ + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT BackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer) PURE; +}; + +typedef struct IDirect3DSwapChain8 *LPDIRECT3DSWAPCHAIN8, *PDIRECT3DSWAPCHAIN8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DSwapChain8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DSwapChain8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DSwapChain8_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DSwapChain8_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) +#define IDirect3DSwapChain8_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) +#else +#define IDirect3DSwapChain8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DSwapChain8_AddRef(p) (p)->AddRef() +#define IDirect3DSwapChain8_Release(p) (p)->Release() +#define IDirect3DSwapChain8_Present(p,a,b,c,d) (p)->Present(a,b,c,d) +#define IDirect3DSwapChain8_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) +#endif + + + +#undef INTERFACE +#define INTERFACE IDirect3DResource8 + +DECLARE_INTERFACE_(IDirect3DResource8, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DResource8 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; +}; + +typedef struct IDirect3DResource8 *LPDIRECT3DRESOURCE8, *PDIRECT3DRESOURCE8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DResource8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DResource8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DResource8_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DResource8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DResource8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DResource8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DResource8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DResource8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DResource8_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DResource8_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DResource8_GetType(p) (p)->lpVtbl->GetType(p) +#else +#define IDirect3DResource8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DResource8_AddRef(p) (p)->AddRef() +#define IDirect3DResource8_Release(p) (p)->Release() +#define IDirect3DResource8_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DResource8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DResource8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DResource8_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DResource8_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DResource8_GetPriority(p) (p)->GetPriority() +#define IDirect3DResource8_PreLoad(p) (p)->PreLoad() +#define IDirect3DResource8_GetType(p) (p)->GetType() +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DBaseTexture8 + +DECLARE_INTERFACE_(IDirect3DBaseTexture8, IDirect3DResource8) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DResource8 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; +}; + +typedef struct IDirect3DBaseTexture8 *LPDIRECT3DBASETEXTURE8, *PDIRECT3DBASETEXTURE8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DBaseTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DBaseTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DBaseTexture8_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DBaseTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DBaseTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DBaseTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DBaseTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DBaseTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DBaseTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DBaseTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DBaseTexture8_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DBaseTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DBaseTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DBaseTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#else +#define IDirect3DBaseTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DBaseTexture8_AddRef(p) (p)->AddRef() +#define IDirect3DBaseTexture8_Release(p) (p)->Release() +#define IDirect3DBaseTexture8_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DBaseTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DBaseTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DBaseTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DBaseTexture8_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DBaseTexture8_GetPriority(p) (p)->GetPriority() +#define IDirect3DBaseTexture8_PreLoad(p) (p)->PreLoad() +#define IDirect3DBaseTexture8_GetType(p) (p)->GetType() +#define IDirect3DBaseTexture8_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DBaseTexture8_GetLOD(p) (p)->GetLOD() +#define IDirect3DBaseTexture8_GetLevelCount(p) (p)->GetLevelCount() +#endif + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DTexture8 + +DECLARE_INTERFACE_(IDirect3DTexture8, IDirect3DBaseTexture8) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DBaseTexture8 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE; + STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level,IDirect3DSurface8** ppSurfaceLevel) PURE; + STDMETHOD(LockRect)(THIS_ UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; + STDMETHOD(UnlockRect)(THIS_ UINT Level) PURE; + STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pDirtyRect) PURE; +}; + +typedef struct IDirect3DTexture8 *LPDIRECT3DTEXTURE8, *PDIRECT3DTEXTURE8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DTexture8_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DTexture8_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#define IDirect3DTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) +#define IDirect3DTexture8_GetSurfaceLevel(p,a,b) (p)->lpVtbl->GetSurfaceLevel(p,a,b) +#define IDirect3DTexture8_LockRect(p,a,b,c,d) (p)->lpVtbl->LockRect(p,a,b,c,d) +#define IDirect3DTexture8_UnlockRect(p,a) (p)->lpVtbl->UnlockRect(p,a) +#define IDirect3DTexture8_AddDirtyRect(p,a) (p)->lpVtbl->AddDirtyRect(p,a) +#else +#define IDirect3DTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DTexture8_AddRef(p) (p)->AddRef() +#define IDirect3DTexture8_Release(p) (p)->Release() +#define IDirect3DTexture8_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DTexture8_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DTexture8_GetPriority(p) (p)->GetPriority() +#define IDirect3DTexture8_PreLoad(p) (p)->PreLoad() +#define IDirect3DTexture8_GetType(p) (p)->GetType() +#define IDirect3DTexture8_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DTexture8_GetLOD(p) (p)->GetLOD() +#define IDirect3DTexture8_GetLevelCount(p) (p)->GetLevelCount() +#define IDirect3DTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) +#define IDirect3DTexture8_GetSurfaceLevel(p,a,b) (p)->GetSurfaceLevel(a,b) +#define IDirect3DTexture8_LockRect(p,a,b,c,d) (p)->LockRect(a,b,c,d) +#define IDirect3DTexture8_UnlockRect(p,a) (p)->UnlockRect(a) +#define IDirect3DTexture8_AddDirtyRect(p,a) (p)->AddDirtyRect(a) +#endif + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DVolumeTexture8 + +DECLARE_INTERFACE_(IDirect3DVolumeTexture8, IDirect3DBaseTexture8) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DBaseTexture8 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DVOLUME_DESC *pDesc) PURE; + STDMETHOD(GetVolumeLevel)(THIS_ UINT Level,IDirect3DVolume8** ppVolumeLevel) PURE; + STDMETHOD(LockBox)(THIS_ UINT Level,D3DLOCKED_BOX* pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) PURE; + STDMETHOD(UnlockBox)(THIS_ UINT Level) PURE; + STDMETHOD(AddDirtyBox)(THIS_ CONST D3DBOX* pDirtyBox) PURE; +}; + +typedef struct IDirect3DVolumeTexture8 *LPDIRECT3DVOLUMETEXTURE8, *PDIRECT3DVOLUMETEXTURE8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVolumeTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVolumeTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVolumeTexture8_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVolumeTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVolumeTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DVolumeTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DVolumeTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DVolumeTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DVolumeTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DVolumeTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DVolumeTexture8_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DVolumeTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DVolumeTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DVolumeTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#define IDirect3DVolumeTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) +#define IDirect3DVolumeTexture8_GetVolumeLevel(p,a,b) (p)->lpVtbl->GetVolumeLevel(p,a,b) +#define IDirect3DVolumeTexture8_LockBox(p,a,b,c,d) (p)->lpVtbl->LockBox(p,a,b,c,d) +#define IDirect3DVolumeTexture8_UnlockBox(p,a) (p)->lpVtbl->UnlockBox(p,a) +#define IDirect3DVolumeTexture8_AddDirtyBox(p,a) (p)->lpVtbl->AddDirtyBox(p,a) +#else +#define IDirect3DVolumeTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVolumeTexture8_AddRef(p) (p)->AddRef() +#define IDirect3DVolumeTexture8_Release(p) (p)->Release() +#define IDirect3DVolumeTexture8_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVolumeTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DVolumeTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DVolumeTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DVolumeTexture8_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DVolumeTexture8_GetPriority(p) (p)->GetPriority() +#define IDirect3DVolumeTexture8_PreLoad(p) (p)->PreLoad() +#define IDirect3DVolumeTexture8_GetType(p) (p)->GetType() +#define IDirect3DVolumeTexture8_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DVolumeTexture8_GetLOD(p) (p)->GetLOD() +#define IDirect3DVolumeTexture8_GetLevelCount(p) (p)->GetLevelCount() +#define IDirect3DVolumeTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) +#define IDirect3DVolumeTexture8_GetVolumeLevel(p,a,b) (p)->GetVolumeLevel(a,b) +#define IDirect3DVolumeTexture8_LockBox(p,a,b,c,d) (p)->LockBox(a,b,c,d) +#define IDirect3DVolumeTexture8_UnlockBox(p,a) (p)->UnlockBox(a) +#define IDirect3DVolumeTexture8_AddDirtyBox(p,a) (p)->AddDirtyBox(a) +#endif + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DCubeTexture8 + +DECLARE_INTERFACE_(IDirect3DCubeTexture8, IDirect3DBaseTexture8) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DBaseTexture8 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE; + STDMETHOD(GetCubeMapSurface)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,IDirect3DSurface8** ppCubeMapSurface) PURE; + STDMETHOD(LockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; + STDMETHOD(UnlockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level) PURE; + STDMETHOD(AddDirtyRect)(THIS_ D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect) PURE; +}; + +typedef struct IDirect3DCubeTexture8 *LPDIRECT3DCUBETEXTURE8, *PDIRECT3DCUBETEXTURE8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DCubeTexture8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DCubeTexture8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DCubeTexture8_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DCubeTexture8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DCubeTexture8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DCubeTexture8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DCubeTexture8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DCubeTexture8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DCubeTexture8_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DCubeTexture8_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DCubeTexture8_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DCubeTexture8_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DCubeTexture8_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DCubeTexture8_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#define IDirect3DCubeTexture8_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) +#define IDirect3DCubeTexture8_GetCubeMapSurface(p,a,b,c) (p)->lpVtbl->GetCubeMapSurface(p,a,b,c) +#define IDirect3DCubeTexture8_LockRect(p,a,b,c,d,e) (p)->lpVtbl->LockRect(p,a,b,c,d,e) +#define IDirect3DCubeTexture8_UnlockRect(p,a,b) (p)->lpVtbl->UnlockRect(p,a,b) +#define IDirect3DCubeTexture8_AddDirtyRect(p,a,b) (p)->lpVtbl->AddDirtyRect(p,a,b) +#else +#define IDirect3DCubeTexture8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DCubeTexture8_AddRef(p) (p)->AddRef() +#define IDirect3DCubeTexture8_Release(p) (p)->Release() +#define IDirect3DCubeTexture8_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DCubeTexture8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DCubeTexture8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DCubeTexture8_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DCubeTexture8_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DCubeTexture8_GetPriority(p) (p)->GetPriority() +#define IDirect3DCubeTexture8_PreLoad(p) (p)->PreLoad() +#define IDirect3DCubeTexture8_GetType(p) (p)->GetType() +#define IDirect3DCubeTexture8_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DCubeTexture8_GetLOD(p) (p)->GetLOD() +#define IDirect3DCubeTexture8_GetLevelCount(p) (p)->GetLevelCount() +#define IDirect3DCubeTexture8_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) +#define IDirect3DCubeTexture8_GetCubeMapSurface(p,a,b,c) (p)->GetCubeMapSurface(a,b,c) +#define IDirect3DCubeTexture8_LockRect(p,a,b,c,d,e) (p)->LockRect(a,b,c,d,e) +#define IDirect3DCubeTexture8_UnlockRect(p,a,b) (p)->UnlockRect(a,b) +#define IDirect3DCubeTexture8_AddDirtyRect(p,a,b) (p)->AddDirtyRect(a,b) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DVertexBuffer8 + +DECLARE_INTERFACE_(IDirect3DVertexBuffer8, IDirect3DResource8) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DResource8 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) PURE; + STDMETHOD(Unlock)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3DVERTEXBUFFER_DESC *pDesc) PURE; +}; + +typedef struct IDirect3DVertexBuffer8 *LPDIRECT3DVERTEXBUFFER8, *PDIRECT3DVERTEXBUFFER8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVertexBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVertexBuffer8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVertexBuffer8_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVertexBuffer8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVertexBuffer8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DVertexBuffer8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DVertexBuffer8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DVertexBuffer8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DVertexBuffer8_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DVertexBuffer8_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DVertexBuffer8_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DVertexBuffer8_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) +#define IDirect3DVertexBuffer8_Unlock(p) (p)->lpVtbl->Unlock(p) +#define IDirect3DVertexBuffer8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#else +#define IDirect3DVertexBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVertexBuffer8_AddRef(p) (p)->AddRef() +#define IDirect3DVertexBuffer8_Release(p) (p)->Release() +#define IDirect3DVertexBuffer8_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVertexBuffer8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DVertexBuffer8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DVertexBuffer8_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DVertexBuffer8_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DVertexBuffer8_GetPriority(p) (p)->GetPriority() +#define IDirect3DVertexBuffer8_PreLoad(p) (p)->PreLoad() +#define IDirect3DVertexBuffer8_GetType(p) (p)->GetType() +#define IDirect3DVertexBuffer8_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) +#define IDirect3DVertexBuffer8_Unlock(p) (p)->Unlock() +#define IDirect3DVertexBuffer8_GetDesc(p,a) (p)->GetDesc(a) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DIndexBuffer8 + +DECLARE_INTERFACE_(IDirect3DIndexBuffer8, IDirect3DResource8) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DResource8 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) PURE; + STDMETHOD(Unlock)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3DINDEXBUFFER_DESC *pDesc) PURE; +}; + +typedef struct IDirect3DIndexBuffer8 *LPDIRECT3DINDEXBUFFER8, *PDIRECT3DINDEXBUFFER8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DIndexBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DIndexBuffer8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DIndexBuffer8_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DIndexBuffer8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DIndexBuffer8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DIndexBuffer8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DIndexBuffer8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DIndexBuffer8_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DIndexBuffer8_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DIndexBuffer8_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DIndexBuffer8_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DIndexBuffer8_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) +#define IDirect3DIndexBuffer8_Unlock(p) (p)->lpVtbl->Unlock(p) +#define IDirect3DIndexBuffer8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#else +#define IDirect3DIndexBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DIndexBuffer8_AddRef(p) (p)->AddRef() +#define IDirect3DIndexBuffer8_Release(p) (p)->Release() +#define IDirect3DIndexBuffer8_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DIndexBuffer8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DIndexBuffer8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DIndexBuffer8_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DIndexBuffer8_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DIndexBuffer8_GetPriority(p) (p)->GetPriority() +#define IDirect3DIndexBuffer8_PreLoad(p) (p)->PreLoad() +#define IDirect3DIndexBuffer8_GetType(p) (p)->GetType() +#define IDirect3DIndexBuffer8_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) +#define IDirect3DIndexBuffer8_Unlock(p) (p)->Unlock() +#define IDirect3DIndexBuffer8_GetDesc(p,a) (p)->GetDesc(a) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DSurface8 + +DECLARE_INTERFACE_(IDirect3DSurface8, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DSurface8 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE; + STDMETHOD(GetDesc)(THIS_ D3DSURFACE_DESC *pDesc) PURE; + STDMETHOD(LockRect)(THIS_ D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; + STDMETHOD(UnlockRect)(THIS) PURE; +}; + +typedef struct IDirect3DSurface8 *LPDIRECT3DSURFACE8, *PDIRECT3DSURFACE8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DSurface8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DSurface8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DSurface8_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DSurface8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DSurface8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DSurface8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DSurface8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DSurface8_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) +#define IDirect3DSurface8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#define IDirect3DSurface8_LockRect(p,a,b,c) (p)->lpVtbl->LockRect(p,a,b,c) +#define IDirect3DSurface8_UnlockRect(p) (p)->lpVtbl->UnlockRect(p) +#else +#define IDirect3DSurface8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DSurface8_AddRef(p) (p)->AddRef() +#define IDirect3DSurface8_Release(p) (p)->Release() +#define IDirect3DSurface8_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DSurface8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DSurface8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DSurface8_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DSurface8_GetContainer(p,a,b) (p)->GetContainer(a,b) +#define IDirect3DSurface8_GetDesc(p,a) (p)->GetDesc(a) +#define IDirect3DSurface8_LockRect(p,a,b,c) (p)->LockRect(a,b,c) +#define IDirect3DSurface8_UnlockRect(p) (p)->UnlockRect() +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DVolume8 + +DECLARE_INTERFACE_(IDirect3DVolume8, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DVolume8 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE; + STDMETHOD(GetDesc)(THIS_ D3DVOLUME_DESC *pDesc) PURE; + STDMETHOD(LockBox)(THIS_ D3DLOCKED_BOX * pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) PURE; + STDMETHOD(UnlockBox)(THIS) PURE; +}; + +typedef struct IDirect3DVolume8 *LPDIRECT3DVOLUME8, *PDIRECT3DVOLUME8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVolume8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVolume8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVolume8_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVolume8_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVolume8_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DVolume8_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DVolume8_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DVolume8_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) +#define IDirect3DVolume8_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#define IDirect3DVolume8_LockBox(p,a,b,c) (p)->lpVtbl->LockBox(p,a,b,c) +#define IDirect3DVolume8_UnlockBox(p) (p)->lpVtbl->UnlockBox(p) +#else +#define IDirect3DVolume8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVolume8_AddRef(p) (p)->AddRef() +#define IDirect3DVolume8_Release(p) (p)->Release() +#define IDirect3DVolume8_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVolume8_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DVolume8_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DVolume8_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DVolume8_GetContainer(p,a,b) (p)->GetContainer(a,b) +#define IDirect3DVolume8_GetDesc(p,a) (p)->GetDesc(a) +#define IDirect3DVolume8_LockBox(p,a,b,c) (p)->LockBox(a,b,c) +#define IDirect3DVolume8_UnlockBox(p) (p)->UnlockBox() +#endif + +/**************************************************************************** + * Flags for SetPrivateData method on all D3D8 interfaces + * + * The passed pointer is an IUnknown ptr. The SizeOfData argument to SetPrivateData + * must be set to sizeof(IUnknown*). Direct3D will call AddRef through this + * pointer and Release when the private data is destroyed. The data will be + * destroyed when another SetPrivateData with the same GUID is set, when + * FreePrivateData is called, or when the D3D8 object is freed. + ****************************************************************************/ +#define D3DSPD_IUNKNOWN 0x00000001L + +/**************************************************************************** + * + * Parameter for IDirect3D8 Enum and GetCaps8 functions to get the info for + * the current mode only. + * + ****************************************************************************/ + +#define D3DCURRENT_DISPLAY_MODE 0x00EFFFFFL + +/**************************************************************************** + * + * Flags for IDirect3D8::CreateDevice's BehaviorFlags + * + ****************************************************************************/ + +#define D3DCREATE_FPU_PRESERVE 0x00000002L +#define D3DCREATE_MULTITHREADED 0x00000004L + +#define D3DCREATE_PUREDEVICE 0x00000010L +#define D3DCREATE_SOFTWARE_VERTEXPROCESSING 0x00000020L +#define D3DCREATE_HARDWARE_VERTEXPROCESSING 0x00000040L +#define D3DCREATE_MIXED_VERTEXPROCESSING 0x00000080L + +#define D3DCREATE_DISABLE_DRIVER_MANAGEMENT 0x00000100L + + +/**************************************************************************** + * + * Parameter for IDirect3D8::CreateDevice's iAdapter + * + ****************************************************************************/ + +#define D3DADAPTER_DEFAULT 0 + +/**************************************************************************** + * + * Flags for IDirect3D8::EnumAdapters + * + ****************************************************************************/ + +#define D3DENUM_NO_WHQL_LEVEL 0x00000002L + +/**************************************************************************** + * + * Maximum number of back-buffers supported in DX8 + * + ****************************************************************************/ + +#define D3DPRESENT_BACK_BUFFERS_MAX 3L + +/**************************************************************************** + * + * Flags for IDirect3DDevice8::SetGammaRamp + * + ****************************************************************************/ + +#define D3DSGR_NO_CALIBRATION 0x00000000L +#define D3DSGR_CALIBRATE 0x00000001L + +/**************************************************************************** + * + * Flags for IDirect3DDevice8::SetCursorPosition + * + ****************************************************************************/ + +#define D3DCURSOR_IMMEDIATE_UPDATE 0x00000001L + +/**************************************************************************** + * + * Flags for DrawPrimitive/DrawIndexedPrimitive + * Also valid for Begin/BeginIndexed + * Also valid for VertexBuffer::CreateVertexBuffer + ****************************************************************************/ + + +/* + * DirectDraw error codes + */ +#define _FACD3D 0x876 +#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) + +/* + * Direct3D Errors + */ +#define D3D_OK S_OK + +#define D3DERR_WRONGTEXTUREFORMAT MAKE_D3DHRESULT(2072) +#define D3DERR_UNSUPPORTEDCOLOROPERATION MAKE_D3DHRESULT(2073) +#define D3DERR_UNSUPPORTEDCOLORARG MAKE_D3DHRESULT(2074) +#define D3DERR_UNSUPPORTEDALPHAOPERATION MAKE_D3DHRESULT(2075) +#define D3DERR_UNSUPPORTEDALPHAARG MAKE_D3DHRESULT(2076) +#define D3DERR_TOOMANYOPERATIONS MAKE_D3DHRESULT(2077) +#define D3DERR_CONFLICTINGTEXTUREFILTER MAKE_D3DHRESULT(2078) +#define D3DERR_UNSUPPORTEDFACTORVALUE MAKE_D3DHRESULT(2079) +#define D3DERR_CONFLICTINGRENDERSTATE MAKE_D3DHRESULT(2081) +#define D3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_D3DHRESULT(2082) +#define D3DERR_CONFLICTINGTEXTUREPALETTE MAKE_D3DHRESULT(2086) +#define D3DERR_DRIVERINTERNALERROR MAKE_D3DHRESULT(2087) + +#define D3DERR_NOTFOUND MAKE_D3DHRESULT(2150) +#define D3DERR_MOREDATA MAKE_D3DHRESULT(2151) +#define D3DERR_DEVICELOST MAKE_D3DHRESULT(2152) +#define D3DERR_DEVICENOTRESET MAKE_D3DHRESULT(2153) +#define D3DERR_NOTAVAILABLE MAKE_D3DHRESULT(2154) +#define D3DERR_OUTOFVIDEOMEMORY MAKE_D3DHRESULT(380) +#define D3DERR_INVALIDDEVICE MAKE_D3DHRESULT(2155) +#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) +#define D3DERR_DRIVERINVALIDCALL MAKE_D3DHRESULT(2157) + +#ifdef __cplusplus +}; +#endif + +#endif /* (DIRECT3D_VERSION >= 0x0800) */ +#endif /* _D3D_H_ */ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3d8caps.h b/Src/Decoder_H264_ALL/D3D/include/d3d8caps.h new file mode 100644 index 0000000..6af8e6c --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3d8caps.h @@ -0,0 +1,364 @@ +/*==========================================================================; + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: d3d8caps.h + * Content: Direct3D capabilities include file + * + ***************************************************************************/ + +#ifndef _D3D8CAPS_H +#define _D3D8CAPS_H + +#ifndef DIRECT3D_VERSION +#define DIRECT3D_VERSION 0x0800 +#endif //DIRECT3D_VERSION + +// include this file content only if compiling for DX8 interfaces +#if(DIRECT3D_VERSION >= 0x0800) + +#if defined(_X86_) || defined(_IA64_) +#pragma pack(4) +#endif + +typedef struct _D3DCAPS8 +{ + /* Device Info */ + D3DDEVTYPE DeviceType; + UINT AdapterOrdinal; + + /* Caps from DX7 Draw */ + DWORD Caps; + DWORD Caps2; + DWORD Caps3; + DWORD PresentationIntervals; + + /* Cursor Caps */ + DWORD CursorCaps; + + /* 3D Device Caps */ + DWORD DevCaps; + + DWORD PrimitiveMiscCaps; + DWORD RasterCaps; + DWORD ZCmpCaps; + DWORD SrcBlendCaps; + DWORD DestBlendCaps; + DWORD AlphaCmpCaps; + DWORD ShadeCaps; + DWORD TextureCaps; + DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture8's + DWORD CubeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DCubeTexture8's + DWORD VolumeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DVolumeTexture8's + DWORD TextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DTexture8's + DWORD VolumeTextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DVolumeTexture8's + + DWORD LineCaps; // D3DLINECAPS + + DWORD MaxTextureWidth, MaxTextureHeight; + DWORD MaxVolumeExtent; + + DWORD MaxTextureRepeat; + DWORD MaxTextureAspectRatio; + DWORD MaxAnisotropy; + float MaxVertexW; + + float GuardBandLeft; + float GuardBandTop; + float GuardBandRight; + float GuardBandBottom; + + float ExtentsAdjust; + DWORD StencilCaps; + + DWORD FVFCaps; + DWORD TextureOpCaps; + DWORD MaxTextureBlendStages; + DWORD MaxSimultaneousTextures; + + DWORD VertexProcessingCaps; + DWORD MaxActiveLights; + DWORD MaxUserClipPlanes; + DWORD MaxVertexBlendMatrices; + DWORD MaxVertexBlendMatrixIndex; + + float MaxPointSize; + + DWORD MaxPrimitiveCount; // max number of primitives per DrawPrimitive call + DWORD MaxVertexIndex; + DWORD MaxStreams; + DWORD MaxStreamStride; // max stride for SetStreamSource + + DWORD VertexShaderVersion; + DWORD MaxVertexShaderConst; // number of vertex shader constant registers + + DWORD PixelShaderVersion; + float MaxPixelShaderValue; // max value of pixel shader arithmetic component + +} D3DCAPS8; + +// +// BIT DEFINES FOR D3DCAPS8 DWORD MEMBERS +// + +// +// Caps +// +#define D3DCAPS_READ_SCANLINE 0x00020000L + +// +// Caps2 +// +#define D3DCAPS2_NO2DDURING3DSCENE 0x00000002L +#define D3DCAPS2_FULLSCREENGAMMA 0x00020000L +#define D3DCAPS2_CANRENDERWINDOWED 0x00080000L +#define D3DCAPS2_CANCALIBRATEGAMMA 0x00100000L +#define D3DCAPS2_RESERVED 0x02000000L +#define D3DCAPS2_CANMANAGERESOURCE 0x10000000L +#define D3DCAPS2_DYNAMICTEXTURES 0x20000000L + +// +// Caps3 +// +#define D3DCAPS3_RESERVED 0x8000001fL + +// Indicates that the device can respect the ALPHABLENDENABLE render state +// when fullscreen while using the FLIP or DISCARD swap effect. +// COPY and COPYVSYNC swap effects work whether or not this flag is set. +#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020L + +// +// PresentationIntervals +// +#define D3DPRESENT_INTERVAL_DEFAULT 0x00000000L +#define D3DPRESENT_INTERVAL_ONE 0x00000001L +#define D3DPRESENT_INTERVAL_TWO 0x00000002L +#define D3DPRESENT_INTERVAL_THREE 0x00000004L +#define D3DPRESENT_INTERVAL_FOUR 0x00000008L +#define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000L + +// +// CursorCaps +// +// Driver supports HW color cursor in at least hi-res modes(height >=400) +#define D3DCURSORCAPS_COLOR 0x00000001L +// Driver supports HW cursor also in low-res modes(height < 400) +#define D3DCURSORCAPS_LOWRES 0x00000002L + +// +// DevCaps +// +#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */ +#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */ +#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */ +#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */ +#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */ +#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */ +#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */ +#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */ +#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */ +#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */ +#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */ +#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/ +#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */ +#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */ +#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */ +#define D3DDEVCAPS_PUREDEVICE 0x00100000L /* Device supports D3DCREATE_PUREDEVICE */ +#define D3DDEVCAPS_QUINTICRTPATCHES 0x00200000L /* Device supports quintic Beziers and BSplines */ +#define D3DDEVCAPS_RTPATCHES 0x00400000L /* Device supports Rect and Tri patches */ +#define D3DDEVCAPS_RTPATCHHANDLEZERO 0x00800000L /* Indicates that RT Patches may be drawn efficiently using handle 0 */ +#define D3DDEVCAPS_NPATCHES 0x01000000L /* Device supports N-Patches */ + +// +// PrimitiveMiscCaps +// +#define D3DPMISCCAPS_MASKZ 0x00000002L +#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L +#define D3DPMISCCAPS_CULLNONE 0x00000010L +#define D3DPMISCCAPS_CULLCW 0x00000020L +#define D3DPMISCCAPS_CULLCCW 0x00000040L +#define D3DPMISCCAPS_COLORWRITEENABLE 0x00000080L +#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x00000100L /* Device correctly clips scaled points to clip planes */ +#define D3DPMISCCAPS_CLIPTLVERTS 0x00000200L /* device will clip post-transformed vertex primitives */ +#define D3DPMISCCAPS_TSSARGTEMP 0x00000400L /* device supports D3DTA_TEMP for temporary register */ +#define D3DPMISCCAPS_BLENDOP 0x00000800L /* device supports D3DRS_BLENDOP */ +#define D3DPMISCCAPS_NULLREFERENCE 0x00001000L /* Reference Device that doesnt render */ + +// +// LineCaps +// +#define D3DLINECAPS_TEXTURE 0x00000001L +#define D3DLINECAPS_ZTEST 0x00000002L +#define D3DLINECAPS_BLEND 0x00000004L +#define D3DLINECAPS_ALPHACMP 0x00000008L +#define D3DLINECAPS_FOG 0x00000010L + +// +// RasterCaps +// +#define D3DPRASTERCAPS_DITHER 0x00000001L +#define D3DPRASTERCAPS_PAT 0x00000008L +#define D3DPRASTERCAPS_ZTEST 0x00000010L +#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L +#define D3DPRASTERCAPS_FOGTABLE 0x00000100L +#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L +#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L +#define D3DPRASTERCAPS_ZBIAS 0x00004000L +#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L +#define D3DPRASTERCAPS_FOGRANGE 0x00010000L +#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L +#define D3DPRASTERCAPS_WBUFFER 0x00040000L +#define D3DPRASTERCAPS_WFOG 0x00100000L +#define D3DPRASTERCAPS_ZFOG 0x00200000L +#define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L /* Device iterates colors perspective correct */ +#define D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE 0x00800000L + +// +// ZCmpCaps, AlphaCmpCaps +// +#define D3DPCMPCAPS_NEVER 0x00000001L +#define D3DPCMPCAPS_LESS 0x00000002L +#define D3DPCMPCAPS_EQUAL 0x00000004L +#define D3DPCMPCAPS_LESSEQUAL 0x00000008L +#define D3DPCMPCAPS_GREATER 0x00000010L +#define D3DPCMPCAPS_NOTEQUAL 0x00000020L +#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L +#define D3DPCMPCAPS_ALWAYS 0x00000080L + +// +// SourceBlendCaps, DestBlendCaps +// +#define D3DPBLENDCAPS_ZERO 0x00000001L +#define D3DPBLENDCAPS_ONE 0x00000002L +#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L +#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L +#define D3DPBLENDCAPS_SRCALPHA 0x00000010L +#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L +#define D3DPBLENDCAPS_DESTALPHA 0x00000040L +#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L +#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L +#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L +#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L +#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L +#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L + +// +// ShadeCaps +// +#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L +#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L +#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L +#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L + +// +// TextureCaps +// +#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L /* Perspective-correct texturing is supported */ +#define D3DPTEXTURECAPS_POW2 0x00000002L /* Power-of-2 texture dimensions are required - applies to non-Cube/Volume textures only. */ +#define D3DPTEXTURECAPS_ALPHA 0x00000004L /* Alpha in texture pixels is supported */ +#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L /* Only square textures are supported */ +#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L /* Texture indices are not scaled by the texture size prior to interpolation */ +#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L /* Device can draw alpha from texture palettes */ +// Device can use non-POW2 textures if: +// 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage +// 2) D3DRS_WRAP(N) is zero for this texture's coordinates +// 3) mip mapping is not enabled (use magnification filter only) +#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L +#define D3DPTEXTURECAPS_PROJECTED 0x00000400L /* Device can do D3DTTFF_PROJECTED */ +#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L /* Device can do cubemap textures */ +#define D3DPTEXTURECAPS_VOLUMEMAP 0x00002000L /* Device can do volume textures */ +#define D3DPTEXTURECAPS_MIPMAP 0x00004000L /* Device can do mipmapped textures */ +#define D3DPTEXTURECAPS_MIPVOLUMEMAP 0x00008000L /* Device can do mipmapped volume textures */ +#define D3DPTEXTURECAPS_MIPCUBEMAP 0x00010000L /* Device can do mipmapped cube maps */ +#define D3DPTEXTURECAPS_CUBEMAP_POW2 0x00020000L /* Device requires that cubemaps be power-of-2 dimension */ +#define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x00040000L /* Device requires that volume maps be power-of-2 dimension */ + +// +// TextureFilterCaps +// +#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L /* Min Filter */ +#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L +#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L +#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L /* Mip Filter */ +#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L +#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L /* Mag Filter */ +#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L +#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L +#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L +#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L + +// +// TextureAddressCaps +// +#define D3DPTADDRESSCAPS_WRAP 0x00000001L +#define D3DPTADDRESSCAPS_MIRROR 0x00000002L +#define D3DPTADDRESSCAPS_CLAMP 0x00000004L +#define D3DPTADDRESSCAPS_BORDER 0x00000008L +#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L +#define D3DPTADDRESSCAPS_MIRRORONCE 0x00000020L + +// +// StencilCaps +// +#define D3DSTENCILCAPS_KEEP 0x00000001L +#define D3DSTENCILCAPS_ZERO 0x00000002L +#define D3DSTENCILCAPS_REPLACE 0x00000004L +#define D3DSTENCILCAPS_INCRSAT 0x00000008L +#define D3DSTENCILCAPS_DECRSAT 0x00000010L +#define D3DSTENCILCAPS_INVERT 0x00000020L +#define D3DSTENCILCAPS_INCR 0x00000040L +#define D3DSTENCILCAPS_DECR 0x00000080L + +// +// TextureOpCaps +// +#define D3DTEXOPCAPS_DISABLE 0x00000001L +#define D3DTEXOPCAPS_SELECTARG1 0x00000002L +#define D3DTEXOPCAPS_SELECTARG2 0x00000004L +#define D3DTEXOPCAPS_MODULATE 0x00000008L +#define D3DTEXOPCAPS_MODULATE2X 0x00000010L +#define D3DTEXOPCAPS_MODULATE4X 0x00000020L +#define D3DTEXOPCAPS_ADD 0x00000040L +#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L +#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L +#define D3DTEXOPCAPS_SUBTRACT 0x00000200L +#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L +#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L +#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L +#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L +#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L +#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L +#define D3DTEXOPCAPS_PREMODULATE 0x00010000L +#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L +#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L +#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L +#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L +#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L +#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L +#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L +#define D3DTEXOPCAPS_MULTIPLYADD 0x01000000L +#define D3DTEXOPCAPS_LERP 0x02000000L + +// +// FVFCaps +// +#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */ +#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */ +#define D3DFVFCAPS_PSIZE 0x00100000L /* Device can receive point size */ + +// +// VertexProcessingCaps +// +#define D3DVTXPCAPS_TEXGEN 0x00000001L /* device can do texgen */ +#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L /* device can do DX7-level colormaterialsource ops */ +#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L /* device can do directional lights */ +#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L /* device can do positional lights (includes point and spot) */ +#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L /* device can do local viewer */ +#define D3DVTXPCAPS_TWEENING 0x00000040L /* device can do vertex tweening */ +#define D3DVTXPCAPS_NO_VSDT_UBYTE4 0x00000080L /* device does not support D3DVSDT_UBYTE4 */ + +#pragma pack() + +#endif /* (DIRECT3D_VERSION >= 0x0800) */ +#endif /* _D3D8CAPS_H_ */ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3d8types.h b/Src/Decoder_H264_ALL/D3D/include/d3d8types.h new file mode 100644 index 0000000..5d622af --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3d8types.h @@ -0,0 +1,1684 @@ +/*==========================================================================; + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: d3d8types.h + * Content: Direct3D capabilities include file + * + ***************************************************************************/ + +#ifndef _D3D8TYPES_H_ +#define _D3D8TYPES_H_ + +#ifndef DIRECT3D_VERSION +#define DIRECT3D_VERSION 0x0800 +#endif //DIRECT3D_VERSION + +// include this file content only if compiling for DX8 interfaces +#if(DIRECT3D_VERSION >= 0x0800) + +#include + +#if _MSC_VER >= 1200 +#pragma warning(push) +#endif +#pragma warning(disable:4201) // anonymous unions warning +#if defined(_X86_) || defined(_IA64_) +#pragma pack(4) +#endif + +// D3DCOLOR is equivalent to D3DFMT_A8R8G8B8 +#ifndef D3DCOLOR_DEFINED +typedef DWORD D3DCOLOR; +#define D3DCOLOR_DEFINED +#endif + +// maps unsigned 8 bits/channel to D3DCOLOR +#define D3DCOLOR_ARGB(a,r,g,b) \ + ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff))) +#define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b) +#define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b) + +// maps floating point channels (0.f to 1.f range) to D3DCOLOR +#define D3DCOLOR_COLORVALUE(r,g,b,a) \ + D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f)) + + +#ifndef D3DVECTOR_DEFINED +typedef struct _D3DVECTOR { + float x; + float y; + float z; +} D3DVECTOR; +#define D3DVECTOR_DEFINED +#endif + +#ifndef D3DCOLORVALUE_DEFINED +typedef struct _D3DCOLORVALUE { + float r; + float g; + float b; + float a; +} D3DCOLORVALUE; +#define D3DCOLORVALUE_DEFINED +#endif + +#ifndef D3DRECT_DEFINED +typedef struct _D3DRECT { + LONG x1; + LONG y1; + LONG x2; + LONG y2; +} D3DRECT; +#define D3DRECT_DEFINED +#endif + +#ifndef D3DMATRIX_DEFINED +typedef struct _D3DMATRIX { + union { + struct { + float _11, _12, _13, _14; + float _21, _22, _23, _24; + float _31, _32, _33, _34; + float _41, _42, _43, _44; + + }; + float m[4][4]; + }; +} D3DMATRIX; +#define D3DMATRIX_DEFINED +#endif + +typedef struct _D3DVIEWPORT8 { + DWORD X; + DWORD Y; /* Viewport Top left */ + DWORD Width; + DWORD Height; /* Viewport Dimensions */ + float MinZ; /* Min/max of clip Volume */ + float MaxZ; +} D3DVIEWPORT8; + +/* + * Values for clip fields. + */ + +// Max number of user clipping planes, supported in D3D. +#define D3DMAXUSERCLIPPLANES 32 + +// These bits could be ORed together to use with D3DRS_CLIPPLANEENABLE +// +#define D3DCLIPPLANE0 (1 << 0) +#define D3DCLIPPLANE1 (1 << 1) +#define D3DCLIPPLANE2 (1 << 2) +#define D3DCLIPPLANE3 (1 << 3) +#define D3DCLIPPLANE4 (1 << 4) +#define D3DCLIPPLANE5 (1 << 5) + +// The following bits are used in the ClipUnion and ClipIntersection +// members of the D3DCLIPSTATUS8 +// + +#define D3DCS_LEFT 0x00000001L +#define D3DCS_RIGHT 0x00000002L +#define D3DCS_TOP 0x00000004L +#define D3DCS_BOTTOM 0x00000008L +#define D3DCS_FRONT 0x00000010L +#define D3DCS_BACK 0x00000020L +#define D3DCS_PLANE0 0x00000040L +#define D3DCS_PLANE1 0x00000080L +#define D3DCS_PLANE2 0x00000100L +#define D3DCS_PLANE3 0x00000200L +#define D3DCS_PLANE4 0x00000400L +#define D3DCS_PLANE5 0x00000800L + +#define D3DCS_ALL (D3DCS_LEFT | \ + D3DCS_RIGHT | \ + D3DCS_TOP | \ + D3DCS_BOTTOM | \ + D3DCS_FRONT | \ + D3DCS_BACK | \ + D3DCS_PLANE0 | \ + D3DCS_PLANE1 | \ + D3DCS_PLANE2 | \ + D3DCS_PLANE3 | \ + D3DCS_PLANE4 | \ + D3DCS_PLANE5) + +typedef struct _D3DCLIPSTATUS8 { + DWORD ClipUnion; + DWORD ClipIntersection; +} D3DCLIPSTATUS8; + +typedef struct _D3DMATERIAL8 { + D3DCOLORVALUE Diffuse; /* Diffuse color RGBA */ + D3DCOLORVALUE Ambient; /* Ambient color RGB */ + D3DCOLORVALUE Specular; /* Specular 'shininess' */ + D3DCOLORVALUE Emissive; /* Emissive color RGB */ + float Power; /* Sharpness if specular highlight */ +} D3DMATERIAL8; + +typedef enum _D3DLIGHTTYPE { + D3DLIGHT_POINT = 1, + D3DLIGHT_SPOT = 2, + D3DLIGHT_DIRECTIONAL = 3, + D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DLIGHTTYPE; + +typedef struct _D3DLIGHT8 { + D3DLIGHTTYPE Type; /* Type of light source */ + D3DCOLORVALUE Diffuse; /* Diffuse color of light */ + D3DCOLORVALUE Specular; /* Specular color of light */ + D3DCOLORVALUE Ambient; /* Ambient color of light */ + D3DVECTOR Position; /* Position in world space */ + D3DVECTOR Direction; /* Direction in world space */ + float Range; /* Cutoff range */ + float Falloff; /* Falloff */ + float Attenuation0; /* Constant attenuation */ + float Attenuation1; /* Linear attenuation */ + float Attenuation2; /* Quadratic attenuation */ + float Theta; /* Inner angle of spotlight cone */ + float Phi; /* Outer angle of spotlight cone */ +} D3DLIGHT8; + +/* + * Options for clearing + */ +#define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */ +#define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */ +#define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */ + +/* + * The following defines the rendering states + */ + +typedef enum _D3DSHADEMODE { + D3DSHADE_FLAT = 1, + D3DSHADE_GOURAUD = 2, + D3DSHADE_PHONG = 3, + D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DSHADEMODE; + +typedef enum _D3DFILLMODE { + D3DFILL_POINT = 1, + D3DFILL_WIREFRAME = 2, + D3DFILL_SOLID = 3, + D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DFILLMODE; + +typedef struct _D3DLINEPATTERN { + WORD wRepeatFactor; + WORD wLinePattern; +} D3DLINEPATTERN; + +typedef enum _D3DBLEND { + D3DBLEND_ZERO = 1, + D3DBLEND_ONE = 2, + D3DBLEND_SRCCOLOR = 3, + D3DBLEND_INVSRCCOLOR = 4, + D3DBLEND_SRCALPHA = 5, + D3DBLEND_INVSRCALPHA = 6, + D3DBLEND_DESTALPHA = 7, + D3DBLEND_INVDESTALPHA = 8, + D3DBLEND_DESTCOLOR = 9, + D3DBLEND_INVDESTCOLOR = 10, + D3DBLEND_SRCALPHASAT = 11, + D3DBLEND_BOTHSRCALPHA = 12, + D3DBLEND_BOTHINVSRCALPHA = 13, + D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DBLEND; + +typedef enum _D3DBLENDOP { + D3DBLENDOP_ADD = 1, + D3DBLENDOP_SUBTRACT = 2, + D3DBLENDOP_REVSUBTRACT = 3, + D3DBLENDOP_MIN = 4, + D3DBLENDOP_MAX = 5, + D3DBLENDOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DBLENDOP; + +typedef enum _D3DTEXTUREADDRESS { + D3DTADDRESS_WRAP = 1, + D3DTADDRESS_MIRROR = 2, + D3DTADDRESS_CLAMP = 3, + D3DTADDRESS_BORDER = 4, + D3DTADDRESS_MIRRORONCE = 5, + D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DTEXTUREADDRESS; + +typedef enum _D3DCULL { + D3DCULL_NONE = 1, + D3DCULL_CW = 2, + D3DCULL_CCW = 3, + D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DCULL; + +typedef enum _D3DCMPFUNC { + D3DCMP_NEVER = 1, + D3DCMP_LESS = 2, + D3DCMP_EQUAL = 3, + D3DCMP_LESSEQUAL = 4, + D3DCMP_GREATER = 5, + D3DCMP_NOTEQUAL = 6, + D3DCMP_GREATEREQUAL = 7, + D3DCMP_ALWAYS = 8, + D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DCMPFUNC; + +typedef enum _D3DSTENCILOP { + D3DSTENCILOP_KEEP = 1, + D3DSTENCILOP_ZERO = 2, + D3DSTENCILOP_REPLACE = 3, + D3DSTENCILOP_INCRSAT = 4, + D3DSTENCILOP_DECRSAT = 5, + D3DSTENCILOP_INVERT = 6, + D3DSTENCILOP_INCR = 7, + D3DSTENCILOP_DECR = 8, + D3DSTENCILOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DSTENCILOP; + +typedef enum _D3DFOGMODE { + D3DFOG_NONE = 0, + D3DFOG_EXP = 1, + D3DFOG_EXP2 = 2, + D3DFOG_LINEAR = 3, + D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DFOGMODE; + +typedef enum _D3DZBUFFERTYPE { + D3DZB_FALSE = 0, + D3DZB_TRUE = 1, // Z buffering + D3DZB_USEW = 2, // W buffering + D3DZB_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DZBUFFERTYPE; + +// Primitives supported by draw-primitive API +typedef enum _D3DPRIMITIVETYPE { + D3DPT_POINTLIST = 1, + D3DPT_LINELIST = 2, + D3DPT_LINESTRIP = 3, + D3DPT_TRIANGLELIST = 4, + D3DPT_TRIANGLESTRIP = 5, + D3DPT_TRIANGLEFAN = 6, + D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DPRIMITIVETYPE; + +typedef enum _D3DTRANSFORMSTATETYPE { + D3DTS_VIEW = 2, + D3DTS_PROJECTION = 3, + D3DTS_TEXTURE0 = 16, + D3DTS_TEXTURE1 = 17, + D3DTS_TEXTURE2 = 18, + D3DTS_TEXTURE3 = 19, + D3DTS_TEXTURE4 = 20, + D3DTS_TEXTURE5 = 21, + D3DTS_TEXTURE6 = 22, + D3DTS_TEXTURE7 = 23, + D3DTS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DTRANSFORMSTATETYPE; + +#define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256) +#define D3DTS_WORLD D3DTS_WORLDMATRIX(0) +#define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1) +#define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2) +#define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3) + +typedef enum _D3DRENDERSTATETYPE { + D3DRS_ZENABLE = 7, /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */ + D3DRS_FILLMODE = 8, /* D3DFILLMODE */ + D3DRS_SHADEMODE = 9, /* D3DSHADEMODE */ + D3DRS_LINEPATTERN = 10, /* D3DLINEPATTERN */ + D3DRS_ZWRITEENABLE = 14, /* TRUE to enable z writes */ + D3DRS_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */ + D3DRS_LASTPIXEL = 16, /* TRUE for last-pixel on lines */ + D3DRS_SRCBLEND = 19, /* D3DBLEND */ + D3DRS_DESTBLEND = 20, /* D3DBLEND */ + D3DRS_CULLMODE = 22, /* D3DCULL */ + D3DRS_ZFUNC = 23, /* D3DCMPFUNC */ + D3DRS_ALPHAREF = 24, /* D3DFIXED */ + D3DRS_ALPHAFUNC = 25, /* D3DCMPFUNC */ + D3DRS_DITHERENABLE = 26, /* TRUE to enable dithering */ + D3DRS_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */ + D3DRS_FOGENABLE = 28, /* TRUE to enable fog blending */ + D3DRS_SPECULARENABLE = 29, /* TRUE to enable specular */ + D3DRS_ZVISIBLE = 30, /* TRUE to enable z checking */ + D3DRS_FOGCOLOR = 34, /* D3DCOLOR */ + D3DRS_FOGTABLEMODE = 35, /* D3DFOGMODE */ + D3DRS_FOGSTART = 36, /* Fog start (for both vertex and pixel fog) */ + D3DRS_FOGEND = 37, /* Fog end */ + D3DRS_FOGDENSITY = 38, /* Fog density */ + D3DRS_EDGEANTIALIAS = 40, /* TRUE to enable edge antialiasing */ + D3DRS_ZBIAS = 47, /* LONG Z bias */ + D3DRS_RANGEFOGENABLE = 48, /* Enables range-based fog */ + D3DRS_STENCILENABLE = 52, /* BOOL enable/disable stenciling */ + D3DRS_STENCILFAIL = 53, /* D3DSTENCILOP to do if stencil test fails */ + D3DRS_STENCILZFAIL = 54, /* D3DSTENCILOP to do if stencil test passes and Z test fails */ + D3DRS_STENCILPASS = 55, /* D3DSTENCILOP to do if both stencil and Z tests pass */ + D3DRS_STENCILFUNC = 56, /* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */ + D3DRS_STENCILREF = 57, /* Reference value used in stencil test */ + D3DRS_STENCILMASK = 58, /* Mask value used in stencil test */ + D3DRS_STENCILWRITEMASK = 59, /* Write mask applied to values written to stencil buffer */ + D3DRS_TEXTUREFACTOR = 60, /* D3DCOLOR used for multi-texture blend */ + D3DRS_WRAP0 = 128, /* wrap for 1st texture coord. set */ + D3DRS_WRAP1 = 129, /* wrap for 2nd texture coord. set */ + D3DRS_WRAP2 = 130, /* wrap for 3rd texture coord. set */ + D3DRS_WRAP3 = 131, /* wrap for 4th texture coord. set */ + D3DRS_WRAP4 = 132, /* wrap for 5th texture coord. set */ + D3DRS_WRAP5 = 133, /* wrap for 6th texture coord. set */ + D3DRS_WRAP6 = 134, /* wrap for 7th texture coord. set */ + D3DRS_WRAP7 = 135, /* wrap for 8th texture coord. set */ + D3DRS_CLIPPING = 136, + D3DRS_LIGHTING = 137, + D3DRS_AMBIENT = 139, + D3DRS_FOGVERTEXMODE = 140, + D3DRS_COLORVERTEX = 141, + D3DRS_LOCALVIEWER = 142, + D3DRS_NORMALIZENORMALS = 143, + D3DRS_DIFFUSEMATERIALSOURCE = 145, + D3DRS_SPECULARMATERIALSOURCE = 146, + D3DRS_AMBIENTMATERIALSOURCE = 147, + D3DRS_EMISSIVEMATERIALSOURCE = 148, + D3DRS_VERTEXBLEND = 151, + D3DRS_CLIPPLANEENABLE = 152, + D3DRS_SOFTWAREVERTEXPROCESSING = 153, + D3DRS_POINTSIZE = 154, /* float point size */ + D3DRS_POINTSIZE_MIN = 155, /* float point size min threshold */ + D3DRS_POINTSPRITEENABLE = 156, /* BOOL point texture coord control */ + D3DRS_POINTSCALEENABLE = 157, /* BOOL point size scale enable */ + D3DRS_POINTSCALE_A = 158, /* float point attenuation A value */ + D3DRS_POINTSCALE_B = 159, /* float point attenuation B value */ + D3DRS_POINTSCALE_C = 160, /* float point attenuation C value */ + D3DRS_MULTISAMPLEANTIALIAS = 161, // BOOL - set to do FSAA with multisample buffer + D3DRS_MULTISAMPLEMASK = 162, // DWORD - per-sample enable/disable + D3DRS_PATCHEDGESTYLE = 163, // Sets whether patch edges will use float style tessellation + D3DRS_PATCHSEGMENTS = 164, // Number of segments per edge when drawing patches + D3DRS_DEBUGMONITORTOKEN = 165, // DEBUG ONLY - token to debug monitor + D3DRS_POINTSIZE_MAX = 166, /* float point size max threshold */ + D3DRS_INDEXEDVERTEXBLENDENABLE = 167, + D3DRS_COLORWRITEENABLE = 168, // per-channel write enable + D3DRS_TWEENFACTOR = 170, // float tween factor + D3DRS_BLENDOP = 171, // D3DBLENDOP setting + D3DRS_POSITIONORDER = 172, // NPatch position interpolation order. D3DORDER_LINEAR or D3DORDER_CUBIC (default) + D3DRS_NORMALORDER = 173, // NPatch normal interpolation order. D3DORDER_LINEAR (default) or D3DORDER_QUADRATIC + + D3DRS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DRENDERSTATETYPE; + +// Values for material source +typedef enum _D3DMATERIALCOLORSOURCE +{ + D3DMCS_MATERIAL = 0, // Color from material is used + D3DMCS_COLOR1 = 1, // Diffuse vertex color is used + D3DMCS_COLOR2 = 2, // Specular vertex color is used + D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum +} D3DMATERIALCOLORSOURCE; + +// Bias to apply to the texture coordinate set to apply a wrap to. +#define D3DRENDERSTATE_WRAPBIAS 128UL + +/* Flags to construct the WRAP render states */ +#define D3DWRAP_U 0x00000001L +#define D3DWRAP_V 0x00000002L +#define D3DWRAP_W 0x00000004L + +/* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */ +#define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U +#define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V +#define D3DWRAPCOORD_2 0x00000004L // same as D3DWRAP_W +#define D3DWRAPCOORD_3 0x00000008L + +/* Flags to construct D3DRS_COLORWRITEENABLE */ +#define D3DCOLORWRITEENABLE_RED (1L<<0) +#define D3DCOLORWRITEENABLE_GREEN (1L<<1) +#define D3DCOLORWRITEENABLE_BLUE (1L<<2) +#define D3DCOLORWRITEENABLE_ALPHA (1L<<3) + +/* + * State enumerants for per-stage texture processing. + */ +typedef enum _D3DTEXTURESTAGESTATETYPE +{ + D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */ + D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */ + D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */ + D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */ + D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */ + D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */ + D3DTSS_BUMPENVMAT00 = 7, /* float (bump mapping matrix) */ + D3DTSS_BUMPENVMAT01 = 8, /* float (bump mapping matrix) */ + D3DTSS_BUMPENVMAT10 = 9, /* float (bump mapping matrix) */ + D3DTSS_BUMPENVMAT11 = 10, /* float (bump mapping matrix) */ + D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */ + D3DTSS_ADDRESSU = 13, /* D3DTEXTUREADDRESS for U coordinate */ + D3DTSS_ADDRESSV = 14, /* D3DTEXTUREADDRESS for V coordinate */ + D3DTSS_BORDERCOLOR = 15, /* D3DCOLOR */ + D3DTSS_MAGFILTER = 16, /* D3DTEXTUREFILTER filter to use for magnification */ + D3DTSS_MINFILTER = 17, /* D3DTEXTUREFILTER filter to use for minification */ + D3DTSS_MIPFILTER = 18, /* D3DTEXTUREFILTER filter to use between mipmaps during minification */ + D3DTSS_MIPMAPLODBIAS = 19, /* float Mipmap LOD bias */ + D3DTSS_MAXMIPLEVEL = 20, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */ + D3DTSS_MAXANISOTROPY = 21, /* DWORD maximum anisotropy */ + D3DTSS_BUMPENVLSCALE = 22, /* float scale for bump map luminance */ + D3DTSS_BUMPENVLOFFSET = 23, /* float offset for bump map luminance */ + D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */ + D3DTSS_ADDRESSW = 25, /* D3DTEXTUREADDRESS for W coordinate */ + D3DTSS_COLORARG0 = 26, /* D3DTA_* third arg for triadic ops */ + D3DTSS_ALPHAARG0 = 27, /* D3DTA_* third arg for triadic ops */ + D3DTSS_RESULTARG = 28, /* D3DTA_* arg for result (CURRENT or TEMP) */ + D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DTEXTURESTAGESTATETYPE; + +// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position +// and normal in the camera space) should be taken as texture coordinates +// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from +// +#define D3DTSS_TCI_PASSTHRU 0x00000000 +#define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000 +#define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000 +#define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000 + +/* + * Enumerations for COLOROP and ALPHAOP texture blending operations set in + * texture processing stage controls in D3DTSS. + */ +typedef enum _D3DTEXTUREOP +{ + // Control + D3DTOP_DISABLE = 1, // disables stage + D3DTOP_SELECTARG1 = 2, // the default + D3DTOP_SELECTARG2 = 3, + + // Modulate + D3DTOP_MODULATE = 4, // multiply args together + D3DTOP_MODULATE2X = 5, // multiply and 1 bit + D3DTOP_MODULATE4X = 6, // multiply and 2 bits + + // Add + D3DTOP_ADD = 7, // add arguments together + D3DTOP_ADDSIGNED = 8, // add with -0.5 bias + D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit + D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation + D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product + // Arg1 + Arg2 - Arg1*Arg2 + // = Arg1 + (1-Arg1)*Arg2 + + // Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha) + D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha + D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha + D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRS_TEXTUREFACTOR + + // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha) + D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha + D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color + + // Specular mapping + D3DTOP_PREMODULATE = 17, // modulate with next texture before use + D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB + // COLOROP only + D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A + // COLOROP only + D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB + // COLOROP only + D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A + // COLOROP only + + // Bump mapping + D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation + D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel + + // This can do either diffuse or specular bump mapping with correct input. + // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B) + // where each component has been scaled and offset to make it signed. + // The result is replicated into all four (including alpha) channels. + // This is a valid COLOROP only. + D3DTOP_DOTPRODUCT3 = 24, + + // Triadic ops + D3DTOP_MULTIPLYADD = 25, // Arg0 + Arg1*Arg2 + D3DTOP_LERP = 26, // (Arg0)*Arg1 + (1-Arg0)*Arg2 + + D3DTOP_FORCE_DWORD = 0x7fffffff, +} D3DTEXTUREOP; + +/* + * Values for COLORARG0,1,2, ALPHAARG0,1,2, and RESULTARG texture blending + * operations set in texture processing stage controls in D3DRENDERSTATE. + */ +#define D3DTA_SELECTMASK 0x0000000f // mask for arg selector +#define D3DTA_DIFFUSE 0x00000000 // select diffuse color (read only) +#define D3DTA_CURRENT 0x00000001 // select stage destination register (read/write) +#define D3DTA_TEXTURE 0x00000002 // select texture color (read only) +#define D3DTA_TFACTOR 0x00000003 // select D3DRS_TEXTUREFACTOR (read only) +#define D3DTA_SPECULAR 0x00000004 // select specular color (read only) +#define D3DTA_TEMP 0x00000005 // select temporary register color (read/write) +#define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x (read modifier) +#define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components (read modifier) + +// +// Values for D3DTSS_***FILTER texture stage states +// +typedef enum _D3DTEXTUREFILTERTYPE +{ + D3DTEXF_NONE = 0, // filtering disabled (valid for mip filter only) + D3DTEXF_POINT = 1, // nearest + D3DTEXF_LINEAR = 2, // linear interpolation + D3DTEXF_ANISOTROPIC = 3, // anisotropic + D3DTEXF_FLATCUBIC = 4, // cubic + D3DTEXF_GAUSSIANCUBIC = 5, // different cubic kernel + D3DTEXF_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum +} D3DTEXTUREFILTERTYPE; + +/* Bits for Flags in ProcessVertices call */ + +#define D3DPV_DONOTCOPYDATA (1 << 0) + +//------------------------------------------------------------------- + +// Flexible vertex format bits +// +#define D3DFVF_RESERVED0 0x001 +#define D3DFVF_POSITION_MASK 0x00E +#define D3DFVF_XYZ 0x002 +#define D3DFVF_XYZRHW 0x004 +#define D3DFVF_XYZB1 0x006 +#define D3DFVF_XYZB2 0x008 +#define D3DFVF_XYZB3 0x00a +#define D3DFVF_XYZB4 0x00c +#define D3DFVF_XYZB5 0x00e + +#define D3DFVF_NORMAL 0x010 +#define D3DFVF_PSIZE 0x020 +#define D3DFVF_DIFFUSE 0x040 +#define D3DFVF_SPECULAR 0x080 + +#define D3DFVF_TEXCOUNT_MASK 0xf00 +#define D3DFVF_TEXCOUNT_SHIFT 8 +#define D3DFVF_TEX0 0x000 +#define D3DFVF_TEX1 0x100 +#define D3DFVF_TEX2 0x200 +#define D3DFVF_TEX3 0x300 +#define D3DFVF_TEX4 0x400 +#define D3DFVF_TEX5 0x500 +#define D3DFVF_TEX6 0x600 +#define D3DFVF_TEX7 0x700 +#define D3DFVF_TEX8 0x800 + +#define D3DFVF_LASTBETA_UBYTE4 0x1000 + +#define D3DFVF_RESERVED2 0xE000 // 4 reserved bits + +//--------------------------------------------------------------------- +// Vertex Shaders +// + +/* + +Vertex Shader Declaration + +The declaration portion of a vertex shader defines the static external +interface of the shader. The information in the declaration includes: + +- Assignments of vertex shader input registers to data streams. These +assignments bind a specific vertex register to a single component within a +vertex stream. A vertex stream element is identified by a byte offset +within the stream and a type. The type specifies the arithmetic data type +plus the dimensionality (1, 2, 3, or 4 values). Stream data which is +less than 4 values are always expanded out to 4 values with zero or more +0.F values and one 1.F value. + +- Assignment of vertex shader input registers to implicit data from the +primitive tessellator. This controls the loading of vertex data which is +not loaded from a stream, but rather is generated during primitive +tessellation prior to the vertex shader. + +- Loading data into the constant memory at the time a shader is set as the +current shader. Each token specifies values for one or more contiguous 4 +DWORD constant registers. This allows the shader to update an arbitrary +subset of the constant memory, overwriting the device state (which +contains the current values of the constant memory). Note that these +values can be subsequently overwritten (between DrawPrimitive calls) +during the time a shader is bound to a device via the +SetVertexShaderConstant method. + + +Declaration arrays are single-dimensional arrays of DWORDs composed of +multiple tokens each of which is one or more DWORDs. The single-DWORD +token value 0xFFFFFFFF is a special token used to indicate the end of the +declaration array. The single DWORD token value 0x00000000 is a NOP token +with is ignored during the declaration parsing. Note that 0x00000000 is a +valid value for DWORDs following the first DWORD for multiple word tokens. + +[31:29] TokenType + 0x0 - NOP (requires all DWORD bits to be zero) + 0x1 - stream selector + 0x2 - stream data definition (map to vertex input memory) + 0x3 - vertex input memory from tessellator + 0x4 - constant memory from shader + 0x5 - extension + 0x6 - reserved + 0x7 - end-of-array (requires all DWORD bits to be 1) + +NOP Token (single DWORD token) + [31:29] 0x0 + [28:00] 0x0 + +Stream Selector (single DWORD token) + [31:29] 0x1 + [28] indicates whether this is a tessellator stream + [27:04] 0x0 + [03:00] stream selector (0..15) + +Stream Data Definition (single DWORD token) + Vertex Input Register Load + [31:29] 0x2 + [28] 0x0 + [27:20] 0x0 + [19:16] type (dimensionality and data type) + [15:04] 0x0 + [03:00] vertex register address (0..15) + Data Skip (no register load) + [31:29] 0x2 + [28] 0x1 + [27:20] 0x0 + [19:16] count of DWORDS to skip over (0..15) + [15:00] 0x0 + Vertex Input Memory from Tessellator Data (single DWORD token) + [31:29] 0x3 + [28] indicates whether data is normals or u/v + [27:24] 0x0 + [23:20] vertex register address (0..15) + [19:16] type (dimensionality) + [15:04] 0x0 + [03:00] vertex register address (0..15) + +Constant Memory from Shader (multiple DWORD token) + [31:29] 0x4 + [28:25] count of 4*DWORD constants to load (0..15) + [24:07] 0x0 + [06:00] constant memory address (0..95) + +Extension Token (single or multiple DWORD token) + [31:29] 0x5 + [28:24] count of additional DWORDs in token (0..31) + [23:00] extension-specific information + +End-of-array token (single DWORD token) + [31:29] 0x7 + [28:00] 0x1fffffff + +The stream selector token must be immediately followed by a contiguous set of stream data definition tokens. This token sequence fully defines that stream, including the set of elements within the stream, the order in which the elements appear, the type of each element, and the vertex register into which to load an element. +Streams are allowed to include data which is not loaded into a vertex register, thus allowing data which is not used for this shader to exist in the vertex stream. This skipped data is defined only by a count of DWORDs to skip over, since the type information is irrelevant. +The token sequence: +Stream Select: stream=0 +Stream Data Definition (Load): type=FLOAT3; register=3 +Stream Data Definition (Load): type=FLOAT3; register=4 +Stream Data Definition (Skip): count=2 +Stream Data Definition (Load): type=FLOAT2; register=7 + +defines stream zero to consist of 4 elements, 3 of which are loaded into registers and the fourth skipped over. Register 3 is loaded with the first three DWORDs in each vertex interpreted as FLOAT data. Register 4 is loaded with the 4th, 5th, and 6th DWORDs interpreted as FLOAT data. The next two DWORDs (7th and 8th) are skipped over and not loaded into any vertex input register. Register 7 is loaded with the 9th and 10th DWORDS interpreted as FLOAT data. +Placing of tokens other than NOPs between the Stream Selector and Stream Data Definition tokens is disallowed. + +*/ + +typedef enum _D3DVSD_TOKENTYPE +{ + D3DVSD_TOKEN_NOP = 0, // NOP or extension + D3DVSD_TOKEN_STREAM, // stream selector + D3DVSD_TOKEN_STREAMDATA, // stream data definition (map to vertex input memory) + D3DVSD_TOKEN_TESSELLATOR, // vertex input memory from tessellator + D3DVSD_TOKEN_CONSTMEM, // constant memory from shader + D3DVSD_TOKEN_EXT, // extension + D3DVSD_TOKEN_END = 7, // end-of-array (requires all DWORD bits to be 1) + D3DVSD_FORCE_DWORD = 0x7fffffff,// force 32-bit size enum +} D3DVSD_TOKENTYPE; + +#define D3DVSD_TOKENTYPESHIFT 29 +#define D3DVSD_TOKENTYPEMASK (7 << D3DVSD_TOKENTYPESHIFT) + +#define D3DVSD_STREAMNUMBERSHIFT 0 +#define D3DVSD_STREAMNUMBERMASK (0xF << D3DVSD_STREAMNUMBERSHIFT) + +#define D3DVSD_DATALOADTYPESHIFT 28 +#define D3DVSD_DATALOADTYPEMASK (0x1 << D3DVSD_DATALOADTYPESHIFT) + +#define D3DVSD_DATATYPESHIFT 16 +#define D3DVSD_DATATYPEMASK (0xF << D3DVSD_DATATYPESHIFT) + +#define D3DVSD_SKIPCOUNTSHIFT 16 +#define D3DVSD_SKIPCOUNTMASK (0xF << D3DVSD_SKIPCOUNTSHIFT) + +#define D3DVSD_VERTEXREGSHIFT 0 +#define D3DVSD_VERTEXREGMASK (0x1F << D3DVSD_VERTEXREGSHIFT) + +#define D3DVSD_VERTEXREGINSHIFT 20 +#define D3DVSD_VERTEXREGINMASK (0xF << D3DVSD_VERTEXREGINSHIFT) + +#define D3DVSD_CONSTCOUNTSHIFT 25 +#define D3DVSD_CONSTCOUNTMASK (0xF << D3DVSD_CONSTCOUNTSHIFT) + +#define D3DVSD_CONSTADDRESSSHIFT 0 +#define D3DVSD_CONSTADDRESSMASK (0x7F << D3DVSD_CONSTADDRESSSHIFT) + +#define D3DVSD_CONSTRSSHIFT 16 +#define D3DVSD_CONSTRSMASK (0x1FFF << D3DVSD_CONSTRSSHIFT) + +#define D3DVSD_EXTCOUNTSHIFT 24 +#define D3DVSD_EXTCOUNTMASK (0x1F << D3DVSD_EXTCOUNTSHIFT) + +#define D3DVSD_EXTINFOSHIFT 0 +#define D3DVSD_EXTINFOMASK (0xFFFFFF << D3DVSD_EXTINFOSHIFT) + +#define D3DVSD_MAKETOKENTYPE(tokenType) ((tokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK) + +// macros for generation of CreateVertexShader Declaration token array + +// Set current stream +// _StreamNumber [0..(MaxStreams-1)] stream to get data from +// +#define D3DVSD_STREAM( _StreamNumber ) \ + (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (_StreamNumber)) + +// Set tessellator stream +// +#define D3DVSD_STREAMTESSSHIFT 28 +#define D3DVSD_STREAMTESSMASK (1 << D3DVSD_STREAMTESSSHIFT) +#define D3DVSD_STREAM_TESS( ) \ + (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK)) + +// bind single vertex register to vertex element from vertex stream +// +// _VertexRegister [0..15] address of the vertex register +// _Type [D3DVSDT_*] dimensionality and arithmetic data type + +#define D3DVSD_REG( _VertexRegister, _Type ) \ + (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | \ + ((_Type) << D3DVSD_DATATYPESHIFT) | (_VertexRegister)) + +// Skip _DWORDCount DWORDs in vertex +// +#define D3DVSD_SKIP( _DWORDCount ) \ + (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | \ + ((_DWORDCount) << D3DVSD_SKIPCOUNTSHIFT)) + +// load data into vertex shader constant memory +// +// _ConstantAddress [0..95] - address of constant array to begin filling data +// _Count [0..15] - number of constant vectors to load (4 DWORDs each) +// followed by 4*_Count DWORDS of data +// +#define D3DVSD_CONST( _ConstantAddress, _Count ) \ + (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | \ + ((_Count) << D3DVSD_CONSTCOUNTSHIFT) | (_ConstantAddress)) + +// enable tessellator generated normals +// +// _VertexRegisterIn [0..15] address of vertex register whose input stream +// will be used in normal computation +// _VertexRegisterOut [0..15] address of vertex register to output the normal to +// +#define D3DVSD_TESSNORMAL( _VertexRegisterIn, _VertexRegisterOut ) \ + (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | \ + ((_VertexRegisterIn) << D3DVSD_VERTEXREGINSHIFT) | \ + ((0x02) << D3DVSD_DATATYPESHIFT) | (_VertexRegisterOut)) + +// enable tessellator generated surface parameters +// +// _VertexRegister [0..15] address of vertex register to output parameters +// +#define D3DVSD_TESSUV( _VertexRegister ) \ + (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | \ + ((0x01) << D3DVSD_DATATYPESHIFT) | (_VertexRegister)) + +// Generates END token +// +#define D3DVSD_END() 0xFFFFFFFF + +// Generates NOP token +#define D3DVSD_NOP() 0x00000000 + +// bit declarations for _Type fields +#define D3DVSDT_FLOAT1 0x00 // 1D float expanded to (value, 0., 0., 1.) +#define D3DVSDT_FLOAT2 0x01 // 2D float expanded to (value, value, 0., 1.) +#define D3DVSDT_FLOAT3 0x02 // 3D float expanded to (value, value, value, 1.) +#define D3DVSDT_FLOAT4 0x03 // 4D float +#define D3DVSDT_D3DCOLOR 0x04 // 4D packed unsigned bytes mapped to 0. to 1. range + // Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A) +#define D3DVSDT_UBYTE4 0x05 // 4D unsigned byte +#define D3DVSDT_SHORT2 0x06 // 2D signed short expanded to (value, value, 0., 1.) +#define D3DVSDT_SHORT4 0x07 // 4D signed short + +// assignments of vertex input registers for fixed function vertex shader +// +#define D3DVSDE_POSITION 0 +#define D3DVSDE_BLENDWEIGHT 1 +#define D3DVSDE_BLENDINDICES 2 +#define D3DVSDE_NORMAL 3 +#define D3DVSDE_PSIZE 4 +#define D3DVSDE_DIFFUSE 5 +#define D3DVSDE_SPECULAR 6 +#define D3DVSDE_TEXCOORD0 7 +#define D3DVSDE_TEXCOORD1 8 +#define D3DVSDE_TEXCOORD2 9 +#define D3DVSDE_TEXCOORD3 10 +#define D3DVSDE_TEXCOORD4 11 +#define D3DVSDE_TEXCOORD5 12 +#define D3DVSDE_TEXCOORD6 13 +#define D3DVSDE_TEXCOORD7 14 +#define D3DVSDE_POSITION2 15 +#define D3DVSDE_NORMAL2 16 + +// Maximum supported number of texture coordinate sets +#define D3DDP_MAXTEXCOORD 8 + + +// +// Instruction Token Bit Definitions +// +#define D3DSI_OPCODE_MASK 0x0000FFFF + +typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE +{ + D3DSIO_NOP = 0, // PS/VS + D3DSIO_MOV , // PS/VS + D3DSIO_ADD , // PS/VS + D3DSIO_SUB , // PS + D3DSIO_MAD , // PS/VS + D3DSIO_MUL , // PS/VS + D3DSIO_RCP , // VS + D3DSIO_RSQ , // VS + D3DSIO_DP3 , // PS/VS + D3DSIO_DP4 , // PS/VS + D3DSIO_MIN , // VS + D3DSIO_MAX , // VS + D3DSIO_SLT , // VS + D3DSIO_SGE , // VS + D3DSIO_EXP , // VS + D3DSIO_LOG , // VS + D3DSIO_LIT , // VS + D3DSIO_DST , // VS + D3DSIO_LRP , // PS + D3DSIO_FRC , // VS + D3DSIO_M4x4 , // VS + D3DSIO_M4x3 , // VS + D3DSIO_M3x4 , // VS + D3DSIO_M3x3 , // VS + D3DSIO_M3x2 , // VS + + D3DSIO_TEXCOORD = 64, // PS + D3DSIO_TEXKILL , // PS + D3DSIO_TEX , // PS + D3DSIO_TEXBEM , // PS + D3DSIO_TEXBEML , // PS + D3DSIO_TEXREG2AR , // PS + D3DSIO_TEXREG2GB , // PS + D3DSIO_TEXM3x2PAD , // PS + D3DSIO_TEXM3x2TEX , // PS + D3DSIO_TEXM3x3PAD , // PS + D3DSIO_TEXM3x3TEX , // PS + D3DSIO_TEXM3x3DIFF , // PS + D3DSIO_TEXM3x3SPEC , // PS + D3DSIO_TEXM3x3VSPEC , // PS + D3DSIO_EXPP , // VS + D3DSIO_LOGP , // VS + D3DSIO_CND , // PS + D3DSIO_DEF , // PS + D3DSIO_TEXREG2RGB , // PS + D3DSIO_TEXDP3TEX , // PS + D3DSIO_TEXM3x2DEPTH , // PS + D3DSIO_TEXDP3 , // PS + D3DSIO_TEXM3x3 , // PS + D3DSIO_TEXDEPTH , // PS + D3DSIO_CMP , // PS + D3DSIO_BEM , // PS + + D3DSIO_PHASE = 0xFFFD, + D3DSIO_COMMENT = 0xFFFE, + D3DSIO_END = 0xFFFF, + + D3DSIO_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum +} D3DSHADER_INSTRUCTION_OPCODE_TYPE; + +// +// Co-Issue Instruction Modifier - if set then this instruction is to be +// issued in parallel with the previous instruction(s) for which this bit +// is not set. +// +#define D3DSI_COISSUE 0x40000000 + +// +// Parameter Token Bit Definitions +// +#define D3DSP_REGNUM_MASK 0x00001FFF + +// destination parameter write mask +#define D3DSP_WRITEMASK_0 0x00010000 // Component 0 (X;Red) +#define D3DSP_WRITEMASK_1 0x00020000 // Component 1 (Y;Green) +#define D3DSP_WRITEMASK_2 0x00040000 // Component 2 (Z;Blue) +#define D3DSP_WRITEMASK_3 0x00080000 // Component 3 (W;Alpha) +#define D3DSP_WRITEMASK_ALL 0x000F0000 // All Components + +// destination parameter modifiers +#define D3DSP_DSTMOD_SHIFT 20 +#define D3DSP_DSTMOD_MASK 0x00F00000 + +typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE +{ + D3DSPDM_NONE = 0<>8)&0xFF) +#define D3DSHADER_VERSION_MINOR(_Version) (((_Version)>>0)&0xFF) + +// destination/source parameter register type +#define D3DSI_COMMENTSIZE_SHIFT 16 +#define D3DSI_COMMENTSIZE_MASK 0x7FFF0000 +#define D3DSHADER_COMMENT(_DWordSize) \ + ((((_DWordSize)<= 1200 +#pragma warning(pop) +#else +#pragma warning(default:4201) +#endif + +#endif /* (DIRECT3D_VERSION >= 0x0800) */ +#endif /* _D3D8TYPES(P)_H_ */ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3d9.h b/Src/Decoder_H264_ALL/D3D/include/d3d9.h new file mode 100644 index 0000000..8d455bb --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3d9.h @@ -0,0 +1,2783 @@ +/*==========================================================================; + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: d3d9.h + * Content: Direct3D include file + * + ****************************************************************************/ + +#ifndef _D3D9_H_ +#define _D3D9_H_ + +#ifndef DIRECT3D_VERSION +#define DIRECT3D_VERSION 0x0900 +#endif //DIRECT3D_VERSION + +// include this file content only if compiling for DX9 interfaces +#if(DIRECT3D_VERSION >= 0x0900) + + +/* This identifier is passed to Direct3DCreate9 in order to ensure that an + * application was built against the correct header files. This number is + * incremented whenever a header (or other) change would require applications + * to be rebuilt. If the version doesn't match, Direct3DCreate9 will fail. + * (The number itself has no meaning.)*/ + +#ifdef D3D_DEBUG_INFO +#define D3D_SDK_VERSION (32 | 0x80000000) +#define D3D9b_SDK_VERSION (31 | 0x80000000) + +#else +#define D3D_SDK_VERSION 32 +#define D3D9b_SDK_VERSION 31 +#endif + + +#include + +#define COM_NO_WINDOWS_H +#include + +#include + +#if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500) + #define HMONITOR_DECLARED + DECLARE_HANDLE(HMONITOR); +#endif + +#define D3DAPI WINAPI + +/* + * Interface IID's + */ +#if defined( _WIN32 ) && !defined( _NO_COM) + +/* IID_IDirect3D9 */ +/* {81BDCBCA-64D4-426d-AE8D-AD0147F4275C} */ +DEFINE_GUID(IID_IDirect3D9, 0x81bdcbca, 0x64d4, 0x426d, 0xae, 0x8d, 0xad, 0x1, 0x47, 0xf4, 0x27, 0x5c); + +/* IID_IDirect3DDevice9 */ +// {D0223B96-BF7A-43fd-92BD-A43B0D82B9EB} */ +DEFINE_GUID(IID_IDirect3DDevice9, 0xd0223b96, 0xbf7a, 0x43fd, 0x92, 0xbd, 0xa4, 0x3b, 0xd, 0x82, 0xb9, 0xeb); + +/* IID_IDirect3DResource9 */ +// {05EEC05D-8F7D-4362-B999-D1BAF357C704} +DEFINE_GUID(IID_IDirect3DResource9, 0x5eec05d, 0x8f7d, 0x4362, 0xb9, 0x99, 0xd1, 0xba, 0xf3, 0x57, 0xc7, 0x4); + +/* IID_IDirect3DBaseTexture9 */ +/* {580CA87E-1D3C-4d54-991D-B7D3E3C298CE} */ +DEFINE_GUID(IID_IDirect3DBaseTexture9, 0x580ca87e, 0x1d3c, 0x4d54, 0x99, 0x1d, 0xb7, 0xd3, 0xe3, 0xc2, 0x98, 0xce); + +/* IID_IDirect3DTexture9 */ +/* {85C31227-3DE5-4f00-9B3A-F11AC38C18B5} */ +DEFINE_GUID(IID_IDirect3DTexture9, 0x85c31227, 0x3de5, 0x4f00, 0x9b, 0x3a, 0xf1, 0x1a, 0xc3, 0x8c, 0x18, 0xb5); + +/* IID_IDirect3DCubeTexture9 */ +/* {FFF32F81-D953-473a-9223-93D652ABA93F} */ +DEFINE_GUID(IID_IDirect3DCubeTexture9, 0xfff32f81, 0xd953, 0x473a, 0x92, 0x23, 0x93, 0xd6, 0x52, 0xab, 0xa9, 0x3f); + +/* IID_IDirect3DVolumeTexture9 */ +/* {2518526C-E789-4111-A7B9-47EF328D13E6} */ +DEFINE_GUID(IID_IDirect3DVolumeTexture9, 0x2518526c, 0xe789, 0x4111, 0xa7, 0xb9, 0x47, 0xef, 0x32, 0x8d, 0x13, 0xe6); + +/* IID_IDirect3DVertexBuffer9 */ +/* {B64BB1B5-FD70-4df6-BF91-19D0A12455E3} */ +DEFINE_GUID(IID_IDirect3DVertexBuffer9, 0xb64bb1b5, 0xfd70, 0x4df6, 0xbf, 0x91, 0x19, 0xd0, 0xa1, 0x24, 0x55, 0xe3); + +/* IID_IDirect3DIndexBuffer9 */ +/* {7C9DD65E-D3F7-4529-ACEE-785830ACDE35} */ +DEFINE_GUID(IID_IDirect3DIndexBuffer9, 0x7c9dd65e, 0xd3f7, 0x4529, 0xac, 0xee, 0x78, 0x58, 0x30, 0xac, 0xde, 0x35); + +/* IID_IDirect3DSurface9 */ +/* {0CFBAF3A-9FF6-429a-99B3-A2796AF8B89B} */ +DEFINE_GUID(IID_IDirect3DSurface9, 0xcfbaf3a, 0x9ff6, 0x429a, 0x99, 0xb3, 0xa2, 0x79, 0x6a, 0xf8, 0xb8, 0x9b); + +/* IID_IDirect3DVolume9 */ +/* {24F416E6-1F67-4aa7-B88E-D33F6F3128A1} */ +DEFINE_GUID(IID_IDirect3DVolume9, 0x24f416e6, 0x1f67, 0x4aa7, 0xb8, 0x8e, 0xd3, 0x3f, 0x6f, 0x31, 0x28, 0xa1); + +/* IID_IDirect3DSwapChain9 */ +/* {794950F2-ADFC-458a-905E-10A10B0B503B} */ +DEFINE_GUID(IID_IDirect3DSwapChain9, 0x794950f2, 0xadfc, 0x458a, 0x90, 0x5e, 0x10, 0xa1, 0xb, 0xb, 0x50, 0x3b); + +/* IID_IDirect3DVertexDeclaration9 */ +/* {DD13C59C-36FA-4098-A8FB-C7ED39DC8546} */ +DEFINE_GUID(IID_IDirect3DVertexDeclaration9, 0xdd13c59c, 0x36fa, 0x4098, 0xa8, 0xfb, 0xc7, 0xed, 0x39, 0xdc, 0x85, 0x46); + +/* IID_IDirect3DVertexShader9 */ +/* {EFC5557E-6265-4613-8A94-43857889EB36} */ +DEFINE_GUID(IID_IDirect3DVertexShader9, 0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36); + +/* IID_IDirect3DPixelShader9 */ +/* {6D3BDBDC-5B02-4415-B852-CE5E8BCCB289} */ +DEFINE_GUID(IID_IDirect3DPixelShader9, 0x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89); + +/* IID_IDirect3DStateBlock9 */ +/* {B07C4FE5-310D-4ba8-A23C-4F0F206F218B} */ +DEFINE_GUID(IID_IDirect3DStateBlock9, 0xb07c4fe5, 0x310d, 0x4ba8, 0xa2, 0x3c, 0x4f, 0xf, 0x20, 0x6f, 0x21, 0x8b); + +/* IID_IDirect3DQuery9 */ +/* {d9771460-a695-4f26-bbd3-27b840b541cc} */ +DEFINE_GUID(IID_IDirect3DQuery9, 0xd9771460, 0xa695, 0x4f26, 0xbb, 0xd3, 0x27, 0xb8, 0x40, 0xb5, 0x41, 0xcc); + + +/* IID_HelperName */ +/* {E4A36723-FDFE-4b22-B146-3C04C07F4CC8} */ +DEFINE_GUID(IID_HelperName, 0xe4a36723, 0xfdfe, 0x4b22, 0xb1, 0x46, 0x3c, 0x4, 0xc0, 0x7f, 0x4c, 0xc8); + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +/* IID_IDirect3D9Ex */ +/* {02177241-69FC-400C-8FF1-93A44DF6861D} */ +DEFINE_GUID(IID_IDirect3D9Ex, 0x02177241, 0x69FC, 0x400C, 0x8F, 0xF1, 0x93, 0xA4, 0x4D, 0xF6, 0x86, 0x1D); + +/* IID_IDirect3DDevice9Ex */ +// {B18B10CE-2649-405a-870F-95F777D4313A} +DEFINE_GUID(IID_IDirect3DDevice9Ex, 0xb18b10ce, 0x2649, 0x405a, 0x87, 0xf, 0x95, 0xf7, 0x77, 0xd4, 0x31, 0x3a); + +/* IID_IDirect3DSwapChain9Ex */ +/* {91886CAF-1C3D-4d2e-A0AB-3E4C7D8D3303} */ +DEFINE_GUID(IID_IDirect3DSwapChain9Ex, 0x91886caf, 0x1c3d, 0x4d2e, 0xa0, 0xab, 0x3e, 0x4c, 0x7d, 0x8d, 0x33, 0x3); + +/* IID_IDirect3D9ExOverlayExtension */ +/* {187aeb13-aaf5-4c59-876d-e059088c0df8} */ +DEFINE_GUID(IID_IDirect3D9ExOverlayExtension, 0x187aeb13, 0xaaf5, 0x4c59, 0x87, 0x6d, 0xe0, 0x59, 0x8, 0x8c, 0xd, 0xf8); + +/* IID_IDirect3DDevice9Video */ +// {26DC4561-A1EE-4ae7-96DA-118A36C0EC95} +DEFINE_GUID(IID_IDirect3DDevice9Video, 0x26dc4561, 0xa1ee, 0x4ae7, 0x96, 0xda, 0x11, 0x8a, 0x36, 0xc0, 0xec, 0x95); + +/* IID_IDirect3D9AuthenticatedChannel */ +// {FF24BEEE-DA21-4beb-98B5-D2F899F98AF9} +DEFINE_GUID(IID_IDirect3DAuthenticatedChannel9, 0xff24beee, 0xda21, 0x4beb, 0x98, 0xb5, 0xd2, 0xf8, 0x99, 0xf9, 0x8a, 0xf9); + +/* IID_IDirect3DCryptoSession9 */ +// {FA0AB799-7A9C-48ca-8C5B-237E71A54434} +DEFINE_GUID(IID_IDirect3DCryptoSession9, 0xfa0ab799, 0x7a9c, 0x48ca, 0x8c, 0x5b, 0x23, 0x7e, 0x71, 0xa5, 0x44, 0x34); + + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + +#endif + +#ifdef __cplusplus + +#ifndef DECLSPEC_UUID +#if _MSC_VER >= 1100 +#define DECLSPEC_UUID(x) __declspec(uuid(x)) +#else +#define DECLSPEC_UUID(x) +#endif +#endif + +interface DECLSPEC_UUID("81BDCBCA-64D4-426d-AE8D-AD0147F4275C") IDirect3D9; +interface DECLSPEC_UUID("D0223B96-BF7A-43fd-92BD-A43B0D82B9EB") IDirect3DDevice9; + +interface DECLSPEC_UUID("B07C4FE5-310D-4ba8-A23C-4F0F206F218B") IDirect3DStateBlock9; +interface DECLSPEC_UUID("05EEC05D-8F7D-4362-B999-D1BAF357C704") IDirect3DResource9; +interface DECLSPEC_UUID("DD13C59C-36FA-4098-A8FB-C7ED39DC8546") IDirect3DVertexDeclaration9; +interface DECLSPEC_UUID("EFC5557E-6265-4613-8A94-43857889EB36") IDirect3DVertexShader9; +interface DECLSPEC_UUID("6D3BDBDC-5B02-4415-B852-CE5E8BCCB289") IDirect3DPixelShader9; +interface DECLSPEC_UUID("580CA87E-1D3C-4d54-991D-B7D3E3C298CE") IDirect3DBaseTexture9; +interface DECLSPEC_UUID("85C31227-3DE5-4f00-9B3A-F11AC38C18B5") IDirect3DTexture9; +interface DECLSPEC_UUID("2518526C-E789-4111-A7B9-47EF328D13E6") IDirect3DVolumeTexture9; +interface DECLSPEC_UUID("FFF32F81-D953-473a-9223-93D652ABA93F") IDirect3DCubeTexture9; + +interface DECLSPEC_UUID("B64BB1B5-FD70-4df6-BF91-19D0A12455E3") IDirect3DVertexBuffer9; +interface DECLSPEC_UUID("7C9DD65E-D3F7-4529-ACEE-785830ACDE35") IDirect3DIndexBuffer9; + +interface DECLSPEC_UUID("0CFBAF3A-9FF6-429a-99B3-A2796AF8B89B") IDirect3DSurface9; +interface DECLSPEC_UUID("24F416E6-1F67-4aa7-B88E-D33F6F3128A1") IDirect3DVolume9; + +interface DECLSPEC_UUID("794950F2-ADFC-458a-905E-10A10B0B503B") IDirect3DSwapChain9; +interface DECLSPEC_UUID("d9771460-a695-4f26-bbd3-27b840b541cc") IDirect3DQuery9; + + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +interface DECLSPEC_UUID("02177241-69FC-400C-8FF1-93A44DF6861D") IDirect3D9Ex; +interface DECLSPEC_UUID("B18B10CE-2649-405a-870F-95F777D4313A") IDirect3DDevice9Ex; +interface DECLSPEC_UUID("91886CAF-1C3D-4d2e-A0AB-3E4C7D8D3303") IDirect3DSwapChain9Ex; +interface DECLSPEC_UUID("187AEB13-AAF5-4C59-876D-E059088C0DF8") IDirect3D9ExOverlayExtension; +interface DECLSPEC_UUID("26DC4561-A1EE-4ae7-96DA-118A36C0EC95") IDirect3DDevice9Video; +interface DECLSPEC_UUID("FF24BEEE-DA21-4beb-98B5-D2F899F98AF9") IDirect3DAuthenticatedChannel9; +interface DECLSPEC_UUID("FA0AB799-7A9C-48CA-8C5B-237E71A54434") IDirect3DCryptoSession9; + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + +#if defined(_COM_SMARTPTR_TYPEDEF) +_COM_SMARTPTR_TYPEDEF(IDirect3D9, __uuidof(IDirect3D9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DDevice9, __uuidof(IDirect3DDevice9)); + +_COM_SMARTPTR_TYPEDEF(IDirect3DStateBlock9, __uuidof(IDirect3DStateBlock9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DResource9, __uuidof(IDirect3DResource9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DVertexDeclaration9, __uuidof(IDirect3DVertexDeclaration9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DVertexShader9, __uuidof(IDirect3DVertexShader9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DPixelShader9, __uuidof(IDirect3DPixelShader9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DBaseTexture9, __uuidof(IDirect3DBaseTexture9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DTexture9, __uuidof(IDirect3DTexture9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DVolumeTexture9, __uuidof(IDirect3DVolumeTexture9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DCubeTexture9, __uuidof(IDirect3DCubeTexture9)); + +_COM_SMARTPTR_TYPEDEF(IDirect3DVertexBuffer9, __uuidof(IDirect3DVertexBuffer9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DIndexBuffer9, __uuidof(IDirect3DIndexBuffer9)); + +_COM_SMARTPTR_TYPEDEF(IDirect3DSurface9, __uuidof(IDirect3DSurface9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DVolume9, __uuidof(IDirect3DVolume9)); + +_COM_SMARTPTR_TYPEDEF(IDirect3DSwapChain9, __uuidof(IDirect3DSwapChain9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DQuery9, __uuidof(IDirect3DQuery9)); + + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +_COM_SMARTPTR_TYPEDEF(IDirect3D9Ex, __uuidof(IDirect3D9Ex)); +_COM_SMARTPTR_TYPEDEF(IDirect3DDevice9Ex, __uuidof(IDirect3DDevice9Ex)); +_COM_SMARTPTR_TYPEDEF(IDirect3DSwapChain9Ex, __uuidof(IDirect3DSwapChain9Ex)); +_COM_SMARTPTR_TYPEDEF(IDirect3D9ExOverlayExtension, __uuidof(IDirect3D9ExOverlayExtension)); +_COM_SMARTPTR_TYPEDEF(IDirect3DDevice9Video, __uuidof(IDirect3DDevice9Video)); +_COM_SMARTPTR_TYPEDEF(IDirect3DAuthenticatedChannel9, __uuidof(IDirect3DAuthenticatedChannel9)); +_COM_SMARTPTR_TYPEDEF(IDirect3DCryptoSession9, __uuidof(IDirect3DCryptoSession9)); + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + +#endif + +#endif + + +typedef interface IDirect3D9 IDirect3D9; +typedef interface IDirect3DDevice9 IDirect3DDevice9; +typedef interface IDirect3DStateBlock9 IDirect3DStateBlock9; +typedef interface IDirect3DVertexDeclaration9 IDirect3DVertexDeclaration9; +typedef interface IDirect3DVertexShader9 IDirect3DVertexShader9; +typedef interface IDirect3DPixelShader9 IDirect3DPixelShader9; +typedef interface IDirect3DResource9 IDirect3DResource9; +typedef interface IDirect3DBaseTexture9 IDirect3DBaseTexture9; +typedef interface IDirect3DTexture9 IDirect3DTexture9; +typedef interface IDirect3DVolumeTexture9 IDirect3DVolumeTexture9; +typedef interface IDirect3DCubeTexture9 IDirect3DCubeTexture9; +typedef interface IDirect3DVertexBuffer9 IDirect3DVertexBuffer9; +typedef interface IDirect3DIndexBuffer9 IDirect3DIndexBuffer9; +typedef interface IDirect3DSurface9 IDirect3DSurface9; +typedef interface IDirect3DVolume9 IDirect3DVolume9; +typedef interface IDirect3DSwapChain9 IDirect3DSwapChain9; +typedef interface IDirect3DQuery9 IDirect3DQuery9; + + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + + +typedef interface IDirect3D9Ex IDirect3D9Ex; +typedef interface IDirect3DDevice9Ex IDirect3DDevice9Ex; +typedef interface IDirect3DSwapChain9Ex IDirect3DSwapChain9Ex; +typedef interface IDirect3D9ExOverlayExtension IDirect3D9ExOverlayExtension; +typedef interface IDirect3DDevice9Video IDirect3DDevice9Video; +typedef interface IDirect3DAuthenticatedChannel9 IDirect3DAuthenticatedChannel9; +typedef interface IDirect3DCryptoSession9 IDirect3DCryptoSession9; + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + +#include "d3d9types.h" +#include "d3d9caps.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * DLL Function for creating a Direct3D9 object. This object supports + * enumeration and allows the creation of Direct3DDevice9 objects. + * Pass the value of the constant D3D_SDK_VERSION to this function, so + * that the run-time can validate that your application was compiled + * against the right headers. + */ + +IDirect3D9 * WINAPI Direct3DCreate9(UINT SDKVersion); + +/* + * Stubs for graphics profiling. + */ + +int WINAPI D3DPERF_BeginEvent( D3DCOLOR col, LPCWSTR wszName ); +int WINAPI D3DPERF_EndEvent( void ); +void WINAPI D3DPERF_SetMarker( D3DCOLOR col, LPCWSTR wszName ); +void WINAPI D3DPERF_SetRegion( D3DCOLOR col, LPCWSTR wszName ); +BOOL WINAPI D3DPERF_QueryRepeatFrame( void ); + +void WINAPI D3DPERF_SetOptions( DWORD dwOptions ); +DWORD WINAPI D3DPERF_GetStatus( void ); + +/* + * Direct3D interfaces + */ + + + + + + +#undef INTERFACE +#define INTERFACE IDirect3D9 + +DECLARE_INTERFACE_(IDirect3D9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3D9 methods ***/ + STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE; + STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE; + STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) PURE; + STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter,D3DFORMAT Format) PURE; + STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter,D3DDEVTYPE DevType,D3DFORMAT AdapterFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) PURE; + STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) PURE; + STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) PURE; + STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) PURE; + STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) PURE; + STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE; + STDMETHOD(CreateDevice)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Version; + #endif +}; + +typedef struct IDirect3D9 *LPDIRECT3D9, *PDIRECT3D9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3D9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3D9_RegisterSoftwareDevice(p,a) (p)->lpVtbl->RegisterSoftwareDevice(p,a) +#define IDirect3D9_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p) +#define IDirect3D9_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c) +#define IDirect3D9_GetAdapterModeCount(p,a,b) (p)->lpVtbl->GetAdapterModeCount(p,a,b) +#define IDirect3D9_EnumAdapterModes(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d) +#define IDirect3D9_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b) +#define IDirect3D9_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e) +#define IDirect3D9_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f) +#define IDirect3D9_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f) +#define IDirect3D9_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e) +#define IDirect3D9_CheckDeviceFormatConversion(p,a,b,c,d) (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d) +#define IDirect3D9_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c) +#define IDirect3D9_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a) +#define IDirect3D9_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f) +#else +#define IDirect3D9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D9_AddRef(p) (p)->AddRef() +#define IDirect3D9_Release(p) (p)->Release() +#define IDirect3D9_RegisterSoftwareDevice(p,a) (p)->RegisterSoftwareDevice(a) +#define IDirect3D9_GetAdapterCount(p) (p)->GetAdapterCount() +#define IDirect3D9_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c) +#define IDirect3D9_GetAdapterModeCount(p,a,b) (p)->GetAdapterModeCount(a,b) +#define IDirect3D9_EnumAdapterModes(p,a,b,c,d) (p)->EnumAdapterModes(a,b,c,d) +#define IDirect3D9_GetAdapterDisplayMode(p,a,b) (p)->GetAdapterDisplayMode(a,b) +#define IDirect3D9_CheckDeviceType(p,a,b,c,d,e) (p)->CheckDeviceType(a,b,c,d,e) +#define IDirect3D9_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->CheckDeviceFormat(a,b,c,d,e,f) +#define IDirect3D9_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->CheckDeviceMultiSampleType(a,b,c,d,e,f) +#define IDirect3D9_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->CheckDepthStencilMatch(a,b,c,d,e) +#define IDirect3D9_CheckDeviceFormatConversion(p,a,b,c,d) (p)->CheckDeviceFormatConversion(a,b,c,d) +#define IDirect3D9_GetDeviceCaps(p,a,b,c) (p)->GetDeviceCaps(a,b,c) +#define IDirect3D9_GetAdapterMonitor(p,a) (p)->GetAdapterMonitor(a) +#define IDirect3D9_CreateDevice(p,a,b,c,d,e,f) (p)->CreateDevice(a,b,c,d,e,f) +#endif + + + + + + + +/* SwapChain */ + + + + + + + + + + + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DDevice9 + +DECLARE_INTERFACE_(IDirect3DDevice9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DDevice9 methods ***/ + STDMETHOD(TestCooperativeLevel)(THIS) PURE; + STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE; + STDMETHOD(EvictManagedResources)(THIS) PURE; + STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps) PURE; + STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE; + STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap) PURE; + STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags) PURE; + STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE; + STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain) PURE; + STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain,IDirect3DSwapChain9** pSwapChain) PURE; + STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE; + STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE; + STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus) PURE; + STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE; + STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp) PURE; + STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain,D3DGAMMARAMP* pRamp) PURE; + STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint) PURE; + STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture) PURE; + STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter) PURE; + STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color) PURE; + STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget) PURE; + STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) PURE; + STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil) PURE; + STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface) PURE; + STDMETHOD(BeginScene)(THIS) PURE; + STDMETHOD(EndScene)(THIS) PURE; + STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) PURE; + STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) PURE; + STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) PURE; + STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*) PURE; + STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial) PURE; + STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial) PURE; + STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT9*) PURE; + STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT9*) PURE; + STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE; + STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE; + STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane) PURE; + STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane) PURE; + STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value) PURE; + STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue) PURE; + STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB) PURE; + STDMETHOD(BeginStateBlock)(THIS) PURE; + STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB) PURE; + STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus) PURE; + STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus) PURE; + STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9** ppTexture) PURE; + STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9* pTexture) PURE; + STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE; + STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE; + STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue) PURE; + STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value) PURE; + STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE; + STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries) PURE; + STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE; + STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE; + STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE; + STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE; + STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE; + STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE; + STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE; + STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE; + STDMETHOD_(float, GetNPatchMode)(THIS) PURE; + STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE; + STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE; + STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; + STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; + STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags) PURE; + STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl) PURE; + STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl) PURE; + STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl) PURE; + STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; + STDMETHOD(GetFVF)(THIS_ DWORD* pFVF) PURE; + STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader) PURE; + STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader) PURE; + STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader) PURE; + STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) PURE; + STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* pOffsetInBytes,UINT* pStride) PURE; + STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT Setting) PURE; + STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT* pSetting) PURE; + STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData) PURE; + STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData) PURE; + STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader) PURE; + STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader) PURE; + STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader) PURE; + STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE; + STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE; + STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; + STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery) PURE; + + #ifdef D3D_DEBUG_INFO + D3DDEVICE_CREATION_PARAMETERS CreationParameters; + D3DPRESENT_PARAMETERS PresentParameters; + D3DDISPLAYMODE DisplayMode; + D3DCAPS9 Caps; + + UINT AvailableTextureMem; + UINT SwapChains; + UINT Textures; + UINT VertexBuffers; + UINT IndexBuffers; + UINT VertexShaders; + UINT PixelShaders; + + D3DVIEWPORT9 Viewport; + D3DMATRIX ProjectionMatrix; + D3DMATRIX ViewMatrix; + D3DMATRIX WorldMatrix; + D3DMATRIX TextureMatrices[8]; + + DWORD FVF; + UINT VertexSize; + DWORD VertexShaderVersion; + DWORD PixelShaderVersion; + BOOL SoftwareVertexProcessing; + + D3DMATERIAL9 Material; + D3DLIGHT9 Lights[16]; + BOOL LightsEnabled[16]; + + D3DGAMMARAMP GammaRamp; + RECT ScissorRect; + BOOL DialogBoxMode; + #endif +}; + +typedef struct IDirect3DDevice9 *LPDIRECT3DDEVICE9, *PDIRECT3DDEVICE9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DDevice9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDevice9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDevice9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DDevice9_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) +#define IDirect3DDevice9_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p) +#define IDirect3DDevice9_EvictManagedResources(p) (p)->lpVtbl->EvictManagedResources(p) +#define IDirect3DDevice9_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) +#define IDirect3DDevice9_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a) +#define IDirect3DDevice9_GetDisplayMode(p,a,b) (p)->lpVtbl->GetDisplayMode(p,a,b) +#define IDirect3DDevice9_GetCreationParameters(p,a) (p)->lpVtbl->GetCreationParameters(p,a) +#define IDirect3DDevice9_SetCursorProperties(p,a,b,c) (p)->lpVtbl->SetCursorProperties(p,a,b,c) +#define IDirect3DDevice9_SetCursorPosition(p,a,b,c) (p)->lpVtbl->SetCursorPosition(p,a,b,c) +#define IDirect3DDevice9_ShowCursor(p,a) (p)->lpVtbl->ShowCursor(p,a) +#define IDirect3DDevice9_CreateAdditionalSwapChain(p,a,b) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b) +#define IDirect3DDevice9_GetSwapChain(p,a,b) (p)->lpVtbl->GetSwapChain(p,a,b) +#define IDirect3DDevice9_GetNumberOfSwapChains(p) (p)->lpVtbl->GetNumberOfSwapChains(p) +#define IDirect3DDevice9_Reset(p,a) (p)->lpVtbl->Reset(p,a) +#define IDirect3DDevice9_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) +#define IDirect3DDevice9_GetBackBuffer(p,a,b,c,d) (p)->lpVtbl->GetBackBuffer(p,a,b,c,d) +#define IDirect3DDevice9_GetRasterStatus(p,a,b) (p)->lpVtbl->GetRasterStatus(p,a,b) +#define IDirect3DDevice9_SetDialogBoxMode(p,a) (p)->lpVtbl->SetDialogBoxMode(p,a) +#define IDirect3DDevice9_SetGammaRamp(p,a,b,c) (p)->lpVtbl->SetGammaRamp(p,a,b,c) +#define IDirect3DDevice9_GetGammaRamp(p,a,b) (p)->lpVtbl->GetGammaRamp(p,a,b) +#define IDirect3DDevice9_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f,g) +#define IDirect3DDevice9_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e,f) +#define IDirect3DDevice9_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e,f) +#define IDirect3DDevice9_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_UpdateSurface(p,a,b,c,d) (p)->lpVtbl->UpdateSurface(p,a,b,c,d) +#define IDirect3DDevice9_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) +#define IDirect3DDevice9_GetRenderTargetData(p,a,b) (p)->lpVtbl->GetRenderTargetData(p,a,b) +#define IDirect3DDevice9_GetFrontBufferData(p,a,b) (p)->lpVtbl->GetFrontBufferData(p,a,b) +#define IDirect3DDevice9_StretchRect(p,a,b,c,d,e) (p)->lpVtbl->StretchRect(p,a,b,c,d,e) +#define IDirect3DDevice9_ColorFill(p,a,b,c) (p)->lpVtbl->ColorFill(p,a,b,c) +#define IDirect3DDevice9_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->lpVtbl->CreateOffscreenPlainSurface(p,a,b,c,d,e,f) +#define IDirect3DDevice9_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) +#define IDirect3DDevice9_GetRenderTarget(p,a,b) (p)->lpVtbl->GetRenderTarget(p,a,b) +#define IDirect3DDevice9_SetDepthStencilSurface(p,a) (p)->lpVtbl->SetDepthStencilSurface(p,a) +#define IDirect3DDevice9_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a) +#define IDirect3DDevice9_BeginScene(p) (p)->lpVtbl->BeginScene(p) +#define IDirect3DDevice9_EndScene(p) (p)->lpVtbl->EndScene(p) +#define IDirect3DDevice9_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) +#define IDirect3DDevice9_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) +#define IDirect3DDevice9_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) +#define IDirect3DDevice9_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) +#define IDirect3DDevice9_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) +#define IDirect3DDevice9_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) +#define IDirect3DDevice9_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DDevice9_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) +#define IDirect3DDevice9_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) +#define IDirect3DDevice9_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) +#define IDirect3DDevice9_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) +#define IDirect3DDevice9_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) +#define IDirect3DDevice9_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) +#define IDirect3DDevice9_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) +#define IDirect3DDevice9_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) +#define IDirect3DDevice9_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) +#define IDirect3DDevice9_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) +#define IDirect3DDevice9_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) +#define IDirect3DDevice9_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) +#define IDirect3DDevice9_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) +#define IDirect3DDevice9_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) +#define IDirect3DDevice9_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) +#define IDirect3DDevice9_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) +#define IDirect3DDevice9_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) +#define IDirect3DDevice9_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) +#define IDirect3DDevice9_GetSamplerState(p,a,b,c) (p)->lpVtbl->GetSamplerState(p,a,b,c) +#define IDirect3DDevice9_SetSamplerState(p,a,b,c) (p)->lpVtbl->SetSamplerState(p,a,b,c) +#define IDirect3DDevice9_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) +#define IDirect3DDevice9_SetPaletteEntries(p,a,b) (p)->lpVtbl->SetPaletteEntries(p,a,b) +#define IDirect3DDevice9_GetPaletteEntries(p,a,b) (p)->lpVtbl->GetPaletteEntries(p,a,b) +#define IDirect3DDevice9_SetCurrentTexturePalette(p,a) (p)->lpVtbl->SetCurrentTexturePalette(p,a) +#define IDirect3DDevice9_GetCurrentTexturePalette(p,a) (p)->lpVtbl->GetCurrentTexturePalette(p,a) +#define IDirect3DDevice9_SetScissorRect(p,a) (p)->lpVtbl->SetScissorRect(p,a) +#define IDirect3DDevice9_GetScissorRect(p,a) (p)->lpVtbl->GetScissorRect(p,a) +#define IDirect3DDevice9_SetSoftwareVertexProcessing(p,a) (p)->lpVtbl->SetSoftwareVertexProcessing(p,a) +#define IDirect3DDevice9_GetSoftwareVertexProcessing(p) (p)->lpVtbl->GetSoftwareVertexProcessing(p) +#define IDirect3DDevice9_SetNPatchMode(p,a) (p)->lpVtbl->SetNPatchMode(p,a) +#define IDirect3DDevice9_GetNPatchMode(p) (p)->lpVtbl->GetNPatchMode(p) +#define IDirect3DDevice9_DrawPrimitive(p,a,b,c) (p)->lpVtbl->DrawPrimitive(p,a,b,c) +#define IDirect3DDevice9_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f) +#define IDirect3DDevice9_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d) +#define IDirect3DDevice9_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_ProcessVertices(p,a,b,c,d,e,f) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f) +#define IDirect3DDevice9_CreateVertexDeclaration(p,a,b) (p)->lpVtbl->CreateVertexDeclaration(p,a,b) +#define IDirect3DDevice9_SetVertexDeclaration(p,a) (p)->lpVtbl->SetVertexDeclaration(p,a) +#define IDirect3DDevice9_GetVertexDeclaration(p,a) (p)->lpVtbl->GetVertexDeclaration(p,a) +#define IDirect3DDevice9_SetFVF(p,a) (p)->lpVtbl->SetFVF(p,a) +#define IDirect3DDevice9_GetFVF(p,a) (p)->lpVtbl->GetFVF(p,a) +#define IDirect3DDevice9_CreateVertexShader(p,a,b) (p)->lpVtbl->CreateVertexShader(p,a,b) +#define IDirect3DDevice9_SetVertexShader(p,a) (p)->lpVtbl->SetVertexShader(p,a) +#define IDirect3DDevice9_GetVertexShader(p,a) (p)->lpVtbl->GetVertexShader(p,a) +#define IDirect3DDevice9_SetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantF(p,a,b,c) +#define IDirect3DDevice9_GetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantF(p,a,b,c) +#define IDirect3DDevice9_SetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantI(p,a,b,c) +#define IDirect3DDevice9_GetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantI(p,a,b,c) +#define IDirect3DDevice9_SetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantB(p,a,b,c) +#define IDirect3DDevice9_GetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantB(p,a,b,c) +#define IDirect3DDevice9_SetStreamSource(p,a,b,c,d) (p)->lpVtbl->SetStreamSource(p,a,b,c,d) +#define IDirect3DDevice9_GetStreamSource(p,a,b,c,d) (p)->lpVtbl->GetStreamSource(p,a,b,c,d) +#define IDirect3DDevice9_SetStreamSourceFreq(p,a,b) (p)->lpVtbl->SetStreamSourceFreq(p,a,b) +#define IDirect3DDevice9_GetStreamSourceFreq(p,a,b) (p)->lpVtbl->GetStreamSourceFreq(p,a,b) +#define IDirect3DDevice9_SetIndices(p,a) (p)->lpVtbl->SetIndices(p,a) +#define IDirect3DDevice9_GetIndices(p,a) (p)->lpVtbl->GetIndices(p,a) +#define IDirect3DDevice9_CreatePixelShader(p,a,b) (p)->lpVtbl->CreatePixelShader(p,a,b) +#define IDirect3DDevice9_SetPixelShader(p,a) (p)->lpVtbl->SetPixelShader(p,a) +#define IDirect3DDevice9_GetPixelShader(p,a) (p)->lpVtbl->GetPixelShader(p,a) +#define IDirect3DDevice9_SetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantF(p,a,b,c) +#define IDirect3DDevice9_GetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantF(p,a,b,c) +#define IDirect3DDevice9_SetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantI(p,a,b,c) +#define IDirect3DDevice9_GetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantI(p,a,b,c) +#define IDirect3DDevice9_SetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantB(p,a,b,c) +#define IDirect3DDevice9_GetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantB(p,a,b,c) +#define IDirect3DDevice9_DrawRectPatch(p,a,b,c) (p)->lpVtbl->DrawRectPatch(p,a,b,c) +#define IDirect3DDevice9_DrawTriPatch(p,a,b,c) (p)->lpVtbl->DrawTriPatch(p,a,b,c) +#define IDirect3DDevice9_DeletePatch(p,a) (p)->lpVtbl->DeletePatch(p,a) +#define IDirect3DDevice9_CreateQuery(p,a,b) (p)->lpVtbl->CreateQuery(p,a,b) +#else +#define IDirect3DDevice9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDevice9_AddRef(p) (p)->AddRef() +#define IDirect3DDevice9_Release(p) (p)->Release() +#define IDirect3DDevice9_TestCooperativeLevel(p) (p)->TestCooperativeLevel() +#define IDirect3DDevice9_GetAvailableTextureMem(p) (p)->GetAvailableTextureMem() +#define IDirect3DDevice9_EvictManagedResources(p) (p)->EvictManagedResources() +#define IDirect3DDevice9_GetDirect3D(p,a) (p)->GetDirect3D(a) +#define IDirect3DDevice9_GetDeviceCaps(p,a) (p)->GetDeviceCaps(a) +#define IDirect3DDevice9_GetDisplayMode(p,a,b) (p)->GetDisplayMode(a,b) +#define IDirect3DDevice9_GetCreationParameters(p,a) (p)->GetCreationParameters(a) +#define IDirect3DDevice9_SetCursorProperties(p,a,b,c) (p)->SetCursorProperties(a,b,c) +#define IDirect3DDevice9_SetCursorPosition(p,a,b,c) (p)->SetCursorPosition(a,b,c) +#define IDirect3DDevice9_ShowCursor(p,a) (p)->ShowCursor(a) +#define IDirect3DDevice9_CreateAdditionalSwapChain(p,a,b) (p)->CreateAdditionalSwapChain(a,b) +#define IDirect3DDevice9_GetSwapChain(p,a,b) (p)->GetSwapChain(a,b) +#define IDirect3DDevice9_GetNumberOfSwapChains(p) (p)->GetNumberOfSwapChains() +#define IDirect3DDevice9_Reset(p,a) (p)->Reset(a) +#define IDirect3DDevice9_Present(p,a,b,c,d) (p)->Present(a,b,c,d) +#define IDirect3DDevice9_GetBackBuffer(p,a,b,c,d) (p)->GetBackBuffer(a,b,c,d) +#define IDirect3DDevice9_GetRasterStatus(p,a,b) (p)->GetRasterStatus(a,b) +#define IDirect3DDevice9_SetDialogBoxMode(p,a) (p)->SetDialogBoxMode(a) +#define IDirect3DDevice9_SetGammaRamp(p,a,b,c) (p)->SetGammaRamp(a,b,c) +#define IDirect3DDevice9_GetGammaRamp(p,a,b) (p)->GetGammaRamp(a,b) +#define IDirect3DDevice9_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->CreateTexture(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->CreateCubeTexture(a,b,c,d,e,f,g) +#define IDirect3DDevice9_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->CreateVertexBuffer(a,b,c,d,e,f) +#define IDirect3DDevice9_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->CreateIndexBuffer(a,b,c,d,e,f) +#define IDirect3DDevice9_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->CreateRenderTarget(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->CreateDepthStencilSurface(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_UpdateSurface(p,a,b,c,d) (p)->UpdateSurface(a,b,c,d) +#define IDirect3DDevice9_UpdateTexture(p,a,b) (p)->UpdateTexture(a,b) +#define IDirect3DDevice9_GetRenderTargetData(p,a,b) (p)->GetRenderTargetData(a,b) +#define IDirect3DDevice9_GetFrontBufferData(p,a,b) (p)->GetFrontBufferData(a,b) +#define IDirect3DDevice9_StretchRect(p,a,b,c,d,e) (p)->StretchRect(a,b,c,d,e) +#define IDirect3DDevice9_ColorFill(p,a,b,c) (p)->ColorFill(a,b,c) +#define IDirect3DDevice9_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->CreateOffscreenPlainSurface(a,b,c,d,e,f) +#define IDirect3DDevice9_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) +#define IDirect3DDevice9_GetRenderTarget(p,a,b) (p)->GetRenderTarget(a,b) +#define IDirect3DDevice9_SetDepthStencilSurface(p,a) (p)->SetDepthStencilSurface(a) +#define IDirect3DDevice9_GetDepthStencilSurface(p,a) (p)->GetDepthStencilSurface(a) +#define IDirect3DDevice9_BeginScene(p) (p)->BeginScene() +#define IDirect3DDevice9_EndScene(p) (p)->EndScene() +#define IDirect3DDevice9_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) +#define IDirect3DDevice9_SetTransform(p,a,b) (p)->SetTransform(a,b) +#define IDirect3DDevice9_GetTransform(p,a,b) (p)->GetTransform(a,b) +#define IDirect3DDevice9_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) +#define IDirect3DDevice9_SetViewport(p,a) (p)->SetViewport(a) +#define IDirect3DDevice9_GetViewport(p,a) (p)->GetViewport(a) +#define IDirect3DDevice9_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DDevice9_GetMaterial(p,a) (p)->GetMaterial(a) +#define IDirect3DDevice9_SetLight(p,a,b) (p)->SetLight(a,b) +#define IDirect3DDevice9_GetLight(p,a,b) (p)->GetLight(a,b) +#define IDirect3DDevice9_LightEnable(p,a,b) (p)->LightEnable(a,b) +#define IDirect3DDevice9_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) +#define IDirect3DDevice9_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) +#define IDirect3DDevice9_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) +#define IDirect3DDevice9_SetRenderState(p,a,b) (p)->SetRenderState(a,b) +#define IDirect3DDevice9_GetRenderState(p,a,b) (p)->GetRenderState(a,b) +#define IDirect3DDevice9_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) +#define IDirect3DDevice9_BeginStateBlock(p) (p)->BeginStateBlock() +#define IDirect3DDevice9_EndStateBlock(p,a) (p)->EndStateBlock(a) +#define IDirect3DDevice9_SetClipStatus(p,a) (p)->SetClipStatus(a) +#define IDirect3DDevice9_GetClipStatus(p,a) (p)->GetClipStatus(a) +#define IDirect3DDevice9_GetTexture(p,a,b) (p)->GetTexture(a,b) +#define IDirect3DDevice9_SetTexture(p,a,b) (p)->SetTexture(a,b) +#define IDirect3DDevice9_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) +#define IDirect3DDevice9_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) +#define IDirect3DDevice9_GetSamplerState(p,a,b,c) (p)->GetSamplerState(a,b,c) +#define IDirect3DDevice9_SetSamplerState(p,a,b,c) (p)->SetSamplerState(a,b,c) +#define IDirect3DDevice9_ValidateDevice(p,a) (p)->ValidateDevice(a) +#define IDirect3DDevice9_SetPaletteEntries(p,a,b) (p)->SetPaletteEntries(a,b) +#define IDirect3DDevice9_GetPaletteEntries(p,a,b) (p)->GetPaletteEntries(a,b) +#define IDirect3DDevice9_SetCurrentTexturePalette(p,a) (p)->SetCurrentTexturePalette(a) +#define IDirect3DDevice9_GetCurrentTexturePalette(p,a) (p)->GetCurrentTexturePalette(a) +#define IDirect3DDevice9_SetScissorRect(p,a) (p)->SetScissorRect(a) +#define IDirect3DDevice9_GetScissorRect(p,a) (p)->GetScissorRect(a) +#define IDirect3DDevice9_SetSoftwareVertexProcessing(p,a) (p)->SetSoftwareVertexProcessing(a) +#define IDirect3DDevice9_GetSoftwareVertexProcessing(p) (p)->GetSoftwareVertexProcessing() +#define IDirect3DDevice9_SetNPatchMode(p,a) (p)->SetNPatchMode(a) +#define IDirect3DDevice9_GetNPatchMode(p) (p)->GetNPatchMode() +#define IDirect3DDevice9_DrawPrimitive(p,a,b,c) (p)->DrawPrimitive(a,b,c) +#define IDirect3DDevice9_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->DrawIndexedPrimitive(a,b,c,d,e,f) +#define IDirect3DDevice9_DrawPrimitiveUP(p,a,b,c,d) (p)->DrawPrimitiveUP(a,b,c,d) +#define IDirect3DDevice9_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9_ProcessVertices(p,a,b,c,d,e,f) (p)->ProcessVertices(a,b,c,d,e,f) +#define IDirect3DDevice9_CreateVertexDeclaration(p,a,b) (p)->CreateVertexDeclaration(a,b) +#define IDirect3DDevice9_SetVertexDeclaration(p,a) (p)->SetVertexDeclaration(a) +#define IDirect3DDevice9_GetVertexDeclaration(p,a) (p)->GetVertexDeclaration(a) +#define IDirect3DDevice9_SetFVF(p,a) (p)->SetFVF(a) +#define IDirect3DDevice9_GetFVF(p,a) (p)->GetFVF(a) +#define IDirect3DDevice9_CreateVertexShader(p,a,b) (p)->CreateVertexShader(a,b) +#define IDirect3DDevice9_SetVertexShader(p,a) (p)->SetVertexShader(a) +#define IDirect3DDevice9_GetVertexShader(p,a) (p)->GetVertexShader(a) +#define IDirect3DDevice9_SetVertexShaderConstantF(p,a,b,c) (p)->SetVertexShaderConstantF(a,b,c) +#define IDirect3DDevice9_GetVertexShaderConstantF(p,a,b,c) (p)->GetVertexShaderConstantF(a,b,c) +#define IDirect3DDevice9_SetVertexShaderConstantI(p,a,b,c) (p)->SetVertexShaderConstantI(a,b,c) +#define IDirect3DDevice9_GetVertexShaderConstantI(p,a,b,c) (p)->GetVertexShaderConstantI(a,b,c) +#define IDirect3DDevice9_SetVertexShaderConstantB(p,a,b,c) (p)->SetVertexShaderConstantB(a,b,c) +#define IDirect3DDevice9_GetVertexShaderConstantB(p,a,b,c) (p)->GetVertexShaderConstantB(a,b,c) +#define IDirect3DDevice9_SetStreamSource(p,a,b,c,d) (p)->SetStreamSource(a,b,c,d) +#define IDirect3DDevice9_GetStreamSource(p,a,b,c,d) (p)->GetStreamSource(a,b,c,d) +#define IDirect3DDevice9_SetStreamSourceFreq(p,a,b) (p)->SetStreamSourceFreq(a,b) +#define IDirect3DDevice9_GetStreamSourceFreq(p,a,b) (p)->GetStreamSourceFreq(a,b) +#define IDirect3DDevice9_SetIndices(p,a) (p)->SetIndices(a) +#define IDirect3DDevice9_GetIndices(p,a) (p)->GetIndices(a) +#define IDirect3DDevice9_CreatePixelShader(p,a,b) (p)->CreatePixelShader(a,b) +#define IDirect3DDevice9_SetPixelShader(p,a) (p)->SetPixelShader(a) +#define IDirect3DDevice9_GetPixelShader(p,a) (p)->GetPixelShader(a) +#define IDirect3DDevice9_SetPixelShaderConstantF(p,a,b,c) (p)->SetPixelShaderConstantF(a,b,c) +#define IDirect3DDevice9_GetPixelShaderConstantF(p,a,b,c) (p)->GetPixelShaderConstantF(a,b,c) +#define IDirect3DDevice9_SetPixelShaderConstantI(p,a,b,c) (p)->SetPixelShaderConstantI(a,b,c) +#define IDirect3DDevice9_GetPixelShaderConstantI(p,a,b,c) (p)->GetPixelShaderConstantI(a,b,c) +#define IDirect3DDevice9_SetPixelShaderConstantB(p,a,b,c) (p)->SetPixelShaderConstantB(a,b,c) +#define IDirect3DDevice9_GetPixelShaderConstantB(p,a,b,c) (p)->GetPixelShaderConstantB(a,b,c) +#define IDirect3DDevice9_DrawRectPatch(p,a,b,c) (p)->DrawRectPatch(a,b,c) +#define IDirect3DDevice9_DrawTriPatch(p,a,b,c) (p)->DrawTriPatch(a,b,c) +#define IDirect3DDevice9_DeletePatch(p,a) (p)->DeletePatch(a) +#define IDirect3DDevice9_CreateQuery(p,a,b) (p)->CreateQuery(a,b) +#endif + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DStateBlock9 + +DECLARE_INTERFACE_(IDirect3DStateBlock9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DStateBlock9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(Capture)(THIS) PURE; + STDMETHOD(Apply)(THIS) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DStateBlock9 *LPDIRECT3DSTATEBLOCK9, *PDIRECT3DSTATEBLOCK9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DStateBlock9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DStateBlock9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DStateBlock9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DStateBlock9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DStateBlock9_Capture(p) (p)->lpVtbl->Capture(p) +#define IDirect3DStateBlock9_Apply(p) (p)->lpVtbl->Apply(p) +#else +#define IDirect3DStateBlock9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DStateBlock9_AddRef(p) (p)->AddRef() +#define IDirect3DStateBlock9_Release(p) (p)->Release() +#define IDirect3DStateBlock9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DStateBlock9_Capture(p) (p)->Capture() +#define IDirect3DStateBlock9_Apply(p) (p)->Apply() +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DSwapChain9 + +DECLARE_INTERFACE_(IDirect3DSwapChain9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DSwapChain9 methods ***/ + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags) PURE; + STDMETHOD(GetFrontBufferData)(THIS_ IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE; + STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE; + STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; + + #ifdef D3D_DEBUG_INFO + D3DPRESENT_PARAMETERS PresentParameters; + D3DDISPLAYMODE DisplayMode; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DSwapChain9 *LPDIRECT3DSWAPCHAIN9, *PDIRECT3DSWAPCHAIN9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DSwapChain9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DSwapChain9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DSwapChain9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DSwapChain9_Present(p,a,b,c,d,e) (p)->lpVtbl->Present(p,a,b,c,d,e) +#define IDirect3DSwapChain9_GetFrontBufferData(p,a) (p)->lpVtbl->GetFrontBufferData(p,a) +#define IDirect3DSwapChain9_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) +#define IDirect3DSwapChain9_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) +#define IDirect3DSwapChain9_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) +#define IDirect3DSwapChain9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DSwapChain9_GetPresentParameters(p,a) (p)->lpVtbl->GetPresentParameters(p,a) +#else +#define IDirect3DSwapChain9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DSwapChain9_AddRef(p) (p)->AddRef() +#define IDirect3DSwapChain9_Release(p) (p)->Release() +#define IDirect3DSwapChain9_Present(p,a,b,c,d,e) (p)->Present(a,b,c,d,e) +#define IDirect3DSwapChain9_GetFrontBufferData(p,a) (p)->GetFrontBufferData(a) +#define IDirect3DSwapChain9_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) +#define IDirect3DSwapChain9_GetRasterStatus(p,a) (p)->GetRasterStatus(a) +#define IDirect3DSwapChain9_GetDisplayMode(p,a) (p)->GetDisplayMode(a) +#define IDirect3DSwapChain9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DSwapChain9_GetPresentParameters(p,a) (p)->GetPresentParameters(a) +#endif + + + +#undef INTERFACE +#define INTERFACE IDirect3DResource9 + +DECLARE_INTERFACE_(IDirect3DResource9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; +}; + +typedef struct IDirect3DResource9 *LPDIRECT3DRESOURCE9, *PDIRECT3DRESOURCE9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DResource9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DResource9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DResource9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DResource9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DResource9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DResource9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DResource9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DResource9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DResource9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DResource9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DResource9_GetType(p) (p)->lpVtbl->GetType(p) +#else +#define IDirect3DResource9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DResource9_AddRef(p) (p)->AddRef() +#define IDirect3DResource9_Release(p) (p)->Release() +#define IDirect3DResource9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DResource9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DResource9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DResource9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DResource9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DResource9_GetPriority(p) (p)->GetPriority() +#define IDirect3DResource9_PreLoad(p) (p)->PreLoad() +#define IDirect3DResource9_GetType(p) (p)->GetType() +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DVertexDeclaration9 + +DECLARE_INTERFACE_(IDirect3DVertexDeclaration9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DVertexDeclaration9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9* pElement,UINT* pNumElements) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DVertexDeclaration9 *LPDIRECT3DVERTEXDECLARATION9, *PDIRECT3DVERTEXDECLARATION9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVertexDeclaration9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVertexDeclaration9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVertexDeclaration9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVertexDeclaration9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVertexDeclaration9_GetDeclaration(p,a,b) (p)->lpVtbl->GetDeclaration(p,a,b) +#else +#define IDirect3DVertexDeclaration9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVertexDeclaration9_AddRef(p) (p)->AddRef() +#define IDirect3DVertexDeclaration9_Release(p) (p)->Release() +#define IDirect3DVertexDeclaration9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVertexDeclaration9_GetDeclaration(p,a,b) (p)->GetDeclaration(a,b) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DVertexShader9 + +DECLARE_INTERFACE_(IDirect3DVertexShader9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DVertexShader9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetFunction)(THIS_ void*,UINT* pSizeOfData) PURE; + + #ifdef D3D_DEBUG_INFO + DWORD Version; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DVertexShader9 *LPDIRECT3DVERTEXSHADER9, *PDIRECT3DVERTEXSHADER9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVertexShader9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVertexShader9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVertexShader9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVertexShader9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVertexShader9_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b) +#else +#define IDirect3DVertexShader9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVertexShader9_AddRef(p) (p)->AddRef() +#define IDirect3DVertexShader9_Release(p) (p)->Release() +#define IDirect3DVertexShader9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVertexShader9_GetFunction(p,a,b) (p)->GetFunction(a,b) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DPixelShader9 + +DECLARE_INTERFACE_(IDirect3DPixelShader9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DPixelShader9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetFunction)(THIS_ void*,UINT* pSizeOfData) PURE; + + #ifdef D3D_DEBUG_INFO + DWORD Version; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DPixelShader9 *LPDIRECT3DPIXELSHADER9, *PDIRECT3DPIXELSHADER9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DPixelShader9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DPixelShader9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DPixelShader9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DPixelShader9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DPixelShader9_GetFunction(p,a,b) (p)->lpVtbl->GetFunction(p,a,b) +#else +#define IDirect3DPixelShader9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DPixelShader9_AddRef(p) (p)->AddRef() +#define IDirect3DPixelShader9_Release(p) (p)->Release() +#define IDirect3DPixelShader9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DPixelShader9_GetFunction(p,a,b) (p)->GetFunction(a,b) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DBaseTexture9 + +DECLARE_INTERFACE_(IDirect3DBaseTexture9, IDirect3DResource9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; +}; + +typedef struct IDirect3DBaseTexture9 *LPDIRECT3DBASETEXTURE9, *PDIRECT3DBASETEXTURE9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DBaseTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DBaseTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DBaseTexture9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DBaseTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DBaseTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DBaseTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DBaseTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DBaseTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DBaseTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DBaseTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DBaseTexture9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DBaseTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DBaseTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DBaseTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#define IDirect3DBaseTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) +#define IDirect3DBaseTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) +#define IDirect3DBaseTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) +#else +#define IDirect3DBaseTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DBaseTexture9_AddRef(p) (p)->AddRef() +#define IDirect3DBaseTexture9_Release(p) (p)->Release() +#define IDirect3DBaseTexture9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DBaseTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DBaseTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DBaseTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DBaseTexture9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DBaseTexture9_GetPriority(p) (p)->GetPriority() +#define IDirect3DBaseTexture9_PreLoad(p) (p)->PreLoad() +#define IDirect3DBaseTexture9_GetType(p) (p)->GetType() +#define IDirect3DBaseTexture9_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DBaseTexture9_GetLOD(p) (p)->GetLOD() +#define IDirect3DBaseTexture9_GetLevelCount(p) (p)->GetLevelCount() +#define IDirect3DBaseTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) +#define IDirect3DBaseTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() +#define IDirect3DBaseTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() +#endif + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DTexture9 + +DECLARE_INTERFACE_(IDirect3DTexture9, IDirect3DBaseTexture9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DBaseTexture9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; + STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE; + STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level,IDirect3DSurface9** ppSurfaceLevel) PURE; + STDMETHOD(LockRect)(THIS_ UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; + STDMETHOD(UnlockRect)(THIS_ UINT Level) PURE; + STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pDirtyRect) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Name; + UINT Width; + UINT Height; + UINT Levels; + DWORD Usage; + D3DFORMAT Format; + D3DPOOL Pool; + DWORD Priority; + DWORD LOD; + D3DTEXTUREFILTERTYPE FilterType; + UINT LockCount; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DTexture9 *LPDIRECT3DTEXTURE9, *PDIRECT3DTEXTURE9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DTexture9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DTexture9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#define IDirect3DTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) +#define IDirect3DTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) +#define IDirect3DTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) +#define IDirect3DTexture9_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) +#define IDirect3DTexture9_GetSurfaceLevel(p,a,b) (p)->lpVtbl->GetSurfaceLevel(p,a,b) +#define IDirect3DTexture9_LockRect(p,a,b,c,d) (p)->lpVtbl->LockRect(p,a,b,c,d) +#define IDirect3DTexture9_UnlockRect(p,a) (p)->lpVtbl->UnlockRect(p,a) +#define IDirect3DTexture9_AddDirtyRect(p,a) (p)->lpVtbl->AddDirtyRect(p,a) +#else +#define IDirect3DTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DTexture9_AddRef(p) (p)->AddRef() +#define IDirect3DTexture9_Release(p) (p)->Release() +#define IDirect3DTexture9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DTexture9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DTexture9_GetPriority(p) (p)->GetPriority() +#define IDirect3DTexture9_PreLoad(p) (p)->PreLoad() +#define IDirect3DTexture9_GetType(p) (p)->GetType() +#define IDirect3DTexture9_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DTexture9_GetLOD(p) (p)->GetLOD() +#define IDirect3DTexture9_GetLevelCount(p) (p)->GetLevelCount() +#define IDirect3DTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) +#define IDirect3DTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() +#define IDirect3DTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() +#define IDirect3DTexture9_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) +#define IDirect3DTexture9_GetSurfaceLevel(p,a,b) (p)->GetSurfaceLevel(a,b) +#define IDirect3DTexture9_LockRect(p,a,b,c,d) (p)->LockRect(a,b,c,d) +#define IDirect3DTexture9_UnlockRect(p,a) (p)->UnlockRect(a) +#define IDirect3DTexture9_AddDirtyRect(p,a) (p)->AddDirtyRect(a) +#endif + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DVolumeTexture9 + +DECLARE_INTERFACE_(IDirect3DVolumeTexture9, IDirect3DBaseTexture9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DBaseTexture9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; + STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DVOLUME_DESC *pDesc) PURE; + STDMETHOD(GetVolumeLevel)(THIS_ UINT Level,IDirect3DVolume9** ppVolumeLevel) PURE; + STDMETHOD(LockBox)(THIS_ UINT Level,D3DLOCKED_BOX* pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) PURE; + STDMETHOD(UnlockBox)(THIS_ UINT Level) PURE; + STDMETHOD(AddDirtyBox)(THIS_ CONST D3DBOX* pDirtyBox) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Name; + UINT Width; + UINT Height; + UINT Depth; + UINT Levels; + DWORD Usage; + D3DFORMAT Format; + D3DPOOL Pool; + DWORD Priority; + DWORD LOD; + D3DTEXTUREFILTERTYPE FilterType; + UINT LockCount; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DVolumeTexture9 *LPDIRECT3DVOLUMETEXTURE9, *PDIRECT3DVOLUMETEXTURE9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVolumeTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVolumeTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVolumeTexture9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVolumeTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVolumeTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DVolumeTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DVolumeTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DVolumeTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DVolumeTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DVolumeTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DVolumeTexture9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DVolumeTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DVolumeTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DVolumeTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#define IDirect3DVolumeTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) +#define IDirect3DVolumeTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) +#define IDirect3DVolumeTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) +#define IDirect3DVolumeTexture9_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) +#define IDirect3DVolumeTexture9_GetVolumeLevel(p,a,b) (p)->lpVtbl->GetVolumeLevel(p,a,b) +#define IDirect3DVolumeTexture9_LockBox(p,a,b,c,d) (p)->lpVtbl->LockBox(p,a,b,c,d) +#define IDirect3DVolumeTexture9_UnlockBox(p,a) (p)->lpVtbl->UnlockBox(p,a) +#define IDirect3DVolumeTexture9_AddDirtyBox(p,a) (p)->lpVtbl->AddDirtyBox(p,a) +#else +#define IDirect3DVolumeTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVolumeTexture9_AddRef(p) (p)->AddRef() +#define IDirect3DVolumeTexture9_Release(p) (p)->Release() +#define IDirect3DVolumeTexture9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVolumeTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DVolumeTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DVolumeTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DVolumeTexture9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DVolumeTexture9_GetPriority(p) (p)->GetPriority() +#define IDirect3DVolumeTexture9_PreLoad(p) (p)->PreLoad() +#define IDirect3DVolumeTexture9_GetType(p) (p)->GetType() +#define IDirect3DVolumeTexture9_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DVolumeTexture9_GetLOD(p) (p)->GetLOD() +#define IDirect3DVolumeTexture9_GetLevelCount(p) (p)->GetLevelCount() +#define IDirect3DVolumeTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) +#define IDirect3DVolumeTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() +#define IDirect3DVolumeTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() +#define IDirect3DVolumeTexture9_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) +#define IDirect3DVolumeTexture9_GetVolumeLevel(p,a,b) (p)->GetVolumeLevel(a,b) +#define IDirect3DVolumeTexture9_LockBox(p,a,b,c,d) (p)->LockBox(a,b,c,d) +#define IDirect3DVolumeTexture9_UnlockBox(p,a) (p)->UnlockBox(a) +#define IDirect3DVolumeTexture9_AddDirtyBox(p,a) (p)->AddDirtyBox(a) +#endif + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DCubeTexture9 + +DECLARE_INTERFACE_(IDirect3DCubeTexture9, IDirect3DBaseTexture9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DBaseTexture9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; + STDMETHOD_(DWORD, GetLOD)(THIS) PURE; + STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; + STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC *pDesc) PURE; + STDMETHOD(GetCubeMapSurface)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,IDirect3DSurface9** ppCubeMapSurface) PURE; + STDMETHOD(LockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; + STDMETHOD(UnlockRect)(THIS_ D3DCUBEMAP_FACES FaceType,UINT Level) PURE; + STDMETHOD(AddDirtyRect)(THIS_ D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Name; + UINT Width; + UINT Height; + UINT Levels; + DWORD Usage; + D3DFORMAT Format; + D3DPOOL Pool; + DWORD Priority; + DWORD LOD; + D3DTEXTUREFILTERTYPE FilterType; + UINT LockCount; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DCubeTexture9 *LPDIRECT3DCUBETEXTURE9, *PDIRECT3DCUBETEXTURE9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DCubeTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DCubeTexture9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DCubeTexture9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DCubeTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DCubeTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DCubeTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DCubeTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DCubeTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DCubeTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DCubeTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DCubeTexture9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DCubeTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirect3DCubeTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p) +#define IDirect3DCubeTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p) +#define IDirect3DCubeTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a) +#define IDirect3DCubeTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p) +#define IDirect3DCubeTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p) +#define IDirect3DCubeTexture9_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b) +#define IDirect3DCubeTexture9_GetCubeMapSurface(p,a,b,c) (p)->lpVtbl->GetCubeMapSurface(p,a,b,c) +#define IDirect3DCubeTexture9_LockRect(p,a,b,c,d,e) (p)->lpVtbl->LockRect(p,a,b,c,d,e) +#define IDirect3DCubeTexture9_UnlockRect(p,a,b) (p)->lpVtbl->UnlockRect(p,a,b) +#define IDirect3DCubeTexture9_AddDirtyRect(p,a,b) (p)->lpVtbl->AddDirtyRect(p,a,b) +#else +#define IDirect3DCubeTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DCubeTexture9_AddRef(p) (p)->AddRef() +#define IDirect3DCubeTexture9_Release(p) (p)->Release() +#define IDirect3DCubeTexture9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DCubeTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DCubeTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DCubeTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DCubeTexture9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DCubeTexture9_GetPriority(p) (p)->GetPriority() +#define IDirect3DCubeTexture9_PreLoad(p) (p)->PreLoad() +#define IDirect3DCubeTexture9_GetType(p) (p)->GetType() +#define IDirect3DCubeTexture9_SetLOD(p,a) (p)->SetLOD(a) +#define IDirect3DCubeTexture9_GetLOD(p) (p)->GetLOD() +#define IDirect3DCubeTexture9_GetLevelCount(p) (p)->GetLevelCount() +#define IDirect3DCubeTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a) +#define IDirect3DCubeTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType() +#define IDirect3DCubeTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels() +#define IDirect3DCubeTexture9_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b) +#define IDirect3DCubeTexture9_GetCubeMapSurface(p,a,b,c) (p)->GetCubeMapSurface(a,b,c) +#define IDirect3DCubeTexture9_LockRect(p,a,b,c,d,e) (p)->LockRect(a,b,c,d,e) +#define IDirect3DCubeTexture9_UnlockRect(p,a,b) (p)->UnlockRect(a,b) +#define IDirect3DCubeTexture9_AddDirtyRect(p,a,b) (p)->AddDirtyRect(a,b) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DVertexBuffer9 + +DECLARE_INTERFACE_(IDirect3DVertexBuffer9, IDirect3DResource9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags) PURE; + STDMETHOD(Unlock)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3DVERTEXBUFFER_DESC *pDesc) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Name; + UINT Length; + DWORD Usage; + DWORD FVF; + D3DPOOL Pool; + DWORD Priority; + UINT LockCount; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DVertexBuffer9 *LPDIRECT3DVERTEXBUFFER9, *PDIRECT3DVERTEXBUFFER9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVertexBuffer9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVertexBuffer9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVertexBuffer9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVertexBuffer9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVertexBuffer9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DVertexBuffer9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DVertexBuffer9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DVertexBuffer9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DVertexBuffer9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DVertexBuffer9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DVertexBuffer9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DVertexBuffer9_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) +#define IDirect3DVertexBuffer9_Unlock(p) (p)->lpVtbl->Unlock(p) +#define IDirect3DVertexBuffer9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#else +#define IDirect3DVertexBuffer9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVertexBuffer9_AddRef(p) (p)->AddRef() +#define IDirect3DVertexBuffer9_Release(p) (p)->Release() +#define IDirect3DVertexBuffer9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVertexBuffer9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DVertexBuffer9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DVertexBuffer9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DVertexBuffer9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DVertexBuffer9_GetPriority(p) (p)->GetPriority() +#define IDirect3DVertexBuffer9_PreLoad(p) (p)->PreLoad() +#define IDirect3DVertexBuffer9_GetType(p) (p)->GetType() +#define IDirect3DVertexBuffer9_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) +#define IDirect3DVertexBuffer9_Unlock(p) (p)->Unlock() +#define IDirect3DVertexBuffer9_GetDesc(p,a) (p)->GetDesc(a) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DIndexBuffer9 + +DECLARE_INTERFACE_(IDirect3DIndexBuffer9, IDirect3DResource9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags) PURE; + STDMETHOD(Unlock)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3DINDEXBUFFER_DESC *pDesc) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Name; + UINT Length; + DWORD Usage; + D3DFORMAT Format; + D3DPOOL Pool; + DWORD Priority; + UINT LockCount; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DIndexBuffer9 *LPDIRECT3DINDEXBUFFER9, *PDIRECT3DINDEXBUFFER9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DIndexBuffer9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DIndexBuffer9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DIndexBuffer9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DIndexBuffer9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DIndexBuffer9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DIndexBuffer9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DIndexBuffer9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DIndexBuffer9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DIndexBuffer9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DIndexBuffer9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DIndexBuffer9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DIndexBuffer9_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) +#define IDirect3DIndexBuffer9_Unlock(p) (p)->lpVtbl->Unlock(p) +#define IDirect3DIndexBuffer9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#else +#define IDirect3DIndexBuffer9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DIndexBuffer9_AddRef(p) (p)->AddRef() +#define IDirect3DIndexBuffer9_Release(p) (p)->Release() +#define IDirect3DIndexBuffer9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DIndexBuffer9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DIndexBuffer9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DIndexBuffer9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DIndexBuffer9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DIndexBuffer9_GetPriority(p) (p)->GetPriority() +#define IDirect3DIndexBuffer9_PreLoad(p) (p)->PreLoad() +#define IDirect3DIndexBuffer9_GetType(p) (p)->GetType() +#define IDirect3DIndexBuffer9_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) +#define IDirect3DIndexBuffer9_Unlock(p) (p)->Unlock() +#define IDirect3DIndexBuffer9_GetDesc(p,a) (p)->GetDesc(a) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DSurface9 + +DECLARE_INTERFACE_(IDirect3DSurface9, IDirect3DResource9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DResource9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE; + STDMETHOD_(DWORD, GetPriority)(THIS) PURE; + STDMETHOD_(void, PreLoad)(THIS) PURE; + STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE; + STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE; + STDMETHOD(GetDesc)(THIS_ D3DSURFACE_DESC *pDesc) PURE; + STDMETHOD(LockRect)(THIS_ D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE; + STDMETHOD(UnlockRect)(THIS) PURE; + STDMETHOD(GetDC)(THIS_ HDC *phdc) PURE; + STDMETHOD(ReleaseDC)(THIS_ HDC hdc) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Name; + UINT Width; + UINT Height; + DWORD Usage; + D3DFORMAT Format; + D3DPOOL Pool; + D3DMULTISAMPLE_TYPE MultiSampleType; + DWORD MultiSampleQuality; + DWORD Priority; + UINT LockCount; + UINT DCCount; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DSurface9 *LPDIRECT3DSURFACE9, *PDIRECT3DSURFACE9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DSurface9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DSurface9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DSurface9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DSurface9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DSurface9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DSurface9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DSurface9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DSurface9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirect3DSurface9_GetPriority(p) (p)->lpVtbl->GetPriority(p) +#define IDirect3DSurface9_PreLoad(p) (p)->lpVtbl->PreLoad(p) +#define IDirect3DSurface9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DSurface9_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) +#define IDirect3DSurface9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#define IDirect3DSurface9_LockRect(p,a,b,c) (p)->lpVtbl->LockRect(p,a,b,c) +#define IDirect3DSurface9_UnlockRect(p) (p)->lpVtbl->UnlockRect(p) +#define IDirect3DSurface9_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) +#define IDirect3DSurface9_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) +#else +#define IDirect3DSurface9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DSurface9_AddRef(p) (p)->AddRef() +#define IDirect3DSurface9_Release(p) (p)->Release() +#define IDirect3DSurface9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DSurface9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DSurface9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DSurface9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DSurface9_SetPriority(p,a) (p)->SetPriority(a) +#define IDirect3DSurface9_GetPriority(p) (p)->GetPriority() +#define IDirect3DSurface9_PreLoad(p) (p)->PreLoad() +#define IDirect3DSurface9_GetType(p) (p)->GetType() +#define IDirect3DSurface9_GetContainer(p,a,b) (p)->GetContainer(a,b) +#define IDirect3DSurface9_GetDesc(p,a) (p)->GetDesc(a) +#define IDirect3DSurface9_LockRect(p,a,b,c) (p)->LockRect(a,b,c) +#define IDirect3DSurface9_UnlockRect(p) (p)->UnlockRect() +#define IDirect3DSurface9_GetDC(p,a) (p)->GetDC(a) +#define IDirect3DSurface9_ReleaseDC(p,a) (p)->ReleaseDC(a) +#endif + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DVolume9 + +DECLARE_INTERFACE_(IDirect3DVolume9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DVolume9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE; + STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE; + STDMETHOD(GetDesc)(THIS_ D3DVOLUME_DESC *pDesc) PURE; + STDMETHOD(LockBox)(THIS_ D3DLOCKED_BOX * pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) PURE; + STDMETHOD(UnlockBox)(THIS) PURE; + + #ifdef D3D_DEBUG_INFO + LPCWSTR Name; + UINT Width; + UINT Height; + UINT Depth; + DWORD Usage; + D3DFORMAT Format; + D3DPOOL Pool; + UINT LockCount; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DVolume9 *LPDIRECT3DVOLUME9, *PDIRECT3DVOLUME9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DVolume9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DVolume9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DVolume9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DVolume9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DVolume9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirect3DVolume9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirect3DVolume9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirect3DVolume9_GetContainer(p,a,b) (p)->lpVtbl->GetContainer(p,a,b) +#define IDirect3DVolume9_GetDesc(p,a) (p)->lpVtbl->GetDesc(p,a) +#define IDirect3DVolume9_LockBox(p,a,b,c) (p)->lpVtbl->LockBox(p,a,b,c) +#define IDirect3DVolume9_UnlockBox(p) (p)->lpVtbl->UnlockBox(p) +#else +#define IDirect3DVolume9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DVolume9_AddRef(p) (p)->AddRef() +#define IDirect3DVolume9_Release(p) (p)->Release() +#define IDirect3DVolume9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DVolume9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirect3DVolume9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirect3DVolume9_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirect3DVolume9_GetContainer(p,a,b) (p)->GetContainer(a,b) +#define IDirect3DVolume9_GetDesc(p,a) (p)->GetDesc(a) +#define IDirect3DVolume9_LockBox(p,a,b,c) (p)->LockBox(a,b,c) +#define IDirect3DVolume9_UnlockBox(p) (p)->UnlockBox() +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DQuery9 + +DECLARE_INTERFACE_(IDirect3DQuery9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DQuery9 methods ***/ + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD_(D3DQUERYTYPE, GetType)(THIS) PURE; + STDMETHOD_(DWORD, GetDataSize)(THIS) PURE; + STDMETHOD(Issue)(THIS_ DWORD dwIssueFlags) PURE; + STDMETHOD(GetData)(THIS_ void* pData,DWORD dwSize,DWORD dwGetDataFlags) PURE; + + #ifdef D3D_DEBUG_INFO + D3DQUERYTYPE Type; + DWORD DataSize; + LPCWSTR CreationCallStack; + #endif +}; + +typedef struct IDirect3DQuery9 *LPDIRECT3DQUERY9, *PDIRECT3DQUERY9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DQuery9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DQuery9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DQuery9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DQuery9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DQuery9_GetType(p) (p)->lpVtbl->GetType(p) +#define IDirect3DQuery9_GetDataSize(p) (p)->lpVtbl->GetDataSize(p) +#define IDirect3DQuery9_Issue(p,a) (p)->lpVtbl->Issue(p,a) +#define IDirect3DQuery9_GetData(p,a,b,c) (p)->lpVtbl->GetData(p,a,b,c) +#else +#define IDirect3DQuery9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DQuery9_AddRef(p) (p)->AddRef() +#define IDirect3DQuery9_Release(p) (p)->Release() +#define IDirect3DQuery9_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DQuery9_GetType(p) (p)->GetType() +#define IDirect3DQuery9_GetDataSize(p) (p)->GetDataSize() +#define IDirect3DQuery9_Issue(p,a) (p)->Issue(a) +#define IDirect3DQuery9_GetData(p,a,b,c) (p)->GetData(a,b,c) +#endif + + +/**************************************************************************** + * Flags for SetPrivateData method on all D3D9 interfaces + * + * The passed pointer is an IUnknown ptr. The SizeOfData argument to SetPrivateData + * must be set to sizeof(IUnknown*). Direct3D will call AddRef through this + * pointer and Release when the private data is destroyed. The data will be + * destroyed when another SetPrivateData with the same GUID is set, when + * FreePrivateData is called, or when the D3D9 object is freed. + ****************************************************************************/ +#define D3DSPD_IUNKNOWN 0x00000001L + +/**************************************************************************** + * + * Flags for IDirect3D9::CreateDevice's BehaviorFlags + * + ****************************************************************************/ + +#define D3DCREATE_FPU_PRESERVE 0x00000002L +#define D3DCREATE_MULTITHREADED 0x00000004L + +#define D3DCREATE_PUREDEVICE 0x00000010L +#define D3DCREATE_SOFTWARE_VERTEXPROCESSING 0x00000020L +#define D3DCREATE_HARDWARE_VERTEXPROCESSING 0x00000040L +#define D3DCREATE_MIXED_VERTEXPROCESSING 0x00000080L + +#define D3DCREATE_DISABLE_DRIVER_MANAGEMENT 0x00000100L +#define D3DCREATE_ADAPTERGROUP_DEVICE 0x00000200L +#define D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX 0x00000400L + +// This flag causes the D3D runtime not to alter the focus +// window in any way. Use with caution- the burden of supporting +// focus management events (alt-tab, etc.) falls on the +// application, and appropriate responses (switching display +// mode, etc.) should be coded. +#define D3DCREATE_NOWINDOWCHANGES 0x00000800L + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +// Disable multithreading for software vertex processing +#define D3DCREATE_DISABLE_PSGP_THREADING 0x00002000L +// This flag enables present statistics on device. +#define D3DCREATE_ENABLE_PRESENTSTATS 0x00004000L +// This flag disables printscreen support in the runtime for this device +#define D3DCREATE_DISABLE_PRINTSCREEN 0x00008000L + +#define D3DCREATE_SCREENSAVER 0x10000000L + + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + + +/**************************************************************************** + * + * Parameter for IDirect3D9::CreateDevice's Adapter argument + * + ****************************************************************************/ + +#define D3DADAPTER_DEFAULT 0 + +/**************************************************************************** + * + * Flags for IDirect3D9::EnumAdapters + * + ****************************************************************************/ + +/* + * The D3DENUM_WHQL_LEVEL value has been retired for 9Ex and future versions, + * but it needs to be defined here for compatibility with DX9 and earlier versions. + * See the DirectX SDK for sample code on discovering driver signatures. + */ +#define D3DENUM_WHQL_LEVEL 0x00000002L + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +/* NO_DRIVERVERSION will not fill out the DriverVersion field, nor will the + DriverVersion be incorporated into the DeviceIdentifier GUID. WINNT only */ +#define D3DENUM_NO_DRIVERVERSION 0x00000004L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + +/**************************************************************************** + * + * Maximum number of back-buffers supported in DX9 + * + ****************************************************************************/ + +#define D3DPRESENT_BACK_BUFFERS_MAX 3L + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +/**************************************************************************** + * + * Maximum number of back-buffers supported when apps use CreateDeviceEx + * + ****************************************************************************/ + +#define D3DPRESENT_BACK_BUFFERS_MAX_EX 30L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + +/**************************************************************************** + * + * Flags for IDirect3DDevice9::SetGammaRamp + * + ****************************************************************************/ + +#define D3DSGR_NO_CALIBRATION 0x00000000L +#define D3DSGR_CALIBRATE 0x00000001L + +/**************************************************************************** + * + * Flags for IDirect3DDevice9::SetCursorPosition + * + ****************************************************************************/ + +#define D3DCURSOR_IMMEDIATE_UPDATE 0x00000001L + +/**************************************************************************** + * + * Flags for IDirect3DSwapChain9::Present + * + ****************************************************************************/ + +#define D3DPRESENT_DONOTWAIT 0x00000001L +#define D3DPRESENT_LINEAR_CONTENT 0x00000002L + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +#define D3DPRESENT_DONOTFLIP 0x00000004L +#define D3DPRESENT_FLIPRESTART 0x00000008L +#define D3DPRESENT_VIDEO_RESTRICT_TO_MONITOR 0x00000010L +#define D3DPRESENT_UPDATEOVERLAYONLY 0x00000020L +#define D3DPRESENT_HIDEOVERLAY 0x00000040L +#define D3DPRESENT_UPDATECOLORKEY 0x00000080L +#define D3DPRESENT_FORCEIMMEDIATE 0x00000100L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + +/**************************************************************************** + * + * Flags for DrawPrimitive/DrawIndexedPrimitive + * Also valid for Begin/BeginIndexed + * Also valid for VertexBuffer::CreateVertexBuffer + ****************************************************************************/ + + +/* + * DirectDraw error codes + */ +#define _FACD3D 0x876 +#define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) +#define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code ) + +/* + * Direct3D Errors + */ +#define D3D_OK S_OK + +#define D3DERR_WRONGTEXTUREFORMAT MAKE_D3DHRESULT(2072) +#define D3DERR_UNSUPPORTEDCOLOROPERATION MAKE_D3DHRESULT(2073) +#define D3DERR_UNSUPPORTEDCOLORARG MAKE_D3DHRESULT(2074) +#define D3DERR_UNSUPPORTEDALPHAOPERATION MAKE_D3DHRESULT(2075) +#define D3DERR_UNSUPPORTEDALPHAARG MAKE_D3DHRESULT(2076) +#define D3DERR_TOOMANYOPERATIONS MAKE_D3DHRESULT(2077) +#define D3DERR_CONFLICTINGTEXTUREFILTER MAKE_D3DHRESULT(2078) +#define D3DERR_UNSUPPORTEDFACTORVALUE MAKE_D3DHRESULT(2079) +#define D3DERR_CONFLICTINGRENDERSTATE MAKE_D3DHRESULT(2081) +#define D3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_D3DHRESULT(2082) +#define D3DERR_CONFLICTINGTEXTUREPALETTE MAKE_D3DHRESULT(2086) +#define D3DERR_DRIVERINTERNALERROR MAKE_D3DHRESULT(2087) + +#define D3DERR_NOTFOUND MAKE_D3DHRESULT(2150) +#define D3DERR_MOREDATA MAKE_D3DHRESULT(2151) +#define D3DERR_DEVICELOST MAKE_D3DHRESULT(2152) +#define D3DERR_DEVICENOTRESET MAKE_D3DHRESULT(2153) +#define D3DERR_NOTAVAILABLE MAKE_D3DHRESULT(2154) +#define D3DERR_OUTOFVIDEOMEMORY MAKE_D3DHRESULT(380) +#define D3DERR_INVALIDDEVICE MAKE_D3DHRESULT(2155) +#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) +#define D3DERR_DRIVERINVALIDCALL MAKE_D3DHRESULT(2157) +#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540) +#define D3DOK_NOAUTOGEN MAKE_D3DSTATUS(2159) + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + + +#define D3DERR_DEVICEREMOVED MAKE_D3DHRESULT(2160) +#define S_NOT_RESIDENT MAKE_D3DSTATUS(2165) +#define S_RESIDENT_IN_SHARED_MEMORY MAKE_D3DSTATUS(2166) +#define S_PRESENT_MODE_CHANGED MAKE_D3DSTATUS(2167) +#define S_PRESENT_OCCLUDED MAKE_D3DSTATUS(2168) +#define D3DERR_DEVICEHUNG MAKE_D3DHRESULT(2164) +#define D3DERR_UNSUPPORTEDOVERLAY MAKE_D3DHRESULT(2171) +#define D3DERR_UNSUPPORTEDOVERLAYFORMAT MAKE_D3DHRESULT(2172) +#define D3DERR_CANNOTPROTECTCONTENT MAKE_D3DHRESULT(2173) +#define D3DERR_UNSUPPORTEDCRYPTO MAKE_D3DHRESULT(2174) +#define D3DERR_PRESENT_STATISTICS_DISJOINT MAKE_D3DHRESULT(2180) + + +/********************* +/* D3D9Ex interfaces +/*********************/ + +HRESULT WINAPI Direct3DCreate9Ex(UINT SDKVersion, IDirect3D9Ex**); + + + + +#undef INTERFACE +#define INTERFACE IDirect3D9Ex + +DECLARE_INTERFACE_(IDirect3D9Ex, IDirect3D9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3D9 methods ***/ + STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE; + STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) PURE; + STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter,D3DFORMAT Format) PURE; + STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter,D3DDEVTYPE DevType,D3DFORMAT AdapterFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) PURE; + STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) PURE; + STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) PURE; + STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) PURE; + STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) PURE; + STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE; + STDMETHOD(CreateDevice)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) PURE; + STDMETHOD_(UINT, GetAdapterModeCountEx)(THIS_ UINT Adapter,CONST D3DDISPLAYMODEFILTER* pFilter ) PURE; + STDMETHOD(EnumAdapterModesEx)(THIS_ UINT Adapter,CONST D3DDISPLAYMODEFILTER* pFilter,UINT Mode,D3DDISPLAYMODEEX* pMode) PURE; + STDMETHOD(GetAdapterDisplayModeEx)(THIS_ UINT Adapter,D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation) PURE; + STDMETHOD(CreateDeviceEx)(THIS_ UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,D3DDISPLAYMODEEX* pFullscreenDisplayMode,IDirect3DDevice9Ex** ppReturnedDeviceInterface) PURE; + STDMETHOD(GetAdapterLUID)(THIS_ UINT Adapter,LUID * pLUID) PURE; +}; + +typedef struct IDirect3D9Ex *LPDIRECT3D9EX, *PDIRECT3D9EX; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3D9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D9Ex_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D9Ex_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3D9Ex_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p) +#define IDirect3D9Ex_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c) +#define IDirect3D9Ex_GetAdapterModeCount(p,a,b) (p)->lpVtbl->GetAdapterModeCount(p,a,b) +#define IDirect3D9Ex_EnumAdapterModes(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b) +#define IDirect3D9Ex_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormatConversion(p,a,b,c,d) (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d) +#define IDirect3D9Ex_GetDeviceCaps(p,a,b,c) (p)->lpVtbl->GetDeviceCaps(p,a,b,c) +#define IDirect3D9Ex_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a) +#define IDirect3D9Ex_CreateDevice(p,a,b,c,d,e,f) (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f) +#define IDirect3D9Ex_GetAdapterModeCountEx(p,a,b) (p)->lpVtbl->GetAdapterModeCountEx(p,a,b) +#define IDirect3D9Ex_EnumAdapterModesEx(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModesEx(p,a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayModeEx(p,a,b,c) (p)->lpVtbl->GetAdapterDisplayModeEx(p,a,b,c) +#define IDirect3D9Ex_CreateDeviceEx(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d,e,f,g) +#define IDirect3D9Ex_GetAdapterLUID(p,a,b) (p)->lpVtbl->GetAdapterLUID(p,a,b) +#else +#define IDirect3D9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D9Ex_AddRef(p) (p)->AddRef() +#define IDirect3D9Ex_Release(p) (p)->Release() +#define IDirect3D9Ex_GetAdapterCount(p) (p)->GetAdapterCount() +#define IDirect3D9Ex_GetAdapterIdentifier(p,a,b,c) (p)->GetAdapterIdentifier(a,b,c) +#define IDirect3D9Ex_GetAdapterModeCount(p,a,b) (p)->GetAdapterModeCount(a,b) +#define IDirect3D9Ex_EnumAdapterModes(p,a,b,c,d) (p)->EnumAdapterModes(a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayMode(p,a,b) (p)->GetAdapterDisplayMode(a,b) +#define IDirect3D9Ex_CheckDeviceType(p,a,b,c,d,e) (p)->CheckDeviceType(a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->CheckDeviceFormat(a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->CheckDeviceMultiSampleType(a,b,c,d,e,f) +#define IDirect3D9Ex_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->CheckDepthStencilMatch(a,b,c,d,e) +#define IDirect3D9Ex_CheckDeviceFormatConversion(p,a,b,c,d) (p)->CheckDeviceFormatConversion(a,b,c,d) +#define IDirect3D9Ex_GetDeviceCaps(p,a,b,c) (p)->GetDeviceCaps(a,b,c) +#define IDirect3D9Ex_GetAdapterMonitor(p,a) (p)->GetAdapterMonitor(a) +#define IDirect3D9Ex_CreateDevice(p,a,b,c,d,e,f) (p)->CreateDevice(a,b,c,d,e,f) +#define IDirect3D9Ex_GetAdapterModeCountEx(p,a,b) (p)->GetAdapterModeCountEx(a,b) +#define IDirect3D9Ex_EnumAdapterModesEx(p,a,b,c,d) (p)->EnumAdapterModesEx(a,b,c,d) +#define IDirect3D9Ex_GetAdapterDisplayModeEx(p,a,b,c) (p)->GetAdapterDisplayModeEx(a,b,c) +#define IDirect3D9Ex_CreateDeviceEx(p,a,b,c,d,e,f,g) (p)->CreateDeviceEx(a,b,c,d,e,f,g) +#define IDirect3D9Ex_GetAdapterLUID(p,a,b) (p)->GetAdapterLUID(a,b) +#endif + + + + + + + + + + + + + + + + + + + + + + + + +#undef INTERFACE +#define INTERFACE IDirect3DDevice9Ex + +DECLARE_INTERFACE_(IDirect3DDevice9Ex, IDirect3DDevice9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DDevice9 methods ***/ + STDMETHOD(TestCooperativeLevel)(THIS) PURE; + STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE; + STDMETHOD(EvictManagedResources)(THIS) PURE; + STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9) PURE; + STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps) PURE; + STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain,D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE; + STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap) PURE; + STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags) PURE; + STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE; + STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain) PURE; + STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain,IDirect3DSwapChain9** pSwapChain) PURE; + STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE; + STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE; + STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus) PURE; + STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE; + STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp) PURE; + STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain,D3DGAMMARAMP* pRamp) PURE; + STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint) PURE; + STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture) PURE; + STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter) PURE; + STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color) PURE; + STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE; + STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget) PURE; + STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) PURE; + STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil) PURE; + STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface) PURE; + STDMETHOD(BeginScene)(THIS) PURE; + STDMETHOD(EndScene)(THIS) PURE; + STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) PURE; + STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) PURE; + STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) PURE; + STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*) PURE; + STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial) PURE; + STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial) PURE; + STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT9*) PURE; + STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT9*) PURE; + STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE; + STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE; + STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane) PURE; + STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane) PURE; + STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value) PURE; + STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue) PURE; + STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB) PURE; + STDMETHOD(BeginStateBlock)(THIS) PURE; + STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB) PURE; + STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus) PURE; + STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus) PURE; + STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9** ppTexture) PURE; + STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9* pTexture) PURE; + STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE; + STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE; + STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue) PURE; + STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value) PURE; + STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE; + STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries) PURE; + STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE; + STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE; + STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE; + STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE; + STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE; + STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE; + STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE; + STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE; + STDMETHOD_(float, GetNPatchMode)(THIS) PURE; + STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE; + STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE; + STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; + STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE; + STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags) PURE; + STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl) PURE; + STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl) PURE; + STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl) PURE; + STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; + STDMETHOD(GetFVF)(THIS_ DWORD* pFVF) PURE; + STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader) PURE; + STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader) PURE; + STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader) PURE; + STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) PURE; + STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* pOffsetInBytes,UINT* pStride) PURE; + STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT Setting) PURE; + STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT* pSetting) PURE; + STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData) PURE; + STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData) PURE; + STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader) PURE; + STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader) PURE; + STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader) PURE; + STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE; + STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE; + STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE; + STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE; + STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE; + STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE; + STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery) PURE; + STDMETHOD(SetConvolutionMonoKernel)(THIS_ UINT width,UINT height,float* rows,float* columns) PURE; + STDMETHOD(ComposeRects)(THIS_ IDirect3DSurface9* pSrc,IDirect3DSurface9* pDst,IDirect3DVertexBuffer9* pSrcRectDescs,UINT NumRects,IDirect3DVertexBuffer9* pDstRectDescs,D3DCOMPOSERECTSOP Operation,int Xoffset,int Yoffset) PURE; + STDMETHOD(PresentEx)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags) PURE; + STDMETHOD(GetGPUThreadPriority)(THIS_ INT* pPriority) PURE; + STDMETHOD(SetGPUThreadPriority)(THIS_ INT Priority) PURE; + STDMETHOD(WaitForVBlank)(THIS_ UINT iSwapChain) PURE; + STDMETHOD(CheckResourceResidency)(THIS_ IDirect3DResource9** pResourceArray,UINT32 NumResources) PURE; + STDMETHOD(SetMaximumFrameLatency)(THIS_ UINT MaxLatency) PURE; + STDMETHOD(GetMaximumFrameLatency)(THIS_ UINT* pMaxLatency) PURE; + STDMETHOD(CheckDeviceState)(THIS_ HWND hDestinationWindow) PURE; + STDMETHOD(CreateRenderTargetEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage) PURE; + STDMETHOD(CreateOffscreenPlainSurfaceEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage) PURE; + STDMETHOD(CreateDepthStencilSurfaceEx)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle,DWORD Usage) PURE; + STDMETHOD(ResetEx)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,D3DDISPLAYMODEEX *pFullscreenDisplayMode) PURE; + STDMETHOD(GetDisplayModeEx)(THIS_ UINT iSwapChain,D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation) PURE; +}; + +typedef struct IDirect3DDevice9Ex *LPDIRECT3DDEVICE9EX, *PDIRECT3DDEVICE9EX; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DDevice9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDevice9Ex_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDevice9Ex_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DDevice9Ex_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) +#define IDirect3DDevice9Ex_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p) +#define IDirect3DDevice9Ex_EvictManagedResources(p) (p)->lpVtbl->EvictManagedResources(p) +#define IDirect3DDevice9Ex_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a) +#define IDirect3DDevice9Ex_GetDeviceCaps(p,a) (p)->lpVtbl->GetDeviceCaps(p,a) +#define IDirect3DDevice9Ex_GetDisplayMode(p,a,b) (p)->lpVtbl->GetDisplayMode(p,a,b) +#define IDirect3DDevice9Ex_GetCreationParameters(p,a) (p)->lpVtbl->GetCreationParameters(p,a) +#define IDirect3DDevice9Ex_SetCursorProperties(p,a,b,c) (p)->lpVtbl->SetCursorProperties(p,a,b,c) +#define IDirect3DDevice9Ex_SetCursorPosition(p,a,b,c) (p)->lpVtbl->SetCursorPosition(p,a,b,c) +#define IDirect3DDevice9Ex_ShowCursor(p,a) (p)->lpVtbl->ShowCursor(p,a) +#define IDirect3DDevice9Ex_CreateAdditionalSwapChain(p,a,b) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b) +#define IDirect3DDevice9Ex_GetSwapChain(p,a,b) (p)->lpVtbl->GetSwapChain(p,a,b) +#define IDirect3DDevice9Ex_GetNumberOfSwapChains(p) (p)->lpVtbl->GetNumberOfSwapChains(p) +#define IDirect3DDevice9Ex_Reset(p,a) (p)->lpVtbl->Reset(p,a) +#define IDirect3DDevice9Ex_Present(p,a,b,c,d) (p)->lpVtbl->Present(p,a,b,c,d) +#define IDirect3DDevice9Ex_GetBackBuffer(p,a,b,c,d) (p)->lpVtbl->GetBackBuffer(p,a,b,c,d) +#define IDirect3DDevice9Ex_GetRasterStatus(p,a,b) (p)->lpVtbl->GetRasterStatus(p,a,b) +#define IDirect3DDevice9Ex_SetDialogBoxMode(p,a) (p)->lpVtbl->SetDialogBoxMode(p,a) +#define IDirect3DDevice9Ex_SetGammaRamp(p,a,b,c) (p)->lpVtbl->SetGammaRamp(p,a,b,c) +#define IDirect3DDevice9Ex_GetGammaRamp(p,a,b) (p)->lpVtbl->GetGammaRamp(p,a,b) +#define IDirect3DDevice9Ex_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f,g) +#define IDirect3DDevice9Ex_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_UpdateSurface(p,a,b,c,d) (p)->lpVtbl->UpdateSurface(p,a,b,c,d) +#define IDirect3DDevice9Ex_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) +#define IDirect3DDevice9Ex_GetRenderTargetData(p,a,b) (p)->lpVtbl->GetRenderTargetData(p,a,b) +#define IDirect3DDevice9Ex_GetFrontBufferData(p,a,b) (p)->lpVtbl->GetFrontBufferData(p,a,b) +#define IDirect3DDevice9Ex_StretchRect(p,a,b,c,d,e) (p)->lpVtbl->StretchRect(p,a,b,c,d,e) +#define IDirect3DDevice9Ex_ColorFill(p,a,b,c) (p)->lpVtbl->ColorFill(p,a,b,c) +#define IDirect3DDevice9Ex_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->lpVtbl->CreateOffscreenPlainSurface(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b) +#define IDirect3DDevice9Ex_GetRenderTarget(p,a,b) (p)->lpVtbl->GetRenderTarget(p,a,b) +#define IDirect3DDevice9Ex_SetDepthStencilSurface(p,a) (p)->lpVtbl->SetDepthStencilSurface(p,a) +#define IDirect3DDevice9Ex_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a) +#define IDirect3DDevice9Ex_BeginScene(p) (p)->lpVtbl->BeginScene(p) +#define IDirect3DDevice9Ex_EndScene(p) (p)->lpVtbl->EndScene(p) +#define IDirect3DDevice9Ex_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b) +#define IDirect3DDevice9Ex_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b) +#define IDirect3DDevice9Ex_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b) +#define IDirect3DDevice9Ex_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a) +#define IDirect3DDevice9Ex_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a) +#define IDirect3DDevice9Ex_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a) +#define IDirect3DDevice9Ex_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a) +#define IDirect3DDevice9Ex_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b) +#define IDirect3DDevice9Ex_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b) +#define IDirect3DDevice9Ex_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b) +#define IDirect3DDevice9Ex_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b) +#define IDirect3DDevice9Ex_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b) +#define IDirect3DDevice9Ex_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b) +#define IDirect3DDevice9Ex_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b) +#define IDirect3DDevice9Ex_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b) +#define IDirect3DDevice9Ex_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b) +#define IDirect3DDevice9Ex_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p) +#define IDirect3DDevice9Ex_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a) +#define IDirect3DDevice9Ex_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a) +#define IDirect3DDevice9Ex_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a) +#define IDirect3DDevice9Ex_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b) +#define IDirect3DDevice9Ex_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b) +#define IDirect3DDevice9Ex_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c) +#define IDirect3DDevice9Ex_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c) +#define IDirect3DDevice9Ex_GetSamplerState(p,a,b,c) (p)->lpVtbl->GetSamplerState(p,a,b,c) +#define IDirect3DDevice9Ex_SetSamplerState(p,a,b,c) (p)->lpVtbl->SetSamplerState(p,a,b,c) +#define IDirect3DDevice9Ex_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a) +#define IDirect3DDevice9Ex_SetPaletteEntries(p,a,b) (p)->lpVtbl->SetPaletteEntries(p,a,b) +#define IDirect3DDevice9Ex_GetPaletteEntries(p,a,b) (p)->lpVtbl->GetPaletteEntries(p,a,b) +#define IDirect3DDevice9Ex_SetCurrentTexturePalette(p,a) (p)->lpVtbl->SetCurrentTexturePalette(p,a) +#define IDirect3DDevice9Ex_GetCurrentTexturePalette(p,a) (p)->lpVtbl->GetCurrentTexturePalette(p,a) +#define IDirect3DDevice9Ex_SetScissorRect(p,a) (p)->lpVtbl->SetScissorRect(p,a) +#define IDirect3DDevice9Ex_GetScissorRect(p,a) (p)->lpVtbl->GetScissorRect(p,a) +#define IDirect3DDevice9Ex_SetSoftwareVertexProcessing(p,a) (p)->lpVtbl->SetSoftwareVertexProcessing(p,a) +#define IDirect3DDevice9Ex_GetSoftwareVertexProcessing(p) (p)->lpVtbl->GetSoftwareVertexProcessing(p) +#define IDirect3DDevice9Ex_SetNPatchMode(p,a) (p)->lpVtbl->SetNPatchMode(p,a) +#define IDirect3DDevice9Ex_GetNPatchMode(p) (p)->lpVtbl->GetNPatchMode(p) +#define IDirect3DDevice9Ex_DrawPrimitive(p,a,b,c) (p)->lpVtbl->DrawPrimitive(p,a,b,c) +#define IDirect3DDevice9Ex_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_DrawPrimitiveUP(p,a,b,c,d) (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d) +#define IDirect3DDevice9Ex_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_ProcessVertices(p,a,b,c,d,e,f) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateVertexDeclaration(p,a,b) (p)->lpVtbl->CreateVertexDeclaration(p,a,b) +#define IDirect3DDevice9Ex_SetVertexDeclaration(p,a) (p)->lpVtbl->SetVertexDeclaration(p,a) +#define IDirect3DDevice9Ex_GetVertexDeclaration(p,a) (p)->lpVtbl->GetVertexDeclaration(p,a) +#define IDirect3DDevice9Ex_SetFVF(p,a) (p)->lpVtbl->SetFVF(p,a) +#define IDirect3DDevice9Ex_GetFVF(p,a) (p)->lpVtbl->GetFVF(p,a) +#define IDirect3DDevice9Ex_CreateVertexShader(p,a,b) (p)->lpVtbl->CreateVertexShader(p,a,b) +#define IDirect3DDevice9Ex_SetVertexShader(p,a) (p)->lpVtbl->SetVertexShader(p,a) +#define IDirect3DDevice9Ex_GetVertexShader(p,a) (p)->lpVtbl->GetVertexShader(p,a) +#define IDirect3DDevice9Ex_SetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantF(p,a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantF(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantF(p,a,b,c) +#define IDirect3DDevice9Ex_SetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantI(p,a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantI(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantI(p,a,b,c) +#define IDirect3DDevice9Ex_SetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->SetVertexShaderConstantB(p,a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantB(p,a,b,c) (p)->lpVtbl->GetVertexShaderConstantB(p,a,b,c) +#define IDirect3DDevice9Ex_SetStreamSource(p,a,b,c,d) (p)->lpVtbl->SetStreamSource(p,a,b,c,d) +#define IDirect3DDevice9Ex_GetStreamSource(p,a,b,c,d) (p)->lpVtbl->GetStreamSource(p,a,b,c,d) +#define IDirect3DDevice9Ex_SetStreamSourceFreq(p,a,b) (p)->lpVtbl->SetStreamSourceFreq(p,a,b) +#define IDirect3DDevice9Ex_GetStreamSourceFreq(p,a,b) (p)->lpVtbl->GetStreamSourceFreq(p,a,b) +#define IDirect3DDevice9Ex_SetIndices(p,a) (p)->lpVtbl->SetIndices(p,a) +#define IDirect3DDevice9Ex_GetIndices(p,a) (p)->lpVtbl->GetIndices(p,a) +#define IDirect3DDevice9Ex_CreatePixelShader(p,a,b) (p)->lpVtbl->CreatePixelShader(p,a,b) +#define IDirect3DDevice9Ex_SetPixelShader(p,a) (p)->lpVtbl->SetPixelShader(p,a) +#define IDirect3DDevice9Ex_GetPixelShader(p,a) (p)->lpVtbl->GetPixelShader(p,a) +#define IDirect3DDevice9Ex_SetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantF(p,a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantF(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantF(p,a,b,c) +#define IDirect3DDevice9Ex_SetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantI(p,a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantI(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantI(p,a,b,c) +#define IDirect3DDevice9Ex_SetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->SetPixelShaderConstantB(p,a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantB(p,a,b,c) (p)->lpVtbl->GetPixelShaderConstantB(p,a,b,c) +#define IDirect3DDevice9Ex_DrawRectPatch(p,a,b,c) (p)->lpVtbl->DrawRectPatch(p,a,b,c) +#define IDirect3DDevice9Ex_DrawTriPatch(p,a,b,c) (p)->lpVtbl->DrawTriPatch(p,a,b,c) +#define IDirect3DDevice9Ex_DeletePatch(p,a) (p)->lpVtbl->DeletePatch(p,a) +#define IDirect3DDevice9Ex_CreateQuery(p,a,b) (p)->lpVtbl->CreateQuery(p,a,b) +#define IDirect3DDevice9Ex_SetConvolutionMonoKernel(p,a,b,c,d) (p)->lpVtbl->SetConvolutionMonoKernel(p,a,b,c,d) +#define IDirect3DDevice9Ex_ComposeRects(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->ComposeRects(p,a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_PresentEx(p,a,b,c,d,e) (p)->lpVtbl->PresentEx(p,a,b,c,d,e) +#define IDirect3DDevice9Ex_GetGPUThreadPriority(p,a) (p)->lpVtbl->GetGPUThreadPriority(p,a) +#define IDirect3DDevice9Ex_SetGPUThreadPriority(p,a) (p)->lpVtbl->SetGPUThreadPriority(p,a) +#define IDirect3DDevice9Ex_WaitForVBlank(p,a) (p)->lpVtbl->WaitForVBlank(p,a) +#define IDirect3DDevice9Ex_CheckResourceResidency(p,a,b) (p)->lpVtbl->CheckResourceResidency(p,a,b) +#define IDirect3DDevice9Ex_SetMaximumFrameLatency(p,a) (p)->lpVtbl->SetMaximumFrameLatency(p,a) +#define IDirect3DDevice9Ex_GetMaximumFrameLatency(p,a) (p)->lpVtbl->GetMaximumFrameLatency(p,a) +#define IDirect3DDevice9Ex_CheckDeviceState(p,a) (p)->lpVtbl->CheckDeviceState(p,a) +#define IDirect3DDevice9Ex_CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g) (p)->lpVtbl->CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g) +#define IDirect3DDevice9Ex_CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_ResetEx(p,a,b) (p)->lpVtbl->ResetEx(p,a,b) +#define IDirect3DDevice9Ex_GetDisplayModeEx(p,a,b,c) (p)->lpVtbl->GetDisplayModeEx(p,a,b,c) +#else +#define IDirect3DDevice9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDevice9Ex_AddRef(p) (p)->AddRef() +#define IDirect3DDevice9Ex_Release(p) (p)->Release() +#define IDirect3DDevice9Ex_TestCooperativeLevel(p) (p)->TestCooperativeLevel() +#define IDirect3DDevice9Ex_GetAvailableTextureMem(p) (p)->GetAvailableTextureMem() +#define IDirect3DDevice9Ex_EvictManagedResources(p) (p)->EvictManagedResources() +#define IDirect3DDevice9Ex_GetDirect3D(p,a) (p)->GetDirect3D(a) +#define IDirect3DDevice9Ex_GetDeviceCaps(p,a) (p)->GetDeviceCaps(a) +#define IDirect3DDevice9Ex_GetDisplayMode(p,a,b) (p)->GetDisplayMode(a,b) +#define IDirect3DDevice9Ex_GetCreationParameters(p,a) (p)->GetCreationParameters(a) +#define IDirect3DDevice9Ex_SetCursorProperties(p,a,b,c) (p)->SetCursorProperties(a,b,c) +#define IDirect3DDevice9Ex_SetCursorPosition(p,a,b,c) (p)->SetCursorPosition(a,b,c) +#define IDirect3DDevice9Ex_ShowCursor(p,a) (p)->ShowCursor(a) +#define IDirect3DDevice9Ex_CreateAdditionalSwapChain(p,a,b) (p)->CreateAdditionalSwapChain(a,b) +#define IDirect3DDevice9Ex_GetSwapChain(p,a,b) (p)->GetSwapChain(a,b) +#define IDirect3DDevice9Ex_GetNumberOfSwapChains(p) (p)->GetNumberOfSwapChains() +#define IDirect3DDevice9Ex_Reset(p,a) (p)->Reset(a) +#define IDirect3DDevice9Ex_Present(p,a,b,c,d) (p)->Present(a,b,c,d) +#define IDirect3DDevice9Ex_GetBackBuffer(p,a,b,c,d) (p)->GetBackBuffer(a,b,c,d) +#define IDirect3DDevice9Ex_GetRasterStatus(p,a,b) (p)->GetRasterStatus(a,b) +#define IDirect3DDevice9Ex_SetDialogBoxMode(p,a) (p)->SetDialogBoxMode(a) +#define IDirect3DDevice9Ex_SetGammaRamp(p,a,b,c) (p)->SetGammaRamp(a,b,c) +#define IDirect3DDevice9Ex_GetGammaRamp(p,a,b) (p)->GetGammaRamp(a,b) +#define IDirect3DDevice9Ex_CreateTexture(p,a,b,c,d,e,f,g,h) (p)->CreateTexture(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i) (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_CreateCubeTexture(p,a,b,c,d,e,f,g) (p)->CreateCubeTexture(a,b,c,d,e,f,g) +#define IDirect3DDevice9Ex_CreateVertexBuffer(p,a,b,c,d,e,f) (p)->CreateVertexBuffer(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateIndexBuffer(p,a,b,c,d,e,f) (p)->CreateIndexBuffer(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateRenderTarget(p,a,b,c,d,e,f,g,h) (p)->CreateRenderTarget(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h) (p)->CreateDepthStencilSurface(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_UpdateSurface(p,a,b,c,d) (p)->UpdateSurface(a,b,c,d) +#define IDirect3DDevice9Ex_UpdateTexture(p,a,b) (p)->UpdateTexture(a,b) +#define IDirect3DDevice9Ex_GetRenderTargetData(p,a,b) (p)->GetRenderTargetData(a,b) +#define IDirect3DDevice9Ex_GetFrontBufferData(p,a,b) (p)->GetFrontBufferData(a,b) +#define IDirect3DDevice9Ex_StretchRect(p,a,b,c,d,e) (p)->StretchRect(a,b,c,d,e) +#define IDirect3DDevice9Ex_ColorFill(p,a,b,c) (p)->ColorFill(a,b,c) +#define IDirect3DDevice9Ex_CreateOffscreenPlainSurface(p,a,b,c,d,e,f) (p)->CreateOffscreenPlainSurface(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b) +#define IDirect3DDevice9Ex_GetRenderTarget(p,a,b) (p)->GetRenderTarget(a,b) +#define IDirect3DDevice9Ex_SetDepthStencilSurface(p,a) (p)->SetDepthStencilSurface(a) +#define IDirect3DDevice9Ex_GetDepthStencilSurface(p,a) (p)->GetDepthStencilSurface(a) +#define IDirect3DDevice9Ex_BeginScene(p) (p)->BeginScene() +#define IDirect3DDevice9Ex_EndScene(p) (p)->EndScene() +#define IDirect3DDevice9Ex_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_SetTransform(p,a,b) (p)->SetTransform(a,b) +#define IDirect3DDevice9Ex_GetTransform(p,a,b) (p)->GetTransform(a,b) +#define IDirect3DDevice9Ex_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b) +#define IDirect3DDevice9Ex_SetViewport(p,a) (p)->SetViewport(a) +#define IDirect3DDevice9Ex_GetViewport(p,a) (p)->GetViewport(a) +#define IDirect3DDevice9Ex_SetMaterial(p,a) (p)->SetMaterial(a) +#define IDirect3DDevice9Ex_GetMaterial(p,a) (p)->GetMaterial(a) +#define IDirect3DDevice9Ex_SetLight(p,a,b) (p)->SetLight(a,b) +#define IDirect3DDevice9Ex_GetLight(p,a,b) (p)->GetLight(a,b) +#define IDirect3DDevice9Ex_LightEnable(p,a,b) (p)->LightEnable(a,b) +#define IDirect3DDevice9Ex_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b) +#define IDirect3DDevice9Ex_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b) +#define IDirect3DDevice9Ex_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b) +#define IDirect3DDevice9Ex_SetRenderState(p,a,b) (p)->SetRenderState(a,b) +#define IDirect3DDevice9Ex_GetRenderState(p,a,b) (p)->GetRenderState(a,b) +#define IDirect3DDevice9Ex_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b) +#define IDirect3DDevice9Ex_BeginStateBlock(p) (p)->BeginStateBlock() +#define IDirect3DDevice9Ex_EndStateBlock(p,a) (p)->EndStateBlock(a) +#define IDirect3DDevice9Ex_SetClipStatus(p,a) (p)->SetClipStatus(a) +#define IDirect3DDevice9Ex_GetClipStatus(p,a) (p)->GetClipStatus(a) +#define IDirect3DDevice9Ex_GetTexture(p,a,b) (p)->GetTexture(a,b) +#define IDirect3DDevice9Ex_SetTexture(p,a,b) (p)->SetTexture(a,b) +#define IDirect3DDevice9Ex_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c) +#define IDirect3DDevice9Ex_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c) +#define IDirect3DDevice9Ex_GetSamplerState(p,a,b,c) (p)->GetSamplerState(a,b,c) +#define IDirect3DDevice9Ex_SetSamplerState(p,a,b,c) (p)->SetSamplerState(a,b,c) +#define IDirect3DDevice9Ex_ValidateDevice(p,a) (p)->ValidateDevice(a) +#define IDirect3DDevice9Ex_SetPaletteEntries(p,a,b) (p)->SetPaletteEntries(a,b) +#define IDirect3DDevice9Ex_GetPaletteEntries(p,a,b) (p)->GetPaletteEntries(a,b) +#define IDirect3DDevice9Ex_SetCurrentTexturePalette(p,a) (p)->SetCurrentTexturePalette(a) +#define IDirect3DDevice9Ex_GetCurrentTexturePalette(p,a) (p)->GetCurrentTexturePalette(a) +#define IDirect3DDevice9Ex_SetScissorRect(p,a) (p)->SetScissorRect(a) +#define IDirect3DDevice9Ex_GetScissorRect(p,a) (p)->GetScissorRect(a) +#define IDirect3DDevice9Ex_SetSoftwareVertexProcessing(p,a) (p)->SetSoftwareVertexProcessing(a) +#define IDirect3DDevice9Ex_GetSoftwareVertexProcessing(p) (p)->GetSoftwareVertexProcessing() +#define IDirect3DDevice9Ex_SetNPatchMode(p,a) (p)->SetNPatchMode(a) +#define IDirect3DDevice9Ex_GetNPatchMode(p) (p)->GetNPatchMode() +#define IDirect3DDevice9Ex_DrawPrimitive(p,a,b,c) (p)->DrawPrimitive(a,b,c) +#define IDirect3DDevice9Ex_DrawIndexedPrimitive(p,a,b,c,d,e,f) (p)->DrawIndexedPrimitive(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_DrawPrimitiveUP(p,a,b,c,d) (p)->DrawPrimitiveUP(a,b,c,d) +#define IDirect3DDevice9Ex_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_ProcessVertices(p,a,b,c,d,e,f) (p)->ProcessVertices(a,b,c,d,e,f) +#define IDirect3DDevice9Ex_CreateVertexDeclaration(p,a,b) (p)->CreateVertexDeclaration(a,b) +#define IDirect3DDevice9Ex_SetVertexDeclaration(p,a) (p)->SetVertexDeclaration(a) +#define IDirect3DDevice9Ex_GetVertexDeclaration(p,a) (p)->GetVertexDeclaration(a) +#define IDirect3DDevice9Ex_SetFVF(p,a) (p)->SetFVF(a) +#define IDirect3DDevice9Ex_GetFVF(p,a) (p)->GetFVF(a) +#define IDirect3DDevice9Ex_CreateVertexShader(p,a,b) (p)->CreateVertexShader(a,b) +#define IDirect3DDevice9Ex_SetVertexShader(p,a) (p)->SetVertexShader(a) +#define IDirect3DDevice9Ex_GetVertexShader(p,a) (p)->GetVertexShader(a) +#define IDirect3DDevice9Ex_SetVertexShaderConstantF(p,a,b,c) (p)->SetVertexShaderConstantF(a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantF(p,a,b,c) (p)->GetVertexShaderConstantF(a,b,c) +#define IDirect3DDevice9Ex_SetVertexShaderConstantI(p,a,b,c) (p)->SetVertexShaderConstantI(a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantI(p,a,b,c) (p)->GetVertexShaderConstantI(a,b,c) +#define IDirect3DDevice9Ex_SetVertexShaderConstantB(p,a,b,c) (p)->SetVertexShaderConstantB(a,b,c) +#define IDirect3DDevice9Ex_GetVertexShaderConstantB(p,a,b,c) (p)->GetVertexShaderConstantB(a,b,c) +#define IDirect3DDevice9Ex_SetStreamSource(p,a,b,c,d) (p)->SetStreamSource(a,b,c,d) +#define IDirect3DDevice9Ex_GetStreamSource(p,a,b,c,d) (p)->GetStreamSource(a,b,c,d) +#define IDirect3DDevice9Ex_SetStreamSourceFreq(p,a,b) (p)->SetStreamSourceFreq(a,b) +#define IDirect3DDevice9Ex_GetStreamSourceFreq(p,a,b) (p)->GetStreamSourceFreq(a,b) +#define IDirect3DDevice9Ex_SetIndices(p,a) (p)->SetIndices(a) +#define IDirect3DDevice9Ex_GetIndices(p,a) (p)->GetIndices(a) +#define IDirect3DDevice9Ex_CreatePixelShader(p,a,b) (p)->CreatePixelShader(a,b) +#define IDirect3DDevice9Ex_SetPixelShader(p,a) (p)->SetPixelShader(a) +#define IDirect3DDevice9Ex_GetPixelShader(p,a) (p)->GetPixelShader(a) +#define IDirect3DDevice9Ex_SetPixelShaderConstantF(p,a,b,c) (p)->SetPixelShaderConstantF(a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantF(p,a,b,c) (p)->GetPixelShaderConstantF(a,b,c) +#define IDirect3DDevice9Ex_SetPixelShaderConstantI(p,a,b,c) (p)->SetPixelShaderConstantI(a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantI(p,a,b,c) (p)->GetPixelShaderConstantI(a,b,c) +#define IDirect3DDevice9Ex_SetPixelShaderConstantB(p,a,b,c) (p)->SetPixelShaderConstantB(a,b,c) +#define IDirect3DDevice9Ex_GetPixelShaderConstantB(p,a,b,c) (p)->GetPixelShaderConstantB(a,b,c) +#define IDirect3DDevice9Ex_DrawRectPatch(p,a,b,c) (p)->DrawRectPatch(a,b,c) +#define IDirect3DDevice9Ex_DrawTriPatch(p,a,b,c) (p)->DrawTriPatch(a,b,c) +#define IDirect3DDevice9Ex_DeletePatch(p,a) (p)->DeletePatch(a) +#define IDirect3DDevice9Ex_CreateQuery(p,a,b) (p)->CreateQuery(a,b) +#define IDirect3DDevice9Ex_SetConvolutionMonoKernel(p,a,b,c,d) (p)->SetConvolutionMonoKernel(a,b,c,d) +#define IDirect3DDevice9Ex_ComposeRects(p,a,b,c,d,e,f,g,h) (p)->ComposeRects(a,b,c,d,e,f,g,h) +#define IDirect3DDevice9Ex_PresentEx(p,a,b,c,d,e) (p)->PresentEx(a,b,c,d,e) +#define IDirect3DDevice9Ex_GetGPUThreadPriority(p,a) (p)->GetGPUThreadPriority(a) +#define IDirect3DDevice9Ex_SetGPUThreadPriority(p,a) (p)->SetGPUThreadPriority(a) +#define IDirect3DDevice9Ex_WaitForVBlank(p,a) (p)->WaitForVBlank(a) +#define IDirect3DDevice9Ex_CheckResourceResidency(p,a,b) (p)->CheckResourceResidency(a,b) +#define IDirect3DDevice9Ex_SetMaximumFrameLatency(p,a) (p)->SetMaximumFrameLatency(a) +#define IDirect3DDevice9Ex_GetMaximumFrameLatency(p,a) (p)->GetMaximumFrameLatency(a) +#define IDirect3DDevice9Ex_CheckDeviceState(p,a) (p)->CheckDeviceState(a) +#define IDirect3DDevice9Ex_CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i) (p)->CreateRenderTargetEx(a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g) (p)->CreateOffscreenPlainSurfaceEx(a,b,c,d,e,f,g) +#define IDirect3DDevice9Ex_CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i) (p)->CreateDepthStencilSurfaceEx(a,b,c,d,e,f,g,h,i) +#define IDirect3DDevice9Ex_ResetEx(p,a,b) (p)->ResetEx(a,b) +#define IDirect3DDevice9Ex_GetDisplayModeEx(p,a,b,c) (p)->GetDisplayModeEx(a,b,c) +#endif + + + +#undef INTERFACE +#define INTERFACE IDirect3DSwapChain9Ex + +DECLARE_INTERFACE_(IDirect3DSwapChain9Ex, IDirect3DSwapChain9) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DSwapChain9 methods ***/ + STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags) PURE; + STDMETHOD(GetFrontBufferData)(THIS_ IDirect3DSurface9* pDestSurface) PURE; + STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE; + STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE; + STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE; + STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE; + STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE; + STDMETHOD(GetLastPresentCount)(THIS_ UINT* pLastPresentCount) PURE; + STDMETHOD(GetPresentStats)(THIS_ D3DPRESENTSTATS* pPresentationStatistics) PURE; + STDMETHOD(GetDisplayModeEx)(THIS_ D3DDISPLAYMODEEX* pMode,D3DDISPLAYROTATION* pRotation) PURE; +}; + +typedef struct IDirect3DSwapChain9Ex *LPDIRECT3DSWAPCHAIN9EX, *PDIRECT3DSWAPCHAIN9EX; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DSwapChain9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DSwapChain9Ex_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DSwapChain9Ex_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DSwapChain9Ex_Present(p,a,b,c,d,e) (p)->lpVtbl->Present(p,a,b,c,d,e) +#define IDirect3DSwapChain9Ex_GetFrontBufferData(p,a) (p)->lpVtbl->GetFrontBufferData(p,a) +#define IDirect3DSwapChain9Ex_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) +#define IDirect3DSwapChain9Ex_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) +#define IDirect3DSwapChain9Ex_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) +#define IDirect3DSwapChain9Ex_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirect3DSwapChain9Ex_GetPresentParameters(p,a) (p)->lpVtbl->GetPresentParameters(p,a) +#define IDirect3DSwapChain9Ex_GetLastPresentCount(p,a) (p)->lpVtbl->GetLastPresentCount(p,a) +#define IDirect3DSwapChain9Ex_GetPresentStats(p,a) (p)->lpVtbl->GetPresentStats(p,a) +#define IDirect3DSwapChain9Ex_GetDisplayModeEx(p,a,b) (p)->lpVtbl->GetDisplayModeEx(p,a,b) +#else +#define IDirect3DSwapChain9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DSwapChain9Ex_AddRef(p) (p)->AddRef() +#define IDirect3DSwapChain9Ex_Release(p) (p)->Release() +#define IDirect3DSwapChain9Ex_Present(p,a,b,c,d,e) (p)->Present(a,b,c,d,e) +#define IDirect3DSwapChain9Ex_GetFrontBufferData(p,a) (p)->GetFrontBufferData(a) +#define IDirect3DSwapChain9Ex_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c) +#define IDirect3DSwapChain9Ex_GetRasterStatus(p,a) (p)->GetRasterStatus(a) +#define IDirect3DSwapChain9Ex_GetDisplayMode(p,a) (p)->GetDisplayMode(a) +#define IDirect3DSwapChain9Ex_GetDevice(p,a) (p)->GetDevice(a) +#define IDirect3DSwapChain9Ex_GetPresentParameters(p,a) (p)->GetPresentParameters(a) +#define IDirect3DSwapChain9Ex_GetLastPresentCount(p,a) (p)->GetLastPresentCount(a) +#define IDirect3DSwapChain9Ex_GetPresentStats(p,a) (p)->GetPresentStats(a) +#define IDirect3DSwapChain9Ex_GetDisplayModeEx(p,a,b) (p)->GetDisplayModeEx(a,b) +#endif + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + + +#undef INTERFACE +#define INTERFACE IDirect3D9ExOverlayExtension + +DECLARE_INTERFACE_(IDirect3D9ExOverlayExtension, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3D9ExOverlayExtension methods ***/ + STDMETHOD(CheckDeviceOverlayType)(THIS_ UINT Adapter,D3DDEVTYPE DevType,UINT OverlayWidth,UINT OverlayHeight,D3DFORMAT OverlayFormat,D3DDISPLAYMODEEX* pDisplayMode,D3DDISPLAYROTATION DisplayRotation,D3DOVERLAYCAPS* pOverlayCaps) PURE; +}; + +typedef struct IDirect3D9ExOverlayExtension *LPDIRECT3D9EXOVERLAYEXTENSION, *PDIRECT3D9EXOVERLAYEXTENSION; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3D9ExOverlayExtension_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3D9ExOverlayExtension_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3D9ExOverlayExtension_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3D9ExOverlayExtension_CheckDeviceOverlayType(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->CheckDeviceOverlayType(p,a,b,c,d,e,f,g,h) +#else +#define IDirect3D9ExOverlayExtension_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3D9ExOverlayExtension_AddRef(p) (p)->AddRef() +#define IDirect3D9ExOverlayExtension_Release(p) (p)->Release() +#define IDirect3D9ExOverlayExtension_CheckDeviceOverlayType(p,a,b,c,d,e,f,g,h) (p)->CheckDeviceOverlayType(a,b,c,d,e,f,g,h) +#endif + + + +#undef INTERFACE +#define INTERFACE IDirect3DDevice9Video + +DECLARE_INTERFACE_(IDirect3DDevice9Video, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DDevice9Video methods ***/ + STDMETHOD(GetContentProtectionCaps)(THIS_ CONST GUID* pCryptoType,CONST GUID* pDecodeProfile,D3DCONTENTPROTECTIONCAPS* pCaps) PURE; + STDMETHOD(CreateAuthenticatedChannel)(THIS_ D3DAUTHENTICATEDCHANNELTYPE ChannelType,IDirect3DAuthenticatedChannel9** ppAuthenticatedChannel,HANDLE* pChannelHandle) PURE; + STDMETHOD(CreateCryptoSession)(THIS_ CONST GUID* pCryptoType,CONST GUID* pDecodeProfile,IDirect3DCryptoSession9** ppCryptoSession,HANDLE* pCryptoHandle) PURE; +}; + +typedef struct IDirect3DDevice9Video *LPDIRECT3DDEVICE9VIDEO, *PDIRECT3DDEVICE9VIDEO; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DDevice9Video_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DDevice9Video_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DDevice9Video_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DDevice9Video_GetContentProtectionCaps(p,a,b,c) (p)->lpVtbl->GetContentProtectionCaps(p,a,b,c) +#define IDirect3DDevice9Video_CreateAuthenticatedChannel(p,a,b,c) (p)->lpVtbl->CreateAuthenticatedChannel(p,a,b,c) +#define IDirect3DDevice9Video_CreateCryptoSession(p,a,b,c,d) (p)->lpVtbl->CreateCryptoSession(p,a,b,c,d) +#else +#define IDirect3DDevice9Video_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DDevice9Video_AddRef(p) (p)->AddRef() +#define IDirect3DDevice9Video_Release(p) (p)->Release() +#define IDirect3DDevice9Video_GetContentProtectionCaps(p,a,b,c) (p)->GetContentProtectionCaps(a,b,c) +#define IDirect3DDevice9Video_CreateAuthenticatedChannel(p,a,b,c) (p)->CreateAuthenticatedChannel(a,b,c) +#define IDirect3DDevice9Video_CreateCryptoSession(p,a,b,c,d) (p)->CreateCryptoSession(a,b,c,d) +#endif + + + + +#undef INTERFACE +#define INTERFACE IDirect3DAuthenticatedChannel9 + +DECLARE_INTERFACE_(IDirect3DAuthenticatedChannel9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DAuthenticatedChannel9 methods ***/ + STDMETHOD(GetCertificateSize)(THIS_ UINT* pCertificateSize) PURE; + STDMETHOD(GetCertificate)(THIS_ UINT CertifacteSize,BYTE* ppCertificate) PURE; + STDMETHOD(NegotiateKeyExchange)(THIS_ UINT DataSize,VOID* pData) PURE; + STDMETHOD(Query)(THIS_ UINT InputSize,CONST VOID* pInput,UINT OutputSize,VOID* pOutput) PURE; + STDMETHOD(Configure)(THIS_ UINT InputSize,CONST VOID* pInput,D3DAUTHENTICATEDCHANNEL_CONFIGURE_OUTPUT* pOutput) PURE; +}; + +typedef struct IDirect3DAuthenticatedChannel9 *LPDIRECT3DAUTHENTICATEDCHANNEL9, *PDIRECT3DAUTHENTICATEDCHANNEL9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DAuthenticatedChannel9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DAuthenticatedChannel9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DAuthenticatedChannel9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DAuthenticatedChannel9_GetCertificateSize(p,a) (p)->lpVtbl->GetCertificateSize(p,a) +#define IDirect3DAuthenticatedChannel9_GetCertificate(p,a,b) (p)->lpVtbl->GetCertificate(p,a,b) +#define IDirect3DAuthenticatedChannel9_NegotiateKeyExchange(p,a,b) (p)->lpVtbl->NegotiateKeyExchange(p,a,b) +#define IDirect3DAuthenticatedChannel9_Query(p,a,b,c,d) (p)->lpVtbl->Query(p,a,b,c,d) +#define IDirect3DAuthenticatedChannel9_Configure(p,a,b,c) (p)->lpVtbl->Configure(p,a,b,c) +#else +#define IDirect3DAuthenticatedChannel9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DAuthenticatedChannel9_AddRef(p) (p)->AddRef() +#define IDirect3DAuthenticatedChannel9_Release(p) (p)->Release() +#define IDirect3DAuthenticatedChannel9_GetCertificateSize(p,a) (p)->GetCertificateSize(a) +#define IDirect3DAuthenticatedChannel9_GetCertificate(p,a,b) (p)->GetCertificate(a,b) +#define IDirect3DAuthenticatedChannel9_NegotiateKeyExchange(p,a,b) (p)->NegotiateKeyExchange(a,b) +#define IDirect3DAuthenticatedChannel9_Query(p,a,b,c,d) (p)->Query(a,b,c,d) +#define IDirect3DAuthenticatedChannel9_Configure(p,a,b,c) (p)->Configure(a,b,c) +#endif + + + +#undef INTERFACE +#define INTERFACE IDirect3DCryptoSession9 + +DECLARE_INTERFACE_(IDirect3DCryptoSession9, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirect3DCryptoSession9 methods ***/ + STDMETHOD(GetCertificateSize)(THIS_ UINT* pCertificateSize) PURE; + STDMETHOD(GetCertificate)(THIS_ UINT CertifacteSize,BYTE* ppCertificate) PURE; + STDMETHOD(NegotiateKeyExchange)(THIS_ UINT DataSize,VOID* pData) PURE; + STDMETHOD(EncryptionBlt)(THIS_ IDirect3DSurface9* pSrcSurface,IDirect3DSurface9* pDstSurface,UINT DstSurfaceSize,VOID* pIV) PURE; + STDMETHOD(DecryptionBlt)(THIS_ IDirect3DSurface9* pSrcSurface,IDirect3DSurface9* pDstSurface,UINT SrcSurfaceSize,D3DENCRYPTED_BLOCK_INFO* pEncryptedBlockInfo,VOID* pContentKey,VOID* pIV) PURE; + STDMETHOD(GetSurfacePitch)(THIS_ IDirect3DSurface9* pSrcSurface,UINT* pSurfacePitch) PURE; + STDMETHOD(StartSessionKeyRefresh)(THIS_ VOID* pRandomNumber,UINT RandomNumberSize) PURE; + STDMETHOD(FinishSessionKeyRefresh)(THIS) PURE; + STDMETHOD(GetEncryptionBltKey)(THIS_ VOID* pReadbackKey,UINT KeySize) PURE; +}; + +typedef struct IDirect3DCryptoSession9 *LPDIRECT3DCRYPTOSESSION9, *PDIRECT3DCRYPTOSESSION9; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirect3DCryptoSession9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirect3DCryptoSession9_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirect3DCryptoSession9_Release(p) (p)->lpVtbl->Release(p) +#define IDirect3DCryptoSession9_GetCertificateSize(p,a) (p)->lpVtbl->GetCertificateSize(p,a) +#define IDirect3DCryptoSession9_GetCertificate(p,a,b) (p)->lpVtbl->GetCertificate(p,a,b) +#define IDirect3DCryptoSession9_NegotiateKeyExchange(p,a,b) (p)->lpVtbl->NegotiateKeyExchange(p,a,b) +#define IDirect3DCryptoSession9_EncryptionBlt(p,a,b,c,d) (p)->lpVtbl->EncryptionBlt(p,a,b,c,d) +#define IDirect3DCryptoSession9_DecryptionBlt(p,a,b,c,d,e,f) (p)->lpVtbl->DecryptionBlt(p,a,b,c,d,e,f) +#define IDirect3DCryptoSession9_GetSurfacePitch(p,a,b) (p)->lpVtbl->GetSurfacePitch(p,a,b) +#define IDirect3DCryptoSession9_StartSessionKeyRefresh(p,a,b) (p)->lpVtbl->StartSessionKeyRefresh(p,a,b) +#define IDirect3DCryptoSession9_FinishSessionKeyRefresh(p) (p)->lpVtbl->FinishSessionKeyRefresh(p) +#define IDirect3DCryptoSession9_GetEncryptionBltKey(p,a,b) (p)->lpVtbl->GetEncryptionBltKey(p,a,b) +#else +#define IDirect3DCryptoSession9_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirect3DCryptoSession9_AddRef(p) (p)->AddRef() +#define IDirect3DCryptoSession9_Release(p) (p)->Release() +#define IDirect3DCryptoSession9_GetCertificateSize(p,a) (p)->GetCertificateSize(a) +#define IDirect3DCryptoSession9_GetCertificate(p,a,b) (p)->GetCertificate(a,b) +#define IDirect3DCryptoSession9_NegotiateKeyExchange(p,a,b) (p)->NegotiateKeyExchange(a,b) +#define IDirect3DCryptoSession9_EncryptionBlt(p,a,b,c,d) (p)->EncryptionBlt(a,b,c,d) +#define IDirect3DCryptoSession9_DecryptionBlt(p,a,b,c,d,e,f) (p)->DecryptionBlt(a,b,c,d,e,f) +#define IDirect3DCryptoSession9_GetSurfacePitch(p,a,b) (p)->GetSurfacePitch(a,b) +#define IDirect3DCryptoSession9_StartSessionKeyRefresh(p,a,b) (p)->StartSessionKeyRefresh(a,b) +#define IDirect3DCryptoSession9_FinishSessionKeyRefresh(p) (p)->FinishSessionKeyRefresh() +#define IDirect3DCryptoSession9_GetEncryptionBltKey(p,a,b) (p)->GetEncryptionBltKey(a,b) +#endif + + +#ifdef __cplusplus +}; +#endif + +#endif /* (DIRECT3D_VERSION >= 0x0900) */ +#endif /* _D3D_H_ */ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3d9caps.h b/Src/Decoder_H264_ALL/D3D/include/d3d9caps.h new file mode 100644 index 0000000..6fdcbed --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3d9caps.h @@ -0,0 +1,563 @@ +/*==========================================================================; + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: d3d9caps.h + * Content: Direct3D capabilities include file + * + ***************************************************************************/ + +#ifndef _d3d9CAPS_H +#define _d3d9CAPS_H + +#ifndef DIRECT3D_VERSION +#define DIRECT3D_VERSION 0x0900 +#endif //DIRECT3D_VERSION + +// include this file content only if compiling for DX9 interfaces +#if(DIRECT3D_VERSION >= 0x0900) + +#if defined(_X86_) || defined(_IA64_) +#pragma pack(4) +#endif + +typedef struct _D3DVSHADERCAPS2_0 +{ + DWORD Caps; + INT DynamicFlowControlDepth; + INT NumTemps; + INT StaticFlowControlDepth; +} D3DVSHADERCAPS2_0; + +#define D3DVS20CAPS_PREDICATION (1<<0) + +#define D3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH 24 +#define D3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH 0 +#define D3DVS20_MAX_NUMTEMPS 32 +#define D3DVS20_MIN_NUMTEMPS 12 +#define D3DVS20_MAX_STATICFLOWCONTROLDEPTH 4 +#define D3DVS20_MIN_STATICFLOWCONTROLDEPTH 1 + +typedef struct _D3DPSHADERCAPS2_0 +{ + DWORD Caps; + INT DynamicFlowControlDepth; + INT NumTemps; + INT StaticFlowControlDepth; + INT NumInstructionSlots; +} D3DPSHADERCAPS2_0; + +#define D3DPS20CAPS_ARBITRARYSWIZZLE (1<<0) +#define D3DPS20CAPS_GRADIENTINSTRUCTIONS (1<<1) +#define D3DPS20CAPS_PREDICATION (1<<2) +#define D3DPS20CAPS_NODEPENDENTREADLIMIT (1<<3) +#define D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT (1<<4) + +#define D3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH 24 +#define D3DPS20_MIN_DYNAMICFLOWCONTROLDEPTH 0 +#define D3DPS20_MAX_NUMTEMPS 32 +#define D3DPS20_MIN_NUMTEMPS 12 +#define D3DPS20_MAX_STATICFLOWCONTROLDEPTH 4 +#define D3DPS20_MIN_STATICFLOWCONTROLDEPTH 0 +#define D3DPS20_MAX_NUMINSTRUCTIONSLOTS 512 +#define D3DPS20_MIN_NUMINSTRUCTIONSLOTS 96 + +#define D3DMIN30SHADERINSTRUCTIONS 512 +#define D3DMAX30SHADERINSTRUCTIONS 32768 + + +typedef struct _D3DOVERLAYCAPS +{ + UINT Caps; + UINT MaxOverlayDisplayWidth; + UINT MaxOverlayDisplayHeight; +} D3DOVERLAYCAPS; + +#define D3DOVERLAYCAPS_FULLRANGERGB 0x00000001 +#define D3DOVERLAYCAPS_LIMITEDRANGERGB 0x00000002 +#define D3DOVERLAYCAPS_YCbCr_BT601 0x00000004 +#define D3DOVERLAYCAPS_YCbCr_BT709 0x00000008 +#define D3DOVERLAYCAPS_YCbCr_BT601_xvYCC 0x00000010 +#define D3DOVERLAYCAPS_YCbCr_BT709_xvYCC 0x00000020 +#define D3DOVERLAYCAPS_STRETCHX 0x00000040 +#define D3DOVERLAYCAPS_STRETCHY 0x00000080 + + +typedef struct _D3DCONTENTPROTECTIONCAPS +{ + DWORD Caps; + GUID KeyExchangeType; + UINT BufferAlignmentStart; + UINT BlockAlignmentSize; + ULONGLONG ProtectedMemorySize; +} D3DCONTENTPROTECTIONCAPS; + +#define D3DCPCAPS_SOFTWARE 0x00000001 +#define D3DCPCAPS_HARDWARE 0x00000002 +#define D3DCPCAPS_PROTECTIONALWAYSON 0x00000004 +#define D3DCPCAPS_PARTIALDECRYPTION 0x00000008 +#define D3DCPCAPS_CONTENTKEY 0x00000010 +#define D3DCPCAPS_FRESHENSESSIONKEY 0x00000020 +#define D3DCPCAPS_ENCRYPTEDREADBACK 0x00000040 +#define D3DCPCAPS_ENCRYPTEDREADBACKKEY 0x00000080 +#define D3DCPCAPS_SEQUENTIAL_CTR_IV 0x00000100 +#define D3DCPCAPS_ENCRYPTSLICEDATAONLY 0x00000200 + +DEFINE_GUID(D3DCRYPTOTYPE_AES128_CTR, +0x9b6bd711, 0x4f74, 0x41c9, 0x9e, 0x7b, 0xb, 0xe2, 0xd7, 0xd9, 0x3b, 0x4f); +DEFINE_GUID(D3DCRYPTOTYPE_PROPRIETARY, +0xab4e9afd, 0x1d1c, 0x46e6, 0xa7, 0x2f, 0x8, 0x69, 0x91, 0x7b, 0xd, 0xe8); + +DEFINE_GUID(D3DKEYEXCHANGE_RSAES_OAEP, +0xc1949895, 0xd72a, 0x4a1d, 0x8e, 0x5d, 0xed, 0x85, 0x7d, 0x17, 0x15, 0x20); +DEFINE_GUID(D3DKEYEXCHANGE_DXVA, +0x43d3775c, 0x38e5, 0x4924, 0x8d, 0x86, 0xd3, 0xfc, 0xcf, 0x15, 0x3e, 0x9b); + + +typedef struct _D3DCAPS9 +{ + /* Device Info */ + D3DDEVTYPE DeviceType; + UINT AdapterOrdinal; + + /* Caps from DX7 Draw */ + DWORD Caps; + DWORD Caps2; + DWORD Caps3; + DWORD PresentationIntervals; + + /* Cursor Caps */ + DWORD CursorCaps; + + /* 3D Device Caps */ + DWORD DevCaps; + + DWORD PrimitiveMiscCaps; + DWORD RasterCaps; + DWORD ZCmpCaps; + DWORD SrcBlendCaps; + DWORD DestBlendCaps; + DWORD AlphaCmpCaps; + DWORD ShadeCaps; + DWORD TextureCaps; + DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture9's + DWORD CubeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DCubeTexture9's + DWORD VolumeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DVolumeTexture9's + DWORD TextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DTexture9's + DWORD VolumeTextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DVolumeTexture9's + + DWORD LineCaps; // D3DLINECAPS + + DWORD MaxTextureWidth, MaxTextureHeight; + DWORD MaxVolumeExtent; + + DWORD MaxTextureRepeat; + DWORD MaxTextureAspectRatio; + DWORD MaxAnisotropy; + float MaxVertexW; + + float GuardBandLeft; + float GuardBandTop; + float GuardBandRight; + float GuardBandBottom; + + float ExtentsAdjust; + DWORD StencilCaps; + + DWORD FVFCaps; + DWORD TextureOpCaps; + DWORD MaxTextureBlendStages; + DWORD MaxSimultaneousTextures; + + DWORD VertexProcessingCaps; + DWORD MaxActiveLights; + DWORD MaxUserClipPlanes; + DWORD MaxVertexBlendMatrices; + DWORD MaxVertexBlendMatrixIndex; + + float MaxPointSize; + + DWORD MaxPrimitiveCount; // max number of primitives per DrawPrimitive call + DWORD MaxVertexIndex; + DWORD MaxStreams; + DWORD MaxStreamStride; // max stride for SetStreamSource + + DWORD VertexShaderVersion; + DWORD MaxVertexShaderConst; // number of vertex shader constant registers + + DWORD PixelShaderVersion; + float PixelShader1xMaxValue; // max value storable in registers of ps.1.x shaders + + // Here are the DX9 specific ones + DWORD DevCaps2; + + float MaxNpatchTessellationLevel; + DWORD Reserved5; + + UINT MasterAdapterOrdinal; // ordinal of master adaptor for adapter group + UINT AdapterOrdinalInGroup; // ordinal inside the adapter group + UINT NumberOfAdaptersInGroup; // number of adapters in this adapter group (only if master) + DWORD DeclTypes; // Data types, supported in vertex declarations + DWORD NumSimultaneousRTs; // Will be at least 1 + DWORD StretchRectFilterCaps; // Filter caps supported by StretchRect + D3DVSHADERCAPS2_0 VS20Caps; + D3DPSHADERCAPS2_0 PS20Caps; + DWORD VertexTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture9's for texture, used in vertex shaders + DWORD MaxVShaderInstructionsExecuted; // maximum number of vertex shader instructions that can be executed + DWORD MaxPShaderInstructionsExecuted; // maximum number of pixel shader instructions that can be executed + DWORD MaxVertexShader30InstructionSlots; + DWORD MaxPixelShader30InstructionSlots; +} D3DCAPS9; + +// +// BIT DEFINES FOR D3DCAPS9 DWORD MEMBERS +// + +// +// Caps +// +#define D3DCAPS_OVERLAY 0x00000800L +#define D3DCAPS_READ_SCANLINE 0x00020000L + +// +// Caps2 +// +#define D3DCAPS2_FULLSCREENGAMMA 0x00020000L +#define D3DCAPS2_CANCALIBRATEGAMMA 0x00100000L +#define D3DCAPS2_RESERVED 0x02000000L +#define D3DCAPS2_CANMANAGERESOURCE 0x10000000L +#define D3DCAPS2_DYNAMICTEXTURES 0x20000000L +#define D3DCAPS2_CANAUTOGENMIPMAP 0x40000000L + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +#define D3DCAPS2_CANSHARERESOURCE 0x80000000L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + +// +// Caps3 +// +#define D3DCAPS3_RESERVED 0x8000001fL + +// Indicates that the device can respect the ALPHABLENDENABLE render state +// when fullscreen while using the FLIP or DISCARD swap effect. +// COPY and COPYVSYNC swap effects work whether or not this flag is set. +#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD 0x00000020L + +// Indicates that the device can perform a gamma correction from +// a windowed back buffer containing linear content to the sRGB desktop. +#define D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION 0x00000080L + +#define D3DCAPS3_COPY_TO_VIDMEM 0x00000100L /* Device can acclerate copies from sysmem to local vidmem */ +#define D3DCAPS3_COPY_TO_SYSTEMMEM 0x00000200L /* Device can acclerate copies from local vidmem to sysmem */ +#define D3DCAPS3_DXVAHD 0x00000400L + + +// +// PresentationIntervals +// +#define D3DPRESENT_INTERVAL_DEFAULT 0x00000000L +#define D3DPRESENT_INTERVAL_ONE 0x00000001L +#define D3DPRESENT_INTERVAL_TWO 0x00000002L +#define D3DPRESENT_INTERVAL_THREE 0x00000004L +#define D3DPRESENT_INTERVAL_FOUR 0x00000008L +#define D3DPRESENT_INTERVAL_IMMEDIATE 0x80000000L + +// +// CursorCaps +// +// Driver supports HW color cursor in at least hi-res modes(height >=400) +#define D3DCURSORCAPS_COLOR 0x00000001L +// Driver supports HW cursor also in low-res modes(height < 400) +#define D3DCURSORCAPS_LOWRES 0x00000002L + +// +// DevCaps +// +#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */ +#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */ +#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */ +#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */ +#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */ +#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */ +#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */ +#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */ +#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */ +#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */ +#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */ +#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/ +#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */ +#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */ +#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */ +#define D3DDEVCAPS_PUREDEVICE 0x00100000L /* Device supports D3DCREATE_PUREDEVICE */ +#define D3DDEVCAPS_QUINTICRTPATCHES 0x00200000L /* Device supports quintic Beziers and BSplines */ +#define D3DDEVCAPS_RTPATCHES 0x00400000L /* Device supports Rect and Tri patches */ +#define D3DDEVCAPS_RTPATCHHANDLEZERO 0x00800000L /* Indicates that RT Patches may be drawn efficiently using handle 0 */ +#define D3DDEVCAPS_NPATCHES 0x01000000L /* Device supports N-Patches */ + +// +// PrimitiveMiscCaps +// +#define D3DPMISCCAPS_MASKZ 0x00000002L +#define D3DPMISCCAPS_CULLNONE 0x00000010L +#define D3DPMISCCAPS_CULLCW 0x00000020L +#define D3DPMISCCAPS_CULLCCW 0x00000040L +#define D3DPMISCCAPS_COLORWRITEENABLE 0x00000080L +#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x00000100L /* Device correctly clips scaled points to clip planes */ +#define D3DPMISCCAPS_CLIPTLVERTS 0x00000200L /* device will clip post-transformed vertex primitives */ +#define D3DPMISCCAPS_TSSARGTEMP 0x00000400L /* device supports D3DTA_TEMP for temporary register */ +#define D3DPMISCCAPS_BLENDOP 0x00000800L /* device supports D3DRS_BLENDOP */ +#define D3DPMISCCAPS_NULLREFERENCE 0x00001000L /* Reference Device that doesnt render */ +#define D3DPMISCCAPS_INDEPENDENTWRITEMASKS 0x00004000L /* Device supports independent write masks for MET or MRT */ +#define D3DPMISCCAPS_PERSTAGECONSTANT 0x00008000L /* Device supports per-stage constants */ +#define D3DPMISCCAPS_FOGANDSPECULARALPHA 0x00010000L /* Device supports separate fog and specular alpha (many devices + use the specular alpha channel to store fog factor) */ +#define D3DPMISCCAPS_SEPARATEALPHABLEND 0x00020000L /* Device supports separate blend settings for the alpha channel */ +#define D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS 0x00040000L /* Device supports different bit depths for MRT */ +#define D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING 0x00080000L /* Device supports post-pixel shader operations for MRT */ +#define D3DPMISCCAPS_FOGVERTEXCLAMPED 0x00100000L /* Device clamps fog blend factor per vertex */ + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +#define D3DPMISCCAPS_POSTBLENDSRGBCONVERT 0x00200000L /* Indicates device can perform conversion to sRGB after blending. */ + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + +// +// LineCaps +// +#define D3DLINECAPS_TEXTURE 0x00000001L +#define D3DLINECAPS_ZTEST 0x00000002L +#define D3DLINECAPS_BLEND 0x00000004L +#define D3DLINECAPS_ALPHACMP 0x00000008L +#define D3DLINECAPS_FOG 0x00000010L +#define D3DLINECAPS_ANTIALIAS 0x00000020L + +// +// RasterCaps +// +#define D3DPRASTERCAPS_DITHER 0x00000001L +#define D3DPRASTERCAPS_ZTEST 0x00000010L +#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L +#define D3DPRASTERCAPS_FOGTABLE 0x00000100L +#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L +#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L +#define D3DPRASTERCAPS_FOGRANGE 0x00010000L +#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L +#define D3DPRASTERCAPS_WBUFFER 0x00040000L +#define D3DPRASTERCAPS_WFOG 0x00100000L +#define D3DPRASTERCAPS_ZFOG 0x00200000L +#define D3DPRASTERCAPS_COLORPERSPECTIVE 0x00400000L /* Device iterates colors perspective correct */ +#define D3DPRASTERCAPS_SCISSORTEST 0x01000000L +#define D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS 0x02000000L +#define D3DPRASTERCAPS_DEPTHBIAS 0x04000000L +#define D3DPRASTERCAPS_MULTISAMPLE_TOGGLE 0x08000000L + +// +// ZCmpCaps, AlphaCmpCaps +// +#define D3DPCMPCAPS_NEVER 0x00000001L +#define D3DPCMPCAPS_LESS 0x00000002L +#define D3DPCMPCAPS_EQUAL 0x00000004L +#define D3DPCMPCAPS_LESSEQUAL 0x00000008L +#define D3DPCMPCAPS_GREATER 0x00000010L +#define D3DPCMPCAPS_NOTEQUAL 0x00000020L +#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L +#define D3DPCMPCAPS_ALWAYS 0x00000080L + +// +// SourceBlendCaps, DestBlendCaps +// +#define D3DPBLENDCAPS_ZERO 0x00000001L +#define D3DPBLENDCAPS_ONE 0x00000002L +#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L +#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L +#define D3DPBLENDCAPS_SRCALPHA 0x00000010L +#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L +#define D3DPBLENDCAPS_DESTALPHA 0x00000040L +#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L +#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L +#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L +#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L +#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L +#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L +#define D3DPBLENDCAPS_BLENDFACTOR 0x00002000L /* Supports both D3DBLEND_BLENDFACTOR and D3DBLEND_INVBLENDFACTOR */ + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +#define D3DPBLENDCAPS_SRCCOLOR2 0x00004000L +#define D3DPBLENDCAPS_INVSRCCOLOR2 0x00008000L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + +// +// ShadeCaps +// +#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L +#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L +#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L +#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L + +// +// TextureCaps +// +#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L /* Perspective-correct texturing is supported */ +#define D3DPTEXTURECAPS_POW2 0x00000002L /* Power-of-2 texture dimensions are required - applies to non-Cube/Volume textures only. */ +#define D3DPTEXTURECAPS_ALPHA 0x00000004L /* Alpha in texture pixels is supported */ +#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L /* Only square textures are supported */ +#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L /* Texture indices are not scaled by the texture size prior to interpolation */ +#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L /* Device can draw alpha from texture palettes */ +// Device can use non-POW2 textures if: +// 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage +// 2) D3DRS_WRAP(N) is zero for this texture's coordinates +// 3) mip mapping is not enabled (use magnification filter only) +#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L +#define D3DPTEXTURECAPS_PROJECTED 0x00000400L /* Device can do D3DTTFF_PROJECTED */ +#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L /* Device can do cubemap textures */ +#define D3DPTEXTURECAPS_VOLUMEMAP 0x00002000L /* Device can do volume textures */ +#define D3DPTEXTURECAPS_MIPMAP 0x00004000L /* Device can do mipmapped textures */ +#define D3DPTEXTURECAPS_MIPVOLUMEMAP 0x00008000L /* Device can do mipmapped volume textures */ +#define D3DPTEXTURECAPS_MIPCUBEMAP 0x00010000L /* Device can do mipmapped cube maps */ +#define D3DPTEXTURECAPS_CUBEMAP_POW2 0x00020000L /* Device requires that cubemaps be power-of-2 dimension */ +#define D3DPTEXTURECAPS_VOLUMEMAP_POW2 0x00040000L /* Device requires that volume maps be power-of-2 dimension */ +#define D3DPTEXTURECAPS_NOPROJECTEDBUMPENV 0x00200000L /* Device does not support projected bump env lookup operation + in programmable and fixed function pixel shaders */ + +// +// TextureFilterCaps, StretchRectFilterCaps +// +#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L /* Min Filter */ +#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L +#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L +#define D3DPTFILTERCAPS_MINFPYRAMIDALQUAD 0x00000800L +#define D3DPTFILTERCAPS_MINFGAUSSIANQUAD 0x00001000L +#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L /* Mip Filter */ +#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +#define D3DPTFILTERCAPS_CONVOLUTIONMONO 0x00040000L /* Min and Mag for the convolution mono filter */ + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + +#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L /* Mag Filter */ +#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L +#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L +#define D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD 0x08000000L +#define D3DPTFILTERCAPS_MAGFGAUSSIANQUAD 0x10000000L + +// +// TextureAddressCaps +// +#define D3DPTADDRESSCAPS_WRAP 0x00000001L +#define D3DPTADDRESSCAPS_MIRROR 0x00000002L +#define D3DPTADDRESSCAPS_CLAMP 0x00000004L +#define D3DPTADDRESSCAPS_BORDER 0x00000008L +#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L +#define D3DPTADDRESSCAPS_MIRRORONCE 0x00000020L + +// +// StencilCaps +// +#define D3DSTENCILCAPS_KEEP 0x00000001L +#define D3DSTENCILCAPS_ZERO 0x00000002L +#define D3DSTENCILCAPS_REPLACE 0x00000004L +#define D3DSTENCILCAPS_INCRSAT 0x00000008L +#define D3DSTENCILCAPS_DECRSAT 0x00000010L +#define D3DSTENCILCAPS_INVERT 0x00000020L +#define D3DSTENCILCAPS_INCR 0x00000040L +#define D3DSTENCILCAPS_DECR 0x00000080L +#define D3DSTENCILCAPS_TWOSIDED 0x00000100L + +// +// TextureOpCaps +// +#define D3DTEXOPCAPS_DISABLE 0x00000001L +#define D3DTEXOPCAPS_SELECTARG1 0x00000002L +#define D3DTEXOPCAPS_SELECTARG2 0x00000004L +#define D3DTEXOPCAPS_MODULATE 0x00000008L +#define D3DTEXOPCAPS_MODULATE2X 0x00000010L +#define D3DTEXOPCAPS_MODULATE4X 0x00000020L +#define D3DTEXOPCAPS_ADD 0x00000040L +#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L +#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L +#define D3DTEXOPCAPS_SUBTRACT 0x00000200L +#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L +#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L +#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L +#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L +#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L +#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L +#define D3DTEXOPCAPS_PREMODULATE 0x00010000L +#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L +#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L +#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L +#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L +#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L +#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L +#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L +#define D3DTEXOPCAPS_MULTIPLYADD 0x01000000L +#define D3DTEXOPCAPS_LERP 0x02000000L + +// +// FVFCaps +// +#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */ +#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */ +#define D3DFVFCAPS_PSIZE 0x00100000L /* Device can receive point size */ + +// +// VertexProcessingCaps +// +#define D3DVTXPCAPS_TEXGEN 0x00000001L /* device can do texgen */ +#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L /* device can do DX7-level colormaterialsource ops */ +#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L /* device can do directional lights */ +#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L /* device can do positional lights (includes point and spot) */ +#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L /* device can do local viewer */ +#define D3DVTXPCAPS_TWEENING 0x00000040L /* device can do vertex tweening */ +#define D3DVTXPCAPS_TEXGEN_SPHEREMAP 0x00000100L /* device supports D3DTSS_TCI_SPHEREMAP */ +#define D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER 0x00000200L /* device does not support TexGen in non-local + viewer mode */ + +// +// DevCaps2 +// +#define D3DDEVCAPS2_STREAMOFFSET 0x00000001L /* Device supports offsets in streams. Must be set by DX9 drivers */ +#define D3DDEVCAPS2_DMAPNPATCH 0x00000002L /* Device supports displacement maps for N-Patches*/ +#define D3DDEVCAPS2_ADAPTIVETESSRTPATCH 0x00000004L /* Device supports adaptive tesselation of RT-patches*/ +#define D3DDEVCAPS2_ADAPTIVETESSNPATCH 0x00000008L /* Device supports adaptive tesselation of N-patches*/ +#define D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES 0x00000010L /* Device supports StretchRect calls with a texture as the source*/ +#define D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH 0x00000020L /* Device supports presampled displacement maps for N-Patches */ +#define D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET 0x00000040L /* Vertex elements in a vertex declaration can share the same stream offset */ + +// +// DeclTypes +// +#define D3DDTCAPS_UBYTE4 0x00000001L +#define D3DDTCAPS_UBYTE4N 0x00000002L +#define D3DDTCAPS_SHORT2N 0x00000004L +#define D3DDTCAPS_SHORT4N 0x00000008L +#define D3DDTCAPS_USHORT2N 0x00000010L +#define D3DDTCAPS_USHORT4N 0x00000020L +#define D3DDTCAPS_UDEC3 0x00000040L +#define D3DDTCAPS_DEC3N 0x00000080L +#define D3DDTCAPS_FLOAT16_2 0x00000100L +#define D3DDTCAPS_FLOAT16_4 0x00000200L + + +#pragma pack() + +#endif /* (DIRECT3D_VERSION >= 0x0900) */ +#endif /* _d3d9CAPS_H_ */ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3d9types.h b/Src/Decoder_H264_ALL/D3D/include/d3d9types.h new file mode 100644 index 0000000..b03f77f --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3d9types.h @@ -0,0 +1,2415 @@ +/*==========================================================================; + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: d3d9types.h + * Content: Direct3D capabilities include file + * + ***************************************************************************/ + +#ifndef _d3d9TYPES_H_ +#define _d3d9TYPES_H_ + +#ifndef DIRECT3D_VERSION +#define DIRECT3D_VERSION 0x0900 +#endif //DIRECT3D_VERSION + +// include this file content only if compiling for DX9 interfaces +#if(DIRECT3D_VERSION >= 0x0900) + +#include + +#if _MSC_VER >= 1200 +#pragma warning(push) +#endif +#pragma warning(disable:4201) // anonymous unions warning +#if defined(_X86_) || defined(_IA64_) +#pragma pack(4) +#endif + +// D3DCOLOR is equivalent to D3DFMT_A8R8G8B8 +#ifndef D3DCOLOR_DEFINED +typedef DWORD D3DCOLOR; +#define D3DCOLOR_DEFINED +#endif + +// maps unsigned 8 bits/channel to D3DCOLOR +#define D3DCOLOR_ARGB(a,r,g,b) \ + ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff))) +#define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b) +#define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b) + +#define D3DCOLOR_XYUV(y,u,v) D3DCOLOR_ARGB(0xff,y,u,v) +#define D3DCOLOR_AYUV(a,y,u,v) D3DCOLOR_ARGB(a,y,u,v) + +// maps floating point channels (0.f to 1.f range) to D3DCOLOR +#define D3DCOLOR_COLORVALUE(r,g,b,a) \ + D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f)) + + +#ifndef D3DVECTOR_DEFINED +typedef struct _D3DVECTOR { + float x; + float y; + float z; +} D3DVECTOR; +#define D3DVECTOR_DEFINED +#endif + +#ifndef D3DCOLORVALUE_DEFINED +typedef struct _D3DCOLORVALUE { + float r; + float g; + float b; + float a; +} D3DCOLORVALUE; +#define D3DCOLORVALUE_DEFINED +#endif + +#ifndef D3DRECT_DEFINED +typedef struct _D3DRECT { + LONG x1; + LONG y1; + LONG x2; + LONG y2; +} D3DRECT; +#define D3DRECT_DEFINED +#endif + +#ifndef D3DMATRIX_DEFINED +typedef struct _D3DMATRIX { + union { + struct { + float _11, _12, _13, _14; + float _21, _22, _23, _24; + float _31, _32, _33, _34; + float _41, _42, _43, _44; + + }; + float m[4][4]; + }; +} D3DMATRIX; +#define D3DMATRIX_DEFINED +#endif + +typedef struct _D3DVIEWPORT9 { + DWORD X; + DWORD Y; /* Viewport Top left */ + DWORD Width; + DWORD Height; /* Viewport Dimensions */ + float MinZ; /* Min/max of clip Volume */ + float MaxZ; +} D3DVIEWPORT9; + +/* + * Values for clip fields. + */ + +// Max number of user clipping planes, supported in D3D. +#define D3DMAXUSERCLIPPLANES 32 + +// These bits could be ORed together to use with D3DRS_CLIPPLANEENABLE +// +#define D3DCLIPPLANE0 (1 << 0) +#define D3DCLIPPLANE1 (1 << 1) +#define D3DCLIPPLANE2 (1 << 2) +#define D3DCLIPPLANE3 (1 << 3) +#define D3DCLIPPLANE4 (1 << 4) +#define D3DCLIPPLANE5 (1 << 5) + +// The following bits are used in the ClipUnion and ClipIntersection +// members of the D3DCLIPSTATUS9 +// + +#define D3DCS_LEFT 0x00000001L +#define D3DCS_RIGHT 0x00000002L +#define D3DCS_TOP 0x00000004L +#define D3DCS_BOTTOM 0x00000008L +#define D3DCS_FRONT 0x00000010L +#define D3DCS_BACK 0x00000020L +#define D3DCS_PLANE0 0x00000040L +#define D3DCS_PLANE1 0x00000080L +#define D3DCS_PLANE2 0x00000100L +#define D3DCS_PLANE3 0x00000200L +#define D3DCS_PLANE4 0x00000400L +#define D3DCS_PLANE5 0x00000800L + +#define D3DCS_ALL (D3DCS_LEFT | \ + D3DCS_RIGHT | \ + D3DCS_TOP | \ + D3DCS_BOTTOM | \ + D3DCS_FRONT | \ + D3DCS_BACK | \ + D3DCS_PLANE0 | \ + D3DCS_PLANE1 | \ + D3DCS_PLANE2 | \ + D3DCS_PLANE3 | \ + D3DCS_PLANE4 | \ + D3DCS_PLANE5) + +typedef struct _D3DCLIPSTATUS9 { + DWORD ClipUnion; + DWORD ClipIntersection; +} D3DCLIPSTATUS9; + +typedef struct _D3DMATERIAL9 { + D3DCOLORVALUE Diffuse; /* Diffuse color RGBA */ + D3DCOLORVALUE Ambient; /* Ambient color RGB */ + D3DCOLORVALUE Specular; /* Specular 'shininess' */ + D3DCOLORVALUE Emissive; /* Emissive color RGB */ + float Power; /* Sharpness if specular highlight */ +} D3DMATERIAL9; + +typedef enum _D3DLIGHTTYPE { + D3DLIGHT_POINT = 1, + D3DLIGHT_SPOT = 2, + D3DLIGHT_DIRECTIONAL = 3, + D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DLIGHTTYPE; + +typedef struct _D3DLIGHT9 { + D3DLIGHTTYPE Type; /* Type of light source */ + D3DCOLORVALUE Diffuse; /* Diffuse color of light */ + D3DCOLORVALUE Specular; /* Specular color of light */ + D3DCOLORVALUE Ambient; /* Ambient color of light */ + D3DVECTOR Position; /* Position in world space */ + D3DVECTOR Direction; /* Direction in world space */ + float Range; /* Cutoff range */ + float Falloff; /* Falloff */ + float Attenuation0; /* Constant attenuation */ + float Attenuation1; /* Linear attenuation */ + float Attenuation2; /* Quadratic attenuation */ + float Theta; /* Inner angle of spotlight cone */ + float Phi; /* Outer angle of spotlight cone */ +} D3DLIGHT9; + +/* + * Options for clearing + */ +#define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */ +#define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */ +#define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */ + +/* + * The following defines the rendering states + */ + +typedef enum _D3DSHADEMODE { + D3DSHADE_FLAT = 1, + D3DSHADE_GOURAUD = 2, + D3DSHADE_PHONG = 3, + D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DSHADEMODE; + +typedef enum _D3DFILLMODE { + D3DFILL_POINT = 1, + D3DFILL_WIREFRAME = 2, + D3DFILL_SOLID = 3, + D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DFILLMODE; + +typedef enum _D3DBLEND { + D3DBLEND_ZERO = 1, + D3DBLEND_ONE = 2, + D3DBLEND_SRCCOLOR = 3, + D3DBLEND_INVSRCCOLOR = 4, + D3DBLEND_SRCALPHA = 5, + D3DBLEND_INVSRCALPHA = 6, + D3DBLEND_DESTALPHA = 7, + D3DBLEND_INVDESTALPHA = 8, + D3DBLEND_DESTCOLOR = 9, + D3DBLEND_INVDESTCOLOR = 10, + D3DBLEND_SRCALPHASAT = 11, + D3DBLEND_BOTHSRCALPHA = 12, + D3DBLEND_BOTHINVSRCALPHA = 13, + D3DBLEND_BLENDFACTOR = 14, /* Only supported if D3DPBLENDCAPS_BLENDFACTOR is on */ + D3DBLEND_INVBLENDFACTOR = 15, /* Only supported if D3DPBLENDCAPS_BLENDFACTOR is on */ +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + + D3DBLEND_SRCCOLOR2 = 16, + D3DBLEND_INVSRCCOLOR2 = 17, + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DBLEND; + +typedef enum _D3DBLENDOP { + D3DBLENDOP_ADD = 1, + D3DBLENDOP_SUBTRACT = 2, + D3DBLENDOP_REVSUBTRACT = 3, + D3DBLENDOP_MIN = 4, + D3DBLENDOP_MAX = 5, + D3DBLENDOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DBLENDOP; + +typedef enum _D3DTEXTUREADDRESS { + D3DTADDRESS_WRAP = 1, + D3DTADDRESS_MIRROR = 2, + D3DTADDRESS_CLAMP = 3, + D3DTADDRESS_BORDER = 4, + D3DTADDRESS_MIRRORONCE = 5, + D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DTEXTUREADDRESS; + +typedef enum _D3DCULL { + D3DCULL_NONE = 1, + D3DCULL_CW = 2, + D3DCULL_CCW = 3, + D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DCULL; + +typedef enum _D3DCMPFUNC { + D3DCMP_NEVER = 1, + D3DCMP_LESS = 2, + D3DCMP_EQUAL = 3, + D3DCMP_LESSEQUAL = 4, + D3DCMP_GREATER = 5, + D3DCMP_NOTEQUAL = 6, + D3DCMP_GREATEREQUAL = 7, + D3DCMP_ALWAYS = 8, + D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DCMPFUNC; + +typedef enum _D3DSTENCILOP { + D3DSTENCILOP_KEEP = 1, + D3DSTENCILOP_ZERO = 2, + D3DSTENCILOP_REPLACE = 3, + D3DSTENCILOP_INCRSAT = 4, + D3DSTENCILOP_DECRSAT = 5, + D3DSTENCILOP_INVERT = 6, + D3DSTENCILOP_INCR = 7, + D3DSTENCILOP_DECR = 8, + D3DSTENCILOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DSTENCILOP; + +typedef enum _D3DFOGMODE { + D3DFOG_NONE = 0, + D3DFOG_EXP = 1, + D3DFOG_EXP2 = 2, + D3DFOG_LINEAR = 3, + D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DFOGMODE; + +typedef enum _D3DZBUFFERTYPE { + D3DZB_FALSE = 0, + D3DZB_TRUE = 1, // Z buffering + D3DZB_USEW = 2, // W buffering + D3DZB_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DZBUFFERTYPE; + +// Primitives supported by draw-primitive API +typedef enum _D3DPRIMITIVETYPE { + D3DPT_POINTLIST = 1, + D3DPT_LINELIST = 2, + D3DPT_LINESTRIP = 3, + D3DPT_TRIANGLELIST = 4, + D3DPT_TRIANGLESTRIP = 5, + D3DPT_TRIANGLEFAN = 6, + D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DPRIMITIVETYPE; + +typedef enum _D3DTRANSFORMSTATETYPE { + D3DTS_VIEW = 2, + D3DTS_PROJECTION = 3, + D3DTS_TEXTURE0 = 16, + D3DTS_TEXTURE1 = 17, + D3DTS_TEXTURE2 = 18, + D3DTS_TEXTURE3 = 19, + D3DTS_TEXTURE4 = 20, + D3DTS_TEXTURE5 = 21, + D3DTS_TEXTURE6 = 22, + D3DTS_TEXTURE7 = 23, + D3DTS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DTRANSFORMSTATETYPE; + +#define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256) +#define D3DTS_WORLD D3DTS_WORLDMATRIX(0) +#define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1) +#define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2) +#define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3) + +typedef enum _D3DRENDERSTATETYPE { + D3DRS_ZENABLE = 7, /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */ + D3DRS_FILLMODE = 8, /* D3DFILLMODE */ + D3DRS_SHADEMODE = 9, /* D3DSHADEMODE */ + D3DRS_ZWRITEENABLE = 14, /* TRUE to enable z writes */ + D3DRS_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */ + D3DRS_LASTPIXEL = 16, /* TRUE for last-pixel on lines */ + D3DRS_SRCBLEND = 19, /* D3DBLEND */ + D3DRS_DESTBLEND = 20, /* D3DBLEND */ + D3DRS_CULLMODE = 22, /* D3DCULL */ + D3DRS_ZFUNC = 23, /* D3DCMPFUNC */ + D3DRS_ALPHAREF = 24, /* D3DFIXED */ + D3DRS_ALPHAFUNC = 25, /* D3DCMPFUNC */ + D3DRS_DITHERENABLE = 26, /* TRUE to enable dithering */ + D3DRS_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */ + D3DRS_FOGENABLE = 28, /* TRUE to enable fog blending */ + D3DRS_SPECULARENABLE = 29, /* TRUE to enable specular */ + D3DRS_FOGCOLOR = 34, /* D3DCOLOR */ + D3DRS_FOGTABLEMODE = 35, /* D3DFOGMODE */ + D3DRS_FOGSTART = 36, /* Fog start (for both vertex and pixel fog) */ + D3DRS_FOGEND = 37, /* Fog end */ + D3DRS_FOGDENSITY = 38, /* Fog density */ + D3DRS_RANGEFOGENABLE = 48, /* Enables range-based fog */ + D3DRS_STENCILENABLE = 52, /* BOOL enable/disable stenciling */ + D3DRS_STENCILFAIL = 53, /* D3DSTENCILOP to do if stencil test fails */ + D3DRS_STENCILZFAIL = 54, /* D3DSTENCILOP to do if stencil test passes and Z test fails */ + D3DRS_STENCILPASS = 55, /* D3DSTENCILOP to do if both stencil and Z tests pass */ + D3DRS_STENCILFUNC = 56, /* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */ + D3DRS_STENCILREF = 57, /* Reference value used in stencil test */ + D3DRS_STENCILMASK = 58, /* Mask value used in stencil test */ + D3DRS_STENCILWRITEMASK = 59, /* Write mask applied to values written to stencil buffer */ + D3DRS_TEXTUREFACTOR = 60, /* D3DCOLOR used for multi-texture blend */ + D3DRS_WRAP0 = 128, /* wrap for 1st texture coord. set */ + D3DRS_WRAP1 = 129, /* wrap for 2nd texture coord. set */ + D3DRS_WRAP2 = 130, /* wrap for 3rd texture coord. set */ + D3DRS_WRAP3 = 131, /* wrap for 4th texture coord. set */ + D3DRS_WRAP4 = 132, /* wrap for 5th texture coord. set */ + D3DRS_WRAP5 = 133, /* wrap for 6th texture coord. set */ + D3DRS_WRAP6 = 134, /* wrap for 7th texture coord. set */ + D3DRS_WRAP7 = 135, /* wrap for 8th texture coord. set */ + D3DRS_CLIPPING = 136, + D3DRS_LIGHTING = 137, + D3DRS_AMBIENT = 139, + D3DRS_FOGVERTEXMODE = 140, + D3DRS_COLORVERTEX = 141, + D3DRS_LOCALVIEWER = 142, + D3DRS_NORMALIZENORMALS = 143, + D3DRS_DIFFUSEMATERIALSOURCE = 145, + D3DRS_SPECULARMATERIALSOURCE = 146, + D3DRS_AMBIENTMATERIALSOURCE = 147, + D3DRS_EMISSIVEMATERIALSOURCE = 148, + D3DRS_VERTEXBLEND = 151, + D3DRS_CLIPPLANEENABLE = 152, + D3DRS_POINTSIZE = 154, /* float point size */ + D3DRS_POINTSIZE_MIN = 155, /* float point size min threshold */ + D3DRS_POINTSPRITEENABLE = 156, /* BOOL point texture coord control */ + D3DRS_POINTSCALEENABLE = 157, /* BOOL point size scale enable */ + D3DRS_POINTSCALE_A = 158, /* float point attenuation A value */ + D3DRS_POINTSCALE_B = 159, /* float point attenuation B value */ + D3DRS_POINTSCALE_C = 160, /* float point attenuation C value */ + D3DRS_MULTISAMPLEANTIALIAS = 161, // BOOL - set to do FSAA with multisample buffer + D3DRS_MULTISAMPLEMASK = 162, // DWORD - per-sample enable/disable + D3DRS_PATCHEDGESTYLE = 163, // Sets whether patch edges will use float style tessellation + D3DRS_DEBUGMONITORTOKEN = 165, // DEBUG ONLY - token to debug monitor + D3DRS_POINTSIZE_MAX = 166, /* float point size max threshold */ + D3DRS_INDEXEDVERTEXBLENDENABLE = 167, + D3DRS_COLORWRITEENABLE = 168, // per-channel write enable + D3DRS_TWEENFACTOR = 170, // float tween factor + D3DRS_BLENDOP = 171, // D3DBLENDOP setting + D3DRS_POSITIONDEGREE = 172, // NPatch position interpolation degree. D3DDEGREE_LINEAR or D3DDEGREE_CUBIC (default) + D3DRS_NORMALDEGREE = 173, // NPatch normal interpolation degree. D3DDEGREE_LINEAR (default) or D3DDEGREE_QUADRATIC + D3DRS_SCISSORTESTENABLE = 174, + D3DRS_SLOPESCALEDEPTHBIAS = 175, + D3DRS_ANTIALIASEDLINEENABLE = 176, + D3DRS_MINTESSELLATIONLEVEL = 178, + D3DRS_MAXTESSELLATIONLEVEL = 179, + D3DRS_ADAPTIVETESS_X = 180, + D3DRS_ADAPTIVETESS_Y = 181, + D3DRS_ADAPTIVETESS_Z = 182, + D3DRS_ADAPTIVETESS_W = 183, + D3DRS_ENABLEADAPTIVETESSELLATION = 184, + D3DRS_TWOSIDEDSTENCILMODE = 185, /* BOOL enable/disable 2 sided stenciling */ + D3DRS_CCW_STENCILFAIL = 186, /* D3DSTENCILOP to do if ccw stencil test fails */ + D3DRS_CCW_STENCILZFAIL = 187, /* D3DSTENCILOP to do if ccw stencil test passes and Z test fails */ + D3DRS_CCW_STENCILPASS = 188, /* D3DSTENCILOP to do if both ccw stencil and Z tests pass */ + D3DRS_CCW_STENCILFUNC = 189, /* D3DCMPFUNC fn. ccw Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */ + D3DRS_COLORWRITEENABLE1 = 190, /* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS */ + D3DRS_COLORWRITEENABLE2 = 191, /* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS */ + D3DRS_COLORWRITEENABLE3 = 192, /* Additional ColorWriteEnables for the devices that support D3DPMISCCAPS_INDEPENDENTWRITEMASKS */ + D3DRS_BLENDFACTOR = 193, /* D3DCOLOR used for a constant blend factor during alpha blending for devices that support D3DPBLENDCAPS_BLENDFACTOR */ + D3DRS_SRGBWRITEENABLE = 194, /* Enable rendertarget writes to be DE-linearized to SRGB (for formats that expose D3DUSAGE_QUERY_SRGBWRITE) */ + D3DRS_DEPTHBIAS = 195, + D3DRS_WRAP8 = 198, /* Additional wrap states for vs_3_0+ attributes with D3DDECLUSAGE_TEXCOORD */ + D3DRS_WRAP9 = 199, + D3DRS_WRAP10 = 200, + D3DRS_WRAP11 = 201, + D3DRS_WRAP12 = 202, + D3DRS_WRAP13 = 203, + D3DRS_WRAP14 = 204, + D3DRS_WRAP15 = 205, + D3DRS_SEPARATEALPHABLENDENABLE = 206, /* TRUE to enable a separate blending function for the alpha channel */ + D3DRS_SRCBLENDALPHA = 207, /* SRC blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */ + D3DRS_DESTBLENDALPHA = 208, /* DST blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */ + D3DRS_BLENDOPALPHA = 209, /* Blending operation for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */ + + + D3DRS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DRENDERSTATETYPE; + +// Maximum number of simultaneous render targets D3D supports +#define D3D_MAX_SIMULTANEOUS_RENDERTARGETS 4 + +// Values for material source +typedef enum _D3DMATERIALCOLORSOURCE +{ + D3DMCS_MATERIAL = 0, // Color from material is used + D3DMCS_COLOR1 = 1, // Diffuse vertex color is used + D3DMCS_COLOR2 = 2, // Specular vertex color is used + D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum +} D3DMATERIALCOLORSOURCE; + +// Bias to apply to the texture coordinate set to apply a wrap to. +#define D3DRENDERSTATE_WRAPBIAS 128UL + +/* Flags to construct the WRAP render states */ +#define D3DWRAP_U 0x00000001L +#define D3DWRAP_V 0x00000002L +#define D3DWRAP_W 0x00000004L + +/* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */ +#define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U +#define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V +#define D3DWRAPCOORD_2 0x00000004L // same as D3DWRAP_W +#define D3DWRAPCOORD_3 0x00000008L + +/* Flags to construct D3DRS_COLORWRITEENABLE */ +#define D3DCOLORWRITEENABLE_RED (1L<<0) +#define D3DCOLORWRITEENABLE_GREEN (1L<<1) +#define D3DCOLORWRITEENABLE_BLUE (1L<<2) +#define D3DCOLORWRITEENABLE_ALPHA (1L<<3) + +/* + * State enumerants for per-stage processing of fixed function pixel processing + * Two of these affect fixed function vertex processing as well: TEXTURETRANSFORMFLAGS and TEXCOORDINDEX. + */ +typedef enum _D3DTEXTURESTAGESTATETYPE +{ + D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */ + D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */ + D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */ + D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */ + D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */ + D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */ + D3DTSS_BUMPENVMAT00 = 7, /* float (bump mapping matrix) */ + D3DTSS_BUMPENVMAT01 = 8, /* float (bump mapping matrix) */ + D3DTSS_BUMPENVMAT10 = 9, /* float (bump mapping matrix) */ + D3DTSS_BUMPENVMAT11 = 10, /* float (bump mapping matrix) */ + D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */ + D3DTSS_BUMPENVLSCALE = 22, /* float scale for bump map luminance */ + D3DTSS_BUMPENVLOFFSET = 23, /* float offset for bump map luminance */ + D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */ + D3DTSS_COLORARG0 = 26, /* D3DTA_* third arg for triadic ops */ + D3DTSS_ALPHAARG0 = 27, /* D3DTA_* third arg for triadic ops */ + D3DTSS_RESULTARG = 28, /* D3DTA_* arg for result (CURRENT or TEMP) */ + D3DTSS_CONSTANT = 32, /* Per-stage constant D3DTA_CONSTANT */ + + + D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DTEXTURESTAGESTATETYPE; + +/* + * State enumerants for per-sampler texture processing. + */ +typedef enum _D3DSAMPLERSTATETYPE +{ + D3DSAMP_ADDRESSU = 1, /* D3DTEXTUREADDRESS for U coordinate */ + D3DSAMP_ADDRESSV = 2, /* D3DTEXTUREADDRESS for V coordinate */ + D3DSAMP_ADDRESSW = 3, /* D3DTEXTUREADDRESS for W coordinate */ + D3DSAMP_BORDERCOLOR = 4, /* D3DCOLOR */ + D3DSAMP_MAGFILTER = 5, /* D3DTEXTUREFILTER filter to use for magnification */ + D3DSAMP_MINFILTER = 6, /* D3DTEXTUREFILTER filter to use for minification */ + D3DSAMP_MIPFILTER = 7, /* D3DTEXTUREFILTER filter to use between mipmaps during minification */ + D3DSAMP_MIPMAPLODBIAS = 8, /* float Mipmap LOD bias */ + D3DSAMP_MAXMIPLEVEL = 9, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */ + D3DSAMP_MAXANISOTROPY = 10, /* DWORD maximum anisotropy */ + D3DSAMP_SRGBTEXTURE = 11, /* Default = 0 (which means Gamma 1.0, + no correction required.) else correct for + Gamma = 2.2 */ + D3DSAMP_ELEMENTINDEX = 12, /* When multi-element texture is assigned to sampler, this + indicates which element index to use. Default = 0. */ + D3DSAMP_DMAPOFFSET = 13, /* Offset in vertices in the pre-sampled displacement map. + Only valid for D3DDMAPSAMPLER sampler */ + D3DSAMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DSAMPLERSTATETYPE; + +/* Special sampler which is used in the tesselator */ +#define D3DDMAPSAMPLER 256 + +// Samplers used in vertex shaders +#define D3DVERTEXTEXTURESAMPLER0 (D3DDMAPSAMPLER+1) +#define D3DVERTEXTEXTURESAMPLER1 (D3DDMAPSAMPLER+2) +#define D3DVERTEXTEXTURESAMPLER2 (D3DDMAPSAMPLER+3) +#define D3DVERTEXTEXTURESAMPLER3 (D3DDMAPSAMPLER+4) + +// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position +// and normal in the camera space) should be taken as texture coordinates +// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from +// +#define D3DTSS_TCI_PASSTHRU 0x00000000 +#define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000 +#define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000 +#define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000 +#define D3DTSS_TCI_SPHEREMAP 0x00040000 + +/* + * Enumerations for COLOROP and ALPHAOP texture blending operations set in + * texture processing stage controls in D3DTSS. + */ +typedef enum _D3DTEXTUREOP +{ + // Control + D3DTOP_DISABLE = 1, // disables stage + D3DTOP_SELECTARG1 = 2, // the default + D3DTOP_SELECTARG2 = 3, + + // Modulate + D3DTOP_MODULATE = 4, // multiply args together + D3DTOP_MODULATE2X = 5, // multiply and 1 bit + D3DTOP_MODULATE4X = 6, // multiply and 2 bits + + // Add + D3DTOP_ADD = 7, // add arguments together + D3DTOP_ADDSIGNED = 8, // add with -0.5 bias + D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit + D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation + D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product + // Arg1 + Arg2 - Arg1*Arg2 + // = Arg1 + (1-Arg1)*Arg2 + + // Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha) + D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha + D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha + D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRS_TEXTUREFACTOR + + // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha) + D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha + D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color + + // Specular mapping + D3DTOP_PREMODULATE = 17, // modulate with next texture before use + D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB + // COLOROP only + D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A + // COLOROP only + D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB + // COLOROP only + D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A + // COLOROP only + + // Bump mapping + D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation + D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel + + // This can do either diffuse or specular bump mapping with correct input. + // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B) + // where each component has been scaled and offset to make it signed. + // The result is replicated into all four (including alpha) channels. + // This is a valid COLOROP only. + D3DTOP_DOTPRODUCT3 = 24, + + // Triadic ops + D3DTOP_MULTIPLYADD = 25, // Arg0 + Arg1*Arg2 + D3DTOP_LERP = 26, // (Arg0)*Arg1 + (1-Arg0)*Arg2 + + D3DTOP_FORCE_DWORD = 0x7fffffff, +} D3DTEXTUREOP; + +/* + * Values for COLORARG0,1,2, ALPHAARG0,1,2, and RESULTARG texture blending + * operations set in texture processing stage controls in D3DRENDERSTATE. + */ +#define D3DTA_SELECTMASK 0x0000000f // mask for arg selector +#define D3DTA_DIFFUSE 0x00000000 // select diffuse color (read only) +#define D3DTA_CURRENT 0x00000001 // select stage destination register (read/write) +#define D3DTA_TEXTURE 0x00000002 // select texture color (read only) +#define D3DTA_TFACTOR 0x00000003 // select D3DRS_TEXTUREFACTOR (read only) +#define D3DTA_SPECULAR 0x00000004 // select specular color (read only) +#define D3DTA_TEMP 0x00000005 // select temporary register color (read/write) +#define D3DTA_CONSTANT 0x00000006 // select texture stage constant +#define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x (read modifier) +#define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components (read modifier) + +// +// Values for D3DSAMP_***FILTER texture stage states +// +typedef enum _D3DTEXTUREFILTERTYPE +{ + D3DTEXF_NONE = 0, // filtering disabled (valid for mip filter only) + D3DTEXF_POINT = 1, // nearest + D3DTEXF_LINEAR = 2, // linear interpolation + D3DTEXF_ANISOTROPIC = 3, // anisotropic + D3DTEXF_PYRAMIDALQUAD = 6, // 4-sample tent + D3DTEXF_GAUSSIANQUAD = 7, // 4-sample gaussian +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + + D3DTEXF_CONVOLUTIONMONO = 8, // Convolution filter for monochrome textures + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + D3DTEXF_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum +} D3DTEXTUREFILTERTYPE; + +/* Bits for Flags in ProcessVertices call */ + +#define D3DPV_DONOTCOPYDATA (1 << 0) + +//------------------------------------------------------------------- + +// Flexible vertex format bits +// +#define D3DFVF_RESERVED0 0x001 +#define D3DFVF_POSITION_MASK 0x400E +#define D3DFVF_XYZ 0x002 +#define D3DFVF_XYZRHW 0x004 +#define D3DFVF_XYZB1 0x006 +#define D3DFVF_XYZB2 0x008 +#define D3DFVF_XYZB3 0x00a +#define D3DFVF_XYZB4 0x00c +#define D3DFVF_XYZB5 0x00e +#define D3DFVF_XYZW 0x4002 + +#define D3DFVF_NORMAL 0x010 +#define D3DFVF_PSIZE 0x020 +#define D3DFVF_DIFFUSE 0x040 +#define D3DFVF_SPECULAR 0x080 + +#define D3DFVF_TEXCOUNT_MASK 0xf00 +#define D3DFVF_TEXCOUNT_SHIFT 8 +#define D3DFVF_TEX0 0x000 +#define D3DFVF_TEX1 0x100 +#define D3DFVF_TEX2 0x200 +#define D3DFVF_TEX3 0x300 +#define D3DFVF_TEX4 0x400 +#define D3DFVF_TEX5 0x500 +#define D3DFVF_TEX6 0x600 +#define D3DFVF_TEX7 0x700 +#define D3DFVF_TEX8 0x800 + +#define D3DFVF_LASTBETA_UBYTE4 0x1000 +#define D3DFVF_LASTBETA_D3DCOLOR 0x8000 + +#define D3DFVF_RESERVED2 0x6000 // 2 reserved bits + +//--------------------------------------------------------------------- +// Vertex Shaders +// + +// Vertex shader declaration + +// Vertex element semantics +// +typedef enum _D3DDECLUSAGE +{ + D3DDECLUSAGE_POSITION = 0, + D3DDECLUSAGE_BLENDWEIGHT, // 1 + D3DDECLUSAGE_BLENDINDICES, // 2 + D3DDECLUSAGE_NORMAL, // 3 + D3DDECLUSAGE_PSIZE, // 4 + D3DDECLUSAGE_TEXCOORD, // 5 + D3DDECLUSAGE_TANGENT, // 6 + D3DDECLUSAGE_BINORMAL, // 7 + D3DDECLUSAGE_TESSFACTOR, // 8 + D3DDECLUSAGE_POSITIONT, // 9 + D3DDECLUSAGE_COLOR, // 10 + D3DDECLUSAGE_FOG, // 11 + D3DDECLUSAGE_DEPTH, // 12 + D3DDECLUSAGE_SAMPLE, // 13 +} D3DDECLUSAGE; + +#define MAXD3DDECLUSAGE D3DDECLUSAGE_SAMPLE +#define MAXD3DDECLUSAGEINDEX 15 +#define MAXD3DDECLLENGTH 64 // does not include "end" marker vertex element + +typedef enum _D3DDECLMETHOD +{ + D3DDECLMETHOD_DEFAULT = 0, + D3DDECLMETHOD_PARTIALU, + D3DDECLMETHOD_PARTIALV, + D3DDECLMETHOD_CROSSUV, // Normal + D3DDECLMETHOD_UV, + D3DDECLMETHOD_LOOKUP, // Lookup a displacement map + D3DDECLMETHOD_LOOKUPPRESAMPLED, // Lookup a pre-sampled displacement map +} D3DDECLMETHOD; + +#define MAXD3DDECLMETHOD D3DDECLMETHOD_LOOKUPPRESAMPLED + +// Declarations for _Type fields +// +typedef enum _D3DDECLTYPE +{ + D3DDECLTYPE_FLOAT1 = 0, // 1D float expanded to (value, 0., 0., 1.) + D3DDECLTYPE_FLOAT2 = 1, // 2D float expanded to (value, value, 0., 1.) + D3DDECLTYPE_FLOAT3 = 2, // 3D float expanded to (value, value, value, 1.) + D3DDECLTYPE_FLOAT4 = 3, // 4D float + D3DDECLTYPE_D3DCOLOR = 4, // 4D packed unsigned bytes mapped to 0. to 1. range + // Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A) + D3DDECLTYPE_UBYTE4 = 5, // 4D unsigned byte + D3DDECLTYPE_SHORT2 = 6, // 2D signed short expanded to (value, value, 0., 1.) + D3DDECLTYPE_SHORT4 = 7, // 4D signed short + +// The following types are valid only with vertex shaders >= 2.0 + + + D3DDECLTYPE_UBYTE4N = 8, // Each of 4 bytes is normalized by dividing to 255.0 + D3DDECLTYPE_SHORT2N = 9, // 2D signed short normalized (v[0]/32767.0,v[1]/32767.0,0,1) + D3DDECLTYPE_SHORT4N = 10, // 4D signed short normalized (v[0]/32767.0,v[1]/32767.0,v[2]/32767.0,v[3]/32767.0) + D3DDECLTYPE_USHORT2N = 11, // 2D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,0,1) + D3DDECLTYPE_USHORT4N = 12, // 4D unsigned short normalized (v[0]/65535.0,v[1]/65535.0,v[2]/65535.0,v[3]/65535.0) + D3DDECLTYPE_UDEC3 = 13, // 3D unsigned 10 10 10 format expanded to (value, value, value, 1) + D3DDECLTYPE_DEC3N = 14, // 3D signed 10 10 10 format normalized and expanded to (v[0]/511.0, v[1]/511.0, v[2]/511.0, 1) + D3DDECLTYPE_FLOAT16_2 = 15, // Two 16-bit floating point values, expanded to (value, value, 0, 1) + D3DDECLTYPE_FLOAT16_4 = 16, // Four 16-bit floating point values + D3DDECLTYPE_UNUSED = 17, // When the type field in a decl is unused. +} D3DDECLTYPE; + +#define MAXD3DDECLTYPE D3DDECLTYPE_UNUSED + +typedef struct _D3DVERTEXELEMENT9 +{ + WORD Stream; // Stream index + WORD Offset; // Offset in the stream in bytes + BYTE Type; // Data type + BYTE Method; // Processing method + BYTE Usage; // Semantics + BYTE UsageIndex; // Semantic index +} D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9; + +// This is used to initialize the last vertex element in a vertex declaration +// array +// +#define D3DDECL_END() {0xFF,0,D3DDECLTYPE_UNUSED,0,0,0} + +// Maximum supported number of texture coordinate sets +#define D3DDP_MAXTEXCOORD 8 + +//--------------------------------------------------------------------- +// Values for IDirect3DDevice9::SetStreamSourceFreq's Setting parameter +//--------------------------------------------------------------------- +#define D3DSTREAMSOURCE_INDEXEDDATA (1<<30) +#define D3DSTREAMSOURCE_INSTANCEDATA (2<<30) + + + +//--------------------------------------------------------------------- +// +// The internal format of Pixel Shader (PS) & Vertex Shader (VS) +// Instruction Tokens is defined in the Direct3D Device Driver Kit +// +//--------------------------------------------------------------------- + +// +// Instruction Token Bit Definitions +// +#define D3DSI_OPCODE_MASK 0x0000FFFF + +#define D3DSI_INSTLENGTH_MASK 0x0F000000 +#define D3DSI_INSTLENGTH_SHIFT 24 + +typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE +{ + D3DSIO_NOP = 0, + D3DSIO_MOV , + D3DSIO_ADD , + D3DSIO_SUB , + D3DSIO_MAD , + D3DSIO_MUL , + D3DSIO_RCP , + D3DSIO_RSQ , + D3DSIO_DP3 , + D3DSIO_DP4 , + D3DSIO_MIN , + D3DSIO_MAX , + D3DSIO_SLT , + D3DSIO_SGE , + D3DSIO_EXP , + D3DSIO_LOG , + D3DSIO_LIT , + D3DSIO_DST , + D3DSIO_LRP , + D3DSIO_FRC , + D3DSIO_M4x4 , + D3DSIO_M4x3 , + D3DSIO_M3x4 , + D3DSIO_M3x3 , + D3DSIO_M3x2 , + D3DSIO_CALL , + D3DSIO_CALLNZ , + D3DSIO_LOOP , + D3DSIO_RET , + D3DSIO_ENDLOOP , + D3DSIO_LABEL , + D3DSIO_DCL , + D3DSIO_POW , + D3DSIO_CRS , + D3DSIO_SGN , + D3DSIO_ABS , + D3DSIO_NRM , + D3DSIO_SINCOS , + D3DSIO_REP , + D3DSIO_ENDREP , + D3DSIO_IF , + D3DSIO_IFC , + D3DSIO_ELSE , + D3DSIO_ENDIF , + D3DSIO_BREAK , + D3DSIO_BREAKC , + D3DSIO_MOVA , + D3DSIO_DEFB , + D3DSIO_DEFI , + + D3DSIO_TEXCOORD = 64, + D3DSIO_TEXKILL , + D3DSIO_TEX , + D3DSIO_TEXBEM , + D3DSIO_TEXBEML , + D3DSIO_TEXREG2AR , + D3DSIO_TEXREG2GB , + D3DSIO_TEXM3x2PAD , + D3DSIO_TEXM3x2TEX , + D3DSIO_TEXM3x3PAD , + D3DSIO_TEXM3x3TEX , + D3DSIO_RESERVED0 , + D3DSIO_TEXM3x3SPEC , + D3DSIO_TEXM3x3VSPEC , + D3DSIO_EXPP , + D3DSIO_LOGP , + D3DSIO_CND , + D3DSIO_DEF , + D3DSIO_TEXREG2RGB , + D3DSIO_TEXDP3TEX , + D3DSIO_TEXM3x2DEPTH , + D3DSIO_TEXDP3 , + D3DSIO_TEXM3x3 , + D3DSIO_TEXDEPTH , + D3DSIO_CMP , + D3DSIO_BEM , + D3DSIO_DP2ADD , + D3DSIO_DSX , + D3DSIO_DSY , + D3DSIO_TEXLDD , + D3DSIO_SETP , + D3DSIO_TEXLDL , + D3DSIO_BREAKP , + + D3DSIO_PHASE = 0xFFFD, + D3DSIO_COMMENT = 0xFFFE, + D3DSIO_END = 0xFFFF, + + D3DSIO_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum +} D3DSHADER_INSTRUCTION_OPCODE_TYPE; + +//--------------------------------------------------------------------- +// Use these constants with D3DSIO_SINCOS macro as SRC2, SRC3 +// +#define D3DSINCOSCONST1 -1.5500992e-006f, -2.1701389e-005f, 0.0026041667f, 0.00026041668f +#define D3DSINCOSCONST2 -0.020833334f, -0.12500000f, 1.0f, 0.50000000f + +//--------------------------------------------------------------------- +// Co-Issue Instruction Modifier - if set then this instruction is to be +// issued in parallel with the previous instruction(s) for which this bit +// is not set. +// +#define D3DSI_COISSUE 0x40000000 + +//--------------------------------------------------------------------- +// Opcode specific controls + +#define D3DSP_OPCODESPECIFICCONTROL_MASK 0x00ff0000 +#define D3DSP_OPCODESPECIFICCONTROL_SHIFT 16 + +// ps_2_0 texld controls +#define D3DSI_TEXLD_PROJECT (0x01 << D3DSP_OPCODESPECIFICCONTROL_SHIFT) +#define D3DSI_TEXLD_BIAS (0x02 << D3DSP_OPCODESPECIFICCONTROL_SHIFT) + +// Comparison for dynamic conditional instruction opcodes (i.e. if, breakc) +typedef enum _D3DSHADER_COMPARISON +{ + // < = > + D3DSPC_RESERVED0= 0, // 0 0 0 + D3DSPC_GT = 1, // 0 0 1 + D3DSPC_EQ = 2, // 0 1 0 + D3DSPC_GE = 3, // 0 1 1 + D3DSPC_LT = 4, // 1 0 0 + D3DSPC_NE = 5, // 1 0 1 + D3DSPC_LE = 6, // 1 1 0 + D3DSPC_RESERVED1= 7 // 1 1 1 +} D3DSHADER_COMPARISON; + +// Comparison is part of instruction opcode token: +#define D3DSHADER_COMPARISON_SHIFT D3DSP_OPCODESPECIFICCONTROL_SHIFT +#define D3DSHADER_COMPARISON_MASK (0x7<>8)&0xFF) +#define D3DSHADER_VERSION_MINOR(_Version) (((_Version)>>0)&0xFF) + +// destination/source parameter register type +#define D3DSI_COMMENTSIZE_SHIFT 16 +#define D3DSI_COMMENTSIZE_MASK 0x7FFF0000 +#define D3DSHADER_COMMENT(_DWordSize) \ + ((((_DWordSize)<= 1200 +#pragma warning(pop) +#else +#pragma warning(default:4201) +#endif + +#endif /* (DIRECT3D_VERSION >= 0x0900) */ +#endif /* _d3d9TYPES(P)_H_ */ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dcaps.h b/Src/Decoder_H264_ALL/D3D/include/d3dcaps.h new file mode 100644 index 0000000..6066c7a --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dcaps.h @@ -0,0 +1,601 @@ +/*==========================================================================; + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: d3dcaps.h + * Content: Direct3D capabilities include file + * + ***************************************************************************/ + +#ifndef _D3DCAPS_H +#define _D3DCAPS_H + +/* + * Pull in DirectDraw include file automatically: + */ +#include "ddraw.h" + +#ifndef DIRECT3D_VERSION +#define DIRECT3D_VERSION 0x0700 +#endif + +#if defined(_X86_) || defined(_IA64_) +#pragma pack(4) +#endif + +/* Description of capabilities of transform */ + +typedef struct _D3DTRANSFORMCAPS { + DWORD dwSize; + DWORD dwCaps; +} D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS; + +#define D3DTRANSFORMCAPS_CLIP 0x00000001L /* Will clip whilst transforming */ + +/* Description of capabilities of lighting */ + +typedef struct _D3DLIGHTINGCAPS { + DWORD dwSize; + DWORD dwCaps; /* Lighting caps */ + DWORD dwLightingModel; /* Lighting model - RGB or mono */ + DWORD dwNumLights; /* Number of lights that can be handled */ +} D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS; + +#define D3DLIGHTINGMODEL_RGB 0x00000001L +#define D3DLIGHTINGMODEL_MONO 0x00000002L + +#define D3DLIGHTCAPS_POINT 0x00000001L /* Point lights supported */ +#define D3DLIGHTCAPS_SPOT 0x00000002L /* Spot lights supported */ +#define D3DLIGHTCAPS_DIRECTIONAL 0x00000004L /* Directional lights supported */ +#if(DIRECT3D_VERSION < 0x700) +#define D3DLIGHTCAPS_PARALLELPOINT 0x00000008L /* Parallel point lights supported */ +#endif +#if(DIRECT3D_VERSION < 0x500) +#define D3DLIGHTCAPS_GLSPOT 0x00000010L /* GL syle spot lights supported */ +#endif + +/* Description of capabilities for each primitive type */ + +typedef struct _D3DPrimCaps { + DWORD dwSize; + DWORD dwMiscCaps; /* Capability flags */ + DWORD dwRasterCaps; + DWORD dwZCmpCaps; + DWORD dwSrcBlendCaps; + DWORD dwDestBlendCaps; + DWORD dwAlphaCmpCaps; + DWORD dwShadeCaps; + DWORD dwTextureCaps; + DWORD dwTextureFilterCaps; + DWORD dwTextureBlendCaps; + DWORD dwTextureAddressCaps; + DWORD dwStippleWidth; /* maximum width and height of */ + DWORD dwStippleHeight; /* of supported stipple (up to 32x32) */ +} D3DPRIMCAPS, *LPD3DPRIMCAPS; + +/* D3DPRIMCAPS dwMiscCaps */ + +#define D3DPMISCCAPS_MASKPLANES 0x00000001L +#define D3DPMISCCAPS_MASKZ 0x00000002L +#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L +#define D3DPMISCCAPS_CONFORMANT 0x00000008L +#define D3DPMISCCAPS_CULLNONE 0x00000010L +#define D3DPMISCCAPS_CULLCW 0x00000020L +#define D3DPMISCCAPS_CULLCCW 0x00000040L + +/* D3DPRIMCAPS dwRasterCaps */ + +#define D3DPRASTERCAPS_DITHER 0x00000001L +#define D3DPRASTERCAPS_ROP2 0x00000002L +#define D3DPRASTERCAPS_XOR 0x00000004L +#define D3DPRASTERCAPS_PAT 0x00000008L +#define D3DPRASTERCAPS_ZTEST 0x00000010L +#define D3DPRASTERCAPS_SUBPIXEL 0x00000020L +#define D3DPRASTERCAPS_SUBPIXELX 0x00000040L +#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L +#define D3DPRASTERCAPS_FOGTABLE 0x00000100L +#define D3DPRASTERCAPS_STIPPLE 0x00000200L +#if(DIRECT3D_VERSION >= 0x0500) +#define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT 0x00000400L +#define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L +#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L +#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L +#define D3DPRASTERCAPS_ZBIAS 0x00004000L +#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L +#define D3DPRASTERCAPS_FOGRANGE 0x00010000L +#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L +#endif /* DIRECT3D_VERSION >= 0x0500 */ +#if(DIRECT3D_VERSION >= 0x0600) +#define D3DPRASTERCAPS_WBUFFER 0x00040000L +#define D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT 0x00080000L +#define D3DPRASTERCAPS_WFOG 0x00100000L +#define D3DPRASTERCAPS_ZFOG 0x00200000L +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +/* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */ + +#define D3DPCMPCAPS_NEVER 0x00000001L +#define D3DPCMPCAPS_LESS 0x00000002L +#define D3DPCMPCAPS_EQUAL 0x00000004L +#define D3DPCMPCAPS_LESSEQUAL 0x00000008L +#define D3DPCMPCAPS_GREATER 0x00000010L +#define D3DPCMPCAPS_NOTEQUAL 0x00000020L +#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L +#define D3DPCMPCAPS_ALWAYS 0x00000080L + +/* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */ + +#define D3DPBLENDCAPS_ZERO 0x00000001L +#define D3DPBLENDCAPS_ONE 0x00000002L +#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L +#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L +#define D3DPBLENDCAPS_SRCALPHA 0x00000010L +#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L +#define D3DPBLENDCAPS_DESTALPHA 0x00000040L +#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L +#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L +#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L +#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L +#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L +#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L + +/* D3DPRIMCAPS dwShadeCaps */ + +#define D3DPSHADECAPS_COLORFLATMONO 0x00000001L +#define D3DPSHADECAPS_COLORFLATRGB 0x00000002L +#define D3DPSHADECAPS_COLORGOURAUDMONO 0x00000004L +#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L +#define D3DPSHADECAPS_COLORPHONGMONO 0x00000010L +#define D3DPSHADECAPS_COLORPHONGRGB 0x00000020L + +#define D3DPSHADECAPS_SPECULARFLATMONO 0x00000040L +#define D3DPSHADECAPS_SPECULARFLATRGB 0x00000080L +#define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100L +#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L +#define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400L +#define D3DPSHADECAPS_SPECULARPHONGRGB 0x00000800L + +#define D3DPSHADECAPS_ALPHAFLATBLEND 0x00001000L +#define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000L +#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L +#define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000L +#define D3DPSHADECAPS_ALPHAPHONGBLEND 0x00010000L +#define D3DPSHADECAPS_ALPHAPHONGSTIPPLED 0x00020000L + +#define D3DPSHADECAPS_FOGFLAT 0x00040000L +#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L +#define D3DPSHADECAPS_FOGPHONG 0x00100000L + +/* D3DPRIMCAPS dwTextureCaps */ + +/* + * Perspective-correct texturing is supported + */ +#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L + +/* + * Power-of-2 texture dimensions are required + */ +#define D3DPTEXTURECAPS_POW2 0x00000002L + +/* + * Alpha in texture pixels is supported + */ +#define D3DPTEXTURECAPS_ALPHA 0x00000004L + +/* + * Color-keyed textures are supported + */ +#define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008L + +/* + * obsolete, see D3DPTADDRESSCAPS_BORDER + */ +#define D3DPTEXTURECAPS_BORDER 0x00000010L + +/* + * Only square textures are supported + */ +#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L + +#if(DIRECT3D_VERSION >= 0x0600) +/* + * Texture indices are not scaled by the texture size prior + * to interpolation. + */ +#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L + +/* + * Device can draw alpha from texture palettes + */ +#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L + +/* + * Device can use non-POW2 textures if: + * 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage + * 2) D3DRS_WRAP(N) is zero for this texture's coordinates + * 3) mip mapping is not enabled (use magnification filter only) + */ +#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L + +#endif /* DIRECT3D_VERSION >= 0x0600 */ +#if(DIRECT3D_VERSION >= 0x0700) + +// 0x00000200L unused + +/* + * Device can divide transformed texture coordinates by the + * COUNTth texture coordinate (can do D3DTTFF_PROJECTED) + */ +#define D3DPTEXTURECAPS_PROJECTED 0x00000400L + +/* + * Device can do cubemap textures + */ +#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L + +#define D3DPTEXTURECAPS_COLORKEYBLEND 0x00001000L +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +/* D3DPRIMCAPS dwTextureFilterCaps */ + +#define D3DPTFILTERCAPS_NEAREST 0x00000001L +#define D3DPTFILTERCAPS_LINEAR 0x00000002L +#define D3DPTFILTERCAPS_MIPNEAREST 0x00000004L +#define D3DPTFILTERCAPS_MIPLINEAR 0x00000008L +#define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L +#define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L + +#if(DIRECT3D_VERSION >= 0x0600) +/* Device3 Min Filter */ +#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L +#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L +#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L + +/* Device3 Mip Filter */ +#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L +#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L + +/* Device3 Mag Filter */ +#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L +#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L +#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L +#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L +#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +/* D3DPRIMCAPS dwTextureBlendCaps */ + +#define D3DPTBLENDCAPS_DECAL 0x00000001L +#define D3DPTBLENDCAPS_MODULATE 0x00000002L +#define D3DPTBLENDCAPS_DECALALPHA 0x00000004L +#define D3DPTBLENDCAPS_MODULATEALPHA 0x00000008L +#define D3DPTBLENDCAPS_DECALMASK 0x00000010L +#define D3DPTBLENDCAPS_MODULATEMASK 0x00000020L +#define D3DPTBLENDCAPS_COPY 0x00000040L +#if(DIRECT3D_VERSION >= 0x0500) +#define D3DPTBLENDCAPS_ADD 0x00000080L +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +/* D3DPRIMCAPS dwTextureAddressCaps */ +#define D3DPTADDRESSCAPS_WRAP 0x00000001L +#define D3DPTADDRESSCAPS_MIRROR 0x00000002L +#define D3DPTADDRESSCAPS_CLAMP 0x00000004L +#if(DIRECT3D_VERSION >= 0x0500) +#define D3DPTADDRESSCAPS_BORDER 0x00000008L +#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if(DIRECT3D_VERSION >= 0x0600) + +/* D3DDEVICEDESC dwStencilCaps */ + +#define D3DSTENCILCAPS_KEEP 0x00000001L +#define D3DSTENCILCAPS_ZERO 0x00000002L +#define D3DSTENCILCAPS_REPLACE 0x00000004L +#define D3DSTENCILCAPS_INCRSAT 0x00000008L +#define D3DSTENCILCAPS_DECRSAT 0x00000010L +#define D3DSTENCILCAPS_INVERT 0x00000020L +#define D3DSTENCILCAPS_INCR 0x00000040L +#define D3DSTENCILCAPS_DECR 0x00000080L + +/* D3DDEVICEDESC dwTextureOpCaps */ + +#define D3DTEXOPCAPS_DISABLE 0x00000001L +#define D3DTEXOPCAPS_SELECTARG1 0x00000002L +#define D3DTEXOPCAPS_SELECTARG2 0x00000004L +#define D3DTEXOPCAPS_MODULATE 0x00000008L +#define D3DTEXOPCAPS_MODULATE2X 0x00000010L +#define D3DTEXOPCAPS_MODULATE4X 0x00000020L +#define D3DTEXOPCAPS_ADD 0x00000040L +#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L +#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L +#define D3DTEXOPCAPS_SUBTRACT 0x00000200L +#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L +#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L +#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L +#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L +#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L +#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L +#define D3DTEXOPCAPS_PREMODULATE 0x00010000L +#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L +#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L +#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L +#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L +#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L +#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L +#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L + +/* D3DDEVICEDESC dwFVFCaps flags */ + +#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */ +#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */ + +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +/* + * Description for a device. + * This is used to describe a device that is to be created or to query + * the current device. + */ +typedef struct _D3DDeviceDesc { + DWORD dwSize; /* Size of D3DDEVICEDESC structure */ + DWORD dwFlags; /* Indicates which fields have valid data */ + D3DCOLORMODEL dcmColorModel; /* Color model of device */ + DWORD dwDevCaps; /* Capabilities of device */ + D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */ + BOOL bClipping; /* Device can do 3D clipping */ + D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */ + D3DPRIMCAPS dpcLineCaps; + D3DPRIMCAPS dpcTriCaps; + DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */ + DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */ + DWORD dwMaxBufferSize; /* Maximum execute buffer size */ + DWORD dwMaxVertexCount; /* Maximum vertex count */ +#if(DIRECT3D_VERSION >= 0x0500) + // *** New fields for DX5 *** // + + // Width and height caps are 0 for legacy HALs. + DWORD dwMinTextureWidth, dwMinTextureHeight; + DWORD dwMaxTextureWidth, dwMaxTextureHeight; + DWORD dwMinStippleWidth, dwMaxStippleWidth; + DWORD dwMinStippleHeight, dwMaxStippleHeight; +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if(DIRECT3D_VERSION >= 0x0600) + // New fields for DX6 + DWORD dwMaxTextureRepeat; + DWORD dwMaxTextureAspectRatio; + DWORD dwMaxAnisotropy; + + // Guard band that the rasterizer can accommodate + // Screen-space vertices inside this space but outside the viewport + // will get clipped properly. + D3DVALUE dvGuardBandLeft; + D3DVALUE dvGuardBandTop; + D3DVALUE dvGuardBandRight; + D3DVALUE dvGuardBandBottom; + + D3DVALUE dvExtentsAdjust; + DWORD dwStencilCaps; + + DWORD dwFVFCaps; + DWORD dwTextureOpCaps; + WORD wMaxTextureBlendStages; + WORD wMaxSimultaneousTextures; +#endif /* DIRECT3D_VERSION >= 0x0600 */ +} D3DDEVICEDESC, *LPD3DDEVICEDESC; + +#if(DIRECT3D_VERSION >= 0x0700) +typedef struct _D3DDeviceDesc7 { + DWORD dwDevCaps; /* Capabilities of device */ + D3DPRIMCAPS dpcLineCaps; + D3DPRIMCAPS dpcTriCaps; + DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */ + DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */ + + DWORD dwMinTextureWidth, dwMinTextureHeight; + DWORD dwMaxTextureWidth, dwMaxTextureHeight; + + DWORD dwMaxTextureRepeat; + DWORD dwMaxTextureAspectRatio; + DWORD dwMaxAnisotropy; + + D3DVALUE dvGuardBandLeft; + D3DVALUE dvGuardBandTop; + D3DVALUE dvGuardBandRight; + D3DVALUE dvGuardBandBottom; + + D3DVALUE dvExtentsAdjust; + DWORD dwStencilCaps; + + DWORD dwFVFCaps; + DWORD dwTextureOpCaps; + WORD wMaxTextureBlendStages; + WORD wMaxSimultaneousTextures; + + DWORD dwMaxActiveLights; + D3DVALUE dvMaxVertexW; + GUID deviceGUID; + + WORD wMaxUserClipPlanes; + WORD wMaxVertexBlendMatrices; + + DWORD dwVertexProcessingCaps; + + DWORD dwReserved1; + DWORD dwReserved2; + DWORD dwReserved3; + DWORD dwReserved4; +} D3DDEVICEDESC7, *LPD3DDEVICEDESC7; +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +#define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC)) +#define D3DDEVICEDESC7SIZE (sizeof(D3DDEVICEDESC7)) + +typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK)(GUID FAR *lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID); + +#if(DIRECT3D_VERSION >= 0x0700) +typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK7)(LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC7, LPVOID); +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +/* D3DDEVICEDESC dwFlags indicating valid fields */ + +#define D3DDD_COLORMODEL 0x00000001L /* dcmColorModel is valid */ +#define D3DDD_DEVCAPS 0x00000002L /* dwDevCaps is valid */ +#define D3DDD_TRANSFORMCAPS 0x00000004L /* dtcTransformCaps is valid */ +#define D3DDD_LIGHTINGCAPS 0x00000008L /* dlcLightingCaps is valid */ +#define D3DDD_BCLIPPING 0x00000010L /* bClipping is valid */ +#define D3DDD_LINECAPS 0x00000020L /* dpcLineCaps is valid */ +#define D3DDD_TRICAPS 0x00000040L /* dpcTriCaps is valid */ +#define D3DDD_DEVICERENDERBITDEPTH 0x00000080L /* dwDeviceRenderBitDepth is valid */ +#define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */ +#define D3DDD_MAXBUFFERSIZE 0x00000200L /* dwMaxBufferSize is valid */ +#define D3DDD_MAXVERTEXCOUNT 0x00000400L /* dwMaxVertexCount is valid */ + +/* D3DDEVICEDESC dwDevCaps flags */ + +#define D3DDEVCAPS_FLOATTLVERTEX 0x00000001L /* Device accepts floating point */ + /* for post-transform vertex data */ +#define D3DDEVCAPS_SORTINCREASINGZ 0x00000002L /* Device needs data sorted for increasing Z */ +#define D3DDEVCAPS_SORTDECREASINGZ 0X00000004L /* Device needs data sorted for decreasing Z */ +#define D3DDEVCAPS_SORTEXACT 0x00000008L /* Device needs data sorted exactly */ + +#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */ +#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */ +#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */ +#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */ +#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */ +#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */ +#if(DIRECT3D_VERSION >= 0x0500) +#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */ +#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */ +#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ +#if(DIRECT3D_VERSION >= 0x0600) +#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */ +#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */ +#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/ +#endif /* DIRECT3D_VERSION >= 0x0600 */ +#if(DIRECT3D_VERSION >= 0x0700) +#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */ +#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */ +#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */ + +/* + * These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field + */ + +/* device can do texgen */ +#define D3DVTXPCAPS_TEXGEN 0x00000001L +/* device can do IDirect3DDevice7 colormaterialsource ops */ +#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L +/* device can do vertex fog */ +#define D3DVTXPCAPS_VERTEXFOG 0x00000004L +/* device can do directional lights */ +#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L +/* device can do positional lights (includes point and spot) */ +#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L +/* device can do local viewer */ +#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L + +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +#define D3DFDS_COLORMODEL 0x00000001L /* Match color model */ +#define D3DFDS_GUID 0x00000002L /* Match guid */ +#define D3DFDS_HARDWARE 0x00000004L /* Match hardware/software */ +#define D3DFDS_TRIANGLES 0x00000008L /* Match in triCaps */ +#define D3DFDS_LINES 0x00000010L /* Match in lineCaps */ +#define D3DFDS_MISCCAPS 0x00000020L /* Match primCaps.dwMiscCaps */ +#define D3DFDS_RASTERCAPS 0x00000040L /* Match primCaps.dwRasterCaps */ +#define D3DFDS_ZCMPCAPS 0x00000080L /* Match primCaps.dwZCmpCaps */ +#define D3DFDS_ALPHACMPCAPS 0x00000100L /* Match primCaps.dwAlphaCmpCaps */ +#define D3DFDS_SRCBLENDCAPS 0x00000200L /* Match primCaps.dwSourceBlendCaps */ +#define D3DFDS_DSTBLENDCAPS 0x00000400L /* Match primCaps.dwDestBlendCaps */ +#define D3DFDS_SHADECAPS 0x00000800L /* Match primCaps.dwShadeCaps */ +#define D3DFDS_TEXTURECAPS 0x00001000L /* Match primCaps.dwTextureCaps */ +#define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */ +#define D3DFDS_TEXTUREBLENDCAPS 0x00004000L /* Match primCaps.dwTextureBlendCaps */ +#define D3DFDS_TEXTUREADDRESSCAPS 0x00008000L /* Match primCaps.dwTextureBlendCaps */ + +/* + * FindDevice arguments + */ +typedef struct _D3DFINDDEVICESEARCH { + DWORD dwSize; + DWORD dwFlags; + BOOL bHardware; + D3DCOLORMODEL dcmColorModel; + GUID guid; + DWORD dwCaps; + D3DPRIMCAPS dpcPrimCaps; +} D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH; + +typedef struct _D3DFINDDEVICERESULT { + DWORD dwSize; + GUID guid; /* guid which matched */ + D3DDEVICEDESC ddHwDesc; /* hardware D3DDEVICEDESC */ + D3DDEVICEDESC ddSwDesc; /* software D3DDEVICEDESC */ +} D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT; + +/* + * Description of execute buffer. + */ +typedef struct _D3DExecuteBufferDesc { + DWORD dwSize; /* size of this structure */ + DWORD dwFlags; /* flags indicating which fields are valid */ + DWORD dwCaps; /* capabilities of execute buffer */ + DWORD dwBufferSize; /* size of execute buffer data */ + LPVOID lpData; /* pointer to actual data */ +} D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC; + +/* D3DEXECUTEBUFFER dwFlags indicating valid fields */ + +#define D3DDEB_BUFSIZE 0x00000001l /* buffer size valid */ +#define D3DDEB_CAPS 0x00000002l /* caps valid */ +#define D3DDEB_LPDATA 0x00000004l /* lpData valid */ + +/* D3DEXECUTEBUFFER dwCaps */ + +#define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l /* buffer in system memory */ +#define D3DDEBCAPS_VIDEOMEMORY 0x00000002l /* buffer in device memory */ +#define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY) + +#if(DIRECT3D_VERSION < 0x0800) + +#if(DIRECT3D_VERSION >= 0x0700) +typedef struct _D3DDEVINFO_TEXTUREMANAGER { + BOOL bThrashing; /* indicates if thrashing */ + DWORD dwApproxBytesDownloaded; /* Approximate number of bytes downloaded by texture manager */ + DWORD dwNumEvicts; /* number of textures evicted */ + DWORD dwNumVidCreates; /* number of textures created in video memory */ + DWORD dwNumTexturesUsed; /* number of textures used */ + DWORD dwNumUsedTexInVid; /* number of used textures present in video memory */ + DWORD dwWorkingSet; /* number of textures in video memory */ + DWORD dwWorkingSetBytes; /* number of bytes in video memory */ + DWORD dwTotalManaged; /* total number of managed textures */ + DWORD dwTotalBytes; /* total number of bytes of managed textures */ + DWORD dwLastPri; /* priority of last texture evicted */ +} D3DDEVINFO_TEXTUREMANAGER, *LPD3DDEVINFO_TEXTUREMANAGER; + +typedef struct _D3DDEVINFO_TEXTURING { + DWORD dwNumLoads; /* counts Load() API calls */ + DWORD dwApproxBytesLoaded; /* Approximate number bytes loaded via Load() */ + DWORD dwNumPreLoads; /* counts PreLoad() API calls */ + DWORD dwNumSet; /* counts SetTexture() API calls */ + DWORD dwNumCreates; /* counts texture creates */ + DWORD dwNumDestroys; /* counts texture destroys */ + DWORD dwNumSetPriorities; /* counts SetPriority() API calls */ + DWORD dwNumSetLODs; /* counts SetLOD() API calls */ + DWORD dwNumLocks; /* counts number of texture locks */ + DWORD dwNumGetDCs; /* counts number of GetDCs to textures */ +} D3DDEVINFO_TEXTURING, *LPD3DDEVINFO_TEXTURING; +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +#endif //(DIRECT3D_VERSION < 0x0800) + +#pragma pack() + + +#endif /* _D3DCAPS_H_ */ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3drm.h b/Src/Decoder_H264_ALL/D3D/include/d3drm.h new file mode 100644 index 0000000..143c0e0 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3drm.h @@ -0,0 +1,342 @@ +/*==========================================================================; + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: d3drm.h + * Content: Direct3DRM include file + * + ***************************************************************************/ + +#ifndef __D3DRM_H__ +#define __D3DRM_H__ + +#include "ddraw.h" + +#ifdef __cplusplus +struct IDirect3DRM; +#endif + +typedef struct IDirect3DRM *LPDIRECT3DRM; + +#include "d3drmobj.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +DEFINE_GUID(IID_IDirect3DRM, 0x2bc49361, 0x8327, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRM2, 0x4516ecc8, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRM3, 0x4516ec83, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +WIN_TYPES(IDirect3DRM, DIRECT3DRM); +WIN_TYPES(IDirect3DRM2, DIRECT3DRM2); +WIN_TYPES(IDirect3DRM3, DIRECT3DRM3); + +/* + * Direct3DRM Object Class (for CoCreateInstance()) + */ +DEFINE_GUID(CLSID_CDirect3DRM, 0x4516ec41, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); + + +/* Create a Direct3DRM API */ +STDAPI Direct3DRMCreate(LPDIRECT3DRM FAR *lplpDirect3DRM); + +#undef INTERFACE +#define INTERFACE IDirect3DRM + +DECLARE_INTERFACE_(IDirect3DRM, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD(CreateObject) + (THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE; + STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME *) PURE; + STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE; + STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER *) PURE; + STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE; + STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE; + STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE; + STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE *) PURE; + STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE; + STDMETHOD(CreateLightRGB) + (THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE; + STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE; + STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE *) PURE; + + /* Create a Windows Device using DirectDraw surfaces */ + STDMETHOD(CreateDeviceFromSurface) + ( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD, + LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE * + ) PURE; + + /* Create a Windows Device using D3D objects */ + STDMETHOD(CreateDeviceFromD3D) + ( THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev, + LPDIRECT3DRMDEVICE * + ) PURE; + + STDMETHOD(CreateDeviceFromClipper) + ( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, + int width, int height, LPDIRECT3DRMDEVICE *) PURE; + + STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE *) PURE; + + STDMETHOD(CreateShadow) + ( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT, + D3DVALUE px, D3DVALUE py, D3DVALUE pz, + D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, + LPDIRECT3DRMVISUAL * + ) PURE; + STDMETHOD(CreateViewport) + ( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD, + DWORD, DWORD, LPDIRECT3DRMVIEWPORT * + ) PURE; + STDMETHOD(CreateWrap) + ( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME, + D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, + D3DVALUE ou, D3DVALUE ov, + D3DVALUE su, D3DVALUE sv, + LPDIRECT3DRMWRAP * + ) PURE; + STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE; + STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE *) PURE; + STDMETHOD(LoadTextureFromResource) (THIS_ HRSRC rs, LPDIRECT3DRMTEXTURE *) PURE; + + STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE; + STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE; + STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE; + STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE; + STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE; + + STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE; + STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE; + + STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE; + + STDMETHOD(Load) + ( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS, + D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID, + LPDIRECT3DRMFRAME + ) PURE; + STDMETHOD(Tick) (THIS_ D3DVALUE) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRM2 + +DECLARE_INTERFACE_(IDirect3DRM2, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD(CreateObject) + (THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE; + STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME2 *) PURE; + STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE; + STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER2 *) PURE; + STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE *) PURE; + STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION *) PURE; + STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE; + STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE2 *) PURE; + STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE; + STDMETHOD(CreateLightRGB) + (THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE; + STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE; + STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE2 *) PURE; + + /* Create a Windows Device using DirectDraw surfaces */ + STDMETHOD(CreateDeviceFromSurface) + ( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD, + LPDIRECTDRAWSURFACE lpDDSBack, LPDIRECT3DRMDEVICE2 * + ) PURE; + + /* Create a Windows Device using D3D objects */ + STDMETHOD(CreateDeviceFromD3D) + ( THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev, + LPDIRECT3DRMDEVICE2 * + ) PURE; + + STDMETHOD(CreateDeviceFromClipper) + ( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, + int width, int height, LPDIRECT3DRMDEVICE2 *) PURE; + + STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE2 *) PURE; + + STDMETHOD(CreateShadow) + ( THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT, + D3DVALUE px, D3DVALUE py, D3DVALUE pz, + D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, + LPDIRECT3DRMVISUAL * + ) PURE; + STDMETHOD(CreateViewport) + ( THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD, + DWORD, DWORD, LPDIRECT3DRMVIEWPORT * + ) PURE; + STDMETHOD(CreateWrap) + ( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME, + D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, + D3DVALUE ou, D3DVALUE ov, + D3DVALUE su, D3DVALUE sv, + LPDIRECT3DRMWRAP * + ) PURE; + STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE; + STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE2 *) PURE; + STDMETHOD(LoadTextureFromResource) (THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType, LPDIRECT3DRMTEXTURE2 *) PURE; + + STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE; + STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE; + STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE; + STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE; + STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE; + + STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE; + STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE; + + STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE; + + STDMETHOD(Load) + ( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS, + D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURECALLBACK, LPVOID, + LPDIRECT3DRMFRAME + ) PURE; + STDMETHOD(Tick) (THIS_ D3DVALUE) PURE; + + STDMETHOD(CreateProgressiveMesh)(THIS_ LPDIRECT3DRMPROGRESSIVEMESH *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRM3 + +DECLARE_INTERFACE_(IDirect3DRM3, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD(CreateObject) + (THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppv) PURE; + STDMETHOD(CreateFrame) (THIS_ LPDIRECT3DRMFRAME3, LPDIRECT3DRMFRAME3 *) PURE; + STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *) PURE; + STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER3 *) PURE; + STDMETHOD(CreateFace) (THIS_ LPDIRECT3DRMFACE2 *) PURE; + STDMETHOD(CreateAnimation) (THIS_ LPDIRECT3DRMANIMATION2 *) PURE; + STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET2 *) PURE; + STDMETHOD(CreateTexture) (THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE3 *) PURE; + STDMETHOD(CreateLight) (THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE; + STDMETHOD(CreateLightRGB) + (THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE; + STDMETHOD(CreateMaterial) (THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL2 *) PURE; + STDMETHOD(CreateDevice) (THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE3 *) PURE; + + /* Create a Windows Device using DirectDraw surfaces */ + STDMETHOD(CreateDeviceFromSurface) + ( THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD, + LPDIRECTDRAWSURFACE lpDDSBack, DWORD dwFlags, LPDIRECT3DRMDEVICE3 * + ) PURE; + + /* Create a Windows Device using D3D objects */ + STDMETHOD(CreateDeviceFromD3D) + ( THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev, + LPDIRECT3DRMDEVICE3 * + ) PURE; + + STDMETHOD(CreateDeviceFromClipper) + ( THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, + int width, int height, LPDIRECT3DRMDEVICE3 *) PURE; + + STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DRMTEXTURE3 *) PURE; + + STDMETHOD(CreateShadow) + ( THIS_ LPUNKNOWN, LPDIRECT3DRMLIGHT, + D3DVALUE px, D3DVALUE py, D3DVALUE pz, + D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, + LPDIRECT3DRMSHADOW2 * + ) PURE; + STDMETHOD(CreateViewport) + ( THIS_ LPDIRECT3DRMDEVICE3, LPDIRECT3DRMFRAME3, DWORD, DWORD, + DWORD, DWORD, LPDIRECT3DRMVIEWPORT2 * + ) PURE; + STDMETHOD(CreateWrap) + ( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME3, + D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, + D3DVALUE ou, D3DVALUE ov, + D3DVALUE su, D3DVALUE sv, + LPDIRECT3DRMWRAP * + ) PURE; + STDMETHOD(CreateUserVisual) (THIS_ D3DRMUSERVISUALCALLBACK, LPVOID lPArg, LPDIRECT3DRMUSERVISUAL *) PURE; + STDMETHOD(LoadTexture) (THIS_ const char *, LPDIRECT3DRMTEXTURE3 *) PURE; + STDMETHOD(LoadTextureFromResource) (THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType, LPDIRECT3DRMTEXTURE3 *) PURE; + + STDMETHOD(SetSearchPath) (THIS_ LPCSTR) PURE; + STDMETHOD(AddSearchPath) (THIS_ LPCSTR) PURE; + STDMETHOD(GetSearchPath) (THIS_ DWORD *size_return, LPSTR path_return) PURE; + STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE; + STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE; + + STDMETHOD(GetDevices) (THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE; + STDMETHOD(GetNamedObject) (THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE; + + STDMETHOD(EnumerateObjects) (THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE; + + STDMETHOD(Load) + ( THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS, + D3DRMLOADCALLBACK, LPVOID, D3DRMLOADTEXTURE3CALLBACK, LPVOID, + LPDIRECT3DRMFRAME3 + ) PURE; + STDMETHOD(Tick) (THIS_ D3DVALUE) PURE; + + STDMETHOD(CreateProgressiveMesh)(THIS_ LPDIRECT3DRMPROGRESSIVEMESH *) PURE; + + /* Used with IDirect3DRMObject2 */ + STDMETHOD(RegisterClient) (THIS_ REFGUID rguid, LPDWORD lpdwID) PURE; + STDMETHOD(UnregisterClient) (THIS_ REFGUID rguid) PURE; + + STDMETHOD(CreateClippedVisual) (THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMCLIPPEDVISUAL *) PURE; + STDMETHOD(SetOptions) (THIS_ DWORD); + STDMETHOD(GetOptions) (THIS_ LPDWORD); +}; + +#define D3DRM_OK DD_OK +#define D3DRMERR_BADOBJECT MAKE_DDHRESULT(781) +#define D3DRMERR_BADTYPE MAKE_DDHRESULT(782) +#define D3DRMERR_BADALLOC MAKE_DDHRESULT(783) +#define D3DRMERR_FACEUSED MAKE_DDHRESULT(784) +#define D3DRMERR_NOTFOUND MAKE_DDHRESULT(785) +#define D3DRMERR_NOTDONEYET MAKE_DDHRESULT(786) +#define D3DRMERR_FILENOTFOUND MAKE_DDHRESULT(787) +#define D3DRMERR_BADFILE MAKE_DDHRESULT(788) +#define D3DRMERR_BADDEVICE MAKE_DDHRESULT(789) +#define D3DRMERR_BADVALUE MAKE_DDHRESULT(790) +#define D3DRMERR_BADMAJORVERSION MAKE_DDHRESULT(791) +#define D3DRMERR_BADMINORVERSION MAKE_DDHRESULT(792) +#define D3DRMERR_UNABLETOEXECUTE MAKE_DDHRESULT(793) +#define D3DRMERR_LIBRARYNOTFOUND MAKE_DDHRESULT(794) +#define D3DRMERR_INVALIDLIBRARY MAKE_DDHRESULT(795) +#define D3DRMERR_PENDING MAKE_DDHRESULT(796) +#define D3DRMERR_NOTENOUGHDATA MAKE_DDHRESULT(797) +#define D3DRMERR_REQUESTTOOLARGE MAKE_DDHRESULT(798) +#define D3DRMERR_REQUESTTOOSMALL MAKE_DDHRESULT(799) +#define D3DRMERR_CONNECTIONLOST MAKE_DDHRESULT(800) +#define D3DRMERR_LOADABORTED MAKE_DDHRESULT(801) +#define D3DRMERR_NOINTERNET MAKE_DDHRESULT(802) +#define D3DRMERR_BADCACHEFILE MAKE_DDHRESULT(803) +#define D3DRMERR_BOXNOTSET MAKE_DDHRESULT(804) +#define D3DRMERR_BADPMDATA MAKE_DDHRESULT(805) +#define D3DRMERR_CLIENTNOTREGISTERED MAKE_DDHRESULT(806) +#define D3DRMERR_NOTCREATEDFROMDDS MAKE_DDHRESULT(807) +#define D3DRMERR_NOSUCHKEY MAKE_DDHRESULT(808) +#define D3DRMERR_INCOMPATABLEKEY MAKE_DDHRESULT(809) +#define D3DRMERR_ELEMENTINUSE MAKE_DDHRESULT(810) +#define D3DRMERR_TEXTUREFORMATNOTFOUND MAKE_DDHRESULT(811) +#define D3DRMERR_NOTAGGREGATED MAKE_DDHRESULT(812) + +#ifdef __cplusplus +}; +#endif + +#endif /* _D3DRMAPI_H_ */ + + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3drmdef.h b/Src/Decoder_H264_ALL/D3D/include/d3drmdef.h new file mode 100644 index 0000000..9da4b18 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3drmdef.h @@ -0,0 +1,695 @@ +/*==========================================================================; + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: d3drm.h + * Content: Direct3DRM include file + * + ***************************************************************************/ + +#ifndef __D3DRMDEFS_H__ +#define __D3DRMDEFS_H__ + +#include +#include "d3dtypes.h" + +#ifdef WIN32 +#define D3DRMAPI __stdcall +#else +#define D3DRMAPI +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + +#ifndef TRUE +#define FALSE 0 +#define TRUE 1 +#endif + +typedef struct _D3DRMVECTOR4D +{ D3DVALUE x, y, z, w; +} D3DRMVECTOR4D, *LPD3DRMVECTOR4D; + +typedef D3DVALUE D3DRMMATRIX4D[4][4]; + +typedef struct _D3DRMQUATERNION +{ D3DVALUE s; + D3DVECTOR v; +} D3DRMQUATERNION, *LPD3DRMQUATERNION; + +typedef struct _D3DRMRAY +{ D3DVECTOR dvDir; + D3DVECTOR dvPos; +} D3DRMRAY, *LPD3DRMRAY; + +typedef struct _D3DRMBOX +{ D3DVECTOR min, max; +} D3DRMBOX, *LPD3DRMBOX; + +typedef void (*D3DRMWRAPCALLBACK) + (LPD3DVECTOR, int* u, int* v, LPD3DVECTOR a, LPD3DVECTOR b, LPVOID); + +typedef enum _D3DRMLIGHTTYPE +{ D3DRMLIGHT_AMBIENT, + D3DRMLIGHT_POINT, + D3DRMLIGHT_SPOT, + D3DRMLIGHT_DIRECTIONAL, + D3DRMLIGHT_PARALLELPOINT +} D3DRMLIGHTTYPE, *LPD3DRMLIGHTTYPE; + +typedef enum _D3DRMSHADEMODE { + D3DRMSHADE_FLAT = 0, + D3DRMSHADE_GOURAUD = 1, + D3DRMSHADE_PHONG = 2, + + D3DRMSHADE_MASK = 7, + D3DRMSHADE_MAX = 8 +} D3DRMSHADEMODE, *LPD3DRMSHADEMODE; + +typedef enum _D3DRMLIGHTMODE { + D3DRMLIGHT_OFF = 0 * D3DRMSHADE_MAX, + D3DRMLIGHT_ON = 1 * D3DRMSHADE_MAX, + + D3DRMLIGHT_MASK = 7 * D3DRMSHADE_MAX, + D3DRMLIGHT_MAX = 8 * D3DRMSHADE_MAX +} D3DRMLIGHTMODE, *LPD3DRMLIGHTMODE; + +typedef enum _D3DRMFILLMODE { + D3DRMFILL_POINTS = 0 * D3DRMLIGHT_MAX, + D3DRMFILL_WIREFRAME = 1 * D3DRMLIGHT_MAX, + D3DRMFILL_SOLID = 2 * D3DRMLIGHT_MAX, + + D3DRMFILL_MASK = 7 * D3DRMLIGHT_MAX, + D3DRMFILL_MAX = 8 * D3DRMLIGHT_MAX +} D3DRMFILLMODE, *LPD3DRMFILLMODE; + +typedef DWORD D3DRMRENDERQUALITY, *LPD3DRMRENDERQUALITY; + +#define D3DRMRENDER_WIREFRAME (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_WIREFRAME) +#define D3DRMRENDER_UNLITFLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_OFF+D3DRMFILL_SOLID) +#define D3DRMRENDER_FLAT (D3DRMSHADE_FLAT+D3DRMLIGHT_ON+D3DRMFILL_SOLID) +#define D3DRMRENDER_GOURAUD (D3DRMSHADE_GOURAUD+D3DRMLIGHT_ON+D3DRMFILL_SOLID) +#define D3DRMRENDER_PHONG (D3DRMSHADE_PHONG+D3DRMLIGHT_ON+D3DRMFILL_SOLID) + +#define D3DRMRENDERMODE_BLENDEDTRANSPARENCY 1 +#define D3DRMRENDERMODE_SORTEDTRANSPARENCY 2 +#define D3DRMRENDERMODE_LIGHTINMODELSPACE 8 +#define D3DRMRENDERMODE_VIEWDEPENDENTSPECULAR 16 +#define D3DRMRENDERMODE_DISABLESORTEDALPHAZWRITE 32 + +typedef enum _D3DRMTEXTUREQUALITY +{ D3DRMTEXTURE_NEAREST, /* choose nearest texel */ + D3DRMTEXTURE_LINEAR, /* interpolate 4 texels */ + D3DRMTEXTURE_MIPNEAREST, /* nearest texel in nearest mipmap */ + D3DRMTEXTURE_MIPLINEAR, /* interpolate 2 texels from 2 mipmaps */ + D3DRMTEXTURE_LINEARMIPNEAREST, /* interpolate 4 texels in nearest mipmap */ + D3DRMTEXTURE_LINEARMIPLINEAR /* interpolate 8 texels from 2 mipmaps */ +} D3DRMTEXTUREQUALITY, *LPD3DRMTEXTUREQUALITY; + +/* + * Texture flags + */ +#define D3DRMTEXTURE_FORCERESIDENT 0x00000001 /* texture should be kept in video memory */ +#define D3DRMTEXTURE_STATIC 0x00000002 /* texture will not change */ +#define D3DRMTEXTURE_DOWNSAMPLEPOINT 0x00000004 /* point filtering should be used when downsampling */ +#define D3DRMTEXTURE_DOWNSAMPLEBILINEAR 0x00000008 /* bilinear filtering should be used when downsampling */ +#define D3DRMTEXTURE_DOWNSAMPLEREDUCEDEPTH 0x00000010 /* reduce bit depth when downsampling */ +#define D3DRMTEXTURE_DOWNSAMPLENONE 0x00000020 /* texture should never be downsampled */ +#define D3DRMTEXTURE_CHANGEDPIXELS 0x00000040 /* pixels have changed */ +#define D3DRMTEXTURE_CHANGEDPALETTE 0x00000080 /* palette has changed */ +#define D3DRMTEXTURE_INVALIDATEONLY 0x00000100 /* dirty regions are invalid */ + +/* + * Shadow flags + */ +#define D3DRMSHADOW_TRUEALPHA 0x00000001 /* shadow should render without artifacts when true alpha is on */ + +typedef enum _D3DRMCOMBINETYPE +{ D3DRMCOMBINE_REPLACE, + D3DRMCOMBINE_BEFORE, + D3DRMCOMBINE_AFTER +} D3DRMCOMBINETYPE, *LPD3DRMCOMBINETYPE; + +typedef D3DCOLORMODEL D3DRMCOLORMODEL, *LPD3DRMCOLORMODEL; + +typedef enum _D3DRMPALETTEFLAGS +{ D3DRMPALETTE_FREE, /* renderer may use this entry freely */ + D3DRMPALETTE_READONLY, /* fixed but may be used by renderer */ + D3DRMPALETTE_RESERVED /* may not be used by renderer */ +} D3DRMPALETTEFLAGS, *LPD3DRMPALETTEFLAGS; + +typedef struct _D3DRMPALETTEENTRY +{ unsigned char red; /* 0 .. 255 */ + unsigned char green; /* 0 .. 255 */ + unsigned char blue; /* 0 .. 255 */ + unsigned char flags; /* one of D3DRMPALETTEFLAGS */ +} D3DRMPALETTEENTRY, *LPD3DRMPALETTEENTRY; + +typedef struct _D3DRMIMAGE +{ int width, height; /* width and height in pixels */ + int aspectx, aspecty; /* aspect ratio for non-square pixels */ + int depth; /* bits per pixel */ + int rgb; /* if false, pixels are indices into a + palette otherwise, pixels encode + RGB values. */ + int bytes_per_line; /* number of bytes of memory for a + scanline. This must be a multiple + of 4. */ + void* buffer1; /* memory to render into (first buffer). */ + void* buffer2; /* second rendering buffer for double + buffering, set to NULL for single + buffering. */ + unsigned long red_mask; + unsigned long green_mask; + unsigned long blue_mask; + unsigned long alpha_mask; /* if rgb is true, these are masks for + the red, green and blue parts of a + pixel. Otherwise, these are masks + for the significant bits of the + red, green and blue elements in the + palette. For instance, most SVGA + displays use 64 intensities of red, + green and blue, so the masks should + all be set to 0xfc. */ + int palette_size; /* number of entries in palette */ + D3DRMPALETTEENTRY* palette; /* description of the palette (only if + rgb is false). Must be (1< /* Use Windows header files */ +#define VIRTUAL +#include "d3drmdef.h" + +#include "d3d.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The methods for IUnknown + */ +#define IUNKNOWN_METHODS(kind) \ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) kind; \ + STDMETHOD_(ULONG, AddRef) (THIS) kind; \ + STDMETHOD_(ULONG, Release) (THIS) kind + +/* + * The methods for IDirect3DRMObject + */ +#define IDIRECT3DRMOBJECT_METHODS(kind) \ + STDMETHOD(Clone) (THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) kind; \ + STDMETHOD(AddDestroyCallback) (THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) kind; \ + STDMETHOD(DeleteDestroyCallback) (THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) kind; \ + STDMETHOD(SetAppData) (THIS_ DWORD data) kind; \ + STDMETHOD_(DWORD, GetAppData) (THIS) kind; \ + STDMETHOD(SetName) (THIS_ LPCSTR) kind; \ + STDMETHOD(GetName) (THIS_ LPDWORD lpdwSize, LPSTR lpName) kind; \ + STDMETHOD(GetClassName) (THIS_ LPDWORD lpdwSize, LPSTR lpName) kind + + +#define WIN_TYPES(itype, ptype) \ + typedef interface itype FAR *LP##ptype, FAR **LPLP##ptype + +WIN_TYPES(IDirect3DRMObject, DIRECT3DRMOBJECT); +WIN_TYPES(IDirect3DRMObject2, DIRECT3DRMOBJECT2); +WIN_TYPES(IDirect3DRMDevice, DIRECT3DRMDEVICE); +WIN_TYPES(IDirect3DRMDevice2, DIRECT3DRMDEVICE2); +WIN_TYPES(IDirect3DRMDevice3, DIRECT3DRMDEVICE3); +WIN_TYPES(IDirect3DRMViewport, DIRECT3DRMVIEWPORT); +WIN_TYPES(IDirect3DRMViewport2, DIRECT3DRMVIEWPORT2); +WIN_TYPES(IDirect3DRMFrame, DIRECT3DRMFRAME); +WIN_TYPES(IDirect3DRMFrame2, DIRECT3DRMFRAME2); +WIN_TYPES(IDirect3DRMFrame3, DIRECT3DRMFRAME3); +WIN_TYPES(IDirect3DRMVisual, DIRECT3DRMVISUAL); +WIN_TYPES(IDirect3DRMMesh, DIRECT3DRMMESH); +WIN_TYPES(IDirect3DRMMeshBuilder, DIRECT3DRMMESHBUILDER); +WIN_TYPES(IDirect3DRMMeshBuilder2, DIRECT3DRMMESHBUILDER2); +WIN_TYPES(IDirect3DRMMeshBuilder3, DIRECT3DRMMESHBUILDER3); +WIN_TYPES(IDirect3DRMFace, DIRECT3DRMFACE); +WIN_TYPES(IDirect3DRMFace2, DIRECT3DRMFACE2); +WIN_TYPES(IDirect3DRMLight, DIRECT3DRMLIGHT); +WIN_TYPES(IDirect3DRMTexture, DIRECT3DRMTEXTURE); +WIN_TYPES(IDirect3DRMTexture2, DIRECT3DRMTEXTURE2); +WIN_TYPES(IDirect3DRMTexture3, DIRECT3DRMTEXTURE3); +WIN_TYPES(IDirect3DRMWrap, DIRECT3DRMWRAP); +WIN_TYPES(IDirect3DRMMaterial, DIRECT3DRMMATERIAL); +WIN_TYPES(IDirect3DRMMaterial2, DIRECT3DRMMATERIAL2); +WIN_TYPES(IDirect3DRMInterpolator, DIRECT3DRMINTERPOLATOR); +WIN_TYPES(IDirect3DRMAnimation, DIRECT3DRMANIMATION); +WIN_TYPES(IDirect3DRMAnimation2, DIRECT3DRMANIMATION2); +WIN_TYPES(IDirect3DRMAnimationSet, DIRECT3DRMANIMATIONSET); +WIN_TYPES(IDirect3DRMAnimationSet2, DIRECT3DRMANIMATIONSET2); +WIN_TYPES(IDirect3DRMUserVisual, DIRECT3DRMUSERVISUAL); +WIN_TYPES(IDirect3DRMShadow, DIRECT3DRMSHADOW); +WIN_TYPES(IDirect3DRMShadow2, DIRECT3DRMSHADOW2); +WIN_TYPES(IDirect3DRMArray, DIRECT3DRMARRAY); +WIN_TYPES(IDirect3DRMObjectArray, DIRECT3DRMOBJECTARRAY); +WIN_TYPES(IDirect3DRMDeviceArray, DIRECT3DRMDEVICEARRAY); +WIN_TYPES(IDirect3DRMFaceArray, DIRECT3DRMFACEARRAY); +WIN_TYPES(IDirect3DRMViewportArray, DIRECT3DRMVIEWPORTARRAY); +WIN_TYPES(IDirect3DRMFrameArray, DIRECT3DRMFRAMEARRAY); +WIN_TYPES(IDirect3DRMAnimationArray, DIRECT3DRMANIMATIONARRAY); +WIN_TYPES(IDirect3DRMVisualArray, DIRECT3DRMVISUALARRAY); +WIN_TYPES(IDirect3DRMPickedArray, DIRECT3DRMPICKEDARRAY); +WIN_TYPES(IDirect3DRMPicked2Array, DIRECT3DRMPICKED2ARRAY); +WIN_TYPES(IDirect3DRMLightArray, DIRECT3DRMLIGHTARRAY); +WIN_TYPES(IDirect3DRMProgressiveMesh, DIRECT3DRMPROGRESSIVEMESH); +WIN_TYPES(IDirect3DRMClippedVisual, DIRECT3DRMCLIPPEDVISUAL); + +/* + * Direct3DRM Object classes + */ +DEFINE_GUID(CLSID_CDirect3DRMDevice, 0x4fa3568e, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMViewport, 0x4fa3568f, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMFrame, 0x4fa35690, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMMesh, 0x4fa35691, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMMeshBuilder, 0x4fa35692, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMFace, 0x4fa35693, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMLight, 0x4fa35694, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMTexture, 0x4fa35695, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMWrap, 0x4fa35696, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMMaterial, 0x4fa35697, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMAnimation, 0x4fa35698, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMAnimationSet, 0x4fa35699, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMUserVisual, 0x4fa3569a, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMShadow, 0x4fa3569b, 0x623f, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(CLSID_CDirect3DRMViewportInterpolator, +0xde9eaa1, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(CLSID_CDirect3DRMFrameInterpolator, +0xde9eaa2, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(CLSID_CDirect3DRMMeshInterpolator, +0xde9eaa3, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(CLSID_CDirect3DRMLightInterpolator, +0xde9eaa6, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(CLSID_CDirect3DRMMaterialInterpolator, +0xde9eaa7, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(CLSID_CDirect3DRMTextureInterpolator, +0xde9eaa8, 0x3b84, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(CLSID_CDirect3DRMProgressiveMesh, 0x4516ec40, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(CLSID_CDirect3DRMClippedVisual, 0x5434e72d, 0x6d66, 0x11d1, 0xbb, 0xb, 0x0, 0x0, 0xf8, 0x75, 0x86, 0x5a); + + +/* + * Direct3DRM Object interfaces + */ +DEFINE_GUID(IID_IDirect3DRMObject, 0xeb16cb00, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMObject2, 0x4516ec7c, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMDevice, 0xe9e19280, 0x6e05, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMDevice2, 0x4516ec78, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMDevice3, 0x549f498b, 0xbfeb, 0x11d1, 0x8e, 0xd8, 0x0, 0xa0, 0xc9, 0x67, 0xa4, 0x82); +DEFINE_GUID(IID_IDirect3DRMViewport, 0xeb16cb02, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMViewport2, 0x4a1b1be6, 0xbfed, 0x11d1, 0x8e, 0xd8, 0x0, 0xa0, 0xc9, 0x67, 0xa4, 0x82); +DEFINE_GUID(IID_IDirect3DRMFrame, 0xeb16cb03, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMFrame2, 0xc3dfbd60, 0x3988, 0x11d0, 0x9e, 0xc2, 0x0, 0x0, 0xc0, 0x29, 0x1a, 0xc3); +DEFINE_GUID(IID_IDirect3DRMFrame3, 0xff6b7f70, 0xa40e, 0x11d1, 0x91, 0xf9, 0x0, 0x0, 0xf8, 0x75, 0x8e, 0x66); +DEFINE_GUID(IID_IDirect3DRMVisual, 0xeb16cb04, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMMesh, 0xa3a80d01, 0x6e12, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMMeshBuilder, 0xa3a80d02, 0x6e12, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMMeshBuilder2, 0x4516ec77, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMMeshBuilder3, 0x4516ec82, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMFace, 0xeb16cb07, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMFace2, 0x4516ec81, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMLight, 0xeb16cb08, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMTexture, 0xeb16cb09, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMTexture2, 0x120f30c0, 0x1629, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b); +DEFINE_GUID(IID_IDirect3DRMTexture3, 0xff6b7f73, 0xa40e, 0x11d1, 0x91, 0xf9, 0x0, 0x0, 0xf8, 0x75, 0x8e, 0x66); +DEFINE_GUID(IID_IDirect3DRMWrap, 0xeb16cb0a, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMMaterial, 0xeb16cb0b, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMMaterial2, 0xff6b7f75, 0xa40e, 0x11d1, 0x91, 0xf9, 0x0, 0x0, 0xf8, 0x75, 0x8e, 0x66); +DEFINE_GUID(IID_IDirect3DRMAnimation, 0xeb16cb0d, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMAnimation2, 0xff6b7f77, 0xa40e, 0x11d1, 0x91, 0xf9, 0x0, 0x0, 0xf8, 0x75, 0x8e, 0x66); +DEFINE_GUID(IID_IDirect3DRMAnimationSet, 0xeb16cb0e, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMAnimationSet2, 0xff6b7f79, 0xa40e, 0x11d1, 0x91, 0xf9, 0x0, 0x0, 0xf8, 0x75, 0x8e, 0x66); +DEFINE_GUID(IID_IDirect3DRMObjectArray, 0x242f6bc2, 0x3849, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMDeviceArray, 0xeb16cb10, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMViewportArray, 0xeb16cb11, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMFrameArray, 0xeb16cb12, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMVisualArray, 0xeb16cb13, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMLightArray, 0xeb16cb14, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMPickedArray, 0xeb16cb16, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMFaceArray, 0xeb16cb17, 0xd271, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMAnimationArray, +0xd5f1cae0, 0x4bd7, 0x11d1, 0xb9, 0x74, 0x0, 0x60, 0x8, 0x3e, 0x45, 0xf3); +DEFINE_GUID(IID_IDirect3DRMUserVisual, 0x59163de0, 0x6d43, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMShadow, 0xaf359780, 0x6ba3, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); +DEFINE_GUID(IID_IDirect3DRMShadow2, 0x86b44e25, 0x9c82, 0x11d1, 0xbb, 0xb, 0x0, 0xa0, 0xc9, 0x81, 0xa0, 0xa6); +DEFINE_GUID(IID_IDirect3DRMInterpolator, 0x242f6bc1, 0x3849, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMProgressiveMesh, 0x4516ec79, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMPicked2Array, 0x4516ec7b, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x0, 0x0, 0xc0, 0x78, 0x1b, 0xc3); +DEFINE_GUID(IID_IDirect3DRMClippedVisual, 0x5434e733, 0x6d66, 0x11d1, 0xbb, 0xb, 0x0, 0x0, 0xf8, 0x75, 0x86, 0x5a); + +typedef void (__cdecl *D3DRMOBJECTCALLBACK)(LPDIRECT3DRMOBJECT obj, LPVOID arg); +typedef void (__cdecl *D3DRMFRAMEMOVECALLBACK)(LPDIRECT3DRMFRAME obj, LPVOID arg, D3DVALUE delta); +typedef void (__cdecl *D3DRMFRAME3MOVECALLBACK)(LPDIRECT3DRMFRAME3 obj, LPVOID arg, D3DVALUE delta); +typedef void (__cdecl *D3DRMUPDATECALLBACK)(LPDIRECT3DRMDEVICE obj, LPVOID arg, int, LPD3DRECT); +typedef void (__cdecl *D3DRMDEVICE3UPDATECALLBACK)(LPDIRECT3DRMDEVICE3 obj, LPVOID arg, int, LPD3DRECT); +typedef int (__cdecl *D3DRMUSERVISUALCALLBACK) + ( LPDIRECT3DRMUSERVISUAL obj, LPVOID arg, D3DRMUSERVISUALREASON reason, + LPDIRECT3DRMDEVICE dev, LPDIRECT3DRMVIEWPORT view + ); +typedef HRESULT (__cdecl *D3DRMLOADTEXTURECALLBACK) + (char *tex_name, void *arg, LPDIRECT3DRMTEXTURE *); +typedef HRESULT (__cdecl *D3DRMLOADTEXTURE3CALLBACK) + (char *tex_name, void *arg, LPDIRECT3DRMTEXTURE3 *); +typedef void (__cdecl *D3DRMLOADCALLBACK) + (LPDIRECT3DRMOBJECT object, REFIID objectguid, LPVOID arg); + +typedef HRESULT (__cdecl *D3DRMDOWNSAMPLECALLBACK) + (LPDIRECT3DRMTEXTURE3 lpDirect3DRMTexture, LPVOID pArg, + LPDIRECTDRAWSURFACE pDDSSrc, LPDIRECTDRAWSURFACE pDDSDst); +typedef HRESULT (__cdecl *D3DRMVALIDATIONCALLBACK) + (LPDIRECT3DRMTEXTURE3 lpDirect3DRMTexture, LPVOID pArg, + DWORD dwFlags, DWORD dwcRects, LPRECT pRects); + + +typedef struct _D3DRMPICKDESC +{ + ULONG ulFaceIdx; + LONG lGroupIdx; + D3DVECTOR vPosition; + +} D3DRMPICKDESC, *LPD3DRMPICKDESC; + +typedef struct _D3DRMPICKDESC2 +{ + ULONG ulFaceIdx; + LONG lGroupIdx; + D3DVECTOR dvPosition; + D3DVALUE tu; + D3DVALUE tv; + D3DVECTOR dvNormal; + D3DCOLOR dcColor; + +} D3DRMPICKDESC2, *LPD3DRMPICKDESC2; + +#undef INTERFACE +#define INTERFACE IDirect3DRMObject + +/* + * Base class + */ +DECLARE_INTERFACE_(IDirect3DRMObject, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMObject2 + +DECLARE_INTERFACE_(IDirect3DRMObject2, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + + /* + * IDirect3DRMObject2 methods + */ + STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK lpFunc, LPVOID pvArg) PURE; + STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE; \ + STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK lpFunc, LPVOID pvArg) PURE; \ + STDMETHOD(GetClientData)(THIS_ DWORD dwID, LPVOID* lplpvData) PURE; + STDMETHOD(GetDirect3DRM)(THIS_ LPDIRECT3DRM* lplpDirect3DRM) PURE; + STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE; + STDMETHOD(SetClientData)(THIS_ DWORD dwID, LPVOID lpvData, DWORD dwFlags) PURE; + STDMETHOD(SetName)(THIS_ LPCSTR lpName) PURE; + STDMETHOD(GetAge)(THIS_ DWORD dwFlags, LPDWORD pdwAge) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMVisual + +DECLARE_INTERFACE_(IDirect3DRMVisual, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMDevice + +DECLARE_INTERFACE_(IDirect3DRMDevice, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMDevice methods + */ + STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE; + STDMETHOD(InitFromD3D)(THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev) PURE; + STDMETHOD(InitFromClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, int width, int height) PURE; + + STDMETHOD(Update)(THIS) PURE; + STDMETHOD(AddUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE; + STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE; + STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE; + STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE; + + STDMETHOD(SetDither)(THIS_ BOOL) PURE; + STDMETHOD(SetShades)(THIS_ DWORD) PURE; + STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE; + + STDMETHOD(GetViewports)(THIS_ LPDIRECT3DRMVIEWPORTARRAY *return_views) PURE; + + STDMETHOD_(BOOL, GetDither)(THIS) PURE; + STDMETHOD_(DWORD, GetShades)(THIS) PURE; + STDMETHOD_(DWORD, GetHeight)(THIS) PURE; + STDMETHOD_(DWORD, GetWidth)(THIS) PURE; + STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE; + STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; + STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE; + STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE; + STDMETHOD(GetDirect3DDevice)(THIS_ LPDIRECT3DDEVICE *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMDevice2 + +DECLARE_INTERFACE_(IDirect3DRMDevice2, IDirect3DRMDevice) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMDevice methods + */ + STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE; + STDMETHOD(InitFromD3D)(THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev) PURE; + STDMETHOD(InitFromClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, int width, int height) PURE; + + STDMETHOD(Update)(THIS) PURE; + STDMETHOD(AddUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE; + STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE; + STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE; + STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE; + + STDMETHOD(SetDither)(THIS_ BOOL) PURE; + STDMETHOD(SetShades)(THIS_ DWORD) PURE; + STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE; + + STDMETHOD(GetViewports)(THIS_ LPDIRECT3DRMVIEWPORTARRAY *return_views) PURE; + + STDMETHOD_(BOOL, GetDither)(THIS) PURE; + STDMETHOD_(DWORD, GetShades)(THIS) PURE; + STDMETHOD_(DWORD, GetHeight)(THIS) PURE; + STDMETHOD_(DWORD, GetWidth)(THIS) PURE; + STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE; + STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; + STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE; + STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE; + STDMETHOD(GetDirect3DDevice)(THIS_ LPDIRECT3DDEVICE *) PURE; + + /* + * IDirect3DRMDevice2 methods + */ + STDMETHOD(InitFromD3D2)(THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev) PURE; + STDMETHOD(InitFromSurface)(THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD, LPDIRECTDRAWSURFACE lpDDSBack) PURE; + STDMETHOD(SetRenderMode)(THIS_ DWORD dwFlags) PURE; + STDMETHOD_(DWORD, GetRenderMode)(THIS) PURE; + STDMETHOD(GetDirect3DDevice2)(THIS_ LPDIRECT3DDEVICE2 *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMDevice3 + +DECLARE_INTERFACE_(IDirect3DRMDevice3, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMDevice methods + */ + STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE; + STDMETHOD(InitFromD3D)(THIS_ LPDIRECT3D lpD3D, LPDIRECT3DDEVICE lpD3DDev) PURE; + STDMETHOD(InitFromClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper, LPGUID lpGUID, int width, int height) PURE; + + STDMETHOD(Update)(THIS) PURE; + STDMETHOD(AddUpdateCallback)(THIS_ D3DRMDEVICE3UPDATECALLBACK, LPVOID arg) PURE; + STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMDEVICE3UPDATECALLBACK, LPVOID arg) PURE; + STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE; + STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE; + + STDMETHOD(SetDither)(THIS_ BOOL) PURE; + STDMETHOD(SetShades)(THIS_ DWORD) PURE; + STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE; + + STDMETHOD(GetViewports)(THIS_ LPDIRECT3DRMVIEWPORTARRAY *return_views) PURE; + + STDMETHOD_(BOOL, GetDither)(THIS) PURE; + STDMETHOD_(DWORD, GetShades)(THIS) PURE; + STDMETHOD_(DWORD, GetHeight)(THIS) PURE; + STDMETHOD_(DWORD, GetWidth)(THIS) PURE; + STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE; + STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; + STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE; + STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE; + STDMETHOD(GetDirect3DDevice)(THIS_ LPDIRECT3DDEVICE *) PURE; + + /* + * IDirect3DRMDevice2 methods + */ + STDMETHOD(InitFromD3D2)(THIS_ LPDIRECT3D2 lpD3D, LPDIRECT3DDEVICE2 lpD3DDev) PURE; + STDMETHOD(InitFromSurface)(THIS_ LPGUID lpGUID, LPDIRECTDRAW lpDD, LPDIRECTDRAWSURFACE lpDDSBack, DWORD dwFlags) PURE; + STDMETHOD(SetRenderMode)(THIS_ DWORD dwFlags) PURE; + STDMETHOD_(DWORD, GetRenderMode)(THIS) PURE; + STDMETHOD(GetDirect3DDevice2)(THIS_ LPDIRECT3DDEVICE2 *) PURE; + + /* + * IDirect3DRMDevice3 methods + */ + STDMETHOD(FindPreferredTextureFormat)(THIS_ DWORD dwBitDepths, DWORD dwFlags, LPDDPIXELFORMAT lpDDPF) PURE; + STDMETHOD(RenderStateChange)(THIS_ D3DRENDERSTATETYPE drsType, DWORD dwVal, DWORD dwFlags) PURE; + STDMETHOD(LightStateChange)(THIS_ D3DLIGHTSTATETYPE drsType, DWORD dwVal, DWORD dwFlags) PURE; + STDMETHOD(GetStateChangeOptions)(THIS_ DWORD dwStateClass, DWORD dwStateNum, LPDWORD pdwFlags) PURE; + STDMETHOD(SetStateChangeOptions)(THIS_ DWORD dwStateClass, DWORD dwStateNum, DWORD dwFlags) PURE; +}; + + +#undef INTERFACE +#define INTERFACE IDirect3DRMViewport + +DECLARE_INTERFACE_(IDirect3DRMViewport, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMViewport methods + */ + STDMETHOD(Init) + ( THIS_ LPDIRECT3DRMDEVICE dev, LPDIRECT3DRMFRAME camera, + DWORD xpos, DWORD ypos, DWORD width, DWORD height + ) PURE; + STDMETHOD(Clear)(THIS) PURE; + STDMETHOD(Render)(THIS_ LPDIRECT3DRMFRAME) PURE; + + STDMETHOD(SetFront)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetBack)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetField)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetUniformScaling)(THIS_ BOOL) PURE; + STDMETHOD(SetCamera)(THIS_ LPDIRECT3DRMFRAME) PURE; + STDMETHOD(SetProjection)(THIS_ D3DRMPROJECTIONTYPE) PURE; + STDMETHOD(Transform)(THIS_ D3DRMVECTOR4D *d, D3DVECTOR *s) PURE; + STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DRMVECTOR4D *s) PURE; + STDMETHOD(Configure)(THIS_ LONG x, LONG y, DWORD width, DWORD height) PURE; + STDMETHOD(ForceUpdate)(THIS_ DWORD x1, DWORD y1, DWORD x2, DWORD y2) PURE; + STDMETHOD(SetPlane)(THIS_ D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top) PURE; + + STDMETHOD(GetCamera)(THIS_ LPDIRECT3DRMFRAME *) PURE; + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DRMDEVICE *) PURE; + STDMETHOD(GetPlane)(THIS_ D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top) PURE; + STDMETHOD(Pick)(THIS_ LONG x, LONG y, LPDIRECT3DRMPICKEDARRAY *return_visuals) PURE; + + STDMETHOD_(BOOL, GetUniformScaling)(THIS) PURE; + STDMETHOD_(LONG, GetX)(THIS) PURE; + STDMETHOD_(LONG, GetY)(THIS) PURE; + STDMETHOD_(DWORD, GetWidth)(THIS) PURE; + STDMETHOD_(DWORD, GetHeight)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetField)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetBack)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetFront)(THIS) PURE; + STDMETHOD_(D3DRMPROJECTIONTYPE, GetProjection)(THIS) PURE; + STDMETHOD(GetDirect3DViewport)(THIS_ LPDIRECT3DVIEWPORT *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMViewport2 +DECLARE_INTERFACE_(IDirect3DRMViewport2, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMViewport2 methods + */ + STDMETHOD(Init) + ( THIS_ LPDIRECT3DRMDEVICE3 dev, LPDIRECT3DRMFRAME3 camera, + DWORD xpos, DWORD ypos, DWORD width, DWORD height + ) PURE; + STDMETHOD(Clear)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(Render)(THIS_ LPDIRECT3DRMFRAME3) PURE; + + STDMETHOD(SetFront)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetBack)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetField)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetUniformScaling)(THIS_ BOOL) PURE; + STDMETHOD(SetCamera)(THIS_ LPDIRECT3DRMFRAME3) PURE; + STDMETHOD(SetProjection)(THIS_ D3DRMPROJECTIONTYPE) PURE; + STDMETHOD(Transform)(THIS_ D3DRMVECTOR4D *d, D3DVECTOR *s) PURE; + STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DRMVECTOR4D *s) PURE; + STDMETHOD(Configure)(THIS_ LONG x, LONG y, DWORD width, DWORD height) PURE; + STDMETHOD(ForceUpdate)(THIS_ DWORD x1, DWORD y1, DWORD x2, DWORD y2) PURE; + STDMETHOD(SetPlane)(THIS_ D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top) PURE; + + STDMETHOD(GetCamera)(THIS_ LPDIRECT3DRMFRAME3 *) PURE; + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DRMDEVICE3 *) PURE; + STDMETHOD(GetPlane)(THIS_ D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top) PURE; + STDMETHOD(Pick)(THIS_ LONG x, LONG y, LPDIRECT3DRMPICKEDARRAY *return_visuals) PURE; + + STDMETHOD_(BOOL, GetUniformScaling)(THIS) PURE; + STDMETHOD_(LONG, GetX)(THIS) PURE; + STDMETHOD_(LONG, GetY)(THIS) PURE; + STDMETHOD_(DWORD, GetWidth)(THIS) PURE; + STDMETHOD_(DWORD, GetHeight)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetField)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetBack)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetFront)(THIS) PURE; + STDMETHOD_(D3DRMPROJECTIONTYPE, GetProjection)(THIS) PURE; + STDMETHOD(GetDirect3DViewport)(THIS_ LPDIRECT3DVIEWPORT *) PURE; + STDMETHOD(TransformVectors)(THIS_ DWORD dwNumVectors, + LPD3DRMVECTOR4D lpDstVectors, + LPD3DVECTOR lpSrcVectors) PURE; + STDMETHOD(InverseTransformVectors)(THIS_ DWORD dwNumVectors, + LPD3DVECTOR lpDstVectors, + LPD3DRMVECTOR4D lpSrcVectors) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMFrame + +DECLARE_INTERFACE_(IDirect3DRMFrame, IDirect3DRMVisual) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMFrame methods + */ + STDMETHOD(AddChild)(THIS_ LPDIRECT3DRMFRAME child) PURE; + STDMETHOD(AddLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; + STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE; + STDMETHOD(AddTransform)(THIS_ D3DRMCOMBINETYPE, D3DRMMATRIX4D) PURE; + STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; + STDMETHOD(AddVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE; + STDMETHOD(GetChildren)(THIS_ LPDIRECT3DRMFRAMEARRAY *children) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; + STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE; + STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE; + STDMETHOD(GetParent)(THIS_ LPDIRECT3DRMFRAME *) PURE; + STDMETHOD(GetPosition)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_position) PURE; + STDMETHOD(GetRotation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR axis, LPD3DVALUE return_theta) PURE; + STDMETHOD(GetScene)(THIS_ LPDIRECT3DRMFRAME *) PURE; + STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE; + STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE *) PURE; + STDMETHOD(GetTransform)(THIS_ D3DRMMATRIX4D return_matrix) PURE; + STDMETHOD(GetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_velocity, BOOL with_rotation) PURE; + STDMETHOD(GetOrientation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR dir, LPD3DVECTOR up) PURE; + STDMETHOD(GetVisuals)(THIS_ LPDIRECT3DRMVISUALARRAY *visuals) PURE; + STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; + STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; + STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg)PURE; + STDMETHOD(LookAt)(THIS_ LPDIRECT3DRMFRAME target, LPDIRECT3DRMFRAME reference, D3DRMFRAMECONSTRAINT) PURE; + STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE; + STDMETHOD(DeleteChild)(THIS_ LPDIRECT3DRMFRAME) PURE; + STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; + STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE; + STDMETHOD(DeleteVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE; + STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE; + STDMETHOD(GetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *) PURE; + STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE; + STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE; + STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE; + STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end, D3DVALUE *return_density) PURE; + STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; + STDMETHOD(SetSceneBackgroundImage)(THIS_ LPDIRECT3DRMTEXTURE) PURE; + STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE; + STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE; + STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE; + STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE; + STDMETHOD(SetOrientation) + ( THIS_ LPDIRECT3DRMFRAME reference, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz + ) PURE; + STDMETHOD(SetPosition)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetRotation)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; + STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE; + STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(SetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) PURE; + STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE; + STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMFrame2 + +DECLARE_INTERFACE_(IDirect3DRMFrame2, IDirect3DRMFrame) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMFrame methods + */ + STDMETHOD(AddChild)(THIS_ LPDIRECT3DRMFRAME child) PURE; + STDMETHOD(AddLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; + STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE; + STDMETHOD(AddTransform)(THIS_ D3DRMCOMBINETYPE, D3DRMMATRIX4D) PURE; + STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; + STDMETHOD(AddVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE; + STDMETHOD(GetChildren)(THIS_ LPDIRECT3DRMFRAMEARRAY *children) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; + STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE; + STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE; + STDMETHOD(GetParent)(THIS_ LPDIRECT3DRMFRAME *) PURE; + STDMETHOD(GetPosition)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_position) PURE; + STDMETHOD(GetRotation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR axis, LPD3DVALUE return_theta) PURE; + STDMETHOD(GetScene)(THIS_ LPDIRECT3DRMFRAME *) PURE; + STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE; + STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE *) PURE; + STDMETHOD(GetTransform)(THIS_ D3DRMMATRIX4D return_matrix) PURE; + STDMETHOD(GetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_velocity, BOOL with_rotation) PURE; + STDMETHOD(GetOrientation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR dir, LPD3DVECTOR up) PURE; + STDMETHOD(GetVisuals)(THIS_ LPDIRECT3DRMVISUALARRAY *visuals) PURE; + STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; + STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; + STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg)PURE; + STDMETHOD(LookAt)(THIS_ LPDIRECT3DRMFRAME target, LPDIRECT3DRMFRAME reference, D3DRMFRAMECONSTRAINT) PURE; + STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE; + STDMETHOD(DeleteChild)(THIS_ LPDIRECT3DRMFRAME) PURE; + STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; + STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE; + STDMETHOD(DeleteVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE; + STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE; + STDMETHOD(GetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *) PURE; + STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE; + STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE; + STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE; + STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end, D3DVALUE *return_density) PURE; + STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; + STDMETHOD(SetSceneBackgroundImage)(THIS_ LPDIRECT3DRMTEXTURE) PURE; + STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE; + STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE; + STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE; + STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE; + STDMETHOD(SetOrientation) + ( THIS_ LPDIRECT3DRMFRAME reference, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz + ) PURE; + STDMETHOD(SetPosition)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetRotation)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; + STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE; + STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(SetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) PURE; + STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE; + STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; + + /* + * IDirect3DRMFrame2 methods + */ + STDMETHOD(AddMoveCallback2)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg, DWORD dwFlags) PURE; + STDMETHOD(GetBox)(THIS_ LPD3DRMBOX) PURE; + STDMETHOD_(BOOL, GetBoxEnable)(THIS) PURE; + STDMETHOD(GetAxes)(THIS_ LPD3DVECTOR dir, LPD3DVECTOR up); + STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL *) PURE; + STDMETHOD_(BOOL, GetInheritAxes)(THIS); + STDMETHOD(GetHierarchyBox)(THIS_ LPD3DRMBOX) PURE; + + STDMETHOD(SetBox)(THIS_ LPD3DRMBOX) PURE; + STDMETHOD(SetBoxEnable)(THIS_ BOOL) PURE; + STDMETHOD(SetAxes)(THIS_ D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz); + STDMETHOD(SetInheritAxes)(THIS_ BOOL inherit_from_parent); + STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE; + STDMETHOD(SetQuaternion)(THIS_ LPDIRECT3DRMFRAME reference, D3DRMQUATERNION *q) PURE; + + STDMETHOD(RayPick)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DRMRAY ray, DWORD dwFlags, LPDIRECT3DRMPICKED2ARRAY *return_visuals) PURE; + STDMETHOD(Save)(THIS_ LPCSTR filename, D3DRMXOFFORMAT d3dFormat, + D3DRMSAVEOPTIONS d3dSaveFlags); +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMFrame3 + +DECLARE_INTERFACE_(IDirect3DRMFrame3, IDirect3DRMVisual) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMFrame3 methods + */ + STDMETHOD(AddChild)(THIS_ LPDIRECT3DRMFRAME3 child) PURE; + STDMETHOD(AddLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; + STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAME3MOVECALLBACK, VOID *arg, DWORD dwFlags) PURE; + STDMETHOD(AddTransform)(THIS_ D3DRMCOMBINETYPE, D3DRMMATRIX4D) PURE; + STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; + STDMETHOD(AddVisual)(THIS_ LPUNKNOWN) PURE; + STDMETHOD(GetChildren)(THIS_ LPDIRECT3DRMFRAMEARRAY *children) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; + STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE; + STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE; + STDMETHOD(GetParent)(THIS_ LPDIRECT3DRMFRAME3 *) PURE; + STDMETHOD(GetPosition)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DVECTOR return_position) PURE; + STDMETHOD(GetRotation)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DVECTOR axis, LPD3DVALUE return_theta) PURE; + STDMETHOD(GetScene)(THIS_ LPDIRECT3DRMFRAME3 *) PURE; + STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE; + STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE3 *) PURE; + STDMETHOD(GetTransform)(THIS_ LPDIRECT3DRMFRAME3 reference, + D3DRMMATRIX4D rmMatrix) PURE; + STDMETHOD(GetVelocity)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DVECTOR return_velocity, BOOL with_rotation) PURE; + STDMETHOD(GetOrientation)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DVECTOR dir, LPD3DVECTOR up) PURE; + STDMETHOD(GetVisuals)(THIS_ LPDWORD lpdwCount, LPUNKNOWN *) PURE; + STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; + STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURE3CALLBACK, LPVOID lpArg)PURE; + STDMETHOD(LookAt)(THIS_ LPDIRECT3DRMFRAME3 target, LPDIRECT3DRMFRAME3 reference, D3DRMFRAMECONSTRAINT) PURE; + STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE; + STDMETHOD(DeleteChild)(THIS_ LPDIRECT3DRMFRAME3) PURE; + STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DRMLIGHT) PURE; + STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAME3MOVECALLBACK, VOID *arg) PURE; + STDMETHOD(DeleteVisual)(THIS_ LPUNKNOWN) PURE; + STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE; + STDMETHOD(GetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *) PURE; + STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE; + STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE; + STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE; + STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end, D3DVALUE *return_density) PURE; + STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE; + STDMETHOD(SetSceneBackgroundImage)(THIS_ LPDIRECT3DRMTEXTURE3) PURE; + STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE; + STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE; + STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE; + STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE; + STDMETHOD(SetOrientation) + ( THIS_ LPDIRECT3DRMFRAME3 reference, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz + ) PURE; + STDMETHOD(SetPosition)(THIS_ LPDIRECT3DRMFRAME3 reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetRotation)(THIS_ LPDIRECT3DRMFRAME3 reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE; + STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE; + STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE3) PURE; + STDMETHOD(SetVelocity)(THIS_ LPDIRECT3DRMFRAME3 reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) PURE; + STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE; + STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE; + STDMETHOD(GetBox)(THIS_ LPD3DRMBOX) PURE; + STDMETHOD_(BOOL, GetBoxEnable)(THIS) PURE; + STDMETHOD(GetAxes)(THIS_ LPD3DVECTOR dir, LPD3DVECTOR up); + STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2 *) PURE; + STDMETHOD_(BOOL, GetInheritAxes)(THIS); + STDMETHOD(GetHierarchyBox)(THIS_ LPD3DRMBOX) PURE; + + STDMETHOD(SetBox)(THIS_ LPD3DRMBOX) PURE; + STDMETHOD(SetBoxEnable)(THIS_ BOOL) PURE; + STDMETHOD(SetAxes)(THIS_ D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz); + STDMETHOD(SetInheritAxes)(THIS_ BOOL inherit_from_parent); + STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2) PURE; + STDMETHOD(SetQuaternion)(THIS_ LPDIRECT3DRMFRAME3 reference, D3DRMQUATERNION *q) PURE; + + STDMETHOD(RayPick)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DRMRAY ray, DWORD dwFlags, LPDIRECT3DRMPICKED2ARRAY *return_visuals) PURE; + STDMETHOD(Save)(THIS_ LPCSTR filename, D3DRMXOFFORMAT d3dFormat, + D3DRMSAVEOPTIONS d3dSaveFlags); + STDMETHOD(TransformVectors)(THIS_ LPDIRECT3DRMFRAME3 reference, + DWORD dwNumVectors, + LPD3DVECTOR lpDstVectors, + LPD3DVECTOR lpSrcVectors) PURE; + STDMETHOD(InverseTransformVectors)(THIS_ LPDIRECT3DRMFRAME3 reference, + DWORD dwNumVectors, + LPD3DVECTOR lpDstVectors, + LPD3DVECTOR lpSrcVectors) PURE; + STDMETHOD(SetTraversalOptions)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetTraversalOptions)(THIS_ LPDWORD lpdwFlags) PURE; + STDMETHOD(SetSceneFogMethod)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetSceneFogMethod)(THIS_ LPDWORD lpdwFlags) PURE; + STDMETHOD(SetMaterialOverride)(THIS_ LPD3DRMMATERIALOVERRIDE) PURE; + STDMETHOD(GetMaterialOverride)(THIS_ LPD3DRMMATERIALOVERRIDE) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMMesh + +DECLARE_INTERFACE_(IDirect3DRMMesh, IDirect3DRMVisual) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMMesh methods + */ + STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; + STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; + STDMETHOD(AddGroup)(THIS_ unsigned vCount, unsigned fCount, unsigned vPerFace, unsigned *fData, D3DRMGROUPINDEX *returnId) PURE; + STDMETHOD(SetVertices)(THIS_ D3DRMGROUPINDEX id, unsigned index, unsigned count, D3DRMVERTEX *values) PURE; + STDMETHOD(SetGroupColor)(THIS_ D3DRMGROUPINDEX id, D3DCOLOR value) PURE; + STDMETHOD(SetGroupColorRGB)(THIS_ D3DRMGROUPINDEX id, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetGroupMapping)(THIS_ D3DRMGROUPINDEX id, D3DRMMAPPING value) PURE; + STDMETHOD(SetGroupQuality)(THIS_ D3DRMGROUPINDEX id, D3DRMRENDERQUALITY value) PURE; + STDMETHOD(SetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL value) PURE; + STDMETHOD(SetGroupTexture)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMTEXTURE value) PURE; + + STDMETHOD_(unsigned, GetGroupCount)(THIS) PURE; + STDMETHOD(GetGroup)(THIS_ D3DRMGROUPINDEX id, unsigned *vCount, unsigned *fCount, unsigned *vPerFace, DWORD *fDataSize, unsigned *fData) PURE; + STDMETHOD(GetVertices)(THIS_ D3DRMGROUPINDEX id, DWORD index, DWORD count, D3DRMVERTEX *returnPtr) PURE; + STDMETHOD_(D3DCOLOR, GetGroupColor)(THIS_ D3DRMGROUPINDEX id) PURE; + STDMETHOD_(D3DRMMAPPING, GetGroupMapping)(THIS_ D3DRMGROUPINDEX id) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetGroupQuality)(THIS_ D3DRMGROUPINDEX id) PURE; + STDMETHOD(GetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL *returnPtr) PURE; + STDMETHOD(GetGroupTexture)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMTEXTURE *returnPtr) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMProgressiveMesh + +DECLARE_INTERFACE_(IDirect3DRMProgressiveMesh, IDirect3DRMVisual) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMProgressiveMesh methods + */ + STDMETHOD(Load) (THIS_ LPVOID lpObjLocation, LPVOID lpObjId, + D3DRMLOADOPTIONS dloLoadflags, D3DRMLOADTEXTURECALLBACK lpCallback, + LPVOID lpArg) PURE; + STDMETHOD(GetLoadStatus) (THIS_ LPD3DRMPMESHLOADSTATUS lpStatus) PURE; + STDMETHOD(SetMinRenderDetail) (THIS_ D3DVALUE d3dVal) PURE; + STDMETHOD(Abort) (THIS_ DWORD dwFlags) PURE; + + STDMETHOD(GetFaceDetail) (THIS_ LPDWORD lpdwCount) PURE; + STDMETHOD(GetVertexDetail) (THIS_ LPDWORD lpdwCount) PURE; + STDMETHOD(SetFaceDetail) (THIS_ DWORD dwCount) PURE; + STDMETHOD(SetVertexDetail) (THIS_ DWORD dwCount) PURE; + STDMETHOD(GetFaceDetailRange) (THIS_ LPDWORD lpdwMin, LPDWORD lpdwMax) PURE; + STDMETHOD(GetVertexDetailRange) (THIS_ LPDWORD lpdwMin, LPDWORD lpdwMax) PURE; + STDMETHOD(GetDetail) (THIS_ D3DVALUE *lpdvVal) PURE; + STDMETHOD(SetDetail) (THIS_ D3DVALUE d3dVal) PURE; + + STDMETHOD(RegisterEvents) (THIS_ HANDLE hEvent, DWORD dwFlags, DWORD dwReserved) PURE; + STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *lplpD3DRMMesh) PURE; + STDMETHOD(Duplicate) (THIS_ LPDIRECT3DRMPROGRESSIVEMESH *lplpD3DRMPMesh) PURE; + STDMETHOD(GetBox) (THIS_ LPD3DRMBOX lpBBox) PURE; + STDMETHOD(SetQuality) (THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(GetQuality) (THIS_ LPD3DRMRENDERQUALITY lpdwquality) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMShadow + +DECLARE_INTERFACE_(IDirect3DRMShadow, IDirect3DRMVisual) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMShadow methods + */ + STDMETHOD(Init) + ( THIS_ LPDIRECT3DRMVISUAL visual, LPDIRECT3DRMLIGHT light, + D3DVALUE px, D3DVALUE py, D3DVALUE pz, + D3DVALUE nx, D3DVALUE ny, D3DVALUE nz + ) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMShadow2 + +DECLARE_INTERFACE_(IDirect3DRMShadow2, IDirect3DRMVisual) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMShadow methods + */ + STDMETHOD(Init) + ( THIS_ LPUNKNOWN pUNK, LPDIRECT3DRMLIGHT light, + D3DVALUE px, D3DVALUE py, D3DVALUE pz, + D3DVALUE nx, D3DVALUE ny, D3DVALUE nz + ) PURE; + + /* + * IDirect3DRMShadow2 methods + */ + STDMETHOD(GetVisual)(THIS_ LPDIRECT3DRMVISUAL *) PURE; + STDMETHOD(SetVisual)(THIS_ LPUNKNOWN pUNK, DWORD) PURE; + STDMETHOD(GetLight)(THIS_ LPDIRECT3DRMLIGHT *) PURE; + STDMETHOD(SetLight)(THIS_ LPDIRECT3DRMLIGHT, DWORD) PURE; + STDMETHOD(GetPlane)(THIS_ LPD3DVALUE px, LPD3DVALUE py, LPD3DVALUE pz, + LPD3DVALUE nx, LPD3DVALUE ny, LPD3DVALUE nz) PURE; + STDMETHOD(SetPlane)(THIS_ D3DVALUE px, D3DVALUE py, D3DVALUE pz, + D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, DWORD) PURE; + STDMETHOD(GetOptions)(THIS_ LPDWORD) PURE; + STDMETHOD(SetOptions)(THIS_ DWORD) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMFace + +DECLARE_INTERFACE_(IDirect3DRMFace, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMFace methods + */ + STDMETHOD(AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddVertexAndNormalIndexed)(THIS_ DWORD vertex, DWORD normal) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE, D3DVALUE, D3DVALUE) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; + STDMETHOD(SetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE u, D3DVALUE v) PURE; + STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + + STDMETHOD(GetVertex)(THIS_ DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal) PURE; + STDMETHOD(GetVertices)(THIS_ DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals); + STDMETHOD(GetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE *u, D3DVALUE *v) PURE; + STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; + STDMETHOD(GetNormal)(THIS_ D3DVECTOR *) PURE; + STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE *) PURE; + STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL *) PURE; + + STDMETHOD_(int, GetVertexCount)(THIS) PURE; + STDMETHOD_(int, GetVertexIndex)(THIS_ DWORD which) PURE; + STDMETHOD_(int, GetTextureCoordinateIndex)(THIS_ DWORD which) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMFace2 + +DECLARE_INTERFACE_(IDirect3DRMFace2, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMFace methods + */ + STDMETHOD(AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddVertexAndNormalIndexed)(THIS_ DWORD vertex, DWORD normal) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE, D3DVALUE, D3DVALUE) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE3) PURE; + STDMETHOD(SetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE u, D3DVALUE v) PURE; + STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + + STDMETHOD(GetVertex)(THIS_ DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal) PURE; + STDMETHOD(GetVertices)(THIS_ DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals); + STDMETHOD(GetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE *u, D3DVALUE *v) PURE; + STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE; + STDMETHOD(GetNormal)(THIS_ D3DVECTOR *) PURE; + STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE3 *) PURE; + STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2 *) PURE; + + STDMETHOD_(int, GetVertexCount)(THIS) PURE; + STDMETHOD_(int, GetVertexIndex)(THIS_ DWORD which) PURE; + STDMETHOD_(int, GetTextureCoordinateIndex)(THIS_ DWORD which) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMMeshBuilder + +DECLARE_INTERFACE_(IDirect3DRMMeshBuilder, IDirect3DRMVisual) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMMeshBuilder methods + */ + STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg) PURE; + STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE; + STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; + STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE; + STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; + STDMETHOD(GenerateNormals)(THIS) PURE; + STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE; + + STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE; + STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER) PURE; + STDMETHOD(AddFrame)(THIS_ LPDIRECT3DRMFRAME) PURE; + STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE) PURE; + STDMETHOD(AddFaces) + ( THIS_ DWORD vcount, D3DVECTOR *vertices, DWORD ncount, D3DVECTOR *normals, + DWORD *data, LPDIRECT3DRMFACEARRAY* + ) PURE; + STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; + STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(SetPerspective)(THIS_ BOOL) PURE; + STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE; + STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE; + STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + + STDMETHOD(GetFaces)(THIS_ LPDIRECT3DRMFACEARRAY*) PURE; + STDMETHOD(GetVertices) + ( THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals, DWORD *face_data_size, DWORD *face_data + ) PURE; + STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE; + + STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE*) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; + STDMETHOD_(BOOL, GetPerspective)(THIS) PURE; + STDMETHOD_(int, GetFaceCount)(THIS) PURE; + STDMETHOD_(int, GetVertexCount)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE; + + STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMMeshBuilder2 + +DECLARE_INTERFACE_(IDirect3DRMMeshBuilder2, IDirect3DRMMeshBuilder) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMMeshBuilder methods + */ + STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg) PURE; + STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE; + STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; + STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE; + STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; + STDMETHOD(GenerateNormals)(THIS) PURE; + STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE; + + STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE; + STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER) PURE; + STDMETHOD(AddFrame)(THIS_ LPDIRECT3DRMFRAME) PURE; + STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE) PURE; + STDMETHOD(AddFaces) + ( THIS_ DWORD vcount, D3DVECTOR *vertices, DWORD ncount, D3DVECTOR *normals, + DWORD *data, LPDIRECT3DRMFACEARRAY* + ) PURE; + STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE; + STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(SetPerspective)(THIS_ BOOL) PURE; + STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE; + STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE; + STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + + STDMETHOD(GetFaces)(THIS_ LPDIRECT3DRMFACEARRAY*) PURE; + STDMETHOD(GetVertices) + ( THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals, DWORD *face_data_size, DWORD *face_data + ) PURE; + STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE; + + STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE*) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; + STDMETHOD_(BOOL, GetPerspective)(THIS) PURE; + STDMETHOD_(int, GetFaceCount)(THIS) PURE; + STDMETHOD_(int, GetVertexCount)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE; + + STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE; + + /* + * IDirect3DRMMeshBuilder2 methods + */ + STDMETHOD(GenerateNormals2)(THIS_ D3DVALUE crease, DWORD dwFlags) PURE; + STDMETHOD(GetFace)(THIS_ DWORD index, LPDIRECT3DRMFACE*) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMMeshBuilder3 + +DECLARE_INTERFACE_(IDirect3DRMMeshBuilder3, IDirect3DRMVisual) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMMeshBuilder3 methods + */ + STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURE3CALLBACK, LPVOID lpArg) PURE; + STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE; + STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE; + STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE; + STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE; + STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE; + STDMETHOD(GenerateNormals)(THIS_ D3DVALUE crease, DWORD dwFlags) PURE; + STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE; + + STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE; + STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER3, DWORD dwFlags) PURE; + STDMETHOD(AddFrame)(THIS_ LPDIRECT3DRMFRAME3) PURE; + STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE2) PURE; + STDMETHOD(AddFaces) + ( THIS_ DWORD vcount, D3DVECTOR *vertices, DWORD ncount, D3DVECTOR *normals, + DWORD *data, LPDIRECT3DRMFACEARRAY* + ) PURE; + STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE3) PURE; + STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2) PURE; + STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE; + STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE; + STDMETHOD(SetPerspective)(THIS_ BOOL) PURE; + STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE; + STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE; + STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(GetFaces)(THIS_ LPDIRECT3DRMFACEARRAY*) PURE; + STDMETHOD(GetGeometry) + ( THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals, DWORD *face_data_size, DWORD *face_data + ) PURE; + STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE; + STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE2 *) PURE; + STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE; + STDMETHOD_(BOOL, GetPerspective)(THIS) PURE; + STDMETHOD_(int, GetFaceCount)(THIS) PURE; + STDMETHOD_(int, GetVertexCount)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE; + STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE; + STDMETHOD(GetFace)(THIS_ DWORD index, LPDIRECT3DRMFACE2 *) PURE; + STDMETHOD(GetVertex)(THIS_ DWORD dwIndex, LPD3DVECTOR lpVector) PURE; + STDMETHOD(GetNormal)(THIS_ DWORD dwIndex, LPD3DVECTOR lpVector) PURE; + STDMETHOD(DeleteVertices)(THIS_ DWORD dwIndexFirst, DWORD dwCount) PURE; + STDMETHOD(DeleteNormals)(THIS_ DWORD dwIndexFirst, DWORD dwCount) PURE; + STDMETHOD(DeleteFace)(THIS_ LPDIRECT3DRMFACE2) PURE; + STDMETHOD(Empty)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(Optimize)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(AddFacesIndexed)(THIS_ DWORD dwFlags, DWORD *lpdwvIndices, DWORD *dwIndexFirst, DWORD *dwCount) PURE; + STDMETHOD(CreateSubMesh)(THIS_ LPUNKNOWN *) PURE; + STDMETHOD(GetParentMesh)(THIS_ DWORD, LPUNKNOWN *) PURE; + STDMETHOD(GetSubMeshes)(THIS_ LPDWORD lpdwCount, LPUNKNOWN *) PURE; + STDMETHOD(DeleteSubMesh)(THIS_ LPUNKNOWN) PURE; + STDMETHOD(Enable)(THIS_ DWORD) PURE; + STDMETHOD(GetEnable)(THIS_ DWORD *) PURE; + STDMETHOD(AddTriangles)(THIS_ DWORD dwFlags, DWORD dwFormat, + DWORD dwVertexCount, LPVOID lpvData) PURE; + STDMETHOD(SetVertices)(THIS_ DWORD dwIndexFirst, DWORD dwCount, LPD3DVECTOR) PURE; + STDMETHOD(GetVertices)(THIS_ DWORD dwIndexFirst, LPDWORD lpdwCount, LPD3DVECTOR) PURE; + STDMETHOD(SetNormals)(THIS_ DWORD dwIndexFirst, DWORD dwCount, LPD3DVECTOR) PURE; + STDMETHOD(GetNormals)(THIS_ DWORD dwIndexFirst, LPDWORD lpdwCount, LPD3DVECTOR) PURE; + STDMETHOD_(int, GetNormalCount)(THIS) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMLight + +DECLARE_INTERFACE_(IDirect3DRMLight, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMLight methods + */ + STDMETHOD(SetType)(THIS_ D3DRMLIGHTTYPE) PURE; + STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE; + STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE; + STDMETHOD(SetRange)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetUmbra)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetPenumbra)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetConstantAttenuation)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetLinearAttenuation)(THIS_ D3DVALUE) PURE; + STDMETHOD(SetQuadraticAttenuation)(THIS_ D3DVALUE) PURE; + + STDMETHOD_(D3DVALUE, GetRange)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetUmbra)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetPenumbra)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetConstantAttenuation)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetLinearAttenuation)(THIS) PURE; + STDMETHOD_(D3DVALUE, GetQuadraticAttenuation)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE; + STDMETHOD_(D3DRMLIGHTTYPE, GetType)(THIS) PURE; + + STDMETHOD(SetEnableFrame)(THIS_ LPDIRECT3DRMFRAME) PURE; + STDMETHOD(GetEnableFrame)(THIS_ LPDIRECT3DRMFRAME*) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMTexture + +DECLARE_INTERFACE_(IDirect3DRMTexture, IDirect3DRMVisual) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMTexture methods + */ + STDMETHOD(InitFromFile)(THIS_ const char *filename) PURE; + STDMETHOD(InitFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS) PURE; + STDMETHOD(InitFromResource)(THIS_ HRSRC) PURE; + STDMETHOD(Changed)(THIS_ BOOL pixels, BOOL palette) PURE; + + STDMETHOD(SetColors)(THIS_ DWORD) PURE; + STDMETHOD(SetShades)(THIS_ DWORD) PURE; + STDMETHOD(SetDecalSize)(THIS_ D3DVALUE width, D3DVALUE height) PURE; + STDMETHOD(SetDecalOrigin)(THIS_ LONG x, LONG y) PURE; + STDMETHOD(SetDecalScale)(THIS_ DWORD) PURE; + STDMETHOD(SetDecalTransparency)(THIS_ BOOL) PURE; + STDMETHOD(SetDecalTransparentColor)(THIS_ D3DCOLOR) PURE; + + STDMETHOD(GetDecalSize)(THIS_ D3DVALUE *width_return, D3DVALUE *height_return) PURE; + STDMETHOD(GetDecalOrigin)(THIS_ LONG *x_return, LONG *y_return) PURE; + + STDMETHOD_(D3DRMIMAGE *, GetImage)(THIS) PURE; + STDMETHOD_(DWORD, GetShades)(THIS) PURE; + STDMETHOD_(DWORD, GetColors)(THIS) PURE; + STDMETHOD_(DWORD, GetDecalScale)(THIS) PURE; + STDMETHOD_(BOOL, GetDecalTransparency)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetDecalTransparentColor)(THIS) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMTexture2 + +DECLARE_INTERFACE_(IDirect3DRMTexture2, IDirect3DRMTexture) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMTexture methods + */ + STDMETHOD(InitFromFile)(THIS_ const char *filename) PURE; + STDMETHOD(InitFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS) PURE; + STDMETHOD(InitFromResource)(THIS_ HRSRC) PURE; + STDMETHOD(Changed)(THIS_ BOOL pixels, BOOL palette) PURE; + + STDMETHOD(SetColors)(THIS_ DWORD) PURE; + STDMETHOD(SetShades)(THIS_ DWORD) PURE; + STDMETHOD(SetDecalSize)(THIS_ D3DVALUE width, D3DVALUE height) PURE; + STDMETHOD(SetDecalOrigin)(THIS_ LONG x, LONG y) PURE; + STDMETHOD(SetDecalScale)(THIS_ DWORD) PURE; + STDMETHOD(SetDecalTransparency)(THIS_ BOOL) PURE; + STDMETHOD(SetDecalTransparentColor)(THIS_ D3DCOLOR) PURE; + + STDMETHOD(GetDecalSize)(THIS_ D3DVALUE *width_return, D3DVALUE *height_return) PURE; + STDMETHOD(GetDecalOrigin)(THIS_ LONG *x_return, LONG *y_return) PURE; + + STDMETHOD_(D3DRMIMAGE *, GetImage)(THIS) PURE; + STDMETHOD_(DWORD, GetShades)(THIS) PURE; + STDMETHOD_(DWORD, GetColors)(THIS) PURE; + STDMETHOD_(DWORD, GetDecalScale)(THIS) PURE; + STDMETHOD_(BOOL, GetDecalTransparency)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetDecalTransparentColor)(THIS) PURE; + + /* + * IDirect3DRMTexture2 methods + */ + STDMETHOD(InitFromImage)(THIS_ LPD3DRMIMAGE) PURE; + STDMETHOD(InitFromResource2)(THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType) PURE; + STDMETHOD(GenerateMIPMap)(THIS_ DWORD) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMTexture3 + +DECLARE_INTERFACE_(IDirect3DRMTexture3, IDirect3DRMVisual) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMTexture3 methods + */ + STDMETHOD(InitFromFile)(THIS_ const char *filename) PURE; + STDMETHOD(InitFromSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDS) PURE; + STDMETHOD(InitFromResource)(THIS_ HRSRC) PURE; + STDMETHOD(Changed)(THIS_ DWORD dwFlags, DWORD dwcRects, LPRECT pRects) PURE; + STDMETHOD(SetColors)(THIS_ DWORD) PURE; + STDMETHOD(SetShades)(THIS_ DWORD) PURE; + STDMETHOD(SetDecalSize)(THIS_ D3DVALUE width, D3DVALUE height) PURE; + STDMETHOD(SetDecalOrigin)(THIS_ LONG x, LONG y) PURE; + STDMETHOD(SetDecalScale)(THIS_ DWORD) PURE; + STDMETHOD(SetDecalTransparency)(THIS_ BOOL) PURE; + STDMETHOD(SetDecalTransparentColor)(THIS_ D3DCOLOR) PURE; + + STDMETHOD(GetDecalSize)(THIS_ D3DVALUE *width_return, D3DVALUE *height_return) PURE; + STDMETHOD(GetDecalOrigin)(THIS_ LONG *x_return, LONG *y_return) PURE; + + STDMETHOD_(D3DRMIMAGE *, GetImage)(THIS) PURE; + STDMETHOD_(DWORD, GetShades)(THIS) PURE; + STDMETHOD_(DWORD, GetColors)(THIS) PURE; + STDMETHOD_(DWORD, GetDecalScale)(THIS) PURE; + STDMETHOD_(BOOL, GetDecalTransparency)(THIS) PURE; + STDMETHOD_(D3DCOLOR, GetDecalTransparentColor)(THIS) PURE; + STDMETHOD(InitFromImage)(THIS_ LPD3DRMIMAGE) PURE; + STDMETHOD(InitFromResource2)(THIS_ HMODULE hModule, LPCTSTR strName, LPCTSTR strType) PURE; + STDMETHOD(GenerateMIPMap)(THIS_ DWORD) PURE; + STDMETHOD(GetSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE* lplpDDS) PURE; + STDMETHOD(SetCacheOptions)(THIS_ LONG lImportance, DWORD dwFlags) PURE; + STDMETHOD(GetCacheOptions)(THIS_ LPLONG lplImportance, LPDWORD lpdwFlags) PURE; + STDMETHOD(SetDownsampleCallback)(THIS_ D3DRMDOWNSAMPLECALLBACK pCallback, LPVOID pArg) PURE; + STDMETHOD(SetValidationCallback)(THIS_ D3DRMVALIDATIONCALLBACK pCallback, LPVOID pArg) PURE; +}; + + +#undef INTERFACE +#define INTERFACE IDirect3DRMWrap + +DECLARE_INTERFACE_(IDirect3DRMWrap, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMWrap methods + */ + STDMETHOD(Init) + ( THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME ref, + D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, + D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, + D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, + D3DVALUE ou, D3DVALUE ov, + D3DVALUE su, D3DVALUE sv + ) PURE; + STDMETHOD(Apply)(THIS_ LPDIRECT3DRMOBJECT) PURE; + STDMETHOD(ApplyRelative)(THIS_ LPDIRECT3DRMFRAME frame, LPDIRECT3DRMOBJECT) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMMaterial + +DECLARE_INTERFACE_(IDirect3DRMMaterial, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMMaterial methods + */ + STDMETHOD(SetPower)(THIS_ D3DVALUE power) PURE; + STDMETHOD(SetSpecular)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; + STDMETHOD(SetEmissive)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; + + STDMETHOD_(D3DVALUE, GetPower)(THIS) PURE; + STDMETHOD(GetSpecular)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; + STDMETHOD(GetEmissive)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; +}; + + +#undef INTERFACE +#define INTERFACE IDirect3DRMMaterial2 + +DECLARE_INTERFACE_(IDirect3DRMMaterial2, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMMaterial2 methods + */ + STDMETHOD(SetPower)(THIS_ D3DVALUE power) PURE; + STDMETHOD(SetSpecular)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; + STDMETHOD(SetEmissive)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; + STDMETHOD_(D3DVALUE, GetPower)(THIS) PURE; + STDMETHOD(GetSpecular)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; + STDMETHOD(GetEmissive)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; + STDMETHOD(GetAmbient)(THIS_ D3DVALUE* r, D3DVALUE* g, D3DVALUE* b) PURE; + STDMETHOD(SetAmbient)(THIS_ D3DVALUE r, D3DVALUE g, D3DVALUE b) PURE; +}; + + +#undef INTERFACE +#define INTERFACE IDirect3DRMAnimation + +DECLARE_INTERFACE_(IDirect3DRMAnimation, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMAnimation methods + */ + STDMETHOD(SetOptions)(THIS_ D3DRMANIMATIONOPTIONS flags) PURE; + STDMETHOD(AddRotateKey)(THIS_ D3DVALUE time, D3DRMQUATERNION *q) PURE; + STDMETHOD(AddPositionKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddScaleKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(DeleteKey)(THIS_ D3DVALUE time) PURE; + STDMETHOD(SetFrame)(THIS_ LPDIRECT3DRMFRAME frame) PURE; + STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; + + STDMETHOD_(D3DRMANIMATIONOPTIONS, GetOptions)(THIS) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMAnimation2 + +DECLARE_INTERFACE_(IDirect3DRMAnimation2, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMAnimation2 methods + */ + STDMETHOD(SetOptions)(THIS_ D3DRMANIMATIONOPTIONS flags) PURE; + STDMETHOD(AddRotateKey)(THIS_ D3DVALUE time, D3DRMQUATERNION *q) PURE; + STDMETHOD(AddPositionKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(AddScaleKey)(THIS_ D3DVALUE time, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE; + STDMETHOD(DeleteKey)(THIS_ D3DVALUE time) PURE; + STDMETHOD(SetFrame)(THIS_ LPDIRECT3DRMFRAME3 frame) PURE; + STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; + + STDMETHOD_(D3DRMANIMATIONOPTIONS, GetOptions)(THIS) PURE; + STDMETHOD(GetFrame)(THIS_ LPDIRECT3DRMFRAME3 *lpD3DFrame) PURE; + STDMETHOD(DeleteKeyByID)(THIS_ DWORD dwID) PURE; + STDMETHOD(AddKey)(THIS_ LPD3DRMANIMATIONKEY lpKey) PURE; + STDMETHOD(ModifyKey)(THIS_ LPD3DRMANIMATIONKEY lpKey) PURE; + STDMETHOD(GetKeys)(THIS_ D3DVALUE dvTimeMin, + D3DVALUE dvTimeMax, LPDWORD lpdwNumKeys, + LPD3DRMANIMATIONKEY lpKey); +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMAnimationSet + +DECLARE_INTERFACE_(IDirect3DRMAnimationSet, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMAnimationSet methods + */ + STDMETHOD(AddAnimation)(THIS_ LPDIRECT3DRMANIMATION aid) PURE; + STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID lpArg, LPDIRECT3DRMFRAME parent)PURE; + STDMETHOD(DeleteAnimation)(THIS_ LPDIRECT3DRMANIMATION aid) PURE; + STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMAnimationSet2 + +DECLARE_INTERFACE_(IDirect3DRMAnimationSet2, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMAnimationSet2 methods + */ + STDMETHOD(AddAnimation)(THIS_ LPDIRECT3DRMANIMATION2 aid) PURE; + STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURE3CALLBACK, LPVOID lpArg, LPDIRECT3DRMFRAME3 parent)PURE; + STDMETHOD(DeleteAnimation)(THIS_ LPDIRECT3DRMANIMATION2 aid) PURE; + STDMETHOD(SetTime)(THIS_ D3DVALUE time) PURE; + STDMETHOD(GetAnimations)(THIS_ LPDIRECT3DRMANIMATIONARRAY *) PURE; +}; + + +#undef INTERFACE +#define INTERFACE IDirect3DRMUserVisual + +DECLARE_INTERFACE_(IDirect3DRMUserVisual, IDirect3DRMVisual) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMUserVisual methods + */ + STDMETHOD(Init)(THIS_ D3DRMUSERVISUALCALLBACK fn, void *arg) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMArray + +DECLARE_INTERFACE_(IDirect3DRMArray, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + /* No GetElement method as it would get overloaded + * in derived classes, and overloading is + * a no-no in COM + */ +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMObjectArray + +DECLARE_INTERFACE_(IDirect3DRMObjectArray, IDirect3DRMArray) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMOBJECT *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMDeviceArray + +DECLARE_INTERFACE_(IDirect3DRMDeviceArray, IDirect3DRMArray) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMDEVICE *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMFrameArray + +DECLARE_INTERFACE_(IDirect3DRMFrameArray, IDirect3DRMArray) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMFRAME *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMViewportArray + +DECLARE_INTERFACE_(IDirect3DRMViewportArray, IDirect3DRMArray) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMVIEWPORT *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMVisualArray + +DECLARE_INTERFACE_(IDirect3DRMVisualArray, IDirect3DRMArray) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMVISUAL *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMAnimationArray + +DECLARE_INTERFACE_(IDirect3DRMAnimationArray, IDirect3DRMArray) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMANIMATION2 *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMPickedArray + +DECLARE_INTERFACE_(IDirect3DRMPickedArray, IDirect3DRMArray) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetPick)(THIS_ DWORD index, LPDIRECT3DRMVISUAL *, LPDIRECT3DRMFRAMEARRAY *, LPD3DRMPICKDESC) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMLightArray + +DECLARE_INTERFACE_(IDirect3DRMLightArray, IDirect3DRMArray) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMLIGHT *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMFaceArray + +DECLARE_INTERFACE_(IDirect3DRMFaceArray, IDirect3DRMArray) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetElement)(THIS_ DWORD index, LPDIRECT3DRMFACE *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMPicked2Array + +DECLARE_INTERFACE_(IDirect3DRMPicked2Array, IDirect3DRMArray) +{ + IUNKNOWN_METHODS(PURE); + + STDMETHOD_(DWORD, GetSize)(THIS) PURE; + STDMETHOD(GetPick)(THIS_ DWORD index, LPDIRECT3DRMVISUAL *, LPDIRECT3DRMFRAMEARRAY *, LPD3DRMPICKDESC2) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMInterpolator + +DECLARE_INTERFACE_(IDirect3DRMInterpolator, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMInterpolator methods + */ + STDMETHOD(AttachObject)(THIS_ LPDIRECT3DRMOBJECT) PURE; + STDMETHOD(GetAttachedObjects)(THIS_ LPDIRECT3DRMOBJECTARRAY *) PURE; + STDMETHOD(DetachObject)(THIS_ LPDIRECT3DRMOBJECT) PURE; + STDMETHOD(SetIndex)(THIS_ D3DVALUE) PURE; + STDMETHOD_(D3DVALUE, GetIndex)(THIS) PURE; + STDMETHOD(Interpolate)(THIS_ D3DVALUE, LPDIRECT3DRMOBJECT, D3DRMINTERPOLATIONOPTIONS) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirect3DRMClippedVisual + +DECLARE_INTERFACE_(IDirect3DRMClippedVisual, IDirect3DRMVisual) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMClippedVisual methods + */ + STDMETHOD(Init) (THIS_ LPDIRECT3DRMVISUAL) PURE; + STDMETHOD(AddPlane) (THIS_ LPDIRECT3DRMFRAME3, LPD3DVECTOR, LPD3DVECTOR, DWORD, LPDWORD) PURE; + STDMETHOD(DeletePlane)(THIS_ DWORD, DWORD) PURE; + STDMETHOD(GetPlaneIDs)(THIS_ LPDWORD, LPDWORD, DWORD) PURE; + STDMETHOD(GetPlane) (THIS_ DWORD, LPDIRECT3DRMFRAME3, LPD3DVECTOR, LPD3DVECTOR, DWORD) PURE; + STDMETHOD(SetPlane) (THIS_ DWORD, LPDIRECT3DRMFRAME3, LPD3DVECTOR, LPD3DVECTOR, DWORD) PURE; +}; + +#ifdef __cplusplus +}; +#endif +#endif /* _D3DRMOBJ_H_ */ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3drmwin.h b/Src/Decoder_H264_ALL/D3D/include/d3drmwin.h new file mode 100644 index 0000000..d051ef4 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3drmwin.h @@ -0,0 +1,50 @@ +/*==========================================================================; + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: d3drm.h + * Content: Direct3DRM include file + * + ***************************************************************************/ + +#ifndef __D3DRMWIN_H__ +#define __D3DRMWIN_H__ + +#ifndef WIN32 +#define WIN32 +#endif + +#include "d3drm.h" + +#include "ddraw.h" +#include "d3d.h" + +/* + * GUIDS used by Direct3DRM Windows interface + */ +DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); + +WIN_TYPES(IDirect3DRMWinDevice, DIRECT3DRMWINDEVICE); + +#undef INTERFACE +#define INTERFACE IDirect3DRMWinDevice + +DECLARE_INTERFACE_(IDirect3DRMWinDevice, IDirect3DRMObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECT3DRMOBJECT_METHODS(PURE); + + /* + * IDirect3DRMWinDevice methods + */ + + /* Repaint the window with the last frame which was rendered. */ + STDMETHOD(HandlePaint)(THIS_ HDC hdc) PURE; + + /* Respond to a WM_ACTIVATE message. */ + STDMETHOD(HandleActivate)(THIS_ WORD wparam) PURE; +}; + + +#endif + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dtypes.h b/Src/Decoder_H264_ALL/D3D/include/d3dtypes.h new file mode 100644 index 0000000..7949041 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dtypes.h @@ -0,0 +1,2119 @@ +/*==========================================================================; + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: d3dtypes.h + * Content: Direct3D types include file + * + ***************************************************************************/ + +#ifndef _D3DTYPES_H_ +#define _D3DTYPES_H_ + +#ifndef DIRECT3D_VERSION +#define DIRECT3D_VERSION 0x0700 +#endif + +#if (DIRECT3D_VERSION >= 0x0800) +#pragma message("should not include d3dtypes.h when compiling for DX8 or newer interfaces") +#endif + +#include + +#include +#include "ddraw.h" + +#pragma warning(disable:4201) // anonymous unions warning +#if defined(_X86_) || defined(_IA64_) +#pragma pack(4) +#endif + + +/* D3DVALUE is the fundamental Direct3D fractional data type */ + +#define D3DVALP(val, prec) ((float)(val)) +#define D3DVAL(val) ((float)(val)) + +#ifndef DX_SHARED_DEFINES + +/* + * This definition is shared with other DirectX components whose header files + * might already have defined it. Therefore, we don't define this type if + * someone else already has (as indicated by the definition of + * DX_SHARED_DEFINES). We don't set DX_SHARED_DEFINES here as there are + * other types in this header that are also shared. The last of these + * shared defines in this file will set DX_SHARED_DEFINES. + */ +typedef float D3DVALUE, *LPD3DVALUE; + +#endif /* DX_SHARED_DEFINES */ + +#define D3DDivide(a, b) (float)((double) (a) / (double) (b)) +#define D3DMultiply(a, b) ((a) * (b)) + +typedef LONG D3DFIXED; + +#ifndef RGB_MAKE +/* + * Format of CI colors is + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | alpha | color index | fraction | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ +#define CI_GETALPHA(ci) ((ci) >> 24) +#define CI_GETINDEX(ci) (((ci) >> 8) & 0xffff) +#define CI_GETFRACTION(ci) ((ci) & 0xff) +#define CI_ROUNDINDEX(ci) CI_GETINDEX((ci) + 0x80) +#define CI_MASKALPHA(ci) ((ci) & 0xffffff) +#define CI_MAKE(a, i, f) (((a) << 24) | ((i) << 8) | (f)) + +/* + * Format of RGBA colors is + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | alpha | red | green | blue | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ +#define RGBA_GETALPHA(rgb) ((rgb) >> 24) +#define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff) +#define RGBA_GETGREEN(rgb) (((rgb) >> 8) & 0xff) +#define RGBA_GETBLUE(rgb) ((rgb) & 0xff) +#define RGBA_MAKE(r, g, b, a) ((D3DCOLOR) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))) + +/* D3DRGB and D3DRGBA may be used as initialisers for D3DCOLORs + * The float values must be in the range 0..1 + */ +#define D3DRGB(r, g, b) \ + (0xff000000L | ( ((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255)) +#define D3DRGBA(r, g, b, a) \ + ( (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \ + | (((long)((g) * 255)) << 8) | (long)((b) * 255) \ + ) + +/* + * Format of RGB colors is + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | ignored | red | green | blue | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ +#define RGB_GETRED(rgb) (((rgb) >> 16) & 0xff) +#define RGB_GETGREEN(rgb) (((rgb) >> 8) & 0xff) +#define RGB_GETBLUE(rgb) ((rgb) & 0xff) +#define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff)) +#define RGB_MAKE(r, g, b) ((D3DCOLOR) (((r) << 16) | ((g) << 8) | (b))) +#define RGBA_TORGB(rgba) ((D3DCOLOR) ((rgba) & 0xffffff)) +#define RGB_TORGBA(rgb) ((D3DCOLOR) ((rgb) | 0xff000000)) + +#endif + +/* + * Flags for Enumerate functions + */ + +/* + * Stop the enumeration + */ +#define D3DENUMRET_CANCEL DDENUMRET_CANCEL + +/* + * Continue the enumeration + */ +#define D3DENUMRET_OK DDENUMRET_OK + +typedef HRESULT (CALLBACK* LPD3DVALIDATECALLBACK)(LPVOID lpUserArg, DWORD dwOffset); +typedef HRESULT (CALLBACK* LPD3DENUMTEXTUREFORMATSCALLBACK)(LPDDSURFACEDESC lpDdsd, LPVOID lpContext); +typedef HRESULT (CALLBACK* LPD3DENUMPIXELFORMATSCALLBACK)(LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext); + +#ifndef DX_SHARED_DEFINES + +/* + * This definition is shared with other DirectX components whose header files + * might already have defined it. Therefore, we don't define this type if + * someone else already has (as indicated by the definition of + * DX_SHARED_DEFINES). We don't set DX_SHARED_DEFINES here as there are + * other types in this header that are also shared. The last of these + * shared defines in this file will set DX_SHARED_DEFINES. + */ +#ifndef D3DCOLOR_DEFINED +typedef DWORD D3DCOLOR; +#define D3DCOLOR_DEFINED +#endif +typedef DWORD *LPD3DCOLOR; + +#endif /* DX_SHARED_DEFINES */ + +typedef DWORD D3DMATERIALHANDLE, *LPD3DMATERIALHANDLE; +typedef DWORD D3DTEXTUREHANDLE, *LPD3DTEXTUREHANDLE; +typedef DWORD D3DMATRIXHANDLE, *LPD3DMATRIXHANDLE; + +#ifndef D3DCOLORVALUE_DEFINED +typedef struct _D3DCOLORVALUE { + union { + D3DVALUE r; + D3DVALUE dvR; + }; + union { + D3DVALUE g; + D3DVALUE dvG; + }; + union { + D3DVALUE b; + D3DVALUE dvB; + }; + union { + D3DVALUE a; + D3DVALUE dvA; + }; +} D3DCOLORVALUE; +#define D3DCOLORVALUE_DEFINED +#endif +typedef struct _D3DCOLORVALUE *LPD3DCOLORVALUE; + +#ifndef D3DRECT_DEFINED +typedef struct _D3DRECT { + union { + LONG x1; + LONG lX1; + }; + union { + LONG y1; + LONG lY1; + }; + union { + LONG x2; + LONG lX2; + }; + union { + LONG y2; + LONG lY2; + }; +} D3DRECT; +#define D3DRECT_DEFINED +#endif +typedef struct _D3DRECT *LPD3DRECT; + +#ifndef DX_SHARED_DEFINES + +/* + * This definition is shared with other DirectX components whose header files + * might already have defined it. Therefore, we don't define this type if + * someone else already has (as indicated by the definition of + * DX_SHARED_DEFINES). + */ + +#ifndef D3DVECTOR_DEFINED +typedef struct _D3DVECTOR { + union { + D3DVALUE x; + D3DVALUE dvX; + }; + union { + D3DVALUE y; + D3DVALUE dvY; + }; + union { + D3DVALUE z; + D3DVALUE dvZ; + }; +#if(DIRECT3D_VERSION >= 0x0500) +#if (defined __cplusplus) && (defined D3D_OVERLOADS) + +public: + + // ===================================== + // Constructors + // ===================================== + + _D3DVECTOR() { } + _D3DVECTOR(D3DVALUE f); + _D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z); + _D3DVECTOR(const D3DVALUE f[3]); + + // ===================================== + // Access grants + // ===================================== + + const D3DVALUE&operator[](int i) const; + D3DVALUE&operator[](int i); + + // ===================================== + // Assignment operators + // ===================================== + + _D3DVECTOR& operator += (const _D3DVECTOR& v); + _D3DVECTOR& operator -= (const _D3DVECTOR& v); + _D3DVECTOR& operator *= (const _D3DVECTOR& v); + _D3DVECTOR& operator /= (const _D3DVECTOR& v); + _D3DVECTOR& operator *= (D3DVALUE s); + _D3DVECTOR& operator /= (D3DVALUE s); + + // ===================================== + // Unary operators + // ===================================== + + friend _D3DVECTOR operator + (const _D3DVECTOR& v); + friend _D3DVECTOR operator - (const _D3DVECTOR& v); + + + // ===================================== + // Binary operators + // ===================================== + + // Addition and subtraction + friend _D3DVECTOR operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2); + friend _D3DVECTOR operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2); + // Scalar multiplication and division + friend _D3DVECTOR operator * (const _D3DVECTOR& v, D3DVALUE s); + friend _D3DVECTOR operator * (D3DVALUE s, const _D3DVECTOR& v); + friend _D3DVECTOR operator / (const _D3DVECTOR& v, D3DVALUE s); + // Memberwise multiplication and division + friend _D3DVECTOR operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2); + friend _D3DVECTOR operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2); + + // Vector dominance + friend int operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2); + friend int operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2); + + // Bitwise equality + friend int operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2); + + // Length-related functions + friend D3DVALUE SquareMagnitude (const _D3DVECTOR& v); + friend D3DVALUE Magnitude (const _D3DVECTOR& v); + + // Returns vector with same direction and unit length + friend _D3DVECTOR Normalize (const _D3DVECTOR& v); + + // Return min/max component of the input vector + friend D3DVALUE Min (const _D3DVECTOR& v); + friend D3DVALUE Max (const _D3DVECTOR& v); + + // Return memberwise min/max of input vectors + friend _D3DVECTOR Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2); + friend _D3DVECTOR Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2); + + // Dot and cross product + friend D3DVALUE DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2); + friend _D3DVECTOR CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2); + +#endif +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DVECTOR; +#define D3DVECTOR_DEFINED +#endif +typedef struct _D3DVECTOR *LPD3DVECTOR; + +/* + * As this is the last of the shared defines to be defined we now set + * D3D_SHARED_DEFINES to flag that fact that this header has defined these + * types. + */ +#define DX_SHARED_DEFINES + +#endif /* DX_SHARED_DEFINES */ + +/* + * Vertex data types supported in an ExecuteBuffer. + */ + +/* + * Homogeneous vertices + */ + +typedef struct _D3DHVERTEX { + DWORD dwFlags; /* Homogeneous clipping flags */ + union { + D3DVALUE hx; + D3DVALUE dvHX; + }; + union { + D3DVALUE hy; + D3DVALUE dvHY; + }; + union { + D3DVALUE hz; + D3DVALUE dvHZ; + }; +} D3DHVERTEX, *LPD3DHVERTEX; + +/* + * Transformed/lit vertices + */ +typedef struct _D3DTLVERTEX { + union { + D3DVALUE sx; /* Screen coordinates */ + D3DVALUE dvSX; + }; + union { + D3DVALUE sy; + D3DVALUE dvSY; + }; + union { + D3DVALUE sz; + D3DVALUE dvSZ; + }; + union { + D3DVALUE rhw; /* Reciprocal of homogeneous w */ + D3DVALUE dvRHW; + }; + union { + D3DCOLOR color; /* Vertex color */ + D3DCOLOR dcColor; + }; + union { + D3DCOLOR specular; /* Specular component of vertex */ + D3DCOLOR dcSpecular; + }; + union { + D3DVALUE tu; /* Texture coordinates */ + D3DVALUE dvTU; + }; + union { + D3DVALUE tv; + D3DVALUE dvTV; + }; +#if(DIRECT3D_VERSION >= 0x0500) +#if (defined __cplusplus) && (defined D3D_OVERLOADS) + _D3DTLVERTEX() { } + _D3DTLVERTEX(const D3DVECTOR& v, float _rhw, + D3DCOLOR _color, D3DCOLOR _specular, + float _tu, float _tv) + { sx = v.x; sy = v.y; sz = v.z; rhw = _rhw; + color = _color; specular = _specular; + tu = _tu; tv = _tv; + } +#endif +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DTLVERTEX, *LPD3DTLVERTEX; + +/* + * Untransformed/lit vertices + */ +typedef struct _D3DLVERTEX { + union { + D3DVALUE x; /* Homogeneous coordinates */ + D3DVALUE dvX; + }; + union { + D3DVALUE y; + D3DVALUE dvY; + }; + union { + D3DVALUE z; + D3DVALUE dvZ; + }; + DWORD dwReserved; + union { + D3DCOLOR color; /* Vertex color */ + D3DCOLOR dcColor; + }; + union { + D3DCOLOR specular; /* Specular component of vertex */ + D3DCOLOR dcSpecular; + }; + union { + D3DVALUE tu; /* Texture coordinates */ + D3DVALUE dvTU; + }; + union { + D3DVALUE tv; + D3DVALUE dvTV; + }; +#if(DIRECT3D_VERSION >= 0x0500) +#if (defined __cplusplus) && (defined D3D_OVERLOADS) + _D3DLVERTEX() { } + _D3DLVERTEX(const D3DVECTOR& v, + D3DCOLOR _color, D3DCOLOR _specular, + float _tu, float _tv) + { x = v.x; y = v.y; z = v.z; dwReserved = 0; + color = _color; specular = _specular; + tu = _tu; tv = _tv; + } +#endif +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DLVERTEX, *LPD3DLVERTEX; + +/* + * Untransformed/unlit vertices + */ + +typedef struct _D3DVERTEX { + union { + D3DVALUE x; /* Homogeneous coordinates */ + D3DVALUE dvX; + }; + union { + D3DVALUE y; + D3DVALUE dvY; + }; + union { + D3DVALUE z; + D3DVALUE dvZ; + }; + union { + D3DVALUE nx; /* Normal */ + D3DVALUE dvNX; + }; + union { + D3DVALUE ny; + D3DVALUE dvNY; + }; + union { + D3DVALUE nz; + D3DVALUE dvNZ; + }; + union { + D3DVALUE tu; /* Texture coordinates */ + D3DVALUE dvTU; + }; + union { + D3DVALUE tv; + D3DVALUE dvTV; + }; +#if(DIRECT3D_VERSION >= 0x0500) +#if (defined __cplusplus) && (defined D3D_OVERLOADS) + _D3DVERTEX() { } + _D3DVERTEX(const D3DVECTOR& v, const D3DVECTOR& n, float _tu, float _tv) + { x = v.x; y = v.y; z = v.z; + nx = n.x; ny = n.y; nz = n.z; + tu = _tu; tv = _tv; + } +#endif +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DVERTEX, *LPD3DVERTEX; + + +/* + * Matrix, viewport, and tranformation structures and definitions. + */ + +#ifndef D3DMATRIX_DEFINED +typedef struct _D3DMATRIX { +#if(DIRECT3D_VERSION >= 0x0500) +#if (defined __cplusplus) && (defined D3D_OVERLOADS) + union { + struct { +#endif + +#endif /* DIRECT3D_VERSION >= 0x0500 */ + D3DVALUE _11, _12, _13, _14; + D3DVALUE _21, _22, _23, _24; + D3DVALUE _31, _32, _33, _34; + D3DVALUE _41, _42, _43, _44; + +#if(DIRECT3D_VERSION >= 0x0500) +#if (defined __cplusplus) && (defined D3D_OVERLOADS) + }; + D3DVALUE m[4][4]; + }; + _D3DMATRIX() { } + _D3DMATRIX( D3DVALUE _m00, D3DVALUE _m01, D3DVALUE _m02, D3DVALUE _m03, + D3DVALUE _m10, D3DVALUE _m11, D3DVALUE _m12, D3DVALUE _m13, + D3DVALUE _m20, D3DVALUE _m21, D3DVALUE _m22, D3DVALUE _m23, + D3DVALUE _m30, D3DVALUE _m31, D3DVALUE _m32, D3DVALUE _m33 + ) + { + m[0][0] = _m00; m[0][1] = _m01; m[0][2] = _m02; m[0][3] = _m03; + m[1][0] = _m10; m[1][1] = _m11; m[1][2] = _m12; m[1][3] = _m13; + m[2][0] = _m20; m[2][1] = _m21; m[2][2] = _m22; m[2][3] = _m23; + m[3][0] = _m30; m[3][1] = _m31; m[3][2] = _m32; m[3][3] = _m33; + } + + D3DVALUE& operator()(int iRow, int iColumn) { return m[iRow][iColumn]; } + const D3DVALUE& operator()(int iRow, int iColumn) const { return m[iRow][iColumn]; } +#if(DIRECT3D_VERSION >= 0x0600) + friend _D3DMATRIX operator* (const _D3DMATRIX&, const _D3DMATRIX&); +#endif /* DIRECT3D_VERSION >= 0x0600 */ +#endif +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DMATRIX; +#define D3DMATRIX_DEFINED +#endif +typedef struct _D3DMATRIX *LPD3DMATRIX; + +#if (defined __cplusplus) && (defined D3D_OVERLOADS) +#include "d3dvec.inl" +#endif + +typedef struct _D3DVIEWPORT { + DWORD dwSize; + DWORD dwX; + DWORD dwY; /* Top left */ + DWORD dwWidth; + DWORD dwHeight; /* Dimensions */ + D3DVALUE dvScaleX; /* Scale homogeneous to screen */ + D3DVALUE dvScaleY; /* Scale homogeneous to screen */ + D3DVALUE dvMaxX; /* Min/max homogeneous x coord */ + D3DVALUE dvMaxY; /* Min/max homogeneous y coord */ + D3DVALUE dvMinZ; + D3DVALUE dvMaxZ; /* Min/max homogeneous z coord */ +} D3DVIEWPORT, *LPD3DVIEWPORT; + +#if(DIRECT3D_VERSION >= 0x0500) +typedef struct _D3DVIEWPORT2 { + DWORD dwSize; + DWORD dwX; + DWORD dwY; /* Viewport Top left */ + DWORD dwWidth; + DWORD dwHeight; /* Viewport Dimensions */ + D3DVALUE dvClipX; /* Top left of clip volume */ + D3DVALUE dvClipY; + D3DVALUE dvClipWidth; /* Clip Volume Dimensions */ + D3DVALUE dvClipHeight; + D3DVALUE dvMinZ; /* Min/max of clip Volume */ + D3DVALUE dvMaxZ; +} D3DVIEWPORT2, *LPD3DVIEWPORT2; +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if(DIRECT3D_VERSION >= 0x0700) +typedef struct _D3DVIEWPORT7 { + DWORD dwX; + DWORD dwY; /* Viewport Top left */ + DWORD dwWidth; + DWORD dwHeight; /* Viewport Dimensions */ + D3DVALUE dvMinZ; /* Min/max of clip Volume */ + D3DVALUE dvMaxZ; +} D3DVIEWPORT7, *LPD3DVIEWPORT7; +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +/* + * Values for clip fields. + */ + +#if(DIRECT3D_VERSION >= 0x0700) + +// Max number of user clipping planes, supported in D3D. +#define D3DMAXUSERCLIPPLANES 32 + +// These bits could be ORed together to use with D3DRENDERSTATE_CLIPPLANEENABLE +// +#define D3DCLIPPLANE0 (1 << 0) +#define D3DCLIPPLANE1 (1 << 1) +#define D3DCLIPPLANE2 (1 << 2) +#define D3DCLIPPLANE3 (1 << 3) +#define D3DCLIPPLANE4 (1 << 4) +#define D3DCLIPPLANE5 (1 << 5) + +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +#define D3DCLIP_LEFT 0x00000001L +#define D3DCLIP_RIGHT 0x00000002L +#define D3DCLIP_TOP 0x00000004L +#define D3DCLIP_BOTTOM 0x00000008L +#define D3DCLIP_FRONT 0x00000010L +#define D3DCLIP_BACK 0x00000020L +#define D3DCLIP_GEN0 0x00000040L +#define D3DCLIP_GEN1 0x00000080L +#define D3DCLIP_GEN2 0x00000100L +#define D3DCLIP_GEN3 0x00000200L +#define D3DCLIP_GEN4 0x00000400L +#define D3DCLIP_GEN5 0x00000800L + +/* + * Values for d3d status. + */ +#define D3DSTATUS_CLIPUNIONLEFT D3DCLIP_LEFT +#define D3DSTATUS_CLIPUNIONRIGHT D3DCLIP_RIGHT +#define D3DSTATUS_CLIPUNIONTOP D3DCLIP_TOP +#define D3DSTATUS_CLIPUNIONBOTTOM D3DCLIP_BOTTOM +#define D3DSTATUS_CLIPUNIONFRONT D3DCLIP_FRONT +#define D3DSTATUS_CLIPUNIONBACK D3DCLIP_BACK +#define D3DSTATUS_CLIPUNIONGEN0 D3DCLIP_GEN0 +#define D3DSTATUS_CLIPUNIONGEN1 D3DCLIP_GEN1 +#define D3DSTATUS_CLIPUNIONGEN2 D3DCLIP_GEN2 +#define D3DSTATUS_CLIPUNIONGEN3 D3DCLIP_GEN3 +#define D3DSTATUS_CLIPUNIONGEN4 D3DCLIP_GEN4 +#define D3DSTATUS_CLIPUNIONGEN5 D3DCLIP_GEN5 + +#define D3DSTATUS_CLIPINTERSECTIONLEFT 0x00001000L +#define D3DSTATUS_CLIPINTERSECTIONRIGHT 0x00002000L +#define D3DSTATUS_CLIPINTERSECTIONTOP 0x00004000L +#define D3DSTATUS_CLIPINTERSECTIONBOTTOM 0x00008000L +#define D3DSTATUS_CLIPINTERSECTIONFRONT 0x00010000L +#define D3DSTATUS_CLIPINTERSECTIONBACK 0x00020000L +#define D3DSTATUS_CLIPINTERSECTIONGEN0 0x00040000L +#define D3DSTATUS_CLIPINTERSECTIONGEN1 0x00080000L +#define D3DSTATUS_CLIPINTERSECTIONGEN2 0x00100000L +#define D3DSTATUS_CLIPINTERSECTIONGEN3 0x00200000L +#define D3DSTATUS_CLIPINTERSECTIONGEN4 0x00400000L +#define D3DSTATUS_CLIPINTERSECTIONGEN5 0x00800000L +#define D3DSTATUS_ZNOTVISIBLE 0x01000000L +/* Do not use 0x80000000 for any status flags in future as it is reserved */ + +#define D3DSTATUS_CLIPUNIONALL ( \ + D3DSTATUS_CLIPUNIONLEFT | \ + D3DSTATUS_CLIPUNIONRIGHT | \ + D3DSTATUS_CLIPUNIONTOP | \ + D3DSTATUS_CLIPUNIONBOTTOM | \ + D3DSTATUS_CLIPUNIONFRONT | \ + D3DSTATUS_CLIPUNIONBACK | \ + D3DSTATUS_CLIPUNIONGEN0 | \ + D3DSTATUS_CLIPUNIONGEN1 | \ + D3DSTATUS_CLIPUNIONGEN2 | \ + D3DSTATUS_CLIPUNIONGEN3 | \ + D3DSTATUS_CLIPUNIONGEN4 | \ + D3DSTATUS_CLIPUNIONGEN5 \ + ) + +#define D3DSTATUS_CLIPINTERSECTIONALL ( \ + D3DSTATUS_CLIPINTERSECTIONLEFT | \ + D3DSTATUS_CLIPINTERSECTIONRIGHT | \ + D3DSTATUS_CLIPINTERSECTIONTOP | \ + D3DSTATUS_CLIPINTERSECTIONBOTTOM | \ + D3DSTATUS_CLIPINTERSECTIONFRONT | \ + D3DSTATUS_CLIPINTERSECTIONBACK | \ + D3DSTATUS_CLIPINTERSECTIONGEN0 | \ + D3DSTATUS_CLIPINTERSECTIONGEN1 | \ + D3DSTATUS_CLIPINTERSECTIONGEN2 | \ + D3DSTATUS_CLIPINTERSECTIONGEN3 | \ + D3DSTATUS_CLIPINTERSECTIONGEN4 | \ + D3DSTATUS_CLIPINTERSECTIONGEN5 \ + ) + +#define D3DSTATUS_DEFAULT ( \ + D3DSTATUS_CLIPINTERSECTIONALL | \ + D3DSTATUS_ZNOTVISIBLE) + + +/* + * Options for direct transform calls + */ +#define D3DTRANSFORM_CLIPPED 0x00000001l +#define D3DTRANSFORM_UNCLIPPED 0x00000002l + +typedef struct _D3DTRANSFORMDATA { + DWORD dwSize; + LPVOID lpIn; /* Input vertices */ + DWORD dwInSize; /* Stride of input vertices */ + LPVOID lpOut; /* Output vertices */ + DWORD dwOutSize; /* Stride of output vertices */ + LPD3DHVERTEX lpHOut; /* Output homogeneous vertices */ + DWORD dwClip; /* Clipping hint */ + DWORD dwClipIntersection; + DWORD dwClipUnion; /* Union of all clip flags */ + D3DRECT drExtent; /* Extent of transformed vertices */ +} D3DTRANSFORMDATA, *LPD3DTRANSFORMDATA; + +/* + * Structure defining position and direction properties for lighting. + */ +typedef struct _D3DLIGHTINGELEMENT { + D3DVECTOR dvPosition; /* Lightable point in model space */ + D3DVECTOR dvNormal; /* Normalised unit vector */ +} D3DLIGHTINGELEMENT, *LPD3DLIGHTINGELEMENT; + +/* + * Structure defining material properties for lighting. + */ +typedef struct _D3DMATERIAL { + DWORD dwSize; + union { + D3DCOLORVALUE diffuse; /* Diffuse color RGBA */ + D3DCOLORVALUE dcvDiffuse; + }; + union { + D3DCOLORVALUE ambient; /* Ambient color RGB */ + D3DCOLORVALUE dcvAmbient; + }; + union { + D3DCOLORVALUE specular; /* Specular 'shininess' */ + D3DCOLORVALUE dcvSpecular; + }; + union { + D3DCOLORVALUE emissive; /* Emissive color RGB */ + D3DCOLORVALUE dcvEmissive; + }; + union { + D3DVALUE power; /* Sharpness if specular highlight */ + D3DVALUE dvPower; + }; + D3DTEXTUREHANDLE hTexture; /* Handle to texture map */ + DWORD dwRampSize; +} D3DMATERIAL, *LPD3DMATERIAL; + +#if(DIRECT3D_VERSION >= 0x0700) + +typedef struct _D3DMATERIAL7 { + union { + D3DCOLORVALUE diffuse; /* Diffuse color RGBA */ + D3DCOLORVALUE dcvDiffuse; + }; + union { + D3DCOLORVALUE ambient; /* Ambient color RGB */ + D3DCOLORVALUE dcvAmbient; + }; + union { + D3DCOLORVALUE specular; /* Specular 'shininess' */ + D3DCOLORVALUE dcvSpecular; + }; + union { + D3DCOLORVALUE emissive; /* Emissive color RGB */ + D3DCOLORVALUE dcvEmissive; + }; + union { + D3DVALUE power; /* Sharpness if specular highlight */ + D3DVALUE dvPower; + }; +} D3DMATERIAL7, *LPD3DMATERIAL7; + +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +#if(DIRECT3D_VERSION < 0x0800) + +typedef enum _D3DLIGHTTYPE { + D3DLIGHT_POINT = 1, + D3DLIGHT_SPOT = 2, + D3DLIGHT_DIRECTIONAL = 3, +// Note: The following light type (D3DLIGHT_PARALLELPOINT) +// is no longer supported from D3D for DX7 onwards. + D3DLIGHT_PARALLELPOINT = 4, +#if(DIRECT3D_VERSION < 0x0500) // For backward compatible headers + D3DLIGHT_GLSPOT = 5, +#endif + D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DLIGHTTYPE; + +#else +typedef enum _D3DLIGHTTYPE D3DLIGHTTYPE; +#define D3DLIGHT_PARALLELPOINT (D3DLIGHTTYPE)4 +#define D3DLIGHT_GLSPOT (D3DLIGHTTYPE)5 + +#endif //(DIRECT3D_VERSION < 0x0800) + +/* + * Structure defining a light source and its properties. + */ +typedef struct _D3DLIGHT { + DWORD dwSize; + D3DLIGHTTYPE dltType; /* Type of light source */ + D3DCOLORVALUE dcvColor; /* Color of light */ + D3DVECTOR dvPosition; /* Position in world space */ + D3DVECTOR dvDirection; /* Direction in world space */ + D3DVALUE dvRange; /* Cutoff range */ + D3DVALUE dvFalloff; /* Falloff */ + D3DVALUE dvAttenuation0; /* Constant attenuation */ + D3DVALUE dvAttenuation1; /* Linear attenuation */ + D3DVALUE dvAttenuation2; /* Quadratic attenuation */ + D3DVALUE dvTheta; /* Inner angle of spotlight cone */ + D3DVALUE dvPhi; /* Outer angle of spotlight cone */ +} D3DLIGHT, *LPD3DLIGHT; + +#if(DIRECT3D_VERSION >= 0x0700) + +typedef struct _D3DLIGHT7 { + D3DLIGHTTYPE dltType; /* Type of light source */ + D3DCOLORVALUE dcvDiffuse; /* Diffuse color of light */ + D3DCOLORVALUE dcvSpecular; /* Specular color of light */ + D3DCOLORVALUE dcvAmbient; /* Ambient color of light */ + D3DVECTOR dvPosition; /* Position in world space */ + D3DVECTOR dvDirection; /* Direction in world space */ + D3DVALUE dvRange; /* Cutoff range */ + D3DVALUE dvFalloff; /* Falloff */ + D3DVALUE dvAttenuation0; /* Constant attenuation */ + D3DVALUE dvAttenuation1; /* Linear attenuation */ + D3DVALUE dvAttenuation2; /* Quadratic attenuation */ + D3DVALUE dvTheta; /* Inner angle of spotlight cone */ + D3DVALUE dvPhi; /* Outer angle of spotlight cone */ +} D3DLIGHT7, *LPD3DLIGHT7; + +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +#if(DIRECT3D_VERSION >= 0x0500) +/* + * Structure defining a light source and its properties. + */ + +/* flags bits */ +#define D3DLIGHT_ACTIVE 0x00000001 +#define D3DLIGHT_NO_SPECULAR 0x00000002 +#define D3DLIGHT_ALL (D3DLIGHT_ACTIVE | D3DLIGHT_NO_SPECULAR) + +/* maximum valid light range */ +#define D3DLIGHT_RANGE_MAX ((float)sqrt(FLT_MAX)) + +typedef struct _D3DLIGHT2 { + DWORD dwSize; + D3DLIGHTTYPE dltType; /* Type of light source */ + D3DCOLORVALUE dcvColor; /* Color of light */ + D3DVECTOR dvPosition; /* Position in world space */ + D3DVECTOR dvDirection; /* Direction in world space */ + D3DVALUE dvRange; /* Cutoff range */ + D3DVALUE dvFalloff; /* Falloff */ + D3DVALUE dvAttenuation0; /* Constant attenuation */ + D3DVALUE dvAttenuation1; /* Linear attenuation */ + D3DVALUE dvAttenuation2; /* Quadratic attenuation */ + D3DVALUE dvTheta; /* Inner angle of spotlight cone */ + D3DVALUE dvPhi; /* Outer angle of spotlight cone */ + DWORD dwFlags; +} D3DLIGHT2, *LPD3DLIGHT2; + +#endif /* DIRECT3D_VERSION >= 0x0500 */ +typedef struct _D3DLIGHTDATA { + DWORD dwSize; + LPD3DLIGHTINGELEMENT lpIn; /* Input positions and normals */ + DWORD dwInSize; /* Stride of input elements */ + LPD3DTLVERTEX lpOut; /* Output colors */ + DWORD dwOutSize; /* Stride of output colors */ +} D3DLIGHTDATA, *LPD3DLIGHTDATA; + +#if(DIRECT3D_VERSION >= 0x0500) +/* + * Before DX5, these values were in an enum called + * D3DCOLORMODEL. This was not correct, since they are + * bit flags. A driver can surface either or both flags + * in the dcmColorModel member of D3DDEVICEDESC. + */ +#define D3DCOLOR_MONO 1 +#define D3DCOLOR_RGB 2 + +typedef DWORD D3DCOLORMODEL; +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +/* + * Options for clearing + */ +#define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */ +#define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */ +#if(DIRECT3D_VERSION >= 0x0600) +#define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */ +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +/* + * Execute buffers are allocated via Direct3D. These buffers may then + * be filled by the application with instructions to execute along with + * vertex data. + */ + +/* + * Supported op codes for execute instructions. + */ +typedef enum _D3DOPCODE { + D3DOP_POINT = 1, + D3DOP_LINE = 2, + D3DOP_TRIANGLE = 3, + D3DOP_MATRIXLOAD = 4, + D3DOP_MATRIXMULTIPLY = 5, + D3DOP_STATETRANSFORM = 6, + D3DOP_STATELIGHT = 7, + D3DOP_STATERENDER = 8, + D3DOP_PROCESSVERTICES = 9, + D3DOP_TEXTURELOAD = 10, + D3DOP_EXIT = 11, + D3DOP_BRANCHFORWARD = 12, + D3DOP_SPAN = 13, + D3DOP_SETSTATUS = 14, +#if(DIRECT3D_VERSION >= 0x0500) + D3DOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DOPCODE; + +typedef struct _D3DINSTRUCTION { + BYTE bOpcode; /* Instruction opcode */ + BYTE bSize; /* Size of each instruction data unit */ + WORD wCount; /* Count of instruction data units to follow */ +} D3DINSTRUCTION, *LPD3DINSTRUCTION; + +/* + * Structure for texture loads + */ +typedef struct _D3DTEXTURELOAD { + D3DTEXTUREHANDLE hDestTexture; + D3DTEXTUREHANDLE hSrcTexture; +} D3DTEXTURELOAD, *LPD3DTEXTURELOAD; + +/* + * Structure for picking + */ +typedef struct _D3DPICKRECORD { + BYTE bOpcode; + BYTE bPad; + DWORD dwOffset; + D3DVALUE dvZ; +} D3DPICKRECORD, *LPD3DPICKRECORD; + +/* + * The following defines the rendering states which can be set in the + * execute buffer. + */ + +#if(DIRECT3D_VERSION < 0x0800) + +typedef enum _D3DSHADEMODE { + D3DSHADE_FLAT = 1, + D3DSHADE_GOURAUD = 2, + D3DSHADE_PHONG = 3, +#if(DIRECT3D_VERSION >= 0x0500) + D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DSHADEMODE; + +typedef enum _D3DFILLMODE { + D3DFILL_POINT = 1, + D3DFILL_WIREFRAME = 2, + D3DFILL_SOLID = 3, +#if(DIRECT3D_VERSION >= 0x0500) + D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DFILLMODE; + +typedef struct _D3DLINEPATTERN { + WORD wRepeatFactor; + WORD wLinePattern; +} D3DLINEPATTERN; + +#endif //(DIRECT3D_VERSION < 0x0800) + +typedef enum _D3DTEXTUREFILTER { + D3DFILTER_NEAREST = 1, + D3DFILTER_LINEAR = 2, + D3DFILTER_MIPNEAREST = 3, + D3DFILTER_MIPLINEAR = 4, + D3DFILTER_LINEARMIPNEAREST = 5, + D3DFILTER_LINEARMIPLINEAR = 6, +#if(DIRECT3D_VERSION >= 0x0500) + D3DFILTER_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DTEXTUREFILTER; + +#if(DIRECT3D_VERSION < 0x0800) + +typedef enum _D3DBLEND { + D3DBLEND_ZERO = 1, + D3DBLEND_ONE = 2, + D3DBLEND_SRCCOLOR = 3, + D3DBLEND_INVSRCCOLOR = 4, + D3DBLEND_SRCALPHA = 5, + D3DBLEND_INVSRCALPHA = 6, + D3DBLEND_DESTALPHA = 7, + D3DBLEND_INVDESTALPHA = 8, + D3DBLEND_DESTCOLOR = 9, + D3DBLEND_INVDESTCOLOR = 10, + D3DBLEND_SRCALPHASAT = 11, + D3DBLEND_BOTHSRCALPHA = 12, + D3DBLEND_BOTHINVSRCALPHA = 13, +#if(DIRECT3D_VERSION >= 0x0500) + D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DBLEND; + +#endif //(DIRECT3D_VERSION < 0x0800) + +typedef enum _D3DTEXTUREBLEND { + D3DTBLEND_DECAL = 1, + D3DTBLEND_MODULATE = 2, + D3DTBLEND_DECALALPHA = 3, + D3DTBLEND_MODULATEALPHA = 4, + D3DTBLEND_DECALMASK = 5, + D3DTBLEND_MODULATEMASK = 6, + D3DTBLEND_COPY = 7, +#if(DIRECT3D_VERSION >= 0x0500) + D3DTBLEND_ADD = 8, + D3DTBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DTEXTUREBLEND; + +#if(DIRECT3D_VERSION < 0x0800) + +typedef enum _D3DTEXTUREADDRESS { + D3DTADDRESS_WRAP = 1, + D3DTADDRESS_MIRROR = 2, + D3DTADDRESS_CLAMP = 3, +#if(DIRECT3D_VERSION >= 0x0500) + D3DTADDRESS_BORDER = 4, + D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DTEXTUREADDRESS; + +typedef enum _D3DCULL { + D3DCULL_NONE = 1, + D3DCULL_CW = 2, + D3DCULL_CCW = 3, +#if(DIRECT3D_VERSION >= 0x0500) + D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DCULL; + +typedef enum _D3DCMPFUNC { + D3DCMP_NEVER = 1, + D3DCMP_LESS = 2, + D3DCMP_EQUAL = 3, + D3DCMP_LESSEQUAL = 4, + D3DCMP_GREATER = 5, + D3DCMP_NOTEQUAL = 6, + D3DCMP_GREATEREQUAL = 7, + D3DCMP_ALWAYS = 8, +#if(DIRECT3D_VERSION >= 0x0500) + D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DCMPFUNC; + +#if(DIRECT3D_VERSION >= 0x0600) +typedef enum _D3DSTENCILOP { + D3DSTENCILOP_KEEP = 1, + D3DSTENCILOP_ZERO = 2, + D3DSTENCILOP_REPLACE = 3, + D3DSTENCILOP_INCRSAT = 4, + D3DSTENCILOP_DECRSAT = 5, + D3DSTENCILOP_INVERT = 6, + D3DSTENCILOP_INCR = 7, + D3DSTENCILOP_DECR = 8, + D3DSTENCILOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DSTENCILOP; +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +typedef enum _D3DFOGMODE { + D3DFOG_NONE = 0, + D3DFOG_EXP = 1, + D3DFOG_EXP2 = 2, +#if(DIRECT3D_VERSION >= 0x0500) + D3DFOG_LINEAR = 3, + D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DFOGMODE; + +#if(DIRECT3D_VERSION >= 0x0600) +typedef enum _D3DZBUFFERTYPE { + D3DZB_FALSE = 0, + D3DZB_TRUE = 1, // Z buffering + D3DZB_USEW = 2, // W buffering + D3DZB_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DZBUFFERTYPE; +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +#endif //(DIRECT3D_VERSION < 0x0800) + +#if(DIRECT3D_VERSION >= 0x0500) +typedef enum _D3DANTIALIASMODE { + D3DANTIALIAS_NONE = 0, + D3DANTIALIAS_SORTDEPENDENT = 1, + D3DANTIALIAS_SORTINDEPENDENT = 2, + D3DANTIALIAS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DANTIALIASMODE; + +// Vertex types supported by Direct3D +typedef enum _D3DVERTEXTYPE { + D3DVT_VERTEX = 1, + D3DVT_LVERTEX = 2, + D3DVT_TLVERTEX = 3, + D3DVT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DVERTEXTYPE; + +#if(DIRECT3D_VERSION < 0x0800) + +// Primitives supported by draw-primitive API +typedef enum _D3DPRIMITIVETYPE { + D3DPT_POINTLIST = 1, + D3DPT_LINELIST = 2, + D3DPT_LINESTRIP = 3, + D3DPT_TRIANGLELIST = 4, + D3DPT_TRIANGLESTRIP = 5, + D3DPT_TRIANGLEFAN = 6, + D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DPRIMITIVETYPE; + +#endif //(DIRECT3D_VERSION < 0x0800) + +#endif /* DIRECT3D_VERSION >= 0x0500 */ +/* + * Amount to add to a state to generate the override for that state. + */ +#define D3DSTATE_OVERRIDE_BIAS 256 + +/* + * A state which sets the override flag for the specified state type. + */ +#define D3DSTATE_OVERRIDE(type) (D3DRENDERSTATETYPE)(((DWORD) (type) + D3DSTATE_OVERRIDE_BIAS)) + +#if(DIRECT3D_VERSION < 0x0800) + +typedef enum _D3DTRANSFORMSTATETYPE { + D3DTRANSFORMSTATE_WORLD = 1, + D3DTRANSFORMSTATE_VIEW = 2, + D3DTRANSFORMSTATE_PROJECTION = 3, +#if(DIRECT3D_VERSION >= 0x0700) + D3DTRANSFORMSTATE_WORLD1 = 4, // 2nd matrix to blend + D3DTRANSFORMSTATE_WORLD2 = 5, // 3rd matrix to blend + D3DTRANSFORMSTATE_WORLD3 = 6, // 4th matrix to blend + D3DTRANSFORMSTATE_TEXTURE0 = 16, + D3DTRANSFORMSTATE_TEXTURE1 = 17, + D3DTRANSFORMSTATE_TEXTURE2 = 18, + D3DTRANSFORMSTATE_TEXTURE3 = 19, + D3DTRANSFORMSTATE_TEXTURE4 = 20, + D3DTRANSFORMSTATE_TEXTURE5 = 21, + D3DTRANSFORMSTATE_TEXTURE6 = 22, + D3DTRANSFORMSTATE_TEXTURE7 = 23, +#endif /* DIRECT3D_VERSION >= 0x0700 */ +#if(DIRECT3D_VERSION >= 0x0500) + D3DTRANSFORMSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DTRANSFORMSTATETYPE; + +#else + +// +// legacy transform state names +// +typedef enum _D3DTRANSFORMSTATETYPE D3DTRANSFORMSTATETYPE; +#define D3DTRANSFORMSTATE_WORLD (D3DTRANSFORMSTATETYPE)1 +#define D3DTRANSFORMSTATE_VIEW (D3DTRANSFORMSTATETYPE)2 +#define D3DTRANSFORMSTATE_PROJECTION (D3DTRANSFORMSTATETYPE)3 +#define D3DTRANSFORMSTATE_WORLD1 (D3DTRANSFORMSTATETYPE)4 +#define D3DTRANSFORMSTATE_WORLD2 (D3DTRANSFORMSTATETYPE)5 +#define D3DTRANSFORMSTATE_WORLD3 (D3DTRANSFORMSTATETYPE)6 +#define D3DTRANSFORMSTATE_TEXTURE0 (D3DTRANSFORMSTATETYPE)16 +#define D3DTRANSFORMSTATE_TEXTURE1 (D3DTRANSFORMSTATETYPE)17 +#define D3DTRANSFORMSTATE_TEXTURE2 (D3DTRANSFORMSTATETYPE)18 +#define D3DTRANSFORMSTATE_TEXTURE3 (D3DTRANSFORMSTATETYPE)19 +#define D3DTRANSFORMSTATE_TEXTURE4 (D3DTRANSFORMSTATETYPE)20 +#define D3DTRANSFORMSTATE_TEXTURE5 (D3DTRANSFORMSTATETYPE)21 +#define D3DTRANSFORMSTATE_TEXTURE6 (D3DTRANSFORMSTATETYPE)22 +#define D3DTRANSFORMSTATE_TEXTURE7 (D3DTRANSFORMSTATETYPE)23 + +#endif //(DIRECT3D_VERSION < 0x0800) + +typedef enum _D3DLIGHTSTATETYPE { + D3DLIGHTSTATE_MATERIAL = 1, + D3DLIGHTSTATE_AMBIENT = 2, + D3DLIGHTSTATE_COLORMODEL = 3, + D3DLIGHTSTATE_FOGMODE = 4, + D3DLIGHTSTATE_FOGSTART = 5, + D3DLIGHTSTATE_FOGEND = 6, + D3DLIGHTSTATE_FOGDENSITY = 7, +#if(DIRECT3D_VERSION >= 0x0600) + D3DLIGHTSTATE_COLORVERTEX = 8, +#endif /* DIRECT3D_VERSION >= 0x0600 */ +#if(DIRECT3D_VERSION >= 0x0500) + D3DLIGHTSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DLIGHTSTATETYPE; + +#if(DIRECT3D_VERSION < 0x0800) + +typedef enum _D3DRENDERSTATETYPE { + D3DRENDERSTATE_ANTIALIAS = 2, /* D3DANTIALIASMODE */ + D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4, /* TRUE for perspective correction */ + D3DRENDERSTATE_ZENABLE = 7, /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */ + D3DRENDERSTATE_FILLMODE = 8, /* D3DFILL_MODE */ + D3DRENDERSTATE_SHADEMODE = 9, /* D3DSHADEMODE */ + D3DRENDERSTATE_LINEPATTERN = 10, /* D3DLINEPATTERN */ + D3DRENDERSTATE_ZWRITEENABLE = 14, /* TRUE to enable z writes */ + D3DRENDERSTATE_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */ + D3DRENDERSTATE_LASTPIXEL = 16, /* TRUE for last-pixel on lines */ + D3DRENDERSTATE_SRCBLEND = 19, /* D3DBLEND */ + D3DRENDERSTATE_DESTBLEND = 20, /* D3DBLEND */ + D3DRENDERSTATE_CULLMODE = 22, /* D3DCULL */ + D3DRENDERSTATE_ZFUNC = 23, /* D3DCMPFUNC */ + D3DRENDERSTATE_ALPHAREF = 24, /* D3DFIXED */ + D3DRENDERSTATE_ALPHAFUNC = 25, /* D3DCMPFUNC */ + D3DRENDERSTATE_DITHERENABLE = 26, /* TRUE to enable dithering */ +#if(DIRECT3D_VERSION >= 0x0500) + D3DRENDERSTATE_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ + D3DRENDERSTATE_FOGENABLE = 28, /* TRUE to enable fog blending */ + D3DRENDERSTATE_SPECULARENABLE = 29, /* TRUE to enable specular */ + D3DRENDERSTATE_ZVISIBLE = 30, /* TRUE to enable z checking */ + D3DRENDERSTATE_STIPPLEDALPHA = 33, /* TRUE to enable stippled alpha (RGB device only) */ + D3DRENDERSTATE_FOGCOLOR = 34, /* D3DCOLOR */ + D3DRENDERSTATE_FOGTABLEMODE = 35, /* D3DFOGMODE */ +#if(DIRECT3D_VERSION >= 0x0700) + D3DRENDERSTATE_FOGSTART = 36, /* Fog start (for both vertex and pixel fog) */ + D3DRENDERSTATE_FOGEND = 37, /* Fog end */ + D3DRENDERSTATE_FOGDENSITY = 38, /* Fog density */ +#endif /* DIRECT3D_VERSION >= 0x0700 */ +#if(DIRECT3D_VERSION >= 0x0500) + D3DRENDERSTATE_EDGEANTIALIAS = 40, /* TRUE to enable edge antialiasing */ + D3DRENDERSTATE_COLORKEYENABLE = 41, /* TRUE to enable source colorkeyed textures */ + D3DRENDERSTATE_ZBIAS = 47, /* LONG Z bias */ + D3DRENDERSTATE_RANGEFOGENABLE = 48, /* Enables range-based fog */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if(DIRECT3D_VERSION >= 0x0600) + D3DRENDERSTATE_STENCILENABLE = 52, /* BOOL enable/disable stenciling */ + D3DRENDERSTATE_STENCILFAIL = 53, /* D3DSTENCILOP to do if stencil test fails */ + D3DRENDERSTATE_STENCILZFAIL = 54, /* D3DSTENCILOP to do if stencil test passes and Z test fails */ + D3DRENDERSTATE_STENCILPASS = 55, /* D3DSTENCILOP to do if both stencil and Z tests pass */ + D3DRENDERSTATE_STENCILFUNC = 56, /* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */ + D3DRENDERSTATE_STENCILREF = 57, /* Reference value used in stencil test */ + D3DRENDERSTATE_STENCILMASK = 58, /* Mask value used in stencil test */ + D3DRENDERSTATE_STENCILWRITEMASK = 59, /* Write mask applied to values written to stencil buffer */ + D3DRENDERSTATE_TEXTUREFACTOR = 60, /* D3DCOLOR used for multi-texture blend */ +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +#if(DIRECT3D_VERSION >= 0x0600) + + /* + * 128 values [128, 255] are reserved for texture coordinate wrap flags. + * These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using + * a flags word preserves forward compatibility with texture coordinates + * that are >2D. + */ + D3DRENDERSTATE_WRAP0 = 128, /* wrap for 1st texture coord. set */ + D3DRENDERSTATE_WRAP1 = 129, /* wrap for 2nd texture coord. set */ + D3DRENDERSTATE_WRAP2 = 130, /* wrap for 3rd texture coord. set */ + D3DRENDERSTATE_WRAP3 = 131, /* wrap for 4th texture coord. set */ + D3DRENDERSTATE_WRAP4 = 132, /* wrap for 5th texture coord. set */ + D3DRENDERSTATE_WRAP5 = 133, /* wrap for 6th texture coord. set */ + D3DRENDERSTATE_WRAP6 = 134, /* wrap for 7th texture coord. set */ + D3DRENDERSTATE_WRAP7 = 135, /* wrap for 8th texture coord. set */ +#endif /* DIRECT3D_VERSION >= 0x0600 */ +#if(DIRECT3D_VERSION >= 0x0700) + D3DRENDERSTATE_CLIPPING = 136, + D3DRENDERSTATE_LIGHTING = 137, + D3DRENDERSTATE_EXTENTS = 138, + D3DRENDERSTATE_AMBIENT = 139, + D3DRENDERSTATE_FOGVERTEXMODE = 140, + D3DRENDERSTATE_COLORVERTEX = 141, + D3DRENDERSTATE_LOCALVIEWER = 142, + D3DRENDERSTATE_NORMALIZENORMALS = 143, + D3DRENDERSTATE_COLORKEYBLENDENABLE = 144, + D3DRENDERSTATE_DIFFUSEMATERIALSOURCE = 145, + D3DRENDERSTATE_SPECULARMATERIALSOURCE = 146, + D3DRENDERSTATE_AMBIENTMATERIALSOURCE = 147, + D3DRENDERSTATE_EMISSIVEMATERIALSOURCE = 148, + D3DRENDERSTATE_VERTEXBLEND = 151, + D3DRENDERSTATE_CLIPPLANEENABLE = 152, + +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +// +// retired renderstates - not supported for DX7 interfaces +// + D3DRENDERSTATE_TEXTUREHANDLE = 1, /* Texture handle for legacy interfaces (Texture,Texture2) */ + D3DRENDERSTATE_TEXTUREADDRESS = 3, /* D3DTEXTUREADDRESS */ + D3DRENDERSTATE_WRAPU = 5, /* TRUE for wrapping in u */ + D3DRENDERSTATE_WRAPV = 6, /* TRUE for wrapping in v */ + D3DRENDERSTATE_MONOENABLE = 11, /* TRUE to enable mono rasterization */ + D3DRENDERSTATE_ROP2 = 12, /* ROP2 */ + D3DRENDERSTATE_PLANEMASK = 13, /* DWORD physical plane mask */ + D3DRENDERSTATE_TEXTUREMAG = 17, /* D3DTEXTUREFILTER */ + D3DRENDERSTATE_TEXTUREMIN = 18, /* D3DTEXTUREFILTER */ + D3DRENDERSTATE_TEXTUREMAPBLEND = 21, /* D3DTEXTUREBLEND */ + D3DRENDERSTATE_SUBPIXEL = 31, /* TRUE to enable subpixel correction */ + D3DRENDERSTATE_SUBPIXELX = 32, /* TRUE to enable correction in X only */ + D3DRENDERSTATE_STIPPLEENABLE = 39, /* TRUE to enable stippling */ +#if(DIRECT3D_VERSION >= 0x0500) + D3DRENDERSTATE_BORDERCOLOR = 43, /* Border color for texturing w/border */ + D3DRENDERSTATE_TEXTUREADDRESSU = 44, /* Texture addressing mode for U coordinate */ + D3DRENDERSTATE_TEXTUREADDRESSV = 45, /* Texture addressing mode for V coordinate */ + D3DRENDERSTATE_MIPMAPLODBIAS = 46, /* D3DVALUE Mipmap LOD bias */ + D3DRENDERSTATE_ANISOTROPY = 49, /* Max. anisotropy. 1 = no anisotropy */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ + D3DRENDERSTATE_FLUSHBATCH = 50, /* Explicit flush for DP batching (DX5 Only) */ +#if(DIRECT3D_VERSION >= 0x0600) + D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT=51, /* BOOL enable sort-independent transparency */ +#endif /* DIRECT3D_VERSION >= 0x0600 */ + D3DRENDERSTATE_STIPPLEPATTERN00 = 64, /* Stipple pattern 01... */ + D3DRENDERSTATE_STIPPLEPATTERN01 = 65, + D3DRENDERSTATE_STIPPLEPATTERN02 = 66, + D3DRENDERSTATE_STIPPLEPATTERN03 = 67, + D3DRENDERSTATE_STIPPLEPATTERN04 = 68, + D3DRENDERSTATE_STIPPLEPATTERN05 = 69, + D3DRENDERSTATE_STIPPLEPATTERN06 = 70, + D3DRENDERSTATE_STIPPLEPATTERN07 = 71, + D3DRENDERSTATE_STIPPLEPATTERN08 = 72, + D3DRENDERSTATE_STIPPLEPATTERN09 = 73, + D3DRENDERSTATE_STIPPLEPATTERN10 = 74, + D3DRENDERSTATE_STIPPLEPATTERN11 = 75, + D3DRENDERSTATE_STIPPLEPATTERN12 = 76, + D3DRENDERSTATE_STIPPLEPATTERN13 = 77, + D3DRENDERSTATE_STIPPLEPATTERN14 = 78, + D3DRENDERSTATE_STIPPLEPATTERN15 = 79, + D3DRENDERSTATE_STIPPLEPATTERN16 = 80, + D3DRENDERSTATE_STIPPLEPATTERN17 = 81, + D3DRENDERSTATE_STIPPLEPATTERN18 = 82, + D3DRENDERSTATE_STIPPLEPATTERN19 = 83, + D3DRENDERSTATE_STIPPLEPATTERN20 = 84, + D3DRENDERSTATE_STIPPLEPATTERN21 = 85, + D3DRENDERSTATE_STIPPLEPATTERN22 = 86, + D3DRENDERSTATE_STIPPLEPATTERN23 = 87, + D3DRENDERSTATE_STIPPLEPATTERN24 = 88, + D3DRENDERSTATE_STIPPLEPATTERN25 = 89, + D3DRENDERSTATE_STIPPLEPATTERN26 = 90, + D3DRENDERSTATE_STIPPLEPATTERN27 = 91, + D3DRENDERSTATE_STIPPLEPATTERN28 = 92, + D3DRENDERSTATE_STIPPLEPATTERN29 = 93, + D3DRENDERSTATE_STIPPLEPATTERN30 = 94, + D3DRENDERSTATE_STIPPLEPATTERN31 = 95, + +// +// retired renderstate names - the values are still used under new naming conventions +// + D3DRENDERSTATE_FOGTABLESTART = 36, /* Fog table start */ + D3DRENDERSTATE_FOGTABLEEND = 37, /* Fog table end */ + D3DRENDERSTATE_FOGTABLEDENSITY = 38, /* Fog table density */ + +#if(DIRECT3D_VERSION >= 0x0500) + D3DRENDERSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +#endif /* DIRECT3D_VERSION >= 0x0500 */ +} D3DRENDERSTATETYPE; + +#else + +typedef enum _D3DRENDERSTATETYPE D3DRENDERSTATETYPE; + +// +// legacy renderstate names +// +#define D3DRENDERSTATE_TEXTUREPERSPECTIVE (D3DRENDERSTATETYPE)4 +#define D3DRENDERSTATE_ZENABLE (D3DRENDERSTATETYPE)7 +#define D3DRENDERSTATE_FILLMODE (D3DRENDERSTATETYPE)8 +#define D3DRENDERSTATE_SHADEMODE (D3DRENDERSTATETYPE)9 +#define D3DRENDERSTATE_LINEPATTERN (D3DRENDERSTATETYPE)10 +#define D3DRENDERSTATE_ZWRITEENABLE (D3DRENDERSTATETYPE)14 +#define D3DRENDERSTATE_ALPHATESTENABLE (D3DRENDERSTATETYPE)15 +#define D3DRENDERSTATE_LASTPIXEL (D3DRENDERSTATETYPE)16 +#define D3DRENDERSTATE_SRCBLEND (D3DRENDERSTATETYPE)19 +#define D3DRENDERSTATE_DESTBLEND (D3DRENDERSTATETYPE)20 +#define D3DRENDERSTATE_CULLMODE (D3DRENDERSTATETYPE)22 +#define D3DRENDERSTATE_ZFUNC (D3DRENDERSTATETYPE)23 +#define D3DRENDERSTATE_ALPHAREF (D3DRENDERSTATETYPE)24 +#define D3DRENDERSTATE_ALPHAFUNC (D3DRENDERSTATETYPE)25 +#define D3DRENDERSTATE_DITHERENABLE (D3DRENDERSTATETYPE)26 +#define D3DRENDERSTATE_ALPHABLENDENABLE (D3DRENDERSTATETYPE)27 +#define D3DRENDERSTATE_FOGENABLE (D3DRENDERSTATETYPE)28 +#define D3DRENDERSTATE_SPECULARENABLE (D3DRENDERSTATETYPE)29 +#define D3DRENDERSTATE_ZVISIBLE (D3DRENDERSTATETYPE)30 +#define D3DRENDERSTATE_STIPPLEDALPHA (D3DRENDERSTATETYPE)33 +#define D3DRENDERSTATE_FOGCOLOR (D3DRENDERSTATETYPE)34 +#define D3DRENDERSTATE_FOGTABLEMODE (D3DRENDERSTATETYPE)35 +#define D3DRENDERSTATE_FOGSTART (D3DRENDERSTATETYPE)36 +#define D3DRENDERSTATE_FOGEND (D3DRENDERSTATETYPE)37 +#define D3DRENDERSTATE_FOGDENSITY (D3DRENDERSTATETYPE)38 +#define D3DRENDERSTATE_EDGEANTIALIAS (D3DRENDERSTATETYPE)40 +#define D3DRENDERSTATE_ZBIAS (D3DRENDERSTATETYPE)47 +#define D3DRENDERSTATE_RANGEFOGENABLE (D3DRENDERSTATETYPE)48 +#define D3DRENDERSTATE_STENCILENABLE (D3DRENDERSTATETYPE)52 +#define D3DRENDERSTATE_STENCILFAIL (D3DRENDERSTATETYPE)53 +#define D3DRENDERSTATE_STENCILZFAIL (D3DRENDERSTATETYPE)54 +#define D3DRENDERSTATE_STENCILPASS (D3DRENDERSTATETYPE)55 +#define D3DRENDERSTATE_STENCILFUNC (D3DRENDERSTATETYPE)56 +#define D3DRENDERSTATE_STENCILREF (D3DRENDERSTATETYPE)57 +#define D3DRENDERSTATE_STENCILMASK (D3DRENDERSTATETYPE)58 +#define D3DRENDERSTATE_STENCILWRITEMASK (D3DRENDERSTATETYPE)59 +#define D3DRENDERSTATE_TEXTUREFACTOR (D3DRENDERSTATETYPE)60 +#define D3DRENDERSTATE_WRAP0 (D3DRENDERSTATETYPE)128 +#define D3DRENDERSTATE_WRAP1 (D3DRENDERSTATETYPE)129 +#define D3DRENDERSTATE_WRAP2 (D3DRENDERSTATETYPE)130 +#define D3DRENDERSTATE_WRAP3 (D3DRENDERSTATETYPE)131 +#define D3DRENDERSTATE_WRAP4 (D3DRENDERSTATETYPE)132 +#define D3DRENDERSTATE_WRAP5 (D3DRENDERSTATETYPE)133 +#define D3DRENDERSTATE_WRAP6 (D3DRENDERSTATETYPE)134 +#define D3DRENDERSTATE_WRAP7 (D3DRENDERSTATETYPE)135 + +#define D3DRENDERSTATE_CLIPPING (D3DRENDERSTATETYPE)136 +#define D3DRENDERSTATE_LIGHTING (D3DRENDERSTATETYPE)137 +#define D3DRENDERSTATE_EXTENTS (D3DRENDERSTATETYPE)138 +#define D3DRENDERSTATE_AMBIENT (D3DRENDERSTATETYPE)139 +#define D3DRENDERSTATE_FOGVERTEXMODE (D3DRENDERSTATETYPE)140 +#define D3DRENDERSTATE_COLORVERTEX (D3DRENDERSTATETYPE)141 +#define D3DRENDERSTATE_LOCALVIEWER (D3DRENDERSTATETYPE)142 +#define D3DRENDERSTATE_NORMALIZENORMALS (D3DRENDERSTATETYPE)143 +#define D3DRENDERSTATE_COLORKEYBLENDENABLE (D3DRENDERSTATETYPE)144 +#define D3DRENDERSTATE_DIFFUSEMATERIALSOURCE (D3DRENDERSTATETYPE)145 +#define D3DRENDERSTATE_SPECULARMATERIALSOURCE (D3DRENDERSTATETYPE)146 +#define D3DRENDERSTATE_AMBIENTMATERIALSOURCE (D3DRENDERSTATETYPE)147 +#define D3DRENDERSTATE_EMISSIVEMATERIALSOURCE (D3DRENDERSTATETYPE)148 +#define D3DRENDERSTATE_VERTEXBLEND (D3DRENDERSTATETYPE)151 +#define D3DRENDERSTATE_CLIPPLANEENABLE (D3DRENDERSTATETYPE)152 + +// +// retired renderstates - not supported for DX7 interfaces +// +#define D3DRENDERSTATE_TEXTUREHANDLE (D3DRENDERSTATETYPE)1 +#define D3DRENDERSTATE_ANTIALIAS (D3DRENDERSTATETYPE)2 +#define D3DRENDERSTATE_TEXTUREADDRESS (D3DRENDERSTATETYPE)3 +#define D3DRENDERSTATE_WRAPU (D3DRENDERSTATETYPE)5 +#define D3DRENDERSTATE_WRAPV (D3DRENDERSTATETYPE)6 +#define D3DRENDERSTATE_MONOENABLE (D3DRENDERSTATETYPE)11 +#define D3DRENDERSTATE_ROP2 (D3DRENDERSTATETYPE)12 +#define D3DRENDERSTATE_PLANEMASK (D3DRENDERSTATETYPE)13 +#define D3DRENDERSTATE_TEXTUREMAG (D3DRENDERSTATETYPE)17 +#define D3DRENDERSTATE_TEXTUREMIN (D3DRENDERSTATETYPE)18 +#define D3DRENDERSTATE_TEXTUREMAPBLEND (D3DRENDERSTATETYPE)21 +#define D3DRENDERSTATE_SUBPIXEL (D3DRENDERSTATETYPE)31 +#define D3DRENDERSTATE_SUBPIXELX (D3DRENDERSTATETYPE)32 +#define D3DRENDERSTATE_STIPPLEENABLE (D3DRENDERSTATETYPE)39 +#define D3DRENDERSTATE_OLDALPHABLENDENABLE (D3DRENDERSTATETYPE)42 +#define D3DRENDERSTATE_BORDERCOLOR (D3DRENDERSTATETYPE)43 +#define D3DRENDERSTATE_TEXTUREADDRESSU (D3DRENDERSTATETYPE)44 +#define D3DRENDERSTATE_TEXTUREADDRESSV (D3DRENDERSTATETYPE)45 +#define D3DRENDERSTATE_MIPMAPLODBIAS (D3DRENDERSTATETYPE)46 +#define D3DRENDERSTATE_ANISOTROPY (D3DRENDERSTATETYPE)49 +#define D3DRENDERSTATE_FLUSHBATCH (D3DRENDERSTATETYPE)50 +#define D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT (D3DRENDERSTATETYPE)51 +#define D3DRENDERSTATE_STIPPLEPATTERN00 (D3DRENDERSTATETYPE)64 +#define D3DRENDERSTATE_STIPPLEPATTERN01 (D3DRENDERSTATETYPE)65 +#define D3DRENDERSTATE_STIPPLEPATTERN02 (D3DRENDERSTATETYPE)66 +#define D3DRENDERSTATE_STIPPLEPATTERN03 (D3DRENDERSTATETYPE)67 +#define D3DRENDERSTATE_STIPPLEPATTERN04 (D3DRENDERSTATETYPE)68 +#define D3DRENDERSTATE_STIPPLEPATTERN05 (D3DRENDERSTATETYPE)69 +#define D3DRENDERSTATE_STIPPLEPATTERN06 (D3DRENDERSTATETYPE)70 +#define D3DRENDERSTATE_STIPPLEPATTERN07 (D3DRENDERSTATETYPE)71 +#define D3DRENDERSTATE_STIPPLEPATTERN08 (D3DRENDERSTATETYPE)72 +#define D3DRENDERSTATE_STIPPLEPATTERN09 (D3DRENDERSTATETYPE)73 +#define D3DRENDERSTATE_STIPPLEPATTERN10 (D3DRENDERSTATETYPE)74 +#define D3DRENDERSTATE_STIPPLEPATTERN11 (D3DRENDERSTATETYPE)75 +#define D3DRENDERSTATE_STIPPLEPATTERN12 (D3DRENDERSTATETYPE)76 +#define D3DRENDERSTATE_STIPPLEPATTERN13 (D3DRENDERSTATETYPE)77 +#define D3DRENDERSTATE_STIPPLEPATTERN14 (D3DRENDERSTATETYPE)78 +#define D3DRENDERSTATE_STIPPLEPATTERN15 (D3DRENDERSTATETYPE)79 +#define D3DRENDERSTATE_STIPPLEPATTERN16 (D3DRENDERSTATETYPE)80 +#define D3DRENDERSTATE_STIPPLEPATTERN17 (D3DRENDERSTATETYPE)81 +#define D3DRENDERSTATE_STIPPLEPATTERN18 (D3DRENDERSTATETYPE)82 +#define D3DRENDERSTATE_STIPPLEPATTERN19 (D3DRENDERSTATETYPE)83 +#define D3DRENDERSTATE_STIPPLEPATTERN20 (D3DRENDERSTATETYPE)84 +#define D3DRENDERSTATE_STIPPLEPATTERN21 (D3DRENDERSTATETYPE)85 +#define D3DRENDERSTATE_STIPPLEPATTERN22 (D3DRENDERSTATETYPE)86 +#define D3DRENDERSTATE_STIPPLEPATTERN23 (D3DRENDERSTATETYPE)87 +#define D3DRENDERSTATE_STIPPLEPATTERN24 (D3DRENDERSTATETYPE)88 +#define D3DRENDERSTATE_STIPPLEPATTERN25 (D3DRENDERSTATETYPE)89 +#define D3DRENDERSTATE_STIPPLEPATTERN26 (D3DRENDERSTATETYPE)90 +#define D3DRENDERSTATE_STIPPLEPATTERN27 (D3DRENDERSTATETYPE)91 +#define D3DRENDERSTATE_STIPPLEPATTERN28 (D3DRENDERSTATETYPE)92 +#define D3DRENDERSTATE_STIPPLEPATTERN29 (D3DRENDERSTATETYPE)93 +#define D3DRENDERSTATE_STIPPLEPATTERN30 (D3DRENDERSTATETYPE)94 +#define D3DRENDERSTATE_STIPPLEPATTERN31 (D3DRENDERSTATETYPE)95 + +// +// retired renderstates - not supported for DX8 interfaces +// +#define D3DRENDERSTATE_COLORKEYENABLE (D3DRENDERSTATETYPE)41 +#define D3DRENDERSTATE_COLORKEYBLENDENABLE (D3DRENDERSTATETYPE)144 + +// +// retired renderstate names - the values are still used under new naming conventions +// +#define D3DRENDERSTATE_BLENDENABLE (D3DRENDERSTATETYPE)27 +#define D3DRENDERSTATE_FOGTABLESTART (D3DRENDERSTATETYPE)36 +#define D3DRENDERSTATE_FOGTABLEEND (D3DRENDERSTATETYPE)37 +#define D3DRENDERSTATE_FOGTABLEDENSITY (D3DRENDERSTATETYPE)38 + +#endif //(DIRECT3D_VERSION < 0x0800) + + +#if(DIRECT3D_VERSION < 0x0800) + +// Values for material source +typedef enum _D3DMATERIALCOLORSOURCE +{ + D3DMCS_MATERIAL = 0, // Color from material is used + D3DMCS_COLOR1 = 1, // Diffuse vertex color is used + D3DMCS_COLOR2 = 2, // Specular vertex color is used + D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum +} D3DMATERIALCOLORSOURCE; + + +#if(DIRECT3D_VERSION >= 0x0500) +// For back-compatibility with legacy compilations +#define D3DRENDERSTATE_BLENDENABLE D3DRENDERSTATE_ALPHABLENDENABLE +#endif /* DIRECT3D_VERSION >= 0x0500 */ + +#if(DIRECT3D_VERSION >= 0x0600) + +// Bias to apply to the texture coordinate set to apply a wrap to. +#define D3DRENDERSTATE_WRAPBIAS 128UL + +/* Flags to construct the WRAP render states */ +#define D3DWRAP_U 0x00000001L +#define D3DWRAP_V 0x00000002L + +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +#if(DIRECT3D_VERSION >= 0x0700) + +/* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */ +#define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U +#define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V +#define D3DWRAPCOORD_2 0x00000004L +#define D3DWRAPCOORD_3 0x00000008L + +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +#endif //(DIRECT3D_VERSION < 0x0800) + +#define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y)) + +typedef struct _D3DSTATE { + union { +#if(DIRECT3D_VERSION < 0x0800) + D3DTRANSFORMSTATETYPE dtstTransformStateType; +#endif //(DIRECT3D_VERSION < 0x0800) + D3DLIGHTSTATETYPE dlstLightStateType; + D3DRENDERSTATETYPE drstRenderStateType; + }; + union { + DWORD dwArg[1]; + D3DVALUE dvArg[1]; + }; +} D3DSTATE, *LPD3DSTATE; + + +/* + * Operation used to load matrices + * hDstMat = hSrcMat + */ +typedef struct _D3DMATRIXLOAD { + D3DMATRIXHANDLE hDestMatrix; /* Destination matrix */ + D3DMATRIXHANDLE hSrcMatrix; /* Source matrix */ +} D3DMATRIXLOAD, *LPD3DMATRIXLOAD; + +/* + * Operation used to multiply matrices + * hDstMat = hSrcMat1 * hSrcMat2 + */ +typedef struct _D3DMATRIXMULTIPLY { + D3DMATRIXHANDLE hDestMatrix; /* Destination matrix */ + D3DMATRIXHANDLE hSrcMatrix1; /* First source matrix */ + D3DMATRIXHANDLE hSrcMatrix2; /* Second source matrix */ +} D3DMATRIXMULTIPLY, *LPD3DMATRIXMULTIPLY; + +/* + * Operation used to transform and light vertices. + */ +typedef struct _D3DPROCESSVERTICES { + DWORD dwFlags; /* Do we transform or light or just copy? */ + WORD wStart; /* Index to first vertex in source */ + WORD wDest; /* Index to first vertex in local buffer */ + DWORD dwCount; /* Number of vertices to be processed */ + DWORD dwReserved; /* Must be zero */ +} D3DPROCESSVERTICES, *LPD3DPROCESSVERTICES; + +#define D3DPROCESSVERTICES_TRANSFORMLIGHT 0x00000000L +#define D3DPROCESSVERTICES_TRANSFORM 0x00000001L +#define D3DPROCESSVERTICES_COPY 0x00000002L +#define D3DPROCESSVERTICES_OPMASK 0x00000007L + +#define D3DPROCESSVERTICES_UPDATEEXTENTS 0x00000008L +#define D3DPROCESSVERTICES_NOCOLOR 0x00000010L + + +#if(DIRECT3D_VERSION >= 0x0600) + + +#if(DIRECT3D_VERSION < 0x0800) + +/* + * State enumerants for per-stage texture processing. + */ +typedef enum _D3DTEXTURESTAGESTATETYPE +{ + D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */ + D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */ + D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */ + D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */ + D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */ + D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */ + D3DTSS_BUMPENVMAT00 = 7, /* D3DVALUE (bump mapping matrix) */ + D3DTSS_BUMPENVMAT01 = 8, /* D3DVALUE (bump mapping matrix) */ + D3DTSS_BUMPENVMAT10 = 9, /* D3DVALUE (bump mapping matrix) */ + D3DTSS_BUMPENVMAT11 = 10, /* D3DVALUE (bump mapping matrix) */ + D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */ + D3DTSS_ADDRESS = 12, /* D3DTEXTUREADDRESS for both coordinates */ + D3DTSS_ADDRESSU = 13, /* D3DTEXTUREADDRESS for U coordinate */ + D3DTSS_ADDRESSV = 14, /* D3DTEXTUREADDRESS for V coordinate */ + D3DTSS_BORDERCOLOR = 15, /* D3DCOLOR */ + D3DTSS_MAGFILTER = 16, /* D3DTEXTUREMAGFILTER filter to use for magnification */ + D3DTSS_MINFILTER = 17, /* D3DTEXTUREMINFILTER filter to use for minification */ + D3DTSS_MIPFILTER = 18, /* D3DTEXTUREMIPFILTER filter to use between mipmaps during minification */ + D3DTSS_MIPMAPLODBIAS = 19, /* D3DVALUE Mipmap LOD bias */ + D3DTSS_MAXMIPLEVEL = 20, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */ + D3DTSS_MAXANISOTROPY = 21, /* DWORD maximum anisotropy */ + D3DTSS_BUMPENVLSCALE = 22, /* D3DVALUE scale for bump map luminance */ + D3DTSS_BUMPENVLOFFSET = 23, /* D3DVALUE offset for bump map luminance */ +#if(DIRECT3D_VERSION >= 0x0700) + D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */ +#endif /* DIRECT3D_VERSION >= 0x0700 */ + D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DTEXTURESTAGESTATETYPE; + +#if(DIRECT3D_VERSION >= 0x0700) +// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position +// and normal in the camera space) should be taken as texture coordinates +// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from +// +#define D3DTSS_TCI_PASSTHRU 0x00000000 +#define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000 +#define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000 +#define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000 +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +/* + * Enumerations for COLOROP and ALPHAOP texture blending operations set in + * texture processing stage controls in D3DRENDERSTATE. + */ +typedef enum _D3DTEXTUREOP +{ +// Control + D3DTOP_DISABLE = 1, // disables stage + D3DTOP_SELECTARG1 = 2, // the default + D3DTOP_SELECTARG2 = 3, + +// Modulate + D3DTOP_MODULATE = 4, // multiply args together + D3DTOP_MODULATE2X = 5, // multiply and 1 bit + D3DTOP_MODULATE4X = 6, // multiply and 2 bits + +// Add + D3DTOP_ADD = 7, // add arguments together + D3DTOP_ADDSIGNED = 8, // add with -0.5 bias + D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit + D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation + D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product + // Arg1 + Arg2 - Arg1*Arg2 + // = Arg1 + (1-Arg1)*Arg2 + +// Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha) + D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha + D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha + D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRENDERSTATE_TEXTUREFACTOR + // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha) + D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha + D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color + +// Specular mapping + D3DTOP_PREMODULATE = 17, // modulate with next texture before use + D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB + // COLOROP only + D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A + // COLOROP only + D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB + // COLOROP only + D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A + // COLOROP only + +// Bump mapping + D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation + D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel + // This can do either diffuse or specular bump mapping with correct input. + // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B) + // where each component has been scaled and offset to make it signed. + // The result is replicated into all four (including alpha) channels. + // This is a valid COLOROP only. + D3DTOP_DOTPRODUCT3 = 24, + + D3DTOP_FORCE_DWORD = 0x7fffffff, +} D3DTEXTUREOP; + +/* + * Values for COLORARG1,2 and ALPHAARG1,2 texture blending operations + * set in texture processing stage controls in D3DRENDERSTATE. + */ +#define D3DTA_SELECTMASK 0x0000000f // mask for arg selector +#define D3DTA_DIFFUSE 0x00000000 // select diffuse color +#define D3DTA_CURRENT 0x00000001 // select result of previous stage +#define D3DTA_TEXTURE 0x00000002 // select texture color +#define D3DTA_TFACTOR 0x00000003 // select RENDERSTATE_TEXTUREFACTOR +#if(DIRECT3D_VERSION >= 0x0700) +#define D3DTA_SPECULAR 0x00000004 // select specular color +#endif /* DIRECT3D_VERSION >= 0x0700 */ +#define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x +#define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components + +#endif //(DIRECT3D_VERSION < 0x0800) + +/* + * IDirect3DTexture2 State Filter Types + */ +typedef enum _D3DTEXTUREMAGFILTER +{ + D3DTFG_POINT = 1, // nearest + D3DTFG_LINEAR = 2, // linear interpolation + D3DTFG_FLATCUBIC = 3, // cubic + D3DTFG_GAUSSIANCUBIC = 4, // different cubic kernel + D3DTFG_ANISOTROPIC = 5, // +#if(DIRECT3D_VERSION >= 0x0700) +#endif /* DIRECT3D_VERSION >= 0x0700 */ + D3DTFG_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum +} D3DTEXTUREMAGFILTER; + +typedef enum _D3DTEXTUREMINFILTER +{ + D3DTFN_POINT = 1, // nearest + D3DTFN_LINEAR = 2, // linear interpolation + D3DTFN_ANISOTROPIC = 3, // + D3DTFN_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum +} D3DTEXTUREMINFILTER; + +typedef enum _D3DTEXTUREMIPFILTER +{ + D3DTFP_NONE = 1, // mipmapping disabled (use MAG filter) + D3DTFP_POINT = 2, // nearest + D3DTFP_LINEAR = 3, // linear interpolation + D3DTFP_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum +} D3DTEXTUREMIPFILTER; + +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +/* + * Triangle flags + */ + +/* + * Tri strip and fan flags. + * START loads all three vertices + * EVEN and ODD load just v3 with even or odd culling + * START_FLAT contains a count from 0 to 29 that allows the + * whole strip or fan to be culled in one hit. + * e.g. for a quad len = 1 + */ +#define D3DTRIFLAG_START 0x00000000L +#define D3DTRIFLAG_STARTFLAT(len) (len) /* 0 < len < 30 */ +#define D3DTRIFLAG_ODD 0x0000001eL +#define D3DTRIFLAG_EVEN 0x0000001fL + +/* + * Triangle edge flags + * enable edges for wireframe or antialiasing + */ +#define D3DTRIFLAG_EDGEENABLE1 0x00000100L /* v0-v1 edge */ +#define D3DTRIFLAG_EDGEENABLE2 0x00000200L /* v1-v2 edge */ +#define D3DTRIFLAG_EDGEENABLE3 0x00000400L /* v2-v0 edge */ +#define D3DTRIFLAG_EDGEENABLETRIANGLE \ + (D3DTRIFLAG_EDGEENABLE1 | D3DTRIFLAG_EDGEENABLE2 | D3DTRIFLAG_EDGEENABLE3) + +/* + * Primitive structures and related defines. Vertex offsets are to types + * D3DVERTEX, D3DLVERTEX, or D3DTLVERTEX. + */ + +/* + * Triangle list primitive structure + */ +typedef struct _D3DTRIANGLE { + union { + WORD v1; /* Vertex indices */ + WORD wV1; + }; + union { + WORD v2; + WORD wV2; + }; + union { + WORD v3; + WORD wV3; + }; + WORD wFlags; /* Edge (and other) flags */ +} D3DTRIANGLE, *LPD3DTRIANGLE; + +/* + * Line list structure. + * The instruction count defines the number of line segments. + */ +typedef struct _D3DLINE { + union { + WORD v1; /* Vertex indices */ + WORD wV1; + }; + union { + WORD v2; + WORD wV2; + }; +} D3DLINE, *LPD3DLINE; + +/* + * Span structure + * Spans join a list of points with the same y value. + * If the y value changes, a new span is started. + */ +typedef struct _D3DSPAN { + WORD wCount; /* Number of spans */ + WORD wFirst; /* Index to first vertex */ +} D3DSPAN, *LPD3DSPAN; + +/* + * Point structure + */ +typedef struct _D3DPOINT { + WORD wCount; /* number of points */ + WORD wFirst; /* index to first vertex */ +} D3DPOINT, *LPD3DPOINT; + + +/* + * Forward branch structure. + * Mask is logically anded with the driver status mask + * if the result equals 'value', the branch is taken. + */ +typedef struct _D3DBRANCH { + DWORD dwMask; /* Bitmask against D3D status */ + DWORD dwValue; + BOOL bNegate; /* TRUE to negate comparison */ + DWORD dwOffset; /* How far to branch forward (0 for exit)*/ +} D3DBRANCH, *LPD3DBRANCH; + +/* + * Status used for set status instruction. + * The D3D status is initialised on device creation + * and is modified by all execute calls. + */ +typedef struct _D3DSTATUS { + DWORD dwFlags; /* Do we set extents or status */ + DWORD dwStatus; /* D3D status */ + D3DRECT drExtent; +} D3DSTATUS, *LPD3DSTATUS; + +#define D3DSETSTATUS_STATUS 0x00000001L +#define D3DSETSTATUS_EXTENTS 0x00000002L +#define D3DSETSTATUS_ALL (D3DSETSTATUS_STATUS | D3DSETSTATUS_EXTENTS) + +#if(DIRECT3D_VERSION >= 0x0500) +typedef struct _D3DCLIPSTATUS { + DWORD dwFlags; /* Do we set 2d extents, 3D extents or status */ + DWORD dwStatus; /* Clip status */ + float minx, maxx; /* X extents */ + float miny, maxy; /* Y extents */ + float minz, maxz; /* Z extents */ +} D3DCLIPSTATUS, *LPD3DCLIPSTATUS; + +#define D3DCLIPSTATUS_STATUS 0x00000001L +#define D3DCLIPSTATUS_EXTENTS2 0x00000002L +#define D3DCLIPSTATUS_EXTENTS3 0x00000004L + +#endif /* DIRECT3D_VERSION >= 0x0500 */ +/* + * Statistics structure + */ +typedef struct _D3DSTATS { + DWORD dwSize; + DWORD dwTrianglesDrawn; + DWORD dwLinesDrawn; + DWORD dwPointsDrawn; + DWORD dwSpansDrawn; + DWORD dwVerticesProcessed; +} D3DSTATS, *LPD3DSTATS; + +/* + * Execute options. + * When calling using D3DEXECUTE_UNCLIPPED all the primitives + * inside the buffer must be contained within the viewport. + */ +#define D3DEXECUTE_CLIPPED 0x00000001l +#define D3DEXECUTE_UNCLIPPED 0x00000002l + +typedef struct _D3DEXECUTEDATA { + DWORD dwSize; + DWORD dwVertexOffset; + DWORD dwVertexCount; + DWORD dwInstructionOffset; + DWORD dwInstructionLength; + DWORD dwHVertexOffset; + D3DSTATUS dsStatus; /* Status after execute */ +} D3DEXECUTEDATA, *LPD3DEXECUTEDATA; + +/* + * Palette flags. + * This are or'ed with the peFlags in the PALETTEENTRYs passed to DirectDraw. + */ +#define D3DPAL_FREE 0x00 /* Renderer may use this entry freely */ +#define D3DPAL_READONLY 0x40 /* Renderer may not set this entry */ +#define D3DPAL_RESERVED 0x80 /* Renderer may not use this entry */ + + +#if(DIRECT3D_VERSION >= 0x0600) + +typedef struct _D3DVERTEXBUFFERDESC { + DWORD dwSize; + DWORD dwCaps; + DWORD dwFVF; + DWORD dwNumVertices; +} D3DVERTEXBUFFERDESC, *LPD3DVERTEXBUFFERDESC; + +#define D3DVBCAPS_SYSTEMMEMORY 0x00000800l +#define D3DVBCAPS_WRITEONLY 0x00010000l +#define D3DVBCAPS_OPTIMIZED 0x80000000l +#define D3DVBCAPS_DONOTCLIP 0x00000001l + +/* Vertex Operations for ProcessVertices */ +#define D3DVOP_LIGHT (1 << 10) +#define D3DVOP_TRANSFORM (1 << 0) +#define D3DVOP_CLIP (1 << 2) +#define D3DVOP_EXTENTS (1 << 3) + + +#if(DIRECT3D_VERSION < 0x0800) + +/* The maximum number of vertices user can pass to any d3d + drawing function or to create vertex buffer with +*/ +#define D3DMAXNUMVERTICES ((1<<16) - 1) +/* The maximum number of primitives user can pass to any d3d + drawing function. +*/ +#define D3DMAXNUMPRIMITIVES ((1<<16) - 1) + +#if(DIRECT3D_VERSION >= 0x0700) + +/* Bits for dwFlags in ProcessVertices call */ +#define D3DPV_DONOTCOPYDATA (1 << 0) + +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +#endif //(DIRECT3D_VERSION < 0x0800) + +//------------------------------------------------------------------- + +#if(DIRECT3D_VERSION < 0x0800) + +// Flexible vertex format bits +// +#define D3DFVF_RESERVED0 0x001 +#define D3DFVF_POSITION_MASK 0x00E +#define D3DFVF_XYZ 0x002 +#define D3DFVF_XYZRHW 0x004 +#if(DIRECT3D_VERSION >= 0x0700) +#define D3DFVF_XYZB1 0x006 +#define D3DFVF_XYZB2 0x008 +#define D3DFVF_XYZB3 0x00a +#define D3DFVF_XYZB4 0x00c +#define D3DFVF_XYZB5 0x00e + +#endif /* DIRECT3D_VERSION >= 0x0700 */ +#define D3DFVF_NORMAL 0x010 +#define D3DFVF_RESERVED1 0x020 +#define D3DFVF_DIFFUSE 0x040 +#define D3DFVF_SPECULAR 0x080 + +#define D3DFVF_TEXCOUNT_MASK 0xf00 +#define D3DFVF_TEXCOUNT_SHIFT 8 +#define D3DFVF_TEX0 0x000 +#define D3DFVF_TEX1 0x100 +#define D3DFVF_TEX2 0x200 +#define D3DFVF_TEX3 0x300 +#define D3DFVF_TEX4 0x400 +#define D3DFVF_TEX5 0x500 +#define D3DFVF_TEX6 0x600 +#define D3DFVF_TEX7 0x700 +#define D3DFVF_TEX8 0x800 + +#define D3DFVF_RESERVED2 0xf000 // 4 reserved bits + +#else +#define D3DFVF_RESERVED1 0x020 +#endif //(DIRECT3D_VERSION < 0x0800) + +#define D3DFVF_VERTEX ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 ) +#define D3DFVF_LVERTEX ( D3DFVF_XYZ | D3DFVF_RESERVED1 | D3DFVF_DIFFUSE | \ + D3DFVF_SPECULAR | D3DFVF_TEX1 ) +#define D3DFVF_TLVERTEX ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | \ + D3DFVF_TEX1 ) + + +typedef struct _D3DDP_PTRSTRIDE +{ + LPVOID lpvData; + DWORD dwStride; +} D3DDP_PTRSTRIDE; + +#define D3DDP_MAXTEXCOORD 8 + +typedef struct _D3DDRAWPRIMITIVESTRIDEDDATA +{ + D3DDP_PTRSTRIDE position; + D3DDP_PTRSTRIDE normal; + D3DDP_PTRSTRIDE diffuse; + D3DDP_PTRSTRIDE specular; + D3DDP_PTRSTRIDE textureCoords[D3DDP_MAXTEXCOORD]; +} D3DDRAWPRIMITIVESTRIDEDDATA, *LPD3DDRAWPRIMITIVESTRIDEDDATA; +//--------------------------------------------------------------------- +// ComputeSphereVisibility return values +// +#define D3DVIS_INSIDE_FRUSTUM 0 +#define D3DVIS_INTERSECT_FRUSTUM 1 +#define D3DVIS_OUTSIDE_FRUSTUM 2 +#define D3DVIS_INSIDE_LEFT 0 +#define D3DVIS_INTERSECT_LEFT (1 << 2) +#define D3DVIS_OUTSIDE_LEFT (2 << 2) +#define D3DVIS_INSIDE_RIGHT 0 +#define D3DVIS_INTERSECT_RIGHT (1 << 4) +#define D3DVIS_OUTSIDE_RIGHT (2 << 4) +#define D3DVIS_INSIDE_TOP 0 +#define D3DVIS_INTERSECT_TOP (1 << 6) +#define D3DVIS_OUTSIDE_TOP (2 << 6) +#define D3DVIS_INSIDE_BOTTOM 0 +#define D3DVIS_INTERSECT_BOTTOM (1 << 8) +#define D3DVIS_OUTSIDE_BOTTOM (2 << 8) +#define D3DVIS_INSIDE_NEAR 0 +#define D3DVIS_INTERSECT_NEAR (1 << 10) +#define D3DVIS_OUTSIDE_NEAR (2 << 10) +#define D3DVIS_INSIDE_FAR 0 +#define D3DVIS_INTERSECT_FAR (1 << 12) +#define D3DVIS_OUTSIDE_FAR (2 << 12) + +#define D3DVIS_MASK_FRUSTUM (3 << 0) +#define D3DVIS_MASK_LEFT (3 << 2) +#define D3DVIS_MASK_RIGHT (3 << 4) +#define D3DVIS_MASK_TOP (3 << 6) +#define D3DVIS_MASK_BOTTOM (3 << 8) +#define D3DVIS_MASK_NEAR (3 << 10) +#define D3DVIS_MASK_FAR (3 << 12) + +#endif /* DIRECT3D_VERSION >= 0x0600 */ + +#if(DIRECT3D_VERSION < 0x0800) + +#if(DIRECT3D_VERSION >= 0x0700) + +// To be used with GetInfo() +#define D3DDEVINFOID_TEXTUREMANAGER 1 +#define D3DDEVINFOID_D3DTEXTUREMANAGER 2 +#define D3DDEVINFOID_TEXTURING 3 + +typedef enum _D3DSTATEBLOCKTYPE +{ + D3DSBT_ALL = 1, // capture all state + D3DSBT_PIXELSTATE = 2, // capture pixel state + D3DSBT_VERTEXSTATE = 3, // capture vertex state + D3DSBT_FORCE_DWORD = 0xffffffff +} D3DSTATEBLOCKTYPE; + +// The D3DVERTEXBLENDFLAGS type is used with D3DRENDERSTATE_VERTEXBLEND state. +// +typedef enum _D3DVERTEXBLENDFLAGS +{ + D3DVBLEND_DISABLE = 0, // Disable vertex blending + D3DVBLEND_1WEIGHT = 1, // blend between 2 matrices + D3DVBLEND_2WEIGHTS = 2, // blend between 3 matrices + D3DVBLEND_3WEIGHTS = 3, // blend between 4 matrices +} D3DVERTEXBLENDFLAGS; + +typedef enum _D3DTEXTURETRANSFORMFLAGS { + D3DTTFF_DISABLE = 0, // texture coordinates are passed directly + D3DTTFF_COUNT1 = 1, // rasterizer should expect 1-D texture coords + D3DTTFF_COUNT2 = 2, // rasterizer should expect 2-D texture coords + D3DTTFF_COUNT3 = 3, // rasterizer should expect 3-D texture coords + D3DTTFF_COUNT4 = 4, // rasterizer should expect 4-D texture coords + D3DTTFF_PROJECTED = 256, // texcoords to be divided by COUNTth element + D3DTTFF_FORCE_DWORD = 0x7fffffff, +} D3DTEXTURETRANSFORMFLAGS; + +// Macros to set texture coordinate format bits in the FVF id + +#define D3DFVF_TEXTUREFORMAT2 0 // Two floating point values +#define D3DFVF_TEXTUREFORMAT1 3 // One floating point value +#define D3DFVF_TEXTUREFORMAT3 1 // Three floating point values +#define D3DFVF_TEXTUREFORMAT4 2 // Four floating point values + +#define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16)) +#define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2) +#define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16)) +#define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16)) + + +#endif /* DIRECT3D_VERSION >= 0x0700 */ + +#else +// +// legacy vertex blend names +// +typedef enum _D3DVERTEXBLENDFLAGS D3DVERTEXBLENDFLAGS; +#define D3DVBLEND_DISABLE (D3DVERTEXBLENDFLAGS)0 +#define D3DVBLEND_1WEIGHT (D3DVERTEXBLENDFLAGS)1 +#define D3DVBLEND_2WEIGHTS (D3DVERTEXBLENDFLAGS)2 +#define D3DVBLEND_3WEIGHTS (D3DVERTEXBLENDFLAGS)3 + +#endif //(DIRECT3D_VERSION < 0x0800) + +#pragma pack() +#pragma warning(default:4201) + +#endif /* _D3DTYPES_H_ */ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dvec.inl b/Src/Decoder_H264_ALL/D3D/include/d3dvec.inl new file mode 100644 index 0000000..ff7fdfe --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dvec.inl @@ -0,0 +1,255 @@ + +/****************************************************************** + * * + * D3DVec.inl * + * * + * Float-valued 3D vector class for Direct3D. * + * * + * Copyright (c) Microsoft Corp. All rights reserved. * + * * + ******************************************************************/ + +#include + +// ===================================== +// Constructors +// ===================================== + +inline +_D3DVECTOR::_D3DVECTOR(D3DVALUE f) +{ + x = y = z = f; +} + +inline +_D3DVECTOR::_D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z) +{ + x = _x; y = _y; z = _z; +} + +inline +_D3DVECTOR::_D3DVECTOR(const D3DVALUE f[3]) +{ + x = f[0]; y = f[1]; z = f[2]; +} + +// ===================================== +// Access grants +// ===================================== + +inline const D3DVALUE& +_D3DVECTOR::operator[](int i) const +{ + return (&x)[i]; +} + +inline D3DVALUE& +_D3DVECTOR::operator[](int i) +{ + return (&x)[i]; +} + + +// ===================================== +// Assignment operators +// ===================================== + +inline _D3DVECTOR& +_D3DVECTOR::operator += (const _D3DVECTOR& v) +{ + x += v.x; y += v.y; z += v.z; + return *this; +} + +inline _D3DVECTOR& +_D3DVECTOR::operator -= (const _D3DVECTOR& v) +{ + x -= v.x; y -= v.y; z -= v.z; + return *this; +} + +inline _D3DVECTOR& +_D3DVECTOR::operator *= (const _D3DVECTOR& v) +{ + x *= v.x; y *= v.y; z *= v.z; + return *this; +} + +inline _D3DVECTOR& +_D3DVECTOR::operator /= (const _D3DVECTOR& v) +{ + x /= v.x; y /= v.y; z /= v.z; + return *this; +} + +inline _D3DVECTOR& +_D3DVECTOR::operator *= (D3DVALUE s) +{ + x *= s; y *= s; z *= s; + return *this; +} + +inline _D3DVECTOR& +_D3DVECTOR::operator /= (D3DVALUE s) +{ + x /= s; y /= s; z /= s; + return *this; +} + +inline _D3DVECTOR +operator + (const _D3DVECTOR& v) +{ + return v; +} + +inline _D3DVECTOR +operator - (const _D3DVECTOR& v) +{ + return _D3DVECTOR(-v.x, -v.y, -v.z); +} + +inline _D3DVECTOR +operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2) +{ + return _D3DVECTOR(v1.x+v2.x, v1.y+v2.y, v1.z+v2.z); +} + +inline _D3DVECTOR +operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2) +{ + return _D3DVECTOR(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z); +} + +inline _D3DVECTOR +operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2) +{ + return _D3DVECTOR(v1.x*v2.x, v1.y*v2.y, v1.z*v2.z); +} + +inline _D3DVECTOR +operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2) +{ + return _D3DVECTOR(v1.x/v2.x, v1.y/v2.y, v1.z/v2.z); +} + +inline int +operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2) +{ + return v1[0] < v2[0] && v1[1] < v2[1] && v1[2] < v2[2]; +} + +inline int +operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2) +{ + return v1[0] <= v2[0] && v1[1] <= v2[1] && v1[2] <= v2[2]; +} + +inline _D3DVECTOR +operator * (const _D3DVECTOR& v, D3DVALUE s) +{ + return _D3DVECTOR(s*v.x, s*v.y, s*v.z); +} + +inline _D3DVECTOR +operator * (D3DVALUE s, const _D3DVECTOR& v) +{ + return _D3DVECTOR(s*v.x, s*v.y, s*v.z); +} + +inline _D3DVECTOR +operator / (const _D3DVECTOR& v, D3DVALUE s) +{ + return _D3DVECTOR(v.x/s, v.y/s, v.z/s); +} + +inline int +operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2) +{ + return v1.x==v2.x && v1.y==v2.y && v1.z == v2.z; +} + +inline D3DVALUE +Magnitude (const _D3DVECTOR& v) +{ + return (D3DVALUE) sqrt(SquareMagnitude(v)); +} + +inline D3DVALUE +SquareMagnitude (const _D3DVECTOR& v) +{ + return v.x*v.x + v.y*v.y + v.z*v.z; +} + +inline _D3DVECTOR +Normalize (const _D3DVECTOR& v) +{ + return v / Magnitude(v); +} + +inline D3DVALUE +Min (const _D3DVECTOR& v) +{ + D3DVALUE ret = v.x; + if (v.y < ret) ret = v.y; + if (v.z < ret) ret = v.z; + return ret; +} + +inline D3DVALUE +Max (const _D3DVECTOR& v) +{ + D3DVALUE ret = v.x; + if (ret < v.y) ret = v.y; + if (ret < v.z) ret = v.z; + return ret; +} + +inline _D3DVECTOR +Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2) +{ + return _D3DVECTOR( v1[0] < v2[0] ? v1[0] : v2[0], + v1[1] < v2[1] ? v1[1] : v2[1], + v1[2] < v2[2] ? v1[2] : v2[2]); +} + +inline _D3DVECTOR +Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2) +{ + return _D3DVECTOR( v1[0] > v2[0] ? v1[0] : v2[0], + v1[1] > v2[1] ? v1[1] : v2[1], + v1[2] > v2[2] ? v1[2] : v2[2]); +} + +inline D3DVALUE +DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2) +{ + return v1.x*v2.x + v1.y * v2.y + v1.z*v2.z; +} + +inline _D3DVECTOR +CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2) +{ + _D3DVECTOR result; + + result[0] = v1[1] * v2[2] - v1[2] * v2[1]; + result[1] = v1[2] * v2[0] - v1[0] * v2[2]; + result[2] = v1[0] * v2[1] - v1[1] * v2[0]; + + return result; +} + +inline _D3DMATRIX +operator* (const _D3DMATRIX& a, const _D3DMATRIX& b) +{ + _D3DMATRIX ret; + for (int i=0; i<4; i++) { + for (int j=0; j<4; j++) { + ret(i, j) = 0.0f; + for (int k=0; k<4; k++) { + ret(i, j) += a(i, k) * b(k, j); + } + } + } + return ret; +} + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dx10async.h b/Src/Decoder_H264_ALL/D3D/include/d3dx10async.h new file mode 100644 index 0000000..d1b1fc5 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dx10async.h @@ -0,0 +1,290 @@ + +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: D3DX10Async.h +// Content: D3DX10 Asynchronous Effect / Shader loaders / compilers +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3DX10ASYNC_H__ +#define __D3DX10ASYNC_H__ + +#include "d3dx10.h" + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +//---------------------------------------------------------------------------- +// D3DX10Compile: +// ------------------ +// Compiles an effect or shader. +// +// Parameters: +// pSrcFile +// Source file name. +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module. +// pSrcData +// Pointer to source code. +// SrcDataLen +// Size of source code, in bytes. +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// pFunctionName +// Name of the entrypoint function where execution should begin. +// pProfile +// Instruction set to be used when generating code. Currently supported +// profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "vs_3_0", +// "vs_3_sw", "vs_4_0", "vs_4_1", +// "ps_2_0", "ps_2_a", "ps_2_b", "ps_2_sw", "ps_3_0", +// "ps_3_sw", "ps_4_0", "ps_4_1", +// "gs_4_0", "gs_4_1", +// "tx_1_0", +// "fx_4_0", "fx_4_1" +// Note that this entrypoint does not compile fx_2_0 targets, for that +// you need to use the D3DX9 function. +// Flags1 +// See D3D10_SHADER_xxx flags. +// Flags2 +// See D3D10_EFFECT_xxx flags. +// ppShader +// Returns a buffer containing the created shader. This buffer contains +// the compiled shader code, as well as any embedded debug and symbol +// table info. (See D3D10GetShaderConstantTable) +// ppErrorMsgs +// Returns a buffer containing a listing of errors and warnings that were +// encountered during the compile. If you are running in a debugger, +// these are the same messages you will see in your debug output. +// pHResult +// Pointer to a memory location to receive the return value upon completion. +// Maybe NULL if not needed. +// If pPump != NULL, pHResult must be a valid memory location until the +// the asynchronous execution completes. +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3DX10CompileFromFileA(LPCSTR pSrcFile,CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CompileFromFileW(LPCWSTR pSrcFile, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10CompileFromFile D3DX10CompileFromFileW +#else +#define D3DX10CompileFromFile D3DX10CompileFromFileA +#endif + +HRESULT WINAPI D3DX10CompileFromResourceA(HMODULE hSrcModule, LPCSTR pSrcResource, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CompileFromResourceW(HMODULE hSrcModule, LPCWSTR pSrcResource, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10CompileFromResource D3DX10CompileFromResourceW +#else +#define D3DX10CompileFromResource D3DX10CompileFromResourceA +#endif + +HRESULT WINAPI D3DX10CompileFromMemory(LPCSTR pSrcData, SIZE_T SrcDataLen, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, ID3DX10ThreadPump* pPump, ID3D10Blob** ppShader, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +//---------------------------------------------------------------------------- +// D3DX10CreateEffectFromXXXX: +// -------------------------- +// Creates an effect from a binary effect or file +// +// Parameters: +// +// [in] +// +// +// pFileName +// Name of the ASCII (uncompiled) or binary (compiled) Effect file to load +// +// hModule +// Handle to the module containing the resource to compile from +// pResourceName +// Name of the resource within hModule to compile from +// +// pData +// Blob of effect data, either ASCII (uncompiled) or binary (compiled) +// DataLength +// Length of the data blob +// +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// pProfile +// Profile to use when compiling the effect. +// HLSLFlags +// Compilation flags pertaining to shaders and data types, honored by +// the HLSL compiler +// FXFlags +// Compilation flags pertaining to Effect compilation, honored +// by the Effect compiler +// pDevice +// Pointer to the D3D10 device on which to create Effect resources +// pEffectPool +// Pointer to an Effect pool to share variables with or NULL +// +// [out] +// +// ppEffect +// Address of the newly created Effect interface +// ppEffectPool +// Address of the newly created Effect pool interface +// ppErrors +// If non-NULL, address of a buffer with error messages that occurred +// during parsing or compilation +// pHResult +// Pointer to a memory location to receive the return value upon completion. +// Maybe NULL if not needed. +// If pPump != NULL, pHResult must be a valid memory location until the +// the asynchronous execution completes. +//---------------------------------------------------------------------------- + + +HRESULT WINAPI D3DX10CreateEffectFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult); + + +#ifdef UNICODE +#define D3DX10CreateEffectFromFile D3DX10CreateEffectFromFileW +#define D3DX10CreateEffectFromResource D3DX10CreateEffectFromResourceW +#else +#define D3DX10CreateEffectFromFile D3DX10CreateEffectFromFileA +#define D3DX10CreateEffectFromResource D3DX10CreateEffectFromResourceA +#endif + +HRESULT WINAPI D3DX10CreateEffectPoolFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump, + ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectPoolFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, ID3DX10ThreadPump* pPump, + ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectPoolFromMemory(LPCVOID pData, SIZE_T DataLength, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectPoolFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult); + +HRESULT WINAPI D3DX10CreateEffectPoolFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO *pDefines, + ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice, + ID3DX10ThreadPump* pPump, ID3D10EffectPool **ppEffectPool, ID3D10Blob **ppErrors, HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10CreateEffectPoolFromFile D3DX10CreateEffectPoolFromFileW +#define D3DX10CreateEffectPoolFromResource D3DX10CreateEffectPoolFromResourceW +#else +#define D3DX10CreateEffectPoolFromFile D3DX10CreateEffectPoolFromFileA +#define D3DX10CreateEffectPoolFromResource D3DX10CreateEffectPoolFromResourceA +#endif + +HRESULT WINAPI D3DX10PreprocessShaderFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX10PreprocessShaderFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX10PreprocessShaderFromMemory(LPCSTR pSrcData, SIZE_T SrcDataSize, LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX10PreprocessShaderFromResourceA(HMODULE hModule, LPCSTR pResourceName, LPCSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +HRESULT WINAPI D3DX10PreprocessShaderFromResourceW(HMODULE hModule, LPCWSTR pResourceName, LPCWSTR pSrcFileName, CONST D3D10_SHADER_MACRO* pDefines, + LPD3D10INCLUDE pInclude, ID3DX10ThreadPump *pPump, ID3D10Blob** ppShaderText, ID3D10Blob** ppErrorMsgs, HRESULT* pHResult); + +#ifdef UNICODE +#define D3DX10PreprocessShaderFromFile D3DX10PreprocessShaderFromFileW +#define D3DX10PreprocessShaderFromResource D3DX10PreprocessShaderFromResourceW +#else +#define D3DX10PreprocessShaderFromFile D3DX10PreprocessShaderFromFileA +#define D3DX10PreprocessShaderFromResource D3DX10PreprocessShaderFromResourceA +#endif + +//---------------------------------------------------------------------------- +// Async processors +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3DX10CreateAsyncCompilerProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pFunctionName, LPCSTR pProfile, UINT Flags1, UINT Flags2, + ID3D10Blob **ppCompiledShader, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor); + +HRESULT WINAPI D3DX10CreateAsyncEffectCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice, + ID3D10EffectPool *pPool, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor); + +HRESULT WINAPI D3DX10CreateAsyncEffectPoolCreateProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + LPCSTR pProfile, UINT Flags, UINT FXFlags, ID3D10Device *pDevice, + ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor); + +HRESULT WINAPI D3DX10CreateAsyncShaderPreprocessProcessor(LPCSTR pFileName, CONST D3D10_SHADER_MACRO* pDefines, LPD3D10INCLUDE pInclude, + ID3D10Blob** ppShaderText, ID3D10Blob **ppErrorBuffer, ID3DX10DataProcessor **ppProcessor); + + + +//---------------------------------------------------------------------------- +// D3DX10 Asynchronous texture I/O (advanced mode) +//---------------------------------------------------------------------------- + +HRESULT WINAPI D3DX10CreateAsyncFileLoaderW(LPCWSTR pFileName, ID3DX10DataLoader **ppDataLoader); +HRESULT WINAPI D3DX10CreateAsyncFileLoaderA(LPCSTR pFileName, ID3DX10DataLoader **ppDataLoader); +HRESULT WINAPI D3DX10CreateAsyncMemoryLoader(LPCVOID pData, SIZE_T cbData, ID3DX10DataLoader **ppDataLoader); +HRESULT WINAPI D3DX10CreateAsyncResourceLoaderW(HMODULE hSrcModule, LPCWSTR pSrcResource, ID3DX10DataLoader **ppDataLoader); +HRESULT WINAPI D3DX10CreateAsyncResourceLoaderA(HMODULE hSrcModule, LPCSTR pSrcResource, ID3DX10DataLoader **ppDataLoader); + +#ifdef UNICODE +#define D3DX10CreateAsyncFileLoader D3DX10CreateAsyncFileLoaderW +#define D3DX10CreateAsyncResourceLoader D3DX10CreateAsyncResourceLoaderW +#else +#define D3DX10CreateAsyncFileLoader D3DX10CreateAsyncFileLoaderA +#define D3DX10CreateAsyncResourceLoader D3DX10CreateAsyncResourceLoaderA +#endif + +HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor); +HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor(D3DX10_IMAGE_INFO *pImageInfo, ID3DX10DataProcessor **ppDataProcessor); +HRESULT WINAPI D3DX10CreateAsyncShaderResourceViewProcessor(ID3D10Device *pDevice, D3DX10_IMAGE_LOAD_INFO *pLoadInfo, ID3DX10DataProcessor **ppDataProcessor); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX10ASYNC_H__ + + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dx9.h b/Src/Decoder_H264_ALL/D3D/include/d3dx9.h new file mode 100644 index 0000000..822f0a8 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dx9.h @@ -0,0 +1,76 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9.h +// Content: D3DX utility library +// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __D3DX_INTERNAL__ +#error Incorrect D3DX header used +#endif + +#ifndef __D3DX9_H__ +#define __D3DX9_H__ + + +// Defines +#include + +#define D3DX_DEFAULT ((UINT) -1) +#define D3DX_DEFAULT_NONPOW2 ((UINT) -2) +#define D3DX_DEFAULT_FLOAT FLT_MAX +#define D3DX_FROM_FILE ((UINT) -3) +#define D3DFMT_FROM_FILE ((D3DFORMAT) -3) + +#ifndef D3DXINLINE +#ifdef _MSC_VER + #if (_MSC_VER >= 1200) + #define D3DXINLINE __forceinline + #else + #define D3DXINLINE __inline + #endif +#else + #ifdef __cplusplus + #define D3DXINLINE inline + #else + #define D3DXINLINE + #endif +#endif +#endif + + + +// Includes +#include "d3d9.h" +#include "d3dx9math.h" +#include "d3dx9core.h" +#include "d3dx9xof.h" +#include "d3dx9mesh.h" +#include "d3dx9shader.h" +#include "d3dx9effect.h" +#include "d3dx9tex.h" +#include "d3dx9shape.h" +#include "d3dx9anim.h" + + +// Errors +#define _FACDD 0x876 +#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) + +enum _D3DXERR { + D3DXERR_CANNOTMODIFYINDEXBUFFER = MAKE_DDHRESULT(2900), + D3DXERR_INVALIDMESH = MAKE_DDHRESULT(2901), + D3DXERR_CANNOTATTRSORT = MAKE_DDHRESULT(2902), + D3DXERR_SKINNINGNOTSUPPORTED = MAKE_DDHRESULT(2903), + D3DXERR_TOOMANYINFLUENCES = MAKE_DDHRESULT(2904), + D3DXERR_INVALIDDATA = MAKE_DDHRESULT(2905), + D3DXERR_LOADEDMESHASNODATA = MAKE_DDHRESULT(2906), + D3DXERR_DUPLICATENAMEDFRAGMENT = MAKE_DDHRESULT(2907), + D3DXERR_CANNOTREMOVELASTITEM = MAKE_DDHRESULT(2908), +}; + + +#endif //__D3DX9_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dx9anim.h b/Src/Decoder_H264_ALL/D3D/include/d3dx9anim.h new file mode 100644 index 0000000..fedb1db --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dx9anim.h @@ -0,0 +1,1114 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9anim.h +// Content: D3DX mesh types and functions +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3DX9ANIM_H__ +#define __D3DX9ANIM_H__ + +// {698CFB3F-9289-4d95-9A57-33A94B5A65F9} +DEFINE_GUID(IID_ID3DXAnimationSet, +0x698cfb3f, 0x9289, 0x4d95, 0x9a, 0x57, 0x33, 0xa9, 0x4b, 0x5a, 0x65, 0xf9); + +// {FA4E8E3A-9786-407d-8B4C-5995893764AF} +DEFINE_GUID(IID_ID3DXKeyframedAnimationSet, +0xfa4e8e3a, 0x9786, 0x407d, 0x8b, 0x4c, 0x59, 0x95, 0x89, 0x37, 0x64, 0xaf); + +// {6CC2480D-3808-4739-9F88-DE49FACD8D4C} +DEFINE_GUID(IID_ID3DXCompressedAnimationSet, +0x6cc2480d, 0x3808, 0x4739, 0x9f, 0x88, 0xde, 0x49, 0xfa, 0xcd, 0x8d, 0x4c); + +// {AC8948EC-F86D-43e2-96DE-31FC35F96D9E} +DEFINE_GUID(IID_ID3DXAnimationController, +0xac8948ec, 0xf86d, 0x43e2, 0x96, 0xde, 0x31, 0xfc, 0x35, 0xf9, 0x6d, 0x9e); + + +//---------------------------------------------------------------------------- +// D3DXMESHDATATYPE: +// ----------------- +// This enum defines the type of mesh data present in a MeshData structure. +//---------------------------------------------------------------------------- +typedef enum _D3DXMESHDATATYPE { + D3DXMESHTYPE_MESH = 0x001, // Normal ID3DXMesh data + D3DXMESHTYPE_PMESH = 0x002, // Progressive Mesh - ID3DXPMesh + D3DXMESHTYPE_PATCHMESH = 0x003, // Patch Mesh - ID3DXPatchMesh + + D3DXMESHTYPE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DXMESHDATATYPE; + +//---------------------------------------------------------------------------- +// D3DXMESHDATA: +// ------------- +// This struct encapsulates a the mesh data that can be present in a mesh +// container. The supported mesh types are pMesh, pPMesh, pPatchMesh. +// The valid way to access this is determined by the Type enum. +//---------------------------------------------------------------------------- +typedef struct _D3DXMESHDATA +{ + D3DXMESHDATATYPE Type; + + // current mesh data interface + union + { + LPD3DXMESH pMesh; + LPD3DXPMESH pPMesh; + LPD3DXPATCHMESH pPatchMesh; + }; +} D3DXMESHDATA, *LPD3DXMESHDATA; + +//---------------------------------------------------------------------------- +// D3DXMESHCONTAINER: +// ------------------ +// This struct encapsulates a mesh object in a transformation frame +// hierarchy. The app can derive from this structure to add other app specific +// data to this. +//---------------------------------------------------------------------------- +typedef struct _D3DXMESHCONTAINER +{ + LPSTR Name; + + D3DXMESHDATA MeshData; + + LPD3DXMATERIAL pMaterials; + LPD3DXEFFECTINSTANCE pEffects; + DWORD NumMaterials; + DWORD *pAdjacency; + + LPD3DXSKININFO pSkinInfo; + + struct _D3DXMESHCONTAINER *pNextMeshContainer; +} D3DXMESHCONTAINER, *LPD3DXMESHCONTAINER; + +//---------------------------------------------------------------------------- +// D3DXFRAME: +// ---------- +// This struct is the encapsulates a transform frame in a transformation frame +// hierarchy. The app can derive from this structure to add other app specific +// data to this +//---------------------------------------------------------------------------- +typedef struct _D3DXFRAME +{ + LPSTR Name; + D3DXMATRIX TransformationMatrix; + + LPD3DXMESHCONTAINER pMeshContainer; + + struct _D3DXFRAME *pFrameSibling; + struct _D3DXFRAME *pFrameFirstChild; +} D3DXFRAME, *LPD3DXFRAME; + + +//---------------------------------------------------------------------------- +// ID3DXAllocateHierarchy: +// ----------------------- +// This interface is implemented by the application to allocate/free frame and +// mesh container objects. Methods on this are called during loading and +// destroying frame hierarchies +//---------------------------------------------------------------------------- +typedef interface ID3DXAllocateHierarchy ID3DXAllocateHierarchy; +typedef interface ID3DXAllocateHierarchy *LPD3DXALLOCATEHIERARCHY; + +#undef INTERFACE +#define INTERFACE ID3DXAllocateHierarchy + +DECLARE_INTERFACE(ID3DXAllocateHierarchy) +{ + // ID3DXAllocateHierarchy + + //------------------------------------------------------------------------ + // CreateFrame: + // ------------ + // Requests allocation of a frame object. + // + // Parameters: + // Name + // Name of the frame to be created + // ppNewFrame + // Returns the created frame object + // + //------------------------------------------------------------------------ + STDMETHOD(CreateFrame)(THIS_ LPCSTR Name, + LPD3DXFRAME *ppNewFrame) PURE; + + //------------------------------------------------------------------------ + // CreateMeshContainer: + // -------------------- + // Requests allocation of a mesh container object. + // + // Parameters: + // Name + // Name of the mesh + // pMesh + // Pointer to the mesh object if basic polygon data found + // pPMesh + // Pointer to the progressive mesh object if progressive mesh data found + // pPatchMesh + // Pointer to the patch mesh object if patch data found + // pMaterials + // Array of materials used in the mesh + // pEffectInstances + // Array of effect instances used in the mesh + // NumMaterials + // Num elements in the pMaterials array + // pAdjacency + // Adjacency array for the mesh + // pSkinInfo + // Pointer to the skininfo object if the mesh is skinned + // pBoneNames + // Array of names, one for each bone in the skinned mesh. + // The numberof bones can be found from the pSkinMesh object + // pBoneOffsetMatrices + // Array of matrices, one for each bone in the skinned mesh. + // + //------------------------------------------------------------------------ + STDMETHOD(CreateMeshContainer)(THIS_ + LPCSTR Name, + CONST D3DXMESHDATA *pMeshData, + CONST D3DXMATERIAL *pMaterials, + CONST D3DXEFFECTINSTANCE *pEffectInstances, + DWORD NumMaterials, + CONST DWORD *pAdjacency, + LPD3DXSKININFO pSkinInfo, + LPD3DXMESHCONTAINER *ppNewMeshContainer) PURE; + + //------------------------------------------------------------------------ + // DestroyFrame: + // ------------- + // Requests de-allocation of a frame object. + // + // Parameters: + // pFrameToFree + // Pointer to the frame to be de-allocated + // + //------------------------------------------------------------------------ + STDMETHOD(DestroyFrame)(THIS_ LPD3DXFRAME pFrameToFree) PURE; + + //------------------------------------------------------------------------ + // DestroyMeshContainer: + // --------------------- + // Requests de-allocation of a mesh container object. + // + // Parameters: + // pMeshContainerToFree + // Pointer to the mesh container object to be de-allocated + // + //------------------------------------------------------------------------ + STDMETHOD(DestroyMeshContainer)(THIS_ LPD3DXMESHCONTAINER pMeshContainerToFree) PURE; +}; + +//---------------------------------------------------------------------------- +// ID3DXLoadUserData: +// ------------------ +// This interface is implemented by the application to load user data in a .X file +// When user data is found, these callbacks will be used to allow the application +// to load the data. +//---------------------------------------------------------------------------- +typedef interface ID3DXLoadUserData ID3DXLoadUserData; +typedef interface ID3DXLoadUserData *LPD3DXLOADUSERDATA; + +#undef INTERFACE +#define INTERFACE ID3DXLoadUserData + +DECLARE_INTERFACE(ID3DXLoadUserData) +{ + STDMETHOD(LoadTopLevelData)(LPD3DXFILEDATA pXofChildData) PURE; + + STDMETHOD(LoadFrameChildData)(LPD3DXFRAME pFrame, + LPD3DXFILEDATA pXofChildData) PURE; + + STDMETHOD(LoadMeshChildData)(LPD3DXMESHCONTAINER pMeshContainer, + LPD3DXFILEDATA pXofChildData) PURE; +}; + +//---------------------------------------------------------------------------- +// ID3DXSaveUserData: +// ------------------ +// This interface is implemented by the application to save user data in a .X file +// The callbacks are called for all data saved. The user can then add any +// child data objects to the object provided to the callback. +//---------------------------------------------------------------------------- +typedef interface ID3DXSaveUserData ID3DXSaveUserData; +typedef interface ID3DXSaveUserData *LPD3DXSAVEUSERDATA; + +#undef INTERFACE +#define INTERFACE ID3DXSaveUserData + +DECLARE_INTERFACE(ID3DXSaveUserData) +{ + STDMETHOD(AddFrameChildData)(CONST D3DXFRAME *pFrame, + LPD3DXFILESAVEOBJECT pXofSave, + LPD3DXFILESAVEDATA pXofFrameData) PURE; + + STDMETHOD(AddMeshChildData)(CONST D3DXMESHCONTAINER *pMeshContainer, + LPD3DXFILESAVEOBJECT pXofSave, + LPD3DXFILESAVEDATA pXofMeshData) PURE; + + // NOTE: this is called once per Save. All top level objects should be added using the + // provided interface. One call adds objects before the frame hierarchy, the other after + STDMETHOD(AddTopLevelDataObjectsPre)(LPD3DXFILESAVEOBJECT pXofSave) PURE; + STDMETHOD(AddTopLevelDataObjectsPost)(LPD3DXFILESAVEOBJECT pXofSave) PURE; + + // callbacks for the user to register and then save templates to the XFile + STDMETHOD(RegisterTemplates)(LPD3DXFILE pXFileApi) PURE; + STDMETHOD(SaveTemplates)(LPD3DXFILESAVEOBJECT pXofSave) PURE; +}; + + +//---------------------------------------------------------------------------- +// D3DXCALLBACK_SEARCH_FLAGS: +// -------------------------- +// Flags that can be passed into ID3DXAnimationSet::GetCallback. +//---------------------------------------------------------------------------- +typedef enum _D3DXCALLBACK_SEARCH_FLAGS +{ + D3DXCALLBACK_SEARCH_EXCLUDING_INITIAL_POSITION = 0x01, // exclude callbacks at the initial position from the search + D3DXCALLBACK_SEARCH_BEHIND_INITIAL_POSITION = 0x02, // reverse the callback search direction + + D3DXCALLBACK_SEARCH_FORCE_DWORD = 0x7fffffff, +} D3DXCALLBACK_SEARCH_FLAGS; + +//---------------------------------------------------------------------------- +// ID3DXAnimationSet: +// ------------------ +// This interface implements an animation set. +//---------------------------------------------------------------------------- +typedef interface ID3DXAnimationSet ID3DXAnimationSet; +typedef interface ID3DXAnimationSet *LPD3DXANIMATIONSET; + +#undef INTERFACE +#define INTERFACE ID3DXAnimationSet + +DECLARE_INTERFACE_(ID3DXAnimationSet, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Name + STDMETHOD_(LPCSTR, GetName)(THIS) PURE; + + // Period + STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; + STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period + + // Animation names + STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; + STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE; + STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE; + + // SRT + STDMETHOD(GetSRT)(THIS_ + DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition) + UINT Animation, // Animation index + D3DXVECTOR3 *pScale, // Returns the scale + D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion + D3DXVECTOR3 *pTranslation) PURE; // Returns the translation + + // Callbacks + STDMETHOD(GetCallback)(THIS_ + DOUBLE Position, // Position from which to find callbacks + DWORD Flags, // Callback search flags + DOUBLE *pCallbackPosition, // Returns the position of the callback + LPVOID *ppCallbackData) PURE; // Returns the callback data pointer +}; + + +//---------------------------------------------------------------------------- +// D3DXPLAYBACK_TYPE: +// ------------------ +// This enum defines the type of animation set loop modes. +//---------------------------------------------------------------------------- +typedef enum _D3DXPLAYBACK_TYPE +{ + D3DXPLAY_LOOP = 0, + D3DXPLAY_ONCE = 1, + D3DXPLAY_PINGPONG = 2, + + D3DXPLAY_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DXPLAYBACK_TYPE; + + +//---------------------------------------------------------------------------- +// D3DXKEY_VECTOR3: +// ---------------- +// This structure describes a vector key for use in keyframe animation. +// It specifies a vector Value at a given Time. This is used for scale and +// translation keys. +//---------------------------------------------------------------------------- +typedef struct _D3DXKEY_VECTOR3 +{ + FLOAT Time; + D3DXVECTOR3 Value; +} D3DXKEY_VECTOR3, *LPD3DXKEY_VECTOR3; + + +//---------------------------------------------------------------------------- +// D3DXKEY_QUATERNION: +// ------------------- +// This structure describes a quaternion key for use in keyframe animation. +// It specifies a quaternion Value at a given Time. This is used for rotation +// keys. +//---------------------------------------------------------------------------- +typedef struct _D3DXKEY_QUATERNION +{ + FLOAT Time; + D3DXQUATERNION Value; +} D3DXKEY_QUATERNION, *LPD3DXKEY_QUATERNION; + + +//---------------------------------------------------------------------------- +// D3DXKEY_CALLBACK: +// ----------------- +// This structure describes an callback key for use in keyframe animation. +// It specifies a pointer to user data at a given Time. +//---------------------------------------------------------------------------- +typedef struct _D3DXKEY_CALLBACK +{ + FLOAT Time; + LPVOID pCallbackData; +} D3DXKEY_CALLBACK, *LPD3DXKEY_CALLBACK; + + +//---------------------------------------------------------------------------- +// D3DXCOMPRESSION_FLAGS: +// ---------------------- +// Flags that can be passed into ID3DXKeyframedAnimationSet::Compress. +//---------------------------------------------------------------------------- +typedef enum _D3DXCOMPRESSION_FLAGS +{ + D3DXCOMPRESS_DEFAULT = 0x00, + + D3DXCOMPRESS_FORCE_DWORD = 0x7fffffff, +} D3DXCOMPRESSION_FLAGS; + + +//---------------------------------------------------------------------------- +// ID3DXKeyframedAnimationSet: +// --------------------------- +// This interface implements a compressable keyframed animation set. +//---------------------------------------------------------------------------- +typedef interface ID3DXKeyframedAnimationSet ID3DXKeyframedAnimationSet; +typedef interface ID3DXKeyframedAnimationSet *LPD3DXKEYFRAMEDANIMATIONSET; + +#undef INTERFACE +#define INTERFACE ID3DXKeyframedAnimationSet + +DECLARE_INTERFACE_(ID3DXKeyframedAnimationSet, ID3DXAnimationSet) +{ + // ID3DXAnimationSet + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Name + STDMETHOD_(LPCSTR, GetName)(THIS) PURE; + + // Period + STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; + STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period + + // Animation names + STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; + STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE; + STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE; + + // SRT + STDMETHOD(GetSRT)(THIS_ + DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition) + UINT Animation, // Animation index + D3DXVECTOR3 *pScale, // Returns the scale + D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion + D3DXVECTOR3 *pTranslation) PURE; // Returns the translation + + // Callbacks + STDMETHOD(GetCallback)(THIS_ + DOUBLE Position, // Position from which to find callbacks + DWORD Flags, // Callback search flags + DOUBLE *pCallbackPosition, // Returns the position of the callback + LPVOID *ppCallbackData) PURE; // Returns the callback data pointer + + // Playback + STDMETHOD_(D3DXPLAYBACK_TYPE, GetPlaybackType)(THIS) PURE; + STDMETHOD_(DOUBLE, GetSourceTicksPerSecond)(THIS) PURE; + + // Scale keys + STDMETHOD_(UINT, GetNumScaleKeys)(THIS_ UINT Animation) PURE; + STDMETHOD(GetScaleKeys)(THIS_ UINT Animation, LPD3DXKEY_VECTOR3 pScaleKeys) PURE; + STDMETHOD(GetScaleKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pScaleKey) PURE; + STDMETHOD(SetScaleKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pScaleKey) PURE; + + // Rotation keys + STDMETHOD_(UINT, GetNumRotationKeys)(THIS_ UINT Animation) PURE; + STDMETHOD(GetRotationKeys)(THIS_ UINT Animation, LPD3DXKEY_QUATERNION pRotationKeys) PURE; + STDMETHOD(GetRotationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_QUATERNION pRotationKey) PURE; + STDMETHOD(SetRotationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_QUATERNION pRotationKey) PURE; + + // Translation keys + STDMETHOD_(UINT, GetNumTranslationKeys)(THIS_ UINT Animation) PURE; + STDMETHOD(GetTranslationKeys)(THIS_ UINT Animation, LPD3DXKEY_VECTOR3 pTranslationKeys) PURE; + STDMETHOD(GetTranslationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pTranslationKey) PURE; + STDMETHOD(SetTranslationKey)(THIS_ UINT Animation, UINT Key, LPD3DXKEY_VECTOR3 pTranslationKey) PURE; + + // Callback keys + STDMETHOD_(UINT, GetNumCallbackKeys)(THIS) PURE; + STDMETHOD(GetCallbackKeys)(THIS_ LPD3DXKEY_CALLBACK pCallbackKeys) PURE; + STDMETHOD(GetCallbackKey)(THIS_ UINT Key, LPD3DXKEY_CALLBACK pCallbackKey) PURE; + STDMETHOD(SetCallbackKey)(THIS_ UINT Key, LPD3DXKEY_CALLBACK pCallbackKey) PURE; + + // Key removal methods. These are slow, and should not be used once the animation starts playing + STDMETHOD(UnregisterScaleKey)(THIS_ UINT Animation, UINT Key) PURE; + STDMETHOD(UnregisterRotationKey)(THIS_ UINT Animation, UINT Key) PURE; + STDMETHOD(UnregisterTranslationKey)(THIS_ UINT Animation, UINT Key) PURE; + + // One-time animaton SRT keyframe registration + STDMETHOD(RegisterAnimationSRTKeys)(THIS_ + LPCSTR pName, // Animation name + UINT NumScaleKeys, // Number of scale keys + UINT NumRotationKeys, // Number of rotation keys + UINT NumTranslationKeys, // Number of translation keys + CONST D3DXKEY_VECTOR3 *pScaleKeys, // Array of scale keys + CONST D3DXKEY_QUATERNION *pRotationKeys, // Array of rotation keys + CONST D3DXKEY_VECTOR3 *pTranslationKeys, // Array of translation keys + DWORD *pAnimationIndex) PURE; // Returns the animation index + + // Compression + STDMETHOD(Compress)(THIS_ + DWORD Flags, // Compression flags (use D3DXCOMPRESS_STRONG for better results) + FLOAT Lossiness, // Compression loss ratio in the [0, 1] range + LPD3DXFRAME pHierarchy, // Frame hierarchy (optional) + LPD3DXBUFFER *ppCompressedData) PURE; // Returns the compressed animation set + + STDMETHOD(UnregisterAnimation)(THIS_ UINT Index) PURE; +}; + + +//---------------------------------------------------------------------------- +// ID3DXCompressedAnimationSet: +// ---------------------------- +// This interface implements a compressed keyframed animation set. +//---------------------------------------------------------------------------- +typedef interface ID3DXCompressedAnimationSet ID3DXCompressedAnimationSet; +typedef interface ID3DXCompressedAnimationSet *LPD3DXCOMPRESSEDANIMATIONSET; + +#undef INTERFACE +#define INTERFACE ID3DXCompressedAnimationSet + +DECLARE_INTERFACE_(ID3DXCompressedAnimationSet, ID3DXAnimationSet) +{ + // ID3DXAnimationSet + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Name + STDMETHOD_(LPCSTR, GetName)(THIS) PURE; + + // Period + STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; + STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE Position) PURE; // Maps position into animation period + + // Animation names + STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; + STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT Index, LPCSTR *ppName) PURE; + STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR pName, UINT *pIndex) PURE; + + // SRT + STDMETHOD(GetSRT)(THIS_ + DOUBLE PeriodicPosition, // Position mapped to period (use GetPeriodicPosition) + UINT Animation, // Animation index + D3DXVECTOR3 *pScale, // Returns the scale + D3DXQUATERNION *pRotation, // Returns the rotation as a quaternion + D3DXVECTOR3 *pTranslation) PURE; // Returns the translation + + // Callbacks + STDMETHOD(GetCallback)(THIS_ + DOUBLE Position, // Position from which to find callbacks + DWORD Flags, // Callback search flags + DOUBLE *pCallbackPosition, // Returns the position of the callback + LPVOID *ppCallbackData) PURE; // Returns the callback data pointer + + // Playback + STDMETHOD_(D3DXPLAYBACK_TYPE, GetPlaybackType)(THIS) PURE; + STDMETHOD_(DOUBLE, GetSourceTicksPerSecond)(THIS) PURE; + + // Scale keys + STDMETHOD(GetCompressedData)(THIS_ LPD3DXBUFFER *ppCompressedData) PURE; + + // Callback keys + STDMETHOD_(UINT, GetNumCallbackKeys)(THIS) PURE; + STDMETHOD(GetCallbackKeys)(THIS_ LPD3DXKEY_CALLBACK pCallbackKeys) PURE; +}; + + +//---------------------------------------------------------------------------- +// D3DXPRIORITY_TYPE: +// ------------------ +// This enum defines the type of priority group that a track can be assigned to. +//---------------------------------------------------------------------------- +typedef enum _D3DXPRIORITY_TYPE { + D3DXPRIORITY_LOW = 0, // This track should be blended with all low priority tracks before mixed with the high priority result + D3DXPRIORITY_HIGH = 1, // This track should be blended with all high priority tracks before mixed with the low priority result + + D3DXPRIORITY_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DXPRIORITY_TYPE; + +//---------------------------------------------------------------------------- +// D3DXTRACK_DESC: +// --------------- +// This structure describes the mixing information of an animation track. +// The mixing information consists of the current position, speed, and blending +// weight for the track. The Flags field also specifies whether the track is +// low or high priority. Tracks with the same priority are blended together +// and then the two resulting values are blended using the priority blend factor. +// A track also has an animation set (stored separately) associated with it. +//---------------------------------------------------------------------------- +typedef struct _D3DXTRACK_DESC +{ + D3DXPRIORITY_TYPE Priority; + FLOAT Weight; + FLOAT Speed; + DOUBLE Position; + BOOL Enable; +} D3DXTRACK_DESC, *LPD3DXTRACK_DESC; + +//---------------------------------------------------------------------------- +// D3DXEVENT_TYPE: +// --------------- +// This enum defines the type of events keyable via the animation controller. +//---------------------------------------------------------------------------- +typedef enum _D3DXEVENT_TYPE +{ + D3DXEVENT_TRACKSPEED = 0, + D3DXEVENT_TRACKWEIGHT = 1, + D3DXEVENT_TRACKPOSITION = 2, + D3DXEVENT_TRACKENABLE = 3, + D3DXEVENT_PRIORITYBLEND = 4, + + D3DXEVENT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DXEVENT_TYPE; + +//---------------------------------------------------------------------------- +// D3DXTRANSITION_TYPE: +// -------------------- +// This enum defines the type of transtion performed on a event that +// transitions from one value to another. +//---------------------------------------------------------------------------- +typedef enum _D3DXTRANSITION_TYPE { + D3DXTRANSITION_LINEAR = 0x000, // Linear transition from one value to the next + D3DXTRANSITION_EASEINEASEOUT = 0x001, // Ease-In Ease-Out spline transtion from one value to the next + + D3DXTRANSITION_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DXTRANSITION_TYPE; + +//---------------------------------------------------------------------------- +// D3DXEVENT_DESC: +// --------------- +// This structure describes a animation controller event. +// It gives the event's type, track (if the event is a track event), global +// start time, duration, transition method, and target value. +//---------------------------------------------------------------------------- +typedef struct _D3DXEVENT_DESC +{ + D3DXEVENT_TYPE Type; + UINT Track; + DOUBLE StartTime; + DOUBLE Duration; + D3DXTRANSITION_TYPE Transition; + union + { + FLOAT Weight; + FLOAT Speed; + DOUBLE Position; + BOOL Enable; + }; +} D3DXEVENT_DESC, *LPD3DXEVENT_DESC; + +//---------------------------------------------------------------------------- +// D3DXEVENTHANDLE: +// ---------------- +// Handle values used to efficiently reference animation controller events. +//---------------------------------------------------------------------------- +typedef DWORD D3DXEVENTHANDLE; +typedef D3DXEVENTHANDLE *LPD3DXEVENTHANDLE; + + +//---------------------------------------------------------------------------- +// ID3DXAnimationCallbackHandler: +// ------------------------------ +// This interface is intended to be implemented by the application, and can +// be used to handle callbacks in animation sets generated when +// ID3DXAnimationController::AdvanceTime() is called. +//---------------------------------------------------------------------------- +typedef interface ID3DXAnimationCallbackHandler ID3DXAnimationCallbackHandler; +typedef interface ID3DXAnimationCallbackHandler *LPD3DXANIMATIONCALLBACKHANDLER; + +#undef INTERFACE +#define INTERFACE ID3DXAnimationCallbackHandler + +DECLARE_INTERFACE(ID3DXAnimationCallbackHandler) +{ + //---------------------------------------------------------------------------- + // ID3DXAnimationCallbackHandler::HandleCallback: + // ---------------------------------------------- + // This method gets called when a callback occurs for an animation set in one + // of the tracks during the ID3DXAnimationController::AdvanceTime() call. + // + // Parameters: + // Track + // Index of the track on which the callback occured. + // pCallbackData + // Pointer to user owned callback data. + // + //---------------------------------------------------------------------------- + STDMETHOD(HandleCallback)(THIS_ UINT Track, LPVOID pCallbackData) PURE; +}; + + +//---------------------------------------------------------------------------- +// ID3DXAnimationController: +// ------------------------- +// This interface implements the main animation functionality. It connects +// animation sets with the transform frames that are being animated. Allows +// mixing multiple animations for blended animations or for transistions +// It adds also has methods to modify blending parameters over time to +// enable smooth transistions and other effects. +//---------------------------------------------------------------------------- +typedef interface ID3DXAnimationController ID3DXAnimationController; +typedef interface ID3DXAnimationController *LPD3DXANIMATIONCONTROLLER; + +#undef INTERFACE +#define INTERFACE ID3DXAnimationController + +DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Max sizes + STDMETHOD_(UINT, GetMaxNumAnimationOutputs)(THIS) PURE; + STDMETHOD_(UINT, GetMaxNumAnimationSets)(THIS) PURE; + STDMETHOD_(UINT, GetMaxNumTracks)(THIS) PURE; + STDMETHOD_(UINT, GetMaxNumEvents)(THIS) PURE; + + // Animation output registration + STDMETHOD(RegisterAnimationOutput)(THIS_ + LPCSTR pName, + D3DXMATRIX *pMatrix, + D3DXVECTOR3 *pScale, + D3DXQUATERNION *pRotation, + D3DXVECTOR3 *pTranslation) PURE; + + // Animation set registration + STDMETHOD(RegisterAnimationSet)(THIS_ LPD3DXANIMATIONSET pAnimSet) PURE; + STDMETHOD(UnregisterAnimationSet)(THIS_ LPD3DXANIMATIONSET pAnimSet) PURE; + + STDMETHOD_(UINT, GetNumAnimationSets)(THIS) PURE; + STDMETHOD(GetAnimationSet)(THIS_ UINT Index, LPD3DXANIMATIONSET *ppAnimationSet) PURE; + STDMETHOD(GetAnimationSetByName)(THIS_ LPCSTR szName, LPD3DXANIMATIONSET *ppAnimationSet) PURE; + + // Global time + STDMETHOD(AdvanceTime)(THIS_ DOUBLE TimeDelta, LPD3DXANIMATIONCALLBACKHANDLER pCallbackHandler) PURE; + STDMETHOD(ResetTime)(THIS) PURE; + STDMETHOD_(DOUBLE, GetTime)(THIS) PURE; + + // Tracks + STDMETHOD(SetTrackAnimationSet)(THIS_ UINT Track, LPD3DXANIMATIONSET pAnimSet) PURE; + STDMETHOD(GetTrackAnimationSet)(THIS_ UINT Track, LPD3DXANIMATIONSET *ppAnimSet) PURE; + + STDMETHOD(SetTrackPriority)(THIS_ UINT Track, D3DXPRIORITY_TYPE Priority) PURE; + + STDMETHOD(SetTrackSpeed)(THIS_ UINT Track, FLOAT Speed) PURE; + STDMETHOD(SetTrackWeight)(THIS_ UINT Track, FLOAT Weight) PURE; + STDMETHOD(SetTrackPosition)(THIS_ UINT Track, DOUBLE Position) PURE; + STDMETHOD(SetTrackEnable)(THIS_ UINT Track, BOOL Enable) PURE; + + STDMETHOD(SetTrackDesc)(THIS_ UINT Track, LPD3DXTRACK_DESC pDesc) PURE; + STDMETHOD(GetTrackDesc)(THIS_ UINT Track, LPD3DXTRACK_DESC pDesc) PURE; + + // Priority blending + STDMETHOD(SetPriorityBlend)(THIS_ FLOAT BlendWeight) PURE; + STDMETHOD_(FLOAT, GetPriorityBlend)(THIS) PURE; + + // Event keying + STDMETHOD_(D3DXEVENTHANDLE, KeyTrackSpeed)(THIS_ UINT Track, FLOAT NewSpeed, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE; + STDMETHOD_(D3DXEVENTHANDLE, KeyTrackWeight)(THIS_ UINT Track, FLOAT NewWeight, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE; + STDMETHOD_(D3DXEVENTHANDLE, KeyTrackPosition)(THIS_ UINT Track, DOUBLE NewPosition, DOUBLE StartTime) PURE; + STDMETHOD_(D3DXEVENTHANDLE, KeyTrackEnable)(THIS_ UINT Track, BOOL NewEnable, DOUBLE StartTime) PURE; + + STDMETHOD_(D3DXEVENTHANDLE, KeyPriorityBlend)(THIS_ FLOAT NewBlendWeight, DOUBLE StartTime, DOUBLE Duration, D3DXTRANSITION_TYPE Transition) PURE; + + // Event unkeying + STDMETHOD(UnkeyEvent)(THIS_ D3DXEVENTHANDLE hEvent) PURE; + + STDMETHOD(UnkeyAllTrackEvents)(THIS_ UINT Track) PURE; + STDMETHOD(UnkeyAllPriorityBlends)(THIS) PURE; + + // Event enumeration + STDMETHOD_(D3DXEVENTHANDLE, GetCurrentTrackEvent)(THIS_ UINT Track, D3DXEVENT_TYPE EventType) PURE; + STDMETHOD_(D3DXEVENTHANDLE, GetCurrentPriorityBlend)(THIS) PURE; + + STDMETHOD_(D3DXEVENTHANDLE, GetUpcomingTrackEvent)(THIS_ UINT Track, D3DXEVENTHANDLE hEvent) PURE; + STDMETHOD_(D3DXEVENTHANDLE, GetUpcomingPriorityBlend)(THIS_ D3DXEVENTHANDLE hEvent) PURE; + + STDMETHOD(ValidateEvent)(THIS_ D3DXEVENTHANDLE hEvent) PURE; + + STDMETHOD(GetEventDesc)(THIS_ D3DXEVENTHANDLE hEvent, LPD3DXEVENT_DESC pDesc) PURE; + + // Cloning + STDMETHOD(CloneAnimationController)(THIS_ + UINT MaxNumAnimationOutputs, + UINT MaxNumAnimationSets, + UINT MaxNumTracks, + UINT MaxNumEvents, + LPD3DXANIMATIONCONTROLLER *ppAnimController) PURE; +}; + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +//---------------------------------------------------------------------------- +// D3DXLoadMeshHierarchyFromX: +// --------------------------- +// Loads the first frame hierarchy in a .X file. +// +// Parameters: +// Filename +// Name of the .X file +// MeshOptions +// Mesh creation options for meshes in the file (see d3dx9mesh.h) +// pD3DDevice +// D3D9 device on which meshes in the file are created in +// pAlloc +// Allocation interface used to allocate nodes of the frame hierarchy +// pUserDataLoader +// Application provided interface to allow loading of user data +// ppFrameHierarchy +// Returns root node pointer of the loaded frame hierarchy +// ppAnimController +// Returns pointer to an animation controller corresponding to animation +// in the .X file. This is created with default max tracks and events +// +//---------------------------------------------------------------------------- +HRESULT WINAPI +D3DXLoadMeshHierarchyFromXA + ( + LPCSTR Filename, + DWORD MeshOptions, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXALLOCATEHIERARCHY pAlloc, + LPD3DXLOADUSERDATA pUserDataLoader, + LPD3DXFRAME *ppFrameHierarchy, + LPD3DXANIMATIONCONTROLLER *ppAnimController + ); + +HRESULT WINAPI +D3DXLoadMeshHierarchyFromXW + ( + LPCWSTR Filename, + DWORD MeshOptions, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXALLOCATEHIERARCHY pAlloc, + LPD3DXLOADUSERDATA pUserDataLoader, + LPD3DXFRAME *ppFrameHierarchy, + LPD3DXANIMATIONCONTROLLER *ppAnimController + ); + +#ifdef UNICODE +#define D3DXLoadMeshHierarchyFromX D3DXLoadMeshHierarchyFromXW +#else +#define D3DXLoadMeshHierarchyFromX D3DXLoadMeshHierarchyFromXA +#endif + +HRESULT WINAPI +D3DXLoadMeshHierarchyFromXInMemory + ( + LPCVOID Memory, + DWORD SizeOfMemory, + DWORD MeshOptions, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXALLOCATEHIERARCHY pAlloc, + LPD3DXLOADUSERDATA pUserDataLoader, + LPD3DXFRAME *ppFrameHierarchy, + LPD3DXANIMATIONCONTROLLER *ppAnimController + ); + +//---------------------------------------------------------------------------- +// D3DXSaveMeshHierarchyToFile: +// ---------------------------- +// Creates a .X file and saves the mesh hierarchy and corresponding animations +// in it +// +// Parameters: +// Filename +// Name of the .X file +// XFormat +// Format of the .X file (text or binary, compressed or not, etc) +// pFrameRoot +// Root node of the hierarchy to be saved +// pAnimController +// The animation controller whose animation sets are to be stored +// pUserDataSaver +// Application provided interface to allow adding of user data to +// data objects saved to .X file +// +//---------------------------------------------------------------------------- +HRESULT WINAPI +D3DXSaveMeshHierarchyToFileA + ( + LPCSTR Filename, + DWORD XFormat, + CONST D3DXFRAME *pFrameRoot, + LPD3DXANIMATIONCONTROLLER pAnimcontroller, + LPD3DXSAVEUSERDATA pUserDataSaver + ); + +HRESULT WINAPI +D3DXSaveMeshHierarchyToFileW + ( + LPCWSTR Filename, + DWORD XFormat, + CONST D3DXFRAME *pFrameRoot, + LPD3DXANIMATIONCONTROLLER pAnimController, + LPD3DXSAVEUSERDATA pUserDataSaver + ); + +#ifdef UNICODE +#define D3DXSaveMeshHierarchyToFile D3DXSaveMeshHierarchyToFileW +#else +#define D3DXSaveMeshHierarchyToFile D3DXSaveMeshHierarchyToFileA +#endif + +//---------------------------------------------------------------------------- +// D3DXFrameDestroy: +// ----------------- +// Destroys the subtree of frames under the root, including the root +// +// Parameters: +// pFrameRoot +// Pointer to the root node +// pAlloc +// Allocation interface used to de-allocate nodes of the frame hierarchy +// +//---------------------------------------------------------------------------- +HRESULT WINAPI +D3DXFrameDestroy + ( + LPD3DXFRAME pFrameRoot, + LPD3DXALLOCATEHIERARCHY pAlloc + ); + +//---------------------------------------------------------------------------- +// D3DXFrameAppendChild: +// --------------------- +// Add a child frame to a frame +// +// Parameters: +// pFrameParent +// Pointer to the parent node +// pFrameChild +// Pointer to the child node +// +//---------------------------------------------------------------------------- +HRESULT WINAPI +D3DXFrameAppendChild + ( + LPD3DXFRAME pFrameParent, + CONST D3DXFRAME *pFrameChild + ); + +//---------------------------------------------------------------------------- +// D3DXFrameFind: +// -------------- +// Finds a frame with the given name. Returns NULL if no frame found. +// +// Parameters: +// pFrameRoot +// Pointer to the root node +// Name +// Name of frame to find +// +//---------------------------------------------------------------------------- +LPD3DXFRAME WINAPI +D3DXFrameFind + ( + CONST D3DXFRAME *pFrameRoot, + LPCSTR Name + ); + +//---------------------------------------------------------------------------- +// D3DXFrameRegisterNamedMatrices: +// ------------------------------- +// Finds all frames that have non-null names and registers each of those frame +// matrices to the given animation controller +// +// Parameters: +// pFrameRoot +// Pointer to the root node +// pAnimController +// Pointer to the animation controller where the matrices are registered +// +//---------------------------------------------------------------------------- +HRESULT WINAPI +D3DXFrameRegisterNamedMatrices + ( + LPD3DXFRAME pFrameRoot, + LPD3DXANIMATIONCONTROLLER pAnimController + ); + +//---------------------------------------------------------------------------- +// D3DXFrameNumNamedMatrices: +// -------------------------- +// Counts number of frames in a subtree that have non-null names +// +// Parameters: +// pFrameRoot +// Pointer to the root node of the subtree +// Return Value: +// Count of frames +// +//---------------------------------------------------------------------------- +UINT WINAPI +D3DXFrameNumNamedMatrices + ( + CONST D3DXFRAME *pFrameRoot + ); + +//---------------------------------------------------------------------------- +// D3DXFrameCalculateBoundingSphere: +// --------------------------------- +// Computes the bounding sphere of all the meshes in the frame hierarchy. +// +// Parameters: +// pFrameRoot +// Pointer to the root node +// pObjectCenter +// Returns the center of the bounding sphere +// pObjectRadius +// Returns the radius of the bounding sphere +// +//---------------------------------------------------------------------------- +HRESULT WINAPI +D3DXFrameCalculateBoundingSphere + ( + CONST D3DXFRAME *pFrameRoot, + LPD3DXVECTOR3 pObjectCenter, + FLOAT *pObjectRadius + ); + + +//---------------------------------------------------------------------------- +// D3DXCreateKeyframedAnimationSet: +// -------------------------------- +// This function creates a compressable keyframed animations set interface. +// +// Parameters: +// pName +// Name of the animation set +// TicksPerSecond +// Number of keyframe ticks that elapse per second +// Playback +// Playback mode of keyframe looping +// NumAnimations +// Number of SRT animations +// NumCallbackKeys +// Number of callback keys +// pCallbackKeys +// Array of callback keys +// ppAnimationSet +// Returns the animation set interface +// +//----------------------------------------------------------------------------- +HRESULT WINAPI +D3DXCreateKeyframedAnimationSet + ( + LPCSTR pName, + DOUBLE TicksPerSecond, + D3DXPLAYBACK_TYPE Playback, + UINT NumAnimations, + UINT NumCallbackKeys, + CONST D3DXKEY_CALLBACK *pCallbackKeys, + LPD3DXKEYFRAMEDANIMATIONSET *ppAnimationSet + ); + + +//---------------------------------------------------------------------------- +// D3DXCreateCompressedAnimationSet: +// -------------------------------- +// This function creates a compressed animations set interface from +// compressed data. +// +// Parameters: +// pName +// Name of the animation set +// TicksPerSecond +// Number of keyframe ticks that elapse per second +// Playback +// Playback mode of keyframe looping +// pCompressedData +// Compressed animation SRT data +// NumCallbackKeys +// Number of callback keys +// pCallbackKeys +// Array of callback keys +// ppAnimationSet +// Returns the animation set interface +// +//----------------------------------------------------------------------------- +HRESULT WINAPI +D3DXCreateCompressedAnimationSet + ( + LPCSTR pName, + DOUBLE TicksPerSecond, + D3DXPLAYBACK_TYPE Playback, + LPD3DXBUFFER pCompressedData, + UINT NumCallbackKeys, + CONST D3DXKEY_CALLBACK *pCallbackKeys, + LPD3DXCOMPRESSEDANIMATIONSET *ppAnimationSet + ); + + +//---------------------------------------------------------------------------- +// D3DXCreateAnimationController: +// ------------------------------ +// This function creates an animation controller object. +// +// Parameters: +// MaxNumMatrices +// Maximum number of matrices that can be animated +// MaxNumAnimationSets +// Maximum number of animation sets that can be played +// MaxNumTracks +// Maximum number of animation sets that can be blended +// MaxNumEvents +// Maximum number of outstanding events that can be scheduled at any given time +// ppAnimController +// Returns the animation controller interface +// +//----------------------------------------------------------------------------- +HRESULT WINAPI +D3DXCreateAnimationController + ( + UINT MaxNumMatrices, + UINT MaxNumAnimationSets, + UINT MaxNumTracks, + UINT MaxNumEvents, + LPD3DXANIMATIONCONTROLLER *ppAnimController + ); + + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX9ANIM_H__ + + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dx9core.h b/Src/Decoder_H264_ALL/D3D/include/d3dx9core.h new file mode 100644 index 0000000..9cc3686 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dx9core.h @@ -0,0 +1,753 @@ +/////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9core.h +// Content: D3DX core types and functions +// +/////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#ifndef __D3DX9CORE_H__ +#define __D3DX9CORE_H__ + + +/////////////////////////////////////////////////////////////////////////// +// D3DX_SDK_VERSION: +// ----------------- +// This identifier is passed to D3DXCheckVersion in order to ensure that an +// application was built against the correct header files and lib files. +// This number is incremented whenever a header (or other) change would +// require applications to be rebuilt. If the version doesn't match, +// D3DXCheckVersion will return FALSE. (The number itself has no meaning.) +/////////////////////////////////////////////////////////////////////////// + +#define D3DX_VERSION 0x0902 + +#define D3DX_SDK_VERSION 42 + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +BOOL WINAPI + D3DXCheckVersion(UINT D3DSdkVersion, UINT D3DXSdkVersion); + +#ifdef __cplusplus +} +#endif //__cplusplus + + + +/////////////////////////////////////////////////////////////////////////// +// D3DXDebugMute +// Mutes D3DX and D3D debug spew (TRUE - mute, FALSE - not mute) +// +// returns previous mute value +// +/////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +BOOL WINAPI + D3DXDebugMute(BOOL Mute); + +#ifdef __cplusplus +} +#endif //__cplusplus + + +/////////////////////////////////////////////////////////////////////////// +// D3DXGetDriverLevel: +// Returns driver version information: +// +// 700 - DX7 level driver +// 800 - DX8 level driver +// 900 - DX9 level driver +/////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +UINT WINAPI + D3DXGetDriverLevel(LPDIRECT3DDEVICE9 pDevice); + +#ifdef __cplusplus +} +#endif //__cplusplus + + +/////////////////////////////////////////////////////////////////////////// +// ID3DXBuffer: +// ------------ +// The buffer object is used by D3DX to return arbitrary size data. +// +// GetBufferPointer - +// Returns a pointer to the beginning of the buffer. +// +// GetBufferSize - +// Returns the size of the buffer, in bytes. +/////////////////////////////////////////////////////////////////////////// + +typedef interface ID3DXBuffer ID3DXBuffer; +typedef interface ID3DXBuffer *LPD3DXBUFFER; + +// {8BA5FB08-5195-40e2-AC58-0D989C3A0102} +DEFINE_GUID(IID_ID3DXBuffer, +0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2); + +#undef INTERFACE +#define INTERFACE ID3DXBuffer + +DECLARE_INTERFACE_(ID3DXBuffer, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXBuffer + STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE; + STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE; +}; + + + +////////////////////////////////////////////////////////////////////////////// +// D3DXSPRITE flags: +// ----------------- +// D3DXSPRITE_DONOTSAVESTATE +// Specifies device state is not to be saved and restored in Begin/End. +// D3DXSPRITE_DONOTMODIFY_RENDERSTATE +// Specifies device render state is not to be changed in Begin. The device +// is assumed to be in a valid state to draw vertices containing POSITION0, +// TEXCOORD0, and COLOR0 data. +// D3DXSPRITE_OBJECTSPACE +// The WORLD, VIEW, and PROJECTION transforms are NOT modified. The +// transforms currently set to the device are used to transform the sprites +// when the batch is drawn (at Flush or End). If this is not specified, +// WORLD, VIEW, and PROJECTION transforms are modified so that sprites are +// drawn in screenspace coordinates. +// D3DXSPRITE_BILLBOARD +// Rotates each sprite about its center so that it is facing the viewer. +// D3DXSPRITE_ALPHABLEND +// Enables ALPHABLEND(SRCALPHA, INVSRCALPHA) and ALPHATEST(alpha > 0). +// ID3DXFont expects this to be set when drawing text. +// D3DXSPRITE_SORT_TEXTURE +// Sprites are sorted by texture prior to drawing. This is recommended when +// drawing non-overlapping sprites of uniform depth. For example, drawing +// screen-aligned text with ID3DXFont. +// D3DXSPRITE_SORT_DEPTH_FRONTTOBACK +// Sprites are sorted by depth front-to-back prior to drawing. This is +// recommended when drawing opaque sprites of varying depths. +// D3DXSPRITE_SORT_DEPTH_BACKTOFRONT +// Sprites are sorted by depth back-to-front prior to drawing. This is +// recommended when drawing transparent sprites of varying depths. +// D3DXSPRITE_DO_NOT_ADDREF_TEXTURE +// Disables calling AddRef() on every draw, and Release() on Flush() for +// better performance. +////////////////////////////////////////////////////////////////////////////// + +#define D3DXSPRITE_DONOTSAVESTATE (1 << 0) +#define D3DXSPRITE_DONOTMODIFY_RENDERSTATE (1 << 1) +#define D3DXSPRITE_OBJECTSPACE (1 << 2) +#define D3DXSPRITE_BILLBOARD (1 << 3) +#define D3DXSPRITE_ALPHABLEND (1 << 4) +#define D3DXSPRITE_SORT_TEXTURE (1 << 5) +#define D3DXSPRITE_SORT_DEPTH_FRONTTOBACK (1 << 6) +#define D3DXSPRITE_SORT_DEPTH_BACKTOFRONT (1 << 7) +#define D3DXSPRITE_DO_NOT_ADDREF_TEXTURE (1 << 8) + + +////////////////////////////////////////////////////////////////////////////// +// ID3DXSprite: +// ------------ +// This object intends to provide an easy way to drawing sprites using D3D. +// +// Begin - +// Prepares device for drawing sprites. +// +// Draw - +// Draws a sprite. Before transformation, the sprite is the size of +// SrcRect, with its top-left corner specified by Position. The color +// and alpha channels are modulated by Color. +// +// Flush - +// Forces all batched sprites to submitted to the device. +// +// End - +// Restores device state to how it was when Begin was called. +// +// OnLostDevice, OnResetDevice - +// Call OnLostDevice() on this object before calling Reset() on the +// device, so that this object can release any stateblocks and video +// memory resources. After Reset(), the call OnResetDevice(). +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3DXSprite ID3DXSprite; +typedef interface ID3DXSprite *LPD3DXSPRITE; + + +// {BA0B762D-7D28-43ec-B9DC-2F84443B0614} +DEFINE_GUID(IID_ID3DXSprite, +0xba0b762d, 0x7d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14); + + +#undef INTERFACE +#define INTERFACE ID3DXSprite + +DECLARE_INTERFACE_(ID3DXSprite, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXSprite + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + + STDMETHOD(GetTransform)(THIS_ D3DXMATRIX *pTransform) PURE; + STDMETHOD(SetTransform)(THIS_ CONST D3DXMATRIX *pTransform) PURE; + + STDMETHOD(SetWorldViewRH)(THIS_ CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) PURE; + STDMETHOD(SetWorldViewLH)(THIS_ CONST D3DXMATRIX *pWorld, CONST D3DXMATRIX *pView) PURE; + + STDMETHOD(Begin)(THIS_ DWORD Flags) PURE; + STDMETHOD(Draw)(THIS_ LPDIRECT3DTEXTURE9 pTexture, CONST RECT *pSrcRect, CONST D3DXVECTOR3 *pCenter, CONST D3DXVECTOR3 *pPosition, D3DCOLOR Color) PURE; + STDMETHOD(Flush)(THIS) PURE; + STDMETHOD(End)(THIS) PURE; + + STDMETHOD(OnLostDevice)(THIS) PURE; + STDMETHOD(OnResetDevice)(THIS) PURE; +}; + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI + D3DXCreateSprite( + LPDIRECT3DDEVICE9 pDevice, + LPD3DXSPRITE* ppSprite); + +#ifdef __cplusplus +} +#endif //__cplusplus + + + +////////////////////////////////////////////////////////////////////////////// +// ID3DXFont: +// ---------- +// Font objects contain the textures and resources needed to render a specific +// font on a specific device. +// +// GetGlyphData - +// Returns glyph cache data, for a given glyph. +// +// PreloadCharacters/PreloadGlyphs/PreloadText - +// Preloads glyphs into the glyph cache textures. +// +// DrawText - +// Draws formatted text on a D3D device. Some parameters are +// surprisingly similar to those of GDI's DrawText function. See GDI +// documentation for a detailed description of these parameters. +// If pSprite is NULL, an internal sprite object will be used. +// +// OnLostDevice, OnResetDevice - +// Call OnLostDevice() on this object before calling Reset() on the +// device, so that this object can release any stateblocks and video +// memory resources. After Reset(), the call OnResetDevice(). +////////////////////////////////////////////////////////////////////////////// + +typedef struct _D3DXFONT_DESCA +{ + INT Height; + UINT Width; + UINT Weight; + UINT MipLevels; + BOOL Italic; + BYTE CharSet; + BYTE OutputPrecision; + BYTE Quality; + BYTE PitchAndFamily; + CHAR FaceName[LF_FACESIZE]; + +} D3DXFONT_DESCA, *LPD3DXFONT_DESCA; + +typedef struct _D3DXFONT_DESCW +{ + INT Height; + UINT Width; + UINT Weight; + UINT MipLevels; + BOOL Italic; + BYTE CharSet; + BYTE OutputPrecision; + BYTE Quality; + BYTE PitchAndFamily; + WCHAR FaceName[LF_FACESIZE]; + +} D3DXFONT_DESCW, *LPD3DXFONT_DESCW; + +#ifdef UNICODE +typedef D3DXFONT_DESCW D3DXFONT_DESC; +typedef LPD3DXFONT_DESCW LPD3DXFONT_DESC; +#else +typedef D3DXFONT_DESCA D3DXFONT_DESC; +typedef LPD3DXFONT_DESCA LPD3DXFONT_DESC; +#endif + + +typedef interface ID3DXFont ID3DXFont; +typedef interface ID3DXFont *LPD3DXFONT; + + +// {D79DBB70-5F21-4d36-BBC2-FF525C213CDC} +DEFINE_GUID(IID_ID3DXFont, +0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc); + + +#undef INTERFACE +#define INTERFACE ID3DXFont + +DECLARE_INTERFACE_(ID3DXFont, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXFont + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *ppDevice) PURE; + STDMETHOD(GetDescA)(THIS_ D3DXFONT_DESCA *pDesc) PURE; + STDMETHOD(GetDescW)(THIS_ D3DXFONT_DESCW *pDesc) PURE; + STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *pTextMetrics) PURE; + STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *pTextMetrics) PURE; + + STDMETHOD_(HDC, GetDC)(THIS) PURE; + STDMETHOD(GetGlyphData)(THIS_ UINT Glyph, LPDIRECT3DTEXTURE9 *ppTexture, RECT *pBlackBox, POINT *pCellInc) PURE; + + STDMETHOD(PreloadCharacters)(THIS_ UINT First, UINT Last) PURE; + STDMETHOD(PreloadGlyphs)(THIS_ UINT First, UINT Last) PURE; + STDMETHOD(PreloadTextA)(THIS_ LPCSTR pString, INT Count) PURE; + STDMETHOD(PreloadTextW)(THIS_ LPCWSTR pString, INT Count) PURE; + + STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DXSPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE; + STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DXSPRITE pSprite, LPCWSTR pString, INT Count, LPRECT pRect, DWORD Format, D3DCOLOR Color) PURE; + + STDMETHOD(OnLostDevice)(THIS) PURE; + STDMETHOD(OnResetDevice)(THIS) PURE; + +#ifdef __cplusplus +#ifdef UNICODE + HRESULT GetDesc(D3DXFONT_DESCW *pDesc) { return GetDescW(pDesc); } + HRESULT PreloadText(LPCWSTR pString, INT Count) { return PreloadTextW(pString, Count); } +#else + HRESULT GetDesc(D3DXFONT_DESCA *pDesc) { return GetDescA(pDesc); } + HRESULT PreloadText(LPCSTR pString, INT Count) { return PreloadTextA(pString, Count); } +#endif +#endif //__cplusplus +}; + +#ifndef GetTextMetrics +#ifdef UNICODE +#define GetTextMetrics GetTextMetricsW +#else +#define GetTextMetrics GetTextMetricsA +#endif +#endif + +#ifndef DrawText +#ifdef UNICODE +#define DrawText DrawTextW +#else +#define DrawText DrawTextA +#endif +#endif + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +HRESULT WINAPI + D3DXCreateFontA( + LPDIRECT3DDEVICE9 pDevice, + INT Height, + UINT Width, + UINT Weight, + UINT MipLevels, + BOOL Italic, + DWORD CharSet, + DWORD OutputPrecision, + DWORD Quality, + DWORD PitchAndFamily, + LPCSTR pFaceName, + LPD3DXFONT* ppFont); + +HRESULT WINAPI + D3DXCreateFontW( + LPDIRECT3DDEVICE9 pDevice, + INT Height, + UINT Width, + UINT Weight, + UINT MipLevels, + BOOL Italic, + DWORD CharSet, + DWORD OutputPrecision, + DWORD Quality, + DWORD PitchAndFamily, + LPCWSTR pFaceName, + LPD3DXFONT* ppFont); + +#ifdef UNICODE +#define D3DXCreateFont D3DXCreateFontW +#else +#define D3DXCreateFont D3DXCreateFontA +#endif + + +HRESULT WINAPI + D3DXCreateFontIndirectA( + LPDIRECT3DDEVICE9 pDevice, + CONST D3DXFONT_DESCA* pDesc, + LPD3DXFONT* ppFont); + +HRESULT WINAPI + D3DXCreateFontIndirectW( + LPDIRECT3DDEVICE9 pDevice, + CONST D3DXFONT_DESCW* pDesc, + LPD3DXFONT* ppFont); + +#ifdef UNICODE +#define D3DXCreateFontIndirect D3DXCreateFontIndirectW +#else +#define D3DXCreateFontIndirect D3DXCreateFontIndirectA +#endif + + +#ifdef __cplusplus +} +#endif //__cplusplus + + + +/////////////////////////////////////////////////////////////////////////// +// ID3DXRenderToSurface: +// --------------------- +// This object abstracts rendering to surfaces. These surfaces do not +// necessarily need to be render targets. If they are not, a compatible +// render target is used, and the result copied into surface at end scene. +// +// BeginScene, EndScene - +// Call BeginScene() and EndScene() at the beginning and ending of your +// scene. These calls will setup and restore render targets, viewports, +// etc.. +// +// OnLostDevice, OnResetDevice - +// Call OnLostDevice() on this object before calling Reset() on the +// device, so that this object can release any stateblocks and video +// memory resources. After Reset(), the call OnResetDevice(). +/////////////////////////////////////////////////////////////////////////// + +typedef struct _D3DXRTS_DESC +{ + UINT Width; + UINT Height; + D3DFORMAT Format; + BOOL DepthStencil; + D3DFORMAT DepthStencilFormat; + +} D3DXRTS_DESC, *LPD3DXRTS_DESC; + + +typedef interface ID3DXRenderToSurface ID3DXRenderToSurface; +typedef interface ID3DXRenderToSurface *LPD3DXRENDERTOSURFACE; + + +// {6985F346-2C3D-43b3-BE8B-DAAE8A03D894} +DEFINE_GUID(IID_ID3DXRenderToSurface, +0x6985f346, 0x2c3d, 0x43b3, 0xbe, 0x8b, 0xda, 0xae, 0x8a, 0x3, 0xd8, 0x94); + + +#undef INTERFACE +#define INTERFACE ID3DXRenderToSurface + +DECLARE_INTERFACE_(ID3DXRenderToSurface, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXRenderToSurface + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + STDMETHOD(GetDesc)(THIS_ D3DXRTS_DESC* pDesc) PURE; + + STDMETHOD(BeginScene)(THIS_ LPDIRECT3DSURFACE9 pSurface, CONST D3DVIEWPORT9* pViewport) PURE; + STDMETHOD(EndScene)(THIS_ DWORD MipFilter) PURE; + + STDMETHOD(OnLostDevice)(THIS) PURE; + STDMETHOD(OnResetDevice)(THIS) PURE; +}; + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI + D3DXCreateRenderToSurface( + LPDIRECT3DDEVICE9 pDevice, + UINT Width, + UINT Height, + D3DFORMAT Format, + BOOL DepthStencil, + D3DFORMAT DepthStencilFormat, + LPD3DXRENDERTOSURFACE* ppRenderToSurface); + +#ifdef __cplusplus +} +#endif //__cplusplus + + + +/////////////////////////////////////////////////////////////////////////// +// ID3DXRenderToEnvMap: +// -------------------- +// This object abstracts rendering to environment maps. These surfaces +// do not necessarily need to be render targets. If they are not, a +// compatible render target is used, and the result copied into the +// environment map at end scene. +// +// BeginCube, BeginSphere, BeginHemisphere, BeginParabolic - +// This function initiates the rendering of the environment map. As +// parameters, you pass the textures in which will get filled in with +// the resulting environment map. +// +// Face - +// Call this function to initiate the drawing of each face. For each +// environment map, you will call this six times.. once for each face +// in D3DCUBEMAP_FACES. +// +// End - +// This will restore all render targets, and if needed compose all the +// rendered faces into the environment map surfaces. +// +// OnLostDevice, OnResetDevice - +// Call OnLostDevice() on this object before calling Reset() on the +// device, so that this object can release any stateblocks and video +// memory resources. After Reset(), the call OnResetDevice(). +/////////////////////////////////////////////////////////////////////////// + +typedef struct _D3DXRTE_DESC +{ + UINT Size; + UINT MipLevels; + D3DFORMAT Format; + BOOL DepthStencil; + D3DFORMAT DepthStencilFormat; + +} D3DXRTE_DESC, *LPD3DXRTE_DESC; + + +typedef interface ID3DXRenderToEnvMap ID3DXRenderToEnvMap; +typedef interface ID3DXRenderToEnvMap *LPD3DXRenderToEnvMap; + + +// {313F1B4B-C7B0-4fa2-9D9D-8D380B64385E} +DEFINE_GUID(IID_ID3DXRenderToEnvMap, +0x313f1b4b, 0xc7b0, 0x4fa2, 0x9d, 0x9d, 0x8d, 0x38, 0xb, 0x64, 0x38, 0x5e); + + +#undef INTERFACE +#define INTERFACE ID3DXRenderToEnvMap + +DECLARE_INTERFACE_(ID3DXRenderToEnvMap, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXRenderToEnvMap + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + STDMETHOD(GetDesc)(THIS_ D3DXRTE_DESC* pDesc) PURE; + + STDMETHOD(BeginCube)(THIS_ + LPDIRECT3DCUBETEXTURE9 pCubeTex) PURE; + + STDMETHOD(BeginSphere)(THIS_ + LPDIRECT3DTEXTURE9 pTex) PURE; + + STDMETHOD(BeginHemisphere)(THIS_ + LPDIRECT3DTEXTURE9 pTexZPos, + LPDIRECT3DTEXTURE9 pTexZNeg) PURE; + + STDMETHOD(BeginParabolic)(THIS_ + LPDIRECT3DTEXTURE9 pTexZPos, + LPDIRECT3DTEXTURE9 pTexZNeg) PURE; + + STDMETHOD(Face)(THIS_ D3DCUBEMAP_FACES Face, DWORD MipFilter) PURE; + STDMETHOD(End)(THIS_ DWORD MipFilter) PURE; + + STDMETHOD(OnLostDevice)(THIS) PURE; + STDMETHOD(OnResetDevice)(THIS) PURE; +}; + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI + D3DXCreateRenderToEnvMap( + LPDIRECT3DDEVICE9 pDevice, + UINT Size, + UINT MipLevels, + D3DFORMAT Format, + BOOL DepthStencil, + D3DFORMAT DepthStencilFormat, + LPD3DXRenderToEnvMap* ppRenderToEnvMap); + +#ifdef __cplusplus +} +#endif //__cplusplus + + + +/////////////////////////////////////////////////////////////////////////// +// ID3DXLine: +// ------------ +// This object intends to provide an easy way to draw lines using D3D. +// +// Begin - +// Prepares device for drawing lines +// +// Draw - +// Draws a line strip in screen-space. +// Input is in the form of a array defining points on the line strip. of D3DXVECTOR2 +// +// DrawTransform - +// Draws a line in screen-space with a specified input transformation matrix. +// +// End - +// Restores device state to how it was when Begin was called. +// +// SetPattern - +// Applies a stipple pattern to the line. Input is one 32-bit +// DWORD which describes the stipple pattern. 1 is opaque, 0 is +// transparent. +// +// SetPatternScale - +// Stretches the stipple pattern in the u direction. Input is one +// floating-point value. 0.0f is no scaling, whereas 1.0f doubles +// the length of the stipple pattern. +// +// SetWidth - +// Specifies the thickness of the line in the v direction. Input is +// one floating-point value. +// +// SetAntialias - +// Toggles line antialiasing. Input is a BOOL. +// TRUE = Antialiasing on. +// FALSE = Antialiasing off. +// +// SetGLLines - +// Toggles non-antialiased OpenGL line emulation. Input is a BOOL. +// TRUE = OpenGL line emulation on. +// FALSE = OpenGL line emulation off. +// +// OpenGL line: Regular line: +// *\ *\ +// | \ / \ +// | \ *\ \ +// *\ \ \ \ +// \ \ \ \ +// \ * \ * +// \ | \ / +// \| * +// * +// +// OnLostDevice, OnResetDevice - +// Call OnLostDevice() on this object before calling Reset() on the +// device, so that this object can release any stateblocks and video +// memory resources. After Reset(), the call OnResetDevice(). +/////////////////////////////////////////////////////////////////////////// + + +typedef interface ID3DXLine ID3DXLine; +typedef interface ID3DXLine *LPD3DXLINE; + + +// {D379BA7F-9042-4ac4-9F5E-58192A4C6BD8} +DEFINE_GUID(IID_ID3DXLine, +0xd379ba7f, 0x9042, 0x4ac4, 0x9f, 0x5e, 0x58, 0x19, 0x2a, 0x4c, 0x6b, 0xd8); + +#undef INTERFACE +#define INTERFACE ID3DXLine + +DECLARE_INTERFACE_(ID3DXLine, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXLine + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + + STDMETHOD(Begin)(THIS) PURE; + + STDMETHOD(Draw)(THIS_ CONST D3DXVECTOR2 *pVertexList, + DWORD dwVertexListCount, D3DCOLOR Color) PURE; + + STDMETHOD(DrawTransform)(THIS_ CONST D3DXVECTOR3 *pVertexList, + DWORD dwVertexListCount, CONST D3DXMATRIX* pTransform, + D3DCOLOR Color) PURE; + + STDMETHOD(SetPattern)(THIS_ DWORD dwPattern) PURE; + STDMETHOD_(DWORD, GetPattern)(THIS) PURE; + + STDMETHOD(SetPatternScale)(THIS_ FLOAT fPatternScale) PURE; + STDMETHOD_(FLOAT, GetPatternScale)(THIS) PURE; + + STDMETHOD(SetWidth)(THIS_ FLOAT fWidth) PURE; + STDMETHOD_(FLOAT, GetWidth)(THIS) PURE; + + STDMETHOD(SetAntialias)(THIS_ BOOL bAntialias) PURE; + STDMETHOD_(BOOL, GetAntialias)(THIS) PURE; + + STDMETHOD(SetGLLines)(THIS_ BOOL bGLLines) PURE; + STDMETHOD_(BOOL, GetGLLines)(THIS) PURE; + + STDMETHOD(End)(THIS) PURE; + + STDMETHOD(OnLostDevice)(THIS) PURE; + STDMETHOD(OnResetDevice)(THIS) PURE; +}; + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +HRESULT WINAPI + D3DXCreateLine( + LPDIRECT3DDEVICE9 pDevice, + LPD3DXLINE* ppLine); + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX9CORE_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dx9effect.h b/Src/Decoder_H264_ALL/D3D/include/d3dx9effect.h new file mode 100644 index 0000000..a3bcd30 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dx9effect.h @@ -0,0 +1,873 @@ + +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: d3dx9effect.h +// Content: D3DX effect types and Shaders +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#ifndef __D3DX9EFFECT_H__ +#define __D3DX9EFFECT_H__ + + +//---------------------------------------------------------------------------- +// D3DXFX_DONOTSAVESTATE +// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag +// is specified, device state is not saved or restored in Begin/End. +// D3DXFX_DONOTSAVESHADERSTATE +// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag +// is specified, shader device state is not saved or restored in Begin/End. +// This includes pixel/vertex shaders and shader constants +// D3DXFX_DONOTSAVESAMPLERSTATE +// This flag is used as a parameter to ID3DXEffect::Begin(). When this flag +// is specified, sampler device state is not saved or restored in Begin/End. +// D3DXFX_NOT_CLONEABLE +// This flag is used as a parameter to the D3DXCreateEffect family of APIs. +// When this flag is specified, the effect will be non-cloneable and will not +// contain any shader binary data. +// Furthermore, GetPassDesc will not return shader function pointers. +// Setting this flag reduces effect memory usage by about 50%. +//---------------------------------------------------------------------------- + +#define D3DXFX_DONOTSAVESTATE (1 << 0) +#define D3DXFX_DONOTSAVESHADERSTATE (1 << 1) +#define D3DXFX_DONOTSAVESAMPLERSTATE (1 << 2) + +#define D3DXFX_NOT_CLONEABLE (1 << 11) +#define D3DXFX_LARGEADDRESSAWARE (1 << 17) + +//---------------------------------------------------------------------------- +// D3DX_PARAMETER_SHARED +// Indicates that the value of a parameter will be shared with all effects +// which share the same namespace. Changing the value in one effect will +// change it in all. +// +// D3DX_PARAMETER_LITERAL +// Indicates that the value of this parameter can be treated as literal. +// Literal parameters can be marked when the effect is compiled, and their +// cannot be changed after the effect is compiled. Shared parameters cannot +// be literal. +//---------------------------------------------------------------------------- + +#define D3DX_PARAMETER_SHARED (1 << 0) +#define D3DX_PARAMETER_LITERAL (1 << 1) +#define D3DX_PARAMETER_ANNOTATION (1 << 2) + +//---------------------------------------------------------------------------- +// D3DXEFFECT_DESC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXEFFECT_DESC +{ + LPCSTR Creator; // Creator string + UINT Parameters; // Number of parameters + UINT Techniques; // Number of techniques + UINT Functions; // Number of function entrypoints + +} D3DXEFFECT_DESC; + + +//---------------------------------------------------------------------------- +// D3DXPARAMETER_DESC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXPARAMETER_DESC +{ + LPCSTR Name; // Parameter name + LPCSTR Semantic; // Parameter semantic + D3DXPARAMETER_CLASS Class; // Class + D3DXPARAMETER_TYPE Type; // Component type + UINT Rows; // Number of rows + UINT Columns; // Number of columns + UINT Elements; // Number of array elements + UINT Annotations; // Number of annotations + UINT StructMembers; // Number of structure member sub-parameters + DWORD Flags; // D3DX_PARAMETER_* flags + UINT Bytes; // Parameter size, in bytes + +} D3DXPARAMETER_DESC; + + +//---------------------------------------------------------------------------- +// D3DXTECHNIQUE_DESC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXTECHNIQUE_DESC +{ + LPCSTR Name; // Technique name + UINT Passes; // Number of passes + UINT Annotations; // Number of annotations + +} D3DXTECHNIQUE_DESC; + + +//---------------------------------------------------------------------------- +// D3DXPASS_DESC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXPASS_DESC +{ + LPCSTR Name; // Pass name + UINT Annotations; // Number of annotations + + CONST DWORD *pVertexShaderFunction; // Vertex shader function + CONST DWORD *pPixelShaderFunction; // Pixel shader function + +} D3DXPASS_DESC; + + +//---------------------------------------------------------------------------- +// D3DXFUNCTION_DESC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXFUNCTION_DESC +{ + LPCSTR Name; // Function name + UINT Annotations; // Number of annotations + +} D3DXFUNCTION_DESC; + + + +////////////////////////////////////////////////////////////////////////////// +// ID3DXEffectPool /////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3DXEffectPool ID3DXEffectPool; +typedef interface ID3DXEffectPool *LPD3DXEFFECTPOOL; + +// {9537AB04-3250-412e-8213-FCD2F8677933} +DEFINE_GUID(IID_ID3DXEffectPool, +0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33); + + +#undef INTERFACE +#define INTERFACE ID3DXEffectPool + +DECLARE_INTERFACE_(ID3DXEffectPool, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // No public methods +}; + + +////////////////////////////////////////////////////////////////////////////// +// ID3DXBaseEffect /////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3DXBaseEffect ID3DXBaseEffect; +typedef interface ID3DXBaseEffect *LPD3DXBASEEFFECT; + +// {017C18AC-103F-4417-8C51-6BF6EF1E56BE} +DEFINE_GUID(IID_ID3DXBaseEffect, +0x17c18ac, 0x103f, 0x4417, 0x8c, 0x51, 0x6b, 0xf6, 0xef, 0x1e, 0x56, 0xbe); + + +#undef INTERFACE +#define INTERFACE ID3DXBaseEffect + +DECLARE_INTERFACE_(ID3DXBaseEffect, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Descs + STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE; + STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE; + STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE; + STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE; + STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE; + + // Handle operations + STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE; + + // Get/Set Parameters + STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE; + STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE; + STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE; + STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE; + STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE; + STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE; + STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE; + STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE; + STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE; + STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE; + STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE; + STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE; + STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE; + STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE; + STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE; + STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE; + STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE; + STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE; + STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE; + STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE; + STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE; + STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE; + + //Set Range of an Array to pass to device + //Useful for sending only a subrange of an array down to the device + STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE; + +}; + + +//---------------------------------------------------------------------------- +// ID3DXEffectStateManager: +// ------------------------ +// This is a user implemented interface that can be used to manage device +// state changes made by an Effect. +//---------------------------------------------------------------------------- + +typedef interface ID3DXEffectStateManager ID3DXEffectStateManager; +typedef interface ID3DXEffectStateManager *LPD3DXEFFECTSTATEMANAGER; + +// {79AAB587-6DBC-4fa7-82DE-37FA1781C5CE} +DEFINE_GUID(IID_ID3DXEffectStateManager, +0x79aab587, 0x6dbc, 0x4fa7, 0x82, 0xde, 0x37, 0xfa, 0x17, 0x81, 0xc5, 0xce); + +#undef INTERFACE +#define INTERFACE ID3DXEffectStateManager + +DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown) +{ + // The user must correctly implement QueryInterface, AddRef, and Release. + + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // The following methods are called by the Effect when it wants to make + // the corresponding device call. Note that: + // 1. Users manage the state and are therefore responsible for making the + // the corresponding device calls themselves inside their callbacks. + // 2. Effects pay attention to the return values of the callbacks, and so + // users must pay attention to what they return in their callbacks. + + STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX *pMatrix) PURE; + STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9 *pMaterial) PURE; + STDMETHOD(SetLight)(THIS_ DWORD Index, CONST D3DLIGHT9 *pLight) PURE; + STDMETHOD(LightEnable)(THIS_ DWORD Index, BOOL Enable) PURE; + STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD Value) PURE; + STDMETHOD(SetTexture)(THIS_ DWORD Stage, LPDIRECT3DBASETEXTURE9 pTexture) PURE; + STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) PURE; + STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) PURE; + STDMETHOD(SetNPatchMode)(THIS_ FLOAT NumSegments) PURE; + STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; + STDMETHOD(SetVertexShader)(THIS_ LPDIRECT3DVERTEXSHADER9 pShader) PURE; + STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT RegisterIndex, CONST FLOAT *pConstantData, UINT RegisterCount) PURE; + STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT RegisterIndex, CONST INT *pConstantData, UINT RegisterCount) PURE; + STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT RegisterIndex, CONST BOOL *pConstantData, UINT RegisterCount) PURE; + STDMETHOD(SetPixelShader)(THIS_ LPDIRECT3DPIXELSHADER9 pShader) PURE; + STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT RegisterIndex, CONST FLOAT *pConstantData, UINT RegisterCount) PURE; + STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT RegisterIndex, CONST INT *pConstantData, UINT RegisterCount) PURE; + STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT RegisterIndex, CONST BOOL *pConstantData, UINT RegisterCount) PURE; +}; + + +////////////////////////////////////////////////////////////////////////////// +// ID3DXEffect /////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3DXEffect ID3DXEffect; +typedef interface ID3DXEffect *LPD3DXEFFECT; + +// {F6CEB4B3-4E4C-40dd-B883-8D8DE5EA0CD5} +DEFINE_GUID(IID_ID3DXEffect, +0xf6ceb4b3, 0x4e4c, 0x40dd, 0xb8, 0x83, 0x8d, 0x8d, 0xe5, 0xea, 0xc, 0xd5); + +#undef INTERFACE +#define INTERFACE ID3DXEffect + +DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect) +{ + // ID3DXBaseEffect + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Descs + STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE; + STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE; + STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE; + STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE; + STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE; + + // Handle operations + STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE; + + // Get/Set Parameters + STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE; + STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE; + STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE; + STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE; + STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE; + STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE; + STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE; + STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE; + STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE; + STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE; + STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE; + STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE; + STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE; + STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE; + STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE; + STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE; + STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE; + STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE; + STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE; + STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE; + STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE; + STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE; + + //Set Range of an Array to pass to device + //Usefull for sending only a subrange of an array down to the device + STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE; + // ID3DXBaseEffect + + + // Pool + STDMETHOD(GetPool)(THIS_ LPD3DXEFFECTPOOL* ppPool) PURE; + + // Selecting and setting a technique + STDMETHOD(SetTechnique)(THIS_ D3DXHANDLE hTechnique) PURE; + STDMETHOD_(D3DXHANDLE, GetCurrentTechnique)(THIS) PURE; + STDMETHOD(ValidateTechnique)(THIS_ D3DXHANDLE hTechnique) PURE; + STDMETHOD(FindNextValidTechnique)(THIS_ D3DXHANDLE hTechnique, D3DXHANDLE *pTechnique) PURE; + STDMETHOD_(BOOL, IsParameterUsed)(THIS_ D3DXHANDLE hParameter, D3DXHANDLE hTechnique) PURE; + + // Using current technique + // Begin starts active technique + // BeginPass begins a pass + // CommitChanges updates changes to any set calls in the pass. This should be called before + // any DrawPrimitive call to d3d + // EndPass ends a pass + // End ends active technique + STDMETHOD(Begin)(THIS_ UINT *pPasses, DWORD Flags) PURE; + STDMETHOD(BeginPass)(THIS_ UINT Pass) PURE; + STDMETHOD(CommitChanges)(THIS) PURE; + STDMETHOD(EndPass)(THIS) PURE; + STDMETHOD(End)(THIS) PURE; + + // Managing D3D Device + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + STDMETHOD(OnLostDevice)(THIS) PURE; + STDMETHOD(OnResetDevice)(THIS) PURE; + + // Logging device calls + STDMETHOD(SetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER pManager) PURE; + STDMETHOD(GetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER *ppManager) PURE; + + // Parameter blocks + STDMETHOD(BeginParameterBlock)(THIS) PURE; + STDMETHOD_(D3DXHANDLE, EndParameterBlock)(THIS) PURE; + STDMETHOD(ApplyParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE; + STDMETHOD(DeleteParameterBlock)(THIS_ D3DXHANDLE hParameterBlock) PURE; + + // Cloning + STDMETHOD(CloneEffect)(THIS_ LPDIRECT3DDEVICE9 pDevice, LPD3DXEFFECT* ppEffect) PURE; + + // Fast path for setting variables directly in ID3DXEffect + STDMETHOD(SetRawValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT ByteOffset, UINT Bytes) PURE; +}; + + +////////////////////////////////////////////////////////////////////////////// +// ID3DXEffectCompiler /////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3DXEffectCompiler ID3DXEffectCompiler; +typedef interface ID3DXEffectCompiler *LPD3DXEFFECTCOMPILER; + +// {51B8A949-1A31-47e6-BEA0-4B30DB53F1E0} +DEFINE_GUID(IID_ID3DXEffectCompiler, +0x51b8a949, 0x1a31, 0x47e6, 0xbe, 0xa0, 0x4b, 0x30, 0xdb, 0x53, 0xf1, 0xe0); + + +#undef INTERFACE +#define INTERFACE ID3DXEffectCompiler + +DECLARE_INTERFACE_(ID3DXEffectCompiler, ID3DXBaseEffect) +{ + // ID3DXBaseEffect + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Descs + STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* pDesc) PURE; + STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE hParameter, D3DXPARAMETER_DESC* pDesc) PURE; + STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE hTechnique, D3DXTECHNIQUE_DESC* pDesc) PURE; + STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE hPass, D3DXPASS_DESC* pDesc) PURE; + STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE hShader, D3DXFUNCTION_DESC* pDesc) PURE; + + // Handle operations + STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE hParameter, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE hParameter, LPCSTR pSemantic) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE hParameter, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE hTechnique, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE hTechnique, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE hObject, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE hObject, LPCSTR pName) PURE; + + // Get/Set Parameters + STDMETHOD(SetValue)(THIS_ D3DXHANDLE hParameter, LPCVOID pData, UINT Bytes) PURE; + STDMETHOD(GetValue)(THIS_ D3DXHANDLE hParameter, LPVOID pData, UINT Bytes) PURE; + STDMETHOD(SetBool)(THIS_ D3DXHANDLE hParameter, BOOL b) PURE; + STDMETHOD(GetBool)(THIS_ D3DXHANDLE hParameter, BOOL* pb) PURE; + STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hParameter, CONST BOOL* pb, UINT Count) PURE; + STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE hParameter, BOOL* pb, UINT Count) PURE; + STDMETHOD(SetInt)(THIS_ D3DXHANDLE hParameter, INT n) PURE; + STDMETHOD(GetInt)(THIS_ D3DXHANDLE hParameter, INT* pn) PURE; + STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hParameter, CONST INT* pn, UINT Count) PURE; + STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE hParameter, INT* pn, UINT Count) PURE; + STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT f) PURE; + STDMETHOD(GetFloat)(THIS_ D3DXHANDLE hParameter, FLOAT* pf) PURE; + STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hParameter, CONST FLOAT* pf, UINT Count) PURE; + STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE hParameter, FLOAT* pf, UINT Count) PURE; + STDMETHOD(SetVector)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector) PURE; + STDMETHOD(GetVector)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector) PURE; + STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE hParameter, D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hParameter, D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetString)(THIS_ D3DXHANDLE hParameter, LPCSTR pString) PURE; + STDMETHOD(GetString)(THIS_ D3DXHANDLE hParameter, LPCSTR* ppString) PURE; + STDMETHOD(SetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 pTexture) PURE; + STDMETHOD(GetTexture)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DBASETEXTURE9 *ppTexture) PURE; + STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DPIXELSHADER9 *ppPShader) PURE; + STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE hParameter, LPDIRECT3DVERTEXSHADER9 *ppVShader) PURE; + + //Set Range of an Array to pass to device + //Usefull for sending only a subrange of an array down to the device + STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE hParameter, UINT uStart, UINT uEnd) PURE; + // ID3DXBaseEffect + + // Parameter sharing, specialization, and information + STDMETHOD(SetLiteral)(THIS_ D3DXHANDLE hParameter, BOOL Literal) PURE; + STDMETHOD(GetLiteral)(THIS_ D3DXHANDLE hParameter, BOOL *pLiteral) PURE; + + // Compilation + STDMETHOD(CompileEffect)(THIS_ DWORD Flags, + LPD3DXBUFFER* ppEffect, LPD3DXBUFFER* ppErrorMsgs) PURE; + + STDMETHOD(CompileShader)(THIS_ D3DXHANDLE hFunction, LPCSTR pTarget, DWORD Flags, + LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs, LPD3DXCONSTANTTABLE* ppConstantTable) PURE; +}; + + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +//---------------------------------------------------------------------------- +// D3DXCreateEffectPool: +// --------------------- +// Creates an effect pool. Pools are used for sharing parameters between +// multiple effects. For all effects within a pool, shared parameters of the +// same name all share the same value. +// +// Parameters: +// ppPool +// Returns the created pool. +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXCreateEffectPool( + LPD3DXEFFECTPOOL* ppPool); + + +//---------------------------------------------------------------------------- +// D3DXCreateEffect: +// ----------------- +// Creates an effect from an ascii or binary effect description. +// +// Parameters: +// pDevice +// Pointer of the device on which to create the effect +// pSrcFile +// Name of the file containing the effect description +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module +// pSrcData +// Pointer to effect description +// SrcDataSize +// Size of the effect description in bytes +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// Flags +// See D3DXSHADER_xxx flags. +// pSkipConstants +// A list of semi-colon delimited variable names. The effect will +// not set these variables to the device when they are referenced +// by a shader. NOTE: the variables specified here must be +// register bound in the file and must not be used in expressions +// in passes or samplers or the file will not load. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// pPool +// Pointer to ID3DXEffectPool object to use for shared parameters. +// If NULL, no parameters will be shared. +// ppEffect +// Returns a buffer containing created effect. +// ppCompilationErrors +// Returns a buffer containing any error messages which occurred during +// compile. Or NULL if you do not care about the error messages. +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXCreateEffectFromFileA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +HRESULT WINAPI + D3DXCreateEffectFromFileW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +#ifdef UNICODE +#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileW +#else +#define D3DXCreateEffectFromFile D3DXCreateEffectFromFileA +#endif + + +HRESULT WINAPI + D3DXCreateEffectFromResourceA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +HRESULT WINAPI + D3DXCreateEffectFromResourceW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +#ifdef UNICODE +#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceW +#else +#define D3DXCreateEffectFromResource D3DXCreateEffectFromResourceA +#endif + + +HRESULT WINAPI + D3DXCreateEffect( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataLen, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +// +// Ex functions that accept pSkipConstants in addition to other parameters +// + +HRESULT WINAPI + D3DXCreateEffectFromFileExA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +HRESULT WINAPI + D3DXCreateEffectFromFileExW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +#ifdef UNICODE +#define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExW +#else +#define D3DXCreateEffectFromFileEx D3DXCreateEffectFromFileExA +#endif + + +HRESULT WINAPI + D3DXCreateEffectFromResourceExA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +HRESULT WINAPI + D3DXCreateEffectFromResourceExW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +#ifdef UNICODE +#define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExW +#else +#define D3DXCreateEffectFromResourceEx D3DXCreateEffectFromResourceExA +#endif + + +HRESULT WINAPI + D3DXCreateEffectEx( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataLen, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pSkipConstants, + DWORD Flags, + LPD3DXEFFECTPOOL pPool, + LPD3DXEFFECT* ppEffect, + LPD3DXBUFFER* ppCompilationErrors); + +//---------------------------------------------------------------------------- +// D3DXCreateEffectCompiler: +// ------------------------- +// Creates an effect from an ascii or binary effect description. +// +// Parameters: +// pSrcFile +// Name of the file containing the effect description +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module +// pSrcData +// Pointer to effect description +// SrcDataSize +// Size of the effect description in bytes +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// pPool +// Pointer to ID3DXEffectPool object to use for shared parameters. +// If NULL, no parameters will be shared. +// ppCompiler +// Returns a buffer containing created effect compiler. +// ppParseErrors +// Returns a buffer containing any error messages which occurred during +// parse. Or NULL if you do not care about the error messages. +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXCreateEffectCompilerFromFileA( + LPCSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTCOMPILER* ppCompiler, + LPD3DXBUFFER* ppParseErrors); + +HRESULT WINAPI + D3DXCreateEffectCompilerFromFileW( + LPCWSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTCOMPILER* ppCompiler, + LPD3DXBUFFER* ppParseErrors); + +#ifdef UNICODE +#define D3DXCreateEffectCompilerFromFile D3DXCreateEffectCompilerFromFileW +#else +#define D3DXCreateEffectCompilerFromFile D3DXCreateEffectCompilerFromFileA +#endif + + +HRESULT WINAPI + D3DXCreateEffectCompilerFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTCOMPILER* ppCompiler, + LPD3DXBUFFER* ppParseErrors); + +HRESULT WINAPI + D3DXCreateEffectCompilerFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTCOMPILER* ppCompiler, + LPD3DXBUFFER* ppParseErrors); + +#ifdef UNICODE +#define D3DXCreateEffectCompilerFromResource D3DXCreateEffectCompilerFromResourceW +#else +#define D3DXCreateEffectCompilerFromResource D3DXCreateEffectCompilerFromResourceA +#endif + + +HRESULT WINAPI + D3DXCreateEffectCompiler( + LPCSTR pSrcData, + UINT SrcDataLen, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXEFFECTCOMPILER* ppCompiler, + LPD3DXBUFFER* ppParseErrors); + +//---------------------------------------------------------------------------- +// D3DXDisassembleEffect: +// ----------------------- +// +// Parameters: +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXDisassembleEffect( + LPD3DXEFFECT pEffect, + BOOL EnableColorCode, + LPD3DXBUFFER *ppDisassembly); + + + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX9EFFECT_H__ + + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dx9math.h b/Src/Decoder_H264_ALL/D3D/include/d3dx9math.h new file mode 100644 index 0000000..3fda053 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dx9math.h @@ -0,0 +1,1796 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9math.h +// Content: D3DX math types and functions +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#ifndef __D3DX9MATH_H__ +#define __D3DX9MATH_H__ + +#include +#if _MSC_VER >= 1200 +#pragma warning(push) +#endif +#pragma warning(disable:4201) // anonymous unions warning + + + +//=========================================================================== +// +// General purpose utilities +// +//=========================================================================== +#define D3DX_PI ((FLOAT) 3.141592654f) +#define D3DX_1BYPI ((FLOAT) 0.318309886f) + +#define D3DXToRadian( degree ) ((degree) * (D3DX_PI / 180.0f)) +#define D3DXToDegree( radian ) ((radian) * (180.0f / D3DX_PI)) + + + +//=========================================================================== +// +// 16 bit floating point numbers +// +//=========================================================================== + +#define D3DX_16F_DIG 3 // # of decimal digits of precision +#define D3DX_16F_EPSILON 4.8875809e-4f // smallest such that 1.0 + epsilon != 1.0 +#define D3DX_16F_MANT_DIG 11 // # of bits in mantissa +#define D3DX_16F_MAX 6.550400e+004 // max value +#define D3DX_16F_MAX_10_EXP 4 // max decimal exponent +#define D3DX_16F_MAX_EXP 15 // max binary exponent +#define D3DX_16F_MIN 6.1035156e-5f // min positive value +#define D3DX_16F_MIN_10_EXP (-4) // min decimal exponent +#define D3DX_16F_MIN_EXP (-14) // min binary exponent +#define D3DX_16F_RADIX 2 // exponent radix +#define D3DX_16F_ROUNDS 1 // addition rounding: near + + +typedef struct D3DXFLOAT16 +{ +#ifdef __cplusplus +public: + D3DXFLOAT16() {}; + D3DXFLOAT16( FLOAT ); + D3DXFLOAT16( CONST D3DXFLOAT16& ); + + // casting + operator FLOAT (); + + // binary operators + BOOL operator == ( CONST D3DXFLOAT16& ) const; + BOOL operator != ( CONST D3DXFLOAT16& ) const; + +protected: +#endif //__cplusplus + WORD value; +} D3DXFLOAT16, *LPD3DXFLOAT16; + + + +//=========================================================================== +// +// Vectors +// +//=========================================================================== + + +//-------------------------- +// 2D Vector +//-------------------------- +typedef struct D3DXVECTOR2 +{ +#ifdef __cplusplus +public: + D3DXVECTOR2() {}; + D3DXVECTOR2( CONST FLOAT * ); + D3DXVECTOR2( CONST D3DXFLOAT16 * ); + D3DXVECTOR2( FLOAT x, FLOAT y ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXVECTOR2& operator += ( CONST D3DXVECTOR2& ); + D3DXVECTOR2& operator -= ( CONST D3DXVECTOR2& ); + D3DXVECTOR2& operator *= ( FLOAT ); + D3DXVECTOR2& operator /= ( FLOAT ); + + // unary operators + D3DXVECTOR2 operator + () const; + D3DXVECTOR2 operator - () const; + + // binary operators + D3DXVECTOR2 operator + ( CONST D3DXVECTOR2& ) const; + D3DXVECTOR2 operator - ( CONST D3DXVECTOR2& ) const; + D3DXVECTOR2 operator * ( FLOAT ) const; + D3DXVECTOR2 operator / ( FLOAT ) const; + + friend D3DXVECTOR2 operator * ( FLOAT, CONST D3DXVECTOR2& ); + + BOOL operator == ( CONST D3DXVECTOR2& ) const; + BOOL operator != ( CONST D3DXVECTOR2& ) const; + + +public: +#endif //__cplusplus + FLOAT x, y; +} D3DXVECTOR2, *LPD3DXVECTOR2; + + + +//-------------------------- +// 2D Vector (16 bit) +//-------------------------- + +typedef struct D3DXVECTOR2_16F +{ +#ifdef __cplusplus +public: + D3DXVECTOR2_16F() {}; + D3DXVECTOR2_16F( CONST FLOAT * ); + D3DXVECTOR2_16F( CONST D3DXFLOAT16 * ); + D3DXVECTOR2_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y ); + + // casting + operator D3DXFLOAT16* (); + operator CONST D3DXFLOAT16* () const; + + // binary operators + BOOL operator == ( CONST D3DXVECTOR2_16F& ) const; + BOOL operator != ( CONST D3DXVECTOR2_16F& ) const; + +public: +#endif //__cplusplus + D3DXFLOAT16 x, y; + +} D3DXVECTOR2_16F, *LPD3DXVECTOR2_16F; + + + +//-------------------------- +// 3D Vector +//-------------------------- +#ifdef __cplusplus +typedef struct D3DXVECTOR3 : public D3DVECTOR +{ +public: + D3DXVECTOR3() {}; + D3DXVECTOR3( CONST FLOAT * ); + D3DXVECTOR3( CONST D3DVECTOR& ); + D3DXVECTOR3( CONST D3DXFLOAT16 * ); + D3DXVECTOR3( FLOAT x, FLOAT y, FLOAT z ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& ); + D3DXVECTOR3& operator -= ( CONST D3DXVECTOR3& ); + D3DXVECTOR3& operator *= ( FLOAT ); + D3DXVECTOR3& operator /= ( FLOAT ); + + // unary operators + D3DXVECTOR3 operator + () const; + D3DXVECTOR3 operator - () const; + + // binary operators + D3DXVECTOR3 operator + ( CONST D3DXVECTOR3& ) const; + D3DXVECTOR3 operator - ( CONST D3DXVECTOR3& ) const; + D3DXVECTOR3 operator * ( FLOAT ) const; + D3DXVECTOR3 operator / ( FLOAT ) const; + + friend D3DXVECTOR3 operator * ( FLOAT, CONST struct D3DXVECTOR3& ); + + BOOL operator == ( CONST D3DXVECTOR3& ) const; + BOOL operator != ( CONST D3DXVECTOR3& ) const; + +} D3DXVECTOR3, *LPD3DXVECTOR3; + +#else //!__cplusplus +typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3; +#endif //!__cplusplus + + + +//-------------------------- +// 3D Vector (16 bit) +//-------------------------- +typedef struct D3DXVECTOR3_16F +{ +#ifdef __cplusplus +public: + D3DXVECTOR3_16F() {}; + D3DXVECTOR3_16F( CONST FLOAT * ); + D3DXVECTOR3_16F( CONST D3DVECTOR& ); + D3DXVECTOR3_16F( CONST D3DXFLOAT16 * ); + D3DXVECTOR3_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y, CONST D3DXFLOAT16 &z ); + + // casting + operator D3DXFLOAT16* (); + operator CONST D3DXFLOAT16* () const; + + // binary operators + BOOL operator == ( CONST D3DXVECTOR3_16F& ) const; + BOOL operator != ( CONST D3DXVECTOR3_16F& ) const; + +public: +#endif //__cplusplus + D3DXFLOAT16 x, y, z; + +} D3DXVECTOR3_16F, *LPD3DXVECTOR3_16F; + + + +//-------------------------- +// 4D Vector +//-------------------------- +typedef struct D3DXVECTOR4 +{ +#ifdef __cplusplus +public: + D3DXVECTOR4() {}; + D3DXVECTOR4( CONST FLOAT* ); + D3DXVECTOR4( CONST D3DXFLOAT16* ); + D3DXVECTOR4( CONST D3DVECTOR& xyz, FLOAT w ); + D3DXVECTOR4( FLOAT x, FLOAT y, FLOAT z, FLOAT w ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXVECTOR4& operator += ( CONST D3DXVECTOR4& ); + D3DXVECTOR4& operator -= ( CONST D3DXVECTOR4& ); + D3DXVECTOR4& operator *= ( FLOAT ); + D3DXVECTOR4& operator /= ( FLOAT ); + + // unary operators + D3DXVECTOR4 operator + () const; + D3DXVECTOR4 operator - () const; + + // binary operators + D3DXVECTOR4 operator + ( CONST D3DXVECTOR4& ) const; + D3DXVECTOR4 operator - ( CONST D3DXVECTOR4& ) const; + D3DXVECTOR4 operator * ( FLOAT ) const; + D3DXVECTOR4 operator / ( FLOAT ) const; + + friend D3DXVECTOR4 operator * ( FLOAT, CONST D3DXVECTOR4& ); + + BOOL operator == ( CONST D3DXVECTOR4& ) const; + BOOL operator != ( CONST D3DXVECTOR4& ) const; + +public: +#endif //__cplusplus + FLOAT x, y, z, w; +} D3DXVECTOR4, *LPD3DXVECTOR4; + + +//-------------------------- +// 4D Vector (16 bit) +//-------------------------- +typedef struct D3DXVECTOR4_16F +{ +#ifdef __cplusplus +public: + D3DXVECTOR4_16F() {}; + D3DXVECTOR4_16F( CONST FLOAT * ); + D3DXVECTOR4_16F( CONST D3DXFLOAT16* ); + D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& xyz, CONST D3DXFLOAT16& w ); + D3DXVECTOR4_16F( CONST D3DXFLOAT16& x, CONST D3DXFLOAT16& y, CONST D3DXFLOAT16& z, CONST D3DXFLOAT16& w ); + + // casting + operator D3DXFLOAT16* (); + operator CONST D3DXFLOAT16* () const; + + // binary operators + BOOL operator == ( CONST D3DXVECTOR4_16F& ) const; + BOOL operator != ( CONST D3DXVECTOR4_16F& ) const; + +public: +#endif //__cplusplus + D3DXFLOAT16 x, y, z, w; + +} D3DXVECTOR4_16F, *LPD3DXVECTOR4_16F; + + + +//=========================================================================== +// +// Matrices +// +//=========================================================================== +#ifdef __cplusplus +typedef struct D3DXMATRIX : public D3DMATRIX +{ +public: + D3DXMATRIX() {}; + D3DXMATRIX( CONST FLOAT * ); + D3DXMATRIX( CONST D3DMATRIX& ); + D3DXMATRIX( CONST D3DXFLOAT16 * ); + D3DXMATRIX( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, + FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, + FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, + FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ); + + + // access grants + FLOAT& operator () ( UINT Row, UINT Col ); + FLOAT operator () ( UINT Row, UINT Col ) const; + + // casting operators + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXMATRIX& operator *= ( CONST D3DXMATRIX& ); + D3DXMATRIX& operator += ( CONST D3DXMATRIX& ); + D3DXMATRIX& operator -= ( CONST D3DXMATRIX& ); + D3DXMATRIX& operator *= ( FLOAT ); + D3DXMATRIX& operator /= ( FLOAT ); + + // unary operators + D3DXMATRIX operator + () const; + D3DXMATRIX operator - () const; + + // binary operators + D3DXMATRIX operator * ( CONST D3DXMATRIX& ) const; + D3DXMATRIX operator + ( CONST D3DXMATRIX& ) const; + D3DXMATRIX operator - ( CONST D3DXMATRIX& ) const; + D3DXMATRIX operator * ( FLOAT ) const; + D3DXMATRIX operator / ( FLOAT ) const; + + friend D3DXMATRIX operator * ( FLOAT, CONST D3DXMATRIX& ); + + BOOL operator == ( CONST D3DXMATRIX& ) const; + BOOL operator != ( CONST D3DXMATRIX& ) const; + +} D3DXMATRIX, *LPD3DXMATRIX; + +#else //!__cplusplus +typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX; +#endif //!__cplusplus + + +//--------------------------------------------------------------------------- +// Aligned Matrices +// +// This class helps keep matrices 16-byte aligned as preferred by P4 cpus. +// It aligns matrices on the stack and on the heap or in global scope. +// It does this using __declspec(align(16)) which works on VC7 and on VC 6 +// with the processor pack. Unfortunately there is no way to detect the +// latter so this is turned on only on VC7. On other compilers this is the +// the same as D3DXMATRIX. +// +// Using this class on a compiler that does not actually do the alignment +// can be dangerous since it will not expose bugs that ignore alignment. +// E.g if an object of this class in inside a struct or class, and some code +// memcopys data in it assuming tight packing. This could break on a compiler +// that eventually start aligning the matrix. +//--------------------------------------------------------------------------- +#ifdef __cplusplus +typedef struct _D3DXMATRIXA16 : public D3DXMATRIX +{ + _D3DXMATRIXA16() {} + _D3DXMATRIXA16( CONST FLOAT * ); + _D3DXMATRIXA16( CONST D3DMATRIX& ); + _D3DXMATRIXA16( CONST D3DXFLOAT16 * ); + _D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, + FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, + FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, + FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ); + + // new operators + void* operator new ( size_t ); + void* operator new[] ( size_t ); + + // delete operators + void operator delete ( void* ); // These are NOT virtual; Do not + void operator delete[] ( void* ); // cast to D3DXMATRIX and delete. + + // assignment operators + _D3DXMATRIXA16& operator = ( CONST D3DXMATRIX& ); + +} _D3DXMATRIXA16; + +#else //!__cplusplus +typedef D3DXMATRIX _D3DXMATRIXA16; +#endif //!__cplusplus + + + +#if _MSC_VER >= 1300 // VC7 +#define D3DX_ALIGN16 __declspec(align(16)) +#else +#define D3DX_ALIGN16 // Earlier compiler may not understand this, do nothing. +#endif + +typedef D3DX_ALIGN16 _D3DXMATRIXA16 D3DXMATRIXA16, *LPD3DXMATRIXA16; + + + +//=========================================================================== +// +// Quaternions +// +//=========================================================================== +typedef struct D3DXQUATERNION +{ +#ifdef __cplusplus +public: + D3DXQUATERNION() {} + D3DXQUATERNION( CONST FLOAT * ); + D3DXQUATERNION( CONST D3DXFLOAT16 * ); + D3DXQUATERNION( FLOAT x, FLOAT y, FLOAT z, FLOAT w ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXQUATERNION& operator += ( CONST D3DXQUATERNION& ); + D3DXQUATERNION& operator -= ( CONST D3DXQUATERNION& ); + D3DXQUATERNION& operator *= ( CONST D3DXQUATERNION& ); + D3DXQUATERNION& operator *= ( FLOAT ); + D3DXQUATERNION& operator /= ( FLOAT ); + + // unary operators + D3DXQUATERNION operator + () const; + D3DXQUATERNION operator - () const; + + // binary operators + D3DXQUATERNION operator + ( CONST D3DXQUATERNION& ) const; + D3DXQUATERNION operator - ( CONST D3DXQUATERNION& ) const; + D3DXQUATERNION operator * ( CONST D3DXQUATERNION& ) const; + D3DXQUATERNION operator * ( FLOAT ) const; + D3DXQUATERNION operator / ( FLOAT ) const; + + friend D3DXQUATERNION operator * (FLOAT, CONST D3DXQUATERNION& ); + + BOOL operator == ( CONST D3DXQUATERNION& ) const; + BOOL operator != ( CONST D3DXQUATERNION& ) const; + +#endif //__cplusplus + FLOAT x, y, z, w; +} D3DXQUATERNION, *LPD3DXQUATERNION; + + +//=========================================================================== +// +// Planes +// +//=========================================================================== +typedef struct D3DXPLANE +{ +#ifdef __cplusplus +public: + D3DXPLANE() {} + D3DXPLANE( CONST FLOAT* ); + D3DXPLANE( CONST D3DXFLOAT16* ); + D3DXPLANE( FLOAT a, FLOAT b, FLOAT c, FLOAT d ); + + // casting + operator FLOAT* (); + operator CONST FLOAT* () const; + + // assignment operators + D3DXPLANE& operator *= ( FLOAT ); + D3DXPLANE& operator /= ( FLOAT ); + + // unary operators + D3DXPLANE operator + () const; + D3DXPLANE operator - () const; + + // binary operators + D3DXPLANE operator * ( FLOAT ) const; + D3DXPLANE operator / ( FLOAT ) const; + + friend D3DXPLANE operator * ( FLOAT, CONST D3DXPLANE& ); + + BOOL operator == ( CONST D3DXPLANE& ) const; + BOOL operator != ( CONST D3DXPLANE& ) const; + +#endif //__cplusplus + FLOAT a, b, c, d; +} D3DXPLANE, *LPD3DXPLANE; + + +//=========================================================================== +// +// Colors +// +//=========================================================================== + +typedef struct D3DXCOLOR +{ +#ifdef __cplusplus +public: + D3DXCOLOR() {} + D3DXCOLOR( DWORD argb ); + D3DXCOLOR( CONST FLOAT * ); + D3DXCOLOR( CONST D3DXFLOAT16 * ); + D3DXCOLOR( CONST D3DCOLORVALUE& ); + D3DXCOLOR( FLOAT r, FLOAT g, FLOAT b, FLOAT a ); + + // casting + operator DWORD () const; + + operator FLOAT* (); + operator CONST FLOAT* () const; + + operator D3DCOLORVALUE* (); + operator CONST D3DCOLORVALUE* () const; + + operator D3DCOLORVALUE& (); + operator CONST D3DCOLORVALUE& () const; + + // assignment operators + D3DXCOLOR& operator += ( CONST D3DXCOLOR& ); + D3DXCOLOR& operator -= ( CONST D3DXCOLOR& ); + D3DXCOLOR& operator *= ( FLOAT ); + D3DXCOLOR& operator /= ( FLOAT ); + + // unary operators + D3DXCOLOR operator + () const; + D3DXCOLOR operator - () const; + + // binary operators + D3DXCOLOR operator + ( CONST D3DXCOLOR& ) const; + D3DXCOLOR operator - ( CONST D3DXCOLOR& ) const; + D3DXCOLOR operator * ( FLOAT ) const; + D3DXCOLOR operator / ( FLOAT ) const; + + friend D3DXCOLOR operator * ( FLOAT, CONST D3DXCOLOR& ); + + BOOL operator == ( CONST D3DXCOLOR& ) const; + BOOL operator != ( CONST D3DXCOLOR& ) const; + +#endif //__cplusplus + FLOAT r, g, b, a; +} D3DXCOLOR, *LPD3DXCOLOR; + + + +//=========================================================================== +// +// D3DX math functions: +// +// NOTE: +// * All these functions can take the same object as in and out parameters. +// +// * Out parameters are typically also returned as return values, so that +// the output of one function may be used as a parameter to another. +// +//=========================================================================== + +//-------------------------- +// Float16 +//-------------------------- + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Converts an array 32-bit floats to 16-bit floats +D3DXFLOAT16* WINAPI D3DXFloat32To16Array + ( D3DXFLOAT16 *pOut, CONST FLOAT *pIn, UINT n ); + +// Converts an array 16-bit floats to 32-bit floats +FLOAT* WINAPI D3DXFloat16To32Array + ( FLOAT *pOut, CONST D3DXFLOAT16 *pIn, UINT n ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// 2D Vector +//-------------------------- + +// inline + +FLOAT D3DXVec2Length + ( CONST D3DXVECTOR2 *pV ); + +FLOAT D3DXVec2LengthSq + ( CONST D3DXVECTOR2 *pV ); + +FLOAT D3DXVec2Dot + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +// Z component of ((x1,y1,0) cross (x2,y2,0)) +FLOAT D3DXVec2CCW + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +D3DXVECTOR2* D3DXVec2Add + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +D3DXVECTOR2* D3DXVec2Subtract + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +// Minimize each component. x = min(x1, x2), y = min(y1, y2) +D3DXVECTOR2* D3DXVec2Minimize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +// Maximize each component. x = max(x1, x2), y = max(y1, y2) +D3DXVECTOR2* D3DXVec2Maximize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ); + +D3DXVECTOR2* D3DXVec2Scale + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s ); + +// Linear interpolation. V1 + s(V2-V1) +D3DXVECTOR2* D3DXVec2Lerp + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, + FLOAT s ); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +D3DXVECTOR2* WINAPI D3DXVec2Normalize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV ); + +// Hermite interpolation between position V1, tangent T1 (when s == 0) +// and position V2, tangent T2 (when s == 1). +D3DXVECTOR2* WINAPI D3DXVec2Hermite + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pT1, + CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pT2, FLOAT s ); + +// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) +D3DXVECTOR2* WINAPI D3DXVec2CatmullRom + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV0, CONST D3DXVECTOR2 *pV1, + CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT s ); + +// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) +D3DXVECTOR2* WINAPI D3DXVec2BaryCentric + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, + CONST D3DXVECTOR2 *pV3, FLOAT f, FLOAT g); + +// Transform (x, y, 0, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec2Transform + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, 0, 1) by matrix, project result back into w=1. +D3DXVECTOR2* WINAPI D3DXVec2TransformCoord + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, 0, 0) by matrix. +D3DXVECTOR2* WINAPI D3DXVec2TransformNormal + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ); + +// Transform Array (x, y, 0, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec2TransformArray + ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n); + +// Transform Array (x, y, 0, 1) by matrix, project result back into w=1. +D3DXVECTOR2* WINAPI D3DXVec2TransformCoordArray + ( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Transform Array (x, y, 0, 0) by matrix. +D3DXVECTOR2* WINAPI D3DXVec2TransformNormalArray + ( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + + + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// 3D Vector +//-------------------------- + +// inline + +FLOAT D3DXVec3Length + ( CONST D3DXVECTOR3 *pV ); + +FLOAT D3DXVec3LengthSq + ( CONST D3DXVECTOR3 *pV ); + +FLOAT D3DXVec3Dot + ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Cross + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Add + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Subtract + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +// Minimize each component. x = min(x1, x2), y = min(y1, y2), ... +D3DXVECTOR3* D3DXVec3Minimize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +// Maximize each component. x = max(x1, x2), y = max(y1, y2), ... +D3DXVECTOR3* D3DXVec3Maximize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ); + +D3DXVECTOR3* D3DXVec3Scale + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s); + +// Linear interpolation. V1 + s(V2-V1) +D3DXVECTOR3* D3DXVec3Lerp + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + FLOAT s ); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +D3DXVECTOR3* WINAPI D3DXVec3Normalize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV ); + +// Hermite interpolation between position V1, tangent T1 (when s == 0) +// and position V2, tangent T2 (when s == 1). +D3DXVECTOR3* WINAPI D3DXVec3Hermite + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pT1, + CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pT2, FLOAT s ); + +// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) +D3DXVECTOR3* WINAPI D3DXVec3CatmullRom + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV0, CONST D3DXVECTOR3 *pV1, + CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT s ); + +// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) +D3DXVECTOR3* WINAPI D3DXVec3BaryCentric + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + CONST D3DXVECTOR3 *pV3, FLOAT f, FLOAT g); + +// Transform (x, y, z, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec3Transform + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, z, 1) by matrix, project result back into w=1. +D3DXVECTOR3* WINAPI D3DXVec3TransformCoord + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); + +// Transform (x, y, z, 0) by matrix. If you transforming a normal by a +// non-affine matrix, the matrix you pass to this function should be the +// transpose of the inverse of the matrix you would use to transform a coord. +D3DXVECTOR3* WINAPI D3DXVec3TransformNormal + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ); + + +// Transform Array (x, y, z, 1) by matrix. +D3DXVECTOR4* WINAPI D3DXVec3TransformArray + ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Transform Array (x, y, z, 1) by matrix, project result back into w=1. +D3DXVECTOR3* WINAPI D3DXVec3TransformCoordArray + ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Transform (x, y, z, 0) by matrix. If you transforming a normal by a +// non-affine matrix, the matrix you pass to this function should be the +// transpose of the inverse of the matrix you would use to transform a coord. +D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray + ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +// Project vector from object space into screen space +D3DXVECTOR3* WINAPI D3DXVec3Project + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld); + +// Project vector from screen space into object space +D3DXVECTOR3* WINAPI D3DXVec3Unproject + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld); + +// Project vector Array from object space into screen space +D3DXVECTOR3* WINAPI D3DXVec3ProjectArray + ( D3DXVECTOR3 *pOut, UINT OutStride,CONST D3DXVECTOR3 *pV, UINT VStride,CONST D3DVIEWPORT9 *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n); + +// Project vector Array from screen space into object space +D3DXVECTOR3* WINAPI D3DXVec3UnprojectArray + ( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DVIEWPORT9 *pViewport, + CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n); + + +#ifdef __cplusplus +} +#endif + + + +//-------------------------- +// 4D Vector +//-------------------------- + +// inline + +FLOAT D3DXVec4Length + ( CONST D3DXVECTOR4 *pV ); + +FLOAT D3DXVec4LengthSq + ( CONST D3DXVECTOR4 *pV ); + +FLOAT D3DXVec4Dot + ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 ); + +D3DXVECTOR4* D3DXVec4Add + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +D3DXVECTOR4* D3DXVec4Subtract + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +// Minimize each component. x = min(x1, x2), y = min(y1, y2), ... +D3DXVECTOR4* D3DXVec4Minimize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +// Maximize each component. x = max(x1, x2), y = max(y1, y2), ... +D3DXVECTOR4* D3DXVec4Maximize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2); + +D3DXVECTOR4* D3DXVec4Scale + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s); + +// Linear interpolation. V1 + s(V2-V1) +D3DXVECTOR4* D3DXVec4Lerp + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + FLOAT s ); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Cross-product in 4 dimensions. +D3DXVECTOR4* WINAPI D3DXVec4Cross + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + CONST D3DXVECTOR4 *pV3); + +D3DXVECTOR4* WINAPI D3DXVec4Normalize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV ); + +// Hermite interpolation between position V1, tangent T1 (when s == 0) +// and position V2, tangent T2 (when s == 1). +D3DXVECTOR4* WINAPI D3DXVec4Hermite + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pT1, + CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pT2, FLOAT s ); + +// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1) +D3DXVECTOR4* WINAPI D3DXVec4CatmullRom + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV0, CONST D3DXVECTOR4 *pV1, + CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT s ); + +// Barycentric coordinates. V1 + f(V2-V1) + g(V3-V1) +D3DXVECTOR4* WINAPI D3DXVec4BaryCentric + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + CONST D3DXVECTOR4 *pV3, FLOAT f, FLOAT g); + +// Transform vector by matrix. +D3DXVECTOR4* WINAPI D3DXVec4Transform + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM ); + +// Transform vector array by matrix. +D3DXVECTOR4* WINAPI D3DXVec4TransformArray + ( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR4 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// 4D Matrix +//-------------------------- + +// inline + +D3DXMATRIX* D3DXMatrixIdentity + ( D3DXMATRIX *pOut ); + +BOOL D3DXMatrixIsIdentity + ( CONST D3DXMATRIX *pM ); + + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +FLOAT WINAPI D3DXMatrixDeterminant + ( CONST D3DXMATRIX *pM ); + +HRESULT WINAPI D3DXMatrixDecompose + ( D3DXVECTOR3 *pOutScale, D3DXQUATERNION *pOutRotation, + D3DXVECTOR3 *pOutTranslation, CONST D3DXMATRIX *pM ); + +D3DXMATRIX* WINAPI D3DXMatrixTranspose + ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM ); + +// Matrix multiplication. The result represents the transformation M2 +// followed by the transformation M1. (Out = M1 * M2) +D3DXMATRIX* WINAPI D3DXMatrixMultiply + ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ); + +// Matrix multiplication, followed by a transpose. (Out = T(M1 * M2)) +D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose + ( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ); + +// Calculate inverse of matrix. Inversion my fail, in which case NULL will +// be returned. The determinant of pM is also returned it pfDeterminant +// is non-NULL. +D3DXMATRIX* WINAPI D3DXMatrixInverse + ( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM ); + +// Build a matrix which scales by (sx, sy, sz) +D3DXMATRIX* WINAPI D3DXMatrixScaling + ( D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz ); + +// Build a matrix which translates by (x, y, z) +D3DXMATRIX* WINAPI D3DXMatrixTranslation + ( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z ); + +// Build a matrix which rotates around the X axis +D3DXMATRIX* WINAPI D3DXMatrixRotationX + ( D3DXMATRIX *pOut, FLOAT Angle ); + +// Build a matrix which rotates around the Y axis +D3DXMATRIX* WINAPI D3DXMatrixRotationY + ( D3DXMATRIX *pOut, FLOAT Angle ); + +// Build a matrix which rotates around the Z axis +D3DXMATRIX* WINAPI D3DXMatrixRotationZ + ( D3DXMATRIX *pOut, FLOAT Angle ); + +// Build a matrix which rotates around an arbitrary axis +D3DXMATRIX* WINAPI D3DXMatrixRotationAxis + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ); + +// Build a matrix from a quaternion +D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion + ( D3DXMATRIX *pOut, CONST D3DXQUATERNION *pQ); + +// Yaw around the Y axis, a pitch around the X axis, +// and a roll around the Z axis. +D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll + ( D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ); + +// Build transformation matrix. NULL arguments are treated as identity. +// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixTransformation + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter, + CONST D3DXQUATERNION *pScalingRotation, CONST D3DXVECTOR3 *pScaling, + CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation, + CONST D3DXVECTOR3 *pTranslation); + +// Build 2D transformation matrix in XY plane. NULL arguments are treated as identity. +// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixTransformation2D + ( D3DXMATRIX *pOut, CONST D3DXVECTOR2* pScalingCenter, + FLOAT ScalingRotation, CONST D3DXVECTOR2* pScaling, + CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation, + CONST D3DXVECTOR2* pTranslation); + +// Build affine transformation matrix. NULL arguments are treated as identity. +// Mout = Ms * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation + ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter, + CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation); + +// Build 2D affine transformation matrix in XY plane. NULL arguments are treated as identity. +// Mout = Ms * Mrc-1 * Mr * Mrc * Mt +D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D + ( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR2* pRotationCenter, + FLOAT Rotation, CONST D3DXVECTOR2* pTranslation); + +// Build a lookat matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixLookAtRH + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, + CONST D3DXVECTOR3 *pUp ); + +// Build a lookat matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixLookAtLH + ( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, + CONST D3DXVECTOR3 *pUp ); + +// Build a perspective projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH + ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH + ( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ); + +// Build a perspective projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build a perspective projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build an ortho projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoRH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build an ortho projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoLH + ( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ); + +// Build an ortho projection matrix. (right-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build an ortho projection matrix. (left-handed) +D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH + ( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, + FLOAT zf ); + +// Build a matrix which flattens geometry into a plane, as if casting +// a shadow from a light. +D3DXMATRIX* WINAPI D3DXMatrixShadow + ( D3DXMATRIX *pOut, CONST D3DXVECTOR4 *pLight, + CONST D3DXPLANE *pPlane ); + +// Build a matrix which reflects the coordinate system about a plane +D3DXMATRIX* WINAPI D3DXMatrixReflect + ( D3DXMATRIX *pOut, CONST D3DXPLANE *pPlane ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// Quaternion +//-------------------------- + +// inline + +FLOAT D3DXQuaternionLength + ( CONST D3DXQUATERNION *pQ ); + +// Length squared, or "norm" +FLOAT D3DXQuaternionLengthSq + ( CONST D3DXQUATERNION *pQ ); + +FLOAT D3DXQuaternionDot + ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 ); + +// (0, 0, 0, 1) +D3DXQUATERNION* D3DXQuaternionIdentity + ( D3DXQUATERNION *pOut ); + +BOOL D3DXQuaternionIsIdentity + ( CONST D3DXQUATERNION *pQ ); + +// (-x, -y, -z, w) +D3DXQUATERNION* D3DXQuaternionConjugate + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Compute a quaternin's axis and angle of rotation. Expects unit quaternions. +void WINAPI D3DXQuaternionToAxisAngle + ( CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle ); + +// Build a quaternion from a rotation matrix. +D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix + ( D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM); + +// Rotation about arbitrary axis. +D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis + ( D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ); + +// Yaw around the Y axis, a pitch around the X axis, +// and a roll around the Z axis. +D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll + ( D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ); + +// Quaternion multiplication. The result represents the rotation Q2 +// followed by the rotation Q1. (Out = Q2 * Q1) +D3DXQUATERNION* WINAPI D3DXQuaternionMultiply + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2 ); + +D3DXQUATERNION* WINAPI D3DXQuaternionNormalize + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Conjugate and re-norm +D3DXQUATERNION* WINAPI D3DXQuaternionInverse + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Expects unit quaternions. +// if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v) +D3DXQUATERNION* WINAPI D3DXQuaternionLn + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Expects pure quaternions. (w == 0) w is ignored in calculation. +// if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v) +D3DXQUATERNION* WINAPI D3DXQuaternionExp + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ); + +// Spherical linear interpolation between Q1 (t == 0) and Q2 (t == 1). +// Expects unit quaternions. +D3DXQUATERNION* WINAPI D3DXQuaternionSlerp + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2, FLOAT t ); + +// Spherical quadrangle interpolation. +// Slerp(Slerp(Q1, C, t), Slerp(A, B, t), 2t(1-t)) +D3DXQUATERNION* WINAPI D3DXQuaternionSquad + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pA, CONST D3DXQUATERNION *pB, + CONST D3DXQUATERNION *pC, FLOAT t ); + +// Setup control points for spherical quadrangle interpolation +// from Q1 to Q2. The control points are chosen in such a way +// to ensure the continuity of tangents with adjacent segments. +void WINAPI D3DXQuaternionSquadSetup + ( D3DXQUATERNION *pAOut, D3DXQUATERNION *pBOut, D3DXQUATERNION *pCOut, + CONST D3DXQUATERNION *pQ0, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3 ); + +// Barycentric interpolation. +// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g)) +D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, + CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3, + FLOAT f, FLOAT g ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// Plane +//-------------------------- + +// inline + +// ax + by + cz + dw +FLOAT D3DXPlaneDot + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV); + +// ax + by + cz + d +FLOAT D3DXPlaneDotCoord + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV); + +// ax + by + cz +FLOAT D3DXPlaneDotNormal + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV); + +D3DXPLANE* D3DXPlaneScale + (D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Normalize plane (so that |a,b,c| == 1) +D3DXPLANE* WINAPI D3DXPlaneNormalize + ( D3DXPLANE *pOut, CONST D3DXPLANE *pP); + +// Find the intersection between a plane and a line. If the line is +// parallel to the plane, NULL is returned. +D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine + ( D3DXVECTOR3 *pOut, CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV1, + CONST D3DXVECTOR3 *pV2); + +// Construct a plane from a point and a normal +D3DXPLANE* WINAPI D3DXPlaneFromPointNormal + ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pPoint, CONST D3DXVECTOR3 *pNormal); + +// Construct a plane from 3 points +D3DXPLANE* WINAPI D3DXPlaneFromPoints + ( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + CONST D3DXVECTOR3 *pV3); + +// Transform a plane by a matrix. The vector (a,b,c) must be normal. +// M should be the inverse transpose of the transformation desired. +D3DXPLANE* WINAPI D3DXPlaneTransform + ( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM ); + +// Transform an array of planes by a matrix. The vectors (a,b,c) must be normal. +// M should be the inverse transpose of the transformation desired. +D3DXPLANE* WINAPI D3DXPlaneTransformArray + ( D3DXPLANE *pOut, UINT OutStride, CONST D3DXPLANE *pP, UINT PStride, CONST D3DXMATRIX *pM, UINT n ); + +#ifdef __cplusplus +} +#endif + + +//-------------------------- +// Color +//-------------------------- + +// inline + +// (1-r, 1-g, 1-b, a) +D3DXCOLOR* D3DXColorNegative + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC); + +D3DXCOLOR* D3DXColorAdd + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); + +D3DXCOLOR* D3DXColorSubtract + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); + +D3DXCOLOR* D3DXColorScale + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s); + +// (r1*r2, g1*g2, b1*b2, a1*a2) +D3DXCOLOR* D3DXColorModulate + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2); + +// Linear interpolation of r,g,b, and a. C1 + s(C2-C1) +D3DXCOLOR* D3DXColorLerp + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s); + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +// Interpolate r,g,b between desaturated color and color. +// DesaturatedColor + s(Color - DesaturatedColor) +D3DXCOLOR* WINAPI D3DXColorAdjustSaturation + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s); + +// Interpolate r,g,b between 50% grey and color. Grey + s(Color - Grey) +D3DXCOLOR* WINAPI D3DXColorAdjustContrast + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT c); + +#ifdef __cplusplus +} +#endif + + + + +//-------------------------- +// Misc +//-------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +// Calculate Fresnel term given the cosine of theta (likely obtained by +// taking the dot of two normals), and the refraction index of the material. +FLOAT WINAPI D3DXFresnelTerm + (FLOAT CosTheta, FLOAT RefractionIndex); + +#ifdef __cplusplus +} +#endif + + + +//=========================================================================== +// +// Matrix Stack +// +//=========================================================================== + +typedef interface ID3DXMatrixStack ID3DXMatrixStack; +typedef interface ID3DXMatrixStack *LPD3DXMATRIXSTACK; + +// {C7885BA7-F990-4fe7-922D-8515E477DD85} +DEFINE_GUID(IID_ID3DXMatrixStack, +0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85); + + +#undef INTERFACE +#define INTERFACE ID3DXMatrixStack + +DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown) +{ + // + // IUnknown methods + // + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + // + // ID3DXMatrixStack methods + // + + // Pops the top of the stack, returns the current top + // *after* popping the top. + STDMETHOD(Pop)(THIS) PURE; + + // Pushes the stack by one, duplicating the current matrix. + STDMETHOD(Push)(THIS) PURE; + + // Loads identity in the current matrix. + STDMETHOD(LoadIdentity)(THIS) PURE; + + // Loads the given matrix into the current matrix + STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; + + // Right-Multiplies the given matrix to the current matrix. + // (transformation is about the current world origin) + STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; + + // Left-Multiplies the given matrix to the current matrix + // (transformation is about the local origin of the object) + STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE; + + // Right multiply the current matrix with the computed rotation + // matrix, counterclockwise about the given axis with the given angle. + // (rotation is about the current world origin) + STDMETHOD(RotateAxis) + (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; + + // Left multiply the current matrix with the computed rotation + // matrix, counterclockwise about the given axis with the given angle. + // (rotation is about the local origin of the object) + STDMETHOD(RotateAxisLocal) + (THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; + + // Right multiply the current matrix with the computed rotation + // matrix. All angles are counterclockwise. (rotation is about the + // current world origin) + + // The rotation is composed of a yaw around the Y axis, a pitch around + // the X axis, and a roll around the Z axis. + STDMETHOD(RotateYawPitchRoll) + (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; + + // Left multiply the current matrix with the computed rotation + // matrix. All angles are counterclockwise. (rotation is about the + // local origin of the object) + + // The rotation is composed of a yaw around the Y axis, a pitch around + // the X axis, and a roll around the Z axis. + STDMETHOD(RotateYawPitchRollLocal) + (THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; + + // Right multiply the current matrix with the computed scale + // matrix. (transformation is about the current world origin) + STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + + // Left multiply the current matrix with the computed scale + // matrix. (transformation is about the local origin of the object) + STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + + // Right multiply the current matrix with the computed translation + // matrix. (transformation is about the current world origin) + STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE; + + // Left multiply the current matrix with the computed translation + // matrix. (transformation is about the local origin of the object) + STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + + // Obtain the current matrix at the top of the stack + STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +HRESULT WINAPI + D3DXCreateMatrixStack( + DWORD Flags, + LPD3DXMATRIXSTACK* ppStack); + +#ifdef __cplusplus +} +#endif + +//=========================================================================== +// +// Spherical Harmonic Runtime Routines +// +// NOTE: +// * Most of these functions can take the same object as in and out parameters. +// The exceptions are the rotation functions. +// +// * Out parameters are typically also returned as return values, so that +// the output of one function may be used as a parameter to another. +// +//============================================================================ + + +// non-inline +#ifdef __cplusplus +extern "C" { +#endif + +//============================================================================ +// +// Basic Spherical Harmonic math routines +// +//============================================================================ + +#define D3DXSH_MINORDER 2 +#define D3DXSH_MAXORDER 6 + +//============================================================================ +// +// D3DXSHEvalDirection: +// -------------------- +// Evaluates the Spherical Harmonic basis functions +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Direction to evaluate in - assumed to be normalized +// +//============================================================================ + +FLOAT* WINAPI D3DXSHEvalDirection + ( FLOAT *pOut, UINT Order, CONST D3DXVECTOR3 *pDir ); + +//============================================================================ +// +// D3DXSHRotate: +// -------------------- +// Rotates SH vector by a rotation matrix +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned (should not alias with pIn.) +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pMatrix +// Matrix used for rotation - rotation sub matrix should be orthogonal +// and have a unit determinant. +// pIn +// Input SH coeffs (rotated), incorect results if this is also output. +// +//============================================================================ + +FLOAT* WINAPI D3DXSHRotate + ( FLOAT *pOut, UINT Order, CONST D3DXMATRIX *pMatrix, CONST FLOAT *pIn ); + +//============================================================================ +// +// D3DXSHRotateZ: +// -------------------- +// Rotates the SH vector in the Z axis by an angle +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned (should not alias with pIn.) +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// Angle +// Angle in radians to rotate around the Z axis. +// pIn +// Input SH coeffs (rotated), incorect results if this is also output. +// +//============================================================================ + + +FLOAT* WINAPI D3DXSHRotateZ + ( FLOAT *pOut, UINT Order, FLOAT Angle, CONST FLOAT *pIn ); + +//============================================================================ +// +// D3DXSHAdd: +// -------------------- +// Adds two SH vectors, pOut[i] = pA[i] + pB[i]; +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pA +// Input SH coeffs. +// pB +// Input SH coeffs (second vector.) +// +//============================================================================ + +FLOAT* WINAPI D3DXSHAdd + ( FLOAT *pOut, UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ); + +//============================================================================ +// +// D3DXSHScale: +// -------------------- +// Adds two SH vectors, pOut[i] = pA[i]*Scale; +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pIn +// Input SH coeffs. +// Scale +// Scale factor. +// +//============================================================================ + +FLOAT* WINAPI D3DXSHScale + ( FLOAT *pOut, UINT Order, CONST FLOAT *pIn, CONST FLOAT Scale ); + +//============================================================================ +// +// D3DXSHDot: +// -------------------- +// Computes the dot product of two SH vectors +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pA +// Input SH coeffs. +// pB +// Second set of input SH coeffs. +// +//============================================================================ + +FLOAT WINAPI D3DXSHDot + ( UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ); + +//============================================================================ +// +// D3DXSHMultiply[O]: +// -------------------- +// Computes the product of two functions represented using SH (f and g), where: +// pOut[i] = int(y_i(s) * f(s) * g(s)), where y_i(s) is the ith SH basis +// function, f(s) and g(s) are SH functions (sum_i(y_i(s)*c_i)). The order O +// determines the lengths of the arrays, where there should always be O^2 +// coefficients. In general the product of two SH functions of order O generates +// and SH function of order 2*O - 1, but we truncate the result. This means +// that the product commutes (f*g == g*f) but doesn't associate +// (f*(g*h) != (f*g)*h. +// +// Parameters: +// pOut +// Output SH coefficients - basis function Ylm is stored at l*l + m+l +// This is the pointer that is returned. +// pF +// Input SH coeffs for first function. +// pG +// Second set of input SH coeffs. +// +//============================================================================ + +FLOAT* WINAPI D3DXSHMultiply2( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); +FLOAT* WINAPI D3DXSHMultiply3( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); +FLOAT* WINAPI D3DXSHMultiply4( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); +FLOAT* WINAPI D3DXSHMultiply5( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); +FLOAT* WINAPI D3DXSHMultiply6( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG); + + +//============================================================================ +// +// Basic Spherical Harmonic lighting routines +// +//============================================================================ + +//============================================================================ +// +// D3DXSHEvalDirectionalLight: +// -------------------- +// Evaluates a directional light and returns spectral SH data. The output +// vector is computed so that if the intensity of R/G/B is unit the resulting +// exit radiance of a point directly under the light on a diffuse object with +// an albedo of 1 would be 1.0. This will compute 3 spectral samples, pROut +// has to be specified, while pGout and pBout are optional. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Direction light is coming from (assumed to be normalized.) +// RIntensity +// Red intensity of light. +// GIntensity +// Green intensity of light. +// BIntensity +// Blue intensity of light. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green (optional.) +// pBOut +// Output SH vector for Blue (optional.) +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalDirectionalLight + ( UINT Order, CONST D3DXVECTOR3 *pDir, + FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, + FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); + +//============================================================================ +// +// D3DXSHEvalSphericalLight: +// -------------------- +// Evaluates a spherical light and returns spectral SH data. There is no +// normalization of the intensity of the light like there is for directional +// lights, care has to be taken when specifiying the intensities. This will +// compute 3 spectral samples, pROut has to be specified, while pGout and +// pBout are optional. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pPos +// Position of light - reciever is assumed to be at the origin. +// Radius +// Radius of the spherical light source. +// RIntensity +// Red intensity of light. +// GIntensity +// Green intensity of light. +// BIntensity +// Blue intensity of light. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green (optional.) +// pBOut +// Output SH vector for Blue (optional.) +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalSphericalLight + ( UINT Order, CONST D3DXVECTOR3 *pPos, FLOAT Radius, + FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, + FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); + +//============================================================================ +// +// D3DXSHEvalConeLight: +// -------------------- +// Evaluates a light that is a cone of constant intensity and returns spectral +// SH data. The output vector is computed so that if the intensity of R/G/B is +// unit the resulting exit radiance of a point directly under the light oriented +// in the cone direction on a diffuse object with an albedo of 1 would be 1.0. +// This will compute 3 spectral samples, pROut has to be specified, while pGout +// and pBout are optional. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Direction light is coming from (assumed to be normalized.) +// Radius +// Radius of cone in radians. +// RIntensity +// Red intensity of light. +// GIntensity +// Green intensity of light. +// BIntensity +// Blue intensity of light. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green (optional.) +// pBOut +// Output SH vector for Blue (optional.) +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalConeLight + ( UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT Radius, + FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, + FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); + +//============================================================================ +// +// D3DXSHEvalHemisphereLight: +// -------------------- +// Evaluates a light that is a linear interpolant between two colors over the +// sphere. The interpolant is linear along the axis of the two points, not +// over the surface of the sphere (ie: if the axis was (0,0,1) it is linear in +// Z, not in the azimuthal angle.) The resulting spherical lighting function +// is normalized so that a point on a perfectly diffuse surface with no +// shadowing and a normal pointed in the direction pDir would result in exit +// radiance with a value of 1 if the top color was white and the bottom color +// was black. This is a very simple model where Top represents the intensity +// of the "sky" and Bottom represents the intensity of the "ground". +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pDir +// Axis of the hemisphere. +// Top +// Color of the upper hemisphere. +// Bottom +// Color of the lower hemisphere. +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green +// pBOut +// Output SH vector for Blue +// +//============================================================================ + +HRESULT WINAPI D3DXSHEvalHemisphereLight + ( UINT Order, CONST D3DXVECTOR3 *pDir, D3DXCOLOR Top, D3DXCOLOR Bottom, + FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); + +//============================================================================ +// +// Basic Spherical Harmonic projection routines +// +//============================================================================ + +//============================================================================ +// +// D3DXSHProjectCubeMap: +// -------------------- +// Projects a function represented on a cube map into spherical harmonics. +// +// Parameters: +// Order +// Order of the SH evaluation, generates Order^2 coefs, degree is Order-1 +// pCubeMap +// CubeMap that is going to be projected into spherical harmonics +// pROut +// Output SH vector for Red. +// pGOut +// Output SH vector for Green +// pBOut +// Output SH vector for Blue +// +//============================================================================ + +HRESULT WINAPI D3DXSHProjectCubeMap + ( UINT uOrder, LPDIRECT3DCUBETEXTURE9 pCubeMap, + FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ); + + +#ifdef __cplusplus +} +#endif + + +#include "d3dx9math.inl" + +#if _MSC_VER >= 1200 +#pragma warning(pop) +#else +#pragma warning(default:4201) +#endif + +#endif // __D3DX9MATH_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dx9math.inl b/Src/Decoder_H264_ALL/D3D/include/d3dx9math.inl new file mode 100644 index 0000000..a3652ed --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dx9math.inl @@ -0,0 +1,2251 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9math.inl +// Content: D3DX math inline functions +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3DX9MATH_INL__ +#define __D3DX9MATH_INL__ + +//=========================================================================== +// +// Inline Class Methods +// +//=========================================================================== + +#ifdef __cplusplus + +//-------------------------- +// Float16 +//-------------------------- + +D3DXINLINE +D3DXFLOAT16::D3DXFLOAT16( FLOAT f ) +{ + D3DXFloat32To16Array(this, &f, 1); +} + +D3DXINLINE +D3DXFLOAT16::D3DXFLOAT16( CONST D3DXFLOAT16& f ) +{ + value = f.value; +} + +// casting +D3DXINLINE +D3DXFLOAT16::operator FLOAT () +{ + FLOAT f; + D3DXFloat16To32Array(&f, this, 1); + return f; +} + +// binary operators +D3DXINLINE BOOL +D3DXFLOAT16::operator == ( CONST D3DXFLOAT16& f ) const +{ + return value == f.value; +} + +D3DXINLINE BOOL +D3DXFLOAT16::operator != ( CONST D3DXFLOAT16& f ) const +{ + return value != f.value; +} + + +//-------------------------- +// 2D Vector +//-------------------------- + +D3DXINLINE +D3DXVECTOR2::D3DXVECTOR2( CONST FLOAT *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; +} + +D3DXINLINE +D3DXVECTOR2::D3DXVECTOR2( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 2); +} + +D3DXINLINE +D3DXVECTOR2::D3DXVECTOR2( FLOAT fx, FLOAT fy ) +{ + x = fx; + y = fy; +} + + +// casting +D3DXINLINE +D3DXVECTOR2::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DXINLINE +D3DXVECTOR2::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DXINLINE D3DXVECTOR2& +D3DXVECTOR2::operator += ( CONST D3DXVECTOR2& v ) +{ + x += v.x; + y += v.y; + return *this; +} + +D3DXINLINE D3DXVECTOR2& +D3DXVECTOR2::operator -= ( CONST D3DXVECTOR2& v ) +{ + x -= v.x; + y -= v.y; + return *this; +} + +D3DXINLINE D3DXVECTOR2& +D3DXVECTOR2::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + return *this; +} + +D3DXINLINE D3DXVECTOR2& +D3DXVECTOR2::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + return *this; +} + + +// unary operators +D3DXINLINE D3DXVECTOR2 +D3DXVECTOR2::operator + () const +{ + return *this; +} + +D3DXINLINE D3DXVECTOR2 +D3DXVECTOR2::operator - () const +{ + return D3DXVECTOR2(-x, -y); +} + + +// binary operators +D3DXINLINE D3DXVECTOR2 +D3DXVECTOR2::operator + ( CONST D3DXVECTOR2& v ) const +{ + return D3DXVECTOR2(x + v.x, y + v.y); +} + +D3DXINLINE D3DXVECTOR2 +D3DXVECTOR2::operator - ( CONST D3DXVECTOR2& v ) const +{ + return D3DXVECTOR2(x - v.x, y - v.y); +} + +D3DXINLINE D3DXVECTOR2 +D3DXVECTOR2::operator * ( FLOAT f ) const +{ + return D3DXVECTOR2(x * f, y * f); +} + +D3DXINLINE D3DXVECTOR2 +D3DXVECTOR2::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXVECTOR2(x * fInv, y * fInv); +} + +D3DXINLINE D3DXVECTOR2 +operator * ( FLOAT f, CONST D3DXVECTOR2& v ) +{ + return D3DXVECTOR2(f * v.x, f * v.y); +} + +D3DXINLINE BOOL +D3DXVECTOR2::operator == ( CONST D3DXVECTOR2& v ) const +{ + return x == v.x && y == v.y; +} + +D3DXINLINE BOOL +D3DXVECTOR2::operator != ( CONST D3DXVECTOR2& v ) const +{ + return x != v.x || y != v.y; +} + + + +//-------------------------- +// 2D Vector (16 bit) +//-------------------------- + +D3DXINLINE +D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST FLOAT *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat32To16Array(&x, pf, 2); +} + +D3DXINLINE +D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + *((DWORD *) &x) = *((DWORD *) &pf[0]); +} + +D3DXINLINE +D3DXVECTOR2_16F::D3DXVECTOR2_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy ) +{ + x = fx; + y = fy; +} + + +// casting +D3DXINLINE +D3DXVECTOR2_16F::operator D3DXFLOAT16* () +{ + return (D3DXFLOAT16*) &x; +} + +D3DXINLINE +D3DXVECTOR2_16F::operator CONST D3DXFLOAT16* () const +{ + return (CONST D3DXFLOAT16*) &x; +} + + +// binary operators +D3DXINLINE BOOL +D3DXVECTOR2_16F::operator == ( CONST D3DXVECTOR2_16F &v ) const +{ + return *((DWORD *) &x) == *((DWORD *) &v.x); +} + +D3DXINLINE BOOL +D3DXVECTOR2_16F::operator != ( CONST D3DXVECTOR2_16F &v ) const +{ + return *((DWORD *) &x) != *((DWORD *) &v.x); +} + + +//-------------------------- +// 3D Vector +//-------------------------- +D3DXINLINE +D3DXVECTOR3::D3DXVECTOR3( CONST FLOAT *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; + z = pf[2]; +} + +D3DXINLINE +D3DXVECTOR3::D3DXVECTOR3( CONST D3DVECTOR& v ) +{ + x = v.x; + y = v.y; + z = v.z; +} + +D3DXINLINE +D3DXVECTOR3::D3DXVECTOR3( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 3); +} + +D3DXINLINE +D3DXVECTOR3::D3DXVECTOR3( FLOAT fx, FLOAT fy, FLOAT fz ) +{ + x = fx; + y = fy; + z = fz; +} + + +// casting +D3DXINLINE +D3DXVECTOR3::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DXINLINE +D3DXVECTOR3::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DXINLINE D3DXVECTOR3& +D3DXVECTOR3::operator += ( CONST D3DXVECTOR3& v ) +{ + x += v.x; + y += v.y; + z += v.z; + return *this; +} + +D3DXINLINE D3DXVECTOR3& +D3DXVECTOR3::operator -= ( CONST D3DXVECTOR3& v ) +{ + x -= v.x; + y -= v.y; + z -= v.z; + return *this; +} + +D3DXINLINE D3DXVECTOR3& +D3DXVECTOR3::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + z *= f; + return *this; +} + +D3DXINLINE D3DXVECTOR3& +D3DXVECTOR3::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + z *= fInv; + return *this; +} + + +// unary operators +D3DXINLINE D3DXVECTOR3 +D3DXVECTOR3::operator + () const +{ + return *this; +} + +D3DXINLINE D3DXVECTOR3 +D3DXVECTOR3::operator - () const +{ + return D3DXVECTOR3(-x, -y, -z); +} + + +// binary operators +D3DXINLINE D3DXVECTOR3 +D3DXVECTOR3::operator + ( CONST D3DXVECTOR3& v ) const +{ + return D3DXVECTOR3(x + v.x, y + v.y, z + v.z); +} + +D3DXINLINE D3DXVECTOR3 +D3DXVECTOR3::operator - ( CONST D3DXVECTOR3& v ) const +{ + return D3DXVECTOR3(x - v.x, y - v.y, z - v.z); +} + +D3DXINLINE D3DXVECTOR3 +D3DXVECTOR3::operator * ( FLOAT f ) const +{ + return D3DXVECTOR3(x * f, y * f, z * f); +} + +D3DXINLINE D3DXVECTOR3 +D3DXVECTOR3::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXVECTOR3(x * fInv, y * fInv, z * fInv); +} + + +D3DXINLINE D3DXVECTOR3 +operator * ( FLOAT f, CONST struct D3DXVECTOR3& v ) +{ + return D3DXVECTOR3(f * v.x, f * v.y, f * v.z); +} + + +D3DXINLINE BOOL +D3DXVECTOR3::operator == ( CONST D3DXVECTOR3& v ) const +{ + return x == v.x && y == v.y && z == v.z; +} + +D3DXINLINE BOOL +D3DXVECTOR3::operator != ( CONST D3DXVECTOR3& v ) const +{ + return x != v.x || y != v.y || z != v.z; +} + + + +//-------------------------- +// 3D Vector (16 bit) +//-------------------------- + +D3DXINLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST FLOAT *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat32To16Array(&x, pf, 3); +} + +D3DXINLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DVECTOR& v ) +{ + D3DXFloat32To16Array(&x, &v.x, 1); + D3DXFloat32To16Array(&y, &v.y, 1); + D3DXFloat32To16Array(&z, &v.z, 1); +} + +D3DXINLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + *((DWORD *) &x) = *((DWORD *) &pf[0]); + *((WORD *) &z) = *((WORD *) &pf[2]); +} + +D3DXINLINE +D3DXVECTOR3_16F::D3DXVECTOR3_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy, CONST D3DXFLOAT16 &fz ) +{ + x = fx; + y = fy; + z = fz; +} + + +// casting +D3DXINLINE +D3DXVECTOR3_16F::operator D3DXFLOAT16* () +{ + return (D3DXFLOAT16*) &x; +} + +D3DXINLINE +D3DXVECTOR3_16F::operator CONST D3DXFLOAT16* () const +{ + return (CONST D3DXFLOAT16*) &x; +} + + +// binary operators +D3DXINLINE BOOL +D3DXVECTOR3_16F::operator == ( CONST D3DXVECTOR3_16F &v ) const +{ + return *((DWORD *) &x) == *((DWORD *) &v.x) && + *((WORD *) &z) == *((WORD *) &v.z); +} + +D3DXINLINE BOOL +D3DXVECTOR3_16F::operator != ( CONST D3DXVECTOR3_16F &v ) const +{ + return *((DWORD *) &x) != *((DWORD *) &v.x) || + *((WORD *) &z) != *((WORD *) &v.z); +} + + +//-------------------------- +// 4D Vector +//-------------------------- +D3DXINLINE +D3DXVECTOR4::D3DXVECTOR4( CONST FLOAT *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; + z = pf[2]; + w = pf[3]; +} + +D3DXINLINE +D3DXVECTOR4::D3DXVECTOR4( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 4); +} + +D3DXINLINE +D3DXVECTOR4::D3DXVECTOR4( CONST D3DVECTOR& v, FLOAT f ) +{ + x = v.x; + y = v.y; + z = v.z; + w = f; +} + +D3DXINLINE +D3DXVECTOR4::D3DXVECTOR4( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw ) +{ + x = fx; + y = fy; + z = fz; + w = fw; +} + + +// casting +D3DXINLINE +D3DXVECTOR4::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DXINLINE +D3DXVECTOR4::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DXINLINE D3DXVECTOR4& +D3DXVECTOR4::operator += ( CONST D3DXVECTOR4& v ) +{ + x += v.x; + y += v.y; + z += v.z; + w += v.w; + return *this; +} + +D3DXINLINE D3DXVECTOR4& +D3DXVECTOR4::operator -= ( CONST D3DXVECTOR4& v ) +{ + x -= v.x; + y -= v.y; + z -= v.z; + w -= v.w; + return *this; +} + +D3DXINLINE D3DXVECTOR4& +D3DXVECTOR4::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + z *= f; + w *= f; + return *this; +} + +D3DXINLINE D3DXVECTOR4& +D3DXVECTOR4::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + z *= fInv; + w *= fInv; + return *this; +} + + +// unary operators +D3DXINLINE D3DXVECTOR4 +D3DXVECTOR4::operator + () const +{ + return *this; +} + +D3DXINLINE D3DXVECTOR4 +D3DXVECTOR4::operator - () const +{ + return D3DXVECTOR4(-x, -y, -z, -w); +} + + +// binary operators +D3DXINLINE D3DXVECTOR4 +D3DXVECTOR4::operator + ( CONST D3DXVECTOR4& v ) const +{ + return D3DXVECTOR4(x + v.x, y + v.y, z + v.z, w + v.w); +} + +D3DXINLINE D3DXVECTOR4 +D3DXVECTOR4::operator - ( CONST D3DXVECTOR4& v ) const +{ + return D3DXVECTOR4(x - v.x, y - v.y, z - v.z, w - v.w); +} + +D3DXINLINE D3DXVECTOR4 +D3DXVECTOR4::operator * ( FLOAT f ) const +{ + return D3DXVECTOR4(x * f, y * f, z * f, w * f); +} + +D3DXINLINE D3DXVECTOR4 +D3DXVECTOR4::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXVECTOR4(x * fInv, y * fInv, z * fInv, w * fInv); +} + +D3DXINLINE D3DXVECTOR4 +operator * ( FLOAT f, CONST D3DXVECTOR4& v ) +{ + return D3DXVECTOR4(f * v.x, f * v.y, f * v.z, f * v.w); +} + + +D3DXINLINE BOOL +D3DXVECTOR4::operator == ( CONST D3DXVECTOR4& v ) const +{ + return x == v.x && y == v.y && z == v.z && w == v.w; +} + +D3DXINLINE BOOL +D3DXVECTOR4::operator != ( CONST D3DXVECTOR4& v ) const +{ + return x != v.x || y != v.y || z != v.z || w != v.w; +} + + + +//-------------------------- +// 4D Vector (16 bit) +//-------------------------- + +D3DXINLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST FLOAT *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat32To16Array(&x, pf, 4); +} + +D3DXINLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXFLOAT16 *pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + *((DWORD *) &x) = *((DWORD *) &pf[0]); + *((DWORD *) &z) = *((DWORD *) &pf[2]); +} + +D3DXINLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& v, CONST D3DXFLOAT16& f ) +{ + x = v.x; + y = v.y; + z = v.z; + w = f; +} + +D3DXINLINE +D3DXVECTOR4_16F::D3DXVECTOR4_16F( CONST D3DXFLOAT16 &fx, CONST D3DXFLOAT16 &fy, CONST D3DXFLOAT16 &fz, CONST D3DXFLOAT16 &fw ) +{ + x = fx; + y = fy; + z = fz; + w = fw; +} + + +// casting +D3DXINLINE +D3DXVECTOR4_16F::operator D3DXFLOAT16* () +{ + return (D3DXFLOAT16*) &x; +} + +D3DXINLINE +D3DXVECTOR4_16F::operator CONST D3DXFLOAT16* () const +{ + return (CONST D3DXFLOAT16*) &x; +} + + +// binary operators +D3DXINLINE BOOL +D3DXVECTOR4_16F::operator == ( CONST D3DXVECTOR4_16F &v ) const +{ + return *((DWORD *) &x) == *((DWORD *) &v.x) && + *((DWORD *) &z) == *((DWORD *) &v.z); +} + +D3DXINLINE BOOL +D3DXVECTOR4_16F::operator != ( CONST D3DXVECTOR4_16F &v ) const +{ + return *((DWORD *) &x) != *((DWORD *) &v.x) || + *((DWORD *) &z) != *((DWORD *) &v.z); +} + + +//-------------------------- +// Matrix +//-------------------------- +D3DXINLINE +D3DXMATRIX::D3DXMATRIX( CONST FLOAT* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + memcpy(&_11, pf, sizeof(D3DXMATRIX)); +} + +D3DXINLINE +D3DXMATRIX::D3DXMATRIX( CONST D3DMATRIX& mat ) +{ + memcpy(&_11, &mat, sizeof(D3DXMATRIX)); +} + +D3DXINLINE +D3DXMATRIX::D3DXMATRIX( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&_11, pf, 16); +} + +D3DXINLINE +D3DXMATRIX::D3DXMATRIX( FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14, + FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24, + FLOAT f31, FLOAT f32, FLOAT f33, FLOAT f34, + FLOAT f41, FLOAT f42, FLOAT f43, FLOAT f44 ) +{ + _11 = f11; _12 = f12; _13 = f13; _14 = f14; + _21 = f21; _22 = f22; _23 = f23; _24 = f24; + _31 = f31; _32 = f32; _33 = f33; _34 = f34; + _41 = f41; _42 = f42; _43 = f43; _44 = f44; +} + + + +// access grants +D3DXINLINE FLOAT& +D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) +{ + return m[iRow][iCol]; +} + +D3DXINLINE FLOAT +D3DXMATRIX::operator () ( UINT iRow, UINT iCol ) const +{ + return m[iRow][iCol]; +} + + +// casting operators +D3DXINLINE +D3DXMATRIX::operator FLOAT* () +{ + return (FLOAT *) &_11; +} + +D3DXINLINE +D3DXMATRIX::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &_11; +} + + +// assignment operators +D3DXINLINE D3DXMATRIX& +D3DXMATRIX::operator *= ( CONST D3DXMATRIX& mat ) +{ + D3DXMatrixMultiply(this, this, &mat); + return *this; +} + +D3DXINLINE D3DXMATRIX& +D3DXMATRIX::operator += ( CONST D3DXMATRIX& mat ) +{ + _11 += mat._11; _12 += mat._12; _13 += mat._13; _14 += mat._14; + _21 += mat._21; _22 += mat._22; _23 += mat._23; _24 += mat._24; + _31 += mat._31; _32 += mat._32; _33 += mat._33; _34 += mat._34; + _41 += mat._41; _42 += mat._42; _43 += mat._43; _44 += mat._44; + return *this; +} + +D3DXINLINE D3DXMATRIX& +D3DXMATRIX::operator -= ( CONST D3DXMATRIX& mat ) +{ + _11 -= mat._11; _12 -= mat._12; _13 -= mat._13; _14 -= mat._14; + _21 -= mat._21; _22 -= mat._22; _23 -= mat._23; _24 -= mat._24; + _31 -= mat._31; _32 -= mat._32; _33 -= mat._33; _34 -= mat._34; + _41 -= mat._41; _42 -= mat._42; _43 -= mat._43; _44 -= mat._44; + return *this; +} + +D3DXINLINE D3DXMATRIX& +D3DXMATRIX::operator *= ( FLOAT f ) +{ + _11 *= f; _12 *= f; _13 *= f; _14 *= f; + _21 *= f; _22 *= f; _23 *= f; _24 *= f; + _31 *= f; _32 *= f; _33 *= f; _34 *= f; + _41 *= f; _42 *= f; _43 *= f; _44 *= f; + return *this; +} + +D3DXINLINE D3DXMATRIX& +D3DXMATRIX::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + _11 *= fInv; _12 *= fInv; _13 *= fInv; _14 *= fInv; + _21 *= fInv; _22 *= fInv; _23 *= fInv; _24 *= fInv; + _31 *= fInv; _32 *= fInv; _33 *= fInv; _34 *= fInv; + _41 *= fInv; _42 *= fInv; _43 *= fInv; _44 *= fInv; + return *this; +} + + +// unary operators +D3DXINLINE D3DXMATRIX +D3DXMATRIX::operator + () const +{ + return *this; +} + +D3DXINLINE D3DXMATRIX +D3DXMATRIX::operator - () const +{ + return D3DXMATRIX(-_11, -_12, -_13, -_14, + -_21, -_22, -_23, -_24, + -_31, -_32, -_33, -_34, + -_41, -_42, -_43, -_44); +} + + +// binary operators +D3DXINLINE D3DXMATRIX +D3DXMATRIX::operator * ( CONST D3DXMATRIX& mat ) const +{ + D3DXMATRIX matT; + D3DXMatrixMultiply(&matT, this, &mat); + return matT; +} + +D3DXINLINE D3DXMATRIX +D3DXMATRIX::operator + ( CONST D3DXMATRIX& mat ) const +{ + return D3DXMATRIX(_11 + mat._11, _12 + mat._12, _13 + mat._13, _14 + mat._14, + _21 + mat._21, _22 + mat._22, _23 + mat._23, _24 + mat._24, + _31 + mat._31, _32 + mat._32, _33 + mat._33, _34 + mat._34, + _41 + mat._41, _42 + mat._42, _43 + mat._43, _44 + mat._44); +} + +D3DXINLINE D3DXMATRIX +D3DXMATRIX::operator - ( CONST D3DXMATRIX& mat ) const +{ + return D3DXMATRIX(_11 - mat._11, _12 - mat._12, _13 - mat._13, _14 - mat._14, + _21 - mat._21, _22 - mat._22, _23 - mat._23, _24 - mat._24, + _31 - mat._31, _32 - mat._32, _33 - mat._33, _34 - mat._34, + _41 - mat._41, _42 - mat._42, _43 - mat._43, _44 - mat._44); +} + +D3DXINLINE D3DXMATRIX +D3DXMATRIX::operator * ( FLOAT f ) const +{ + return D3DXMATRIX(_11 * f, _12 * f, _13 * f, _14 * f, + _21 * f, _22 * f, _23 * f, _24 * f, + _31 * f, _32 * f, _33 * f, _34 * f, + _41 * f, _42 * f, _43 * f, _44 * f); +} + +D3DXINLINE D3DXMATRIX +D3DXMATRIX::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXMATRIX(_11 * fInv, _12 * fInv, _13 * fInv, _14 * fInv, + _21 * fInv, _22 * fInv, _23 * fInv, _24 * fInv, + _31 * fInv, _32 * fInv, _33 * fInv, _34 * fInv, + _41 * fInv, _42 * fInv, _43 * fInv, _44 * fInv); +} + + +D3DXINLINE D3DXMATRIX +operator * ( FLOAT f, CONST D3DXMATRIX& mat ) +{ + return D3DXMATRIX(f * mat._11, f * mat._12, f * mat._13, f * mat._14, + f * mat._21, f * mat._22, f * mat._23, f * mat._24, + f * mat._31, f * mat._32, f * mat._33, f * mat._34, + f * mat._41, f * mat._42, f * mat._43, f * mat._44); +} + + +D3DXINLINE BOOL +D3DXMATRIX::operator == ( CONST D3DXMATRIX& mat ) const +{ + return 0 == memcmp(this, &mat, sizeof(D3DXMATRIX)); +} + +D3DXINLINE BOOL +D3DXMATRIX::operator != ( CONST D3DXMATRIX& mat ) const +{ + return 0 != memcmp(this, &mat, sizeof(D3DXMATRIX)); +} + + + +//-------------------------- +// Aligned Matrices +//-------------------------- + +D3DXINLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( CONST FLOAT* f ) : + D3DXMATRIX( f ) +{ +} + +D3DXINLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( CONST D3DMATRIX& m ) : + D3DXMATRIX( m ) +{ +} + +D3DXINLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( CONST D3DXFLOAT16* f ) : + D3DXMATRIX( f ) +{ +} + +D3DXINLINE +_D3DXMATRIXA16::_D3DXMATRIXA16( FLOAT _11, FLOAT _12, FLOAT _13, FLOAT _14, + FLOAT _21, FLOAT _22, FLOAT _23, FLOAT _24, + FLOAT _31, FLOAT _32, FLOAT _33, FLOAT _34, + FLOAT _41, FLOAT _42, FLOAT _43, FLOAT _44 ) : + D3DXMATRIX(_11, _12, _13, _14, + _21, _22, _23, _24, + _31, _32, _33, _34, + _41, _42, _43, _44) +{ +} + +#ifndef SIZE_MAX +#define SIZE_MAX ((SIZE_T)-1) +#endif + +D3DXINLINE void* +_D3DXMATRIXA16::operator new( size_t s ) +{ + if (s > (SIZE_MAX-16)) + return NULL; + LPBYTE p = ::new BYTE[s + 16]; + if (p) + { + BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15)); + p += offset; + p[-1] = offset; + } + return p; +} + +D3DXINLINE void* +_D3DXMATRIXA16::operator new[]( size_t s ) +{ + if (s > (SIZE_MAX-16)) + return NULL; + LPBYTE p = ::new BYTE[s + 16]; + if (p) + { + BYTE offset = (BYTE)(16 - ((UINT_PTR)p & 15)); + p += offset; + p[-1] = offset; + } + return p; +} + +D3DXINLINE void +_D3DXMATRIXA16::operator delete(void* p) +{ + if(p) + { + BYTE* pb = static_cast(p); + pb -= pb[-1]; + ::delete [] pb; + } +} + +D3DXINLINE void +_D3DXMATRIXA16::operator delete[](void* p) +{ + if(p) + { + BYTE* pb = static_cast(p); + pb -= pb[-1]; + ::delete [] pb; + } +} + +D3DXINLINE _D3DXMATRIXA16& +_D3DXMATRIXA16::operator=(CONST D3DXMATRIX& rhs) +{ + memcpy(&_11, &rhs, sizeof(D3DXMATRIX)); + return *this; +} + + +//-------------------------- +// Quaternion +//-------------------------- + +D3DXINLINE +D3DXQUATERNION::D3DXQUATERNION( CONST FLOAT* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + x = pf[0]; + y = pf[1]; + z = pf[2]; + w = pf[3]; +} + +D3DXINLINE +D3DXQUATERNION::D3DXQUATERNION( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&x, pf, 4); +} + +D3DXINLINE +D3DXQUATERNION::D3DXQUATERNION( FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw ) +{ + x = fx; + y = fy; + z = fz; + w = fw; +} + + +// casting +D3DXINLINE +D3DXQUATERNION::operator FLOAT* () +{ + return (FLOAT *) &x; +} + +D3DXINLINE +D3DXQUATERNION::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &x; +} + + +// assignment operators +D3DXINLINE D3DXQUATERNION& +D3DXQUATERNION::operator += ( CONST D3DXQUATERNION& q ) +{ + x += q.x; + y += q.y; + z += q.z; + w += q.w; + return *this; +} + +D3DXINLINE D3DXQUATERNION& +D3DXQUATERNION::operator -= ( CONST D3DXQUATERNION& q ) +{ + x -= q.x; + y -= q.y; + z -= q.z; + w -= q.w; + return *this; +} + +D3DXINLINE D3DXQUATERNION& +D3DXQUATERNION::operator *= ( CONST D3DXQUATERNION& q ) +{ + D3DXQuaternionMultiply(this, this, &q); + return *this; +} + +D3DXINLINE D3DXQUATERNION& +D3DXQUATERNION::operator *= ( FLOAT f ) +{ + x *= f; + y *= f; + z *= f; + w *= f; + return *this; +} + +D3DXINLINE D3DXQUATERNION& +D3DXQUATERNION::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + x *= fInv; + y *= fInv; + z *= fInv; + w *= fInv; + return *this; +} + + +// unary operators +D3DXINLINE D3DXQUATERNION +D3DXQUATERNION::operator + () const +{ + return *this; +} + +D3DXINLINE D3DXQUATERNION +D3DXQUATERNION::operator - () const +{ + return D3DXQUATERNION(-x, -y, -z, -w); +} + + +// binary operators +D3DXINLINE D3DXQUATERNION +D3DXQUATERNION::operator + ( CONST D3DXQUATERNION& q ) const +{ + return D3DXQUATERNION(x + q.x, y + q.y, z + q.z, w + q.w); +} + +D3DXINLINE D3DXQUATERNION +D3DXQUATERNION::operator - ( CONST D3DXQUATERNION& q ) const +{ + return D3DXQUATERNION(x - q.x, y - q.y, z - q.z, w - q.w); +} + +D3DXINLINE D3DXQUATERNION +D3DXQUATERNION::operator * ( CONST D3DXQUATERNION& q ) const +{ + D3DXQUATERNION qT; + D3DXQuaternionMultiply(&qT, this, &q); + return qT; +} + +D3DXINLINE D3DXQUATERNION +D3DXQUATERNION::operator * ( FLOAT f ) const +{ + return D3DXQUATERNION(x * f, y * f, z * f, w * f); +} + +D3DXINLINE D3DXQUATERNION +D3DXQUATERNION::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXQUATERNION(x * fInv, y * fInv, z * fInv, w * fInv); +} + + +D3DXINLINE D3DXQUATERNION +operator * (FLOAT f, CONST D3DXQUATERNION& q ) +{ + return D3DXQUATERNION(f * q.x, f * q.y, f * q.z, f * q.w); +} + + +D3DXINLINE BOOL +D3DXQUATERNION::operator == ( CONST D3DXQUATERNION& q ) const +{ + return x == q.x && y == q.y && z == q.z && w == q.w; +} + +D3DXINLINE BOOL +D3DXQUATERNION::operator != ( CONST D3DXQUATERNION& q ) const +{ + return x != q.x || y != q.y || z != q.z || w != q.w; +} + + + +//-------------------------- +// Plane +//-------------------------- + +D3DXINLINE +D3DXPLANE::D3DXPLANE( CONST FLOAT* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + a = pf[0]; + b = pf[1]; + c = pf[2]; + d = pf[3]; +} + +D3DXINLINE +D3DXPLANE::D3DXPLANE( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&a, pf, 4); +} + +D3DXINLINE +D3DXPLANE::D3DXPLANE( FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd ) +{ + a = fa; + b = fb; + c = fc; + d = fd; +} + + +// casting +D3DXINLINE +D3DXPLANE::operator FLOAT* () +{ + return (FLOAT *) &a; +} + +D3DXINLINE +D3DXPLANE::operator CONST FLOAT* () const +{ + return (CONST FLOAT *) &a; +} + + +// assignment operators +D3DXINLINE D3DXPLANE& +D3DXPLANE::operator *= ( FLOAT f ) +{ + a *= f; + b *= f; + c *= f; + d *= f; + return *this; +} + +D3DXINLINE D3DXPLANE& +D3DXPLANE::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + a *= fInv; + b *= fInv; + c *= fInv; + d *= fInv; + return *this; +} + + +// unary operators +D3DXINLINE D3DXPLANE +D3DXPLANE::operator + () const +{ + return *this; +} + +D3DXINLINE D3DXPLANE +D3DXPLANE::operator - () const +{ + return D3DXPLANE(-a, -b, -c, -d); +} + + +// binary operators +D3DXINLINE D3DXPLANE +D3DXPLANE::operator * ( FLOAT f ) const +{ + return D3DXPLANE(a * f, b * f, c * f, d * f); +} + +D3DXINLINE D3DXPLANE +D3DXPLANE::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXPLANE(a * fInv, b * fInv, c * fInv, d * fInv); +} + +D3DXINLINE D3DXPLANE +operator * (FLOAT f, CONST D3DXPLANE& p ) +{ + return D3DXPLANE(f * p.a, f * p.b, f * p.c, f * p.d); +} + +D3DXINLINE BOOL +D3DXPLANE::operator == ( CONST D3DXPLANE& p ) const +{ + return a == p.a && b == p.b && c == p.c && d == p.d; +} + +D3DXINLINE BOOL +D3DXPLANE::operator != ( CONST D3DXPLANE& p ) const +{ + return a != p.a || b != p.b || c != p.c || d != p.d; +} + + + + +//-------------------------- +// Color +//-------------------------- + +D3DXINLINE +D3DXCOLOR::D3DXCOLOR( DWORD dw ) +{ + CONST FLOAT f = 1.0f / 255.0f; + r = f * (FLOAT) (unsigned char) (dw >> 16); + g = f * (FLOAT) (unsigned char) (dw >> 8); + b = f * (FLOAT) (unsigned char) (dw >> 0); + a = f * (FLOAT) (unsigned char) (dw >> 24); +} + +D3DXINLINE +D3DXCOLOR::D3DXCOLOR( CONST FLOAT* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + r = pf[0]; + g = pf[1]; + b = pf[2]; + a = pf[3]; +} + +D3DXINLINE +D3DXCOLOR::D3DXCOLOR( CONST D3DXFLOAT16* pf ) +{ +#ifdef D3DX_DEBUG + if(!pf) + return; +#endif + + D3DXFloat16To32Array(&r, pf, 4); +} + +D3DXINLINE +D3DXCOLOR::D3DXCOLOR( CONST D3DCOLORVALUE& c ) +{ + r = c.r; + g = c.g; + b = c.b; + a = c.a; +} + +D3DXINLINE +D3DXCOLOR::D3DXCOLOR( FLOAT fr, FLOAT fg, FLOAT fb, FLOAT fa ) +{ + r = fr; + g = fg; + b = fb; + a = fa; +} + + +// casting +D3DXINLINE +D3DXCOLOR::operator DWORD () const +{ + DWORD dwR = r >= 1.0f ? 0xff : r <= 0.0f ? 0x00 : (DWORD) (r * 255.0f + 0.5f); + DWORD dwG = g >= 1.0f ? 0xff : g <= 0.0f ? 0x00 : (DWORD) (g * 255.0f + 0.5f); + DWORD dwB = b >= 1.0f ? 0xff : b <= 0.0f ? 0x00 : (DWORD) (b * 255.0f + 0.5f); + DWORD dwA = a >= 1.0f ? 0xff : a <= 0.0f ? 0x00 : (DWORD) (a * 255.0f + 0.5f); + + return (dwA << 24) | (dwR << 16) | (dwG << 8) | dwB; +} + + +D3DXINLINE +D3DXCOLOR::operator FLOAT * () +{ + return (FLOAT *) &r; +} + +D3DXINLINE +D3DXCOLOR::operator CONST FLOAT * () const +{ + return (CONST FLOAT *) &r; +} + + +D3DXINLINE +D3DXCOLOR::operator D3DCOLORVALUE * () +{ + return (D3DCOLORVALUE *) &r; +} + +D3DXINLINE +D3DXCOLOR::operator CONST D3DCOLORVALUE * () const +{ + return (CONST D3DCOLORVALUE *) &r; +} + + +D3DXINLINE +D3DXCOLOR::operator D3DCOLORVALUE& () +{ + return *((D3DCOLORVALUE *) &r); +} + +D3DXINLINE +D3DXCOLOR::operator CONST D3DCOLORVALUE& () const +{ + return *((CONST D3DCOLORVALUE *) &r); +} + + +// assignment operators +D3DXINLINE D3DXCOLOR& +D3DXCOLOR::operator += ( CONST D3DXCOLOR& c ) +{ + r += c.r; + g += c.g; + b += c.b; + a += c.a; + return *this; +} + +D3DXINLINE D3DXCOLOR& +D3DXCOLOR::operator -= ( CONST D3DXCOLOR& c ) +{ + r -= c.r; + g -= c.g; + b -= c.b; + a -= c.a; + return *this; +} + +D3DXINLINE D3DXCOLOR& +D3DXCOLOR::operator *= ( FLOAT f ) +{ + r *= f; + g *= f; + b *= f; + a *= f; + return *this; +} + +D3DXINLINE D3DXCOLOR& +D3DXCOLOR::operator /= ( FLOAT f ) +{ + FLOAT fInv = 1.0f / f; + r *= fInv; + g *= fInv; + b *= fInv; + a *= fInv; + return *this; +} + + +// unary operators +D3DXINLINE D3DXCOLOR +D3DXCOLOR::operator + () const +{ + return *this; +} + +D3DXINLINE D3DXCOLOR +D3DXCOLOR::operator - () const +{ + return D3DXCOLOR(-r, -g, -b, -a); +} + + +// binary operators +D3DXINLINE D3DXCOLOR +D3DXCOLOR::operator + ( CONST D3DXCOLOR& c ) const +{ + return D3DXCOLOR(r + c.r, g + c.g, b + c.b, a + c.a); +} + +D3DXINLINE D3DXCOLOR +D3DXCOLOR::operator - ( CONST D3DXCOLOR& c ) const +{ + return D3DXCOLOR(r - c.r, g - c.g, b - c.b, a - c.a); +} + +D3DXINLINE D3DXCOLOR +D3DXCOLOR::operator * ( FLOAT f ) const +{ + return D3DXCOLOR(r * f, g * f, b * f, a * f); +} + +D3DXINLINE D3DXCOLOR +D3DXCOLOR::operator / ( FLOAT f ) const +{ + FLOAT fInv = 1.0f / f; + return D3DXCOLOR(r * fInv, g * fInv, b * fInv, a * fInv); +} + + +D3DXINLINE D3DXCOLOR +operator * (FLOAT f, CONST D3DXCOLOR& c ) +{ + return D3DXCOLOR(f * c.r, f * c.g, f * c.b, f * c.a); +} + + +D3DXINLINE BOOL +D3DXCOLOR::operator == ( CONST D3DXCOLOR& c ) const +{ + return r == c.r && g == c.g && b == c.b && a == c.a; +} + +D3DXINLINE BOOL +D3DXCOLOR::operator != ( CONST D3DXCOLOR& c ) const +{ + return r != c.r || g != c.g || b != c.b || a != c.a; +} + + +#endif //__cplusplus + + + +//=========================================================================== +// +// Inline functions +// +//=========================================================================== + + +//-------------------------- +// 2D Vector +//-------------------------- + +D3DXINLINE FLOAT D3DXVec2Length + ( CONST D3DXVECTOR2 *pV ) +{ +#ifdef D3DX_DEBUG + if(!pV) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pV->x * pV->x + pV->y * pV->y); +#else + return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y); +#endif +} + +D3DXINLINE FLOAT D3DXVec2LengthSq + ( CONST D3DXVECTOR2 *pV ) +{ +#ifdef D3DX_DEBUG + if(!pV) + return 0.0f; +#endif + + return pV->x * pV->x + pV->y * pV->y; +} + +D3DXINLINE FLOAT D3DXVec2Dot + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->x + pV1->y * pV2->y; +} + +D3DXINLINE FLOAT D3DXVec2CCW + ( CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->y - pV1->y * pV2->x; +} + +D3DXINLINE D3DXVECTOR2* D3DXVec2Add + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + pV2->x; + pOut->y = pV1->y + pV2->y; + return pOut; +} + +D3DXINLINE D3DXVECTOR2* D3DXVec2Subtract + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x - pV2->x; + pOut->y = pV1->y - pV2->y; + return pOut; +} + +D3DXINLINE D3DXVECTOR2* D3DXVec2Minimize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; + return pOut; +} + +D3DXINLINE D3DXVECTOR2* D3DXVec2Maximize + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; + return pOut; +} + +D3DXINLINE D3DXVECTOR2* D3DXVec2Scale + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, FLOAT s ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV) + return NULL; +#endif + + pOut->x = pV->x * s; + pOut->y = pV->y * s; + return pOut; +} + +D3DXINLINE D3DXVECTOR2* D3DXVec2Lerp + ( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, + FLOAT s ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + s * (pV2->x - pV1->x); + pOut->y = pV1->y + s * (pV2->y - pV1->y); + return pOut; +} + + +//-------------------------- +// 3D Vector +//-------------------------- + +D3DXINLINE FLOAT D3DXVec3Length + ( CONST D3DXVECTOR3 *pV ) +{ +#ifdef D3DX_DEBUG + if(!pV) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z); +#else + return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z); +#endif +} + +D3DXINLINE FLOAT D3DXVec3LengthSq + ( CONST D3DXVECTOR3 *pV ) +{ +#ifdef D3DX_DEBUG + if(!pV) + return 0.0f; +#endif + + return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z; +} + +D3DXINLINE FLOAT D3DXVec3Dot + ( CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Cross + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ + D3DXVECTOR3 v; + +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + v.x = pV1->y * pV2->z - pV1->z * pV2->y; + v.y = pV1->z * pV2->x - pV1->x * pV2->z; + v.z = pV1->x * pV2->y - pV1->y * pV2->x; + + *pOut = v; + return pOut; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Add + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + pV2->x; + pOut->y = pV1->y + pV2->y; + pOut->z = pV1->z + pV2->z; + return pOut; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Subtract + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x - pV2->x; + pOut->y = pV1->y - pV2->y; + pOut->z = pV1->z - pV2->z; + return pOut; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Minimize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z; + return pOut; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Maximize + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z; + return pOut; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Scale + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, FLOAT s) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV) + return NULL; +#endif + + pOut->x = pV->x * s; + pOut->y = pV->y * s; + pOut->z = pV->z * s; + return pOut; +} + +D3DXINLINE D3DXVECTOR3* D3DXVec3Lerp + ( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, + FLOAT s ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + s * (pV2->x - pV1->x); + pOut->y = pV1->y + s * (pV2->y - pV1->y); + pOut->z = pV1->z + s * (pV2->z - pV1->z); + return pOut; +} + + +//-------------------------- +// 4D Vector +//-------------------------- + +D3DXINLINE FLOAT D3DXVec4Length + ( CONST D3DXVECTOR4 *pV ) +{ +#ifdef D3DX_DEBUG + if(!pV) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w); +#else + return (FLOAT) sqrt(pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w); +#endif +} + +D3DXINLINE FLOAT D3DXVec4LengthSq + ( CONST D3DXVECTOR4 *pV ) +{ +#ifdef D3DX_DEBUG + if(!pV) + return 0.0f; +#endif + + return pV->x * pV->x + pV->y * pV->y + pV->z * pV->z + pV->w * pV->w; +} + +D3DXINLINE FLOAT D3DXVec4Dot + ( CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2 ) +{ +#ifdef D3DX_DEBUG + if(!pV1 || !pV2) + return 0.0f; +#endif + + return pV1->x * pV2->x + pV1->y * pV2->y + pV1->z * pV2->z + pV1->w * pV2->w; +} + +D3DXINLINE D3DXVECTOR4* D3DXVec4Add + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + pV2->x; + pOut->y = pV1->y + pV2->y; + pOut->z = pV1->z + pV2->z; + pOut->w = pV1->w + pV2->w; + return pOut; +} + +D3DXINLINE D3DXVECTOR4* D3DXVec4Subtract + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x - pV2->x; + pOut->y = pV1->y - pV2->y; + pOut->z = pV1->z - pV2->z; + pOut->w = pV1->w - pV2->w; + return pOut; +} + +D3DXINLINE D3DXVECTOR4* D3DXVec4Minimize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x < pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y < pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z < pV2->z ? pV1->z : pV2->z; + pOut->w = pV1->w < pV2->w ? pV1->w : pV2->w; + return pOut; +} + +D3DXINLINE D3DXVECTOR4* D3DXVec4Maximize + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x > pV2->x ? pV1->x : pV2->x; + pOut->y = pV1->y > pV2->y ? pV1->y : pV2->y; + pOut->z = pV1->z > pV2->z ? pV1->z : pV2->z; + pOut->w = pV1->w > pV2->w ? pV1->w : pV2->w; + return pOut; +} + +D3DXINLINE D3DXVECTOR4* D3DXVec4Scale + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, FLOAT s) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV) + return NULL; +#endif + + pOut->x = pV->x * s; + pOut->y = pV->y * s; + pOut->z = pV->z * s; + pOut->w = pV->w * s; + return pOut; +} + +D3DXINLINE D3DXVECTOR4* D3DXVec4Lerp + ( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, + FLOAT s ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pV1 || !pV2) + return NULL; +#endif + + pOut->x = pV1->x + s * (pV2->x - pV1->x); + pOut->y = pV1->y + s * (pV2->y - pV1->y); + pOut->z = pV1->z + s * (pV2->z - pV1->z); + pOut->w = pV1->w + s * (pV2->w - pV1->w); + return pOut; +} + + +//-------------------------- +// 4D Matrix +//-------------------------- + +D3DXINLINE D3DXMATRIX* D3DXMatrixIdentity + ( D3DXMATRIX *pOut ) +{ +#ifdef D3DX_DEBUG + if(!pOut) + return NULL; +#endif + + pOut->m[0][1] = pOut->m[0][2] = pOut->m[0][3] = + pOut->m[1][0] = pOut->m[1][2] = pOut->m[1][3] = + pOut->m[2][0] = pOut->m[2][1] = pOut->m[2][3] = + pOut->m[3][0] = pOut->m[3][1] = pOut->m[3][2] = 0.0f; + + pOut->m[0][0] = pOut->m[1][1] = pOut->m[2][2] = pOut->m[3][3] = 1.0f; + return pOut; +} + + +D3DXINLINE BOOL D3DXMatrixIsIdentity + ( CONST D3DXMATRIX *pM ) +{ +#ifdef D3DX_DEBUG + if(!pM) + return FALSE; +#endif + + return pM->m[0][0] == 1.0f && pM->m[0][1] == 0.0f && pM->m[0][2] == 0.0f && pM->m[0][3] == 0.0f && + pM->m[1][0] == 0.0f && pM->m[1][1] == 1.0f && pM->m[1][2] == 0.0f && pM->m[1][3] == 0.0f && + pM->m[2][0] == 0.0f && pM->m[2][1] == 0.0f && pM->m[2][2] == 1.0f && pM->m[2][3] == 0.0f && + pM->m[3][0] == 0.0f && pM->m[3][1] == 0.0f && pM->m[3][2] == 0.0f && pM->m[3][3] == 1.0f; +} + + +//-------------------------- +// Quaternion +//-------------------------- + +D3DXINLINE FLOAT D3DXQuaternionLength + ( CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX_DEBUG + if(!pQ) + return 0.0f; +#endif + +#ifdef __cplusplus + return sqrtf(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w); +#else + return (FLOAT) sqrt(pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w); +#endif +} + +D3DXINLINE FLOAT D3DXQuaternionLengthSq + ( CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX_DEBUG + if(!pQ) + return 0.0f; +#endif + + return pQ->x * pQ->x + pQ->y * pQ->y + pQ->z * pQ->z + pQ->w * pQ->w; +} + +D3DXINLINE FLOAT D3DXQuaternionDot + ( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 ) +{ +#ifdef D3DX_DEBUG + if(!pQ1 || !pQ2) + return 0.0f; +#endif + + return pQ1->x * pQ2->x + pQ1->y * pQ2->y + pQ1->z * pQ2->z + pQ1->w * pQ2->w; +} + + +D3DXINLINE D3DXQUATERNION* D3DXQuaternionIdentity + ( D3DXQUATERNION *pOut ) +{ +#ifdef D3DX_DEBUG + if(!pOut) + return NULL; +#endif + + pOut->x = pOut->y = pOut->z = 0.0f; + pOut->w = 1.0f; + return pOut; +} + +D3DXINLINE BOOL D3DXQuaternionIsIdentity + ( CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX_DEBUG + if(!pQ) + return FALSE; +#endif + + return pQ->x == 0.0f && pQ->y == 0.0f && pQ->z == 0.0f && pQ->w == 1.0f; +} + + +D3DXINLINE D3DXQUATERNION* D3DXQuaternionConjugate + ( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pQ) + return NULL; +#endif + + pOut->x = -pQ->x; + pOut->y = -pQ->y; + pOut->z = -pQ->z; + pOut->w = pQ->w; + return pOut; +} + + +//-------------------------- +// Plane +//-------------------------- + +D3DXINLINE FLOAT D3DXPlaneDot + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR4 *pV) +{ +#ifdef D3DX_DEBUG + if(!pP || !pV) + return 0.0f; +#endif + + return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d * pV->w; +} + +D3DXINLINE FLOAT D3DXPlaneDotCoord + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV) +{ +#ifdef D3DX_DEBUG + if(!pP || !pV) + return 0.0f; +#endif + + return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z + pP->d; +} + +D3DXINLINE FLOAT D3DXPlaneDotNormal + ( CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV) +{ +#ifdef D3DX_DEBUG + if(!pP || !pV) + return 0.0f; +#endif + + return pP->a * pV->x + pP->b * pV->y + pP->c * pV->z; +} + +D3DXINLINE D3DXPLANE* D3DXPlaneScale + (D3DXPLANE *pOut, CONST D3DXPLANE *pP, FLOAT s) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pP) + return NULL; +#endif + + pOut->a = pP->a * s; + pOut->b = pP->b * s; + pOut->c = pP->c * s; + pOut->d = pP->d * s; + return pOut; +} + + +//-------------------------- +// Color +//-------------------------- + +D3DXINLINE D3DXCOLOR* D3DXColorNegative + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pC) + return NULL; +#endif + + pOut->r = 1.0f - pC->r; + pOut->g = 1.0f - pC->g; + pOut->b = 1.0f - pC->b; + pOut->a = pC->a; + return pOut; +} + +D3DXINLINE D3DXCOLOR* D3DXColorAdd + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r + pC2->r; + pOut->g = pC1->g + pC2->g; + pOut->b = pC1->b + pC2->b; + pOut->a = pC1->a + pC2->a; + return pOut; +} + +D3DXINLINE D3DXCOLOR* D3DXColorSubtract + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r - pC2->r; + pOut->g = pC1->g - pC2->g; + pOut->b = pC1->b - pC2->b; + pOut->a = pC1->a - pC2->a; + return pOut; +} + +D3DXINLINE D3DXCOLOR* D3DXColorScale + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pC) + return NULL; +#endif + + pOut->r = pC->r * s; + pOut->g = pC->g * s; + pOut->b = pC->b * s; + pOut->a = pC->a * s; + return pOut; +} + +D3DXINLINE D3DXCOLOR* D3DXColorModulate + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r * pC2->r; + pOut->g = pC1->g * pC2->g; + pOut->b = pC1->b * pC2->b; + pOut->a = pC1->a * pC2->a; + return pOut; +} + +D3DXINLINE D3DXCOLOR* D3DXColorLerp + (D3DXCOLOR *pOut, CONST D3DXCOLOR *pC1, CONST D3DXCOLOR *pC2, FLOAT s) +{ +#ifdef D3DX_DEBUG + if(!pOut || !pC1 || !pC2) + return NULL; +#endif + + pOut->r = pC1->r + s * (pC2->r - pC1->r); + pOut->g = pC1->g + s * (pC2->g - pC1->g); + pOut->b = pC1->b + s * (pC2->b - pC1->b); + pOut->a = pC1->a + s * (pC2->a - pC1->a); + return pOut; +} + + +#endif // __D3DX9MATH_INL__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dx9mesh.h b/Src/Decoder_H264_ALL/D3D/include/d3dx9mesh.h new file mode 100644 index 0000000..a009d9a --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dx9mesh.h @@ -0,0 +1,3007 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9mesh.h +// Content: D3DX mesh types and functions +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#ifndef __D3DX9MESH_H__ +#define __D3DX9MESH_H__ + +// {7ED943DD-52E8-40b5-A8D8-76685C406330} +DEFINE_GUID(IID_ID3DXBaseMesh, +0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30); + +// {4020E5C2-1403-4929-883F-E2E849FAC195} +DEFINE_GUID(IID_ID3DXMesh, +0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95); + +// {8875769A-D579-4088-AAEB-534D1AD84E96} +DEFINE_GUID(IID_ID3DXPMesh, +0x8875769a, 0xd579, 0x4088, 0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96); + +// {667EA4C7-F1CD-4386-B523-7C0290B83CC5} +DEFINE_GUID(IID_ID3DXSPMesh, +0x667ea4c7, 0xf1cd, 0x4386, 0xb5, 0x23, 0x7c, 0x2, 0x90, 0xb8, 0x3c, 0xc5); + +// {11EAA540-F9A6-4d49-AE6A-E19221F70CC4} +DEFINE_GUID(IID_ID3DXSkinInfo, +0x11eaa540, 0xf9a6, 0x4d49, 0xae, 0x6a, 0xe1, 0x92, 0x21, 0xf7, 0xc, 0xc4); + +// {3CE6CC22-DBF2-44f4-894D-F9C34A337139} +DEFINE_GUID(IID_ID3DXPatchMesh, +0x3ce6cc22, 0xdbf2, 0x44f4, 0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39); + +//patch mesh can be quads or tris +typedef enum _D3DXPATCHMESHTYPE { + D3DXPATCHMESH_RECT = 0x001, + D3DXPATCHMESH_TRI = 0x002, + D3DXPATCHMESH_NPATCH = 0x003, + + D3DXPATCHMESH_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */ +} D3DXPATCHMESHTYPE; + +// Mesh options - lower 3 bytes only, upper byte used by _D3DXMESHOPT option flags +enum _D3DXMESH { + D3DXMESH_32BIT = 0x001, // If set, then use 32 bit indices, if not set use 16 bit indices. + D3DXMESH_DONOTCLIP = 0x002, // Use D3DUSAGE_DONOTCLIP for VB & IB. + D3DXMESH_POINTS = 0x004, // Use D3DUSAGE_POINTS for VB & IB. + D3DXMESH_RTPATCHES = 0x008, // Use D3DUSAGE_RTPATCHES for VB & IB. + D3DXMESH_NPATCHES = 0x4000,// Use D3DUSAGE_NPATCHES for VB & IB. + D3DXMESH_VB_SYSTEMMEM = 0x010, // Use D3DPOOL_SYSTEMMEM for VB. Overrides D3DXMESH_MANAGEDVERTEXBUFFER + D3DXMESH_VB_MANAGED = 0x020, // Use D3DPOOL_MANAGED for VB. + D3DXMESH_VB_WRITEONLY = 0x040, // Use D3DUSAGE_WRITEONLY for VB. + D3DXMESH_VB_DYNAMIC = 0x080, // Use D3DUSAGE_DYNAMIC for VB. + D3DXMESH_VB_SOFTWAREPROCESSING = 0x8000, // Use D3DUSAGE_SOFTWAREPROCESSING for VB. + D3DXMESH_IB_SYSTEMMEM = 0x100, // Use D3DPOOL_SYSTEMMEM for IB. Overrides D3DXMESH_MANAGEDINDEXBUFFER + D3DXMESH_IB_MANAGED = 0x200, // Use D3DPOOL_MANAGED for IB. + D3DXMESH_IB_WRITEONLY = 0x400, // Use D3DUSAGE_WRITEONLY for IB. + D3DXMESH_IB_DYNAMIC = 0x800, // Use D3DUSAGE_DYNAMIC for IB. + D3DXMESH_IB_SOFTWAREPROCESSING= 0x10000, // Use D3DUSAGE_SOFTWAREPROCESSING for IB. + + D3DXMESH_VB_SHARE = 0x1000, // Valid for Clone* calls only, forces cloned mesh/pmesh to share vertex buffer + + D3DXMESH_USEHWONLY = 0x2000, // Valid for ID3DXSkinInfo::ConvertToBlendedMesh + + // Helper options + D3DXMESH_SYSTEMMEM = 0x110, // D3DXMESH_VB_SYSTEMMEM | D3DXMESH_IB_SYSTEMMEM + D3DXMESH_MANAGED = 0x220, // D3DXMESH_VB_MANAGED | D3DXMESH_IB_MANAGED + D3DXMESH_WRITEONLY = 0x440, // D3DXMESH_VB_WRITEONLY | D3DXMESH_IB_WRITEONLY + D3DXMESH_DYNAMIC = 0x880, // D3DXMESH_VB_DYNAMIC | D3DXMESH_IB_DYNAMIC + D3DXMESH_SOFTWAREPROCESSING = 0x18000, // D3DXMESH_VB_SOFTWAREPROCESSING | D3DXMESH_IB_SOFTWAREPROCESSING + +}; + +//patch mesh options +enum _D3DXPATCHMESH { + D3DXPATCHMESH_DEFAULT = 000, +}; +// option field values for specifying min value in D3DXGeneratePMesh and D3DXSimplifyMesh +enum _D3DXMESHSIMP +{ + D3DXMESHSIMP_VERTEX = 0x1, + D3DXMESHSIMP_FACE = 0x2, + +}; + +typedef enum _D3DXCLEANTYPE { + D3DXCLEAN_BACKFACING = 0x00000001, + D3DXCLEAN_BOWTIES = 0x00000002, + + // Helper options + D3DXCLEAN_SKINNING = D3DXCLEAN_BACKFACING, // Bowtie cleaning modifies geometry and breaks skinning + D3DXCLEAN_OPTIMIZATION = D3DXCLEAN_BACKFACING, + D3DXCLEAN_SIMPLIFICATION= D3DXCLEAN_BACKFACING | D3DXCLEAN_BOWTIES, +} D3DXCLEANTYPE; + +enum _MAX_FVF_DECL_SIZE +{ + MAX_FVF_DECL_SIZE = MAXD3DDECLLENGTH + 1 // +1 for END +}; + +typedef enum _D3DXTANGENT +{ + D3DXTANGENT_WRAP_U = 0x01, + D3DXTANGENT_WRAP_V = 0x02, + D3DXTANGENT_WRAP_UV = 0x03, + D3DXTANGENT_DONT_NORMALIZE_PARTIALS = 0x04, + D3DXTANGENT_DONT_ORTHOGONALIZE = 0x08, + D3DXTANGENT_ORTHOGONALIZE_FROM_V = 0x010, + D3DXTANGENT_ORTHOGONALIZE_FROM_U = 0x020, + D3DXTANGENT_WEIGHT_BY_AREA = 0x040, + D3DXTANGENT_WEIGHT_EQUAL = 0x080, + D3DXTANGENT_WIND_CW = 0x0100, + D3DXTANGENT_CALCULATE_NORMALS = 0x0200, + D3DXTANGENT_GENERATE_IN_PLACE = 0x0400, +} D3DXTANGENT; + +// D3DXIMT_WRAP_U means the texture wraps in the U direction +// D3DXIMT_WRAP_V means the texture wraps in the V direction +// D3DXIMT_WRAP_UV means the texture wraps in both directions +typedef enum _D3DXIMT +{ + D3DXIMT_WRAP_U = 0x01, + D3DXIMT_WRAP_V = 0x02, + D3DXIMT_WRAP_UV = 0x03, +} D3DXIMT; + +// These options are only valid for UVAtlasCreate and UVAtlasPartition, we may add more for UVAtlasPack if necessary +// D3DXUVATLAS_DEFAULT - Meshes with more than 25k faces go through fast, meshes with fewer than 25k faces go through quality +// D3DXUVATLAS_GEODESIC_FAST - Uses approximations to improve charting speed at the cost of added stretch or more charts. +// D3DXUVATLAS_GEODESIC_QUALITY - Provides better quality charts, but requires more time and memory than fast. +typedef enum _D3DXUVATLAS +{ + D3DXUVATLAS_DEFAULT = 0x00, + D3DXUVATLAS_GEODESIC_FAST = 0x01, + D3DXUVATLAS_GEODESIC_QUALITY = 0x02, +} D3DXUVATLAS; + +typedef struct ID3DXBaseMesh *LPD3DXBASEMESH; +typedef struct ID3DXMesh *LPD3DXMESH; +typedef struct ID3DXPMesh *LPD3DXPMESH; +typedef struct ID3DXSPMesh *LPD3DXSPMESH; +typedef struct ID3DXSkinInfo *LPD3DXSKININFO; +typedef struct ID3DXPatchMesh *LPD3DXPATCHMESH; +typedef interface ID3DXTextureGutterHelper *LPD3DXTEXTUREGUTTERHELPER; +typedef interface ID3DXPRTBuffer *LPD3DXPRTBUFFER; + + +typedef struct _D3DXATTRIBUTERANGE +{ + DWORD AttribId; + DWORD FaceStart; + DWORD FaceCount; + DWORD VertexStart; + DWORD VertexCount; +} D3DXATTRIBUTERANGE; + +typedef D3DXATTRIBUTERANGE* LPD3DXATTRIBUTERANGE; + +typedef struct _D3DXMATERIAL +{ + D3DMATERIAL9 MatD3D; + LPSTR pTextureFilename; +} D3DXMATERIAL; +typedef D3DXMATERIAL *LPD3DXMATERIAL; + +typedef enum _D3DXEFFECTDEFAULTTYPE +{ + D3DXEDT_STRING = 0x1, // pValue points to a null terminated ASCII string + D3DXEDT_FLOATS = 0x2, // pValue points to an array of floats - number of floats is NumBytes / sizeof(float) + D3DXEDT_DWORD = 0x3, // pValue points to a DWORD + + D3DXEDT_FORCEDWORD = 0x7fffffff +} D3DXEFFECTDEFAULTTYPE; + +typedef struct _D3DXEFFECTDEFAULT +{ + LPSTR pParamName; + D3DXEFFECTDEFAULTTYPE Type; // type of the data pointed to by pValue + DWORD NumBytes; // size in bytes of the data pointed to by pValue + LPVOID pValue; // data for the default of the effect +} D3DXEFFECTDEFAULT, *LPD3DXEFFECTDEFAULT; + +typedef struct _D3DXEFFECTINSTANCE +{ + LPSTR pEffectFilename; + DWORD NumDefaults; + LPD3DXEFFECTDEFAULT pDefaults; +} D3DXEFFECTINSTANCE, *LPD3DXEFFECTINSTANCE; + +typedef struct _D3DXATTRIBUTEWEIGHTS +{ + FLOAT Position; + FLOAT Boundary; + FLOAT Normal; + FLOAT Diffuse; + FLOAT Specular; + FLOAT Texcoord[8]; + FLOAT Tangent; + FLOAT Binormal; +} D3DXATTRIBUTEWEIGHTS, *LPD3DXATTRIBUTEWEIGHTS; + +enum _D3DXWELDEPSILONSFLAGS +{ + D3DXWELDEPSILONS_WELDALL = 0x1, // weld all vertices marked by adjacency as being overlapping + + D3DXWELDEPSILONS_WELDPARTIALMATCHES = 0x2, // if a given vertex component is within epsilon, modify partial matched + // vertices so that both components identical AND if all components "equal" + // remove one of the vertices + D3DXWELDEPSILONS_DONOTREMOVEVERTICES = 0x4, // instructs weld to only allow modifications to vertices and not removal + // ONLY valid if D3DXWELDEPSILONS_WELDPARTIALMATCHES is set + // useful to modify vertices to be equal, but not allow vertices to be removed + + D3DXWELDEPSILONS_DONOTSPLIT = 0x8, // instructs weld to specify the D3DXMESHOPT_DONOTSPLIT flag when doing an Optimize(ATTR_SORT) + // if this flag is not set, all vertices that are in separate attribute groups + // will remain split and not welded. Setting this flag can slow down software vertex processing + +}; + +typedef struct _D3DXWELDEPSILONS +{ + FLOAT Position; // NOTE: This does NOT replace the epsilon in GenerateAdjacency + // in general, it should be the same value or greater than the one passed to GeneratedAdjacency + FLOAT BlendWeights; + FLOAT Normal; + FLOAT PSize; + FLOAT Specular; + FLOAT Diffuse; + FLOAT Texcoord[8]; + FLOAT Tangent; + FLOAT Binormal; + FLOAT TessFactor; +} D3DXWELDEPSILONS; + +typedef D3DXWELDEPSILONS* LPD3DXWELDEPSILONS; + + +#undef INTERFACE +#define INTERFACE ID3DXBaseMesh + +DECLARE_INTERFACE_(ID3DXBaseMesh, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXBaseMesh + STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE; + STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; + STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; + STDMETHOD_(DWORD, GetFVF)(THIS) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + STDMETHOD_(DWORD, GetNumBytesPerVertex)(THIS) PURE; + STDMETHOD_(DWORD, GetOptions)(THIS) PURE; + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, + DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(CloneMesh)(THIS_ DWORD Options, + CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER9* ppVB) PURE; + STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER9* ppIB) PURE; + STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockVertexBuffer)(THIS) PURE; + STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockIndexBuffer)(THIS) PURE; + STDMETHOD(GetAttributeTable)( + THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE; + + STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE; + STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE; + STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE; + + STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; +}; + + +#undef INTERFACE +#define INTERFACE ID3DXMesh + +DECLARE_INTERFACE_(ID3DXMesh, ID3DXBaseMesh) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXBaseMesh + STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE; + STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; + STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; + STDMETHOD_(DWORD, GetFVF)(THIS) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + STDMETHOD_(DWORD, GetNumBytesPerVertex)(THIS) PURE; + STDMETHOD_(DWORD, GetOptions)(THIS) PURE; + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, + DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(CloneMesh)(THIS_ DWORD Options, + CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER9* ppVB) PURE; + STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER9* ppIB) PURE; + STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockVertexBuffer)(THIS) PURE; + STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockIndexBuffer)(THIS) PURE; + STDMETHOD(GetAttributeTable)( + THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE; + + STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE; + STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE; + STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE; + + STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + + // ID3DXMesh + STDMETHOD(LockAttributeBuffer)(THIS_ DWORD Flags, DWORD** ppData) PURE; + STDMETHOD(UnlockAttributeBuffer)(THIS) PURE; + STDMETHOD(Optimize)(THIS_ DWORD Flags, CONST DWORD* pAdjacencyIn, DWORD* pAdjacencyOut, + DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap, + LPD3DXMESH* ppOptMesh) PURE; + STDMETHOD(OptimizeInplace)(THIS_ DWORD Flags, CONST DWORD* pAdjacencyIn, DWORD* pAdjacencyOut, + DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap) PURE; + STDMETHOD(SetAttributeTable)(THIS_ CONST D3DXATTRIBUTERANGE *pAttribTable, DWORD cAttribTableSize) PURE; +}; + + +#undef INTERFACE +#define INTERFACE ID3DXPMesh + +DECLARE_INTERFACE_(ID3DXPMesh, ID3DXBaseMesh) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXBaseMesh + STDMETHOD(DrawSubset)(THIS_ DWORD AttribId) PURE; + STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; + STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; + STDMETHOD_(DWORD, GetFVF)(THIS) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + STDMETHOD_(DWORD, GetNumBytesPerVertex)(THIS) PURE; + STDMETHOD_(DWORD, GetOptions)(THIS) PURE; + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, + DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(CloneMesh)(THIS_ DWORD Options, + CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER9* ppVB) PURE; + STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER9* ppIB) PURE; + STDMETHOD(LockVertexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockVertexBuffer)(THIS) PURE; + STDMETHOD(LockIndexBuffer)(THIS_ DWORD Flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockIndexBuffer)(THIS) PURE; + STDMETHOD(GetAttributeTable)( + THIS_ D3DXATTRIBUTERANGE *pAttribTable, DWORD* pAttribTableSize) PURE; + + STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* pPRep, DWORD* pAdjacency) PURE; + STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* pAdjacency, DWORD* pPRep) PURE; + STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Epsilon, DWORD* pAdjacency) PURE; + + STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + + // ID3DXPMesh + STDMETHOD(ClonePMeshFVF)(THIS_ DWORD Options, + DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXPMESH* ppCloneMesh) PURE; + STDMETHOD(ClonePMesh)(THIS_ DWORD Options, + CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, LPD3DXPMESH* ppCloneMesh) PURE; + STDMETHOD(SetNumFaces)(THIS_ DWORD Faces) PURE; + STDMETHOD(SetNumVertices)(THIS_ DWORD Vertices) PURE; + STDMETHOD_(DWORD, GetMaxFaces)(THIS) PURE; + STDMETHOD_(DWORD, GetMinFaces)(THIS) PURE; + STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE; + STDMETHOD_(DWORD, GetMinVertices)(THIS) PURE; + STDMETHOD(Save)(THIS_ IStream *pStream, CONST D3DXMATERIAL* pMaterials, CONST D3DXEFFECTINSTANCE* pEffectInstances, DWORD NumMaterials) PURE; + + STDMETHOD(Optimize)(THIS_ DWORD Flags, DWORD* pAdjacencyOut, + DWORD* pFaceRemap, LPD3DXBUFFER *ppVertexRemap, + LPD3DXMESH* ppOptMesh) PURE; + + STDMETHOD(OptimizeBaseLOD)(THIS_ DWORD Flags, DWORD* pFaceRemap) PURE; + STDMETHOD(TrimByFaces)(THIS_ DWORD NewFacesMin, DWORD NewFacesMax, DWORD *rgiFaceRemap, DWORD *rgiVertRemap) PURE; + STDMETHOD(TrimByVertices)(THIS_ DWORD NewVerticesMin, DWORD NewVerticesMax, DWORD *rgiFaceRemap, DWORD *rgiVertRemap) PURE; + + STDMETHOD(GetAdjacency)(THIS_ DWORD* pAdjacency) PURE; + + // Used to generate the immediate "ancestor" for each vertex when it is removed by a vsplit. Allows generation of geomorphs + // Vertex buffer must be equal to or greater than the maximum number of vertices in the pmesh + STDMETHOD(GenerateVertexHistory)(THIS_ DWORD* pVertexHistory) PURE; +}; + + +#undef INTERFACE +#define INTERFACE ID3DXSPMesh + +DECLARE_INTERFACE_(ID3DXSPMesh, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXSPMesh + STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE; + STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; + STDMETHOD_(DWORD, GetFVF)(THIS) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + STDMETHOD_(DWORD, GetOptions)(THIS) PURE; + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* ppDevice) PURE; + STDMETHOD(CloneMeshFVF)(THIS_ DWORD Options, + DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, DWORD *pAdjacencyOut, DWORD *pVertexRemapOut, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(CloneMesh)(THIS_ DWORD Options, + CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, DWORD *pAdjacencyOut, DWORD *pVertexRemapOut, LPD3DXMESH* ppCloneMesh) PURE; + STDMETHOD(ClonePMeshFVF)(THIS_ DWORD Options, + DWORD FVF, LPDIRECT3DDEVICE9 pD3DDevice, DWORD *pVertexRemapOut, FLOAT *pErrorsByFace, LPD3DXPMESH* ppCloneMesh) PURE; + STDMETHOD(ClonePMesh)(THIS_ DWORD Options, + CONST D3DVERTEXELEMENT9 *pDeclaration, LPDIRECT3DDEVICE9 pD3DDevice, DWORD *pVertexRemapOut, FLOAT *pErrorsbyFace, LPD3DXPMESH* ppCloneMesh) PURE; + STDMETHOD(ReduceFaces)(THIS_ DWORD Faces) PURE; + STDMETHOD(ReduceVertices)(THIS_ DWORD Vertices) PURE; + STDMETHOD_(DWORD, GetMaxFaces)(THIS) PURE; + STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE; + STDMETHOD(GetVertexAttributeWeights)(THIS_ LPD3DXATTRIBUTEWEIGHTS pVertexAttributeWeights) PURE; + STDMETHOD(GetVertexWeights)(THIS_ FLOAT *pVertexWeights) PURE; +}; + +#define UNUSED16 (0xffff) +#define UNUSED32 (0xffffffff) + +// ID3DXMesh::Optimize options - upper byte only, lower 3 bytes used from _D3DXMESH option flags +enum _D3DXMESHOPT { + D3DXMESHOPT_COMPACT = 0x01000000, + D3DXMESHOPT_ATTRSORT = 0x02000000, + D3DXMESHOPT_VERTEXCACHE = 0x04000000, + D3DXMESHOPT_STRIPREORDER = 0x08000000, + D3DXMESHOPT_IGNOREVERTS = 0x10000000, // optimize faces only, don't touch vertices + D3DXMESHOPT_DONOTSPLIT = 0x20000000, // do not split vertices shared between attribute groups when attribute sorting + D3DXMESHOPT_DEVICEINDEPENDENT = 0x00400000, // Only affects VCache. uses a static known good cache size for all cards + + // D3DXMESHOPT_SHAREVB has been removed, please use D3DXMESH_VB_SHARE instead + +}; + +// Subset of the mesh that has the same attribute and bone combination. +// This subset can be rendered in a single draw call +typedef struct _D3DXBONECOMBINATION +{ + DWORD AttribId; + DWORD FaceStart; + DWORD FaceCount; + DWORD VertexStart; + DWORD VertexCount; + DWORD* BoneId; +} D3DXBONECOMBINATION, *LPD3DXBONECOMBINATION; + +// The following types of patch combinations are supported: +// Patch type Basis Degree +// Rect Bezier 2,3,5 +// Rect B-Spline 2,3,5 +// Rect Catmull-Rom 3 +// Tri Bezier 2,3,5 +// N-Patch N/A 3 + +typedef struct _D3DXPATCHINFO +{ + D3DXPATCHMESHTYPE PatchType; + D3DDEGREETYPE Degree; + D3DBASISTYPE Basis; +} D3DXPATCHINFO, *LPD3DXPATCHINFO; + +#undef INTERFACE +#define INTERFACE ID3DXPatchMesh + +DECLARE_INTERFACE_(ID3DXPatchMesh, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXPatchMesh + + // Return creation parameters + STDMETHOD_(DWORD, GetNumPatches)(THIS) PURE; + STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + STDMETHOD_(DWORD, GetControlVerticesPerPatch)(THIS) PURE; + STDMETHOD_(DWORD, GetOptions)(THIS) PURE; + STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *ppDevice) PURE; + STDMETHOD(GetPatchInfo)(THIS_ LPD3DXPATCHINFO PatchInfo) PURE; + + // Control mesh access + STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER9* ppVB) PURE; + STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER9* ppIB) PURE; + STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockVertexBuffer)(THIS) PURE; + STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, LPVOID *ppData) PURE; + STDMETHOD(UnlockIndexBuffer)(THIS) PURE; + STDMETHOD(LockAttributeBuffer)(THIS_ DWORD flags, DWORD** ppData) PURE; + STDMETHOD(UnlockAttributeBuffer)(THIS) PURE; + + // This function returns the size of the tessellated mesh given a tessellation level. + // This assumes uniform tessellation. For adaptive tessellation the Adaptive parameter must + // be set to TRUE and TessellationLevel should be the max tessellation. + // This will result in the max mesh size necessary for adaptive tessellation. + STDMETHOD(GetTessSize)(THIS_ FLOAT fTessLevel,DWORD Adaptive, DWORD *NumTriangles,DWORD *NumVertices) PURE; + + //GenerateAdjacency determines which patches are adjacent with provided tolerance + //this information is used internally to optimize tessellation + STDMETHOD(GenerateAdjacency)(THIS_ FLOAT Tolerance) PURE; + + //CloneMesh Creates a new patchmesh with the specified decl, and converts the vertex buffer + //to the new decl. Entries in the new decl which are new are set to 0. If the current mesh + //has adjacency, the new mesh will also have adjacency + STDMETHOD(CloneMesh)(THIS_ DWORD Options, CONST D3DVERTEXELEMENT9 *pDecl, LPD3DXPATCHMESH *pMesh) PURE; + + // Optimizes the patchmesh for efficient tessellation. This function is designed + // to perform one time optimization for patch meshes that need to be tessellated + // repeatedly by calling the Tessellate() method. The optimization performed is + // independent of the actual tessellation level used. + // Currently Flags is unused. + // If vertices are changed, Optimize must be called again + STDMETHOD(Optimize)(THIS_ DWORD flags) PURE; + + //gets and sets displacement parameters + //displacement maps can only be 2D textures MIP-MAPPING is ignored for non adapative tessellation + STDMETHOD(SetDisplaceParam)(THIS_ LPDIRECT3DBASETEXTURE9 Texture, + D3DTEXTUREFILTERTYPE MinFilter, + D3DTEXTUREFILTERTYPE MagFilter, + D3DTEXTUREFILTERTYPE MipFilter, + D3DTEXTUREADDRESS Wrap, + DWORD dwLODBias) PURE; + + STDMETHOD(GetDisplaceParam)(THIS_ LPDIRECT3DBASETEXTURE9 *Texture, + D3DTEXTUREFILTERTYPE *MinFilter, + D3DTEXTUREFILTERTYPE *MagFilter, + D3DTEXTUREFILTERTYPE *MipFilter, + D3DTEXTUREADDRESS *Wrap, + DWORD *dwLODBias) PURE; + + // Performs the uniform tessellation based on the tessellation level. + // This function will perform more efficiently if the patch mesh has been optimized using the Optimize() call. + STDMETHOD(Tessellate)(THIS_ FLOAT fTessLevel,LPD3DXMESH pMesh) PURE; + + // Performs adaptive tessellation based on the Z based adaptive tessellation criterion. + // pTrans specifies a 4D vector that is dotted with the vertices to get the per vertex + // adaptive tessellation amount. Each edge is tessellated to the average of the criterion + // at the 2 vertices it connects. + // MaxTessLevel specifies the upper limit for adaptive tesselation. + // This function will perform more efficiently if the patch mesh has been optimized using the Optimize() call. + STDMETHOD(TessellateAdaptive)(THIS_ + CONST D3DXVECTOR4 *pTrans, + DWORD dwMaxTessLevel, + DWORD dwMinTessLevel, + LPD3DXMESH pMesh) PURE; + +}; + +#undef INTERFACE +#define INTERFACE ID3DXSkinInfo + +DECLARE_INTERFACE_(ID3DXSkinInfo, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Specify the which vertices do each bones influence and by how much + STDMETHOD(SetBoneInfluence)(THIS_ DWORD bone, DWORD numInfluences, CONST DWORD* vertices, CONST FLOAT* weights) PURE; + STDMETHOD(SetBoneVertexInfluence)(THIS_ DWORD boneNum, DWORD influenceNum, float weight) PURE; + STDMETHOD_(DWORD, GetNumBoneInfluences)(THIS_ DWORD bone) PURE; + STDMETHOD(GetBoneInfluence)(THIS_ DWORD bone, DWORD* vertices, FLOAT* weights) PURE; + STDMETHOD(GetBoneVertexInfluence)(THIS_ DWORD boneNum, DWORD influenceNum, float *pWeight, DWORD *pVertexNum) PURE; + STDMETHOD(GetMaxVertexInfluences)(THIS_ DWORD* maxVertexInfluences) PURE; + STDMETHOD_(DWORD, GetNumBones)(THIS) PURE; + STDMETHOD(FindBoneVertexInfluenceIndex)(THIS_ DWORD boneNum, DWORD vertexNum, DWORD *pInfluenceIndex) PURE; + + // This gets the max face influences based on a triangle mesh with the specified index buffer + STDMETHOD(GetMaxFaceInfluences)(THIS_ LPDIRECT3DINDEXBUFFER9 pIB, DWORD NumFaces, DWORD* maxFaceInfluences) PURE; + + // Set min bone influence. Bone influences that are smaller than this are ignored + STDMETHOD(SetMinBoneInfluence)(THIS_ FLOAT MinInfl) PURE; + // Get min bone influence. + STDMETHOD_(FLOAT, GetMinBoneInfluence)(THIS) PURE; + + // Bone names are returned by D3DXLoadSkinMeshFromXof. They are not used by any other method of this object + STDMETHOD(SetBoneName)(THIS_ DWORD Bone, LPCSTR pName) PURE; // pName is copied to an internal string buffer + STDMETHOD_(LPCSTR, GetBoneName)(THIS_ DWORD Bone) PURE; // A pointer to an internal string buffer is returned. Do not free this. + + // Bone offset matrices are returned by D3DXLoadSkinMeshFromXof. They are not used by any other method of this object + STDMETHOD(SetBoneOffsetMatrix)(THIS_ DWORD Bone, CONST D3DXMATRIX *pBoneTransform) PURE; // pBoneTransform is copied to an internal buffer + STDMETHOD_(LPD3DXMATRIX, GetBoneOffsetMatrix)(THIS_ DWORD Bone) PURE; // A pointer to an internal matrix is returned. Do not free this. + + // Clone a skin info object + STDMETHOD(Clone)(THIS_ LPD3DXSKININFO* ppSkinInfo) PURE; + + // Update bone influence information to match vertices after they are reordered. This should be called + // if the target vertex buffer has been reordered externally. + STDMETHOD(Remap)(THIS_ DWORD NumVertices, DWORD* pVertexRemap) PURE; + + // These methods enable the modification of the vertex layout of the vertices that will be skinned + STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; + STDMETHOD(SetDeclaration)(THIS_ CONST D3DVERTEXELEMENT9 *pDeclaration) PURE; + STDMETHOD_(DWORD, GetFVF)(THIS) PURE; + STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE]) PURE; + + // Apply SW skinning based on current pose matrices to the target vertices. + STDMETHOD(UpdateSkinnedMesh)(THIS_ + CONST D3DXMATRIX* pBoneTransforms, + CONST D3DXMATRIX* pBoneInvTransposeTransforms, + LPCVOID pVerticesSrc, + PVOID pVerticesDst) PURE; + + // Takes a mesh and returns a new mesh with per vertex blend weights and a bone combination + // table that describes which bones affect which subsets of the mesh + STDMETHOD(ConvertToBlendedMesh)(THIS_ + LPD3DXMESH pMesh, + DWORD Options, + CONST DWORD *pAdjacencyIn, + LPDWORD pAdjacencyOut, + DWORD* pFaceRemap, + LPD3DXBUFFER *ppVertexRemap, + DWORD* pMaxFaceInfl, + DWORD* pNumBoneCombinations, + LPD3DXBUFFER* ppBoneCombinationTable, + LPD3DXMESH* ppMesh) PURE; + + // Takes a mesh and returns a new mesh with per vertex blend weights and indices + // and a bone combination table that describes which bones palettes affect which subsets of the mesh + STDMETHOD(ConvertToIndexedBlendedMesh)(THIS_ + LPD3DXMESH pMesh, + DWORD Options, + DWORD paletteSize, + CONST DWORD *pAdjacencyIn, + LPDWORD pAdjacencyOut, + DWORD* pFaceRemap, + LPD3DXBUFFER *ppVertexRemap, + DWORD* pMaxVertexInfl, + DWORD* pNumBoneCombinations, + LPD3DXBUFFER* ppBoneCombinationTable, + LPD3DXMESH* ppMesh) PURE; +}; + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +HRESULT WINAPI + D3DXCreateMesh( + DWORD NumFaces, + DWORD NumVertices, + DWORD Options, + CONST D3DVERTEXELEMENT9 *pDeclaration, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXMESH* ppMesh); + +HRESULT WINAPI + D3DXCreateMeshFVF( + DWORD NumFaces, + DWORD NumVertices, + DWORD Options, + DWORD FVF, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXMESH* ppMesh); + +HRESULT WINAPI + D3DXCreateSPMesh( + LPD3DXMESH pMesh, + CONST DWORD* pAdjacency, + CONST D3DXATTRIBUTEWEIGHTS *pVertexAttributeWeights, + CONST FLOAT *pVertexWeights, + LPD3DXSPMESH* ppSMesh); + +// clean a mesh up for simplification, try to make manifold +HRESULT WINAPI + D3DXCleanMesh( + D3DXCLEANTYPE CleanType, + LPD3DXMESH pMeshIn, + CONST DWORD* pAdjacencyIn, + LPD3DXMESH* ppMeshOut, + DWORD* pAdjacencyOut, + LPD3DXBUFFER* ppErrorsAndWarnings); + +HRESULT WINAPI + D3DXValidMesh( + LPD3DXMESH pMeshIn, + CONST DWORD* pAdjacency, + LPD3DXBUFFER* ppErrorsAndWarnings); + +HRESULT WINAPI + D3DXGeneratePMesh( + LPD3DXMESH pMesh, + CONST DWORD* pAdjacency, + CONST D3DXATTRIBUTEWEIGHTS *pVertexAttributeWeights, + CONST FLOAT *pVertexWeights, + DWORD MinValue, + DWORD Options, + LPD3DXPMESH* ppPMesh); + +HRESULT WINAPI + D3DXSimplifyMesh( + LPD3DXMESH pMesh, + CONST DWORD* pAdjacency, + CONST D3DXATTRIBUTEWEIGHTS *pVertexAttributeWeights, + CONST FLOAT *pVertexWeights, + DWORD MinValue, + DWORD Options, + LPD3DXMESH* ppMesh); + +HRESULT WINAPI + D3DXComputeBoundingSphere( + CONST D3DXVECTOR3 *pFirstPosition, // pointer to first position + DWORD NumVertices, + DWORD dwStride, // count in bytes to subsequent position vectors + D3DXVECTOR3 *pCenter, + FLOAT *pRadius); + +HRESULT WINAPI + D3DXComputeBoundingBox( + CONST D3DXVECTOR3 *pFirstPosition, // pointer to first position + DWORD NumVertices, + DWORD dwStride, // count in bytes to subsequent position vectors + D3DXVECTOR3 *pMin, + D3DXVECTOR3 *pMax); + +HRESULT WINAPI + D3DXComputeNormals( + LPD3DXBASEMESH pMesh, + CONST DWORD *pAdjacency); + +HRESULT WINAPI + D3DXCreateBuffer( + DWORD NumBytes, + LPD3DXBUFFER *ppBuffer); + + +HRESULT WINAPI + D3DXLoadMeshFromXA( + LPCSTR pFilename, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER *ppAdjacency, + LPD3DXBUFFER *ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + DWORD *pNumMaterials, + LPD3DXMESH *ppMesh); + +HRESULT WINAPI + D3DXLoadMeshFromXW( + LPCWSTR pFilename, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER *ppAdjacency, + LPD3DXBUFFER *ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + DWORD *pNumMaterials, + LPD3DXMESH *ppMesh); + +#ifdef UNICODE +#define D3DXLoadMeshFromX D3DXLoadMeshFromXW +#else +#define D3DXLoadMeshFromX D3DXLoadMeshFromXA +#endif + +HRESULT WINAPI + D3DXLoadMeshFromXInMemory( + LPCVOID Memory, + DWORD SizeOfMemory, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER *ppAdjacency, + LPD3DXBUFFER *ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + DWORD *pNumMaterials, + LPD3DXMESH *ppMesh); + +HRESULT WINAPI + D3DXLoadMeshFromXResource( + HMODULE Module, + LPCSTR Name, + LPCSTR Type, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER *ppAdjacency, + LPD3DXBUFFER *ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + DWORD *pNumMaterials, + LPD3DXMESH *ppMesh); + +HRESULT WINAPI + D3DXSaveMeshToXA( + LPCSTR pFilename, + LPD3DXMESH pMesh, + CONST DWORD* pAdjacency, + CONST D3DXMATERIAL* pMaterials, + CONST D3DXEFFECTINSTANCE* pEffectInstances, + DWORD NumMaterials, + DWORD Format + ); + +HRESULT WINAPI + D3DXSaveMeshToXW( + LPCWSTR pFilename, + LPD3DXMESH pMesh, + CONST DWORD* pAdjacency, + CONST D3DXMATERIAL* pMaterials, + CONST D3DXEFFECTINSTANCE* pEffectInstances, + DWORD NumMaterials, + DWORD Format + ); + +#ifdef UNICODE +#define D3DXSaveMeshToX D3DXSaveMeshToXW +#else +#define D3DXSaveMeshToX D3DXSaveMeshToXA +#endif + + +HRESULT WINAPI + D3DXCreatePMeshFromStream( + IStream *pStream, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER *ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + DWORD* pNumMaterials, + LPD3DXPMESH *ppPMesh); + +// Creates a skin info object based on the number of vertices, number of bones, and a declaration describing the vertex layout of the target vertices +// The bone names and initial bone transforms are not filled in the skin info object by this method. +HRESULT WINAPI + D3DXCreateSkinInfo( + DWORD NumVertices, + CONST D3DVERTEXELEMENT9 *pDeclaration, + DWORD NumBones, + LPD3DXSKININFO* ppSkinInfo); + +// Creates a skin info object based on the number of vertices, number of bones, and a FVF describing the vertex layout of the target vertices +// The bone names and initial bone transforms are not filled in the skin info object by this method. +HRESULT WINAPI + D3DXCreateSkinInfoFVF( + DWORD NumVertices, + DWORD FVF, + DWORD NumBones, + LPD3DXSKININFO* ppSkinInfo); + +#ifdef __cplusplus +} + +extern "C" { +#endif //__cplusplus + +HRESULT WINAPI + D3DXLoadMeshFromXof( + LPD3DXFILEDATA pxofMesh, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER *ppAdjacency, + LPD3DXBUFFER *ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + DWORD *pNumMaterials, + LPD3DXMESH *ppMesh); + +// This similar to D3DXLoadMeshFromXof, except also returns skinning info if present in the file +// If skinning info is not present, ppSkinInfo will be NULL +HRESULT WINAPI + D3DXLoadSkinMeshFromXof( + LPD3DXFILEDATA pxofMesh, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER* ppAdjacency, + LPD3DXBUFFER* ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + DWORD *pMatOut, + LPD3DXSKININFO* ppSkinInfo, + LPD3DXMESH* ppMesh); + + +// The inverse of D3DXConvertTo{Indexed}BlendedMesh() functions. It figures out the skinning info from +// the mesh and the bone combination table and populates a skin info object with that data. The bone +// names and initial bone transforms are not filled in the skin info object by this method. This works +// with either a non-indexed or indexed blended mesh. It examines the FVF or declarator of the mesh to +// determine what type it is. +HRESULT WINAPI + D3DXCreateSkinInfoFromBlendedMesh( + LPD3DXBASEMESH pMesh, + DWORD NumBones, + CONST D3DXBONECOMBINATION *pBoneCombinationTable, + LPD3DXSKININFO* ppSkinInfo); + +HRESULT WINAPI + D3DXTessellateNPatches( + LPD3DXMESH pMeshIn, + CONST DWORD* pAdjacencyIn, + FLOAT NumSegs, + BOOL QuadraticInterpNormals, // if false use linear intrep for normals, if true use quadratic + LPD3DXMESH *ppMeshOut, + LPD3DXBUFFER *ppAdjacencyOut); + + +//generates implied outputdecl from input decl +//the decl generated from this should be used to generate the output decl for +//the tessellator subroutines. + +HRESULT WINAPI + D3DXGenerateOutputDecl( + D3DVERTEXELEMENT9 *pOutput, + CONST D3DVERTEXELEMENT9 *pInput); + +//loads patches from an XFileData +//since an X file can have up to 6 different patch meshes in it, +//returns them in an array - pNumPatches will contain the number of +//meshes in the actual file. +HRESULT WINAPI + D3DXLoadPatchMeshFromXof( + LPD3DXFILEDATA pXofObjMesh, + DWORD Options, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXBUFFER *ppMaterials, + LPD3DXBUFFER *ppEffectInstances, + PDWORD pNumMaterials, + LPD3DXPATCHMESH *ppMesh); + +//computes the size a single rect patch. +HRESULT WINAPI + D3DXRectPatchSize( + CONST FLOAT *pfNumSegs, //segments for each edge (4) + DWORD *pdwTriangles, //output number of triangles + DWORD *pdwVertices); //output number of vertices + +//computes the size of a single triangle patch +HRESULT WINAPI + D3DXTriPatchSize( + CONST FLOAT *pfNumSegs, //segments for each edge (3) + DWORD *pdwTriangles, //output number of triangles + DWORD *pdwVertices); //output number of vertices + + +//tessellates a patch into a created mesh +//similar to D3D RT patch +HRESULT WINAPI + D3DXTessellateRectPatch( + LPDIRECT3DVERTEXBUFFER9 pVB, + CONST FLOAT *pNumSegs, + CONST D3DVERTEXELEMENT9 *pdwInDecl, + CONST D3DRECTPATCH_INFO *pRectPatchInfo, + LPD3DXMESH pMesh); + + +HRESULT WINAPI + D3DXTessellateTriPatch( + LPDIRECT3DVERTEXBUFFER9 pVB, + CONST FLOAT *pNumSegs, + CONST D3DVERTEXELEMENT9 *pInDecl, + CONST D3DTRIPATCH_INFO *pTriPatchInfo, + LPD3DXMESH pMesh); + + + +//creates an NPatch PatchMesh from a D3DXMESH +HRESULT WINAPI + D3DXCreateNPatchMesh( + LPD3DXMESH pMeshSysMem, + LPD3DXPATCHMESH *pPatchMesh); + + +//creates a patch mesh +HRESULT WINAPI + D3DXCreatePatchMesh( + CONST D3DXPATCHINFO *pInfo, //patch type + DWORD dwNumPatches, //number of patches + DWORD dwNumVertices, //number of control vertices + DWORD dwOptions, //options + CONST D3DVERTEXELEMENT9 *pDecl, //format of control vertices + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXPATCHMESH *pPatchMesh); + + +//returns the number of degenerates in a patch mesh - +//text output put in string. +HRESULT WINAPI + D3DXValidPatchMesh(LPD3DXPATCHMESH pMesh, + DWORD *dwcDegenerateVertices, + DWORD *dwcDegeneratePatches, + LPD3DXBUFFER *ppErrorsAndWarnings); + +UINT WINAPI + D3DXGetFVFVertexSize(DWORD FVF); + +UINT WINAPI + D3DXGetDeclVertexSize(CONST D3DVERTEXELEMENT9 *pDecl,DWORD Stream); + +UINT WINAPI + D3DXGetDeclLength(CONST D3DVERTEXELEMENT9 *pDecl); + +HRESULT WINAPI + D3DXDeclaratorFromFVF( + DWORD FVF, + D3DVERTEXELEMENT9 pDeclarator[MAX_FVF_DECL_SIZE]); + +HRESULT WINAPI + D3DXFVFFromDeclarator( + CONST D3DVERTEXELEMENT9 *pDeclarator, + DWORD *pFVF); + +HRESULT WINAPI + D3DXWeldVertices( + LPD3DXMESH pMesh, + DWORD Flags, + CONST D3DXWELDEPSILONS *pEpsilons, + CONST DWORD *pAdjacencyIn, + DWORD *pAdjacencyOut, + DWORD *pFaceRemap, + LPD3DXBUFFER *ppVertexRemap); + +typedef struct _D3DXINTERSECTINFO +{ + DWORD FaceIndex; // index of face intersected + FLOAT U; // Barycentric Hit Coordinates + FLOAT V; // Barycentric Hit Coordinates + FLOAT Dist; // Ray-Intersection Parameter Distance +} D3DXINTERSECTINFO, *LPD3DXINTERSECTINFO; + + +HRESULT WINAPI + D3DXIntersect( + LPD3DXBASEMESH pMesh, + CONST D3DXVECTOR3 *pRayPos, + CONST D3DXVECTOR3 *pRayDir, + BOOL *pHit, // True if any faces were intersected + DWORD *pFaceIndex, // index of closest face intersected + FLOAT *pU, // Barycentric Hit Coordinates + FLOAT *pV, // Barycentric Hit Coordinates + FLOAT *pDist, // Ray-Intersection Parameter Distance + LPD3DXBUFFER *ppAllHits, // Array of D3DXINTERSECTINFOs for all hits (not just closest) + DWORD *pCountOfHits); // Number of entries in AllHits array + +HRESULT WINAPI + D3DXIntersectSubset( + LPD3DXBASEMESH pMesh, + DWORD AttribId, + CONST D3DXVECTOR3 *pRayPos, + CONST D3DXVECTOR3 *pRayDir, + BOOL *pHit, // True if any faces were intersected + DWORD *pFaceIndex, // index of closest face intersected + FLOAT *pU, // Barycentric Hit Coordinates + FLOAT *pV, // Barycentric Hit Coordinates + FLOAT *pDist, // Ray-Intersection Parameter Distance + LPD3DXBUFFER *ppAllHits, // Array of D3DXINTERSECTINFOs for all hits (not just closest) + DWORD *pCountOfHits); // Number of entries in AllHits array + + +HRESULT WINAPI D3DXSplitMesh + ( + LPD3DXMESH pMeshIn, + CONST DWORD *pAdjacencyIn, + CONST DWORD MaxSize, + CONST DWORD Options, + DWORD *pMeshesOut, + LPD3DXBUFFER *ppMeshArrayOut, + LPD3DXBUFFER *ppAdjacencyArrayOut, + LPD3DXBUFFER *ppFaceRemapArrayOut, + LPD3DXBUFFER *ppVertRemapArrayOut + ); + +BOOL WINAPI D3DXIntersectTri +( + CONST D3DXVECTOR3 *p0, // Triangle vertex 0 position + CONST D3DXVECTOR3 *p1, // Triangle vertex 1 position + CONST D3DXVECTOR3 *p2, // Triangle vertex 2 position + CONST D3DXVECTOR3 *pRayPos, // Ray origin + CONST D3DXVECTOR3 *pRayDir, // Ray direction + FLOAT *pU, // Barycentric Hit Coordinates + FLOAT *pV, // Barycentric Hit Coordinates + FLOAT *pDist); // Ray-Intersection Parameter Distance + +BOOL WINAPI + D3DXSphereBoundProbe( + CONST D3DXVECTOR3 *pCenter, + FLOAT Radius, + CONST D3DXVECTOR3 *pRayPosition, + CONST D3DXVECTOR3 *pRayDirection); + +BOOL WINAPI + D3DXBoxBoundProbe( + CONST D3DXVECTOR3 *pMin, + CONST D3DXVECTOR3 *pMax, + CONST D3DXVECTOR3 *pRayPosition, + CONST D3DXVECTOR3 *pRayDirection); + + +HRESULT WINAPI D3DXComputeTangentFrame(ID3DXMesh *pMesh, + DWORD dwOptions); + +HRESULT WINAPI D3DXComputeTangentFrameEx(ID3DXMesh *pMesh, + DWORD dwTextureInSemantic, + DWORD dwTextureInIndex, + DWORD dwUPartialOutSemantic, + DWORD dwUPartialOutIndex, + DWORD dwVPartialOutSemantic, + DWORD dwVPartialOutIndex, + DWORD dwNormalOutSemantic, + DWORD dwNormalOutIndex, + DWORD dwOptions, + CONST DWORD *pdwAdjacency, + FLOAT fPartialEdgeThreshold, + FLOAT fSingularPointThreshold, + FLOAT fNormalEdgeThreshold, + ID3DXMesh **ppMeshOut, + ID3DXBuffer **ppVertexMapping); + + +//D3DXComputeTangent +// +//Computes the Tangent vectors for the TexStage texture coordinates +//and places the results in the TANGENT[TangentIndex] specified in the meshes' DECL +//puts the binorm in BINORM[BinormIndex] also specified in the decl. +// +//If neither the binorm or the tangnet are in the meshes declaration, +//the function will fail. +// +//If a tangent or Binorm field is in the Decl, but the user does not +//wish D3DXComputeTangent to replace them, then D3DX_DEFAULT specified +//in the TangentIndex or BinormIndex will cause it to ignore the specified +//semantic. +// +//Wrap should be specified if the texture coordinates wrap. + +HRESULT WINAPI D3DXComputeTangent(LPD3DXMESH Mesh, + DWORD TexStage, + DWORD TangentIndex, + DWORD BinormIndex, + DWORD Wrap, + CONST DWORD *pAdjacency); + +//============================================================================ +// +// UVAtlas apis +// +//============================================================================ +typedef HRESULT (WINAPI *LPD3DXUVATLASCB)(FLOAT fPercentDone, LPVOID lpUserContext); + +// This function creates atlases for meshes. There are two modes of operation, +// either based on the number of charts, or the maximum allowed stretch. If the +// maximum allowed stretch is 0, then each triangle will likely be in its own +// chart. + +// +// The parameters are as follows: +// pMesh - Input mesh to calculate an atlas for. This must have a position +// channel and at least a 2-d texture channel. +// uMaxChartNumber - The maximum number of charts required for the atlas. +// If this is 0, it will be parameterized based solely on +// stretch. +// fMaxStretch - The maximum amount of stretch, if 0, no stretching is allowed, +// if 1, then any amount of stretching is allowed. +// uWidth - The width of the texture the atlas will be used on. +// uHeight - The height of the texture the atlas will be used on. +// fGutter - The minimum distance, in texels between two charts on the atlas. +// this gets scaled by the width, so if fGutter is 2.5, and it is +// used on a 512x512 texture, then the minimum distance will be +// 2.5 / 512 in u-v space. +// dwTextureIndex - Specifies which texture coordinate to write to in the +// output mesh (which is cloned from the input mesh). Useful +// if your vertex has multiple texture coordinates. +// pdwAdjacency - a pointer to an array with 3 DWORDs per face, indicating +// which triangles are adjacent to each other. +// pdwFalseEdgeAdjacency - a pointer to an array with 3 DWORDS per face, indicating +// at each face, whether an edge is a false edge or not (using +// the same ordering as the adjacency data structure). If this +// is NULL, then it is assumed that there are no false edges. If +// not NULL, then a non-false edge is indicated by -1 and a false +// edge is indicated by any other value (it is not required, but +// it may be useful for the caller to use the original adjacency +// value). This allows you to parameterize a mesh of quads, and +// the edges down the middle of each quad will not be cut when +// parameterizing the mesh. +// pfIMTArray - a pointer to an array with 3 FLOATs per face, describing the +// integrated metric tensor for that face. This lets you control +// the way this triangle may be stretched in the atlas. The IMT +// passed in will be 3 floats (a,b,c) and specify a symmetric +// matrix (a b) that, given a vector (s,t), specifies the +// (b c) +// distance between a vector v1 and a vector v2 = v1 + (s,t) as +// sqrt((s, t) * M * (s, t)^T). +// In other words, this lets one specify the magnitude of the +// stretch in an arbitrary direction in u-v space. For example +// if a = b = c = 1, then this scales the vector (1,1) by 2, and +// the vector (1,-1) by 0. Note that this is multiplying the edge +// length by the square of the matrix, so if you want the face to +// stretch to twice its +// size with no shearing, the IMT value should be (2, 0, 2), which +// is just the identity matrix times 2. +// Note that this assumes you have an orientation for the triangle +// in some 2-D space. For D3DXUVAtlas, this space is created by +// letting S be the direction from the first to the second +// vertex, and T be the cross product between the normal and S. +// +// pStatusCallback - Since the atlas creation process can be very CPU intensive, +// this allows the programmer to specify a function to be called +// periodically, similarly to how it is done in the PRT simulation +// engine. +// fCallbackFrequency - This lets you specify how often the callback will be +// called. A decent default should be 0.0001f. +// pUserContext - a void pointer to be passed back to the callback function +// dwOptions - A combination of flags in the D3DXUVATLAS enum +// ppMeshOut - A pointer to a location to store a pointer for the newly created +// mesh. +// ppFacePartitioning - A pointer to a location to store a pointer for an array, +// one DWORD per face, giving the final partitioning +// created by the atlasing algorithm. +// ppVertexRemapArray - A pointer to a location to store a pointer for an array, +// one DWORD per vertex, giving the vertex it was copied +// from, if any vertices needed to be split. +// pfMaxStretchOut - A location to store the maximum stretch resulting from the +// atlasing algorithm. +// puNumChartsOut - A location to store the number of charts created, or if the +// maximum number of charts was too low, this gives the minimum +// number of charts needed to create an atlas. + +HRESULT WINAPI D3DXUVAtlasCreate(LPD3DXMESH pMesh, + UINT uMaxChartNumber, + FLOAT fMaxStretch, + UINT uWidth, + UINT uHeight, + FLOAT fGutter, + DWORD dwTextureIndex, + CONST DWORD *pdwAdjacency, + CONST DWORD *pdwFalseEdgeAdjacency, + CONST FLOAT *pfIMTArray, + LPD3DXUVATLASCB pStatusCallback, + FLOAT fCallbackFrequency, + LPVOID pUserContext, + DWORD dwOptions, + LPD3DXMESH *ppMeshOut, + LPD3DXBUFFER *ppFacePartitioning, + LPD3DXBUFFER *ppVertexRemapArray, + FLOAT *pfMaxStretchOut, + UINT *puNumChartsOut); + +// This has the same exact arguments as Create, except that it does not perform the +// final packing step. This method allows one to get a partitioning out, and possibly +// modify it before sending it to be repacked. Note that if you change the +// partitioning, you'll also need to calculate new texture coordinates for any faces +// that have switched charts. +// +// The partition result adjacency output parameter is meant to be passed to the +// UVAtlasPack function, this adjacency cuts edges that are between adjacent +// charts, and also can include cuts inside of a chart in order to make it +// equivalent to a disc. For example: +// +// _______ +// | ___ | +// | |_| | +// |_____| +// +// In order to make this equivalent to a disc, we would need to add a cut, and it +// Would end up looking like: +// _______ +// | ___ | +// | |_|_| +// |_____| +// +// The resulting partition adjacency parameter cannot be NULL, because it is +// required for the packing step. + + + +HRESULT WINAPI D3DXUVAtlasPartition(LPD3DXMESH pMesh, + UINT uMaxChartNumber, + FLOAT fMaxStretch, + DWORD dwTextureIndex, + CONST DWORD *pdwAdjacency, + CONST DWORD *pdwFalseEdgeAdjacency, + CONST FLOAT *pfIMTArray, + LPD3DXUVATLASCB pStatusCallback, + FLOAT fCallbackFrequency, + LPVOID pUserContext, + DWORD dwOptions, + LPD3DXMESH *ppMeshOut, + LPD3DXBUFFER *ppFacePartitioning, + LPD3DXBUFFER *ppVertexRemapArray, + LPD3DXBUFFER *ppPartitionResultAdjacency, + FLOAT *pfMaxStretchOut, + UINT *puNumChartsOut); + +// This takes the face partitioning result from Partition and packs it into an +// atlas of the given size. pdwPartitionResultAdjacency should be derived from +// the adjacency returned from the partition step. This value cannot be NULL +// because Pack needs to know where charts were cut in the partition step in +// order to find the edges of each chart. +// The options parameter is currently reserved. +HRESULT WINAPI D3DXUVAtlasPack(ID3DXMesh *pMesh, + UINT uWidth, + UINT uHeight, + FLOAT fGutter, + DWORD dwTextureIndex, + CONST DWORD *pdwPartitionResultAdjacency, + LPD3DXUVATLASCB pStatusCallback, + FLOAT fCallbackFrequency, + LPVOID pUserContext, + DWORD dwOptions, + LPD3DXBUFFER pFacePartitioning); + + +//============================================================================ +// +// IMT Calculation apis +// +// These functions all compute the Integrated Metric Tensor for use in the +// UVAtlas API. They all calculate the IMT with respect to the canonical +// triangle, where the coordinate system is set up so that the u axis goes +// from vertex 0 to 1 and the v axis is N x u. So, for example, the second +// vertex's canonical uv coordinates are (d,0) where d is the distance between +// vertices 0 and 1. This way the IMT does not depend on the parameterization +// of the mesh, and if the signal over the surface doesn't change, then +// the IMT doesn't need to be recalculated. +//============================================================================ + +// This callback is used by D3DXComputeIMTFromSignal. +// +// uv - The texture coordinate for the vertex. +// uPrimitiveID - Face ID of the triangle on which to compute the signal. +// uSignalDimension - The number of floats to store in pfSignalOut. +// pUserData - The pUserData pointer passed in to ComputeIMTFromSignal. +// pfSignalOut - A pointer to where to store the signal data. +typedef HRESULT (WINAPI* LPD3DXIMTSIGNALCALLBACK) + (CONST D3DXVECTOR2 *uv, + UINT uPrimitiveID, + UINT uSignalDimension, + VOID *pUserData, + FLOAT *pfSignalOut); + +// This function is used to calculate the IMT from per vertex data. It sets +// up a linear system over the triangle, solves for the jacobian J, then +// constructs the IMT from that (J^TJ). +// This function allows you to calculate the IMT based off of any value in a +// mesh (color, normal, etc) by specifying the correct stride of the array. +// The IMT computed will cause areas of the mesh that have similar values to +// take up less space in the texture. +// +// pMesh - The mesh to calculate the IMT for. +// pVertexSignal - A float array of size uSignalStride * v, where v is the +// number of vertices in the mesh. +// uSignalDimension - How many floats per vertex to use in calculating the IMT. +// uSignalStride - The number of bytes per vertex in the array. This must be +// a multiple of sizeof(float) +// ppIMTData - Where to store the buffer holding the IMT data + +HRESULT WINAPI D3DXComputeIMTFromPerVertexSignal ( + LPD3DXMESH pMesh, + CONST FLOAT *pfVertexSignal, // uSignalDimension floats per vertex + UINT uSignalDimension, + UINT uSignalStride, // stride of signal in bytes + DWORD dwOptions, // reserved for future use + LPD3DXUVATLASCB pStatusCallback, + LPVOID pUserContext, + LPD3DXBUFFER *ppIMTData); + +// This function is used to calculate the IMT from data that varies over the +// surface of the mesh (generally at a higher frequency than vertex data). +// This function requires the mesh to already be parameterized (so it already +// has texture coordinates). It allows the user to define a signal arbitrarily +// over the surface of the mesh. +// +// pMesh - The mesh to calculate the IMT for. +// dwTextureIndex - This describes which set of texture coordinates in the +// mesh to use. +// uSignalDimension - How many components there are in the signal. +// fMaxUVDistance - The subdivision will continue until the distance between +// all vertices is at most fMaxUVDistance. +// dwOptions - reserved for future use +// pSignalCallback - The callback to use to get the signal. +// pUserData - A pointer that will be passed in to the callback. +// ppIMTData - Where to store the buffer holding the IMT data +HRESULT WINAPI D3DXComputeIMTFromSignal( + LPD3DXMESH pMesh, + DWORD dwTextureIndex, + UINT uSignalDimension, + FLOAT fMaxUVDistance, + DWORD dwOptions, // reserved for future use + LPD3DXIMTSIGNALCALLBACK pSignalCallback, + VOID *pUserData, + LPD3DXUVATLASCB pStatusCallback, + LPVOID pUserContext, + LPD3DXBUFFER *ppIMTData); + +// This function is used to calculate the IMT from texture data. Given a texture +// that maps over the surface of the mesh, the algorithm computes the IMT for +// each face. This will cause large areas that are very similar to take up less +// room when parameterized with UVAtlas. The texture is assumed to be +// interpolated over the mesh bilinearly. +// +// pMesh - The mesh to calculate the IMT for. +// pTexture - The texture to load data from. +// dwTextureIndex - This describes which set of texture coordinates in the +// mesh to use. +// dwOptions - Combination of one or more D3DXIMT flags. +// ppIMTData - Where to store the buffer holding the IMT data +HRESULT WINAPI D3DXComputeIMTFromTexture ( + LPD3DXMESH pMesh, + LPDIRECT3DTEXTURE9 pTexture, + DWORD dwTextureIndex, + DWORD dwOptions, + LPD3DXUVATLASCB pStatusCallback, + LPVOID pUserContext, + LPD3DXBUFFER *ppIMTData); + +// This function is very similar to ComputeIMTFromTexture, but it uses a +// float array to pass in the data, and it can calculate higher dimensional +// values than 4. +// +// pMesh - The mesh to calculate the IMT for. +// dwTextureIndex - This describes which set of texture coordinates in the +// mesh to use. +// pfFloatArray - a pointer to a float array of size +// uWidth*uHeight*uComponents +// uWidth - The width of the texture +// uHeight - The height of the texture +// uSignalDimension - The number of floats per texel in the signal +// uComponents - The number of floats in each texel +// dwOptions - Combination of one or more D3DXIMT flags +// ppIMTData - Where to store the buffer holding the IMT data +HRESULT WINAPI D3DXComputeIMTFromPerTexelSignal( + LPD3DXMESH pMesh, + DWORD dwTextureIndex, + FLOAT *pfTexelSignal, + UINT uWidth, + UINT uHeight, + UINT uSignalDimension, + UINT uComponents, + DWORD dwOptions, + LPD3DXUVATLASCB pStatusCallback, + LPVOID pUserContext, + LPD3DXBUFFER *ppIMTData); + +HRESULT WINAPI + D3DXConvertMeshSubsetToSingleStrip( + LPD3DXBASEMESH MeshIn, + DWORD AttribId, + DWORD IBOptions, + LPDIRECT3DINDEXBUFFER9 *ppIndexBuffer, + DWORD *pNumIndices); + +HRESULT WINAPI + D3DXConvertMeshSubsetToStrips( + LPD3DXBASEMESH MeshIn, + DWORD AttribId, + DWORD IBOptions, + LPDIRECT3DINDEXBUFFER9 *ppIndexBuffer, + DWORD *pNumIndices, + LPD3DXBUFFER *ppStripLengths, + DWORD *pNumStrips); + + +//============================================================================ +// +// D3DXOptimizeFaces: +// -------------------- +// Generate a face remapping for a triangle list that more effectively utilizes +// vertex caches. This optimization is identical to the one provided +// by ID3DXMesh::Optimize with the hardware independent option enabled. +// +// Parameters: +// pbIndices +// Triangle list indices to use for generating a vertex ordering +// NumFaces +// Number of faces in the triangle list +// NumVertices +// Number of vertices referenced by the triangle list +// b32BitIndices +// TRUE if indices are 32 bit, FALSE if indices are 16 bit +// pFaceRemap +// Destination buffer to store face ordering +// The number stored for a given element is where in the new ordering +// the face will have come from. See ID3DXMesh::Optimize for more info. +// +//============================================================================ +HRESULT WINAPI + D3DXOptimizeFaces( + LPCVOID pbIndices, + UINT cFaces, + UINT cVertices, + BOOL b32BitIndices, + DWORD* pFaceRemap); + +//============================================================================ +// +// D3DXOptimizeVertices: +// -------------------- +// Generate a vertex remapping to optimize for in order use of vertices for +// a given set of indices. This is commonly used after applying the face +// remap generated by D3DXOptimizeFaces +// +// Parameters: +// pbIndices +// Triangle list indices to use for generating a vertex ordering +// NumFaces +// Number of faces in the triangle list +// NumVertices +// Number of vertices referenced by the triangle list +// b32BitIndices +// TRUE if indices are 32 bit, FALSE if indices are 16 bit +// pVertexRemap +// Destination buffer to store vertex ordering +// The number stored for a given element is where in the new ordering +// the vertex will have come from. See ID3DXMesh::Optimize for more info. +// +//============================================================================ +HRESULT WINAPI + D3DXOptimizeVertices( + LPCVOID pbIndices, + UINT cFaces, + UINT cVertices, + BOOL b32BitIndices, + DWORD* pVertexRemap); + +#ifdef __cplusplus +} +#endif //__cplusplus + + +//=========================================================================== +// +// Data structures for Spherical Harmonic Precomputation +// +// +//============================================================================ + +typedef enum _D3DXSHCOMPRESSQUALITYTYPE { + D3DXSHCQUAL_FASTLOWQUALITY = 1, + D3DXSHCQUAL_SLOWHIGHQUALITY = 2, + D3DXSHCQUAL_FORCE_DWORD = 0x7fffffff +} D3DXSHCOMPRESSQUALITYTYPE; + +typedef enum _D3DXSHGPUSIMOPT { + D3DXSHGPUSIMOPT_SHADOWRES256 = 1, + D3DXSHGPUSIMOPT_SHADOWRES512 = 0, + D3DXSHGPUSIMOPT_SHADOWRES1024 = 2, + D3DXSHGPUSIMOPT_SHADOWRES2048 = 3, + + D3DXSHGPUSIMOPT_HIGHQUALITY = 4, + + D3DXSHGPUSIMOPT_FORCE_DWORD = 0x7fffffff +} D3DXSHGPUSIMOPT; + +// for all properties that are colors the luminance is computed +// if the simulator is run with a single channel using the following +// formula: R * 0.2125 + G * 0.7154 + B * 0.0721 + +typedef struct _D3DXSHMATERIAL { + D3DCOLORVALUE Diffuse; // Diffuse albedo of the surface. (Ignored if object is a Mirror) + BOOL bMirror; // Must be set to FALSE. bMirror == TRUE not currently supported + BOOL bSubSurf; // true if the object does subsurface scattering - can't do this and be a mirror + + // subsurface scattering parameters + FLOAT RelativeIndexOfRefraction; + D3DCOLORVALUE Absorption; + D3DCOLORVALUE ReducedScattering; + +} D3DXSHMATERIAL; + +// allocated in D3DXSHPRTCompSplitMeshSC +// vertices are duplicated into multiple super clusters but +// only have a valid status in one super cluster (fill in the rest) + +typedef struct _D3DXSHPRTSPLITMESHVERTDATA { + UINT uVertRemap; // vertex in original mesh this corresponds to + UINT uSubCluster; // cluster index relative to super cluster + UCHAR ucVertStatus; // 1 if vertex has valid data, 0 if it is "fill" +} D3DXSHPRTSPLITMESHVERTDATA; + +// used in D3DXSHPRTCompSplitMeshSC +// information for each super cluster that maps into face/vert arrays + +typedef struct _D3DXSHPRTSPLITMESHCLUSTERDATA { + UINT uVertStart; // initial index into remapped vertex array + UINT uVertLength; // number of vertices in this super cluster + + UINT uFaceStart; // initial index into face array + UINT uFaceLength; // number of faces in this super cluster + + UINT uClusterStart; // initial index into cluster array + UINT uClusterLength; // number of clusters in this super cluster +} D3DXSHPRTSPLITMESHCLUSTERDATA; + +// call back function for simulator +// return S_OK to keep running the simulator - anything else represents +// failure and the simulator will abort. + +typedef HRESULT (WINAPI *LPD3DXSHPRTSIMCB)(float fPercentDone, LPVOID lpUserContext); + +// interfaces for PRT buffers/simulator + +// GUIDs +// {F1827E47-00A8-49cd-908C-9D11955F8728} +DEFINE_GUID(IID_ID3DXPRTBuffer, +0xf1827e47, 0xa8, 0x49cd, 0x90, 0x8c, 0x9d, 0x11, 0x95, 0x5f, 0x87, 0x28); + +// {A758D465-FE8D-45ad-9CF0-D01E56266A07} +DEFINE_GUID(IID_ID3DXPRTCompBuffer, +0xa758d465, 0xfe8d, 0x45ad, 0x9c, 0xf0, 0xd0, 0x1e, 0x56, 0x26, 0x6a, 0x7); + +// {838F01EC-9729-4527-AADB-DF70ADE7FEA9} +DEFINE_GUID(IID_ID3DXTextureGutterHelper, +0x838f01ec, 0x9729, 0x4527, 0xaa, 0xdb, 0xdf, 0x70, 0xad, 0xe7, 0xfe, 0xa9); + +// {683A4278-CD5F-4d24-90AD-C4E1B6855D53} +DEFINE_GUID(IID_ID3DXPRTEngine, +0x683a4278, 0xcd5f, 0x4d24, 0x90, 0xad, 0xc4, 0xe1, 0xb6, 0x85, 0x5d, 0x53); + +// interface defenitions + +typedef interface ID3DXTextureGutterHelper ID3DXTextureGutterHelper; +typedef interface ID3DXPRTBuffer ID3DXPRTBuffer; + +#undef INTERFACE +#define INTERFACE ID3DXPRTBuffer + +// Buffer interface - contains "NumSamples" samples +// each sample in memory is stored as NumCoeffs scalars per channel (1 or 3) +// Same interface is used for both Vertex and Pixel PRT buffers + +DECLARE_INTERFACE_(ID3DXPRTBuffer, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXPRTBuffer + STDMETHOD_(UINT, GetNumSamples)(THIS) PURE; + STDMETHOD_(UINT, GetNumCoeffs)(THIS) PURE; + STDMETHOD_(UINT, GetNumChannels)(THIS) PURE; + + STDMETHOD_(BOOL, IsTexture)(THIS) PURE; + STDMETHOD_(UINT, GetWidth)(THIS) PURE; + STDMETHOD_(UINT, GetHeight)(THIS) PURE; + + // changes the number of samples allocated in the buffer + STDMETHOD(Resize)(THIS_ UINT NewSize) PURE; + + // ppData will point to the memory location where sample Start begins + // pointer is valid for at least NumSamples samples + STDMETHOD(LockBuffer)(THIS_ UINT Start, UINT NumSamples, FLOAT **ppData) PURE; + STDMETHOD(UnlockBuffer)(THIS) PURE; + + // every scalar in buffer is multiplied by Scale + STDMETHOD(ScaleBuffer)(THIS_ FLOAT Scale) PURE; + + // every scalar contains the sum of this and pBuffers values + // pBuffer must have the same storage class/dimensions + STDMETHOD(AddBuffer)(THIS_ LPD3DXPRTBUFFER pBuffer) PURE; + + // GutterHelper (described below) will fill in the gutter + // regions of a texture by interpolating "internal" values + STDMETHOD(AttachGH)(THIS_ LPD3DXTEXTUREGUTTERHELPER) PURE; + STDMETHOD(ReleaseGH)(THIS) PURE; + + // Evaluates attached gutter helper on the contents of this buffer + STDMETHOD(EvalGH)(THIS) PURE; + + // extracts a given channel into texture pTexture + // NumCoefficients starting from StartCoefficient are copied + STDMETHOD(ExtractTexture)(THIS_ UINT Channel, UINT StartCoefficient, + UINT NumCoefficients, LPDIRECT3DTEXTURE9 pTexture) PURE; + + // extracts NumCoefficients coefficients into mesh - only applicable on single channel + // buffers, otherwise just lockbuffer and copy data. With SHPRT data NumCoefficients + // should be Order^2 + STDMETHOD(ExtractToMesh)(THIS_ UINT NumCoefficients, D3DDECLUSAGE Usage, UINT UsageIndexStart, + LPD3DXMESH pScene) PURE; + +}; + +typedef interface ID3DXPRTCompBuffer ID3DXPRTCompBuffer; +typedef interface ID3DXPRTCompBuffer *LPD3DXPRTCOMPBUFFER; + +#undef INTERFACE +#define INTERFACE ID3DXPRTCompBuffer + +// compressed buffers stored a compressed version of a PRTBuffer + +DECLARE_INTERFACE_(ID3DXPRTCompBuffer, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DPRTCompBuffer + + // NumCoeffs and NumChannels are properties of input buffer + STDMETHOD_(UINT, GetNumSamples)(THIS) PURE; + STDMETHOD_(UINT, GetNumCoeffs)(THIS) PURE; + STDMETHOD_(UINT, GetNumChannels)(THIS) PURE; + + STDMETHOD_(BOOL, IsTexture)(THIS) PURE; + STDMETHOD_(UINT, GetWidth)(THIS) PURE; + STDMETHOD_(UINT, GetHeight)(THIS) PURE; + + // number of clusters, and PCA vectors per-cluster + STDMETHOD_(UINT, GetNumClusters)(THIS) PURE; + STDMETHOD_(UINT, GetNumPCA)(THIS) PURE; + + // normalizes PCA weights so that they are between [-1,1] + // basis vectors are modified to reflect this + STDMETHOD(NormalizeData)(THIS) PURE; + + // copies basis vectors for cluster "Cluster" into pClusterBasis + // (NumPCA+1)*NumCoeffs*NumChannels floats + STDMETHOD(ExtractBasis)(THIS_ UINT Cluster, FLOAT *pClusterBasis) PURE; + + // UINT per sample - which cluster it belongs to + STDMETHOD(ExtractClusterIDs)(THIS_ UINT *pClusterIDs) PURE; + + // copies NumExtract PCA projection coefficients starting at StartPCA + // into pPCACoefficients - NumSamples*NumExtract floats copied + STDMETHOD(ExtractPCA)(THIS_ UINT StartPCA, UINT NumExtract, FLOAT *pPCACoefficients) PURE; + + // copies NumPCA projection coefficients starting at StartPCA + // into pTexture - should be able to cope with signed formats + STDMETHOD(ExtractTexture)(THIS_ UINT StartPCA, UINT NumpPCA, + LPDIRECT3DTEXTURE9 pTexture) PURE; + + // copies NumPCA projection coefficients into mesh pScene + // Usage is D3DDECLUSAGE where coefficients are to be stored + // UsageIndexStart is starting index + STDMETHOD(ExtractToMesh)(THIS_ UINT NumPCA, D3DDECLUSAGE Usage, UINT UsageIndexStart, + LPD3DXMESH pScene) PURE; +}; + + +#undef INTERFACE +#define INTERFACE ID3DXTextureGutterHelper + +// ID3DXTextureGutterHelper will build and manage +// "gutter" regions in a texture - this will allow for +// bi-linear interpolation to not have artifacts when rendering +// It generates a map (in texture space) where each texel +// is in one of 3 states: +// 0 Invalid - not used at all +// 1 Inside triangle +// 2 Gutter texel +// 4 represents a gutter texel that will be computed during PRT +// For each Inside/Gutter texel it stores the face it +// belongs to and barycentric coordinates for the 1st two +// vertices of that face. Gutter vertices are assigned to +// the closest edge in texture space. +// +// When used with PRT this requires a unique parameterization +// of the model - every texel must correspond to a single point +// on the surface of the model and vice versa + +DECLARE_INTERFACE_(ID3DXTextureGutterHelper, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXTextureGutterHelper + + // dimensions of texture this is bound too + STDMETHOD_(UINT, GetWidth)(THIS) PURE; + STDMETHOD_(UINT, GetHeight)(THIS) PURE; + + + // Applying gutters recomputes all of the gutter texels of class "2" + // based on texels of class "1" or "4" + + // Applies gutters to a raw float buffer - each texel is NumCoeffs floats + // Width and Height must match GutterHelper + STDMETHOD(ApplyGuttersFloat)(THIS_ FLOAT *pDataIn, UINT NumCoeffs, UINT Width, UINT Height); + + // Applies gutters to pTexture + // Dimensions must match GutterHelper + STDMETHOD(ApplyGuttersTex)(THIS_ LPDIRECT3DTEXTURE9 pTexture); + + // Applies gutters to a D3DXPRTBuffer + // Dimensions must match GutterHelper + STDMETHOD(ApplyGuttersPRT)(THIS_ LPD3DXPRTBUFFER pBuffer); + + // Resamples a texture from a mesh onto this gutterhelpers + // parameterization. It is assumed that the UV coordinates + // for this gutter helper are in TEXTURE 0 (usage/usage index) + // and the texture coordinates should all be within [0,1] for + // both sets. + // + // pTextureIn - texture represented using parameterization in pMeshIn + // pMeshIn - Mesh with texture coordinates that represent pTextureIn + // pTextureOut texture coordinates are assumed to be in + // TEXTURE 0 + // Usage - field in DECL for pMeshIn that stores texture coordinates + // for pTextureIn + // UsageIndex - which index for Usage above for pTextureIn + // pTextureOut- Resampled texture + // + // Usage would generally be D3DDECLUSAGE_TEXCOORD and UsageIndex other than zero + STDMETHOD(ResampleTex)(THIS_ LPDIRECT3DTEXTURE9 pTextureIn, + LPD3DXMESH pMeshIn, + D3DDECLUSAGE Usage, UINT UsageIndex, + LPDIRECT3DTEXTURE9 pTextureOut); + + // the routines below provide access to the data structures + // used by the Apply functions + + // face map is a UINT per texel that represents the + // face of the mesh that texel belongs too - + // only valid if same texel is valid in pGutterData + // pFaceData must be allocated by the user + STDMETHOD(GetFaceMap)(THIS_ UINT *pFaceData) PURE; + + // BaryMap is a D3DXVECTOR2 per texel + // the 1st two barycentric coordinates for the corresponding + // face (3rd weight is always 1-sum of first two) + // only valid if same texel is valid in pGutterData + // pBaryData must be allocated by the user + STDMETHOD(GetBaryMap)(THIS_ D3DXVECTOR2 *pBaryData) PURE; + + // TexelMap is a D3DXVECTOR2 per texel that + // stores the location in pixel coordinates where the + // corresponding texel is mapped + // pTexelData must be allocated by the user + STDMETHOD(GetTexelMap)(THIS_ D3DXVECTOR2 *pTexelData) PURE; + + // GutterMap is a BYTE per texel + // 0/1/2 for Invalid/Internal/Gutter texels + // 4 represents a gutter texel that will be computed + // during PRT + // pGutterData must be allocated by the user + STDMETHOD(GetGutterMap)(THIS_ BYTE *pGutterData) PURE; + + // face map is a UINT per texel that represents the + // face of the mesh that texel belongs too - + // only valid if same texel is valid in pGutterData + STDMETHOD(SetFaceMap)(THIS_ UINT *pFaceData) PURE; + + // BaryMap is a D3DXVECTOR2 per texel + // the 1st two barycentric coordinates for the corresponding + // face (3rd weight is always 1-sum of first two) + // only valid if same texel is valid in pGutterData + STDMETHOD(SetBaryMap)(THIS_ D3DXVECTOR2 *pBaryData) PURE; + + // TexelMap is a D3DXVECTOR2 per texel that + // stores the location in pixel coordinates where the + // corresponding texel is mapped + STDMETHOD(SetTexelMap)(THIS_ D3DXVECTOR2 *pTexelData) PURE; + + // GutterMap is a BYTE per texel + // 0/1/2 for Invalid/Internal/Gutter texels + // 4 represents a gutter texel that will be computed + // during PRT + STDMETHOD(SetGutterMap)(THIS_ BYTE *pGutterData) PURE; +}; + + +typedef interface ID3DXPRTEngine ID3DXPRTEngine; +typedef interface ID3DXPRTEngine *LPD3DXPRTENGINE; + +#undef INTERFACE +#define INTERFACE ID3DXPRTEngine + +// ID3DXPRTEngine is used to compute a PRT simulation +// Use the following steps to compute PRT for SH +// (1) create an interface (which includes a scene) +// (2) call SetSamplingInfo +// (3) [optional] Set MeshMaterials/albedo's (required if doing bounces) +// (4) call ComputeDirectLightingSH +// (5) [optional] call ComputeBounce +// repeat step 5 for as many bounces as wanted. +// if you want to model subsurface scattering you +// need to call ComputeSS after direct lighting and +// each bounce. +// If you want to bake the albedo into the PRT signal, you +// must call MutliplyAlbedo, otherwise the user has to multiply +// the albedo themselves. Not multiplying the albedo allows you +// to model albedo variation at a finer scale then illumination, and +// can result in better compression results. +// Luminance values are computed from RGB values using the following +// formula: R * 0.2125 + G * 0.7154 + B * 0.0721 + +DECLARE_INTERFACE_(ID3DXPRTEngine, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // ID3DXPRTEngine + + // This sets a material per attribute in the scene mesh and it is + // the only way to specify subsurface scattering parameters. if + // bSetAlbedo is FALSE, NumChannels must match the current + // configuration of the PRTEngine. If you intend to change + // NumChannels (through some other SetAlbedo function) it must + // happen before SetMeshMaterials is called. + // + // NumChannels 1 implies "grayscale" materials, set this to 3 to enable + // color bleeding effects + // bSetAlbedo sets albedo from material if TRUE - which clobbers per texel/vertex + // albedo that might have been set before. FALSE won't clobber. + // fLengthScale is used for subsurface scattering - scene is mapped into a 1mm unit cube + // and scaled by this amount + STDMETHOD(SetMeshMaterials)(THIS_ CONST D3DXSHMATERIAL **ppMaterials, UINT NumMeshes, + UINT NumChannels, BOOL bSetAlbedo, FLOAT fLengthScale) PURE; + + // setting albedo per-vertex or per-texel over rides the albedos stored per mesh + // but it does not over ride any other settings + + // sets an albedo to be used per vertex - the albedo is represented as a float + // pDataIn input pointer (pointint to albedo of 1st sample) + // NumChannels 1 implies "grayscale" materials, set this to 3 to enable + // color bleeding effects + // Stride - stride in bytes to get to next samples albedo + STDMETHOD(SetPerVertexAlbedo)(THIS_ CONST VOID *pDataIn, UINT NumChannels, UINT Stride) PURE; + + // represents the albedo per-texel instead of per-vertex (even if per-vertex PRT is used) + // pAlbedoTexture - texture that stores the albedo (dimension arbitrary) + // NumChannels 1 implies "grayscale" materials, set this to 3 to enable + // color bleeding effects + // pGH - optional gutter helper, otherwise one is constructed in computation routines and + // destroyed (if not attached to buffers) + STDMETHOD(SetPerTexelAlbedo)(THIS_ LPDIRECT3DTEXTURE9 pAlbedoTexture, + UINT NumChannels, + LPD3DXTEXTUREGUTTERHELPER pGH) PURE; + + // gets the per-vertex albedo + STDMETHOD(GetVertexAlbedo)(THIS_ D3DXCOLOR *pVertColors, UINT NumVerts) PURE; + + // If pixel PRT is being computed normals default to ones that are interpolated + // from the vertex normals. This specifies a texture that stores an object + // space normal map instead (must use a texture format that can represent signed values) + // pNormalTexture - normal map, must be same dimensions as PRTBuffers, signed + STDMETHOD(SetPerTexelNormal)(THIS_ LPDIRECT3DTEXTURE9 pNormalTexture) PURE; + + // Copies per-vertex albedo from mesh + // pMesh - mesh that represents the scene. It must have the same + // properties as the mesh used to create the PRTEngine + // Usage - D3DDECLUSAGE to extract albedos from + // NumChannels 1 implies "grayscale" materials, set this to 3 to enable + // color bleeding effects + STDMETHOD(ExtractPerVertexAlbedo)(THIS_ LPD3DXMESH pMesh, + D3DDECLUSAGE Usage, + UINT NumChannels) PURE; + + // Resamples the input buffer into the output buffer + // can be used to move between per-vertex and per-texel buffers. This can also be used + // to convert single channel buffers to 3-channel buffers and vice-versa. + STDMETHOD(ResampleBuffer)(THIS_ LPD3DXPRTBUFFER pBufferIn, LPD3DXPRTBUFFER pBufferOut) PURE; + + // Returns the scene mesh - including modifications from adaptive spatial sampling + // The returned mesh only has positions, normals and texture coordinates (if defined) + // pD3DDevice - d3d device that will be used to allocate the mesh + // pFaceRemap - each face has a pointer back to the face on the original mesh that it comes from + // if the face hasn't been subdivided this will be an identity mapping + // pVertRemap - each vertex contains 3 vertices that this is a linear combination of + // pVertWeights - weights for each of above indices (sum to 1.0f) + // ppMesh - mesh that will be allocated and filled + STDMETHOD(GetAdaptedMesh)(THIS_ LPDIRECT3DDEVICE9 pD3DDevice,UINT *pFaceRemap, UINT *pVertRemap, FLOAT *pfVertWeights, LPD3DXMESH *ppMesh) PURE; + + // Number of vertices currently allocated (includes new vertices from adaptive sampling) + STDMETHOD_(UINT, GetNumVerts)(THIS) PURE; + // Number of faces currently allocated (includes new faces) + STDMETHOD_(UINT, GetNumFaces)(THIS) PURE; + + // Sets the Minimum/Maximum intersection distances, this can be used to control + // maximum distance that objects can shadow/reflect light, and help with "bad" + // art that might have near features that you don't want to shadow. This does not + // apply for GPU simulations. + // fMin - minimum intersection distance, must be positive and less than fMax + // fMax - maximum intersection distance, if 0.0f use the previous value, otherwise + // must be strictly greater than fMin + STDMETHOD(SetMinMaxIntersection)(THIS_ FLOAT fMin, FLOAT fMax) PURE; + + // This will subdivide faces on a mesh so that adaptively simulations can + // use a more conservative threshold (it won't miss features.) + // MinEdgeLength - minimum edge length that will be generated, if 0.0f a + // reasonable default will be used + // MaxSubdiv - maximum level of subdivision, if 0 is specified a default + // value will be used (5) + STDMETHOD(RobustMeshRefine)(THIS_ FLOAT MinEdgeLength, UINT MaxSubdiv) PURE; + + // This sets to sampling information used by the simulator. Adaptive sampling + // parameters are currently ignored. + // NumRays - number of rays to shoot per sample + // UseSphere - if TRUE uses spherical samples, otherwise samples over + // the hemisphere. Should only be used with GPU and Vol computations + // UseCosine - if TRUE uses a cosine weighting - not used for Vol computations + // or if only the visiblity function is desired + // Adaptive - if TRUE adaptive sampling (angular) is used + // AdaptiveThresh - threshold used to terminate adaptive angular sampling + // ignored if adaptive sampling is not set + STDMETHOD(SetSamplingInfo)(THIS_ UINT NumRays, + BOOL UseSphere, + BOOL UseCosine, + BOOL Adaptive, + FLOAT AdaptiveThresh) PURE; + + // Methods that compute the direct lighting contribution for objects + // always represente light using spherical harmonics (SH) + // the albedo is not multiplied by the signal - it just integrates + // incoming light. If NumChannels is not 1 the vector is replicated + // + // SHOrder - order of SH to use + // pDataOut - PRT buffer that is generated. Can be single channel + STDMETHOD(ComputeDirectLightingSH)(THIS_ UINT SHOrder, + LPD3DXPRTBUFFER pDataOut) PURE; + + // Adaptive variant of above function. This will refine the mesh + // generating new vertices/faces to approximate the PRT signal + // more faithfully. + // SHOrder - order of SH to use + // AdaptiveThresh - threshold for adaptive subdivision (in PRT vector error) + // if value is less then 1e-6f, 1e-6f is specified + // MinEdgeLength - minimum edge length that will be generated + // if value is too small a fairly conservative model dependent value + // is used + // MaxSubdiv - maximum subdivision level, if 0 is specified it + // will default to 4 + // pDataOut - PRT buffer that is generated. Can be single channel. + STDMETHOD(ComputeDirectLightingSHAdaptive)(THIS_ UINT SHOrder, + FLOAT AdaptiveThresh, + FLOAT MinEdgeLength, + UINT MaxSubdiv, + LPD3DXPRTBUFFER pDataOut) PURE; + + // Function that computes the direct lighting contribution for objects + // light is always represented using spherical harmonics (SH) + // This is done on the GPU and is much faster then using the CPU. + // The albedo is not multiplied by the signal - it just integrates + // incoming light. If NumChannels is not 1 the vector is replicated. + // ZBias/ZAngleBias are akin to parameters used with shadow zbuffers. + // A reasonable default for both values is 0.005, but the user should + // experiment (ZAngleBias can be zero, ZBias should not be.) + // Callbacks should not use the Direct3D9Device the simulator is using. + // SetSamplingInfo must be called with TRUE for UseSphere and + // FALSE for UseCosine before this method is called. + // + // pD3DDevice - device used to run GPU simulator - must support PS2.0 + // and FP render targets + // Flags - parameters for the GPU simulator, combination of one or more + // D3DXSHGPUSIMOPT flags. Only one SHADOWRES setting should be set and + // the defaults is 512 + // SHOrder - order of SH to use + // ZBias - bias in normal direction (for depth test) + // ZAngleBias - scaled by one minus cosine of angle with light (offset in depth) + // pDataOut - PRT buffer that is filled in. Can be single channel + STDMETHOD(ComputeDirectLightingSHGPU)(THIS_ LPDIRECT3DDEVICE9 pD3DDevice, + UINT Flags, + UINT SHOrder, + FLOAT ZBias, + FLOAT ZAngleBias, + LPD3DXPRTBUFFER pDataOut) PURE; + + + // Functions that computes subsurface scattering (using material properties) + // Albedo is not multiplied by result. This only works for per-vertex data + // use ResampleBuffer to move per-vertex data into a texture and back. + // + // pDataIn - input data (previous bounce) + // pDataOut - result of subsurface scattering simulation + // pDataTotal - [optional] results can be summed into this buffer + STDMETHOD(ComputeSS)(THIS_ LPD3DXPRTBUFFER pDataIn, + LPD3DXPRTBUFFER pDataOut, LPD3DXPRTBUFFER pDataTotal) PURE; + + // Adaptive version of ComputeSS. + // + // pDataIn - input data (previous bounce) + // AdaptiveThresh - threshold for adaptive subdivision (in PRT vector error) + // if value is less then 1e-6f, 1e-6f is specified + // MinEdgeLength - minimum edge length that will be generated + // if value is too small a fairly conservative model dependent value + // is used + // MaxSubdiv - maximum subdivision level, if 0 is specified it + // will default to 4 + // pDataOut - result of subsurface scattering simulation + // pDataTotal - [optional] results can be summed into this buffer + STDMETHOD(ComputeSSAdaptive)(THIS_ LPD3DXPRTBUFFER pDataIn, + FLOAT AdaptiveThresh, + FLOAT MinEdgeLength, + UINT MaxSubdiv, + LPD3DXPRTBUFFER pDataOut, LPD3DXPRTBUFFER pDataTotal) PURE; + + // computes a single bounce of inter-reflected light + // works for SH based PRT or generic lighting + // Albedo is not multiplied by result + // + // pDataIn - previous bounces data + // pDataOut - PRT buffer that is generated + // pDataTotal - [optional] can be used to keep a running sum + STDMETHOD(ComputeBounce)(THIS_ LPD3DXPRTBUFFER pDataIn, + LPD3DXPRTBUFFER pDataOut, + LPD3DXPRTBUFFER pDataTotal) PURE; + + // Adaptive version of above function. + // + // pDataIn - previous bounces data, can be single channel + // AdaptiveThresh - threshold for adaptive subdivision (in PRT vector error) + // if value is less then 1e-6f, 1e-6f is specified + // MinEdgeLength - minimum edge length that will be generated + // if value is too small a fairly conservative model dependent value + // is used + // MaxSubdiv - maximum subdivision level, if 0 is specified it + // will default to 4 + // pDataOut - PRT buffer that is generated + // pDataTotal - [optional] can be used to keep a running sum + STDMETHOD(ComputeBounceAdaptive)(THIS_ LPD3DXPRTBUFFER pDataIn, + FLOAT AdaptiveThresh, + FLOAT MinEdgeLength, + UINT MaxSubdiv, + LPD3DXPRTBUFFER pDataOut, + LPD3DXPRTBUFFER pDataTotal) PURE; + + // Computes projection of distant SH radiance into a local SH radiance + // function. This models how direct lighting is attenuated by the + // scene and is a form of "neighborhood transfer." The result is + // a linear operator (matrix) at every sample point, if you multiply + // this matrix by the distant SH lighting coefficients you get an + // approximation of the local incident radiance function from + // direct lighting. These resulting lighting coefficients can + // than be projected into another basis or used with any rendering + // technique that uses spherical harmonics as input. + // SetSamplingInfo must be called with TRUE for UseSphere and + // FALSE for UseCosine before this method is called. + // Generates SHOrderIn*SHOrderIn*SHOrderOut*SHOrderOut scalars + // per channel at each sample location. + // + // SHOrderIn - Order of the SH representation of distant lighting + // SHOrderOut - Order of the SH representation of local lighting + // NumVolSamples - Number of sample locations + // pSampleLocs - position of sample locations + // pDataOut - PRT Buffer that will store output results + STDMETHOD(ComputeVolumeSamplesDirectSH)(THIS_ UINT SHOrderIn, + UINT SHOrderOut, + UINT NumVolSamples, + CONST D3DXVECTOR3 *pSampleLocs, + LPD3DXPRTBUFFER pDataOut) PURE; + + // At each sample location computes a linear operator (matrix) that maps + // the representation of source radiance (NumCoeffs in pSurfDataIn) + // into a local incident radiance function approximated with spherical + // harmonics. For example if a light map data is specified in pSurfDataIn + // the result is an SH representation of the flow of light at each sample + // point. If PRT data for an outdoor scene is used, each sample point + // contains a matrix that models how distant lighting bounces of the objects + // in the scene and arrives at the given sample point. Combined with + // ComputeVolumeSamplesDirectSH this gives the complete representation for + // how light arrives at each sample point parameterized by distant lighting. + // SetSamplingInfo must be called with TRUE for UseSphere and + // FALSE for UseCosine before this method is called. + // Generates pSurfDataIn->NumCoeffs()*SHOrder*SHOrder scalars + // per channel at each sample location. + // + // pSurfDataIn - previous bounce data + // SHOrder - order of SH to generate projection with + // NumVolSamples - Number of sample locations + // pSampleLocs - position of sample locations + // pDataOut - PRT Buffer that will store output results + STDMETHOD(ComputeVolumeSamples)(THIS_ LPD3DXPRTBUFFER pSurfDataIn, + UINT SHOrder, + UINT NumVolSamples, + CONST D3DXVECTOR3 *pSampleLocs, + LPD3DXPRTBUFFER pDataOut) PURE; + + // Computes direct lighting (SH) for a point not on the mesh + // with a given normal - cannot use texture buffers. + // + // SHOrder - order of SH to use + // NumSamples - number of sample locations + // pSampleLocs - position for each sample + // pSampleNorms - normal for each sample + // pDataOut - PRT Buffer that will store output results + STDMETHOD(ComputeSurfSamplesDirectSH)(THIS_ UINT SHOrder, + UINT NumSamples, + CONST D3DXVECTOR3 *pSampleLocs, + CONST D3DXVECTOR3 *pSampleNorms, + LPD3DXPRTBUFFER pDataOut) PURE; + + + // given the solution for PRT or light maps, computes transfer vector at arbitrary + // position/normal pairs in space + // + // pSurfDataIn - input data + // NumSamples - number of sample locations + // pSampleLocs - position for each sample + // pSampleNorms - normal for each sample + // pDataOut - PRT Buffer that will store output results + // pDataTotal - optional buffer to sum results into - can be NULL + STDMETHOD(ComputeSurfSamplesBounce)(THIS_ LPD3DXPRTBUFFER pSurfDataIn, + UINT NumSamples, + CONST D3DXVECTOR3 *pSampleLocs, + CONST D3DXVECTOR3 *pSampleNorms, + LPD3DXPRTBUFFER pDataOut, + LPD3DXPRTBUFFER pDataTotal) PURE; + + // Frees temporary data structures that can be created for subsurface scattering + // this data is freed when the PRTComputeEngine is freed and is lazily created + STDMETHOD(FreeSSData)(THIS) PURE; + + // Frees temporary data structures that can be created for bounce simulations + // this data is freed when the PRTComputeEngine is freed and is lazily created + STDMETHOD(FreeBounceData)(THIS) PURE; + + // This computes the Local Deformable PRT (LDPRT) coefficients relative to the + // per sample normals that minimize error in a least squares sense with respect + // to the input PRT data set. These coefficients can be used with skinned/transformed + // normals to model global effects with dynamic objects. Shading normals can + // optionally be solved for - these normals (along with the LDPRT coefficients) can + // more accurately represent the PRT signal. The coefficients are for zonal + // harmonics oriented in the normal/shading normal direction. + // + // pDataIn - SH PRT dataset that is input + // SHOrder - Order of SH to compute conv coefficients for + // pNormOut - Optional array of vectors (passed in) that will be filled with + // "shading normals", LDPRT coefficients are optimized for + // these normals. This array must be the same size as the number of + // samples in pDataIn + // pDataOut - Output buffer (SHOrder zonal harmonic coefficients per channel per sample) + STDMETHOD(ComputeLDPRTCoeffs)(THIS_ LPD3DXPRTBUFFER pDataIn, + UINT SHOrder, + D3DXVECTOR3 *pNormOut, + LPD3DXPRTBUFFER pDataOut) PURE; + + // scales all the samples associated with a given sub mesh + // can be useful when using subsurface scattering + // fScale - value to scale each vector in submesh by + STDMETHOD(ScaleMeshChunk)(THIS_ UINT uMeshChunk, FLOAT fScale, LPD3DXPRTBUFFER pDataOut) PURE; + + // mutliplies each PRT vector by the albedo - can be used if you want to have the albedo + // burned into the dataset, often better not to do this. If this is not done the user + // must mutliply the albedo themselves when rendering - just multiply the albedo times + // the result of the PRT dot product. + // If pDataOut is a texture simulation result and there is an albedo texture it + // must be represented at the same resolution as the simulation buffer. You can use + // LoadSurfaceFromSurface and set a new albedo texture if this is an issue - but must + // be careful about how the gutters are handled. + // + // pDataOut - dataset that will get albedo pushed into it + STDMETHOD(MultiplyAlbedo)(THIS_ LPD3DXPRTBUFFER pDataOut) PURE; + + // Sets a pointer to an optional call back function that reports back to the + // user percentage done and gives them the option of quitting + // pCB - pointer to call back function, return S_OK for the simulation + // to continue + // Frequency - 1/Frequency is roughly the number of times the call back + // will be invoked + // lpUserContext - will be passed back to the users call back + STDMETHOD(SetCallBack)(THIS_ LPD3DXSHPRTSIMCB pCB, FLOAT Frequency, LPVOID lpUserContext) PURE; + + // Returns TRUE if the ray intersects the mesh, FALSE if it does not. This function + // takes into account settings from SetMinMaxIntersection. If the closest intersection + // is not needed this function is more efficient compared to the ClosestRayIntersection + // method. + // pRayPos - origin of ray + // pRayDir - normalized ray direction (normalization required for SetMinMax to be meaningful) + + STDMETHOD_(BOOL, ShadowRayIntersects)(THIS_ CONST D3DXVECTOR3 *pRayPos, CONST D3DXVECTOR3 *pRayDir) PURE; + + // Returns TRUE if the ray intersects the mesh, FALSE if it does not. If there is an + // intersection the closest face that was intersected and its first two barycentric coordinates + // are returned. This function takes into account settings from SetMinMaxIntersection. + // This is a slower function compared to ShadowRayIntersects and should only be used where + // needed. The third vertices barycentric coordinates will be 1 - pU - pV. + // pRayPos - origin of ray + // pRayDir - normalized ray direction (normalization required for SetMinMax to be meaningful) + // pFaceIndex - Closest face that intersects. This index is based on stacking the pBlockerMesh + // faces before the faces from pMesh + // pU - Barycentric coordinate for vertex 0 + // pV - Barycentric coordinate for vertex 1 + // pDist - Distance along ray where the intersection occured + + STDMETHOD_(BOOL, ClosestRayIntersects)(THIS_ CONST D3DXVECTOR3 *pRayPos, CONST D3DXVECTOR3 *pRayDir, + DWORD *pFaceIndex, FLOAT *pU, FLOAT *pV, FLOAT *pDist) PURE; +}; + + +// API functions for creating interfaces + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +//============================================================================ +// +// D3DXCreatePRTBuffer: +// -------------------- +// Generates a PRT Buffer that can be compressed or filled by a simulator +// This function should be used to create per-vertex or volume buffers. +// When buffers are created all values are initialized to zero. +// +// Parameters: +// NumSamples +// Number of sample locations represented +// NumCoeffs +// Number of coefficients per sample location (order^2 for SH) +// NumChannels +// Number of color channels to represent (1 or 3) +// ppBuffer +// Buffer that will be allocated +// +//============================================================================ + +HRESULT WINAPI + D3DXCreatePRTBuffer( + UINT NumSamples, + UINT NumCoeffs, + UINT NumChannels, + LPD3DXPRTBUFFER* ppBuffer); + +//============================================================================ +// +// D3DXCreatePRTBufferTex: +// -------------------- +// Generates a PRT Buffer that can be compressed or filled by a simulator +// This function should be used to create per-pixel buffers. +// When buffers are created all values are initialized to zero. +// +// Parameters: +// Width +// Width of texture +// Height +// Height of texture +// NumCoeffs +// Number of coefficients per sample location (order^2 for SH) +// NumChannels +// Number of color channels to represent (1 or 3) +// ppBuffer +// Buffer that will be allocated +// +//============================================================================ + +HRESULT WINAPI + D3DXCreatePRTBufferTex( + UINT Width, + UINT Height, + UINT NumCoeffs, + UINT NumChannels, + LPD3DXPRTBUFFER* ppBuffer); + +//============================================================================ +// +// D3DXLoadPRTBufferFromFile: +// -------------------- +// Loads a PRT buffer that has been saved to disk. +// +// Parameters: +// pFilename +// Name of the file to load +// ppBuffer +// Buffer that will be allocated +// +//============================================================================ + +HRESULT WINAPI + D3DXLoadPRTBufferFromFileA( + LPCSTR pFilename, + LPD3DXPRTBUFFER* ppBuffer); + +HRESULT WINAPI + D3DXLoadPRTBufferFromFileW( + LPCWSTR pFilename, + LPD3DXPRTBUFFER* ppBuffer); + +#ifdef UNICODE +#define D3DXLoadPRTBufferFromFile D3DXLoadPRTBufferFromFileW +#else +#define D3DXLoadPRTBufferFromFile D3DXLoadPRTBufferFromFileA +#endif + + +//============================================================================ +// +// D3DXSavePRTBufferToFile: +// -------------------- +// Saves a PRTBuffer to disk. +// +// Parameters: +// pFilename +// Name of the file to save +// pBuffer +// Buffer that will be saved +// +//============================================================================ + +HRESULT WINAPI + D3DXSavePRTBufferToFileA( + LPCSTR pFileName, + LPD3DXPRTBUFFER pBuffer); + +HRESULT WINAPI + D3DXSavePRTBufferToFileW( + LPCWSTR pFileName, + LPD3DXPRTBUFFER pBuffer); + +#ifdef UNICODE +#define D3DXSavePRTBufferToFile D3DXSavePRTBufferToFileW +#else +#define D3DXSavePRTBufferToFile D3DXSavePRTBufferToFileA +#endif + + +//============================================================================ +// +// D3DXLoadPRTCompBufferFromFile: +// -------------------- +// Loads a PRTComp buffer that has been saved to disk. +// +// Parameters: +// pFilename +// Name of the file to load +// ppBuffer +// Buffer that will be allocated +// +//============================================================================ + +HRESULT WINAPI + D3DXLoadPRTCompBufferFromFileA( + LPCSTR pFilename, + LPD3DXPRTCOMPBUFFER* ppBuffer); + +HRESULT WINAPI + D3DXLoadPRTCompBufferFromFileW( + LPCWSTR pFilename, + LPD3DXPRTCOMPBUFFER* ppBuffer); + +#ifdef UNICODE +#define D3DXLoadPRTCompBufferFromFile D3DXLoadPRTCompBufferFromFileW +#else +#define D3DXLoadPRTCompBufferFromFile D3DXLoadPRTCompBufferFromFileA +#endif + +//============================================================================ +// +// D3DXSavePRTCompBufferToFile: +// -------------------- +// Saves a PRTCompBuffer to disk. +// +// Parameters: +// pFilename +// Name of the file to save +// pBuffer +// Buffer that will be saved +// +//============================================================================ + +HRESULT WINAPI + D3DXSavePRTCompBufferToFileA( + LPCSTR pFileName, + LPD3DXPRTCOMPBUFFER pBuffer); + +HRESULT WINAPI + D3DXSavePRTCompBufferToFileW( + LPCWSTR pFileName, + LPD3DXPRTCOMPBUFFER pBuffer); + +#ifdef UNICODE +#define D3DXSavePRTCompBufferToFile D3DXSavePRTCompBufferToFileW +#else +#define D3DXSavePRTCompBufferToFile D3DXSavePRTCompBufferToFileA +#endif + +//============================================================================ +// +// D3DXCreatePRTCompBuffer: +// -------------------- +// Compresses a PRT buffer (vertex or texel) +// +// Parameters: +// D3DXSHCOMPRESSQUALITYTYPE +// Quality of compression - low is faster (computes PCA per voronoi cluster) +// high is slower but better quality (clusters based on distance to affine subspace) +// NumClusters +// Number of clusters to compute +// NumPCA +// Number of basis vectors to compute +// pCB +// Optional Callback function +// lpUserContext +// Optional user context +// pBufferIn +// Buffer that will be compressed +// ppBufferOut +// Compressed buffer that will be created +// +//============================================================================ + + +HRESULT WINAPI + D3DXCreatePRTCompBuffer( + D3DXSHCOMPRESSQUALITYTYPE Quality, + UINT NumClusters, + UINT NumPCA, + LPD3DXSHPRTSIMCB pCB, + LPVOID lpUserContext, + LPD3DXPRTBUFFER pBufferIn, + LPD3DXPRTCOMPBUFFER *ppBufferOut + ); + +//============================================================================ +// +// D3DXCreateTextureGutterHelper: +// -------------------- +// Generates a "GutterHelper" for a given set of meshes and texture +// resolution +// +// Parameters: +// Width +// Width of texture +// Height +// Height of texture +// pMesh +// Mesh that represents the scene +// GutterSize +// Number of texels to over rasterize in texture space +// this should be at least 1.0 +// ppBuffer +// GutterHelper that will be created +// +//============================================================================ + + +HRESULT WINAPI + D3DXCreateTextureGutterHelper( + UINT Width, + UINT Height, + LPD3DXMESH pMesh, + FLOAT GutterSize, + LPD3DXTEXTUREGUTTERHELPER* ppBuffer); + + +//============================================================================ +// +// D3DXCreatePRTEngine: +// -------------------- +// Computes a PRTEngine which can efficiently generate PRT simulations +// of a scene +// +// Parameters: +// pMesh +// Mesh that represents the scene - must have an AttributeTable +// where vertices are in a unique attribute. +// pAdjacency +// Optional adjacency information +// ExtractUVs +// Set this to true if textures are going to be used for albedos +// or to store PRT vectors +// pBlockerMesh +// Optional mesh that just blocks the scene +// ppEngine +// PRTEngine that will be created +// +//============================================================================ + + +HRESULT WINAPI + D3DXCreatePRTEngine( + LPD3DXMESH pMesh, + DWORD *pAdjacency, + BOOL ExtractUVs, + LPD3DXMESH pBlockerMesh, + LPD3DXPRTENGINE* ppEngine); + +//============================================================================ +// +// D3DXConcatenateMeshes: +// -------------------- +// Concatenates a group of meshes into one common mesh. This can optionaly transform +// each sub mesh or its texture coordinates. If no DECL is given it will +// generate a union of all of the DECL's of the sub meshes, promoting channels +// and types if neccesary. It will create an AttributeTable if possible, one can +// call OptimizeMesh with attribute sort and compacting enabled to ensure this. +// +// Parameters: +// ppMeshes +// Array of pointers to meshes that can store PRT vectors +// NumMeshes +// Number of meshes +// Options +// Passed through to D3DXCreateMesh +// pGeomXForms +// [optional] Each sub mesh is transformed by the corresponding +// matrix if this array is supplied +// pTextureXForms +// [optional] UV coordinates for each sub mesh are transformed +// by corresponding matrix if supplied +// pDecl +// [optional] Only information in this DECL is used when merging +// data +// pD3DDevice +// D3D device that is used to create the new mesh +// ppMeshOut +// Mesh that will be created +// +//============================================================================ + + +HRESULT WINAPI + D3DXConcatenateMeshes( + LPD3DXMESH *ppMeshes, + UINT NumMeshes, + DWORD Options, + CONST D3DXMATRIX *pGeomXForms, + CONST D3DXMATRIX *pTextureXForms, + CONST D3DVERTEXELEMENT9 *pDecl, + LPDIRECT3DDEVICE9 pD3DDevice, + LPD3DXMESH *ppMeshOut); + +//============================================================================ +// +// D3DXSHPRTCompSuperCluster: +// -------------------------- +// Used with compressed results of D3DXSHPRTSimulation. +// Generates "super clusters" - groups of clusters that can be drawn in +// the same draw call. A greedy algorithm that minimizes overdraw is used +// to group the clusters. +// +// Parameters: +// pClusterIDs +// NumVerts cluster ID's (extracted from a compressed buffer) +// pScene +// Mesh that represents composite scene passed to the simulator +// MaxNumClusters +// Maximum number of clusters allocated per super cluster +// NumClusters +// Number of clusters computed in the simulator +// pSuperClusterIDs +// Array of length NumClusters, contains index of super cluster +// that corresponding cluster was assigned to +// pNumSuperClusters +// Returns the number of super clusters allocated +// +//============================================================================ + +HRESULT WINAPI + D3DXSHPRTCompSuperCluster( + UINT *pClusterIDs, + LPD3DXMESH pScene, + UINT MaxNumClusters, + UINT NumClusters, + UINT *pSuperClusterIDs, + UINT *pNumSuperClusters); + +//============================================================================ +// +// D3DXSHPRTCompSplitMeshSC: +// ------------------------- +// Used with compressed results of the vertex version of the PRT simulator. +// After D3DXSHRTCompSuperCluster has been called this function can be used +// to split the mesh into a group of faces/vertices per super cluster. +// Each super cluster contains all of the faces that contain any vertex +// classified in one of its clusters. All of the vertices connected to this +// set of faces are also included with the returned array ppVertStatus +// indicating whether or not the vertex belongs to the supercluster. +// +// Parameters: +// pClusterIDs +// NumVerts cluster ID's (extracted from a compressed buffer) +// NumVertices +// Number of vertices in original mesh +// NumClusters +// Number of clusters (input parameter to compression) +// pSuperClusterIDs +// Array of size NumClusters that will contain super cluster ID's (from +// D3DXSHCompSuerCluster) +// NumSuperClusters +// Number of superclusters allocated in D3DXSHCompSuerCluster +// pInputIB +// Raw index buffer for mesh - format depends on bInputIBIs32Bit +// InputIBIs32Bit +// Indicates whether the input index buffer is 32-bit (otherwise 16-bit +// is assumed) +// NumFaces +// Number of faces in the original mesh (pInputIB is 3 times this length) +// ppIBData +// LPD3DXBUFFER holds raw index buffer that will contain the resulting split faces. +// Format determined by bIBIs32Bit. Allocated by function +// pIBDataLength +// Length of ppIBData, assigned in function +// OutputIBIs32Bit +// Indicates whether the output index buffer is to be 32-bit (otherwise +// 16-bit is assumed) +// ppFaceRemap +// LPD3DXBUFFER mapping of each face in ppIBData to original faces. Length is +// *pIBDataLength/3. Optional paramter, allocated in function +// ppVertData +// LPD3DXBUFFER contains new vertex data structure. Size of pVertDataLength +// pVertDataLength +// Number of new vertices in split mesh. Assigned in function +// pSCClusterList +// Array of length NumClusters which pSCData indexes into (Cluster* fields) +// for each SC, contains clusters sorted by super cluster +// pSCData +// Structure per super cluster - contains indices into ppIBData, +// pSCClusterList and ppVertData +// +//============================================================================ + +HRESULT WINAPI + D3DXSHPRTCompSplitMeshSC( + UINT *pClusterIDs, + UINT NumVertices, + UINT NumClusters, + UINT *pSuperClusterIDs, + UINT NumSuperClusters, + LPVOID pInputIB, + BOOL InputIBIs32Bit, + UINT NumFaces, + LPD3DXBUFFER *ppIBData, + UINT *pIBDataLength, + BOOL OutputIBIs32Bit, + LPD3DXBUFFER *ppFaceRemap, + LPD3DXBUFFER *ppVertData, + UINT *pVertDataLength, + UINT *pSCClusterList, + D3DXSHPRTSPLITMESHCLUSTERDATA *pSCData); + + +#ifdef __cplusplus +} +#endif //__cplusplus + +////////////////////////////////////////////////////////////////////////////// +// +// Definitions of .X file templates used by mesh load/save functions +// that are not RM standard +// +////////////////////////////////////////////////////////////////////////////// + +// {3CF169CE-FF7C-44ab-93C0-F78F62D172E2} +DEFINE_GUID(DXFILEOBJ_XSkinMeshHeader, +0x3cf169ce, 0xff7c, 0x44ab, 0x93, 0xc0, 0xf7, 0x8f, 0x62, 0xd1, 0x72, 0xe2); + +// {B8D65549-D7C9-4995-89CF-53A9A8B031E3} +DEFINE_GUID(DXFILEOBJ_VertexDuplicationIndices, +0xb8d65549, 0xd7c9, 0x4995, 0x89, 0xcf, 0x53, 0xa9, 0xa8, 0xb0, 0x31, 0xe3); + +// {A64C844A-E282-4756-8B80-250CDE04398C} +DEFINE_GUID(DXFILEOBJ_FaceAdjacency, +0xa64c844a, 0xe282, 0x4756, 0x8b, 0x80, 0x25, 0xc, 0xde, 0x4, 0x39, 0x8c); + +// {6F0D123B-BAD2-4167-A0D0-80224F25FABB} +DEFINE_GUID(DXFILEOBJ_SkinWeights, +0x6f0d123b, 0xbad2, 0x4167, 0xa0, 0xd0, 0x80, 0x22, 0x4f, 0x25, 0xfa, 0xbb); + +// {A3EB5D44-FC22-429d-9AFB-3221CB9719A6} +DEFINE_GUID(DXFILEOBJ_Patch, +0xa3eb5d44, 0xfc22, 0x429d, 0x9a, 0xfb, 0x32, 0x21, 0xcb, 0x97, 0x19, 0xa6); + +// {D02C95CC-EDBA-4305-9B5D-1820D7704BBF} +DEFINE_GUID(DXFILEOBJ_PatchMesh, +0xd02c95cc, 0xedba, 0x4305, 0x9b, 0x5d, 0x18, 0x20, 0xd7, 0x70, 0x4b, 0xbf); + +// {B9EC94E1-B9A6-4251-BA18-94893F02C0EA} +DEFINE_GUID(DXFILEOBJ_PatchMesh9, +0xb9ec94e1, 0xb9a6, 0x4251, 0xba, 0x18, 0x94, 0x89, 0x3f, 0x2, 0xc0, 0xea); + +// {B6C3E656-EC8B-4b92-9B62-681659522947} +DEFINE_GUID(DXFILEOBJ_PMInfo, +0xb6c3e656, 0xec8b, 0x4b92, 0x9b, 0x62, 0x68, 0x16, 0x59, 0x52, 0x29, 0x47); + +// {917E0427-C61E-4a14-9C64-AFE65F9E9844} +DEFINE_GUID(DXFILEOBJ_PMAttributeRange, +0x917e0427, 0xc61e, 0x4a14, 0x9c, 0x64, 0xaf, 0xe6, 0x5f, 0x9e, 0x98, 0x44); + +// {574CCC14-F0B3-4333-822D-93E8A8A08E4C} +DEFINE_GUID(DXFILEOBJ_PMVSplitRecord, +0x574ccc14, 0xf0b3, 0x4333, 0x82, 0x2d, 0x93, 0xe8, 0xa8, 0xa0, 0x8e, 0x4c); + +// {B6E70A0E-8EF9-4e83-94AD-ECC8B0C04897} +DEFINE_GUID(DXFILEOBJ_FVFData, +0xb6e70a0e, 0x8ef9, 0x4e83, 0x94, 0xad, 0xec, 0xc8, 0xb0, 0xc0, 0x48, 0x97); + +// {F752461C-1E23-48f6-B9F8-8350850F336F} +DEFINE_GUID(DXFILEOBJ_VertexElement, +0xf752461c, 0x1e23, 0x48f6, 0xb9, 0xf8, 0x83, 0x50, 0x85, 0xf, 0x33, 0x6f); + +// {BF22E553-292C-4781-9FEA-62BD554BDD93} +DEFINE_GUID(DXFILEOBJ_DeclData, +0xbf22e553, 0x292c, 0x4781, 0x9f, 0xea, 0x62, 0xbd, 0x55, 0x4b, 0xdd, 0x93); + +// {F1CFE2B3-0DE3-4e28-AFA1-155A750A282D} +DEFINE_GUID(DXFILEOBJ_EffectFloats, +0xf1cfe2b3, 0xde3, 0x4e28, 0xaf, 0xa1, 0x15, 0x5a, 0x75, 0xa, 0x28, 0x2d); + +// {D55B097E-BDB6-4c52-B03D-6051C89D0E42} +DEFINE_GUID(DXFILEOBJ_EffectString, +0xd55b097e, 0xbdb6, 0x4c52, 0xb0, 0x3d, 0x60, 0x51, 0xc8, 0x9d, 0xe, 0x42); + +// {622C0ED0-956E-4da9-908A-2AF94F3CE716} +DEFINE_GUID(DXFILEOBJ_EffectDWord, +0x622c0ed0, 0x956e, 0x4da9, 0x90, 0x8a, 0x2a, 0xf9, 0x4f, 0x3c, 0xe7, 0x16); + +// {3014B9A0-62F5-478c-9B86-E4AC9F4E418B} +DEFINE_GUID(DXFILEOBJ_EffectParamFloats, +0x3014b9a0, 0x62f5, 0x478c, 0x9b, 0x86, 0xe4, 0xac, 0x9f, 0x4e, 0x41, 0x8b); + +// {1DBC4C88-94C1-46ee-9076-2C28818C9481} +DEFINE_GUID(DXFILEOBJ_EffectParamString, +0x1dbc4c88, 0x94c1, 0x46ee, 0x90, 0x76, 0x2c, 0x28, 0x81, 0x8c, 0x94, 0x81); + +// {E13963BC-AE51-4c5d-B00F-CFA3A9D97CE5} +DEFINE_GUID(DXFILEOBJ_EffectParamDWord, +0xe13963bc, 0xae51, 0x4c5d, 0xb0, 0xf, 0xcf, 0xa3, 0xa9, 0xd9, 0x7c, 0xe5); + +// {E331F7E4-0559-4cc2-8E99-1CEC1657928F} +DEFINE_GUID(DXFILEOBJ_EffectInstance, +0xe331f7e4, 0x559, 0x4cc2, 0x8e, 0x99, 0x1c, 0xec, 0x16, 0x57, 0x92, 0x8f); + +// {9E415A43-7BA6-4a73-8743-B73D47E88476} +DEFINE_GUID(DXFILEOBJ_AnimTicksPerSecond, +0x9e415a43, 0x7ba6, 0x4a73, 0x87, 0x43, 0xb7, 0x3d, 0x47, 0xe8, 0x84, 0x76); + +// {7F9B00B3-F125-4890-876E-1CFFBF697C4D} +DEFINE_GUID(DXFILEOBJ_CompressedAnimationSet, +0x7f9b00b3, 0xf125, 0x4890, 0x87, 0x6e, 0x1c, 0x42, 0xbf, 0x69, 0x7c, 0x4d); + +#pragma pack(push, 1) +typedef struct _XFILECOMPRESSEDANIMATIONSET +{ + DWORD CompressedBlockSize; + FLOAT TicksPerSec; + DWORD PlaybackType; + DWORD BufferLength; +} XFILECOMPRESSEDANIMATIONSET; +#pragma pack(pop) + +#define XSKINEXP_TEMPLATES \ + "xof 0303txt 0032\ + template XSkinMeshHeader \ + { \ + <3CF169CE-FF7C-44ab-93C0-F78F62D172E2> \ + WORD nMaxSkinWeightsPerVertex; \ + WORD nMaxSkinWeightsPerFace; \ + WORD nBones; \ + } \ + template VertexDuplicationIndices \ + { \ + \ + DWORD nIndices; \ + DWORD nOriginalVertices; \ + array DWORD indices[nIndices]; \ + } \ + template FaceAdjacency \ + { \ + \ + DWORD nIndices; \ + array DWORD indices[nIndices]; \ + } \ + template SkinWeights \ + { \ + <6F0D123B-BAD2-4167-A0D0-80224F25FABB> \ + STRING transformNodeName; \ + DWORD nWeights; \ + array DWORD vertexIndices[nWeights]; \ + array float weights[nWeights]; \ + Matrix4x4 matrixOffset; \ + } \ + template Patch \ + { \ + \ + DWORD nControlIndices; \ + array DWORD controlIndices[nControlIndices]; \ + } \ + template PatchMesh \ + { \ + \ + DWORD nVertices; \ + array Vector vertices[nVertices]; \ + DWORD nPatches; \ + array Patch patches[nPatches]; \ + [ ... ] \ + } \ + template PatchMesh9 \ + { \ + \ + DWORD Type; \ + DWORD Degree; \ + DWORD Basis; \ + DWORD nVertices; \ + array Vector vertices[nVertices]; \ + DWORD nPatches; \ + array Patch patches[nPatches]; \ + [ ... ] \ + } " \ + "template EffectFloats \ + { \ + \ + DWORD nFloats; \ + array float Floats[nFloats]; \ + } \ + template EffectString \ + { \ + \ + STRING Value; \ + } \ + template EffectDWord \ + { \ + <622C0ED0-956E-4da9-908A-2AF94F3CE716> \ + DWORD Value; \ + } " \ + "template EffectParamFloats \ + { \ + <3014B9A0-62F5-478c-9B86-E4AC9F4E418B> \ + STRING ParamName; \ + DWORD nFloats; \ + array float Floats[nFloats]; \ + } " \ + "template EffectParamString \ + { \ + <1DBC4C88-94C1-46ee-9076-2C28818C9481> \ + STRING ParamName; \ + STRING Value; \ + } \ + template EffectParamDWord \ + { \ + \ + STRING ParamName; \ + DWORD Value; \ + } \ + template EffectInstance \ + { \ + \ + STRING EffectFilename; \ + [ ... ] \ + } " \ + "template AnimTicksPerSecond \ + { \ + <9E415A43-7BA6-4a73-8743-B73D47E88476> \ + DWORD AnimTicksPerSecond; \ + } \ + template CompressedAnimationSet \ + { \ + <7F9B00B3-F125-4890-876E-1C42BF697C4D> \ + DWORD CompressedBlockSize; \ + FLOAT TicksPerSec; \ + DWORD PlaybackType; \ + DWORD BufferLength; \ + array DWORD CompressedData[BufferLength]; \ + } " + +#define XEXTENSIONS_TEMPLATES \ + "xof 0303txt 0032\ + template FVFData \ + { \ + \ + DWORD dwFVF; \ + DWORD nDWords; \ + array DWORD data[nDWords]; \ + } \ + template VertexElement \ + { \ + \ + DWORD Type; \ + DWORD Method; \ + DWORD Usage; \ + DWORD UsageIndex; \ + } \ + template DeclData \ + { \ + \ + DWORD nElements; \ + array VertexElement Elements[nElements]; \ + DWORD nDWords; \ + array DWORD data[nDWords]; \ + } \ + template PMAttributeRange \ + { \ + <917E0427-C61E-4a14-9C64-AFE65F9E9844> \ + DWORD iFaceOffset; \ + DWORD nFacesMin; \ + DWORD nFacesMax; \ + DWORD iVertexOffset; \ + DWORD nVerticesMin; \ + DWORD nVerticesMax; \ + } \ + template PMVSplitRecord \ + { \ + <574CCC14-F0B3-4333-822D-93E8A8A08E4C> \ + DWORD iFaceCLW; \ + DWORD iVlrOffset; \ + DWORD iCode; \ + } \ + template PMInfo \ + { \ + \ + DWORD nAttributes; \ + array PMAttributeRange attributeRanges[nAttributes]; \ + DWORD nMaxValence; \ + DWORD nMinLogicalVertices; \ + DWORD nMaxLogicalVertices; \ + DWORD nVSplits; \ + array PMVSplitRecord splitRecords[nVSplits]; \ + DWORD nAttributeMispredicts; \ + array DWORD attributeMispredicts[nAttributeMispredicts]; \ + } " + +#endif //__D3DX9MESH_H__ + + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dx9shader.h b/Src/Decoder_H264_ALL/D3D/include/d3dx9shader.h new file mode 100644 index 0000000..5ed3f01 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dx9shader.h @@ -0,0 +1,1010 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: d3dx9shader.h +// Content: D3DX Shader APIs +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#ifndef __D3DX9SHADER_H__ +#define __D3DX9SHADER_H__ + + +//--------------------------------------------------------------------------- +// D3DXTX_VERSION: +// -------------- +// Version token used to create a procedural texture filler in effects +// Used by D3DXFill[]TX functions +//--------------------------------------------------------------------------- +#define D3DXTX_VERSION(_Major,_Minor) (('T' << 24) | ('X' << 16) | ((_Major) << 8) | (_Minor)) + + + +//---------------------------------------------------------------------------- +// D3DXSHADER flags: +// ----------------- +// D3DXSHADER_DEBUG +// Insert debug file/line/type/symbol information. +// +// D3DXSHADER_SKIPVALIDATION +// Do not validate the generated code against known capabilities and +// constraints. This option is only recommended when compiling shaders +// you KNOW will work. (ie. have compiled before without this option.) +// Shaders are always validated by D3D before they are set to the device. +// +// D3DXSHADER_SKIPOPTIMIZATION +// Instructs the compiler to skip optimization steps during code generation. +// Unless you are trying to isolate a problem in your code using this option +// is not recommended. +// +// D3DXSHADER_PACKMATRIX_ROWMAJOR +// Unless explicitly specified, matrices will be packed in row-major order +// on input and output from the shader. +// +// D3DXSHADER_PACKMATRIX_COLUMNMAJOR +// Unless explicitly specified, matrices will be packed in column-major +// order on input and output from the shader. This is generally more +// efficient, since it allows vector-matrix multiplication to be performed +// using a series of dot-products. +// +// D3DXSHADER_PARTIALPRECISION +// Force all computations in resulting shader to occur at partial precision. +// This may result in faster evaluation of shaders on some hardware. +// +// D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT +// Force compiler to compile against the next highest available software +// target for vertex shaders. This flag also turns optimizations off, +// and debugging on. +// +// D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT +// Force compiler to compile against the next highest available software +// target for pixel shaders. This flag also turns optimizations off, +// and debugging on. +// +// D3DXSHADER_NO_PRESHADER +// Disables Preshaders. Using this flag will cause the compiler to not +// pull out static expression for evaluation on the host cpu +// +// D3DXSHADER_AVOID_FLOW_CONTROL +// Hint compiler to avoid flow-control constructs where possible. +// +// D3DXSHADER_PREFER_FLOW_CONTROL +// Hint compiler to prefer flow-control constructs where possible. +// +//---------------------------------------------------------------------------- + +#define D3DXSHADER_DEBUG (1 << 0) +#define D3DXSHADER_SKIPVALIDATION (1 << 1) +#define D3DXSHADER_SKIPOPTIMIZATION (1 << 2) +#define D3DXSHADER_PACKMATRIX_ROWMAJOR (1 << 3) +#define D3DXSHADER_PACKMATRIX_COLUMNMAJOR (1 << 4) +#define D3DXSHADER_PARTIALPRECISION (1 << 5) +#define D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT (1 << 6) +#define D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT (1 << 7) +#define D3DXSHADER_NO_PRESHADER (1 << 8) +#define D3DXSHADER_AVOID_FLOW_CONTROL (1 << 9) +#define D3DXSHADER_PREFER_FLOW_CONTROL (1 << 10) +#define D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12) +#define D3DXSHADER_IEEE_STRICTNESS (1 << 13) +#define D3DXSHADER_USE_LEGACY_D3DX9_31_DLL (1 << 16) + + +// optimization level flags +#define D3DXSHADER_OPTIMIZATION_LEVEL0 (1 << 14) +#define D3DXSHADER_OPTIMIZATION_LEVEL1 0 +#define D3DXSHADER_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15)) +#define D3DXSHADER_OPTIMIZATION_LEVEL3 (1 << 15) + + + +//---------------------------------------------------------------------------- +// D3DXCONSTTABLE flags: +// ------------------- + +#define D3DXCONSTTABLE_LARGEADDRESSAWARE (1 << 17) + + + +//---------------------------------------------------------------------------- +// D3DXHANDLE: +// ----------- +// Handle values used to efficiently reference shader and effect parameters. +// Strings can be used as handles. However, handles are not always strings. +//---------------------------------------------------------------------------- + +#ifndef D3DXFX_LARGEADDRESS_HANDLE +typedef LPCSTR D3DXHANDLE; +#else +typedef UINT_PTR D3DXHANDLE; +#endif +typedef D3DXHANDLE *LPD3DXHANDLE; + + +//---------------------------------------------------------------------------- +// D3DXMACRO: +// ---------- +// Preprocessor macro definition. The application pass in a NULL-terminated +// array of this structure to various D3DX APIs. This enables the application +// to #define tokens at runtime, before the file is parsed. +//---------------------------------------------------------------------------- + +typedef struct _D3DXMACRO +{ + LPCSTR Name; + LPCSTR Definition; + +} D3DXMACRO, *LPD3DXMACRO; + + +//---------------------------------------------------------------------------- +// D3DXSEMANTIC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXSEMANTIC +{ + UINT Usage; + UINT UsageIndex; + +} D3DXSEMANTIC, *LPD3DXSEMANTIC; + + + +//---------------------------------------------------------------------------- +// D3DXREGISTER_SET: +//---------------------------------------------------------------------------- + +typedef enum _D3DXREGISTER_SET +{ + D3DXRS_BOOL, + D3DXRS_INT4, + D3DXRS_FLOAT4, + D3DXRS_SAMPLER, + + // force 32-bit size enum + D3DXRS_FORCE_DWORD = 0x7fffffff + +} D3DXREGISTER_SET, *LPD3DXREGISTER_SET; + + +//---------------------------------------------------------------------------- +// D3DXPARAMETER_CLASS: +//---------------------------------------------------------------------------- + +typedef enum _D3DXPARAMETER_CLASS +{ + D3DXPC_SCALAR, + D3DXPC_VECTOR, + D3DXPC_MATRIX_ROWS, + D3DXPC_MATRIX_COLUMNS, + D3DXPC_OBJECT, + D3DXPC_STRUCT, + + // force 32-bit size enum + D3DXPC_FORCE_DWORD = 0x7fffffff + +} D3DXPARAMETER_CLASS, *LPD3DXPARAMETER_CLASS; + + +//---------------------------------------------------------------------------- +// D3DXPARAMETER_TYPE: +//---------------------------------------------------------------------------- + +typedef enum _D3DXPARAMETER_TYPE +{ + D3DXPT_VOID, + D3DXPT_BOOL, + D3DXPT_INT, + D3DXPT_FLOAT, + D3DXPT_STRING, + D3DXPT_TEXTURE, + D3DXPT_TEXTURE1D, + D3DXPT_TEXTURE2D, + D3DXPT_TEXTURE3D, + D3DXPT_TEXTURECUBE, + D3DXPT_SAMPLER, + D3DXPT_SAMPLER1D, + D3DXPT_SAMPLER2D, + D3DXPT_SAMPLER3D, + D3DXPT_SAMPLERCUBE, + D3DXPT_PIXELSHADER, + D3DXPT_VERTEXSHADER, + D3DXPT_PIXELFRAGMENT, + D3DXPT_VERTEXFRAGMENT, + D3DXPT_UNSUPPORTED, + + // force 32-bit size enum + D3DXPT_FORCE_DWORD = 0x7fffffff + +} D3DXPARAMETER_TYPE, *LPD3DXPARAMETER_TYPE; + + +//---------------------------------------------------------------------------- +// D3DXCONSTANTTABLE_DESC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXCONSTANTTABLE_DESC +{ + LPCSTR Creator; // Creator string + DWORD Version; // Shader version + UINT Constants; // Number of constants + +} D3DXCONSTANTTABLE_DESC, *LPD3DXCONSTANTTABLE_DESC; + + +//---------------------------------------------------------------------------- +// D3DXCONSTANT_DESC: +//---------------------------------------------------------------------------- + +typedef struct _D3DXCONSTANT_DESC +{ + LPCSTR Name; // Constant name + + D3DXREGISTER_SET RegisterSet; // Register set + UINT RegisterIndex; // Register index + UINT RegisterCount; // Number of registers occupied + + D3DXPARAMETER_CLASS Class; // Class + D3DXPARAMETER_TYPE Type; // Component type + + UINT Rows; // Number of rows + UINT Columns; // Number of columns + UINT Elements; // Number of array elements + UINT StructMembers; // Number of structure member sub-parameters + + UINT Bytes; // Data size, in bytes + LPCVOID DefaultValue; // Pointer to default value + +} D3DXCONSTANT_DESC, *LPD3DXCONSTANT_DESC; + + + +//---------------------------------------------------------------------------- +// ID3DXConstantTable: +//---------------------------------------------------------------------------- + +typedef interface ID3DXConstantTable ID3DXConstantTable; +typedef interface ID3DXConstantTable *LPD3DXCONSTANTTABLE; + +// {AB3C758F-093E-4356-B762-4DB18F1B3A01} +DEFINE_GUID(IID_ID3DXConstantTable, +0xab3c758f, 0x93e, 0x4356, 0xb7, 0x62, 0x4d, 0xb1, 0x8f, 0x1b, 0x3a, 0x1); + + +#undef INTERFACE +#define INTERFACE ID3DXConstantTable + +DECLARE_INTERFACE_(ID3DXConstantTable, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Buffer + STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE; + STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE; + + // Descs + STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE; + STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE; + STDMETHOD_(UINT, GetSamplerIndex)(THIS_ D3DXHANDLE hConstant) PURE; + + // Handle operations + STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE hConstant, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; + + // Set Constants + STDMETHOD(SetDefaults)(THIS_ LPDIRECT3DDEVICE9 pDevice) PURE; + STDMETHOD(SetValue)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, LPCVOID pData, UINT Bytes) PURE; + STDMETHOD(SetBool)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, BOOL b) PURE; + STDMETHOD(SetBoolArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST BOOL* pb, UINT Count) PURE; + STDMETHOD(SetInt)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, INT n) PURE; + STDMETHOD(SetIntArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST INT* pn, UINT Count) PURE; + STDMETHOD(SetFloat)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, FLOAT f) PURE; + STDMETHOD(SetFloatArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST FLOAT* pf, UINT Count) PURE; + STDMETHOD(SetVector)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector) PURE; + STDMETHOD(SetVectorArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(SetMatrix)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixPointerArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTransposePointerArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; +}; + + +//---------------------------------------------------------------------------- +// ID3DXTextureShader: +//---------------------------------------------------------------------------- + +typedef interface ID3DXTextureShader ID3DXTextureShader; +typedef interface ID3DXTextureShader *LPD3DXTEXTURESHADER; + +// {3E3D67F8-AA7A-405d-A857-BA01D4758426} +DEFINE_GUID(IID_ID3DXTextureShader, +0x3e3d67f8, 0xaa7a, 0x405d, 0xa8, 0x57, 0xba, 0x1, 0xd4, 0x75, 0x84, 0x26); + +#undef INTERFACE +#define INTERFACE ID3DXTextureShader + +DECLARE_INTERFACE_(ID3DXTextureShader, IUnknown) +{ + // IUnknown + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + // Gets + STDMETHOD(GetFunction)(THIS_ LPD3DXBUFFER *ppFunction) PURE; + STDMETHOD(GetConstantBuffer)(THIS_ LPD3DXBUFFER *ppConstantBuffer) PURE; + + // Descs + STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE; + STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE; + + // Handle operations + STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE hConstant, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; + + // Set Constants + STDMETHOD(SetDefaults)(THIS) PURE; + STDMETHOD(SetValue)(THIS_ D3DXHANDLE hConstant, LPCVOID pData, UINT Bytes) PURE; + STDMETHOD(SetBool)(THIS_ D3DXHANDLE hConstant, BOOL b) PURE; + STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hConstant, CONST BOOL* pb, UINT Count) PURE; + STDMETHOD(SetInt)(THIS_ D3DXHANDLE hConstant, INT n) PURE; + STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hConstant, CONST INT* pn, UINT Count) PURE; + STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hConstant, FLOAT f) PURE; + STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hConstant, CONST FLOAT* pf, UINT Count) PURE; + STDMETHOD(SetVector)(THIS_ D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector) PURE; + STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector, UINT Count) PURE; + STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE; +}; + + +//---------------------------------------------------------------------------- +// D3DXINCLUDE_TYPE: +//---------------------------------------------------------------------------- + +typedef enum _D3DXINCLUDE_TYPE +{ + D3DXINC_LOCAL, + D3DXINC_SYSTEM, + + // force 32-bit size enum + D3DXINC_FORCE_DWORD = 0x7fffffff + +} D3DXINCLUDE_TYPE, *LPD3DXINCLUDE_TYPE; + + +//---------------------------------------------------------------------------- +// ID3DXInclude: +// ------------- +// This interface is intended to be implemented by the application, and can +// be used by various D3DX APIs. This enables application-specific handling +// of #include directives in source files. +// +// Open() +// Opens an include file. If successful, it should fill in ppData and +// pBytes. The data pointer returned must remain valid until Close is +// subsequently called. The name of the file is encoded in UTF-8 format. +// Close() +// Closes an include file. If Open was successful, Close is guaranteed +// to be called before the API using this interface returns. +//---------------------------------------------------------------------------- + +typedef interface ID3DXInclude ID3DXInclude; +typedef interface ID3DXInclude *LPD3DXINCLUDE; + +#undef INTERFACE +#define INTERFACE ID3DXInclude + +DECLARE_INTERFACE(ID3DXInclude) +{ + STDMETHOD(Open)(THIS_ D3DXINCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) PURE; + STDMETHOD(Close)(THIS_ LPCVOID pData) PURE; +}; + + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +//---------------------------------------------------------------------------- +// D3DXAssembleShader: +// ------------------- +// Assembles a shader. +// +// Parameters: +// pSrcFile +// Source file name +// hSrcModule +// Module handle. if NULL, current module will be used +// pSrcResource +// Resource name in module +// pSrcData +// Pointer to source code +// SrcDataLen +// Size of source code, in bytes +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when assembling +// from file, and will error when assembling from resource or memory. +// Flags +// See D3DXSHADER_xxx flags +// ppShader +// Returns a buffer containing the created shader. This buffer contains +// the assembled shader code, as well as any embedded debug info. +// ppErrorMsgs +// Returns a buffer containing a listing of errors and warnings that were +// encountered during assembly. If you are running in a debugger, +// these are the same messages you will see in your debug output. +//---------------------------------------------------------------------------- + + +HRESULT WINAPI + D3DXAssembleShaderFromFileA( + LPCSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs); + +HRESULT WINAPI + D3DXAssembleShaderFromFileW( + LPCWSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs); + +#ifdef UNICODE +#define D3DXAssembleShaderFromFile D3DXAssembleShaderFromFileW +#else +#define D3DXAssembleShaderFromFile D3DXAssembleShaderFromFileA +#endif + + +HRESULT WINAPI + D3DXAssembleShaderFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs); + +HRESULT WINAPI + D3DXAssembleShaderFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs); + +#ifdef UNICODE +#define D3DXAssembleShaderFromResource D3DXAssembleShaderFromResourceW +#else +#define D3DXAssembleShaderFromResource D3DXAssembleShaderFromResourceA +#endif + + +HRESULT WINAPI + D3DXAssembleShader( + LPCSTR pSrcData, + UINT SrcDataLen, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs); + + + +//---------------------------------------------------------------------------- +// D3DXCompileShader: +// ------------------ +// Compiles a shader. +// +// Parameters: +// pSrcFile +// Source file name. +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module. +// pSrcData +// Pointer to source code. +// SrcDataLen +// Size of source code, in bytes. +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when compiling +// from file, and will error when compiling from resource or memory. +// pFunctionName +// Name of the entrypoint function where execution should begin. +// pProfile +// Instruction set to be used when generating code. Currently supported +// profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "ps_1_1", +// "ps_1_2", "ps_1_3", "ps_1_4", "ps_2_0", "ps_2_a", "ps_2_sw", "tx_1_0" +// Flags +// See D3DXSHADER_xxx flags. +// ppShader +// Returns a buffer containing the created shader. This buffer contains +// the compiled shader code, as well as any embedded debug and symbol +// table info. (See D3DXGetShaderConstantTable) +// ppErrorMsgs +// Returns a buffer containing a listing of errors and warnings that were +// encountered during the compile. If you are running in a debugger, +// these are the same messages you will see in your debug output. +// ppConstantTable +// Returns a ID3DXConstantTable object which can be used to set +// shader constants to the device. Alternatively, an application can +// parse the D3DXSHADER_CONSTANTTABLE block embedded as a comment within +// the shader. +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXCompileShaderFromFileA( + LPCSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pFunctionName, + LPCSTR pProfile, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs, + LPD3DXCONSTANTTABLE* ppConstantTable); + +HRESULT WINAPI + D3DXCompileShaderFromFileW( + LPCWSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pFunctionName, + LPCSTR pProfile, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs, + LPD3DXCONSTANTTABLE* ppConstantTable); + +#ifdef UNICODE +#define D3DXCompileShaderFromFile D3DXCompileShaderFromFileW +#else +#define D3DXCompileShaderFromFile D3DXCompileShaderFromFileA +#endif + + +HRESULT WINAPI + D3DXCompileShaderFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pFunctionName, + LPCSTR pProfile, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs, + LPD3DXCONSTANTTABLE* ppConstantTable); + +HRESULT WINAPI + D3DXCompileShaderFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pFunctionName, + LPCSTR pProfile, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs, + LPD3DXCONSTANTTABLE* ppConstantTable); + +#ifdef UNICODE +#define D3DXCompileShaderFromResource D3DXCompileShaderFromResourceW +#else +#define D3DXCompileShaderFromResource D3DXCompileShaderFromResourceA +#endif + + +HRESULT WINAPI + D3DXCompileShader( + LPCSTR pSrcData, + UINT SrcDataLen, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pFunctionName, + LPCSTR pProfile, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs, + LPD3DXCONSTANTTABLE* ppConstantTable); + + +//---------------------------------------------------------------------------- +// D3DXDisassembleShader: +// ---------------------- +// Takes a binary shader, and returns a buffer containing text assembly. +// +// Parameters: +// pShader +// Pointer to the shader byte code. +// ShaderSizeInBytes +// Size of the shader byte code in bytes. +// EnableColorCode +// Emit HTML tags for color coding the output? +// pComments +// Pointer to a comment string to include at the top of the shader. +// ppDisassembly +// Returns a buffer containing the disassembled shader. +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXDisassembleShader( + CONST DWORD* pShader, + BOOL EnableColorCode, + LPCSTR pComments, + LPD3DXBUFFER* ppDisassembly); + + +//---------------------------------------------------------------------------- +// D3DXGetPixelShaderProfile/D3DXGetVertexShaderProfile: +// ----------------------------------------------------- +// Returns the name of the HLSL profile best suited to a given device. +// +// Parameters: +// pDevice +// Pointer to the device in question +//---------------------------------------------------------------------------- + +LPCSTR WINAPI + D3DXGetPixelShaderProfile( + LPDIRECT3DDEVICE9 pDevice); + +LPCSTR WINAPI + D3DXGetVertexShaderProfile( + LPDIRECT3DDEVICE9 pDevice); + + +//---------------------------------------------------------------------------- +// D3DXFindShaderComment: +// ---------------------- +// Searches through a shader for a particular comment, denoted by a FourCC in +// the first DWORD of the comment. If the comment is not found, and no other +// error has occurred, S_FALSE is returned. +// +// Parameters: +// pFunction +// Pointer to the function DWORD stream +// FourCC +// FourCC used to identify the desired comment block. +// ppData +// Returns a pointer to the comment data (not including comment token +// and FourCC). Can be NULL. +// pSizeInBytes +// Returns the size of the comment data in bytes. Can be NULL. +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXFindShaderComment( + CONST DWORD* pFunction, + DWORD FourCC, + LPCVOID* ppData, + UINT* pSizeInBytes); + + +//---------------------------------------------------------------------------- +// D3DXGetShaderSize: +// ------------------ +// Returns the size of the shader byte-code, in bytes. +// +// Parameters: +// pFunction +// Pointer to the function DWORD stream +//---------------------------------------------------------------------------- + +UINT WINAPI + D3DXGetShaderSize( + CONST DWORD* pFunction); + + +//---------------------------------------------------------------------------- +// D3DXGetShaderVersion: +// ----------------------- +// Returns the shader version of a given shader. Returns zero if the shader +// function is NULL. +// +// Parameters: +// pFunction +// Pointer to the function DWORD stream +//---------------------------------------------------------------------------- + +DWORD WINAPI + D3DXGetShaderVersion( + CONST DWORD* pFunction); + +//---------------------------------------------------------------------------- +// D3DXGetShaderSemantics: +// ----------------------- +// Gets semantics for all input elements referenced inside a given shader. +// +// Parameters: +// pFunction +// Pointer to the function DWORD stream +// pSemantics +// Pointer to an array of D3DXSEMANTIC structures. The function will +// fill this array with the semantics for each input element referenced +// inside the shader. This array is assumed to contain at least +// MAXD3DDECLLENGTH elements. +// pCount +// Returns the number of elements referenced by the shader +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXGetShaderInputSemantics( + CONST DWORD* pFunction, + D3DXSEMANTIC* pSemantics, + UINT* pCount); + +HRESULT WINAPI + D3DXGetShaderOutputSemantics( + CONST DWORD* pFunction, + D3DXSEMANTIC* pSemantics, + UINT* pCount); + + +//---------------------------------------------------------------------------- +// D3DXGetShaderSamplers: +// ---------------------- +// Gets semantics for all input elements referenced inside a given shader. +// +// pFunction +// Pointer to the function DWORD stream +// pSamplers +// Pointer to an array of LPCSTRs. The function will fill this array +// with pointers to the sampler names contained within pFunction, for +// each sampler referenced inside the shader. This array is assumed to +// contain at least 16 elements. +// pCount +// Returns the number of samplers referenced by the shader +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXGetShaderSamplers( + CONST DWORD* pFunction, + LPCSTR* pSamplers, + UINT* pCount); + + +//---------------------------------------------------------------------------- +// D3DXGetShaderConstantTable: +// --------------------------- +// Gets shader constant table embedded inside shader. A constant table is +// generated by D3DXAssembleShader and D3DXCompileShader, and is embedded in +// the body of the shader. +// +// Parameters: +// pFunction +// Pointer to the function DWORD stream +// Flags +// See D3DXCONSTTABLE_xxx +// ppConstantTable +// Returns a ID3DXConstantTable object which can be used to set +// shader constants to the device. Alternatively, an application can +// parse the D3DXSHADER_CONSTANTTABLE block embedded as a comment within +// the shader. +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXGetShaderConstantTable( + CONST DWORD* pFunction, + LPD3DXCONSTANTTABLE* ppConstantTable); + +HRESULT WINAPI + D3DXGetShaderConstantTableEx( + CONST DWORD* pFunction, + DWORD Flags, + LPD3DXCONSTANTTABLE* ppConstantTable); + + + +//---------------------------------------------------------------------------- +// D3DXCreateTextureShader: +// ------------------------ +// Creates a texture shader object, given the compiled shader. +// +// Parameters +// pFunction +// Pointer to the function DWORD stream +// ppTextureShader +// Returns a ID3DXTextureShader object which can be used to procedurally +// fill the contents of a texture using the D3DXFillTextureTX functions. +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXCreateTextureShader( + CONST DWORD* pFunction, + LPD3DXTEXTURESHADER* ppTextureShader); + + +//---------------------------------------------------------------------------- +// D3DXPreprocessShader: +// --------------------- +// Runs the preprocessor on the specified shader or effect, but does +// not actually compile it. This is useful for evaluating the #includes +// and #defines in a shader and then emitting a reformatted token stream +// for debugging purposes or for generating a self-contained shader. +// +// Parameters: +// pSrcFile +// Source file name +// hSrcModule +// Module handle. if NULL, current module will be used +// pSrcResource +// Resource name in module +// pSrcData +// Pointer to source code +// SrcDataLen +// Size of source code, in bytes +// pDefines +// Optional NULL-terminated array of preprocessor macro definitions. +// pInclude +// Optional interface pointer to use for handling #include directives. +// If this parameter is NULL, #includes will be honored when assembling +// from file, and will error when assembling from resource or memory. +// ppShaderText +// Returns a buffer containing a single large string that represents +// the resulting formatted token stream +// ppErrorMsgs +// Returns a buffer containing a listing of errors and warnings that were +// encountered during assembly. If you are running in a debugger, +// these are the same messages you will see in your debug output. +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXPreprocessShaderFromFileA( + LPCSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); + +HRESULT WINAPI + D3DXPreprocessShaderFromFileW( + LPCWSTR pSrcFile, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); + +#ifdef UNICODE +#define D3DXPreprocessShaderFromFile D3DXPreprocessShaderFromFileW +#else +#define D3DXPreprocessShaderFromFile D3DXPreprocessShaderFromFileA +#endif + +HRESULT WINAPI + D3DXPreprocessShaderFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); + +HRESULT WINAPI + D3DXPreprocessShaderFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); + +#ifdef UNICODE +#define D3DXPreprocessShaderFromResource D3DXPreprocessShaderFromResourceW +#else +#define D3DXPreprocessShaderFromResource D3DXPreprocessShaderFromResourceA +#endif + +HRESULT WINAPI + D3DXPreprocessShader( + LPCSTR pSrcData, + UINT SrcDataSize, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPD3DXBUFFER* ppShaderText, + LPD3DXBUFFER* ppErrorMsgs); + + +#ifdef __cplusplus +} +#endif //__cplusplus + + +////////////////////////////////////////////////////////////////////////////// +// Shader comment block layouts ////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DXSHADER_CONSTANTTABLE: +// ------------------------- +// Shader constant information; included as an CTAB comment block inside +// shaders. All offsets are BYTE offsets from start of CONSTANTTABLE struct. +// Entries in the table are sorted by Name in ascending order. +//---------------------------------------------------------------------------- + +typedef struct _D3DXSHADER_CONSTANTTABLE +{ + DWORD Size; // sizeof(D3DXSHADER_CONSTANTTABLE) + DWORD Creator; // LPCSTR offset + DWORD Version; // shader version + DWORD Constants; // number of constants + DWORD ConstantInfo; // D3DXSHADER_CONSTANTINFO[Constants] offset + DWORD Flags; // flags shader was compiled with + DWORD Target; // LPCSTR offset + +} D3DXSHADER_CONSTANTTABLE, *LPD3DXSHADER_CONSTANTTABLE; + + +typedef struct _D3DXSHADER_CONSTANTINFO +{ + DWORD Name; // LPCSTR offset + WORD RegisterSet; // D3DXREGISTER_SET + WORD RegisterIndex; // register number + WORD RegisterCount; // number of registers + WORD Reserved; // reserved + DWORD TypeInfo; // D3DXSHADER_TYPEINFO offset + DWORD DefaultValue; // offset of default value + +} D3DXSHADER_CONSTANTINFO, *LPD3DXSHADER_CONSTANTINFO; + + +typedef struct _D3DXSHADER_TYPEINFO +{ + WORD Class; // D3DXPARAMETER_CLASS + WORD Type; // D3DXPARAMETER_TYPE + WORD Rows; // number of rows (matrices) + WORD Columns; // number of columns (vectors and matrices) + WORD Elements; // array dimension + WORD StructMembers; // number of struct members + DWORD StructMemberInfo; // D3DXSHADER_STRUCTMEMBERINFO[Members] offset + +} D3DXSHADER_TYPEINFO, *LPD3DXSHADER_TYPEINFO; + + +typedef struct _D3DXSHADER_STRUCTMEMBERINFO +{ + DWORD Name; // LPCSTR offset + DWORD TypeInfo; // D3DXSHADER_TYPEINFO offset + +} D3DXSHADER_STRUCTMEMBERINFO, *LPD3DXSHADER_STRUCTMEMBERINFO; + + + +#endif //__D3DX9SHADER_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dx9shape.h b/Src/Decoder_H264_ALL/D3D/include/d3dx9shape.h new file mode 100644 index 0000000..4c23091 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dx9shape.h @@ -0,0 +1,221 @@ +/////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9shapes.h +// Content: D3DX simple shapes +// +/////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#ifndef __D3DX9SHAPES_H__ +#define __D3DX9SHAPES_H__ + +/////////////////////////////////////////////////////////////////////////// +// Functions: +/////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + +//------------------------------------------------------------------------- +// D3DXCreatePolygon: +// ------------------ +// Creates a mesh containing an n-sided polygon. The polygon is centered +// at the origin. +// +// Parameters: +// +// pDevice The D3D device with which the mesh is going to be used. +// Length Length of each side. +// Sides Number of sides the polygon has. (Must be >= 3) +// ppMesh The mesh object which will be created +// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. +//------------------------------------------------------------------------- +HRESULT WINAPI + D3DXCreatePolygon( + LPDIRECT3DDEVICE9 pDevice, + FLOAT Length, + UINT Sides, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency); + + +//------------------------------------------------------------------------- +// D3DXCreateBox: +// -------------- +// Creates a mesh containing an axis-aligned box. The box is centered at +// the origin. +// +// Parameters: +// +// pDevice The D3D device with which the mesh is going to be used. +// Width Width of box (along X-axis) +// Height Height of box (along Y-axis) +// Depth Depth of box (along Z-axis) +// ppMesh The mesh object which will be created +// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. +//------------------------------------------------------------------------- +HRESULT WINAPI + D3DXCreateBox( + LPDIRECT3DDEVICE9 pDevice, + FLOAT Width, + FLOAT Height, + FLOAT Depth, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency); + + +//------------------------------------------------------------------------- +// D3DXCreateCylinder: +// ------------------- +// Creates a mesh containing a cylinder. The generated cylinder is +// centered at the origin, and its axis is aligned with the Z-axis. +// +// Parameters: +// +// pDevice The D3D device with which the mesh is going to be used. +// Radius1 Radius at -Z end (should be >= 0.0f) +// Radius2 Radius at +Z end (should be >= 0.0f) +// Length Length of cylinder (along Z-axis) +// Slices Number of slices about the main axis +// Stacks Number of stacks along the main axis +// ppMesh The mesh object which will be created +// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. +//------------------------------------------------------------------------- +HRESULT WINAPI + D3DXCreateCylinder( + LPDIRECT3DDEVICE9 pDevice, + FLOAT Radius1, + FLOAT Radius2, + FLOAT Length, + UINT Slices, + UINT Stacks, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency); + + +//------------------------------------------------------------------------- +// D3DXCreateSphere: +// ----------------- +// Creates a mesh containing a sphere. The sphere is centered at the +// origin. +// +// Parameters: +// +// pDevice The D3D device with which the mesh is going to be used. +// Radius Radius of the sphere (should be >= 0.0f) +// Slices Number of slices about the main axis +// Stacks Number of stacks along the main axis +// ppMesh The mesh object which will be created +// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. +//------------------------------------------------------------------------- +HRESULT WINAPI + D3DXCreateSphere( + LPDIRECT3DDEVICE9 pDevice, + FLOAT Radius, + UINT Slices, + UINT Stacks, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency); + + +//------------------------------------------------------------------------- +// D3DXCreateTorus: +// ---------------- +// Creates a mesh containing a torus. The generated torus is centered at +// the origin, and its axis is aligned with the Z-axis. +// +// Parameters: +// +// pDevice The D3D device with which the mesh is going to be used. +// InnerRadius Inner radius of the torus (should be >= 0.0f) +// OuterRadius Outer radius of the torue (should be >= 0.0f) +// Sides Number of sides in a cross-section (must be >= 3) +// Rings Number of rings making up the torus (must be >= 3) +// ppMesh The mesh object which will be created +// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. +//------------------------------------------------------------------------- +HRESULT WINAPI + D3DXCreateTorus( + LPDIRECT3DDEVICE9 pDevice, + FLOAT InnerRadius, + FLOAT OuterRadius, + UINT Sides, + UINT Rings, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency); + + +//------------------------------------------------------------------------- +// D3DXCreateTeapot: +// ----------------- +// Creates a mesh containing a teapot. +// +// Parameters: +// +// pDevice The D3D device with which the mesh is going to be used. +// ppMesh The mesh object which will be created +// ppAdjacency Returns a buffer containing adjacency info. Can be NULL. +//------------------------------------------------------------------------- +HRESULT WINAPI + D3DXCreateTeapot( + LPDIRECT3DDEVICE9 pDevice, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency); + + +//------------------------------------------------------------------------- +// D3DXCreateText: +// --------------- +// Creates a mesh containing the specified text using the font associated +// with the device context. +// +// Parameters: +// +// pDevice The D3D device with which the mesh is going to be used. +// hDC Device context, with desired font selected +// pText Text to generate +// Deviation Maximum chordal deviation from true font outlines +// Extrusion Amount to extrude text in -Z direction +// ppMesh The mesh object which will be created +// pGlyphMetrics Address of buffer to receive glyph metric data (or NULL) +//------------------------------------------------------------------------- +HRESULT WINAPI + D3DXCreateTextA( + LPDIRECT3DDEVICE9 pDevice, + HDC hDC, + LPCSTR pText, + FLOAT Deviation, + FLOAT Extrusion, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency, + LPGLYPHMETRICSFLOAT pGlyphMetrics); + +HRESULT WINAPI + D3DXCreateTextW( + LPDIRECT3DDEVICE9 pDevice, + HDC hDC, + LPCWSTR pText, + FLOAT Deviation, + FLOAT Extrusion, + LPD3DXMESH* ppMesh, + LPD3DXBUFFER* ppAdjacency, + LPGLYPHMETRICSFLOAT pGlyphMetrics); + +#ifdef UNICODE +#define D3DXCreateText D3DXCreateTextW +#else +#define D3DXCreateText D3DXCreateTextA +#endif + + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX9SHAPES_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dx9tex.h b/Src/Decoder_H264_ALL/D3D/include/d3dx9tex.h new file mode 100644 index 0000000..c4b6510 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dx9tex.h @@ -0,0 +1,1735 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9tex.h +// Content: D3DX texturing APIs +// +////////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#ifndef __D3DX9TEX_H__ +#define __D3DX9TEX_H__ + + +//---------------------------------------------------------------------------- +// D3DX_FILTER flags: +// ------------------ +// +// A valid filter must contain one of these values: +// +// D3DX_FILTER_NONE +// No scaling or filtering will take place. Pixels outside the bounds +// of the source image are assumed to be transparent black. +// D3DX_FILTER_POINT +// Each destination pixel is computed by sampling the nearest pixel +// from the source image. +// D3DX_FILTER_LINEAR +// Each destination pixel is computed by linearly interpolating between +// the nearest pixels in the source image. This filter works best +// when the scale on each axis is less than 2. +// D3DX_FILTER_TRIANGLE +// Every pixel in the source image contributes equally to the +// destination image. This is the slowest of all the filters. +// D3DX_FILTER_BOX +// Each pixel is computed by averaging a 2x2(x2) box pixels from +// the source image. Only works when the dimensions of the +// destination are half those of the source. (as with mip maps) +// +// And can be OR'd with any of these optional flags: +// +// D3DX_FILTER_MIRROR_U +// Indicates that pixels off the edge of the texture on the U-axis +// should be mirrored, not wraped. +// D3DX_FILTER_MIRROR_V +// Indicates that pixels off the edge of the texture on the V-axis +// should be mirrored, not wraped. +// D3DX_FILTER_MIRROR_W +// Indicates that pixels off the edge of the texture on the W-axis +// should be mirrored, not wraped. +// D3DX_FILTER_MIRROR +// Same as specifying D3DX_FILTER_MIRROR_U | D3DX_FILTER_MIRROR_V | +// D3DX_FILTER_MIRROR_V +// D3DX_FILTER_DITHER +// Dithers the resulting image using a 4x4 order dither pattern. +// D3DX_FILTER_SRGB_IN +// Denotes that the input data is in sRGB (gamma 2.2) colorspace. +// D3DX_FILTER_SRGB_OUT +// Denotes that the output data is in sRGB (gamma 2.2) colorspace. +// D3DX_FILTER_SRGB +// Same as specifying D3DX_FILTER_SRGB_IN | D3DX_FILTER_SRGB_OUT +// +//---------------------------------------------------------------------------- + +#define D3DX_FILTER_NONE (1 << 0) +#define D3DX_FILTER_POINT (2 << 0) +#define D3DX_FILTER_LINEAR (3 << 0) +#define D3DX_FILTER_TRIANGLE (4 << 0) +#define D3DX_FILTER_BOX (5 << 0) + +#define D3DX_FILTER_MIRROR_U (1 << 16) +#define D3DX_FILTER_MIRROR_V (2 << 16) +#define D3DX_FILTER_MIRROR_W (4 << 16) +#define D3DX_FILTER_MIRROR (7 << 16) + +#define D3DX_FILTER_DITHER (1 << 19) +#define D3DX_FILTER_DITHER_DIFFUSION (2 << 19) + +#define D3DX_FILTER_SRGB_IN (1 << 21) +#define D3DX_FILTER_SRGB_OUT (2 << 21) +#define D3DX_FILTER_SRGB (3 << 21) + + +//----------------------------------------------------------------------------- +// D3DX_SKIP_DDS_MIP_LEVELS is used to skip mip levels when loading a DDS file: +//----------------------------------------------------------------------------- + +#define D3DX_SKIP_DDS_MIP_LEVELS_MASK 0x1F +#define D3DX_SKIP_DDS_MIP_LEVELS_SHIFT 26 +#define D3DX_SKIP_DDS_MIP_LEVELS(levels, filter) ((((levels) & D3DX_SKIP_DDS_MIP_LEVELS_MASK) << D3DX_SKIP_DDS_MIP_LEVELS_SHIFT) | ((filter) == D3DX_DEFAULT ? D3DX_FILTER_BOX : (filter))) + + + + +//---------------------------------------------------------------------------- +// D3DX_NORMALMAP flags: +// --------------------- +// These flags are used to control how D3DXComputeNormalMap generates normal +// maps. Any number of these flags may be OR'd together in any combination. +// +// D3DX_NORMALMAP_MIRROR_U +// Indicates that pixels off the edge of the texture on the U-axis +// should be mirrored, not wraped. +// D3DX_NORMALMAP_MIRROR_V +// Indicates that pixels off the edge of the texture on the V-axis +// should be mirrored, not wraped. +// D3DX_NORMALMAP_MIRROR +// Same as specifying D3DX_NORMALMAP_MIRROR_U | D3DX_NORMALMAP_MIRROR_V +// D3DX_NORMALMAP_INVERTSIGN +// Inverts the direction of each normal +// D3DX_NORMALMAP_COMPUTE_OCCLUSION +// Compute the per pixel Occlusion term and encodes it into the alpha. +// An Alpha of 1 means that the pixel is not obscured in anyway, and +// an alpha of 0 would mean that the pixel is completly obscured. +// +//---------------------------------------------------------------------------- + +//---------------------------------------------------------------------------- + +#define D3DX_NORMALMAP_MIRROR_U (1 << 16) +#define D3DX_NORMALMAP_MIRROR_V (2 << 16) +#define D3DX_NORMALMAP_MIRROR (3 << 16) +#define D3DX_NORMALMAP_INVERTSIGN (8 << 16) +#define D3DX_NORMALMAP_COMPUTE_OCCLUSION (16 << 16) + + + + +//---------------------------------------------------------------------------- +// D3DX_CHANNEL flags: +// ------------------- +// These flags are used by functions which operate on or more channels +// in a texture. +// +// D3DX_CHANNEL_RED +// Indicates the red channel should be used +// D3DX_CHANNEL_BLUE +// Indicates the blue channel should be used +// D3DX_CHANNEL_GREEN +// Indicates the green channel should be used +// D3DX_CHANNEL_ALPHA +// Indicates the alpha channel should be used +// D3DX_CHANNEL_LUMINANCE +// Indicates the luminaces of the red green and blue channels should be +// used. +// +//---------------------------------------------------------------------------- + +#define D3DX_CHANNEL_RED (1 << 0) +#define D3DX_CHANNEL_BLUE (1 << 1) +#define D3DX_CHANNEL_GREEN (1 << 2) +#define D3DX_CHANNEL_ALPHA (1 << 3) +#define D3DX_CHANNEL_LUMINANCE (1 << 4) + + + + +//---------------------------------------------------------------------------- +// D3DXIMAGE_FILEFORMAT: +// --------------------- +// This enum is used to describe supported image file formats. +// +//---------------------------------------------------------------------------- + +typedef enum _D3DXIMAGE_FILEFORMAT +{ + D3DXIFF_BMP = 0, + D3DXIFF_JPG = 1, + D3DXIFF_TGA = 2, + D3DXIFF_PNG = 3, + D3DXIFF_DDS = 4, + D3DXIFF_PPM = 5, + D3DXIFF_DIB = 6, + D3DXIFF_HDR = 7, //high dynamic range formats + D3DXIFF_PFM = 8, // + D3DXIFF_FORCE_DWORD = 0x7fffffff + +} D3DXIMAGE_FILEFORMAT; + + +//---------------------------------------------------------------------------- +// LPD3DXFILL2D and LPD3DXFILL3D: +// ------------------------------ +// Function types used by the texture fill functions. +// +// Parameters: +// pOut +// Pointer to a vector which the function uses to return its result. +// X,Y,Z,W will be mapped to R,G,B,A respectivly. +// pTexCoord +// Pointer to a vector containing the coordinates of the texel currently +// being evaluated. Textures and VolumeTexture texcoord components +// range from 0 to 1. CubeTexture texcoord component range from -1 to 1. +// pTexelSize +// Pointer to a vector containing the dimensions of the current texel. +// pData +// Pointer to user data. +// +//---------------------------------------------------------------------------- + +typedef VOID (WINAPI *LPD3DXFILL2D)(D3DXVECTOR4 *pOut, + CONST D3DXVECTOR2 *pTexCoord, CONST D3DXVECTOR2 *pTexelSize, LPVOID pData); + +typedef VOID (WINAPI *LPD3DXFILL3D)(D3DXVECTOR4 *pOut, + CONST D3DXVECTOR3 *pTexCoord, CONST D3DXVECTOR3 *pTexelSize, LPVOID pData); + + + +//---------------------------------------------------------------------------- +// D3DXIMAGE_INFO: +// --------------- +// This structure is used to return a rough description of what the +// the original contents of an image file looked like. +// +// Width +// Width of original image in pixels +// Height +// Height of original image in pixels +// Depth +// Depth of original image in pixels +// MipLevels +// Number of mip levels in original image +// Format +// D3D format which most closely describes the data in original image +// ResourceType +// D3DRESOURCETYPE representing the type of texture stored in the file. +// D3DRTYPE_TEXTURE, D3DRTYPE_VOLUMETEXTURE, or D3DRTYPE_CUBETEXTURE. +// ImageFileFormat +// D3DXIMAGE_FILEFORMAT representing the format of the image file. +// +//---------------------------------------------------------------------------- + +typedef struct _D3DXIMAGE_INFO +{ + UINT Width; + UINT Height; + UINT Depth; + UINT MipLevels; + D3DFORMAT Format; + D3DRESOURCETYPE ResourceType; + D3DXIMAGE_FILEFORMAT ImageFileFormat; + +} D3DXIMAGE_INFO; + + + + + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + + + +////////////////////////////////////////////////////////////////////////////// +// Image File APIs /////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +; +//---------------------------------------------------------------------------- +// GetImageInfoFromFile/Resource: +// ------------------------------ +// Fills in a D3DXIMAGE_INFO struct with information about an image file. +// +// Parameters: +// pSrcFile +// File name of the source image. +// pSrcModule +// Module where resource is located, or NULL for module associated +// with image the os used to create the current process. +// pSrcResource +// Resource name +// pSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// pSrcInfo +// Pointer to a D3DXIMAGE_INFO structure to be filled in with the +// description of the data in the source image file. +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXGetImageInfoFromFileA( + LPCSTR pSrcFile, + D3DXIMAGE_INFO* pSrcInfo); + +HRESULT WINAPI + D3DXGetImageInfoFromFileW( + LPCWSTR pSrcFile, + D3DXIMAGE_INFO* pSrcInfo); + +#ifdef UNICODE +#define D3DXGetImageInfoFromFile D3DXGetImageInfoFromFileW +#else +#define D3DXGetImageInfoFromFile D3DXGetImageInfoFromFileA +#endif + + +HRESULT WINAPI + D3DXGetImageInfoFromResourceA( + HMODULE hSrcModule, + LPCSTR pSrcResource, + D3DXIMAGE_INFO* pSrcInfo); + +HRESULT WINAPI + D3DXGetImageInfoFromResourceW( + HMODULE hSrcModule, + LPCWSTR pSrcResource, + D3DXIMAGE_INFO* pSrcInfo); + +#ifdef UNICODE +#define D3DXGetImageInfoFromResource D3DXGetImageInfoFromResourceW +#else +#define D3DXGetImageInfoFromResource D3DXGetImageInfoFromResourceA +#endif + + +HRESULT WINAPI + D3DXGetImageInfoFromFileInMemory( + LPCVOID pSrcData, + UINT SrcDataSize, + D3DXIMAGE_INFO* pSrcInfo); + + + + +////////////////////////////////////////////////////////////////////////////// +// Load/Save Surface APIs //////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DXLoadSurfaceFromFile/Resource: +// --------------------------------- +// Load surface from a file or resource +// +// Parameters: +// pDestSurface +// Destination surface, which will receive the image. +// pDestPalette +// Destination palette of 256 colors, or NULL +// pDestRect +// Destination rectangle, or NULL for entire surface +// pSrcFile +// File name of the source image. +// pSrcModule +// Module where resource is located, or NULL for module associated +// with image the os used to create the current process. +// pSrcResource +// Resource name +// pSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// pSrcRect +// Source rectangle, or NULL for entire image +// Filter +// D3DX_FILTER flags controlling how the image is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. +// ColorKey +// Color to replace with transparent black, or 0 to disable colorkey. +// This is always a 32-bit ARGB color, independent of the source image +// format. Alpha is significant, and should usually be set to FF for +// opaque colorkeys. (ex. Opaque black == 0xff000000) +// pSrcInfo +// Pointer to a D3DXIMAGE_INFO structure to be filled in with the +// description of the data in the source image file, or NULL. +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXLoadSurfaceFromFileA( + LPDIRECT3DSURFACE9 pDestSurface, + CONST PALETTEENTRY* pDestPalette, + CONST RECT* pDestRect, + LPCSTR pSrcFile, + CONST RECT* pSrcRect, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + +HRESULT WINAPI + D3DXLoadSurfaceFromFileW( + LPDIRECT3DSURFACE9 pDestSurface, + CONST PALETTEENTRY* pDestPalette, + CONST RECT* pDestRect, + LPCWSTR pSrcFile, + CONST RECT* pSrcRect, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + +#ifdef UNICODE +#define D3DXLoadSurfaceFromFile D3DXLoadSurfaceFromFileW +#else +#define D3DXLoadSurfaceFromFile D3DXLoadSurfaceFromFileA +#endif + + + +HRESULT WINAPI + D3DXLoadSurfaceFromResourceA( + LPDIRECT3DSURFACE9 pDestSurface, + CONST PALETTEENTRY* pDestPalette, + CONST RECT* pDestRect, + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST RECT* pSrcRect, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + +HRESULT WINAPI + D3DXLoadSurfaceFromResourceW( + LPDIRECT3DSURFACE9 pDestSurface, + CONST PALETTEENTRY* pDestPalette, + CONST RECT* pDestRect, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST RECT* pSrcRect, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + + +#ifdef UNICODE +#define D3DXLoadSurfaceFromResource D3DXLoadSurfaceFromResourceW +#else +#define D3DXLoadSurfaceFromResource D3DXLoadSurfaceFromResourceA +#endif + + + +HRESULT WINAPI + D3DXLoadSurfaceFromFileInMemory( + LPDIRECT3DSURFACE9 pDestSurface, + CONST PALETTEENTRY* pDestPalette, + CONST RECT* pDestRect, + LPCVOID pSrcData, + UINT SrcDataSize, + CONST RECT* pSrcRect, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + + + +//---------------------------------------------------------------------------- +// D3DXLoadSurfaceFromSurface: +// --------------------------- +// Load surface from another surface (with color conversion) +// +// Parameters: +// pDestSurface +// Destination surface, which will receive the image. +// pDestPalette +// Destination palette of 256 colors, or NULL +// pDestRect +// Destination rectangle, or NULL for entire surface +// pSrcSurface +// Source surface +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcRect +// Source rectangle, or NULL for entire surface +// Filter +// D3DX_FILTER flags controlling how the image is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. +// ColorKey +// Color to replace with transparent black, or 0 to disable colorkey. +// This is always a 32-bit ARGB color, independent of the source image +// format. Alpha is significant, and should usually be set to FF for +// opaque colorkeys. (ex. Opaque black == 0xff000000) +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXLoadSurfaceFromSurface( + LPDIRECT3DSURFACE9 pDestSurface, + CONST PALETTEENTRY* pDestPalette, + CONST RECT* pDestRect, + LPDIRECT3DSURFACE9 pSrcSurface, + CONST PALETTEENTRY* pSrcPalette, + CONST RECT* pSrcRect, + DWORD Filter, + D3DCOLOR ColorKey); + + +//---------------------------------------------------------------------------- +// D3DXLoadSurfaceFromMemory: +// -------------------------- +// Load surface from memory. +// +// Parameters: +// pDestSurface +// Destination surface, which will receive the image. +// pDestPalette +// Destination palette of 256 colors, or NULL +// pDestRect +// Destination rectangle, or NULL for entire surface +// pSrcMemory +// Pointer to the top-left corner of the source image in memory +// SrcFormat +// Pixel format of the source image. +// SrcPitch +// Pitch of source image, in bytes. For DXT formats, this number +// should represent the width of one row of cells, in bytes. +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcRect +// Source rectangle. +// Filter +// D3DX_FILTER flags controlling how the image is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. +// ColorKey +// Color to replace with transparent black, or 0 to disable colorkey. +// This is always a 32-bit ARGB color, independent of the source image +// format. Alpha is significant, and should usually be set to FF for +// opaque colorkeys. (ex. Opaque black == 0xff000000) +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXLoadSurfaceFromMemory( + LPDIRECT3DSURFACE9 pDestSurface, + CONST PALETTEENTRY* pDestPalette, + CONST RECT* pDestRect, + LPCVOID pSrcMemory, + D3DFORMAT SrcFormat, + UINT SrcPitch, + CONST PALETTEENTRY* pSrcPalette, + CONST RECT* pSrcRect, + DWORD Filter, + D3DCOLOR ColorKey); + + +//---------------------------------------------------------------------------- +// D3DXSaveSurfaceToFile: +// ---------------------- +// Save a surface to a image file. +// +// Parameters: +// pDestFile +// File name of the destination file +// DestFormat +// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. +// pSrcSurface +// Source surface, containing the image to be saved +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcRect +// Source rectangle, or NULL for the entire image +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXSaveSurfaceToFileA( + LPCSTR pDestFile, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DSURFACE9 pSrcSurface, + CONST PALETTEENTRY* pSrcPalette, + CONST RECT* pSrcRect); + +HRESULT WINAPI + D3DXSaveSurfaceToFileW( + LPCWSTR pDestFile, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DSURFACE9 pSrcSurface, + CONST PALETTEENTRY* pSrcPalette, + CONST RECT* pSrcRect); + +#ifdef UNICODE +#define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileW +#else +#define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileA +#endif + +//---------------------------------------------------------------------------- +// D3DXSaveSurfaceToFileInMemory: +// ---------------------- +// Save a surface to a image file. +// +// Parameters: +// ppDestBuf +// address of pointer to d3dxbuffer for returning data bits +// DestFormat +// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. +// pSrcSurface +// Source surface, containing the image to be saved +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcRect +// Source rectangle, or NULL for the entire image +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXSaveSurfaceToFileInMemory( + LPD3DXBUFFER* ppDestBuf, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DSURFACE9 pSrcSurface, + CONST PALETTEENTRY* pSrcPalette, + CONST RECT* pSrcRect); + + +////////////////////////////////////////////////////////////////////////////// +// Load/Save Volume APIs ///////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DXLoadVolumeFromFile/Resource: +// -------------------------------- +// Load volume from a file or resource +// +// Parameters: +// pDestVolume +// Destination volume, which will receive the image. +// pDestPalette +// Destination palette of 256 colors, or NULL +// pDestBox +// Destination box, or NULL for entire volume +// pSrcFile +// File name of the source image. +// pSrcModule +// Module where resource is located, or NULL for module associated +// with image the os used to create the current process. +// pSrcResource +// Resource name +// pSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// pSrcBox +// Source box, or NULL for entire image +// Filter +// D3DX_FILTER flags controlling how the image is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. +// ColorKey +// Color to replace with transparent black, or 0 to disable colorkey. +// This is always a 32-bit ARGB color, independent of the source image +// format. Alpha is significant, and should usually be set to FF for +// opaque colorkeys. (ex. Opaque black == 0xff000000) +// pSrcInfo +// Pointer to a D3DXIMAGE_INFO structure to be filled in with the +// description of the data in the source image file, or NULL. +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXLoadVolumeFromFileA( + LPDIRECT3DVOLUME9 pDestVolume, + CONST PALETTEENTRY* pDestPalette, + CONST D3DBOX* pDestBox, + LPCSTR pSrcFile, + CONST D3DBOX* pSrcBox, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + +HRESULT WINAPI + D3DXLoadVolumeFromFileW( + LPDIRECT3DVOLUME9 pDestVolume, + CONST PALETTEENTRY* pDestPalette, + CONST D3DBOX* pDestBox, + LPCWSTR pSrcFile, + CONST D3DBOX* pSrcBox, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + +#ifdef UNICODE +#define D3DXLoadVolumeFromFile D3DXLoadVolumeFromFileW +#else +#define D3DXLoadVolumeFromFile D3DXLoadVolumeFromFileA +#endif + + +HRESULT WINAPI + D3DXLoadVolumeFromResourceA( + LPDIRECT3DVOLUME9 pDestVolume, + CONST PALETTEENTRY* pDestPalette, + CONST D3DBOX* pDestBox, + HMODULE hSrcModule, + LPCSTR pSrcResource, + CONST D3DBOX* pSrcBox, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + +HRESULT WINAPI + D3DXLoadVolumeFromResourceW( + LPDIRECT3DVOLUME9 pDestVolume, + CONST PALETTEENTRY* pDestPalette, + CONST D3DBOX* pDestBox, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + CONST D3DBOX* pSrcBox, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + +#ifdef UNICODE +#define D3DXLoadVolumeFromResource D3DXLoadVolumeFromResourceW +#else +#define D3DXLoadVolumeFromResource D3DXLoadVolumeFromResourceA +#endif + + + +HRESULT WINAPI + D3DXLoadVolumeFromFileInMemory( + LPDIRECT3DVOLUME9 pDestVolume, + CONST PALETTEENTRY* pDestPalette, + CONST D3DBOX* pDestBox, + LPCVOID pSrcData, + UINT SrcDataSize, + CONST D3DBOX* pSrcBox, + DWORD Filter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo); + + + +//---------------------------------------------------------------------------- +// D3DXLoadVolumeFromVolume: +// ------------------------- +// Load volume from another volume (with color conversion) +// +// Parameters: +// pDestVolume +// Destination volume, which will receive the image. +// pDestPalette +// Destination palette of 256 colors, or NULL +// pDestBox +// Destination box, or NULL for entire volume +// pSrcVolume +// Source volume +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcBox +// Source box, or NULL for entire volume +// Filter +// D3DX_FILTER flags controlling how the image is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. +// ColorKey +// Color to replace with transparent black, or 0 to disable colorkey. +// This is always a 32-bit ARGB color, independent of the source image +// format. Alpha is significant, and should usually be set to FF for +// opaque colorkeys. (ex. Opaque black == 0xff000000) +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXLoadVolumeFromVolume( + LPDIRECT3DVOLUME9 pDestVolume, + CONST PALETTEENTRY* pDestPalette, + CONST D3DBOX* pDestBox, + LPDIRECT3DVOLUME9 pSrcVolume, + CONST PALETTEENTRY* pSrcPalette, + CONST D3DBOX* pSrcBox, + DWORD Filter, + D3DCOLOR ColorKey); + + + +//---------------------------------------------------------------------------- +// D3DXLoadVolumeFromMemory: +// ------------------------- +// Load volume from memory. +// +// Parameters: +// pDestVolume +// Destination volume, which will receive the image. +// pDestPalette +// Destination palette of 256 colors, or NULL +// pDestBox +// Destination box, or NULL for entire volume +// pSrcMemory +// Pointer to the top-left corner of the source volume in memory +// SrcFormat +// Pixel format of the source volume. +// SrcRowPitch +// Pitch of source image, in bytes. For DXT formats, this number +// should represent the size of one row of cells, in bytes. +// SrcSlicePitch +// Pitch of source image, in bytes. For DXT formats, this number +// should represent the size of one slice of cells, in bytes. +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcBox +// Source box. +// Filter +// D3DX_FILTER flags controlling how the image is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. +// ColorKey +// Color to replace with transparent black, or 0 to disable colorkey. +// This is always a 32-bit ARGB color, independent of the source image +// format. Alpha is significant, and should usually be set to FF for +// opaque colorkeys. (ex. Opaque black == 0xff000000) +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXLoadVolumeFromMemory( + LPDIRECT3DVOLUME9 pDestVolume, + CONST PALETTEENTRY* pDestPalette, + CONST D3DBOX* pDestBox, + LPCVOID pSrcMemory, + D3DFORMAT SrcFormat, + UINT SrcRowPitch, + UINT SrcSlicePitch, + CONST PALETTEENTRY* pSrcPalette, + CONST D3DBOX* pSrcBox, + DWORD Filter, + D3DCOLOR ColorKey); + + + +//---------------------------------------------------------------------------- +// D3DXSaveVolumeToFile: +// --------------------- +// Save a volume to a image file. +// +// Parameters: +// pDestFile +// File name of the destination file +// DestFormat +// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. +// pSrcVolume +// Source volume, containing the image to be saved +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcBox +// Source box, or NULL for the entire volume +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXSaveVolumeToFileA( + LPCSTR pDestFile, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DVOLUME9 pSrcVolume, + CONST PALETTEENTRY* pSrcPalette, + CONST D3DBOX* pSrcBox); + +HRESULT WINAPI + D3DXSaveVolumeToFileW( + LPCWSTR pDestFile, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DVOLUME9 pSrcVolume, + CONST PALETTEENTRY* pSrcPalette, + CONST D3DBOX* pSrcBox); + +#ifdef UNICODE +#define D3DXSaveVolumeToFile D3DXSaveVolumeToFileW +#else +#define D3DXSaveVolumeToFile D3DXSaveVolumeToFileA +#endif + + +//---------------------------------------------------------------------------- +// D3DXSaveVolumeToFileInMemory: +// --------------------- +// Save a volume to a image file. +// +// Parameters: +// pDestFile +// File name of the destination file +// DestFormat +// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. +// pSrcVolume +// Source volume, containing the image to be saved +// pSrcPalette +// Source palette of 256 colors, or NULL +// pSrcBox +// Source box, or NULL for the entire volume +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXSaveVolumeToFileInMemory( + LPD3DXBUFFER* ppDestBuf, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DVOLUME9 pSrcVolume, + CONST PALETTEENTRY* pSrcPalette, + CONST D3DBOX* pSrcBox); + +////////////////////////////////////////////////////////////////////////////// +// Create/Save Texture APIs ////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DXCheckTextureRequirements: +// ----------------------------- +// Checks texture creation parameters. If parameters are invalid, this +// function returns corrected parameters. +// +// Parameters: +// +// pDevice +// The D3D device to be used +// pWidth, pHeight, pDepth, pSize +// Desired size in pixels, or NULL. Returns corrected size. +// pNumMipLevels +// Number of desired mipmap levels, or NULL. Returns corrected number. +// Usage +// Texture usage flags +// pFormat +// Desired pixel format, or NULL. Returns corrected format. +// Pool +// Memory pool to be used to create texture +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXCheckTextureRequirements( + LPDIRECT3DDEVICE9 pDevice, + UINT* pWidth, + UINT* pHeight, + UINT* pNumMipLevels, + DWORD Usage, + D3DFORMAT* pFormat, + D3DPOOL Pool); + +HRESULT WINAPI + D3DXCheckCubeTextureRequirements( + LPDIRECT3DDEVICE9 pDevice, + UINT* pSize, + UINT* pNumMipLevels, + DWORD Usage, + D3DFORMAT* pFormat, + D3DPOOL Pool); + +HRESULT WINAPI + D3DXCheckVolumeTextureRequirements( + LPDIRECT3DDEVICE9 pDevice, + UINT* pWidth, + UINT* pHeight, + UINT* pDepth, + UINT* pNumMipLevels, + DWORD Usage, + D3DFORMAT* pFormat, + D3DPOOL Pool); + + +//---------------------------------------------------------------------------- +// D3DXCreateTexture: +// ------------------ +// Create an empty texture +// +// Parameters: +// +// pDevice +// The D3D device with which the texture is going to be used. +// Width, Height, Depth, Size +// size in pixels. these must be non-zero +// MipLevels +// number of mip levels desired. if zero or D3DX_DEFAULT, a complete +// mipmap chain will be created. +// Usage +// Texture usage flags +// Format +// Pixel format. +// Pool +// Memory pool to be used to create texture +// ppTexture, ppCubeTexture, ppVolumeTexture +// The texture object that will be created +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXCreateTexture( + LPDIRECT3DDEVICE9 pDevice, + UINT Width, + UINT Height, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + LPDIRECT3DTEXTURE9* ppTexture); + +HRESULT WINAPI + D3DXCreateCubeTexture( + LPDIRECT3DDEVICE9 pDevice, + UINT Size, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +HRESULT WINAPI + D3DXCreateVolumeTexture( + LPDIRECT3DDEVICE9 pDevice, + UINT Width, + UINT Height, + UINT Depth, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + + + +//---------------------------------------------------------------------------- +// D3DXCreateTextureFromFile/Resource: +// ----------------------------------- +// Create a texture object from a file or resource. +// +// Parameters: +// +// pDevice +// The D3D device with which the texture is going to be used. +// pSrcFile +// File name. +// hSrcModule +// Module handle. if NULL, current module will be used. +// pSrcResource +// Resource name in module +// pvSrcData +// Pointer to file in memory. +// SrcDataSize +// Size in bytes of file in memory. +// Width, Height, Depth, Size +// Size in pixels. If zero or D3DX_DEFAULT, the size will be taken from +// the file and rounded up to a power of two. If D3DX_DEFAULT_NONPOW2, +// and the device supports NONPOW2 textures, the size will not be rounded. +// If D3DX_FROM_FILE, the size will be taken exactly as it is in the file, +// and the call will fail if this violates device capabilities. +// MipLevels +// Number of mip levels. If zero or D3DX_DEFAULT, a complete mipmap +// chain will be created. If D3DX_FROM_FILE, the size will be taken +// exactly as it is in the file, and the call will fail if this violates +// device capabilities. +// Usage +// Texture usage flags +// Format +// Desired pixel format. If D3DFMT_UNKNOWN, the format will be +// taken from the file. If D3DFMT_FROM_FILE, the format will be taken +// exactly as it is in the file, and the call will fail if the device does +// not support the given format. +// Pool +// Memory pool to be used to create texture +// Filter +// D3DX_FILTER flags controlling how the image is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE. +// MipFilter +// D3DX_FILTER flags controlling how each miplevel is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_BOX. +// Use the D3DX_SKIP_DDS_MIP_LEVELS macro to specify both a filter and the +// number of mip levels to skip when loading DDS files. +// ColorKey +// Color to replace with transparent black, or 0 to disable colorkey. +// This is always a 32-bit ARGB color, independent of the source image +// format. Alpha is significant, and should usually be set to FF for +// opaque colorkeys. (ex. Opaque black == 0xff000000) +// pSrcInfo +// Pointer to a D3DXIMAGE_INFO structure to be filled in with the +// description of the data in the source image file, or NULL. +// pPalette +// 256 color palette to be filled in, or NULL +// ppTexture, ppCubeTexture, ppVolumeTexture +// The texture object that will be created +// +//---------------------------------------------------------------------------- + +// FromFile + +HRESULT WINAPI + D3DXCreateTextureFromFileA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + LPDIRECT3DTEXTURE9* ppTexture); + +HRESULT WINAPI + D3DXCreateTextureFromFileW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + LPDIRECT3DTEXTURE9* ppTexture); + +#ifdef UNICODE +#define D3DXCreateTextureFromFile D3DXCreateTextureFromFileW +#else +#define D3DXCreateTextureFromFile D3DXCreateTextureFromFileA +#endif + + +HRESULT WINAPI + D3DXCreateCubeTextureFromFileA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +HRESULT WINAPI + D3DXCreateCubeTextureFromFileW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +#ifdef UNICODE +#define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileW +#else +#define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileA +#endif + + +HRESULT WINAPI + D3DXCreateVolumeTextureFromFileA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +HRESULT WINAPI + D3DXCreateVolumeTextureFromFileW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +#ifdef UNICODE +#define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileW +#else +#define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileA +#endif + + +// FromResource + +HRESULT WINAPI + D3DXCreateTextureFromResourceA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + LPDIRECT3DTEXTURE9* ppTexture); + +HRESULT WINAPI + D3DXCreateTextureFromResourceW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + LPDIRECT3DTEXTURE9* ppTexture); + +#ifdef UNICODE +#define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceW +#else +#define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceA +#endif + + +HRESULT WINAPI + D3DXCreateCubeTextureFromResourceA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +HRESULT WINAPI + D3DXCreateCubeTextureFromResourceW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +#ifdef UNICODE +#define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceW +#else +#define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceA +#endif + + +HRESULT WINAPI + D3DXCreateVolumeTextureFromResourceA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +HRESULT WINAPI + D3DXCreateVolumeTextureFromResourceW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +#ifdef UNICODE +#define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceW +#else +#define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceA +#endif + + +// FromFileEx + +HRESULT WINAPI + D3DXCreateTextureFromFileExA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + UINT Width, + UINT Height, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DTEXTURE9* ppTexture); + +HRESULT WINAPI + D3DXCreateTextureFromFileExW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + UINT Width, + UINT Height, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DTEXTURE9* ppTexture); + +#ifdef UNICODE +#define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExW +#else +#define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExA +#endif + + +HRESULT WINAPI + D3DXCreateCubeTextureFromFileExA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + UINT Size, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +HRESULT WINAPI + D3DXCreateCubeTextureFromFileExW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + UINT Size, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +#ifdef UNICODE +#define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExW +#else +#define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExA +#endif + + +HRESULT WINAPI + D3DXCreateVolumeTextureFromFileExA( + LPDIRECT3DDEVICE9 pDevice, + LPCSTR pSrcFile, + UINT Width, + UINT Height, + UINT Depth, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +HRESULT WINAPI + D3DXCreateVolumeTextureFromFileExW( + LPDIRECT3DDEVICE9 pDevice, + LPCWSTR pSrcFile, + UINT Width, + UINT Height, + UINT Depth, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +#ifdef UNICODE +#define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExW +#else +#define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExA +#endif + + +// FromResourceEx + +HRESULT WINAPI + D3DXCreateTextureFromResourceExA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + UINT Width, + UINT Height, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DTEXTURE9* ppTexture); + +HRESULT WINAPI + D3DXCreateTextureFromResourceExW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + UINT Width, + UINT Height, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DTEXTURE9* ppTexture); + +#ifdef UNICODE +#define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExW +#else +#define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExA +#endif + + +HRESULT WINAPI + D3DXCreateCubeTextureFromResourceExA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + UINT Size, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +HRESULT WINAPI + D3DXCreateCubeTextureFromResourceExW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + UINT Size, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +#ifdef UNICODE +#define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExW +#else +#define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExA +#endif + + +HRESULT WINAPI + D3DXCreateVolumeTextureFromResourceExA( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCSTR pSrcResource, + UINT Width, + UINT Height, + UINT Depth, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +HRESULT WINAPI + D3DXCreateVolumeTextureFromResourceExW( + LPDIRECT3DDEVICE9 pDevice, + HMODULE hSrcModule, + LPCWSTR pSrcResource, + UINT Width, + UINT Height, + UINT Depth, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + +#ifdef UNICODE +#define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExW +#else +#define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExA +#endif + + +// FromFileInMemory + +HRESULT WINAPI + D3DXCreateTextureFromFileInMemory( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataSize, + LPDIRECT3DTEXTURE9* ppTexture); + +HRESULT WINAPI + D3DXCreateCubeTextureFromFileInMemory( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataSize, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +HRESULT WINAPI + D3DXCreateVolumeTextureFromFileInMemory( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataSize, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + + +// FromFileInMemoryEx + +HRESULT WINAPI + D3DXCreateTextureFromFileInMemoryEx( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataSize, + UINT Width, + UINT Height, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DTEXTURE9* ppTexture); + +HRESULT WINAPI + D3DXCreateCubeTextureFromFileInMemoryEx( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataSize, + UINT Size, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DCUBETEXTURE9* ppCubeTexture); + +HRESULT WINAPI + D3DXCreateVolumeTextureFromFileInMemoryEx( + LPDIRECT3DDEVICE9 pDevice, + LPCVOID pSrcData, + UINT SrcDataSize, + UINT Width, + UINT Height, + UINT Depth, + UINT MipLevels, + DWORD Usage, + D3DFORMAT Format, + D3DPOOL Pool, + DWORD Filter, + DWORD MipFilter, + D3DCOLOR ColorKey, + D3DXIMAGE_INFO* pSrcInfo, + PALETTEENTRY* pPalette, + LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture); + + + +//---------------------------------------------------------------------------- +// D3DXSaveTextureToFile: +// ---------------------- +// Save a texture to a file. +// +// Parameters: +// pDestFile +// File name of the destination file +// DestFormat +// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. +// pSrcTexture +// Source texture, containing the image to be saved +// pSrcPalette +// Source palette of 256 colors, or NULL +// +//---------------------------------------------------------------------------- + + +HRESULT WINAPI + D3DXSaveTextureToFileA( + LPCSTR pDestFile, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DBASETEXTURE9 pSrcTexture, + CONST PALETTEENTRY* pSrcPalette); + +HRESULT WINAPI + D3DXSaveTextureToFileW( + LPCWSTR pDestFile, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DBASETEXTURE9 pSrcTexture, + CONST PALETTEENTRY* pSrcPalette); + +#ifdef UNICODE +#define D3DXSaveTextureToFile D3DXSaveTextureToFileW +#else +#define D3DXSaveTextureToFile D3DXSaveTextureToFileA +#endif + + +//---------------------------------------------------------------------------- +// D3DXSaveTextureToFileInMemory: +// ---------------------- +// Save a texture to a file. +// +// Parameters: +// ppDestBuf +// address of a d3dxbuffer pointer to return the image data +// DestFormat +// D3DXIMAGE_FILEFORMAT specifying file format to use when saving. +// pSrcTexture +// Source texture, containing the image to be saved +// pSrcPalette +// Source palette of 256 colors, or NULL +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXSaveTextureToFileInMemory( + LPD3DXBUFFER* ppDestBuf, + D3DXIMAGE_FILEFORMAT DestFormat, + LPDIRECT3DBASETEXTURE9 pSrcTexture, + CONST PALETTEENTRY* pSrcPalette); + + + + +////////////////////////////////////////////////////////////////////////////// +// Misc Texture APIs ///////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +//---------------------------------------------------------------------------- +// D3DXFilterTexture: +// ------------------ +// Filters mipmaps levels of a texture. +// +// Parameters: +// pBaseTexture +// The texture object to be filtered +// pPalette +// 256 color palette to be used, or NULL for non-palettized formats +// SrcLevel +// The level whose image is used to generate the subsequent levels. +// Filter +// D3DX_FILTER flags controlling how each miplevel is filtered. +// Or D3DX_DEFAULT for D3DX_FILTER_BOX, +// +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXFilterTexture( + LPDIRECT3DBASETEXTURE9 pBaseTexture, + CONST PALETTEENTRY* pPalette, + UINT SrcLevel, + DWORD Filter); + +#define D3DXFilterCubeTexture D3DXFilterTexture +#define D3DXFilterVolumeTexture D3DXFilterTexture + + + +//---------------------------------------------------------------------------- +// D3DXFillTexture: +// ---------------- +// Uses a user provided function to fill each texel of each mip level of a +// given texture. +// +// Paramters: +// pTexture, pCubeTexture, pVolumeTexture +// Pointer to the texture to be filled. +// pFunction +// Pointer to user provided evalutor function which will be used to +// compute the value of each texel. +// pData +// Pointer to an arbitrary block of user defined data. This pointer +// will be passed to the function provided in pFunction +//----------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXFillTexture( + LPDIRECT3DTEXTURE9 pTexture, + LPD3DXFILL2D pFunction, + LPVOID pData); + +HRESULT WINAPI + D3DXFillCubeTexture( + LPDIRECT3DCUBETEXTURE9 pCubeTexture, + LPD3DXFILL3D pFunction, + LPVOID pData); + +HRESULT WINAPI + D3DXFillVolumeTexture( + LPDIRECT3DVOLUMETEXTURE9 pVolumeTexture, + LPD3DXFILL3D pFunction, + LPVOID pData); + +//--------------------------------------------------------------------------- +// D3DXFillTextureTX: +// ------------------ +// Uses a TX Shader target to function to fill each texel of each mip level +// of a given texture. The TX Shader target should be a compiled function +// taking 2 paramters and returning a float4 color. +// +// Paramters: +// pTexture, pCubeTexture, pVolumeTexture +// Pointer to the texture to be filled. +// pTextureShader +// Pointer to the texture shader to be used to fill in the texture +//---------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXFillTextureTX( + LPDIRECT3DTEXTURE9 pTexture, + LPD3DXTEXTURESHADER pTextureShader); + + +HRESULT WINAPI + D3DXFillCubeTextureTX( + LPDIRECT3DCUBETEXTURE9 pCubeTexture, + LPD3DXTEXTURESHADER pTextureShader); + + +HRESULT WINAPI + D3DXFillVolumeTextureTX( + LPDIRECT3DVOLUMETEXTURE9 pVolumeTexture, + LPD3DXTEXTURESHADER pTextureShader); + + + +//---------------------------------------------------------------------------- +// D3DXComputeNormalMap: +// --------------------- +// Converts a height map into a normal map. The (x,y,z) components of each +// normal are mapped to the (r,g,b) channels of the output texture. +// +// Parameters +// pTexture +// Pointer to the destination texture +// pSrcTexture +// Pointer to the source heightmap texture +// pSrcPalette +// Source palette of 256 colors, or NULL +// Flags +// D3DX_NORMALMAP flags +// Channel +// D3DX_CHANNEL specifying source of height information +// Amplitude +// The constant value which the height information is multiplied by. +//--------------------------------------------------------------------------- + +HRESULT WINAPI + D3DXComputeNormalMap( + LPDIRECT3DTEXTURE9 pTexture, + LPDIRECT3DTEXTURE9 pSrcTexture, + CONST PALETTEENTRY* pSrcPalette, + DWORD Flags, + DWORD Channel, + FLOAT Amplitude); + + + + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3DX9TEX_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/d3dx9xof.h b/Src/Decoder_H264_ALL/D3D/include/d3dx9xof.h new file mode 100644 index 0000000..c513f0f --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/d3dx9xof.h @@ -0,0 +1,299 @@ +/////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: d3dx9xof.h +// Content: D3DX .X File types and functions +// +/////////////////////////////////////////////////////////////////////////// + +#include "d3dx9.h" + +#if !defined( __D3DX9XOF_H__ ) +#define __D3DX9XOF_H__ + +#if defined( __cplusplus ) +extern "C" { +#endif // defined( __cplusplus ) + +//---------------------------------------------------------------------------- +// D3DXF_FILEFORMAT +// This flag is used to specify what file type to use when saving to disk. +// _BINARY, and _TEXT are mutually exclusive, while +// _COMPRESSED is an optional setting that works with all file types. +//---------------------------------------------------------------------------- +typedef DWORD D3DXF_FILEFORMAT; + +#define D3DXF_FILEFORMAT_BINARY 0 +#define D3DXF_FILEFORMAT_TEXT 1 +#define D3DXF_FILEFORMAT_COMPRESSED 2 + +//---------------------------------------------------------------------------- +// D3DXF_FILESAVEOPTIONS +// This flag is used to specify where to save the file to. Each flag is +// mutually exclusive, indicates the data location of the file, and also +// chooses which additional data will specify the location. +// _TOFILE is paired with a filename (LPCSTR) +// _TOWFILE is paired with a filename (LPWSTR) +//---------------------------------------------------------------------------- +typedef DWORD D3DXF_FILESAVEOPTIONS; + +#define D3DXF_FILESAVE_TOFILE 0x00L +#define D3DXF_FILESAVE_TOWFILE 0x01L + +//---------------------------------------------------------------------------- +// D3DXF_FILELOADOPTIONS +// This flag is used to specify where to load the file from. Each flag is +// mutually exclusive, indicates the data location of the file, and also +// chooses which additional data will specify the location. +// _FROMFILE is paired with a filename (LPCSTR) +// _FROMWFILE is paired with a filename (LPWSTR) +// _FROMRESOURCE is paired with a (D3DXF_FILELOADRESOUCE*) description. +// _FROMMEMORY is paired with a (D3DXF_FILELOADMEMORY*) description. +//---------------------------------------------------------------------------- +typedef DWORD D3DXF_FILELOADOPTIONS; + +#define D3DXF_FILELOAD_FROMFILE 0x00L +#define D3DXF_FILELOAD_FROMWFILE 0x01L +#define D3DXF_FILELOAD_FROMRESOURCE 0x02L +#define D3DXF_FILELOAD_FROMMEMORY 0x03L + +//---------------------------------------------------------------------------- +// D3DXF_FILELOADRESOURCE: +//---------------------------------------------------------------------------- + +typedef struct _D3DXF_FILELOADRESOURCE +{ + HMODULE hModule; // Desc + LPCSTR lpName; // Desc + LPCSTR lpType; // Desc +} D3DXF_FILELOADRESOURCE; + +//---------------------------------------------------------------------------- +// D3DXF_FILELOADMEMORY: +//---------------------------------------------------------------------------- + +typedef struct _D3DXF_FILELOADMEMORY +{ + LPCVOID lpMemory; // Desc + SIZE_T dSize; // Desc +} D3DXF_FILELOADMEMORY; + +#if defined( _WIN32 ) && !defined( _NO_COM ) + +// {cef08cf9-7b4f-4429-9624-2a690a933201} +DEFINE_GUID( IID_ID3DXFile, +0xcef08cf9, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); + +// {cef08cfa-7b4f-4429-9624-2a690a933201} +DEFINE_GUID( IID_ID3DXFileSaveObject, +0xcef08cfa, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); + +// {cef08cfb-7b4f-4429-9624-2a690a933201} +DEFINE_GUID( IID_ID3DXFileSaveData, +0xcef08cfb, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); + +// {cef08cfc-7b4f-4429-9624-2a690a933201} +DEFINE_GUID( IID_ID3DXFileEnumObject, +0xcef08cfc, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); + +// {cef08cfd-7b4f-4429-9624-2a690a933201} +DEFINE_GUID( IID_ID3DXFileData, +0xcef08cfd, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 ); + +#endif // defined( _WIN32 ) && !defined( _NO_COM ) + +#if defined( __cplusplus ) +#if !defined( DECLSPEC_UUID ) +#if _MSC_VER >= 1100 +#define DECLSPEC_UUID( x ) __declspec( uuid( x ) ) +#else // !( _MSC_VER >= 1100 ) +#define DECLSPEC_UUID( x ) +#endif // !( _MSC_VER >= 1100 ) +#endif // !defined( DECLSPEC_UUID ) + +interface DECLSPEC_UUID( "cef08cf9-7b4f-4429-9624-2a690a933201" ) + ID3DXFile; +interface DECLSPEC_UUID( "cef08cfa-7b4f-4429-9624-2a690a933201" ) + ID3DXFileSaveObject; +interface DECLSPEC_UUID( "cef08cfb-7b4f-4429-9624-2a690a933201" ) + ID3DXFileSaveData; +interface DECLSPEC_UUID( "cef08cfc-7b4f-4429-9624-2a690a933201" ) + ID3DXFileEnumObject; +interface DECLSPEC_UUID( "cef08cfd-7b4f-4429-9624-2a690a933201" ) + ID3DXFileData; + +#if defined( _COM_SMARTPTR_TYPEDEF ) +_COM_SMARTPTR_TYPEDEF( ID3DXFile, + __uuidof( ID3DXFile ) ); +_COM_SMARTPTR_TYPEDEF( ID3DXFileSaveObject, + __uuidof( ID3DXFileSaveObject ) ); +_COM_SMARTPTR_TYPEDEF( ID3DXFileSaveData, + __uuidof( ID3DXFileSaveData ) ); +_COM_SMARTPTR_TYPEDEF( ID3DXFileEnumObject, + __uuidof( ID3DXFileEnumObject ) ); +_COM_SMARTPTR_TYPEDEF( ID3DXFileData, + __uuidof( ID3DXFileData ) ); +#endif // defined( _COM_SMARTPTR_TYPEDEF ) +#endif // defined( __cplusplus ) + +typedef interface ID3DXFile ID3DXFile; +typedef interface ID3DXFileSaveObject ID3DXFileSaveObject; +typedef interface ID3DXFileSaveData ID3DXFileSaveData; +typedef interface ID3DXFileEnumObject ID3DXFileEnumObject; +typedef interface ID3DXFileData ID3DXFileData; + +////////////////////////////////////////////////////////////////////////////// +// ID3DXFile ///////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ID3DXFile + +DECLARE_INTERFACE_( ID3DXFile, IUnknown ) +{ + STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; + STDMETHOD_( ULONG, AddRef )( THIS ) PURE; + STDMETHOD_( ULONG, Release )( THIS ) PURE; + + STDMETHOD( CreateEnumObject )( THIS_ LPCVOID, D3DXF_FILELOADOPTIONS, + ID3DXFileEnumObject** ) PURE; + STDMETHOD( CreateSaveObject )( THIS_ LPCVOID, D3DXF_FILESAVEOPTIONS, + D3DXF_FILEFORMAT, ID3DXFileSaveObject** ) PURE; + STDMETHOD( RegisterTemplates )( THIS_ LPCVOID, SIZE_T ) PURE; + STDMETHOD( RegisterEnumTemplates )( THIS_ ID3DXFileEnumObject* ) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3DXFileSaveObject /////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ID3DXFileSaveObject + +DECLARE_INTERFACE_( ID3DXFileSaveObject, IUnknown ) +{ + STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; + STDMETHOD_( ULONG, AddRef )( THIS ) PURE; + STDMETHOD_( ULONG, Release )( THIS ) PURE; + + STDMETHOD( GetFile )( THIS_ ID3DXFile** ) PURE; + STDMETHOD( AddDataObject )( THIS_ REFGUID, LPCSTR, CONST GUID*, + SIZE_T, LPCVOID, ID3DXFileSaveData** ) PURE; + STDMETHOD( Save )( THIS ) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3DXFileSaveData ///////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ID3DXFileSaveData + +DECLARE_INTERFACE_( ID3DXFileSaveData, IUnknown ) +{ + STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; + STDMETHOD_( ULONG, AddRef )( THIS ) PURE; + STDMETHOD_( ULONG, Release )( THIS ) PURE; + + STDMETHOD( GetSave )( THIS_ ID3DXFileSaveObject** ) PURE; + STDMETHOD( GetName )( THIS_ LPSTR, SIZE_T* ) PURE; + STDMETHOD( GetId )( THIS_ LPGUID ) PURE; + STDMETHOD( GetType )( THIS_ GUID* ) PURE; + STDMETHOD( AddDataObject )( THIS_ REFGUID, LPCSTR, CONST GUID*, + SIZE_T, LPCVOID, ID3DXFileSaveData** ) PURE; + STDMETHOD( AddDataReference )( THIS_ LPCSTR, CONST GUID* ) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3DXFileEnumObject /////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ID3DXFileEnumObject + +DECLARE_INTERFACE_( ID3DXFileEnumObject, IUnknown ) +{ + STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; + STDMETHOD_( ULONG, AddRef )( THIS ) PURE; + STDMETHOD_( ULONG, Release )( THIS ) PURE; + + STDMETHOD( GetFile )( THIS_ ID3DXFile** ) PURE; + STDMETHOD( GetChildren )( THIS_ SIZE_T* ) PURE; + STDMETHOD( GetChild )( THIS_ SIZE_T, ID3DXFileData** ) PURE; + STDMETHOD( GetDataObjectById )( THIS_ REFGUID, ID3DXFileData** ) PURE; + STDMETHOD( GetDataObjectByName )( THIS_ LPCSTR, ID3DXFileData** ) PURE; +}; + +////////////////////////////////////////////////////////////////////////////// +// ID3DXFileData ///////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#undef INTERFACE +#define INTERFACE ID3DXFileData + +DECLARE_INTERFACE_( ID3DXFileData, IUnknown ) +{ + STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE; + STDMETHOD_( ULONG, AddRef )( THIS ) PURE; + STDMETHOD_( ULONG, Release )( THIS ) PURE; + + STDMETHOD( GetEnum )( THIS_ ID3DXFileEnumObject** ) PURE; + STDMETHOD( GetName )( THIS_ LPSTR, SIZE_T* ) PURE; + STDMETHOD( GetId )( THIS_ LPGUID ) PURE; + STDMETHOD( Lock )( THIS_ SIZE_T*, LPCVOID* ) PURE; + STDMETHOD( Unlock )( THIS ) PURE; + STDMETHOD( GetType )( THIS_ GUID* ) PURE; + STDMETHOD_( BOOL, IsReference )( THIS ) PURE; + STDMETHOD( GetChildren )( THIS_ SIZE_T* ) PURE; + STDMETHOD( GetChild )( THIS_ SIZE_T, ID3DXFileData** ) PURE; +}; + +STDAPI D3DXFileCreate( ID3DXFile** lplpDirectXFile ); + +/* + * DirectX File errors. + */ + +#define _FACD3DXF 0x876 + +#define D3DXFERR_BADOBJECT MAKE_HRESULT( 1, _FACD3DXF, 900 ) +#define D3DXFERR_BADVALUE MAKE_HRESULT( 1, _FACD3DXF, 901 ) +#define D3DXFERR_BADTYPE MAKE_HRESULT( 1, _FACD3DXF, 902 ) +#define D3DXFERR_NOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 903 ) +#define D3DXFERR_NOTDONEYET MAKE_HRESULT( 1, _FACD3DXF, 904 ) +#define D3DXFERR_FILENOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 905 ) +#define D3DXFERR_RESOURCENOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 906 ) +#define D3DXFERR_BADRESOURCE MAKE_HRESULT( 1, _FACD3DXF, 907 ) +#define D3DXFERR_BADFILETYPE MAKE_HRESULT( 1, _FACD3DXF, 908 ) +#define D3DXFERR_BADFILEVERSION MAKE_HRESULT( 1, _FACD3DXF, 909 ) +#define D3DXFERR_BADFILEFLOATSIZE MAKE_HRESULT( 1, _FACD3DXF, 910 ) +#define D3DXFERR_BADFILE MAKE_HRESULT( 1, _FACD3DXF, 911 ) +#define D3DXFERR_PARSEERROR MAKE_HRESULT( 1, _FACD3DXF, 912 ) +#define D3DXFERR_BADARRAYSIZE MAKE_HRESULT( 1, _FACD3DXF, 913 ) +#define D3DXFERR_BADDATAREFERENCE MAKE_HRESULT( 1, _FACD3DXF, 914 ) +#define D3DXFERR_NOMOREOBJECTS MAKE_HRESULT( 1, _FACD3DXF, 915 ) +#define D3DXFERR_NOMOREDATA MAKE_HRESULT( 1, _FACD3DXF, 916 ) +#define D3DXFERR_BADCACHEFILE MAKE_HRESULT( 1, _FACD3DXF, 917 ) + +/* + * DirectX File object types. + */ + +#ifndef WIN_TYPES +#define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype +#endif + +WIN_TYPES(ID3DXFile, D3DXFILE); +WIN_TYPES(ID3DXFileEnumObject, D3DXFILEENUMOBJECT); +WIN_TYPES(ID3DXFileSaveObject, D3DXFILESAVEOBJECT); +WIN_TYPES(ID3DXFileData, D3DXFILEDATA); +WIN_TYPES(ID3DXFileSaveData, D3DXFILESAVEDATA); + +#if defined( __cplusplus ) +} // extern "C" +#endif // defined( __cplusplus ) + +#endif // !defined( __D3DX9XOF_H__ ) + + diff --git a/Src/Decoder_H264_ALL/D3D/include/ddraw.h b/Src/Decoder_H264_ALL/D3D/include/ddraw.h new file mode 100644 index 0000000..4b72177 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/ddraw.h @@ -0,0 +1,5856 @@ +/*==========================================================================; + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: ddraw.h + * Content: DirectDraw include file + * + ***************************************************************************/ + +#ifndef __DDRAW_INCLUDED__ +#define __DDRAW_INCLUDED__ + +//Disable the nameless union warning when building internally +#undef ENABLE_NAMELESS_UNION_PRAGMA +#ifdef DIRECTX_REDIST +#define ENABLE_NAMELESS_UNION_PRAGMA +#endif + +#ifdef ENABLE_NAMELESS_UNION_PRAGMA +#pragma warning(disable:4201) +#endif + +/* + * If you wish an application built against the newest version of DirectDraw + * to run against an older DirectDraw run time then define DIRECTDRAW_VERSION + * to be the earlies version of DirectDraw you wish to run against. For, + * example if you wish an application to run against a DX 3 runtime define + * DIRECTDRAW_VERSION to be 0x0300. + */ +#ifndef DIRECTDRAW_VERSION +#define DIRECTDRAW_VERSION 0x0700 +#endif /* DIRECTDRAW_VERSION */ + +#if defined( _WIN32 ) && !defined( _NO_COM ) +#define COM_NO_WINDOWS_H +#include +#else +#define IUnknown void +#if !defined( NT_BUILD_ENVIRONMENT ) && !defined(WINNT) + #define CO_E_NOTINITIALIZED 0x800401F0L +#endif +#endif + +#define _FACDD 0x876 +#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) + +#ifdef __cplusplus +extern "C" { +#endif + +// +// For compilers that don't support nameless unions, do a +// +// #define NONAMELESSUNION +// +// before #include +// +#ifndef DUMMYUNIONNAMEN +#if defined(__cplusplus) || !defined(NONAMELESSUNION) +#define DUMMYUNIONNAMEN(n) +#else +#define DUMMYUNIONNAMEN(n) u##n +#endif +#endif + +#ifndef MAKEFOURCC + #define MAKEFOURCC(ch0, ch1, ch2, ch3) \ + ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ + ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) +#endif //defined(MAKEFOURCC) + +/* + * FOURCC codes for DX compressed-texture pixel formats + */ +#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1')) +#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2')) +#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3')) +#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4')) +#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5')) + +/* + * GUIDS used by DirectDraw objects + */ +#if defined( _WIN32 ) && !defined( _NO_COM ) + +DEFINE_GUID( CLSID_DirectDraw, 0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 ); +DEFINE_GUID( CLSID_DirectDraw7, 0x3c305196,0x50db,0x11d3,0x9c,0xfe,0x00,0xc0,0x4f,0xd9,0x30,0xc5 ); +DEFINE_GUID( CLSID_DirectDrawClipper, 0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 ); +DEFINE_GUID( IID_IDirectDraw, 0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); +DEFINE_GUID( IID_IDirectDraw2, 0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 ); +DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 ); +DEFINE_GUID( IID_IDirectDraw7, 0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b ); +DEFINE_GUID( IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); +DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 ); +DEFINE_GUID( IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB ); +DEFINE_GUID( IID_IDirectDrawSurface4, 0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B ); +DEFINE_GUID( IID_IDirectDrawSurface7, 0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b ); +DEFINE_GUID( IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); +DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); +DEFINE_GUID( IID_IDirectDrawColorControl, 0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 ); +DEFINE_GUID( IID_IDirectDrawGammaControl, 0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E ); + +#endif + +/*============================================================================ + * + * DirectDraw Structures + * + * Various structures used to invoke DirectDraw. + * + *==========================================================================*/ + +struct IDirectDraw; +struct IDirectDrawSurface; +struct IDirectDrawPalette; +struct IDirectDrawClipper; + +typedef struct IDirectDraw FAR *LPDIRECTDRAW; +typedef struct IDirectDraw2 FAR *LPDIRECTDRAW2; +typedef struct IDirectDraw4 FAR *LPDIRECTDRAW4; +typedef struct IDirectDraw7 FAR *LPDIRECTDRAW7; +typedef struct IDirectDrawSurface FAR *LPDIRECTDRAWSURFACE; +typedef struct IDirectDrawSurface2 FAR *LPDIRECTDRAWSURFACE2; +typedef struct IDirectDrawSurface3 FAR *LPDIRECTDRAWSURFACE3; +typedef struct IDirectDrawSurface4 FAR *LPDIRECTDRAWSURFACE4; +typedef struct IDirectDrawSurface7 FAR *LPDIRECTDRAWSURFACE7; +typedef struct IDirectDrawPalette FAR *LPDIRECTDRAWPALETTE; +typedef struct IDirectDrawClipper FAR *LPDIRECTDRAWCLIPPER; +typedef struct IDirectDrawColorControl FAR *LPDIRECTDRAWCOLORCONTROL; +typedef struct IDirectDrawGammaControl FAR *LPDIRECTDRAWGAMMACONTROL; + +typedef struct _DDFXROP FAR *LPDDFXROP; +typedef struct _DDSURFACEDESC FAR *LPDDSURFACEDESC; +typedef struct _DDSURFACEDESC2 FAR *LPDDSURFACEDESC2; +typedef struct _DDCOLORCONTROL FAR *LPDDCOLORCONTROL; + +/* + * API's + */ +#if (defined (WIN32) || defined( _WIN32 ) ) && !defined( _NO_COM ) +//#if defined( _WIN32 ) && !defined( _NO_ENUM ) + typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID); + typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID); + extern HRESULT WINAPI DirectDrawEnumerateW( LPDDENUMCALLBACKW lpCallback, LPVOID lpContext ); + extern HRESULT WINAPI DirectDrawEnumerateA( LPDDENUMCALLBACKA lpCallback, LPVOID lpContext ); + /* + * Protect against old SDKs + */ + #if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500) + #define HMONITOR_DECLARED + DECLARE_HANDLE(HMONITOR); + #endif + typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXA)(GUID FAR *, LPSTR, LPSTR, LPVOID, HMONITOR); + typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKEXW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID, HMONITOR); + extern HRESULT WINAPI DirectDrawEnumerateExW( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags); + extern HRESULT WINAPI DirectDrawEnumerateExA( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags); + typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags); + typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXW)( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags); + + #ifdef UNICODE + typedef LPDDENUMCALLBACKW LPDDENUMCALLBACK; + #define DirectDrawEnumerate DirectDrawEnumerateW + typedef LPDDENUMCALLBACKEXW LPDDENUMCALLBACKEX; + typedef LPDIRECTDRAWENUMERATEEXW LPDIRECTDRAWENUMERATEEX; + #define DirectDrawEnumerateEx DirectDrawEnumerateExW + #else + typedef LPDDENUMCALLBACKA LPDDENUMCALLBACK; + #define DirectDrawEnumerate DirectDrawEnumerateA + typedef LPDDENUMCALLBACKEXA LPDDENUMCALLBACKEX; + typedef LPDIRECTDRAWENUMERATEEXA LPDIRECTDRAWENUMERATEEX; + #define DirectDrawEnumerateEx DirectDrawEnumerateExA + #endif + extern HRESULT WINAPI DirectDrawCreate( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter ); + extern HRESULT WINAPI DirectDrawCreateEx( GUID FAR * lpGuid, LPVOID *lplpDD, REFIID iid,IUnknown FAR *pUnkOuter ); + extern HRESULT WINAPI DirectDrawCreateClipper( DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter ); +#endif +/* + * Flags for DirectDrawEnumerateEx + * DirectDrawEnumerateEx supercedes DirectDrawEnumerate. You must use GetProcAddress to + * obtain a function pointer (of type LPDIRECTDRAWENUMERATEEX) to DirectDrawEnumerateEx. + * By default, only the primary display device is enumerated. + * DirectDrawEnumerate is equivalent to DirectDrawEnumerate(,,DDENUM_NONDISPLAYDEVICES) + */ + +/* + * This flag causes enumeration of any GDI display devices which are part of + * the Windows Desktop + */ +#define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001L + +/* + * This flag causes enumeration of any GDI display devices which are not + * part of the Windows Desktop + */ +#define DDENUM_DETACHEDSECONDARYDEVICES 0x00000002L + +/* + * This flag causes enumeration of non-display devices + */ +#define DDENUM_NONDISPLAYDEVICES 0x00000004L + + +#define REGSTR_KEY_DDHW_DESCRIPTION "Description" +#define REGSTR_KEY_DDHW_DRIVERNAME "DriverName" +#define REGSTR_PATH_DDHW "Hardware\\DirectDrawDrivers" + +#define DDCREATE_HARDWAREONLY 0x00000001l +#define DDCREATE_EMULATIONONLY 0x00000002l + +#if defined(WINNT) || !defined(WIN32) +#ifndef _HRESULT_DEFINED +#define _HRESULT_DEFINED +typedef __success(return >= 0) long HRESULT; +#endif // !_HRESULT_DEFINED +#endif + +//#ifndef WINNT +typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID); +typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK2)(LPDDSURFACEDESC2, LPVOID); +typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID); +typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK2)(LPDIRECTDRAWSURFACE4, LPDDSURFACEDESC2, LPVOID); +typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK7)(LPDIRECTDRAWSURFACE7, LPDDSURFACEDESC2, LPVOID); +//#endif + +/* + * Generic pixel format with 8-bit RGB and alpha components + */ +typedef struct _DDARGB +{ + BYTE blue; + BYTE green; + BYTE red; + BYTE alpha; +} DDARGB; + +typedef DDARGB FAR *LPDDARGB; + +/* + * This version of the structure remains for backwards source compatibility. + * The DDARGB structure is the one that should be used for all DirectDraw APIs. + */ +typedef struct _DDRGBA +{ + BYTE red; + BYTE green; + BYTE blue; + BYTE alpha; +} DDRGBA; + +typedef DDRGBA FAR *LPDDRGBA; + + +/* + * DDCOLORKEY + */ +typedef struct _DDCOLORKEY +{ + DWORD dwColorSpaceLowValue; // low boundary of color space that is to + // be treated as Color Key, inclusive + DWORD dwColorSpaceHighValue; // high boundary of color space that is + // to be treated as Color Key, inclusive +} DDCOLORKEY; + +typedef DDCOLORKEY FAR* LPDDCOLORKEY; + +/* + * DDBLTFX + * Used to pass override information to the DIRECTDRAWSURFACE callback Blt. + */ +typedef struct _DDBLTFX +{ + DWORD dwSize; // size of structure + DWORD dwDDFX; // FX operations + DWORD dwROP; // Win32 raster operations + DWORD dwDDROP; // Raster operations new for DirectDraw + DWORD dwRotationAngle; // Rotation angle for blt + DWORD dwZBufferOpCode; // ZBuffer compares + DWORD dwZBufferLow; // Low limit of Z buffer + DWORD dwZBufferHigh; // High limit of Z buffer + DWORD dwZBufferBaseDest; // Destination base value + DWORD dwZDestConstBitDepth; // Bit depth used to specify Z constant for destination + union + { + DWORD dwZDestConst; // Constant to use as Z buffer for dest + LPDIRECTDRAWSURFACE lpDDSZBufferDest; // Surface to use as Z buffer for dest + } DUMMYUNIONNAMEN(1); + DWORD dwZSrcConstBitDepth; // Bit depth used to specify Z constant for source + union + { + DWORD dwZSrcConst; // Constant to use as Z buffer for src + LPDIRECTDRAWSURFACE lpDDSZBufferSrc; // Surface to use as Z buffer for src + } DUMMYUNIONNAMEN(2); + DWORD dwAlphaEdgeBlendBitDepth; // Bit depth used to specify constant for alpha edge blend + DWORD dwAlphaEdgeBlend; // Alpha for edge blending + DWORD dwReserved; + DWORD dwAlphaDestConstBitDepth; // Bit depth used to specify alpha constant for destination + union + { + DWORD dwAlphaDestConst; // Constant to use as Alpha Channel + LPDIRECTDRAWSURFACE lpDDSAlphaDest; // Surface to use as Alpha Channel + } DUMMYUNIONNAMEN(3); + DWORD dwAlphaSrcConstBitDepth; // Bit depth used to specify alpha constant for source + union + { + DWORD dwAlphaSrcConst; // Constant to use as Alpha Channel + LPDIRECTDRAWSURFACE lpDDSAlphaSrc; // Surface to use as Alpha Channel + } DUMMYUNIONNAMEN(4); + union + { + DWORD dwFillColor; // color in RGB or Palettized + DWORD dwFillDepth; // depth value for z-buffer + DWORD dwFillPixel; // pixel value for RGBA or RGBZ + LPDIRECTDRAWSURFACE lpDDSPattern; // Surface to use as pattern + } DUMMYUNIONNAMEN(5); + DDCOLORKEY ddckDestColorkey; // DestColorkey override + DDCOLORKEY ddckSrcColorkey; // SrcColorkey override +} DDBLTFX; + +typedef DDBLTFX FAR* LPDDBLTFX; + + + +/* + * DDSCAPS + */ +typedef struct _DDSCAPS +{ + DWORD dwCaps; // capabilities of surface wanted +} DDSCAPS; + +typedef DDSCAPS FAR* LPDDSCAPS; + + +/* + * DDOSCAPS + */ +typedef struct _DDOSCAPS +{ + DWORD dwCaps; // capabilities of surface wanted +} DDOSCAPS; + +typedef DDOSCAPS FAR* LPDDOSCAPS; + +/* + * This structure is used internally by DirectDraw. + */ +typedef struct _DDSCAPSEX +{ + DWORD dwCaps2; + DWORD dwCaps3; + union + { + DWORD dwCaps4; + DWORD dwVolumeDepth; + } DUMMYUNIONNAMEN(1); +} DDSCAPSEX, FAR * LPDDSCAPSEX; + +/* + * DDSCAPS2 + */ +typedef struct _DDSCAPS2 +{ + DWORD dwCaps; // capabilities of surface wanted + DWORD dwCaps2; + DWORD dwCaps3; + union + { + DWORD dwCaps4; + DWORD dwVolumeDepth; + } DUMMYUNIONNAMEN(1); +} DDSCAPS2; + +typedef DDSCAPS2 FAR* LPDDSCAPS2; + +/* + * DDCAPS + */ +#define DD_ROP_SPACE (256/32) // space required to store ROP array +/* + * NOTE: Our choosen structure number scheme is to append a single digit to + * the end of the structure giving the version that structure is associated + * with. + */ + +/* + * This structure represents the DDCAPS structure released in DirectDraw 1.0. It is used internally + * by DirectDraw to interpret caps passed into ddraw by drivers written prior to the release of DirectDraw 2.0. + * New applications should use the DDCAPS structure defined below. + */ +typedef struct _DDCAPS_DX1 +{ + DWORD dwSize; // size of the DDDRIVERCAPS structure + DWORD dwCaps; // driver specific capabilities + DWORD dwCaps2; // more driver specific capabilites + DWORD dwCKeyCaps; // color key capabilities of the surface + DWORD dwFXCaps; // driver specific stretching and effects capabilites + DWORD dwFXAlphaCaps; // alpha driver specific capabilities + DWORD dwPalCaps; // palette capabilities + DWORD dwSVCaps; // stereo vision capabilities + DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 + DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 + DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 + DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 + DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 + DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 + DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 + DWORD dwVidMemTotal; // total amount of video memory + DWORD dwVidMemFree; // amount of free video memory + DWORD dwMaxVisibleOverlays; // maximum number of visible overlays + DWORD dwCurrVisibleOverlays; // current number of visible overlays + DWORD dwNumFourCCCodes; // number of four cc codes + DWORD dwAlignBoundarySrc; // source rectangle alignment + DWORD dwAlignSizeSrc; // source rectangle byte size + DWORD dwAlignBoundaryDest; // dest rectangle alignment + DWORD dwAlignSizeDest; // dest rectangle byte size + DWORD dwAlignStrideAlign; // stride alignment + DWORD dwRops[DD_ROP_SPACE]; // ROPS supported + DDSCAPS ddsCaps; // DDSCAPS structure has all the general capabilities + DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 + DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 + DWORD dwMinLiveVideoStretch; // OBSOLETE! This field remains for compatability reasons only + DWORD dwMaxLiveVideoStretch; // OBSOLETE! This field remains for compatability reasons only + DWORD dwMinHwCodecStretch; // OBSOLETE! This field remains for compatability reasons only + DWORD dwMaxHwCodecStretch; // OBSOLETE! This field remains for compatability reasons only + DWORD dwReserved1; // reserved + DWORD dwReserved2; // reserved + DWORD dwReserved3; // reserved +} DDCAPS_DX1; + +typedef DDCAPS_DX1 FAR* LPDDCAPS_DX1; + +/* + * This structure is the DDCAPS structure as it was in version 2 and 3 of Direct X. + * It is present for back compatability. + */ +typedef struct _DDCAPS_DX3 +{ + DWORD dwSize; // size of the DDDRIVERCAPS structure + DWORD dwCaps; // driver specific capabilities + DWORD dwCaps2; // more driver specific capabilites + DWORD dwCKeyCaps; // color key capabilities of the surface + DWORD dwFXCaps; // driver specific stretching and effects capabilites + DWORD dwFXAlphaCaps; // alpha driver specific capabilities + DWORD dwPalCaps; // palette capabilities + DWORD dwSVCaps; // stereo vision capabilities + DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 + DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 + DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 + DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 + DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 + DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 + DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 + DWORD dwVidMemTotal; // total amount of video memory + DWORD dwVidMemFree; // amount of free video memory + DWORD dwMaxVisibleOverlays; // maximum number of visible overlays + DWORD dwCurrVisibleOverlays; // current number of visible overlays + DWORD dwNumFourCCCodes; // number of four cc codes + DWORD dwAlignBoundarySrc; // source rectangle alignment + DWORD dwAlignSizeSrc; // source rectangle byte size + DWORD dwAlignBoundaryDest; // dest rectangle alignment + DWORD dwAlignSizeDest; // dest rectangle byte size + DWORD dwAlignStrideAlign; // stride alignment + DWORD dwRops[DD_ROP_SPACE]; // ROPS supported + DDSCAPS ddsCaps; // DDSCAPS structure has all the general capabilities + DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 + DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 + DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 + DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 + DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 + DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 + DWORD dwReserved1; // reserved + DWORD dwReserved2; // reserved + DWORD dwReserved3; // reserved + DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts + DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts + DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts + DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts + DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts + DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts + DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts + DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts + DWORD dwSSBCaps; // driver specific capabilities for System->System blts + DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts + DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts + DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts + DWORD dwReserved4; // reserved + DWORD dwReserved5; // reserved + DWORD dwReserved6; // reserved +} DDCAPS_DX3; +typedef DDCAPS_DX3 FAR* LPDDCAPS_DX3; + +/* + * This structure is the DDCAPS structure as it was in version 5 of Direct X. + * It is present for back compatability. + */ +typedef struct _DDCAPS_DX5 +{ +/* 0*/ DWORD dwSize; // size of the DDDRIVERCAPS structure +/* 4*/ DWORD dwCaps; // driver specific capabilities +/* 8*/ DWORD dwCaps2; // more driver specific capabilites +/* c*/ DWORD dwCKeyCaps; // color key capabilities of the surface +/* 10*/ DWORD dwFXCaps; // driver specific stretching and effects capabilites +/* 14*/ DWORD dwFXAlphaCaps; // alpha driver specific capabilities +/* 18*/ DWORD dwPalCaps; // palette capabilities +/* 1c*/ DWORD dwSVCaps; // stereo vision capabilities +/* 20*/ DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 +/* 24*/ DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 +/* 28*/ DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 +/* 2c*/ DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 +/* 30*/ DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 +/* 34*/ DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 +/* 38*/ DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 +/* 3c*/ DWORD dwVidMemTotal; // total amount of video memory +/* 40*/ DWORD dwVidMemFree; // amount of free video memory +/* 44*/ DWORD dwMaxVisibleOverlays; // maximum number of visible overlays +/* 48*/ DWORD dwCurrVisibleOverlays; // current number of visible overlays +/* 4c*/ DWORD dwNumFourCCCodes; // number of four cc codes +/* 50*/ DWORD dwAlignBoundarySrc; // source rectangle alignment +/* 54*/ DWORD dwAlignSizeSrc; // source rectangle byte size +/* 58*/ DWORD dwAlignBoundaryDest; // dest rectangle alignment +/* 5c*/ DWORD dwAlignSizeDest; // dest rectangle byte size +/* 60*/ DWORD dwAlignStrideAlign; // stride alignment +/* 64*/ DWORD dwRops[DD_ROP_SPACE]; // ROPS supported +/* 84*/ DDSCAPS ddsCaps; // DDSCAPS structure has all the general capabilities +/* 88*/ DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 8c*/ DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 90*/ DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 94*/ DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 98*/ DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 9c*/ DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* a0*/ DWORD dwReserved1; // reserved +/* a4*/ DWORD dwReserved2; // reserved +/* a8*/ DWORD dwReserved3; // reserved +/* ac*/ DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts +/* b0*/ DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts +/* b4*/ DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts +/* b8*/ DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts +/* d8*/ DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts +/* dc*/ DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts +/* e0*/ DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts +/* e4*/ DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts +/*104*/ DWORD dwSSBCaps; // driver specific capabilities for System->System blts +/*108*/ DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts +/*10c*/ DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts +/*110*/ DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts +// Members added for DX5: +/*130*/ DWORD dwMaxVideoPorts; // maximum number of usable video ports +/*134*/ DWORD dwCurrVideoPorts; // current number of video ports used +/*138*/ DWORD dwSVBCaps2; // more driver specific capabilities for System->Vmem blts +/*13c*/ DWORD dwNLVBCaps; // driver specific capabilities for non-local->local vidmem blts +/*140*/ DWORD dwNLVBCaps2; // more driver specific capabilities non-local->local vidmem blts +/*144*/ DWORD dwNLVBCKeyCaps; // driver color key capabilities for non-local->local vidmem blts +/*148*/ DWORD dwNLVBFXCaps; // driver FX capabilities for non-local->local blts +/*14c*/ DWORD dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts +} DDCAPS_DX5; +typedef DDCAPS_DX5 FAR* LPDDCAPS_DX5; + +typedef struct _DDCAPS_DX6 +{ +/* 0*/ DWORD dwSize; // size of the DDDRIVERCAPS structure +/* 4*/ DWORD dwCaps; // driver specific capabilities +/* 8*/ DWORD dwCaps2; // more driver specific capabilites +/* c*/ DWORD dwCKeyCaps; // color key capabilities of the surface +/* 10*/ DWORD dwFXCaps; // driver specific stretching and effects capabilites +/* 14*/ DWORD dwFXAlphaCaps; // alpha caps +/* 18*/ DWORD dwPalCaps; // palette capabilities +/* 1c*/ DWORD dwSVCaps; // stereo vision capabilities +/* 20*/ DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 +/* 24*/ DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 +/* 28*/ DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 +/* 2c*/ DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 +/* 30*/ DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 +/* 34*/ DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 +/* 38*/ DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 +/* 3c*/ DWORD dwVidMemTotal; // total amount of video memory +/* 40*/ DWORD dwVidMemFree; // amount of free video memory +/* 44*/ DWORD dwMaxVisibleOverlays; // maximum number of visible overlays +/* 48*/ DWORD dwCurrVisibleOverlays; // current number of visible overlays +/* 4c*/ DWORD dwNumFourCCCodes; // number of four cc codes +/* 50*/ DWORD dwAlignBoundarySrc; // source rectangle alignment +/* 54*/ DWORD dwAlignSizeSrc; // source rectangle byte size +/* 58*/ DWORD dwAlignBoundaryDest; // dest rectangle alignment +/* 5c*/ DWORD dwAlignSizeDest; // dest rectangle byte size +/* 60*/ DWORD dwAlignStrideAlign; // stride alignment +/* 64*/ DWORD dwRops[DD_ROP_SPACE]; // ROPS supported +/* 84*/ DDSCAPS ddsOldCaps; // Was DDSCAPS ddsCaps. ddsCaps is of type DDSCAPS2 for DX6 +/* 88*/ DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 8c*/ DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 90*/ DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 94*/ DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 98*/ DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 9c*/ DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* a0*/ DWORD dwReserved1; // reserved +/* a4*/ DWORD dwReserved2; // reserved +/* a8*/ DWORD dwReserved3; // reserved +/* ac*/ DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts +/* b0*/ DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts +/* b4*/ DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts +/* b8*/ DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts +/* d8*/ DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts +/* dc*/ DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts +/* e0*/ DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts +/* e4*/ DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts +/*104*/ DWORD dwSSBCaps; // driver specific capabilities for System->System blts +/*108*/ DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts +/*10c*/ DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts +/*110*/ DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts +/*130*/ DWORD dwMaxVideoPorts; // maximum number of usable video ports +/*134*/ DWORD dwCurrVideoPorts; // current number of video ports used +/*138*/ DWORD dwSVBCaps2; // more driver specific capabilities for System->Vmem blts +/*13c*/ DWORD dwNLVBCaps; // driver specific capabilities for non-local->local vidmem blts +/*140*/ DWORD dwNLVBCaps2; // more driver specific capabilities non-local->local vidmem blts +/*144*/ DWORD dwNLVBCKeyCaps; // driver color key capabilities for non-local->local vidmem blts +/*148*/ DWORD dwNLVBFXCaps; // driver FX capabilities for non-local->local blts +/*14c*/ DWORD dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts +// Members added for DX6 release +/*16c*/ DDSCAPS2 ddsCaps; // Surface Caps +} DDCAPS_DX6; +typedef DDCAPS_DX6 FAR* LPDDCAPS_DX6; + +typedef struct _DDCAPS_DX7 +{ +/* 0*/ DWORD dwSize; // size of the DDDRIVERCAPS structure +/* 4*/ DWORD dwCaps; // driver specific capabilities +/* 8*/ DWORD dwCaps2; // more driver specific capabilites +/* c*/ DWORD dwCKeyCaps; // color key capabilities of the surface +/* 10*/ DWORD dwFXCaps; // driver specific stretching and effects capabilites +/* 14*/ DWORD dwFXAlphaCaps; // alpha driver specific capabilities +/* 18*/ DWORD dwPalCaps; // palette capabilities +/* 1c*/ DWORD dwSVCaps; // stereo vision capabilities +/* 20*/ DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 +/* 24*/ DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 +/* 28*/ DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 +/* 2c*/ DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 +/* 30*/ DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 +/* 34*/ DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 +/* 38*/ DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 +/* 3c*/ DWORD dwVidMemTotal; // total amount of video memory +/* 40*/ DWORD dwVidMemFree; // amount of free video memory +/* 44*/ DWORD dwMaxVisibleOverlays; // maximum number of visible overlays +/* 48*/ DWORD dwCurrVisibleOverlays; // current number of visible overlays +/* 4c*/ DWORD dwNumFourCCCodes; // number of four cc codes +/* 50*/ DWORD dwAlignBoundarySrc; // source rectangle alignment +/* 54*/ DWORD dwAlignSizeSrc; // source rectangle byte size +/* 58*/ DWORD dwAlignBoundaryDest; // dest rectangle alignment +/* 5c*/ DWORD dwAlignSizeDest; // dest rectangle byte size +/* 60*/ DWORD dwAlignStrideAlign; // stride alignment +/* 64*/ DWORD dwRops[DD_ROP_SPACE]; // ROPS supported +/* 84*/ DDSCAPS ddsOldCaps; // Was DDSCAPS ddsCaps. ddsCaps is of type DDSCAPS2 for DX6 +/* 88*/ DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 8c*/ DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 90*/ DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 94*/ DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 98*/ DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* 9c*/ DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 +/* a0*/ DWORD dwReserved1; // reserved +/* a4*/ DWORD dwReserved2; // reserved +/* a8*/ DWORD dwReserved3; // reserved +/* ac*/ DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts +/* b0*/ DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts +/* b4*/ DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts +/* b8*/ DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts +/* d8*/ DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts +/* dc*/ DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts +/* e0*/ DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts +/* e4*/ DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts +/*104*/ DWORD dwSSBCaps; // driver specific capabilities for System->System blts +/*108*/ DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts +/*10c*/ DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts +/*110*/ DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts +/*130*/ DWORD dwMaxVideoPorts; // maximum number of usable video ports +/*134*/ DWORD dwCurrVideoPorts; // current number of video ports used +/*138*/ DWORD dwSVBCaps2; // more driver specific capabilities for System->Vmem blts +/*13c*/ DWORD dwNLVBCaps; // driver specific capabilities for non-local->local vidmem blts +/*140*/ DWORD dwNLVBCaps2; // more driver specific capabilities non-local->local vidmem blts +/*144*/ DWORD dwNLVBCKeyCaps; // driver color key capabilities for non-local->local vidmem blts +/*148*/ DWORD dwNLVBFXCaps; // driver FX capabilities for non-local->local blts +/*14c*/ DWORD dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts +// Members added for DX6 release +/*16c*/ DDSCAPS2 ddsCaps; // Surface Caps +} DDCAPS_DX7; +typedef DDCAPS_DX7 FAR* LPDDCAPS_DX7; + + +#if DIRECTDRAW_VERSION <= 0x300 + typedef DDCAPS_DX3 DDCAPS; +#elif DIRECTDRAW_VERSION <= 0x500 + typedef DDCAPS_DX5 DDCAPS; +#elif DIRECTDRAW_VERSION <= 0x600 + typedef DDCAPS_DX6 DDCAPS; +#else + typedef DDCAPS_DX7 DDCAPS; +#endif + +typedef DDCAPS FAR* LPDDCAPS; + + + +/* + * DDPIXELFORMAT + */ +typedef struct _DDPIXELFORMAT +{ + DWORD dwSize; // size of structure + DWORD dwFlags; // pixel format flags + DWORD dwFourCC; // (FOURCC code) + union + { + DWORD dwRGBBitCount; // how many bits per pixel + DWORD dwYUVBitCount; // how many bits per pixel + DWORD dwZBufferBitDepth; // how many total bits/pixel in z buffer (including any stencil bits) + DWORD dwAlphaBitDepth; // how many bits for alpha channels + DWORD dwLuminanceBitCount; // how many bits per pixel + DWORD dwBumpBitCount; // how many bits per "buxel", total + DWORD dwPrivateFormatBitCount;// Bits per pixel of private driver formats. Only valid in texture + // format list and if DDPF_D3DFORMAT is set + } DUMMYUNIONNAMEN(1); + union + { + DWORD dwRBitMask; // mask for red bit + DWORD dwYBitMask; // mask for Y bits + DWORD dwStencilBitDepth; // how many stencil bits (note: dwZBufferBitDepth-dwStencilBitDepth is total Z-only bits) + DWORD dwLuminanceBitMask; // mask for luminance bits + DWORD dwBumpDuBitMask; // mask for bump map U delta bits + DWORD dwOperations; // DDPF_D3DFORMAT Operations + } DUMMYUNIONNAMEN(2); + union + { + DWORD dwGBitMask; // mask for green bits + DWORD dwUBitMask; // mask for U bits + DWORD dwZBitMask; // mask for Z bits + DWORD dwBumpDvBitMask; // mask for bump map V delta bits + struct + { + WORD wFlipMSTypes; // Multisample methods supported via flip for this D3DFORMAT + WORD wBltMSTypes; // Multisample methods supported via blt for this D3DFORMAT + } MultiSampleCaps; + + } DUMMYUNIONNAMEN(3); + union + { + DWORD dwBBitMask; // mask for blue bits + DWORD dwVBitMask; // mask for V bits + DWORD dwStencilBitMask; // mask for stencil bits + DWORD dwBumpLuminanceBitMask; // mask for luminance in bump map + } DUMMYUNIONNAMEN(4); + union + { + DWORD dwRGBAlphaBitMask; // mask for alpha channel + DWORD dwYUVAlphaBitMask; // mask for alpha channel + DWORD dwLuminanceAlphaBitMask;// mask for alpha channel + DWORD dwRGBZBitMask; // mask for Z channel + DWORD dwYUVZBitMask; // mask for Z channel + } DUMMYUNIONNAMEN(5); +} DDPIXELFORMAT; + +typedef DDPIXELFORMAT FAR* LPDDPIXELFORMAT; + +/* + * DDOVERLAYFX + */ +typedef struct _DDOVERLAYFX +{ + DWORD dwSize; // size of structure + DWORD dwAlphaEdgeBlendBitDepth; // Bit depth used to specify constant for alpha edge blend + DWORD dwAlphaEdgeBlend; // Constant to use as alpha for edge blend + DWORD dwReserved; + DWORD dwAlphaDestConstBitDepth; // Bit depth used to specify alpha constant for destination + union + { + DWORD dwAlphaDestConst; // Constant to use as alpha channel for dest + LPDIRECTDRAWSURFACE lpDDSAlphaDest; // Surface to use as alpha channel for dest + } DUMMYUNIONNAMEN(1); + DWORD dwAlphaSrcConstBitDepth; // Bit depth used to specify alpha constant for source + union + { + DWORD dwAlphaSrcConst; // Constant to use as alpha channel for src + LPDIRECTDRAWSURFACE lpDDSAlphaSrc; // Surface to use as alpha channel for src + } DUMMYUNIONNAMEN(2); + DDCOLORKEY dckDestColorkey; // DestColorkey override + DDCOLORKEY dckSrcColorkey; // DestColorkey override + DWORD dwDDFX; // Overlay FX + DWORD dwFlags; // flags +} DDOVERLAYFX; + +typedef DDOVERLAYFX FAR *LPDDOVERLAYFX; + + +/* + * DDBLTBATCH: BltBatch entry structure + */ +typedef struct _DDBLTBATCH +{ + LPRECT lprDest; + LPDIRECTDRAWSURFACE lpDDSSrc; + LPRECT lprSrc; + DWORD dwFlags; + LPDDBLTFX lpDDBltFx; +} DDBLTBATCH; + +typedef DDBLTBATCH FAR * LPDDBLTBATCH; + + +/* + * DDGAMMARAMP + */ +typedef struct _DDGAMMARAMP +{ + WORD red[256]; + WORD green[256]; + WORD blue[256]; +} DDGAMMARAMP; +typedef DDGAMMARAMP FAR * LPDDGAMMARAMP; + +/* + * This is the structure within which DirectDraw returns data about the current graphics driver and chipset + */ + +#define MAX_DDDEVICEID_STRING 512 + +typedef struct tagDDDEVICEIDENTIFIER +{ + /* + * These elements are for presentation to the user only. They should not be used to identify particular + * drivers, since this is unreliable and many different strings may be associated with the same + * device, and the same driver from different vendors. + */ + char szDriver[MAX_DDDEVICEID_STRING]; + char szDescription[MAX_DDDEVICEID_STRING]; + + /* + * This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons + * on the whole 64 bits. Caution should be exercised if you use this element to identify problematic + * drivers. It is recommended that guidDeviceIdentifier is used for this purpose. + * + * This version has the form: + * wProduct = HIWORD(liDriverVersion.HighPart) + * wVersion = LOWORD(liDriverVersion.HighPart) + * wSubVersion = HIWORD(liDriverVersion.LowPart) + * wBuild = LOWORD(liDriverVersion.LowPart) + */ +#ifdef _WIN32 + LARGE_INTEGER liDriverVersion; /* Defined for applications and other 32 bit components */ +#else + DWORD dwDriverVersionLowPart; /* Defined for 16 bit driver components */ + DWORD dwDriverVersionHighPart; +#endif + + + /* + * These elements can be used to identify particular chipsets. Use with extreme caution. + * dwVendorId Identifies the manufacturer. May be zero if unknown. + * dwDeviceId Identifies the type of chipset. May be zero if unknown. + * dwSubSysId Identifies the subsystem, typically this means the particular board. May be zero if unknown. + * dwRevision Identifies the revision level of the chipset. May be zero if unknown. + */ + DWORD dwVendorId; + DWORD dwDeviceId; + DWORD dwSubSysId; + DWORD dwRevision; + + /* + * This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the + * driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to + * reprofile the graphics subsystem. + * This element can also be used to identify particular problematic drivers. + */ + GUID guidDeviceIdentifier; +} DDDEVICEIDENTIFIER, * LPDDDEVICEIDENTIFIER; + +typedef struct tagDDDEVICEIDENTIFIER2 +{ + /* + * These elements are for presentation to the user only. They should not be used to identify particular + * drivers, since this is unreliable and many different strings may be associated with the same + * device, and the same driver from different vendors. + */ + char szDriver[MAX_DDDEVICEID_STRING]; + char szDescription[MAX_DDDEVICEID_STRING]; + + /* + * This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons + * on the whole 64 bits. Caution should be exercised if you use this element to identify problematic + * drivers. It is recommended that guidDeviceIdentifier is used for this purpose. + * + * This version has the form: + * wProduct = HIWORD(liDriverVersion.HighPart) + * wVersion = LOWORD(liDriverVersion.HighPart) + * wSubVersion = HIWORD(liDriverVersion.LowPart) + * wBuild = LOWORD(liDriverVersion.LowPart) + */ +#ifdef _WIN32 + LARGE_INTEGER liDriverVersion; /* Defined for applications and other 32 bit components */ +#else + DWORD dwDriverVersionLowPart; /* Defined for 16 bit driver components */ + DWORD dwDriverVersionHighPart; +#endif + + + /* + * These elements can be used to identify particular chipsets. Use with extreme caution. + * dwVendorId Identifies the manufacturer. May be zero if unknown. + * dwDeviceId Identifies the type of chipset. May be zero if unknown. + * dwSubSysId Identifies the subsystem, typically this means the particular board. May be zero if unknown. + * dwRevision Identifies the revision level of the chipset. May be zero if unknown. + */ + DWORD dwVendorId; + DWORD dwDeviceId; + DWORD dwSubSysId; + DWORD dwRevision; + + /* + * This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the + * driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to + * reprofile the graphics subsystem. + * This element can also be used to identify particular problematic drivers. + */ + GUID guidDeviceIdentifier; + + /* + * This element is used to determine the Windows Hardware Quality Lab (WHQL) + * certification level for this driver/device pair. + */ + DWORD dwWHQLLevel; + +} DDDEVICEIDENTIFIER2, * LPDDDEVICEIDENTIFIER2; + +/* + * Flags for the IDirectDraw4::GetDeviceIdentifier method + */ + +/* + * This flag causes GetDeviceIdentifier to return information about the host (typically 2D) adapter in a system equipped + * with a stacked secondary 3D adapter. Such an adapter appears to the application as if it were part of the + * host adapter, but is typically physcially located on a separate card. The stacked secondary's information is + * returned when GetDeviceIdentifier's dwFlags field is zero, since this most accurately reflects the qualities + * of the DirectDraw object involved. + */ +#define DDGDI_GETHOSTIDENTIFIER 0x00000001L + +/* + * Macros for interpretting DDEVICEIDENTIFIER2.dwWHQLLevel + */ +#define GET_WHQL_YEAR( dwWHQLLevel ) \ + ( (dwWHQLLevel) / 0x10000 ) +#define GET_WHQL_MONTH( dwWHQLLevel ) \ + ( ( (dwWHQLLevel) / 0x100 ) & 0x00ff ) +#define GET_WHQL_DAY( dwWHQLLevel ) \ + ( (dwWHQLLevel) & 0xff ) + + +/* + * callbacks + */ +typedef DWORD (FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper, HWND hWnd, DWORD code, LPVOID lpContext ); +#ifdef STREAMING +typedef DWORD (FAR PASCAL *LPSURFACESTREAMINGCALLBACK)(DWORD); +#endif + + +/* + * INTERACES FOLLOW: + * IDirectDraw + * IDirectDrawClipper + * IDirectDrawPalette + * IDirectDrawSurface + */ + +/* + * IDirectDraw + */ +#if defined( _WIN32 ) && !defined( _NO_COM ) +#undef INTERFACE +#define INTERFACE IDirectDraw +DECLARE_INTERFACE_( IDirectDraw, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDraw methods ***/ + STDMETHOD(Compact)(THIS) PURE; + STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; + STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; + STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE; + STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE; + STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE; + STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE; + STDMETHOD(FlipToGDISurface)(THIS) PURE; + STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; + STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE; + STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; + STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE; + STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; + STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; + STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; + STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; + STDMETHOD(RestoreDisplayMode)(THIS) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; + STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD) PURE; + STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectDraw_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) +#define IDirectDraw_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectDraw_Release(p) (p)->lpVtbl->Release(p) +#define IDirectDraw_Compact(p) (p)->lpVtbl->Compact(p) +#define IDirectDraw_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) +#define IDirectDraw_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) +#define IDirectDraw_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) +#define IDirectDraw_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) +#define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) +#define IDirectDraw_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) +#define IDirectDraw_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) +#define IDirectDraw_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) +#define IDirectDraw_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) +#define IDirectDraw_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) +#define IDirectDraw_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) +#define IDirectDraw_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) +#define IDirectDraw_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) +#define IDirectDraw_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) +#define IDirectDraw_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) +#define IDirectDraw_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) +#define IDirectDraw_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) +#define IDirectDraw_SetDisplayMode(p, a, b, c) (p)->lpVtbl->SetDisplayMode(p, a, b, c) +#define IDirectDraw_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) +#else +#define IDirectDraw_QueryInterface(p, a, b) (p)->QueryInterface(a, b) +#define IDirectDraw_AddRef(p) (p)->AddRef() +#define IDirectDraw_Release(p) (p)->Release() +#define IDirectDraw_Compact(p) (p)->Compact() +#define IDirectDraw_CreateClipper(p, a, b, c) (p)->CreateClipper(a, b, c) +#define IDirectDraw_CreatePalette(p, a, b, c, d) (p)->CreatePalette(a, b, c, d) +#define IDirectDraw_CreateSurface(p, a, b, c) (p)->CreateSurface(a, b, c) +#define IDirectDraw_DuplicateSurface(p, a, b) (p)->DuplicateSurface(a, b) +#define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d) +#define IDirectDraw_EnumSurfaces(p, a, b, c, d) (p)->EnumSurfaces(a, b, c, d) +#define IDirectDraw_FlipToGDISurface(p) (p)->FlipToGDISurface() +#define IDirectDraw_GetCaps(p, a, b) (p)->GetCaps(a, b) +#define IDirectDraw_GetDisplayMode(p, a) (p)->GetDisplayMode(a) +#define IDirectDraw_GetFourCCCodes(p, a, b) (p)->GetFourCCCodes(a, b) +#define IDirectDraw_GetGDISurface(p, a) (p)->GetGDISurface(a) +#define IDirectDraw_GetMonitorFrequency(p, a) (p)->GetMonitorFrequency(a) +#define IDirectDraw_GetScanLine(p, a) (p)->GetScanLine(a) +#define IDirectDraw_GetVerticalBlankStatus(p, a) (p)->GetVerticalBlankStatus(a) +#define IDirectDraw_Initialize(p, a) (p)->Initialize(a) +#define IDirectDraw_RestoreDisplayMode(p) (p)->RestoreDisplayMode() +#define IDirectDraw_SetCooperativeLevel(p, a, b) (p)->SetCooperativeLevel(a, b) +#define IDirectDraw_SetDisplayMode(p, a, b, c) (p)->SetDisplayMode(a, b, c) +#define IDirectDraw_WaitForVerticalBlank(p, a, b) (p)->WaitForVerticalBlank(a, b) +#endif + +#endif + +#if defined( _WIN32 ) && !defined( _NO_COM ) +#undef INTERFACE +#define INTERFACE IDirectDraw2 +DECLARE_INTERFACE_( IDirectDraw2, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDraw methods ***/ + STDMETHOD(Compact)(THIS) PURE; + STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; + STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; + STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE; + STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE; + STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE; + STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE; + STDMETHOD(FlipToGDISurface)(THIS) PURE; + STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; + STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE; + STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; + STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE; + STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; + STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; + STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; + STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; + STDMETHOD(RestoreDisplayMode)(THIS) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; + STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; + STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; + /*** Added in the v2 interface ***/ + STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS, LPDWORD, LPDWORD) PURE; +}; +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectDraw2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) +#define IDirectDraw2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectDraw2_Release(p) (p)->lpVtbl->Release(p) +#define IDirectDraw2_Compact(p) (p)->lpVtbl->Compact(p) +#define IDirectDraw2_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) +#define IDirectDraw2_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) +#define IDirectDraw2_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) +#define IDirectDraw2_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) +#define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) +#define IDirectDraw2_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) +#define IDirectDraw2_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) +#define IDirectDraw2_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) +#define IDirectDraw2_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) +#define IDirectDraw2_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) +#define IDirectDraw2_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) +#define IDirectDraw2_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) +#define IDirectDraw2_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) +#define IDirectDraw2_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) +#define IDirectDraw2_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) +#define IDirectDraw2_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) +#define IDirectDraw2_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) +#define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e) +#define IDirectDraw2_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) +#define IDirectDraw2_GetAvailableVidMem(p, a, b, c) (p)->lpVtbl->GetAvailableVidMem(p, a, b, c) +#else +#define IDirectDraw2_QueryInterface(p, a, b) (p)->QueryInterface(a, b) +#define IDirectDraw2_AddRef(p) (p)->AddRef() +#define IDirectDraw2_Release(p) (p)->Release() +#define IDirectDraw2_Compact(p) (p)->Compact() +#define IDirectDraw2_CreateClipper(p, a, b, c) (p)->CreateClipper(a, b, c) +#define IDirectDraw2_CreatePalette(p, a, b, c, d) (p)->CreatePalette(a, b, c, d) +#define IDirectDraw2_CreateSurface(p, a, b, c) (p)->CreateSurface(a, b, c) +#define IDirectDraw2_DuplicateSurface(p, a, b) (p)->DuplicateSurface(a, b) +#define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d) +#define IDirectDraw2_EnumSurfaces(p, a, b, c, d) (p)->EnumSurfaces(a, b, c, d) +#define IDirectDraw2_FlipToGDISurface(p) (p)->FlipToGDISurface() +#define IDirectDraw2_GetCaps(p, a, b) (p)->GetCaps(a, b) +#define IDirectDraw2_GetDisplayMode(p, a) (p)->GetDisplayMode(a) +#define IDirectDraw2_GetFourCCCodes(p, a, b) (p)->GetFourCCCodes(a, b) +#define IDirectDraw2_GetGDISurface(p, a) (p)->GetGDISurface(a) +#define IDirectDraw2_GetMonitorFrequency(p, a) (p)->GetMonitorFrequency(a) +#define IDirectDraw2_GetScanLine(p, a) (p)->GetScanLine(a) +#define IDirectDraw2_GetVerticalBlankStatus(p, a) (p)->GetVerticalBlankStatus(a) +#define IDirectDraw2_Initialize(p, a) (p)->Initialize(a) +#define IDirectDraw2_RestoreDisplayMode(p) (p)->RestoreDisplayMode() +#define IDirectDraw2_SetCooperativeLevel(p, a, b) (p)->SetCooperativeLevel(a, b) +#define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e) +#define IDirectDraw2_WaitForVerticalBlank(p, a, b) (p)->WaitForVerticalBlank(a, b) +#define IDirectDraw2_GetAvailableVidMem(p, a, b, c) (p)->GetAvailableVidMem(a, b, c) +#endif + +#endif + +#if defined( _WIN32 ) && !defined( _NO_COM ) +#undef INTERFACE +#define INTERFACE IDirectDraw4 +DECLARE_INTERFACE_( IDirectDraw4, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDraw methods ***/ + STDMETHOD(Compact)(THIS) PURE; + STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; + STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; + STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2, LPDIRECTDRAWSURFACE4 FAR *, IUnknown FAR *) PURE; + STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE4, LPDIRECTDRAWSURFACE4 FAR * ) PURE; + STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC2, LPVOID, LPDDENUMMODESCALLBACK2 ) PURE; + STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC2, LPVOID,LPDDENUMSURFACESCALLBACK2 ) PURE; + STDMETHOD(FlipToGDISurface)(THIS) PURE; + STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; + STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC2) PURE; + STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; + STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE4 FAR *) PURE; + STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; + STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; + STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; + STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; + STDMETHOD(RestoreDisplayMode)(THIS) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; + STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; + STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; + /*** Added in the v2 interface ***/ + STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE; + /*** Added in the V4 Interface ***/ + STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, LPDIRECTDRAWSURFACE4 *) PURE; + STDMETHOD(RestoreAllSurfaces)(THIS) PURE; + STDMETHOD(TestCooperativeLevel)(THIS) PURE; + STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER, DWORD ) PURE; +}; +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectDraw4_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) +#define IDirectDraw4_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectDraw4_Release(p) (p)->lpVtbl->Release(p) +#define IDirectDraw4_Compact(p) (p)->lpVtbl->Compact(p) +#define IDirectDraw4_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) +#define IDirectDraw4_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) +#define IDirectDraw4_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) +#define IDirectDraw4_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) +#define IDirectDraw4_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) +#define IDirectDraw4_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) +#define IDirectDraw4_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) +#define IDirectDraw4_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) +#define IDirectDraw4_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) +#define IDirectDraw4_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) +#define IDirectDraw4_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) +#define IDirectDraw4_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) +#define IDirectDraw4_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) +#define IDirectDraw4_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) +#define IDirectDraw4_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) +#define IDirectDraw4_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) +#define IDirectDraw4_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) +#define IDirectDraw4_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e) +#define IDirectDraw4_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) +#define IDirectDraw4_GetAvailableVidMem(p, a, b, c) (p)->lpVtbl->GetAvailableVidMem(p, a, b, c) +#define IDirectDraw4_GetSurfaceFromDC(p, a, b) (p)->lpVtbl->GetSurfaceFromDC(p, a, b) +#define IDirectDraw4_RestoreAllSurfaces(p) (p)->lpVtbl->RestoreAllSurfaces(p) +#define IDirectDraw4_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) +#define IDirectDraw4_GetDeviceIdentifier(p,a,b) (p)->lpVtbl->GetDeviceIdentifier(p,a,b) +#else +#define IDirectDraw4_QueryInterface(p, a, b) (p)->QueryInterface(a, b) +#define IDirectDraw4_AddRef(p) (p)->AddRef() +#define IDirectDraw4_Release(p) (p)->Release() +#define IDirectDraw4_Compact(p) (p)->Compact() +#define IDirectDraw4_CreateClipper(p, a, b, c) (p)->CreateClipper(a, b, c) +#define IDirectDraw4_CreatePalette(p, a, b, c, d) (p)->CreatePalette(a, b, c, d) +#define IDirectDraw4_CreateSurface(p, a, b, c) (p)->CreateSurface(a, b, c) +#define IDirectDraw4_DuplicateSurface(p, a, b) (p)->DuplicateSurface(a, b) +#define IDirectDraw4_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d) +#define IDirectDraw4_EnumSurfaces(p, a, b, c, d) (p)->EnumSurfaces(a, b, c, d) +#define IDirectDraw4_FlipToGDISurface(p) (p)->FlipToGDISurface() +#define IDirectDraw4_GetCaps(p, a, b) (p)->GetCaps(a, b) +#define IDirectDraw4_GetDisplayMode(p, a) (p)->GetDisplayMode(a) +#define IDirectDraw4_GetFourCCCodes(p, a, b) (p)->GetFourCCCodes(a, b) +#define IDirectDraw4_GetGDISurface(p, a) (p)->GetGDISurface(a) +#define IDirectDraw4_GetMonitorFrequency(p, a) (p)->GetMonitorFrequency(a) +#define IDirectDraw4_GetScanLine(p, a) (p)->GetScanLine(a) +#define IDirectDraw4_GetVerticalBlankStatus(p, a) (p)->GetVerticalBlankStatus(a) +#define IDirectDraw4_Initialize(p, a) (p)->Initialize(a) +#define IDirectDraw4_RestoreDisplayMode(p) (p)->RestoreDisplayMode() +#define IDirectDraw4_SetCooperativeLevel(p, a, b) (p)->SetCooperativeLevel(a, b) +#define IDirectDraw4_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e) +#define IDirectDraw4_WaitForVerticalBlank(p, a, b) (p)->WaitForVerticalBlank(a, b) +#define IDirectDraw4_GetAvailableVidMem(p, a, b, c) (p)->GetAvailableVidMem(a, b, c) +#define IDirectDraw4_GetSurfaceFromDC(p, a, b) (p)->GetSurfaceFromDC(a, b) +#define IDirectDraw4_RestoreAllSurfaces(p) (p)->RestoreAllSurfaces() +#define IDirectDraw4_TestCooperativeLevel(p) (p)->TestCooperativeLevel() +#define IDirectDraw4_GetDeviceIdentifier(p,a,b) (p)->GetDeviceIdentifier(a,b) +#endif + +#endif + +#if defined( _WIN32 ) && !defined( _NO_COM ) +#undef INTERFACE +#define INTERFACE IDirectDraw7 +DECLARE_INTERFACE_( IDirectDraw7, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDraw methods ***/ + STDMETHOD(Compact)(THIS) PURE; + STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; + STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; + STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2, LPDIRECTDRAWSURFACE7 FAR *, IUnknown FAR *) PURE; + STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE7, LPDIRECTDRAWSURFACE7 FAR * ) PURE; + STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC2, LPVOID, LPDDENUMMODESCALLBACK2 ) PURE; + STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC2, LPVOID,LPDDENUMSURFACESCALLBACK7 ) PURE; + STDMETHOD(FlipToGDISurface)(THIS) PURE; + STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; + STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC2) PURE; + STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; + STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE7 FAR *) PURE; + STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; + STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; + STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; + STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; + STDMETHOD(RestoreDisplayMode)(THIS) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; + STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; + STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; + /*** Added in the v2 interface ***/ + STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2, LPDWORD, LPDWORD) PURE; + /*** Added in the V4 Interface ***/ + STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, LPDIRECTDRAWSURFACE7 *) PURE; + STDMETHOD(RestoreAllSurfaces)(THIS) PURE; + STDMETHOD(TestCooperativeLevel)(THIS) PURE; + STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER2, DWORD ) PURE; + STDMETHOD(StartModeTest)(THIS_ LPSIZE, DWORD, DWORD ) PURE; + STDMETHOD(EvaluateMode)(THIS_ DWORD, DWORD * ) PURE; +}; +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectDraw7_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) +#define IDirectDraw7_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectDraw7_Release(p) (p)->lpVtbl->Release(p) +#define IDirectDraw7_Compact(p) (p)->lpVtbl->Compact(p) +#define IDirectDraw7_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) +#define IDirectDraw7_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) +#define IDirectDraw7_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) +#define IDirectDraw7_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) +#define IDirectDraw7_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) +#define IDirectDraw7_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) +#define IDirectDraw7_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) +#define IDirectDraw7_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) +#define IDirectDraw7_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) +#define IDirectDraw7_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) +#define IDirectDraw7_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) +#define IDirectDraw7_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) +#define IDirectDraw7_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) +#define IDirectDraw7_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) +#define IDirectDraw7_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) +#define IDirectDraw7_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) +#define IDirectDraw7_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) +#define IDirectDraw7_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e) +#define IDirectDraw7_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) +#define IDirectDraw7_GetAvailableVidMem(p, a, b, c) (p)->lpVtbl->GetAvailableVidMem(p, a, b, c) +#define IDirectDraw7_GetSurfaceFromDC(p, a, b) (p)->lpVtbl->GetSurfaceFromDC(p, a, b) +#define IDirectDraw7_RestoreAllSurfaces(p) (p)->lpVtbl->RestoreAllSurfaces(p) +#define IDirectDraw7_TestCooperativeLevel(p) (p)->lpVtbl->TestCooperativeLevel(p) +#define IDirectDraw7_GetDeviceIdentifier(p,a,b) (p)->lpVtbl->GetDeviceIdentifier(p,a,b) +#define IDirectDraw7_StartModeTest(p,a,b,c) (p)->lpVtbl->StartModeTest(p,a,b,c) +#define IDirectDraw7_EvaluateMode(p,a,b) (p)->lpVtbl->EvaluateMode(p,a,b) +#else +#define IDirectDraw7_QueryInterface(p, a, b) (p)->QueryInterface(a, b) +#define IDirectDraw7_AddRef(p) (p)->AddRef() +#define IDirectDraw7_Release(p) (p)->Release() +#define IDirectDraw7_Compact(p) (p)->Compact() +#define IDirectDraw7_CreateClipper(p, a, b, c) (p)->CreateClipper(a, b, c) +#define IDirectDraw7_CreatePalette(p, a, b, c, d) (p)->CreatePalette(a, b, c, d) +#define IDirectDraw7_CreateSurface(p, a, b, c) (p)->CreateSurface(a, b, c) +#define IDirectDraw7_DuplicateSurface(p, a, b) (p)->DuplicateSurface(a, b) +#define IDirectDraw7_EnumDisplayModes(p, a, b, c, d) (p)->EnumDisplayModes(a, b, c, d) +#define IDirectDraw7_EnumSurfaces(p, a, b, c, d) (p)->EnumSurfaces(a, b, c, d) +#define IDirectDraw7_FlipToGDISurface(p) (p)->FlipToGDISurface() +#define IDirectDraw7_GetCaps(p, a, b) (p)->GetCaps(a, b) +#define IDirectDraw7_GetDisplayMode(p, a) (p)->GetDisplayMode(a) +#define IDirectDraw7_GetFourCCCodes(p, a, b) (p)->GetFourCCCodes(a, b) +#define IDirectDraw7_GetGDISurface(p, a) (p)->GetGDISurface(a) +#define IDirectDraw7_GetMonitorFrequency(p, a) (p)->GetMonitorFrequency(a) +#define IDirectDraw7_GetScanLine(p, a) (p)->GetScanLine(a) +#define IDirectDraw7_GetVerticalBlankStatus(p, a) (p)->GetVerticalBlankStatus(a) +#define IDirectDraw7_Initialize(p, a) (p)->Initialize(a) +#define IDirectDraw7_RestoreDisplayMode(p) (p)->RestoreDisplayMode() +#define IDirectDraw7_SetCooperativeLevel(p, a, b) (p)->SetCooperativeLevel(a, b) +#define IDirectDraw7_SetDisplayMode(p, a, b, c, d, e) (p)->SetDisplayMode(a, b, c, d, e) +#define IDirectDraw7_WaitForVerticalBlank(p, a, b) (p)->WaitForVerticalBlank(a, b) +#define IDirectDraw7_GetAvailableVidMem(p, a, b, c) (p)->GetAvailableVidMem(a, b, c) +#define IDirectDraw7_GetSurfaceFromDC(p, a, b) (p)->GetSurfaceFromDC(a, b) +#define IDirectDraw7_RestoreAllSurfaces(p) (p)->RestoreAllSurfaces() +#define IDirectDraw7_TestCooperativeLevel(p) (p)->TestCooperativeLevel() +#define IDirectDraw7_GetDeviceIdentifier(p,a,b) (p)->GetDeviceIdentifier(a,b) +#define IDirectDraw7_StartModeTest(p,a,b,c) (p)->lpVtbl->StartModeTest(a,b,c) +#define IDirectDraw7_EvaluateMode(p,a,b) (p)->lpVtbl->EvaluateMode(a,b) +#endif + +#endif + + +/* + * IDirectDrawPalette + */ +#if defined( _WIN32 ) && !defined( _NO_COM ) +#undef INTERFACE +#define INTERFACE IDirectDrawPalette +DECLARE_INTERFACE_( IDirectDrawPalette, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDrawPalette methods ***/ + STDMETHOD(GetCaps)(THIS_ LPDWORD) PURE; + STDMETHOD(GetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD, LPPALETTEENTRY) PURE; + STDMETHOD(SetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectDrawPalette_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) +#define IDirectDrawPalette_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectDrawPalette_Release(p) (p)->lpVtbl->Release(p) +#define IDirectDrawPalette_GetCaps(p, a) (p)->lpVtbl->GetCaps(p, a) +#define IDirectDrawPalette_GetEntries(p, a, b, c, d) (p)->lpVtbl->GetEntries(p, a, b, c, d) +#define IDirectDrawPalette_Initialize(p, a, b, c) (p)->lpVtbl->Initialize(p, a, b, c) +#define IDirectDrawPalette_SetEntries(p, a, b, c, d) (p)->lpVtbl->SetEntries(p, a, b, c, d) +#else +#define IDirectDrawPalette_QueryInterface(p, a, b) (p)->QueryInterface(a, b) +#define IDirectDrawPalette_AddRef(p) (p)->AddRef() +#define IDirectDrawPalette_Release(p) (p)->Release() +#define IDirectDrawPalette_GetCaps(p, a) (p)->GetCaps(a) +#define IDirectDrawPalette_GetEntries(p, a, b, c, d) (p)->GetEntries(a, b, c, d) +#define IDirectDrawPalette_Initialize(p, a, b, c) (p)->Initialize(a, b, c) +#define IDirectDrawPalette_SetEntries(p, a, b, c, d) (p)->SetEntries(a, b, c, d) +#endif + +#endif + + +/* + * IDirectDrawClipper + */ +#if defined( _WIN32 ) && !defined( _NO_COM ) +#undef INTERFACE +#define INTERFACE IDirectDrawClipper +DECLARE_INTERFACE_( IDirectDrawClipper, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDrawClipper methods ***/ + STDMETHOD(GetClipList)(THIS_ LPRECT, LPRGNDATA, LPDWORD) PURE; + STDMETHOD(GetHWnd)(THIS_ HWND FAR *) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD) PURE; + STDMETHOD(IsClipListChanged)(THIS_ BOOL FAR *) PURE; + STDMETHOD(SetClipList)(THIS_ LPRGNDATA,DWORD) PURE; + STDMETHOD(SetHWnd)(THIS_ DWORD, HWND ) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectDrawClipper_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) +#define IDirectDrawClipper_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectDrawClipper_Release(p) (p)->lpVtbl->Release(p) +#define IDirectDrawClipper_GetClipList(p, a, b, c) (p)->lpVtbl->GetClipList(p, a, b, c) +#define IDirectDrawClipper_GetHWnd(p, a) (p)->lpVtbl->GetHWnd(p, a) +#define IDirectDrawClipper_Initialize(p, a, b) (p)->lpVtbl->Initialize(p, a, b) +#define IDirectDrawClipper_IsClipListChanged(p, a) (p)->lpVtbl->IsClipListChanged(p, a) +#define IDirectDrawClipper_SetClipList(p, a, b) (p)->lpVtbl->SetClipList(p, a, b) +#define IDirectDrawClipper_SetHWnd(p, a, b) (p)->lpVtbl->SetHWnd(p, a, b) +#else +#define IDirectDrawClipper_QueryInterface(p, a, b) (p)->QueryInterface(a, b) +#define IDirectDrawClipper_AddRef(p) (p)->AddRef() +#define IDirectDrawClipper_Release(p) (p)->Release() +#define IDirectDrawClipper_GetClipList(p, a, b, c) (p)->GetClipList(a, b, c) +#define IDirectDrawClipper_GetHWnd(p, a) (p)->GetHWnd(a) +#define IDirectDrawClipper_Initialize(p, a, b) (p)->Initialize(a, b) +#define IDirectDrawClipper_IsClipListChanged(p, a) (p)->IsClipListChanged(a) +#define IDirectDrawClipper_SetClipList(p, a, b) (p)->SetClipList(a, b) +#define IDirectDrawClipper_SetHWnd(p, a, b) (p)->SetHWnd(a, b) +#endif + +#endif + +/* + * IDirectDrawSurface and related interfaces + */ +#if defined( _WIN32 ) && !defined( _NO_COM ) +#undef INTERFACE +#define INTERFACE IDirectDrawSurface +DECLARE_INTERFACE_( IDirectDrawSurface, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDrawSurface methods ***/ + STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE) PURE; + STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; + STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE, LPRECT,DWORD, LPDDBLTFX) PURE; + STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; + STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE, LPRECT,DWORD) PURE; + STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE) PURE; + STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; + STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; + STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; + STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE FAR *) PURE; + STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; + STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; + STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; + STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; + STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; + STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; + STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; + STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; + STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; + STDMETHOD(IsLost)(THIS) PURE; + STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; + STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; + STDMETHOD(Restore)(THIS) PURE; + STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; + STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; + STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; + STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; + STDMETHOD(Unlock)(THIS_ LPVOID) PURE; + STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE,LPRECT,DWORD, LPDDOVERLAYFX) PURE; + STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; + STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectDrawSurface_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectDrawSurface_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectDrawSurface_Release(p) (p)->lpVtbl->Release(p) +#define IDirectDrawSurface_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) +#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) +#define IDirectDrawSurface_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) +#define IDirectDrawSurface_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) +#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) +#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) +#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) +#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) +#define IDirectDrawSurface_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) +#define IDirectDrawSurface_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) +#define IDirectDrawSurface_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) +#define IDirectDrawSurface_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) +#define IDirectDrawSurface_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) +#define IDirectDrawSurface_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) +#define IDirectDrawSurface_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) +#define IDirectDrawSurface_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) +#define IDirectDrawSurface_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) +#define IDirectDrawSurface_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) +#define IDirectDrawSurface_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) +#define IDirectDrawSurface_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) +#define IDirectDrawSurface_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectDrawSurface_IsLost(p) (p)->lpVtbl->IsLost(p) +#define IDirectDrawSurface_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) +#define IDirectDrawSurface_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) +#define IDirectDrawSurface_Restore(p) (p)->lpVtbl->Restore(p) +#define IDirectDrawSurface_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) +#define IDirectDrawSurface_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) +#define IDirectDrawSurface_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) +#define IDirectDrawSurface_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) +#define IDirectDrawSurface_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) +#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) +#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) +#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) +#else +#define IDirectDrawSurface_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectDrawSurface_AddRef(p) (p)->AddRef() +#define IDirectDrawSurface_Release(p) (p)->Release() +#define IDirectDrawSurface_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) +#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) +#define IDirectDrawSurface_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) +#define IDirectDrawSurface_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) +#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) +#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) +#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) +#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) +#define IDirectDrawSurface_Flip(p,a,b) (p)->Flip(a,b) +#define IDirectDrawSurface_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) +#define IDirectDrawSurface_GetBltStatus(p,a) (p)->GetBltStatus(a) +#define IDirectDrawSurface_GetCaps(p,b) (p)->GetCaps(b) +#define IDirectDrawSurface_GetClipper(p,a) (p)->GetClipper(a) +#define IDirectDrawSurface_GetColorKey(p,a,b) (p)->GetColorKey(a,b) +#define IDirectDrawSurface_GetDC(p,a) (p)->GetDC(a) +#define IDirectDrawSurface_GetFlipStatus(p,a) (p)->GetFlipStatus(a) +#define IDirectDrawSurface_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) +#define IDirectDrawSurface_GetPalette(p,a) (p)->GetPalette(a) +#define IDirectDrawSurface_GetPixelFormat(p,a) (p)->GetPixelFormat(a) +#define IDirectDrawSurface_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) +#define IDirectDrawSurface_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectDrawSurface_IsLost(p) (p)->IsLost() +#define IDirectDrawSurface_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) +#define IDirectDrawSurface_ReleaseDC(p,a) (p)->ReleaseDC(a) +#define IDirectDrawSurface_Restore(p) (p)->Restore() +#define IDirectDrawSurface_SetClipper(p,a) (p)->SetClipper(a) +#define IDirectDrawSurface_SetColorKey(p,a,b) (p)->SetColorKey(a,b) +#define IDirectDrawSurface_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) +#define IDirectDrawSurface_SetPalette(p,a) (p)->SetPalette(a) +#define IDirectDrawSurface_Unlock(p,b) (p)->Unlock(b) +#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) +#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) +#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) +#endif + +/* + * IDirectDrawSurface2 and related interfaces + */ +#undef INTERFACE +#define INTERFACE IDirectDrawSurface2 +DECLARE_INTERFACE_( IDirectDrawSurface2, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDrawSurface methods ***/ + STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE2) PURE; + STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; + STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE2, LPRECT,DWORD, LPDDBLTFX) PURE; + STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; + STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE2, LPRECT,DWORD) PURE; + STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE2) PURE; + STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; + STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; + STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE2, DWORD) PURE; + STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE2 FAR *) PURE; + STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; + STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; + STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; + STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; + STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; + STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; + STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; + STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; + STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; + STDMETHOD(IsLost)(THIS) PURE; + STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; + STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; + STDMETHOD(Restore)(THIS) PURE; + STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; + STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; + STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; + STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; + STDMETHOD(Unlock)(THIS_ LPVOID) PURE; + STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX) PURE; + STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; + STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE2) PURE; + /*** Added in the v2 interface ***/ + STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; + STDMETHOD(PageLock)(THIS_ DWORD) PURE; + STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectDrawSurface2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectDrawSurface2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectDrawSurface2_Release(p) (p)->lpVtbl->Release(p) +#define IDirectDrawSurface2_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) +#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) +#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) +#define IDirectDrawSurface2_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) +#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) +#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) +#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) +#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) +#define IDirectDrawSurface2_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) +#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) +#define IDirectDrawSurface2_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) +#define IDirectDrawSurface2_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) +#define IDirectDrawSurface2_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) +#define IDirectDrawSurface2_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) +#define IDirectDrawSurface2_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) +#define IDirectDrawSurface2_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) +#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) +#define IDirectDrawSurface2_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) +#define IDirectDrawSurface2_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) +#define IDirectDrawSurface2_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) +#define IDirectDrawSurface2_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectDrawSurface2_IsLost(p) (p)->lpVtbl->IsLost(p) +#define IDirectDrawSurface2_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) +#define IDirectDrawSurface2_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) +#define IDirectDrawSurface2_Restore(p) (p)->lpVtbl->Restore(p) +#define IDirectDrawSurface2_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) +#define IDirectDrawSurface2_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) +#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) +#define IDirectDrawSurface2_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) +#define IDirectDrawSurface2_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) +#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) +#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) +#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) +#define IDirectDrawSurface2_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) +#define IDirectDrawSurface2_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) +#define IDirectDrawSurface2_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) +#else +#define IDirectDrawSurface2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectDrawSurface2_AddRef(p) (p)->AddRef() +#define IDirectDrawSurface2_Release(p) (p)->Release() +#define IDirectDrawSurface2_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) +#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) +#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) +#define IDirectDrawSurface2_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) +#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) +#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) +#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) +#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) +#define IDirectDrawSurface2_Flip(p,a,b) (p)->Flip(a,b) +#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) +#define IDirectDrawSurface2_GetBltStatus(p,a) (p)->GetBltStatus(a) +#define IDirectDrawSurface2_GetCaps(p,b) (p)->GetCaps(b) +#define IDirectDrawSurface2_GetClipper(p,a) (p)->GetClipper(a) +#define IDirectDrawSurface2_GetColorKey(p,a,b) (p)->GetColorKey(a,b) +#define IDirectDrawSurface2_GetDC(p,a) (p)->GetDC(a) +#define IDirectDrawSurface2_GetFlipStatus(p,a) (p)->GetFlipStatus(a) +#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) +#define IDirectDrawSurface2_GetPalette(p,a) (p)->GetPalette(a) +#define IDirectDrawSurface2_GetPixelFormat(p,a) (p)->GetPixelFormat(a) +#define IDirectDrawSurface2_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) +#define IDirectDrawSurface2_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectDrawSurface2_IsLost(p) (p)->IsLost() +#define IDirectDrawSurface2_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) +#define IDirectDrawSurface2_ReleaseDC(p,a) (p)->ReleaseDC(a) +#define IDirectDrawSurface2_Restore(p) (p)->Restore() +#define IDirectDrawSurface2_SetClipper(p,a) (p)->SetClipper(a) +#define IDirectDrawSurface2_SetColorKey(p,a,b) (p)->SetColorKey(a,b) +#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) +#define IDirectDrawSurface2_SetPalette(p,a) (p)->SetPalette(a) +#define IDirectDrawSurface2_Unlock(p,b) (p)->Unlock(b) +#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) +#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) +#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) +#define IDirectDrawSurface2_GetDDInterface(p,a) (p)->GetDDInterface(a) +#define IDirectDrawSurface2_PageLock(p,a) (p)->PageLock(a) +#define IDirectDrawSurface2_PageUnlock(p,a) (p)->PageUnlock(a) +#endif + +/* + * IDirectDrawSurface3 and related interfaces + */ +#undef INTERFACE +#define INTERFACE IDirectDrawSurface3 +DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDrawSurface methods ***/ + STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE; + STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; + STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE3, LPRECT,DWORD, LPDDBLTFX) PURE; + STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; + STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT,DWORD) PURE; + STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE3) PURE; + STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; + STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; + STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3, DWORD) PURE; + STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE3 FAR *) PURE; + STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; + STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; + STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; + STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; + STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; + STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; + STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; + STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; + STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; + STDMETHOD(IsLost)(THIS) PURE; + STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; + STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; + STDMETHOD(Restore)(THIS) PURE; + STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; + STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; + STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; + STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; + STDMETHOD(Unlock)(THIS_ LPVOID) PURE; + STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) PURE; + STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; + STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE; + /*** Added in the v2 interface ***/ + STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; + STDMETHOD(PageLock)(THIS_ DWORD) PURE; + STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; + /*** Added in the V3 interface ***/ + STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectDrawSurface3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectDrawSurface3_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectDrawSurface3_Release(p) (p)->lpVtbl->Release(p) +#define IDirectDrawSurface3_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) +#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) +#define IDirectDrawSurface3_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) +#define IDirectDrawSurface3_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) +#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) +#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) +#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) +#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) +#define IDirectDrawSurface3_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) +#define IDirectDrawSurface3_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) +#define IDirectDrawSurface3_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) +#define IDirectDrawSurface3_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) +#define IDirectDrawSurface3_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) +#define IDirectDrawSurface3_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) +#define IDirectDrawSurface3_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) +#define IDirectDrawSurface3_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) +#define IDirectDrawSurface3_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) +#define IDirectDrawSurface3_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) +#define IDirectDrawSurface3_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) +#define IDirectDrawSurface3_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) +#define IDirectDrawSurface3_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectDrawSurface3_IsLost(p) (p)->lpVtbl->IsLost(p) +#define IDirectDrawSurface3_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) +#define IDirectDrawSurface3_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) +#define IDirectDrawSurface3_Restore(p) (p)->lpVtbl->Restore(p) +#define IDirectDrawSurface3_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) +#define IDirectDrawSurface3_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) +#define IDirectDrawSurface3_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) +#define IDirectDrawSurface3_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) +#define IDirectDrawSurface3_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) +#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) +#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) +#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) +#define IDirectDrawSurface3_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) +#define IDirectDrawSurface3_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) +#define IDirectDrawSurface3_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) +#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) (p)->lpVtbl->SetSurfaceDesc(p,a,b) +#else +#define IDirectDrawSurface3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectDrawSurface3_AddRef(p) (p)->AddRef() +#define IDirectDrawSurface3_Release(p) (p)->Release() +#define IDirectDrawSurface3_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) +#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) +#define IDirectDrawSurface3_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) +#define IDirectDrawSurface3_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) +#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) +#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) +#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) +#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) +#define IDirectDrawSurface3_Flip(p,a,b) (p)->Flip(a,b) +#define IDirectDrawSurface3_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) +#define IDirectDrawSurface3_GetBltStatus(p,a) (p)->GetBltStatus(a) +#define IDirectDrawSurface3_GetCaps(p,b) (p)->GetCaps(b) +#define IDirectDrawSurface3_GetClipper(p,a) (p)->GetClipper(a) +#define IDirectDrawSurface3_GetColorKey(p,a,b) (p)->GetColorKey(a,b) +#define IDirectDrawSurface3_GetDC(p,a) (p)->GetDC(a) +#define IDirectDrawSurface3_GetFlipStatus(p,a) (p)->GetFlipStatus(a) +#define IDirectDrawSurface3_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) +#define IDirectDrawSurface3_GetPalette(p,a) (p)->GetPalette(a) +#define IDirectDrawSurface3_GetPixelFormat(p,a) (p)->GetPixelFormat(a) +#define IDirectDrawSurface3_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) +#define IDirectDrawSurface3_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectDrawSurface3_IsLost(p) (p)->IsLost() +#define IDirectDrawSurface3_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) +#define IDirectDrawSurface3_ReleaseDC(p,a) (p)->ReleaseDC(a) +#define IDirectDrawSurface3_Restore(p) (p)->Restore() +#define IDirectDrawSurface3_SetClipper(p,a) (p)->SetClipper(a) +#define IDirectDrawSurface3_SetColorKey(p,a,b) (p)->SetColorKey(a,b) +#define IDirectDrawSurface3_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) +#define IDirectDrawSurface3_SetPalette(p,a) (p)->SetPalette(a) +#define IDirectDrawSurface3_Unlock(p,b) (p)->Unlock(b) +#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) +#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) +#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) +#define IDirectDrawSurface3_GetDDInterface(p,a) (p)->GetDDInterface(a) +#define IDirectDrawSurface3_PageLock(p,a) (p)->PageLock(a) +#define IDirectDrawSurface3_PageUnlock(p,a) (p)->PageUnlock(a) +#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) (p)->SetSurfaceDesc(a,b) +#endif + +/* + * IDirectDrawSurface4 and related interfaces + */ +#undef INTERFACE +#define INTERFACE IDirectDrawSurface4 +DECLARE_INTERFACE_( IDirectDrawSurface4, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDrawSurface methods ***/ + STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE4) PURE; + STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; + STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE4, LPRECT,DWORD, LPDDBLTFX) PURE; + STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; + STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE4, LPRECT,DWORD) PURE; + STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE4) PURE; + STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK2) PURE; + STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK2) PURE; + STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE4, DWORD) PURE; + STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2, LPDIRECTDRAWSURFACE4 FAR *) PURE; + STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2) PURE; + STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; + STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; + STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; + STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; + STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; + STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; + STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; + STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC2) PURE; + STDMETHOD(IsLost)(THIS) PURE; + STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC2,DWORD,HANDLE) PURE; + STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; + STDMETHOD(Restore)(THIS) PURE; + STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; + STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; + STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; + STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; + STDMETHOD(Unlock)(THIS_ LPRECT) PURE; + STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX) PURE; + STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; + STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE4) PURE; + /*** Added in the v2 interface ***/ + STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; + STDMETHOD(PageLock)(THIS_ DWORD) PURE; + STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; + /*** Added in the v3 interface ***/ + STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE; + /*** Added in the v4 interface ***/ + STDMETHOD(SetPrivateData)(THIS_ REFGUID, LPVOID, DWORD, DWORD) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID, LPVOID, LPDWORD) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID) PURE; + STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD) PURE; + STDMETHOD(ChangeUniquenessValue)(THIS) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectDrawSurface4_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectDrawSurface4_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectDrawSurface4_Release(p) (p)->lpVtbl->Release(p) +#define IDirectDrawSurface4_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) +#define IDirectDrawSurface4_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) +#define IDirectDrawSurface4_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) +#define IDirectDrawSurface4_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) +#define IDirectDrawSurface4_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) +#define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) +#define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) +#define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) +#define IDirectDrawSurface4_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) +#define IDirectDrawSurface4_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) +#define IDirectDrawSurface4_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) +#define IDirectDrawSurface4_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) +#define IDirectDrawSurface4_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) +#define IDirectDrawSurface4_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) +#define IDirectDrawSurface4_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) +#define IDirectDrawSurface4_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) +#define IDirectDrawSurface4_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) +#define IDirectDrawSurface4_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) +#define IDirectDrawSurface4_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) +#define IDirectDrawSurface4_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) +#define IDirectDrawSurface4_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectDrawSurface4_IsLost(p) (p)->lpVtbl->IsLost(p) +#define IDirectDrawSurface4_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) +#define IDirectDrawSurface4_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) +#define IDirectDrawSurface4_Restore(p) (p)->lpVtbl->Restore(p) +#define IDirectDrawSurface4_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) +#define IDirectDrawSurface4_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) +#define IDirectDrawSurface4_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) +#define IDirectDrawSurface4_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) +#define IDirectDrawSurface4_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) +#define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) +#define IDirectDrawSurface4_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) +#define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) +#define IDirectDrawSurface4_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) +#define IDirectDrawSurface4_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) +#define IDirectDrawSurface4_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) +#define IDirectDrawSurface4_SetSurfaceDesc(p,a,b) (p)->lpVtbl->SetSurfaceDesc(p,a,b) +#define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirectDrawSurface4_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirectDrawSurface4_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirectDrawSurface4_GetUniquenessValue(p, a) (p)->lpVtbl->GetUniquenessValue(p, a) +#define IDirectDrawSurface4_ChangeUniquenessValue(p) (p)->lpVtbl->ChangeUniquenessValue(p) +#else +#define IDirectDrawSurface4_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectDrawSurface4_AddRef(p) (p)->AddRef() +#define IDirectDrawSurface4_Release(p) (p)->Release() +#define IDirectDrawSurface4_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) +#define IDirectDrawSurface4_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) +#define IDirectDrawSurface4_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) +#define IDirectDrawSurface4_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) +#define IDirectDrawSurface4_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) +#define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) +#define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) +#define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) +#define IDirectDrawSurface4_Flip(p,a,b) (p)->Flip(a,b) +#define IDirectDrawSurface4_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) +#define IDirectDrawSurface4_GetBltStatus(p,a) (p)->GetBltStatus(a) +#define IDirectDrawSurface4_GetCaps(p,b) (p)->GetCaps(b) +#define IDirectDrawSurface4_GetClipper(p,a) (p)->GetClipper(a) +#define IDirectDrawSurface4_GetColorKey(p,a,b) (p)->GetColorKey(a,b) +#define IDirectDrawSurface4_GetDC(p,a) (p)->GetDC(a) +#define IDirectDrawSurface4_GetFlipStatus(p,a) (p)->GetFlipStatus(a) +#define IDirectDrawSurface4_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) +#define IDirectDrawSurface4_GetPalette(p,a) (p)->GetPalette(a) +#define IDirectDrawSurface4_GetPixelFormat(p,a) (p)->GetPixelFormat(a) +#define IDirectDrawSurface4_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) +#define IDirectDrawSurface4_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectDrawSurface4_IsLost(p) (p)->IsLost() +#define IDirectDrawSurface4_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) +#define IDirectDrawSurface4_ReleaseDC(p,a) (p)->ReleaseDC(a) +#define IDirectDrawSurface4_Restore(p) (p)->Restore() +#define IDirectDrawSurface4_SetClipper(p,a) (p)->SetClipper(a) +#define IDirectDrawSurface4_SetColorKey(p,a,b) (p)->SetColorKey(a,b) +#define IDirectDrawSurface4_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) +#define IDirectDrawSurface4_SetPalette(p,a) (p)->SetPalette(a) +#define IDirectDrawSurface4_Unlock(p,b) (p)->Unlock(b) +#define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) +#define IDirectDrawSurface4_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) +#define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) +#define IDirectDrawSurface4_GetDDInterface(p,a) (p)->GetDDInterface(a) +#define IDirectDrawSurface4_PageLock(p,a) (p)->PageLock(a) +#define IDirectDrawSurface4_PageUnlock(p,a) (p)->PageUnlock(a) +#define IDirectDrawSurface4_SetSurfaceDesc(p,a,b) (p)->SetSurfaceDesc(a,b) +#define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirectDrawSurface4_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirectDrawSurface4_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirectDrawSurface4_GetUniquenessValue(p, a) (p)->GetUniquenessValue(a) +#define IDirectDrawSurface4_ChangeUniquenessValue(p) (p)->ChangeUniquenessValue() +#endif + +/* + * IDirectDrawSurface7 and related interfaces + */ +#undef INTERFACE +#define INTERFACE IDirectDrawSurface7 +DECLARE_INTERFACE_( IDirectDrawSurface7, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDrawSurface methods ***/ + STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE7) PURE; + STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; + STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE7, LPRECT,DWORD, LPDDBLTFX) PURE; + STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; + STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE7, LPRECT,DWORD) PURE; + STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE7) PURE; + STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK7) PURE; + STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK7) PURE; + STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE7, DWORD) PURE; + STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2, LPDIRECTDRAWSURFACE7 FAR *) PURE; + STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; + STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2) PURE; + STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; + STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; + STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; + STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; + STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; + STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; + STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; + STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2) PURE; + STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC2) PURE; + STDMETHOD(IsLost)(THIS) PURE; + STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC2,DWORD,HANDLE) PURE; + STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; + STDMETHOD(Restore)(THIS) PURE; + STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; + STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; + STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; + STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; + STDMETHOD(Unlock)(THIS_ LPRECT) PURE; + STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE7,LPRECT,DWORD, LPDDOVERLAYFX) PURE; + STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; + STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE7) PURE; + /*** Added in the v2 interface ***/ + STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; + STDMETHOD(PageLock)(THIS_ DWORD) PURE; + STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; + /*** Added in the v3 interface ***/ + STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2, DWORD) PURE; + /*** Added in the v4 interface ***/ + STDMETHOD(SetPrivateData)(THIS_ REFGUID, LPVOID, DWORD, DWORD) PURE; + STDMETHOD(GetPrivateData)(THIS_ REFGUID, LPVOID, LPDWORD) PURE; + STDMETHOD(FreePrivateData)(THIS_ REFGUID) PURE; + STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD) PURE; + STDMETHOD(ChangeUniquenessValue)(THIS) PURE; + /*** Moved Texture7 methods here ***/ + STDMETHOD(SetPriority)(THIS_ DWORD) PURE; + STDMETHOD(GetPriority)(THIS_ LPDWORD) PURE; + STDMETHOD(SetLOD)(THIS_ DWORD) PURE; + STDMETHOD(GetLOD)(THIS_ LPDWORD) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectDrawSurface7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectDrawSurface7_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectDrawSurface7_Release(p) (p)->lpVtbl->Release(p) +#define IDirectDrawSurface7_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) +#define IDirectDrawSurface7_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) +#define IDirectDrawSurface7_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) +#define IDirectDrawSurface7_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) +#define IDirectDrawSurface7_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) +#define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) +#define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) +#define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) +#define IDirectDrawSurface7_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) +#define IDirectDrawSurface7_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) +#define IDirectDrawSurface7_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) +#define IDirectDrawSurface7_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) +#define IDirectDrawSurface7_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) +#define IDirectDrawSurface7_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) +#define IDirectDrawSurface7_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) +#define IDirectDrawSurface7_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) +#define IDirectDrawSurface7_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) +#define IDirectDrawSurface7_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) +#define IDirectDrawSurface7_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) +#define IDirectDrawSurface7_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) +#define IDirectDrawSurface7_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectDrawSurface7_IsLost(p) (p)->lpVtbl->IsLost(p) +#define IDirectDrawSurface7_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) +#define IDirectDrawSurface7_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) +#define IDirectDrawSurface7_Restore(p) (p)->lpVtbl->Restore(p) +#define IDirectDrawSurface7_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) +#define IDirectDrawSurface7_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) +#define IDirectDrawSurface7_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) +#define IDirectDrawSurface7_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) +#define IDirectDrawSurface7_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) +#define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) +#define IDirectDrawSurface7_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) +#define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) +#define IDirectDrawSurface7_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) +#define IDirectDrawSurface7_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) +#define IDirectDrawSurface7_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) +#define IDirectDrawSurface7_SetSurfaceDesc(p,a,b) (p)->lpVtbl->SetSurfaceDesc(p,a,b) +#define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d) +#define IDirectDrawSurface7_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c) +#define IDirectDrawSurface7_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a) +#define IDirectDrawSurface7_GetUniquenessValue(p, a) (p)->lpVtbl->GetUniquenessValue(p, a) +#define IDirectDrawSurface7_ChangeUniquenessValue(p) (p)->lpVtbl->ChangeUniquenessValue(p) +#define IDirectDrawSurface7_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a) +#define IDirectDrawSurface7_GetPriority(p,a) (p)->lpVtbl->GetPriority(p,a) +#define IDirectDrawSurface7_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a) +#define IDirectDrawSurface7_GetLOD(p,a) (p)->lpVtbl->GetLOD(p,a) +#else +#define IDirectDrawSurface7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectDrawSurface7_AddRef(p) (p)->AddRef() +#define IDirectDrawSurface7_Release(p) (p)->Release() +#define IDirectDrawSurface7_AddAttachedSurface(p,a) (p)->AddAttachedSurface(a) +#define IDirectDrawSurface7_AddOverlayDirtyRect(p,a) (p)->AddOverlayDirtyRect(a) +#define IDirectDrawSurface7_Blt(p,a,b,c,d,e) (p)->Blt(a,b,c,d,e) +#define IDirectDrawSurface7_BltBatch(p,a,b,c) (p)->BltBatch(a,b,c) +#define IDirectDrawSurface7_BltFast(p,a,b,c,d,e) (p)->BltFast(a,b,c,d,e) +#define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b) +#define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b) (p)->EnumAttachedSurfaces(a,b) +#define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c) (p)->EnumOverlayZOrders(a,b,c) +#define IDirectDrawSurface7_Flip(p,a,b) (p)->Flip(a,b) +#define IDirectDrawSurface7_GetAttachedSurface(p,a,b) (p)->GetAttachedSurface(a,b) +#define IDirectDrawSurface7_GetBltStatus(p,a) (p)->GetBltStatus(a) +#define IDirectDrawSurface7_GetCaps(p,b) (p)->GetCaps(b) +#define IDirectDrawSurface7_GetClipper(p,a) (p)->GetClipper(a) +#define IDirectDrawSurface7_GetColorKey(p,a,b) (p)->GetColorKey(a,b) +#define IDirectDrawSurface7_GetDC(p,a) (p)->GetDC(a) +#define IDirectDrawSurface7_GetFlipStatus(p,a) (p)->GetFlipStatus(a) +#define IDirectDrawSurface7_GetOverlayPosition(p,a,b) (p)->GetOverlayPosition(a,b) +#define IDirectDrawSurface7_GetPalette(p,a) (p)->GetPalette(a) +#define IDirectDrawSurface7_GetPixelFormat(p,a) (p)->GetPixelFormat(a) +#define IDirectDrawSurface7_GetSurfaceDesc(p,a) (p)->GetSurfaceDesc(a) +#define IDirectDrawSurface7_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectDrawSurface7_IsLost(p) (p)->IsLost() +#define IDirectDrawSurface7_Lock(p,a,b,c,d) (p)->Lock(a,b,c,d) +#define IDirectDrawSurface7_ReleaseDC(p,a) (p)->ReleaseDC(a) +#define IDirectDrawSurface7_Restore(p) (p)->Restore() +#define IDirectDrawSurface7_SetClipper(p,a) (p)->SetClipper(a) +#define IDirectDrawSurface7_SetColorKey(p,a,b) (p)->SetColorKey(a,b) +#define IDirectDrawSurface7_SetOverlayPosition(p,a,b) (p)->SetOverlayPosition(a,b) +#define IDirectDrawSurface7_SetPalette(p,a) (p)->SetPalette(a) +#define IDirectDrawSurface7_Unlock(p,b) (p)->Unlock(b) +#define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e) (p)->UpdateOverlay(a,b,c,d,e) +#define IDirectDrawSurface7_UpdateOverlayDisplay(p,a) (p)->UpdateOverlayDisplay(a) +#define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b) (p)->UpdateOverlayZOrder(a,b) +#define IDirectDrawSurface7_GetDDInterface(p,a) (p)->GetDDInterface(a) +#define IDirectDrawSurface7_PageLock(p,a) (p)->PageLock(a) +#define IDirectDrawSurface7_PageUnlock(p,a) (p)->PageUnlock(a) +#define IDirectDrawSurface7_SetSurfaceDesc(p,a,b) (p)->SetSurfaceDesc(a,b) +#define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d) +#define IDirectDrawSurface7_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c) +#define IDirectDrawSurface7_FreePrivateData(p,a) (p)->FreePrivateData(a) +#define IDirectDrawSurface7_GetUniquenessValue(p, a) (p)->GetUniquenessValue(a) +#define IDirectDrawSurface7_ChangeUniquenessValue(p) (p)->ChangeUniquenessValue() +#define IDirectDrawSurface7_SetPriority(p,a) (p)->SetPriority(a) +#define IDirectDrawSurface7_GetPriority(p,a) (p)->GetPriority(a) +#define IDirectDrawSurface7_SetLOD(p,a) (p)->SetLOD(a) +#define IDirectDrawSurface7_GetLOD(p,a) (p)->GetLOD(a) +#endif + + +/* + * IDirectDrawColorControl + */ +#if defined( _WIN32 ) && !defined( _NO_COM ) +#undef INTERFACE +#define INTERFACE IDirectDrawColorControl +DECLARE_INTERFACE_( IDirectDrawColorControl, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDrawColorControl methods ***/ + STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; + STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectDrawColorControl_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) +#define IDirectDrawColorControl_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectDrawColorControl_Release(p) (p)->lpVtbl->Release(p) +#define IDirectDrawColorControl_GetColorControls(p, a) (p)->lpVtbl->GetColorControls(p, a) +#define IDirectDrawColorControl_SetColorControls(p, a) (p)->lpVtbl->SetColorControls(p, a) +#else +#define IDirectDrawColorControl_QueryInterface(p, a, b) (p)->QueryInterface(a, b) +#define IDirectDrawColorControl_AddRef(p) (p)->AddRef() +#define IDirectDrawColorControl_Release(p) (p)->Release() +#define IDirectDrawColorControl_GetColorControls(p, a) (p)->GetColorControls(a) +#define IDirectDrawColorControl_SetColorControls(p, a) (p)->SetColorControls(a) +#endif + +#endif + + +/* + * IDirectDrawGammaControl + */ +#if defined( _WIN32 ) && !defined( _NO_COM ) +#undef INTERFACE +#define INTERFACE IDirectDrawGammaControl +DECLARE_INTERFACE_( IDirectDrawGammaControl, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDrawGammaControl methods ***/ + STDMETHOD(GetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE; + STDMETHOD(SetGammaRamp)(THIS_ DWORD, LPDDGAMMARAMP) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectDrawGammaControl_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) +#define IDirectDrawGammaControl_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectDrawGammaControl_Release(p) (p)->lpVtbl->Release(p) +#define IDirectDrawGammaControl_GetGammaRamp(p, a, b) (p)->lpVtbl->GetGammaRamp(p, a, b) +#define IDirectDrawGammaControl_SetGammaRamp(p, a, b) (p)->lpVtbl->SetGammaRamp(p, a, b) +#else +#define IDirectDrawGammaControl_QueryInterface(p, a, b) (p)->QueryInterface(a, b) +#define IDirectDrawGammaControl_AddRef(p) (p)->AddRef() +#define IDirectDrawGammaControl_Release(p) (p)->Release() +#define IDirectDrawGammaControl_GetGammaRamp(p, a, b) (p)->GetGammaRamp(a, b) +#define IDirectDrawGammaControl_SetGammaRamp(p, a, b) (p)->SetGammaRamp(a, b) +#endif + +#endif + + + +#endif + + +/* + * DDSURFACEDESC + */ +typedef struct _DDSURFACEDESC +{ + DWORD dwSize; // size of the DDSURFACEDESC structure + DWORD dwFlags; // determines what fields are valid + DWORD dwHeight; // height of surface to be created + DWORD dwWidth; // width of input surface + union + { + LONG lPitch; // distance to start of next line (return value only) + DWORD dwLinearSize; // Formless late-allocated optimized surface size + } DUMMYUNIONNAMEN(1); + DWORD dwBackBufferCount; // number of back buffers requested + union + { + DWORD dwMipMapCount; // number of mip-map levels requested + DWORD dwZBufferBitDepth; // depth of Z buffer requested + DWORD dwRefreshRate; // refresh rate (used when display mode is described) + } DUMMYUNIONNAMEN(2); + DWORD dwAlphaBitDepth; // depth of alpha buffer requested + DWORD dwReserved; // reserved + LPVOID lpSurface; // pointer to the associated surface memory + DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay use + DDCOLORKEY ddckCKDestBlt; // color key for destination blt use + DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use + DDCOLORKEY ddckCKSrcBlt; // color key for source blt use + DDPIXELFORMAT ddpfPixelFormat; // pixel format description of the surface + DDSCAPS ddsCaps; // direct draw surface capabilities +} DDSURFACEDESC; + +/* + * DDSURFACEDESC2 + */ +typedef struct _DDSURFACEDESC2 +{ + DWORD dwSize; // size of the DDSURFACEDESC structure + DWORD dwFlags; // determines what fields are valid + DWORD dwHeight; // height of surface to be created + DWORD dwWidth; // width of input surface + union + { + LONG lPitch; // distance to start of next line (return value only) + DWORD dwLinearSize; // Formless late-allocated optimized surface size + } DUMMYUNIONNAMEN(1); + union + { + DWORD dwBackBufferCount; // number of back buffers requested + DWORD dwDepth; // the depth if this is a volume texture + } DUMMYUNIONNAMEN(5); + union + { + DWORD dwMipMapCount; // number of mip-map levels requestde + // dwZBufferBitDepth removed, use ddpfPixelFormat one instead + DWORD dwRefreshRate; // refresh rate (used when display mode is described) + DWORD dwSrcVBHandle; // The source used in VB::Optimize + } DUMMYUNIONNAMEN(2); + DWORD dwAlphaBitDepth; // depth of alpha buffer requested + DWORD dwReserved; // reserved + LPVOID lpSurface; // pointer to the associated surface memory + union + { + DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay use + DWORD dwEmptyFaceColor; // Physical color for empty cubemap faces + } DUMMYUNIONNAMEN(3); + DDCOLORKEY ddckCKDestBlt; // color key for destination blt use + DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use + DDCOLORKEY ddckCKSrcBlt; // color key for source blt use + union + { + DDPIXELFORMAT ddpfPixelFormat; // pixel format description of the surface + DWORD dwFVF; // vertex format description of vertex buffers + } DUMMYUNIONNAMEN(4); + DDSCAPS2 ddsCaps; // direct draw surface capabilities + DWORD dwTextureStage; // stage in multitexture cascade +} DDSURFACEDESC2; + +/* + * ddsCaps field is valid. + */ +#define DDSD_CAPS 0x00000001l // default + +/* + * dwHeight field is valid. + */ +#define DDSD_HEIGHT 0x00000002l + +/* + * dwWidth field is valid. + */ +#define DDSD_WIDTH 0x00000004l + +/* + * lPitch is valid. + */ +#define DDSD_PITCH 0x00000008l + +/* + * dwBackBufferCount is valid. + */ +#define DDSD_BACKBUFFERCOUNT 0x00000020l + +/* + * dwZBufferBitDepth is valid. (shouldnt be used in DDSURFACEDESC2) + */ +#define DDSD_ZBUFFERBITDEPTH 0x00000040l + +/* + * dwAlphaBitDepth is valid. + */ +#define DDSD_ALPHABITDEPTH 0x00000080l + + +/* + * lpSurface is valid. + */ +#define DDSD_LPSURFACE 0x00000800l + +/* + * ddpfPixelFormat is valid. + */ +#define DDSD_PIXELFORMAT 0x00001000l + +/* + * ddckCKDestOverlay is valid. + */ +#define DDSD_CKDESTOVERLAY 0x00002000l + +/* + * ddckCKDestBlt is valid. + */ +#define DDSD_CKDESTBLT 0x00004000l + +/* + * ddckCKSrcOverlay is valid. + */ +#define DDSD_CKSRCOVERLAY 0x00008000l + +/* + * ddckCKSrcBlt is valid. + */ +#define DDSD_CKSRCBLT 0x00010000l + +/* + * dwMipMapCount is valid. + */ +#define DDSD_MIPMAPCOUNT 0x00020000l + + /* + * dwRefreshRate is valid + */ +#define DDSD_REFRESHRATE 0x00040000l + +/* + * dwLinearSize is valid + */ +#define DDSD_LINEARSIZE 0x00080000l + +/* + * dwTextureStage is valid + */ +#define DDSD_TEXTURESTAGE 0x00100000l +/* + * dwFVF is valid + */ +#define DDSD_FVF 0x00200000l +/* + * dwSrcVBHandle is valid + */ +#define DDSD_SRCVBHANDLE 0x00400000l + +/* + * dwDepth is valid + */ +#define DDSD_DEPTH 0x00800000l + +/* + * All input fields are valid. + */ +#define DDSD_ALL 0x00fff9eel + +/* + * DDOPTSURFACEDESC + */ +typedef struct _DDOPTSURFACEDESC +{ + DWORD dwSize; // size of the DDOPTSURFACEDESC structure + DWORD dwFlags; // determines what fields are valid + DDSCAPS2 ddSCaps; // Common caps like: Memory type + DDOSCAPS ddOSCaps; // Common caps like: Memory type + GUID guid; // Compression technique GUID + DWORD dwCompressionRatio; // Compression ratio +} DDOPTSURFACEDESC; + +/* + * guid field is valid. + */ +#define DDOSD_GUID 0x00000001l + +/* + * dwCompressionRatio field is valid. + */ +#define DDOSD_COMPRESSION_RATIO 0x00000002l + +/* + * ddSCaps field is valid. + */ +#define DDOSD_SCAPS 0x00000004l + +/* + * ddOSCaps field is valid. + */ +#define DDOSD_OSCAPS 0x00000008l + +/* + * All input fields are valid. + */ +#define DDOSD_ALL 0x0000000fl + +/* + * The surface's optimized pixelformat is compressed + */ +#define DDOSDCAPS_OPTCOMPRESSED 0x00000001l + +/* + * The surface's optimized pixelformat is reordered + */ +#define DDOSDCAPS_OPTREORDERED 0x00000002l + +/* + * The opt surface is a monolithic mipmap + */ +#define DDOSDCAPS_MONOLITHICMIPMAP 0x00000004l + +/* + * The valid Surf caps: + * #define DDSCAPS_SYSTEMMEMORY 0x00000800l + * #define DDSCAPS_VIDEOMEMORY 0x00004000l + * #define DDSCAPS_LOCALVIDMEM 0x10000000l + * #define DDSCAPS_NONLOCALVIDMEM 0x20000000l + */ +#define DDOSDCAPS_VALIDSCAPS 0x30004800l + +/* + * The valid OptSurf caps + */ +#define DDOSDCAPS_VALIDOSCAPS 0x00000007l + + +/* + * DDCOLORCONTROL + */ +typedef struct _DDCOLORCONTROL +{ + DWORD dwSize; + DWORD dwFlags; + LONG lBrightness; + LONG lContrast; + LONG lHue; + LONG lSaturation; + LONG lSharpness; + LONG lGamma; + LONG lColorEnable; + DWORD dwReserved1; +} DDCOLORCONTROL; + + +/* + * lBrightness field is valid. + */ +#define DDCOLOR_BRIGHTNESS 0x00000001l + +/* + * lContrast field is valid. + */ +#define DDCOLOR_CONTRAST 0x00000002l + +/* + * lHue field is valid. + */ +#define DDCOLOR_HUE 0x00000004l + +/* + * lSaturation field is valid. + */ +#define DDCOLOR_SATURATION 0x00000008l + +/* + * lSharpness field is valid. + */ +#define DDCOLOR_SHARPNESS 0x00000010l + +/* + * lGamma field is valid. + */ +#define DDCOLOR_GAMMA 0x00000020l + +/* + * lColorEnable field is valid. + */ +#define DDCOLOR_COLORENABLE 0x00000040l + + + +/*============================================================================ + * + * Direct Draw Capability Flags + * + * These flags are used to describe the capabilities of a given Surface. + * All flags are bit flags. + * + *==========================================================================*/ + +/**************************************************************************** + * + * DIRECTDRAWSURFACE CAPABILITY FLAGS + * + ****************************************************************************/ + +/* + * This bit is reserved. It should not be specified. + */ +#define DDSCAPS_RESERVED1 0x00000001l + +/* + * Indicates that this surface contains alpha-only information. + * (To determine if a surface is RGBA/YUVA, the pixel format must be + * interrogated.) + */ +#define DDSCAPS_ALPHA 0x00000002l + +/* + * Indicates that this surface is a backbuffer. It is generally + * set by CreateSurface when the DDSCAPS_FLIP capability bit is set. + * It indicates that this surface is THE back buffer of a surface + * flipping structure. DirectDraw supports N surfaces in a + * surface flipping structure. Only the surface that immediately + * precedeces the DDSCAPS_FRONTBUFFER has this capability bit set. + * The other surfaces are identified as back buffers by the presence + * of the DDSCAPS_FLIP capability, their attachment order, and the + * absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER + * capabilities. The bit is sent to CreateSurface when a standalone + * back buffer is being created. This surface could be attached to + * a front buffer and/or back buffers to form a flipping surface + * structure after the CreateSurface call. See AddAttachments for + * a detailed description of the behaviors in this case. + */ +#define DDSCAPS_BACKBUFFER 0x00000004l + +/* + * Indicates a complex surface structure is being described. A + * complex surface structure results in the creation of more than + * one surface. The additional surfaces are attached to the root + * surface. The complex structure can only be destroyed by + * destroying the root. + */ +#define DDSCAPS_COMPLEX 0x00000008l + +/* + * Indicates that this surface is a part of a surface flipping structure. + * When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and + * DDSCAP_BACKBUFFER bits are not set. They are set by CreateSurface + * on the resulting creations. The dwBackBufferCount field in the + * DDSURFACEDESC structure must be set to at least 1 in order for + * the CreateSurface call to succeed. The DDSCAPS_COMPLEX capability + * must always be set with creating multiple surfaces through CreateSurface. + */ +#define DDSCAPS_FLIP 0x00000010l + +/* + * Indicates that this surface is THE front buffer of a surface flipping + * structure. It is generally set by CreateSurface when the DDSCAPS_FLIP + * capability bit is set. + * If this capability is sent to CreateSurface then a standalonw front buffer + * is created. This surface will not have the DDSCAPS_FLIP capability. + * It can be attached to other back buffers to form a flipping structure. + * See AddAttachments for a detailed description of the behaviors in this + * case. + */ +#define DDSCAPS_FRONTBUFFER 0x00000020l + +/* + * Indicates that this surface is any offscreen surface that is not an overlay, + * texture, zbuffer, front buffer, back buffer, or alpha surface. It is used + * to identify plain vanilla surfaces. + */ +#define DDSCAPS_OFFSCREENPLAIN 0x00000040l + +/* + * Indicates that this surface is an overlay. It may or may not be directly visible + * depending on whether or not it is currently being overlayed onto the primary + * surface. DDSCAPS_VISIBLE can be used to determine whether or not it is being + * overlayed at the moment. + */ +#define DDSCAPS_OVERLAY 0x00000080l + +/* + * Indicates that unique DirectDrawPalette objects can be created and + * attached to this surface. + */ +#define DDSCAPS_PALETTE 0x00000100l + +/* + * Indicates that this surface is the primary surface. The primary + * surface represents what the user is seeing at the moment. + */ +#define DDSCAPS_PRIMARYSURFACE 0x00000200l + + +/* + * This flag used to be DDSCAPS_PRIMARYSURFACELEFT, which is now + * obsolete. + */ +#define DDSCAPS_RESERVED3 0x00000400l +#define DDSCAPS_PRIMARYSURFACELEFT 0x00000000l + +/* + * Indicates that this surface memory was allocated in system memory + */ +#define DDSCAPS_SYSTEMMEMORY 0x00000800l + +/* + * Indicates that this surface can be used as a 3D texture. It does not + * indicate whether or not the surface is being used for that purpose. + */ +#define DDSCAPS_TEXTURE 0x00001000l + +/* + * Indicates that a surface may be a destination for 3D rendering. This + * bit must be set in order to query for a Direct3D Device Interface + * from this surface. + */ +#define DDSCAPS_3DDEVICE 0x00002000l + +/* + * Indicates that this surface exists in video memory. + */ +#define DDSCAPS_VIDEOMEMORY 0x00004000l + +/* + * Indicates that changes made to this surface are immediately visible. + * It is always set for the primary surface and is set for overlays while + * they are being overlayed and texture maps while they are being textured. + */ +#define DDSCAPS_VISIBLE 0x00008000l + +/* + * Indicates that only writes are permitted to the surface. Read accesses + * from the surface may or may not generate a protection fault, but the + * results of a read from this surface will not be meaningful. READ ONLY. + */ +#define DDSCAPS_WRITEONLY 0x00010000l + +/* + * Indicates that this surface is a z buffer. A z buffer does not contain + * displayable information. Instead it contains bit depth information that is + * used to determine which pixels are visible and which are obscured. + */ +#define DDSCAPS_ZBUFFER 0x00020000l + +/* + * Indicates surface will have a DC associated long term + */ +#define DDSCAPS_OWNDC 0x00040000l + +/* + * Indicates surface should be able to receive live video + */ +#define DDSCAPS_LIVEVIDEO 0x00080000l + +/* + * Indicates surface should be able to have a stream decompressed + * to it by the hardware. + */ +#define DDSCAPS_HWCODEC 0x00100000l + +/* + * Surface is a ModeX surface. + * + */ +#define DDSCAPS_MODEX 0x00200000l + +/* + * Indicates surface is one level of a mip-map. This surface will + * be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map. + * This can be done explicitly, by creating a number of surfaces and + * attaching them with AddAttachedSurface or by implicitly by CreateSurface. + * If this bit is set then DDSCAPS_TEXTURE must also be set. + */ +#define DDSCAPS_MIPMAP 0x00400000l + +/* + * This bit is reserved. It should not be specified. + */ +#define DDSCAPS_RESERVED2 0x00800000l + + +/* + * Indicates that memory for the surface is not allocated until the surface + * is loaded (via the Direct3D texture Load() function). + */ +#define DDSCAPS_ALLOCONLOAD 0x04000000l + +/* + * Indicates that the surface will recieve data from a video port. + */ +#define DDSCAPS_VIDEOPORT 0x08000000l + +/* + * Indicates that a video memory surface is resident in true, local video + * memory rather than non-local video memory. If this flag is specified then + * so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with + * DDSCAPS_NONLOCALVIDMEM. + */ +#define DDSCAPS_LOCALVIDMEM 0x10000000l + +/* + * Indicates that a video memory surface is resident in non-local video + * memory rather than true, local video memory. If this flag is specified + * then so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with + * DDSCAPS_LOCALVIDMEM. + */ +#define DDSCAPS_NONLOCALVIDMEM 0x20000000l + +/* + * Indicates that this surface is a standard VGA mode surface, and not a + * ModeX surface. (This flag will never be set in combination with the + * DDSCAPS_MODEX flag). + */ +#define DDSCAPS_STANDARDVGAMODE 0x40000000l + +/* + * Indicates that this surface will be an optimized surface. This flag is + * currently only valid in conjunction with the DDSCAPS_TEXTURE flag. The surface + * will be created without any underlying video memory until loaded. + */ +#define DDSCAPS_OPTIMIZED 0x80000000l + + + +/* + * This bit is reserved + */ +#define DDSCAPS2_RESERVED4 0x00000002L +#define DDSCAPS2_HARDWAREDEINTERLACE 0x00000000L + +/* + * Indicates to the driver that this surface will be locked very frequently + * (for procedural textures, dynamic lightmaps, etc). Surfaces with this cap + * set must also have DDSCAPS_TEXTURE. This cap cannot be used with + * DDSCAPS2_HINTSTATIC and DDSCAPS2_OPAQUE. + */ +#define DDSCAPS2_HINTDYNAMIC 0x00000004L + +/* + * Indicates to the driver that this surface can be re-ordered/retiled on + * load. This operation will not change the size of the texture. It is + * relatively fast and symmetrical, since the application may lock these + * bits (although it will take a performance hit when doing so). Surfaces + * with this cap set must also have DDSCAPS_TEXTURE. This cap cannot be + * used with DDSCAPS2_HINTDYNAMIC and DDSCAPS2_OPAQUE. + */ +#define DDSCAPS2_HINTSTATIC 0x00000008L + +/* + * Indicates that the client would like this texture surface to be managed by the + * DirectDraw/Direct3D runtime. Surfaces with this cap set must also have + * DDSCAPS_TEXTURE set. + */ +#define DDSCAPS2_TEXTUREMANAGE 0x00000010L + +/* + * These bits are reserved for internal use */ +#define DDSCAPS2_RESERVED1 0x00000020L +#define DDSCAPS2_RESERVED2 0x00000040L + +/* + * Indicates to the driver that this surface will never be locked again. + * The driver is free to optimize this surface via retiling and actual compression. + * All calls to Lock() or Blts from this surface will fail. Surfaces with this + * cap set must also have DDSCAPS_TEXTURE. This cap cannot be used with + * DDSCAPS2_HINTDYNAMIC and DDSCAPS2_HINTSTATIC. + */ +#define DDSCAPS2_OPAQUE 0x00000080L + +/* + * Applications should set this bit at CreateSurface time to indicate that they + * intend to use antialiasing. Only valid if DDSCAPS_3DDEVICE is also set. + */ +#define DDSCAPS2_HINTANTIALIASING 0x00000100L + + +/* + * This flag is used at CreateSurface time to indicate that this set of + * surfaces is a cubic environment map + */ +#define DDSCAPS2_CUBEMAP 0x00000200L + +/* + * These flags preform two functions: + * - At CreateSurface time, they define which of the six cube faces are + * required by the application. + * - After creation, each face in the cubemap will have exactly one of these + * bits set. + */ +#define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400L +#define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800L +#define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000L +#define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000L +#define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000L +#define DDSCAPS2_CUBEMAP_NEGATIVEZ 0x00008000L + +/* + * This macro may be used to specify all faces of a cube map at CreateSurface time + */ +#define DDSCAPS2_CUBEMAP_ALLFACES ( DDSCAPS2_CUBEMAP_POSITIVEX |\ + DDSCAPS2_CUBEMAP_NEGATIVEX |\ + DDSCAPS2_CUBEMAP_POSITIVEY |\ + DDSCAPS2_CUBEMAP_NEGATIVEY |\ + DDSCAPS2_CUBEMAP_POSITIVEZ |\ + DDSCAPS2_CUBEMAP_NEGATIVEZ ) + + +/* + * This flag is an additional flag which is present on mipmap sublevels from DX7 onwards + * It enables easier use of GetAttachedSurface rather than EnumAttachedSurfaces for surface + * constructs such as Cube Maps, wherein there are more than one mipmap surface attached + * to the root surface. + * This caps bit is ignored by CreateSurface + */ +#define DDSCAPS2_MIPMAPSUBLEVEL 0x00010000L + +/* This flag indicates that the texture should be managed by D3D only */ +#define DDSCAPS2_D3DTEXTUREMANAGE 0x00020000L + +/* This flag indicates that the managed surface can be safely lost */ +#define DDSCAPS2_DONOTPERSIST 0x00040000L + +/* indicates that this surface is part of a stereo flipping chain */ +#define DDSCAPS2_STEREOSURFACELEFT 0x00080000L + + +/* + * Indicates that the surface is a volume. + * Can be combined with DDSCAPS_MIPMAP to indicate a multi-level volume + */ +#define DDSCAPS2_VOLUME 0x00200000L + +/* + * Indicates that the surface may be locked multiple times by the application. + * This cap cannot be used with DDSCAPS2_OPAQUE. + */ +#define DDSCAPS2_NOTUSERLOCKABLE 0x00400000L + +/* + * Indicates that the vertex buffer data can be used to render points and + * point sprites. + */ +#define DDSCAPS2_POINTS 0x00800000L + +/* + * Indicates that the vertex buffer data can be used to render rt pactches. + */ +#define DDSCAPS2_RTPATCHES 0x01000000L + +/* + * Indicates that the vertex buffer data can be used to render n patches. + */ +#define DDSCAPS2_NPATCHES 0x02000000L + +/* + * This bit is reserved for internal use + */ +#define DDSCAPS2_RESERVED3 0x04000000L + + +/* + * Indicates that the contents of the backbuffer do not have to be preserved + * the contents of the backbuffer after they are presented. + */ +#define DDSCAPS2_DISCARDBACKBUFFER 0x10000000L + +/* + * Indicates that all surfaces in this creation chain should be given an alpha channel. + * This flag will be set on primary surface chains that may have no explicit pixel format + * (and thus take on the format of the current display mode). + * The driver should infer that all these surfaces have a format having an alpha channel. + * (e.g. assume D3DFMT_A8R8G8B8 if the display mode is x888.) + */ +#define DDSCAPS2_ENABLEALPHACHANNEL 0x20000000L + +/* + * Indicates that all surfaces in this creation chain is extended primary surface format. + * This flag will be set on extended primary surface chains that always have explicit pixel + * format and the pixel format is typically GDI (Graphics Device Interface) couldn't handle, + * thus only used with fullscreen application. (e.g. D3DFMT_A2R10G10B10 format) + */ +#define DDSCAPS2_EXTENDEDFORMATPRIMARY 0x40000000L + +/* + * Indicates that all surfaces in this creation chain is additional primary surface. + * This flag will be set on primary surface chains which must present on the adapter + * id provided on dwCaps4. Typically this will be used to create secondary primary surface + * on DualView display adapter. + */ +#define DDSCAPS2_ADDITIONALPRIMARY 0x80000000L + +/* + * This is a mask that indicates the set of bits that may be set + * at createsurface time to indicate number of samples per pixel + * when multisampling + */ +#define DDSCAPS3_MULTISAMPLE_MASK 0x0000001FL + +/* + * This is a mask that indicates the set of bits that may be set + * at createsurface time to indicate the quality level of rendering + * for the current number of samples per pixel + */ +#define DDSCAPS3_MULTISAMPLE_QUALITY_MASK 0x000000E0L +#define DDSCAPS3_MULTISAMPLE_QUALITY_SHIFT 5 + +/* + * This bit is reserved for internal use + */ +#define DDSCAPS3_RESERVED1 0x00000100L + +/* + * This bit is reserved for internal use + */ +#define DDSCAPS3_RESERVED2 0x00000200L + +/* + * This indicates whether this surface has light-weight miplevels + */ +#define DDSCAPS3_LIGHTWEIGHTMIPMAP 0x00000400L + +/* + * This indicates that the mipsublevels for this surface are auto-generated + */ +#define DDSCAPS3_AUTOGENMIPMAP 0x00000800L + +/* + * This indicates that the mipsublevels for this surface are auto-generated + */ +#define DDSCAPS3_DMAP 0x00001000L + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +/* + * This indicates that this surface is to be shared by processes + */ +#define DDSCAPS3_CREATESHAREDRESOURCE 0x00002000L + +/* + * This indicates that this surface need to be initialized before being + * shared, this bit implies that this surface is read only after initialization + * absence of this bit implies that this surface allows both read and write + */ +#define DDSCAPS3_READONLYRESOURCE 0x00004000L + +/* + * This indicates that this surface is to share an existing video memory with + * another surface created with DDSCAPS3_CREATESHAREDRESOURCE, This bit is never + * used with DDSCAPS3_CREATESHAREDRESOURCE + */ +#define DDSCAPS3_OPENSHAREDRESOURCE 0x00008000L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + + /**************************************************************************** + * + * DIRECTDRAW DRIVER CAPABILITY FLAGS + * + ****************************************************************************/ + +/* + * Display hardware has 3D acceleration. + */ +#define DDCAPS_3D 0x00000001l + +/* + * Indicates that DirectDraw will support only dest rectangles that are aligned + * on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively. + * READ ONLY. + */ +#define DDCAPS_ALIGNBOUNDARYDEST 0x00000002l + +/* + * Indicates that DirectDraw will support only source rectangles whose sizes in + * BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively. READ ONLY. + */ +#define DDCAPS_ALIGNSIZEDEST 0x00000004l +/* + * Indicates that DirectDraw will support only source rectangles that are aligned + * on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively. + * READ ONLY. + */ +#define DDCAPS_ALIGNBOUNDARYSRC 0x00000008l + +/* + * Indicates that DirectDraw will support only source rectangles whose sizes in + * BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively. READ ONLY. + */ +#define DDCAPS_ALIGNSIZESRC 0x00000010l + +/* + * Indicates that DirectDraw will create video memory surfaces that have a stride + * alignment equal to DIRECTDRAWCAPS.dwAlignStride. READ ONLY. + */ +#define DDCAPS_ALIGNSTRIDE 0x00000020l + +/* + * Display hardware is capable of blt operations. + */ +#define DDCAPS_BLT 0x00000040l + +/* + * Display hardware is capable of asynchronous blt operations. + */ +#define DDCAPS_BLTQUEUE 0x00000080l + +/* + * Display hardware is capable of color space conversions during the blt operation. + */ +#define DDCAPS_BLTFOURCC 0x00000100l + +/* + * Display hardware is capable of stretching during blt operations. + */ +#define DDCAPS_BLTSTRETCH 0x00000200l + +/* + * Display hardware is shared with GDI. + */ +#define DDCAPS_GDI 0x00000400l + +/* + * Display hardware can overlay. + */ +#define DDCAPS_OVERLAY 0x00000800l + +/* + * Set if display hardware supports overlays but can not clip them. + */ +#define DDCAPS_OVERLAYCANTCLIP 0x00001000l + +/* + * Indicates that overlay hardware is capable of color space conversions during + * the overlay operation. + */ +#define DDCAPS_OVERLAYFOURCC 0x00002000l + +/* + * Indicates that stretching can be done by the overlay hardware. + */ +#define DDCAPS_OVERLAYSTRETCH 0x00004000l + +/* + * Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces + * other than the primary surface. + */ +#define DDCAPS_PALETTE 0x00008000l + +/* + * Indicates that palette changes can be syncd with the veritcal refresh. + */ +#define DDCAPS_PALETTEVSYNC 0x00010000l + +/* + * Display hardware can return the current scan line. + */ +#define DDCAPS_READSCANLINE 0x00020000l + + +/* + * This flag used to bo DDCAPS_STEREOVIEW, which is now obsolete + */ +#define DDCAPS_RESERVED1 0x00040000l + +/* + * Display hardware is capable of generating a vertical blank interrupt. + */ +#define DDCAPS_VBI 0x00080000l + +/* + * Supports the use of z buffers with blt operations. + */ +#define DDCAPS_ZBLTS 0x00100000l + +/* + * Supports Z Ordering of overlays. + */ +#define DDCAPS_ZOVERLAYS 0x00200000l + +/* + * Supports color key + */ +#define DDCAPS_COLORKEY 0x00400000l + +/* + * Supports alpha surfaces + */ +#define DDCAPS_ALPHA 0x00800000l + +/* + * colorkey is hardware assisted(DDCAPS_COLORKEY will also be set) + */ +#define DDCAPS_COLORKEYHWASSIST 0x01000000l + +/* + * no hardware support at all + */ +#define DDCAPS_NOHARDWARE 0x02000000l + +/* + * Display hardware is capable of color fill with bltter + */ +#define DDCAPS_BLTCOLORFILL 0x04000000l + +/* + * Display hardware is bank switched, and potentially very slow at + * random access to VRAM. + */ +#define DDCAPS_BANKSWITCHED 0x08000000l + +/* + * Display hardware is capable of depth filling Z-buffers with bltter + */ +#define DDCAPS_BLTDEPTHFILL 0x10000000l + +/* + * Display hardware is capable of clipping while bltting. + */ +#define DDCAPS_CANCLIP 0x20000000l + +/* + * Display hardware is capable of clipping while stretch bltting. + */ +#define DDCAPS_CANCLIPSTRETCHED 0x40000000l + +/* + * Display hardware is capable of bltting to or from system memory + */ +#define DDCAPS_CANBLTSYSMEM 0x80000000l + + + /**************************************************************************** + * + * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2) + * + ****************************************************************************/ + +/* + * Display hardware is certified + */ +#define DDCAPS2_CERTIFIED 0x00000001l + +/* + * Driver cannot interleave 2D operations (lock and blt) to surfaces with + * Direct3D rendering operations between calls to BeginScene() and EndScene() + */ +#define DDCAPS2_NO2DDURING3DSCENE 0x00000002l + +/* + * Display hardware contains a video port + */ +#define DDCAPS2_VIDEOPORT 0x00000004l + +/* + * The overlay can be automatically flipped according to the video port + * VSYNCs, providing automatic doubled buffered display of video port + * data using an overlay + */ +#define DDCAPS2_AUTOFLIPOVERLAY 0x00000008l + +/* + * Overlay can display each field of interlaced data individually while + * it is interleaved in memory without causing jittery artifacts. + */ +#define DDCAPS2_CANBOBINTERLEAVED 0x00000010l + +/* + * Overlay can display each field of interlaced data individually while + * it is not interleaved in memory without causing jittery artifacts. + */ +#define DDCAPS2_CANBOBNONINTERLEAVED 0x00000020l + +/* + * The overlay surface contains color controls (brightness, sharpness, etc.) + */ +#define DDCAPS2_COLORCONTROLOVERLAY 0x00000040l + +/* + * The primary surface contains color controls (gamma, etc.) + */ +#define DDCAPS2_COLORCONTROLPRIMARY 0x00000080l + +/* + * RGBZ -> RGB supported for 16:16 RGB:Z + */ +#define DDCAPS2_CANDROPZ16BIT 0x00000100l + +/* + * Driver supports non-local video memory. + */ +#define DDCAPS2_NONLOCALVIDMEM 0x00000200l + +/* + * Dirver supports non-local video memory but has different capabilities for + * non-local video memory surfaces. If this bit is set then so must + * DDCAPS2_NONLOCALVIDMEM. + */ +#define DDCAPS2_NONLOCALVIDMEMCAPS 0x00000400l + +/* + * Driver neither requires nor prefers surfaces to be pagelocked when performing + * blts involving system memory surfaces + */ +#define DDCAPS2_NOPAGELOCKREQUIRED 0x00000800l + +/* + * Driver can create surfaces which are wider than the primary surface + */ +#define DDCAPS2_WIDESURFACES 0x00001000l + +/* + * Driver supports bob without using a video port by handling the + * DDFLIP_ODD and DDFLIP_EVEN flags specified in Flip. + */ +#define DDCAPS2_CANFLIPODDEVEN 0x00002000l + +/* + * Driver supports bob using hardware + */ +#define DDCAPS2_CANBOBHARDWARE 0x00004000l + +/* + * Driver supports bltting any FOURCC surface to another surface of the same FOURCC + */ +#define DDCAPS2_COPYFOURCC 0x00008000l + + +/* + * Driver supports loadable gamma ramps for the primary surface + */ +#define DDCAPS2_PRIMARYGAMMA 0x00020000l + +/* + * Driver can render in windowed mode. + */ +#define DDCAPS2_CANRENDERWINDOWED 0x00080000l + +/* + * A calibrator is available to adjust the gamma ramp according to the + * physical display properties so that the result will be identical on + * all calibrated systems. + */ +#define DDCAPS2_CANCALIBRATEGAMMA 0x00100000l + +/* + * Indicates that the driver will respond to DDFLIP_INTERVALn flags + */ +#define DDCAPS2_FLIPINTERVAL 0x00200000l + +/* + * Indicates that the driver will respond to DDFLIP_NOVSYNC + */ +#define DDCAPS2_FLIPNOVSYNC 0x00400000l + +/* + * Driver supports management of video memory, if this flag is ON, + * driver manages the texture if requested with DDSCAPS2_TEXTUREMANAGE on + * DirectX manages the texture if this flag is OFF and surface has DDSCAPS2_TEXTUREMANAGE on + */ +#define DDCAPS2_CANMANAGETEXTURE 0x00800000l + +/* + * The Direct3D texture manager uses this cap to decide whether to put managed + * surfaces in non-local video memory. If the cap is set, the texture manager will + * put managed surfaces in non-local vidmem. Drivers that cannot texture from + * local vidmem SHOULD NOT set this cap. + */ +#define DDCAPS2_TEXMANINNONLOCALVIDMEM 0x01000000l + +/* + * Indicates that the driver supports DX7 type of stereo in at least one mode (which may + * not necessarily be the current mode). Applications should use IDirectDraw7 (or higher) + * ::EnumDisplayModes and check the DDSURFACEDESC.ddsCaps.dwCaps2 field for the presence of + * DDSCAPS2_STEREOSURFACELEFT to check if a particular mode supports stereo. The application + * can also use IDirectDraw7(or higher)::GetDisplayMode to check the current mode. + */ +#define DDCAPS2_STEREO 0x02000000L + +/* + * This caps bit is intended for internal DirectDraw use. + * -It is only valid if DDCAPS2_NONLOCALVIDMEMCAPS is set. + * -If this bit is set, then DDCAPS_CANBLTSYSMEM MUST be set by the driver (and + * all the assoicated system memory blt caps must be correct). + * -It implies that the system->video blt caps in DDCAPS also apply to system to + * nonlocal blts. I.e. the dwSVBCaps, dwSVBCKeyCaps, dwSVBFXCaps and dwSVBRops + * members of DDCAPS (DDCORECAPS) are filled in correctly. + * -Any blt from system to nonlocal memory that matches these caps bits will + * be passed to the driver. + * + * NOTE: This is intended to enable the driver itself to do efficient reordering + * of textures. This is NOT meant to imply that hardware can write into AGP memory. + * This operation is not currently supported. + */ +#define DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL 0x04000000L + +/* + * was DDCAPS2_PUREHAL + */ +#define DDCAPS2_RESERVED1 0x08000000L + +/* + * Driver supports management of video memory, if this flag is ON, + * driver manages the resource if requested with DDSCAPS2_TEXTUREMANAGE on + * DirectX manages the resource if this flag is OFF and surface has DDSCAPS2_TEXTUREMANAGE on + */ +#define DDCAPS2_CANMANAGERESOURCE 0x10000000L + +/* + * Driver supports dynamic textures. This will allow the application to set + * D3DUSAGE_DYNAMIC (DDSCAPS2_HINTDYNAMIC for drivers) at texture create time. + * Video memory dynamic textures WILL be lockable by applications. It is + * expected that these locks will be very efficient (which implies that the + * driver should always maintain a linear copy, a pointer to which can be + * quickly handed out to the application). + */ +#define DDCAPS2_DYNAMICTEXTURES 0x20000000L + +/* + * Driver supports auto-generation of mipmaps. + */ +#define DDCAPS2_CANAUTOGENMIPMAP 0x40000000L + +/* D3D9Ex only -- */ +#if !defined(D3D_DISABLE_9EX) + +/* + * Driver supports sharing of cross process resouces + */ +#define DDCAPS2_CANSHARERESOURCE 0x80000000L + +#endif // !D3D_DISABLE_9EX +/* -- D3D9Ex only */ + + +/**************************************************************************** + * + * DIRECTDRAW FX ALPHA CAPABILITY FLAGS + * + ****************************************************************************/ + +/* + * Supports alpha blending around the edge of a source color keyed surface. + * For Blt. + */ +#define DDFXALPHACAPS_BLTALPHAEDGEBLEND 0x00000001l + +/* + * Supports alpha information in the pixel format. The bit depth of alpha + * information in the pixel format can be 1,2,4, or 8. The alpha value becomes + * more opaque as the alpha value increases. (0 is transparent.) + * For Blt. + */ +#define DDFXALPHACAPS_BLTALPHAPIXELS 0x00000002l + +/* + * Supports alpha information in the pixel format. The bit depth of alpha + * information in the pixel format can be 1,2,4, or 8. The alpha value + * becomes more transparent as the alpha value increases. (0 is opaque.) + * This flag can only be set if DDCAPS_ALPHA is set. + * For Blt. + */ +#define DDFXALPHACAPS_BLTALPHAPIXELSNEG 0x00000004l + +/* + * Supports alpha only surfaces. The bit depth of an alpha only surface can be + * 1,2,4, or 8. The alpha value becomes more opaque as the alpha value increases. + * (0 is transparent.) + * For Blt. + */ +#define DDFXALPHACAPS_BLTALPHASURFACES 0x00000008l + +/* + * The depth of the alpha channel data can range can be 1,2,4, or 8. + * The NEG suffix indicates that this alpha channel becomes more transparent + * as the alpha value increases. (0 is opaque.) This flag can only be set if + * DDCAPS_ALPHA is set. + * For Blt. + */ +#define DDFXALPHACAPS_BLTALPHASURFACESNEG 0x00000010l + +/* + * Supports alpha blending around the edge of a source color keyed surface. + * For Overlays. + */ +#define DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND 0x00000020l + +/* + * Supports alpha information in the pixel format. The bit depth of alpha + * information in the pixel format can be 1,2,4, or 8. The alpha value becomes + * more opaque as the alpha value increases. (0 is transparent.) + * For Overlays. + */ +#define DDFXALPHACAPS_OVERLAYALPHAPIXELS 0x00000040l + +/* + * Supports alpha information in the pixel format. The bit depth of alpha + * information in the pixel format can be 1,2,4, or 8. The alpha value + * becomes more transparent as the alpha value increases. (0 is opaque.) + * This flag can only be set if DDCAPS_ALPHA is set. + * For Overlays. + */ +#define DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG 0x00000080l + +/* + * Supports alpha only surfaces. The bit depth of an alpha only surface can be + * 1,2,4, or 8. The alpha value becomes more opaque as the alpha value increases. + * (0 is transparent.) + * For Overlays. + */ +#define DDFXALPHACAPS_OVERLAYALPHASURFACES 0x00000100l + +/* + * The depth of the alpha channel data can range can be 1,2,4, or 8. + * The NEG suffix indicates that this alpha channel becomes more transparent + * as the alpha value increases. (0 is opaque.) This flag can only be set if + * DDCAPS_ALPHA is set. + * For Overlays. + */ +#define DDFXALPHACAPS_OVERLAYALPHASURFACESNEG 0x00000200l + +#if DIRECTDRAW_VERSION < 0x0600 +#endif //DIRECTDRAW_VERSION + + +/**************************************************************************** + * + * DIRECTDRAW FX CAPABILITY FLAGS + * + ****************************************************************************/ + +/* + * Uses arithmetic operations to stretch and shrink surfaces during blt + * rather than pixel doubling techniques. Along the Y axis. + */ +#define DDFXCAPS_BLTARITHSTRETCHY 0x00000020l + +/* + * Uses arithmetic operations to stretch during blt + * rather than pixel doubling techniques. Along the Y axis. Only + * works for x1, x2, etc. + */ +#define DDFXCAPS_BLTARITHSTRETCHYN 0x00000010l + +/* + * Supports mirroring left to right in blt. + */ +#define DDFXCAPS_BLTMIRRORLEFTRIGHT 0x00000040l + +/* + * Supports mirroring top to bottom in blt. + */ +#define DDFXCAPS_BLTMIRRORUPDOWN 0x00000080l + +/* + * Supports arbitrary rotation for blts. + */ +#define DDFXCAPS_BLTROTATION 0x00000100l + +/* + * Supports 90 degree rotations for blts. + */ +#define DDFXCAPS_BLTROTATION90 0x00000200l + +/* + * DirectDraw supports arbitrary shrinking of a surface along the + * x axis (horizontal direction) for blts. + */ +#define DDFXCAPS_BLTSHRINKX 0x00000400l + +/* + * DirectDraw supports integer shrinking (1x,2x,) of a surface + * along the x axis (horizontal direction) for blts. + */ +#define DDFXCAPS_BLTSHRINKXN 0x00000800l + +/* + * DirectDraw supports arbitrary shrinking of a surface along the + * y axis (horizontal direction) for blts. + */ +#define DDFXCAPS_BLTSHRINKY 0x00001000l + +/* + * DirectDraw supports integer shrinking (1x,2x,) of a surface + * along the y axis (vertical direction) for blts. + */ +#define DDFXCAPS_BLTSHRINKYN 0x00002000l + +/* + * DirectDraw supports arbitrary stretching of a surface along the + * x axis (horizontal direction) for blts. + */ +#define DDFXCAPS_BLTSTRETCHX 0x00004000l + +/* + * DirectDraw supports integer stretching (1x,2x,) of a surface + * along the x axis (horizontal direction) for blts. + */ +#define DDFXCAPS_BLTSTRETCHXN 0x00008000l + +/* + * DirectDraw supports arbitrary stretching of a surface along the + * y axis (horizontal direction) for blts. + */ +#define DDFXCAPS_BLTSTRETCHY 0x00010000l + +/* + * DirectDraw supports integer stretching (1x,2x,) of a surface + * along the y axis (vertical direction) for blts. + */ +#define DDFXCAPS_BLTSTRETCHYN 0x00020000l + +/* + * Uses arithmetic operations to stretch and shrink surfaces during + * overlay rather than pixel doubling techniques. Along the Y axis + * for overlays. + */ +#define DDFXCAPS_OVERLAYARITHSTRETCHY 0x00040000l + +/* + * Uses arithmetic operations to stretch surfaces during + * overlay rather than pixel doubling techniques. Along the Y axis + * for overlays. Only works for x1, x2, etc. + */ +#define DDFXCAPS_OVERLAYARITHSTRETCHYN 0x00000008l + +/* + * DirectDraw supports arbitrary shrinking of a surface along the + * x axis (horizontal direction) for overlays. + */ +#define DDFXCAPS_OVERLAYSHRINKX 0x00080000l + +/* + * DirectDraw supports integer shrinking (1x,2x,) of a surface + * along the x axis (horizontal direction) for overlays. + */ +#define DDFXCAPS_OVERLAYSHRINKXN 0x00100000l + +/* + * DirectDraw supports arbitrary shrinking of a surface along the + * y axis (horizontal direction) for overlays. + */ +#define DDFXCAPS_OVERLAYSHRINKY 0x00200000l + +/* + * DirectDraw supports integer shrinking (1x,2x,) of a surface + * along the y axis (vertical direction) for overlays. + */ +#define DDFXCAPS_OVERLAYSHRINKYN 0x00400000l + +/* + * DirectDraw supports arbitrary stretching of a surface along the + * x axis (horizontal direction) for overlays. + */ +#define DDFXCAPS_OVERLAYSTRETCHX 0x00800000l + +/* + * DirectDraw supports integer stretching (1x,2x,) of a surface + * along the x axis (horizontal direction) for overlays. + */ +#define DDFXCAPS_OVERLAYSTRETCHXN 0x01000000l + +/* + * DirectDraw supports arbitrary stretching of a surface along the + * y axis (horizontal direction) for overlays. + */ +#define DDFXCAPS_OVERLAYSTRETCHY 0x02000000l + +/* + * DirectDraw supports integer stretching (1x,2x,) of a surface + * along the y axis (vertical direction) for overlays. + */ +#define DDFXCAPS_OVERLAYSTRETCHYN 0x04000000l + +/* + * DirectDraw supports mirroring of overlays across the vertical axis + */ +#define DDFXCAPS_OVERLAYMIRRORLEFTRIGHT 0x08000000l + +/* + * DirectDraw supports mirroring of overlays across the horizontal axis + */ +#define DDFXCAPS_OVERLAYMIRRORUPDOWN 0x10000000l + +/* + * DirectDraw supports deinterlacing of overlay surfaces + */ +#define DDFXCAPS_OVERLAYDEINTERLACE 0x20000000l + +/* + * Driver can do alpha blending for blits. + */ +#define DDFXCAPS_BLTALPHA 0x00000001l + + +/* + * Driver can do surface-reconstruction filtering for warped blits. + */ +#define DDFXCAPS_BLTFILTER DDFXCAPS_BLTARITHSTRETCHY + +/* + * Driver can do alpha blending for overlays. + */ +#define DDFXCAPS_OVERLAYALPHA 0x00000004l + + +/* + * Driver can do surface-reconstruction filtering for warped overlays. + */ +#define DDFXCAPS_OVERLAYFILTER DDFXCAPS_OVERLAYARITHSTRETCHY + +/**************************************************************************** + * + * DIRECTDRAW STEREO VIEW CAPABILITIES + * + ****************************************************************************/ + +/* + * This flag used to be DDSVCAPS_ENIGMA, which is now obsolete + */ + +#define DDSVCAPS_RESERVED1 0x00000001l + +/* + * This flag used to be DDSVCAPS_FLICKER, which is now obsolete + */ +#define DDSVCAPS_RESERVED2 0x00000002l + +/* + * This flag used to be DDSVCAPS_REDBLUE, which is now obsolete + */ +#define DDSVCAPS_RESERVED3 0x00000004l + +/* + * This flag used to be DDSVCAPS_SPLIT, which is now obsolete + */ +#define DDSVCAPS_RESERVED4 0x00000008l + +/* + * The stereo view is accomplished with switching technology + */ + +#define DDSVCAPS_STEREOSEQUENTIAL 0x00000010L + + + +/**************************************************************************** + * + * DIRECTDRAWPALETTE CAPABILITIES + * + ****************************************************************************/ + +/* + * Index is 4 bits. There are sixteen color entries in the palette table. + */ +#define DDPCAPS_4BIT 0x00000001l + +/* + * Index is onto a 8 bit color index. This field is only valid with the + * DDPCAPS_1BIT, DDPCAPS_2BIT or DDPCAPS_4BIT capability and the target + * surface is in 8bpp. Each color entry is one byte long and is an index + * into destination surface's 8bpp palette. + */ +#define DDPCAPS_8BITENTRIES 0x00000002l + +/* + * Index is 8 bits. There are 256 color entries in the palette table. + */ +#define DDPCAPS_8BIT 0x00000004l + +/* + * Indicates that this DIRECTDRAWPALETTE should use the palette color array + * passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE + * object. + * This flag is obsolete. DirectDraw always initializes the color array from + * the lpDDColorArray parameter. The definition remains for source-level + * compatibility. + */ +#define DDPCAPS_INITIALIZE 0x00000000l + +/* + * This palette is the one attached to the primary surface. Changing this + * table has immediate effect on the display unless DDPSETPAL_VSYNC is specified + * and supported. + */ +#define DDPCAPS_PRIMARYSURFACE 0x00000010l + +/* + * This palette is the one attached to the primary surface left. Changing + * this table has immediate effect on the display for the left eye unless + * DDPSETPAL_VSYNC is specified and supported. + */ +#define DDPCAPS_PRIMARYSURFACELEFT 0x00000020l + +/* + * This palette can have all 256 entries defined + */ +#define DDPCAPS_ALLOW256 0x00000040l + +/* + * This palette can have modifications to it synced with the monitors + * refresh rate. + */ +#define DDPCAPS_VSYNC 0x00000080l + +/* + * Index is 1 bit. There are two color entries in the palette table. + */ +#define DDPCAPS_1BIT 0x00000100l + +/* + * Index is 2 bit. There are four color entries in the palette table. + */ +#define DDPCAPS_2BIT 0x00000200l + +/* + * The peFlags member of PALETTEENTRY denotes an 8 bit alpha value + */ +#define DDPCAPS_ALPHA 0x00000400l + + +/**************************************************************************** + * + * DIRECTDRAWPALETTE SETENTRY CONSTANTS + * + ****************************************************************************/ + + +/**************************************************************************** + * + * DIRECTDRAWPALETTE GETENTRY CONSTANTS + * + ****************************************************************************/ + +/* 0 is the only legal value */ + +/**************************************************************************** + * + * DIRECTDRAWSURFACE SETPRIVATEDATA CONSTANTS + * + ****************************************************************************/ + +/* + * The passed pointer is an IUnknown ptr. The cbData argument to SetPrivateData + * must be set to sizeof(IUnknown*). DirectDraw will call AddRef through this + * pointer and Release when the private data is destroyed. This includes when + * the surface or palette is destroyed before such priovate data is destroyed. + */ +#define DDSPD_IUNKNOWNPOINTER 0x00000001L + +/* + * Private data is only valid for the current state of the object, + * as determined by the uniqueness value. + */ +#define DDSPD_VOLATILE 0x00000002L + + +/**************************************************************************** + * + * DIRECTDRAWSURFACE SETPALETTE CONSTANTS + * + ****************************************************************************/ + + +/**************************************************************************** + * + * DIRECTDRAW BITDEPTH CONSTANTS + * + * NOTE: These are only used to indicate supported bit depths. These + * are flags only, they are not to be used as an actual bit depth. The + * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual + * bit depths in a surface or for changing the display mode. + * + ****************************************************************************/ + +/* + * 1 bit per pixel. + */ +#define DDBD_1 0x00004000l + +/* + * 2 bits per pixel. + */ +#define DDBD_2 0x00002000l + +/* + * 4 bits per pixel. + */ +#define DDBD_4 0x00001000l + +/* + * 8 bits per pixel. + */ +#define DDBD_8 0x00000800l + +/* + * 16 bits per pixel. + */ +#define DDBD_16 0x00000400l + +/* + * 24 bits per pixel. + */ +#define DDBD_24 0X00000200l + +/* + * 32 bits per pixel. + */ +#define DDBD_32 0x00000100l + +/**************************************************************************** + * + * DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS + * + ****************************************************************************/ + +/* + * Set if the structure contains a color space. Not set if the structure + * contains a single color key. + */ +#define DDCKEY_COLORSPACE 0x00000001l + +/* + * Set if the structure specifies a color key or color space which is to be + * used as a destination color key for blt operations. + */ +#define DDCKEY_DESTBLT 0x00000002l + +/* + * Set if the structure specifies a color key or color space which is to be + * used as a destination color key for overlay operations. + */ +#define DDCKEY_DESTOVERLAY 0x00000004l + +/* + * Set if the structure specifies a color key or color space which is to be + * used as a source color key for blt operations. + */ +#define DDCKEY_SRCBLT 0x00000008l + +/* + * Set if the structure specifies a color key or color space which is to be + * used as a source color key for overlay operations. + */ +#define DDCKEY_SRCOVERLAY 0x00000010l + + +/**************************************************************************** + * + * DIRECTDRAW COLOR KEY CAPABILITY FLAGS + * + ****************************************************************************/ + +/* + * Supports transparent blting using a color key to identify the replaceable + * bits of the destination surface for RGB colors. + */ +#define DDCKEYCAPS_DESTBLT 0x00000001l + +/* + * Supports transparent blting using a color space to identify the replaceable + * bits of the destination surface for RGB colors. + */ +#define DDCKEYCAPS_DESTBLTCLRSPACE 0x00000002l + +/* + * Supports transparent blting using a color space to identify the replaceable + * bits of the destination surface for YUV colors. + */ +#define DDCKEYCAPS_DESTBLTCLRSPACEYUV 0x00000004l + +/* + * Supports transparent blting using a color key to identify the replaceable + * bits of the destination surface for YUV colors. + */ +#define DDCKEYCAPS_DESTBLTYUV 0x00000008l + +/* + * Supports overlaying using colorkeying of the replaceable bits of the surface + * being overlayed for RGB colors. + */ +#define DDCKEYCAPS_DESTOVERLAY 0x00000010l + +/* + * Supports a color space as the color key for the destination for RGB colors. + */ +#define DDCKEYCAPS_DESTOVERLAYCLRSPACE 0x00000020l + +/* + * Supports a color space as the color key for the destination for YUV colors. + */ +#define DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV 0x00000040l + +/* + * Supports only one active destination color key value for visible overlay + * surfaces. + */ +#define DDCKEYCAPS_DESTOVERLAYONEACTIVE 0x00000080l + +/* + * Supports overlaying using colorkeying of the replaceable bits of the + * surface being overlayed for YUV colors. + */ +#define DDCKEYCAPS_DESTOVERLAYYUV 0x00000100l + +/* + * Supports transparent blting using the color key for the source with + * this surface for RGB colors. + */ +#define DDCKEYCAPS_SRCBLT 0x00000200l + +/* + * Supports transparent blting using a color space for the source with + * this surface for RGB colors. + */ +#define DDCKEYCAPS_SRCBLTCLRSPACE 0x00000400l + +/* + * Supports transparent blting using a color space for the source with + * this surface for YUV colors. + */ +#define DDCKEYCAPS_SRCBLTCLRSPACEYUV 0x00000800l + +/* + * Supports transparent blting using the color key for the source with + * this surface for YUV colors. + */ +#define DDCKEYCAPS_SRCBLTYUV 0x00001000l + +/* + * Supports overlays using the color key for the source with this + * overlay surface for RGB colors. + */ +#define DDCKEYCAPS_SRCOVERLAY 0x00002000l + +/* + * Supports overlays using a color space as the source color key for + * the overlay surface for RGB colors. + */ +#define DDCKEYCAPS_SRCOVERLAYCLRSPACE 0x00004000l + +/* + * Supports overlays using a color space as the source color key for + * the overlay surface for YUV colors. + */ +#define DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV 0x00008000l + +/* + * Supports only one active source color key value for visible + * overlay surfaces. + */ +#define DDCKEYCAPS_SRCOVERLAYONEACTIVE 0x00010000l + +/* + * Supports overlays using the color key for the source with this + * overlay surface for YUV colors. + */ +#define DDCKEYCAPS_SRCOVERLAYYUV 0x00020000l + +/* + * there are no bandwidth trade-offs for using colorkey with an overlay + */ +#define DDCKEYCAPS_NOCOSTOVERLAY 0x00040000l + + +/**************************************************************************** + * + * DIRECTDRAW PIXELFORMAT FLAGS + * + ****************************************************************************/ + +/* + * The surface has alpha channel information in the pixel format. + */ +#define DDPF_ALPHAPIXELS 0x00000001l + +/* + * The pixel format contains alpha only information + */ +#define DDPF_ALPHA 0x00000002l + +/* + * The FourCC code is valid. + */ +#define DDPF_FOURCC 0x00000004l + +/* + * The surface is 4-bit color indexed. + */ +#define DDPF_PALETTEINDEXED4 0x00000008l + +/* + * The surface is indexed into a palette which stores indices + * into the destination surface's 8-bit palette. + */ +#define DDPF_PALETTEINDEXEDTO8 0x00000010l + +/* + * The surface is 8-bit color indexed. + */ +#define DDPF_PALETTEINDEXED8 0x00000020l + +/* + * The RGB data in the pixel format structure is valid. + */ +#define DDPF_RGB 0x00000040l + +/* + * The surface will accept pixel data in the format specified + * and compress it during the write. + */ +#define DDPF_COMPRESSED 0x00000080l + +/* + * The surface will accept RGB data and translate it during + * the write to YUV data. The format of the data to be written + * will be contained in the pixel format structure. The DDPF_RGB + * flag will be set. + */ +#define DDPF_RGBTOYUV 0x00000100l + +/* + * pixel format is YUV - YUV data in pixel format struct is valid + */ +#define DDPF_YUV 0x00000200l + +/* + * pixel format is a z buffer only surface + */ +#define DDPF_ZBUFFER 0x00000400l + +/* + * The surface is 1-bit color indexed. + */ +#define DDPF_PALETTEINDEXED1 0x00000800l + +/* + * The surface is 2-bit color indexed. + */ +#define DDPF_PALETTEINDEXED2 0x00001000l + +/* + * The surface contains Z information in the pixels + */ +#define DDPF_ZPIXELS 0x00002000l + +/* + * The surface contains stencil information along with Z + */ +#define DDPF_STENCILBUFFER 0x00004000l + +/* + * Premultiplied alpha format -- the color components have been + * premultiplied by the alpha component. + */ +#define DDPF_ALPHAPREMULT 0x00008000l + + +/* + * Luminance data in the pixel format is valid. + * Use this flag for luminance-only or luminance+alpha surfaces, + * the bit depth is then ddpf.dwLuminanceBitCount. + */ +#define DDPF_LUMINANCE 0x00020000l + +/* + * Luminance data in the pixel format is valid. + * Use this flag when hanging luminance off bumpmap surfaces, + * the bit mask for the luminance portion of the pixel is then + * ddpf.dwBumpLuminanceBitMask + */ +#define DDPF_BUMPLUMINANCE 0x00040000l + +/* + * Bump map dUdV data in the pixel format is valid. + */ +#define DDPF_BUMPDUDV 0x00080000l + + +/*=========================================================================== + * + * + * DIRECTDRAW CALLBACK FLAGS + * + * + *==========================================================================*/ + +/**************************************************************************** + * + * DIRECTDRAW ENUMSURFACES FLAGS + * + ****************************************************************************/ + +/* + * Enumerate all of the surfaces that meet the search criterion. + */ +#define DDENUMSURFACES_ALL 0x00000001l + +/* + * A search hit is a surface that matches the surface description. + */ +#define DDENUMSURFACES_MATCH 0x00000002l + +/* + * A search hit is a surface that does not match the surface description. + */ +#define DDENUMSURFACES_NOMATCH 0x00000004l + +/* + * Enumerate the first surface that can be created which meets the search criterion. + */ +#define DDENUMSURFACES_CANBECREATED 0x00000008l + +/* + * Enumerate the surfaces that already exist that meet the search criterion. + */ +#define DDENUMSURFACES_DOESEXIST 0x00000010l + + +/**************************************************************************** + * + * DIRECTDRAW SETDISPLAYMODE FLAGS + * + ****************************************************************************/ + +/* + * The desired mode is a standard VGA mode + */ +#define DDSDM_STANDARDVGAMODE 0x00000001l + + +/**************************************************************************** + * + * DIRECTDRAW ENUMDISPLAYMODES FLAGS + * + ****************************************************************************/ + +/* + * Enumerate Modes with different refresh rates. EnumDisplayModes guarantees + * that a particular mode will be enumerated only once. This flag specifies whether + * the refresh rate is taken into account when determining if a mode is unique. + */ +#define DDEDM_REFRESHRATES 0x00000001l + +/* + * Enumerate VGA modes. Specify this flag if you wish to enumerate supported VGA + * modes such as mode 0x13 in addition to the usual ModeX modes (which are always + * enumerated if the application has previously called SetCooperativeLevel with the + * DDSCL_ALLOWMODEX flag set). + */ +#define DDEDM_STANDARDVGAMODES 0x00000002L + + +/**************************************************************************** + * + * DIRECTDRAW SETCOOPERATIVELEVEL FLAGS + * + ****************************************************************************/ + +/* + * Exclusive mode owner will be responsible for the entire primary surface. + * GDI can be ignored. used with DD + */ +#define DDSCL_FULLSCREEN 0x00000001l + +/* + * allow CTRL_ALT_DEL to work while in fullscreen exclusive mode + */ +#define DDSCL_ALLOWREBOOT 0x00000002l + +/* + * prevents DDRAW from modifying the application window. + * prevents DDRAW from minimize/restore the application window on activation. + */ +#define DDSCL_NOWINDOWCHANGES 0x00000004l + +/* + * app wants to work as a regular Windows application + */ +#define DDSCL_NORMAL 0x00000008l + +/* + * app wants exclusive access + */ +#define DDSCL_EXCLUSIVE 0x00000010l + + +/* + * app can deal with non-windows display modes + */ +#define DDSCL_ALLOWMODEX 0x00000040l + +/* + * this window will receive the focus messages + */ +#define DDSCL_SETFOCUSWINDOW 0x00000080l + +/* + * this window is associated with the DDRAW object and will + * cover the screen in fullscreen mode + */ +#define DDSCL_SETDEVICEWINDOW 0x00000100l + +/* + * app wants DDRAW to create a window to be associated with the + * DDRAW object + */ +#define DDSCL_CREATEDEVICEWINDOW 0x00000200l + +/* + * App explicitly asks DDRAW/D3D to be multithread safe. This makes D3D + * take the global crtisec more frequently. + */ +#define DDSCL_MULTITHREADED 0x00000400l + +/* + * App specifies that it would like to keep the FPU set up for optimal Direct3D + * performance (single precision and exceptions disabled) so Direct3D + * does not need to explicitly set the FPU each time. This is assumed by + * default in DirectX 7. See also DDSCL_FPUPRESERVE + */ +#define DDSCL_FPUSETUP 0x00000800l + +/* + * App specifies that it needs either double precision FPU or FPU exceptions + * enabled. This makes Direct3D explicitly set the FPU state eah time it is + * called. Setting the flag will reduce Direct3D performance. The flag is + * assumed by default in DirectX 6 and earlier. See also DDSCL_FPUSETUP + */ +#define DDSCL_FPUPRESERVE 0x00001000l + + +/**************************************************************************** + * + * DIRECTDRAW BLT FLAGS + * + ****************************************************************************/ + +/* + * Use the alpha information in the pixel format or the alpha channel surface + * attached to the destination surface as the alpha channel for this blt. + */ +#define DDBLT_ALPHADEST 0x00000001l + +/* + * Use the dwConstAlphaDest field in the DDBLTFX structure as the alpha channel + * for the destination surface for this blt. + */ +#define DDBLT_ALPHADESTCONSTOVERRIDE 0x00000002l + +/* + * The NEG suffix indicates that the destination surface becomes more + * transparent as the alpha value increases. (0 is opaque) + */ +#define DDBLT_ALPHADESTNEG 0x00000004l + +/* + * Use the lpDDSAlphaDest field in the DDBLTFX structure as the alpha + * channel for the destination for this blt. + */ +#define DDBLT_ALPHADESTSURFACEOVERRIDE 0x00000008l + +/* + * Use the dwAlphaEdgeBlend field in the DDBLTFX structure as the alpha channel + * for the edges of the image that border the color key colors. + */ +#define DDBLT_ALPHAEDGEBLEND 0x00000010l + +/* + * Use the alpha information in the pixel format or the alpha channel surface + * attached to the source surface as the alpha channel for this blt. + */ +#define DDBLT_ALPHASRC 0x00000020l + +/* + * Use the dwConstAlphaSrc field in the DDBLTFX structure as the alpha channel + * for the source for this blt. + */ +#define DDBLT_ALPHASRCCONSTOVERRIDE 0x00000040l + +/* + * The NEG suffix indicates that the source surface becomes more transparent + * as the alpha value increases. (0 is opaque) + */ +#define DDBLT_ALPHASRCNEG 0x00000080l + +/* + * Use the lpDDSAlphaSrc field in the DDBLTFX structure as the alpha channel + * for the source for this blt. + */ +#define DDBLT_ALPHASRCSURFACEOVERRIDE 0x00000100l + +/* + * Do this blt asynchronously through the FIFO in the order received. If + * there is no room in the hardware FIFO fail the call. + */ +#define DDBLT_ASYNC 0x00000200l + +/* + * Uses the dwFillColor field in the DDBLTFX structure as the RGB color + * to fill the destination rectangle on the destination surface with. + */ +#define DDBLT_COLORFILL 0x00000400l + +/* + * Uses the dwDDFX field in the DDBLTFX structure to specify the effects + * to use for the blt. + */ +#define DDBLT_DDFX 0x00000800l + +/* + * Uses the dwDDROPS field in the DDBLTFX structure to specify the ROPS + * that are not part of the Win32 API. + */ +#define DDBLT_DDROPS 0x00001000l + +/* + * Use the color key associated with the destination surface. + */ +#define DDBLT_KEYDEST 0x00002000l + +/* + * Use the dckDestColorkey field in the DDBLTFX structure as the color key + * for the destination surface. + */ +#define DDBLT_KEYDESTOVERRIDE 0x00004000l + +/* + * Use the color key associated with the source surface. + */ +#define DDBLT_KEYSRC 0x00008000l + +/* + * Use the dckSrcColorkey field in the DDBLTFX structure as the color key + * for the source surface. + */ +#define DDBLT_KEYSRCOVERRIDE 0x00010000l + +/* + * Use the dwROP field in the DDBLTFX structure for the raster operation + * for this blt. These ROPs are the same as the ones defined in the Win32 API. + */ +#define DDBLT_ROP 0x00020000l + +/* + * Use the dwRotationAngle field in the DDBLTFX structure as the angle + * (specified in 1/100th of a degree) to rotate the surface. + */ +#define DDBLT_ROTATIONANGLE 0x00040000l + +/* + * Z-buffered blt using the z-buffers attached to the source and destination + * surfaces and the dwZBufferOpCode field in the DDBLTFX structure as the + * z-buffer opcode. + */ +#define DDBLT_ZBUFFER 0x00080000l + +/* + * Z-buffered blt using the dwConstDest Zfield and the dwZBufferOpCode field + * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively + * for the destination. + */ +#define DDBLT_ZBUFFERDESTCONSTOVERRIDE 0x00100000l + +/* + * Z-buffered blt using the lpDDSDestZBuffer field and the dwZBufferOpCode + * field in the DDBLTFX structure as the z-buffer and z-buffer opcode + * respectively for the destination. + */ +#define DDBLT_ZBUFFERDESTOVERRIDE 0x00200000l + +/* + * Z-buffered blt using the dwConstSrcZ field and the dwZBufferOpCode field + * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively + * for the source. + */ +#define DDBLT_ZBUFFERSRCCONSTOVERRIDE 0x00400000l + +/* + * Z-buffered blt using the lpDDSSrcZBuffer field and the dwZBufferOpCode + * field in the DDBLTFX structure as the z-buffer and z-buffer opcode + * respectively for the source. + */ +#define DDBLT_ZBUFFERSRCOVERRIDE 0x00800000l + +/* + * wait until the device is ready to handle the blt + * this will cause blt to not return DDERR_WASSTILLDRAWING + */ +#define DDBLT_WAIT 0x01000000l + +/* + * Uses the dwFillDepth field in the DDBLTFX structure as the depth value + * to fill the destination rectangle on the destination Z-buffer surface + * with. + */ +#define DDBLT_DEPTHFILL 0x02000000l + + +/* + * Return immediately (with DDERR_WASSTILLDRAWING) if the device is not + * ready to schedule the blt at the time Blt() is called. + */ +#define DDBLT_DONOTWAIT 0x08000000l + +/* + * These flags indicate a presentation blt (i.e. a blt + * that moves surface contents from an offscreen back buffer to the primary + * surface). The driver is not allowed to "queue" more than three such blts. + * The "end" of the presentation blt is indicated, since the + * blt may be clipped, in which case the runtime will call the driver with + * several blts. All blts (even if not clipped) are tagged with DDBLT_PRESENTATION + * and the last (even if not clipped) additionally with DDBLT_LAST_PRESENTATION. + * Thus the true rule is that the driver must not schedule a DDBLT_PRESENTATION + * blt if there are 3 or more DDBLT_PRESENTLAST blts in the hardware pipe. + * If there are such blts in the pipe, the driver should return DDERR_WASSTILLDRAWING + * until the oldest queued DDBLT_LAST_PRESENTATION blts has been retired (i.e. the + * pixels have been actually written to the primary surface). Once the oldest blt + * has been retired, the driver is free to schedule the current blt. + * The goal is to provide a mechanism whereby the device's hardware queue never + * gets more than 3 frames ahead of the frames being generated by the application. + * When excessive queueing occurs, applications become unusable because the application + * visibly lags user input, and such problems make windowed interactive applications impossible. + * Some drivers may not have sufficient knowledge of their hardware's FIFO to know + * when a certain blt has been retired. Such drivers should code cautiously, and + * simply not allow any frames to be queued at all. DDBLT_LAST_PRESENTATION should cause + * such drivers to return DDERR_WASSTILLDRAWING until the accelerator is completely + * finished- exactly as if the application had called Lock on the source surface + * before calling Blt. + * In other words, the driver is allowed and encouraged to + * generate as much latency as it can, but never more than 3 frames worth. + * Implementation detail: Drivers should count blts against the SOURCE surface, not + * against the primary surface. This enables multiple parallel windowed application + * to function more optimally. + * This flag is passed only to DX8 or higher drivers. + * + * APPLICATIONS DO NOT SET THESE FLAGS. THEY ARE SET BY THE DIRECTDRAW RUNTIME. + * + */ +#define DDBLT_PRESENTATION 0x10000000l +#define DDBLT_LAST_PRESENTATION 0x20000000l + +/* + * If DDBLT_EXTENDED_FLAGS is set, then the driver should re-interpret + * other flags according to the definitions that follow. + * For example, bit 0 (0x00000001L) means DDBLT_ALPHADEST, unless + * DDBLT_EXTENDED_FLAGS is also set, in which case bit 0 means + * DDBLT_EXTENDED_LINEAR_CONTENT. + * Only DirectX9 and higher drivers will be given extended blt flags. + * Only flags explicitly mentioned here should be re-interpreted. + * All other flags retain their original meanings. + * + * List of re-interpreted flags: + * + * Bit Hex value New meaning old meaning + * --------------------------------------------------------------- + * 2 0x00000004 DDBLT_EXTENDED_LINEAR_CONTENT DDBLT_ALPHADESTNEG + * 4 0x00000010 DDBLT_EXTENDED_PRESENTATION_STRETCHFACTOR DDBLT_ALPHAEDGEBLEND + * + * + * NOTE: APPLICATIONS SHOULD NOT SET THIS FLAG. THIS FLAG IS INTENDED + * FOR USE BY THE DIRECT3D RUNTIME. + */ +#define DDBLT_EXTENDED_FLAGS 0x40000000l + +/* + * EXTENDED FLAG. SEE DEFINITION OF DDBLT_EXTENDED_FLAGS. + * This flag indidcates that the source surface contains content in a + * linear color space. The driver may perform gamma correction to the + * desktop color space (i.e. sRGB, gamma 2.2) as part of this blt. + * If the device can perform such a conversion as part of the copy, + * the driver should also set D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION + * + * NOTE: APPLICATIONS SHOULD NOT SET THIS FLAG. THIS FLAG IS INTENDED + * FOR USE BY THE DIRECT3D RUNTIME. Use IDirect3DSwapChain9::Present + * and specify D3DPRESENT_LINEAR_CONTENT in order to use this functionality. + */ +#define DDBLT_EXTENDED_LINEAR_CONTENT 0x00000004l + + +/**************************************************************************** + * + * BLTFAST FLAGS + * + ****************************************************************************/ + +#define DDBLTFAST_NOCOLORKEY 0x00000000 +#define DDBLTFAST_SRCCOLORKEY 0x00000001 +#define DDBLTFAST_DESTCOLORKEY 0x00000002 +#define DDBLTFAST_WAIT 0x00000010 +#define DDBLTFAST_DONOTWAIT 0x00000020 + +/**************************************************************************** + * + * FLIP FLAGS + * + ****************************************************************************/ + +#define DDFLIP_WAIT 0x00000001L + +/* + * Indicates that the target surface contains the even field of video data. + * This flag is only valid with an overlay surface. + */ +#define DDFLIP_EVEN 0x00000002L + +/* + * Indicates that the target surface contains the odd field of video data. + * This flag is only valid with an overlay surface. + */ +#define DDFLIP_ODD 0x00000004L + +/* + * Causes DirectDraw to perform the physical flip immediately and return + * to the application. Typically, what was the front buffer but is now the back + * buffer will still be visible (depending on timing) until the next vertical + * retrace. Subsequent operations involving the two flipped surfaces will + * not check to see if the physical flip has finished (i.e. will not return + * DDERR_WASSTILLDRAWING for that reason (but may for other reasons)). + * This allows an application to perform Flips at a higher frequency than the + * monitor refresh rate, but may introduce visible artifacts. + * Only effective if DDCAPS2_FLIPNOVSYNC is set. If that bit is not set, + * DDFLIP_NOVSYNC has no effect. + */ +#define DDFLIP_NOVSYNC 0x00000008L + + +/* + * Flip Interval Flags. These flags indicate how many vertical retraces to wait between + * each flip. The default is one. DirectDraw will return DDERR_WASSTILLDRAWING for each + * surface involved in the flip until the specified number of vertical retraces has + * ocurred. Only effective if DDCAPS2_FLIPINTERVAL is set. If that bit is not set, + * DDFLIP_INTERVALn has no effect. + */ + +/* + * DirectDraw will flip on every other vertical sync + */ +#define DDFLIP_INTERVAL2 0x02000000L + + +/* + * DirectDraw will flip on every third vertical sync + */ +#define DDFLIP_INTERVAL3 0x03000000L + + +/* + * DirectDraw will flip on every fourth vertical sync + */ +#define DDFLIP_INTERVAL4 0x04000000L + +/* + * DirectDraw will flip and display a main stereo surface + */ +#define DDFLIP_STEREO 0x00000010L + +/* + * On IDirectDrawSurface7 and higher interfaces, the default is DDFLIP_WAIT. If you wish + * to override the default and use time when the accelerator is busy (as denoted by + * the DDERR_WASSTILLDRAWING return code) then use DDFLIP_DONOTWAIT. + */ +#define DDFLIP_DONOTWAIT 0x00000020L + + +/**************************************************************************** + * + * DIRECTDRAW SURFACE OVERLAY FLAGS + * + ****************************************************************************/ + +/* + * Use the alpha information in the pixel format or the alpha channel surface + * attached to the destination surface as the alpha channel for the + * destination overlay. + */ +#define DDOVER_ALPHADEST 0x00000001l + +/* + * Use the dwConstAlphaDest field in the DDOVERLAYFX structure as the + * destination alpha channel for this overlay. + */ +#define DDOVER_ALPHADESTCONSTOVERRIDE 0x00000002l + +/* + * The NEG suffix indicates that the destination surface becomes more + * transparent as the alpha value increases. + */ +#define DDOVER_ALPHADESTNEG 0x00000004l + +/* + * Use the lpDDSAlphaDest field in the DDOVERLAYFX structure as the alpha + * channel destination for this overlay. + */ +#define DDOVER_ALPHADESTSURFACEOVERRIDE 0x00000008l + +/* + * Use the dwAlphaEdgeBlend field in the DDOVERLAYFX structure as the alpha + * channel for the edges of the image that border the color key colors. + */ +#define DDOVER_ALPHAEDGEBLEND 0x00000010l + +/* + * Use the alpha information in the pixel format or the alpha channel surface + * attached to the source surface as the source alpha channel for this overlay. + */ +#define DDOVER_ALPHASRC 0x00000020l + +/* + * Use the dwConstAlphaSrc field in the DDOVERLAYFX structure as the source + * alpha channel for this overlay. + */ +#define DDOVER_ALPHASRCCONSTOVERRIDE 0x00000040l + +/* + * The NEG suffix indicates that the source surface becomes more transparent + * as the alpha value increases. + */ +#define DDOVER_ALPHASRCNEG 0x00000080l + +/* + * Use the lpDDSAlphaSrc field in the DDOVERLAYFX structure as the alpha channel + * source for this overlay. + */ +#define DDOVER_ALPHASRCSURFACEOVERRIDE 0x00000100l + +/* + * Turn this overlay off. + */ +#define DDOVER_HIDE 0x00000200l + +/* + * Use the color key associated with the destination surface. + */ +#define DDOVER_KEYDEST 0x00000400l + +/* + * Use the dckDestColorkey field in the DDOVERLAYFX structure as the color key + * for the destination surface + */ +#define DDOVER_KEYDESTOVERRIDE 0x00000800l + +/* + * Use the color key associated with the source surface. + */ +#define DDOVER_KEYSRC 0x00001000l + +/* + * Use the dckSrcColorkey field in the DDOVERLAYFX structure as the color key + * for the source surface. + */ +#define DDOVER_KEYSRCOVERRIDE 0x00002000l + +/* + * Turn this overlay on. + */ +#define DDOVER_SHOW 0x00004000l + +/* + * Add a dirty rect to an emulated overlayed surface. + */ +#define DDOVER_ADDDIRTYRECT 0x00008000l + +/* + * Redraw all dirty rects on an emulated overlayed surface. + */ +#define DDOVER_REFRESHDIRTYRECTS 0x00010000l + +/* + * Redraw the entire surface on an emulated overlayed surface. + */ +#define DDOVER_REFRESHALL 0x00020000l + + +/* + * Use the overlay FX flags to define special overlay FX + */ +#define DDOVER_DDFX 0x00080000l + +/* + * Autoflip the overlay when ever the video port autoflips + */ +#define DDOVER_AUTOFLIP 0x00100000l + +/* + * Display each field of video port data individually without + * causing any jittery artifacts + */ +#define DDOVER_BOB 0x00200000l + +/* + * Indicates that bob/weave decisions should not be overridden by other + * interfaces. + */ +#define DDOVER_OVERRIDEBOBWEAVE 0x00400000l + +/* + * Indicates that the surface memory is composed of interleaved fields. + */ +#define DDOVER_INTERLEAVED 0x00800000l + +/* + * Indicates that bob will be performed using hardware rather than + * software or emulated. + */ +#define DDOVER_BOBHARDWARE 0x01000000l + +/* + * Indicates that overlay FX structure contains valid ARGB scaling factors. + */ +#define DDOVER_ARGBSCALEFACTORS 0x02000000l + +/* + * Indicates that ARGB scaling factors can be degraded to fit driver capabilities. + */ +#define DDOVER_DEGRADEARGBSCALING 0x04000000l + + +#ifdef COMBOX_SANDBOX +#define DX_LONGHORN_PRESERVEDC +#endif + +#ifdef DX_LONGHORN_PRESERVEDC + +/**************************************************************************** + * + * DIRECTDRAWSURFACE SETSURFACEDESC FLAGS + * + ****************************************************************************/ + +/* + * The default. The GDI DC will be tore down. + */ +#define DDSETSURFACEDESC_RECREATEDC 0x00000000L // default + +/* + * The default. The GDI DC will be kept. + */ +#define DDSETSURFACEDESC_PRESERVEDC 0x00000001L + + +#endif // DX_LONGHORN_PRESERVEDC + +/**************************************************************************** + * + * DIRECTDRAWSURFACE LOCK FLAGS + * + ****************************************************************************/ + +/* + * The default. Set to indicate that Lock should return a valid memory pointer + * to the top of the specified rectangle. If no rectangle is specified then a + * pointer to the top of the surface is returned. + */ +#define DDLOCK_SURFACEMEMORYPTR 0x00000000L // default + +/* + * Set to indicate that Lock should wait until it can obtain a valid memory + * pointer before returning. If this bit is set, Lock will never return + * DDERR_WASSTILLDRAWING. + */ +#define DDLOCK_WAIT 0x00000001L + +/* + * Set if an event handle is being passed to Lock. Lock will trigger the event + * when it can return the surface memory pointer requested. + */ +#define DDLOCK_EVENT 0x00000002L + +/* + * Indicates that the surface being locked will only be read from. + */ +#define DDLOCK_READONLY 0x00000010L + +/* + * Indicates that the surface being locked will only be written to + */ +#define DDLOCK_WRITEONLY 0x00000020L + + +/* + * Indicates that a system wide lock should not be taken when this surface + * is locked. This has several advantages (cursor responsiveness, ability + * to call more Windows functions, easier debugging) when locking video + * memory surfaces. However, an application specifying this flag must + * comply with a number of conditions documented in the help file. + * Furthermore, this flag cannot be specified when locking the primary. + */ +#define DDLOCK_NOSYSLOCK 0x00000800L + +/* + * Used only with Direct3D Vertex Buffer Locks. Indicates that no vertices + * that were referred to in Draw*PrimtiveVB calls since the start of the + * frame (or the last lock without this flag) will be modified during the + * lock. This can be useful when one is only appending data to the vertex + * buffer + */ +#define DDLOCK_NOOVERWRITE 0x00001000L + +/* + * Indicates that no assumptions will be made about the contents of the + * surface or vertex buffer during this lock. + * This enables two things: + * - Direct3D or the driver may provide an alternative memory + * area as the vertex buffer. This is useful when one plans to clear the + * contents of the vertex buffer and fill in new data. + * - Drivers sometimes store surface data in a re-ordered format. + * When the application locks the surface, the driver is forced to un-re-order + * the surface data before allowing the application to see the surface contents. + * This flag is a hint to the driver that it can skip the un-re-ordering process + * since the application plans to overwrite every single pixel in the surface + * or locked rectangle (and so erase any un-re-ordered pixels anyway). + * Applications should always set this flag when they intend to overwrite the entire + * surface or locked rectangle. + */ +#define DDLOCK_DISCARDCONTENTS 0x00002000L + /* + * DDLOCK_OKTOSWAP is an older, less informative name for DDLOCK_DISCARDCONTENTS + */ +#define DDLOCK_OKTOSWAP 0x00002000L + +/* + * On IDirectDrawSurface7 and higher interfaces, the default is DDLOCK_WAIT. If you wish + * to override the default and use time when the accelerator is busy (as denoted by + * the DDERR_WASSTILLDRAWING return code) then use DDLOCK_DONOTWAIT. + */ +#define DDLOCK_DONOTWAIT 0x00004000L + +/* + * This indicates volume texture lock with front and back specified. + */ +#define DDLOCK_HASVOLUMETEXTUREBOXRECT 0x00008000L + +/* + * This indicates that the driver should not update dirty rect information for this lock. + */ +#define DDLOCK_NODIRTYUPDATE 0x00010000L + + +/**************************************************************************** + * + * DIRECTDRAWSURFACE PAGELOCK FLAGS + * + ****************************************************************************/ + +/* + * No flags defined at present + */ + + +/**************************************************************************** + * + * DIRECTDRAWSURFACE PAGEUNLOCK FLAGS + * + ****************************************************************************/ + +/* + * No flags defined at present + */ + + +/**************************************************************************** + * + * DIRECTDRAWSURFACE BLT FX FLAGS + * + ****************************************************************************/ + +/* + * If stretching, use arithmetic stretching along the Y axis for this blt. + */ +#define DDBLTFX_ARITHSTRETCHY 0x00000001l + +/* + * Do this blt mirroring the surface left to right. Spin the + * surface around its y-axis. + */ +#define DDBLTFX_MIRRORLEFTRIGHT 0x00000002l + +/* + * Do this blt mirroring the surface up and down. Spin the surface + * around its x-axis. + */ +#define DDBLTFX_MIRRORUPDOWN 0x00000004l + +/* + * Schedule this blt to avoid tearing. + */ +#define DDBLTFX_NOTEARING 0x00000008l + +/* + * Do this blt rotating the surface one hundred and eighty degrees. + */ +#define DDBLTFX_ROTATE180 0x00000010l + +/* + * Do this blt rotating the surface two hundred and seventy degrees. + */ +#define DDBLTFX_ROTATE270 0x00000020l + +/* + * Do this blt rotating the surface ninety degrees. + */ +#define DDBLTFX_ROTATE90 0x00000040l + +/* + * Do this z blt using dwZBufferLow and dwZBufferHigh as range values + * specified to limit the bits copied from the source surface. + */ +#define DDBLTFX_ZBUFFERRANGE 0x00000080l + +/* + * Do this z blt adding the dwZBufferBaseDest to each of the sources z values + * before comparing it with the desting z values. + */ +#define DDBLTFX_ZBUFFERBASEDEST 0x00000100l + +/**************************************************************************** + * + * DIRECTDRAWSURFACE OVERLAY FX FLAGS + * + ****************************************************************************/ + +/* + * If stretching, use arithmetic stretching along the Y axis for this overlay. + */ +#define DDOVERFX_ARITHSTRETCHY 0x00000001l + +/* + * Mirror the overlay across the vertical axis + */ +#define DDOVERFX_MIRRORLEFTRIGHT 0x00000002l + +/* + * Mirror the overlay across the horizontal axis + */ +#define DDOVERFX_MIRRORUPDOWN 0x00000004l + +/* + * Deinterlace the overlay, if possible + */ +#define DDOVERFX_DEINTERLACE 0x00000008l + + +/**************************************************************************** + * + * DIRECTDRAW WAITFORVERTICALBLANK FLAGS + * + ****************************************************************************/ + +/* + * return when the vertical blank interval begins + */ +#define DDWAITVB_BLOCKBEGIN 0x00000001l + +/* + * set up an event to trigger when the vertical blank begins + */ +#define DDWAITVB_BLOCKBEGINEVENT 0x00000002l + +/* + * return when the vertical blank interval ends and display begins + */ +#define DDWAITVB_BLOCKEND 0x00000004l + +/**************************************************************************** + * + * DIRECTDRAW GETFLIPSTATUS FLAGS + * + ****************************************************************************/ + +/* + * is it OK to flip now? + */ +#define DDGFS_CANFLIP 0x00000001l + +/* + * is the last flip finished? + */ +#define DDGFS_ISFLIPDONE 0x00000002l + +/**************************************************************************** + * + * DIRECTDRAW GETBLTSTATUS FLAGS + * + ****************************************************************************/ + +/* + * is it OK to blt now? + */ +#define DDGBS_CANBLT 0x00000001l + +/* + * is the blt to the surface finished? + */ +#define DDGBS_ISBLTDONE 0x00000002l + + +/**************************************************************************** + * + * DIRECTDRAW ENUMOVERLAYZORDER FLAGS + * + ****************************************************************************/ + +/* + * Enumerate overlays back to front. + */ +#define DDENUMOVERLAYZ_BACKTOFRONT 0x00000000l + +/* + * Enumerate overlays front to back + */ +#define DDENUMOVERLAYZ_FRONTTOBACK 0x00000001l + +/**************************************************************************** + * + * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS + * + ****************************************************************************/ + +/* + * Send overlay to front + */ +#define DDOVERZ_SENDTOFRONT 0x00000000l + +/* + * Send overlay to back + */ +#define DDOVERZ_SENDTOBACK 0x00000001l + +/* + * Move Overlay forward + */ +#define DDOVERZ_MOVEFORWARD 0x00000002l + +/* + * Move Overlay backward + */ +#define DDOVERZ_MOVEBACKWARD 0x00000003l + +/* + * Move Overlay in front of relative surface + */ +#define DDOVERZ_INSERTINFRONTOF 0x00000004l + +/* + * Move Overlay in back of relative surface + */ +#define DDOVERZ_INSERTINBACKOF 0x00000005l + + +/**************************************************************************** + * + * DIRECTDRAW SETGAMMARAMP FLAGS + * + ****************************************************************************/ + +/* + * Request calibrator to adjust the gamma ramp according to the physical + * properties of the display so that the result should appear identical + * on all systems. + */ +#define DDSGR_CALIBRATE 0x00000001L + + +/**************************************************************************** + * + * DIRECTDRAW STARTMODETEST FLAGS + * + ****************************************************************************/ + +/* + * Indicates that the mode being tested has passed + */ +#define DDSMT_ISTESTREQUIRED 0x00000001L + + +/**************************************************************************** + * + * DIRECTDRAW EVALUATEMODE FLAGS + * + ****************************************************************************/ + +/* + * Indicates that the mode being tested has passed + */ +#define DDEM_MODEPASSED 0x00000001L + +/* + * Indicates that the mode being tested has failed + */ +#define DDEM_MODEFAILED 0x00000002L + + +/*=========================================================================== + * + * + * DIRECTDRAW RETURN CODES + * + * The return values from DirectDraw Commands and Surface that return an HRESULT + * are codes from DirectDraw concerning the results of the action + * requested by DirectDraw. + * + *==========================================================================*/ + +/* + * Status is OK + * + * Issued by: DirectDraw Commands and all callbacks + */ +#define DD_OK S_OK +#define DD_FALSE S_FALSE + +/**************************************************************************** + * + * DIRECTDRAW ENUMCALLBACK RETURN VALUES + * + * EnumCallback returns are used to control the flow of the DIRECTDRAW and + * DIRECTDRAWSURFACE object enumerations. They can only be returned by + * enumeration callback routines. + * + ****************************************************************************/ + +/* + * stop the enumeration + */ +#define DDENUMRET_CANCEL 0 + +/* + * continue the enumeration + */ +#define DDENUMRET_OK 1 + +/**************************************************************************** + * + * DIRECTDRAW ERRORS + * + * Errors are represented by negative values and cannot be combined. + * + ****************************************************************************/ + +/* + * This object is already initialized + */ +#define DDERR_ALREADYINITIALIZED MAKE_DDHRESULT( 5 ) + +/* + * This surface can not be attached to the requested surface. + */ +#define DDERR_CANNOTATTACHSURFACE MAKE_DDHRESULT( 10 ) + +/* + * This surface can not be detached from the requested surface. + */ +#define DDERR_CANNOTDETACHSURFACE MAKE_DDHRESULT( 20 ) + +/* + * Support is currently not available. + */ +#define DDERR_CURRENTLYNOTAVAIL MAKE_DDHRESULT( 40 ) + +/* + * An exception was encountered while performing the requested operation + */ +#define DDERR_EXCEPTION MAKE_DDHRESULT( 55 ) + +/* + * Generic failure. + */ +#define DDERR_GENERIC E_FAIL + +/* + * Height of rectangle provided is not a multiple of reqd alignment + */ +#define DDERR_HEIGHTALIGN MAKE_DDHRESULT( 90 ) + +/* + * Unable to match primary surface creation request with existing + * primary surface. + */ +#define DDERR_INCOMPATIBLEPRIMARY MAKE_DDHRESULT( 95 ) + +/* + * One or more of the caps bits passed to the callback are incorrect. + */ +#define DDERR_INVALIDCAPS MAKE_DDHRESULT( 100 ) + +/* + * DirectDraw does not support provided Cliplist. + */ +#define DDERR_INVALIDCLIPLIST MAKE_DDHRESULT( 110 ) + +/* + * DirectDraw does not support the requested mode + */ +#define DDERR_INVALIDMODE MAKE_DDHRESULT( 120 ) + +/* + * DirectDraw received a pointer that was an invalid DIRECTDRAW object. + */ +#define DDERR_INVALIDOBJECT MAKE_DDHRESULT( 130 ) + +/* + * One or more of the parameters passed to the callback function are + * incorrect. + */ +#define DDERR_INVALIDPARAMS E_INVALIDARG + +/* + * pixel format was invalid as specified + */ +#define DDERR_INVALIDPIXELFORMAT MAKE_DDHRESULT( 145 ) + +/* + * Rectangle provided was invalid. + */ +#define DDERR_INVALIDRECT MAKE_DDHRESULT( 150 ) + +/* + * Operation could not be carried out because one or more surfaces are locked + */ +#define DDERR_LOCKEDSURFACES MAKE_DDHRESULT( 160 ) + +/* + * There is no 3D present. + */ +#define DDERR_NO3D MAKE_DDHRESULT( 170 ) + +/* + * Operation could not be carried out because there is no alpha accleration + * hardware present or available. + */ +#define DDERR_NOALPHAHW MAKE_DDHRESULT( 180 ) + +/* + * Operation could not be carried out because there is no stereo + * hardware present or available. + */ +#define DDERR_NOSTEREOHARDWARE MAKE_DDHRESULT( 181 ) + +/* + * Operation could not be carried out because there is no hardware + * present which supports stereo surfaces + */ +#define DDERR_NOSURFACELEFT MAKE_DDHRESULT( 182 ) + + + +/* + * no clip list available + */ +#define DDERR_NOCLIPLIST MAKE_DDHRESULT( 205 ) + +/* + * Operation could not be carried out because there is no color conversion + * hardware present or available. + */ +#define DDERR_NOCOLORCONVHW MAKE_DDHRESULT( 210 ) + +/* + * Create function called without DirectDraw object method SetCooperativeLevel + * being called. + */ +#define DDERR_NOCOOPERATIVELEVELSET MAKE_DDHRESULT( 212 ) + +/* + * Surface doesn't currently have a color key + */ +#define DDERR_NOCOLORKEY MAKE_DDHRESULT( 215 ) + +/* + * Operation could not be carried out because there is no hardware support + * of the dest color key. + */ +#define DDERR_NOCOLORKEYHW MAKE_DDHRESULT( 220 ) + +/* + * No DirectDraw support possible with current display driver + */ +#define DDERR_NODIRECTDRAWSUPPORT MAKE_DDHRESULT( 222 ) + +/* + * Operation requires the application to have exclusive mode but the + * application does not have exclusive mode. + */ +#define DDERR_NOEXCLUSIVEMODE MAKE_DDHRESULT( 225 ) + +/* + * Flipping visible surfaces is not supported. + */ +#define DDERR_NOFLIPHW MAKE_DDHRESULT( 230 ) + +/* + * There is no GDI present. + */ +#define DDERR_NOGDI MAKE_DDHRESULT( 240 ) + +/* + * Operation could not be carried out because there is no hardware present + * or available. + */ +#define DDERR_NOMIRRORHW MAKE_DDHRESULT( 250 ) + +/* + * Requested item was not found + */ +#define DDERR_NOTFOUND MAKE_DDHRESULT( 255 ) + +/* + * Operation could not be carried out because there is no overlay hardware + * present or available. + */ +#define DDERR_NOOVERLAYHW MAKE_DDHRESULT( 260 ) + +/* + * Operation could not be carried out because the source and destination + * rectangles are on the same surface and overlap each other. + */ +#define DDERR_OVERLAPPINGRECTS MAKE_DDHRESULT( 270 ) + +/* + * Operation could not be carried out because there is no appropriate raster + * op hardware present or available. + */ +#define DDERR_NORASTEROPHW MAKE_DDHRESULT( 280 ) + +/* + * Operation could not be carried out because there is no rotation hardware + * present or available. + */ +#define DDERR_NOROTATIONHW MAKE_DDHRESULT( 290 ) + +/* + * Operation could not be carried out because there is no hardware support + * for stretching + */ +#define DDERR_NOSTRETCHHW MAKE_DDHRESULT( 310 ) + +/* + * DirectDrawSurface is not in 4 bit color palette and the requested operation + * requires 4 bit color palette. + */ +#define DDERR_NOT4BITCOLOR MAKE_DDHRESULT( 316 ) + +/* + * DirectDrawSurface is not in 4 bit color index palette and the requested + * operation requires 4 bit color index palette. + */ +#define DDERR_NOT4BITCOLORINDEX MAKE_DDHRESULT( 317 ) + +/* + * DirectDraw Surface is not in 8 bit color mode and the requested operation + * requires 8 bit color. + */ +#define DDERR_NOT8BITCOLOR MAKE_DDHRESULT( 320 ) + +/* + * Operation could not be carried out because there is no texture mapping + * hardware present or available. + */ +#define DDERR_NOTEXTUREHW MAKE_DDHRESULT( 330 ) + +/* + * Operation could not be carried out because there is no hardware support + * for vertical blank synchronized operations. + */ +#define DDERR_NOVSYNCHW MAKE_DDHRESULT( 335 ) + +/* + * Operation could not be carried out because there is no hardware support + * for zbuffer blting. + */ +#define DDERR_NOZBUFFERHW MAKE_DDHRESULT( 340 ) + +/* + * Overlay surfaces could not be z layered based on their BltOrder because + * the hardware does not support z layering of overlays. + */ +#define DDERR_NOZOVERLAYHW MAKE_DDHRESULT( 350 ) + +/* + * The hardware needed for the requested operation has already been + * allocated. + */ +#define DDERR_OUTOFCAPS MAKE_DDHRESULT( 360 ) + +/* + * DirectDraw does not have enough memory to perform the operation. + */ +#define DDERR_OUTOFMEMORY E_OUTOFMEMORY + +/* + * DirectDraw does not have enough memory to perform the operation. + */ +#define DDERR_OUTOFVIDEOMEMORY MAKE_DDHRESULT( 380 ) + +/* + * hardware does not support clipped overlays + */ +#define DDERR_OVERLAYCANTCLIP MAKE_DDHRESULT( 382 ) + +/* + * Can only have ony color key active at one time for overlays + */ +#define DDERR_OVERLAYCOLORKEYONLYONEACTIVE MAKE_DDHRESULT( 384 ) + +/* + * Access to this palette is being refused because the palette is already + * locked by another thread. + */ +#define DDERR_PALETTEBUSY MAKE_DDHRESULT( 387 ) + +/* + * No src color key specified for this operation. + */ +#define DDERR_COLORKEYNOTSET MAKE_DDHRESULT( 400 ) + +/* + * This surface is already attached to the surface it is being attached to. + */ +#define DDERR_SURFACEALREADYATTACHED MAKE_DDHRESULT( 410 ) + +/* + * This surface is already a dependency of the surface it is being made a + * dependency of. + */ +#define DDERR_SURFACEALREADYDEPENDENT MAKE_DDHRESULT( 420 ) + +/* + * Access to this surface is being refused because the surface is already + * locked by another thread. + */ +#define DDERR_SURFACEBUSY MAKE_DDHRESULT( 430 ) + +/* + * Access to this surface is being refused because no driver exists + * which can supply a pointer to the surface. + * This is most likely to happen when attempting to lock the primary + * surface when no DCI provider is present. + * Will also happen on attempts to lock an optimized surface. + */ +#define DDERR_CANTLOCKSURFACE MAKE_DDHRESULT( 435 ) + +/* + * Access to Surface refused because Surface is obscured. + */ +#define DDERR_SURFACEISOBSCURED MAKE_DDHRESULT( 440 ) + +/* + * Access to this surface is being refused because the surface is gone. + * The DIRECTDRAWSURFACE object representing this surface should + * have Restore called on it. + */ +#define DDERR_SURFACELOST MAKE_DDHRESULT( 450 ) + +/* + * The requested surface is not attached. + */ +#define DDERR_SURFACENOTATTACHED MAKE_DDHRESULT( 460 ) + +/* + * Height requested by DirectDraw is too large. + */ +#define DDERR_TOOBIGHEIGHT MAKE_DDHRESULT( 470 ) + +/* + * Size requested by DirectDraw is too large -- The individual height and + * width are OK. + */ +#define DDERR_TOOBIGSIZE MAKE_DDHRESULT( 480 ) + +/* + * Width requested by DirectDraw is too large. + */ +#define DDERR_TOOBIGWIDTH MAKE_DDHRESULT( 490 ) + +/* + * Action not supported. + */ +#define DDERR_UNSUPPORTED E_NOTIMPL + +/* + * Pixel format requested is unsupported by DirectDraw + */ +#define DDERR_UNSUPPORTEDFORMAT MAKE_DDHRESULT( 510 ) + +/* + * Bitmask in the pixel format requested is unsupported by DirectDraw + */ +#define DDERR_UNSUPPORTEDMASK MAKE_DDHRESULT( 520 ) + +/* + * The specified stream contains invalid data + */ +#define DDERR_INVALIDSTREAM MAKE_DDHRESULT( 521 ) + +/* + * vertical blank is in progress + */ +#define DDERR_VERTICALBLANKINPROGRESS MAKE_DDHRESULT( 537 ) + +/* + * Informs DirectDraw that the previous Blt which is transfering information + * to or from this Surface is incomplete. + */ +#define DDERR_WASSTILLDRAWING MAKE_DDHRESULT( 540 ) + + +/* + * The specified surface type requires specification of the COMPLEX flag + */ +#define DDERR_DDSCAPSCOMPLEXREQUIRED MAKE_DDHRESULT( 542 ) + + +/* + * Rectangle provided was not horizontally aligned on reqd. boundary + */ +#define DDERR_XALIGN MAKE_DDHRESULT( 560 ) + +/* + * The GUID passed to DirectDrawCreate is not a valid DirectDraw driver + * identifier. + */ +#define DDERR_INVALIDDIRECTDRAWGUID MAKE_DDHRESULT( 561 ) + +/* + * A DirectDraw object representing this driver has already been created + * for this process. + */ +#define DDERR_DIRECTDRAWALREADYCREATED MAKE_DDHRESULT( 562 ) + +/* + * A hardware only DirectDraw object creation was attempted but the driver + * did not support any hardware. + */ +#define DDERR_NODIRECTDRAWHW MAKE_DDHRESULT( 563 ) + +/* + * this process already has created a primary surface + */ +#define DDERR_PRIMARYSURFACEALREADYEXISTS MAKE_DDHRESULT( 564 ) + +/* + * software emulation not available. + */ +#define DDERR_NOEMULATION MAKE_DDHRESULT( 565 ) + +/* + * region passed to Clipper::GetClipList is too small. + */ +#define DDERR_REGIONTOOSMALL MAKE_DDHRESULT( 566 ) + +/* + * an attempt was made to set a clip list for a clipper objec that + * is already monitoring an hwnd. + */ +#define DDERR_CLIPPERISUSINGHWND MAKE_DDHRESULT( 567 ) + +/* + * No clipper object attached to surface object + */ +#define DDERR_NOCLIPPERATTACHED MAKE_DDHRESULT( 568 ) + +/* + * Clipper notification requires an HWND or + * no HWND has previously been set as the CooperativeLevel HWND. + */ +#define DDERR_NOHWND MAKE_DDHRESULT( 569 ) + +/* + * HWND used by DirectDraw CooperativeLevel has been subclassed, + * this prevents DirectDraw from restoring state. + */ +#define DDERR_HWNDSUBCLASSED MAKE_DDHRESULT( 570 ) + +/* + * The CooperativeLevel HWND has already been set. + * It can not be reset while the process has surfaces or palettes created. + */ +#define DDERR_HWNDALREADYSET MAKE_DDHRESULT( 571 ) + +/* + * No palette object attached to this surface. + */ +#define DDERR_NOPALETTEATTACHED MAKE_DDHRESULT( 572 ) + +/* + * No hardware support for 16 or 256 color palettes. + */ +#define DDERR_NOPALETTEHW MAKE_DDHRESULT( 573 ) + +/* + * If a clipper object is attached to the source surface passed into a + * BltFast call. + */ +#define DDERR_BLTFASTCANTCLIP MAKE_DDHRESULT( 574 ) + +/* + * No blter. + */ +#define DDERR_NOBLTHW MAKE_DDHRESULT( 575 ) + +/* + * No DirectDraw ROP hardware. + */ +#define DDERR_NODDROPSHW MAKE_DDHRESULT( 576 ) + +/* + * returned when GetOverlayPosition is called on a hidden overlay + */ +#define DDERR_OVERLAYNOTVISIBLE MAKE_DDHRESULT( 577 ) + +/* + * returned when GetOverlayPosition is called on a overlay that UpdateOverlay + * has never been called on to establish a destionation. + */ +#define DDERR_NOOVERLAYDEST MAKE_DDHRESULT( 578 ) + +/* + * returned when the position of the overlay on the destionation is no longer + * legal for that destionation. + */ +#define DDERR_INVALIDPOSITION MAKE_DDHRESULT( 579 ) + +/* + * returned when an overlay member is called for a non-overlay surface + */ +#define DDERR_NOTAOVERLAYSURFACE MAKE_DDHRESULT( 580 ) + +/* + * An attempt was made to set the cooperative level when it was already + * set to exclusive. + */ +#define DDERR_EXCLUSIVEMODEALREADYSET MAKE_DDHRESULT( 581 ) + +/* + * An attempt has been made to flip a surface that is not flippable. + */ +#define DDERR_NOTFLIPPABLE MAKE_DDHRESULT( 582 ) + +/* + * Can't duplicate primary & 3D surfaces, or surfaces that are implicitly + * created. + */ +#define DDERR_CANTDUPLICATE MAKE_DDHRESULT( 583 ) + +/* + * Surface was not locked. An attempt to unlock a surface that was not + * locked at all, or by this process, has been attempted. + */ +#define DDERR_NOTLOCKED MAKE_DDHRESULT( 584 ) + +/* + * Windows can not create any more DCs, or a DC was requested for a paltte-indexed + * surface when the surface had no palette AND the display mode was not palette-indexed + * (in this case DirectDraw cannot select a proper palette into the DC) + */ +#define DDERR_CANTCREATEDC MAKE_DDHRESULT( 585 ) + +/* + * No DC was ever created for this surface. + */ +#define DDERR_NODC MAKE_DDHRESULT( 586 ) + +/* + * This surface can not be restored because it was created in a different + * mode. + */ +#define DDERR_WRONGMODE MAKE_DDHRESULT( 587 ) + +/* + * This surface can not be restored because it is an implicitly created + * surface. + */ +#define DDERR_IMPLICITLYCREATED MAKE_DDHRESULT( 588 ) + +/* + * The surface being used is not a palette-based surface + */ +#define DDERR_NOTPALETTIZED MAKE_DDHRESULT( 589 ) + + +/* + * The display is currently in an unsupported mode + */ +#define DDERR_UNSUPPORTEDMODE MAKE_DDHRESULT( 590 ) + +/* + * Operation could not be carried out because there is no mip-map + * texture mapping hardware present or available. + */ +#define DDERR_NOMIPMAPHW MAKE_DDHRESULT( 591 ) + +/* + * The requested action could not be performed because the surface was of + * the wrong type. + */ +#define DDERR_INVALIDSURFACETYPE MAKE_DDHRESULT( 592 ) + + +/* + * Device does not support optimized surfaces, therefore no video memory optimized surfaces + */ +#define DDERR_NOOPTIMIZEHW MAKE_DDHRESULT( 600 ) + +/* + * Surface is an optimized surface, but has not yet been allocated any memory + */ +#define DDERR_NOTLOADED MAKE_DDHRESULT( 601 ) + +/* + * Attempt was made to create or set a device window without first setting + * the focus window + */ +#define DDERR_NOFOCUSWINDOW MAKE_DDHRESULT( 602 ) + +/* + * Attempt was made to set a palette on a mipmap sublevel + */ +#define DDERR_NOTONMIPMAPSUBLEVEL MAKE_DDHRESULT( 603 ) + +/* + * A DC has already been returned for this surface. Only one DC can be + * retrieved per surface. + */ +#define DDERR_DCALREADYCREATED MAKE_DDHRESULT( 620 ) + +/* + * An attempt was made to allocate non-local video memory from a device + * that does not support non-local video memory. + */ +#define DDERR_NONONLOCALVIDMEM MAKE_DDHRESULT( 630 ) + +/* + * The attempt to page lock a surface failed. + */ +#define DDERR_CANTPAGELOCK MAKE_DDHRESULT( 640 ) + + +/* + * The attempt to page unlock a surface failed. + */ +#define DDERR_CANTPAGEUNLOCK MAKE_DDHRESULT( 660 ) + +/* + * An attempt was made to page unlock a surface with no outstanding page locks. + */ +#define DDERR_NOTPAGELOCKED MAKE_DDHRESULT( 680 ) + +/* + * There is more data available than the specified buffer size could hold + */ +#define DDERR_MOREDATA MAKE_DDHRESULT( 690 ) + +/* + * The data has expired and is therefore no longer valid. + */ +#define DDERR_EXPIRED MAKE_DDHRESULT( 691 ) + +/* + * The mode test has finished executing. + */ +#define DDERR_TESTFINISHED MAKE_DDHRESULT( 692 ) + +/* + * The mode test has switched to a new mode. + */ +#define DDERR_NEWMODE MAKE_DDHRESULT( 693 ) + +/* + * D3D has not yet been initialized. + */ +#define DDERR_D3DNOTINITIALIZED MAKE_DDHRESULT( 694 ) + +/* + * The video port is not active + */ +#define DDERR_VIDEONOTACTIVE MAKE_DDHRESULT( 695 ) + +/* + * The monitor does not have EDID data. + */ +#define DDERR_NOMONITORINFORMATION MAKE_DDHRESULT( 696 ) + +/* + * The driver does not enumerate display mode refresh rates. + */ +#define DDERR_NODRIVERSUPPORT MAKE_DDHRESULT( 697 ) + +/* + * Surfaces created by one direct draw device cannot be used directly by + * another direct draw device. + */ +#define DDERR_DEVICEDOESNTOWNSURFACE MAKE_DDHRESULT( 699 ) + + + +/* + * An attempt was made to invoke an interface member of a DirectDraw object + * created by CoCreateInstance() before it was initialized. + */ +#define DDERR_NOTINITIALIZED CO_E_NOTINITIALIZED + + +/* Alpha bit depth constants */ + + +#ifdef __cplusplus +}; +#endif + +#ifdef ENABLE_NAMELESS_UNION_PRAGMA +#pragma warning(default:4201) +#endif + +#endif //__DDRAW_INCLUDED__ + + diff --git a/Src/Decoder_H264_ALL/D3D/include/dinput.h b/Src/Decoder_H264_ALL/D3D/include/dinput.h new file mode 100644 index 0000000..5aac256 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dinput.h @@ -0,0 +1,4417 @@ +/**************************************************************************** + * + * Copyright (C) 1996-2000 Microsoft Corporation. All Rights Reserved. + * + * File: dinput.h + * Content: DirectInput include file + * + ****************************************************************************/ + +#ifndef __DINPUT_INCLUDED__ +#define __DINPUT_INCLUDED__ + +#ifndef DIJ_RINGZERO + +#ifdef _WIN32 +#define COM_NO_WINDOWS_H +#include +#endif + +#endif /* DIJ_RINGZERO */ + +#ifdef __cplusplus +extern "C" { +#endif + + + + + +/* + * To build applications for older versions of DirectInput + * + * #define DIRECTINPUT_VERSION [ 0x0300 | 0x0500 | 0x0700 ] + * + * before #include . By default, #include + * will produce a DirectX 8-compatible header file. + * + */ + +#define DIRECTINPUT_HEADER_VERSION 0x0800 +#ifndef DIRECTINPUT_VERSION +#define DIRECTINPUT_VERSION DIRECTINPUT_HEADER_VERSION +#pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800") +#endif + +#ifndef DIJ_RINGZERO + +/**************************************************************************** + * + * Class IDs + * + ****************************************************************************/ + +DEFINE_GUID(CLSID_DirectInput, 0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(CLSID_DirectInputDevice, 0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); + +DEFINE_GUID(CLSID_DirectInput8, 0x25E609E4,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(CLSID_DirectInputDevice8,0x25E609E5,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); + +/**************************************************************************** + * + * Interfaces + * + ****************************************************************************/ + +DEFINE_GUID(IID_IDirectInputA, 0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInputW, 0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInput2A, 0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInput2W, 0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInput7A, 0x9A4CB684,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); +DEFINE_GUID(IID_IDirectInput7W, 0x9A4CB685,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); +DEFINE_GUID(IID_IDirectInput8A, 0xBF798030,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00); +DEFINE_GUID(IID_IDirectInput8W, 0xBF798031,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00); +DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInputDevice2A,0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInputDevice2W,0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInputDevice7A,0x57D7C6BC,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); +DEFINE_GUID(IID_IDirectInputDevice7W,0x57D7C6BD,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); +DEFINE_GUID(IID_IDirectInputDevice8A,0x54D41080,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79); +DEFINE_GUID(IID_IDirectInputDevice8W,0x54D41081,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79); +DEFINE_GUID(IID_IDirectInputEffect, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); + +/**************************************************************************** + * + * Predefined object types + * + ****************************************************************************/ + +DEFINE_GUID(GUID_XAxis, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_YAxis, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_ZAxis, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_RxAxis, 0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_RyAxis, 0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_RzAxis, 0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_Slider, 0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); + +DEFINE_GUID(GUID_Button, 0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_Key, 0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); + +DEFINE_GUID(GUID_POV, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); + +DEFINE_GUID(GUID_Unknown, 0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); + +/**************************************************************************** + * + * Predefined product GUIDs + * + ****************************************************************************/ + +DEFINE_GUID(GUID_SysMouse, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_SysKeyboard,0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_Joystick ,0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_SysMouseEm, 0x6F1D2B80,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_SysMouseEm2,0x6F1D2B81,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_SysKeyboardEm, 0x6F1D2B82,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(GUID_SysKeyboardEm2,0x6F1D2B83,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); + +/**************************************************************************** + * + * Predefined force feedback effects + * + ****************************************************************************/ + +DEFINE_GUID(GUID_ConstantForce, 0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_RampForce, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_Square, 0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_Sine, 0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_Triangle, 0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_SawtoothUp, 0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_SawtoothDown, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_Spring, 0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_Damper, 0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_Inertia, 0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_Friction, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(GUID_CustomForce, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); + +#endif /* DIJ_RINGZERO */ + +/**************************************************************************** + * + * Interfaces and Structures... + * + ****************************************************************************/ + +#if(DIRECTINPUT_VERSION >= 0x0500) + +/**************************************************************************** + * + * IDirectInputEffect + * + ****************************************************************************/ + +#define DIEFT_ALL 0x00000000 + +#define DIEFT_CONSTANTFORCE 0x00000001 +#define DIEFT_RAMPFORCE 0x00000002 +#define DIEFT_PERIODIC 0x00000003 +#define DIEFT_CONDITION 0x00000004 +#define DIEFT_CUSTOMFORCE 0x00000005 +#define DIEFT_HARDWARE 0x000000FF +#define DIEFT_FFATTACK 0x00000200 +#define DIEFT_FFFADE 0x00000400 +#define DIEFT_SATURATION 0x00000800 +#define DIEFT_POSNEGCOEFFICIENTS 0x00001000 +#define DIEFT_POSNEGSATURATION 0x00002000 +#define DIEFT_DEADBAND 0x00004000 +#define DIEFT_STARTDELAY 0x00008000 +#define DIEFT_GETTYPE(n) LOBYTE(n) + +#define DI_DEGREES 100 +#define DI_FFNOMINALMAX 10000 +#define DI_SECONDS 1000000 + +typedef struct DICONSTANTFORCE { + LONG lMagnitude; +} DICONSTANTFORCE, *LPDICONSTANTFORCE; +typedef const DICONSTANTFORCE *LPCDICONSTANTFORCE; + +typedef struct DIRAMPFORCE { + LONG lStart; + LONG lEnd; +} DIRAMPFORCE, *LPDIRAMPFORCE; +typedef const DIRAMPFORCE *LPCDIRAMPFORCE; + +typedef struct DIPERIODIC { + DWORD dwMagnitude; + LONG lOffset; + DWORD dwPhase; + DWORD dwPeriod; +} DIPERIODIC, *LPDIPERIODIC; +typedef const DIPERIODIC *LPCDIPERIODIC; + +typedef struct DICONDITION { + LONG lOffset; + LONG lPositiveCoefficient; + LONG lNegativeCoefficient; + DWORD dwPositiveSaturation; + DWORD dwNegativeSaturation; + LONG lDeadBand; +} DICONDITION, *LPDICONDITION; +typedef const DICONDITION *LPCDICONDITION; + +typedef struct DICUSTOMFORCE { + DWORD cChannels; + DWORD dwSamplePeriod; + DWORD cSamples; + LPLONG rglForceData; +} DICUSTOMFORCE, *LPDICUSTOMFORCE; +typedef const DICUSTOMFORCE *LPCDICUSTOMFORCE; + + +typedef struct DIENVELOPE { + DWORD dwSize; /* sizeof(DIENVELOPE) */ + DWORD dwAttackLevel; + DWORD dwAttackTime; /* Microseconds */ + DWORD dwFadeLevel; + DWORD dwFadeTime; /* Microseconds */ +} DIENVELOPE, *LPDIENVELOPE; +typedef const DIENVELOPE *LPCDIENVELOPE; + + +/* This structure is defined for DirectX 5.0 compatibility */ +typedef struct DIEFFECT_DX5 { + DWORD dwSize; /* sizeof(DIEFFECT_DX5) */ + DWORD dwFlags; /* DIEFF_* */ + DWORD dwDuration; /* Microseconds */ + DWORD dwSamplePeriod; /* Microseconds */ + DWORD dwGain; + DWORD dwTriggerButton; /* or DIEB_NOTRIGGER */ + DWORD dwTriggerRepeatInterval; /* Microseconds */ + DWORD cAxes; /* Number of axes */ + LPDWORD rgdwAxes; /* Array of axes */ + LPLONG rglDirection; /* Array of directions */ + LPDIENVELOPE lpEnvelope; /* Optional */ + DWORD cbTypeSpecificParams; /* Size of params */ + LPVOID lpvTypeSpecificParams; /* Pointer to params */ +} DIEFFECT_DX5, *LPDIEFFECT_DX5; +typedef const DIEFFECT_DX5 *LPCDIEFFECT_DX5; + +typedef struct DIEFFECT { + DWORD dwSize; /* sizeof(DIEFFECT) */ + DWORD dwFlags; /* DIEFF_* */ + DWORD dwDuration; /* Microseconds */ + DWORD dwSamplePeriod; /* Microseconds */ + DWORD dwGain; + DWORD dwTriggerButton; /* or DIEB_NOTRIGGER */ + DWORD dwTriggerRepeatInterval; /* Microseconds */ + DWORD cAxes; /* Number of axes */ + LPDWORD rgdwAxes; /* Array of axes */ + LPLONG rglDirection; /* Array of directions */ + LPDIENVELOPE lpEnvelope; /* Optional */ + DWORD cbTypeSpecificParams; /* Size of params */ + LPVOID lpvTypeSpecificParams; /* Pointer to params */ +#if(DIRECTINPUT_VERSION >= 0x0600) + DWORD dwStartDelay; /* Microseconds */ +#endif /* DIRECTINPUT_VERSION >= 0x0600 */ +} DIEFFECT, *LPDIEFFECT; +typedef DIEFFECT DIEFFECT_DX6; +typedef LPDIEFFECT LPDIEFFECT_DX6; +typedef const DIEFFECT *LPCDIEFFECT; + + +#if(DIRECTINPUT_VERSION >= 0x0700) +#ifndef DIJ_RINGZERO +typedef struct DIFILEEFFECT{ + DWORD dwSize; + GUID GuidEffect; + LPCDIEFFECT lpDiEffect; + CHAR szFriendlyName[MAX_PATH]; +}DIFILEEFFECT, *LPDIFILEEFFECT; +typedef const DIFILEEFFECT *LPCDIFILEEFFECT; +typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSINFILECALLBACK)(LPCDIFILEEFFECT , LPVOID); +#endif /* DIJ_RINGZERO */ +#endif /* DIRECTINPUT_VERSION >= 0x0700 */ + +#define DIEFF_OBJECTIDS 0x00000001 +#define DIEFF_OBJECTOFFSETS 0x00000002 +#define DIEFF_CARTESIAN 0x00000010 +#define DIEFF_POLAR 0x00000020 +#define DIEFF_SPHERICAL 0x00000040 + +#define DIEP_DURATION 0x00000001 +#define DIEP_SAMPLEPERIOD 0x00000002 +#define DIEP_GAIN 0x00000004 +#define DIEP_TRIGGERBUTTON 0x00000008 +#define DIEP_TRIGGERREPEATINTERVAL 0x00000010 +#define DIEP_AXES 0x00000020 +#define DIEP_DIRECTION 0x00000040 +#define DIEP_ENVELOPE 0x00000080 +#define DIEP_TYPESPECIFICPARAMS 0x00000100 +#if(DIRECTINPUT_VERSION >= 0x0600) +#define DIEP_STARTDELAY 0x00000200 +#define DIEP_ALLPARAMS_DX5 0x000001FF +#define DIEP_ALLPARAMS 0x000003FF +#else /* DIRECTINPUT_VERSION < 0x0600 */ +#define DIEP_ALLPARAMS 0x000001FF +#endif /* DIRECTINPUT_VERSION < 0x0600 */ +#define DIEP_START 0x20000000 +#define DIEP_NORESTART 0x40000000 +#define DIEP_NODOWNLOAD 0x80000000 +#define DIEB_NOTRIGGER 0xFFFFFFFF + +#define DIES_SOLO 0x00000001 +#define DIES_NODOWNLOAD 0x80000000 + +#define DIEGES_PLAYING 0x00000001 +#define DIEGES_EMULATED 0x00000002 + +typedef struct DIEFFESCAPE { + DWORD dwSize; + DWORD dwCommand; + LPVOID lpvInBuffer; + DWORD cbInBuffer; + LPVOID lpvOutBuffer; + DWORD cbOutBuffer; +} DIEFFESCAPE, *LPDIEFFESCAPE; + +#ifndef DIJ_RINGZERO + +#undef INTERFACE +#define INTERFACE IDirectInputEffect + +DECLARE_INTERFACE_(IDirectInputEffect, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputEffect methods ***/ + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; + STDMETHOD(GetEffectGuid)(THIS_ LPGUID) PURE; + STDMETHOD(GetParameters)(THIS_ LPDIEFFECT,DWORD) PURE; + STDMETHOD(SetParameters)(THIS_ LPCDIEFFECT,DWORD) PURE; + STDMETHOD(Start)(THIS_ DWORD,DWORD) PURE; + STDMETHOD(Stop)(THIS) PURE; + STDMETHOD(GetEffectStatus)(THIS_ LPDWORD) PURE; + STDMETHOD(Download)(THIS) PURE; + STDMETHOD(Unload)(THIS) PURE; + STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; +}; + +typedef struct IDirectInputEffect *LPDIRECTINPUTEFFECT; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputEffect_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputEffect_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputEffect_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputEffect_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirectInputEffect_GetEffectGuid(p,a) (p)->lpVtbl->GetEffectGuid(p,a) +#define IDirectInputEffect_GetParameters(p,a,b) (p)->lpVtbl->GetParameters(p,a,b) +#define IDirectInputEffect_SetParameters(p,a,b) (p)->lpVtbl->SetParameters(p,a,b) +#define IDirectInputEffect_Start(p,a,b) (p)->lpVtbl->Start(p,a,b) +#define IDirectInputEffect_Stop(p) (p)->lpVtbl->Stop(p) +#define IDirectInputEffect_GetEffectStatus(p,a) (p)->lpVtbl->GetEffectStatus(p,a) +#define IDirectInputEffect_Download(p) (p)->lpVtbl->Download(p) +#define IDirectInputEffect_Unload(p) (p)->lpVtbl->Unload(p) +#define IDirectInputEffect_Escape(p,a) (p)->lpVtbl->Escape(p,a) +#else +#define IDirectInputEffect_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputEffect_AddRef(p) (p)->AddRef() +#define IDirectInputEffect_Release(p) (p)->Release() +#define IDirectInputEffect_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirectInputEffect_GetEffectGuid(p,a) (p)->GetEffectGuid(a) +#define IDirectInputEffect_GetParameters(p,a,b) (p)->GetParameters(a,b) +#define IDirectInputEffect_SetParameters(p,a,b) (p)->SetParameters(a,b) +#define IDirectInputEffect_Start(p,a,b) (p)->Start(a,b) +#define IDirectInputEffect_Stop(p) (p)->Stop() +#define IDirectInputEffect_GetEffectStatus(p,a) (p)->GetEffectStatus(a) +#define IDirectInputEffect_Download(p) (p)->Download() +#define IDirectInputEffect_Unload(p) (p)->Unload() +#define IDirectInputEffect_Escape(p,a) (p)->Escape(a) +#endif + +#endif /* DIJ_RINGZERO */ + +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ + +/**************************************************************************** + * + * IDirectInputDevice + * + ****************************************************************************/ + +#if DIRECTINPUT_VERSION <= 0x700 +#define DIDEVTYPE_DEVICE 1 +#define DIDEVTYPE_MOUSE 2 +#define DIDEVTYPE_KEYBOARD 3 +#define DIDEVTYPE_JOYSTICK 4 + +#else +#define DI8DEVCLASS_ALL 0 +#define DI8DEVCLASS_DEVICE 1 +#define DI8DEVCLASS_POINTER 2 +#define DI8DEVCLASS_KEYBOARD 3 +#define DI8DEVCLASS_GAMECTRL 4 + +#define DI8DEVTYPE_DEVICE 0x11 +#define DI8DEVTYPE_MOUSE 0x12 +#define DI8DEVTYPE_KEYBOARD 0x13 +#define DI8DEVTYPE_JOYSTICK 0x14 +#define DI8DEVTYPE_GAMEPAD 0x15 +#define DI8DEVTYPE_DRIVING 0x16 +#define DI8DEVTYPE_FLIGHT 0x17 +#define DI8DEVTYPE_1STPERSON 0x18 +#define DI8DEVTYPE_DEVICECTRL 0x19 +#define DI8DEVTYPE_SCREENPOINTER 0x1A +#define DI8DEVTYPE_REMOTE 0x1B +#define DI8DEVTYPE_SUPPLEMENTAL 0x1C +#endif /* DIRECTINPUT_VERSION <= 0x700 */ + +#define DIDEVTYPE_HID 0x00010000 + +#if DIRECTINPUT_VERSION <= 0x700 +#define DIDEVTYPEMOUSE_UNKNOWN 1 +#define DIDEVTYPEMOUSE_TRADITIONAL 2 +#define DIDEVTYPEMOUSE_FINGERSTICK 3 +#define DIDEVTYPEMOUSE_TOUCHPAD 4 +#define DIDEVTYPEMOUSE_TRACKBALL 5 + +#define DIDEVTYPEKEYBOARD_UNKNOWN 0 +#define DIDEVTYPEKEYBOARD_PCXT 1 +#define DIDEVTYPEKEYBOARD_OLIVETTI 2 +#define DIDEVTYPEKEYBOARD_PCAT 3 +#define DIDEVTYPEKEYBOARD_PCENH 4 +#define DIDEVTYPEKEYBOARD_NOKIA1050 5 +#define DIDEVTYPEKEYBOARD_NOKIA9140 6 +#define DIDEVTYPEKEYBOARD_NEC98 7 +#define DIDEVTYPEKEYBOARD_NEC98LAPTOP 8 +#define DIDEVTYPEKEYBOARD_NEC98106 9 +#define DIDEVTYPEKEYBOARD_JAPAN106 10 +#define DIDEVTYPEKEYBOARD_JAPANAX 11 +#define DIDEVTYPEKEYBOARD_J3100 12 + +#define DIDEVTYPEJOYSTICK_UNKNOWN 1 +#define DIDEVTYPEJOYSTICK_TRADITIONAL 2 +#define DIDEVTYPEJOYSTICK_FLIGHTSTICK 3 +#define DIDEVTYPEJOYSTICK_GAMEPAD 4 +#define DIDEVTYPEJOYSTICK_RUDDER 5 +#define DIDEVTYPEJOYSTICK_WHEEL 6 +#define DIDEVTYPEJOYSTICK_HEADTRACKER 7 + +#else +#define DI8DEVTYPEMOUSE_UNKNOWN 1 +#define DI8DEVTYPEMOUSE_TRADITIONAL 2 +#define DI8DEVTYPEMOUSE_FINGERSTICK 3 +#define DI8DEVTYPEMOUSE_TOUCHPAD 4 +#define DI8DEVTYPEMOUSE_TRACKBALL 5 +#define DI8DEVTYPEMOUSE_ABSOLUTE 6 + +#define DI8DEVTYPEKEYBOARD_UNKNOWN 0 +#define DI8DEVTYPEKEYBOARD_PCXT 1 +#define DI8DEVTYPEKEYBOARD_OLIVETTI 2 +#define DI8DEVTYPEKEYBOARD_PCAT 3 +#define DI8DEVTYPEKEYBOARD_PCENH 4 +#define DI8DEVTYPEKEYBOARD_NOKIA1050 5 +#define DI8DEVTYPEKEYBOARD_NOKIA9140 6 +#define DI8DEVTYPEKEYBOARD_NEC98 7 +#define DI8DEVTYPEKEYBOARD_NEC98LAPTOP 8 +#define DI8DEVTYPEKEYBOARD_NEC98106 9 +#define DI8DEVTYPEKEYBOARD_JAPAN106 10 +#define DI8DEVTYPEKEYBOARD_JAPANAX 11 +#define DI8DEVTYPEKEYBOARD_J3100 12 + +#define DI8DEVTYPE_LIMITEDGAMESUBTYPE 1 + +#define DI8DEVTYPEJOYSTICK_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE +#define DI8DEVTYPEJOYSTICK_STANDARD 2 + +#define DI8DEVTYPEGAMEPAD_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE +#define DI8DEVTYPEGAMEPAD_STANDARD 2 +#define DI8DEVTYPEGAMEPAD_TILT 3 + +#define DI8DEVTYPEDRIVING_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE +#define DI8DEVTYPEDRIVING_COMBINEDPEDALS 2 +#define DI8DEVTYPEDRIVING_DUALPEDALS 3 +#define DI8DEVTYPEDRIVING_THREEPEDALS 4 +#define DI8DEVTYPEDRIVING_HANDHELD 5 + +#define DI8DEVTYPEFLIGHT_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE +#define DI8DEVTYPEFLIGHT_STICK 2 +#define DI8DEVTYPEFLIGHT_YOKE 3 +#define DI8DEVTYPEFLIGHT_RC 4 + +#define DI8DEVTYPE1STPERSON_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE +#define DI8DEVTYPE1STPERSON_UNKNOWN 2 +#define DI8DEVTYPE1STPERSON_SIXDOF 3 +#define DI8DEVTYPE1STPERSON_SHOOTER 4 + +#define DI8DEVTYPESCREENPTR_UNKNOWN 2 +#define DI8DEVTYPESCREENPTR_LIGHTGUN 3 +#define DI8DEVTYPESCREENPTR_LIGHTPEN 4 +#define DI8DEVTYPESCREENPTR_TOUCH 5 + +#define DI8DEVTYPEREMOTE_UNKNOWN 2 + +#define DI8DEVTYPEDEVICECTRL_UNKNOWN 2 +#define DI8DEVTYPEDEVICECTRL_COMMSSELECTION 3 +#define DI8DEVTYPEDEVICECTRL_COMMSSELECTION_HARDWIRED 4 + +#define DI8DEVTYPESUPPLEMENTAL_UNKNOWN 2 +#define DI8DEVTYPESUPPLEMENTAL_2NDHANDCONTROLLER 3 +#define DI8DEVTYPESUPPLEMENTAL_HEADTRACKER 4 +#define DI8DEVTYPESUPPLEMENTAL_HANDTRACKER 5 +#define DI8DEVTYPESUPPLEMENTAL_SHIFTSTICKGATE 6 +#define DI8DEVTYPESUPPLEMENTAL_SHIFTER 7 +#define DI8DEVTYPESUPPLEMENTAL_THROTTLE 8 +#define DI8DEVTYPESUPPLEMENTAL_SPLITTHROTTLE 9 +#define DI8DEVTYPESUPPLEMENTAL_COMBINEDPEDALS 10 +#define DI8DEVTYPESUPPLEMENTAL_DUALPEDALS 11 +#define DI8DEVTYPESUPPLEMENTAL_THREEPEDALS 12 +#define DI8DEVTYPESUPPLEMENTAL_RUDDERPEDALS 13 +#endif /* DIRECTINPUT_VERSION <= 0x700 */ + +#define GET_DIDEVICE_TYPE(dwDevType) LOBYTE(dwDevType) +#define GET_DIDEVICE_SUBTYPE(dwDevType) HIBYTE(dwDevType) + +#if(DIRECTINPUT_VERSION >= 0x0500) +/* This structure is defined for DirectX 3.0 compatibility */ +typedef struct DIDEVCAPS_DX3 { + DWORD dwSize; + DWORD dwFlags; + DWORD dwDevType; + DWORD dwAxes; + DWORD dwButtons; + DWORD dwPOVs; +} DIDEVCAPS_DX3, *LPDIDEVCAPS_DX3; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ + +typedef struct DIDEVCAPS { + DWORD dwSize; + DWORD dwFlags; + DWORD dwDevType; + DWORD dwAxes; + DWORD dwButtons; + DWORD dwPOVs; +#if(DIRECTINPUT_VERSION >= 0x0500) + DWORD dwFFSamplePeriod; + DWORD dwFFMinTimeResolution; + DWORD dwFirmwareRevision; + DWORD dwHardwareRevision; + DWORD dwFFDriverVersion; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +} DIDEVCAPS, *LPDIDEVCAPS; + +#define DIDC_ATTACHED 0x00000001 +#define DIDC_POLLEDDEVICE 0x00000002 +#define DIDC_EMULATED 0x00000004 +#define DIDC_POLLEDDATAFORMAT 0x00000008 +#if(DIRECTINPUT_VERSION >= 0x0500) +#define DIDC_FORCEFEEDBACK 0x00000100 +#define DIDC_FFATTACK 0x00000200 +#define DIDC_FFFADE 0x00000400 +#define DIDC_SATURATION 0x00000800 +#define DIDC_POSNEGCOEFFICIENTS 0x00001000 +#define DIDC_POSNEGSATURATION 0x00002000 +#define DIDC_DEADBAND 0x00004000 +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +#define DIDC_STARTDELAY 0x00008000 +#if(DIRECTINPUT_VERSION >= 0x050a) +#define DIDC_ALIAS 0x00010000 +#define DIDC_PHANTOM 0x00020000 +#endif /* DIRECTINPUT_VERSION >= 0x050a */ +#if(DIRECTINPUT_VERSION >= 0x0800) +#define DIDC_HIDDEN 0x00040000 +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +#define DIDFT_ALL 0x00000000 + +#define DIDFT_RELAXIS 0x00000001 +#define DIDFT_ABSAXIS 0x00000002 +#define DIDFT_AXIS 0x00000003 + +#define DIDFT_PSHBUTTON 0x00000004 +#define DIDFT_TGLBUTTON 0x00000008 +#define DIDFT_BUTTON 0x0000000C + +#define DIDFT_POV 0x00000010 +#define DIDFT_COLLECTION 0x00000040 +#define DIDFT_NODATA 0x00000080 + +#define DIDFT_ANYINSTANCE 0x00FFFF00 +#define DIDFT_INSTANCEMASK DIDFT_ANYINSTANCE +#define DIDFT_MAKEINSTANCE(n) ((WORD)(n) << 8) +#define DIDFT_GETTYPE(n) LOBYTE(n) +#define DIDFT_GETINSTANCE(n) LOWORD((n) >> 8) +#define DIDFT_FFACTUATOR 0x01000000 +#define DIDFT_FFEFFECTTRIGGER 0x02000000 +#if(DIRECTINPUT_VERSION >= 0x050a) +#define DIDFT_OUTPUT 0x10000000 +#define DIDFT_VENDORDEFINED 0x04000000 +#define DIDFT_ALIAS 0x08000000 +#endif /* DIRECTINPUT_VERSION >= 0x050a */ +#ifndef DIDFT_OPTIONAL +#define DIDFT_OPTIONAL 0x80000000 +#endif + +#define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8) +#define DIDFT_NOCOLLECTION 0x00FFFF00 + +#ifndef DIJ_RINGZERO + +typedef struct _DIOBJECTDATAFORMAT { + const GUID *pguid; + DWORD dwOfs; + DWORD dwType; + DWORD dwFlags; +} DIOBJECTDATAFORMAT, *LPDIOBJECTDATAFORMAT; +typedef const DIOBJECTDATAFORMAT *LPCDIOBJECTDATAFORMAT; + +typedef struct _DIDATAFORMAT { + DWORD dwSize; + DWORD dwObjSize; + DWORD dwFlags; + DWORD dwDataSize; + DWORD dwNumObjs; + LPDIOBJECTDATAFORMAT rgodf; +} DIDATAFORMAT, *LPDIDATAFORMAT; +typedef const DIDATAFORMAT *LPCDIDATAFORMAT; + +#define DIDF_ABSAXIS 0x00000001 +#define DIDF_RELAXIS 0x00000002 + +#ifdef __cplusplus +extern "C" { +#endif +extern const DIDATAFORMAT c_dfDIMouse; + +#if(DIRECTINPUT_VERSION >= 0x0700) +extern const DIDATAFORMAT c_dfDIMouse2; +#endif /* DIRECTINPUT_VERSION >= 0x0700 */ + +extern const DIDATAFORMAT c_dfDIKeyboard; + +#if(DIRECTINPUT_VERSION >= 0x0500) +extern const DIDATAFORMAT c_dfDIJoystick; +extern const DIDATAFORMAT c_dfDIJoystick2; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ + +#ifdef __cplusplus +}; +#endif + + +#if DIRECTINPUT_VERSION > 0x0700 + +typedef struct _DIACTIONA { + UINT_PTR uAppData; + DWORD dwSemantic; + OPTIONAL DWORD dwFlags; + OPTIONAL union { + LPCSTR lptszActionName; + UINT uResIdString; + }; + OPTIONAL GUID guidInstance; + OPTIONAL DWORD dwObjID; + OPTIONAL DWORD dwHow; +} DIACTIONA, *LPDIACTIONA ; +typedef struct _DIACTIONW { + UINT_PTR uAppData; + DWORD dwSemantic; + OPTIONAL DWORD dwFlags; + OPTIONAL union { + LPCWSTR lptszActionName; + UINT uResIdString; + }; + OPTIONAL GUID guidInstance; + OPTIONAL DWORD dwObjID; + OPTIONAL DWORD dwHow; +} DIACTIONW, *LPDIACTIONW ; +#ifdef UNICODE +typedef DIACTIONW DIACTION; +typedef LPDIACTIONW LPDIACTION; +#else +typedef DIACTIONA DIACTION; +typedef LPDIACTIONA LPDIACTION; +#endif // UNICODE + +typedef const DIACTIONA *LPCDIACTIONA; +typedef const DIACTIONW *LPCDIACTIONW; +#ifdef UNICODE +typedef DIACTIONW DIACTION; +typedef LPCDIACTIONW LPCDIACTION; +#else +typedef DIACTIONA DIACTION; +typedef LPCDIACTIONA LPCDIACTION; +#endif // UNICODE +typedef const DIACTION *LPCDIACTION; + + +#define DIA_FORCEFEEDBACK 0x00000001 +#define DIA_APPMAPPED 0x00000002 +#define DIA_APPNOMAP 0x00000004 +#define DIA_NORANGE 0x00000008 +#define DIA_APPFIXED 0x00000010 + +#define DIAH_UNMAPPED 0x00000000 +#define DIAH_USERCONFIG 0x00000001 +#define DIAH_APPREQUESTED 0x00000002 +#define DIAH_HWAPP 0x00000004 +#define DIAH_HWDEFAULT 0x00000008 +#define DIAH_DEFAULT 0x00000020 +#define DIAH_ERROR 0x80000000 + +typedef struct _DIACTIONFORMATA { + DWORD dwSize; + DWORD dwActionSize; + DWORD dwDataSize; + DWORD dwNumActions; + LPDIACTIONA rgoAction; + GUID guidActionMap; + DWORD dwGenre; + DWORD dwBufferSize; + OPTIONAL LONG lAxisMin; + OPTIONAL LONG lAxisMax; + OPTIONAL HINSTANCE hInstString; + FILETIME ftTimeStamp; + DWORD dwCRC; + CHAR tszActionMap[MAX_PATH]; +} DIACTIONFORMATA, *LPDIACTIONFORMATA; +typedef struct _DIACTIONFORMATW { + DWORD dwSize; + DWORD dwActionSize; + DWORD dwDataSize; + DWORD dwNumActions; + LPDIACTIONW rgoAction; + GUID guidActionMap; + DWORD dwGenre; + DWORD dwBufferSize; + OPTIONAL LONG lAxisMin; + OPTIONAL LONG lAxisMax; + OPTIONAL HINSTANCE hInstString; + FILETIME ftTimeStamp; + DWORD dwCRC; + WCHAR tszActionMap[MAX_PATH]; +} DIACTIONFORMATW, *LPDIACTIONFORMATW; +#ifdef UNICODE +typedef DIACTIONFORMATW DIACTIONFORMAT; +typedef LPDIACTIONFORMATW LPDIACTIONFORMAT; +#else +typedef DIACTIONFORMATA DIACTIONFORMAT; +typedef LPDIACTIONFORMATA LPDIACTIONFORMAT; +#endif // UNICODE +typedef const DIACTIONFORMATA *LPCDIACTIONFORMATA; +typedef const DIACTIONFORMATW *LPCDIACTIONFORMATW; +#ifdef UNICODE +typedef DIACTIONFORMATW DIACTIONFORMAT; +typedef LPCDIACTIONFORMATW LPCDIACTIONFORMAT; +#else +typedef DIACTIONFORMATA DIACTIONFORMAT; +typedef LPCDIACTIONFORMATA LPCDIACTIONFORMAT; +#endif // UNICODE +typedef const DIACTIONFORMAT *LPCDIACTIONFORMAT; + +#define DIAFTS_NEWDEVICELOW 0xFFFFFFFF +#define DIAFTS_NEWDEVICEHIGH 0xFFFFFFFF +#define DIAFTS_UNUSEDDEVICELOW 0x00000000 +#define DIAFTS_UNUSEDDEVICEHIGH 0x00000000 + +#define DIDBAM_DEFAULT 0x00000000 +#define DIDBAM_PRESERVE 0x00000001 +#define DIDBAM_INITIALIZE 0x00000002 +#define DIDBAM_HWDEFAULTS 0x00000004 + +#define DIDSAM_DEFAULT 0x00000000 +#define DIDSAM_NOUSER 0x00000001 +#define DIDSAM_FORCESAVE 0x00000002 + +#define DICD_DEFAULT 0x00000000 +#define DICD_EDIT 0x00000001 + +/* + * The following definition is normally defined in d3dtypes.h + */ +#ifndef D3DCOLOR_DEFINED +typedef DWORD D3DCOLOR; +#define D3DCOLOR_DEFINED +#endif + +typedef struct _DICOLORSET{ + DWORD dwSize; + D3DCOLOR cTextFore; + D3DCOLOR cTextHighlight; + D3DCOLOR cCalloutLine; + D3DCOLOR cCalloutHighlight; + D3DCOLOR cBorder; + D3DCOLOR cControlFill; + D3DCOLOR cHighlightFill; + D3DCOLOR cAreaFill; +} DICOLORSET, *LPDICOLORSET; +typedef const DICOLORSET *LPCDICOLORSET; + + +typedef struct _DICONFIGUREDEVICESPARAMSA{ + DWORD dwSize; + DWORD dwcUsers; + LPSTR lptszUserNames; + DWORD dwcFormats; + LPDIACTIONFORMATA lprgFormats; + HWND hwnd; + DICOLORSET dics; + IUnknown FAR * lpUnkDDSTarget; +} DICONFIGUREDEVICESPARAMSA, *LPDICONFIGUREDEVICESPARAMSA; +typedef struct _DICONFIGUREDEVICESPARAMSW{ + DWORD dwSize; + DWORD dwcUsers; + LPWSTR lptszUserNames; + DWORD dwcFormats; + LPDIACTIONFORMATW lprgFormats; + HWND hwnd; + DICOLORSET dics; + IUnknown FAR * lpUnkDDSTarget; +} DICONFIGUREDEVICESPARAMSW, *LPDICONFIGUREDEVICESPARAMSW; +#ifdef UNICODE +typedef DICONFIGUREDEVICESPARAMSW DICONFIGUREDEVICESPARAMS; +typedef LPDICONFIGUREDEVICESPARAMSW LPDICONFIGUREDEVICESPARAMS; +#else +typedef DICONFIGUREDEVICESPARAMSA DICONFIGUREDEVICESPARAMS; +typedef LPDICONFIGUREDEVICESPARAMSA LPDICONFIGUREDEVICESPARAMS; +#endif // UNICODE +typedef const DICONFIGUREDEVICESPARAMSA *LPCDICONFIGUREDEVICESPARAMSA; +typedef const DICONFIGUREDEVICESPARAMSW *LPCDICONFIGUREDEVICESPARAMSW; +#ifdef UNICODE +typedef DICONFIGUREDEVICESPARAMSW DICONFIGUREDEVICESPARAMS; +typedef LPCDICONFIGUREDEVICESPARAMSW LPCDICONFIGUREDEVICESPARAMS; +#else +typedef DICONFIGUREDEVICESPARAMSA DICONFIGUREDEVICESPARAMS; +typedef LPCDICONFIGUREDEVICESPARAMSA LPCDICONFIGUREDEVICESPARAMS; +#endif // UNICODE +typedef const DICONFIGUREDEVICESPARAMS *LPCDICONFIGUREDEVICESPARAMS; + + +#define DIDIFT_CONFIGURATION 0x00000001 +#define DIDIFT_OVERLAY 0x00000002 + +#define DIDAL_CENTERED 0x00000000 +#define DIDAL_LEFTALIGNED 0x00000001 +#define DIDAL_RIGHTALIGNED 0x00000002 +#define DIDAL_MIDDLE 0x00000000 +#define DIDAL_TOPALIGNED 0x00000004 +#define DIDAL_BOTTOMALIGNED 0x00000008 + +typedef struct _DIDEVICEIMAGEINFOA { + CHAR tszImagePath[MAX_PATH]; + DWORD dwFlags; + // These are valid if DIDIFT_OVERLAY is present in dwFlags. + DWORD dwViewID; + RECT rcOverlay; + DWORD dwObjID; + DWORD dwcValidPts; + POINT rgptCalloutLine[5]; + RECT rcCalloutRect; + DWORD dwTextAlign; +} DIDEVICEIMAGEINFOA, *LPDIDEVICEIMAGEINFOA; +typedef struct _DIDEVICEIMAGEINFOW { + WCHAR tszImagePath[MAX_PATH]; + DWORD dwFlags; + // These are valid if DIDIFT_OVERLAY is present in dwFlags. + DWORD dwViewID; + RECT rcOverlay; + DWORD dwObjID; + DWORD dwcValidPts; + POINT rgptCalloutLine[5]; + RECT rcCalloutRect; + DWORD dwTextAlign; +} DIDEVICEIMAGEINFOW, *LPDIDEVICEIMAGEINFOW; +#ifdef UNICODE +typedef DIDEVICEIMAGEINFOW DIDEVICEIMAGEINFO; +typedef LPDIDEVICEIMAGEINFOW LPDIDEVICEIMAGEINFO; +#else +typedef DIDEVICEIMAGEINFOA DIDEVICEIMAGEINFO; +typedef LPDIDEVICEIMAGEINFOA LPDIDEVICEIMAGEINFO; +#endif // UNICODE +typedef const DIDEVICEIMAGEINFOA *LPCDIDEVICEIMAGEINFOA; +typedef const DIDEVICEIMAGEINFOW *LPCDIDEVICEIMAGEINFOW; +#ifdef UNICODE +typedef DIDEVICEIMAGEINFOW DIDEVICEIMAGEINFO; +typedef LPCDIDEVICEIMAGEINFOW LPCDIDEVICEIMAGEINFO; +#else +typedef DIDEVICEIMAGEINFOA DIDEVICEIMAGEINFO; +typedef LPCDIDEVICEIMAGEINFOA LPCDIDEVICEIMAGEINFO; +#endif // UNICODE +typedef const DIDEVICEIMAGEINFO *LPCDIDEVICEIMAGEINFO; + +typedef struct _DIDEVICEIMAGEINFOHEADERA { + DWORD dwSize; + DWORD dwSizeImageInfo; + DWORD dwcViews; + DWORD dwcButtons; + DWORD dwcAxes; + DWORD dwcPOVs; + DWORD dwBufferSize; + DWORD dwBufferUsed; + LPDIDEVICEIMAGEINFOA lprgImageInfoArray; +} DIDEVICEIMAGEINFOHEADERA, *LPDIDEVICEIMAGEINFOHEADERA; +typedef struct _DIDEVICEIMAGEINFOHEADERW { + DWORD dwSize; + DWORD dwSizeImageInfo; + DWORD dwcViews; + DWORD dwcButtons; + DWORD dwcAxes; + DWORD dwcPOVs; + DWORD dwBufferSize; + DWORD dwBufferUsed; + LPDIDEVICEIMAGEINFOW lprgImageInfoArray; +} DIDEVICEIMAGEINFOHEADERW, *LPDIDEVICEIMAGEINFOHEADERW; +#ifdef UNICODE +typedef DIDEVICEIMAGEINFOHEADERW DIDEVICEIMAGEINFOHEADER; +typedef LPDIDEVICEIMAGEINFOHEADERW LPDIDEVICEIMAGEINFOHEADER; +#else +typedef DIDEVICEIMAGEINFOHEADERA DIDEVICEIMAGEINFOHEADER; +typedef LPDIDEVICEIMAGEINFOHEADERA LPDIDEVICEIMAGEINFOHEADER; +#endif // UNICODE +typedef const DIDEVICEIMAGEINFOHEADERA *LPCDIDEVICEIMAGEINFOHEADERA; +typedef const DIDEVICEIMAGEINFOHEADERW *LPCDIDEVICEIMAGEINFOHEADERW; +#ifdef UNICODE +typedef DIDEVICEIMAGEINFOHEADERW DIDEVICEIMAGEINFOHEADER; +typedef LPCDIDEVICEIMAGEINFOHEADERW LPCDIDEVICEIMAGEINFOHEADER; +#else +typedef DIDEVICEIMAGEINFOHEADERA DIDEVICEIMAGEINFOHEADER; +typedef LPCDIDEVICEIMAGEINFOHEADERA LPCDIDEVICEIMAGEINFOHEADER; +#endif // UNICODE +typedef const DIDEVICEIMAGEINFOHEADER *LPCDIDEVICEIMAGEINFOHEADER; + +#endif /* DIRECTINPUT_VERSION > 0x0700 */ + +#if(DIRECTINPUT_VERSION >= 0x0500) +/* These structures are defined for DirectX 3.0 compatibility */ + +typedef struct DIDEVICEOBJECTINSTANCE_DX3A { + DWORD dwSize; + GUID guidType; + DWORD dwOfs; + DWORD dwType; + DWORD dwFlags; + CHAR tszName[MAX_PATH]; +} DIDEVICEOBJECTINSTANCE_DX3A, *LPDIDEVICEOBJECTINSTANCE_DX3A; +typedef struct DIDEVICEOBJECTINSTANCE_DX3W { + DWORD dwSize; + GUID guidType; + DWORD dwOfs; + DWORD dwType; + DWORD dwFlags; + WCHAR tszName[MAX_PATH]; +} DIDEVICEOBJECTINSTANCE_DX3W, *LPDIDEVICEOBJECTINSTANCE_DX3W; +#ifdef UNICODE +typedef DIDEVICEOBJECTINSTANCE_DX3W DIDEVICEOBJECTINSTANCE_DX3; +typedef LPDIDEVICEOBJECTINSTANCE_DX3W LPDIDEVICEOBJECTINSTANCE_DX3; +#else +typedef DIDEVICEOBJECTINSTANCE_DX3A DIDEVICEOBJECTINSTANCE_DX3; +typedef LPDIDEVICEOBJECTINSTANCE_DX3A LPDIDEVICEOBJECTINSTANCE_DX3; +#endif // UNICODE +typedef const DIDEVICEOBJECTINSTANCE_DX3A *LPCDIDEVICEOBJECTINSTANCE_DX3A; +typedef const DIDEVICEOBJECTINSTANCE_DX3W *LPCDIDEVICEOBJECTINSTANCE_DX3W; +typedef const DIDEVICEOBJECTINSTANCE_DX3 *LPCDIDEVICEOBJECTINSTANCE_DX3; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ + +typedef struct DIDEVICEOBJECTINSTANCEA { + DWORD dwSize; + GUID guidType; + DWORD dwOfs; + DWORD dwType; + DWORD dwFlags; + CHAR tszName[MAX_PATH]; +#if(DIRECTINPUT_VERSION >= 0x0500) + DWORD dwFFMaxForce; + DWORD dwFFForceResolution; + WORD wCollectionNumber; + WORD wDesignatorIndex; + WORD wUsagePage; + WORD wUsage; + DWORD dwDimension; + WORD wExponent; + WORD wReportId; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +} DIDEVICEOBJECTINSTANCEA, *LPDIDEVICEOBJECTINSTANCEA; +typedef struct DIDEVICEOBJECTINSTANCEW { + DWORD dwSize; + GUID guidType; + DWORD dwOfs; + DWORD dwType; + DWORD dwFlags; + WCHAR tszName[MAX_PATH]; +#if(DIRECTINPUT_VERSION >= 0x0500) + DWORD dwFFMaxForce; + DWORD dwFFForceResolution; + WORD wCollectionNumber; + WORD wDesignatorIndex; + WORD wUsagePage; + WORD wUsage; + DWORD dwDimension; + WORD wExponent; + WORD wReportId; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +} DIDEVICEOBJECTINSTANCEW, *LPDIDEVICEOBJECTINSTANCEW; +#ifdef UNICODE +typedef DIDEVICEOBJECTINSTANCEW DIDEVICEOBJECTINSTANCE; +typedef LPDIDEVICEOBJECTINSTANCEW LPDIDEVICEOBJECTINSTANCE; +#else +typedef DIDEVICEOBJECTINSTANCEA DIDEVICEOBJECTINSTANCE; +typedef LPDIDEVICEOBJECTINSTANCEA LPDIDEVICEOBJECTINSTANCE; +#endif // UNICODE +typedef const DIDEVICEOBJECTINSTANCEA *LPCDIDEVICEOBJECTINSTANCEA; +typedef const DIDEVICEOBJECTINSTANCEW *LPCDIDEVICEOBJECTINSTANCEW; +typedef const DIDEVICEOBJECTINSTANCE *LPCDIDEVICEOBJECTINSTANCE; + +typedef BOOL (FAR PASCAL * LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA, LPVOID); +typedef BOOL (FAR PASCAL * LPDIENUMDEVICEOBJECTSCALLBACKW)(LPCDIDEVICEOBJECTINSTANCEW, LPVOID); +#ifdef UNICODE +#define LPDIENUMDEVICEOBJECTSCALLBACK LPDIENUMDEVICEOBJECTSCALLBACKW +#else +#define LPDIENUMDEVICEOBJECTSCALLBACK LPDIENUMDEVICEOBJECTSCALLBACKA +#endif // !UNICODE + +#if(DIRECTINPUT_VERSION >= 0x0500) +#define DIDOI_FFACTUATOR 0x00000001 +#define DIDOI_FFEFFECTTRIGGER 0x00000002 +#define DIDOI_POLLED 0x00008000 +#define DIDOI_ASPECTPOSITION 0x00000100 +#define DIDOI_ASPECTVELOCITY 0x00000200 +#define DIDOI_ASPECTACCEL 0x00000300 +#define DIDOI_ASPECTFORCE 0x00000400 +#define DIDOI_ASPECTMASK 0x00000F00 +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +#if(DIRECTINPUT_VERSION >= 0x050a) +#define DIDOI_GUIDISUSAGE 0x00010000 +#endif /* DIRECTINPUT_VERSION >= 0x050a */ + +typedef struct DIPROPHEADER { + DWORD dwSize; + DWORD dwHeaderSize; + DWORD dwObj; + DWORD dwHow; +} DIPROPHEADER, *LPDIPROPHEADER; +typedef const DIPROPHEADER *LPCDIPROPHEADER; + +#define DIPH_DEVICE 0 +#define DIPH_BYOFFSET 1 +#define DIPH_BYID 2 +#if(DIRECTINPUT_VERSION >= 0x050a) +#define DIPH_BYUSAGE 3 +#endif /* DIRECTINPUT_VERSION >= 0x050a */ + +#if(DIRECTINPUT_VERSION >= 0x050a) +#define DIMAKEUSAGEDWORD(UsagePage, Usage) \ + (DWORD)MAKELONG(Usage, UsagePage) +#endif /* DIRECTINPUT_VERSION >= 0x050a */ + +typedef struct DIPROPDWORD { + DIPROPHEADER diph; + DWORD dwData; +} DIPROPDWORD, *LPDIPROPDWORD; +typedef const DIPROPDWORD *LPCDIPROPDWORD; + +#if(DIRECTINPUT_VERSION >= 0x0800) +typedef struct DIPROPPOINTER { + DIPROPHEADER diph; + UINT_PTR uData; +} DIPROPPOINTER, *LPDIPROPPOINTER; +typedef const DIPROPPOINTER *LPCDIPROPPOINTER; +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +typedef struct DIPROPRANGE { + DIPROPHEADER diph; + LONG lMin; + LONG lMax; +} DIPROPRANGE, *LPDIPROPRANGE; +typedef const DIPROPRANGE *LPCDIPROPRANGE; + +#define DIPROPRANGE_NOMIN ((LONG)0x80000000) +#define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF) + +#if(DIRECTINPUT_VERSION >= 0x050a) +typedef struct DIPROPCAL { + DIPROPHEADER diph; + LONG lMin; + LONG lCenter; + LONG lMax; +} DIPROPCAL, *LPDIPROPCAL; +typedef const DIPROPCAL *LPCDIPROPCAL; + +typedef struct DIPROPCALPOV { + DIPROPHEADER diph; + LONG lMin[5]; + LONG lMax[5]; +} DIPROPCALPOV, *LPDIPROPCALPOV; +typedef const DIPROPCALPOV *LPCDIPROPCALPOV; + +typedef struct DIPROPGUIDANDPATH { + DIPROPHEADER diph; + GUID guidClass; + WCHAR wszPath[MAX_PATH]; +} DIPROPGUIDANDPATH, *LPDIPROPGUIDANDPATH; +typedef const DIPROPGUIDANDPATH *LPCDIPROPGUIDANDPATH; + +typedef struct DIPROPSTRING { + DIPROPHEADER diph; + WCHAR wsz[MAX_PATH]; +} DIPROPSTRING, *LPDIPROPSTRING; +typedef const DIPROPSTRING *LPCDIPROPSTRING; + +#endif /* DIRECTINPUT_VERSION >= 0x050a */ + +#if(DIRECTINPUT_VERSION >= 0x0800) +#define MAXCPOINTSNUM 8 + +typedef struct _CPOINT +{ + LONG lP; // raw value + DWORD dwLog; // logical_value / max_logical_value * 10000 +} CPOINT, *PCPOINT; + +typedef struct DIPROPCPOINTS { + DIPROPHEADER diph; + DWORD dwCPointsNum; + CPOINT cp[MAXCPOINTSNUM]; +} DIPROPCPOINTS, *LPDIPROPCPOINTS; +typedef const DIPROPCPOINTS *LPCDIPROPCPOINTS; +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + + +#ifdef __cplusplus +#define MAKEDIPROP(prop) (*(const GUID *)(prop)) +#else +#define MAKEDIPROP(prop) ((REFGUID)(prop)) +#endif + +#define DIPROP_BUFFERSIZE MAKEDIPROP(1) + +#define DIPROP_AXISMODE MAKEDIPROP(2) + +#define DIPROPAXISMODE_ABS 0 +#define DIPROPAXISMODE_REL 1 + +#define DIPROP_GRANULARITY MAKEDIPROP(3) + +#define DIPROP_RANGE MAKEDIPROP(4) + +#define DIPROP_DEADZONE MAKEDIPROP(5) + +#define DIPROP_SATURATION MAKEDIPROP(6) + +#define DIPROP_FFGAIN MAKEDIPROP(7) + +#define DIPROP_FFLOAD MAKEDIPROP(8) + +#define DIPROP_AUTOCENTER MAKEDIPROP(9) + +#define DIPROPAUTOCENTER_OFF 0 +#define DIPROPAUTOCENTER_ON 1 + +#define DIPROP_CALIBRATIONMODE MAKEDIPROP(10) + +#define DIPROPCALIBRATIONMODE_COOKED 0 +#define DIPROPCALIBRATIONMODE_RAW 1 + +#if(DIRECTINPUT_VERSION >= 0x050a) +#define DIPROP_CALIBRATION MAKEDIPROP(11) + +#define DIPROP_GUIDANDPATH MAKEDIPROP(12) + +#define DIPROP_INSTANCENAME MAKEDIPROP(13) + +#define DIPROP_PRODUCTNAME MAKEDIPROP(14) +#endif /* DIRECTINPUT_VERSION >= 0x050a */ + +#if(DIRECTINPUT_VERSION >= 0x05b2) +#define DIPROP_JOYSTICKID MAKEDIPROP(15) + +#define DIPROP_GETPORTDISPLAYNAME MAKEDIPROP(16) + +#endif /* DIRECTINPUT_VERSION >= 0x05b2 */ + +#if(DIRECTINPUT_VERSION >= 0x0700) +#define DIPROP_PHYSICALRANGE MAKEDIPROP(18) + +#define DIPROP_LOGICALRANGE MAKEDIPROP(19) +#endif /* DIRECTINPUT_VERSION >= 0x0700 */ + +#if(DIRECTINPUT_VERSION >= 0x0800) +#define DIPROP_KEYNAME MAKEDIPROP(20) + +#define DIPROP_CPOINTS MAKEDIPROP(21) + +#define DIPROP_APPDATA MAKEDIPROP(22) + +#define DIPROP_SCANCODE MAKEDIPROP(23) + +#define DIPROP_VIDPID MAKEDIPROP(24) + +#define DIPROP_USERNAME MAKEDIPROP(25) + +#define DIPROP_TYPENAME MAKEDIPROP(26) +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + + +typedef struct DIDEVICEOBJECTDATA_DX3 { + DWORD dwOfs; + DWORD dwData; + DWORD dwTimeStamp; + DWORD dwSequence; +} DIDEVICEOBJECTDATA_DX3, *LPDIDEVICEOBJECTDATA_DX3; +typedef const DIDEVICEOBJECTDATA_DX3 *LPCDIDEVICEOBJECTDATA_DX; + +typedef struct DIDEVICEOBJECTDATA { + DWORD dwOfs; + DWORD dwData; + DWORD dwTimeStamp; + DWORD dwSequence; +#if(DIRECTINPUT_VERSION >= 0x0800) + UINT_PTR uAppData; +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ +} DIDEVICEOBJECTDATA, *LPDIDEVICEOBJECTDATA; +typedef const DIDEVICEOBJECTDATA *LPCDIDEVICEOBJECTDATA; + +#define DIGDD_PEEK 0x00000001 + +#define DISEQUENCE_COMPARE(dwSequence1, cmp, dwSequence2) \ + ((int)((dwSequence1) - (dwSequence2)) cmp 0) +#define DISCL_EXCLUSIVE 0x00000001 +#define DISCL_NONEXCLUSIVE 0x00000002 +#define DISCL_FOREGROUND 0x00000004 +#define DISCL_BACKGROUND 0x00000008 +#define DISCL_NOWINKEY 0x00000010 + +#if(DIRECTINPUT_VERSION >= 0x0500) +/* These structures are defined for DirectX 3.0 compatibility */ + +typedef struct DIDEVICEINSTANCE_DX3A { + DWORD dwSize; + GUID guidInstance; + GUID guidProduct; + DWORD dwDevType; + CHAR tszInstanceName[MAX_PATH]; + CHAR tszProductName[MAX_PATH]; +} DIDEVICEINSTANCE_DX3A, *LPDIDEVICEINSTANCE_DX3A; +typedef struct DIDEVICEINSTANCE_DX3W { + DWORD dwSize; + GUID guidInstance; + GUID guidProduct; + DWORD dwDevType; + WCHAR tszInstanceName[MAX_PATH]; + WCHAR tszProductName[MAX_PATH]; +} DIDEVICEINSTANCE_DX3W, *LPDIDEVICEINSTANCE_DX3W; +#ifdef UNICODE +typedef DIDEVICEINSTANCE_DX3W DIDEVICEINSTANCE_DX3; +typedef LPDIDEVICEINSTANCE_DX3W LPDIDEVICEINSTANCE_DX3; +#else +typedef DIDEVICEINSTANCE_DX3A DIDEVICEINSTANCE_DX3; +typedef LPDIDEVICEINSTANCE_DX3A LPDIDEVICEINSTANCE_DX3; +#endif // UNICODE +typedef const DIDEVICEINSTANCE_DX3A *LPCDIDEVICEINSTANCE_DX3A; +typedef const DIDEVICEINSTANCE_DX3W *LPCDIDEVICEINSTANCE_DX3W; +typedef const DIDEVICEINSTANCE_DX3 *LPCDIDEVICEINSTANCE_DX3; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ + +typedef struct DIDEVICEINSTANCEA { + DWORD dwSize; + GUID guidInstance; + GUID guidProduct; + DWORD dwDevType; + CHAR tszInstanceName[MAX_PATH]; + CHAR tszProductName[MAX_PATH]; +#if(DIRECTINPUT_VERSION >= 0x0500) + GUID guidFFDriver; + WORD wUsagePage; + WORD wUsage; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +} DIDEVICEINSTANCEA, *LPDIDEVICEINSTANCEA; +typedef struct DIDEVICEINSTANCEW { + DWORD dwSize; + GUID guidInstance; + GUID guidProduct; + DWORD dwDevType; + WCHAR tszInstanceName[MAX_PATH]; + WCHAR tszProductName[MAX_PATH]; +#if(DIRECTINPUT_VERSION >= 0x0500) + GUID guidFFDriver; + WORD wUsagePage; + WORD wUsage; +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +} DIDEVICEINSTANCEW, *LPDIDEVICEINSTANCEW; +#ifdef UNICODE +typedef DIDEVICEINSTANCEW DIDEVICEINSTANCE; +typedef LPDIDEVICEINSTANCEW LPDIDEVICEINSTANCE; +#else +typedef DIDEVICEINSTANCEA DIDEVICEINSTANCE; +typedef LPDIDEVICEINSTANCEA LPDIDEVICEINSTANCE; +#endif // UNICODE + +typedef const DIDEVICEINSTANCEA *LPCDIDEVICEINSTANCEA; +typedef const DIDEVICEINSTANCEW *LPCDIDEVICEINSTANCEW; +#ifdef UNICODE +typedef DIDEVICEINSTANCEW DIDEVICEINSTANCE; +typedef LPCDIDEVICEINSTANCEW LPCDIDEVICEINSTANCE; +#else +typedef DIDEVICEINSTANCEA DIDEVICEINSTANCE; +typedef LPCDIDEVICEINSTANCEA LPCDIDEVICEINSTANCE; +#endif // UNICODE +typedef const DIDEVICEINSTANCE *LPCDIDEVICEINSTANCE; + +#undef INTERFACE +#define INTERFACE IDirectInputDeviceW + +DECLARE_INTERFACE_(IDirectInputDeviceW, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDeviceW methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; +}; + +typedef struct IDirectInputDeviceW *LPDIRECTINPUTDEVICEW; + +#undef INTERFACE +#define INTERFACE IDirectInputDeviceA + +DECLARE_INTERFACE_(IDirectInputDeviceA, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDeviceA methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; +}; + +typedef struct IDirectInputDeviceA *LPDIRECTINPUTDEVICEA; + +#ifdef UNICODE +#define IID_IDirectInputDevice IID_IDirectInputDeviceW +#define IDirectInputDevice IDirectInputDeviceW +#define IDirectInputDeviceVtbl IDirectInputDeviceWVtbl +#else +#define IID_IDirectInputDevice IID_IDirectInputDeviceA +#define IDirectInputDevice IDirectInputDeviceA +#define IDirectInputDeviceVtbl IDirectInputDeviceAVtbl +#endif +typedef struct IDirectInputDevice *LPDIRECTINPUTDEVICE; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputDevice_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputDevice_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputDevice_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) +#define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) +#define IDirectInputDevice_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) +#define IDirectInputDevice_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) +#define IDirectInputDevice_Acquire(p) (p)->lpVtbl->Acquire(p) +#define IDirectInputDevice_Unacquire(p) (p)->lpVtbl->Unacquire(p) +#define IDirectInputDevice_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) +#define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) +#define IDirectInputDevice_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) +#define IDirectInputDevice_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) +#define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) +#define IDirectInputDevice_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) +#define IDirectInputDevice_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInputDevice_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#else +#define IDirectInputDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputDevice_AddRef(p) (p)->AddRef() +#define IDirectInputDevice_Release(p) (p)->Release() +#define IDirectInputDevice_GetCapabilities(p,a) (p)->GetCapabilities(a) +#define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) +#define IDirectInputDevice_GetProperty(p,a,b) (p)->GetProperty(a,b) +#define IDirectInputDevice_SetProperty(p,a,b) (p)->SetProperty(a,b) +#define IDirectInputDevice_Acquire(p) (p)->Acquire() +#define IDirectInputDevice_Unacquire(p) (p)->Unacquire() +#define IDirectInputDevice_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) +#define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) +#define IDirectInputDevice_SetDataFormat(p,a) (p)->SetDataFormat(a) +#define IDirectInputDevice_SetEventNotification(p,a) (p)->SetEventNotification(a) +#define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) +#define IDirectInputDevice_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) +#define IDirectInputDevice_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInputDevice_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#endif + +#endif /* DIJ_RINGZERO */ + + +#if(DIRECTINPUT_VERSION >= 0x0500) + +#define DISFFC_RESET 0x00000001 +#define DISFFC_STOPALL 0x00000002 +#define DISFFC_PAUSE 0x00000004 +#define DISFFC_CONTINUE 0x00000008 +#define DISFFC_SETACTUATORSON 0x00000010 +#define DISFFC_SETACTUATORSOFF 0x00000020 + +#define DIGFFS_EMPTY 0x00000001 +#define DIGFFS_STOPPED 0x00000002 +#define DIGFFS_PAUSED 0x00000004 +#define DIGFFS_ACTUATORSON 0x00000010 +#define DIGFFS_ACTUATORSOFF 0x00000020 +#define DIGFFS_POWERON 0x00000040 +#define DIGFFS_POWEROFF 0x00000080 +#define DIGFFS_SAFETYSWITCHON 0x00000100 +#define DIGFFS_SAFETYSWITCHOFF 0x00000200 +#define DIGFFS_USERFFSWITCHON 0x00000400 +#define DIGFFS_USERFFSWITCHOFF 0x00000800 +#define DIGFFS_DEVICELOST 0x80000000 + +#ifndef DIJ_RINGZERO + +typedef struct DIEFFECTINFOA { + DWORD dwSize; + GUID guid; + DWORD dwEffType; + DWORD dwStaticParams; + DWORD dwDynamicParams; + CHAR tszName[MAX_PATH]; +} DIEFFECTINFOA, *LPDIEFFECTINFOA; +typedef struct DIEFFECTINFOW { + DWORD dwSize; + GUID guid; + DWORD dwEffType; + DWORD dwStaticParams; + DWORD dwDynamicParams; + WCHAR tszName[MAX_PATH]; +} DIEFFECTINFOW, *LPDIEFFECTINFOW; +#ifdef UNICODE +typedef DIEFFECTINFOW DIEFFECTINFO; +typedef LPDIEFFECTINFOW LPDIEFFECTINFO; +#else +typedef DIEFFECTINFOA DIEFFECTINFO; +typedef LPDIEFFECTINFOA LPDIEFFECTINFO; +#endif // UNICODE +typedef const DIEFFECTINFOA *LPCDIEFFECTINFOA; +typedef const DIEFFECTINFOW *LPCDIEFFECTINFOW; +typedef const DIEFFECTINFO *LPCDIEFFECTINFO; + +#define DISDD_CONTINUE 0x00000001 + +typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSCALLBACKA)(LPCDIEFFECTINFOA, LPVOID); +typedef BOOL (FAR PASCAL * LPDIENUMEFFECTSCALLBACKW)(LPCDIEFFECTINFOW, LPVOID); +#ifdef UNICODE +#define LPDIENUMEFFECTSCALLBACK LPDIENUMEFFECTSCALLBACKW +#else +#define LPDIENUMEFFECTSCALLBACK LPDIENUMEFFECTSCALLBACKA +#endif // !UNICODE +typedef BOOL (FAR PASCAL * LPDIENUMCREATEDEFFECTOBJECTSCALLBACK)(LPDIRECTINPUTEFFECT, LPVOID); + +#undef INTERFACE +#define INTERFACE IDirectInputDevice2W + +DECLARE_INTERFACE_(IDirectInputDevice2W, IDirectInputDeviceW) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDeviceW methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; + + /*** IDirectInputDevice2W methods ***/ + STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE; + STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW,REFGUID) PURE; + STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; + STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; + STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; + STDMETHOD(Poll)(THIS) PURE; + STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; +}; + +typedef struct IDirectInputDevice2W *LPDIRECTINPUTDEVICE2W; + +#undef INTERFACE +#define INTERFACE IDirectInputDevice2A + +DECLARE_INTERFACE_(IDirectInputDevice2A, IDirectInputDeviceA) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDeviceA methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; + + /*** IDirectInputDevice2A methods ***/ + STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE; + STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA,REFGUID) PURE; + STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; + STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; + STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; + STDMETHOD(Poll)(THIS) PURE; + STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; +}; + +typedef struct IDirectInputDevice2A *LPDIRECTINPUTDEVICE2A; + +#ifdef UNICODE +#define IID_IDirectInputDevice2 IID_IDirectInputDevice2W +#define IDirectInputDevice2 IDirectInputDevice2W +#define IDirectInputDevice2Vtbl IDirectInputDevice2WVtbl +#else +#define IID_IDirectInputDevice2 IID_IDirectInputDevice2A +#define IDirectInputDevice2 IDirectInputDevice2A +#define IDirectInputDevice2Vtbl IDirectInputDevice2AVtbl +#endif +typedef struct IDirectInputDevice2 *LPDIRECTINPUTDEVICE2; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputDevice2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputDevice2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputDevice2_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputDevice2_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) +#define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) +#define IDirectInputDevice2_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) +#define IDirectInputDevice2_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) +#define IDirectInputDevice2_Acquire(p) (p)->lpVtbl->Acquire(p) +#define IDirectInputDevice2_Unacquire(p) (p)->lpVtbl->Unacquire(p) +#define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) +#define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) +#define IDirectInputDevice2_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) +#define IDirectInputDevice2_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) +#define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) +#define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) +#define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInputDevice2_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d) +#define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c) +#define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b) +#define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a) +#define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a) +#define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c) +#define IDirectInputDevice2_Escape(p,a) (p)->lpVtbl->Escape(p,a) +#define IDirectInputDevice2_Poll(p) (p)->lpVtbl->Poll(p) +#define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d) +#else +#define IDirectInputDevice2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputDevice2_AddRef(p) (p)->AddRef() +#define IDirectInputDevice2_Release(p) (p)->Release() +#define IDirectInputDevice2_GetCapabilities(p,a) (p)->GetCapabilities(a) +#define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) +#define IDirectInputDevice2_GetProperty(p,a,b) (p)->GetProperty(a,b) +#define IDirectInputDevice2_SetProperty(p,a,b) (p)->SetProperty(a,b) +#define IDirectInputDevice2_Acquire(p) (p)->Acquire() +#define IDirectInputDevice2_Unacquire(p) (p)->Unacquire() +#define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) +#define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) +#define IDirectInputDevice2_SetDataFormat(p,a) (p)->SetDataFormat(a) +#define IDirectInputDevice2_SetEventNotification(p,a) (p)->SetEventNotification(a) +#define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) +#define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) +#define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInputDevice2_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d) +#define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c) +#define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b) +#define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a) +#define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a) +#define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c) +#define IDirectInputDevice2_Escape(p,a) (p)->Escape(a) +#define IDirectInputDevice2_Poll(p) (p)->Poll() +#define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d) +#endif + +#endif /* DIJ_RINGZERO */ + +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ + +#if(DIRECTINPUT_VERSION >= 0x0700) +#define DIFEF_DEFAULT 0x00000000 +#define DIFEF_INCLUDENONSTANDARD 0x00000001 +#define DIFEF_MODIFYIFNEEDED 0x00000010 + +#ifndef DIJ_RINGZERO + +#undef INTERFACE +#define INTERFACE IDirectInputDevice7W + +DECLARE_INTERFACE_(IDirectInputDevice7W, IDirectInputDevice2W) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDevice2W methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; + STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE; + STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW,REFGUID) PURE; + STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; + STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; + STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; + STDMETHOD(Poll)(THIS) PURE; + STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + + /*** IDirectInputDevice7W methods ***/ + STDMETHOD(EnumEffectsInFile)(THIS_ LPCWSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(WriteEffectToFile)(THIS_ LPCWSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE; +}; + +typedef struct IDirectInputDevice7W *LPDIRECTINPUTDEVICE7W; + +#undef INTERFACE +#define INTERFACE IDirectInputDevice7A + +DECLARE_INTERFACE_(IDirectInputDevice7A, IDirectInputDevice2A) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDevice2A methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; + STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE; + STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA,REFGUID) PURE; + STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; + STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; + STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; + STDMETHOD(Poll)(THIS) PURE; + STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + + /*** IDirectInputDevice7A methods ***/ + STDMETHOD(EnumEffectsInFile)(THIS_ LPCSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(WriteEffectToFile)(THIS_ LPCSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE; +}; + +typedef struct IDirectInputDevice7A *LPDIRECTINPUTDEVICE7A; + +#ifdef UNICODE +#define IID_IDirectInputDevice7 IID_IDirectInputDevice7W +#define IDirectInputDevice7 IDirectInputDevice7W +#define IDirectInputDevice7Vtbl IDirectInputDevice7WVtbl +#else +#define IID_IDirectInputDevice7 IID_IDirectInputDevice7A +#define IDirectInputDevice7 IDirectInputDevice7A +#define IDirectInputDevice7Vtbl IDirectInputDevice7AVtbl +#endif +typedef struct IDirectInputDevice7 *LPDIRECTINPUTDEVICE7; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputDevice7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputDevice7_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputDevice7_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputDevice7_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) +#define IDirectInputDevice7_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) +#define IDirectInputDevice7_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) +#define IDirectInputDevice7_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) +#define IDirectInputDevice7_Acquire(p) (p)->lpVtbl->Acquire(p) +#define IDirectInputDevice7_Unacquire(p) (p)->lpVtbl->Unacquire(p) +#define IDirectInputDevice7_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) +#define IDirectInputDevice7_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) +#define IDirectInputDevice7_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) +#define IDirectInputDevice7_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) +#define IDirectInputDevice7_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectInputDevice7_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) +#define IDirectInputDevice7_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) +#define IDirectInputDevice7_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInputDevice7_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirectInputDevice7_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d) +#define IDirectInputDevice7_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c) +#define IDirectInputDevice7_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b) +#define IDirectInputDevice7_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a) +#define IDirectInputDevice7_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a) +#define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c) +#define IDirectInputDevice7_Escape(p,a) (p)->lpVtbl->Escape(p,a) +#define IDirectInputDevice7_Poll(p) (p)->lpVtbl->Poll(p) +#define IDirectInputDevice7_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d) +#define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) (p)->lpVtbl->EnumEffectsInFile(p,a,b,c,d) +#define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) (p)->lpVtbl->WriteEffectToFile(p,a,b,c,d) +#else +#define IDirectInputDevice7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputDevice7_AddRef(p) (p)->AddRef() +#define IDirectInputDevice7_Release(p) (p)->Release() +#define IDirectInputDevice7_GetCapabilities(p,a) (p)->GetCapabilities(a) +#define IDirectInputDevice7_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) +#define IDirectInputDevice7_GetProperty(p,a,b) (p)->GetProperty(a,b) +#define IDirectInputDevice7_SetProperty(p,a,b) (p)->SetProperty(a,b) +#define IDirectInputDevice7_Acquire(p) (p)->Acquire() +#define IDirectInputDevice7_Unacquire(p) (p)->Unacquire() +#define IDirectInputDevice7_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) +#define IDirectInputDevice7_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) +#define IDirectInputDevice7_SetDataFormat(p,a) (p)->SetDataFormat(a) +#define IDirectInputDevice7_SetEventNotification(p,a) (p)->SetEventNotification(a) +#define IDirectInputDevice7_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectInputDevice7_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) +#define IDirectInputDevice7_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) +#define IDirectInputDevice7_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInputDevice7_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirectInputDevice7_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d) +#define IDirectInputDevice7_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c) +#define IDirectInputDevice7_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b) +#define IDirectInputDevice7_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a) +#define IDirectInputDevice7_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a) +#define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c) +#define IDirectInputDevice7_Escape(p,a) (p)->Escape(a) +#define IDirectInputDevice7_Poll(p) (p)->Poll() +#define IDirectInputDevice7_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d) +#define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) (p)->EnumEffectsInFile(a,b,c,d) +#define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) (p)->WriteEffectToFile(a,b,c,d) +#endif + +#endif /* DIJ_RINGZERO */ + +#endif /* DIRECTINPUT_VERSION >= 0x0700 */ + +#if(DIRECTINPUT_VERSION >= 0x0800) + +#ifndef DIJ_RINGZERO + +#undef INTERFACE +#define INTERFACE IDirectInputDevice8W + +DECLARE_INTERFACE_(IDirectInputDevice8W, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDevice8W methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; + STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE; + STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW,REFGUID) PURE; + STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; + STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; + STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; + STDMETHOD(Poll)(THIS) PURE; + STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(EnumEffectsInFile)(THIS_ LPCWSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(WriteEffectToFile)(THIS_ LPCWSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE; + STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATW,LPCWSTR,DWORD) PURE; + STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATW,LPCWSTR,DWORD) PURE; + STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERW) PURE; +}; + +typedef struct IDirectInputDevice8W *LPDIRECTINPUTDEVICE8W; + +#undef INTERFACE +#define INTERFACE IDirectInputDevice8A + +DECLARE_INTERFACE_(IDirectInputDevice8A, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputDevice8A methods ***/ + STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS) PURE; + STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetProperty)(THIS_ REFGUID,LPDIPROPHEADER) PURE; + STDMETHOD(SetProperty)(THIS_ REFGUID,LPCDIPROPHEADER) PURE; + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; + STDMETHOD(GetDeviceData)(THIS_ DWORD,LPDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT) PURE; + STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA,DWORD,DWORD) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD,REFGUID) PURE; + STDMETHOD(CreateEffect)(THIS_ REFGUID,LPCDIEFFECT,LPDIRECTINPUTEFFECT *,LPUNKNOWN) PURE; + STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA,REFGUID) PURE; + STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; + STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; + STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; + STDMETHOD(Poll)(THIS) PURE; + STDMETHOD(SendDeviceData)(THIS_ DWORD,LPCDIDEVICEOBJECTDATA,LPDWORD,DWORD) PURE; + STDMETHOD(EnumEffectsInFile)(THIS_ LPCSTR,LPDIENUMEFFECTSINFILECALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(WriteEffectToFile)(THIS_ LPCSTR,DWORD,LPDIFILEEFFECT,DWORD) PURE; + STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATA,LPCSTR,DWORD) PURE; + STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATA,LPCSTR,DWORD) PURE; + STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERA) PURE; +}; + +typedef struct IDirectInputDevice8A *LPDIRECTINPUTDEVICE8A; + +#ifdef UNICODE +#define IID_IDirectInputDevice8 IID_IDirectInputDevice8W +#define IDirectInputDevice8 IDirectInputDevice8W +#define IDirectInputDevice8Vtbl IDirectInputDevice8WVtbl +#else +#define IID_IDirectInputDevice8 IID_IDirectInputDevice8A +#define IDirectInputDevice8 IDirectInputDevice8A +#define IDirectInputDevice8Vtbl IDirectInputDevice8AVtbl +#endif +typedef struct IDirectInputDevice8 *LPDIRECTINPUTDEVICE8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputDevice8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputDevice8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputDevice8_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputDevice8_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) +#define IDirectInputDevice8_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) +#define IDirectInputDevice8_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) +#define IDirectInputDevice8_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) +#define IDirectInputDevice8_Acquire(p) (p)->lpVtbl->Acquire(p) +#define IDirectInputDevice8_Unacquire(p) (p)->lpVtbl->Unacquire(p) +#define IDirectInputDevice8_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) +#define IDirectInputDevice8_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) +#define IDirectInputDevice8_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) +#define IDirectInputDevice8_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) +#define IDirectInputDevice8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectInputDevice8_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) +#define IDirectInputDevice8_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) +#define IDirectInputDevice8_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInputDevice8_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirectInputDevice8_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d) +#define IDirectInputDevice8_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c) +#define IDirectInputDevice8_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b) +#define IDirectInputDevice8_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a) +#define IDirectInputDevice8_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a) +#define IDirectInputDevice8_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c) +#define IDirectInputDevice8_Escape(p,a) (p)->lpVtbl->Escape(p,a) +#define IDirectInputDevice8_Poll(p) (p)->lpVtbl->Poll(p) +#define IDirectInputDevice8_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d) +#define IDirectInputDevice8_EnumEffectsInFile(p,a,b,c,d) (p)->lpVtbl->EnumEffectsInFile(p,a,b,c,d) +#define IDirectInputDevice8_WriteEffectToFile(p,a,b,c,d) (p)->lpVtbl->WriteEffectToFile(p,a,b,c,d) +#define IDirectInputDevice8_BuildActionMap(p,a,b,c) (p)->lpVtbl->BuildActionMap(p,a,b,c) +#define IDirectInputDevice8_SetActionMap(p,a,b,c) (p)->lpVtbl->SetActionMap(p,a,b,c) +#define IDirectInputDevice8_GetImageInfo(p,a) (p)->lpVtbl->GetImageInfo(p,a) +#else +#define IDirectInputDevice8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputDevice8_AddRef(p) (p)->AddRef() +#define IDirectInputDevice8_Release(p) (p)->Release() +#define IDirectInputDevice8_GetCapabilities(p,a) (p)->GetCapabilities(a) +#define IDirectInputDevice8_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) +#define IDirectInputDevice8_GetProperty(p,a,b) (p)->GetProperty(a,b) +#define IDirectInputDevice8_SetProperty(p,a,b) (p)->SetProperty(a,b) +#define IDirectInputDevice8_Acquire(p) (p)->Acquire() +#define IDirectInputDevice8_Unacquire(p) (p)->Unacquire() +#define IDirectInputDevice8_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) +#define IDirectInputDevice8_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) +#define IDirectInputDevice8_SetDataFormat(p,a) (p)->SetDataFormat(a) +#define IDirectInputDevice8_SetEventNotification(p,a) (p)->SetEventNotification(a) +#define IDirectInputDevice8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectInputDevice8_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) +#define IDirectInputDevice8_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) +#define IDirectInputDevice8_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInputDevice8_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirectInputDevice8_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d) +#define IDirectInputDevice8_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c) +#define IDirectInputDevice8_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b) +#define IDirectInputDevice8_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a) +#define IDirectInputDevice8_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a) +#define IDirectInputDevice8_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c) +#define IDirectInputDevice8_Escape(p,a) (p)->Escape(a) +#define IDirectInputDevice8_Poll(p) (p)->Poll() +#define IDirectInputDevice8_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d) +#define IDirectInputDevice8_EnumEffectsInFile(p,a,b,c,d) (p)->EnumEffectsInFile(a,b,c,d) +#define IDirectInputDevice8_WriteEffectToFile(p,a,b,c,d) (p)->WriteEffectToFile(a,b,c,d) +#define IDirectInputDevice8_BuildActionMap(p,a,b,c) (p)->BuildActionMap(a,b,c) +#define IDirectInputDevice8_SetActionMap(p,a,b,c) (p)->SetActionMap(a,b,c) +#define IDirectInputDevice8_GetImageInfo(p,a) (p)->GetImageInfo(a) +#endif + +#endif /* DIJ_RINGZERO */ + +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +/**************************************************************************** + * + * Mouse + * + ****************************************************************************/ + +#ifndef DIJ_RINGZERO + +typedef struct _DIMOUSESTATE { + LONG lX; + LONG lY; + LONG lZ; + BYTE rgbButtons[4]; +} DIMOUSESTATE, *LPDIMOUSESTATE; + +#if DIRECTINPUT_VERSION >= 0x0700 +typedef struct _DIMOUSESTATE2 { + LONG lX; + LONG lY; + LONG lZ; + BYTE rgbButtons[8]; +} DIMOUSESTATE2, *LPDIMOUSESTATE2; +#endif + + +#define DIMOFS_X FIELD_OFFSET(DIMOUSESTATE, lX) +#define DIMOFS_Y FIELD_OFFSET(DIMOUSESTATE, lY) +#define DIMOFS_Z FIELD_OFFSET(DIMOUSESTATE, lZ) +#define DIMOFS_BUTTON0 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0) +#define DIMOFS_BUTTON1 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1) +#define DIMOFS_BUTTON2 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2) +#define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3) +#if (DIRECTINPUT_VERSION >= 0x0700) +#define DIMOFS_BUTTON4 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 4) +#define DIMOFS_BUTTON5 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 5) +#define DIMOFS_BUTTON6 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 6) +#define DIMOFS_BUTTON7 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 7) +#endif +#endif /* DIJ_RINGZERO */ + +/**************************************************************************** + * + * Keyboard + * + ****************************************************************************/ + +#ifndef DIJ_RINGZERO + +/**************************************************************************** + * + * DirectInput keyboard scan codes + * + ****************************************************************************/ +#define DIK_ESCAPE 0x01 +#define DIK_1 0x02 +#define DIK_2 0x03 +#define DIK_3 0x04 +#define DIK_4 0x05 +#define DIK_5 0x06 +#define DIK_6 0x07 +#define DIK_7 0x08 +#define DIK_8 0x09 +#define DIK_9 0x0A +#define DIK_0 0x0B +#define DIK_MINUS 0x0C /* - on main keyboard */ +#define DIK_EQUALS 0x0D +#define DIK_BACK 0x0E /* backspace */ +#define DIK_TAB 0x0F +#define DIK_Q 0x10 +#define DIK_W 0x11 +#define DIK_E 0x12 +#define DIK_R 0x13 +#define DIK_T 0x14 +#define DIK_Y 0x15 +#define DIK_U 0x16 +#define DIK_I 0x17 +#define DIK_O 0x18 +#define DIK_P 0x19 +#define DIK_LBRACKET 0x1A +#define DIK_RBRACKET 0x1B +#define DIK_RETURN 0x1C /* Enter on main keyboard */ +#define DIK_LCONTROL 0x1D +#define DIK_A 0x1E +#define DIK_S 0x1F +#define DIK_D 0x20 +#define DIK_F 0x21 +#define DIK_G 0x22 +#define DIK_H 0x23 +#define DIK_J 0x24 +#define DIK_K 0x25 +#define DIK_L 0x26 +#define DIK_SEMICOLON 0x27 +#define DIK_APOSTROPHE 0x28 +#define DIK_GRAVE 0x29 /* accent grave */ +#define DIK_LSHIFT 0x2A +#define DIK_BACKSLASH 0x2B +#define DIK_Z 0x2C +#define DIK_X 0x2D +#define DIK_C 0x2E +#define DIK_V 0x2F +#define DIK_B 0x30 +#define DIK_N 0x31 +#define DIK_M 0x32 +#define DIK_COMMA 0x33 +#define DIK_PERIOD 0x34 /* . on main keyboard */ +#define DIK_SLASH 0x35 /* / on main keyboard */ +#define DIK_RSHIFT 0x36 +#define DIK_MULTIPLY 0x37 /* * on numeric keypad */ +#define DIK_LMENU 0x38 /* left Alt */ +#define DIK_SPACE 0x39 +#define DIK_CAPITAL 0x3A +#define DIK_F1 0x3B +#define DIK_F2 0x3C +#define DIK_F3 0x3D +#define DIK_F4 0x3E +#define DIK_F5 0x3F +#define DIK_F6 0x40 +#define DIK_F7 0x41 +#define DIK_F8 0x42 +#define DIK_F9 0x43 +#define DIK_F10 0x44 +#define DIK_NUMLOCK 0x45 +#define DIK_SCROLL 0x46 /* Scroll Lock */ +#define DIK_NUMPAD7 0x47 +#define DIK_NUMPAD8 0x48 +#define DIK_NUMPAD9 0x49 +#define DIK_SUBTRACT 0x4A /* - on numeric keypad */ +#define DIK_NUMPAD4 0x4B +#define DIK_NUMPAD5 0x4C +#define DIK_NUMPAD6 0x4D +#define DIK_ADD 0x4E /* + on numeric keypad */ +#define DIK_NUMPAD1 0x4F +#define DIK_NUMPAD2 0x50 +#define DIK_NUMPAD3 0x51 +#define DIK_NUMPAD0 0x52 +#define DIK_DECIMAL 0x53 /* . on numeric keypad */ +#define DIK_OEM_102 0x56 /* <> or \| on RT 102-key keyboard (Non-U.S.) */ +#define DIK_F11 0x57 +#define DIK_F12 0x58 +#define DIK_F13 0x64 /* (NEC PC98) */ +#define DIK_F14 0x65 /* (NEC PC98) */ +#define DIK_F15 0x66 /* (NEC PC98) */ +#define DIK_KANA 0x70 /* (Japanese keyboard) */ +#define DIK_ABNT_C1 0x73 /* /? on Brazilian keyboard */ +#define DIK_CONVERT 0x79 /* (Japanese keyboard) */ +#define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */ +#define DIK_YEN 0x7D /* (Japanese keyboard) */ +#define DIK_ABNT_C2 0x7E /* Numpad . on Brazilian keyboard */ +#define DIK_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */ +#define DIK_PREVTRACK 0x90 /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */ +#define DIK_AT 0x91 /* (NEC PC98) */ +#define DIK_COLON 0x92 /* (NEC PC98) */ +#define DIK_UNDERLINE 0x93 /* (NEC PC98) */ +#define DIK_KANJI 0x94 /* (Japanese keyboard) */ +#define DIK_STOP 0x95 /* (NEC PC98) */ +#define DIK_AX 0x96 /* (Japan AX) */ +#define DIK_UNLABELED 0x97 /* (J3100) */ +#define DIK_NEXTTRACK 0x99 /* Next Track */ +#define DIK_NUMPADENTER 0x9C /* Enter on numeric keypad */ +#define DIK_RCONTROL 0x9D +#define DIK_MUTE 0xA0 /* Mute */ +#define DIK_CALCULATOR 0xA1 /* Calculator */ +#define DIK_PLAYPAUSE 0xA2 /* Play / Pause */ +#define DIK_MEDIASTOP 0xA4 /* Media Stop */ +#define DIK_VOLUMEDOWN 0xAE /* Volume - */ +#define DIK_VOLUMEUP 0xB0 /* Volume + */ +#define DIK_WEBHOME 0xB2 /* Web home */ +#define DIK_NUMPADCOMMA 0xB3 /* , on numeric keypad (NEC PC98) */ +#define DIK_DIVIDE 0xB5 /* / on numeric keypad */ +#define DIK_SYSRQ 0xB7 +#define DIK_RMENU 0xB8 /* right Alt */ +#define DIK_PAUSE 0xC5 /* Pause */ +#define DIK_HOME 0xC7 /* Home on arrow keypad */ +#define DIK_UP 0xC8 /* UpArrow on arrow keypad */ +#define DIK_PRIOR 0xC9 /* PgUp on arrow keypad */ +#define DIK_LEFT 0xCB /* LeftArrow on arrow keypad */ +#define DIK_RIGHT 0xCD /* RightArrow on arrow keypad */ +#define DIK_END 0xCF /* End on arrow keypad */ +#define DIK_DOWN 0xD0 /* DownArrow on arrow keypad */ +#define DIK_NEXT 0xD1 /* PgDn on arrow keypad */ +#define DIK_INSERT 0xD2 /* Insert on arrow keypad */ +#define DIK_DELETE 0xD3 /* Delete on arrow keypad */ +#define DIK_LWIN 0xDB /* Left Windows key */ +#define DIK_RWIN 0xDC /* Right Windows key */ +#define DIK_APPS 0xDD /* AppMenu key */ +#define DIK_POWER 0xDE /* System Power */ +#define DIK_SLEEP 0xDF /* System Sleep */ +#define DIK_WAKE 0xE3 /* System Wake */ +#define DIK_WEBSEARCH 0xE5 /* Web Search */ +#define DIK_WEBFAVORITES 0xE6 /* Web Favorites */ +#define DIK_WEBREFRESH 0xE7 /* Web Refresh */ +#define DIK_WEBSTOP 0xE8 /* Web Stop */ +#define DIK_WEBFORWARD 0xE9 /* Web Forward */ +#define DIK_WEBBACK 0xEA /* Web Back */ +#define DIK_MYCOMPUTER 0xEB /* My Computer */ +#define DIK_MAIL 0xEC /* Mail */ +#define DIK_MEDIASELECT 0xED /* Media Select */ + +/* + * Alternate names for keys, to facilitate transition from DOS. + */ +#define DIK_BACKSPACE DIK_BACK /* backspace */ +#define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */ +#define DIK_LALT DIK_LMENU /* left Alt */ +#define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */ +#define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */ +#define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */ +#define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */ +#define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */ +#define DIK_RALT DIK_RMENU /* right Alt */ +#define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */ +#define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */ +#define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */ +#define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */ +#define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */ +#define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */ + +/* + * Alternate names for keys originally not used on US keyboards. + */ +#define DIK_CIRCUMFLEX DIK_PREVTRACK /* Japanese keyboard */ + +#endif /* DIJ_RINGZERO */ + +/**************************************************************************** + * + * Joystick + * + ****************************************************************************/ + +#ifndef DIJ_RINGZERO + +typedef struct DIJOYSTATE { + LONG lX; /* x-axis position */ + LONG lY; /* y-axis position */ + LONG lZ; /* z-axis position */ + LONG lRx; /* x-axis rotation */ + LONG lRy; /* y-axis rotation */ + LONG lRz; /* z-axis rotation */ + LONG rglSlider[2]; /* extra axes positions */ + DWORD rgdwPOV[4]; /* POV directions */ + BYTE rgbButtons[32]; /* 32 buttons */ +} DIJOYSTATE, *LPDIJOYSTATE; + +typedef struct DIJOYSTATE2 { + LONG lX; /* x-axis position */ + LONG lY; /* y-axis position */ + LONG lZ; /* z-axis position */ + LONG lRx; /* x-axis rotation */ + LONG lRy; /* y-axis rotation */ + LONG lRz; /* z-axis rotation */ + LONG rglSlider[2]; /* extra axes positions */ + DWORD rgdwPOV[4]; /* POV directions */ + BYTE rgbButtons[128]; /* 128 buttons */ + LONG lVX; /* x-axis velocity */ + LONG lVY; /* y-axis velocity */ + LONG lVZ; /* z-axis velocity */ + LONG lVRx; /* x-axis angular velocity */ + LONG lVRy; /* y-axis angular velocity */ + LONG lVRz; /* z-axis angular velocity */ + LONG rglVSlider[2]; /* extra axes velocities */ + LONG lAX; /* x-axis acceleration */ + LONG lAY; /* y-axis acceleration */ + LONG lAZ; /* z-axis acceleration */ + LONG lARx; /* x-axis angular acceleration */ + LONG lARy; /* y-axis angular acceleration */ + LONG lARz; /* z-axis angular acceleration */ + LONG rglASlider[2]; /* extra axes accelerations */ + LONG lFX; /* x-axis force */ + LONG lFY; /* y-axis force */ + LONG lFZ; /* z-axis force */ + LONG lFRx; /* x-axis torque */ + LONG lFRy; /* y-axis torque */ + LONG lFRz; /* z-axis torque */ + LONG rglFSlider[2]; /* extra axes forces */ +} DIJOYSTATE2, *LPDIJOYSTATE2; + +#define DIJOFS_X FIELD_OFFSET(DIJOYSTATE, lX) +#define DIJOFS_Y FIELD_OFFSET(DIJOYSTATE, lY) +#define DIJOFS_Z FIELD_OFFSET(DIJOYSTATE, lZ) +#define DIJOFS_RX FIELD_OFFSET(DIJOYSTATE, lRx) +#define DIJOFS_RY FIELD_OFFSET(DIJOYSTATE, lRy) +#define DIJOFS_RZ FIELD_OFFSET(DIJOYSTATE, lRz) +#define DIJOFS_SLIDER(n) (FIELD_OFFSET(DIJOYSTATE, rglSlider) + \ + (n) * sizeof(LONG)) +#define DIJOFS_POV(n) (FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + \ + (n) * sizeof(DWORD)) +#define DIJOFS_BUTTON(n) (FIELD_OFFSET(DIJOYSTATE, rgbButtons) + (n)) +#define DIJOFS_BUTTON0 DIJOFS_BUTTON(0) +#define DIJOFS_BUTTON1 DIJOFS_BUTTON(1) +#define DIJOFS_BUTTON2 DIJOFS_BUTTON(2) +#define DIJOFS_BUTTON3 DIJOFS_BUTTON(3) +#define DIJOFS_BUTTON4 DIJOFS_BUTTON(4) +#define DIJOFS_BUTTON5 DIJOFS_BUTTON(5) +#define DIJOFS_BUTTON6 DIJOFS_BUTTON(6) +#define DIJOFS_BUTTON7 DIJOFS_BUTTON(7) +#define DIJOFS_BUTTON8 DIJOFS_BUTTON(8) +#define DIJOFS_BUTTON9 DIJOFS_BUTTON(9) +#define DIJOFS_BUTTON10 DIJOFS_BUTTON(10) +#define DIJOFS_BUTTON11 DIJOFS_BUTTON(11) +#define DIJOFS_BUTTON12 DIJOFS_BUTTON(12) +#define DIJOFS_BUTTON13 DIJOFS_BUTTON(13) +#define DIJOFS_BUTTON14 DIJOFS_BUTTON(14) +#define DIJOFS_BUTTON15 DIJOFS_BUTTON(15) +#define DIJOFS_BUTTON16 DIJOFS_BUTTON(16) +#define DIJOFS_BUTTON17 DIJOFS_BUTTON(17) +#define DIJOFS_BUTTON18 DIJOFS_BUTTON(18) +#define DIJOFS_BUTTON19 DIJOFS_BUTTON(19) +#define DIJOFS_BUTTON20 DIJOFS_BUTTON(20) +#define DIJOFS_BUTTON21 DIJOFS_BUTTON(21) +#define DIJOFS_BUTTON22 DIJOFS_BUTTON(22) +#define DIJOFS_BUTTON23 DIJOFS_BUTTON(23) +#define DIJOFS_BUTTON24 DIJOFS_BUTTON(24) +#define DIJOFS_BUTTON25 DIJOFS_BUTTON(25) +#define DIJOFS_BUTTON26 DIJOFS_BUTTON(26) +#define DIJOFS_BUTTON27 DIJOFS_BUTTON(27) +#define DIJOFS_BUTTON28 DIJOFS_BUTTON(28) +#define DIJOFS_BUTTON29 DIJOFS_BUTTON(29) +#define DIJOFS_BUTTON30 DIJOFS_BUTTON(30) +#define DIJOFS_BUTTON31 DIJOFS_BUTTON(31) + + +#endif /* DIJ_RINGZERO */ + +/**************************************************************************** + * + * IDirectInput + * + ****************************************************************************/ + +#ifndef DIJ_RINGZERO + +#define DIENUM_STOP 0 +#define DIENUM_CONTINUE 1 + +typedef BOOL (FAR PASCAL * LPDIENUMDEVICESCALLBACKA)(LPCDIDEVICEINSTANCEA, LPVOID); +typedef BOOL (FAR PASCAL * LPDIENUMDEVICESCALLBACKW)(LPCDIDEVICEINSTANCEW, LPVOID); +#ifdef UNICODE +#define LPDIENUMDEVICESCALLBACK LPDIENUMDEVICESCALLBACKW +#else +#define LPDIENUMDEVICESCALLBACK LPDIENUMDEVICESCALLBACKA +#endif // !UNICODE +typedef BOOL (FAR PASCAL * LPDICONFIGUREDEVICESCALLBACK)(IUnknown FAR *, LPVOID); + +#define DIEDFL_ALLDEVICES 0x00000000 +#define DIEDFL_ATTACHEDONLY 0x00000001 +#if(DIRECTINPUT_VERSION >= 0x0500) +#define DIEDFL_FORCEFEEDBACK 0x00000100 +#endif /* DIRECTINPUT_VERSION >= 0x0500 */ +#if(DIRECTINPUT_VERSION >= 0x050a) +#define DIEDFL_INCLUDEALIASES 0x00010000 +#define DIEDFL_INCLUDEPHANTOMS 0x00020000 +#endif /* DIRECTINPUT_VERSION >= 0x050a */ +#if(DIRECTINPUT_VERSION >= 0x0800) +#define DIEDFL_INCLUDEHIDDEN 0x00040000 +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + + +#if(DIRECTINPUT_VERSION >= 0x0800) +typedef BOOL (FAR PASCAL * LPDIENUMDEVICESBYSEMANTICSCBA)(LPCDIDEVICEINSTANCEA, LPDIRECTINPUTDEVICE8A, DWORD, DWORD, LPVOID); +typedef BOOL (FAR PASCAL * LPDIENUMDEVICESBYSEMANTICSCBW)(LPCDIDEVICEINSTANCEW, LPDIRECTINPUTDEVICE8W, DWORD, DWORD, LPVOID); +#ifdef UNICODE +#define LPDIENUMDEVICESBYSEMANTICSCB LPDIENUMDEVICESBYSEMANTICSCBW +#else +#define LPDIENUMDEVICESBYSEMANTICSCB LPDIENUMDEVICESBYSEMANTICSCBA +#endif // !UNICODE +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +#if(DIRECTINPUT_VERSION >= 0x0800) +#define DIEDBS_MAPPEDPRI1 0x00000001 +#define DIEDBS_MAPPEDPRI2 0x00000002 +#define DIEDBS_RECENTDEVICE 0x00000010 +#define DIEDBS_NEWDEVICE 0x00000020 +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +#if(DIRECTINPUT_VERSION >= 0x0800) +#define DIEDBSFL_ATTACHEDONLY 0x00000000 +#define DIEDBSFL_THISUSER 0x00000010 +#define DIEDBSFL_FORCEFEEDBACK DIEDFL_FORCEFEEDBACK +#define DIEDBSFL_AVAILABLEDEVICES 0x00001000 +#define DIEDBSFL_MULTIMICEKEYBOARDS 0x00002000 +#define DIEDBSFL_NONGAMINGDEVICES 0x00004000 +#define DIEDBSFL_VALID 0x00007110 +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +#undef INTERFACE +#define INTERFACE IDirectInputW + +DECLARE_INTERFACE_(IDirectInputW, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputW methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; +}; + +typedef struct IDirectInputW *LPDIRECTINPUTW; + +#undef INTERFACE +#define INTERFACE IDirectInputA + +DECLARE_INTERFACE_(IDirectInputA, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputA methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; +}; + +typedef struct IDirectInputA *LPDIRECTINPUTA; + +#ifdef UNICODE +#define IID_IDirectInput IID_IDirectInputW +#define IDirectInput IDirectInputW +#define IDirectInputVtbl IDirectInputWVtbl +#else +#define IID_IDirectInput IID_IDirectInputA +#define IDirectInput IDirectInputA +#define IDirectInputVtbl IDirectInputAVtbl +#endif +typedef struct IDirectInput *LPDIRECTINPUT; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInput_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInput_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInput_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInput_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) +#define IDirectInput_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) +#define IDirectInput_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) +#define IDirectInput_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInput_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#else +#define IDirectInput_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInput_AddRef(p) (p)->AddRef() +#define IDirectInput_Release(p) (p)->Release() +#define IDirectInput_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) +#define IDirectInput_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) +#define IDirectInput_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a) +#define IDirectInput_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInput_Initialize(p,a,b) (p)->Initialize(a,b) +#endif + +#undef INTERFACE +#define INTERFACE IDirectInput2W + +DECLARE_INTERFACE_(IDirectInput2W, IDirectInputW) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputW methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; + + /*** IDirectInput2W methods ***/ + STDMETHOD(FindDevice)(THIS_ REFGUID,LPCWSTR,LPGUID) PURE; +}; + +typedef struct IDirectInput2W *LPDIRECTINPUT2W; + +#undef INTERFACE +#define INTERFACE IDirectInput2A + +DECLARE_INTERFACE_(IDirectInput2A, IDirectInputA) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputA methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; + + /*** IDirectInput2A methods ***/ + STDMETHOD(FindDevice)(THIS_ REFGUID,LPCSTR,LPGUID) PURE; +}; + +typedef struct IDirectInput2A *LPDIRECTINPUT2A; + +#ifdef UNICODE +#define IID_IDirectInput2 IID_IDirectInput2W +#define IDirectInput2 IDirectInput2W +#define IDirectInput2Vtbl IDirectInput2WVtbl +#else +#define IID_IDirectInput2 IID_IDirectInput2A +#define IDirectInput2 IDirectInput2A +#define IDirectInput2Vtbl IDirectInput2AVtbl +#endif +typedef struct IDirectInput2 *LPDIRECTINPUT2; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInput2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInput2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInput2_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInput2_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) +#define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) +#define IDirectInput2_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) +#define IDirectInput2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInput2_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectInput2_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c) +#else +#define IDirectInput2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInput2_AddRef(p) (p)->AddRef() +#define IDirectInput2_Release(p) (p)->Release() +#define IDirectInput2_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) +#define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) +#define IDirectInput2_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a) +#define IDirectInput2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInput2_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectInput2_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c) +#endif + + +#undef INTERFACE +#define INTERFACE IDirectInput7W + +DECLARE_INTERFACE_(IDirectInput7W, IDirectInput2W) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInput2W methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEW *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; + STDMETHOD(FindDevice)(THIS_ REFGUID,LPCWSTR,LPGUID) PURE; + + /*** IDirectInput7W methods ***/ + STDMETHOD(CreateDeviceEx)(THIS_ REFGUID,REFIID,LPVOID *,LPUNKNOWN) PURE; +}; + +typedef struct IDirectInput7W *LPDIRECTINPUT7W; + +#undef INTERFACE +#define INTERFACE IDirectInput7A + +DECLARE_INTERFACE_(IDirectInput7A, IDirectInput2A) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInput2A methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICEA *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; + STDMETHOD(FindDevice)(THIS_ REFGUID,LPCSTR,LPGUID) PURE; + + /*** IDirectInput7A methods ***/ + STDMETHOD(CreateDeviceEx)(THIS_ REFGUID,REFIID,LPVOID *,LPUNKNOWN) PURE; +}; + +typedef struct IDirectInput7A *LPDIRECTINPUT7A; + +#ifdef UNICODE +#define IID_IDirectInput7 IID_IDirectInput7W +#define IDirectInput7 IDirectInput7W +#define IDirectInput7Vtbl IDirectInput7WVtbl +#else +#define IID_IDirectInput7 IID_IDirectInput7A +#define IDirectInput7 IDirectInput7A +#define IDirectInput7Vtbl IDirectInput7AVtbl +#endif +typedef struct IDirectInput7 *LPDIRECTINPUT7; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInput7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInput7_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInput7_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInput7_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) +#define IDirectInput7_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) +#define IDirectInput7_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) +#define IDirectInput7_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInput7_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectInput7_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c) +#define IDirectInput7_CreateDeviceEx(p,a,b,c,d) (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d) +#else +#define IDirectInput7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInput7_AddRef(p) (p)->AddRef() +#define IDirectInput7_Release(p) (p)->Release() +#define IDirectInput7_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) +#define IDirectInput7_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) +#define IDirectInput7_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a) +#define IDirectInput7_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInput7_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectInput7_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c) +#define IDirectInput7_CreateDeviceEx(p,a,b,c,d) (p)->CreateDeviceEx(a,b,c,d) +#endif + +#if(DIRECTINPUT_VERSION >= 0x0800) +#undef INTERFACE +#define INTERFACE IDirectInput8W + +DECLARE_INTERFACE_(IDirectInput8W, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInput8W methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICE8W *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKW,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; + STDMETHOD(FindDevice)(THIS_ REFGUID,LPCWSTR,LPGUID) PURE; + STDMETHOD(EnumDevicesBySemantics)(THIS_ LPCWSTR,LPDIACTIONFORMATW,LPDIENUMDEVICESBYSEMANTICSCBW,LPVOID,DWORD) PURE; + STDMETHOD(ConfigureDevices)(THIS_ LPDICONFIGUREDEVICESCALLBACK,LPDICONFIGUREDEVICESPARAMSW,DWORD,LPVOID) PURE; +}; + +typedef struct IDirectInput8W *LPDIRECTINPUT8W; + +#undef INTERFACE +#define INTERFACE IDirectInput8A + +DECLARE_INTERFACE_(IDirectInput8A, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInput8A methods ***/ + STDMETHOD(CreateDevice)(THIS_ REFGUID,LPDIRECTINPUTDEVICE8A *,LPUNKNOWN) PURE; + STDMETHOD(EnumDevices)(THIS_ DWORD,LPDIENUMDEVICESCALLBACKA,LPVOID,DWORD) PURE; + STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; + STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; + STDMETHOD(FindDevice)(THIS_ REFGUID,LPCSTR,LPGUID) PURE; + STDMETHOD(EnumDevicesBySemantics)(THIS_ LPCSTR,LPDIACTIONFORMATA,LPDIENUMDEVICESBYSEMANTICSCBA,LPVOID,DWORD) PURE; + STDMETHOD(ConfigureDevices)(THIS_ LPDICONFIGUREDEVICESCALLBACK,LPDICONFIGUREDEVICESPARAMSA,DWORD,LPVOID) PURE; +}; + +typedef struct IDirectInput8A *LPDIRECTINPUT8A; + +#ifdef UNICODE +#define IID_IDirectInput8 IID_IDirectInput8W +#define IDirectInput8 IDirectInput8W +#define IDirectInput8Vtbl IDirectInput8WVtbl +#else +#define IID_IDirectInput8 IID_IDirectInput8A +#define IDirectInput8 IDirectInput8A +#define IDirectInput8Vtbl IDirectInput8AVtbl +#endif +typedef struct IDirectInput8 *LPDIRECTINPUT8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInput8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInput8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInput8_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInput8_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) +#define IDirectInput8_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) +#define IDirectInput8_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) +#define IDirectInput8_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) +#define IDirectInput8_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectInput8_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c) +#define IDirectInput8_EnumDevicesBySemantics(p,a,b,c,d,e) (p)->lpVtbl->EnumDevicesBySemantics(p,a,b,c,d,e) +#define IDirectInput8_ConfigureDevices(p,a,b,c,d) (p)->lpVtbl->ConfigureDevices(p,a,b,c,d) +#else +#define IDirectInput8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInput8_AddRef(p) (p)->AddRef() +#define IDirectInput8_Release(p) (p)->Release() +#define IDirectInput8_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) +#define IDirectInput8_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) +#define IDirectInput8_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a) +#define IDirectInput8_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) +#define IDirectInput8_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectInput8_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c) +#define IDirectInput8_EnumDevicesBySemantics(p,a,b,c,d,e) (p)->EnumDevicesBySemantics(a,b,c,d,e) +#define IDirectInput8_ConfigureDevices(p,a,b,c,d) (p)->ConfigureDevices(a,b,c,d) +#endif +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +#if DIRECTINPUT_VERSION > 0x0700 + +extern HRESULT WINAPI DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter); + +#else +extern HRESULT WINAPI DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA *ppDI, LPUNKNOWN punkOuter); +extern HRESULT WINAPI DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTW *ppDI, LPUNKNOWN punkOuter); +#ifdef UNICODE +#define DirectInputCreate DirectInputCreateW +#else +#define DirectInputCreate DirectInputCreateA +#endif // !UNICODE + +extern HRESULT WINAPI DirectInputCreateEx(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter); + +#endif /* DIRECTINPUT_VERSION > 0x700 */ + +#endif /* DIJ_RINGZERO */ + + +/**************************************************************************** + * + * Return Codes + * + ****************************************************************************/ + +/* + * The operation completed successfully. + */ +#define DI_OK S_OK + +/* + * The device exists but is not currently attached. + */ +#define DI_NOTATTACHED S_FALSE + +/* + * The device buffer overflowed. Some input was lost. + */ +#define DI_BUFFEROVERFLOW S_FALSE + +/* + * The change in device properties had no effect. + */ +#define DI_PROPNOEFFECT S_FALSE + +/* + * The operation had no effect. + */ +#define DI_NOEFFECT S_FALSE + +/* + * The device is a polled device. As a result, device buffering + * will not collect any data and event notifications will not be + * signalled until GetDeviceState is called. + */ +#define DI_POLLEDDEVICE ((HRESULT)0x00000002L) + +/* + * The parameters of the effect were successfully updated by + * IDirectInputEffect::SetParameters, but the effect was not + * downloaded because the device is not exclusively acquired + * or because the DIEP_NODOWNLOAD flag was passed. + */ +#define DI_DOWNLOADSKIPPED ((HRESULT)0x00000003L) + +/* + * The parameters of the effect were successfully updated by + * IDirectInputEffect::SetParameters, but in order to change + * the parameters, the effect needed to be restarted. + */ +#define DI_EFFECTRESTARTED ((HRESULT)0x00000004L) + +/* + * The parameters of the effect were successfully updated by + * IDirectInputEffect::SetParameters, but some of them were + * beyond the capabilities of the device and were truncated. + */ +#define DI_TRUNCATED ((HRESULT)0x00000008L) + +/* + * The settings have been successfully applied but could not be + * persisted. + */ +#define DI_SETTINGSNOTSAVED ((HRESULT)0x0000000BL) + +/* + * Equal to DI_EFFECTRESTARTED | DI_TRUNCATED. + */ +#define DI_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL) + +/* + * A SUCCESS code indicating that settings cannot be modified. + */ +#define DI_WRITEPROTECT ((HRESULT)0x00000013L) + +/* + * The application requires a newer version of DirectInput. + */ +#define DIERR_OLDDIRECTINPUTVERSION \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION) + +/* + * The application was written for an unsupported prerelease version + * of DirectInput. + */ +#define DIERR_BETADIRECTINPUTVERSION \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP) + +/* + * The object could not be created due to an incompatible driver version + * or mismatched or incomplete driver components. + */ +#define DIERR_BADDRIVERVER \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL) + +/* + * The device or device instance or effect is not registered with DirectInput. + */ +#define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG + +/* + * The requested object does not exist. + */ +#define DIERR_NOTFOUND \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND) + +/* + * The requested object does not exist. + */ +#define DIERR_OBJECTNOTFOUND \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND) + +/* + * An invalid parameter was passed to the returning function, + * or the object was not in a state that admitted the function + * to be called. + */ +#define DIERR_INVALIDPARAM E_INVALIDARG + +/* + * The specified interface is not supported by the object + */ +#define DIERR_NOINTERFACE E_NOINTERFACE + +/* + * An undetermined error occured inside the DInput subsystem + */ +#define DIERR_GENERIC E_FAIL + +/* + * The DInput subsystem couldn't allocate sufficient memory to complete the + * caller's request. + */ +#define DIERR_OUTOFMEMORY E_OUTOFMEMORY + +/* + * The function called is not supported at this time + */ +#define DIERR_UNSUPPORTED E_NOTIMPL + +/* + * This object has not been initialized + */ +#define DIERR_NOTINITIALIZED \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY) + +/* + * This object is already initialized + */ +#define DIERR_ALREADYINITIALIZED \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED) + +/* + * This object does not support aggregation + */ +#define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION + +/* + * Another app has a higher priority level, preventing this call from + * succeeding. + */ +#define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED + +/* + * Access to the device has been lost. It must be re-acquired. + */ +#define DIERR_INPUTLOST \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT) + +/* + * The operation cannot be performed while the device is acquired. + */ +#define DIERR_ACQUIRED \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY) + +/* + * The operation cannot be performed unless the device is acquired. + */ +#define DIERR_NOTACQUIRED \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS) + +/* + * The specified property cannot be changed. + */ +#define DIERR_READONLY E_ACCESSDENIED + +/* + * The device already has an event notification associated with it. + */ +#define DIERR_HANDLEEXISTS E_ACCESSDENIED + +/* + * Data is not yet available. + */ +#ifndef E_PENDING +#define E_PENDING 0x8000000AL +#endif + +/* + * Unable to IDirectInputJoyConfig_Acquire because the user + * does not have sufficient privileges to change the joystick + * configuration. + */ +#define DIERR_INSUFFICIENTPRIVS 0x80040200L + +/* + * The device is full. + */ +#define DIERR_DEVICEFULL 0x80040201L + +/* + * Not all the requested information fit into the buffer. + */ +#define DIERR_MOREDATA 0x80040202L + +/* + * The effect is not downloaded. + */ +#define DIERR_NOTDOWNLOADED 0x80040203L + +/* + * The device cannot be reinitialized because there are still effects + * attached to it. + */ +#define DIERR_HASEFFECTS 0x80040204L + +/* + * The operation cannot be performed unless the device is acquired + * in DISCL_EXCLUSIVE mode. + */ +#define DIERR_NOTEXCLUSIVEACQUIRED 0x80040205L + +/* + * The effect could not be downloaded because essential information + * is missing. For example, no axes have been associated with the + * effect, or no type-specific information has been created. + */ +#define DIERR_INCOMPLETEEFFECT 0x80040206L + +/* + * Attempted to read buffered device data from a device that is + * not buffered. + */ +#define DIERR_NOTBUFFERED 0x80040207L + +/* + * An attempt was made to modify parameters of an effect while it is + * playing. Not all hardware devices support altering the parameters + * of an effect while it is playing. + */ +#define DIERR_EFFECTPLAYING 0x80040208L + +/* + * The operation could not be completed because the device is not + * plugged in. + */ +#define DIERR_UNPLUGGED 0x80040209L + +/* + * SendDeviceData failed because more information was requested + * to be sent than can be sent to the device. Some devices have + * restrictions on how much data can be sent to them. (For example, + * there might be a limit on the number of buttons that can be + * pressed at once.) + */ +#define DIERR_REPORTFULL 0x8004020AL + + +/* + * A mapper file function failed because reading or writing the user or IHV + * settings file failed. + */ +#define DIERR_MAPFILEFAIL 0x8004020BL + + +/*--- DINPUT Mapper Definitions: New for Dx8 ---*/ + + +/*--- Keyboard + Physical Keyboard Device ---*/ + +#define DIKEYBOARD_ESCAPE 0x81000401 +#define DIKEYBOARD_1 0x81000402 +#define DIKEYBOARD_2 0x81000403 +#define DIKEYBOARD_3 0x81000404 +#define DIKEYBOARD_4 0x81000405 +#define DIKEYBOARD_5 0x81000406 +#define DIKEYBOARD_6 0x81000407 +#define DIKEYBOARD_7 0x81000408 +#define DIKEYBOARD_8 0x81000409 +#define DIKEYBOARD_9 0x8100040A +#define DIKEYBOARD_0 0x8100040B +#define DIKEYBOARD_MINUS 0x8100040C /* - on main keyboard */ +#define DIKEYBOARD_EQUALS 0x8100040D +#define DIKEYBOARD_BACK 0x8100040E /* backspace */ +#define DIKEYBOARD_TAB 0x8100040F +#define DIKEYBOARD_Q 0x81000410 +#define DIKEYBOARD_W 0x81000411 +#define DIKEYBOARD_E 0x81000412 +#define DIKEYBOARD_R 0x81000413 +#define DIKEYBOARD_T 0x81000414 +#define DIKEYBOARD_Y 0x81000415 +#define DIKEYBOARD_U 0x81000416 +#define DIKEYBOARD_I 0x81000417 +#define DIKEYBOARD_O 0x81000418 +#define DIKEYBOARD_P 0x81000419 +#define DIKEYBOARD_LBRACKET 0x8100041A +#define DIKEYBOARD_RBRACKET 0x8100041B +#define DIKEYBOARD_RETURN 0x8100041C /* Enter on main keyboard */ +#define DIKEYBOARD_LCONTROL 0x8100041D +#define DIKEYBOARD_A 0x8100041E +#define DIKEYBOARD_S 0x8100041F +#define DIKEYBOARD_D 0x81000420 +#define DIKEYBOARD_F 0x81000421 +#define DIKEYBOARD_G 0x81000422 +#define DIKEYBOARD_H 0x81000423 +#define DIKEYBOARD_J 0x81000424 +#define DIKEYBOARD_K 0x81000425 +#define DIKEYBOARD_L 0x81000426 +#define DIKEYBOARD_SEMICOLON 0x81000427 +#define DIKEYBOARD_APOSTROPHE 0x81000428 +#define DIKEYBOARD_GRAVE 0x81000429 /* accent grave */ +#define DIKEYBOARD_LSHIFT 0x8100042A +#define DIKEYBOARD_BACKSLASH 0x8100042B +#define DIKEYBOARD_Z 0x8100042C +#define DIKEYBOARD_X 0x8100042D +#define DIKEYBOARD_C 0x8100042E +#define DIKEYBOARD_V 0x8100042F +#define DIKEYBOARD_B 0x81000430 +#define DIKEYBOARD_N 0x81000431 +#define DIKEYBOARD_M 0x81000432 +#define DIKEYBOARD_COMMA 0x81000433 +#define DIKEYBOARD_PERIOD 0x81000434 /* . on main keyboard */ +#define DIKEYBOARD_SLASH 0x81000435 /* / on main keyboard */ +#define DIKEYBOARD_RSHIFT 0x81000436 +#define DIKEYBOARD_MULTIPLY 0x81000437 /* * on numeric keypad */ +#define DIKEYBOARD_LMENU 0x81000438 /* left Alt */ +#define DIKEYBOARD_SPACE 0x81000439 +#define DIKEYBOARD_CAPITAL 0x8100043A +#define DIKEYBOARD_F1 0x8100043B +#define DIKEYBOARD_F2 0x8100043C +#define DIKEYBOARD_F3 0x8100043D +#define DIKEYBOARD_F4 0x8100043E +#define DIKEYBOARD_F5 0x8100043F +#define DIKEYBOARD_F6 0x81000440 +#define DIKEYBOARD_F7 0x81000441 +#define DIKEYBOARD_F8 0x81000442 +#define DIKEYBOARD_F9 0x81000443 +#define DIKEYBOARD_F10 0x81000444 +#define DIKEYBOARD_NUMLOCK 0x81000445 +#define DIKEYBOARD_SCROLL 0x81000446 /* Scroll Lock */ +#define DIKEYBOARD_NUMPAD7 0x81000447 +#define DIKEYBOARD_NUMPAD8 0x81000448 +#define DIKEYBOARD_NUMPAD9 0x81000449 +#define DIKEYBOARD_SUBTRACT 0x8100044A /* - on numeric keypad */ +#define DIKEYBOARD_NUMPAD4 0x8100044B +#define DIKEYBOARD_NUMPAD5 0x8100044C +#define DIKEYBOARD_NUMPAD6 0x8100044D +#define DIKEYBOARD_ADD 0x8100044E /* + on numeric keypad */ +#define DIKEYBOARD_NUMPAD1 0x8100044F +#define DIKEYBOARD_NUMPAD2 0x81000450 +#define DIKEYBOARD_NUMPAD3 0x81000451 +#define DIKEYBOARD_NUMPAD0 0x81000452 +#define DIKEYBOARD_DECIMAL 0x81000453 /* . on numeric keypad */ +#define DIKEYBOARD_OEM_102 0x81000456 /* <> or \| on RT 102-key keyboard (Non-U.S.) */ +#define DIKEYBOARD_F11 0x81000457 +#define DIKEYBOARD_F12 0x81000458 +#define DIKEYBOARD_F13 0x81000464 /* (NEC PC98) */ +#define DIKEYBOARD_F14 0x81000465 /* (NEC PC98) */ +#define DIKEYBOARD_F15 0x81000466 /* (NEC PC98) */ +#define DIKEYBOARD_KANA 0x81000470 /* (Japanese keyboard) */ +#define DIKEYBOARD_ABNT_C1 0x81000473 /* /? on Brazilian keyboard */ +#define DIKEYBOARD_CONVERT 0x81000479 /* (Japanese keyboard) */ +#define DIKEYBOARD_NOCONVERT 0x8100047B /* (Japanese keyboard) */ +#define DIKEYBOARD_YEN 0x8100047D /* (Japanese keyboard) */ +#define DIKEYBOARD_ABNT_C2 0x8100047E /* Numpad . on Brazilian keyboard */ +#define DIKEYBOARD_NUMPADEQUALS 0x8100048D /* = on numeric keypad (NEC PC98) */ +#define DIKEYBOARD_PREVTRACK 0x81000490 /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */ +#define DIKEYBOARD_AT 0x81000491 /* (NEC PC98) */ +#define DIKEYBOARD_COLON 0x81000492 /* (NEC PC98) */ +#define DIKEYBOARD_UNDERLINE 0x81000493 /* (NEC PC98) */ +#define DIKEYBOARD_KANJI 0x81000494 /* (Japanese keyboard) */ +#define DIKEYBOARD_STOP 0x81000495 /* (NEC PC98) */ +#define DIKEYBOARD_AX 0x81000496 /* (Japan AX) */ +#define DIKEYBOARD_UNLABELED 0x81000497 /* (J3100) */ +#define DIKEYBOARD_NEXTTRACK 0x81000499 /* Next Track */ +#define DIKEYBOARD_NUMPADENTER 0x8100049C /* Enter on numeric keypad */ +#define DIKEYBOARD_RCONTROL 0x8100049D +#define DIKEYBOARD_MUTE 0x810004A0 /* Mute */ +#define DIKEYBOARD_CALCULATOR 0x810004A1 /* Calculator */ +#define DIKEYBOARD_PLAYPAUSE 0x810004A2 /* Play / Pause */ +#define DIKEYBOARD_MEDIASTOP 0x810004A4 /* Media Stop */ +#define DIKEYBOARD_VOLUMEDOWN 0x810004AE /* Volume - */ +#define DIKEYBOARD_VOLUMEUP 0x810004B0 /* Volume + */ +#define DIKEYBOARD_WEBHOME 0x810004B2 /* Web home */ +#define DIKEYBOARD_NUMPADCOMMA 0x810004B3 /* , on numeric keypad (NEC PC98) */ +#define DIKEYBOARD_DIVIDE 0x810004B5 /* / on numeric keypad */ +#define DIKEYBOARD_SYSRQ 0x810004B7 +#define DIKEYBOARD_RMENU 0x810004B8 /* right Alt */ +#define DIKEYBOARD_PAUSE 0x810004C5 /* Pause */ +#define DIKEYBOARD_HOME 0x810004C7 /* Home on arrow keypad */ +#define DIKEYBOARD_UP 0x810004C8 /* UpArrow on arrow keypad */ +#define DIKEYBOARD_PRIOR 0x810004C9 /* PgUp on arrow keypad */ +#define DIKEYBOARD_LEFT 0x810004CB /* LeftArrow on arrow keypad */ +#define DIKEYBOARD_RIGHT 0x810004CD /* RightArrow on arrow keypad */ +#define DIKEYBOARD_END 0x810004CF /* End on arrow keypad */ +#define DIKEYBOARD_DOWN 0x810004D0 /* DownArrow on arrow keypad */ +#define DIKEYBOARD_NEXT 0x810004D1 /* PgDn on arrow keypad */ +#define DIKEYBOARD_INSERT 0x810004D2 /* Insert on arrow keypad */ +#define DIKEYBOARD_DELETE 0x810004D3 /* Delete on arrow keypad */ +#define DIKEYBOARD_LWIN 0x810004DB /* Left Windows key */ +#define DIKEYBOARD_RWIN 0x810004DC /* Right Windows key */ +#define DIKEYBOARD_APPS 0x810004DD /* AppMenu key */ +#define DIKEYBOARD_POWER 0x810004DE /* System Power */ +#define DIKEYBOARD_SLEEP 0x810004DF /* System Sleep */ +#define DIKEYBOARD_WAKE 0x810004E3 /* System Wake */ +#define DIKEYBOARD_WEBSEARCH 0x810004E5 /* Web Search */ +#define DIKEYBOARD_WEBFAVORITES 0x810004E6 /* Web Favorites */ +#define DIKEYBOARD_WEBREFRESH 0x810004E7 /* Web Refresh */ +#define DIKEYBOARD_WEBSTOP 0x810004E8 /* Web Stop */ +#define DIKEYBOARD_WEBFORWARD 0x810004E9 /* Web Forward */ +#define DIKEYBOARD_WEBBACK 0x810004EA /* Web Back */ +#define DIKEYBOARD_MYCOMPUTER 0x810004EB /* My Computer */ +#define DIKEYBOARD_MAIL 0x810004EC /* Mail */ +#define DIKEYBOARD_MEDIASELECT 0x810004ED /* Media Select */ + + +/*--- MOUSE + Physical Mouse Device ---*/ + +#define DIMOUSE_XAXISAB (0x82000200 |DIMOFS_X ) /* X Axis-absolute: Some mice natively report absolute coordinates */ +#define DIMOUSE_YAXISAB (0x82000200 |DIMOFS_Y ) /* Y Axis-absolute: Some mice natively report absolute coordinates */ +#define DIMOUSE_XAXIS (0x82000300 |DIMOFS_X ) /* X Axis */ +#define DIMOUSE_YAXIS (0x82000300 |DIMOFS_Y ) /* Y Axis */ +#define DIMOUSE_WHEEL (0x82000300 |DIMOFS_Z ) /* Z Axis */ +#define DIMOUSE_BUTTON0 (0x82000400 |DIMOFS_BUTTON0) /* Button 0 */ +#define DIMOUSE_BUTTON1 (0x82000400 |DIMOFS_BUTTON1) /* Button 1 */ +#define DIMOUSE_BUTTON2 (0x82000400 |DIMOFS_BUTTON2) /* Button 2 */ +#define DIMOUSE_BUTTON3 (0x82000400 |DIMOFS_BUTTON3) /* Button 3 */ +#define DIMOUSE_BUTTON4 (0x82000400 |DIMOFS_BUTTON4) /* Button 4 */ +#define DIMOUSE_BUTTON5 (0x82000400 |DIMOFS_BUTTON5) /* Button 5 */ +#define DIMOUSE_BUTTON6 (0x82000400 |DIMOFS_BUTTON6) /* Button 6 */ +#define DIMOUSE_BUTTON7 (0x82000400 |DIMOFS_BUTTON7) /* Button 7 */ + + +/*--- VOICE + Physical Dplay Voice Device ---*/ + +#define DIVOICE_CHANNEL1 0x83000401 +#define DIVOICE_CHANNEL2 0x83000402 +#define DIVOICE_CHANNEL3 0x83000403 +#define DIVOICE_CHANNEL4 0x83000404 +#define DIVOICE_CHANNEL5 0x83000405 +#define DIVOICE_CHANNEL6 0x83000406 +#define DIVOICE_CHANNEL7 0x83000407 +#define DIVOICE_CHANNEL8 0x83000408 +#define DIVOICE_TEAM 0x83000409 +#define DIVOICE_ALL 0x8300040A +#define DIVOICE_RECORDMUTE 0x8300040B +#define DIVOICE_PLAYBACKMUTE 0x8300040C +#define DIVOICE_TRANSMIT 0x8300040D + +#define DIVOICE_VOICECOMMAND 0x83000410 + + +/*--- Driving Simulator - Racing + Vehicle control is primary objective ---*/ +#define DIVIRTUAL_DRIVING_RACE 0x01000000 +#define DIAXIS_DRIVINGR_STEER 0x01008A01 /* Steering */ +#define DIAXIS_DRIVINGR_ACCELERATE 0x01039202 /* Accelerate */ +#define DIAXIS_DRIVINGR_BRAKE 0x01041203 /* Brake-Axis */ +#define DIBUTTON_DRIVINGR_SHIFTUP 0x01000C01 /* Shift to next higher gear */ +#define DIBUTTON_DRIVINGR_SHIFTDOWN 0x01000C02 /* Shift to next lower gear */ +#define DIBUTTON_DRIVINGR_VIEW 0x01001C03 /* Cycle through view options */ +#define DIBUTTON_DRIVINGR_MENU 0x010004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIAXIS_DRIVINGR_ACCEL_AND_BRAKE 0x01014A04 /* Some devices combine accelerate and brake in a single axis */ +#define DIHATSWITCH_DRIVINGR_GLANCE 0x01004601 /* Look around */ +#define DIBUTTON_DRIVINGR_BRAKE 0x01004C04 /* Brake-button */ +#define DIBUTTON_DRIVINGR_DASHBOARD 0x01004405 /* Select next dashboard option */ +#define DIBUTTON_DRIVINGR_AIDS 0x01004406 /* Driver correction aids */ +#define DIBUTTON_DRIVINGR_MAP 0x01004407 /* Display Driving Map */ +#define DIBUTTON_DRIVINGR_BOOST 0x01004408 /* Turbo Boost */ +#define DIBUTTON_DRIVINGR_PIT 0x01004409 /* Pit stop notification */ +#define DIBUTTON_DRIVINGR_ACCELERATE_LINK 0x0103D4E0 /* Fallback Accelerate button */ +#define DIBUTTON_DRIVINGR_STEER_LEFT_LINK 0x0100CCE4 /* Fallback Steer Left button */ +#define DIBUTTON_DRIVINGR_STEER_RIGHT_LINK 0x0100CCEC /* Fallback Steer Right button */ +#define DIBUTTON_DRIVINGR_GLANCE_LEFT_LINK 0x0107C4E4 /* Fallback Glance Left button */ +#define DIBUTTON_DRIVINGR_GLANCE_RIGHT_LINK 0x0107C4EC /* Fallback Glance Right button */ +#define DIBUTTON_DRIVINGR_DEVICE 0x010044FE /* Show input device and controls */ +#define DIBUTTON_DRIVINGR_PAUSE 0x010044FC /* Start / Pause / Restart game */ + +/*--- Driving Simulator - Combat + Combat from within a vehicle is primary objective ---*/ +#define DIVIRTUAL_DRIVING_COMBAT 0x02000000 +#define DIAXIS_DRIVINGC_STEER 0x02008A01 /* Steering */ +#define DIAXIS_DRIVINGC_ACCELERATE 0x02039202 /* Accelerate */ +#define DIAXIS_DRIVINGC_BRAKE 0x02041203 /* Brake-axis */ +#define DIBUTTON_DRIVINGC_FIRE 0x02000C01 /* Fire */ +#define DIBUTTON_DRIVINGC_WEAPONS 0x02000C02 /* Select next weapon */ +#define DIBUTTON_DRIVINGC_TARGET 0x02000C03 /* Select next available target */ +#define DIBUTTON_DRIVINGC_MENU 0x020004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIAXIS_DRIVINGC_ACCEL_AND_BRAKE 0x02014A04 /* Some devices combine accelerate and brake in a single axis */ +#define DIHATSWITCH_DRIVINGC_GLANCE 0x02004601 /* Look around */ +#define DIBUTTON_DRIVINGC_SHIFTUP 0x02004C04 /* Shift to next higher gear */ +#define DIBUTTON_DRIVINGC_SHIFTDOWN 0x02004C05 /* Shift to next lower gear */ +#define DIBUTTON_DRIVINGC_DASHBOARD 0x02004406 /* Select next dashboard option */ +#define DIBUTTON_DRIVINGC_AIDS 0x02004407 /* Driver correction aids */ +#define DIBUTTON_DRIVINGC_BRAKE 0x02004C08 /* Brake-button */ +#define DIBUTTON_DRIVINGC_FIRESECONDARY 0x02004C09 /* Alternative fire button */ +#define DIBUTTON_DRIVINGC_ACCELERATE_LINK 0x0203D4E0 /* Fallback Accelerate button */ +#define DIBUTTON_DRIVINGC_STEER_LEFT_LINK 0x0200CCE4 /* Fallback Steer Left button */ +#define DIBUTTON_DRIVINGC_STEER_RIGHT_LINK 0x0200CCEC /* Fallback Steer Right button */ +#define DIBUTTON_DRIVINGC_GLANCE_LEFT_LINK 0x0207C4E4 /* Fallback Glance Left button */ +#define DIBUTTON_DRIVINGC_GLANCE_RIGHT_LINK 0x0207C4EC /* Fallback Glance Right button */ +#define DIBUTTON_DRIVINGC_DEVICE 0x020044FE /* Show input device and controls */ +#define DIBUTTON_DRIVINGC_PAUSE 0x020044FC /* Start / Pause / Restart game */ + +/*--- Driving Simulator - Tank + Combat from withing a tank is primary objective ---*/ +#define DIVIRTUAL_DRIVING_TANK 0x03000000 +#define DIAXIS_DRIVINGT_STEER 0x03008A01 /* Turn tank left / right */ +#define DIAXIS_DRIVINGT_BARREL 0x03010202 /* Raise / lower barrel */ +#define DIAXIS_DRIVINGT_ACCELERATE 0x03039203 /* Accelerate */ +#define DIAXIS_DRIVINGT_ROTATE 0x03020204 /* Turn barrel left / right */ +#define DIBUTTON_DRIVINGT_FIRE 0x03000C01 /* Fire */ +#define DIBUTTON_DRIVINGT_WEAPONS 0x03000C02 /* Select next weapon */ +#define DIBUTTON_DRIVINGT_TARGET 0x03000C03 /* Selects next available target */ +#define DIBUTTON_DRIVINGT_MENU 0x030004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_DRIVINGT_GLANCE 0x03004601 /* Look around */ +#define DIAXIS_DRIVINGT_BRAKE 0x03045205 /* Brake-axis */ +#define DIAXIS_DRIVINGT_ACCEL_AND_BRAKE 0x03014A06 /* Some devices combine accelerate and brake in a single axis */ +#define DIBUTTON_DRIVINGT_VIEW 0x03005C04 /* Cycle through view options */ +#define DIBUTTON_DRIVINGT_DASHBOARD 0x03005C05 /* Select next dashboard option */ +#define DIBUTTON_DRIVINGT_BRAKE 0x03004C06 /* Brake-button */ +#define DIBUTTON_DRIVINGT_FIRESECONDARY 0x03004C07 /* Alternative fire button */ +#define DIBUTTON_DRIVINGT_ACCELERATE_LINK 0x0303D4E0 /* Fallback Accelerate button */ +#define DIBUTTON_DRIVINGT_STEER_LEFT_LINK 0x0300CCE4 /* Fallback Steer Left button */ +#define DIBUTTON_DRIVINGT_STEER_RIGHT_LINK 0x0300CCEC /* Fallback Steer Right button */ +#define DIBUTTON_DRIVINGT_BARREL_UP_LINK 0x030144E0 /* Fallback Barrel up button */ +#define DIBUTTON_DRIVINGT_BARREL_DOWN_LINK 0x030144E8 /* Fallback Barrel down button */ +#define DIBUTTON_DRIVINGT_ROTATE_LEFT_LINK 0x030244E4 /* Fallback Rotate left button */ +#define DIBUTTON_DRIVINGT_ROTATE_RIGHT_LINK 0x030244EC /* Fallback Rotate right button */ +#define DIBUTTON_DRIVINGT_GLANCE_LEFT_LINK 0x0307C4E4 /* Fallback Glance Left button */ +#define DIBUTTON_DRIVINGT_GLANCE_RIGHT_LINK 0x0307C4EC /* Fallback Glance Right button */ +#define DIBUTTON_DRIVINGT_DEVICE 0x030044FE /* Show input device and controls */ +#define DIBUTTON_DRIVINGT_PAUSE 0x030044FC /* Start / Pause / Restart game */ + +/*--- Flight Simulator - Civilian + Plane control is the primary objective ---*/ +#define DIVIRTUAL_FLYING_CIVILIAN 0x04000000 +#define DIAXIS_FLYINGC_BANK 0x04008A01 /* Roll ship left / right */ +#define DIAXIS_FLYINGC_PITCH 0x04010A02 /* Nose up / down */ +#define DIAXIS_FLYINGC_THROTTLE 0x04039203 /* Throttle */ +#define DIBUTTON_FLYINGC_VIEW 0x04002401 /* Cycle through view options */ +#define DIBUTTON_FLYINGC_DISPLAY 0x04002402 /* Select next dashboard / heads up display option */ +#define DIBUTTON_FLYINGC_GEAR 0x04002C03 /* Gear up / down */ +#define DIBUTTON_FLYINGC_MENU 0x040004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_FLYINGC_GLANCE 0x04004601 /* Look around */ +#define DIAXIS_FLYINGC_BRAKE 0x04046A04 /* Apply Brake */ +#define DIAXIS_FLYINGC_RUDDER 0x04025205 /* Yaw ship left/right */ +#define DIAXIS_FLYINGC_FLAPS 0x04055A06 /* Flaps */ +#define DIBUTTON_FLYINGC_FLAPSUP 0x04006404 /* Increment stepping up until fully retracted */ +#define DIBUTTON_FLYINGC_FLAPSDOWN 0x04006405 /* Decrement stepping down until fully extended */ +#define DIBUTTON_FLYINGC_BRAKE_LINK 0x04046CE0 /* Fallback brake button */ +#define DIBUTTON_FLYINGC_FASTER_LINK 0x0403D4E0 /* Fallback throttle up button */ +#define DIBUTTON_FLYINGC_SLOWER_LINK 0x0403D4E8 /* Fallback throttle down button */ +#define DIBUTTON_FLYINGC_GLANCE_LEFT_LINK 0x0407C4E4 /* Fallback Glance Left button */ +#define DIBUTTON_FLYINGC_GLANCE_RIGHT_LINK 0x0407C4EC /* Fallback Glance Right button */ +#define DIBUTTON_FLYINGC_GLANCE_UP_LINK 0x0407C4E0 /* Fallback Glance Up button */ +#define DIBUTTON_FLYINGC_GLANCE_DOWN_LINK 0x0407C4E8 /* Fallback Glance Down button */ +#define DIBUTTON_FLYINGC_DEVICE 0x040044FE /* Show input device and controls */ +#define DIBUTTON_FLYINGC_PAUSE 0x040044FC /* Start / Pause / Restart game */ + +/*--- Flight Simulator - Military + Aerial combat is the primary objective ---*/ +#define DIVIRTUAL_FLYING_MILITARY 0x05000000 +#define DIAXIS_FLYINGM_BANK 0x05008A01 /* Bank - Roll ship left / right */ +#define DIAXIS_FLYINGM_PITCH 0x05010A02 /* Pitch - Nose up / down */ +#define DIAXIS_FLYINGM_THROTTLE 0x05039203 /* Throttle - faster / slower */ +#define DIBUTTON_FLYINGM_FIRE 0x05000C01 /* Fire */ +#define DIBUTTON_FLYINGM_WEAPONS 0x05000C02 /* Select next weapon */ +#define DIBUTTON_FLYINGM_TARGET 0x05000C03 /* Selects next available target */ +#define DIBUTTON_FLYINGM_MENU 0x050004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_FLYINGM_GLANCE 0x05004601 /* Look around */ +#define DIBUTTON_FLYINGM_COUNTER 0x05005C04 /* Activate counter measures */ +#define DIAXIS_FLYINGM_RUDDER 0x05024A04 /* Rudder - Yaw ship left/right */ +#define DIAXIS_FLYINGM_BRAKE 0x05046205 /* Brake-axis */ +#define DIBUTTON_FLYINGM_VIEW 0x05006405 /* Cycle through view options */ +#define DIBUTTON_FLYINGM_DISPLAY 0x05006406 /* Select next dashboard option */ +#define DIAXIS_FLYINGM_FLAPS 0x05055206 /* Flaps */ +#define DIBUTTON_FLYINGM_FLAPSUP 0x05005407 /* Increment stepping up until fully retracted */ +#define DIBUTTON_FLYINGM_FLAPSDOWN 0x05005408 /* Decrement stepping down until fully extended */ +#define DIBUTTON_FLYINGM_FIRESECONDARY 0x05004C09 /* Alternative fire button */ +#define DIBUTTON_FLYINGM_GEAR 0x0500640A /* Gear up / down */ +#define DIBUTTON_FLYINGM_BRAKE_LINK 0x050464E0 /* Fallback brake button */ +#define DIBUTTON_FLYINGM_FASTER_LINK 0x0503D4E0 /* Fallback throttle up button */ +#define DIBUTTON_FLYINGM_SLOWER_LINK 0x0503D4E8 /* Fallback throttle down button */ +#define DIBUTTON_FLYINGM_GLANCE_LEFT_LINK 0x0507C4E4 /* Fallback Glance Left button */ +#define DIBUTTON_FLYINGM_GLANCE_RIGHT_LINK 0x0507C4EC /* Fallback Glance Right button */ +#define DIBUTTON_FLYINGM_GLANCE_UP_LINK 0x0507C4E0 /* Fallback Glance Up button */ +#define DIBUTTON_FLYINGM_GLANCE_DOWN_LINK 0x0507C4E8 /* Fallback Glance Down button */ +#define DIBUTTON_FLYINGM_DEVICE 0x050044FE /* Show input device and controls */ +#define DIBUTTON_FLYINGM_PAUSE 0x050044FC /* Start / Pause / Restart game */ + +/*--- Flight Simulator - Combat Helicopter + Combat from helicopter is primary objective ---*/ +#define DIVIRTUAL_FLYING_HELICOPTER 0x06000000 +#define DIAXIS_FLYINGH_BANK 0x06008A01 /* Bank - Roll ship left / right */ +#define DIAXIS_FLYINGH_PITCH 0x06010A02 /* Pitch - Nose up / down */ +#define DIAXIS_FLYINGH_COLLECTIVE 0x06018A03 /* Collective - Blade pitch/power */ +#define DIBUTTON_FLYINGH_FIRE 0x06001401 /* Fire */ +#define DIBUTTON_FLYINGH_WEAPONS 0x06001402 /* Select next weapon */ +#define DIBUTTON_FLYINGH_TARGET 0x06001403 /* Selects next available target */ +#define DIBUTTON_FLYINGH_MENU 0x060004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_FLYINGH_GLANCE 0x06004601 /* Look around */ +#define DIAXIS_FLYINGH_TORQUE 0x06025A04 /* Torque - Rotate ship around left / right axis */ +#define DIAXIS_FLYINGH_THROTTLE 0x0603DA05 /* Throttle */ +#define DIBUTTON_FLYINGH_COUNTER 0x06005404 /* Activate counter measures */ +#define DIBUTTON_FLYINGH_VIEW 0x06006405 /* Cycle through view options */ +#define DIBUTTON_FLYINGH_GEAR 0x06006406 /* Gear up / down */ +#define DIBUTTON_FLYINGH_FIRESECONDARY 0x06004C07 /* Alternative fire button */ +#define DIBUTTON_FLYINGH_FASTER_LINK 0x0603DCE0 /* Fallback throttle up button */ +#define DIBUTTON_FLYINGH_SLOWER_LINK 0x0603DCE8 /* Fallback throttle down button */ +#define DIBUTTON_FLYINGH_GLANCE_LEFT_LINK 0x0607C4E4 /* Fallback Glance Left button */ +#define DIBUTTON_FLYINGH_GLANCE_RIGHT_LINK 0x0607C4EC /* Fallback Glance Right button */ +#define DIBUTTON_FLYINGH_GLANCE_UP_LINK 0x0607C4E0 /* Fallback Glance Up button */ +#define DIBUTTON_FLYINGH_GLANCE_DOWN_LINK 0x0607C4E8 /* Fallback Glance Down button */ +#define DIBUTTON_FLYINGH_DEVICE 0x060044FE /* Show input device and controls */ +#define DIBUTTON_FLYINGH_PAUSE 0x060044FC /* Start / Pause / Restart game */ + +/*--- Space Simulator - Combat + Space Simulator with weapons ---*/ +#define DIVIRTUAL_SPACESIM 0x07000000 +#define DIAXIS_SPACESIM_LATERAL 0x07008201 /* Move ship left / right */ +#define DIAXIS_SPACESIM_MOVE 0x07010202 /* Move ship forward/backward */ +#define DIAXIS_SPACESIM_THROTTLE 0x07038203 /* Throttle - Engine speed */ +#define DIBUTTON_SPACESIM_FIRE 0x07000401 /* Fire */ +#define DIBUTTON_SPACESIM_WEAPONS 0x07000402 /* Select next weapon */ +#define DIBUTTON_SPACESIM_TARGET 0x07000403 /* Selects next available target */ +#define DIBUTTON_SPACESIM_MENU 0x070004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_SPACESIM_GLANCE 0x07004601 /* Look around */ +#define DIAXIS_SPACESIM_CLIMB 0x0701C204 /* Climb - Pitch ship up/down */ +#define DIAXIS_SPACESIM_ROTATE 0x07024205 /* Rotate - Turn ship left/right */ +#define DIBUTTON_SPACESIM_VIEW 0x07004404 /* Cycle through view options */ +#define DIBUTTON_SPACESIM_DISPLAY 0x07004405 /* Select next dashboard / heads up display option */ +#define DIBUTTON_SPACESIM_RAISE 0x07004406 /* Raise ship while maintaining current pitch */ +#define DIBUTTON_SPACESIM_LOWER 0x07004407 /* Lower ship while maintaining current pitch */ +#define DIBUTTON_SPACESIM_GEAR 0x07004408 /* Gear up / down */ +#define DIBUTTON_SPACESIM_FIRESECONDARY 0x07004409 /* Alternative fire button */ +#define DIBUTTON_SPACESIM_LEFT_LINK 0x0700C4E4 /* Fallback move left button */ +#define DIBUTTON_SPACESIM_RIGHT_LINK 0x0700C4EC /* Fallback move right button */ +#define DIBUTTON_SPACESIM_FORWARD_LINK 0x070144E0 /* Fallback move forward button */ +#define DIBUTTON_SPACESIM_BACKWARD_LINK 0x070144E8 /* Fallback move backwards button */ +#define DIBUTTON_SPACESIM_FASTER_LINK 0x0703C4E0 /* Fallback throttle up button */ +#define DIBUTTON_SPACESIM_SLOWER_LINK 0x0703C4E8 /* Fallback throttle down button */ +#define DIBUTTON_SPACESIM_TURN_LEFT_LINK 0x070244E4 /* Fallback turn left button */ +#define DIBUTTON_SPACESIM_TURN_RIGHT_LINK 0x070244EC /* Fallback turn right button */ +#define DIBUTTON_SPACESIM_GLANCE_LEFT_LINK 0x0707C4E4 /* Fallback Glance Left button */ +#define DIBUTTON_SPACESIM_GLANCE_RIGHT_LINK 0x0707C4EC /* Fallback Glance Right button */ +#define DIBUTTON_SPACESIM_GLANCE_UP_LINK 0x0707C4E0 /* Fallback Glance Up button */ +#define DIBUTTON_SPACESIM_GLANCE_DOWN_LINK 0x0707C4E8 /* Fallback Glance Down button */ +#define DIBUTTON_SPACESIM_DEVICE 0x070044FE /* Show input device and controls */ +#define DIBUTTON_SPACESIM_PAUSE 0x070044FC /* Start / Pause / Restart game */ + +/*--- Fighting - First Person + Hand to Hand combat is primary objective ---*/ +#define DIVIRTUAL_FIGHTING_HAND2HAND 0x08000000 +#define DIAXIS_FIGHTINGH_LATERAL 0x08008201 /* Sidestep left/right */ +#define DIAXIS_FIGHTINGH_MOVE 0x08010202 /* Move forward/backward */ +#define DIBUTTON_FIGHTINGH_PUNCH 0x08000401 /* Punch */ +#define DIBUTTON_FIGHTINGH_KICK 0x08000402 /* Kick */ +#define DIBUTTON_FIGHTINGH_BLOCK 0x08000403 /* Block */ +#define DIBUTTON_FIGHTINGH_CROUCH 0x08000404 /* Crouch */ +#define DIBUTTON_FIGHTINGH_JUMP 0x08000405 /* Jump */ +#define DIBUTTON_FIGHTINGH_SPECIAL1 0x08000406 /* Apply first special move */ +#define DIBUTTON_FIGHTINGH_SPECIAL2 0x08000407 /* Apply second special move */ +#define DIBUTTON_FIGHTINGH_MENU 0x080004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_FIGHTINGH_SELECT 0x08004408 /* Select special move */ +#define DIHATSWITCH_FIGHTINGH_SLIDE 0x08004601 /* Look around */ +#define DIBUTTON_FIGHTINGH_DISPLAY 0x08004409 /* Shows next on-screen display option */ +#define DIAXIS_FIGHTINGH_ROTATE 0x08024203 /* Rotate - Turn body left/right */ +#define DIBUTTON_FIGHTINGH_DODGE 0x0800440A /* Dodge */ +#define DIBUTTON_FIGHTINGH_LEFT_LINK 0x0800C4E4 /* Fallback left sidestep button */ +#define DIBUTTON_FIGHTINGH_RIGHT_LINK 0x0800C4EC /* Fallback right sidestep button */ +#define DIBUTTON_FIGHTINGH_FORWARD_LINK 0x080144E0 /* Fallback forward button */ +#define DIBUTTON_FIGHTINGH_BACKWARD_LINK 0x080144E8 /* Fallback backward button */ +#define DIBUTTON_FIGHTINGH_DEVICE 0x080044FE /* Show input device and controls */ +#define DIBUTTON_FIGHTINGH_PAUSE 0x080044FC /* Start / Pause / Restart game */ + +/*--- Fighting - First Person Shooting + Navigation and combat are primary objectives ---*/ +#define DIVIRTUAL_FIGHTING_FPS 0x09000000 +#define DIAXIS_FPS_ROTATE 0x09008201 /* Rotate character left/right */ +#define DIAXIS_FPS_MOVE 0x09010202 /* Move forward/backward */ +#define DIBUTTON_FPS_FIRE 0x09000401 /* Fire */ +#define DIBUTTON_FPS_WEAPONS 0x09000402 /* Select next weapon */ +#define DIBUTTON_FPS_APPLY 0x09000403 /* Use item */ +#define DIBUTTON_FPS_SELECT 0x09000404 /* Select next inventory item */ +#define DIBUTTON_FPS_CROUCH 0x09000405 /* Crouch/ climb down/ swim down */ +#define DIBUTTON_FPS_JUMP 0x09000406 /* Jump/ climb up/ swim up */ +#define DIAXIS_FPS_LOOKUPDOWN 0x09018203 /* Look up / down */ +#define DIBUTTON_FPS_STRAFE 0x09000407 /* Enable strafing while active */ +#define DIBUTTON_FPS_MENU 0x090004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_FPS_GLANCE 0x09004601 /* Look around */ +#define DIBUTTON_FPS_DISPLAY 0x09004408 /* Shows next on-screen display option/ map */ +#define DIAXIS_FPS_SIDESTEP 0x09024204 /* Sidestep */ +#define DIBUTTON_FPS_DODGE 0x09004409 /* Dodge */ +#define DIBUTTON_FPS_GLANCEL 0x0900440A /* Glance Left */ +#define DIBUTTON_FPS_GLANCER 0x0900440B /* Glance Right */ +#define DIBUTTON_FPS_FIRESECONDARY 0x0900440C /* Alternative fire button */ +#define DIBUTTON_FPS_ROTATE_LEFT_LINK 0x0900C4E4 /* Fallback rotate left button */ +#define DIBUTTON_FPS_ROTATE_RIGHT_LINK 0x0900C4EC /* Fallback rotate right button */ +#define DIBUTTON_FPS_FORWARD_LINK 0x090144E0 /* Fallback forward button */ +#define DIBUTTON_FPS_BACKWARD_LINK 0x090144E8 /* Fallback backward button */ +#define DIBUTTON_FPS_GLANCE_UP_LINK 0x0901C4E0 /* Fallback look up button */ +#define DIBUTTON_FPS_GLANCE_DOWN_LINK 0x0901C4E8 /* Fallback look down button */ +#define DIBUTTON_FPS_STEP_LEFT_LINK 0x090244E4 /* Fallback step left button */ +#define DIBUTTON_FPS_STEP_RIGHT_LINK 0x090244EC /* Fallback step right button */ +#define DIBUTTON_FPS_DEVICE 0x090044FE /* Show input device and controls */ +#define DIBUTTON_FPS_PAUSE 0x090044FC /* Start / Pause / Restart game */ + +/*--- Fighting - Third Person action + Perspective of camera is behind the main character ---*/ +#define DIVIRTUAL_FIGHTING_THIRDPERSON 0x0A000000 +#define DIAXIS_TPS_TURN 0x0A020201 /* Turn left/right */ +#define DIAXIS_TPS_MOVE 0x0A010202 /* Move forward/backward */ +#define DIBUTTON_TPS_RUN 0x0A000401 /* Run or walk toggle switch */ +#define DIBUTTON_TPS_ACTION 0x0A000402 /* Action Button */ +#define DIBUTTON_TPS_SELECT 0x0A000403 /* Select next weapon */ +#define DIBUTTON_TPS_USE 0x0A000404 /* Use inventory item currently selected */ +#define DIBUTTON_TPS_JUMP 0x0A000405 /* Character Jumps */ +#define DIBUTTON_TPS_MENU 0x0A0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_TPS_GLANCE 0x0A004601 /* Look around */ +#define DIBUTTON_TPS_VIEW 0x0A004406 /* Select camera view */ +#define DIBUTTON_TPS_STEPLEFT 0x0A004407 /* Character takes a left step */ +#define DIBUTTON_TPS_STEPRIGHT 0x0A004408 /* Character takes a right step */ +#define DIAXIS_TPS_STEP 0x0A00C203 /* Character steps left/right */ +#define DIBUTTON_TPS_DODGE 0x0A004409 /* Character dodges or ducks */ +#define DIBUTTON_TPS_INVENTORY 0x0A00440A /* Cycle through inventory */ +#define DIBUTTON_TPS_TURN_LEFT_LINK 0x0A0244E4 /* Fallback turn left button */ +#define DIBUTTON_TPS_TURN_RIGHT_LINK 0x0A0244EC /* Fallback turn right button */ +#define DIBUTTON_TPS_FORWARD_LINK 0x0A0144E0 /* Fallback forward button */ +#define DIBUTTON_TPS_BACKWARD_LINK 0x0A0144E8 /* Fallback backward button */ +#define DIBUTTON_TPS_GLANCE_UP_LINK 0x0A07C4E0 /* Fallback look up button */ +#define DIBUTTON_TPS_GLANCE_DOWN_LINK 0x0A07C4E8 /* Fallback look down button */ +#define DIBUTTON_TPS_GLANCE_LEFT_LINK 0x0A07C4E4 /* Fallback glance up button */ +#define DIBUTTON_TPS_GLANCE_RIGHT_LINK 0x0A07C4EC /* Fallback glance right button */ +#define DIBUTTON_TPS_DEVICE 0x0A0044FE /* Show input device and controls */ +#define DIBUTTON_TPS_PAUSE 0x0A0044FC /* Start / Pause / Restart game */ + +/*--- Strategy - Role Playing + Navigation and problem solving are primary actions ---*/ +#define DIVIRTUAL_STRATEGY_ROLEPLAYING 0x0B000000 +#define DIAXIS_STRATEGYR_LATERAL 0x0B008201 /* sidestep - left/right */ +#define DIAXIS_STRATEGYR_MOVE 0x0B010202 /* move forward/backward */ +#define DIBUTTON_STRATEGYR_GET 0x0B000401 /* Acquire item */ +#define DIBUTTON_STRATEGYR_APPLY 0x0B000402 /* Use selected item */ +#define DIBUTTON_STRATEGYR_SELECT 0x0B000403 /* Select nextitem */ +#define DIBUTTON_STRATEGYR_ATTACK 0x0B000404 /* Attack */ +#define DIBUTTON_STRATEGYR_CAST 0x0B000405 /* Cast Spell */ +#define DIBUTTON_STRATEGYR_CROUCH 0x0B000406 /* Crouch */ +#define DIBUTTON_STRATEGYR_JUMP 0x0B000407 /* Jump */ +#define DIBUTTON_STRATEGYR_MENU 0x0B0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_STRATEGYR_GLANCE 0x0B004601 /* Look around */ +#define DIBUTTON_STRATEGYR_MAP 0x0B004408 /* Cycle through map options */ +#define DIBUTTON_STRATEGYR_DISPLAY 0x0B004409 /* Shows next on-screen display option */ +#define DIAXIS_STRATEGYR_ROTATE 0x0B024203 /* Turn body left/right */ +#define DIBUTTON_STRATEGYR_LEFT_LINK 0x0B00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_STRATEGYR_RIGHT_LINK 0x0B00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_STRATEGYR_FORWARD_LINK 0x0B0144E0 /* Fallback move forward button */ +#define DIBUTTON_STRATEGYR_BACK_LINK 0x0B0144E8 /* Fallback move backward button */ +#define DIBUTTON_STRATEGYR_ROTATE_LEFT_LINK 0x0B0244E4 /* Fallback turn body left button */ +#define DIBUTTON_STRATEGYR_ROTATE_RIGHT_LINK 0x0B0244EC /* Fallback turn body right button */ +#define DIBUTTON_STRATEGYR_DEVICE 0x0B0044FE /* Show input device and controls */ +#define DIBUTTON_STRATEGYR_PAUSE 0x0B0044FC /* Start / Pause / Restart game */ + +/*--- Strategy - Turn based + Navigation and problem solving are primary actions ---*/ +#define DIVIRTUAL_STRATEGY_TURN 0x0C000000 +#define DIAXIS_STRATEGYT_LATERAL 0x0C008201 /* Sidestep left/right */ +#define DIAXIS_STRATEGYT_MOVE 0x0C010202 /* Move forward/backwards */ +#define DIBUTTON_STRATEGYT_SELECT 0x0C000401 /* Select unit or object */ +#define DIBUTTON_STRATEGYT_INSTRUCT 0x0C000402 /* Cycle through instructions */ +#define DIBUTTON_STRATEGYT_APPLY 0x0C000403 /* Apply selected instruction */ +#define DIBUTTON_STRATEGYT_TEAM 0x0C000404 /* Select next team / cycle through all */ +#define DIBUTTON_STRATEGYT_TURN 0x0C000405 /* Indicate turn over */ +#define DIBUTTON_STRATEGYT_MENU 0x0C0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_STRATEGYT_ZOOM 0x0C004406 /* Zoom - in / out */ +#define DIBUTTON_STRATEGYT_MAP 0x0C004407 /* cycle through map options */ +#define DIBUTTON_STRATEGYT_DISPLAY 0x0C004408 /* shows next on-screen display options */ +#define DIBUTTON_STRATEGYT_LEFT_LINK 0x0C00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_STRATEGYT_RIGHT_LINK 0x0C00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_STRATEGYT_FORWARD_LINK 0x0C0144E0 /* Fallback move forward button */ +#define DIBUTTON_STRATEGYT_BACK_LINK 0x0C0144E8 /* Fallback move back button */ +#define DIBUTTON_STRATEGYT_DEVICE 0x0C0044FE /* Show input device and controls */ +#define DIBUTTON_STRATEGYT_PAUSE 0x0C0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Hunting + Hunting ---*/ +#define DIVIRTUAL_SPORTS_HUNTING 0x0D000000 +#define DIAXIS_HUNTING_LATERAL 0x0D008201 /* sidestep left/right */ +#define DIAXIS_HUNTING_MOVE 0x0D010202 /* move forward/backwards */ +#define DIBUTTON_HUNTING_FIRE 0x0D000401 /* Fire selected weapon */ +#define DIBUTTON_HUNTING_AIM 0x0D000402 /* Select aim/move */ +#define DIBUTTON_HUNTING_WEAPON 0x0D000403 /* Select next weapon */ +#define DIBUTTON_HUNTING_BINOCULAR 0x0D000404 /* Look through Binoculars */ +#define DIBUTTON_HUNTING_CALL 0x0D000405 /* Make animal call */ +#define DIBUTTON_HUNTING_MAP 0x0D000406 /* View Map */ +#define DIBUTTON_HUNTING_SPECIAL 0x0D000407 /* Special game operation */ +#define DIBUTTON_HUNTING_MENU 0x0D0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_HUNTING_GLANCE 0x0D004601 /* Look around */ +#define DIBUTTON_HUNTING_DISPLAY 0x0D004408 /* show next on-screen display option */ +#define DIAXIS_HUNTING_ROTATE 0x0D024203 /* Turn body left/right */ +#define DIBUTTON_HUNTING_CROUCH 0x0D004409 /* Crouch/ Climb / Swim down */ +#define DIBUTTON_HUNTING_JUMP 0x0D00440A /* Jump/ Climb up / Swim up */ +#define DIBUTTON_HUNTING_FIRESECONDARY 0x0D00440B /* Alternative fire button */ +#define DIBUTTON_HUNTING_LEFT_LINK 0x0D00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_HUNTING_RIGHT_LINK 0x0D00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_HUNTING_FORWARD_LINK 0x0D0144E0 /* Fallback move forward button */ +#define DIBUTTON_HUNTING_BACK_LINK 0x0D0144E8 /* Fallback move back button */ +#define DIBUTTON_HUNTING_ROTATE_LEFT_LINK 0x0D0244E4 /* Fallback turn body left button */ +#define DIBUTTON_HUNTING_ROTATE_RIGHT_LINK 0x0D0244EC /* Fallback turn body right button */ +#define DIBUTTON_HUNTING_DEVICE 0x0D0044FE /* Show input device and controls */ +#define DIBUTTON_HUNTING_PAUSE 0x0D0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Fishing + Catching Fish is primary objective ---*/ +#define DIVIRTUAL_SPORTS_FISHING 0x0E000000 +#define DIAXIS_FISHING_LATERAL 0x0E008201 /* sidestep left/right */ +#define DIAXIS_FISHING_MOVE 0x0E010202 /* move forward/backwards */ +#define DIBUTTON_FISHING_CAST 0x0E000401 /* Cast line */ +#define DIBUTTON_FISHING_TYPE 0x0E000402 /* Select cast type */ +#define DIBUTTON_FISHING_BINOCULAR 0x0E000403 /* Look through Binocular */ +#define DIBUTTON_FISHING_BAIT 0x0E000404 /* Select type of Bait */ +#define DIBUTTON_FISHING_MAP 0x0E000405 /* View Map */ +#define DIBUTTON_FISHING_MENU 0x0E0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_FISHING_GLANCE 0x0E004601 /* Look around */ +#define DIBUTTON_FISHING_DISPLAY 0x0E004406 /* Show next on-screen display option */ +#define DIAXIS_FISHING_ROTATE 0x0E024203 /* Turn character left / right */ +#define DIBUTTON_FISHING_CROUCH 0x0E004407 /* Crouch/ Climb / Swim down */ +#define DIBUTTON_FISHING_JUMP 0x0E004408 /* Jump/ Climb up / Swim up */ +#define DIBUTTON_FISHING_LEFT_LINK 0x0E00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_FISHING_RIGHT_LINK 0x0E00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_FISHING_FORWARD_LINK 0x0E0144E0 /* Fallback move forward button */ +#define DIBUTTON_FISHING_BACK_LINK 0x0E0144E8 /* Fallback move back button */ +#define DIBUTTON_FISHING_ROTATE_LEFT_LINK 0x0E0244E4 /* Fallback turn body left button */ +#define DIBUTTON_FISHING_ROTATE_RIGHT_LINK 0x0E0244EC /* Fallback turn body right button */ +#define DIBUTTON_FISHING_DEVICE 0x0E0044FE /* Show input device and controls */ +#define DIBUTTON_FISHING_PAUSE 0x0E0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Baseball - Batting + Batter control is primary objective ---*/ +#define DIVIRTUAL_SPORTS_BASEBALL_BAT 0x0F000000 +#define DIAXIS_BASEBALLB_LATERAL 0x0F008201 /* Aim left / right */ +#define DIAXIS_BASEBALLB_MOVE 0x0F010202 /* Aim up / down */ +#define DIBUTTON_BASEBALLB_SELECT 0x0F000401 /* cycle through swing options */ +#define DIBUTTON_BASEBALLB_NORMAL 0x0F000402 /* normal swing */ +#define DIBUTTON_BASEBALLB_POWER 0x0F000403 /* swing for the fence */ +#define DIBUTTON_BASEBALLB_BUNT 0x0F000404 /* bunt */ +#define DIBUTTON_BASEBALLB_STEAL 0x0F000405 /* Base runner attempts to steal a base */ +#define DIBUTTON_BASEBALLB_BURST 0x0F000406 /* Base runner invokes burst of speed */ +#define DIBUTTON_BASEBALLB_SLIDE 0x0F000407 /* Base runner slides into base */ +#define DIBUTTON_BASEBALLB_CONTACT 0x0F000408 /* Contact swing */ +#define DIBUTTON_BASEBALLB_MENU 0x0F0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_BASEBALLB_NOSTEAL 0x0F004409 /* Base runner goes back to a base */ +#define DIBUTTON_BASEBALLB_BOX 0x0F00440A /* Enter or exit batting box */ +#define DIBUTTON_BASEBALLB_LEFT_LINK 0x0F00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_BASEBALLB_RIGHT_LINK 0x0F00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_BASEBALLB_FORWARD_LINK 0x0F0144E0 /* Fallback move forward button */ +#define DIBUTTON_BASEBALLB_BACK_LINK 0x0F0144E8 /* Fallback move back button */ +#define DIBUTTON_BASEBALLB_DEVICE 0x0F0044FE /* Show input device and controls */ +#define DIBUTTON_BASEBALLB_PAUSE 0x0F0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Baseball - Pitching + Pitcher control is primary objective ---*/ +#define DIVIRTUAL_SPORTS_BASEBALL_PITCH 0x10000000 +#define DIAXIS_BASEBALLP_LATERAL 0x10008201 /* Aim left / right */ +#define DIAXIS_BASEBALLP_MOVE 0x10010202 /* Aim up / down */ +#define DIBUTTON_BASEBALLP_SELECT 0x10000401 /* cycle through pitch selections */ +#define DIBUTTON_BASEBALLP_PITCH 0x10000402 /* throw pitch */ +#define DIBUTTON_BASEBALLP_BASE 0x10000403 /* select base to throw to */ +#define DIBUTTON_BASEBALLP_THROW 0x10000404 /* throw to base */ +#define DIBUTTON_BASEBALLP_FAKE 0x10000405 /* Fake a throw to a base */ +#define DIBUTTON_BASEBALLP_MENU 0x100004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_BASEBALLP_WALK 0x10004406 /* Throw intentional walk / pitch out */ +#define DIBUTTON_BASEBALLP_LOOK 0x10004407 /* Look at runners on bases */ +#define DIBUTTON_BASEBALLP_LEFT_LINK 0x1000C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_BASEBALLP_RIGHT_LINK 0x1000C4EC /* Fallback sidestep right button */ +#define DIBUTTON_BASEBALLP_FORWARD_LINK 0x100144E0 /* Fallback move forward button */ +#define DIBUTTON_BASEBALLP_BACK_LINK 0x100144E8 /* Fallback move back button */ +#define DIBUTTON_BASEBALLP_DEVICE 0x100044FE /* Show input device and controls */ +#define DIBUTTON_BASEBALLP_PAUSE 0x100044FC /* Start / Pause / Restart game */ + +/*--- Sports - Baseball - Fielding + Fielder control is primary objective ---*/ +#define DIVIRTUAL_SPORTS_BASEBALL_FIELD 0x11000000 +#define DIAXIS_BASEBALLF_LATERAL 0x11008201 /* Aim left / right */ +#define DIAXIS_BASEBALLF_MOVE 0x11010202 /* Aim up / down */ +#define DIBUTTON_BASEBALLF_NEAREST 0x11000401 /* Switch to fielder nearest to the ball */ +#define DIBUTTON_BASEBALLF_THROW1 0x11000402 /* Make conservative throw */ +#define DIBUTTON_BASEBALLF_THROW2 0x11000403 /* Make aggressive throw */ +#define DIBUTTON_BASEBALLF_BURST 0x11000404 /* Invoke burst of speed */ +#define DIBUTTON_BASEBALLF_JUMP 0x11000405 /* Jump to catch ball */ +#define DIBUTTON_BASEBALLF_DIVE 0x11000406 /* Dive to catch ball */ +#define DIBUTTON_BASEBALLF_MENU 0x110004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_BASEBALLF_SHIFTIN 0x11004407 /* Shift the infield positioning */ +#define DIBUTTON_BASEBALLF_SHIFTOUT 0x11004408 /* Shift the outfield positioning */ +#define DIBUTTON_BASEBALLF_AIM_LEFT_LINK 0x1100C4E4 /* Fallback aim left button */ +#define DIBUTTON_BASEBALLF_AIM_RIGHT_LINK 0x1100C4EC /* Fallback aim right button */ +#define DIBUTTON_BASEBALLF_FORWARD_LINK 0x110144E0 /* Fallback move forward button */ +#define DIBUTTON_BASEBALLF_BACK_LINK 0x110144E8 /* Fallback move back button */ +#define DIBUTTON_BASEBALLF_DEVICE 0x110044FE /* Show input device and controls */ +#define DIBUTTON_BASEBALLF_PAUSE 0x110044FC /* Start / Pause / Restart game */ + +/*--- Sports - Basketball - Offense + Offense ---*/ +#define DIVIRTUAL_SPORTS_BASKETBALL_OFFENSE 0x12000000 +#define DIAXIS_BBALLO_LATERAL 0x12008201 /* left / right */ +#define DIAXIS_BBALLO_MOVE 0x12010202 /* up / down */ +#define DIBUTTON_BBALLO_SHOOT 0x12000401 /* shoot basket */ +#define DIBUTTON_BBALLO_DUNK 0x12000402 /* dunk basket */ +#define DIBUTTON_BBALLO_PASS 0x12000403 /* throw pass */ +#define DIBUTTON_BBALLO_FAKE 0x12000404 /* fake shot or pass */ +#define DIBUTTON_BBALLO_SPECIAL 0x12000405 /* apply special move */ +#define DIBUTTON_BBALLO_PLAYER 0x12000406 /* select next player */ +#define DIBUTTON_BBALLO_BURST 0x12000407 /* invoke burst */ +#define DIBUTTON_BBALLO_CALL 0x12000408 /* call for ball / pass to me */ +#define DIBUTTON_BBALLO_MENU 0x120004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_BBALLO_GLANCE 0x12004601 /* scroll view */ +#define DIBUTTON_BBALLO_SCREEN 0x12004409 /* Call for screen */ +#define DIBUTTON_BBALLO_PLAY 0x1200440A /* Call for specific offensive play */ +#define DIBUTTON_BBALLO_JAB 0x1200440B /* Initiate fake drive to basket */ +#define DIBUTTON_BBALLO_POST 0x1200440C /* Perform post move */ +#define DIBUTTON_BBALLO_TIMEOUT 0x1200440D /* Time Out */ +#define DIBUTTON_BBALLO_SUBSTITUTE 0x1200440E /* substitute one player for another */ +#define DIBUTTON_BBALLO_LEFT_LINK 0x1200C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_BBALLO_RIGHT_LINK 0x1200C4EC /* Fallback sidestep right button */ +#define DIBUTTON_BBALLO_FORWARD_LINK 0x120144E0 /* Fallback move forward button */ +#define DIBUTTON_BBALLO_BACK_LINK 0x120144E8 /* Fallback move back button */ +#define DIBUTTON_BBALLO_DEVICE 0x120044FE /* Show input device and controls */ +#define DIBUTTON_BBALLO_PAUSE 0x120044FC /* Start / Pause / Restart game */ + +/*--- Sports - Basketball - Defense + Defense ---*/ +#define DIVIRTUAL_SPORTS_BASKETBALL_DEFENSE 0x13000000 +#define DIAXIS_BBALLD_LATERAL 0x13008201 /* left / right */ +#define DIAXIS_BBALLD_MOVE 0x13010202 /* up / down */ +#define DIBUTTON_BBALLD_JUMP 0x13000401 /* jump to block shot */ +#define DIBUTTON_BBALLD_STEAL 0x13000402 /* attempt to steal ball */ +#define DIBUTTON_BBALLD_FAKE 0x13000403 /* fake block or steal */ +#define DIBUTTON_BBALLD_SPECIAL 0x13000404 /* apply special move */ +#define DIBUTTON_BBALLD_PLAYER 0x13000405 /* select next player */ +#define DIBUTTON_BBALLD_BURST 0x13000406 /* invoke burst */ +#define DIBUTTON_BBALLD_PLAY 0x13000407 /* call for specific defensive play */ +#define DIBUTTON_BBALLD_MENU 0x130004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_BBALLD_GLANCE 0x13004601 /* scroll view */ +#define DIBUTTON_BBALLD_TIMEOUT 0x13004408 /* Time Out */ +#define DIBUTTON_BBALLD_SUBSTITUTE 0x13004409 /* substitute one player for another */ +#define DIBUTTON_BBALLD_LEFT_LINK 0x1300C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_BBALLD_RIGHT_LINK 0x1300C4EC /* Fallback sidestep right button */ +#define DIBUTTON_BBALLD_FORWARD_LINK 0x130144E0 /* Fallback move forward button */ +#define DIBUTTON_BBALLD_BACK_LINK 0x130144E8 /* Fallback move back button */ +#define DIBUTTON_BBALLD_DEVICE 0x130044FE /* Show input device and controls */ +#define DIBUTTON_BBALLD_PAUSE 0x130044FC /* Start / Pause / Restart game */ + +/*--- Sports - Football - Play + Play selection ---*/ +#define DIVIRTUAL_SPORTS_FOOTBALL_FIELD 0x14000000 +#define DIBUTTON_FOOTBALLP_PLAY 0x14000401 /* cycle through available plays */ +#define DIBUTTON_FOOTBALLP_SELECT 0x14000402 /* select play */ +#define DIBUTTON_FOOTBALLP_HELP 0x14000403 /* Bring up pop-up help */ +#define DIBUTTON_FOOTBALLP_MENU 0x140004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_FOOTBALLP_DEVICE 0x140044FE /* Show input device and controls */ +#define DIBUTTON_FOOTBALLP_PAUSE 0x140044FC /* Start / Pause / Restart game */ + +/*--- Sports - Football - QB + Offense: Quarterback / Kicker ---*/ +#define DIVIRTUAL_SPORTS_FOOTBALL_QBCK 0x15000000 +#define DIAXIS_FOOTBALLQ_LATERAL 0x15008201 /* Move / Aim: left / right */ +#define DIAXIS_FOOTBALLQ_MOVE 0x15010202 /* Move / Aim: up / down */ +#define DIBUTTON_FOOTBALLQ_SELECT 0x15000401 /* Select */ +#define DIBUTTON_FOOTBALLQ_SNAP 0x15000402 /* snap ball - start play */ +#define DIBUTTON_FOOTBALLQ_JUMP 0x15000403 /* jump over defender */ +#define DIBUTTON_FOOTBALLQ_SLIDE 0x15000404 /* Dive/Slide */ +#define DIBUTTON_FOOTBALLQ_PASS 0x15000405 /* throws pass to receiver */ +#define DIBUTTON_FOOTBALLQ_FAKE 0x15000406 /* pump fake pass or fake kick */ +#define DIBUTTON_FOOTBALLQ_MENU 0x150004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_FOOTBALLQ_FAKESNAP 0x15004407 /* Fake snap */ +#define DIBUTTON_FOOTBALLQ_MOTION 0x15004408 /* Send receivers in motion */ +#define DIBUTTON_FOOTBALLQ_AUDIBLE 0x15004409 /* Change offensive play at line of scrimmage */ +#define DIBUTTON_FOOTBALLQ_LEFT_LINK 0x1500C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_FOOTBALLQ_RIGHT_LINK 0x1500C4EC /* Fallback sidestep right button */ +#define DIBUTTON_FOOTBALLQ_FORWARD_LINK 0x150144E0 /* Fallback move forward button */ +#define DIBUTTON_FOOTBALLQ_BACK_LINK 0x150144E8 /* Fallback move back button */ +#define DIBUTTON_FOOTBALLQ_DEVICE 0x150044FE /* Show input device and controls */ +#define DIBUTTON_FOOTBALLQ_PAUSE 0x150044FC /* Start / Pause / Restart game */ + +/*--- Sports - Football - Offense + Offense - Runner ---*/ +#define DIVIRTUAL_SPORTS_FOOTBALL_OFFENSE 0x16000000 +#define DIAXIS_FOOTBALLO_LATERAL 0x16008201 /* Move / Aim: left / right */ +#define DIAXIS_FOOTBALLO_MOVE 0x16010202 /* Move / Aim: up / down */ +#define DIBUTTON_FOOTBALLO_JUMP 0x16000401 /* jump or hurdle over defender */ +#define DIBUTTON_FOOTBALLO_LEFTARM 0x16000402 /* holds out left arm */ +#define DIBUTTON_FOOTBALLO_RIGHTARM 0x16000403 /* holds out right arm */ +#define DIBUTTON_FOOTBALLO_THROW 0x16000404 /* throw pass or lateral ball to another runner */ +#define DIBUTTON_FOOTBALLO_SPIN 0x16000405 /* Spin to avoid defenders */ +#define DIBUTTON_FOOTBALLO_MENU 0x160004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_FOOTBALLO_JUKE 0x16004406 /* Use special move to avoid defenders */ +#define DIBUTTON_FOOTBALLO_SHOULDER 0x16004407 /* Lower shoulder to run over defenders */ +#define DIBUTTON_FOOTBALLO_TURBO 0x16004408 /* Speed burst past defenders */ +#define DIBUTTON_FOOTBALLO_DIVE 0x16004409 /* Dive over defenders */ +#define DIBUTTON_FOOTBALLO_ZOOM 0x1600440A /* Zoom view in / out */ +#define DIBUTTON_FOOTBALLO_SUBSTITUTE 0x1600440B /* substitute one player for another */ +#define DIBUTTON_FOOTBALLO_LEFT_LINK 0x1600C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_FOOTBALLO_RIGHT_LINK 0x1600C4EC /* Fallback sidestep right button */ +#define DIBUTTON_FOOTBALLO_FORWARD_LINK 0x160144E0 /* Fallback move forward button */ +#define DIBUTTON_FOOTBALLO_BACK_LINK 0x160144E8 /* Fallback move back button */ +#define DIBUTTON_FOOTBALLO_DEVICE 0x160044FE /* Show input device and controls */ +#define DIBUTTON_FOOTBALLO_PAUSE 0x160044FC /* Start / Pause / Restart game */ + +/*--- Sports - Football - Defense + Defense ---*/ +#define DIVIRTUAL_SPORTS_FOOTBALL_DEFENSE 0x17000000 +#define DIAXIS_FOOTBALLD_LATERAL 0x17008201 /* Move / Aim: left / right */ +#define DIAXIS_FOOTBALLD_MOVE 0x17010202 /* Move / Aim: up / down */ +#define DIBUTTON_FOOTBALLD_PLAY 0x17000401 /* cycle through available plays */ +#define DIBUTTON_FOOTBALLD_SELECT 0x17000402 /* select player closest to the ball */ +#define DIBUTTON_FOOTBALLD_JUMP 0x17000403 /* jump to intercept or block */ +#define DIBUTTON_FOOTBALLD_TACKLE 0x17000404 /* tackler runner */ +#define DIBUTTON_FOOTBALLD_FAKE 0x17000405 /* hold down to fake tackle or intercept */ +#define DIBUTTON_FOOTBALLD_SUPERTACKLE 0x17000406 /* Initiate special tackle */ +#define DIBUTTON_FOOTBALLD_MENU 0x170004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_FOOTBALLD_SPIN 0x17004407 /* Spin to beat offensive line */ +#define DIBUTTON_FOOTBALLD_SWIM 0x17004408 /* Swim to beat the offensive line */ +#define DIBUTTON_FOOTBALLD_BULLRUSH 0x17004409 /* Bull rush the offensive line */ +#define DIBUTTON_FOOTBALLD_RIP 0x1700440A /* Rip the offensive line */ +#define DIBUTTON_FOOTBALLD_AUDIBLE 0x1700440B /* Change defensive play at the line of scrimmage */ +#define DIBUTTON_FOOTBALLD_ZOOM 0x1700440C /* Zoom view in / out */ +#define DIBUTTON_FOOTBALLD_SUBSTITUTE 0x1700440D /* substitute one player for another */ +#define DIBUTTON_FOOTBALLD_LEFT_LINK 0x1700C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_FOOTBALLD_RIGHT_LINK 0x1700C4EC /* Fallback sidestep right button */ +#define DIBUTTON_FOOTBALLD_FORWARD_LINK 0x170144E0 /* Fallback move forward button */ +#define DIBUTTON_FOOTBALLD_BACK_LINK 0x170144E8 /* Fallback move back button */ +#define DIBUTTON_FOOTBALLD_DEVICE 0x170044FE /* Show input device and controls */ +#define DIBUTTON_FOOTBALLD_PAUSE 0x170044FC /* Start / Pause / Restart game */ + +/*--- Sports - Golf + ---*/ +#define DIVIRTUAL_SPORTS_GOLF 0x18000000 +#define DIAXIS_GOLF_LATERAL 0x18008201 /* Move / Aim: left / right */ +#define DIAXIS_GOLF_MOVE 0x18010202 /* Move / Aim: up / down */ +#define DIBUTTON_GOLF_SWING 0x18000401 /* swing club */ +#define DIBUTTON_GOLF_SELECT 0x18000402 /* cycle between: club / swing strength / ball arc / ball spin */ +#define DIBUTTON_GOLF_UP 0x18000403 /* increase selection */ +#define DIBUTTON_GOLF_DOWN 0x18000404 /* decrease selection */ +#define DIBUTTON_GOLF_TERRAIN 0x18000405 /* shows terrain detail */ +#define DIBUTTON_GOLF_FLYBY 0x18000406 /* view the hole via a flyby */ +#define DIBUTTON_GOLF_MENU 0x180004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_GOLF_SCROLL 0x18004601 /* scroll view */ +#define DIBUTTON_GOLF_ZOOM 0x18004407 /* Zoom view in / out */ +#define DIBUTTON_GOLF_TIMEOUT 0x18004408 /* Call for time out */ +#define DIBUTTON_GOLF_SUBSTITUTE 0x18004409 /* substitute one player for another */ +#define DIBUTTON_GOLF_LEFT_LINK 0x1800C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_GOLF_RIGHT_LINK 0x1800C4EC /* Fallback sidestep right button */ +#define DIBUTTON_GOLF_FORWARD_LINK 0x180144E0 /* Fallback move forward button */ +#define DIBUTTON_GOLF_BACK_LINK 0x180144E8 /* Fallback move back button */ +#define DIBUTTON_GOLF_DEVICE 0x180044FE /* Show input device and controls */ +#define DIBUTTON_GOLF_PAUSE 0x180044FC /* Start / Pause / Restart game */ + +/*--- Sports - Hockey - Offense + Offense ---*/ +#define DIVIRTUAL_SPORTS_HOCKEY_OFFENSE 0x19000000 +#define DIAXIS_HOCKEYO_LATERAL 0x19008201 /* Move / Aim: left / right */ +#define DIAXIS_HOCKEYO_MOVE 0x19010202 /* Move / Aim: up / down */ +#define DIBUTTON_HOCKEYO_SHOOT 0x19000401 /* Shoot */ +#define DIBUTTON_HOCKEYO_PASS 0x19000402 /* pass the puck */ +#define DIBUTTON_HOCKEYO_BURST 0x19000403 /* invoke speed burst */ +#define DIBUTTON_HOCKEYO_SPECIAL 0x19000404 /* invoke special move */ +#define DIBUTTON_HOCKEYO_FAKE 0x19000405 /* hold down to fake pass or kick */ +#define DIBUTTON_HOCKEYO_MENU 0x190004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_HOCKEYO_SCROLL 0x19004601 /* scroll view */ +#define DIBUTTON_HOCKEYO_ZOOM 0x19004406 /* Zoom view in / out */ +#define DIBUTTON_HOCKEYO_STRATEGY 0x19004407 /* Invoke coaching menu for strategy help */ +#define DIBUTTON_HOCKEYO_TIMEOUT 0x19004408 /* Call for time out */ +#define DIBUTTON_HOCKEYO_SUBSTITUTE 0x19004409 /* substitute one player for another */ +#define DIBUTTON_HOCKEYO_LEFT_LINK 0x1900C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_HOCKEYO_RIGHT_LINK 0x1900C4EC /* Fallback sidestep right button */ +#define DIBUTTON_HOCKEYO_FORWARD_LINK 0x190144E0 /* Fallback move forward button */ +#define DIBUTTON_HOCKEYO_BACK_LINK 0x190144E8 /* Fallback move back button */ +#define DIBUTTON_HOCKEYO_DEVICE 0x190044FE /* Show input device and controls */ +#define DIBUTTON_HOCKEYO_PAUSE 0x190044FC /* Start / Pause / Restart game */ + +/*--- Sports - Hockey - Defense + Defense ---*/ +#define DIVIRTUAL_SPORTS_HOCKEY_DEFENSE 0x1A000000 +#define DIAXIS_HOCKEYD_LATERAL 0x1A008201 /* Move / Aim: left / right */ +#define DIAXIS_HOCKEYD_MOVE 0x1A010202 /* Move / Aim: up / down */ +#define DIBUTTON_HOCKEYD_PLAYER 0x1A000401 /* control player closest to the puck */ +#define DIBUTTON_HOCKEYD_STEAL 0x1A000402 /* attempt steal */ +#define DIBUTTON_HOCKEYD_BURST 0x1A000403 /* speed burst or body check */ +#define DIBUTTON_HOCKEYD_BLOCK 0x1A000404 /* block puck */ +#define DIBUTTON_HOCKEYD_FAKE 0x1A000405 /* hold down to fake tackle or intercept */ +#define DIBUTTON_HOCKEYD_MENU 0x1A0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_HOCKEYD_SCROLL 0x1A004601 /* scroll view */ +#define DIBUTTON_HOCKEYD_ZOOM 0x1A004406 /* Zoom view in / out */ +#define DIBUTTON_HOCKEYD_STRATEGY 0x1A004407 /* Invoke coaching menu for strategy help */ +#define DIBUTTON_HOCKEYD_TIMEOUT 0x1A004408 /* Call for time out */ +#define DIBUTTON_HOCKEYD_SUBSTITUTE 0x1A004409 /* substitute one player for another */ +#define DIBUTTON_HOCKEYD_LEFT_LINK 0x1A00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_HOCKEYD_RIGHT_LINK 0x1A00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_HOCKEYD_FORWARD_LINK 0x1A0144E0 /* Fallback move forward button */ +#define DIBUTTON_HOCKEYD_BACK_LINK 0x1A0144E8 /* Fallback move back button */ +#define DIBUTTON_HOCKEYD_DEVICE 0x1A0044FE /* Show input device and controls */ +#define DIBUTTON_HOCKEYD_PAUSE 0x1A0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Hockey - Goalie + Goal tending ---*/ +#define DIVIRTUAL_SPORTS_HOCKEY_GOALIE 0x1B000000 +#define DIAXIS_HOCKEYG_LATERAL 0x1B008201 /* Move / Aim: left / right */ +#define DIAXIS_HOCKEYG_MOVE 0x1B010202 /* Move / Aim: up / down */ +#define DIBUTTON_HOCKEYG_PASS 0x1B000401 /* pass puck */ +#define DIBUTTON_HOCKEYG_POKE 0x1B000402 /* poke / check / hack */ +#define DIBUTTON_HOCKEYG_STEAL 0x1B000403 /* attempt steal */ +#define DIBUTTON_HOCKEYG_BLOCK 0x1B000404 /* block puck */ +#define DIBUTTON_HOCKEYG_MENU 0x1B0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_HOCKEYG_SCROLL 0x1B004601 /* scroll view */ +#define DIBUTTON_HOCKEYG_ZOOM 0x1B004405 /* Zoom view in / out */ +#define DIBUTTON_HOCKEYG_STRATEGY 0x1B004406 /* Invoke coaching menu for strategy help */ +#define DIBUTTON_HOCKEYG_TIMEOUT 0x1B004407 /* Call for time out */ +#define DIBUTTON_HOCKEYG_SUBSTITUTE 0x1B004408 /* substitute one player for another */ +#define DIBUTTON_HOCKEYG_LEFT_LINK 0x1B00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_HOCKEYG_RIGHT_LINK 0x1B00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_HOCKEYG_FORWARD_LINK 0x1B0144E0 /* Fallback move forward button */ +#define DIBUTTON_HOCKEYG_BACK_LINK 0x1B0144E8 /* Fallback move back button */ +#define DIBUTTON_HOCKEYG_DEVICE 0x1B0044FE /* Show input device and controls */ +#define DIBUTTON_HOCKEYG_PAUSE 0x1B0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Mountain Biking + ---*/ +#define DIVIRTUAL_SPORTS_BIKING_MOUNTAIN 0x1C000000 +#define DIAXIS_BIKINGM_TURN 0x1C008201 /* left / right */ +#define DIAXIS_BIKINGM_PEDAL 0x1C010202 /* Pedal faster / slower / brake */ +#define DIBUTTON_BIKINGM_JUMP 0x1C000401 /* jump over obstacle */ +#define DIBUTTON_BIKINGM_CAMERA 0x1C000402 /* switch camera view */ +#define DIBUTTON_BIKINGM_SPECIAL1 0x1C000403 /* perform first special move */ +#define DIBUTTON_BIKINGM_SELECT 0x1C000404 /* Select */ +#define DIBUTTON_BIKINGM_SPECIAL2 0x1C000405 /* perform second special move */ +#define DIBUTTON_BIKINGM_MENU 0x1C0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_BIKINGM_SCROLL 0x1C004601 /* scroll view */ +#define DIBUTTON_BIKINGM_ZOOM 0x1C004406 /* Zoom view in / out */ +#define DIAXIS_BIKINGM_BRAKE 0x1C044203 /* Brake axis */ +#define DIBUTTON_BIKINGM_LEFT_LINK 0x1C00C4E4 /* Fallback turn left button */ +#define DIBUTTON_BIKINGM_RIGHT_LINK 0x1C00C4EC /* Fallback turn right button */ +#define DIBUTTON_BIKINGM_FASTER_LINK 0x1C0144E0 /* Fallback pedal faster button */ +#define DIBUTTON_BIKINGM_SLOWER_LINK 0x1C0144E8 /* Fallback pedal slower button */ +#define DIBUTTON_BIKINGM_BRAKE_BUTTON_LINK 0x1C0444E8 /* Fallback brake button */ +#define DIBUTTON_BIKINGM_DEVICE 0x1C0044FE /* Show input device and controls */ +#define DIBUTTON_BIKINGM_PAUSE 0x1C0044FC /* Start / Pause / Restart game */ + +/*--- Sports: Skiing / Snowboarding / Skateboarding + ---*/ +#define DIVIRTUAL_SPORTS_SKIING 0x1D000000 +#define DIAXIS_SKIING_TURN 0x1D008201 /* left / right */ +#define DIAXIS_SKIING_SPEED 0x1D010202 /* faster / slower */ +#define DIBUTTON_SKIING_JUMP 0x1D000401 /* Jump */ +#define DIBUTTON_SKIING_CROUCH 0x1D000402 /* crouch down */ +#define DIBUTTON_SKIING_CAMERA 0x1D000403 /* switch camera view */ +#define DIBUTTON_SKIING_SPECIAL1 0x1D000404 /* perform first special move */ +#define DIBUTTON_SKIING_SELECT 0x1D000405 /* Select */ +#define DIBUTTON_SKIING_SPECIAL2 0x1D000406 /* perform second special move */ +#define DIBUTTON_SKIING_MENU 0x1D0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_SKIING_GLANCE 0x1D004601 /* scroll view */ +#define DIBUTTON_SKIING_ZOOM 0x1D004407 /* Zoom view in / out */ +#define DIBUTTON_SKIING_LEFT_LINK 0x1D00C4E4 /* Fallback turn left button */ +#define DIBUTTON_SKIING_RIGHT_LINK 0x1D00C4EC /* Fallback turn right button */ +#define DIBUTTON_SKIING_FASTER_LINK 0x1D0144E0 /* Fallback increase speed button */ +#define DIBUTTON_SKIING_SLOWER_LINK 0x1D0144E8 /* Fallback decrease speed button */ +#define DIBUTTON_SKIING_DEVICE 0x1D0044FE /* Show input device and controls */ +#define DIBUTTON_SKIING_PAUSE 0x1D0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Soccer - Offense + Offense ---*/ +#define DIVIRTUAL_SPORTS_SOCCER_OFFENSE 0x1E000000 +#define DIAXIS_SOCCERO_LATERAL 0x1E008201 /* Move / Aim: left / right */ +#define DIAXIS_SOCCERO_MOVE 0x1E010202 /* Move / Aim: up / down */ +#define DIAXIS_SOCCERO_BEND 0x1E018203 /* Bend to soccer shot/pass */ +#define DIBUTTON_SOCCERO_SHOOT 0x1E000401 /* Shoot the ball */ +#define DIBUTTON_SOCCERO_PASS 0x1E000402 /* Pass */ +#define DIBUTTON_SOCCERO_FAKE 0x1E000403 /* Fake */ +#define DIBUTTON_SOCCERO_PLAYER 0x1E000404 /* Select next player */ +#define DIBUTTON_SOCCERO_SPECIAL1 0x1E000405 /* Apply special move */ +#define DIBUTTON_SOCCERO_SELECT 0x1E000406 /* Select special move */ +#define DIBUTTON_SOCCERO_MENU 0x1E0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_SOCCERO_GLANCE 0x1E004601 /* scroll view */ +#define DIBUTTON_SOCCERO_SUBSTITUTE 0x1E004407 /* Substitute one player for another */ +#define DIBUTTON_SOCCERO_SHOOTLOW 0x1E004408 /* Shoot the ball low */ +#define DIBUTTON_SOCCERO_SHOOTHIGH 0x1E004409 /* Shoot the ball high */ +#define DIBUTTON_SOCCERO_PASSTHRU 0x1E00440A /* Make a thru pass */ +#define DIBUTTON_SOCCERO_SPRINT 0x1E00440B /* Sprint / turbo boost */ +#define DIBUTTON_SOCCERO_CONTROL 0x1E00440C /* Obtain control of the ball */ +#define DIBUTTON_SOCCERO_HEAD 0x1E00440D /* Attempt to head the ball */ +#define DIBUTTON_SOCCERO_LEFT_LINK 0x1E00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_SOCCERO_RIGHT_LINK 0x1E00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_SOCCERO_FORWARD_LINK 0x1E0144E0 /* Fallback move forward button */ +#define DIBUTTON_SOCCERO_BACK_LINK 0x1E0144E8 /* Fallback move back button */ +#define DIBUTTON_SOCCERO_DEVICE 0x1E0044FE /* Show input device and controls */ +#define DIBUTTON_SOCCERO_PAUSE 0x1E0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Soccer - Defense + Defense ---*/ +#define DIVIRTUAL_SPORTS_SOCCER_DEFENSE 0x1F000000 +#define DIAXIS_SOCCERD_LATERAL 0x1F008201 /* Move / Aim: left / right */ +#define DIAXIS_SOCCERD_MOVE 0x1F010202 /* Move / Aim: up / down */ +#define DIBUTTON_SOCCERD_BLOCK 0x1F000401 /* Attempt to block shot */ +#define DIBUTTON_SOCCERD_STEAL 0x1F000402 /* Attempt to steal ball */ +#define DIBUTTON_SOCCERD_FAKE 0x1F000403 /* Fake a block or a steal */ +#define DIBUTTON_SOCCERD_PLAYER 0x1F000404 /* Select next player */ +#define DIBUTTON_SOCCERD_SPECIAL 0x1F000405 /* Apply special move */ +#define DIBUTTON_SOCCERD_SELECT 0x1F000406 /* Select special move */ +#define DIBUTTON_SOCCERD_SLIDE 0x1F000407 /* Attempt a slide tackle */ +#define DIBUTTON_SOCCERD_MENU 0x1F0004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_SOCCERD_GLANCE 0x1F004601 /* scroll view */ +#define DIBUTTON_SOCCERD_FOUL 0x1F004408 /* Initiate a foul / hard-foul */ +#define DIBUTTON_SOCCERD_HEAD 0x1F004409 /* Attempt a Header */ +#define DIBUTTON_SOCCERD_CLEAR 0x1F00440A /* Attempt to clear the ball down the field */ +#define DIBUTTON_SOCCERD_GOALIECHARGE 0x1F00440B /* Make the goalie charge out of the box */ +#define DIBUTTON_SOCCERD_SUBSTITUTE 0x1F00440C /* Substitute one player for another */ +#define DIBUTTON_SOCCERD_LEFT_LINK 0x1F00C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_SOCCERD_RIGHT_LINK 0x1F00C4EC /* Fallback sidestep right button */ +#define DIBUTTON_SOCCERD_FORWARD_LINK 0x1F0144E0 /* Fallback move forward button */ +#define DIBUTTON_SOCCERD_BACK_LINK 0x1F0144E8 /* Fallback move back button */ +#define DIBUTTON_SOCCERD_DEVICE 0x1F0044FE /* Show input device and controls */ +#define DIBUTTON_SOCCERD_PAUSE 0x1F0044FC /* Start / Pause / Restart game */ + +/*--- Sports - Racquet + Tennis - Table-Tennis - Squash ---*/ +#define DIVIRTUAL_SPORTS_RACQUET 0x20000000 +#define DIAXIS_RACQUET_LATERAL 0x20008201 /* Move / Aim: left / right */ +#define DIAXIS_RACQUET_MOVE 0x20010202 /* Move / Aim: up / down */ +#define DIBUTTON_RACQUET_SWING 0x20000401 /* Swing racquet */ +#define DIBUTTON_RACQUET_BACKSWING 0x20000402 /* Swing backhand */ +#define DIBUTTON_RACQUET_SMASH 0x20000403 /* Smash shot */ +#define DIBUTTON_RACQUET_SPECIAL 0x20000404 /* Special shot */ +#define DIBUTTON_RACQUET_SELECT 0x20000405 /* Select special shot */ +#define DIBUTTON_RACQUET_MENU 0x200004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_RACQUET_GLANCE 0x20004601 /* scroll view */ +#define DIBUTTON_RACQUET_TIMEOUT 0x20004406 /* Call for time out */ +#define DIBUTTON_RACQUET_SUBSTITUTE 0x20004407 /* Substitute one player for another */ +#define DIBUTTON_RACQUET_LEFT_LINK 0x2000C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_RACQUET_RIGHT_LINK 0x2000C4EC /* Fallback sidestep right button */ +#define DIBUTTON_RACQUET_FORWARD_LINK 0x200144E0 /* Fallback move forward button */ +#define DIBUTTON_RACQUET_BACK_LINK 0x200144E8 /* Fallback move back button */ +#define DIBUTTON_RACQUET_DEVICE 0x200044FE /* Show input device and controls */ +#define DIBUTTON_RACQUET_PAUSE 0x200044FC /* Start / Pause / Restart game */ + +/*--- Arcade- 2D + Side to Side movement ---*/ +#define DIVIRTUAL_ARCADE_SIDE2SIDE 0x21000000 +#define DIAXIS_ARCADES_LATERAL 0x21008201 /* left / right */ +#define DIAXIS_ARCADES_MOVE 0x21010202 /* up / down */ +#define DIBUTTON_ARCADES_THROW 0x21000401 /* throw object */ +#define DIBUTTON_ARCADES_CARRY 0x21000402 /* carry object */ +#define DIBUTTON_ARCADES_ATTACK 0x21000403 /* attack */ +#define DIBUTTON_ARCADES_SPECIAL 0x21000404 /* apply special move */ +#define DIBUTTON_ARCADES_SELECT 0x21000405 /* select special move */ +#define DIBUTTON_ARCADES_MENU 0x210004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_ARCADES_VIEW 0x21004601 /* scroll view left / right / up / down */ +#define DIBUTTON_ARCADES_LEFT_LINK 0x2100C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_ARCADES_RIGHT_LINK 0x2100C4EC /* Fallback sidestep right button */ +#define DIBUTTON_ARCADES_FORWARD_LINK 0x210144E0 /* Fallback move forward button */ +#define DIBUTTON_ARCADES_BACK_LINK 0x210144E8 /* Fallback move back button */ +#define DIBUTTON_ARCADES_VIEW_UP_LINK 0x2107C4E0 /* Fallback scroll view up button */ +#define DIBUTTON_ARCADES_VIEW_DOWN_LINK 0x2107C4E8 /* Fallback scroll view down button */ +#define DIBUTTON_ARCADES_VIEW_LEFT_LINK 0x2107C4E4 /* Fallback scroll view left button */ +#define DIBUTTON_ARCADES_VIEW_RIGHT_LINK 0x2107C4EC /* Fallback scroll view right button */ +#define DIBUTTON_ARCADES_DEVICE 0x210044FE /* Show input device and controls */ +#define DIBUTTON_ARCADES_PAUSE 0x210044FC /* Start / Pause / Restart game */ + +/*--- Arcade - Platform Game + Character moves around on screen ---*/ +#define DIVIRTUAL_ARCADE_PLATFORM 0x22000000 +#define DIAXIS_ARCADEP_LATERAL 0x22008201 /* Left / right */ +#define DIAXIS_ARCADEP_MOVE 0x22010202 /* Up / down */ +#define DIBUTTON_ARCADEP_JUMP 0x22000401 /* Jump */ +#define DIBUTTON_ARCADEP_FIRE 0x22000402 /* Fire */ +#define DIBUTTON_ARCADEP_CROUCH 0x22000403 /* Crouch */ +#define DIBUTTON_ARCADEP_SPECIAL 0x22000404 /* Apply special move */ +#define DIBUTTON_ARCADEP_SELECT 0x22000405 /* Select special move */ +#define DIBUTTON_ARCADEP_MENU 0x220004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_ARCADEP_VIEW 0x22004601 /* Scroll view */ +#define DIBUTTON_ARCADEP_FIRESECONDARY 0x22004406 /* Alternative fire button */ +#define DIBUTTON_ARCADEP_LEFT_LINK 0x2200C4E4 /* Fallback sidestep left button */ +#define DIBUTTON_ARCADEP_RIGHT_LINK 0x2200C4EC /* Fallback sidestep right button */ +#define DIBUTTON_ARCADEP_FORWARD_LINK 0x220144E0 /* Fallback move forward button */ +#define DIBUTTON_ARCADEP_BACK_LINK 0x220144E8 /* Fallback move back button */ +#define DIBUTTON_ARCADEP_VIEW_UP_LINK 0x2207C4E0 /* Fallback scroll view up button */ +#define DIBUTTON_ARCADEP_VIEW_DOWN_LINK 0x2207C4E8 /* Fallback scroll view down button */ +#define DIBUTTON_ARCADEP_VIEW_LEFT_LINK 0x2207C4E4 /* Fallback scroll view left button */ +#define DIBUTTON_ARCADEP_VIEW_RIGHT_LINK 0x2207C4EC /* Fallback scroll view right button */ +#define DIBUTTON_ARCADEP_DEVICE 0x220044FE /* Show input device and controls */ +#define DIBUTTON_ARCADEP_PAUSE 0x220044FC /* Start / Pause / Restart game */ + +/*--- CAD - 2D Object Control + Controls to select and move objects in 2D ---*/ +#define DIVIRTUAL_CAD_2DCONTROL 0x23000000 +#define DIAXIS_2DCONTROL_LATERAL 0x23008201 /* Move view left / right */ +#define DIAXIS_2DCONTROL_MOVE 0x23010202 /* Move view up / down */ +#define DIAXIS_2DCONTROL_INOUT 0x23018203 /* Zoom - in / out */ +#define DIBUTTON_2DCONTROL_SELECT 0x23000401 /* Select Object */ +#define DIBUTTON_2DCONTROL_SPECIAL1 0x23000402 /* Do first special operation */ +#define DIBUTTON_2DCONTROL_SPECIAL 0x23000403 /* Select special operation */ +#define DIBUTTON_2DCONTROL_SPECIAL2 0x23000404 /* Do second special operation */ +#define DIBUTTON_2DCONTROL_MENU 0x230004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_2DCONTROL_HATSWITCH 0x23004601 /* Hat switch */ +#define DIAXIS_2DCONTROL_ROTATEZ 0x23024204 /* Rotate view clockwise / counterclockwise */ +#define DIBUTTON_2DCONTROL_DISPLAY 0x23004405 /* Shows next on-screen display options */ +#define DIBUTTON_2DCONTROL_DEVICE 0x230044FE /* Show input device and controls */ +#define DIBUTTON_2DCONTROL_PAUSE 0x230044FC /* Start / Pause / Restart game */ + +/*--- CAD - 3D object control + Controls to select and move objects within a 3D environment ---*/ +#define DIVIRTUAL_CAD_3DCONTROL 0x24000000 +#define DIAXIS_3DCONTROL_LATERAL 0x24008201 /* Move view left / right */ +#define DIAXIS_3DCONTROL_MOVE 0x24010202 /* Move view up / down */ +#define DIAXIS_3DCONTROL_INOUT 0x24018203 /* Zoom - in / out */ +#define DIBUTTON_3DCONTROL_SELECT 0x24000401 /* Select Object */ +#define DIBUTTON_3DCONTROL_SPECIAL1 0x24000402 /* Do first special operation */ +#define DIBUTTON_3DCONTROL_SPECIAL 0x24000403 /* Select special operation */ +#define DIBUTTON_3DCONTROL_SPECIAL2 0x24000404 /* Do second special operation */ +#define DIBUTTON_3DCONTROL_MENU 0x240004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_3DCONTROL_HATSWITCH 0x24004601 /* Hat switch */ +#define DIAXIS_3DCONTROL_ROTATEX 0x24034204 /* Rotate view forward or up / backward or down */ +#define DIAXIS_3DCONTROL_ROTATEY 0x2402C205 /* Rotate view clockwise / counterclockwise */ +#define DIAXIS_3DCONTROL_ROTATEZ 0x24024206 /* Rotate view left / right */ +#define DIBUTTON_3DCONTROL_DISPLAY 0x24004405 /* Show next on-screen display options */ +#define DIBUTTON_3DCONTROL_DEVICE 0x240044FE /* Show input device and controls */ +#define DIBUTTON_3DCONTROL_PAUSE 0x240044FC /* Start / Pause / Restart game */ + +/*--- CAD - 3D Navigation - Fly through + Controls for 3D modeling ---*/ +#define DIVIRTUAL_CAD_FLYBY 0x25000000 +#define DIAXIS_CADF_LATERAL 0x25008201 /* move view left / right */ +#define DIAXIS_CADF_MOVE 0x25010202 /* move view up / down */ +#define DIAXIS_CADF_INOUT 0x25018203 /* in / out */ +#define DIBUTTON_CADF_SELECT 0x25000401 /* Select Object */ +#define DIBUTTON_CADF_SPECIAL1 0x25000402 /* do first special operation */ +#define DIBUTTON_CADF_SPECIAL 0x25000403 /* Select special operation */ +#define DIBUTTON_CADF_SPECIAL2 0x25000404 /* do second special operation */ +#define DIBUTTON_CADF_MENU 0x250004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_CADF_HATSWITCH 0x25004601 /* Hat switch */ +#define DIAXIS_CADF_ROTATEX 0x25034204 /* Rotate view forward or up / backward or down */ +#define DIAXIS_CADF_ROTATEY 0x2502C205 /* Rotate view clockwise / counterclockwise */ +#define DIAXIS_CADF_ROTATEZ 0x25024206 /* Rotate view left / right */ +#define DIBUTTON_CADF_DISPLAY 0x25004405 /* shows next on-screen display options */ +#define DIBUTTON_CADF_DEVICE 0x250044FE /* Show input device and controls */ +#define DIBUTTON_CADF_PAUSE 0x250044FC /* Start / Pause / Restart game */ + +/*--- CAD - 3D Model Control + Controls for 3D modeling ---*/ +#define DIVIRTUAL_CAD_MODEL 0x26000000 +#define DIAXIS_CADM_LATERAL 0x26008201 /* move view left / right */ +#define DIAXIS_CADM_MOVE 0x26010202 /* move view up / down */ +#define DIAXIS_CADM_INOUT 0x26018203 /* in / out */ +#define DIBUTTON_CADM_SELECT 0x26000401 /* Select Object */ +#define DIBUTTON_CADM_SPECIAL1 0x26000402 /* do first special operation */ +#define DIBUTTON_CADM_SPECIAL 0x26000403 /* Select special operation */ +#define DIBUTTON_CADM_SPECIAL2 0x26000404 /* do second special operation */ +#define DIBUTTON_CADM_MENU 0x260004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIHATSWITCH_CADM_HATSWITCH 0x26004601 /* Hat switch */ +#define DIAXIS_CADM_ROTATEX 0x26034204 /* Rotate view forward or up / backward or down */ +#define DIAXIS_CADM_ROTATEY 0x2602C205 /* Rotate view clockwise / counterclockwise */ +#define DIAXIS_CADM_ROTATEZ 0x26024206 /* Rotate view left / right */ +#define DIBUTTON_CADM_DISPLAY 0x26004405 /* shows next on-screen display options */ +#define DIBUTTON_CADM_DEVICE 0x260044FE /* Show input device and controls */ +#define DIBUTTON_CADM_PAUSE 0x260044FC /* Start / Pause / Restart game */ + +/*--- Control - Media Equipment + Remote ---*/ +#define DIVIRTUAL_REMOTE_CONTROL 0x27000000 +#define DIAXIS_REMOTE_SLIDER 0x27050201 /* Slider for adjustment: volume / color / bass / etc */ +#define DIBUTTON_REMOTE_MUTE 0x27000401 /* Set volume on current device to zero */ +#define DIBUTTON_REMOTE_SELECT 0x27000402 /* Next/previous: channel/ track / chapter / picture / station */ +#define DIBUTTON_REMOTE_PLAY 0x27002403 /* Start or pause entertainment on current device */ +#define DIBUTTON_REMOTE_CUE 0x27002404 /* Move through current media */ +#define DIBUTTON_REMOTE_REVIEW 0x27002405 /* Move through current media */ +#define DIBUTTON_REMOTE_CHANGE 0x27002406 /* Select next device */ +#define DIBUTTON_REMOTE_RECORD 0x27002407 /* Start recording the current media */ +#define DIBUTTON_REMOTE_MENU 0x270004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIAXIS_REMOTE_SLIDER2 0x27054202 /* Slider for adjustment: volume */ +#define DIBUTTON_REMOTE_TV 0x27005C08 /* Select TV */ +#define DIBUTTON_REMOTE_CABLE 0x27005C09 /* Select cable box */ +#define DIBUTTON_REMOTE_CD 0x27005C0A /* Select CD player */ +#define DIBUTTON_REMOTE_VCR 0x27005C0B /* Select VCR */ +#define DIBUTTON_REMOTE_TUNER 0x27005C0C /* Select tuner */ +#define DIBUTTON_REMOTE_DVD 0x27005C0D /* Select DVD player */ +#define DIBUTTON_REMOTE_ADJUST 0x27005C0E /* Enter device adjustment menu */ +#define DIBUTTON_REMOTE_DIGIT0 0x2700540F /* Digit 0 */ +#define DIBUTTON_REMOTE_DIGIT1 0x27005410 /* Digit 1 */ +#define DIBUTTON_REMOTE_DIGIT2 0x27005411 /* Digit 2 */ +#define DIBUTTON_REMOTE_DIGIT3 0x27005412 /* Digit 3 */ +#define DIBUTTON_REMOTE_DIGIT4 0x27005413 /* Digit 4 */ +#define DIBUTTON_REMOTE_DIGIT5 0x27005414 /* Digit 5 */ +#define DIBUTTON_REMOTE_DIGIT6 0x27005415 /* Digit 6 */ +#define DIBUTTON_REMOTE_DIGIT7 0x27005416 /* Digit 7 */ +#define DIBUTTON_REMOTE_DIGIT8 0x27005417 /* Digit 8 */ +#define DIBUTTON_REMOTE_DIGIT9 0x27005418 /* Digit 9 */ +#define DIBUTTON_REMOTE_DEVICE 0x270044FE /* Show input device and controls */ +#define DIBUTTON_REMOTE_PAUSE 0x270044FC /* Start / Pause / Restart game */ + +/*--- Control- Web + Help or Browser ---*/ +#define DIVIRTUAL_BROWSER_CONTROL 0x28000000 +#define DIAXIS_BROWSER_LATERAL 0x28008201 /* Move on screen pointer */ +#define DIAXIS_BROWSER_MOVE 0x28010202 /* Move on screen pointer */ +#define DIBUTTON_BROWSER_SELECT 0x28000401 /* Select current item */ +#define DIAXIS_BROWSER_VIEW 0x28018203 /* Move view up/down */ +#define DIBUTTON_BROWSER_REFRESH 0x28000402 /* Refresh */ +#define DIBUTTON_BROWSER_MENU 0x280004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_BROWSER_SEARCH 0x28004403 /* Use search tool */ +#define DIBUTTON_BROWSER_STOP 0x28004404 /* Cease current update */ +#define DIBUTTON_BROWSER_HOME 0x28004405 /* Go directly to "home" location */ +#define DIBUTTON_BROWSER_FAVORITES 0x28004406 /* Mark current site as favorite */ +#define DIBUTTON_BROWSER_NEXT 0x28004407 /* Select Next page */ +#define DIBUTTON_BROWSER_PREVIOUS 0x28004408 /* Select Previous page */ +#define DIBUTTON_BROWSER_HISTORY 0x28004409 /* Show/Hide History */ +#define DIBUTTON_BROWSER_PRINT 0x2800440A /* Print current page */ +#define DIBUTTON_BROWSER_DEVICE 0x280044FE /* Show input device and controls */ +#define DIBUTTON_BROWSER_PAUSE 0x280044FC /* Start / Pause / Restart game */ + +/*--- Driving Simulator - Giant Walking Robot + Walking tank with weapons ---*/ +#define DIVIRTUAL_DRIVING_MECHA 0x29000000 +#define DIAXIS_MECHA_STEER 0x29008201 /* Turns mecha left/right */ +#define DIAXIS_MECHA_TORSO 0x29010202 /* Tilts torso forward/backward */ +#define DIAXIS_MECHA_ROTATE 0x29020203 /* Turns torso left/right */ +#define DIAXIS_MECHA_THROTTLE 0x29038204 /* Engine Speed */ +#define DIBUTTON_MECHA_FIRE 0x29000401 /* Fire */ +#define DIBUTTON_MECHA_WEAPONS 0x29000402 /* Select next weapon group */ +#define DIBUTTON_MECHA_TARGET 0x29000403 /* Select closest enemy available target */ +#define DIBUTTON_MECHA_REVERSE 0x29000404 /* Toggles throttle in/out of reverse */ +#define DIBUTTON_MECHA_ZOOM 0x29000405 /* Zoom in/out targeting reticule */ +#define DIBUTTON_MECHA_JUMP 0x29000406 /* Fires jump jets */ +#define DIBUTTON_MECHA_MENU 0x290004FD /* Show menu options */ +/*--- Priority 2 controls ---*/ + +#define DIBUTTON_MECHA_CENTER 0x29004407 /* Center torso to legs */ +#define DIHATSWITCH_MECHA_GLANCE 0x29004601 /* Look around */ +#define DIBUTTON_MECHA_VIEW 0x29004408 /* Cycle through view options */ +#define DIBUTTON_MECHA_FIRESECONDARY 0x29004409 /* Alternative fire button */ +#define DIBUTTON_MECHA_LEFT_LINK 0x2900C4E4 /* Fallback steer left button */ +#define DIBUTTON_MECHA_RIGHT_LINK 0x2900C4EC /* Fallback steer right button */ +#define DIBUTTON_MECHA_FORWARD_LINK 0x290144E0 /* Fallback tilt torso forward button */ +#define DIBUTTON_MECHA_BACK_LINK 0x290144E8 /* Fallback tilt toroso backward button */ +#define DIBUTTON_MECHA_ROTATE_LEFT_LINK 0x290244E4 /* Fallback rotate toroso right button */ +#define DIBUTTON_MECHA_ROTATE_RIGHT_LINK 0x290244EC /* Fallback rotate torso left button */ +#define DIBUTTON_MECHA_FASTER_LINK 0x2903C4E0 /* Fallback increase engine speed */ +#define DIBUTTON_MECHA_SLOWER_LINK 0x2903C4E8 /* Fallback decrease engine speed */ +#define DIBUTTON_MECHA_DEVICE 0x290044FE /* Show input device and controls */ +#define DIBUTTON_MECHA_PAUSE 0x290044FC /* Start / Pause / Restart game */ + +/* + * "ANY" semantics can be used as a last resort to get mappings for actions + * that match nothing in the chosen virtual genre. These semantics will be + * mapped at a lower priority that virtual genre semantics. Also, hardware + * vendors will not be able to provide sensible mappings for these unless + * they provide application specific mappings. + */ +#define DIAXIS_ANY_X_1 0xFF00C201 +#define DIAXIS_ANY_X_2 0xFF00C202 +#define DIAXIS_ANY_Y_1 0xFF014201 +#define DIAXIS_ANY_Y_2 0xFF014202 +#define DIAXIS_ANY_Z_1 0xFF01C201 +#define DIAXIS_ANY_Z_2 0xFF01C202 +#define DIAXIS_ANY_R_1 0xFF024201 +#define DIAXIS_ANY_R_2 0xFF024202 +#define DIAXIS_ANY_U_1 0xFF02C201 +#define DIAXIS_ANY_U_2 0xFF02C202 +#define DIAXIS_ANY_V_1 0xFF034201 +#define DIAXIS_ANY_V_2 0xFF034202 +#define DIAXIS_ANY_A_1 0xFF03C201 +#define DIAXIS_ANY_A_2 0xFF03C202 +#define DIAXIS_ANY_B_1 0xFF044201 +#define DIAXIS_ANY_B_2 0xFF044202 +#define DIAXIS_ANY_C_1 0xFF04C201 +#define DIAXIS_ANY_C_2 0xFF04C202 +#define DIAXIS_ANY_S_1 0xFF054201 +#define DIAXIS_ANY_S_2 0xFF054202 + +#define DIAXIS_ANY_1 0xFF004201 +#define DIAXIS_ANY_2 0xFF004202 +#define DIAXIS_ANY_3 0xFF004203 +#define DIAXIS_ANY_4 0xFF004204 + +#define DIPOV_ANY_1 0xFF004601 +#define DIPOV_ANY_2 0xFF004602 +#define DIPOV_ANY_3 0xFF004603 +#define DIPOV_ANY_4 0xFF004604 + +#define DIBUTTON_ANY(instance) ( 0xFF004400 | instance ) + + +#ifdef __cplusplus +}; +#endif + +#endif /* __DINPUT_INCLUDED__ */ + +/**************************************************************************** + * + * Definitions for non-IDirectInput (VJoyD) features defined more recently + * than the current sdk files + * + ****************************************************************************/ + +#ifdef _INC_MMSYSTEM +#ifndef MMNOJOY + +#ifndef __VJOYDX_INCLUDED__ +#define __VJOYDX_INCLUDED__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Flag to indicate that the dwReserved2 field of the JOYINFOEX structure + * contains mini-driver specific data to be passed by VJoyD to the mini- + * driver instead of doing a poll. + */ +#define JOY_PASSDRIVERDATA 0x10000000l + +/* + * Informs the joystick driver that the configuration has been changed + * and should be reloaded from the registery. + * dwFlags is reserved and should be set to zero + */ +WINMMAPI MMRESULT WINAPI joyConfigChanged( DWORD dwFlags ); + +#ifndef DIJ_RINGZERO +/* + * Invoke the joystick control panel directly, using the passed window handle + * as the parent of the dialog. This API is only supported for compatibility + * purposes; new applications should use the RunControlPanel method of a + * device interface for a game controller. + * The API is called by using the function pointer returned by + * GetProcAddress( hCPL, TEXT("ShowJoyCPL") ) where hCPL is a HMODULE returned + * by LoadLibrary( TEXT("joy.cpl") ). The typedef is provided to allow + * declaration and casting of an appropriately typed variable. + */ +void WINAPI ShowJoyCPL( HWND hWnd ); +typedef void (WINAPI* LPFNSHOWJOYCPL)( HWND hWnd ); +#endif /* DIJ_RINGZERO */ + + +/* + * Hardware Setting indicating that the device is a headtracker + */ +#define JOY_HWS_ISHEADTRACKER 0x02000000l + +/* + * Hardware Setting indicating that the VxD is used to replace + * the standard analog polling + */ +#define JOY_HWS_ISGAMEPORTDRIVER 0x04000000l + +/* + * Hardware Setting indicating that the driver needs a standard + * gameport in order to communicate with the device. + */ +#define JOY_HWS_ISANALOGPORTDRIVER 0x08000000l + +/* + * Hardware Setting indicating that VJoyD should not load this + * driver, it will be loaded externally and will register with + * VJoyD of it's own accord. + */ +#define JOY_HWS_AUTOLOAD 0x10000000l + +/* + * Hardware Setting indicating that the driver acquires any + * resources needed without needing a devnode through VJoyD. + */ +#define JOY_HWS_NODEVNODE 0x20000000l + + +/* + * Hardware Setting indicating that the device is a gameport bus + */ +#define JOY_HWS_ISGAMEPORTBUS 0x80000000l +#define JOY_HWS_GAMEPORTBUSBUSY 0x00000001l + +/* + * Usage Setting indicating that the settings are volatile and + * should be removed if still present on a reboot. + */ +#define JOY_US_VOLATILE 0x00000008L + +#ifdef __cplusplus +}; +#endif + +#endif /* __VJOYDX_INCLUDED__ */ + +#endif /* not MMNOJOY */ +#endif /* _INC_MMSYSTEM */ + +/**************************************************************************** + * + * Definitions for non-IDirectInput (VJoyD) features defined more recently + * than the current ddk files + * + ****************************************************************************/ + +#ifndef DIJ_RINGZERO + +#ifdef _INC_MMDDK +#ifndef MMNOJOYDEV + +#ifndef __VJOYDXD_INCLUDED__ +#define __VJOYDXD_INCLUDED__ +/* + * Poll type in which the do_other field of the JOYOEMPOLLDATA + * structure contains mini-driver specific data passed from an app. + */ +#define JOY_OEMPOLL_PASSDRIVERDATA 7 + +#endif /* __VJOYDXD_INCLUDED__ */ + +#endif /* not MMNOJOYDEV */ +#endif /* _INC_MMDDK */ + +#endif /* DIJ_RINGZERO */ + diff --git a/Src/Decoder_H264_ALL/D3D/include/dinputd.h b/Src/Decoder_H264_ALL/D3D/include/dinputd.h new file mode 100644 index 0000000..f534353 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dinputd.h @@ -0,0 +1,755 @@ +/**************************************************************************** + * + * Copyright (C) 1995-2000 Microsoft Corporation. All Rights Reserved. + * + * File: dinputd.h + * Content: DirectInput include file for device driver implementors + * + ****************************************************************************/ +#ifndef __DINPUTD_INCLUDED__ +#define __DINPUTD_INCLUDED__ + +#ifndef DIRECTINPUT_VERSION +#define DIRECTINPUT_VERSION 0x0800 +#pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800") +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************************************************** + * + * Interfaces + * + ****************************************************************************/ + +#ifndef DIJ_RINGZERO + +DEFINE_GUID(IID_IDirectInputEffectDriver, 0x02538130,0x898F,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); +DEFINE_GUID(IID_IDirectInputJoyConfig, 0x1DE12AB1,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); +DEFINE_GUID(IID_IDirectInputPIDDriver, 0xEEC6993A,0xB3FD,0x11D2,0xA9,0x16,0x00,0xC0,0x4F,0xB9,0x86,0x38); + +DEFINE_GUID(IID_IDirectInputJoyConfig8, 0xeb0d7dfa,0x1990,0x4f27,0xb4,0xd6,0xed,0xf2,0xee,0xc4,0xa4,0x4c); + +#endif /* DIJ_RINGZERO */ + + +/**************************************************************************** + * + * IDirectInputEffectDriver + * + ****************************************************************************/ + +typedef struct DIOBJECTATTRIBUTES { + DWORD dwFlags; + WORD wUsagePage; + WORD wUsage; +} DIOBJECTATTRIBUTES, *LPDIOBJECTATTRIBUTES; +typedef const DIOBJECTATTRIBUTES *LPCDIOBJECTATTRIBUTES; + +typedef struct DIFFOBJECTATTRIBUTES { + DWORD dwFFMaxForce; + DWORD dwFFForceResolution; +} DIFFOBJECTATTRIBUTES, *LPDIFFOBJECTATTRIBUTES; +typedef const DIFFOBJECTATTRIBUTES *LPCDIFFOBJECTATTRIBUTES; + +typedef struct DIOBJECTCALIBRATION { + LONG lMin; + LONG lCenter; + LONG lMax; +} DIOBJECTCALIBRATION, *LPDIOBJECTCALIBRATION; +typedef const DIOBJECTCALIBRATION *LPCDIOBJECTCALIBRATION; + +typedef struct DIPOVCALIBRATION { + LONG lMin[5]; + LONG lMax[5]; +} DIPOVCALIBRATION, *LPDIPOVCALIBRATION; +typedef const DIPOVCALIBRATION *LPCDIPOVCALIBRATION; + +typedef struct DIEFFECTATTRIBUTES { + DWORD dwEffectId; + DWORD dwEffType; + DWORD dwStaticParams; + DWORD dwDynamicParams; + DWORD dwCoords; +} DIEFFECTATTRIBUTES, *LPDIEFFECTATTRIBUTES; +typedef const DIEFFECTATTRIBUTES *LPCDIEFFECTATTRIBUTES; + +typedef struct DIFFDEVICEATTRIBUTES { + DWORD dwFlags; + DWORD dwFFSamplePeriod; + DWORD dwFFMinTimeResolution; +} DIFFDEVICEATTRIBUTES, *LPDIFFDEVICEATTRIBUTES; +typedef const DIFFDEVICEATTRIBUTES *LPCDIFFDEVICEATTRIBUTES; + +typedef struct DIDRIVERVERSIONS { + DWORD dwSize; + DWORD dwFirmwareRevision; + DWORD dwHardwareRevision; + DWORD dwFFDriverVersion; +} DIDRIVERVERSIONS, *LPDIDRIVERVERSIONS; +typedef const DIDRIVERVERSIONS *LPCDIDRIVERVERSIONS; + +typedef struct DIDEVICESTATE { + DWORD dwSize; + DWORD dwState; + DWORD dwLoad; +} DIDEVICESTATE, *LPDIDEVICESTATE; + +#define DEV_STS_EFFECT_RUNNING DIEGES_PLAYING + +#ifndef DIJ_RINGZERO + +typedef struct DIHIDFFINITINFO { + DWORD dwSize; + LPWSTR pwszDeviceInterface; + GUID GuidInstance; +} DIHIDFFINITINFO, *LPDIHIDFFINITINFO; + +#undef INTERFACE +#define INTERFACE IDirectInputEffectDriver + +DECLARE_INTERFACE_(IDirectInputEffectDriver, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputEffectDriver methods ***/ + STDMETHOD(DeviceID)(THIS_ DWORD,DWORD,DWORD,DWORD,LPVOID) PURE; + STDMETHOD(GetVersions)(THIS_ LPDIDRIVERVERSIONS) PURE; + STDMETHOD(Escape)(THIS_ DWORD,DWORD,LPDIEFFESCAPE) PURE; + STDMETHOD(SetGain)(THIS_ DWORD,DWORD) PURE; + STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD,DWORD) PURE; + STDMETHOD(GetForceFeedbackState)(THIS_ DWORD,LPDIDEVICESTATE) PURE; + STDMETHOD(DownloadEffect)(THIS_ DWORD,DWORD,LPDWORD,LPCDIEFFECT,DWORD) PURE; + STDMETHOD(DestroyEffect)(THIS_ DWORD,DWORD) PURE; + STDMETHOD(StartEffect)(THIS_ DWORD,DWORD,DWORD,DWORD) PURE; + STDMETHOD(StopEffect)(THIS_ DWORD,DWORD) PURE; + STDMETHOD(GetEffectStatus)(THIS_ DWORD,DWORD,LPDWORD) PURE; +}; + +typedef struct IDirectInputEffectDriver *LPDIRECTINPUTEFFECTDRIVER; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputEffectDriver_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputEffectDriver_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->lpVtbl->DeviceID(p,a,b,c,d,e) +#define IDirectInputEffectDriver_GetVersions(p,a) (p)->lpVtbl->GetVersions(p,a) +#define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->lpVtbl->Escape(p,a,b,c) +#define IDirectInputEffectDriver_SetGain(p,a,b) (p)->lpVtbl->SetGain(p,a,b) +#define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->lpVtbl->SendForceFeedbackCommand(p,a,b) +#define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->lpVtbl->GetForceFeedbackState(p,a,b) +#define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->lpVtbl->DownloadEffect(p,a,b,c,d,e) +#define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->lpVtbl->DestroyEffect(p,a,b) +#define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->lpVtbl->StartEffect(p,a,b,c,d) +#define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->lpVtbl->StopEffect(p,a,b) +#define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->lpVtbl->GetEffectStatus(p,a,b,c) +#else +#define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputEffectDriver_AddRef(p) (p)->AddRef() +#define IDirectInputEffectDriver_Release(p) (p)->Release() +#define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->DeviceID(a,b,c,d,e) +#define IDirectInputEffectDriver_GetVersions(p,a) (p)->GetVersions(a) +#define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->Escape(a,b,c) +#define IDirectInputEffectDriver_SetGain(p,a,b) (p)->SetGain(a,b) +#define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->SendForceFeedbackCommand(a,b) +#define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->GetForceFeedbackState(a,b) +#define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->DownloadEffect(a,b,c,d,e) +#define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->DestroyEffect(a,b) +#define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->StartEffect(a,b,c,d) +#define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->StopEffect(a,b) +#define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->GetEffectStatus(a,b,c) +#endif + + +#endif /* DIJ_RINGZERO */ + + +/**************************************************************************** + * + * IDirectInputJoyConfig + * + ****************************************************************************/ + +/**************************************************************************** + * + * Definitions copied from the DDK + * + ****************************************************************************/ + +#ifndef JOY_HW_NONE + +/* pre-defined joystick types */ +#define JOY_HW_NONE 0 +#define JOY_HW_CUSTOM 1 +#define JOY_HW_2A_2B_GENERIC 2 +#define JOY_HW_2A_4B_GENERIC 3 +#define JOY_HW_2B_GAMEPAD 4 +#define JOY_HW_2B_FLIGHTYOKE 5 +#define JOY_HW_2B_FLIGHTYOKETHROTTLE 6 +#define JOY_HW_3A_2B_GENERIC 7 +#define JOY_HW_3A_4B_GENERIC 8 +#define JOY_HW_4B_GAMEPAD 9 +#define JOY_HW_4B_FLIGHTYOKE 10 +#define JOY_HW_4B_FLIGHTYOKETHROTTLE 11 +#define JOY_HW_TWO_2A_2B_WITH_Y 12 +#define JOY_HW_LASTENTRY 13 + + +/* calibration flags */ +#define JOY_ISCAL_XY 0x00000001l /* XY are calibrated */ +#define JOY_ISCAL_Z 0x00000002l /* Z is calibrated */ +#define JOY_ISCAL_R 0x00000004l /* R is calibrated */ +#define JOY_ISCAL_U 0x00000008l /* U is calibrated */ +#define JOY_ISCAL_V 0x00000010l /* V is calibrated */ +#define JOY_ISCAL_POV 0x00000020l /* POV is calibrated */ + +/* point of view constants */ +#define JOY_POV_NUMDIRS 4 +#define JOY_POVVAL_FORWARD 0 +#define JOY_POVVAL_BACKWARD 1 +#define JOY_POVVAL_LEFT 2 +#define JOY_POVVAL_RIGHT 3 + +/* Specific settings for joystick hardware */ +#define JOY_HWS_HASZ 0x00000001l /* has Z info? */ +#define JOY_HWS_HASPOV 0x00000002l /* point of view hat present */ +#define JOY_HWS_POVISBUTTONCOMBOS 0x00000004l /* pov done through combo of buttons */ +#define JOY_HWS_POVISPOLL 0x00000008l /* pov done through polling */ +#define JOY_HWS_ISYOKE 0x00000010l /* joystick is a flight yoke */ +#define JOY_HWS_ISGAMEPAD 0x00000020l /* joystick is a game pad */ +#define JOY_HWS_ISCARCTRL 0x00000040l /* joystick is a car controller */ +/* X defaults to J1 X axis */ +#define JOY_HWS_XISJ1Y 0x00000080l /* X is on J1 Y axis */ +#define JOY_HWS_XISJ2X 0x00000100l /* X is on J2 X axis */ +#define JOY_HWS_XISJ2Y 0x00000200l /* X is on J2 Y axis */ +/* Y defaults to J1 Y axis */ +#define JOY_HWS_YISJ1X 0x00000400l /* Y is on J1 X axis */ +#define JOY_HWS_YISJ2X 0x00000800l /* Y is on J2 X axis */ +#define JOY_HWS_YISJ2Y 0x00001000l /* Y is on J2 Y axis */ +/* Z defaults to J2 Y axis */ +#define JOY_HWS_ZISJ1X 0x00002000l /* Z is on J1 X axis */ +#define JOY_HWS_ZISJ1Y 0x00004000l /* Z is on J1 Y axis */ +#define JOY_HWS_ZISJ2X 0x00008000l /* Z is on J2 X axis */ +/* POV defaults to J2 Y axis, if it is not button based */ +#define JOY_HWS_POVISJ1X 0x00010000l /* pov done through J1 X axis */ +#define JOY_HWS_POVISJ1Y 0x00020000l /* pov done through J1 Y axis */ +#define JOY_HWS_POVISJ2X 0x00040000l /* pov done through J2 X axis */ +/* R defaults to J2 X axis */ +#define JOY_HWS_HASR 0x00080000l /* has R (4th axis) info */ +#define JOY_HWS_RISJ1X 0x00100000l /* R done through J1 X axis */ +#define JOY_HWS_RISJ1Y 0x00200000l /* R done through J1 Y axis */ +#define JOY_HWS_RISJ2Y 0x00400000l /* R done through J2 X axis */ +/* U & V for future hardware */ +#define JOY_HWS_HASU 0x00800000l /* has U (5th axis) info */ +#define JOY_HWS_HASV 0x01000000l /* has V (6th axis) info */ + +/* Usage settings */ +#define JOY_US_HASRUDDER 0x00000001l /* joystick configured with rudder */ +#define JOY_US_PRESENT 0x00000002l /* is joystick actually present? */ +#define JOY_US_ISOEM 0x00000004l /* joystick is an OEM defined type */ + +/* reserved for future use -> as link to next possible dword */ +#define JOY_US_RESERVED 0x80000000l /* reserved */ + + +/* Settings for TypeInfo Flags1 */ +#define JOYTYPE_ZEROGAMEENUMOEMDATA 0x00000001l /* Zero GameEnum's OEM data field */ +#define JOYTYPE_NOAUTODETECTGAMEPORT 0x00000002l /* Device does not support Autodetect gameport*/ +#define JOYTYPE_NOHIDDIRECT 0x00000004l /* Do not use HID directly for this device */ +#define JOYTYPE_ANALOGCOMPAT 0x00000008l /* Expose the analog compatible ID */ +#define JOYTYPE_DEFAULTPROPSHEET 0x80000000l /* CPL overrides custom property sheet */ + +/* Settings for TypeInfo Flags2 */ +#define JOYTYPE_DEVICEHIDE 0x00010000l /* Hide unclassified devices */ +#define JOYTYPE_MOUSEHIDE 0x00020000l /* Hide mice */ +#define JOYTYPE_KEYBHIDE 0x00040000l /* Hide keyboards */ +#define JOYTYPE_GAMEHIDE 0x00080000l /* Hide game controllers */ +#define JOYTYPE_HIDEACTIVE 0x00100000l /* Hide flags are active */ +#define JOYTYPE_INFOMASK 0x00E00000l /* Mask for type specific info */ +#define JOYTYPE_INFODEFAULT 0x00000000l /* Use default axis mappings */ +#define JOYTYPE_INFOYYPEDALS 0x00200000l /* Use Y as a combined pedals axis */ +#define JOYTYPE_INFOZYPEDALS 0x00400000l /* Use Z for accelerate, Y for brake */ +#define JOYTYPE_INFOYRPEDALS 0x00600000l /* Use Y for accelerate, R for brake */ +#define JOYTYPE_INFOZRPEDALS 0x00800000l /* Use Z for accelerate, R for brake */ +#define JOYTYPE_INFOZISSLIDER 0x00200000l /* Use Z as a slider */ +#define JOYTYPE_INFOZISZ 0x00400000l /* Use Z as Z axis */ +#define JOYTYPE_ENABLEINPUTREPORT 0x01000000l /* Enable initial input reports */ + +/* struct for storing x,y, z, and rudder values */ +typedef struct joypos_tag { + DWORD dwX; + DWORD dwY; + DWORD dwZ; + DWORD dwR; + DWORD dwU; + DWORD dwV; +} JOYPOS, FAR *LPJOYPOS; + +/* struct for storing ranges */ +typedef struct joyrange_tag { + JOYPOS jpMin; + JOYPOS jpMax; + JOYPOS jpCenter; +} JOYRANGE,FAR *LPJOYRANGE; + +/* + * dwTimeout - value at which to timeout joystick polling + * jrvRanges - range of values app wants returned for axes + * jpDeadZone - area around center to be considered + * as "dead". specified as a percentage + * (0-100). Only X & Y handled by system driver + */ +typedef struct joyreguservalues_tag { + DWORD dwTimeOut; + JOYRANGE jrvRanges; + JOYPOS jpDeadZone; +} JOYREGUSERVALUES, FAR *LPJOYREGUSERVALUES; + +typedef struct joyreghwsettings_tag { + DWORD dwFlags; + DWORD dwNumButtons; +} JOYREGHWSETTINGS, FAR *LPJOYHWSETTINGS; + +/* range of values returned by the hardware (filled in by calibration) */ +/* + * jrvHardware - values returned by hardware + * dwPOVValues - POV values returned by hardware + * dwCalFlags - what has been calibrated + */ +typedef struct joyreghwvalues_tag { + JOYRANGE jrvHardware; + DWORD dwPOVValues[JOY_POV_NUMDIRS]; + DWORD dwCalFlags; +} JOYREGHWVALUES, FAR *LPJOYREGHWVALUES; + +/* hardware configuration */ +/* + * hws - hardware settings + * dwUsageSettings - usage settings + * hwv - values returned by hardware + * dwType - type of joystick + * dwReserved - reserved for OEM drivers + */ +typedef struct joyreghwconfig_tag { + JOYREGHWSETTINGS hws; + DWORD dwUsageSettings; + JOYREGHWVALUES hwv; + DWORD dwType; + DWORD dwReserved; +} JOYREGHWCONFIG, FAR *LPJOYREGHWCONFIG; + +/* joystick calibration info structure */ +typedef struct joycalibrate_tag { + UINT wXbase; + UINT wXdelta; + UINT wYbase; + UINT wYdelta; + UINT wZbase; + UINT wZdelta; +} JOYCALIBRATE; +typedef JOYCALIBRATE FAR *LPJOYCALIBRATE; + +#endif + +#ifndef DIJ_RINGZERO + +#define MAX_JOYSTRING 256 +typedef BOOL (FAR PASCAL * LPDIJOYTYPECALLBACK)(LPCWSTR, LPVOID); + +#ifndef MAX_JOYSTICKOEMVXDNAME +#define MAX_JOYSTICKOEMVXDNAME 260 +#endif + +#define DITC_REGHWSETTINGS 0x00000001 +#define DITC_CLSIDCONFIG 0x00000002 +#define DITC_DISPLAYNAME 0x00000004 +#define DITC_CALLOUT 0x00000008 +#define DITC_HARDWAREID 0x00000010 +#define DITC_FLAGS1 0x00000020 +#define DITC_FLAGS2 0x00000040 +#define DITC_MAPFILE 0x00000080 + + + +/* This structure is defined for DirectX 5.0 compatibility */ + +typedef struct DIJOYTYPEINFO_DX5 { + DWORD dwSize; + JOYREGHWSETTINGS hws; + CLSID clsidConfig; + WCHAR wszDisplayName[MAX_JOYSTRING]; + WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME]; +} DIJOYTYPEINFO_DX5, *LPDIJOYTYPEINFO_DX5; +typedef const DIJOYTYPEINFO_DX5 *LPCDIJOYTYPEINFO_DX5; + +/* This structure is defined for DirectX 6.1 compatibility */ +typedef struct DIJOYTYPEINFO_DX6 { + DWORD dwSize; + JOYREGHWSETTINGS hws; + CLSID clsidConfig; + WCHAR wszDisplayName[MAX_JOYSTRING]; + WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME]; + WCHAR wszHardwareId[MAX_JOYSTRING]; + DWORD dwFlags1; +} DIJOYTYPEINFO_DX6, *LPDIJOYTYPEINFO_DX6; +typedef const DIJOYTYPEINFO_DX6 *LPCDIJOYTYPEINFO_DX6; + +typedef struct DIJOYTYPEINFO { + DWORD dwSize; + JOYREGHWSETTINGS hws; + CLSID clsidConfig; + WCHAR wszDisplayName[MAX_JOYSTRING]; + WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME]; +#if(DIRECTINPUT_VERSION >= 0x05b2) + WCHAR wszHardwareId[MAX_JOYSTRING]; + DWORD dwFlags1; +#if(DIRECTINPUT_VERSION >= 0x0800) + DWORD dwFlags2; + WCHAR wszMapFile[MAX_JOYSTRING]; +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ +#endif /* DIRECTINPUT_VERSION >= 0x05b2 */ +} DIJOYTYPEINFO, *LPDIJOYTYPEINFO; +typedef const DIJOYTYPEINFO *LPCDIJOYTYPEINFO; +#define DIJC_GUIDINSTANCE 0x00000001 +#define DIJC_REGHWCONFIGTYPE 0x00000002 +#define DIJC_GAIN 0x00000004 +#define DIJC_CALLOUT 0x00000008 +#define DIJC_WDMGAMEPORT 0x00000010 + +/* This structure is defined for DirectX 5.0 compatibility */ + +typedef struct DIJOYCONFIG_DX5 { + DWORD dwSize; + GUID guidInstance; + JOYREGHWCONFIG hwc; + DWORD dwGain; + WCHAR wszType[MAX_JOYSTRING]; + WCHAR wszCallout[MAX_JOYSTRING]; +} DIJOYCONFIG_DX5, *LPDIJOYCONFIG_DX5; +typedef const DIJOYCONFIG_DX5 *LPCDIJOYCONFIG_DX5; + +typedef struct DIJOYCONFIG { + DWORD dwSize; + GUID guidInstance; + JOYREGHWCONFIG hwc; + DWORD dwGain; + WCHAR wszType[MAX_JOYSTRING]; + WCHAR wszCallout[MAX_JOYSTRING]; +#if(DIRECTINPUT_VERSION >= 0x05b2) + GUID guidGameport; +#endif /* DIRECTINPUT_VERSION >= 0x05b2 */ + } DIJOYCONFIG, *LPDIJOYCONFIG; +typedef const DIJOYCONFIG *LPCDIJOYCONFIG; + + +#define DIJU_USERVALUES 0x00000001 +#define DIJU_GLOBALDRIVER 0x00000002 +#define DIJU_GAMEPORTEMULATOR 0x00000004 + +typedef struct DIJOYUSERVALUES { + DWORD dwSize; + JOYREGUSERVALUES ruv; + WCHAR wszGlobalDriver[MAX_JOYSTRING]; + WCHAR wszGameportEmulator[MAX_JOYSTRING]; +} DIJOYUSERVALUES, *LPDIJOYUSERVALUES; +typedef const DIJOYUSERVALUES *LPCDIJOYUSERVALUES; + +DEFINE_GUID(GUID_KeyboardClass, 0x4D36E96B,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18); +DEFINE_GUID(GUID_MediaClass, 0x4D36E96C,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18); +DEFINE_GUID(GUID_MouseClass, 0x4D36E96F,0xE325,0x11CE,0xBF,0xC1,0x08,0x00,0x2B,0xE1,0x03,0x18); +DEFINE_GUID(GUID_HIDClass, 0x745A17A0,0x74D3,0x11D0,0xB6,0xFE,0x00,0xA0,0xC9,0x0F,0x57,0xDA); + +#undef INTERFACE +#define INTERFACE IDirectInputJoyConfig + +DECLARE_INTERFACE_(IDirectInputJoyConfig, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputJoyConfig methods ***/ + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(SendNotify)(THIS) PURE; + STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE; + STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE; + STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD) PURE; + STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE; + STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE; + STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE; + STDMETHOD(DeleteConfig)(THIS_ UINT) PURE; + STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE; + STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE; + STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE; + STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE; + STDMETHOD(OpenConfigKey)(THIS_ UINT,DWORD,PHKEY) PURE; +}; + +typedef struct IDirectInputJoyConfig *LPDIRECTINPUTJOYCONFIG; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputJoyConfig_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputJoyConfig_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputJoyConfig_Acquire(p) (p)->lpVtbl->Acquire(p) +#define IDirectInputJoyConfig_Unacquire(p) (p)->lpVtbl->Unacquire(p) +#define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectInputJoyConfig_SendNotify(p) (p)->lpVtbl->SendNotify(p) +#define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b) +#define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c) +#define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->lpVtbl->SetTypeInfo(p,a,b,c) +#define IDirectInputJoyConfig_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a) +#define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c) +#define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c) +#define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a) +#define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b) +#define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b) +#define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b) +#define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c) +#define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->lpVtbl->OpenConfigKey(p,a,b,c) +#else +#define IDirectInputJoyConfig_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputJoyConfig_AddRef(p) (p)->AddRef() +#define IDirectInputJoyConfig_Release(p) (p)->Release() +#define IDirectInputJoyConfig_Acquire(p) (p)->Acquire() +#define IDirectInputJoyConfig_Unacquire(p) (p)->Unacquire() +#define IDirectInputJoyConfig_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectInputJoyConfig_SendNotify(p) (p)->SendNotify() +#define IDirectInputJoyConfig_EnumTypes(p,a,b) (p)->EnumTypes(a,b) +#define IDirectInputJoyConfig_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c) +#define IDirectInputJoyConfig_SetTypeInfo(p,a,b,c) (p)->SetTypeInfo(a,b,c) +#define IDirectInputJoyConfig_DeleteType(p,a) (p)->DeleteType(a) +#define IDirectInputJoyConfig_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c) +#define IDirectInputJoyConfig_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c) +#define IDirectInputJoyConfig_DeleteConfig(p,a) (p)->DeleteConfig(a) +#define IDirectInputJoyConfig_GetUserValues(p,a,b) (p)->GetUserValues(a,b) +#define IDirectInputJoyConfig_SetUserValues(p,a,b) (p)->SetUserValues(a,b) +#define IDirectInputJoyConfig_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b) +#define IDirectInputJoyConfig_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c) +#define IDirectInputJoyConfig_OpenConfigKey(p,a,b,c) (p)->OpenConfigKey(a,b,c) +#endif + +#endif /* DIJ_RINGZERO */ + +#if(DIRECTINPUT_VERSION >= 0x0800) + +#ifndef DIJ_RINGZERO + +#undef INTERFACE +#define INTERFACE IDirectInputJoyConfig8 + +DECLARE_INTERFACE_(IDirectInputJoyConfig8, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + + /*** IDirectInputJoyConfig8 methods ***/ + STDMETHOD(Acquire)(THIS) PURE; + STDMETHOD(Unacquire)(THIS) PURE; + STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; + STDMETHOD(SendNotify)(THIS) PURE; + STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK,LPVOID) PURE; + STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR,LPDIJOYTYPEINFO,DWORD) PURE; + STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR,LPCDIJOYTYPEINFO,DWORD,LPWSTR) PURE; + STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE; + STDMETHOD(GetConfig)(THIS_ UINT,LPDIJOYCONFIG,DWORD) PURE; + STDMETHOD(SetConfig)(THIS_ UINT,LPCDIJOYCONFIG,DWORD) PURE; + STDMETHOD(DeleteConfig)(THIS_ UINT) PURE; + STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES,DWORD) PURE; + STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES,DWORD) PURE; + STDMETHOD(AddNewHardware)(THIS_ HWND,REFGUID) PURE; + STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR,DWORD,PHKEY) PURE; + STDMETHOD(OpenAppStatusKey)(THIS_ PHKEY) PURE; +}; + +typedef struct IDirectInputJoyConfig8 *LPDIRECTINPUTJOYCONFIG8; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectInputJoyConfig8_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectInputJoyConfig8_Release(p) (p)->lpVtbl->Release(p) +#define IDirectInputJoyConfig8_Acquire(p) (p)->lpVtbl->Acquire(p) +#define IDirectInputJoyConfig8_Unacquire(p) (p)->lpVtbl->Unacquire(p) +#define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectInputJoyConfig8_SendNotify(p) (p)->lpVtbl->SendNotify(p) +#define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->lpVtbl->EnumTypes(p,a,b) +#define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->lpVtbl->GetTypeInfo(p,a,b,c) +#define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->lpVtbl->SetTypeInfo(p,a,b,c,d) +#define IDirectInputJoyConfig8_DeleteType(p,a) (p)->lpVtbl->DeleteType(p,a) +#define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->lpVtbl->GetConfig(p,a,b,c) +#define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->lpVtbl->SetConfig(p,a,b,c) +#define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->lpVtbl->DeleteConfig(p,a) +#define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->lpVtbl->GetUserValues(p,a,b) +#define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->lpVtbl->SetUserValues(p,a,b) +#define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->lpVtbl->AddNewHardware(p,a,b) +#define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->lpVtbl->OpenTypeKey(p,a,b,c) +#define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->lpVtbl->OpenAppStatusKey(p,a) +#else +#define IDirectInputJoyConfig8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectInputJoyConfig8_AddRef(p) (p)->AddRef() +#define IDirectInputJoyConfig8_Release(p) (p)->Release() +#define IDirectInputJoyConfig8_Acquire(p) (p)->Acquire() +#define IDirectInputJoyConfig8_Unacquire(p) (p)->Unacquire() +#define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectInputJoyConfig8_SendNotify(p) (p)->SendNotify() +#define IDirectInputJoyConfig8_EnumTypes(p,a,b) (p)->EnumTypes(a,b) +#define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c) (p)->GetTypeInfo(a,b,c) +#define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d) (p)->SetTypeInfo(a,b,c,d) +#define IDirectInputJoyConfig8_DeleteType(p,a) (p)->DeleteType(a) +#define IDirectInputJoyConfig8_GetConfig(p,a,b,c) (p)->GetConfig(a,b,c) +#define IDirectInputJoyConfig8_SetConfig(p,a,b,c) (p)->SetConfig(a,b,c) +#define IDirectInputJoyConfig8_DeleteConfig(p,a) (p)->DeleteConfig(a) +#define IDirectInputJoyConfig8_GetUserValues(p,a,b) (p)->GetUserValues(a,b) +#define IDirectInputJoyConfig8_SetUserValues(p,a,b) (p)->SetUserValues(a,b) +#define IDirectInputJoyConfig8_AddNewHardware(p,a,b) (p)->AddNewHardware(a,b) +#define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c) (p)->OpenTypeKey(a,b,c) +#define IDirectInputJoyConfig8_OpenAppStatusKey(p,a) (p)->OpenAppStatusKey(a) +#endif + +#endif /* DIJ_RINGZERO */ + +/**************************************************************************** + * + * Notification Messages + * + ****************************************************************************/ + +/* RegisterWindowMessage with this to get DirectInput notification messages */ +#define DIRECTINPUT_NOTIFICATION_MSGSTRINGA "DIRECTINPUT_NOTIFICATION_MSGSTRING" +#define DIRECTINPUT_NOTIFICATION_MSGSTRINGW L"DIRECTINPUT_NOTIFICATION_MSGSTRING" + +#ifdef UNICODE +#define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGW +#else +#define DIRECTINPUT_NOTIFICATION_MSGSTRING DIRECTINPUT_NOTIFICATION_MSGSTRINGA +#endif + +#define DIMSGWP_NEWAPPSTART 0x00000001 +#define DIMSGWP_DX8APPSTART 0x00000002 +#define DIMSGWP_DX8MAPPERAPPSTART 0x00000003 + +#endif /* DIRECTINPUT_VERSION >= 0x0800 */ + +#define DIAPPIDFLAG_NOTIME 0x00000001 +#define DIAPPIDFLAG_NOSIZE 0x00000002 + +#define DIRECTINPUT_REGSTR_VAL_APPIDFLAGA "AppIdFlag" +#define DIRECTINPUT_REGSTR_KEY_LASTAPPA "MostRecentApplication" +#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA "MostRecentMapperApplication" +#define DIRECTINPUT_REGSTR_VAL_VERSIONA "Version" +#define DIRECTINPUT_REGSTR_VAL_NAMEA "Name" +#define DIRECTINPUT_REGSTR_VAL_IDA "Id" +#define DIRECTINPUT_REGSTR_VAL_MAPPERA "UsesMapper" +#define DIRECTINPUT_REGSTR_VAL_LASTSTARTA "MostRecentStart" + +#define DIRECTINPUT_REGSTR_VAL_APPIDFLAGW L"AppIdFlag" +#define DIRECTINPUT_REGSTR_KEY_LASTAPPW L"MostRecentApplication" +#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW L"MostRecentMapperApplication" +#define DIRECTINPUT_REGSTR_VAL_VERSIONW L"Version" +#define DIRECTINPUT_REGSTR_VAL_NAMEW L"Name" +#define DIRECTINPUT_REGSTR_VAL_IDW L"Id" +#define DIRECTINPUT_REGSTR_VAL_MAPPERW L"UsesMapper" +#define DIRECTINPUT_REGSTR_VAL_LASTSTARTW L"MostRecentStart" + +#ifdef UNICODE +#define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGW +#define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPW +#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPW +#define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONW +#define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEW +#define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDW +#define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERW +#define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTW +#else +#define DIRECTINPUT_REGSTR_VAL_APPIDFLAG DIRECTINPUT_REGSTR_VAL_APPIDFLAGA +#define DIRECTINPUT_REGSTR_KEY_LASTAPP DIRECTINPUT_REGSTR_KEY_LASTAPPA +#define DIRECTINPUT_REGSTR_KEY_LASTMAPAPP DIRECTINPUT_REGSTR_KEY_LASTMAPAPPA +#define DIRECTINPUT_REGSTR_VAL_VERSION DIRECTINPUT_REGSTR_VAL_VERSIONA +#define DIRECTINPUT_REGSTR_VAL_NAME DIRECTINPUT_REGSTR_VAL_NAMEA +#define DIRECTINPUT_REGSTR_VAL_ID DIRECTINPUT_REGSTR_VAL_IDA +#define DIRECTINPUT_REGSTR_VAL_MAPPER DIRECTINPUT_REGSTR_VAL_MAPPERA +#define DIRECTINPUT_REGSTR_VAL_LASTSTART DIRECTINPUT_REGSTR_VAL_LASTSTARTA +#endif + + +/**************************************************************************** + * + * Return Codes + * + ****************************************************************************/ + +#define DIERR_NOMOREITEMS \ + MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NO_MORE_ITEMS) + +/* + * Device driver-specific codes. + */ + +#define DIERR_DRIVERFIRST 0x80040300L +#define DIERR_DRIVERLAST 0x800403FFL + +/* + * Unless the specific driver has been precisely identified, no meaning + * should be attributed to these values other than that the driver + * originated the error. However, to illustrate the types of error that + * may be causing the failure, the PID force feedback driver distributed + * with DirectX 7 could return the following errors: + * + * DIERR_DRIVERFIRST + 1 + * The requested usage was not found. + * DIERR_DRIVERFIRST + 2 + * The parameter block couldn't be downloaded to the device. + * DIERR_DRIVERFIRST + 3 + * PID initialization failed. + * DIERR_DRIVERFIRST + 4 + * The provided values couldn't be scaled. + */ + + +/* + * Device installer errors. + */ + +/* + * Registry entry or DLL for class installer invalid + * or class installer not found. + */ +#define DIERR_INVALIDCLASSINSTALLER 0x80040400L + +/* + * The user cancelled the install operation. + */ +#define DIERR_CANCELLED 0x80040401L + +/* + * The INF file for the selected device could not be + * found or is invalid or is damaged. + */ +#define DIERR_BADINF 0x80040402L + +/**************************************************************************** + * + * Map files + * + ****************************************************************************/ + +/* + * Delete particular data from default map file. + */ +#define DIDIFT_DELETE 0x01000000 + +#ifdef __cplusplus +}; +#endif + +#endif /* __DINPUTD_INCLUDED__ */ diff --git a/Src/Decoder_H264_ALL/D3D/include/dls1.h b/Src/Decoder_H264_ALL/D3D/include/dls1.h new file mode 100644 index 0000000..fc88a31 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dls1.h @@ -0,0 +1,267 @@ +/*==========================================================================; +// +// dls1.h +// +// +// Description: +// +// Interface defines and structures for the Instrument Collection Form +// RIFF DLS. +// +// +// Written by Sonic Foundry 1996. Released for public use. +// +//=========================================================================*/ + +#ifndef _INC_DLS1 +#define _INC_DLS1 + +/*////////////////////////////////////////////////////////////////////////// +// +// +// Layout of an instrument collection: +// +// +// RIFF [] 'DLS ' [dlid,colh,INSTLIST,WAVEPOOL,INFOLIST] +// +// INSTLIST +// LIST [] 'lins' +// LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST] +// LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST] +// LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST] +// +// RGNLIST +// LIST [] 'lrgn' +// LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST] +// LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST] +// LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST] +// +// ARTLIST +// LIST [] 'lart' +// 'art1' level 1 Articulation connection graph +// 'art2' level 2 Articulation connection graph +// '3rd1' Possible 3rd party articulation structure 1 +// '3rd2' Possible 3rd party articulation structure 2 .... and so on +// +// WAVEPOOL +// ptbl [] [pool table] +// LIST [] 'wvpl' +// [path], +// [path], +// LIST [] 'wave' [dlid,RIFFWAVE] +// LIST [] 'wave' [dlid,RIFFWAVE] +// LIST [] 'wave' [dlid,RIFFWAVE] +// LIST [] 'wave' [dlid,RIFFWAVE] +// LIST [] 'wave' [dlid,RIFFWAVE] +// +// INFOLIST +// LIST [] 'INFO' +// 'icmt' 'One of those crazy comments.' +// 'icop' 'Copyright (C) 1996 Sonic Foundry' +// +/////////////////////////////////////////////////////////////////////////*/ + + +/*///////////////////////////////////////////////////////////////////////// +// FOURCC's used in the DLS file +/////////////////////////////////////////////////////////////////////////*/ + +#define FOURCC_DLS mmioFOURCC('D','L','S',' ') +#define FOURCC_DLID mmioFOURCC('d','l','i','d') +#define FOURCC_COLH mmioFOURCC('c','o','l','h') +#define FOURCC_WVPL mmioFOURCC('w','v','p','l') +#define FOURCC_PTBL mmioFOURCC('p','t','b','l') +#define FOURCC_PATH mmioFOURCC('p','a','t','h') +#define FOURCC_wave mmioFOURCC('w','a','v','e') +#define FOURCC_LINS mmioFOURCC('l','i','n','s') +#define FOURCC_INS mmioFOURCC('i','n','s',' ') +#define FOURCC_INSH mmioFOURCC('i','n','s','h') +#define FOURCC_LRGN mmioFOURCC('l','r','g','n') +#define FOURCC_RGN mmioFOURCC('r','g','n',' ') +#define FOURCC_RGNH mmioFOURCC('r','g','n','h') +#define FOURCC_LART mmioFOURCC('l','a','r','t') +#define FOURCC_ART1 mmioFOURCC('a','r','t','1') +#define FOURCC_WLNK mmioFOURCC('w','l','n','k') +#define FOURCC_WSMP mmioFOURCC('w','s','m','p') +#define FOURCC_VERS mmioFOURCC('v','e','r','s') + +/*///////////////////////////////////////////////////////////////////////// +// Articulation connection graph definitions +/////////////////////////////////////////////////////////////////////////*/ + +/* Generic Sources */ +#define CONN_SRC_NONE 0x0000 +#define CONN_SRC_LFO 0x0001 +#define CONN_SRC_KEYONVELOCITY 0x0002 +#define CONN_SRC_KEYNUMBER 0x0003 +#define CONN_SRC_EG1 0x0004 +#define CONN_SRC_EG2 0x0005 +#define CONN_SRC_PITCHWHEEL 0x0006 + +/* Midi Controllers 0-127 */ +#define CONN_SRC_CC1 0x0081 +#define CONN_SRC_CC7 0x0087 +#define CONN_SRC_CC10 0x008a +#define CONN_SRC_CC11 0x008b + +/* Generic Destinations */ +#define CONN_DST_NONE 0x0000 +#define CONN_DST_ATTENUATION 0x0001 +#define CONN_DST_PITCH 0x0003 +#define CONN_DST_PAN 0x0004 + +/* LFO Destinations */ +#define CONN_DST_LFO_FREQUENCY 0x0104 +#define CONN_DST_LFO_STARTDELAY 0x0105 + +/* EG1 Destinations */ +#define CONN_DST_EG1_ATTACKTIME 0x0206 +#define CONN_DST_EG1_DECAYTIME 0x0207 +#define CONN_DST_EG1_RELEASETIME 0x0209 +#define CONN_DST_EG1_SUSTAINLEVEL 0x020a + +/* EG2 Destinations */ +#define CONN_DST_EG2_ATTACKTIME 0x030a +#define CONN_DST_EG2_DECAYTIME 0x030b +#define CONN_DST_EG2_RELEASETIME 0x030d +#define CONN_DST_EG2_SUSTAINLEVEL 0x030e + +#define CONN_TRN_NONE 0x0000 +#define CONN_TRN_CONCAVE 0x0001 + +typedef struct _DLSID { + ULONG ulData1; + USHORT usData2; + USHORT usData3; + BYTE abData4[8]; +} DLSID, FAR *LPDLSID; + +typedef struct _DLSVERSION { + DWORD dwVersionMS; + DWORD dwVersionLS; +}DLSVERSION, FAR *LPDLSVERSION; + + +typedef struct _CONNECTION { + USHORT usSource; + USHORT usControl; + USHORT usDestination; + USHORT usTransform; + LONG lScale; + }CONNECTION, FAR *LPCONNECTION; + + +/* Level 1 Articulation Data */ + +typedef struct _CONNECTIONLIST { + ULONG cbSize; /* size of the connection list structure */ + ULONG cConnections; /* count of connections in the list */ + } CONNECTIONLIST, FAR *LPCONNECTIONLIST; + + + +/*///////////////////////////////////////////////////////////////////////// +// Generic type defines for regions and instruments +/////////////////////////////////////////////////////////////////////////*/ + +typedef struct _RGNRANGE { + USHORT usLow; + USHORT usHigh; +}RGNRANGE, FAR * LPRGNRANGE; + +#define F_INSTRUMENT_DRUMS 0x80000000 + +typedef struct _MIDILOCALE { + ULONG ulBank; + ULONG ulInstrument; +}MIDILOCALE, FAR *LPMIDILOCALE; + +/*///////////////////////////////////////////////////////////////////////// +// Header structures found in an DLS file for collection, instruments, and +// regions. +/////////////////////////////////////////////////////////////////////////*/ + +#define F_RGN_OPTION_SELFNONEXCLUSIVE 0x0001 + +typedef struct _RGNHEADER { + RGNRANGE RangeKey; /* Key range */ + RGNRANGE RangeVelocity; /* Velocity Range */ + USHORT fusOptions; /* Synthesis options for this range */ + USHORT usKeyGroup; /* Key grouping for non simultaneous play */ + /* 0 = no group, 1 up is group */ + /* for Level 1 only groups 1-15 are allowed */ +}RGNHEADER, FAR *LPRGNHEADER; + +typedef struct _INSTHEADER { + ULONG cRegions; /* Count of regions in this instrument */ + MIDILOCALE Locale; /* Intended MIDI locale of this instrument */ +}INSTHEADER, FAR *LPINSTHEADER; + +typedef struct _DLSHEADER { + ULONG cInstruments; /* Count of instruments in the collection */ +}DLSHEADER, FAR *LPDLSHEADER; + +/*//////////////////////////////////////////////////////////////////////////// +// definitions for the Wave link structure +////////////////////////////////////////////////////////////////////////////*/ + +/* **** For level 1 only WAVELINK_CHANNEL_MONO is valid **** */ +/* ulChannel allows for up to 32 channels of audio with each bit position */ +/* specifiying a channel of playback */ + +#define WAVELINK_CHANNEL_LEFT 0x0001l +#define WAVELINK_CHANNEL_RIGHT 0x0002l + +#define F_WAVELINK_PHASE_MASTER 0x0001 + +typedef struct _WAVELINK { /* any paths or links are stored right after struct */ + USHORT fusOptions; /* options flags for this wave */ + USHORT usPhaseGroup; /* Phase grouping for locking channels */ + ULONG ulChannel; /* channel placement */ + ULONG ulTableIndex; /* index into the wave pool table, 0 based */ +}WAVELINK, FAR *LPWAVELINK; + +#define POOL_CUE_NULL 0xffffffffl + +typedef struct _POOLCUE { + ULONG ulOffset; /* Offset to the entry in the list */ +}POOLCUE, FAR *LPPOOLCUE; + +typedef struct _POOLTABLE { + ULONG cbSize; /* size of the pool table structure */ + ULONG cCues; /* count of cues in the list */ + } POOLTABLE, FAR *LPPOOLTABLE; + +/*//////////////////////////////////////////////////////////////////////////// +// Structures for the "wsmp" chunk +////////////////////////////////////////////////////////////////////////////*/ + +#define F_WSMP_NO_TRUNCATION 0x0001l +#define F_WSMP_NO_COMPRESSION 0x0002l + + +typedef struct _rwsmp { + ULONG cbSize; + USHORT usUnityNote; /* MIDI Unity Playback Note */ + SHORT sFineTune; /* Fine Tune in log tuning */ + LONG lAttenuation; /* Overall Attenuation to be applied to data */ + ULONG fulOptions; /* Flag options */ + ULONG cSampleLoops; /* Count of Sample loops, 0 loops is one shot */ + } WSMPL, FAR *LPWSMPL; + + +/* This loop type is a normal forward playing loop which is continually */ +/* played until the envelope reaches an off threshold in the release */ +/* portion of the volume envelope */ + +#define WLOOP_TYPE_FORWARD 0 + +typedef struct _rloop { + ULONG cbSize; + ULONG ulType; /* Loop Type */ + ULONG ulStart; /* Start of loop in samples */ + ULONG ulLength; /* Length of loop in samples */ +} WLOOP, FAR *LPWLOOP; + +#endif /*_INC_DLS1 */ + diff --git a/Src/Decoder_H264_ALL/D3D/include/dls2.h b/Src/Decoder_H264_ALL/D3D/include/dls2.h new file mode 100644 index 0000000..30cec23 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dls2.h @@ -0,0 +1,130 @@ +/* + + dls2.h + + Description: + + Interface defines and structures for the DLS2 extensions of DLS. + + + Written by Microsoft 1998. Released for public use. + +*/ + +#ifndef _INC_DLS2 +#define _INC_DLS2 + +/* + FOURCC's used in the DLS2 file, in addition to DLS1 chunks +*/ + +#define FOURCC_RGN2 mmioFOURCC('r','g','n','2') +#define FOURCC_LAR2 mmioFOURCC('l','a','r','2') +#define FOURCC_ART2 mmioFOURCC('a','r','t','2') +#define FOURCC_CDL mmioFOURCC('c','d','l',' ') +#define FOURCC_DLID mmioFOURCC('d','l','i','d') + +/* + Articulation connection graph definitions. These are in addition to + the definitions in the DLS1 header. +*/ + +/* Generic Sources (in addition to DLS1 sources. */ +#define CONN_SRC_POLYPRESSURE 0x0007 /* Polyphonic Pressure */ +#define CONN_SRC_CHANNELPRESSURE 0x0008 /* Channel Pressure */ +#define CONN_SRC_VIBRATO 0x0009 /* Vibrato LFO */ +#define CONN_SRC_MONOPRESSURE 0x000a /* MIDI Mono pressure */ + + +/* Midi Controllers */ +#define CONN_SRC_CC91 0x00db /* Reverb Send */ +#define CONN_SRC_CC93 0x00dd /* Chorus Send */ + + +/* Generic Destinations */ +#define CONN_DST_GAIN 0x0001 /* Same as CONN_DST_ ATTENUATION, but more appropriate terminology. */ +#define CONN_DST_KEYNUMBER 0x0005 /* Key Number Generator */ + +/* Audio Channel Output Destinations */ +#define CONN_DST_LEFT 0x0010 /* Left Channel Send */ +#define CONN_DST_RIGHT 0x0011 /* Right Channel Send */ +#define CONN_DST_CENTER 0x0012 /* Center Channel Send */ +#define CONN_DST_LEFTREAR 0x0013 /* Left Rear Channel Send */ +#define CONN_DST_RIGHTREAR 0x0014 /* Right Rear Channel Send */ +#define CONN_DST_LFE_CHANNEL 0x0015 /* LFE Channel Send */ +#define CONN_DST_CHORUS 0x0080 /* Chorus Send */ +#define CONN_DST_REVERB 0x0081 /* Reverb Send */ + +/* Vibrato LFO Destinations */ +#define CONN_DST_VIB_FREQUENCY 0x0114 /* Vibrato Frequency */ +#define CONN_DST_VIB_STARTDELAY 0x0115 /* Vibrato Start Delay */ + +/* EG1 Destinations */ +#define CONN_DST_EG1_DELAYTIME 0x020B /* EG1 Delay Time */ +#define CONN_DST_EG1_HOLDTIME 0x020C /* EG1 Hold Time */ +#define CONN_DST_EG1_SHUTDOWNTIME 0x020D /* EG1 Shutdown Time */ + + +/* EG2 Destinations */ +#define CONN_DST_EG2_DELAYTIME 0x030F /* EG2 Delay Time */ +#define CONN_DST_EG2_HOLDTIME 0x0310 /* EG2 Hold Time */ + + +/* Filter Destinations */ +#define CONN_DST_FILTER_CUTOFF 0x0500 /* Filter Cutoff Frequency */ +#define CONN_DST_FILTER_Q 0x0501 /* Filter Resonance */ + + +/* Transforms */ +#define CONN_TRN_CONVEX 0x0002 /* Convex Transform */ +#define CONN_TRN_SWITCH 0x0003 /* Switch Transform */ + + +/* Conditional chunk operators */ + #define DLS_CDL_AND 0x0001 /* X = X & Y */ + #define DLS_CDL_OR 0x0002 /* X = X | Y */ + #define DLS_CDL_XOR 0x0003 /* X = X ^ Y */ + #define DLS_CDL_ADD 0x0004 /* X = X + Y */ + #define DLS_CDL_SUBTRACT 0x0005 /* X = X - Y */ + #define DLS_CDL_MULTIPLY 0x0006 /* X = X * Y */ + #define DLS_CDL_DIVIDE 0x0007 /* X = X / Y */ + #define DLS_CDL_LOGICAL_AND 0x0008 /* X = X && Y */ + #define DLS_CDL_LOGICAL_OR 0x0009 /* X = X || Y */ + #define DLS_CDL_LT 0x000A /* X = (X < Y) */ + #define DLS_CDL_LE 0x000B /* X = (X <= Y) */ + #define DLS_CDL_GT 0x000C /* X = (X > Y) */ + #define DLS_CDL_GE 0x000D /* X = (X >= Y) */ + #define DLS_CDL_EQ 0x000E /* X = (X == Y) */ + #define DLS_CDL_NOT 0x000F /* X = !X */ + #define DLS_CDL_CONST 0x0010 /* 32-bit constant */ + #define DLS_CDL_QUERY 0x0011 /* 32-bit value returned from query */ + #define DLS_CDL_QUERYSUPPORTED 0x0012 /* Test to see if query is supported by synth */ + +/* + Loop and release +*/ + +#define WLOOP_TYPE_RELEASE 1 + +/* + WaveLink chunk +*/ + +#define F_WAVELINK_MULTICHANNEL 0x0002 + + +/* + DLSID queries for +*/ + +DEFINE_GUID(DLSID_GMInHardware, 0x178f2f24, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); +DEFINE_GUID(DLSID_GSInHardware, 0x178f2f25, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); +DEFINE_GUID(DLSID_XGInHardware, 0x178f2f26, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); +DEFINE_GUID(DLSID_SupportsDLS1, 0x178f2f27, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); +DEFINE_GUID(DLSID_SupportsDLS2, 0xf14599e5, 0x4689, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); +DEFINE_GUID(DLSID_SampleMemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); +DEFINE_GUID(DLSID_ManufacturersID, 0xb03e1181, 0x8095, 0x11d2, 0xa1, 0xef, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8); +DEFINE_GUID(DLSID_ProductID, 0xb03e1182, 0x8095, 0x11d2, 0xa1, 0xef, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8); +DEFINE_GUID(DLSID_SamplePlaybackRate, 0x2a91f713, 0xa4bf, 0x11d2, 0xbb, 0xdf, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8); + +#endif /* _INC_DLS2 */ diff --git a/Src/Decoder_H264_ALL/D3D/include/dmdls.h b/Src/Decoder_H264_ALL/D3D/include/dmdls.h new file mode 100644 index 0000000..c507268 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dmdls.h @@ -0,0 +1,199 @@ +/************************************************************************ +* * +* dmdls.h -- DLS download definitions for DirectMusic API's * +* * +* Copyright (c) Microsoft Corporation. All rights reserved. * +* * +************************************************************************/ + +#ifndef _DMDLS_ +#define _DMDLS_ + +#include "dls1.h" + +typedef long PCENT; /* Pitch cents */ +typedef long GCENT; /* Gain cents */ +typedef long TCENT; /* Time cents */ +typedef long PERCENT; /* Per.. cent! */ + +typedef LONGLONG REFERENCE_TIME; +typedef REFERENCE_TIME *LPREFERENCE_TIME; + +#ifndef MAKE_FOURCC +#define MAKEFOURCC(ch0, ch1, ch2, ch3) \ + ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ + ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) + + +typedef DWORD FOURCC; /* a four character code */ +#endif + +typedef struct _DMUS_DOWNLOADINFO +{ + DWORD dwDLType; /* Instrument or Wave */ + DWORD dwDLId; /* Unique identifier to tag this download. */ + DWORD dwNumOffsetTableEntries; /* Number of index in the offset address table. */ + DWORD cbSize; /* Total size of this memory chunk. */ +} DMUS_DOWNLOADINFO; + +#define DMUS_DOWNLOADINFO_INSTRUMENT 1 +#define DMUS_DOWNLOADINFO_WAVE 2 +#define DMUS_DOWNLOADINFO_INSTRUMENT2 3 /* New version for better DLS2 support. */ + +/* Support for oneshot and streaming wave data + */ +#define DMUS_DOWNLOADINFO_WAVEARTICULATION 4 /* Wave articulation data */ +#define DMUS_DOWNLOADINFO_STREAMINGWAVE 5 /* One chunk of a streaming */ +#define DMUS_DOWNLOADINFO_ONESHOTWAVE 6 + +#define DMUS_DEFAULT_SIZE_OFFSETTABLE 1 + +/* Flags for DMUS_INSTRUMENT's ulFlags member */ + +#define DMUS_INSTRUMENT_GM_INSTRUMENT (1 << 0) + +typedef struct _DMUS_OFFSETTABLE +{ + ULONG ulOffsetTable[DMUS_DEFAULT_SIZE_OFFSETTABLE]; +} DMUS_OFFSETTABLE; + +typedef struct _DMUS_INSTRUMENT +{ + ULONG ulPatch; + ULONG ulFirstRegionIdx; + ULONG ulGlobalArtIdx; /* If zero the instrument does not have an articulation */ + ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the instrument */ + ULONG ulCopyrightIdx; /* If zero no Copyright information associated with the instrument */ + ULONG ulFlags; +} DMUS_INSTRUMENT; + +typedef struct _DMUS_REGION +{ + RGNRANGE RangeKey; + RGNRANGE RangeVelocity; + USHORT fusOptions; + USHORT usKeyGroup; + ULONG ulRegionArtIdx; /* If zero the region does not have an articulation */ + ULONG ulNextRegionIdx; /* If zero no more regions */ + ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the region */ + WAVELINK WaveLink; + WSMPL WSMP; /* If WSMP.cSampleLoops > 1 then a WLOOP is included */ + WLOOP WLOOP[1]; +} DMUS_REGION; + +typedef struct _DMUS_LFOPARAMS +{ + PCENT pcFrequency; + TCENT tcDelay; + GCENT gcVolumeScale; + PCENT pcPitchScale; + GCENT gcMWToVolume; + PCENT pcMWToPitch; +} DMUS_LFOPARAMS; + +typedef struct _DMUS_VEGPARAMS +{ + TCENT tcAttack; + TCENT tcDecay; + PERCENT ptSustain; + TCENT tcRelease; + TCENT tcVel2Attack; + TCENT tcKey2Decay; +} DMUS_VEGPARAMS; + +typedef struct _DMUS_PEGPARAMS +{ + TCENT tcAttack; + TCENT tcDecay; + PERCENT ptSustain; + TCENT tcRelease; + TCENT tcVel2Attack; + TCENT tcKey2Decay; + PCENT pcRange; +} DMUS_PEGPARAMS; + +typedef struct _DMUS_MSCPARAMS +{ + PERCENT ptDefaultPan; +} DMUS_MSCPARAMS; + +typedef struct _DMUS_ARTICPARAMS +{ + DMUS_LFOPARAMS LFO; + DMUS_VEGPARAMS VolEG; + DMUS_PEGPARAMS PitchEG; + DMUS_MSCPARAMS Misc; +} DMUS_ARTICPARAMS; + +typedef struct _DMUS_ARTICULATION /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT format. */ +{ + ULONG ulArt1Idx; /* DLS Level 1 articulation chunk */ + ULONG ulFirstExtCkIdx; /* 3rd party extenstion chunks associated with the articulation */ +} DMUS_ARTICULATION; + +typedef struct _DMUS_ARTICULATION2 /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT2 format. */ +{ + ULONG ulArtIdx; /* DLS Level 1/2 articulation chunk */ + ULONG ulFirstExtCkIdx; /* 3rd party extenstion chunks associated with the articulation */ + ULONG ulNextArtIdx; /* Additional articulation chunks */ +} DMUS_ARTICULATION2; + +#define DMUS_MIN_DATA_SIZE 4 +/* The actual number is determined by cbSize of struct _DMUS_EXTENSIONCHUNK */ + +typedef struct _DMUS_EXTENSIONCHUNK +{ + ULONG cbSize; /* Size of extension chunk */ + ULONG ulNextExtCkIdx; /* If zero no more 3rd party entenstion chunks */ + FOURCC ExtCkID; + BYTE byExtCk[DMUS_MIN_DATA_SIZE]; /* The actual number that follows is determined by cbSize */ +} DMUS_EXTENSIONCHUNK; + +/* The actual number is determined by cbSize of struct _DMUS_COPYRIGHT */ + +typedef struct _DMUS_COPYRIGHT +{ + ULONG cbSize; /* Size of copyright information */ + BYTE byCopyright[DMUS_MIN_DATA_SIZE]; /* The actual number that follows is determined by cbSize */ +} DMUS_COPYRIGHT; + +typedef struct _DMUS_WAVEDATA +{ + ULONG cbSize; + BYTE byData[DMUS_MIN_DATA_SIZE]; +} DMUS_WAVEDATA; + +typedef struct _DMUS_WAVE +{ + ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the wave */ + ULONG ulCopyrightIdx; /* If zero no Copyright information associated with the wave */ + ULONG ulWaveDataIdx; /* Location of actual wave data. */ + WAVEFORMATEX WaveformatEx; +} DMUS_WAVE; + +typedef struct _DMUS_NOTERANGE *LPDMUS_NOTERANGE; +typedef struct _DMUS_NOTERANGE +{ + DWORD dwLowNote; /* Sets the low note for the range of MIDI note events to which the instrument responds.*/ + DWORD dwHighNote; /* Sets the high note for the range of MIDI note events to which the instrument responds.*/ +} DMUS_NOTERANGE; + +typedef struct _DMUS_WAVEARTDL +{ + ULONG ulDownloadIdIdx; /* Download ID's of each buffer */ + ULONG ulBus; /* Playback bus */ + ULONG ulBuffers; /* Buffers */ + ULONG ulMasterDLId; /* Download ID of master voice of slave group */ + USHORT usOptions; /* Same as DLS2 region options */ +} DMUS_WAVEARTDL, + *LPDMUS_WAVEARTDL; + +typedef struct _DMUS_WAVEDL +{ + ULONG cbWaveData; /* Bytes of wave data */ +} DMUS_WAVEDL, + *LPDMUS_WAVEDL; + +#endif + + diff --git a/Src/Decoder_H264_ALL/D3D/include/dmerror.h b/Src/Decoder_H264_ALL/D3D/include/dmerror.h new file mode 100644 index 0000000..a0a61ff --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dmerror.h @@ -0,0 +1,843 @@ +/************************************************************************ +* * +* dmerror.h -- Error codes returned by DirectMusic API's * +* * +* Copyright (c) Microsoft Corporation. All rights reserved. * +* * +************************************************************************/ + +#ifndef _DMERROR_ +#define _DMERROR_ + +#define FACILITY_DIRECTMUSIC 0x878 /* Shared with DirectSound */ +#define DMUS_ERRBASE 0x1000 /* Make error codes human readable in hex */ + +#ifndef MAKE_HRESULT +#define MAKE_HRESULT(sev,fac,code) \ + ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) ) +#endif + +#define MAKE_DMHRESULTSUCCESS(code) MAKE_HRESULT(0, FACILITY_DIRECTMUSIC, (DMUS_ERRBASE + (code))) +#define MAKE_DMHRESULTERROR(code) MAKE_HRESULT(1, FACILITY_DIRECTMUSIC, (DMUS_ERRBASE + (code))) + +/* DMUS_S_PARTIALLOAD + * + * The object could only load partially. This can happen if some components are + * not registered properly, such as embedded tracks and tools. This can also happen + * if some content is missing. For example, if a segment uses a DLS collection that + * is not in the loader's current search directory. + */ +#define DMUS_S_PARTIALLOAD MAKE_DMHRESULTSUCCESS(0x091) + +/* DMUS_S_PARTIALDOWNLOAD + * + * Return value from IDirectMusicBand::Download() which indicates that + * some of the instruments safely downloaded, but others failed. This usually + * occurs when some instruments are on PChannels not supported by the performance + * or port. + */ +#define DMUS_S_PARTIALDOWNLOAD MAKE_DMHRESULTSUCCESS(0x092) + +/* DMUS_S_REQUEUE + * + * Return value from IDirectMusicTool::ProcessPMsg() which indicates to the + * performance that it should cue the PMsg again automatically. + */ +#define DMUS_S_REQUEUE MAKE_DMHRESULTSUCCESS(0x200) + +/* DMUS_S_FREE + * + * Return value from IDirectMusicTool::ProcessPMsg() which indicates to the + * performance that it should free the PMsg automatically. + */ +#define DMUS_S_FREE MAKE_DMHRESULTSUCCESS(0x201) + +/* DMUS_S_END + * + * Return value from IDirectMusicTrack::Play() which indicates to the + * segment that the track has no more data after mtEnd. + */ +#define DMUS_S_END MAKE_DMHRESULTSUCCESS(0x202) + +/* DMUS_S_STRING_TRUNCATED + * + * Returned string has been truncated to fit the buffer size. + */ +#define DMUS_S_STRING_TRUNCATED MAKE_DMHRESULTSUCCESS(0x210) + +/* DMUS_S_LAST_TOOL + * + * Returned from IDirectMusicGraph::StampPMsg(), this indicates that the PMsg + * is already stamped with the last tool in the graph. The returned PMsg's + * tool pointer is now NULL. + */ +#define DMUS_S_LAST_TOOL MAKE_DMHRESULTSUCCESS(0x211) + +/* DMUS_S_OVER_CHORD + * + * Returned from IDirectMusicPerformance::MusicToMIDI(), this indicates + * that no note has been calculated because the music value has the note + * at a position higher than the top note of the chord. This applies only + * to DMUS_PLAYMODE_NORMALCHORD play mode. This success code indicates + * that the caller should not do anything with the note. It is not meant + * to be played against this chord. + */ +#define DMUS_S_OVER_CHORD MAKE_DMHRESULTSUCCESS(0x212) + +/* DMUS_S_UP_OCTAVE + * + * Returned from IDirectMusicPerformance::MIDIToMusic(), and + * IDirectMusicPerformance::MusicToMIDI(), this indicates + * that the note conversion generated a note value that is below 0, + * so it has been bumped up one or more octaves to be in the proper + * MIDI range of 0 through 127. + * Note that this is valid for MIDIToMusic() when using play modes + * DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of + * which store MIDI values in wMusicValue. With MusicToMIDI(), it is + * valid for all play modes. + * Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code. + */ +#define DMUS_S_UP_OCTAVE MAKE_DMHRESULTSUCCESS(0x213) + +/* DMUS_S_DOWN_OCTAVE + * + * Returned from IDirectMusicPerformance::MIDIToMusic(), and + * IDirectMusicPerformance::MusicToMIDI(), this indicates + * that the note conversion generated a note value that is above 127, + * so it has been bumped down one or more octaves to be in the proper + * MIDI range of 0 through 127. + * Note that this is valid for MIDIToMusic() when using play modes + * DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of + * which store MIDI values in wMusicValue. With MusicToMIDI(), it is + * valid for all play modes. + * Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code. + */ +#define DMUS_S_DOWN_OCTAVE MAKE_DMHRESULTSUCCESS(0x214) + +/* DMUS_S_NOBUFFERCONTROL + * + * Although the audio output from the port will be routed to the + * same device as the given DirectSound buffer, buffer controls + * such as pan and volume will not affect the output. + * + */ +#define DMUS_S_NOBUFFERCONTROL MAKE_DMHRESULTSUCCESS(0x215) + +/* DMUS_S_GARBAGE_COLLECTED + * + * The requested operation was not performed because during CollectGarbage + * the loader determined that the object had been released. + */ +#define DMUS_S_GARBAGE_COLLECTED MAKE_DMHRESULTSUCCESS(0x216) + +/* DMUS_E_DRIVER_FAILED + * + * An unexpected error was returned from a device driver, indicating + * possible failure of the driver or hardware. + */ +#define DMUS_E_DRIVER_FAILED MAKE_DMHRESULTERROR(0x0101) + +/* DMUS_E_PORTS_OPEN + * + * The requested operation cannot be performed while there are + * instantiated ports in any process in the system. + */ +#define DMUS_E_PORTS_OPEN MAKE_DMHRESULTERROR(0x0102) + +/* DMUS_E_DEVICE_IN_USE + * + * The requested device is already in use (possibly by a non-DirectMusic + * client) and cannot be opened again. + */ +#define DMUS_E_DEVICE_IN_USE MAKE_DMHRESULTERROR(0x0103) + +/* DMUS_E_INSUFFICIENTBUFFER + * + * Buffer is not large enough for requested operation. + */ +#define DMUS_E_INSUFFICIENTBUFFER MAKE_DMHRESULTERROR(0x0104) + +/* DMUS_E_BUFFERNOTSET + * + * No buffer was prepared for the download data. + */ +#define DMUS_E_BUFFERNOTSET MAKE_DMHRESULTERROR(0x0105) + +/* DMUS_E_BUFFERNOTAVAILABLE + * + * Download failed due to inability to access or create download buffer. + */ +#define DMUS_E_BUFFERNOTAVAILABLE MAKE_DMHRESULTERROR(0x0106) + +/* DMUS_E_NOTADLSCOL + * + * Error parsing DLS collection. File is corrupt. + */ +#define DMUS_E_NOTADLSCOL MAKE_DMHRESULTERROR(0x0108) + +/* DMUS_E_INVALIDOFFSET + * + * Wave chunks in DLS collection file are at incorrect offsets. + */ +#define DMUS_E_INVALIDOFFSET MAKE_DMHRESULTERROR(0x0109) + +/* DMUS_E_ALREADY_LOADED + * + * Second attempt to load a DLS collection that is currently open. + */ +#define DMUS_E_ALREADY_LOADED MAKE_DMHRESULTERROR(0x0111) + +/* DMUS_E_INVALIDPOS + * + * Error reading wave data from DLS collection. Indicates bad file. + */ +#define DMUS_E_INVALIDPOS MAKE_DMHRESULTERROR(0x0113) + +/* DMUS_E_INVALIDPATCH + * + * There is no instrument in the collection that matches patch number. + */ +#define DMUS_E_INVALIDPATCH MAKE_DMHRESULTERROR(0x0114) + +/* DMUS_E_CANNOTSEEK + * + * The IStream* doesn't support Seek(). + */ +#define DMUS_E_CANNOTSEEK MAKE_DMHRESULTERROR(0x0115) + +/* DMUS_E_CANNOTWRITE + * + * The IStream* doesn't support Write(). + */ +#define DMUS_E_CANNOTWRITE MAKE_DMHRESULTERROR(0x0116) + +/* DMUS_E_CHUNKNOTFOUND + * + * The RIFF parser doesn't contain a required chunk while parsing file. + */ +#define DMUS_E_CHUNKNOTFOUND MAKE_DMHRESULTERROR(0x0117) + +/* DMUS_E_INVALID_DOWNLOADID + * + * Invalid download id was used in the process of creating a download buffer. + */ +#define DMUS_E_INVALID_DOWNLOADID MAKE_DMHRESULTERROR(0x0119) + +/* DMUS_E_NOT_DOWNLOADED_TO_PORT + * + * Tried to unload an object that was not downloaded or previously unloaded. + */ +#define DMUS_E_NOT_DOWNLOADED_TO_PORT MAKE_DMHRESULTERROR(0x0120) + +/* DMUS_E_ALREADY_DOWNLOADED + * + * Buffer was already downloaded to synth. + */ +#define DMUS_E_ALREADY_DOWNLOADED MAKE_DMHRESULTERROR(0x0121) + +/* DMUS_E_UNKNOWN_PROPERTY + * + * The specified property item was not recognized by the target object. + */ +#define DMUS_E_UNKNOWN_PROPERTY MAKE_DMHRESULTERROR(0x0122) + +/* DMUS_E_SET_UNSUPPORTED + * + * The specified property item may not be set on the target object. + */ +#define DMUS_E_SET_UNSUPPORTED MAKE_DMHRESULTERROR(0x0123) + +/* DMUS_E_GET_UNSUPPORTED + * + * The specified property item may not be retrieved from the target object. + */ +#define DMUS_E_GET_UNSUPPORTED MAKE_DMHRESULTERROR(0x0124) + +/* DMUS_E_NOTMONO + * + * Wave chunk has more than one interleaved channel. DLS format requires MONO. + */ +#define DMUS_E_NOTMONO MAKE_DMHRESULTERROR(0x0125) + +/* DMUS_E_BADARTICULATION + * + * Invalid articulation chunk in DLS collection. + */ +#define DMUS_E_BADARTICULATION MAKE_DMHRESULTERROR(0x0126) + +/* DMUS_E_BADINSTRUMENT + * + * Invalid instrument chunk in DLS collection. + */ +#define DMUS_E_BADINSTRUMENT MAKE_DMHRESULTERROR(0x0127) + +/* DMUS_E_BADWAVELINK + * + * Wavelink chunk in DLS collection points to invalid wave. + */ +#define DMUS_E_BADWAVELINK MAKE_DMHRESULTERROR(0x0128) + +/* DMUS_E_NOARTICULATION + * + * Articulation missing from instrument in DLS collection. + */ +#define DMUS_E_NOARTICULATION MAKE_DMHRESULTERROR(0x0129) + +/* DMUS_E_NOTPCM + * + * Downoaded DLS wave is not in PCM format. +*/ +#define DMUS_E_NOTPCM MAKE_DMHRESULTERROR(0x012A) + +/* DMUS_E_BADWAVE + * + * Bad wave chunk in DLS collection + */ +#define DMUS_E_BADWAVE MAKE_DMHRESULTERROR(0x012B) + +/* DMUS_E_BADOFFSETTABLE + * + * Offset Table for download buffer has errors. + */ +#define DMUS_E_BADOFFSETTABLE MAKE_DMHRESULTERROR(0x012C) + +/* DMUS_E_UNKNOWNDOWNLOAD + * + * Attempted to download unknown data type. + */ +#define DMUS_E_UNKNOWNDOWNLOAD MAKE_DMHRESULTERROR(0x012D) + +/* DMUS_E_NOSYNTHSINK + * + * The operation could not be completed because no sink was connected to + * the synthesizer. + */ +#define DMUS_E_NOSYNTHSINK MAKE_DMHRESULTERROR(0x012E) + +/* DMUS_E_ALREADYOPEN + * + * An attempt was made to open the software synthesizer while it was already + * open. + * ASSERT? + */ +#define DMUS_E_ALREADYOPEN MAKE_DMHRESULTERROR(0x012F) + +/* DMUS_E_ALREADYCLOSE + * + * An attempt was made to close the software synthesizer while it was already + * open. + * ASSERT? + */ +#define DMUS_E_ALREADYCLOSED MAKE_DMHRESULTERROR(0x0130) + +/* DMUS_E_SYNTHNOTCONFIGURED + * + * The operation could not be completed because the software synth has not + * yet been fully configured. + * ASSERT? + */ +#define DMUS_E_SYNTHNOTCONFIGURED MAKE_DMHRESULTERROR(0x0131) + +/* DMUS_E_SYNTHACTIVE + * + * The operation cannot be carried out while the synthesizer is active. + */ +#define DMUS_E_SYNTHACTIVE MAKE_DMHRESULTERROR(0x0132) + +/* DMUS_E_CANNOTREAD + * + * An error occurred while attempting to read from the IStream* object. + */ +#define DMUS_E_CANNOTREAD MAKE_DMHRESULTERROR(0x0133) + +/* DMUS_E_DMUSIC_RELEASED + * + * The operation cannot be performed because the final instance of the + * DirectMusic object was released. Ports cannot be used after final + * release of the DirectMusic object. + */ +#define DMUS_E_DMUSIC_RELEASED MAKE_DMHRESULTERROR(0x0134) + +/* DMUS_E_BUFFER_EMPTY + * + * There was no data in the referenced buffer. + */ +#define DMUS_E_BUFFER_EMPTY MAKE_DMHRESULTERROR(0x0135) + +/* DMUS_E_BUFFER_FULL + * + * There is insufficient space to insert the given event into the buffer. + */ +#define DMUS_E_BUFFER_FULL MAKE_DMHRESULTERROR(0x0136) + +/* DMUS_E_PORT_NOT_CAPTURE + * + * The given operation could not be carried out because the port is a + * capture port. + */ +#define DMUS_E_PORT_NOT_CAPTURE MAKE_DMHRESULTERROR(0x0137) + +/* DMUS_E_PORT_NOT_RENDER + * + * The given operation could not be carried out because the port is a + * render port. + */ +#define DMUS_E_PORT_NOT_RENDER MAKE_DMHRESULTERROR(0x0138) + +/* DMUS_E_DSOUND_NOT_SET + * + * The port could not be created because no DirectSound has been specified. + * Specify a DirectSound interface via the IDirectMusic::SetDirectSound + * method; pass NULL to have DirectMusic manage usage of DirectSound. + */ +#define DMUS_E_DSOUND_NOT_SET MAKE_DMHRESULTERROR(0x0139) + +/* DMUS_E_ALREADY_ACTIVATED + * + * The operation cannot be carried out while the port is active. + */ +#define DMUS_E_ALREADY_ACTIVATED MAKE_DMHRESULTERROR(0x013A) + +/* DMUS_E_INVALIDBUFFER + * + * Invalid DirectSound buffer was handed to port. + */ +#define DMUS_E_INVALIDBUFFER MAKE_DMHRESULTERROR(0x013B) + +/* DMUS_E_WAVEFORMATNOTSUPPORTED + * + * Invalid buffer format was handed to the synth sink. + */ +#define DMUS_E_WAVEFORMATNOTSUPPORTED MAKE_DMHRESULTERROR(0x013C) + +/* DMUS_E_SYNTHINACTIVE + * + * The operation cannot be carried out while the synthesizer is inactive. + */ +#define DMUS_E_SYNTHINACTIVE MAKE_DMHRESULTERROR(0x013D) + +/* DMUS_E_DSOUND_ALREADY_SET + * + * IDirectMusic::SetDirectSound has already been called. It may not be + * changed while in use. + */ +#define DMUS_E_DSOUND_ALREADY_SET MAKE_DMHRESULTERROR(0x013E) + +/* DMUS_E_INVALID_EVENT + * + * The given event is invalid (either it is not a valid MIDI message + * or it makes use of running status). The event cannot be packed + * into the buffer. + */ +#define DMUS_E_INVALID_EVENT MAKE_DMHRESULTERROR(0x013F) + +/* DMUS_E_UNSUPPORTED_STREAM + * + * The IStream* object does not contain data supported by the loading object. + */ +#define DMUS_E_UNSUPPORTED_STREAM MAKE_DMHRESULTERROR(0x0150) + +/* DMUS_E_ALREADY_INITED + * + * The object has already been initialized. + */ +#define DMUS_E_ALREADY_INITED MAKE_DMHRESULTERROR(0x0151) + +/* DMUS_E_INVALID_BAND + * + * The file does not contain a valid band. + */ +#define DMUS_E_INVALID_BAND MAKE_DMHRESULTERROR(0x0152) + +/* DMUS_E_TRACK_HDR_NOT_FIRST_CK + * + * The IStream* object's data does not have a track header as the first chunk, + * and therefore can not be read by the segment object. + */ +#define DMUS_E_TRACK_HDR_NOT_FIRST_CK MAKE_DMHRESULTERROR(0x0155) + +/* DMUS_E_TOOL_HDR_NOT_FIRST_CK + * + * The IStream* object's data does not have a tool header as the first chunk, + * and therefore can not be read by the graph object. + */ +#define DMUS_E_TOOL_HDR_NOT_FIRST_CK MAKE_DMHRESULTERROR(0x0156) + +/* DMUS_E_INVALID_TRACK_HDR + * + * The IStream* object's data contains an invalid track header (ckid is 0 and + * fccType is NULL,) and therefore can not be read by the segment object. + */ +#define DMUS_E_INVALID_TRACK_HDR MAKE_DMHRESULTERROR(0x0157) + +/* DMUS_E_INVALID_TOOL_HDR + * + * The IStream* object's data contains an invalid tool header (ckid is 0 and + * fccType is NULL,) and therefore can not be read by the graph object. + */ +#define DMUS_E_INVALID_TOOL_HDR MAKE_DMHRESULTERROR(0x0158) + +/* DMUS_E_ALL_TOOLS_FAILED + * + * The graph object was unable to load all tools from the IStream* object data. + * This may be due to errors in the stream, or the tools being incorrectly + * registered on the client. + */ +#define DMUS_E_ALL_TOOLS_FAILED MAKE_DMHRESULTERROR(0x0159) + +/* DMUS_E_ALL_TRACKS_FAILED + * + * The segment object was unable to load all tracks from the IStream* object data. + * This may be due to errors in the stream, or the tracks being incorrectly + * registered on the client. + */ +#define DMUS_E_ALL_TRACKS_FAILED MAKE_DMHRESULTERROR(0x0160) + +/* DMUS_E_NOT_FOUND + * + * The requested item was not contained by the object. + */ +#define DMUS_E_NOT_FOUND MAKE_DMHRESULTERROR(0x0161) + +/* DMUS_E_NOT_INIT + * + * A required object is not initialized or failed to initialize. + */ +#define DMUS_E_NOT_INIT MAKE_DMHRESULTERROR(0x0162) + +/* DMUS_E_TYPE_DISABLED + * + * The requested parameter type is currently disabled. Parameter types may + * be enabled and disabled by certain calls to SetParam(). + */ +#define DMUS_E_TYPE_DISABLED MAKE_DMHRESULTERROR(0x0163) + +/* DMUS_E_TYPE_UNSUPPORTED + * + * The requested parameter type is not supported on the object. + */ +#define DMUS_E_TYPE_UNSUPPORTED MAKE_DMHRESULTERROR(0x0164) + +/* DMUS_E_TIME_PAST + * + * The time is in the past, and the operation can not succeed. + */ +#define DMUS_E_TIME_PAST MAKE_DMHRESULTERROR(0x0165) + +/* DMUS_E_TRACK_NOT_FOUND + * + * The requested track is not contained by the segment. + */ +#define DMUS_E_TRACK_NOT_FOUND MAKE_DMHRESULTERROR(0x0166) + +/* DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT + * + * The track does not support clock time playback or getparam. + */ +#define DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT MAKE_DMHRESULTERROR(0x0167) + +/* DMUS_E_NO_MASTER_CLOCK + * + * There is no master clock in the performance. Be sure to call + * IDirectMusicPerformance::Init(). + */ +#define DMUS_E_NO_MASTER_CLOCK MAKE_DMHRESULTERROR(0x0170) + +/* DMUS_E_LOADER_NOCLASSID + * + * The class id field is required and missing in the DMUS_OBJECTDESC. + */ +#define DMUS_E_LOADER_NOCLASSID MAKE_DMHRESULTERROR(0x0180) + +/* DMUS_E_LOADER_BADPATH + * + * The requested file path is invalid. + */ +#define DMUS_E_LOADER_BADPATH MAKE_DMHRESULTERROR(0x0181) + +/* DMUS_E_LOADER_FAILEDOPEN + * + * File open failed - either file doesn't exist or is locked. + */ +#define DMUS_E_LOADER_FAILEDOPEN MAKE_DMHRESULTERROR(0x0182) + +/* DMUS_E_LOADER_FORMATNOTSUPPORTED + * + * Search data type is not supported. + */ +#define DMUS_E_LOADER_FORMATNOTSUPPORTED MAKE_DMHRESULTERROR(0x0183) + +/* DMUS_E_LOADER_FAILEDCREATE + * + * Unable to find or create object. + */ +#define DMUS_E_LOADER_FAILEDCREATE MAKE_DMHRESULTERROR(0x0184) + +/* DMUS_E_LOADER_OBJECTNOTFOUND + * + * Object was not found. + */ +#define DMUS_E_LOADER_OBJECTNOTFOUND MAKE_DMHRESULTERROR(0x0185) + +/* DMUS_E_LOADER_NOFILENAME + * + * The file name is missing from the DMUS_OBJECTDESC. + */ +#define DMUS_E_LOADER_NOFILENAME MAKE_DMHRESULTERROR(0x0186) + +/* DMUS_E_INVALIDFILE + * + * The file requested is not a valid file. + */ +#define DMUS_E_INVALIDFILE MAKE_DMHRESULTERROR(0x0200) + +/* DMUS_E_ALREADY_EXISTS + * + * The tool is already contained in the graph. Create a new instance. + */ +#define DMUS_E_ALREADY_EXISTS MAKE_DMHRESULTERROR(0x0201) + +/* DMUS_E_OUT_OF_RANGE + * + * Value is out of range, for instance the requested length is longer than + * the segment. + */ +#define DMUS_E_OUT_OF_RANGE MAKE_DMHRESULTERROR(0x0202) + +/* DMUS_E_SEGMENT_INIT_FAILED + * + * Segment initialization failed, most likely due to a critical memory situation. + */ +#define DMUS_E_SEGMENT_INIT_FAILED MAKE_DMHRESULTERROR(0x0203) + +/* DMUS_E_ALREADY_SENT + * + * The DMUS_PMSG has already been sent to the performance object via + * IDirectMusicPerformance::SendPMsg(). + */ +#define DMUS_E_ALREADY_SENT MAKE_DMHRESULTERROR(0x0204) + +/* DMUS_E_CANNOT_FREE + * + * The DMUS_PMSG was either not allocated by the performance via + * IDirectMusicPerformance::AllocPMsg(), or it was already freed via + * IDirectMusicPerformance::FreePMsg(). + */ +#define DMUS_E_CANNOT_FREE MAKE_DMHRESULTERROR(0x0205) + +/* DMUS_E_CANNOT_OPEN_PORT + * + * The default system port could not be opened. + */ +#define DMUS_E_CANNOT_OPEN_PORT MAKE_DMHRESULTERROR(0x0206) + +/* DMUS_E_CANNOT_CONVERT + * + * A call to MIDIToMusic() or MusicToMIDI() resulted in an error because + * the requested conversion could not happen. This usually occurs when the + * provided DMUS_CHORD_KEY structure has an invalid chord or scale pattern. + */ +#define DMUS_E_CANNOT_CONVERT MAKE_DMHRESULTERROR(0x0207) +/* misspelling in previous versions of DirectX preserved for backward compatibility */ +#define DMUS_E_CONNOT_CONVERT DMUS_E_CANNOT_CONVERT + +/* DMUS_E_DESCEND_CHUNK_FAIL + * + * DMUS_E_DESCEND_CHUNK_FAIL is returned when the end of the file + * was reached before the desired chunk was found. + */ +#define DMUS_E_DESCEND_CHUNK_FAIL MAKE_DMHRESULTERROR(0x0210) + +/* DMUS_E_NOT_LOADED + * + * An attempt to use this object failed because it first needs to + * be loaded. + */ +#define DMUS_E_NOT_LOADED MAKE_DMHRESULTERROR(0x0211) + +/* DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE + * + * The activeX scripting engine for the script's language is not compatible with + * DirectMusic. + * + */ +#define DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE MAKE_DMHRESULTERROR(0x0213) + +/* DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE + * + * A varient was used that had a type that is not supported by DirectMusic. + * + */ +#define DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE MAKE_DMHRESULTERROR(0x0214) + +/* DMUS_E_SCRIPT_ERROR_IN_SCRIPT + * + * An error was encountered while parsing or executing the script. + * The pErrorInfo parameter (if supplied) was filled with information about the error. + */ +#define DMUS_E_SCRIPT_ERROR_IN_SCRIPT MAKE_DMHRESULTERROR(0x0215) + +/* DMUS_E_SCRIPT_CANTLOAD_OLEAUT32 + * + * Loading of oleaut32.dll failed. VBScript and other activeX scripting languages + * require use of oleaut32.dll. On platforms where oleaut32.dll is not present, only + * the DirectMusicScript language, which doesn't require oleaut32.dll can be used. + */ +#define DMUS_E_SCRIPT_CANTLOAD_OLEAUT32 MAKE_DMHRESULTERROR(0x0216) + +/* DMUS_E_SCRIPT_LOADSCRIPT_ERROR + * + * An error occured while parsing a script loaded using LoadScript. The script that + * was loaded contains an error. + */ +#define DMUS_E_SCRIPT_LOADSCRIPT_ERROR MAKE_DMHRESULTERROR(0x0217) + +/* DMUS_E_SCRIPT_INVALID_FILE + * + * The script file is invalid. + */ +#define DMUS_E_SCRIPT_INVALID_FILE MAKE_DMHRESULTERROR(0x0218) + +/* DMUS_E_INVALID_SCRIPTTRACK + * + * The file contains an invalid script track. + */ +#define DMUS_E_INVALID_SCRIPTTRACK MAKE_DMHRESULTERROR(0x0219) + +/* DMUS_E_SCRIPT_VARIABLE_NOT_FOUND + * + * The script does not contain a variable with the specified name. + */ +#define DMUS_E_SCRIPT_VARIABLE_NOT_FOUND MAKE_DMHRESULTERROR(0x021A) + +/* DMUS_E_SCRIPT_ROUTINE_NOT_FOUND + * + * The script does not contain a routine with the specified name. + */ +#define DMUS_E_SCRIPT_ROUTINE_NOT_FOUND MAKE_DMHRESULTERROR(0x021B) + +/* DMUS_E_SCRIPT_CONTENT_READONLY + * + * Scripts variables for content referenced or embedded in a script cannot be set. + */ +#define DMUS_E_SCRIPT_CONTENT_READONLY MAKE_DMHRESULTERROR(0x021C) + +/* DMUS_E_SCRIPT_NOT_A_REFERENCE + * + * Attempt was made to set a script's variable by reference to a value that was + * not an object type. + */ +#define DMUS_E_SCRIPT_NOT_A_REFERENCE MAKE_DMHRESULTERROR(0x021D) + +/* DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED + * + * Attempt was made to set a script's variable by value to an object that does + * not support a default value property. + */ +#define DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED MAKE_DMHRESULTERROR(0x021E) + +/* DMUS_E_INVALID_SEGMENTTRIGGERTRACK + * + * The file contains an invalid segment trigger track. + */ +#define DMUS_E_INVALID_SEGMENTTRIGGERTRACK MAKE_DMHRESULTERROR(0x0220) + +/* DMUS_E_INVALID_LYRICSTRACK + * + * The file contains an invalid lyrics track. + */ +#define DMUS_E_INVALID_LYRICSTRACK MAKE_DMHRESULTERROR(0x0221) + +/* DMUS_E_INVALID_PARAMCONTROLTRACK + * + * The file contains an invalid parameter control track. + */ +#define DMUS_E_INVALID_PARAMCONTROLTRACK MAKE_DMHRESULTERROR(0x0222) + +/* DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR + * + * A script written in AudioVBScript could not be read because it contained a statement that + * is not allowed by the AudioVBScript language. + */ +#define DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR MAKE_DMHRESULTERROR(0x0223) + +/* DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR + * + * A script routine written in AudioVBScript failed because an invalid operation occurred. For example, + * adding the number 3 to a segment object would produce this error. So would attempting to call a routine + * that doesn't exist. + */ +#define DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR MAKE_DMHRESULTERROR(0x0224) + +/* DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE + * + * A script routine written in AudioVBScript failed because a function outside of a script failed to complete. + * For example, a call to PlaySegment that fails to play because of low memory would return this error. + */ +#define DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE MAKE_DMHRESULTERROR(0x0225) + +/* DMUS_E_AUDIOPATHS_NOT_VALID + * + * The Performance has set up some PChannels using the AssignPChannel command, which + * makes it not capable of supporting audio paths. + */ +#define DMUS_E_AUDIOPATHS_NOT_VALID MAKE_DMHRESULTERROR(0x0226) + +/* DMUS_E_AUDIOPATHS_IN_USE + * + * This is the inverse of the previous error. + * The Performance has set up some audio paths, which makes is incompatible + * with the calls to allocate pchannels, etc. + */ +#define DMUS_E_AUDIOPATHS_IN_USE MAKE_DMHRESULTERROR(0x0227) + +/* DMUS_E_NO_AUDIOPATH_CONFIG + * + * A segment was asked for its embedded audio path configuration, + * but there isn't any. + */ +#define DMUS_E_NO_AUDIOPATH_CONFIG MAKE_DMHRESULTERROR(0x0228) + +/* DMUS_E_AUDIOPATH_INACTIVE + * + * An audiopath is inactive, perhaps because closedown was called. + */ +#define DMUS_E_AUDIOPATH_INACTIVE MAKE_DMHRESULTERROR(0x0229) + +/* DMUS_E_AUDIOPATH_NOBUFFER + * + * An audiopath failed to create because a requested buffer could not be created. + */ +#define DMUS_E_AUDIOPATH_NOBUFFER MAKE_DMHRESULTERROR(0x022A) + +/* DMUS_E_AUDIOPATH_NOPORT + * + * An audiopath could not be used for playback because it lacked port assignments. + */ +#define DMUS_E_AUDIOPATH_NOPORT MAKE_DMHRESULTERROR(0x022B) + +/* DMUS_E_NO_AUDIOPATH + * + * Attempt was made to play segment in audiopath mode and there was no audiopath. + */ +#define DMUS_E_NO_AUDIOPATH MAKE_DMHRESULTERROR(0x022C) + +/* DMUS_E_INVALIDCHUNK + * + * Invalid data was found in a RIFF file chunk. + */ +#define DMUS_E_INVALIDCHUNK MAKE_DMHRESULTERROR(0x022D) + +/* DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER + * + * Attempt was made to create an audiopath that sends to a global effects buffer which did not exist. + */ +#define DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER MAKE_DMHRESULTERROR(0x022E) + +/* DMUS_E_INVALID_CONTAINER_OBJECT + * + * The file does not contain a valid container object. + */ +#define DMUS_E_INVALID_CONTAINER_OBJECT MAKE_DMHRESULTERROR(0x022F) + +#endif diff --git a/Src/Decoder_H264_ALL/D3D/include/dmksctrl.h b/Src/Decoder_H264_ALL/D3D/include/dmksctrl.h new file mode 100644 index 0000000..f53e714 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dmksctrl.h @@ -0,0 +1,166 @@ +/************************************************************************ +* * +* dmksctrl.h -- Definition of IKsControl * +* * +* Copyright (c) Microsoft Corporation. All rights reserved. * +* * +* This header file contains the definition of IKsControl, which * +* duplicates definitions from ks.h and ksproxy.h. Your code should * +* include ks.h and ksproxy.h directly if you have them (they are * +* provided in the Windows 98 DDK and will be in the Windows NT 5 * +* SDK). * +* * +************************************************************************/ + +#ifndef _DMKSCTRL_ +#define _DMKSCTRL_ + +#if _MSC_VER >= 1200 +#pragma warning(push) +#endif +#pragma warning(disable:4201) /* Disable warnings on anonymous unions */ + +#include + +#include + +#if !defined(_NTRTL_) + #ifndef DEFINE_GUIDEX + #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name + #endif /* !defined(DEFINE_GUIDEX) */ + + #ifndef STATICGUIDOF + #define STATICGUIDOF(guid) STATIC_##guid + #endif /* !defined(STATICGUIDOF) */ +#endif /* !defined(_NTRTL_) */ + +#ifndef STATIC_IID_IKsControl +#define STATIC_IID_IKsControl\ + 0x28F54685L, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 +#endif /* STATIC_IID_IKsControl */ + +/* + * Warning: This will prevent the rest of ks.h from being pulled in if ks.h is + * included after dmksctrl.h. Make sure you do not include both headers in + * the same source file. + */ +#ifndef _KS_ +#define _KS_ + +#if (defined(_MSC_EXTENSIONS) || defined(__cplusplus)) && !defined(CINTERFACE) +typedef struct { + union { + struct { + GUID Set; + ULONG Id; + ULONG Flags; + }; + LONGLONG Alignment; + }; +} KSIDENTIFIER, *PKSIDENTIFIER; +#else +typedef struct { + union { + struct { + GUID Set; + ULONG Id; + ULONG Flags; + } Data; + LONGLONG Alignment; + }; +} KSIDENTIFIER, *PKSIDENTIFIER; +#endif + +typedef KSIDENTIFIER KSPROPERTY, *PKSPROPERTY, KSMETHOD, *PKSMETHOD, KSEVENT, *PKSEVENT; + +#define KSMETHOD_TYPE_NONE 0x00000000 +#define KSMETHOD_TYPE_READ 0x00000001 +#define KSMETHOD_TYPE_WRITE 0x00000002 +#define KSMETHOD_TYPE_MODIFY 0x00000003 +#define KSMETHOD_TYPE_SOURCE 0x00000004 + +#define KSMETHOD_TYPE_SEND 0x00000001 +#define KSMETHOD_TYPE_SETSUPPORT 0x00000100 +#define KSMETHOD_TYPE_BASICSUPPORT 0x00000200 + +#define KSPROPERTY_TYPE_GET 0x00000001 +#define KSPROPERTY_TYPE_SET 0x00000002 +#define KSPROPERTY_TYPE_SETSUPPORT 0x00000100 +#define KSPROPERTY_TYPE_BASICSUPPORT 0x00000200 +#define KSPROPERTY_TYPE_RELATIONS 0x00000400 +#define KSPROPERTY_TYPE_SERIALIZESET 0x00000800 +#define KSPROPERTY_TYPE_UNSERIALIZESET 0x00001000 +#define KSPROPERTY_TYPE_SERIALIZERAW 0x00002000 +#define KSPROPERTY_TYPE_UNSERIALIZERAW 0x00004000 +#define KSPROPERTY_TYPE_SERIALIZESIZE 0x00008000 +#define KSPROPERTY_TYPE_DEFAULTVALUES 0x00010000 + +#define KSPROPERTY_TYPE_TOPOLOGY 0x10000000 +#endif /* _KS_ */ + +#ifndef _IKsControl_ +#define _IKsControl_ + +#ifdef DECLARE_INTERFACE_ + + +#undef INTERFACE +#define INTERFACE IKsControl +DECLARE_INTERFACE_(IKsControl, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /*IKsControl*/ + STDMETHOD(KsProperty)( + THIS_ + IN PKSPROPERTY Property, + IN ULONG PropertyLength, + IN OUT LPVOID PropertyData, + IN ULONG DataLength, + OUT ULONG* BytesReturned + ) PURE; + STDMETHOD(KsMethod)( + THIS_ + IN PKSMETHOD Method, + IN ULONG MethodLength, + IN OUT LPVOID MethodData, + IN ULONG DataLength, + OUT ULONG* BytesReturned + ) PURE; + STDMETHOD(KsEvent)( + THIS_ + IN PKSEVENT Event OPTIONAL, + IN ULONG EventLength, + IN OUT LPVOID EventData, + IN ULONG DataLength, + OUT ULONG* BytesReturned + ) PURE; +}; + +#endif /* DECLARE_INTERFACE_ */ +#endif /* _IKsControl_ */ + +#include + +DEFINE_GUID(IID_IKsControl, 0x28F54685, 0x06FD, 0x11D2, 0xB2, 0x7A, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96); + +/* These formats are in ksmedia.h + */ +#ifndef _KSMEDIA_ + +DEFINE_GUID(KSDATAFORMAT_SUBTYPE_MIDI, 0x1D262760L, 0xE957, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00); +DEFINE_GUID(KSDATAFORMAT_SUBTYPE_DIRECTMUSIC, 0x1a82f8bc, 0x3f8b, 0x11d2, 0xb7, 0x74, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1); + +#endif + +#if _MSC_VER >= 1200 +#pragma warning(pop) +#endif + +#endif /* _DMKSCTRL */ + + + diff --git a/Src/Decoder_H264_ALL/D3D/include/dmplugin.h b/Src/Decoder_H264_ALL/D3D/include/dmplugin.h new file mode 100644 index 0000000..3f3e141 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dmplugin.h @@ -0,0 +1,280 @@ +/************************************************************************ +* * +* dmplugin.h -- This module contains the API for plugins for the * +* DirectMusic performance layer * +* * +* Copyright (c) Microsoft Corporation. All rights reserved. * +* * +************************************************************************/ + +#ifndef _DMPLUGIN_ +#define _DMPLUGIN_ + +#include + +#define COM_NO_WINDOWS_H +#include + +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +interface IDirectMusicTrack; +interface IDirectMusicTool; +interface IDirectMusicTool8; +interface IDirectMusicTrack8; +interface IDirectMusicPerformance; +interface IDirectMusicPerformance8; +interface IDirectMusicSegment; +interface IDirectMusicSegment8; +interface IDirectMusicSegmentState; +interface IDirectMusicSegmentState8; +interface IDirectMusicGraph; +#ifndef __cplusplus +typedef interface IDirectMusicTrack IDirectMusicTrack; +typedef interface IDirectMusicTool IDirectMusicTool; +typedef interface IDirectMusicTool8 IDirectMusicTool8; +typedef interface IDirectMusicTrack8 IDirectMusicTrack8; +typedef interface IDirectMusicPerformance IDirectMusicPerformance; +typedef interface IDirectMusicPerformance8 IDirectMusicPerformance8; +typedef interface IDirectMusicSegment IDirectMusicSegment; +typedef interface IDirectMusicSegment8 IDirectMusicSegment8; +typedef interface IDirectMusicSegmentState IDirectMusicSegmentState; +typedef interface IDirectMusicSegmentState8 IDirectMusicSegmentState8; +typedef interface IDirectMusicGraph IDirectMusicGraph; +#endif + +typedef struct _DMUS_PMSG DMUS_PMSG; +typedef long MUSIC_TIME; + +/* Registry location for tools */ +#define DMUS_REGSTR_PATH_TOOLS "Software\\Microsoft\\DirectMusic\\Tools" + +/*//////////////////////////////////////////////////////////////////// +// IDirectMusicTool */ +#undef INTERFACE +#define INTERFACE IDirectMusicTool +DECLARE_INTERFACE_(IDirectMusicTool, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicTool */ + STDMETHOD(Init) (THIS_ IDirectMusicGraph* pGraph) PURE; + STDMETHOD(GetMsgDeliveryType) (THIS_ DWORD* pdwDeliveryType ) PURE; + STDMETHOD(GetMediaTypeArraySize)(THIS_ DWORD* pdwNumElements ) PURE; + STDMETHOD(GetMediaTypes) (THIS_ DWORD** padwMediaTypes, + DWORD dwNumElements) PURE; + STDMETHOD(ProcessPMsg) (THIS_ IDirectMusicPerformance* pPerf, + DMUS_PMSG* pPMSG) PURE; + STDMETHOD(Flush) (THIS_ IDirectMusicPerformance* pPerf, + DMUS_PMSG* pPMSG, + REFERENCE_TIME rtTime) PURE; +}; + +/*//////////////////////////////////////////////////////////////////// +// IDirectMusicTool8 */ +#undef INTERFACE +#define INTERFACE IDirectMusicTool8 +DECLARE_INTERFACE_(IDirectMusicTool8, IDirectMusicTool) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicTool */ + STDMETHOD(Init) (THIS_ IDirectMusicGraph* pGraph) PURE; + STDMETHOD(GetMsgDeliveryType) (THIS_ DWORD* pdwDeliveryType ) PURE; + STDMETHOD(GetMediaTypeArraySize)(THIS_ DWORD* pdwNumElements ) PURE; + STDMETHOD(GetMediaTypes) (THIS_ DWORD** padwMediaTypes, + DWORD dwNumElements) PURE; + STDMETHOD(ProcessPMsg) (THIS_ IDirectMusicPerformance* pPerf, + DMUS_PMSG* pPMSG) PURE; + STDMETHOD(Flush) (THIS_ IDirectMusicPerformance* pPerf, + DMUS_PMSG* pPMSG, + REFERENCE_TIME rtTime) PURE; + /* IDirectMusicTool8 */ + STDMETHOD(Clone) (THIS_ IDirectMusicTool ** ppTool) PURE; +}; + + +/* The following flags are sent in the IDirectMusicTrack::Play() method */ +/* inside the dwFlags parameter */ +typedef enum enumDMUS_TRACKF_FLAGS +{ + DMUS_TRACKF_SEEK = 1, /* set on a seek */ + DMUS_TRACKF_LOOP = 2, /* set on a loop (repeat) */ + DMUS_TRACKF_START = 4, /* set on first call to Play */ + DMUS_TRACKF_FLUSH = 8, /* set when this call is in response to a flush on the perfomance */ + DMUS_TRACKF_DIRTY = 0x10, /* set when the track should consider any cached values from a previous call to GetParam to be invalidated */ + /* The following flags are DX8 only. */ + DMUS_TRACKF_NOTIFY_OFF = 0x20, /* tells track not to send notifications. */ + DMUS_TRACKF_PLAY_OFF = 0x40, /* tells track not to play anything (but can still send notifications.) */ + DMUS_TRACKF_LOOPEND = 0x80, /* set when the end of range is also a loop end. */ + DMUS_TRACKF_STOP = 0x100, /* set when the end of range is also end of playing this segment. */ + DMUS_TRACKF_RECOMPOSE = 0x200, /* set to indicate the track should compose. */ + DMUS_TRACKF_CLOCK = 0x400, /* set when time parameters are in reference (clock) time. Only valid for PlayEx(). */ +} DMUS_TRACKF_FLAGS; + +/* The following flags are sent in the IDirectMusicTrack8::GetParamEx() and SetParamEx() methods */ +/* inside the dwFlags parameter */ +#define DMUS_TRACK_PARAMF_CLOCK 0x01 /* set when the time is measured is in reference (clock) time */ + +/*//////////////////////////////////////////////////////////////////// +// IDirectMusicTrack */ +#undef INTERFACE +#define INTERFACE IDirectMusicTrack +DECLARE_INTERFACE_(IDirectMusicTrack, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicTrack */ + STDMETHOD(Init) (THIS_ IDirectMusicSegment* pSegment) PURE; + STDMETHOD(InitPlay) (THIS_ IDirectMusicSegmentState* pSegmentState, + IDirectMusicPerformance* pPerformance, + void** ppStateData, + DWORD dwVirtualTrackID, + DWORD dwFlags) PURE; + STDMETHOD(EndPlay) (THIS_ void* pStateData) PURE; + STDMETHOD(Play) (THIS_ void* pStateData, + MUSIC_TIME mtStart, + MUSIC_TIME mtEnd, + MUSIC_TIME mtOffset, + DWORD dwFlags, + IDirectMusicPerformance* pPerf, + IDirectMusicSegmentState* pSegSt, + DWORD dwVirtualID) PURE; + STDMETHOD(GetParam) (THIS_ REFGUID rguidType, + MUSIC_TIME mtTime, + MUSIC_TIME* pmtNext, + void* pParam) PURE; + STDMETHOD(SetParam) (THIS_ REFGUID rguidType, + MUSIC_TIME mtTime, + void* pParam) PURE; + STDMETHOD(IsParamSupported) (THIS_ REFGUID rguidType) PURE; + STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; + STDMETHOD(RemoveNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; + STDMETHOD(Clone) (THIS_ MUSIC_TIME mtStart, + MUSIC_TIME mtEnd, + IDirectMusicTrack** ppTrack) PURE; +}; + +/*//////////////////////////////////////////////////////////////////// +// IDirectMusicTrack8 */ +#undef INTERFACE +#define INTERFACE IDirectMusicTrack8 +DECLARE_INTERFACE_(IDirectMusicTrack8, IDirectMusicTrack) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicTrack */ + STDMETHOD(Init) (THIS_ IDirectMusicSegment* pSegment) PURE; + STDMETHOD(InitPlay) (THIS_ IDirectMusicSegmentState* pSegmentState, + IDirectMusicPerformance* pPerformance, + void** ppStateData, + DWORD dwVirtualTrackID, + DWORD dwFlags) PURE; + STDMETHOD(EndPlay) (THIS_ void* pStateData) PURE; + STDMETHOD(Play) (THIS_ void* pStateData, + MUSIC_TIME mtStart, + MUSIC_TIME mtEnd, + MUSIC_TIME mtOffset, + DWORD dwFlags, + IDirectMusicPerformance* pPerf, + IDirectMusicSegmentState* pSegSt, + DWORD dwVirtualID) PURE; + STDMETHOD(GetParam) (THIS_ REFGUID rguidType, + MUSIC_TIME mtTime, + MUSIC_TIME* pmtNext, + void* pParam) PURE; + STDMETHOD(SetParam) (THIS_ REFGUID rguidType, + MUSIC_TIME mtTime, + void* pParam) PURE; + STDMETHOD(IsParamSupported) (THIS_ REFGUID rguidType) PURE; + STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; + STDMETHOD(RemoveNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; + STDMETHOD(Clone) (THIS_ MUSIC_TIME mtStart, + MUSIC_TIME mtEnd, + IDirectMusicTrack** ppTrack) PURE; + /* IDirectMusicTrack8 */ + STDMETHOD(PlayEx) (THIS_ void* pStateData, + REFERENCE_TIME rtStart, + REFERENCE_TIME rtEnd, + REFERENCE_TIME rtOffset, + DWORD dwFlags, + IDirectMusicPerformance* pPerf, + IDirectMusicSegmentState* pSegSt, + DWORD dwVirtualID) PURE; + STDMETHOD(GetParamEx) (THIS_ REFGUID rguidType, /* Command type. */ + REFERENCE_TIME rtTime, /* Time, in ref time if dwFlags == DMUS_TRACK_PARAMF_CLOCK. Otherwise, music time. */ + REFERENCE_TIME* prtNext, /* Time of next parameter, relative to rtTime, in music or clock time units. */ + void* pParam, /* Pointer to the parameter data. */ + void * pStateData, /* State data for track instance. */ + DWORD dwFlags) PURE; /* Control flags. */ + STDMETHOD(SetParamEx) (THIS_ REFGUID rguidType, + REFERENCE_TIME rtTime, + void* pParam, /* Pointer to the parameter data. */ + void * pStateData, /* State data for track instance. */ + DWORD dwFlags) PURE; /* Control flags. */ + STDMETHOD(Compose) (THIS_ IUnknown* pContext, /* Context for composition */ + DWORD dwTrackGroup, + IDirectMusicTrack** ppResultTrack) PURE; + STDMETHOD(Join) (THIS_ IDirectMusicTrack* pNewTrack, + MUSIC_TIME mtJoin, + IUnknown* pContext, /* Context for joining */ + DWORD dwTrackGroup, + IDirectMusicTrack** ppResultTrack) PURE; +}; + +/* CLSID's */ +DEFINE_GUID(CLSID_DirectMusicTempoTrack,0xd2ac2885, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicSeqTrack,0xd2ac2886, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicSysExTrack,0xd2ac2887, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicTimeSigTrack,0xd2ac2888, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicChordTrack,0xd2ac288b, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicCommandTrack,0xd2ac288c, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicStyleTrack,0xd2ac288d, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicMotifTrack,0xd2ac288e, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicSignPostTrack,0xf17e8672, 0xc3b4, 0x11d1, 0x87, 0xb, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicBandTrack,0xd2ac2894, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicChordMapTrack,0xd2ac2896, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicMuteTrack,0xd2ac2898, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* New CLSID's for DX8 */ +DEFINE_GUID(CLSID_DirectMusicScriptTrack,0x4108fa85, 0x3586, 0x11d3, 0x8b, 0xd7, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {4108FA85-3586-11d3-8BD7-00600893B1B6} */ +DEFINE_GUID(CLSID_DirectMusicMarkerTrack,0x55a8fd00, 0x4288, 0x11d3, 0x9b, 0xd1, 0x8a, 0xd, 0x61, 0xc8, 0x88, 0x35); +DEFINE_GUID(CLSID_DirectMusicSegmentTriggerTrack, 0xbae4d665, 0x4ea1, 0x11d3, 0x8b, 0xda, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {BAE4D665-4EA1-11d3-8BDA-00600893B1B6} */ +DEFINE_GUID(CLSID_DirectMusicLyricsTrack, 0x995c1cf5, 0x54ff, 0x11d3, 0x8b, 0xda, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {995C1CF5-54FF-11d3-8BDA-00600893B1B6} */ +DEFINE_GUID(CLSID_DirectMusicParamControlTrack, 0x4be0537b, 0x5c19, 0x11d3, 0x8b, 0xdc, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {4BE0537B-5C19-11d3-8BDC-00600893B1B6} */ +DEFINE_GUID(CLSID_DirectMusicWaveTrack,0xeed36461, 0x9ea5, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74); + +/* IID's */ +DEFINE_GUID(IID_IDirectMusicTrack, 0xf96029a1, 0x4282, 0x11d2, 0x87, 0x17, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(IID_IDirectMusicTool,0xd2ac28ba, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Interface IDs for DX8 */ +/* changed interfaces (GUID only) */ +DEFINE_GUID(IID_IDirectMusicTool8, 0xe674303, 0x3b05, 0x11d3, 0x9b, 0xd1, 0xf9, 0xe7, 0xf0, 0xa0, 0x15, 0x36); +DEFINE_GUID(IID_IDirectMusicTrack8, 0xe674304, 0x3b05, 0x11d3, 0x9b, 0xd1, 0xf9, 0xe7, 0xf0, 0xa0, 0x15, 0x36); + +#ifdef __cplusplus +}; /* extern "C" */ +#endif + +#include + +#endif /* #ifndef _DMPLUGIN_ */ diff --git a/Src/Decoder_H264_ALL/D3D/include/dmusbuff.h b/Src/Decoder_H264_ALL/D3D/include/dmusbuff.h new file mode 100644 index 0000000..5488453 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dmusbuff.h @@ -0,0 +1,41 @@ +/*************************************************************************** +* * +* DMusBuff.h -- This module defines the buffer format for DirectMusic * +* Shared file between user mode and kernel mode components * +* * +* Copyright (c) 1998, Microsoft Corp. All rights reserved. * +* * +***************************************************************************/ + +#ifndef _DMusBuff_ +#define _DMusBuff_ + +/* Format of DirectMusic events in a buffer + * + * A buffer contains 1 or more events, each with the following header. + * Immediately following the header is the event data. The header+data + * size is rounded to the nearest quadword (8 bytes). + */ + +#include /* Do not pad at end - that's where the data is */ +typedef struct _DMUS_EVENTHEADER *LPDMUS_EVENTHEADER; +typedef struct _DMUS_EVENTHEADER +{ + DWORD cbEvent; /* Unrounded bytes in event */ + DWORD dwChannelGroup; /* Channel group of event */ + REFERENCE_TIME rtDelta; /* Delta from start time of entire buffer */ + DWORD dwFlags; /* Flags DMUS_EVENT_xxx */ +} DMUS_EVENTHEADER; +#include + +#define DMUS_EVENT_STRUCTURED 0x00000001 /* Unstructured data (SysEx, etc.) */ + +/* The number of bytes to allocate for an event with 'cb' data bytes. + */ +#define QWORD_ALIGN(x) (((x) + 7) & ~7) +#define DMUS_EVENT_SIZE(cb) QWORD_ALIGN(sizeof(DMUS_EVENTHEADER) + cb) + + +#endif /* _DMusBuff_ */ + + diff --git a/Src/Decoder_H264_ALL/D3D/include/dmusicc.h b/Src/Decoder_H264_ALL/D3D/include/dmusicc.h new file mode 100644 index 0000000..0d0afb2 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dmusicc.h @@ -0,0 +1,784 @@ +/************************************************************************ +* * +* dmusicc.h -- This module defines the DirectMusic core API's * +* * +* Copyright (c) Microsoft Corporation. All rights reserved. * +* * +************************************************************************/ + +#ifndef _DMUSICC_ +#define _DMUSICC_ + +#include + +#define COM_NO_WINDOWS_H +#include + +#include + +#include "dls1.h" +#include "dmerror.h" +#include "dmdls.h" +#include "dsound.h" +#include "dmusbuff.h" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef ULONGLONG SAMPLE_TIME; +typedef ULONGLONG SAMPLE_POSITION; +typedef SAMPLE_TIME *LPSAMPLE_TIME; + +#define DMUS_MAX_DESCRIPTION 128 +#define DMUS_MAX_DRIVER 128 + +typedef struct _DMUS_BUFFERDESC *LPDMUS_BUFFERDESC; +typedef struct _DMUS_BUFFERDESC +{ + DWORD dwSize; + DWORD dwFlags; + GUID guidBufferFormat; + DWORD cbBuffer; +} DMUS_BUFFERDESC; + +/* DMUS_EFFECT_ flags are used in the dwEffectFlags fields of both DMUS_PORTCAPS + * and DMUS_PORTPARAMS. + */ +#define DMUS_EFFECT_NONE 0x00000000 +#define DMUS_EFFECT_REVERB 0x00000001 +#define DMUS_EFFECT_CHORUS 0x00000002 +#define DMUS_EFFECT_DELAY 0x00000004 + +/* For DMUS_PORTCAPS dwClass + */ +#define DMUS_PC_INPUTCLASS (0) +#define DMUS_PC_OUTPUTCLASS (1) + +/* For DMUS_PORTCAPS dwFlags + */ +#define DMUS_PC_DLS (0x00000001) // Supports DLS downloading and DLS level 1. +#define DMUS_PC_EXTERNAL (0x00000002) // External MIDI module. +#define DMUS_PC_SOFTWARESYNTH (0x00000004) // Software synthesizer. +#define DMUS_PC_MEMORYSIZEFIXED (0x00000008) // Memory size is fixed. +#define DMUS_PC_GMINHARDWARE (0x00000010) // GM sound set is built in, no need to download. +#define DMUS_PC_GSINHARDWARE (0x00000020) // GS sound set is built in. +#define DMUS_PC_XGINHARDWARE (0x00000040) // XG sound set is built in. +#define DMUS_PC_DIRECTSOUND (0x00000080) // Connects to DirectSound via a DirectSound buffer. +#define DMUS_PC_SHAREABLE (0x00000100) // Synth can be actively shared by multiple apps at once. +#define DMUS_PC_DLS2 (0x00000200) // Supports DLS2 instruments. +#define DMUS_PC_AUDIOPATH (0x00000400) // Multiple outputs can be connected to DirectSound for audiopaths. +#define DMUS_PC_WAVE (0x00000800) // Supports streaming and one shot waves. + +#define DMUS_PC_SYSTEMMEMORY (0x7FFFFFFF) // Sample memory is system memory. + + +typedef struct _DMUS_PORTCAPS +{ + DWORD dwSize; + DWORD dwFlags; + GUID guidPort; + DWORD dwClass; + DWORD dwType; + DWORD dwMemorySize; + DWORD dwMaxChannelGroups; + DWORD dwMaxVoices; + DWORD dwMaxAudioChannels; + DWORD dwEffectFlags; + WCHAR wszDescription[DMUS_MAX_DESCRIPTION]; +} DMUS_PORTCAPS; + +typedef DMUS_PORTCAPS *LPDMUS_PORTCAPS; + +/* Values for DMUS_PORTCAPS dwType. This field indicates the underlying + * driver type of the port. + */ +#define DMUS_PORT_WINMM_DRIVER (0) +#define DMUS_PORT_USER_MODE_SYNTH (1) +#define DMUS_PORT_KERNEL_MODE (2) + +/* These flags (set in dwValidParams) indicate which other members of the */ +/* DMUS_PORTPARAMS are valid. */ +/* */ +#define DMUS_PORTPARAMS_VOICES 0x00000001 +#define DMUS_PORTPARAMS_CHANNELGROUPS 0x00000002 +#define DMUS_PORTPARAMS_AUDIOCHANNELS 0x00000004 +#define DMUS_PORTPARAMS_SAMPLERATE 0x00000008 +#define DMUS_PORTPARAMS_EFFECTS 0x00000020 +#define DMUS_PORTPARAMS_SHARE 0x00000040 +#define DMUS_PORTPARAMS_FEATURES 0x00000080 /* DirectX 8.0 and above */ + +typedef struct _DMUS_PORTPARAMS +{ + DWORD dwSize; + DWORD dwValidParams; + DWORD dwVoices; + DWORD dwChannelGroups; + DWORD dwAudioChannels; + DWORD dwSampleRate; + DWORD dwEffectFlags; + BOOL fShare; +} DMUS_PORTPARAMS7; + +typedef struct _DMUS_PORTPARAMS8 +{ + DWORD dwSize; + DWORD dwValidParams; + DWORD dwVoices; + DWORD dwChannelGroups; + DWORD dwAudioChannels; + DWORD dwSampleRate; + DWORD dwEffectFlags; + BOOL fShare; + DWORD dwFeatures; +} DMUS_PORTPARAMS8; + +#define DMUS_PORT_FEATURE_AUDIOPATH 0x00000001 /* Supports audiopath connection to DirectSound buffers. */ +#define DMUS_PORT_FEATURE_STREAMING 0x00000002 /* Supports streaming waves through the synth. */ + + +typedef DMUS_PORTPARAMS8 DMUS_PORTPARAMS; +typedef DMUS_PORTPARAMS *LPDMUS_PORTPARAMS; + +typedef struct _DMUS_SYNTHSTATS *LPDMUS_SYNTHSTATS; +typedef struct _DMUS_SYNTHSTATS8 *LPDMUS_SYNTHSTATS8; +typedef struct _DMUS_SYNTHSTATS +{ + DWORD dwSize; /* Size in bytes of the structure */ + DWORD dwValidStats; /* Flags indicating which fields below are valid. */ + DWORD dwVoices; /* Average number of voices playing. */ + DWORD dwTotalCPU; /* Total CPU usage as percent * 100. */ + DWORD dwCPUPerVoice; /* CPU per voice as percent * 100. */ + DWORD dwLostNotes; /* Number of notes lost in 1 second. */ + DWORD dwFreeMemory; /* Free memory in bytes */ + long lPeakVolume; /* Decibel level * 100. */ +} DMUS_SYNTHSTATS; + +typedef struct _DMUS_SYNTHSTATS8 +{ + DWORD dwSize; /* Size in bytes of the structure */ + DWORD dwValidStats; /* Flags indicating which fields below are valid. */ + DWORD dwVoices; /* Average number of voices playing. */ + DWORD dwTotalCPU; /* Total CPU usage as percent * 100. */ + DWORD dwCPUPerVoice; /* CPU per voice as percent * 100. */ + DWORD dwLostNotes; /* Number of notes lost in 1 second. */ + DWORD dwFreeMemory; /* Free memory in bytes */ + long lPeakVolume; /* Decibel level * 100. */ + DWORD dwSynthMemUse; /* Memory used by synth wave data */ +} DMUS_SYNTHSTATS8; + +#define DMUS_SYNTHSTATS_VOICES (1 << 0) +#define DMUS_SYNTHSTATS_TOTAL_CPU (1 << 1) +#define DMUS_SYNTHSTATS_CPU_PER_VOICE (1 << 2) +#define DMUS_SYNTHSTATS_LOST_NOTES (1 << 3) +#define DMUS_SYNTHSTATS_PEAK_VOLUME (1 << 4) +#define DMUS_SYNTHSTATS_FREE_MEMORY (1 << 5) + +#define DMUS_SYNTHSTATS_SYSTEMMEMORY DMUS_PC_SYSTEMMEMORY + +typedef struct _DMUS_WAVES_REVERB_PARAMS +{ + float fInGain; /* Input gain in dB (to avoid output overflows) */ + float fReverbMix; /* Reverb mix in dB. 0dB means 100% wet reverb (no direct signal) + Negative values gives less wet signal. + The coeficients are calculated so that the overall output level stays + (approximately) constant regardless of the ammount of reverb mix. */ + float fReverbTime; /* The reverb decay time, in milliseconds. */ + float fHighFreqRTRatio; /* The ratio of the high frequencies to the global reverb time. + Unless very 'splashy-bright' reverbs are wanted, this should be set to + a value < 1.0. + For example if dRevTime==1000ms and dHighFreqRTRatio=0.1 than the + decay time for high frequencies will be 100ms.*/ + +} DMUS_WAVES_REVERB_PARAMS; + +/* Note: Default values for Reverb are: + fInGain = 0.0dB (no change in level) + fReverbMix = -10.0dB (a reasonable reverb mix) + fReverbTime = 1000.0ms (one second global reverb time) + fHighFreqRTRatio = 0.001 (the ratio of the high frequencies to the global reverb time) +*/ + +typedef enum +{ + DMUS_CLOCK_SYSTEM = 0, + DMUS_CLOCK_WAVE = 1 +} DMUS_CLOCKTYPE; + +#define DMUS_CLOCKF_GLOBAL 0x00000001 + +typedef struct _DMUS_CLOCKINFO7 *LPDMUS_CLOCKINFO7; +typedef struct _DMUS_CLOCKINFO7 +{ + DWORD dwSize; + DMUS_CLOCKTYPE ctType; + GUID guidClock; /* Identifies this time source */ + WCHAR wszDescription[DMUS_MAX_DESCRIPTION]; +} DMUS_CLOCKINFO7; + +typedef struct _DMUS_CLOCKINFO8 *LPDMUS_CLOCKINFO8; +typedef struct _DMUS_CLOCKINFO8 +{ + DWORD dwSize; + DMUS_CLOCKTYPE ctType; + GUID guidClock; /* Identifies this time source */ + WCHAR wszDescription[DMUS_MAX_DESCRIPTION]; + DWORD dwFlags; +} DMUS_CLOCKINFO8; + +typedef DMUS_CLOCKINFO8 DMUS_CLOCKINFO; +typedef DMUS_CLOCKINFO *LPDMUS_CLOCKINFO; + +/* Default bus identifiers + * + * The first 17 are direct mappings to the destinations defined in both + * the MMA DLS Level 2 specification and the Microsoft Multi-Channel audio + * specification. + */ +#define DSBUSID_FIRST_SPKR_LOC 0 +#define DSBUSID_FRONT_LEFT 0 +#define DSBUSID_LEFT 0 /* Front left is also just left */ +#define DSBUSID_FRONT_RIGHT 1 +#define DSBUSID_RIGHT 1 /* Ditto front right */ +#define DSBUSID_FRONT_CENTER 2 +#define DSBUSID_LOW_FREQUENCY 3 +#define DSBUSID_BACK_LEFT 4 +#define DSBUSID_BACK_RIGHT 5 +#define DSBUSID_FRONT_LEFT_OF_CENTER 6 +#define DSBUSID_FRONT_RIGHT_OF_CENTER 7 +#define DSBUSID_BACK_CENTER 8 +#define DSBUSID_SIDE_LEFT 9 +#define DSBUSID_SIDE_RIGHT 10 +#define DSBUSID_TOP_CENTER 11 +#define DSBUSID_TOP_FRONT_LEFT 12 +#define DSBUSID_TOP_FRONT_CENTER 13 +#define DSBUSID_TOP_FRONT_RIGHT 14 +#define DSBUSID_TOP_BACK_LEFT 15 +#define DSBUSID_TOP_BACK_CENTER 16 +#define DSBUSID_TOP_BACK_RIGHT 17 +#define DSBUSID_LAST_SPKR_LOC 17 + +#define DSBUSID_IS_SPKR_LOC(id) ( ((id) >= DSBUSID_FIRST_SPKR_LOC) && ((id) <= DSBUSID_LAST_SPKR_LOC) ) + +/* These bus identifiers are for the standard DLS effect sends + */ +#define DSBUSID_REVERB_SEND 64 +#define DSBUSID_CHORUS_SEND 65 + +/* Dynamic bus identifiers start here. See the documentation for how + * synthesizers map the output of voices to static and dynamic + * bus identifiers. + */ +#define DSBUSID_DYNAMIC_0 512 + +/* Null bus, used to identify busses that have no function mapping. +*/ +#define DSBUSID_NULL 0xFFFFFFFF + +interface IDirectMusic; +interface IDirectMusic8; +interface IDirectMusicBuffer; +interface IDirectMusicPort; +interface IDirectMusicThru; +interface IReferenceClock; + +#ifndef __cplusplus + +typedef interface IDirectMusic IDirectMusic; +typedef interface IDirectMusic8 IDirectMusic8; +typedef interface IDirectMusicPort IDirectMusicPort; +typedef interface IDirectMusicBuffer IDirectMusicBuffer; +typedef interface IDirectMusicThru IDirectMusicThru; +typedef interface IReferenceClock IReferenceClock; + +#endif /* C++ */ + +typedef IDirectMusic *LPDIRECTMUSIC; +typedef IDirectMusic8 *LPDIRECTMUSIC8; +typedef IDirectMusicPort *LPDIRECTMUSICPORT; +typedef IDirectMusicBuffer *LPDIRECTMUSICBUFFER; + +#undef INTERFACE +#define INTERFACE IDirectMusic +DECLARE_INTERFACE_(IDirectMusic, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusic */ + STDMETHOD(EnumPort) (THIS_ DWORD dwIndex, + LPDMUS_PORTCAPS pPortCaps) PURE; + STDMETHOD(CreateMusicBuffer) (THIS_ LPDMUS_BUFFERDESC pBufferDesc, + LPDIRECTMUSICBUFFER *ppBuffer, + LPUNKNOWN pUnkOuter) PURE; + STDMETHOD(CreatePort) (THIS_ REFCLSID rclsidPort, + LPDMUS_PORTPARAMS pPortParams, + LPDIRECTMUSICPORT *ppPort, + LPUNKNOWN pUnkOuter) PURE; + STDMETHOD(EnumMasterClock) (THIS_ DWORD dwIndex, + LPDMUS_CLOCKINFO lpClockInfo) PURE; + STDMETHOD(GetMasterClock) (THIS_ LPGUID pguidClock, + IReferenceClock **ppReferenceClock) PURE; + STDMETHOD(SetMasterClock) (THIS_ REFGUID rguidClock) PURE; + STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE; + STDMETHOD(GetDefaultPort) (THIS_ LPGUID pguidPort) PURE; + STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound, + HWND hWnd) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectMusic8 +DECLARE_INTERFACE_(IDirectMusic8, IDirectMusic) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusic */ + STDMETHOD(EnumPort) (THIS_ DWORD dwIndex, + LPDMUS_PORTCAPS pPortCaps) PURE; + STDMETHOD(CreateMusicBuffer) (THIS_ LPDMUS_BUFFERDESC pBufferDesc, + LPDIRECTMUSICBUFFER *ppBuffer, + LPUNKNOWN pUnkOuter) PURE; + STDMETHOD(CreatePort) (THIS_ REFCLSID rclsidPort, + LPDMUS_PORTPARAMS pPortParams, + LPDIRECTMUSICPORT *ppPort, + LPUNKNOWN pUnkOuter) PURE; + STDMETHOD(EnumMasterClock) (THIS_ DWORD dwIndex, + LPDMUS_CLOCKINFO lpClockInfo) PURE; + STDMETHOD(GetMasterClock) (THIS_ LPGUID pguidClock, + IReferenceClock **ppReferenceClock) PURE; + STDMETHOD(SetMasterClock) (THIS_ REFGUID rguidClock) PURE; + STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE; + STDMETHOD(GetDefaultPort) (THIS_ LPGUID pguidPort) PURE; + STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound, + HWND hWnd) PURE; + /* IDirectMusic8 */ + STDMETHOD(SetExternalMasterClock) + (THIS_ IReferenceClock *pClock) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectMusicBuffer +DECLARE_INTERFACE_(IDirectMusicBuffer, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicBuffer */ + STDMETHOD(Flush) (THIS) PURE; + STDMETHOD(TotalTime) (THIS_ LPREFERENCE_TIME prtTime) PURE; + + STDMETHOD(PackStructured) (THIS_ REFERENCE_TIME rt, + DWORD dwChannelGroup, + DWORD dwChannelMessage) PURE; + + STDMETHOD(PackUnstructured) (THIS_ REFERENCE_TIME rt, + DWORD dwChannelGroup, + DWORD cb, + LPBYTE lpb) PURE; + + STDMETHOD(ResetReadPtr) (THIS) PURE; + STDMETHOD(GetNextEvent) (THIS_ LPREFERENCE_TIME prt, + LPDWORD pdwChannelGroup, + LPDWORD pdwLength, + LPBYTE *ppData) PURE; + + STDMETHOD(GetRawBufferPtr) (THIS_ LPBYTE *ppData) PURE; + STDMETHOD(GetStartTime) (THIS_ LPREFERENCE_TIME prt) PURE; + STDMETHOD(GetUsedBytes) (THIS_ LPDWORD pcb) PURE; + STDMETHOD(GetMaxBytes) (THIS_ LPDWORD pcb) PURE; + STDMETHOD(GetBufferFormat) (THIS_ LPGUID pGuidFormat) PURE; + + STDMETHOD(SetStartTime) (THIS_ REFERENCE_TIME rt) PURE; + STDMETHOD(SetUsedBytes) (THIS_ DWORD cb) PURE; +}; + +typedef IDirectMusicBuffer IDirectMusicBuffer8; +typedef IDirectMusicBuffer8 *LPDIRECTMUSICBUFFER8; + +#undef INTERFACE +#define INTERFACE IDirectMusicInstrument +DECLARE_INTERFACE_(IDirectMusicInstrument, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicInstrument */ + STDMETHOD(GetPatch) (THIS_ DWORD* pdwPatch) PURE; + STDMETHOD(SetPatch) (THIS_ DWORD dwPatch) PURE; +}; + +typedef IDirectMusicInstrument IDirectMusicInstrument8; +typedef IDirectMusicInstrument8 *LPDIRECTMUSICINSTRUMENT8; + +#undef INTERFACE +#define INTERFACE IDirectMusicDownloadedInstrument +DECLARE_INTERFACE_(IDirectMusicDownloadedInstrument, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicDownloadedInstrument */ + /* None at this time */ +}; + +typedef IDirectMusicDownloadedInstrument IDirectMusicDownloadedInstrument8; +typedef IDirectMusicDownloadedInstrument8 *LPDIRECTMUSICDOWNLOADEDINSTRUMENT8; + +#undef INTERFACE +#define INTERFACE IDirectMusicCollection +DECLARE_INTERFACE_(IDirectMusicCollection, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicCollection */ + STDMETHOD(GetInstrument) (THIS_ DWORD dwPatch, + IDirectMusicInstrument** ppInstrument) PURE; + STDMETHOD(EnumInstrument) (THIS_ DWORD dwIndex, + DWORD* pdwPatch, + LPWSTR pwszName, + DWORD dwNameLen) PURE; +}; + +typedef IDirectMusicCollection IDirectMusicCollection8; +typedef IDirectMusicCollection8 *LPDIRECTMUSICCOLLECTION8; + +#undef INTERFACE +#define INTERFACE IDirectMusicDownload +DECLARE_INTERFACE_(IDirectMusicDownload , IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicDownload */ + STDMETHOD(GetBuffer) (THIS_ void** ppvBuffer, + DWORD* pdwSize) PURE; +}; + +typedef IDirectMusicDownload IDirectMusicDownload8; +typedef IDirectMusicDownload8 *LPDIRECTMUSICDOWNLOAD8; + +#undef INTERFACE +#define INTERFACE IDirectMusicPortDownload +DECLARE_INTERFACE_(IDirectMusicPortDownload, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicPortDownload */ + STDMETHOD(GetBuffer) (THIS_ DWORD dwDLId, + IDirectMusicDownload** ppIDMDownload) PURE; + STDMETHOD(AllocateBuffer) (THIS_ DWORD dwSize, + IDirectMusicDownload** ppIDMDownload) PURE; + STDMETHOD(GetDLId) (THIS_ DWORD* pdwStartDLId, + DWORD dwCount) PURE; + STDMETHOD(GetAppend) (THIS_ DWORD* pdwAppend) PURE; + STDMETHOD(Download) (THIS_ IDirectMusicDownload* pIDMDownload) PURE; + STDMETHOD(Unload) (THIS_ IDirectMusicDownload* pIDMDownload) PURE; +}; + +typedef IDirectMusicPortDownload IDirectMusicPortDownload8; +typedef IDirectMusicPortDownload8 *LPDIRECTMUSICPORTDOWNLOAD8; + +/* Standard values for voice priorities. Numerically higher priorities are higher in priority. + * These priorities are used to set the voice priority for all voices on a channel. They are + * used in the dwPriority parameter of IDirectMusicPort::GetPriority and returned in the + * lpwPriority parameter of pdwPriority. + * + * These priorities are shared with DirectSound. + */ + +#ifndef _DIRECTAUDIO_PRIORITIES_DEFINED_ +#define _DIRECTAUDIO_PRIORITIES_DEFINED_ + +#define DAUD_CRITICAL_VOICE_PRIORITY (0xF0000000) +#define DAUD_HIGH_VOICE_PRIORITY (0xC0000000) +#define DAUD_STANDARD_VOICE_PRIORITY (0x80000000) +#define DAUD_LOW_VOICE_PRIORITY (0x40000000) +#define DAUD_PERSIST_VOICE_PRIORITY (0x10000000) + +/* These are the default priorities assigned if not overridden. By default priorities are + * equal across channel groups (e.g. channel 5 on channel group 1 has the same priority as + * channel 5 on channel group 2). + * + * In accordance with DLS level 1, channel 10 has the highest priority, followed by 1 through 16 + * except for 10. + */ +#define DAUD_CHAN1_VOICE_PRIORITY_OFFSET (0x0000000E) +#define DAUD_CHAN2_VOICE_PRIORITY_OFFSET (0x0000000D) +#define DAUD_CHAN3_VOICE_PRIORITY_OFFSET (0x0000000C) +#define DAUD_CHAN4_VOICE_PRIORITY_OFFSET (0x0000000B) +#define DAUD_CHAN5_VOICE_PRIORITY_OFFSET (0x0000000A) +#define DAUD_CHAN6_VOICE_PRIORITY_OFFSET (0x00000009) +#define DAUD_CHAN7_VOICE_PRIORITY_OFFSET (0x00000008) +#define DAUD_CHAN8_VOICE_PRIORITY_OFFSET (0x00000007) +#define DAUD_CHAN9_VOICE_PRIORITY_OFFSET (0x00000006) +#define DAUD_CHAN10_VOICE_PRIORITY_OFFSET (0x0000000F) +#define DAUD_CHAN11_VOICE_PRIORITY_OFFSET (0x00000005) +#define DAUD_CHAN12_VOICE_PRIORITY_OFFSET (0x00000004) +#define DAUD_CHAN13_VOICE_PRIORITY_OFFSET (0x00000003) +#define DAUD_CHAN14_VOICE_PRIORITY_OFFSET (0x00000002) +#define DAUD_CHAN15_VOICE_PRIORITY_OFFSET (0x00000001) +#define DAUD_CHAN16_VOICE_PRIORITY_OFFSET (0x00000000) + + +#define DAUD_CHAN1_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN1_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN2_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN2_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN3_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN3_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN4_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN4_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN5_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN5_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN6_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN6_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN7_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN7_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN8_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN8_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN9_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN9_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN10_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN10_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN11_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN11_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN12_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN12_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN13_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN13_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN14_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN14_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN15_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN15_VOICE_PRIORITY_OFFSET) +#define DAUD_CHAN16_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN16_VOICE_PRIORITY_OFFSET) + +#endif /* _DIRECTAUDIO_PRIORITIES_DEFINED_ */ + + +#undef INTERFACE +#define INTERFACE IDirectMusicPort +DECLARE_INTERFACE_(IDirectMusicPort, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicPort */ + /* */ + STDMETHOD(PlayBuffer) (THIS_ LPDIRECTMUSICBUFFER pBuffer) PURE; + STDMETHOD(SetReadNotificationHandle) (THIS_ HANDLE hEvent) PURE; + STDMETHOD(Read) (THIS_ LPDIRECTMUSICBUFFER pBuffer) PURE; + STDMETHOD(DownloadInstrument) (THIS_ IDirectMusicInstrument *pInstrument, + IDirectMusicDownloadedInstrument **ppDownloadedInstrument, + DMUS_NOTERANGE *pNoteRanges, + DWORD dwNumNoteRanges) PURE; + STDMETHOD(UnloadInstrument) (THIS_ IDirectMusicDownloadedInstrument *pDownloadedInstrument) PURE; + STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE; + STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE; + STDMETHOD(Compact) (THIS) PURE; + STDMETHOD(GetCaps) (THIS_ LPDMUS_PORTCAPS pPortCaps) PURE; + STDMETHOD(DeviceIoControl) (THIS_ DWORD dwIoControlCode, + LPVOID lpInBuffer, + DWORD nInBufferSize, + LPVOID lpOutBuffer, + DWORD nOutBufferSize, + LPDWORD lpBytesReturned, + LPOVERLAPPED lpOverlapped) PURE; + STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwChannelGroups) PURE; + STDMETHOD(GetNumChannelGroups) (THIS_ LPDWORD pdwChannelGroups) PURE; + STDMETHOD(Activate) (THIS_ BOOL fActive) PURE; + STDMETHOD(SetChannelPriority) (THIS_ DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority) PURE; + STDMETHOD(GetChannelPriority) (THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority) PURE; + STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer) PURE; + STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSize, LPDWORD pdwBufferSize) PURE; +}; + +typedef IDirectMusicPort IDirectMusicPort8; +typedef IDirectMusicPort8 *LPDIRECTMUSICPORT8; + +#undef INTERFACE +#define INTERFACE IDirectMusicThru +DECLARE_INTERFACE_(IDirectMusicThru, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicThru + */ + STDMETHOD(ThruChannel) (THIS_ DWORD dwSourceChannelGroup, + DWORD dwSourceChannel, + DWORD dwDestinationChannelGroup, + DWORD dwDestinationChannel, + LPDIRECTMUSICPORT pDestinationPort) PURE; +}; + +typedef IDirectMusicThru IDirectMusicThru8; +typedef IDirectMusicThru8 *LPDIRECTMUSICTHRU8; + +#ifndef __IReferenceClock_INTERFACE_DEFINED__ +#define __IReferenceClock_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_IReferenceClock,0x56a86897,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70); + +#undef INTERFACE +#define INTERFACE IReferenceClock +DECLARE_INTERFACE_(IReferenceClock, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IReferenceClock */ + /* */ + + /* get the time now */ + STDMETHOD(GetTime) (THIS_ REFERENCE_TIME *pTime) PURE; + + /* ask for an async notification that a time has elapsed */ + STDMETHOD(AdviseTime) (THIS_ REFERENCE_TIME baseTime, /* base time */ + REFERENCE_TIME streamTime, /* stream offset time */ + HANDLE hEvent, /* advise via this event */ + DWORD * pdwAdviseCookie) PURE; /* where your cookie goes */ + + /* ask for an async periodic notification that a time has elapsed */ + STDMETHOD(AdvisePeriodic) (THIS_ REFERENCE_TIME startTime, /* starting at this time */ + REFERENCE_TIME periodTime, /* time between notifications */ + HANDLE hSemaphore, /* advise via a semaphore */ + DWORD * pdwAdviseCookie) PURE; /* where your cookie goes */ + + /* cancel a request for notification */ + STDMETHOD(Unadvise) (THIS_ DWORD dwAdviseCookie) PURE; +}; + +#endif /* __IReferenceClock_INTERFACE_DEFINED__ */ + +DEFINE_GUID(CLSID_DirectMusic,0x636b9f10,0x0c7d,0x11d1,0x95,0xb2,0x00,0x20,0xaf,0xdc,0x74,0x21); +DEFINE_GUID(CLSID_DirectMusicCollection,0x480ff4b0, 0x28b2, 0x11d1, 0xbe, 0xf7, 0x0, 0xc0, 0x4f, 0xbf, 0x8f, 0xef); +DEFINE_GUID(CLSID_DirectMusicSynth,0x58C2B4D0,0x46E7,0x11D1,0x89,0xAC,0x00,0xA0,0xC9,0x05,0x41,0x29); + +DEFINE_GUID(IID_IDirectMusic,0x6536115a,0x7b2d,0x11d2,0xba,0x18,0x00,0x00,0xf8,0x75,0xac,0x12); +DEFINE_GUID(IID_IDirectMusicBuffer,0xd2ac2878, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(IID_IDirectMusicPort, 0x08f2d8c9,0x37c2,0x11d2,0xb9,0xf9,0x00,0x00,0xf8,0x75,0xac,0x12); +DEFINE_GUID(IID_IDirectMusicThru, 0xced153e7, 0x3606, 0x11d2, 0xb9, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); +DEFINE_GUID(IID_IDirectMusicPortDownload,0xd2ac287a, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(IID_IDirectMusicDownload,0xd2ac287b, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(IID_IDirectMusicCollection,0xd2ac287c, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(IID_IDirectMusicInstrument,0xd2ac287d, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(IID_IDirectMusicDownloadedInstrument,0xd2ac287e, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + + +/* Alternate interface ID for IID_IDirectMusic, available in DX7 release and after. */ +DEFINE_GUID(IID_IDirectMusic2,0x6fc2cae1, 0xbc78, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); + +DEFINE_GUID(IID_IDirectMusic8,0x2d3629f7,0x813d,0x4939,0x85,0x08,0xf0,0x5c,0x6b,0x75,0xfd,0x97); + +#define IID_IDirectMusicThru8 IID_IDirectMusicThru +#define IID_IDirectMusicPortDownload8 IID_IDirectMusicPortDownload +#define IID_IDirectMusicDownload8 IID_IDirectMusicDownload +#define IID_IDirectMusicCollection8 IID_IDirectMusicCollection +#define IID_IDirectMusicInstrument8 IID_IDirectMusicInstrument +#define IID_IDirectMusicDownloadedInstrument8 IID_IDirectMusicDownloadedInstrument +#define IID_IDirectMusicPort8 IID_IDirectMusicPort + + +/* Property Query GUID_DMUS_PROP_GM_Hardware - Local GM set, no need to download + * Property Query GUID_DMUS_PROP_GS_Hardware - Local GS set, no need to download + * Property Query GUID_DMUS_PROP_XG_Hardware - Local XG set, no need to download + * Property Query GUID_DMUS_PROP_DLS1 - Support DLS level 1 + * Property Query GUID_DMUS_PROP_INSTRUMENT2 - Support new INSTRUMENT2 download format + * Property Query GUID_DMUS_PROP_XG_Capable - Support minimum requirements of XG + * Property Query GUID_DMUS_PROP_GS_Capable - Support minimum requirements of GS + * Property Query GUID_DMUS_PROP_SynthSink_DSOUND - Synthsink talks to DirectSound + * Property Query GUID_DMUS_PROP_SynthSink_WAVE - Synthsink talks to Wave device + * + * Item 0: Supported + * Returns a DWORD which is non-zero if the feature is supported + */ +DEFINE_GUID(GUID_DMUS_PROP_GM_Hardware, 0x178f2f24, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); +DEFINE_GUID(GUID_DMUS_PROP_GS_Hardware, 0x178f2f25, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); +DEFINE_GUID(GUID_DMUS_PROP_XG_Hardware, 0x178f2f26, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); +DEFINE_GUID(GUID_DMUS_PROP_XG_Capable, 0x6496aba1, 0x61b0, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); +DEFINE_GUID(GUID_DMUS_PROP_GS_Capable, 0x6496aba2, 0x61b0, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); +DEFINE_GUID(GUID_DMUS_PROP_DLS1, 0x178f2f27, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); +DEFINE_GUID(GUID_DMUS_PROP_DLS2, 0xf14599e5, 0x4689, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); +DEFINE_GUID(GUID_DMUS_PROP_INSTRUMENT2, 0x865fd372, 0x9f67, 0x11d2, 0x87, 0x2a, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(GUID_DMUS_PROP_SynthSink_DSOUND,0xaa97844, 0xc877, 0x11d1, 0x87, 0xc, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(GUID_DMUS_PROP_SynthSink_WAVE,0xaa97845, 0xc877, 0x11d1, 0x87, 0xc, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(GUID_DMUS_PROP_SampleMemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); +DEFINE_GUID(GUID_DMUS_PROP_SamplePlaybackRate, 0x2a91f713, 0xa4bf, 0x11d2, 0xbb, 0xdf, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8); + +/* Property Get/Set GUID_DMUS_PROP_WriteLatency + * + * Item 0: Synth buffer write latency, in milliseconds + * Get/Set SynthSink latency, the average time after the play head that the next buffer gets written. + */ +DEFINE_GUID(GUID_DMUS_PROP_WriteLatency,0x268a0fa0, 0x60f2, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); + +/* Property Get/Set GUID_DMUS_PROP_WritePeriod + * + * Item 0: Synth buffer write period, in milliseconds + * Get/Set SynthSink buffer write period, time span between successive writes. + */ +DEFINE_GUID(GUID_DMUS_PROP_WritePeriod,0x268a0fa1, 0x60f2, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); + +/* Property Get GUID_DMUS_PROP_MemorySize + * + * Item 0: Memory size + * Returns a DWORD containing the total number of bytes of sample RAM + */ +DEFINE_GUID(GUID_DMUS_PROP_MemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); + +/* Property Set GUID_DMUS_PROP_WavesReverb + * + * Item 0: DMUS_WAVES_REVERB structure + * Sets reverb parameters + */ +DEFINE_GUID(GUID_DMUS_PROP_WavesReverb,0x4cb5622, 0x32e5, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); + +/* Property Set GUID_DMUS_PROP_Effects + * + * Item 0: DWORD with effects flags. + * Get/Set effects bits, same as dwEffectFlags in DMUS_PORTPARAMS and DMUS_PORTCAPS: + * DMUS_EFFECT_NONE + * DMUS_EFFECT_REVERB + * DMUS_EFFECT_CHORUS + */ +DEFINE_GUID(GUID_DMUS_PROP_Effects, 0xcda8d611, 0x684a, 0x11d2, 0x87, 0x1e, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Property Set GUID_DMUS_PROP_LegacyCaps + * + * Item 0: The MIDINCAPS or MIDIOUTCAPS which describes the port's underlying WinMM device. This property is only supported + * by ports which wrap WinMM devices. + */ + +DEFINE_GUID(GUID_DMUS_PROP_LegacyCaps,0xcfa7cdc2, 0x00a1, 0x11d2, 0xaa, 0xd5, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); + +/* Property Set GUID_DMUS_PROP_Volume + * + * Item 0: A long which contains an offset, in 1/100 dB, to be added to the final volume + * + */ +DEFINE_GUID(GUID_DMUS_PROP_Volume, 0xfedfae25L, 0xe46e, 0x11d1, 0xaa, 0xce, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); + +/* Min and Max values for setting volume with GUID_DMUS_PROP_Volume */ + +#define DMUS_VOLUME_MAX 2000 /* +20 dB */ +#define DMUS_VOLUME_MIN -20000 /* -200 dB */ + +#ifdef __cplusplus +}; /* extern "C" */ +#endif + +#include + +#endif /* #ifndef _DMUSICC_ */ diff --git a/Src/Decoder_H264_ALL/D3D/include/dmusicf.h b/Src/Decoder_H264_ALL/D3D/include/dmusicf.h new file mode 100644 index 0000000..920b2fc --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dmusicf.h @@ -0,0 +1,2199 @@ +/************************************************************************ +* * +* dmusicf.h -- This module defines the DirectMusic file formats * +* * +* Copyright (c) Microsoft Corporation. All rights reserved. * +* * +************************************************************************/ + +#ifndef _DMUSICF_ +#define _DMUSICF_ + + +#include + +#define COM_NO_WINDOWS_H +#include + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +interface IDirectMusicCollection; +#ifndef __cplusplus +typedef interface IDirectMusicCollection IDirectMusicCollection; +#endif + +/* Common chunks */ + +#define DMUS_FOURCC_GUID_CHUNK mmioFOURCC('g','u','i','d') +#define DMUS_FOURCC_INFO_LIST mmioFOURCC('I','N','F','O') +#define DMUS_FOURCC_UNFO_LIST mmioFOURCC('U','N','F','O') +#define DMUS_FOURCC_UNAM_CHUNK mmioFOURCC('U','N','A','M') +#define DMUS_FOURCC_UART_CHUNK mmioFOURCC('U','A','R','T') +#define DMUS_FOURCC_UCOP_CHUNK mmioFOURCC('U','C','O','P') +#define DMUS_FOURCC_USBJ_CHUNK mmioFOURCC('U','S','B','J') +#define DMUS_FOURCC_UCMT_CHUNK mmioFOURCC('U','C','M','T') +#define DMUS_FOURCC_CATEGORY_CHUNK mmioFOURCC('c','a','t','g') +#define DMUS_FOURCC_VERSION_CHUNK mmioFOURCC('v','e','r','s') + +/* The following structures are used by the Tracks, and are the packed structures */ +/* that are passed to the Tracks inside the IStream. */ + + +typedef struct _DMUS_IO_SEQ_ITEM +{ + MUSIC_TIME mtTime; + MUSIC_TIME mtDuration; + DWORD dwPChannel; + short nOffset; + BYTE bStatus; + BYTE bByte1; + BYTE bByte2; +} DMUS_IO_SEQ_ITEM; + + +typedef struct _DMUS_IO_CURVE_ITEM +{ + MUSIC_TIME mtStart; + MUSIC_TIME mtDuration; + MUSIC_TIME mtResetDuration; + DWORD dwPChannel; + short nOffset; + short nStartValue; + short nEndValue; + short nResetValue; + BYTE bType; + BYTE bCurveShape; + BYTE bCCData; + BYTE bFlags; + /* Following was added for DirectX8. */ + WORD wParamType; /* RPN or NRPN parameter number. */ + WORD wMergeIndex; /* Allows multiple parameters to be merged (pitchbend, volume, and expression.) */ +} DMUS_IO_CURVE_ITEM; + + +typedef struct _DMUS_IO_TEMPO_ITEM +{ + MUSIC_TIME lTime; + double dblTempo; +} DMUS_IO_TEMPO_ITEM; + + +typedef struct _DMUS_IO_SYSEX_ITEM +{ + MUSIC_TIME mtTime; + DWORD dwPChannel; + DWORD dwSysExLength; +} DMUS_IO_SYSEX_ITEM; + +typedef DMUS_CHORD_KEY DMUS_CHORD_PARAM; /* DMUS_CHORD_KEY defined in dmusici.h */ + +typedef struct _DMUS_RHYTHM_PARAM +{ + DMUS_TIMESIGNATURE TimeSig; + DWORD dwRhythmPattern; +} DMUS_RHYTHM_PARAM; + +typedef struct _DMUS_TEMPO_PARAM +{ + MUSIC_TIME mtTime; + double dblTempo; +} DMUS_TEMPO_PARAM; + + +typedef struct _DMUS_MUTE_PARAM +{ + DWORD dwPChannel; + DWORD dwPChannelMap; + BOOL fMute; +} DMUS_MUTE_PARAM; + +/* Style chunks */ + +#define DMUS_FOURCC_STYLE_FORM mmioFOURCC('D','M','S','T') +#define DMUS_FOURCC_STYLE_CHUNK mmioFOURCC('s','t','y','h') +#define DMUS_FOURCC_PART_LIST mmioFOURCC('p','a','r','t') +#define DMUS_FOURCC_PART_CHUNK mmioFOURCC('p','r','t','h') +#define DMUS_FOURCC_NOTE_CHUNK mmioFOURCC('n','o','t','e') +#define DMUS_FOURCC_CURVE_CHUNK mmioFOURCC('c','r','v','e') +#define DMUS_FOURCC_MARKER_CHUNK mmioFOURCC('m','r','k','r') +#define DMUS_FOURCC_RESOLUTION_CHUNK mmioFOURCC('r','s','l','n') +#define DMUS_FOURCC_ANTICIPATION_CHUNK mmioFOURCC('a','n','p','n') +#define DMUS_FOURCC_PATTERN_LIST mmioFOURCC('p','t','t','n') +#define DMUS_FOURCC_PATTERN_CHUNK mmioFOURCC('p','t','n','h') +#define DMUS_FOURCC_RHYTHM_CHUNK mmioFOURCC('r','h','t','m') +#define DMUS_FOURCC_PARTREF_LIST mmioFOURCC('p','r','e','f') +#define DMUS_FOURCC_PARTREF_CHUNK mmioFOURCC('p','r','f','c') +#define DMUS_FOURCC_STYLE_PERS_REF_LIST mmioFOURCC('p','r','r','f') +#define DMUS_FOURCC_MOTIFSETTINGS_CHUNK mmioFOURCC('m','t','f','s') + +/* Flags used by variations: these make up the DWORDs in dwVariationChoices. */ + +/* These flags determine the types of chords supported by a given variation in DirectMusic */ +/* mode. The first seven flags (bits 1-7) are set if the variation supports major chords */ +/* rooted in scale positions, so, e.g., if bits 1, 2, and 4 are set, the variation */ +/* supports major chords rooted in the tonic, second, and fourth scale positions. The */ +/* next seven flags serve the same purpose, but for minor chords, and the following seven */ +/* flags serve the same purpose for chords that are not major or minor (e.g., SUS 4 */ +/* chords). Bits 22, 23, and 24 are set if the variation supports chords rooted in the */ +/* scale, chords rooted sharp of scale tones, and chords rooted flat of scale tones, */ +/* respectively. For example, to support a C# minor chord in the scale of C Major, */ +/* bits 8 (for tonic minor) and 24 (for sharp) need to be set. Bits 25, 26, an 27 handle */ +/* chords that are triads, 6th or 7th chords, and chords with extensions, respectively. */ +/* bits 28 and 29 handle chords that are followed by tonic and dominant chords, */ +/* respectively. */ +#define DMUS_VARIATIONF_MAJOR 0x0000007F /* Seven positions in the scale - major chords. */ +#define DMUS_VARIATIONF_MINOR 0x00003F80 /* Seven positions in the scale - minor chords. */ +#define DMUS_VARIATIONF_OTHER 0x001FC000 /* Seven positions in the scale - other chords. */ +#define DMUS_VARIATIONF_ROOT_SCALE 0x00200000 /* Handles chord roots in the scale. */ +#define DMUS_VARIATIONF_ROOT_FLAT 0x00400000 /* Handles flat chord roots (based on scale notes). */ +#define DMUS_VARIATIONF_ROOT_SHARP 0x00800000 /* Handles sharp chord roots (based on scale notes). */ +#define DMUS_VARIATIONF_TYPE_TRIAD 0x01000000 /* Handles simple chords - triads. */ +#define DMUS_VARIATIONF_TYPE_6AND7 0x02000000 /* Handles simple chords - 6 and 7. */ +#define DMUS_VARIATIONF_TYPE_COMPLEX 0x04000000 /* Handles complex chords. */ +#define DMUS_VARIATIONF_DEST_TO1 0x08000000 /* Handles transitions to 1 chord. */ +#define DMUS_VARIATIONF_DEST_TO5 0x10000000 /* Handles transitions to 5 chord. */ +#define DMUS_VARIATIONF_DEST_OTHER 0x40000000 /* Handles transitions to chords other than 1 . */ + +/* legacy mask for variation modes */ +#define DMUS_VARIATIONF_MODES 0xE0000000 +/* Bits 29 and 31 of the variation flags are the Mode bits. If both are 0, it's IMA. */ +/* If bit 29 is 1, it's Direct Music. */ +#define DMUS_VARIATIONF_MODES_EX (0x20000000 | 0x80000000) +#define DMUS_VARIATIONF_IMA25_MODE 0x00000000 +#define DMUS_VARIATIONF_DMUS_MODE 0x20000000 + +/* Set this if the part uses marker events */ +#define DMUS_PARTF_USE_MARKERS 0x1 +/* Set this if the part is allowed to switch only on chord-aligned markers */ +#define DMUS_PARTF_ALIGN_CHORDS 0x2 + +/* These specify if the marker event signals whether to stop a variation or start a +pattern/variation (or both), and whether new variations must align with a chord */ +#define DMUS_MARKERF_START 0x1 +#define DMUS_MARKERF_STOP 0x2 +#define DMUS_MARKERF_CHORD_ALIGN 0x4 + +/* if this flag is set, variation settings in a playing pattern-based track's state data will +persist in the track after it stops playing */ +#define DMUS_PATTERNF_PERSIST_CONTROL 0x1 + +/* These specify possible values for DMUS_IO_PARTREF.bRandomVariation + all but DMUS_VARIATIONT_SEQUENTIAL and DMUS_VARIATIONT_RANDOM are DirectX8. */ +typedef enum enumDMUS_VARIATIONT_TYPES +{ + DMUS_VARIATIONT_SEQUENTIAL = 0, /* Play sequential starting with variation 1. */ + DMUS_VARIATIONT_RANDOM = 1, /* Play randomly. */ + DMUS_VARIATIONT_RANDOM_START = 2, /* Play sequential starting with a random variation. */ + DMUS_VARIATIONT_NO_REPEAT = 3, /* Play randomly, but don't play the same variation twice. */ + DMUS_VARIATIONT_RANDOM_ROW = 4 /* Play randomly as a row: don't repeat any variation until all have played. */ +} DMUS_VARIATIONT_TYPES; + +/* These specify possible values for DMUS_IO_PATTERN.wEmbellishment (DirectX8) */ +typedef enum enumDMUS_EMBELLISHT_TYPES +{ + DMUS_EMBELLISHT_NORMAL = 0, + DMUS_EMBELLISHT_FILL = 1, + DMUS_EMBELLISHT_BREAK = 2, + DMUS_EMBELLISHT_INTRO = 4, + DMUS_EMBELLISHT_END = 8, + DMUS_EMBELLISHT_MOTIF = 16, + DMUS_EMBELLISHT_ALL = 0xFFFF +} DMUS_EMBELLISHT_TYPES; + +#pragma pack(2) + +typedef struct _DMUS_IO_TIMESIG +{ + /* Time signatures define how many beats per measure, which note receives */ + /* the beat, and the grid resolution. */ + BYTE bBeatsPerMeasure; /* beats per measure (top of time sig) */ + BYTE bBeat; /* what note receives the beat (bottom of time sig.) */ + /* we can assume that 0 means 256th note */ + WORD wGridsPerBeat; /* grids per beat */ +} DMUS_IO_TIMESIG; + +typedef struct _DMUS_IO_STYLE +{ + DMUS_IO_TIMESIG timeSig; /* Styles have a default Time Signature */ + double dblTempo; +} DMUS_IO_STYLE; + +typedef struct _DMUS_IO_VERSION +{ + DWORD dwVersionMS; /* Version # high-order 32 bits */ + DWORD dwVersionLS; /* Version # low-order 32 bits */ +} DMUS_IO_VERSION; + +typedef struct _DMUS_IO_PATTERN +{ + DMUS_IO_TIMESIG timeSig; /* Patterns can override the Style's Time sig. */ + BYTE bGrooveBottom; /* bottom of groove range */ + BYTE bGrooveTop; /* top of groove range */ + WORD wEmbellishment; /* Fill, Break, Intro, End, Normal, Motif */ + WORD wNbrMeasures; /* length in measures */ + BYTE bDestGrooveBottom; /* bottom of groove range for next pattern */ + BYTE bDestGrooveTop; /* top of groove range for next pattern */ + DWORD dwFlags; /* various flags */ +} DMUS_IO_PATTERN; + +typedef struct _DMUS_IO_STYLEPART +{ + DMUS_IO_TIMESIG timeSig; /* can override pattern's */ + DWORD dwVariationChoices[32]; /* MOAW choice bitfield */ + GUID guidPartID; /* identifies the part */ + WORD wNbrMeasures; /* length of the Part */ + BYTE bPlayModeFlags; /* see PLAYMODE flags */ + BYTE bInvertUpper; /* inversion upper limit */ + BYTE bInvertLower; /* inversion lower limit */ + BYTE bPad[3]; /* for DWORD alignment */ + DWORD dwFlags; /* various flags */ +} DMUS_IO_STYLEPART; + +typedef struct _DMUS_IO_PARTREF +{ + GUID guidPartID; /* unique ID for matching up with parts */ + WORD wLogicalPartID; /* corresponds to port/device/midi channel OBSOLETE */ + BYTE bVariationLockID; /* parts with the same ID lock variations. */ + /* high bit is used to identify master Part */ + BYTE bSubChordLevel; /* tells which sub chord level this part wants */ + BYTE bPriority; /* 256 priority levels. Parts with lower priority */ + /* aren't played first when a device runs out of */ + /* notes */ + BYTE bRandomVariation; /* when set, matching variations play in random order */ + /* when clear, matching variations play sequentially */ + WORD wPad; /* not used */ + DWORD dwPChannel; /* replaces wLogicalPartID */ +} DMUS_IO_PARTREF; + +typedef struct _DMUS_IO_STYLENOTE +{ + MUSIC_TIME mtGridStart; /* when this note occurs */ + DWORD dwVariation; /* variation bits */ + MUSIC_TIME mtDuration; /* how long this note lasts */ + short nTimeOffset; /* offset from mtGridStart */ + WORD wMusicValue; /* Position in scale. */ + BYTE bVelocity; /* Note velocity. */ + BYTE bTimeRange; /* Range to randomize start time. */ + BYTE bDurRange; /* Range to randomize duration. */ + BYTE bVelRange; /* Range to randomize velocity. */ + BYTE bInversionID; /* Identifies inversion group to which this note belongs */ + BYTE bPlayModeFlags; /* Can override part */ + /* Following exists only under DirectX8 and on */ + BYTE bNoteFlags; /* values from DMUS_NOTEF_FLAGS */ +} DMUS_IO_STYLENOTE; + +typedef struct _DMUS_IO_STYLECURVE +{ + MUSIC_TIME mtGridStart; /* when this curve occurs */ + DWORD dwVariation; /* variation bits */ + MUSIC_TIME mtDuration; /* how long this curve lasts */ + MUSIC_TIME mtResetDuration;/* how long after the end of the curve to reset the curve */ + short nTimeOffset; /* offset from mtGridStart */ + short nStartValue; /* curve's start value */ + short nEndValue; /* curve's end value */ + short nResetValue; /* the value to which to reset the curve */ + BYTE bEventType; /* type of curve */ + BYTE bCurveShape; /* shape of curve */ + BYTE bCCData; /* CC# */ + BYTE bFlags; /* Bit 1=TRUE means to send nResetValue. Otherwise, don't. + Other bits are reserved. */ + /* Following was added for DirectX8. */ + WORD wParamType; /* RPN or NRPN parameter number. */ + WORD wMergeIndex; /* Allows multiple parameters to be merged (pitchbend, volume, and expression.) */ +} DMUS_IO_STYLECURVE; + +typedef struct _DMUS_IO_STYLEMARKER +{ + MUSIC_TIME mtGridStart; /* when this marker occurs */ + DWORD dwVariation; /* variation bits */ + WORD wMarkerFlags; /* how the marker is used */ +} DMUS_IO_STYLEMARKER; + +typedef struct _DMUS_IO_STYLERESOLUTION +{ + DWORD dwVariation; /* variation bits */ + WORD wMusicValue; /* Position in scale. */ + BYTE bInversionID; /* Identifies inversion group to which this note belongs */ + BYTE bPlayModeFlags; /* Can override part */ +} DMUS_IO_STYLERESOLUTION; + +typedef struct _DMUS_IO_STYLE_ANTICIPATION +{ + MUSIC_TIME mtGridStart; /* when this anticipation occurs */ + DWORD dwVariation; /* variation bits */ + short nTimeOffset; /* offset from mtGridStart */ + BYTE bTimeRange; /* Range to randomize start time. */ +} DMUS_IO_STYLE_ANTICIPATION; + +typedef struct _DMUS_IO_MOTIFSETTINGS +{ + DWORD dwRepeats; /* Number of repeats. By default, 0. */ + MUSIC_TIME mtPlayStart; /* Start of playback. By default, 0. */ + MUSIC_TIME mtLoopStart; /* Start of looping portion. By default, 0. */ + MUSIC_TIME mtLoopEnd; /* End of loop. Must be greater than mtLoopStart. Or, 0, indicating loop full motif. */ + DWORD dwResolution; /* Default resolution. */ +} DMUS_IO_MOTIFSETTINGS; + +#pragma pack() + + +/* +RIFF +( + 'DMST' // Style + // Style header chunk + // Every Style has a GUID + [] // Name, author, copyright info., comments + [] // version chunk + ... // Array of parts in the Style, used by patterns + ... // Array of patterns in the Style + ... // Array of bands in the Style + []...// Optional array of chord map references in the Style +) + + // + styh + ( + + ) + + // + guid + ( + + ) + + // + vers + ( + + ) + + // + LIST + ( + 'part' + // Part header chunk + [] // Name, author, copyright info., comments + [] // Optional chunk containing an array of notes in Part + [] // Optional chunk containing an array of curves in Part + [] // Optional chunk containing an array of markers in Part + [] // Optional chunk containing an array of variation resolutions in Part + [] // Optional chunk containing an array of resolution anticipations in Part + ) + + // + prth + ( + + ) + + // + 'note' + ( + // sizeof DMUS_IO_STYLENOTE:DWORD + ... + ) + + // + 'crve' + ( + // sizeof DMUS_IO_STYLECURVE:DWORD + ... + ) + + // + 'mrkr' + ( + // sizeof DMUS_IO_STYLEMARKER:DWORD + ... + ) + + // + 'rsln' + ( + // sizeof DMUS_IO_STYLERESOLUTION:DWORD + ... + ) + + // + 'anpn' + ( + // sizeof DMUS_IO_STYLE_ANTICIPATION:DWORD + ... + ) + + // + LIST + ( + 'pttn' + // Pattern header chunk + // Chunk containing an array of rhythms for chord matching + [] // Name, author, copyright info., comments + [] // Motif settings chunk + [] // Optional band to be associated with the pattern (for motifs) + ... // Array of part reference id's + ) + + // + ptnh + ( + + ) + + // + 'rhtm' + ( + // DWORD's representing rhythms for chord matching based on number + // of measures in the pattern + ) + + + // pref-list + LIST + ( + 'pref' + // part ref chunk + ) + + // + prfc + ( + + ) + + // + mtfs + ( + + ) + + // + LIST + ( + 'prrf' + ... // Array of Chordmap references + ) +*/ + +/* Pattern chunk, for use in Pattern tracks */ + +#define DMUS_FOURCC_PATTERN_FORM mmioFOURCC('D','M','P','T') + +/* +RIFF +( + 'DMPT' // Pattern + // Style header chunk + // The pattern, in single pattern format (includes DMUS_FOURCC_PART_LIST chunks) +) +*/ + + +/* Chord and command file formats */ + +/* These specify possible values for DMUS_IO_COMMAND.bRepeatMode (DirectX8) */ +typedef enum enumDMUS_PATTERNT_TYPES +{ + DMUS_PATTERNT_RANDOM = 0, /* Play randomly. (DirectX7 behavior) */ + DMUS_PATTERNT_REPEAT = 1, /* Repeat last pattern. */ + DMUS_PATTERNT_SEQUENTIAL = 2, /* Play sequential starting with first matching pattern. */ + DMUS_PATTERNT_RANDOM_START = 3, /* Play sequential starting with a random pattern. */ + DMUS_PATTERNT_NO_REPEAT = 4, /* Play randomly, but don't play the same pattern twice. */ + DMUS_PATTERNT_RANDOM_ROW = 5 /* Play randomly as a row: don't repeat any pattern until all have played. */ +} DMUS_PATTERNT_TYPES; + + +#define DMUS_FOURCC_CHORDTRACK_LIST mmioFOURCC('c','o','r','d') +#define DMUS_FOURCC_CHORDTRACKHEADER_CHUNK mmioFOURCC('c','r','d','h') +#define DMUS_FOURCC_CHORDTRACKBODY_CHUNK mmioFOURCC('c','r','d','b') + +#define DMUS_FOURCC_COMMANDTRACK_CHUNK mmioFOURCC('c','m','n','d') + +typedef struct _DMUS_IO_CHORD +{ + WCHAR wszName[16]; /* Name of the chord */ + MUSIC_TIME mtTime; /* Time of this chord */ + WORD wMeasure; /* Measure this falls on */ + BYTE bBeat; /* Beat this falls on */ + BYTE bFlags; /* Various flags */ +} DMUS_IO_CHORD; + +typedef struct _DMUS_IO_SUBCHORD +{ + DWORD dwChordPattern; /* Notes in the subchord */ + DWORD dwScalePattern; /* Notes in the scale */ + DWORD dwInversionPoints; /* Where inversions can occur */ + DWORD dwLevels; /* Which levels are supported by this subchord */ + BYTE bChordRoot; /* Root of the subchord */ + BYTE bScaleRoot; /* Root of the scale */ +} DMUS_IO_SUBCHORD; + +typedef struct _DMUS_IO_COMMAND +{ + MUSIC_TIME mtTime; /* Time of this command */ + WORD wMeasure; /* Measure this falls on */ + BYTE bBeat; /* Beat this falls on */ + BYTE bCommand; /* Command type (see #defines below) */ + BYTE bGrooveLevel; /* Groove level (0 if command is not a groove) */ + BYTE bGrooveRange; /* Groove range */ + BYTE bRepeatMode; /* Used to control selection of patterns with same groove level */ +} DMUS_IO_COMMAND; + + +/* + + // + LIST + ( + 'cord' + + ... // Chord body chunks + ) + + // + crdh + ( + // Scale: dword (upper 8 bits for root, lower 24 for scale) + ) + + // + crdb + ( + // sizeof DMUS_IO_CHORD:dword + + // # of DMUS_IO_SUBCHORDS:dword + // sizeof DMUS_IO_SUBCHORDS:dword + // a number of + ) + + + // + 'cmnd' + ( + //sizeof DMUS_IO_COMMAND: DWORD + ... + ) + +*/ + +/* File io for DirectMusic Tool and ToolGraph objects +*/ + +/* RIFF ids: */ + +#define DMUS_FOURCC_TOOLGRAPH_FORM mmioFOURCC('D','M','T','G') +#define DMUS_FOURCC_TOOL_LIST mmioFOURCC('t','o','l','l') +#define DMUS_FOURCC_TOOL_FORM mmioFOURCC('D','M','T','L') +#define DMUS_FOURCC_TOOL_CHUNK mmioFOURCC('t','o','l','h') + +/* io structures: */ + +typedef struct _DMUS_IO_TOOL_HEADER +{ + GUID guidClassID; /* Class id of tool. */ + long lIndex; /* Position in graph. */ + DWORD cPChannels; /* Number of items in channels array. */ + FOURCC ckid; /* chunk ID of tool's data chunk if 0 fccType valid. */ + FOURCC fccType; /* list type if NULL ckid valid. */ + DWORD dwPChannels[1]; /* Array of PChannels, size determined by cPChannels. */ +} DMUS_IO_TOOL_HEADER; + +/* +RIFF +( + 'DMTG' // DirectMusic ToolGraph chunk + [] // GUID for ToolGraph + [] // Optional version info + [] // Name, author, copyright info., comments + // List of Tools +) + + // + 'guid' + ( + + ) + + // + vers + ( + + ) + + // + LIST + ( + 'toll' // Array of tools + ... // Each tool is encapsulated in a RIFF chunk + ) + +// Tools are embedded in a graph. Theoretically, they can be saved as individual files too. +RIFF +( + 'DMTL' + + [] // Tool data. Must be a RIFF readable chunk. +) + + // // Tool header chunk + ( + 'tolh' + // Tool header + ) +*/ + +/* The AudioPath file carries everything for describing a specific audio path, + including Tool Graph and Buffer Descriptor. + This can even be used for configuring a complete performance. +*/ + +#define DMUS_FOURCC_AUDIOPATH_FORM mmioFOURCC('D','M','A','P') + +/* +RIFF +( + 'DMAP' // DirectMusic AudioPath chunk + [] // GUID for this Audio Path configuration + [] // Optional version info + [] // Name, author, copyright info., comments + [] // Optional ToolGraph + [] // Optional list of port configurations + []...// Optional array of DirectSound buffer descriptors +) +*/ + +#define DMUS_FOURCC_PORTCONFIGS_LIST mmioFOURCC('p','c','s','l') +#define DMUS_FOURCC_PORTCONFIG_LIST mmioFOURCC('p','c','f','l') +#define DMUS_FOURCC_PORTCONFIG_ITEM mmioFOURCC('p','c','f','h') +#define DMUS_FOURCC_PORTPARAMS_ITEM mmioFOURCC('p','p','r','h') +#define DMUS_FOURCC_DSBUFFER_LIST mmioFOURCC('d','b','f','l') +#define DMUS_FOURCC_DSBUFFATTR_ITEM mmioFOURCC('d','d','a','h') +#define DMUS_FOURCC_PCHANNELS_LIST mmioFOURCC('p','c','h','l') +#define DMUS_FOURCC_PCHANNELS_ITEM mmioFOURCC('p','c','h','h') + +typedef struct _DMUS_IO_PORTCONFIG_HEADER +{ + GUID guidPort; /* GUID of requested port. */ + DWORD dwPChannelBase; /* PChannel that this should start on. */ + DWORD dwPChannelCount; /* How many channels. */ + DWORD dwFlags; /* Various flags. */ +} DMUS_IO_PORTCONFIG_HEADER; + +#define DMUS_PORTCONFIGF_DRUMSON10 1 /* This port configured for drums on channel 10. */ +#define DMUS_PORTCONFIGF_USEDEFAULT 2 /* Use the default port. */ + +/* Each portconfig has one or more pchannel to buffer mappings. Each buffer + is identified by a guid. Each pchannel can map to one or more buffers. + This is defined with one or more DMUS_IO_PCHANNELTOBUFFER_HEADER + structures. Each defines a range of PChannels and the set of buffers + that they connect to. +*/ + +typedef struct _DMUS_IO_PCHANNELTOBUFFER_HEADER +{ + DWORD dwPChannelBase; /* PChannel that this should start on. */ + DWORD dwPChannelCount; /* How many PChannels. */ + DWORD dwBufferCount; /* How many buffers do these connect to. */ + DWORD dwFlags; /* Various flags. Currently reserved for future use. Must be 0. */ +} DMUS_IO_PCHANNELTOBUFFER_HEADER; + +/* Each buffer is represented by an DSBC form. This is wrapped by the + DMUS_IO_BUFFER_ATTRIBUTES_HEADER which identifies how to use the + buffer. In particular, it indicates whether this gets dynamically duplicated + or all references to this should share the same instance. + To resolve references, the unique GUID of the buffer is also stored + in this structure. +*/ + +typedef struct _DMUS_IO_BUFFER_ATTRIBUTES_HEADER +{ + GUID guidBufferID; /* Each buffer config has a unique ID. */ + DWORD dwFlags; /* Various flags. */ +} DMUS_IO_BUFFER_ATTRIBUTES_HEADER; + +/* DMUS_IO_BUFFER_ATTRIBUTES_HEADER.dwFlags: */ +#define DMUS_BUFFERF_SHARED 1 /* Share this with other audio paths, instead of creating unique copies. */ +#define DMUS_BUFFERF_DEFINED 2 /* Use one of the standard predefined buffers (see GUID_Buffer... in dmusici.h.) */ +#define DMUS_BUFFERF_MIXIN 8 /* This is a mixin buffer. */ + +/* + +LIST +( + 'pcsl' // Array of port configurations + ... // One or more port configurations, each in a list chunk +) + +LIST +( + 'pcfl' // List container for one port configuration. + // Portconfig header chunk. + // Port params, to be used to create the port. + []...// Optional array of DirectSound buffer descriptors + [] // Optional list of pchannel to buffer assignments + +) + + // // Port config header chunk + ( + 'pcfh' + // Port config header + ) + + // // Port params header chunk + ( + 'pprh' + // Port params header + ) + +LIST +( + 'pchl' // List container for one or more pchannel to buffer assignments. + ... // One or more pchannel to buffer assignment headers and data. + + // + ( + 'pchh' + // Description of PChannels + ... // Array of GUIDs defining the buffers they all connect to. + ) +) + +LIST +( + 'dbfl' // List container for one buffer and buffer attributes header. + // Buffer attributes header. + [] // Buffer configuration. Not required when header uses a predefined buffer type. + + // + ( + 'ddah' + // Buffer attributes. + ) +) +*/ + +/* File io for DirectMusic Band Track object */ + + +/* RIFF ids: */ +#define DMUS_FOURCC_BANDTRACK_FORM mmioFOURCC('D','M','B','T') +#define DMUS_FOURCC_BANDTRACK_CHUNK mmioFOURCC('b','d','t','h') +#define DMUS_FOURCC_BANDS_LIST mmioFOURCC('l','b','d','l') +#define DMUS_FOURCC_BAND_LIST mmioFOURCC('l','b','n','d') +#define DMUS_FOURCC_BANDITEM_CHUNK mmioFOURCC('b','d','i','h') +#define DMUS_FOURCC_BANDITEM_CHUNK2 mmioFOURCC('b','d','2','h') + +/* io structures */ +typedef struct _DMUS_IO_BAND_TRACK_HEADER +{ + BOOL bAutoDownload; /* Determines if Auto-Download is enabled. */ +} DMUS_IO_BAND_TRACK_HEADER; + +typedef struct _DMUS_IO_BAND_ITEM_HEADER +{ + MUSIC_TIME lBandTime; /* Position in track list. */ +} DMUS_IO_BAND_ITEM_HEADER; + +typedef struct _DMUS_IO_BAND_ITEM_HEADER2 +{ + MUSIC_TIME lBandTimeLogical; /* Position in track list. Time in the music with which band change is associated. */ + MUSIC_TIME lBandTimePhysical; /* Precise time band change will take effect. Should be close to logical time. */ +} DMUS_IO_BAND_ITEM_HEADER2; + +/* +RIFF +( + 'DMBT' // DirectMusic Band Track form-type + [] // Band track header + [] // GUID for band track + [] // Optional version info + [] // Name, author, copyright info., comments + // List of Band items +) + + // + 'bdth' + ( + + ) + + // + 'guid' + ( + + ) + + // + vers + ( + + ) + + // + LIST + ( + 'lbdl' + ... // Array of bands, each encapsulated in a list chunk + ) + + // + LIST + ( + 'lbnd' + or // bdih is a legacy format. bd2h is preferred for new content. + // Band + ) + + // or // band item header + ( + or // Band item header + ) +*/ + + +/* File io for DirectMusic Band object +*/ + +/* RIFF ids: */ + +#define DMUS_FOURCC_BAND_FORM mmioFOURCC('D','M','B','D') +#define DMUS_FOURCC_INSTRUMENTS_LIST mmioFOURCC('l','b','i','l') +#define DMUS_FOURCC_INSTRUMENT_LIST mmioFOURCC('l','b','i','n') +#define DMUS_FOURCC_INSTRUMENT_CHUNK mmioFOURCC('b','i','n','s') + +/* Flags for DMUS_IO_INSTRUMENT + */ +#define DMUS_IO_INST_PATCH (1 << 0) /* dwPatch is valid. */ +#define DMUS_IO_INST_BANKSELECT (1 << 1) /* dwPatch contains a valid Bank Select MSB and LSB part */ +#define DMUS_IO_INST_ASSIGN_PATCH (1 << 3) /* dwAssignPatch is valid */ +#define DMUS_IO_INST_NOTERANGES (1 << 4) /* dwNoteRanges is valid */ +#define DMUS_IO_INST_PAN (1 << 5) /* bPan is valid */ +#define DMUS_IO_INST_VOLUME (1 << 6 ) /* bVolume is valid */ +#define DMUS_IO_INST_TRANSPOSE (1 << 7) /* nTranspose is valid */ +#define DMUS_IO_INST_GM (1 << 8) /* Instrument is from GM collection */ +#define DMUS_IO_INST_GS (1 << 9) /* Instrument is from GS collection */ +#define DMUS_IO_INST_XG (1 << 10) /* Instrument is from XG collection */ +#define DMUS_IO_INST_CHANNEL_PRIORITY (1 << 11) /* dwChannelPriority is valid */ +#define DMUS_IO_INST_USE_DEFAULT_GM_SET (1 << 12) /* Always use the default GM set for this patch, */ + /* don't rely on the synth caps stating GM or GS in hardware. */ +#define DMUS_IO_INST_PITCHBENDRANGE (1 << 13) /* nPitchBendRange is valid */ + +/* io structures */ +typedef struct _DMUS_IO_INSTRUMENT +{ + DWORD dwPatch; /* MSB, LSB and Program change to define instrument */ + DWORD dwAssignPatch; /* MSB, LSB and Program change to assign to instrument when downloading */ + DWORD dwNoteRanges[4]; /* 128 bits; one for each MIDI note instrument needs to able to play */ + DWORD dwPChannel; /* PChannel instrument plays on */ + DWORD dwFlags; /* DMUS_IO_INST_ flags */ + BYTE bPan; /* Pan for instrument */ + BYTE bVolume; /* Volume for instrument */ + short nTranspose; /* Number of semitones to transpose notes */ + DWORD dwChannelPriority; /* Channel priority */ + short nPitchBendRange; /* Number of semitones shifted by pitch bend */ +} DMUS_IO_INSTRUMENT; + +/* +// bands can be embedded in other forms +RIFF +( + 'DMBD' // DirectMusic Band chunk + [] // GUID for band + [] // Optional version info + [] // Name, author, copyright info., comments + // List of Instruments +) + + // + 'guid' + ( + + ) + + // + vers + ( + + ) + + // + LIST + ( + 'lbil' // Array of instruments + ... // Each instrument is encapsulated in a list + ) + + // + LIST + ( + 'lbin' + + [] // Optional reference to DLS Collection file. + ) + + // // Instrument chunk + ( + 'bins' + // Instrument header + ) +*/ + +/* This RIFF id and io struct have been added to allow wave files (and the wave object) to + differentiate between streaming and one-shot waves, and to give a prefetch for streaming + waves */ + +#define DMUS_FOURCC_WAVEHEADER_CHUNK mmioFOURCC('w','a','v','h') + +typedef struct _DMUS_IO_WAVE_HEADER +{ + REFERENCE_TIME rtReadAhead; /* How far ahead in the stream wave data will be read (in REFERENCE_TIME). Ignored for one-shot waves. */ + DWORD dwFlags; /* Various flags, including whether this is a streaming wave and whether it can be invalidated. */ +} DMUS_IO_WAVE_HEADER; + + +/* File io for Wave track */ + +/* RIFF ids: */ + +#define DMUS_FOURCC_WAVETRACK_LIST mmioFOURCC('w','a','v','t') +#define DMUS_FOURCC_WAVETRACK_CHUNK mmioFOURCC('w','a','t','h') +#define DMUS_FOURCC_WAVEPART_LIST mmioFOURCC('w','a','v','p') +#define DMUS_FOURCC_WAVEPART_CHUNK mmioFOURCC('w','a','p','h') +#define DMUS_FOURCC_WAVEITEM_LIST mmioFOURCC('w','a','v','i') +#define DMUS_FOURCC_WAVE_LIST mmioFOURCC('w','a','v','e') +#define DMUS_FOURCC_WAVEITEM_CHUNK mmioFOURCC('w','a','i','h') + +/* This flag is included in DMUS_IO_WAVE_TRACK_HEADER.dwFlags. If set, the track will get its + variations from a pattern track, via GetParam(GUID_Variations). */ +#define DMUS_WAVETRACKF_SYNC_VAR 0x1 +/* This is also included in DMUS_IO_WAVE_TRACK_HEADER.dwFlags. If set, variation control + information will persist from one playback instance to the next.*/ +#define DMUS_WAVETRACKF_PERSIST_CONTROL 0x2 + +typedef struct _DMUS_IO_WAVE_TRACK_HEADER +{ + long lVolume; /* Gain, in 1/100th of dB, to be applied to all waves. Note: All gain values should be negative. */ + DWORD dwFlags; /* Flags, including whether this track syncs to a pattern track for its variations. */ +} DMUS_IO_WAVE_TRACK_HEADER; + +typedef struct _DMUS_IO_WAVE_PART_HEADER +{ + long lVolume; /* Gain, in 1/100th of dB, to be applied to all waves in wave part. Note: All gain values should be negative. */ + DWORD dwVariations; /* Variation mask for which of 32 variations */ + DWORD dwPChannel; /* PChannel */ + DWORD dwLockToPart; /* Part ID to lock to. */ + DWORD dwFlags; /* Flags, including stuff for managing how variations are chosen (in low-order nibble) */ + DWORD dwIndex; /* Index for distinguishing multiple parts on the same PChannel*/ +} DMUS_IO_WAVE_PART_HEADER; + +typedef struct _DMUS_IO_WAVE_ITEM_HEADER +{ + long lVolume; /* Gain, in 1/100th of dB. Note: All gain values should be negative. */ + long lPitch; /* Pitch offset in 1/100th of a semitone. */ + DWORD dwVariations; /* Variation flags for which of 32 variations this wave belongs to. */ + REFERENCE_TIME rtTime; /* Start time, in REFERENCE_TIME, if clock time track, or MUSIC_TIME for music time track. */ + REFERENCE_TIME rtStartOffset; /* Distance into wave to start playback, in reference time units. */ + REFERENCE_TIME rtReserved; /* Reserved field. */ + REFERENCE_TIME rtDuration; /* Duration, in REFERENCE_TIME or MUSIC_TIME, depending on track timing format. */ + MUSIC_TIME mtLogicalTime; /* If in music track format, this indicates the musical boundary where this belongs. Otherwise, ignored. */ + DWORD dwLoopStart; /* Start point for a looping wave. */ + DWORD dwLoopEnd; /* End point for a looping wave. */ + DWORD dwFlags; /* Various flags, including whether this is a streaming wave and whether it can be invalidated. */ + WORD wVolumeRange; /* Random range for volume. */ + WORD wPitchRange; /* Random range for pitch. */ +} DMUS_IO_WAVE_ITEM_HEADER; + +/* +LIST +{ + 'wavt' // Wave track chunk + // Wave track header + ... // Array of Wave Parts +} + // + 'wath' + { + + } + + // + LIST + { + 'wavp' + // Wave Part Header + // List of wave items + } + + // + 'waph' + { + + } + + // + LIST + { + 'wavi' + ... // Array of waves; each wave is encapsulated in a list + } + + // + LIST + { + 'wave' + // Wave item header + // Reference to wave object + } + + // + 'waih' + { + + } + +*/ + +/* File io for DirectMusic Container file. This embeds a set of related files. And, + in turn, it can be embedded within a segment or script file. +*/ + +#define DMUS_FOURCC_CONTAINER_FORM mmioFOURCC('D','M','C','N') +#define DMUS_FOURCC_CONTAINER_CHUNK mmioFOURCC('c','o','n','h') +#define DMUS_FOURCC_CONTAINED_ALIAS_CHUNK mmioFOURCC('c','o','b','a') +#define DMUS_FOURCC_CONTAINED_OBJECT_CHUNK mmioFOURCC('c','o','b','h') +#define DMUS_FOURCC_CONTAINED_OBJECTS_LIST mmioFOURCC('c','o','s','l') +#define DMUS_FOURCC_CONTAINED_OBJECT_LIST mmioFOURCC('c','o','b','l') + +typedef struct _DMUS_IO_CONTAINER_HEADER +{ + DWORD dwFlags; /* Flags. */ +} DMUS_IO_CONTAINER_HEADER; + +#define DMUS_CONTAINER_NOLOADS (1 << 1) /* Contained items are not loaded when the container is loaded. + Entries will be created in the loader (via SetObject) but + the actual objects will not be created until they are + specifically loaded at a later time. */ + +typedef struct _DMUS_IO_CONTAINED_OBJECT_HEADER +{ + GUID guidClassID; /* Class id of object. */ + DWORD dwFlags; /* Flags, for example DMUS_CONTAINED_OBJF_KEEP. */ + FOURCC ckid; /* chunk ID of track's data chunk if 0 fccType valid. */ + FOURCC fccType; /* list type if NULL ckid valid */ + /* Note that LIST:DMRF may be used for ckid and fccType in order to reference an + object instead of embedding it within the container. */ +} DMUS_IO_CONTAINED_OBJECT_HEADER; + +#define DMUS_CONTAINED_OBJF_KEEP 1 /* Keep the object cached in the loader after the container is released. */ + +/* +RIFF +( + 'DMCN' // DirectMusic Container chunk + // Container header chunk + [] // GUID for container + [] // Optional version info + [] // Name, author, copyright info., comments + // List of objects. +) + + // + 'conh' + ( + + ) + + // + 'guid' + ( + + ) + + // + vers + ( + + ) + + LIST + ( + 'cosl' // Array of embedded objects. + ... // Each object is encapsulated in a LIST chunk + ) + + // // Encapsulates one object + LIST + ( + 'cobl' + [] // Alias. An alternative name by which this object is known + // within the container. + // Required header, includes CLASS ID for object. + [] or // Object data of the type specified in . + // If DMRF, it is a reference of where to find the object. + // Otherwise, it could be any RIFF readable chunk in the + // exact same format as a file. The object will load + // itself from this data. + ) + + // + 'coba' + ( + // Alias, stored as NULL terminated string of WCHARs + ) + + // + 'cobh' + ( + + ) +*/ + +/* File io for DirectMusic Segment object */ + +/* RIFF ids: */ + +#define DMUS_FOURCC_SEGMENT_FORM mmioFOURCC('D','M','S','G') +#define DMUS_FOURCC_SEGMENT_CHUNK mmioFOURCC('s','e','g','h') +#define DMUS_FOURCC_TRACK_LIST mmioFOURCC('t','r','k','l') +#define DMUS_FOURCC_TRACK_FORM mmioFOURCC('D','M','T','K') +#define DMUS_FOURCC_TRACK_CHUNK mmioFOURCC('t','r','k','h') +#define DMUS_FOURCC_TRACK_EXTRAS_CHUNK mmioFOURCC('t','r','k','x') + +/* io structures:*/ + +typedef struct _DMUS_IO_SEGMENT_HEADER +{ + DWORD dwRepeats; /* Number of repeats. By default, 0. */ + MUSIC_TIME mtLength; /* Length, in music time. */ + MUSIC_TIME mtPlayStart; /* Start of playback. By default, 0. */ + MUSIC_TIME mtLoopStart; /* Start of looping portion. By default, 0. */ + MUSIC_TIME mtLoopEnd; /* End of loop. Must be greater than dwPlayStart. Or, 0, indicating loop full segment. */ + DWORD dwResolution; /* Default resolution. */ + /* Following added for DirectX8: */ + REFERENCE_TIME rtLength; /* Length, in reference time (overrides music time length.) */ + DWORD dwFlags; + DWORD dwReserved; /* Reserved. */ + /* Added for DirectX9: */ + REFERENCE_TIME rtLoopStart; /* Clock time loop start. */ + REFERENCE_TIME rtLoopEnd; /* Clock time loop end. */ + REFERENCE_TIME rtPlayStart; /* Start of playback in clock time. */ +} DMUS_IO_SEGMENT_HEADER; + +#define DMUS_SEGIOF_REFLENGTH 1 /* Use the time in rtLength for the segment length. */ +#define DMUS_SEGIOF_CLOCKTIME 2 /* This is a clock time segment. */ + +typedef struct _DMUS_IO_TRACK_HEADER +{ + GUID guidClassID; /* Class id of track. */ + DWORD dwPosition; /* Position in track list. */ + DWORD dwGroup; /* Group bits for track. */ + FOURCC ckid; /* chunk ID of track's data chunk. */ + FOURCC fccType; /* list type if ckid is RIFF or LIST */ +} DMUS_IO_TRACK_HEADER; + +/* Additional parameters for the track header chunk, introduced in DirectX8 and + on, are stored in a separate chunk. */ + +typedef struct _DMUS_IO_TRACK_EXTRAS_HEADER +{ + DWORD dwFlags; /* DirectX8 Added flags for control tracks. */ + DWORD dwPriority; /* Priority for composition. */ +} DMUS_IO_TRACK_EXTRAS_HEADER; + +/* +RIFF +( + 'DMSG' // DirectMusic Segment chunk + // Segment header chunk + [] // GUID for segment + [] // Optional version info + [] // Name, author, copyright info., comments + [] // Optional container of objects embedded in file. Must precede tracklist. + // List of Tracks + [] // Optional ToolGraph + [] // Optional Audio Path +) + + // + 'segh' + ( + + ) + + // + 'guid' + ( + + ) + + // + vers + ( + + ) + + // + LIST + ( + 'trkl' // Array of tracks + ... // Each track is encapsulated in a RIFF chunk + ) + + // // Tracks can be embedded in a segment or stored as separate files. + RIFF + ( + 'DMTK' + + [] // Optional track flags. + [] // Optional GUID for track object instance (not to be confused with Class id in track header) + [] // Optional version info + [] // Optional name, author, copyright info., comments + [] // Track data. Must be a RIFF readable chunk. + ) + + // // Track header chunk + ( + 'trkh' + // Track header + ) + + // // Track flags chunk + ( + 'trkx' + // DirectX8 Track flags header + ) +*/ + +/* File io for DirectMusic reference chunk. + This is used to embed a reference to an object. +*/ + +/* RIFF ids: */ + +#define DMUS_FOURCC_REF_LIST mmioFOURCC('D','M','R','F') +#define DMUS_FOURCC_REF_CHUNK mmioFOURCC('r','e','f','h') +#define DMUS_FOURCC_DATE_CHUNK mmioFOURCC('d','a','t','e') +#define DMUS_FOURCC_NAME_CHUNK mmioFOURCC('n','a','m','e') +#define DMUS_FOURCC_FILE_CHUNK mmioFOURCC('f','i','l','e') + +typedef struct _DMUS_IO_REFERENCE +{ + GUID guidClassID; /* Class id is always required. */ + DWORD dwValidData; /* Flags. */ +} DMUS_IO_REFERENCE; + +/* +LIST +( + 'DMRF' // DirectMusic Reference chunk + // Reference header chunk + [] // Optional object GUID. + [] // Optional file date. + [] // Optional name. + [] // Optional file name. + [] // Optional category name. + [] // Optional version info. +) + + // + 'refh' + ( + + ) + + // + 'guid' + ( + + ) + + // + date + ( + + ) + + // + name + ( + // Name, stored as NULL terminated string of WCHARs + ) + + // + file + ( + // File name, stored as NULL terminated string of WCHARs + ) + + // + catg + ( + // Category name, stored as NULL terminated string of WCHARs + ) + + // + vers + ( + + ) +*/ + +/* Chord Maps */ + +/* runtime chunks */ +#define DMUS_FOURCC_CHORDMAP_FORM mmioFOURCC('D','M','P','R') +#define DMUS_FOURCC_IOCHORDMAP_CHUNK mmioFOURCC('p','e','r','h') +#define DMUS_FOURCC_SUBCHORD_CHUNK mmioFOURCC('c','h','d','t') +#define DMUS_FOURCC_CHORDENTRY_CHUNK mmioFOURCC('c','h','e','h') +#define DMUS_FOURCC_SUBCHORDID_CHUNK mmioFOURCC('s','b','c','n') +#define DMUS_FOURCC_IONEXTCHORD_CHUNK mmioFOURCC('n','c','r','d') +#define DMUS_FOURCC_NEXTCHORDSEQ_CHUNK mmioFOURCC('n','c','s','q') +#define DMUS_FOURCC_IOSIGNPOST_CHUNK mmioFOURCC('s','p','s','h') +#define DMUS_FOURCC_CHORDNAME_CHUNK mmioFOURCC('I','N','A','M') + +/* runtime list chunks */ +#define DMUS_FOURCC_CHORDENTRY_LIST mmioFOURCC('c','h','o','e') +#define DMUS_FOURCC_CHORDMAP_LIST mmioFOURCC('c','m','a','p') +#define DMUS_FOURCC_CHORD_LIST mmioFOURCC('c','h','r','d') +#define DMUS_FOURCC_CHORDPALETTE_LIST mmioFOURCC('c','h','p','l') +#define DMUS_FOURCC_CADENCE_LIST mmioFOURCC('c','a','d','e') +#define DMUS_FOURCC_SIGNPOSTITEM_LIST mmioFOURCC('s','p','s','t') + +#define DMUS_FOURCC_SIGNPOST_LIST mmioFOURCC('s','p','s','q') + +/* values for dwChord field of DMUS_IO_PERS_SIGNPOST */ +/* DMUS_SIGNPOSTF_ flags are also used in templates (DMUS_IO_SIGNPOST) */ +#define DMUS_SIGNPOSTF_A 1 +#define DMUS_SIGNPOSTF_B 2 +#define DMUS_SIGNPOSTF_C 4 +#define DMUS_SIGNPOSTF_D 8 +#define DMUS_SIGNPOSTF_E 0x10 +#define DMUS_SIGNPOSTF_F 0x20 +#define DMUS_SIGNPOSTF_LETTER (DMUS_SIGNPOSTF_A | DMUS_SIGNPOSTF_B | DMUS_SIGNPOSTF_C | DMUS_SIGNPOSTF_D | DMUS_SIGNPOSTF_E | DMUS_SIGNPOSTF_F) +#define DMUS_SIGNPOSTF_1 0x100 +#define DMUS_SIGNPOSTF_2 0x200 +#define DMUS_SIGNPOSTF_3 0x400 +#define DMUS_SIGNPOSTF_4 0x800 +#define DMUS_SIGNPOSTF_5 0x1000 +#define DMUS_SIGNPOSTF_6 0x2000 +#define DMUS_SIGNPOSTF_7 0x4000 +#define DMUS_SIGNPOSTF_ROOT (DMUS_SIGNPOSTF_1 | DMUS_SIGNPOSTF_2 | DMUS_SIGNPOSTF_3 | DMUS_SIGNPOSTF_4 | DMUS_SIGNPOSTF_5 | DMUS_SIGNPOSTF_6 | DMUS_SIGNPOSTF_7) +#define DMUS_SIGNPOSTF_CADENCE 0x8000 + +/* values for dwFlags field of DMUS_IO_CHORDMAP */ +#define DMUS_CHORDMAPF_VERSION8 1 /* Chordmap is version 8 or above. */ + +/* values for dwChord field of DMUS_IO_PERS_SIGNPOST */ +#define DMUS_SPOSTCADENCEF_1 2 /* Use the first cadence chord. */ +#define DMUS_SPOSTCADENCEF_2 4 /* Use the second cadence chord. */ + +/* run time data structs */ +typedef struct _DMUS_IO_CHORDMAP +{ + WCHAR wszLoadName[20]; + DWORD dwScalePattern; + DWORD dwFlags; /* Various flags. Only lower 16 bits are significant. */ +} DMUS_IO_CHORDMAP; + +typedef struct _DMUS_IO_CHORDMAP_SUBCHORD +{ + DWORD dwChordPattern; + DWORD dwScalePattern; + DWORD dwInvertPattern; + BYTE bChordRoot; + BYTE bScaleRoot; + WORD wCFlags; + DWORD dwLevels; /* parts or which subchord levels this chord supports */ +} DMUS_IO_CHORDMAP_SUBCHORD; + +/* Legacy name... */ +typedef DMUS_IO_CHORDMAP_SUBCHORD DMUS_IO_PERS_SUBCHORD; + +typedef struct _DMUS_IO_CHORDENTRY +{ + DWORD dwFlags; + WORD wConnectionID; /* replaces runtime "pointer to this" */ +} DMUS_IO_CHORDENTRY; + +typedef struct _DMUS_IO_NEXTCHORD +{ + DWORD dwFlags; + WORD nWeight; + WORD wMinBeats; + WORD wMaxBeats; + WORD wConnectionID; /* points to an ioChordEntry */ +} DMUS_IO_NEXTCHORD; + +typedef struct _DMUS_IO_CHORDMAP_SIGNPOST +{ + DWORD dwChords; /* 1bit per group */ + DWORD dwFlags; +} DMUS_IO_CHORDMAP_SIGNPOST; + +/* Legacy name... */ +typedef DMUS_IO_CHORDMAP_SIGNPOST DMUS_IO_PERS_SIGNPOST; + +/* +RIFF +( + 'DMPR' + // Chord map header chunk + [] // guid chunk + [] // version chunk (two DWORDS) + [] // Unfo chunk + // subchord database + // chord palette + // chord map + // signpost list + ) + + ::= LIST('cmap' ) + + ::= LIST('choe' + // chord entry data + // chord definition + // connecting(next) chords + ) + + ::= LIST('chrd' + // name of chord in wide char format + // list of subchords composing chord + ) + + ::= LIST('chpl' + ... // chord definition + ) + + ::== LIST('spsq' ... ) + + ::= LIST('spst' + + + [] + ) + + ::= LIST('cade' ...) + + ::= perh() + + ::= chdt( + ... ) + + ::= cheh() + + ::= sbcn( ...) + + ::= ncsq( + ...) + + ::= spsh() + +*/ + +/* File io for DirectMusic Script object */ + +/* RIFF ids: */ + +#define DMUS_FOURCC_SCRIPT_FORM mmioFOURCC('D','M','S','C') +#define DMUS_FOURCC_SCRIPT_CHUNK mmioFOURCC('s','c','h','d') +#define DMUS_FOURCC_SCRIPTVERSION_CHUNK mmioFOURCC('s','c','v','e') +#define DMUS_FOURCC_SCRIPTLANGUAGE_CHUNK mmioFOURCC('s','c','l','a') +#define DMUS_FOURCC_SCRIPTSOURCE_CHUNK mmioFOURCC('s','c','s','r') + +/* io structures:*/ + +typedef struct _DMUS_IO_SCRIPT_HEADER +{ + DWORD dwFlags; /* DMUS_SCRIPTIOF_ flags */ +} DMUS_IO_SCRIPT_HEADER; + +#define DMUS_SCRIPTIOF_LOAD_ALL_CONTENT (1 << 0) + /* If set, when the script loads it will also load all the content in its container. */ +#define DMUS_SCRIPTIOF_DOWNLOAD_ALL_SEGMENTS (1 << 1) + /* If set and LOAD_ALL_CONTENT is also set, when the script initializes it will also download all the segments in its container. + If set and LOAD_ALL_CONTENT is not set, when the script calls segment.Load on a segment then the segment will also be downloaded. + If not set, the script must manually download and unload by calling segment.DownloadSoundData and segment.UnloadSoundData. */ + +/* +RIFF +( + 'DMSC' // DirectMusic Script chunk + // Script header chunk + [] // GUID for script + [] // Optional version info + [] // Name, author, copyright info., comments + // Version of DirectMusic this script was authored to run against + // Container of content referenced by the script. + // ActiveX scripting language in which the script is written + or // The script's source code. + // If scsr-ck, the source is embedding in the chunk. + // If DMRF, it is a reference of where to find a text file with the source. + // Class id (guidClassID in DMUS_IO_REFERENCE) must be GUID_NULL because + // this text file is not a DirectMusic object in its own right. +) + + // + 'schd' + ( + + ) + + // + 'guid' + ( + + ) + + // + vers + ( + + ) + + // + scve + ( + + ) + + 'scla' + ( + // Language name, stored as NULL terminated string of WCHARs + ) + + 'scsr' + ( + // Source code, stored as NULL terminated string of WCHARs + ) +*/ + +/* Signpost tracks */ + +#define DMUS_FOURCC_SIGNPOST_TRACK_CHUNK mmioFOURCC( 's', 'g', 'n', 'p' ) + + +typedef struct _DMUS_IO_SIGNPOST +{ + MUSIC_TIME mtTime; + DWORD dwChords; + WORD wMeasure; +} DMUS_IO_SIGNPOST; + +/* + + // + 'sgnp' + ( + //sizeof DMUS_IO_SIGNPOST: DWORD + ... + ) + +*/ + +#define DMUS_FOURCC_MUTE_CHUNK mmioFOURCC('m','u','t','e') + +typedef struct _DMUS_IO_MUTE +{ + MUSIC_TIME mtTime; + DWORD dwPChannel; + DWORD dwPChannelMap; +} DMUS_IO_MUTE; + +/* + + // + 'mute' + ( + //sizeof DMUS_IO_MUTE:DWORD + ... + ) + + +*/ + +/* Used for both style and chord map tracks */ + +#define DMUS_FOURCC_TIME_STAMP_CHUNK mmioFOURCC('s', 't', 'm', 'p') + +/* Style tracks */ + +#define DMUS_FOURCC_STYLE_TRACK_LIST mmioFOURCC('s', 't', 't', 'r') +#define DMUS_FOURCC_STYLE_REF_LIST mmioFOURCC('s', 't', 'r', 'f') + +/* + + // + LIST('sttr' + ( + ... // Array of Style references + ) + + // + LIST('strf' + ( + + + ) + + // + 'stmp' + ( + // time:DWORD + ) + +*/ + +/* Chord map tracks */ + +#define DMUS_FOURCC_PERS_TRACK_LIST mmioFOURCC('p', 'f', 't', 'r') +#define DMUS_FOURCC_PERS_REF_LIST mmioFOURCC('p', 'f', 'r', 'f') + +/* + + // + LIST('pftr' + ( + ... // Array of Chord map references + ) + + // + LIST('pfrf' + ( + + + ) + + // + 'stmp' + ( + // time:DWORD + ) + +*/ + +#define DMUS_FOURCC_TEMPO_TRACK mmioFOURCC('t','e','t','r') + +/* + // tempo array + 'tetr' + ( + // sizeof DMUS_IO_TEMPO_ITEM: DWORD + ... + ) + */ + +#define DMUS_FOURCC_SEQ_TRACK mmioFOURCC('s','e','q','t') +#define DMUS_FOURCC_SEQ_LIST mmioFOURCC('e','v','t','l') +#define DMUS_FOURCC_CURVE_LIST mmioFOURCC('c','u','r','l') + +/* + // sequence track + 'seqt' + ( + // sequence array + 'evtl' + ( + // sizeof DMUS_IO_SEQ_ITEM: DWORD + ... + ) + // curve array + 'curl' + ( + // sizeof DMUS_IO_CURVE_ITEM: DWORD + ... + ) + ) +*/ + +#define DMUS_FOURCC_SYSEX_TRACK mmioFOURCC('s','y','e','x') + +/* + // sysex track + 'syex' + ( + { + + ... // Array of bytes, length defined in the DMUS_IO_SYSEXITEM structure + }... + ) +*/ + +#define DMUS_FOURCC_TIMESIGNATURE_TRACK mmioFOURCC('t','i','m','s') + +typedef struct _DMUS_IO_TIMESIGNATURE_ITEM +{ + MUSIC_TIME lTime; + BYTE bBeatsPerMeasure; /* beats per measure (top of time sig) */ + BYTE bBeat; /* what note receives the beat (bottom of time sig.) */ + /* we can assume that 0 means 256th note */ + WORD wGridsPerBeat; /* grids per beat */ +} DMUS_IO_TIMESIGNATURE_ITEM; + +/* DirectX6 time signature track + + 'tims' + ( + // size of DMUS_IO_TIMESIGNATURE_ITEM : DWORD + ... + ) +*/ + +/* DirectX8 Time signature track. The track has been updated from DirectX7 to support a list of + RIFF chunks. This will allow the time signature track to expand in the future. +*/ + +#define DMUS_FOURCC_TIMESIGTRACK_LIST mmioFOURCC('T','I','M','S') +#define DMUS_FOURCC_TIMESIG_CHUNK DMUS_FOURCC_TIMESIGNATURE_TRACK + +/* +LIST +( + 'TIMS' // Time Signature Track list-type + // Chunk containing an array of time signatures +) + + 'tims' + ( + // size of DMUS_IO_TIMESIGNATURE_ITEM : DWORD + ... + ) + +*/ + +/* DirectX8 Marker track. This is used to store valid start points and other + flow control parameters that may come later. For example, if we want + to implement more sophisticated looping and branching constructs, they + would live in this track. +*/ + +#define DMUS_FOURCC_MARKERTRACK_LIST mmioFOURCC('M','A','R','K') +#define DMUS_FOURCC_VALIDSTART_CHUNK mmioFOURCC('v','a','l','s') +#define DMUS_FOURCC_PLAYMARKER_CHUNK mmioFOURCC('p','l','a','y') + +/* io structures */ +typedef struct _DMUS_IO_VALID_START +{ + MUSIC_TIME mtTime; /* Time of a legal start. */ +} DMUS_IO_VALID_START; + +typedef struct _DMUS_IO_PLAY_MARKER +{ + MUSIC_TIME mtTime; /* Time of a next legal play point marker. */ +} DMUS_IO_PLAY_MARKER; + +/* +LIST +( + 'MARK' // Marker Track list-type + [] // Chunk containing an array of start points + [] // Chunk containing an array of play start markers +) + + 'vals' + ( + // size of DMUS_IO_VALID_START : DWORD + ... + ) + + 'play' + ( + // size of DMUS_IO_PLAY_MARKER : DWORD + ... + ) + +*/ + +/* segment trigger tracks */ + +/* RIFF ids: */ +#define DMUS_FOURCC_SEGTRACK_LIST mmioFOURCC('s','e','g','t') +#define DMUS_FOURCC_SEGTRACK_CHUNK mmioFOURCC('s','g','t','h') +#define DMUS_FOURCC_SEGMENTS_LIST mmioFOURCC('l','s','g','l') +#define DMUS_FOURCC_SEGMENT_LIST mmioFOURCC('l','s','e','g') +#define DMUS_FOURCC_SEGMENTITEM_CHUNK mmioFOURCC('s','g','i','h') +#define DMUS_FOURCC_SEGMENTITEMNAME_CHUNK mmioFOURCC('s','n','a','m') + +/* io structures */ +typedef struct _DMUS_IO_SEGMENT_TRACK_HEADER +{ + DWORD dwFlags; /* Reserved leave as 0. */ +} DMUS_IO_SEGMENT_TRACK_HEADER; + +typedef struct _DMUS_IO_SEGMENT_ITEM_HEADER +{ + MUSIC_TIME lTimeLogical; /* Position in track list. Time in the music with which the event is associated. */ + MUSIC_TIME lTimePhysical; /* Precise time event will be triggered. Should be close to logical time. */ + DWORD dwPlayFlags; /* Flags for PlaySegment(). */ + DWORD dwFlags; /* Flags. */ +} DMUS_IO_SEGMENT_ITEM_HEADER; + +/* values for dwflags field of DMUS_IO_SEGMENT_ITEM_HEADER */ +#define DMUS_SEGMENTTRACKF_MOTIF 1 /* interpret DMRF as link to style, and use snam as the name of a motif within the style */ + +/* +LIST +( + 'segt' // DirectMusic Segment Trigger Track form-type + [] // Segment track header + // List of Segment Lists +) + + // + 'sgth' + ( + + ) + + // + LIST + ( + 'lsgl' // Array of segments + ... // Each segment is encapsulated in a list (that way it can still be riff parsed.) + ) + + // + LIST + ( + 'lseg' + + // Link to a segment or style file. + [] // Name field. Used with DMUS_SEGMENTTRACKF_MOTIF flag. + ) + + // // segment item header + ( + // Segment item header + ) + + // + ( + // Name, stored as NULL terminated string of WCHARs + ) +*/ + +/* Script track. */ + +/* RIFF ids: */ +#define DMUS_FOURCC_SCRIPTTRACK_LIST mmioFOURCC('s','c','r','t') +#define DMUS_FOURCC_SCRIPTTRACKEVENTS_LIST mmioFOURCC('s','c','r','l') +#define DMUS_FOURCC_SCRIPTTRACKEVENT_LIST mmioFOURCC('s','c','r','e') +#define DMUS_FOURCC_SCRIPTTRACKEVENTHEADER_CHUNK mmioFOURCC('s','c','r','h') +#define DMUS_FOURCC_SCRIPTTRACKEVENTNAME_CHUNK mmioFOURCC('s','c','r','n') + +/* Flags for DMUS_IO_SCRIPTTRACK_TIMING + */ +#define DMUS_IO_SCRIPTTRACKF_PREPARE (1 << 0) /* Fire event in advance of time stamp, at Prepare time. This is the default because it leaves the script time to change the music happening at the target time. */ +#define DMUS_IO_SCRIPTTRACKF_QUEUE (1 << 1) /* Fire event just before time stamp, at Queue time. */ +#define DMUS_IO_SCRIPTTRACKF_ATTIME (1 << 2) /* Fire event right at the time stamp. */ + +typedef struct _DMUS_IO_SCRIPTTRACK_EVENTHEADER +{ + DWORD dwFlags; /* various bits (see DMUS_IO_SCRIPTTRACKF_*) */ + MUSIC_TIME lTimeLogical; /* Position in track list. Time in the music with which the event is associated. */ + MUSIC_TIME lTimePhysical; /* Precise time event will be triggered. Should be close to logical time. */ +} DMUS_IO_SCRIPTTRACK_EVENTHEADER; + +/* + // Script Track + + // + LIST + ( + // List of script events + ) + + // + LIST + ( + ... // Array of event descriptions + ) + + // + LIST + ( + // Event header chunk + + // Routine name + ) + + 'scrh' + ( + + ) + + 'scrn' + ( + // Name, stored as NULL terminated string of WCHARs + ) +*/ + +/* Lyrics/Notification track. */ + +/* RIFF ids: */ +#define DMUS_FOURCC_LYRICSTRACK_LIST mmioFOURCC('l','y','r','t') +#define DMUS_FOURCC_LYRICSTRACKEVENTS_LIST mmioFOURCC('l','y','r','l') +#define DMUS_FOURCC_LYRICSTRACKEVENT_LIST mmioFOURCC('l','y','r','e') +#define DMUS_FOURCC_LYRICSTRACKEVENTHEADER_CHUNK mmioFOURCC('l','y','r','h') +#define DMUS_FOURCC_LYRICSTRACKEVENTTEXT_CHUNK mmioFOURCC('l','y','r','n') + +typedef struct _DMUS_IO_LYRICSTRACK_EVENTHEADER +{ + DWORD dwFlags; /* Reserved leave as 0. */ + DWORD dwTimingFlags; /* Combination DMUS_PMSGF_TOOL_* flags. Determines the precise timing of when the notification happens. Invalid with the flag DMUS_PMSGF_REFTIME, DMUS_PMSGF_MUSICTIME, DMUS_PMSGF_TOOL_FLUSH, or DMUS_PMSGF_LOCKTOREFTIME. */ + MUSIC_TIME lTimeLogical; /* Position in track list. Time in the music with which the event is associated. */ + MUSIC_TIME lTimePhysical; /* Precise time event will be triggered. Should be close to logical time. */ +} DMUS_IO_LYRICSTRACK_EVENTHEADER; + +/* + // Lyrics/Notification Track + + // + LIST + ( + // List of notification events + ) + + // + LIST + ( + ... // Array of event descriptions + ) + + // + LIST + ( + // Event header chunk + // Notification text + ) + + 'lyrh' + ( + + ) + + 'lyrn' + ( + // Name, stored as NULL terminated string of WCHARs + ) +*/ + +/* Parameter control track */ + +/* RIFF ids: */ +#define DMUS_FOURCC_PARAMCONTROLTRACK_TRACK_LIST mmioFOURCC('p','r','m','t') +#define DMUS_FOURCC_PARAMCONTROLTRACK_OBJECT_LIST mmioFOURCC('p','r','o','l') +#define DMUS_FOURCC_PARAMCONTROLTRACK_OBJECT_CHUNK mmioFOURCC('p','r','o','h') +#define DMUS_FOURCC_PARAMCONTROLTRACK_PARAM_LIST mmioFOURCC('p','r','p','l') +#define DMUS_FOURCC_PARAMCONTROLTRACK_PARAM_CHUNK mmioFOURCC('p','r','p','h') +#define DMUS_FOURCC_PARAMCONTROLTRACK_CURVES_CHUNK mmioFOURCC('p','r','c','c') + +typedef struct _DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER +{ + DWORD dwFlags; /* Reserved. Must be zero. */ + GUID guidTimeFormat; /* Time format to set the object to. Must be GUID_TIME_REFERNCE or GUID_TIME_MUSIC from medparam.h. */ + /* Path for finding the object. These fields correspond to the first five parameters of IDirectMusicSegmentState::GetObjectInPath. */ + DWORD dwPChannel; + DWORD dwStage; + DWORD dwBuffer; + GUID guidObject; + DWORD dwIndex; +} DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER; + +typedef struct _DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER +{ + DWORD dwFlags; /* Reserved. Must be zero. */ + DWORD dwIndex; /* Index number of the parameter on the object */ +} DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER; + +typedef struct _DMUS_IO_PARAMCONTROLTRACK_CURVEINFO +{ + MUSIC_TIME mtStartTime; + MUSIC_TIME mtEndTime; + float fltStartValue; + float fltEndValue; + DWORD dwCurveType; /* One of the items from the MP_CURVE_TYPE enum in medparam.h */ + DWORD dwFlags; /* A combination of the MPF_ENVLP_* constants in medparam.h */ +} DMUS_IO_PARAMCONTROLTRACK_CURVEINFO; + +/* + // + LIST + ( + ... // one for each object + ) + + // + LIST + ( + // object header chunk + ... // one for each parameter + ) + + // + proh + ( + + ) + + // + LIST + ( + // parameter header chunk + // chunk containing an array of curves + ) + + // + prph + ( + + ) + + // + prcc + ( + // sizeof DMUS_IO_PARAMCONTROLTRACK_CURVEINFO:DWORD + ... // curves, sorted in order of mtTime + ) +*/ + +#if (DIRECTSOUND_VERSION >= 0x0800) + +/* DirectSoundBufferConfig FX Map */ + +/* RIFF ids: */ + +#define DMUS_FOURCC_DSBC_FORM mmioFOURCC('D','S','B','C') +#define DMUS_FOURCC_DSBD_CHUNK mmioFOURCC('d','s','b','d') +#define DMUS_FOURCC_BSID_CHUNK mmioFOURCC('b','s','i','d') +#define DMUS_FOURCC_DS3D_CHUNK mmioFOURCC('d','s','3','d') +#define DMUS_FOURCC_DSBC_LIST mmioFOURCC('f','x','l','s') +#define DMUS_FOURCC_DSFX_FORM mmioFOURCC('D','S','F','X') +#define DMUS_FOURCC_DSFX_CHUNK mmioFOURCC('f','x','h','r') +#define DMUS_FOURCC_DSFX_DATA mmioFOURCC('d','a','t','a') + +/* io structures */ + +typedef struct _DSOUND_IO_DSBUFFERDESC +{ + DWORD dwFlags; /* DirectSound buffer creation flags */ + WORD nChannels; /* No. of channels (rest of buffer format is determined by owning sink) */ + LONG lVolume; /* Initial pan; only used if CTRLVOLUME is specified */ + LONG lPan; /* Initial pan; only used if CTRLPAN is specified */ + DWORD dwReserved; /* Reserved - must be 0 */ +} DSOUND_IO_DSBUFFERDESC; + +typedef struct _DSOUND_IO_DSBUSID +{ + DWORD busid[1]; /* Array size determined from chunk size */ +} DSOUND_IO_DSBUSID; + +typedef struct _DSOUND_IO_3D +{ + GUID guid3DAlgorithm; /* GUID identifying the 3D algorithm to use (defined in dsound.h) */ + DS3DBUFFER ds3d; /* Initial 3D parameters */ +} DSOUND_IO_3D; + +typedef struct _DSOUND_IO_DXDMO_HEADER +{ + DWORD dwEffectFlags; /* Effect creation flags - equivalent to DSEFFECTDESC::dwFlags */ + GUID guidDSFXClass; /* GUID identifying the effect to use - corresponds to a COM CLSID */ + GUID guidReserved; /* Reserved - must be the null GUID */ + GUID guidSendBuffer; /* GUID identifying the buffer to send to if this is a send effect */ + DWORD dwReserved; /* Reserved - must be 0 */ +} DSOUND_IO_DXDMO_HEADER; + +typedef struct _DSOUND_IO_DXDMO_DATA +{ + DWORD data[1]; /* Array size determined by the DMO involved */ +} DSOUND_IO_DXDMO_DATA; + +/* +RIFF +( + 'DSBC' // DirectSoundBufferConfig chunk + [] // GUID identifier for this DirectSoundBufferConfig + [] // Optional version info + [] // Name, author, copyright info., comments + // DirectSound Buffer descriptor chunk + [] // Optional bus id array + [] // Optional 3d Parameters + [] // Optional list of FX descriptors +) + + // + 'guid' + ( + + ) + + // + 'vers' + ( + + ) + + // + 'dsbd' + ( + // Creation parameters and initial settings for the buffer + ) + + // + 'bsid' + ( + // The size of DSOUND_IO_DSBUSID is determined by the chunk size + ) + + // + 'ds3d' + ( + // Initial 3D buffer parameters: position, etc. + ) + + // + LIST + ( + 'fxls' // Array of DMO creation parameter blocks + ... // Each DMO is encapsulated in a RIFF chunk + ) + +// // DMOs can be embedded in a buffer configuration or stored as separate files +RIFF +( + 'DSFX' + // FX header chunk + [] // FX initial settings chunk +) + + // + 'fxhr' + ( + + ) + + // + 'data' + ( + // Opaque data block used by the DMO to load itself. + // For our standard included DMOs, this is simply the structure accepted by + // the DMO's SetAllParameters() method - e.g. struct DSFXChorus for Chorus. + ) +*/ + +#endif + +#ifdef __cplusplus +}; /* extern "C" */ +#endif + +#include + +#endif /* #ifndef _DMUSICF_ */ diff --git a/Src/Decoder_H264_ALL/D3D/include/dmusici.h b/Src/Decoder_H264_ALL/D3D/include/dmusici.h new file mode 100644 index 0000000..65bf7f6 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dmusici.h @@ -0,0 +1,1883 @@ +/************************************************************************ +* * +* dmusici.h -- This module contains the API for the * +* DirectMusic performance layer * +* * +* Copyright (c) Microsoft Corporation. All rights reserved. * +* * +************************************************************************/ + +#ifndef _DMUSICI_ +#define _DMUSICI_ + +#include + +#define COM_NO_WINDOWS_H +#include + +#include +#include +/* plugin (track and tool) interfaces. This #include will eventually go away. */ +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef WORD TRANSITION_TYPE; +typedef __int64 REFERENCE_TIME; +typedef long MUSIC_TIME; + +#define MT_MIN 0x80000000 /* Minimum music time value. */ +#define MT_MAX 0x7FFFFFFF /* Maximum music time value. */ + +#define DMUS_PPQ 768 /* parts per quarter note */ + +interface IDirectMusicTrack; +interface IDirectMusicPerformance; +interface IDirectMusicPerformance8; +interface IDirectMusicTool; +interface IDirectMusicSegment; +interface IDirectMusicSegment8; +interface IDirectMusicSegmentState; +interface IDirectMusicSegmentState8; +interface IDirectMusicGraph; +interface IDirectMusicBuffer; +interface IDirectMusicInstrument; +interface IDirectMusicDownloadedInstrument; +interface IDirectMusicBand; +interface IDirectMusicChordMap; +interface IDirectMusicLoader; +interface IDirectMusicLoader8; +interface IDirectMusicScript; +interface IDirectMusicObject; +interface IDirectMusicStyle8; +interface IDirectMusicPatternTrack; +interface IDirectMusicContainer; +interface IDirectMusicTool8; +interface IDirectMusicTrack8; +interface IDirectMusicAudioPath; +#ifndef __cplusplus +typedef interface IDirectMusicTrack IDirectMusicTrack; +typedef interface IDirectMusicPerformance IDirectMusicPerformance; +typedef interface IDirectMusicPerformance8 IDirectMusicPerformance8; +typedef interface IDirectMusicTool IDirectMusicTool; +typedef interface IDirectMusicSegment IDirectMusicSegment; +typedef interface IDirectMusicSegment8 IDirectMusicSegment8; +typedef interface IDirectMusicSegmentState IDirectMusicSegmentState; +typedef interface IDirectMusicSegmentState8 IDirectMusicSegmentState8; +typedef interface IDirectMusicGraph IDirectMusicGraph; +typedef interface IDirectMusicBuffer IDirectMusicBuffer; +typedef interface IDirectMusicInstrument IDirectMusicInstrument; +typedef interface IDirectMusicDownloadedInstrument IDirectMusicDownloadedInstrument; +typedef interface IDirectMusicBand IDirectMusicBand; +typedef interface IDirectMusicChordMap IDirectMusicChordMap; +typedef interface IDirectMusicObject IDirectMusicObject; +typedef interface IDirectMusicLoader IDirectMusicLoader; +typedef interface IDirectMusicLoader8 IDirectMusicLoader8; +typedef interface IDirectMusicScript IDirectMusicScript; +typedef interface IDirectMusicStyle8 IDirectMusicStyle8; +typedef interface IDirectMusicPatternTrack IDirectMusicPatternTrack; +typedef interface IDirectMusicContainer IDirectMusicContainer; +typedef interface IDirectMusicTool8 IDirectMusicTool8; +typedef interface IDirectMusicTrack8 IDirectMusicTrack8; +typedef interface IDirectMusicAudioPath IDirectMusicAudioPath; +#endif + +typedef enum enumDMUS_STYLET_TYPES +{ + DMUS_STYLET_PATTERN = 0, + DMUS_STYLET_MOTIF = 1, +} DMUS_STYLET_TYPES; + + +typedef enum enumDMUS_COMMANDT_TYPES +{ + DMUS_COMMANDT_GROOVE = 0, + DMUS_COMMANDT_FILL = 1, + DMUS_COMMANDT_INTRO = 2, + DMUS_COMMANDT_BREAK = 3, + DMUS_COMMANDT_END = 4, + DMUS_COMMANDT_ENDANDINTRO = 5 +} DMUS_COMMANDT_TYPES; + +typedef enum enumDMUS_SHAPET_TYPES +{ + DMUS_SHAPET_FALLING = 0, + DMUS_SHAPET_LEVEL = 1, + DMUS_SHAPET_LOOPABLE = 2, + DMUS_SHAPET_LOUD = 3, + DMUS_SHAPET_QUIET = 4, + DMUS_SHAPET_PEAKING = 5, + DMUS_SHAPET_RANDOM = 6, + DMUS_SHAPET_RISING = 7, + DMUS_SHAPET_SONG = 8 +} DMUS_SHAPET_TYPES; + +typedef enum enumDMUS_COMPOSEF_FLAGS +{ + DMUS_COMPOSEF_NONE = 0, + DMUS_COMPOSEF_ALIGN = 0x1, + DMUS_COMPOSEF_OVERLAP = 0x2, + DMUS_COMPOSEF_IMMEDIATE = 0x4, + DMUS_COMPOSEF_GRID = 0x8, + DMUS_COMPOSEF_BEAT = 0x10, + DMUS_COMPOSEF_MEASURE = 0x20, + DMUS_COMPOSEF_AFTERPREPARETIME = 0x40, + DMUS_COMPOSEF_VALID_START_BEAT = 0x80, /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any beat. */ + DMUS_COMPOSEF_VALID_START_GRID = 0x100, /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any grid. */ + DMUS_COMPOSEF_VALID_START_TICK = 0x200, /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur any time. */ + DMUS_COMPOSEF_SEGMENTEND = 0x400, /* Play the transition at the end of the current segment. */ + DMUS_COMPOSEF_MARKER = 0x800, /* Play the transition at the next marker in the current segment. */ + DMUS_COMPOSEF_MODULATE = 0x1000, + DMUS_COMPOSEF_LONG = 0x2000, + DMUS_COMPOSEF_ENTIRE_TRANSITION = 0x4000, /* play the entire transition pattern */ + DMUS_COMPOSEF_1BAR_TRANSITION = 0x8000, /* play one bar of the transition pattern */ + DMUS_COMPOSEF_ENTIRE_ADDITION = 0x10000, /* play the additional pattern in its entirety */ + DMUS_COMPOSEF_1BAR_ADDITION = 0x20000, /* play one bar of the additional pattern */ + DMUS_COMPOSEF_VALID_START_MEASURE = 0x40000, /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any bar. */ + DMUS_COMPOSEF_DEFAULT = 0x80000, /* Use segment's default boundary */ + DMUS_COMPOSEF_NOINVALIDATE = 0x100000, /* Play without invalidating the currently playing segment(s) */ + DMUS_COMPOSEF_USE_AUDIOPATH = 0x200000, /* Uses the audio paths that are embedded in the segments */ + DMUS_COMPOSEF_INVALIDATE_PRI = 0x400000 /* Invalidate only the current primary seg state */ +} DMUS_COMPOSEF_FLAGS; + +#define DMUS_PMSG_PART \ + DWORD dwSize; \ + REFERENCE_TIME rtTime; /* real time (in 100 nanosecond increments) */ \ + MUSIC_TIME mtTime; /* music time */ \ + DWORD dwFlags; /* various bits (see DMUS_PMSGF_FLAGS enumeration) */ \ + DWORD dwPChannel; /* Performance Channel. The Performance can */ \ + /* use this to determine the port/channel. */ \ + DWORD dwVirtualTrackID; /* virtual track ID */ \ + IDirectMusicTool* pTool; /* tool interface pointer */ \ + IDirectMusicGraph* pGraph; /* tool graph interface pointer */ \ + DWORD dwType; /* PMSG type (see DMUS_PMSGT_TYPES defines) */ \ + DWORD dwVoiceID; /* unique voice id which allows synthesizers to */ \ + /* identify a specific event. For DirectX 6.0, */ \ + /* this field should always be 0. */ \ + DWORD dwGroupID; /* Track group id */ \ + IUnknown* punkUser; /* user com pointer, auto released upon PMSG free */ + +/* every DMUS_PMSG is based off of this structure. The Performance needs + to access these members consistently in every PMSG that goes through it. */ +typedef struct _DMUS_PMSG +{ + /* begin DMUS_PMSG_PART */ + DMUS_PMSG_PART + /* end DMUS_PMSG_PART */ + +} DMUS_PMSG; + +#define DMUS_PCHANNEL_BROADCAST_PERFORMANCE 0xFFFFFFFF /* PMsg is sent on all PChannels of the performance. */ +#define DMUS_PCHANNEL_BROADCAST_AUDIOPATH 0xFFFFFFFE /* PMsg is sent on all PChannels of the audio path. */ +#define DMUS_PCHANNEL_BROADCAST_SEGMENT 0xFFFFFFFD /* PMsg is sent on all PChannels of the segment. */ +#define DMUS_PCHANNEL_BROADCAST_GROUPS 0xFFFFFFFC /* A duplicate PMsg is for each Channels Groups in the performance. */ + +/* The DMUS_PATH constants are used in conjunction with GetObjectInPath to find a requested + interface at a particular stage in the audio path. +*/ +#define DMUS_PATH_SEGMENT 0x1000 /* Get the segment itself (from a segment state.) */ +#define DMUS_PATH_SEGMENT_TRACK 0x1100 /* Look in Track List of Segment. */ +#define DMUS_PATH_SEGMENT_GRAPH 0x1200 /* Get the segment's tool graph. */ +#define DMUS_PATH_SEGMENT_TOOL 0x1300 /* Look in Tool Graph of Segment. */ +#define DMUS_PATH_AUDIOPATH 0x2000 /* Get the audiopath itself (from a segment state.) */ +#define DMUS_PATH_AUDIOPATH_GRAPH 0x2200 /* Get the audiopath's tool graph. */ +#define DMUS_PATH_AUDIOPATH_TOOL 0x2300 /* Look in Tool Graph of Audio Path. */ +#define DMUS_PATH_PERFORMANCE 0x3000 /* Access the performance. */ +#define DMUS_PATH_PERFORMANCE_GRAPH 0x3200 /* Get the performance's tool graph. */ +#define DMUS_PATH_PERFORMANCE_TOOL 0x3300 /* Look in Tool Graph of Performance. */ +#define DMUS_PATH_PORT 0x4000 /* Access the synth. */ +#define DMUS_PATH_BUFFER 0x6000 /* Look in DirectSoundBuffer. */ +#define DMUS_PATH_BUFFER_DMO 0x6100 /* Access a DMO in the buffer. */ +#define DMUS_PATH_MIXIN_BUFFER 0x7000 /* Look in a global mixin buffer. */ +#define DMUS_PATH_MIXIN_BUFFER_DMO 0x7100 /* Access a DMO in a global mixin buffer. */ +#define DMUS_PATH_PRIMARY_BUFFER 0x8000 /* Access the primary buffer. */ + +/* To ignore PChannels when calling GetObjectInPath(), use the DMUS_PCHANNEL_ALL constant. */ +#define DMUS_PCHANNEL_ALL 0xFFFFFFFB + +/* The DMUS_APATH types are used in conjunction with CreateStandardAudioPath to + build default path types. _SHARED_ means the same buffer is shared across multiple + instantiations of the audiopath type. _DYNAMIC_ means a unique buffer is created + every time. +*/ + +#define DMUS_APATH_SHARED_STEREOPLUSREVERB 1 /* A standard music set up with stereo outs and reverb. */ +#define DMUS_APATH_DYNAMIC_3D 6 /* An audio path with one dynamic bus from the synth feeding to a dynamic 3d buffer. Does not send to env reverb. */ +#define DMUS_APATH_DYNAMIC_MONO 7 /* An audio path with one dynamic bus from the synth feeding to a dynamic mono buffer. */ +#define DMUS_APATH_DYNAMIC_STEREO 8 /* An audio path with two dynamic buses from the synth feeding to a dynamic stereo buffer. */ + +typedef struct _DMUS_AUDIOPARAMS +{ + DWORD dwSize; /* Size of this structure. */ + BOOL fInitNow; /* If true, the sink and synth are created immediately and results returned in this structure. */ + DWORD dwValidData; /* Flags indicating which fields below are valid. */ + DWORD dwFeatures; /* Required DMUS_AUDIOF features. */ + DWORD dwVoices; /* Required number of voices. */ + DWORD dwSampleRate; /* Sample rate of synths and sink. */ + CLSID clsidDefaultSynth; /* Class ID of default synthesizer. */ +} DMUS_AUDIOPARAMS; + +/* dwFeatures flags. These indicate which features are required for the audio environment. */ +#define DMUS_AUDIOF_3D 0x1 /* Require 3D buffers. */ +#define DMUS_AUDIOF_ENVIRON 0x2 /* Require environmental modeling. */ +#define DMUS_AUDIOF_EAX 0x4 /* Require use of EAX effects. */ +#define DMUS_AUDIOF_DMOS 0x8 /* Require use of additional DMOs. */ +#define DMUS_AUDIOF_STREAMING 0x10 /* Require support for streaming waves. */ +#define DMUS_AUDIOF_BUFFERS 0x20 /* Require support for multiple buffers (all above cases need this.) */ +#define DMUS_AUDIOF_ALL 0x3F /* Requires everything. */ + +/* dwValidData flags. These indicate which fields in DMUS_AUDIOPARAMS have been filled in. If fInitNow is set, these also return what was allocated. */ +#define DMUS_AUDIOPARAMS_FEATURES 0x00000001 +#define DMUS_AUDIOPARAMS_VOICES 0x00000002 +#define DMUS_AUDIOPARAMS_SAMPLERATE 0x00000004 +#define DMUS_AUDIOPARAMS_DEFAULTSYNTH 0x00000008 + +/* DMUS_PMSGF_FLAGS fill the DMUS_PMSG's dwFlags member */ +typedef enum enumDMUS_PMSGF_FLAGS +{ + DMUS_PMSGF_REFTIME = 1, /* if rtTime is valid */ + DMUS_PMSGF_MUSICTIME = 2, /* if mtTime is valid */ + DMUS_PMSGF_TOOL_IMMEDIATE = 4, /* if PMSG should be processed immediately */ + DMUS_PMSGF_TOOL_QUEUE = 8, /* if PMSG should be processed a little early, at Queue time */ + DMUS_PMSGF_TOOL_ATTIME = 0x10, /* if PMSG should be processed at the time stamp */ + DMUS_PMSGF_TOOL_FLUSH = 0x20, /* if PMSG is being flushed */ + DMUS_PMSGF_LOCKTOREFTIME = 0x40, /* if rtTime can not be overriden by a tempo change. */ + DMUS_PMSGF_DX8 = 0x80 /* if the message has DX8 or later extensions. */ + /* The values of DMUS_TIME_RESOLVE_FLAGS may also be used inside the */ + /* DMUS_PMSG's dwFlags member. */ +} DMUS_PMSGF_FLAGS; + +/* DMUS_PMSGT_TYPES fill the DMUS_PMSG's dwType member */ +typedef enum enumDMUS_PMSGT_TYPES +{ + DMUS_PMSGT_MIDI = 0, /* MIDI short message */ + DMUS_PMSGT_NOTE = 1, /* Interactive Music Note */ + DMUS_PMSGT_SYSEX = 2, /* MIDI long message (system exclusive message) */ + DMUS_PMSGT_NOTIFICATION = 3, /* Notification message */ + DMUS_PMSGT_TEMPO = 4, /* Tempo message */ + DMUS_PMSGT_CURVE = 5, /* Control change / pitch bend, etc. curve */ + DMUS_PMSGT_TIMESIG = 6, /* Time signature */ + DMUS_PMSGT_PATCH = 7, /* Patch changes */ + DMUS_PMSGT_TRANSPOSE = 8, /* Transposition messages */ + DMUS_PMSGT_CHANNEL_PRIORITY = 9, /* Channel priority */ + DMUS_PMSGT_STOP = 10, /* Stop message */ + DMUS_PMSGT_DIRTY = 11, /* Tells Tools that cache GetParam() info to refresh */ + DMUS_PMSGT_WAVE = 12, /* Carries control information for playing a wave. */ + DMUS_PMSGT_LYRIC = 13, /* Lyric message from lyric track. */ + DMUS_PMSGT_SCRIPTLYRIC = 14, /* Lyric message sent by a script with the Trace function. */ + DMUS_PMSGT_USER = 255 /* User message */ +} DMUS_PMSGT_TYPES; + +/* DMUS_SEGF_FLAGS correspond to IDirectMusicPerformance::PlaySegment, and other API */ +typedef enum enumDMUS_SEGF_FLAGS +{ + DMUS_SEGF_REFTIME = 1<<6, /* 0x40 Time parameter is in reference time */ + DMUS_SEGF_SECONDARY = 1<<7, /* 0x80 Secondary segment */ + DMUS_SEGF_QUEUE = 1<<8, /* 0x100 Queue at the end of the primary segment queue (primary only) */ + DMUS_SEGF_CONTROL = 1<<9, /* 0x200 Play as a control track (secondary segments only) */ + DMUS_SEGF_AFTERPREPARETIME = 1<<10, /* 0x400 Play after the prepare time (See IDirectMusicPerformance::GetPrepareTime) */ + DMUS_SEGF_GRID = 1<<11, /* 0x800 Play on grid boundary */ + DMUS_SEGF_BEAT = 1<<12, /* 0x1000 Play on beat boundary */ + DMUS_SEGF_MEASURE = 1<<13, /* 0x2000 Play on measure boundary */ + DMUS_SEGF_DEFAULT = 1<<14, /* 0x4000 Use segment's default boundary */ + DMUS_SEGF_NOINVALIDATE = 1<<15, /* 0x8000 Play without invalidating the currently playing segment(s) */ + DMUS_SEGF_ALIGN = 1<<16, /* 0x10000 Align segment with requested boundary, but switch at first valid point */ + DMUS_SEGF_VALID_START_BEAT = 1<<17, /* 0x20000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any beat. */ + DMUS_SEGF_VALID_START_GRID = 1<<18, /* 0x40000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any grid. */ + DMUS_SEGF_VALID_START_TICK = 1<<19, /* 0x80000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur any time. */ + DMUS_SEGF_AUTOTRANSITION = 1<<20, /* 0x100000 Compose and play a transition segment, using the transition template. */ + DMUS_SEGF_AFTERQUEUETIME = 1<<21, /* 0x200000 Make sure to play after the queue time. This is default for primary segments */ + DMUS_SEGF_AFTERLATENCYTIME = 1<<22, /* 0x400000 Make sure to play after the latency time. This is true for all segments, so this is a nop */ + DMUS_SEGF_SEGMENTEND = 1<<23, /* 0x800000 Play at the next end of segment. */ + DMUS_SEGF_MARKER = 1<<24, /* 0x1000000 Play at next marker in the primary segment. If there are no markers, default to any other resolution requests. */ + DMUS_SEGF_TIMESIG_ALWAYS = 1<<25, /* 0x2000000 Even if there is no primary segment, align start time with current time signature. */ + DMUS_SEGF_USE_AUDIOPATH = 1<<26, /* 0x4000000 Uses the audio path that is embedded in the segment. */ + DMUS_SEGF_VALID_START_MEASURE = 1<<27, /* 0x8000000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any bar. */ + DMUS_SEGF_INVALIDATE_PRI = 1<<28 /* 0x10000000 invalidate only the current primary seg state */ +} DMUS_SEGF_FLAGS; + +#define DMUS_SEG_REPEAT_INFINITE 0xFFFFFFFF /* For IDirectMusicSegment::SetRepeat*/ +#define DMUS_SEG_ALLTRACKS 0x80000000 /* For IDirectMusicSegment::SetParam() and SetTrackConfig() - selects all tracks instead on nth index. */ +#define DMUS_SEG_ANYTRACK 0x80000000 /* For IDirectMusicSegment::GetParam() - checks each track until it finds one that returns data (not DMUS_E_NOT_FOUND.) */ + + +/* DMUS_TIME_RESOLVE_FLAGS correspond to IDirectMusicPerformance::GetResolvedTime, and can */ +/* also be used interchangeably with the corresponding DMUS_SEGF_FLAGS, since their values */ +/* are intentionally the same */ +typedef enum enumDMUS_TIME_RESOLVE_FLAGS +{ + DMUS_TIME_RESOLVE_AFTERPREPARETIME = DMUS_SEGF_AFTERPREPARETIME, + DMUS_TIME_RESOLVE_AFTERQUEUETIME = DMUS_SEGF_AFTERQUEUETIME, + DMUS_TIME_RESOLVE_AFTERLATENCYTIME = DMUS_SEGF_AFTERLATENCYTIME, + DMUS_TIME_RESOLVE_GRID = DMUS_SEGF_GRID, + DMUS_TIME_RESOLVE_BEAT = DMUS_SEGF_BEAT, + DMUS_TIME_RESOLVE_MEASURE = DMUS_SEGF_MEASURE, + DMUS_TIME_RESOLVE_MARKER = DMUS_SEGF_MARKER, + DMUS_TIME_RESOLVE_SEGMENTEND = DMUS_SEGF_SEGMENTEND, +} DMUS_TIME_RESOLVE_FLAGS; + +/* The following flags are sent inside the DMUS_CHORD_KEY.dwFlags parameter */ +typedef enum enumDMUS_CHORDKEYF_FLAGS +{ + DMUS_CHORDKEYF_SILENT = 1, /* is the chord silent? */ +} DMUS_CHORDKEYF_FLAGS; + +#define DMUS_MAXSUBCHORD 8 + +typedef struct _DMUS_SUBCHORD +{ + DWORD dwChordPattern; /* Notes in the subchord */ + DWORD dwScalePattern; /* Notes in the scale */ + DWORD dwInversionPoints; /* Where inversions can occur */ + DWORD dwLevels; /* Which levels are supported by this subchord */ + BYTE bChordRoot; /* Root of the subchord */ + BYTE bScaleRoot; /* Root of the scale */ +} DMUS_SUBCHORD; + +typedef struct _DMUS_CHORD_KEY +{ + WCHAR wszName[16]; /* Name of the chord */ + WORD wMeasure; /* Measure this falls on */ + BYTE bBeat; /* Beat this falls on */ + BYTE bSubChordCount; /* Number of chords in the list of subchords */ + DMUS_SUBCHORD SubChordList[DMUS_MAXSUBCHORD]; /* List of sub chords */ + DWORD dwScale; /* Scale underlying the entire chord */ + BYTE bKey; /* Key underlying the entire chord */ + BYTE bFlags; /* Miscelaneous flags */ +} DMUS_CHORD_KEY; + +/* DMUS_NOTE_PMSG */ +typedef struct _DMUS_NOTE_PMSG +{ + /* begin DMUS_PMSG_PART */ + DMUS_PMSG_PART + /* end DMUS_PMSG_PART */ + + MUSIC_TIME mtDuration; /* duration */ + WORD wMusicValue; /* Description of note in chord and key. */ + WORD wMeasure; /* Measure in which this note occurs */ + short nOffset; /* Offset from grid at which this note occurs */ + BYTE bBeat; /* Beat (in measure) at which this note occurs */ + BYTE bGrid; /* Grid offset from beat at which this note occurs */ + BYTE bVelocity; /* Note velocity */ + BYTE bFlags; /* see DMUS_NOTEF_FLAGS */ + BYTE bTimeRange; /* Range to randomize time. */ + BYTE bDurRange; /* Range to randomize duration. */ + BYTE bVelRange; /* Range to randomize velocity. */ + BYTE bPlayModeFlags; /* Play mode */ + BYTE bSubChordLevel; /* Which subchord level this note uses. */ + BYTE bMidiValue; /* The MIDI note value, converted from wMusicValue */ + char cTranspose; /* Transposition to add to midi note value after converted from wMusicValue. */ +} DMUS_NOTE_PMSG; + +typedef enum enumDMUS_NOTEF_FLAGS +{ + DMUS_NOTEF_NOTEON = 1, /* Set if this is a MIDI Note On. Otherwise, it is MIDI Note Off */ + /* DX8 flags: */ + DMUS_NOTEF_NOINVALIDATE = 2, /* Don't invalidate this note off. */ + DMUS_NOTEF_NOINVALIDATE_INSCALE = 4,/* Don't invalidate if still within the scale. */ + DMUS_NOTEF_NOINVALIDATE_INCHORD = 8,/* Don't invalidate if still within the chord. */ + DMUS_NOTEF_REGENERATE = 0x10, /* Regenerate the note on an invalidate. */ +} DMUS_NOTEF_FLAGS; + +/* The DMUS_PLAYMODE_FLAGS are used to determine how to convert wMusicValue + into the appropriate bMidiValue. +*/ + +typedef enum enumDMUS_PLAYMODE_FLAGS +{ + DMUS_PLAYMODE_KEY_ROOT = 1, /* Transpose on top of the key root. */ + DMUS_PLAYMODE_CHORD_ROOT = 2, /* Transpose on top of the chord root. */ + DMUS_PLAYMODE_SCALE_INTERVALS = 4, /* Use scale intervals from scale pattern. */ + DMUS_PLAYMODE_CHORD_INTERVALS = 8, /* Use chord intervals from chord pattern. */ + DMUS_PLAYMODE_NONE = 16, /* No mode. Indicates the parent part's mode should be used. */ +} DMUS_PLAYMODE_FLAGS; + +/* The following are playback modes that can be created by combining the DMUS_PLAYMODE_FLAGS + in various ways: +*/ + +/* Fixed. wMusicValue holds final MIDI note value. This is used for drums, sound effects, and sequenced + notes that should not be transposed by the chord or scale. +*/ +#define DMUS_PLAYMODE_FIXED 0 +/* In fixed to key, the musicvalue is again a fixed MIDI value, but it + is transposed on top of the key root. +*/ +#define DMUS_PLAYMODE_FIXEDTOKEY DMUS_PLAYMODE_KEY_ROOT +/* In fixed to chord, the musicvalue is also a fixed MIDI value, but it + is transposed on top of the chord root. +*/ +#define DMUS_PLAYMODE_FIXEDTOCHORD DMUS_PLAYMODE_CHORD_ROOT +/* In Pedalpoint, the key root is used and the notes only track the intervals in + the scale. The chord root and intervals are completely ignored. This is useful + for melodic lines that play relative to the key root. +*/ +#define DMUS_PLAYMODE_PEDALPOINT (DMUS_PLAYMODE_KEY_ROOT | DMUS_PLAYMODE_SCALE_INTERVALS) +/* In the Melodic mode, the chord root is used but the notes only track the intervals in + the scale. The key root and chord intervals are completely ignored. This is useful + for melodic lines that play relative to the chord root. +*/ +#define DMUS_PLAYMODE_MELODIC (DMUS_PLAYMODE_CHORD_ROOT | DMUS_PLAYMODE_SCALE_INTERVALS) +/* Normal chord mode is the prevalent playback mode. + The notes track the intervals in the chord, which is based on the chord root. + If there is a scale component to the MusicValue, the additional intervals + are pulled from the scale and added. + If the chord does not have an interval to match the chord component of + the MusicValue, the note is silent. +*/ +#define DMUS_PLAYMODE_NORMALCHORD (DMUS_PLAYMODE_CHORD_ROOT | DMUS_PLAYMODE_CHORD_INTERVALS) +/* If it is desirable to play a note that is above the top of the chord, the + always play mode (known as "purpleized" in a former life) finds a position + for the note by using intervals from the scale. Essentially, this mode is + a combination of the Normal and Melodic playback modes, where a failure + in Normal causes a second try in Melodic mode. +*/ +#define DMUS_PLAYMODE_ALWAYSPLAY (DMUS_PLAYMODE_MELODIC | DMUS_PLAYMODE_NORMALCHORD) + +/* These playmodes are new for dx8. */ +/* In PedalpointChord, the key root is used and the notes only track the intervals in + the chord. The chord root and scale intervals are completely ignored. This is useful + for chordal lines that play relative to the key root. +*/ +#define DMUS_PLAYMODE_PEDALPOINTCHORD (DMUS_PLAYMODE_KEY_ROOT | DMUS_PLAYMODE_CHORD_INTERVALS) + +/* For completeness, here's a mode that tries for pedalpointchord, but if it fails + uses scale intervals +*/ +#define DMUS_PLAYMODE_PEDALPOINTALWAYS (DMUS_PLAYMODE_PEDALPOINT | DMUS_PLAYMODE_PEDALPOINTCHORD) + + +/* Legacy names for modes... */ +#define DMUS_PLAYMODE_PURPLEIZED DMUS_PLAYMODE_ALWAYSPLAY +#define DMUS_PLAYMODE_SCALE_ROOT DMUS_PLAYMODE_KEY_ROOT +#define DMUS_PLAYMODE_FIXEDTOSCALE DMUS_PLAYMODE_FIXEDTOKEY + + +/* DMUS_MIDI_PMSG */ +typedef struct _DMUS_MIDI_PMSG +{ + /* begin DMUS_PMSG_PART */ + DMUS_PMSG_PART + /* end DMUS_PMSG_PART */ + + BYTE bStatus; + BYTE bByte1; + BYTE bByte2; + BYTE bPad[1]; +} DMUS_MIDI_PMSG; + +/* DMUS_PATCH_PMSG */ +typedef struct _DMUS_PATCH_PMSG +{ + /* begin DMUS_PMSG_PART */ + DMUS_PMSG_PART + /* end DMUS_PMSG_PART */ + + BYTE byInstrument; + BYTE byMSB; + BYTE byLSB; + BYTE byPad[1]; +} DMUS_PATCH_PMSG; + +/* DMUS_TRANSPOSE_PMSG */ +typedef struct _DMUS_TRANSPOSE_PMSG +{ + /* begin DMUS_PMSG_PART */ + DMUS_PMSG_PART + /* end DMUS_PMSG_PART */ + + short nTranspose; + /* Following exists only under DX8 and on (check dwFlags for DMUS_PMSGF_DX8) */ + WORD wMergeIndex; /* Allows multiple parameters to be merged (pitchbend, volume, and expression.)*/ +} DMUS_TRANSPOSE_PMSG; + +/* DMUS_CHANNEL_PRIORITY_PMSG */ +typedef struct _DMUS_CHANNEL_PRIORITY_PMSG +{ + /* begin DMUS_PMSG_PART */ + DMUS_PMSG_PART + /* end DMUS_PMSG_PART */ + + DWORD dwChannelPriority; +} DMUS_CHANNEL_PRIORITY_PMSG; + +/* DMUS_TEMPO_PMSG */ +typedef struct _DMUS_TEMPO_PMSG +{ + /* begin DMUS_PMSG_PART */ + DMUS_PMSG_PART + /* end DMUS_PMSG_PART */ + + double dblTempo; /* the tempo */ +} DMUS_TEMPO_PMSG; + +#define DMUS_TEMPO_MAX 1000 +#define DMUS_TEMPO_MIN 1 + +#define DMUS_MASTERTEMPO_MAX 100.0f +#define DMUS_MASTERTEMPO_MIN 0.01f + +/* DMUS_SYSEX_PMSG */ +typedef struct _DMUS_SYSEX_PMSG +{ + /* begin DMUS_PMSG_PART */ + DMUS_PMSG_PART + /* end DMUS_PMSG_PART */ + + DWORD dwLen; /* length of the data */ + BYTE abData[1]; /* array of data, length equal to dwLen */ +} DMUS_SYSEX_PMSG; + +/* DMUS_CURVE_PMSG */ +typedef struct _DMUS_CURVE_PMSG +{ + /* begin DMUS_PMSG_PART */ + DMUS_PMSG_PART + /* end DMUS_PMSG_PART */ + + MUSIC_TIME mtDuration; /* how long this curve lasts */ + MUSIC_TIME mtOriginalStart; /* must be set to either zero when this PMSG is created or to the original mtTime of the curve */ + MUSIC_TIME mtResetDuration; /* how long after the curve is finished to allow a flush or + invalidation to reset to the reset value, nResetValue */ + short nStartValue; /* curve's start value */ + short nEndValue; /* curve's end value */ + short nResetValue; /* curve's reset value, set when a flush or invalidation + occurs within mtDuration + mtResetDuration */ + WORD wMeasure; /* Measure in which this curve occurs */ + short nOffset; /* Offset from grid at which this curve occurs */ + BYTE bBeat; /* Beat (in measure) at which this curve occurs */ + BYTE bGrid; /* Grid offset from beat at which this curve occurs */ + BYTE bType; /* type of curve */ + BYTE bCurveShape; /* shape of curve */ + BYTE bCCData; /* CC# if this is a control change type */ + BYTE bFlags; /* Curve reset and start from current value flags. */ + /* Following exists only under DX8 and on (check dwFlags for DMUS_PMSGF_DX8) */ + WORD wParamType; /* RPN or NRPN parameter number. */ + WORD wMergeIndex; /* Allows multiple parameters to be merged (pitchbend, volume, and expression.)*/ +} DMUS_CURVE_PMSG; + +typedef enum enumDMUS_CURVE_FLAGS +{ + DMUS_CURVE_RESET = 1, /* When set, the nResetValue must be sent when the + time is reached or an invalidate occurs because + of a transition. If not set, the curve stays + permanently stuck at the new value. */ + DMUS_CURVE_START_FROM_CURRENT = 2/* Ignore Start, start the curve at the current value. + This only works for volume, expression, and pitchbend. */ +} DMUS_CURVE_FLAGS; + + +#define DMUS_CURVE_RESET 1 + +/* Curve shapes */ +enum +{ + DMUS_CURVES_LINEAR = 0, + DMUS_CURVES_INSTANT = 1, + DMUS_CURVES_EXP = 2, + DMUS_CURVES_LOG = 3, + DMUS_CURVES_SINE = 4 +}; +/* curve types */ +#define DMUS_CURVET_PBCURVE 0x03 /* Pitch bend curve. */ +#define DMUS_CURVET_CCCURVE 0x04 /* Control change curve. */ +#define DMUS_CURVET_MATCURVE 0x05 /* Mono aftertouch curve. */ +#define DMUS_CURVET_PATCURVE 0x06 /* Poly aftertouch curve. */ +#define DMUS_CURVET_RPNCURVE 0x07 /* RPN curve with curve type in wParamType. */ +#define DMUS_CURVET_NRPNCURVE 0x08 /* NRPN curve with curve type in wParamType. */ + +/* DMUS_TIMESIG_PMSG */ +typedef struct _DMUS_TIMESIG_PMSG +{ + /* begin DMUS_PMSG_PART */ + DMUS_PMSG_PART + /* end DMUS_PMSG_PART */ + + /* Time signatures define how many beats per measure, which note receives */ + /* the beat, and the grid resolution. */ + BYTE bBeatsPerMeasure; /* beats per measure (top of time sig) */ + BYTE bBeat; /* what note receives the beat (bottom of time sig.) */ + /* we can assume that 0 means 256th note */ + WORD wGridsPerBeat; /* grids per beat */ +} DMUS_TIMESIG_PMSG; + + + +/* notification type values */ +/* The following correspond to GUID_NOTIFICATION_SEGMENT */ +#define DMUS_NOTIFICATION_SEGSTART 0 +#define DMUS_NOTIFICATION_SEGEND 1 +#define DMUS_NOTIFICATION_SEGALMOSTEND 2 +#define DMUS_NOTIFICATION_SEGLOOP 3 +#define DMUS_NOTIFICATION_SEGABORT 4 +/* The following correspond to GUID_NOTIFICATION_PERFORMANCE */ +#define DMUS_NOTIFICATION_MUSICSTARTED 0 +#define DMUS_NOTIFICATION_MUSICSTOPPED 1 +#define DMUS_NOTIFICATION_MUSICALMOSTEND 2 +/* The following corresponds to GUID_NOTIFICATION_MEASUREANDBEAT */ +#define DMUS_NOTIFICATION_MEASUREBEAT 0 +/* The following corresponds to GUID_NOTIFICATION_CHORD */ +#define DMUS_NOTIFICATION_CHORD 0 +/* The following correspond to GUID_NOTIFICATION_COMMAND */ +#define DMUS_NOTIFICATION_GROOVE 0 +#define DMUS_NOTIFICATION_EMBELLISHMENT 1 +/* The following corresponds to GUID_NOTIFICATION_RECOMPOSE */ +#define DMUS_NOTIFICATION_RECOMPOSE 0 + +/* DMUS_NOTIFICATION_PMSG */ +typedef struct _DMUS_NOTIFICATION_PMSG +{ + /* begin DMUS_PMSG_PART */ + DMUS_PMSG_PART + /* end DMUS_PMSG_PART */ + + GUID guidNotificationType; + DWORD dwNotificationOption; + DWORD dwField1; + DWORD dwField2; +} DMUS_NOTIFICATION_PMSG; + +/* DMUS_WAVE_PMSG */ +typedef struct _DMUS_WAVE_PMSG +{ + /* begin DMUS_PMSG_PART */ + DMUS_PMSG_PART + /* end DMUS_PMSG_PART */ + + REFERENCE_TIME rtStartOffset; /* How far into the wave to start, in reference time units only. */ + REFERENCE_TIME rtDuration; /* Duration of the wave, in either reference time or music time. */ + long lOffset; /* Offset from actual time to logical time, in music or ref time. */ + long lVolume; /* Initial volume, in 100ths of a dB. */ + long lPitch; /* Initial pitch, in 100ths of a semitone. */ + BYTE bFlags; /* Flags, including DMUS_WAVEF_OFF... */ +} DMUS_WAVE_PMSG; + +#define DMUS_WAVEF_OFF 1 /* If wave is playing and this is the off message. */ +#define DMUS_WAVEF_STREAMING 2 /* If wave is streaming. */ +#define DMUS_WAVEF_NOINVALIDATE 4 /* Don't invalidate this wave. */ +#define DMUS_WAVEF_NOPREROLL 8 /* Don't preroll any wave data. */ +#define DMUS_WAVEF_IGNORELOOPS 0x20 /* Ignore segment looping. */ + +/* DMUS_LYRIC_PMSG */ +typedef struct _DMUS_LYRIC_PMSG +{ + /* begin DMUS_PMSG_PART */ + DMUS_PMSG_PART + /* end DMUS_PMSG_PART */ + + WCHAR wszString[1]; /* null-terminated Unicode lyric string (structure is actually larger than size 1) */ +} DMUS_LYRIC_PMSG; + +#define DMUS_MAX_NAME 64 /* Maximum object name length. */ +#define DMUS_MAX_CATEGORY 64 /* Maximum object category name length. */ +#define DMUS_MAX_FILENAME MAX_PATH + +typedef struct _DMUS_VERSION { + DWORD dwVersionMS; + DWORD dwVersionLS; +}DMUS_VERSION, FAR *LPDMUS_VERSION; + +/* Time Signature structure, used by IDirectMusicStyle */ +/* Also used as a parameter for GetParam() and SetParam */ +typedef struct _DMUS_TIMESIGNATURE +{ + MUSIC_TIME mtTime; + BYTE bBeatsPerMeasure; /* beats per measure (top of time sig) */ + BYTE bBeat; /* what note receives the beat (bottom of time sig.) */ + /* we can assume that 0 means 256th note */ + WORD wGridsPerBeat; /* grids per beat */ +} DMUS_TIMESIGNATURE; + +typedef struct _DMUS_VALID_START_PARAM +{ + MUSIC_TIME mtTime; /* Time of the first legal start + point after (or including) the requested time. + This is a returned value. + Time format is the relative offset from requested time. */ +} DMUS_VALID_START_PARAM; + +typedef struct _DMUS_PLAY_MARKER_PARAM +{ + MUSIC_TIME mtTime; /* Time of the first legal segment play + marker before (or including) the requested time. + This is a returned value. + Time format is the relative offset from requested time. */ +} DMUS_PLAY_MARKER_PARAM; + +/* The DMUSOBJECTDESC structure is used to communicate everything you could */ +/* possibly use to describe a DirectMusic object. */ + +typedef struct _DMUS_OBJECTDESC +{ + DWORD dwSize; /* Size of this structure. */ + DWORD dwValidData; /* Flags indicating which fields below are valid. */ + GUID guidObject; /* Unique ID for this object. */ + GUID guidClass; /* GUID for the class of object. */ + FILETIME ftDate; /* Last edited date of object. */ + DMUS_VERSION vVersion; /* Version. */ + WCHAR wszName[DMUS_MAX_NAME]; /* Name of object. */ + WCHAR wszCategory[DMUS_MAX_CATEGORY]; /* Category for object (optional). */ + WCHAR wszFileName[DMUS_MAX_FILENAME]; /* File path. */ + LONGLONG llMemLength; /* Size of Memory data. */ + LPBYTE pbMemData; /* Memory pointer for data. */ + IStream * pStream; /* Stream with data. */ +} DMUS_OBJECTDESC; + +typedef DMUS_OBJECTDESC *LPDMUS_OBJECTDESC; + +/* Flags for dwValidData. When set, a flag indicates that the */ +/* corresponding field in DMUSOBJECTDESC holds valid data. */ + +#define DMUS_OBJ_OBJECT (1 << 0) /* Object GUID is valid. */ +#define DMUS_OBJ_CLASS (1 << 1) /* Class GUID is valid. */ +#define DMUS_OBJ_NAME (1 << 2) /* Name is valid. */ +#define DMUS_OBJ_CATEGORY (1 << 3) /* Category is valid. */ +#define DMUS_OBJ_FILENAME (1 << 4) /* File path is valid. */ +#define DMUS_OBJ_FULLPATH (1 << 5) /* Path is full path. */ +#define DMUS_OBJ_URL (1 << 6) /* Path is URL. */ +#define DMUS_OBJ_VERSION (1 << 7) /* Version is valid. */ +#define DMUS_OBJ_DATE (1 << 8) /* Date is valid. */ +#define DMUS_OBJ_LOADED (1 << 9) /* Object is currently loaded in memory. */ +#define DMUS_OBJ_MEMORY (1 << 10) /* Object is pointed to by pbMemData. */ +#define DMUS_OBJ_STREAM (1 << 11) /* Object is stored in pStream. */ + +/* The DMUS_SCRIPT_ERRORINFO structure describes an error that occurred in a script. + It is returned by methods in IDirectMusicScript. */ +typedef struct _DMUS_SCRIPT_ERRORINFO +{ + DWORD dwSize; /* Size of this structure. */ + HRESULT hr; + ULONG ulLineNumber; + LONG ichCharPosition; + WCHAR wszSourceFile[DMUS_MAX_FILENAME]; + WCHAR wszSourceComponent[DMUS_MAX_FILENAME]; + WCHAR wszDescription[DMUS_MAX_FILENAME]; + WCHAR wszSourceLineText[DMUS_MAX_FILENAME]; +} DMUS_SCRIPT_ERRORINFO; + +/* Track configuration flags, used with IDirectMusicSegment8::SetTrackConfig() */ + +#define DMUS_TRACKCONFIG_OVERRIDE_ALL 1 /* This track should get parameters from this segment before controlling and primary tracks. */ +#define DMUS_TRACKCONFIG_OVERRIDE_PRIMARY 2 /* This track should get parameters from this segment before the primary segment tracks. */ +#define DMUS_TRACKCONFIG_FALLBACK 4 /* This track should get parameters from this segment if the primary and controlling segments don't succeed. */ +#define DMUS_TRACKCONFIG_CONTROL_ENABLED 8 /* GetParam() enabled for this track. */ +#define DMUS_TRACKCONFIG_PLAY_ENABLED 0x10 /* Play() enabled for this track. */ +#define DMUS_TRACKCONFIG_NOTIFICATION_ENABLED 0x20 /* Notifications enabled for this track. */ +#define DMUS_TRACKCONFIG_PLAY_CLOCKTIME 0x40 /* This track plays in clock time, not music time. */ +#define DMUS_TRACKCONFIG_PLAY_COMPOSE 0x80 /* This track should regenerate data each time it starts playing. */ +#define DMUS_TRACKCONFIG_LOOP_COMPOSE 0x100 /* This track should regenerate data each time it repeats. */ +#define DMUS_TRACKCONFIG_COMPOSING 0x200 /* This track is used to compose other tracks. */ +#define DMUS_TRACKCONFIG_CONTROL_PLAY 0x10000 /* This track, when played in a controlling segment, overrides playback of primary segment tracks. */ +#define DMUS_TRACKCONFIG_CONTROL_NOTIFICATION 0x20000 /* This track, when played in a controlling segment, overrides notification of primary segment tracks. */ +/* Additional track config flags for composing transitions */ +#define DMUS_TRACKCONFIG_TRANS1_FROMSEGSTART 0x400 /* Get track info from start of From segment */ +#define DMUS_TRACKCONFIG_TRANS1_FROMSEGCURRENT 0x800 /* Get track info from current place in From segment */ +#define DMUS_TRACKCONFIG_TRANS1_TOSEGSTART 0x1000 /* Get track info from start of To segment */ +#define DMUS_TRACKCONFIG_DEFAULT (DMUS_TRACKCONFIG_CONTROL_ENABLED | DMUS_TRACKCONFIG_PLAY_ENABLED | DMUS_TRACKCONFIG_NOTIFICATION_ENABLED) + +/* Get/SetParam structs for commands */ +/* PARAM structures, used by GetParam() and SetParam() */ +typedef struct _DMUS_COMMAND_PARAM +{ + BYTE bCommand; + BYTE bGrooveLevel; + BYTE bGrooveRange; + BYTE bRepeatMode; +} DMUS_COMMAND_PARAM; + +typedef struct _DMUS_COMMAND_PARAM_2 +{ + MUSIC_TIME mtTime; + BYTE bCommand; + BYTE bGrooveLevel; + BYTE bGrooveRange; + BYTE bRepeatMode; +} DMUS_COMMAND_PARAM_2; + +typedef IDirectMusicObject __RPC_FAR *LPDMUS_OBJECT; +typedef IDirectMusicLoader __RPC_FAR *LPDMUS_LOADER; +typedef IDirectMusicBand __RPC_FAR *LPDMUS_BAND; + +#define DMUSB_LOADED (1 << 0) /* Set when band has been loaded */ +#define DMUSB_DEFAULT (1 << 1) /* Set when band is default band for a style */ + +/*//////////////////////////////////////////////////////////////////// +// IDirectMusicBand */ +#undef INTERFACE +#define INTERFACE IDirectMusicBand +DECLARE_INTERFACE_(IDirectMusicBand, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicBand */ + STDMETHOD(CreateSegment) (THIS_ IDirectMusicSegment** ppSegment) PURE; + STDMETHOD(Download) (THIS_ IDirectMusicPerformance* pPerformance) PURE; + STDMETHOD(Unload) (THIS_ IDirectMusicPerformance* pPerformance) PURE; +}; + +typedef IDirectMusicBand IDirectMusicBand8; + +/*//////////////////////////////////////////////////////////////////// +// IDirectMusicObject */ +#undef INTERFACE +#define INTERFACE IDirectMusicObject +DECLARE_INTERFACE_(IDirectMusicObject, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicObject */ + STDMETHOD(GetDescriptor) (THIS_ LPDMUS_OBJECTDESC pDesc) PURE; + STDMETHOD(SetDescriptor) (THIS_ LPDMUS_OBJECTDESC pDesc) PURE; + STDMETHOD(ParseDescriptor) (THIS_ LPSTREAM pStream, + LPDMUS_OBJECTDESC pDesc) PURE; +}; + +typedef IDirectMusicObject IDirectMusicObject8; + +/*//////////////////////////////////////////////////////////////////// +// IDirectMusicLoader */ +#undef INTERFACE +#define INTERFACE IDirectMusicLoader +DECLARE_INTERFACE_(IDirectMusicLoader, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicLoader */ + STDMETHOD(GetObject) (THIS_ LPDMUS_OBJECTDESC pDesc, + REFIID riid, + LPVOID FAR *ppv) PURE; + STDMETHOD(SetObject) (THIS_ LPDMUS_OBJECTDESC pDesc) PURE; + STDMETHOD(SetSearchDirectory) (THIS_ REFGUID rguidClass, + WCHAR *pwzPath, + BOOL fClear) PURE; + STDMETHOD(ScanDirectory) (THIS_ REFGUID rguidClass, + WCHAR *pwzFileExtension, + WCHAR *pwzScanFileName) PURE; + STDMETHOD(CacheObject) (THIS_ IDirectMusicObject * pObject) PURE; + STDMETHOD(ReleaseObject) (THIS_ IDirectMusicObject * pObject) PURE; + STDMETHOD(ClearCache) (THIS_ REFGUID rguidClass) PURE; + STDMETHOD(EnableCache) (THIS_ REFGUID rguidClass, + BOOL fEnable) PURE; + STDMETHOD(EnumObject) (THIS_ REFGUID rguidClass, + DWORD dwIndex, + LPDMUS_OBJECTDESC pDesc) PURE; +}; + +/*//////////////////////////////////////////////////////////////////// +// IDirectMusicLoader8 */ +#undef INTERFACE +#define INTERFACE IDirectMusicLoader8 +DECLARE_INTERFACE_(IDirectMusicLoader8, IDirectMusicLoader) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicLoader */ + STDMETHOD(GetObject) (THIS_ LPDMUS_OBJECTDESC pDesc, + REFIID riid, + LPVOID FAR *ppv) PURE; + STDMETHOD(SetObject) (THIS_ LPDMUS_OBJECTDESC pDesc) PURE; + STDMETHOD(SetSearchDirectory) (THIS_ REFGUID rguidClass, + WCHAR *pwzPath, + BOOL fClear) PURE; + STDMETHOD(ScanDirectory) (THIS_ REFGUID rguidClass, + WCHAR *pwzFileExtension, + WCHAR *pwzScanFileName) PURE; + STDMETHOD(CacheObject) (THIS_ IDirectMusicObject * pObject) PURE; + STDMETHOD(ReleaseObject) (THIS_ IDirectMusicObject * pObject) PURE; + STDMETHOD(ClearCache) (THIS_ REFGUID rguidClass) PURE; + STDMETHOD(EnableCache) (THIS_ REFGUID rguidClass, + BOOL fEnable) PURE; + STDMETHOD(EnumObject) (THIS_ REFGUID rguidClass, + DWORD dwIndex, + LPDMUS_OBJECTDESC pDesc) PURE; + + /* IDirectMusicLoader8 */ + STDMETHOD_(void, CollectGarbage) (THIS) PURE; + STDMETHOD(ReleaseObjectByUnknown) (THIS_ IUnknown *pObject) PURE; + STDMETHOD(LoadObjectFromFile) (THIS_ REFGUID rguidClassID, + REFIID iidInterfaceID, + WCHAR *pwzFilePath, + void ** ppObject) PURE; +}; + +/* Stream object supports IDirectMusicGetLoader interface to access loader while file parsing. */ + +#undef INTERFACE +#define INTERFACE IDirectMusicGetLoader +DECLARE_INTERFACE_(IDirectMusicGetLoader, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicGetLoader */ + STDMETHOD(GetLoader) (THIS_ IDirectMusicLoader ** ppLoader) PURE; +}; + +typedef IDirectMusicGetLoader IDirectMusicGetLoader8; + +/*//////////////////////////////////////////////////////////////////// +// IDirectMusicSegment */ +#undef INTERFACE +#define INTERFACE IDirectMusicSegment +DECLARE_INTERFACE_(IDirectMusicSegment, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicSegment */ + STDMETHOD(GetLength) (THIS_ MUSIC_TIME* pmtLength) PURE; + STDMETHOD(SetLength) (THIS_ MUSIC_TIME mtLength) PURE; + STDMETHOD(GetRepeats) (THIS_ DWORD* pdwRepeats) PURE; + STDMETHOD(SetRepeats) (THIS_ DWORD dwRepeats) PURE; + STDMETHOD(GetDefaultResolution) (THIS_ DWORD* pdwResolution) PURE; + STDMETHOD(SetDefaultResolution) (THIS_ DWORD dwResolution) PURE; + STDMETHOD(GetTrack) (THIS_ REFGUID rguidType, + DWORD dwGroupBits, + DWORD dwIndex, + IDirectMusicTrack** ppTrack) PURE; + STDMETHOD(GetTrackGroup) (THIS_ IDirectMusicTrack* pTrack, + DWORD* pdwGroupBits) PURE; + STDMETHOD(InsertTrack) (THIS_ IDirectMusicTrack* pTrack, + DWORD dwGroupBits) PURE; + STDMETHOD(RemoveTrack) (THIS_ IDirectMusicTrack* pTrack) PURE; + STDMETHOD(InitPlay) (THIS_ IDirectMusicSegmentState** ppSegState, + IDirectMusicPerformance* pPerformance, + DWORD dwFlags) PURE; + STDMETHOD(GetGraph) (THIS_ IDirectMusicGraph** ppGraph) PURE; + STDMETHOD(SetGraph) (THIS_ IDirectMusicGraph* pGraph) PURE; + STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; + STDMETHOD(RemoveNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; + STDMETHOD(GetParam) (THIS_ REFGUID rguidType, + DWORD dwGroupBits, + DWORD dwIndex, + MUSIC_TIME mtTime, + MUSIC_TIME* pmtNext, + void* pParam) PURE; + STDMETHOD(SetParam) (THIS_ REFGUID rguidType, + DWORD dwGroupBits, + DWORD dwIndex, + MUSIC_TIME mtTime, + void* pParam) PURE; + STDMETHOD(Clone) (THIS_ MUSIC_TIME mtStart, + MUSIC_TIME mtEnd, + IDirectMusicSegment** ppSegment) PURE; + STDMETHOD(SetStartPoint) (THIS_ MUSIC_TIME mtStart) PURE; + STDMETHOD(GetStartPoint) (THIS_ MUSIC_TIME* pmtStart) PURE; + STDMETHOD(SetLoopPoints) (THIS_ MUSIC_TIME mtStart, + MUSIC_TIME mtEnd) PURE; + STDMETHOD(GetLoopPoints) (THIS_ MUSIC_TIME* pmtStart, + MUSIC_TIME* pmtEnd) PURE; + STDMETHOD(SetPChannelsUsed) (THIS_ DWORD dwNumPChannels, + DWORD* paPChannels) PURE; +}; + +/*//////////////////////////////////////////////////////////////////// +// IDirectMusicSegment8 */ +#undef INTERFACE +#define INTERFACE IDirectMusicSegment8 +DECLARE_INTERFACE_(IDirectMusicSegment8, IDirectMusicSegment) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicSegment */ + STDMETHOD(GetLength) (THIS_ MUSIC_TIME* pmtLength) PURE; + STDMETHOD(SetLength) (THIS_ MUSIC_TIME mtLength) PURE; + STDMETHOD(GetRepeats) (THIS_ DWORD* pdwRepeats) PURE; + STDMETHOD(SetRepeats) (THIS_ DWORD dwRepeats) PURE; + STDMETHOD(GetDefaultResolution) (THIS_ DWORD* pdwResolution) PURE; + STDMETHOD(SetDefaultResolution) (THIS_ DWORD dwResolution) PURE; + STDMETHOD(GetTrack) (THIS_ REFGUID rguidType, + DWORD dwGroupBits, + DWORD dwIndex, + IDirectMusicTrack** ppTrack) PURE; + STDMETHOD(GetTrackGroup) (THIS_ IDirectMusicTrack* pTrack, + DWORD* pdwGroupBits) PURE; + STDMETHOD(InsertTrack) (THIS_ IDirectMusicTrack* pTrack, + DWORD dwGroupBits) PURE; + STDMETHOD(RemoveTrack) (THIS_ IDirectMusicTrack* pTrack) PURE; + STDMETHOD(InitPlay) (THIS_ IDirectMusicSegmentState** ppSegState, + IDirectMusicPerformance* pPerformance, + DWORD dwFlags) PURE; + STDMETHOD(GetGraph) (THIS_ IDirectMusicGraph** ppGraph) PURE; + STDMETHOD(SetGraph) (THIS_ IDirectMusicGraph* pGraph) PURE; + STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; + STDMETHOD(RemoveNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; + STDMETHOD(GetParam) (THIS_ REFGUID rguidType, + DWORD dwGroupBits, + DWORD dwIndex, + MUSIC_TIME mtTime, + MUSIC_TIME* pmtNext, + void* pParam) PURE; + STDMETHOD(SetParam) (THIS_ REFGUID rguidType, + DWORD dwGroupBits, + DWORD dwIndex, + MUSIC_TIME mtTime, + void* pParam) PURE; + STDMETHOD(Clone) (THIS_ MUSIC_TIME mtStart, + MUSIC_TIME mtEnd, + IDirectMusicSegment** ppSegment) PURE; + STDMETHOD(SetStartPoint) (THIS_ MUSIC_TIME mtStart) PURE; + STDMETHOD(GetStartPoint) (THIS_ MUSIC_TIME* pmtStart) PURE; + STDMETHOD(SetLoopPoints) (THIS_ MUSIC_TIME mtStart, + MUSIC_TIME mtEnd) PURE; + STDMETHOD(GetLoopPoints) (THIS_ MUSIC_TIME* pmtStart, + MUSIC_TIME* pmtEnd) PURE; + STDMETHOD(SetPChannelsUsed) (THIS_ DWORD dwNumPChannels, + DWORD* paPChannels) PURE; + /* IDirectMusicSegment8 */ + STDMETHOD(SetTrackConfig) (THIS_ REFGUID rguidTrackClassID, /* Class ID of the type of track on which to set the configuration flags. */ + DWORD dwGroupBits, /* Group bits. */ + DWORD dwIndex, /* Nth track (or DMUS_SEG_ALLTRACKS) that matches class id and group id. */ + DWORD dwFlagsOn, /* DMUS_TRACKCONFIG_ flags to enable. */ + DWORD dwFlagsOff) PURE; /* DMUS_TRACKCONFIG_ flags to disable. */ + STDMETHOD(GetAudioPathConfig) (THIS_ IUnknown ** ppAudioPathConfig) PURE; + STDMETHOD(Compose) (THIS_ MUSIC_TIME mtTime, + IDirectMusicSegment* pFromSegment, + IDirectMusicSegment* pToSegment, + IDirectMusicSegment** ppComposedSegment) PURE; + STDMETHOD(Download) (THIS_ IUnknown *pAudioPath) PURE; + STDMETHOD(Unload) (THIS_ IUnknown *pAudioPath) PURE; +}; + +/*///////////////////////////////////////////////////////////////////// +// IDirectMusicSegmentState */ +#undef INTERFACE +#define INTERFACE IDirectMusicSegmentState +DECLARE_INTERFACE_(IDirectMusicSegmentState, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicSegmentState */ + STDMETHOD(GetRepeats) (THIS_ DWORD* pdwRepeats) PURE; + STDMETHOD(GetSegment ) (THIS_ IDirectMusicSegment** ppSegment) PURE; + STDMETHOD(GetStartTime) (THIS_ MUSIC_TIME* pmtStart) PURE; + STDMETHOD(GetSeek) (THIS_ MUSIC_TIME* pmtSeek) PURE; + STDMETHOD(GetStartPoint) (THIS_ MUSIC_TIME* pmtStart) PURE; +}; + +/*///////////////////////////////////////////////////////////////////// +// IDirectMusicSegmentState8 */ +#undef INTERFACE +#define INTERFACE IDirectMusicSegmentState8 +DECLARE_INTERFACE_(IDirectMusicSegmentState8, IDirectMusicSegmentState) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicSegmentState */ + STDMETHOD(GetRepeats) (THIS_ DWORD* pdwRepeats) PURE; + STDMETHOD(GetSegment ) (THIS_ IDirectMusicSegment** ppSegment) PURE; + STDMETHOD(GetStartTime) (THIS_ MUSIC_TIME* pmtStart) PURE; + STDMETHOD(GetSeek) (THIS_ MUSIC_TIME* pmtSeek) PURE; + STDMETHOD(GetStartPoint) (THIS_ MUSIC_TIME* pmtStart) PURE; + + /* IDirectMusicSegmentState8 */ + STDMETHOD(SetTrackConfig) (THIS_ REFGUID rguidTrackClassID, /* Class ID of the type of track on which to set the configuration flags. */ + DWORD dwGroupBits, /* Group bits. */ + DWORD dwIndex, /* Nth track (or DMUS_SEG_ALLTRACKS) that matches class id and group id. */ + DWORD dwFlagsOn, /* DMUS_TRACKCONFIG_ flags to enable. */ + DWORD dwFlagsOff) PURE; /* DMUS_TRACKCONFIG_ flags to disable. */ + STDMETHOD(GetObjectInPath) (THIS_ DWORD dwPChannel, /* PChannel to search. */ + DWORD dwStage, /* Which stage in the path. */ + DWORD dwBuffer, /* Which buffer to address, if more than one. */ + REFGUID guidObject, /* ClassID of object. */ + DWORD dwIndex, /* Which object of that class. */ + REFGUID iidInterface,/* Requested COM interface. */ + void ** ppObject) PURE; /* Pointer to interface. */ +}; + +/*//////////////////////////////////////////////////////////////////// +// IDirectMusicAudioPath */ +#undef INTERFACE +#define INTERFACE IDirectMusicAudioPath +DECLARE_INTERFACE_(IDirectMusicAudioPath, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicAudioPath */ + STDMETHOD(GetObjectInPath) (THIS_ DWORD dwPChannel, /* PChannel to search. */ + DWORD dwStage, /* Which stage in the path. */ + DWORD dwBuffer, /* Which buffer to address, if more than one. */ + REFGUID guidObject, /* ClassID of object. */ + DWORD dwIndex, /* Which object of that class. */ + REFGUID iidInterface,/* Requested COM interface. */ + void ** ppObject) PURE; /* Pointer to interface. */ + STDMETHOD(Activate) (THIS_ BOOL fActivate) PURE;/* True to activate, False to deactivate. */ + STDMETHOD(SetVolume) (THIS_ long lVolume, /* Gain, in 100ths of a dB. This must be negative (0 represents full volume.) */ + DWORD dwDuration) PURE;/* Duration of volume ramp in milliseconds. Note that 0 is more efficient. */ + STDMETHOD(ConvertPChannel) (THIS_ DWORD dwPChannelIn, /* Pchannel of source. */ + DWORD *pdwPChannelOut) PURE; /* Equivalent pchannel on performance. */ +}; + +typedef IDirectMusicAudioPath IDirectMusicAudioPath8; + +/*//////////////////////////////////////////////////////////////////// +// IDirectMusicPerformance */ +#undef INTERFACE +#define INTERFACE IDirectMusicPerformance +DECLARE_INTERFACE_(IDirectMusicPerformance, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicPerformance */ + STDMETHOD(Init) (THIS_ IDirectMusic** ppDirectMusic, + LPDIRECTSOUND pDirectSound, + HWND hWnd) PURE; + STDMETHOD(PlaySegment) (THIS_ IDirectMusicSegment* pSegment, + DWORD dwFlags, + __int64 i64StartTime, + IDirectMusicSegmentState** ppSegmentState) PURE; + STDMETHOD(Stop) (THIS_ IDirectMusicSegment* pSegment, + IDirectMusicSegmentState* pSegmentState, + MUSIC_TIME mtTime, + DWORD dwFlags) PURE; + STDMETHOD(GetSegmentState) (THIS_ IDirectMusicSegmentState** ppSegmentState, + MUSIC_TIME mtTime) PURE; + STDMETHOD(SetPrepareTime) (THIS_ DWORD dwMilliSeconds) PURE; + STDMETHOD(GetPrepareTime) (THIS_ DWORD* pdwMilliSeconds) PURE; + STDMETHOD(SetBumperLength) (THIS_ DWORD dwMilliSeconds) PURE; + STDMETHOD(GetBumperLength) (THIS_ DWORD* pdwMilliSeconds) PURE; + STDMETHOD(SendPMsg) (THIS_ DMUS_PMSG* pPMSG) PURE; + STDMETHOD(MusicToReferenceTime) (THIS_ MUSIC_TIME mtTime, + REFERENCE_TIME* prtTime) PURE; + STDMETHOD(ReferenceToMusicTime) (THIS_ REFERENCE_TIME rtTime, + MUSIC_TIME* pmtTime) PURE; + STDMETHOD(IsPlaying) (THIS_ IDirectMusicSegment* pSegment, + IDirectMusicSegmentState* pSegState) PURE; + STDMETHOD(GetTime) (THIS_ REFERENCE_TIME* prtNow, + MUSIC_TIME* pmtNow) PURE; + STDMETHOD(AllocPMsg) (THIS_ ULONG cb, + DMUS_PMSG** ppPMSG) PURE; + STDMETHOD(FreePMsg) (THIS_ DMUS_PMSG* pPMSG) PURE; + STDMETHOD(GetGraph) (THIS_ IDirectMusicGraph** ppGraph) PURE; + STDMETHOD(SetGraph) (THIS_ IDirectMusicGraph* pGraph) PURE; + STDMETHOD(SetNotificationHandle)(THIS_ HANDLE hNotification, + REFERENCE_TIME rtMinimum) PURE; + STDMETHOD(GetNotificationPMsg) (THIS_ DMUS_NOTIFICATION_PMSG** ppNotificationPMsg) PURE; + STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; + STDMETHOD(RemoveNotificationType)(THIS_ REFGUID rguidNotificationType) PURE; + STDMETHOD(AddPort) (THIS_ IDirectMusicPort* pPort) PURE; + STDMETHOD(RemovePort) (THIS_ IDirectMusicPort* pPort ) PURE; + STDMETHOD(AssignPChannelBlock) (THIS_ DWORD dwBlockNum, + IDirectMusicPort* pPort, + DWORD dwGroup ) PURE; + STDMETHOD(AssignPChannel) (THIS_ DWORD dwPChannel, + IDirectMusicPort* pPort, + DWORD dwGroup, + DWORD dwMChannel ) PURE; + STDMETHOD(PChannelInfo) (THIS_ DWORD dwPChannel, + IDirectMusicPort** ppPort, + DWORD* pdwGroup, + DWORD* pdwMChannel ) PURE; + STDMETHOD(DownloadInstrument) (THIS_ IDirectMusicInstrument* pInst, + DWORD dwPChannel, + IDirectMusicDownloadedInstrument** ppDownInst, + DMUS_NOTERANGE* pNoteRanges, + DWORD dwNumNoteRanges, + IDirectMusicPort** ppPort, + DWORD* pdwGroup, + DWORD* pdwMChannel ) PURE; + STDMETHOD(Invalidate) (THIS_ MUSIC_TIME mtTime, + DWORD dwFlags) PURE; + STDMETHOD(GetParam) (THIS_ REFGUID rguidType, + DWORD dwGroupBits, + DWORD dwIndex, + MUSIC_TIME mtTime, + MUSIC_TIME* pmtNext, + void* pParam) PURE; + STDMETHOD(SetParam) (THIS_ REFGUID rguidType, + DWORD dwGroupBits, + DWORD dwIndex, + MUSIC_TIME mtTime, + void* pParam) PURE; + STDMETHOD(GetGlobalParam) (THIS_ REFGUID rguidType, + void* pParam, + DWORD dwSize) PURE; + STDMETHOD(SetGlobalParam) (THIS_ REFGUID rguidType, + void* pParam, + DWORD dwSize) PURE; + STDMETHOD(GetLatencyTime) (THIS_ REFERENCE_TIME* prtTime) PURE; + STDMETHOD(GetQueueTime) (THIS_ REFERENCE_TIME* prtTime) PURE; + STDMETHOD(AdjustTime) (THIS_ REFERENCE_TIME rtAmount) PURE; + STDMETHOD(CloseDown) (THIS) PURE; + STDMETHOD(GetResolvedTime) (THIS_ REFERENCE_TIME rtTime, + REFERENCE_TIME* prtResolved, + DWORD dwTimeResolveFlags) PURE; + STDMETHOD(MIDIToMusic) (THIS_ BYTE bMIDIValue, + DMUS_CHORD_KEY* pChord, + BYTE bPlayMode, + BYTE bChordLevel, + WORD *pwMusicValue) PURE; + STDMETHOD(MusicToMIDI) (THIS_ WORD wMusicValue, + DMUS_CHORD_KEY* pChord, + BYTE bPlayMode, + BYTE bChordLevel, + BYTE *pbMIDIValue) PURE; + STDMETHOD(TimeToRhythm) (THIS_ MUSIC_TIME mtTime, + DMUS_TIMESIGNATURE *pTimeSig, + WORD *pwMeasure, + BYTE *pbBeat, + BYTE *pbGrid, + short *pnOffset) PURE; + STDMETHOD(RhythmToTime) (THIS_ WORD wMeasure, + BYTE bBeat, + BYTE bGrid, + short nOffset, + DMUS_TIMESIGNATURE *pTimeSig, + MUSIC_TIME *pmtTime) PURE; +}; + +/*//////////////////////////////////////////////////////////////////// +// IDirectMusicPerformance8 */ +#undef INTERFACE +#define INTERFACE IDirectMusicPerformance8 +DECLARE_INTERFACE_(IDirectMusicPerformance8, IDirectMusicPerformance) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicPerformance */ + STDMETHOD(Init) (THIS_ IDirectMusic** ppDirectMusic, + LPDIRECTSOUND pDirectSound, + HWND hWnd) PURE; + STDMETHOD(PlaySegment) (THIS_ IDirectMusicSegment* pSegment, + DWORD dwFlags, + __int64 i64StartTime, + IDirectMusicSegmentState** ppSegmentState) PURE; + STDMETHOD(Stop) (THIS_ IDirectMusicSegment* pSegment, + IDirectMusicSegmentState* pSegmentState, + MUSIC_TIME mtTime, + DWORD dwFlags) PURE; + STDMETHOD(GetSegmentState) (THIS_ IDirectMusicSegmentState** ppSegmentState, + MUSIC_TIME mtTime) PURE; + STDMETHOD(SetPrepareTime) (THIS_ DWORD dwMilliSeconds) PURE; + STDMETHOD(GetPrepareTime) (THIS_ DWORD* pdwMilliSeconds) PURE; + STDMETHOD(SetBumperLength) (THIS_ DWORD dwMilliSeconds) PURE; + STDMETHOD(GetBumperLength) (THIS_ DWORD* pdwMilliSeconds) PURE; + STDMETHOD(SendPMsg) (THIS_ DMUS_PMSG* pPMSG) PURE; + STDMETHOD(MusicToReferenceTime) (THIS_ MUSIC_TIME mtTime, + REFERENCE_TIME* prtTime) PURE; + STDMETHOD(ReferenceToMusicTime) (THIS_ REFERENCE_TIME rtTime, + MUSIC_TIME* pmtTime) PURE; + STDMETHOD(IsPlaying) (THIS_ IDirectMusicSegment* pSegment, + IDirectMusicSegmentState* pSegState) PURE; + STDMETHOD(GetTime) (THIS_ REFERENCE_TIME* prtNow, + MUSIC_TIME* pmtNow) PURE; + STDMETHOD(AllocPMsg) (THIS_ ULONG cb, + DMUS_PMSG** ppPMSG) PURE; + STDMETHOD(FreePMsg) (THIS_ DMUS_PMSG* pPMSG) PURE; + STDMETHOD(GetGraph) (THIS_ IDirectMusicGraph** ppGraph) PURE; + STDMETHOD(SetGraph) (THIS_ IDirectMusicGraph* pGraph) PURE; + STDMETHOD(SetNotificationHandle)(THIS_ HANDLE hNotification, + REFERENCE_TIME rtMinimum) PURE; + STDMETHOD(GetNotificationPMsg) (THIS_ DMUS_NOTIFICATION_PMSG** ppNotificationPMsg) PURE; + STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE; + STDMETHOD(RemoveNotificationType)(THIS_ REFGUID rguidNotificationType) PURE; + STDMETHOD(AddPort) (THIS_ IDirectMusicPort* pPort) PURE; + STDMETHOD(RemovePort) (THIS_ IDirectMusicPort* pPort ) PURE; + STDMETHOD(AssignPChannelBlock) (THIS_ DWORD dwBlockNum, + IDirectMusicPort* pPort, + DWORD dwGroup ) PURE; + STDMETHOD(AssignPChannel) (THIS_ DWORD dwPChannel, + IDirectMusicPort* pPort, + DWORD dwGroup, + DWORD dwMChannel ) PURE; + STDMETHOD(PChannelInfo) (THIS_ DWORD dwPChannel, + IDirectMusicPort** ppPort, + DWORD* pdwGroup, + DWORD* pdwMChannel ) PURE; + STDMETHOD(DownloadInstrument) (THIS_ IDirectMusicInstrument* pInst, + DWORD dwPChannel, + IDirectMusicDownloadedInstrument** ppDownInst, + DMUS_NOTERANGE* pNoteRanges, + DWORD dwNumNoteRanges, + IDirectMusicPort** ppPort, + DWORD* pdwGroup, + DWORD* pdwMChannel ) PURE; + STDMETHOD(Invalidate) (THIS_ MUSIC_TIME mtTime, + DWORD dwFlags) PURE; + STDMETHOD(GetParam) (THIS_ REFGUID rguidType, + DWORD dwGroupBits, + DWORD dwIndex, + MUSIC_TIME mtTime, + MUSIC_TIME* pmtNext, + void* pParam) PURE; + STDMETHOD(SetParam) (THIS_ REFGUID rguidType, + DWORD dwGroupBits, + DWORD dwIndex, + MUSIC_TIME mtTime, + void* pParam) PURE; + STDMETHOD(GetGlobalParam) (THIS_ REFGUID rguidType, + void* pParam, + DWORD dwSize) PURE; + STDMETHOD(SetGlobalParam) (THIS_ REFGUID rguidType, + void* pParam, + DWORD dwSize) PURE; + STDMETHOD(GetLatencyTime) (THIS_ REFERENCE_TIME* prtTime) PURE; + STDMETHOD(GetQueueTime) (THIS_ REFERENCE_TIME* prtTime) PURE; + STDMETHOD(AdjustTime) (THIS_ REFERENCE_TIME rtAmount) PURE; + STDMETHOD(CloseDown) (THIS) PURE; + STDMETHOD(GetResolvedTime) (THIS_ REFERENCE_TIME rtTime, + REFERENCE_TIME* prtResolved, + DWORD dwTimeResolveFlags) PURE; + STDMETHOD(MIDIToMusic) (THIS_ BYTE bMIDIValue, + DMUS_CHORD_KEY* pChord, + BYTE bPlayMode, + BYTE bChordLevel, + WORD *pwMusicValue) PURE; + STDMETHOD(MusicToMIDI) (THIS_ WORD wMusicValue, + DMUS_CHORD_KEY* pChord, + BYTE bPlayMode, + BYTE bChordLevel, + BYTE *pbMIDIValue) PURE; + STDMETHOD(TimeToRhythm) (THIS_ MUSIC_TIME mtTime, + DMUS_TIMESIGNATURE *pTimeSig, + WORD *pwMeasure, + BYTE *pbBeat, + BYTE *pbGrid, + short *pnOffset) PURE; + STDMETHOD(RhythmToTime) (THIS_ WORD wMeasure, + BYTE bBeat, + BYTE bGrid, + short nOffset, + DMUS_TIMESIGNATURE *pTimeSig, + MUSIC_TIME *pmtTime) PURE; + /* IDirectMusicPerformance8 */ + STDMETHOD(InitAudio) (THIS_ IDirectMusic** ppDirectMusic, /* Optional DirectMusic pointer. */ + IDirectSound** ppDirectSound, /* Optional DirectSound pointer. */ + HWND hWnd, /* HWND for DirectSound. */ + DWORD dwDefaultPathType, /* Requested default audio path type, also optional. */ + DWORD dwPChannelCount, /* Number of PChannels, if default audio path to be created. */ + DWORD dwFlags, /* DMUS_AUDIOF flags, if no pParams structure. */ + DMUS_AUDIOPARAMS *pParams) PURE; /* Optional initialization structure, defining required voices, buffers, etc. */ + STDMETHOD(PlaySegmentEx) (THIS_ IUnknown* pSource, /* Segment to play. */ + WCHAR *pwzSegmentName, /* Not supported in DX8. */ + IUnknown* pTransition, /* Optional template segment to compose transition with. */ + DWORD dwFlags, /* DMUS_SEGF_ flags. */ + __int64 i64StartTime, /* Time to start playback. */ + IDirectMusicSegmentState** ppSegmentState, /* Returned Segment State. */ + IUnknown *pFrom, /* Optional segmentstate or audiopath to replace. */ + IUnknown *pAudioPath) PURE; /* Optional audioPath to play on. */ + STDMETHOD(StopEx) (THIS_ IUnknown *pObjectToStop, /* Segstate, AudioPath, or Segment. */ + __int64 i64StopTime, + DWORD dwFlags) PURE; + STDMETHOD(ClonePMsg) (THIS_ DMUS_PMSG* pSourcePMSG, + DMUS_PMSG** ppCopyPMSG) PURE; + STDMETHOD(CreateAudioPath) (THIS_ IUnknown *pSourceConfig, /* Source configuration, from AudioPathConfig file. */ + BOOL fActivate, /* TRUE to activate on creation. */ + IDirectMusicAudioPath **ppNewPath) PURE; /* Returns created audiopath. */ + STDMETHOD(CreateStandardAudioPath)(THIS_ DWORD dwType, /* Type of path to create. */ + DWORD dwPChannelCount, /* How many PChannels to allocate for it. */ + BOOL fActivate, /* TRUE to activate on creation. */ + IDirectMusicAudioPath **ppNewPath) PURE; /* Returns created audiopath. */ + STDMETHOD(SetDefaultAudioPath) (THIS_ IDirectMusicAudioPath *pAudioPath) PURE; + STDMETHOD(GetDefaultAudioPath) (THIS_ IDirectMusicAudioPath **ppAudioPath) PURE; + STDMETHOD(GetParamEx) (THIS_ REFGUID rguidType, /* GetParam command ID. */ + DWORD dwTrackID, /* Virtual track ID of caller. */ + DWORD dwGroupBits, /* Group bits of caller. */ + DWORD dwIndex, /* Index to Nth parameter. */ + MUSIC_TIME mtTime, /* Time of requested parameter. */ + MUSIC_TIME* pmtNext, /* Returned delta to next parameter. */ + void* pParam) PURE; /* Data structure to fill with parameter. */ +}; + + + +/*//////////////////////////////////////////////////////////////////// +// IDirectMusicGraph */ +#undef INTERFACE +#define INTERFACE IDirectMusicGraph +DECLARE_INTERFACE_(IDirectMusicGraph, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicGraph */ + STDMETHOD(StampPMsg) (THIS_ DMUS_PMSG* pPMSG) PURE; + STDMETHOD(InsertTool) (THIS_ IDirectMusicTool* pTool, + DWORD* pdwPChannels, + DWORD cPChannels, + LONG lIndex) PURE; + STDMETHOD(GetTool) (THIS_ DWORD dwIndex, + IDirectMusicTool** ppTool) PURE; + STDMETHOD(RemoveTool) (THIS_ IDirectMusicTool* pTool) PURE; +}; + +typedef IDirectMusicGraph IDirectMusicGraph8; + + +/*///////////////////////////////////////////////////////////////////// +// IDirectMusicStyle */ +#undef INTERFACE +#define INTERFACE IDirectMusicStyle +DECLARE_INTERFACE_(IDirectMusicStyle, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicStyle */ + STDMETHOD(GetBand) (THIS_ WCHAR* pwszName, + IDirectMusicBand** ppBand) PURE; + STDMETHOD(EnumBand) (THIS_ DWORD dwIndex, + WCHAR *pwszName) PURE; + STDMETHOD(GetDefaultBand) (THIS_ IDirectMusicBand** ppBand) PURE; + STDMETHOD(EnumMotif) (THIS_ DWORD dwIndex, + WCHAR* pwszName) PURE; + STDMETHOD(GetMotif) (THIS_ WCHAR* pwszName, + IDirectMusicSegment** ppSegment) PURE; + STDMETHOD(GetDefaultChordMap) (THIS_ IDirectMusicChordMap** ppChordMap) PURE; + STDMETHOD(EnumChordMap) (THIS_ DWORD dwIndex, + WCHAR *pwszName) PURE; + STDMETHOD(GetChordMap) (THIS_ WCHAR* pwszName, + IDirectMusicChordMap** ppChordMap) PURE; + STDMETHOD(GetTimeSignature) (THIS_ DMUS_TIMESIGNATURE* pTimeSig) PURE; + STDMETHOD(GetEmbellishmentLength) (THIS_ DWORD dwType, + DWORD dwLevel, + DWORD* pdwMin, + DWORD* pdwMax) PURE; + STDMETHOD(GetTempo) (THIS_ double* pTempo) PURE; +}; + +/*///////////////////////////////////////////////////////////////////// +// IDirectMusicStyle8 */ +#undef INTERFACE +#define INTERFACE IDirectMusicStyle8 +DECLARE_INTERFACE_(IDirectMusicStyle8, IDirectMusicStyle) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicStyle */ + STDMETHOD(GetBand) (THIS_ WCHAR* pwszName, + IDirectMusicBand** ppBand) PURE; + STDMETHOD(EnumBand) (THIS_ DWORD dwIndex, + WCHAR *pwszName) PURE; + STDMETHOD(GetDefaultBand) (THIS_ IDirectMusicBand** ppBand) PURE; + STDMETHOD(EnumMotif) (THIS_ DWORD dwIndex, + WCHAR* pwszName) PURE; + STDMETHOD(GetMotif) (THIS_ WCHAR* pwszName, + IDirectMusicSegment** ppSegment) PURE; + STDMETHOD(GetDefaultChordMap) (THIS_ IDirectMusicChordMap** ppChordMap) PURE; + STDMETHOD(EnumChordMap) (THIS_ DWORD dwIndex, + WCHAR *pwszName) PURE; + STDMETHOD(GetChordMap) (THIS_ WCHAR* pwszName, + IDirectMusicChordMap** ppChordMap) PURE; + STDMETHOD(GetTimeSignature) (THIS_ DMUS_TIMESIGNATURE* pTimeSig) PURE; + STDMETHOD(GetEmbellishmentLength) (THIS_ DWORD dwType, + DWORD dwLevel, + DWORD* pdwMin, + DWORD* pdwMax) PURE; + STDMETHOD(GetTempo) (THIS_ double* pTempo) PURE; + + /* IDirectMusicStyle8 */ + STDMETHOD(EnumPattern) (THIS_ DWORD dwIndex, + DWORD dwPatternType, + WCHAR* pwszName) PURE; +}; + +/*///////////////////////////////////////////////////////////////////// +// IDirectMusicChordMap */ +#undef INTERFACE +#define INTERFACE IDirectMusicChordMap +DECLARE_INTERFACE_(IDirectMusicChordMap, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicChordMap */ + STDMETHOD(GetScale) (THIS_ DWORD* pdwScale) PURE; +}; + +typedef IDirectMusicChordMap IDirectMusicChordMap8; + +/*///////////////////////////////////////////////////////////////////// +// IDirectMusicComposer */ +#undef INTERFACE +#define INTERFACE IDirectMusicComposer +DECLARE_INTERFACE_(IDirectMusicComposer, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicComposer */ + STDMETHOD(ComposeSegmentFromTemplate) (THIS_ IDirectMusicStyle* pStyle, + IDirectMusicSegment* pTemplate, + WORD wActivity, + IDirectMusicChordMap* pChordMap, + IDirectMusicSegment** ppSegment) PURE; + STDMETHOD(ComposeSegmentFromShape) (THIS_ IDirectMusicStyle* pStyle, + WORD wNumMeasures, + WORD wShape, + WORD wActivity, + BOOL fIntro, + BOOL fEnd, + IDirectMusicChordMap* pChordMap, + IDirectMusicSegment** ppSegment ) PURE; + STDMETHOD(ComposeTransition) (THIS_ IDirectMusicSegment* pFromSeg, + IDirectMusicSegment* pToSeg, + MUSIC_TIME mtTime, + WORD wCommand, + DWORD dwFlags, + IDirectMusicChordMap* pChordMap, + IDirectMusicSegment** ppTransSeg) PURE; + STDMETHOD(AutoTransition) (THIS_ IDirectMusicPerformance* pPerformance, + IDirectMusicSegment* pToSeg, + WORD wCommand, + DWORD dwFlags, + IDirectMusicChordMap* pChordMap, + IDirectMusicSegment** ppTransSeg, + IDirectMusicSegmentState** ppToSegState, + IDirectMusicSegmentState** ppTransSegState) PURE; + STDMETHOD(ComposeTemplateFromShape) (THIS_ WORD wNumMeasures, + WORD wShape, + BOOL fIntro, + BOOL fEnd, + WORD wEndLength, + IDirectMusicSegment** ppTemplate) PURE; + STDMETHOD(ChangeChordMap) (THIS_ IDirectMusicSegment* pSegment, + BOOL fTrackScale, + IDirectMusicChordMap* pChordMap) PURE; +}; + +typedef IDirectMusicComposer IDirectMusicComposer8; + +/*///////////////////////////////////////////////////////////////////// +// IDirectMusicPatternTrack */ + +#undef INTERFACE +#define INTERFACE IDirectMusicPatternTrack +DECLARE_INTERFACE_(IDirectMusicPatternTrack, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicPatternTrack */ + STDMETHOD(CreateSegment) (THIS_ IDirectMusicStyle* pStyle, + IDirectMusicSegment** ppSegment) PURE; + STDMETHOD(SetVariation) (THIS_ IDirectMusicSegmentState* pSegState, + DWORD dwVariationFlags, + DWORD dwPart) PURE; + STDMETHOD(SetPatternByName) (THIS_ IDirectMusicSegmentState* pSegState, + WCHAR* wszName, + IDirectMusicStyle* pStyle, + DWORD dwPatternType, + DWORD* pdwLength) PURE; +}; + +typedef IDirectMusicPatternTrack IDirectMusicPatternTrack8; + +/*///////////////////////////////////////////////////////////////////// +// IDirectMusicScript */ + +#undef INTERFACE +#define INTERFACE IDirectMusicScript +DECLARE_INTERFACE_(IDirectMusicScript, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicScript */ + STDMETHOD(Init) (THIS_ IDirectMusicPerformance *pPerformance, + DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; + STDMETHOD(CallRoutine) (THIS_ WCHAR *pwszRoutineName, + DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; + STDMETHOD(SetVariableVariant) (THIS_ WCHAR *pwszVariableName, + VARIANT varValue, + BOOL fSetRef, + DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; + STDMETHOD(GetVariableVariant) (THIS_ WCHAR *pwszVariableName, + VARIANT *pvarValue, + DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; + STDMETHOD(SetVariableNumber) (THIS_ WCHAR *pwszVariableName, + LONG lValue, + DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; + STDMETHOD(GetVariableNumber) (THIS_ WCHAR *pwszVariableName, + LONG *plValue, + DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; + STDMETHOD(SetVariableObject) (THIS_ WCHAR *pwszVariableName, + IUnknown *punkValue, + DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; + STDMETHOD(GetVariableObject) (THIS_ WCHAR *pwszVariableName, + REFIID riid, + LPVOID FAR *ppv, + DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE; + STDMETHOD(EnumRoutine) (THIS_ DWORD dwIndex, + WCHAR *pwszName) PURE; + STDMETHOD(EnumVariable) (THIS_ DWORD dwIndex, + WCHAR *pwszName) PURE; +}; + +typedef IDirectMusicScript IDirectMusicScript8; + +/*///////////////////////////////////////////////////////////////////// +// IDirectMusicContainer */ + +#undef INTERFACE +#define INTERFACE IDirectMusicContainer +DECLARE_INTERFACE_(IDirectMusicContainer, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicContainer */ + STDMETHOD(EnumObject) (THIS_ REFGUID rguidClass, + DWORD dwIndex, + LPDMUS_OBJECTDESC pDesc, + WCHAR *pwszAlias) PURE; +}; + +typedef IDirectMusicContainer IDirectMusicContainer8; + +/* CLSID's */ +DEFINE_GUID(CLSID_DirectMusicPerformance,0xd2ac2881, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicSegment,0xd2ac2882, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicSegmentState,0xd2ac2883, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicGraph,0xd2ac2884, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicStyle,0xd2ac288a, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicChordMap,0xd2ac288f, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicComposer,0xd2ac2890, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicLoader,0xd2ac2892, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicBand,0x79ba9e00, 0xb6ee, 0x11d1, 0x86, 0xbe, 0x0, 0xc0, 0x4f, 0xbf, 0x8f, 0xef); + +/* New CLSID's for DX8 */ +DEFINE_GUID(CLSID_DirectMusicPatternTrack,0xd2ac2897, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(CLSID_DirectMusicScript,0x810b5013, 0xe88d, 0x11d2, 0x8b, 0xc1, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {810B5013-E88D-11d2-8BC1-00600893B1B6} */ +DEFINE_GUID(CLSID_DirectMusicContainer,0x9301e380, 0x1f22, 0x11d3, 0x82, 0x26, 0xd2, 0xfa, 0x76, 0x25, 0x5d, 0x47); +DEFINE_GUID(CLSID_DirectSoundWave,0x8a667154, 0xf9cb, 0x11d2, 0xad, 0x8a, 0x0, 0x60, 0xb0, 0x57, 0x5a, 0xbc); +DEFINE_GUID(CLSID_DirectMusicAudioPathConfig,0xee0b9ca0, 0xa81e, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74); + +/* Special GUID for all object types. This is used by the loader. */ +DEFINE_GUID(GUID_DirectMusicAllTypes,0xd2ac2893, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Notification guids */ +DEFINE_GUID(GUID_NOTIFICATION_SEGMENT,0xd2ac2899, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(GUID_NOTIFICATION_PERFORMANCE,0x81f75bc5, 0x4e5d, 0x11d2, 0xbc, 0xc7, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); +DEFINE_GUID(GUID_NOTIFICATION_MEASUREANDBEAT,0xd2ac289a, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(GUID_NOTIFICATION_CHORD,0xd2ac289b, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(GUID_NOTIFICATION_COMMAND,0xd2ac289c, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(GUID_NOTIFICATION_RECOMPOSE, 0xd348372b, 0x945b, 0x45ae, 0xa5, 0x22, 0x45, 0xf, 0x12, 0x5b, 0x84, 0xa5); + +/* Track param type guids */ +/* Use to get/set a DMUS_COMMAND_PARAM param in the Command track */ +DEFINE_GUID(GUID_CommandParam,0xd2ac289d, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Use to get a DMUS_COMMAND_PARAM_2 param in the Command track */ +DEFINE_GUID(GUID_CommandParam2, 0x28f97ef7, 0x9538, 0x11d2, 0x97, 0xa9, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58); + +/* Use to get/set a DMUS_COMMAND_PARAM_2 param to be used as the command following all commands in +the Command track (this information can't be saved) */ +DEFINE_GUID(GUID_CommandParamNext, 0x472afe7a, 0x281b, 0x11d3, 0x81, 0x7d, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58); + +/* Use to get/set a DMUS_CHORD_PARAM param in the Chord track */ +DEFINE_GUID(GUID_ChordParam,0xd2ac289e, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Use to get a DMUS_RHYTHM_PARAM param in the Chord track */ +DEFINE_GUID(GUID_RhythmParam,0xd2ac289f, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Use to get/set an IDirectMusicStyle param in the Style track */ +DEFINE_GUID(GUID_IDirectMusicStyle,0xd2ac28a1, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Use to get a DMUS_TIMESIGNATURE param in the Style and TimeSig tracks */ +DEFINE_GUID(GUID_TimeSignature,0xd2ac28a4, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Use to get/set a DMUS_TEMPO_PARAM param in the Tempo track */ +DEFINE_GUID(GUID_TempoParam,0xd2ac28a5, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Use to get the next valid point in a segment at which it may start */ +DEFINE_GUID(GUID_Valid_Start_Time,0x7f6b1760, 0x1fdb, 0x11d3, 0x82, 0x26, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); + +/* Use to get the next point in the currently playing primary segment at which a new segment may start */ +DEFINE_GUID(GUID_Play_Marker,0xd8761a41, 0x801a, 0x11d3, 0x9b, 0xd1, 0xda, 0xf7, 0xe1, 0xc3, 0xd8, 0x34); + +/* Use to get (GetParam) or add (SetParam) bands in the Band track */ +DEFINE_GUID(GUID_BandParam,0x2bb1938, 0xcb8b, 0x11d2, 0x8b, 0xb9, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); +typedef struct _DMUS_BAND_PARAM +{ + MUSIC_TIME mtTimePhysical; /* Note: If this is a clock-time track, then this field is interpreted in the track's internal time format, which is the number of milliseconds after the beginning of playback. */ + IDirectMusicBand *pBand; +} DMUS_BAND_PARAM; + +/* Obsolete -- doesn't distinguish physical and logical time. Use GUID_BandParam instead. */ +DEFINE_GUID(GUID_IDirectMusicBand,0xd2ac28ac, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Use to get/set an IDirectMusicChordMap param in the ChordMap track */ +DEFINE_GUID(GUID_IDirectMusicChordMap,0xd2ac28ad, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Use to get/set a DMUS_MUTE_PARAM param in the Mute track */ +DEFINE_GUID(GUID_MuteParam,0xd2ac28af, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* These guids are used in IDirectMusicSegment::SetParam to tell the band track to perform various actions. + Some of these guids (where noted) also apply to wave tracks. + */ +/* Download bands/waves for the IDirectMusicSegment */ +DEFINE_GUID(GUID_Download,0xd2ac28a7, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Unload bands/waves for the IDirectMusicSegment */ +DEFINE_GUID(GUID_Unload,0xd2ac28a8, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Connect segment's bands to an IDirectMusicCollection */ +DEFINE_GUID(GUID_ConnectToDLSCollection, 0x1db1ae6b, 0xe92e, 0x11d1, 0xa8, 0xc5, 0x0, 0xc0, 0x4f, 0xa3, 0x72, 0x6e); + +/* Enable/disable autodownloading of bands/waves */ +DEFINE_GUID(GUID_Enable_Auto_Download,0xd2ac28a9, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(GUID_Disable_Auto_Download,0xd2ac28aa, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Clear all bands */ +DEFINE_GUID(GUID_Clear_All_Bands,0xd2ac28ab, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Set segment to manage all program changes, bank selects, etc. for simple playback of a standard MIDI file */ +DEFINE_GUID(GUID_StandardMIDIFile, 0x6621075, 0xe92e, 0x11d1, 0xa8, 0xc5, 0x0, 0xc0, 0x4f, 0xa3, 0x72, 0x6e); +/* For compatibility with beta releases... */ +#define GUID_IgnoreBankSelectForGM GUID_StandardMIDIFile + +/* Disable/enable param guids. Use these in SetParam calls to disable or enable sending + * specific PMsg types. + */ +DEFINE_GUID(GUID_DisableTimeSig, 0x45fc707b, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); +DEFINE_GUID(GUID_EnableTimeSig, 0x45fc707c, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); +DEFINE_GUID(GUID_DisableTempo, 0x45fc707d, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); +DEFINE_GUID(GUID_EnableTempo, 0x45fc707e, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); + +/* Used in SetParam calls for pattern-based tracks. A nonzero value seeds the random number +generator for variation selection; a value of zero reverts to the default behavior of +getting the seed from the system clock. +*/ +DEFINE_GUID(GUID_SeedVariations, 0x65b76fa5, 0xff37, 0x11d2, 0x81, 0x4e, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58); + +/* Used to get the variations currently in effect across PChannels */ +DEFINE_GUID(GUID_Variations, 0x11f72cce, 0x26e6, 0x4ecd, 0xaf, 0x2e, 0xd6, 0x68, 0xe6, 0x67, 0x7, 0xd8); +typedef struct _DMUS_VARIATIONS_PARAM +{ + DWORD dwPChannelsUsed; /* number of PChannels in use */ + DWORD* padwPChannels; /* array of PChannels in use */ + DWORD* padwVariations; /* array of variations in effect for each PChannel */ +} DMUS_VARIATIONS_PARAM; + +/* Download bands/waves for the IDirectMusicSegment, passed an IDirectMusicAudioPath instead of an IDirectMusicPerformance */ +DEFINE_GUID(GUID_DownloadToAudioPath,0x9f2c0341, 0xc5c4, 0x11d3, 0x9b, 0xd1, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); + +/* Unload bands/waves for the IDirectMusicSegment, passed an IDirectMusicAudioPath instead of an IDirectMusicPerformance */ +DEFINE_GUID(GUID_UnloadFromAudioPath,0x9f2c0342, 0xc5c4, 0x11d3, 0x9b, 0xd1, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); + + +/* Global data guids */ +DEFINE_GUID(GUID_PerfMasterTempo,0xd2ac28b0, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(GUID_PerfMasterVolume,0xd2ac28b1, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(GUID_PerfMasterGrooveLevel,0xd2ac28b2, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(GUID_PerfAutoDownload, 0xfb09565b, 0x3631, 0x11d2, 0xbc, 0xb8, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); + +/* GUID for default GM/GS dls collection. */ +DEFINE_GUID(GUID_DefaultGMCollection, 0xf17e8673, 0xc3b4, 0x11d1, 0x87, 0xb, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* GUID to define default synth, placed in AudioPath configuration file. */ +DEFINE_GUID(GUID_Synth_Default,0x26bb9432, 0x45fe, 0x48d3, 0xa3, 0x75, 0x24, 0x72, 0xc5, 0xe3, 0xe7, 0x86); + +/* GUIDs to define default buffer configurations to place in AudioPath configuration file. */ +DEFINE_GUID(GUID_Buffer_Reverb,0x186cc541, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74); +DEFINE_GUID(GUID_Buffer_EnvReverb,0x186cc542, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74); +DEFINE_GUID(GUID_Buffer_Stereo,0x186cc545, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74); +DEFINE_GUID(GUID_Buffer_3D_Dry,0x186cc546, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74); +DEFINE_GUID(GUID_Buffer_Mono,0x186cc547, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74); + +/* IID's */ +DEFINE_GUID(IID_IDirectMusicLoader, 0x2ffaaca2, 0x5dca, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); +DEFINE_GUID(IID_IDirectMusicGetLoader,0x68a04844, 0xd13d, 0x11d1, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); +DEFINE_GUID(IID_IDirectMusicObject,0xd2ac28b5, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(IID_IDirectMusicSegment, 0xf96029a2, 0x4282, 0x11d2, 0x87, 0x17, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(IID_IDirectMusicSegmentState, 0xa3afdcc7, 0xd3ee, 0x11d1, 0xbc, 0x8d, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); +DEFINE_GUID(IID_IDirectMusicPerformance,0x7d43d03, 0x6523, 0x11d2, 0x87, 0x1d, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(IID_IDirectMusicGraph,0x2befc277, 0x5497, 0x11d2, 0xbc, 0xcb, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb); +DEFINE_GUID(IID_IDirectMusicStyle,0xd2ac28bd, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(IID_IDirectMusicChordMap,0xd2ac28be, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(IID_IDirectMusicComposer,0xd2ac28bf, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); +DEFINE_GUID(IID_IDirectMusicBand,0xd2ac28c0, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Alternate interface IDs, available in DX7 release and after. */ +DEFINE_GUID(IID_IDirectMusicPerformance2,0x6fc2cae0, 0xbc78, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); +DEFINE_GUID(IID_IDirectMusicSegment2, 0xd38894d1, 0xc052, 0x11d2, 0x87, 0x2f, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd); + +/* Interface IDs for DX8 */ +/* changed interfaces (GUID only) */ +DEFINE_GUID(IID_IDirectMusicLoader8, 0x19e7c08c, 0xa44, 0x4e6a, 0xa1, 0x16, 0x59, 0x5a, 0x7c, 0xd5, 0xde, 0x8c); +DEFINE_GUID(IID_IDirectMusicPerformance8, 0x679c4137, 0xc62e, 0x4147, 0xb2, 0xb4, 0x9d, 0x56, 0x9a, 0xcb, 0x25, 0x4c); +DEFINE_GUID(IID_IDirectMusicSegment8,0xc6784488, 0x41a3, 0x418f, 0xaa, 0x15, 0xb3, 0x50, 0x93, 0xba, 0x42, 0xd4); +DEFINE_GUID(IID_IDirectMusicSegmentState8, 0xa50e4730, 0xae4, 0x48a7, 0x98, 0x39, 0xbc, 0x4, 0xbf, 0xe0, 0x77, 0x72); +DEFINE_GUID(IID_IDirectMusicStyle8, 0xfd24ad8a, 0xa260, 0x453d, 0xbf, 0x50, 0x6f, 0x93, 0x84, 0xf7, 0x9, 0x85); +/* new interfaces (GUID + alias) */ +DEFINE_GUID(IID_IDirectMusicPatternTrack, 0x51c22e10, 0xb49f, 0x46fc, 0xbe, 0xc2, 0xe6, 0x28, 0x8f, 0xb9, 0xed, 0xe6); +#define IID_IDirectMusicPatternTrack8 IID_IDirectMusicPatternTrack +DEFINE_GUID(IID_IDirectMusicScript, 0x2252373a, 0x5814, 0x489b, 0x82, 0x9, 0x31, 0xfe, 0xde, 0xba, 0xf1, 0x37); /* {2252373A-5814-489b-8209-31FEDEBAF137} */ +#define IID_IDirectMusicScript8 IID_IDirectMusicScript +DEFINE_GUID(IID_IDirectMusicContainer, 0x9301e386, 0x1f22, 0x11d3, 0x82, 0x26, 0xd2, 0xfa, 0x76, 0x25, 0x5d, 0x47); +#define IID_IDirectMusicContainer8 IID_IDirectMusicContainer +DEFINE_GUID(IID_IDirectMusicAudioPath,0xc87631f5, 0x23be, 0x4986, 0x88, 0x36, 0x5, 0x83, 0x2f, 0xcc, 0x48, 0xf9); +#define IID_IDirectMusicAudioPath8 IID_IDirectMusicAudioPath +/* unchanged interfaces (alias only) */ +#define IID_IDirectMusicGetLoader8 IID_IDirectMusicGetLoader +#define IID_IDirectMusicChordMap8 IID_IDirectMusicChordMap +#define IID_IDirectMusicGraph8 IID_IDirectMusicGraph +#define IID_IDirectMusicBand8 IID_IDirectMusicBand +#define IID_IDirectMusicObject8 IID_IDirectMusicObject +#define IID_IDirectMusicComposer8 IID_IDirectMusicComposer + + +#ifdef __cplusplus +}; /* extern "C" */ +#endif + +#include + +#endif /* #ifndef _DMUSICI_ */ diff --git a/Src/Decoder_H264_ALL/D3D/include/dmusics.h b/Src/Decoder_H264_ALL/D3D/include/dmusics.h new file mode 100644 index 0000000..8f1e45d --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dmusics.h @@ -0,0 +1,193 @@ +/************************************************************************ +* * +* dmusics.h -- Definitions for created a DirectMusic software synth * +* * +* Copyright (c) Microsoft Corporation. All rights reserved. * +* * +************************************************************************/ + +#ifndef _DMUSICS_ +#define _DMUSICS_ + +#include "dmusicc.h" + +/* Software synths are enumerated from under this registry key. + */ +#define REGSTR_PATH_SOFTWARESYNTHS "Software\\Microsoft\\DirectMusic\\SoftwareSynths" + +interface IDirectMusicSynth; +interface IDirectMusicSynthSink; + +#ifndef __cplusplus +typedef interface IDirectMusicSynth IDirectMusicSynth; +typedef interface IDirectMusicSynthSink IDirectMusicSynthSink; +#endif + +#ifndef _DMUS_VOICE_STATE_DEFINED +#define _DMUS_VOICE_STATE_DEFINED + +typedef struct _DMUS_VOICE_STATE +{ + BOOL bExists; + SAMPLE_POSITION spPosition; +} DMUS_VOICE_STATE; + +#endif /* _DMUS_VOICE_STATE_DEFINED */ + +/* IDirectMusicSynth::Refresh + * + * This is the last buffer of the stream. It may be a partial block. + */ +#define REFRESH_F_LASTBUFFER 0x00000001 + +#undef INTERFACE +#define INTERFACE IDirectMusicSynth +DECLARE_INTERFACE_(IDirectMusicSynth, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicSynth */ + STDMETHOD(Open) (THIS_ LPDMUS_PORTPARAMS pPortParams) PURE; + STDMETHOD(Close) (THIS) PURE; + STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwGroups) PURE; + STDMETHOD(Download) (THIS_ LPHANDLE phDownload, + LPVOID pvData, + LPBOOL pbFree ) PURE; + STDMETHOD(Unload) (THIS_ HANDLE hDownload, + HRESULT ( CALLBACK *lpFreeHandle)(HANDLE,HANDLE), + HANDLE hUserData ) PURE; + STDMETHOD(PlayBuffer) (THIS_ REFERENCE_TIME rt, + LPBYTE pbBuffer, + DWORD cbBuffer) PURE; + STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE; + STDMETHOD(GetPortCaps) (THIS_ LPDMUS_PORTCAPS pCaps) PURE; + STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE; + STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE; + STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE; + STDMETHOD(SetSynthSink) (THIS_ IDirectMusicSynthSink *pSynthSink) PURE; + STDMETHOD(Render) (THIS_ short *pBuffer, + DWORD dwLength, + LONGLONG llPosition) PURE; + STDMETHOD(SetChannelPriority) (THIS_ DWORD dwChannelGroup, + DWORD dwChannel, + DWORD dwPriority) PURE; + STDMETHOD(GetChannelPriority) (THIS_ DWORD dwChannelGroup, + DWORD dwChannel, + LPDWORD pdwPriority) PURE; + STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pWaveFormatEx, + LPDWORD pdwWaveFormatExSize) PURE; + STDMETHOD(GetAppend) (THIS_ DWORD* pdwAppend) PURE; +}; + +#undef INTERFACE + +#define INTERFACE IDirectMusicSynth8 +DECLARE_INTERFACE_(IDirectMusicSynth8, IDirectMusicSynth) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicSynth */ + STDMETHOD(Open) (THIS_ LPDMUS_PORTPARAMS pPortParams) PURE; + STDMETHOD(Close) (THIS) PURE; + STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwGroups) PURE; + STDMETHOD(Download) (THIS_ LPHANDLE phDownload, + LPVOID pvData, + LPBOOL pbFree ) PURE; + STDMETHOD(Unload) (THIS_ HANDLE hDownload, + HRESULT ( CALLBACK *lpFreeHandle)(HANDLE,HANDLE), + HANDLE hUserData ) PURE; + STDMETHOD(PlayBuffer) (THIS_ REFERENCE_TIME rt, + LPBYTE pbBuffer, + DWORD cbBuffer) PURE; + STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE; + STDMETHOD(GetPortCaps) (THIS_ LPDMUS_PORTCAPS pCaps) PURE; + STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE; + STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE; + STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE; + STDMETHOD(SetSynthSink) (THIS_ IDirectMusicSynthSink *pSynthSink) PURE; + STDMETHOD(Render) (THIS_ short *pBuffer, + DWORD dwLength, + LONGLONG llPosition) PURE; + STDMETHOD(SetChannelPriority) (THIS_ DWORD dwChannelGroup, + DWORD dwChannel, + DWORD dwPriority) PURE; + STDMETHOD(GetChannelPriority) (THIS_ DWORD dwChannelGroup, + DWORD dwChannel, + LPDWORD pdwPriority) PURE; + STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pWaveFormatEx, + LPDWORD pdwWaveFormatExSize) PURE; + STDMETHOD(GetAppend) (THIS_ DWORD* pdwAppend) PURE; + + /* IDirectMusicSynth8 */ + STDMETHOD(PlayVoice) (THIS_ REFERENCE_TIME rt, + DWORD dwVoiceId, + DWORD dwChannelGroup, + DWORD dwChannel, + DWORD dwDLId, + long prPitch, /* PREL not defined here */ + long vrVolume, /* VREL not defined here */ + SAMPLE_TIME stVoiceStart, + SAMPLE_TIME stLoopStart, + SAMPLE_TIME stLoopEnd) PURE; + + STDMETHOD(StopVoice) (THIS_ REFERENCE_TIME rt, + DWORD dwVoiceId ) PURE; + + STDMETHOD(GetVoiceState) (THIS_ DWORD dwVoice[], + DWORD cbVoice, + DMUS_VOICE_STATE dwVoiceState[] ) PURE; + STDMETHOD(Refresh) (THIS_ DWORD dwDownloadID, + DWORD dwFlags) PURE; + STDMETHOD(AssignChannelToBuses) (THIS_ DWORD dwChannelGroup, + DWORD dwChannel, + LPDWORD pdwBuses, + DWORD cBuses) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectMusicSynthSink +DECLARE_INTERFACE_(IDirectMusicSynthSink, IUnknown) +{ + /* IUnknown */ + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectMusicSynthSink */ + STDMETHOD(Init) (THIS_ IDirectMusicSynth *pSynth) PURE; + STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE; + STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE; + STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE; + STDMETHOD(SampleToRefTime) (THIS_ LONGLONG llSampleTime, + REFERENCE_TIME *prfTime) PURE; + STDMETHOD(RefTimeToSample) (THIS_ REFERENCE_TIME rfTime, + LONGLONG *pllSampleTime) PURE; + STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound, + LPDIRECTSOUNDBUFFER pDirectSoundBuffer) PURE; + STDMETHOD(GetDesiredBufferSize) (THIS_ LPDWORD pdwBufferSizeInSamples) PURE; +}; + +DEFINE_GUID(IID_IDirectMusicSynth, 0x9823661, 0x5c85, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); +DEFINE_GUID(IID_IDirectMusicSynth8,0x53cab625, 0x2711, 0x4c9f, 0x9d, 0xe7, 0x1b, 0x7f, 0x92, 0x5f, 0x6f, 0xc8); +DEFINE_GUID(IID_IDirectMusicSynthSink,0x9823663, 0x5c85, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); + +/* Property Set GUID_DMUS_PROP_SetSynthSink + * + * Item 0: An IUnknown on which the port can QueryInterface for a user-mode synth sink. + */ +DEFINE_GUID(GUID_DMUS_PROP_SetSynthSink,0x0a3a5ba5, 0x37b6, 0x11d2, 0xb9, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); + +/* Property Set GUID_DMUS_PROP_SinkUsesDSound + * + * Item 0: A DWORD boolean indicating whether or not the sink requires an IDirectSound interface. The + * default is FALSE if this property item is not implemented by the sink. + */ +DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound, 0xbe208857, 0x8952, 0x11d2, 0xba, 0x1c, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); + +#endif diff --git a/Src/Decoder_H264_ALL/D3D/include/dpaddr.h b/Src/Decoder_H264_ALL/D3D/include/dpaddr.h new file mode 100644 index 0000000..6e3fccf --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dpaddr.h @@ -0,0 +1,392 @@ +/*==========================================================================; + * + * Copyright (C) 2000-2002 Microsoft Corporation. All Rights Reserved. + * + * File: dpaddr.h + * Content: DirectPlayAddress include file + ***************************************************************************/ + +#ifndef __DIRECTPLAYADDRESS__ +#define __DIRECTPLAYADDRESS__ + +#include // for DECLARE_INTERFACE_ and HRESULT + +#ifdef __cplusplus +extern "C" { +#endif + +#include "dplay8.h" + + + +/**************************************************************************** + * + * DirectPlay8Address CLSIDs + * + ****************************************************************************/ + +// {934A9523-A3CA-4bc5-ADA0-D6D95D979421} +DEFINE_GUID(CLSID_DirectPlay8Address, +0x934a9523, 0xa3ca, 0x4bc5, 0xad, 0xa0, 0xd6, 0xd9, 0x5d, 0x97, 0x94, 0x21); + + +/**************************************************************************** + * + * DirectPlay8Address Interface IIDs + * + ****************************************************************************/ + + +typedef REFIID DPNAREFIID; + +// {83783300-4063-4c8a-9DB3-82830A7FEB31} +DEFINE_GUID(IID_IDirectPlay8Address, +0x83783300, 0x4063, 0x4c8a, 0x9d, 0xb3, 0x82, 0x83, 0xa, 0x7f, 0xeb, 0x31); + +// {E5A0E990-2BAD-430b-87DA-A142CF75DE58} +DEFINE_GUID(IID_IDirectPlay8AddressIP, +0xe5a0e990, 0x2bad, 0x430b, 0x87, 0xda, 0xa1, 0x42, 0xcf, 0x75, 0xde, 0x58); + + + +/**************************************************************************** + * + * DirectPlay8Address Interface Pointer definitions + * + ****************************************************************************/ + +typedef struct IDirectPlay8Address *PDIRECTPLAY8ADDRESS, *LPDIRECTPLAY8ADDRESS; +typedef struct IDirectPlay8AddressIP *PDIRECTPLAY8ADDRESSIP, *LPDIRECTPLAY8ADDRESSIP; + + +/**************************************************************************** + * + * DirectPlay8Address Forward Declarations For External Types + * + ****************************************************************************/ + +typedef struct sockaddr SOCKADDR; + +/**************************************************************************** + * + * DirectPlay8Address Constants + * + ****************************************************************************/ +// +// Asynchronous operation flags +// +#define DPNA_DATATYPE_STRING 0x00000001 +#define DPNA_DATATYPE_DWORD 0x00000002 +#define DPNA_DATATYPE_GUID 0x00000003 +#define DPNA_DATATYPE_BINARY 0x00000004 +#define DPNA_DATATYPE_STRING_ANSI 0x00000005 + +#define DPNA_DPNSVR_PORT 6073 + +#define DPNA_INDEX_INVALID 0xFFFFFFFF + +/**************************************************************************** + * + * DirectPlay8Address Address Elements + * + ****************************************************************************/ + +#define DPNA_SEPARATOR_KEYVALUE L'=' +#define DPNA_SEPARATOR_USERDATA L'#' +#define DPNA_SEPARATOR_COMPONENT L';' +#define DPNA_ESCAPECHAR L'%' + +// Header +#define DPNA_HEADER L"x-directplay:/" + +// key names for address components +#define DPNA_KEY_NAT_RESOLVER L"natresolver" +#define DPNA_KEY_NAT_RESOLVER_USER_STRING L"natresolveruserstring" +#define DPNA_KEY_APPLICATION_INSTANCE L"applicationinstance" +#define DPNA_KEY_DEVICE L"device" +#define DPNA_KEY_HOSTNAME L"hostname" +#define DPNA_KEY_PORT L"port" +#define DPNA_KEY_NAMEINFO L"nameinfo" +#define DPNA_KEY_PROCESSOR L"processor" +#define DPNA_KEY_PROGRAM L"program" +#define DPNA_KEY_PROVIDER L"provider" +#define DPNA_KEY_SCOPE L"scope" +#define DPNA_KEY_TRAVERSALMODE L"traversalmode" +#define DPNA_KEY_BAUD L"baud" +#define DPNA_KEY_FLOWCONTROL L"flowcontrol" +#define DPNA_KEY_PARITY L"parity" +#define DPNA_KEY_PHONENUMBER L"phonenumber" +#define DPNA_KEY_STOPBITS L"stopbits" + +// values for baud rate +#define DPNA_BAUD_RATE_9600 9600 +#define DPNA_BAUD_RATE_14400 14400 +#define DPNA_BAUD_RATE_19200 19200 +#define DPNA_BAUD_RATE_38400 38400 +#define DPNA_BAUD_RATE_56000 56000 +#define DPNA_BAUD_RATE_57600 57600 +#define DPNA_BAUD_RATE_115200 115200 + +// values for stop bits +#define DPNA_STOP_BITS_ONE L"1" +#define DPNA_STOP_BITS_ONE_FIVE L"1.5" +#define DPNA_STOP_BITS_TWO L"2" + +// values for parity +#define DPNA_PARITY_NONE L"NONE" +#define DPNA_PARITY_EVEN L"EVEN" +#define DPNA_PARITY_ODD L"ODD" +#define DPNA_PARITY_MARK L"MARK" +#define DPNA_PARITY_SPACE L"SPACE" + +// values for flow control +#define DPNA_FLOW_CONTROL_NONE L"NONE" +#define DPNA_FLOW_CONTROL_XONXOFF L"XONXOFF" +#define DPNA_FLOW_CONTROL_RTS L"RTS" +#define DPNA_FLOW_CONTROL_DTR L"DTR" +#define DPNA_FLOW_CONTROL_RTSDTR L"RTSDTR" +// values for traversal mode +#define DPNA_TRAVERSALMODE_NONE 0 +#define DPNA_TRAVERSALMODE_PORTREQUIRED 1 +#define DPNA_TRAVERSALMODE_PORTRECOMMENDED 2 +// Shortcut values +// +// These can be used instead of the corresponding CLSID_DP8SP_XXXX guids +// +#define DPNA_VALUE_TCPIPPROVIDER L"IP" +#define DPNA_VALUE_IPXPROVIDER L"IPX" +#define DPNA_VALUE_MODEMPROVIDER L"MODEM" +#define DPNA_VALUE_SERIALPROVIDER L"SERIAL" + +//// ANSI DEFINITIONS + +// Header +#define DPNA_HEADER_A "x-directplay:/" +#define DPNA_SEPARATOR_KEYVALUE_A '=' +#define DPNA_SEPARATOR_USERDATA_A '#' +#define DPNA_SEPARATOR_COMPONENT_A ';' +#define DPNA_ESCAPECHAR_A '%' + +// key names for address components +#define DPNA_KEY_NAT_RESOLVER_A "natresolver" +#define DPNA_KEY_NAT_RESOLVER_USER_STRING_A "natresolveruserstring" +#define DPNA_KEY_APPLICATION_INSTANCE_A "applicationinstance" +#define DPNA_KEY_DEVICE_A "device" +#define DPNA_KEY_HOSTNAME_A "hostname" +#define DPNA_KEY_PORT_A "port" +#define DPNA_KEY_NAMEINFO_A "nameinfo" +#define DPNA_KEY_PROCESSOR_A "processor" +#define DPNA_KEY_PROGRAM_A "program" +#define DPNA_KEY_PROVIDER_A "provider" +#define DPNA_KEY_SCOPE_A "scope" +#define DPNA_KEY_TRAVERSALMODE_A "traversalmode" +#define DPNA_KEY_BAUD_A "baud" +#define DPNA_KEY_FLOWCONTROL_A "flowcontrol" +#define DPNA_KEY_PARITY_A "parity" +#define DPNA_KEY_PHONENUMBER_A "phonenumber" +#define DPNA_KEY_STOPBITS_A "stopbits" + +// values for stop bits +#define DPNA_STOP_BITS_ONE_A "1" +#define DPNA_STOP_BITS_ONE_FIVE_A "1.5" +#define DPNA_STOP_BITS_TWO_A "2" + +// values for parity +#define DPNA_PARITY_NONE_A "NONE" +#define DPNA_PARITY_EVEN_A "EVEN" +#define DPNA_PARITY_ODD_A "ODD" +#define DPNA_PARITY_MARK_A "MARK" +#define DPNA_PARITY_SPACE_A "SPACE" + +// values for flow control +#define DPNA_FLOW_CONTROL_NONE_A "NONE" +#define DPNA_FLOW_CONTROL_XONXOFF_A "XONXOFF" +#define DPNA_FLOW_CONTROL_RTS_A "RTS" +#define DPNA_FLOW_CONTROL_DTR_A "DTR" +#define DPNA_FLOW_CONTROL_RTSDTR_A "RTSDTR" +// Shortcut values +// +// These can be used instead of the corresponding CLSID_DP8SP_XXXX guids +// +#define DPNA_VALUE_TCPIPPROVIDER_A "IP" +#define DPNA_VALUE_IPXPROVIDER_A "IPX" +#define DPNA_VALUE_MODEMPROVIDER_A "MODEM" +#define DPNA_VALUE_SERIALPROVIDER_A "SERIAL" + +/**************************************************************************** + * + * DirectPlay8Address Functions + * + ****************************************************************************/ + + +/* + * + * This function is no longer supported. It is recommended that CoCreateInstance be used to create + * DirectPlay8 address objects. + * + * HRESULT WINAPI DirectPlay8AddressCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown); + * + */ + + +/**************************************************************************** + * + * DirectPlay8Address Application Interfaces + * + ****************************************************************************/ + +// +// COM definition for IDirectPlay8Address Generic Interface +// +#undef INTERFACE // External COM Implementation +#define INTERFACE IDirectPlay8Address +DECLARE_INTERFACE_(IDirectPlay8Address,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ DPNAREFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /*** IDirectPlay8Address methods ***/ + STDMETHOD(BuildFromURLW)(THIS_ WCHAR *pwszSourceURL ) PURE; + STDMETHOD(BuildFromURLA)(THIS_ CHAR *pszSourceURL ) PURE; + STDMETHOD(Duplicate)(THIS_ PDIRECTPLAY8ADDRESS *ppdpaNewAddress ) PURE; + STDMETHOD(SetEqual)(THIS_ PDIRECTPLAY8ADDRESS pdpaAddress ) PURE; + STDMETHOD(IsEqual)(THIS_ PDIRECTPLAY8ADDRESS pdpaAddress ) PURE; + STDMETHOD(Clear)(THIS ) PURE; + STDMETHOD(GetURLW)(THIS_ WCHAR *pwszURL, PDWORD pdwNumChars ) PURE; + STDMETHOD(GetURLA)(THIS_ CHAR *pszURL, PDWORD pdwNumChars) PURE; + STDMETHOD(GetSP)(THIS_ GUID *pguidSP ) PURE; + STDMETHOD(GetUserData)(THIS_ void *pvUserData, PDWORD pdwBufferSize) PURE; + STDMETHOD(SetSP)(THIS_ const GUID * const pguidSP ) PURE; + STDMETHOD(SetUserData)(THIS_ const void * const pvUserData, const DWORD dwDataSize) PURE; + STDMETHOD(GetNumComponents)(THIS_ PDWORD pdwNumComponents ) PURE; + STDMETHOD(GetComponentByName)(THIS_ const WCHAR * const pwszName, void *pvBuffer, PDWORD pdwBufferSize, PDWORD pdwDataType ) PURE; + STDMETHOD(GetComponentByIndex)(THIS_ const DWORD dwComponentID, WCHAR * pwszName, PDWORD pdwNameLen, void *pvBuffer, PDWORD pdwBufferSize, PDWORD pdwDataType ) PURE; + STDMETHOD(AddComponent)(THIS_ const WCHAR * const pwszName, const void * const lpvData, const DWORD dwDataSize, const DWORD dwDataType ) PURE; + STDMETHOD(GetDevice)(THIS_ GUID * ) PURE; + STDMETHOD(SetDevice)(THIS_ const GUID * const) PURE; + STDMETHOD(BuildFromDPADDRESS)( THIS_ LPVOID pvAddress, DWORD dwDataSize ) PURE; +}; + +// +// COM definition for IDirectPlay8AddressIP Generic Interface +// +#undef INTERFACE // External COM Implementation +#define INTERFACE IDirectPlay8AddressIP +DECLARE_INTERFACE_(IDirectPlay8AddressIP,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ DPNAREFIID, PVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /*** IDirectPlay8AddressIP methods ***/ + + // Constructs a IDirectPlay8 TCP Address from a SOCKADDR structure + STDMETHOD(BuildFromSockAddr)(THIS_ const SOCKADDR * const ) PURE; + + // Constructs a TCP Address from a string (hostname) and port + STDMETHOD(BuildAddress)(THIS_ const WCHAR * const wszAddress, const USHORT usPort ) PURE; + + // Builds a local TCP Address + STDMETHOD(BuildLocalAddress)(THIS_ const GUID * const pguidAdapter, const USHORT usPort ) PURE; + + // Gets the address from the structure in SOCKADR format + STDMETHOD(GetSockAddress)(THIS_ SOCKADDR *, PDWORD ) PURE; + + // Gets the local afddress + STDMETHOD(GetLocalAddress)(THIS_ GUID *pguidAdapter, USHORT *pusPort ) PURE; + + // Gets the remote address + STDMETHOD(GetAddress)(THIS_ WCHAR *wszAddress, PDWORD pdwAddressLength, USHORT *psPort ) PURE; +}; + + +/**************************************************************************** + * + * IDirectPlay8 application interface macros + * + ****************************************************************************/ + +#if !defined(__cplusplus) || defined(CINTERFACE) + +#define IDirectPlay8Address_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlay8Address_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlay8Address_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlay8Address_BuildFromURLW(p,a) (p)->lpVtbl->BuildFromURLW(p,a) +#define IDirectPlay8Address_BuildFromURLA(p,a) (p)->lpVtbl->BuildFromURLA(p,a) +#define IDirectPlay8Address_Duplicate(p,a) (p)->lpVtbl->Duplicate(p,a) +#define IDirectPlay8Address_SetEqual(p,a) (p)->lpVtbl->SetEqual(p,a) +#define IDirectPlay8Address_IsEqual(p,a) (p)->lpVtbl->IsEqual(p,a) +#define IDirectPlay8Address_Clear(p) (p)->lpVtbl->Clear(p) +#define IDirectPlay8Address_GetURLW(p,a,b) (p)->lpVtbl->GetURLW(p,a,b) +#define IDirectPlay8Address_GetURLA(p,a,b) (p)->lpVtbl->GetURLA(p,a,b) +#define IDirectPlay8Address_GetSP(p,a) (p)->lpVtbl->GetSP(p,a) +#define IDirectPlay8Address_GetUserData(p,a,b) (p)->lpVtbl->GetUserData(p,a,b) +#define IDirectPlay8Address_SetSP(p,a) (p)->lpVtbl->SetSP(p,a) +#define IDirectPlay8Address_SetUserData(p,a,b) (p)->lpVtbl->SetUserData(p,a,b) +#define IDirectPlay8Address_GetNumComponents(p,a) (p)->lpVtbl->GetNumComponents(p,a) +#define IDirectPlay8Address_GetComponentByName(p,a,b,c,d) (p)->lpVtbl->GetComponentByName(p,a,b,c,d) +#define IDirectPlay8Address_GetComponentByIndex(p,a,b,c,d,e,f) (p)->lpVtbl->GetComponentByIndex(p,a,b,c,d,e,f) +#define IDirectPlay8Address_AddComponent(p,a,b,c,d) (p)->lpVtbl->AddComponent(p,a,b,c,d) +#define IDirectPlay8Address_SetDevice(p,a) (p)->lpVtbl->SetDevice(p,a) +#define IDirectPlay8Address_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) +#define IDirectPlay8Address_BuildFromDirectPlay4Address(p,a,b) (p)->lpVtbl->BuildFromDirectPlay4Address(p,a,b) + +#define IDirectPlay8AddressIP_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlay8AddressIP_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlay8AddressIP_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlay8AddressIP_BuildFromSockAddr(p,a) (p)->lpVtbl->BuildFromSockAddr(p,a) +#define IDirectPlay8AddressIP_BuildAddress(p,a,b) (p)->lpVtbl->BuildAddress(p,a,b) +#define IDirectPlay8AddressIP_BuildLocalAddress(p,a,b) (p)->lpVtbl->BuildLocalAddress(p,a,b) +#define IDirectPlay8AddressIP_GetSockAddress(p,a,b) (p)->lpVtbl->GetSockAddress(p,a,b) +#define IDirectPlay8AddressIP_GetLocalAddress(p,a,b) (p)->lpVtbl->GetLocalAddress(p,a,b) +#define IDirectPlay8AddressIP_GetAddress(p,a,b,c) (p)->lpVtbl->GetAddress(p,a,b,c) + +#else /* C++ */ + +#define IDirectPlay8Address_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlay8Address_AddRef(p) (p)->AddRef() +#define IDirectPlay8Address_Release(p) (p)->Release() +#define IDirectPlay8Address_BuildFromURLW(p,a) (p)->BuildFromURLW(a) +#define IDirectPlay8Address_BuildFromURLA(p,a) (p)->BuildFromURLA(a) +#define IDirectPlay8Address_Duplicate(p,a) (p)->Duplicate(a) +#define IDirectPlay8Address_SetEqual(p,a) (p)->SetEqual(a) +#define IDirectPlay8Address_IsEqual(p,a) (p)->IsEqual(a) +#define IDirectPlay8Address_Clear(p) (p)->Clear() +#define IDirectPlay8Address_GetURLW(p,a,b) (p)->GetURLW(a,b) +#define IDirectPlay8Address_GetURLA(p,a,b) (p)->GetURLA(a,b) +#define IDirectPlay8Address_GetSP(p,a) (p)->GetSP(a) +#define IDirectPlay8Address_GetUserData(p,a,b) (p)->GetUserData(a,b) +#define IDirectPlay8Address_SetSP(p,a) (p)->SetSP(a) +#define IDirectPlay8Address_SetUserData(p,a,b) (p)->SetUserData(a,b) +#define IDirectPlay8Address_GetNumComponents(p,a) (p)->GetNumComponents(a) +#define IDirectPlay8Address_GetComponentByName(p,a,b,c,d) (p)->GetComponentByName(a,b,c,d) +#define IDirectPlay8Address_GetComponentByIndex(p,a,b,c,d,e,f) (p)->GetComponentByIndex(a,b,c,d,e,f) +#define IDirectPlay8Address_AddComponent(p,a,b,c,d) (p)->AddComponent(a,b,c,d) +#define IDirectPlay8Address_SetDevice(p,a) (p)->SetDevice(a) +#define IDirectPlay8Address_GetDevice(p,a) (p)->GetDevice(a) +#define IDirectPlay8Address_BuildFromDirectPlay4Address(p,a,b) (p)->BuildFromDirectPlay4Address(a,b) + +#define IDirectPlay8AddressIP_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlay8AddressIP_AddRef(p) (p)->AddRef() +#define IDirectPlay8AddressIP_Release(p) (p)->Release() +#define IDirectPlay8AddressIP_BuildFromSockAddr(p,a) (p)->BuildFromSockAddr(a) +#define IDirectPlay8AddressIP_BuildAddress(p,a,b) (p)->BuildAddress(a,b) +#define IDirectPlay8AddressIP_BuildLocalAddress(p,a,b) (p)->BuildLocalAddress(a,b) +#define IDirectPlay8AddressIP_GetSockAddress(p,a,b) (p)->GetSockAddress(a,b) +#define IDirectPlay8AddressIP_GetLocalAddress(p,a,b) (p)->GetLocalAddress(a,b) +#define IDirectPlay8AddressIP_GetAddress(p,a,b,c) (p)->GetAddress(a,b,c) + +#endif + + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/Src/Decoder_H264_ALL/D3D/include/dplay.h b/Src/Decoder_H264_ALL/D3D/include/dplay.h new file mode 100644 index 0000000..d91c0a5 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dplay.h @@ -0,0 +1,2154 @@ +/*==========================================================================; + * + * Copyright (C) 1994-1997 Microsoft Corporation. All Rights Reserved. + * + * File: dplay.h + * Content: DirectPlay include file + * + ***************************************************************************/ + +#ifndef __DPLAY_INCLUDED__ +#define __DPLAY_INCLUDED__ + +#include // for DECLARE_INTERFACE and HRESULT + +/* avoid warnings in MSVC at Level4 */ +#if _MSC_VER >= 1200 +#pragma warning(push) +#endif +#pragma warning(disable:4201) + + +/* + * Some types + */ + +#ifndef _WIN64 +#define DWORD_PTR DWORD +#endif + +typedef LPVOID (*LPRGLPVOID)[]; +typedef LPRGLPVOID PRGPVOID, LPRGPVOID, PRGLPVOID, PAPVOID, LPAPVOID, PALPVOID, LPALPVOID; + +#define VOL volatile +typedef VOID *VOL LPVOIDV; + + +#define _FACDP 0x877 +#define MAKE_DPHRESULT( code ) MAKE_HRESULT( 1, _FACDP, code ) + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * GUIDS used by DirectPlay objects + */ +DEFINE_GUID(IID_IDirectPlay2, 0x2b74f7c0, 0x9154, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3); +DEFINE_GUID(IID_IDirectPlay2A,0x9d460580, 0xa822, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82); + +DEFINE_GUID(IID_IDirectPlay3, 0x133efe40, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); +DEFINE_GUID(IID_IDirectPlay3A,0x133efe41, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); + +DEFINE_GUID(IID_IDirectPlay4, 0xab1c530, 0x4745, 0x11d1, 0xa7, 0xa1, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); +DEFINE_GUID(IID_IDirectPlay4A,0xab1c531, 0x4745, 0x11d1, 0xa7, 0xa1, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); + +// {D1EB6D20-8923-11d0-9D97-00A0C90A43CB} +DEFINE_GUID(CLSID_DirectPlay,0xd1eb6d20, 0x8923, 0x11d0, 0x9d, 0x97, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); + +/* + * GUIDS used by Service Providers shipped with DirectPlay + * Use these to identify Service Provider returned by EnumConnections + */ + +// GUID for IPX service provider +// {685BC400-9D2C-11cf-A9CD-00AA006886E3} +DEFINE_GUID(DPSPGUID_IPX, +0x685bc400, 0x9d2c, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3); + +// GUID for TCP/IP service provider +// 36E95EE0-8577-11cf-960C-0080C7534E82 +DEFINE_GUID(DPSPGUID_TCPIP, +0x36E95EE0, 0x8577, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82); + +// GUID for Serial service provider +// {0F1D6860-88D9-11cf-9C4E-00A0C905425E} +DEFINE_GUID(DPSPGUID_SERIAL, +0xf1d6860, 0x88d9, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); + +// GUID for Modem service provider +// {44EAA760-CB68-11cf-9C4E-00A0C905425E} +DEFINE_GUID(DPSPGUID_MODEM, +0x44eaa760, 0xcb68, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); + +/**************************************************************************** + * + * DirectPlay Structures + * + * Various structures used to invoke DirectPlay. + * + ****************************************************************************/ + +#ifndef IDIRECTPLAY2_OR_GREATER +typedef struct IDirectPlay FAR *LPDIRECTPLAY; +#else +typedef struct IUnknown FAR *LPDIRECTPLAY; +#endif + +typedef struct IDirectPlay2 FAR *LPDIRECTPLAY2; +typedef struct IDirectPlay2 FAR *LPDIRECTPLAY2A; +typedef struct IDirectPlay2 IDirectPlay2A; + +typedef struct IDirectPlay3 FAR *LPDIRECTPLAY3; +typedef struct IDirectPlay3 FAR *LPDIRECTPLAY3A; +typedef struct IDirectPlay3 IDirectPlay3A; + +typedef struct IDirectPlay4 FAR *LPDIRECTPLAY4; +typedef struct IDirectPlay4 FAR *LPDIRECTPLAY4A; +typedef struct IDirectPlay4 IDirectPlay4A; + +/* + * DPID + * DirectPlay player and group ID + */ +typedef DWORD DPID, FAR *LPDPID; + +/* + * DPID that system messages come from + */ +#define DPID_SYSMSG 0 + +/* + * DPID representing all players in the session + */ +#define DPID_ALLPLAYERS 0 + +/* + * DPID representing the server player + */ +#define DPID_SERVERPLAYER 1 + + +/* + * DPID representing the maxiumum ID in the range of DPID's reserved for + * use by DirectPlay. + */ +#define DPID_RESERVEDRANGE 100 + +/* + * The player ID is unknown (used with e.g. DPSESSION_NOMESSAGEID) + */ +#define DPID_UNKNOWN 0xFFFFFFFF + +/* + * DPCAPS + * Used to obtain the capabilities of a DirectPlay object + */ +typedef struct +{ + DWORD dwSize; // Size of structure, in bytes + DWORD dwFlags; // DPCAPS_xxx flags + DWORD dwMaxBufferSize; // Maximum message size, in bytes, for this service provider + DWORD dwMaxQueueSize; // Obsolete. + DWORD dwMaxPlayers; // Maximum players/groups (local + remote) + DWORD dwHundredBaud; // Bandwidth in 100 bits per second units; + // i.e. 24 is 2400, 96 is 9600, etc. + DWORD dwLatency; // Estimated latency; 0 = unknown + DWORD dwMaxLocalPlayers; // Maximum # of locally created players allowed + DWORD dwHeaderLength; // Maximum header length, in bytes, on messages + // added by the service provider + DWORD dwTimeout; // Service provider's suggested timeout value + // This is how long DirectPlay will wait for + // responses to system messages +} DPCAPS, FAR *LPDPCAPS; + +/* + * This DirectPlay object is the session host. If the host exits the + * session, another application will become the host and receive a + * DPSYS_HOST system message. + */ +#define DPCAPS_ISHOST 0x00000002 + +/* + * The service provider bound to this DirectPlay object can optimize + * group messaging. + */ +#define DPCAPS_GROUPOPTIMIZED 0x00000008 + +/* + * The service provider bound to this DirectPlay object can optimize + * keep alives (see DPSESSION_KEEPALIVE) + */ +#define DPCAPS_KEEPALIVEOPTIMIZED 0x00000010 + +/* + * The service provider bound to this DirectPlay object can optimize + * guaranteed message delivery. + */ +#define DPCAPS_GUARANTEEDOPTIMIZED 0x00000020 + +/* + * This DirectPlay object supports guaranteed message delivery. + */ +#define DPCAPS_GUARANTEEDSUPPORTED 0x00000040 + +/* + * This DirectPlay object supports digital signing of messages. + */ +#define DPCAPS_SIGNINGSUPPORTED 0x00000080 + +/* + * This DirectPlay object supports encryption of messages. + */ +#define DPCAPS_ENCRYPTIONSUPPORTED 0x00000100 + +/* + * This DirectPlay player was created on this machine + */ +#define DPPLAYERCAPS_LOCAL 0x00000800 + +/* + * Current Open settings supports all forms of Cancel + */ +#define DPCAPS_ASYNCCANCELSUPPORTED 0x00001000 + +/* + * Current Open settings supports CancelAll, but not Cancel + */ +#define DPCAPS_ASYNCCANCELALLSUPPORTED 0x00002000 + +/* + * Current Open settings supports Send Timeouts for sends + */ +#define DPCAPS_SENDTIMEOUTSUPPORTED 0x00004000 + +/* + * Current Open settings supports send priority + */ +#define DPCAPS_SENDPRIORITYSUPPORTED 0x00008000 + +/* + * Current Open settings supports DPSEND_ASYNC flag + */ +#define DPCAPS_ASYNCSUPPORTED 0x00010000 + + +/* + * DPSESSIONDESC2 + * Used to describe the properties of a DirectPlay + * session instance + */ +typedef struct +{ + DWORD dwSize; // Size of structure + DWORD dwFlags; // DPSESSION_xxx flags + GUID guidInstance; // ID for the session instance + GUID guidApplication; // GUID of the DirectPlay application. + // GUID_NULL for all applications. + DWORD dwMaxPlayers; // Maximum # players allowed in session + DWORD dwCurrentPlayers; // Current # players in session (read only) + union + { // Name of the session + LPWSTR lpszSessionName; // Unicode + LPSTR lpszSessionNameA; // ANSI + }; + union + { // Password of the session (optional) + LPWSTR lpszPassword; // Unicode + LPSTR lpszPasswordA; // ANSI + }; + DWORD_PTR dwReserved1; // Reserved for future MS use. + DWORD_PTR dwReserved2; + DWORD_PTR dwUser1; // For use by the application + DWORD_PTR dwUser2; + DWORD_PTR dwUser3; + DWORD_PTR dwUser4; +} DPSESSIONDESC2, FAR *LPDPSESSIONDESC2; + +typedef DPSESSIONDESC2 * VOL LPDPSESSIONDESC2_V; + +/* + * LPCDPSESSIONDESC2 + * A constant pointer to DPSESSIONDESC2 + */ +typedef const DPSESSIONDESC2 FAR *LPCDPSESSIONDESC2; + +/* + * Applications cannot create new players in this session. + */ +#define DPSESSION_NEWPLAYERSDISABLED 0x00000001 + +/* + * If the DirectPlay object that created the session, the host, + * quits, then the host will attempt to migrate to another + * DirectPlay object so that new players can continue to be created + * and new applications can join the session. + */ +#define DPSESSION_MIGRATEHOST 0x00000004 + +/* + * This flag tells DirectPlay not to set the idPlayerTo and idPlayerFrom + * fields in player messages. This cuts two DWORD's off the message + * overhead. + */ +#define DPSESSION_NOMESSAGEID 0x00000008 + + +/* + * This flag tells DirectPlay to not allow any new applications to + * join the session. Applications already in the session can still + * create new players. + */ +#define DPSESSION_JOINDISABLED 0x00000020 + +/* + * This flag tells DirectPlay to detect when remote players + * exit abnormally (e.g. their computer or modem gets unplugged) + */ +#define DPSESSION_KEEPALIVE 0x00000040 + +/* + * This flag tells DirectPlay not to send a message to all players + * when a players remote data changes + */ +#define DPSESSION_NODATAMESSAGES 0x00000080 + +/* + * This flag indicates that the session belongs to a secure server + * and needs user authentication + */ +#define DPSESSION_SECURESERVER 0x00000100 + +/* + * This flag indicates that the session is private and requirs a password + * for EnumSessions as well as Open. + */ +#define DPSESSION_PRIVATE 0x00000200 + +/* + * This flag indicates that the session requires a password for joining. + */ +#define DPSESSION_PASSWORDREQUIRED 0x00000400 + +/* + * This flag tells DirectPlay to route all messages through the server + */ +#define DPSESSION_MULTICASTSERVER 0x00000800 + +/* + * This flag tells DirectPlay to only download information about the + * DPPLAYER_SERVERPLAYER. + */ +#define DPSESSION_CLIENTSERVER 0x00001000 + +/* + * This flag tells DirectPlay to use the protocol built into dplay + * for reliability and statistics all the time. When this bit is + * set, only other sessions with this bit set can join or be joined. + */ +#define DPSESSION_DIRECTPLAYPROTOCOL 0x00002000 + +/* + * This flag tells DirectPlay that preserving order of received + * packets is not important, when using reliable delivery. This + * will allow messages to be indicated out of order if preceding + * messages have not yet arrived. Otherwise DPLAY will wait for + * earlier messages before delivering later reliable messages. + */ +#define DPSESSION_NOPRESERVEORDER 0x00004000 + + +/* + * This flag tells DirectPlay to optimize communication for latency + */ +#define DPSESSION_OPTIMIZELATENCY 0x00008000 + +/* + * This flag allows lobby launched games that aren't voice enabled + * to get voice capabilities. + */ +#define DPSESSION_ALLOWVOICERETRO 0x00010000 + +/* + * This flag supresses transmission of session desc changes. + * DPSESSION_NODATAMESSAGES was supposed to do that, but SetSessionDesc + * was ignoring the flag and some apps depended on the broken behavior, this + * flag allows applications to get the right behaviour without breaking apps depending + * on old broken behavior. + */ +#define DPSESSION_NOSESSIONDESCMESSAGES 0x00020000 + +/* + * DPNAME + * Used to hold the name of a DirectPlay entity + * like a player or a group + */ +typedef struct +{ + DWORD dwSize; // Size of structure + DWORD dwFlags; // Not used. Must be zero. + union + { // The short or friendly name + LPWSTR lpszShortName; // Unicode + LPSTR lpszShortNameA; // ANSI + }; + union + { // The long or formal name + LPWSTR lpszLongName; // Unicode + LPSTR lpszLongNameA; // ANSI + }; + +} DPNAME, FAR *LPDPNAME; + +/* + * LPCDPNAME + * A constant pointer to DPNAME + */ +typedef const DPNAME FAR *LPCDPNAME; + +/* + * DPCREDENTIALS + * Used to hold the user name and password of a DirectPlay user + */ +typedef struct +{ + DWORD dwSize; // Size of structure + DWORD dwFlags; // Not used. Must be zero. + union + { // User name of the account + LPWSTR lpszUsername; // Unicode + LPSTR lpszUsernameA; // ANSI + }; + union + { // Password of the account + LPWSTR lpszPassword; // Unicode + LPSTR lpszPasswordA; // ANSI + }; + union + { // Domain name of the account + LPWSTR lpszDomain; // Unicode + LPSTR lpszDomainA; // ANSI + }; +} DPCREDENTIALS, FAR *LPDPCREDENTIALS; + +typedef const DPCREDENTIALS FAR *LPCDPCREDENTIALS; + +/* + * DPSECURITYDESC + * Used to describe the security properties of a DirectPlay + * session instance + */ +typedef struct +{ + DWORD dwSize; // Size of structure + DWORD dwFlags; // Not used. Must be zero. + union + { // SSPI provider name + LPWSTR lpszSSPIProvider; // Unicode + LPSTR lpszSSPIProviderA; // ANSI + }; + union + { // CAPI provider name + LPWSTR lpszCAPIProvider; // Unicode + LPSTR lpszCAPIProviderA; // ANSI + }; + DWORD dwCAPIProviderType; // Crypto Service Provider type + DWORD dwEncryptionAlgorithm; // Encryption Algorithm type +} DPSECURITYDESC, FAR *LPDPSECURITYDESC; + +typedef const DPSECURITYDESC FAR *LPCDPSECURITYDESC; + +/* + * DPACCOUNTDESC + * Used to describe a user membership account + */ +typedef struct +{ + DWORD dwSize; // Size of structure + DWORD dwFlags; // Not used. Must be zero. + union + { // Account identifier + LPWSTR lpszAccountID; // Unicode + LPSTR lpszAccountIDA; // ANSI + }; +} DPACCOUNTDESC, FAR *LPDPACCOUNTDESC; + +typedef const DPACCOUNTDESC FAR *LPCDPACCOUNTDESC; + +/* + * LPCGUID + * A constant pointer to a guid + */ +typedef const GUID FAR *LPCGUID; + +/* + * DPLCONNECTION + * Used to hold all in the informaion needed to connect + * an application to a session or create a session + */ +typedef struct +{ + DWORD dwSize; // Size of this structure + DWORD dwFlags; // Flags specific to this structure + LPDPSESSIONDESC2 lpSessionDesc; // Pointer to session desc to use on connect + LPDPNAME lpPlayerName; // Pointer to Player name structure + GUID guidSP; // GUID of the DPlay SP to use + LPVOID lpAddress; // Address for service provider + DWORD dwAddressSize; // Size of address data +} DPLCONNECTION, FAR *LPDPLCONNECTION; + +/* + * LPCDPLCONNECTION + * A constant pointer to DPLCONNECTION + */ +typedef const DPLCONNECTION FAR *LPCDPLCONNECTION; + +/* + * DPCHAT + * Used to hold the a DirectPlay chat message + */ +typedef struct +{ + DWORD dwSize; + DWORD dwFlags; + union + { // Message string + LPWSTR lpszMessage; // Unicode + LPSTR lpszMessageA; // ANSI + }; +} DPCHAT, FAR * LPDPCHAT; + +/* + * SGBUFFER + * Scatter Gather Buffer used for SendEx + */ +typedef struct +{ + UINT len; // length of buffer data + PUCHAR pData; // pointer to buffer data +} SGBUFFER, *PSGBUFFER, FAR *LPSGBUFFER; + + +/**************************************************************************** + * + * Prototypes for DirectPlay callback functions + * + ****************************************************************************/ + +/* + * Callback for IDirectPlay2::EnumSessions + */ +typedef BOOL (FAR PASCAL * LPDPENUMSESSIONSCALLBACK2)( + LPCDPSESSIONDESC2 lpThisSD, + LPDWORD lpdwTimeOut, + DWORD dwFlags, + LPVOID lpContext ); + +/* + * This flag is set on the EnumSessions callback dwFlags parameter when + * the time out has occurred. There will be no session data for this + * callback. If *lpdwTimeOut is set to a non-zero value and the + * EnumSessionsCallback function returns TRUE then EnumSessions will + * continue waiting until the next timeout occurs. Timeouts are in + * milliseconds. + */ +#define DPESC_TIMEDOUT 0x00000001 + + +/* + * Callback for IDirectPlay2::EnumPlayers + * IDirectPlay2::EnumGroups + * IDirectPlay2::EnumGroupPlayers + */ +typedef BOOL (FAR PASCAL *LPDPENUMPLAYERSCALLBACK2)( + DPID dpId, + DWORD dwPlayerType, + LPCDPNAME lpName, + DWORD dwFlags, + LPVOID lpContext ); + + +/* + * Unicode callback for DirectPlayEnumerate + * This callback prototype will be used if compiling + * for Unicode strings + */ +typedef BOOL (FAR PASCAL * LPDPENUMDPCALLBACK)( + LPGUID lpguidSP, + LPWSTR lpSPName, + DWORD dwMajorVersion, + DWORD dwMinorVersion, + LPVOID lpContext); + +/* + * ANSI callback for DirectPlayEnumerate + * This callback prototype will be used if compiling + * for ANSI strings + */ +typedef BOOL (FAR PASCAL * LPDPENUMDPCALLBACKA)( + LPGUID lpguidSP, + LPSTR lpSPName, + DWORD dwMajorVersion, + DWORD dwMinorVersion, + LPVOID lpContext); + +/* + * Callback for IDirectPlay3(A)::EnumConnections + */ +typedef BOOL (FAR PASCAL * LPDPENUMCONNECTIONSCALLBACK)( + LPCGUID lpguidSP, + LPVOID lpConnection, + DWORD dwConnectionSize, + LPCDPNAME lpName, + DWORD dwFlags, + LPVOID lpContext); + + +/* + * API's + */ + +#ifdef UNICODE +#define DirectPlayEnumerate DirectPlayEnumerateW +#else +#define DirectPlayEnumerate DirectPlayEnumerateA +#endif // UNICODE + +extern HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA, LPVOID ); +extern HRESULT WINAPI DirectPlayEnumerateW( LPDPENUMDPCALLBACK, LPVOID ); +extern HRESULT WINAPI DirectPlayCreate( LPGUID lpGUID, LPDIRECTPLAY *lplpDP, IUnknown *pUnk); + +/**************************************************************************** + * + * IDirectPlay2 (and IDirectPlay2A) Interface + * + ****************************************************************************/ + +#undef INTERFACE +#define INTERFACE IDirectPlay2 +DECLARE_INTERFACE_( IDirectPlay2, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectPlay2 methods ***/ + STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; + STDMETHOD(Close) (THIS) PURE; + STDMETHOD(CreateGroup) (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; + STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; + STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; + STDMETHOD(EnumGroupPlayers) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; + STDMETHOD(EnumGroups) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; + STDMETHOD(EnumPlayers) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; + STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE; + STDMETHOD(GetCaps) (THIS_ LPDPCAPS,DWORD) PURE; + STDMETHOD(GetGroupData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; + STDMETHOD(GetGroupName) (THIS_ DPID,LPVOID,LPDWORD) PURE; + STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; + STDMETHOD(GetPlayerAddress) (THIS_ DPID,LPVOID,LPDWORD) PURE; + STDMETHOD(GetPlayerCaps) (THIS_ DPID,LPDPCAPS,DWORD) PURE; + STDMETHOD(GetPlayerData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; + STDMETHOD(GetPlayerName) (THIS_ DPID,LPVOID,LPDWORD) PURE; + STDMETHOD(GetSessionDesc) (THIS_ LPVOID,LPDWORD) PURE; + STDMETHOD(Initialize) (THIS_ LPGUID) PURE; + STDMETHOD(Open) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; + STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; + STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; + STDMETHOD(SetGroupData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(SetGroupName) (THIS_ DPID,LPDPNAME,DWORD) PURE; + STDMETHOD(SetPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(SetPlayerName) (THIS_ DPID,LPDPNAME,DWORD) PURE; + STDMETHOD(SetSessionDesc) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; +}; + +/**************************************************************************** + * + * IDirectPlay2 interface macros + * + ****************************************************************************/ + +#if !defined(__cplusplus) || defined(CINTERFACE) + +#define IDirectPlay2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlay2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlay2_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlay2_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) +#define IDirectPlay2_Close(p) (p)->lpVtbl->Close(p) +#define IDirectPlay2_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) +#define IDirectPlay2_CreatePlayer(p,a,b,c,d,e,f) (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f) +#define IDirectPlay2_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) +#define IDirectPlay2_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) +#define IDirectPlay2_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) +#define IDirectPlay2_EnumGroupPlayers(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e) +#define IDirectPlay2_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) +#define IDirectPlay2_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) +#define IDirectPlay2_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) +#define IDirectPlay2_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) +#define IDirectPlay2_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) +#define IDirectPlay2_GetGroupData(p,a,b,c,d) (p)->lpVtbl->GetGroupData(p,a,b,c,d) +#define IDirectPlay2_GetGroupName(p,a,b,c) (p)->lpVtbl->GetGroupName(p,a,b,c) +#define IDirectPlay2_GetPlayerAddress(p,a,b,c) (p)->lpVtbl->GetPlayerAddress(p,a,b,c) +#define IDirectPlay2_GetPlayerCaps(p,a,b,c) (p)->lpVtbl->GetPlayerCaps(p,a,b,c) +#define IDirectPlay2_GetPlayerData(p,a,b,c,d) (p)->lpVtbl->GetPlayerData(p,a,b,c,d) +#define IDirectPlay2_GetPlayerName(p,a,b,c) (p)->lpVtbl->GetPlayerName(p,a,b,c) +#define IDirectPlay2_GetSessionDesc(p,a,b) (p)->lpVtbl->GetSessionDesc(p,a,b) +#define IDirectPlay2_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#define IDirectPlay2_Open(p,a,b) (p)->lpVtbl->Open(p,a,b) +#define IDirectPlay2_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) +#define IDirectPlay2_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) +#define IDirectPlay2_SetGroupData(p,a,b,c,d) (p)->lpVtbl->SetGroupData(p,a,b,c,d) +#define IDirectPlay2_SetGroupName(p,a,b,c) (p)->lpVtbl->SetGroupName(p,a,b,c) +#define IDirectPlay2_SetPlayerData(p,a,b,c,d) (p)->lpVtbl->SetPlayerData(p,a,b,c,d) +#define IDirectPlay2_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) +#define IDirectPlay2_SetSessionDesc(p,a,b) (p)->lpVtbl->SetSessionDesc(p,a,b) + +#else /* C++ */ + +#define IDirectPlay2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlay2_AddRef(p) (p)->AddRef() +#define IDirectPlay2_Release(p) (p)->Release() +#define IDirectPlay2_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) +#define IDirectPlay2_Close(p) (p)->Close() +#define IDirectPlay2_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) +#define IDirectPlay2_CreatePlayer(p,a,b,c,d,e,f) (p)->CreatePlayer(a,b,c,d,e,f) +#define IDirectPlay2_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) +#define IDirectPlay2_DestroyGroup(p,a) (p)->DestroyGroup(a) +#define IDirectPlay2_DestroyPlayer(p,a) (p)->DestroyPlayer(a) +#define IDirectPlay2_EnumGroupPlayers(p,a,b,c,d,e) (p)->EnumGroupPlayers(a,b,c,d,e) +#define IDirectPlay2_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) +#define IDirectPlay2_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) +#define IDirectPlay2_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) +#define IDirectPlay2_GetCaps(p,a,b) (p)->GetCaps(a,b) +#define IDirectPlay2_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) +#define IDirectPlay2_GetGroupData(p,a,b,c,d) (p)->GetGroupData(a,b,c,d) +#define IDirectPlay2_GetGroupName(p,a,b,c) (p)->GetGroupName(a,b,c) +#define IDirectPlay2_GetPlayerAddress(p,a,b,c) (p)->GetPlayerAddress(a,b,c) +#define IDirectPlay2_GetPlayerCaps(p,a,b,c) (p)->GetPlayerCaps(a,b,c) +#define IDirectPlay2_GetPlayerData(p,a,b,c,d) (p)->GetPlayerData(a,b,c,d) +#define IDirectPlay2_GetPlayerName(p,a,b,c) (p)->GetPlayerName(a,b,c) +#define IDirectPlay2_GetSessionDesc(p,a,b) (p)->GetSessionDesc(a,b) +#define IDirectPlay2_Initialize(p,a) (p)->Initialize(a) +#define IDirectPlay2_Open(p,a,b) (p)->Open(a,b) +#define IDirectPlay2_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) +#define IDirectPlay2_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) +#define IDirectPlay2_SetGroupData(p,a,b,c,d) (p)->SetGroupData(a,b,c,d) +#define IDirectPlay2_SetGroupName(p,a,b,c) (p)->SetGroupName(a,b,c) +#define IDirectPlay2_SetPlayerData(p,a,b,c,d) (p)->SetPlayerData(a,b,c,d) +#define IDirectPlay2_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) +#define IDirectPlay2_SetSessionDesc(p,a,b) (p)->SetSessionDesc(a,b) + +#endif + +/**************************************************************************** + * + * IDirectPlay3 (and IDirectPlay3A) Interface + * + ****************************************************************************/ + +#undef INTERFACE +#define INTERFACE IDirectPlay3 +DECLARE_INTERFACE_( IDirectPlay3, IDirectPlay2 ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectPlay2 methods ***/ + STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; + STDMETHOD(Close) (THIS) PURE; + STDMETHOD(CreateGroup) (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; + STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; + STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; + STDMETHOD(EnumGroupPlayers) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; + STDMETHOD(EnumGroups) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; + STDMETHOD(EnumPlayers) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; + STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE; + STDMETHOD(GetCaps) (THIS_ LPDPCAPS,DWORD) PURE; + STDMETHOD(GetGroupData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; + STDMETHOD(GetGroupName) (THIS_ DPID,LPVOID,LPDWORD) PURE; + STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; + STDMETHOD(GetPlayerAddress) (THIS_ DPID,LPVOID,LPDWORD) PURE; + STDMETHOD(GetPlayerCaps) (THIS_ DPID,LPDPCAPS,DWORD) PURE; + STDMETHOD(GetPlayerData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; + STDMETHOD(GetPlayerName) (THIS_ DPID,LPVOID,LPDWORD) PURE; + STDMETHOD(GetSessionDesc) (THIS_ LPVOID,LPDWORD) PURE; + STDMETHOD(Initialize) (THIS_ LPGUID) PURE; + STDMETHOD(Open) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; + STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; + STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; + STDMETHOD(SetGroupData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(SetGroupName) (THIS_ DPID,LPDPNAME,DWORD) PURE; + STDMETHOD(SetPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(SetPlayerName) (THIS_ DPID,LPDPNAME,DWORD) PURE; + STDMETHOD(SetSessionDesc) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; + /*** IDirectPlay3 methods ***/ + STDMETHOD(AddGroupToGroup) (THIS_ DPID, DPID) PURE; + STDMETHOD(CreateGroupInGroup) (THIS_ DPID,LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(DeleteGroupFromGroup) (THIS_ DPID,DPID) PURE; + STDMETHOD(EnumConnections) (THIS_ LPCGUID,LPDPENUMCONNECTIONSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(EnumGroupsInGroup) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; + STDMETHOD(GetGroupConnectionSettings)(THIS_ DWORD, DPID, LPVOID, LPDWORD) PURE; + STDMETHOD(InitializeConnection) (THIS_ LPVOID,DWORD) PURE; + STDMETHOD(SecureOpen) (THIS_ LPCDPSESSIONDESC2,DWORD,LPCDPSECURITYDESC,LPCDPCREDENTIALS) PURE; + STDMETHOD(SendChatMessage) (THIS_ DPID,DPID,DWORD,LPDPCHAT) PURE; + STDMETHOD(SetGroupConnectionSettings)(THIS_ DWORD,DPID,LPDPLCONNECTION) PURE; + STDMETHOD(StartSession) (THIS_ DWORD,DPID) PURE; + STDMETHOD(GetGroupFlags) (THIS_ DPID,LPDWORD) PURE; + STDMETHOD(GetGroupParent) (THIS_ DPID,LPDPID) PURE; + STDMETHOD(GetPlayerAccount) (THIS_ DPID, DWORD, LPVOID, LPDWORD) PURE; + STDMETHOD(GetPlayerFlags) (THIS_ DPID,LPDWORD) PURE; +}; + +/**************************************************************************** + * + * IDirectPlay3 interface macros + * + ****************************************************************************/ + +#if !defined(__cplusplus) || defined(CINTERFACE) + +#define IDirectPlay3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlay3_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlay3_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlay3_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) +#define IDirectPlay3_Close(p) (p)->lpVtbl->Close(p) +#define IDirectPlay3_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) +#define IDirectPlay3_CreatePlayer(p,a,b,c,d,e,f) (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f) +#define IDirectPlay3_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) +#define IDirectPlay3_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) +#define IDirectPlay3_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) +#define IDirectPlay3_EnumGroupPlayers(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e) +#define IDirectPlay3_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) +#define IDirectPlay3_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) +#define IDirectPlay3_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) +#define IDirectPlay3_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) +#define IDirectPlay3_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) +#define IDirectPlay3_GetGroupData(p,a,b,c,d) (p)->lpVtbl->GetGroupData(p,a,b,c,d) +#define IDirectPlay3_GetGroupName(p,a,b,c) (p)->lpVtbl->GetGroupName(p,a,b,c) +#define IDirectPlay3_GetPlayerAddress(p,a,b,c) (p)->lpVtbl->GetPlayerAddress(p,a,b,c) +#define IDirectPlay3_GetPlayerCaps(p,a,b,c) (p)->lpVtbl->GetPlayerCaps(p,a,b,c) +#define IDirectPlay3_GetPlayerData(p,a,b,c,d) (p)->lpVtbl->GetPlayerData(p,a,b,c,d) +#define IDirectPlay3_GetPlayerName(p,a,b,c) (p)->lpVtbl->GetPlayerName(p,a,b,c) +#define IDirectPlay3_GetSessionDesc(p,a,b) (p)->lpVtbl->GetSessionDesc(p,a,b) +#define IDirectPlay3_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#define IDirectPlay3_Open(p,a,b) (p)->lpVtbl->Open(p,a,b) +#define IDirectPlay3_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) +#define IDirectPlay3_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) +#define IDirectPlay3_SetGroupData(p,a,b,c,d) (p)->lpVtbl->SetGroupData(p,a,b,c,d) +#define IDirectPlay3_SetGroupName(p,a,b,c) (p)->lpVtbl->SetGroupName(p,a,b,c) +#define IDirectPlay3_SetPlayerData(p,a,b,c,d) (p)->lpVtbl->SetPlayerData(p,a,b,c,d) +#define IDirectPlay3_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) +#define IDirectPlay3_SetSessionDesc(p,a,b) (p)->lpVtbl->SetSessionDesc(p,a,b) +#define IDirectPlay3_AddGroupToGroup(p,a,b) (p)->lpVtbl->AddGroupToGroup(p,a,b) +#define IDirectPlay3_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->lpVtbl->CreateGroupInGroup(p,a,b,c,d,e,f) +#define IDirectPlay3_DeleteGroupFromGroup(p,a,b) (p)->lpVtbl->DeleteGroupFromGroup(p,a,b) +#define IDirectPlay3_EnumConnections(p,a,b,c,d) (p)->lpVtbl->EnumConnections(p,a,b,c,d) +#define IDirectPlay3_EnumGroupsInGroup(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupsInGroup(p,a,b,c,d,e) +#define IDirectPlay3_GetGroupConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetGroupConnectionSettings(p,a,b,c,d) +#define IDirectPlay3_InitializeConnection(p,a,b) (p)->lpVtbl->InitializeConnection(p,a,b) +#define IDirectPlay3_SecureOpen(p,a,b,c,d) (p)->lpVtbl->SecureOpen(p,a,b,c,d) +#define IDirectPlay3_SendChatMessage(p,a,b,c,d) (p)->lpVtbl->SendChatMessage(p,a,b,c,d) +#define IDirectPlay3_SetGroupConnectionSettings(p,a,b,c) (p)->lpVtbl->SetGroupConnectionSettings(p,a,b,c) +#define IDirectPlay3_StartSession(p,a,b) (p)->lpVtbl->StartSession(p,a,b) +#define IDirectPlay3_GetGroupFlags(p,a,b) (p)->lpVtbl->GetGroupFlags(p,a,b) +#define IDirectPlay3_GetGroupParent(p,a,b) (p)->lpVtbl->GetGroupParent(p,a,b) +#define IDirectPlay3_GetPlayerAccount(p,a,b,c,d) (p)->lpVtbl->GetPlayerAccount(p,a,b,c,d) +#define IDirectPlay3_GetPlayerFlags(p,a,b) (p)->lpVtbl->GetPlayerFlags(p,a,b) + +#else /* C++ */ + +#define IDirectPlay3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlay3_AddRef(p) (p)->AddRef() +#define IDirectPlay3_Release(p) (p)->Release() +#define IDirectPlay3_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) +#define IDirectPlay3_Close(p) (p)->Close() +#define IDirectPlay3_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) +#define IDirectPlay3_CreatePlayer(p,a,b,c,d,e,f) (p)->CreatePlayer(a,b,c,d,e,f) +#define IDirectPlay3_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) +#define IDirectPlay3_DestroyGroup(p,a) (p)->DestroyGroup(a) +#define IDirectPlay3_DestroyPlayer(p,a) (p)->DestroyPlayer(a) +#define IDirectPlay3_EnumGroupPlayers(p,a,b,c,d,e) (p)->EnumGroupPlayers(a,b,c,d,e) +#define IDirectPlay3_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) +#define IDirectPlay3_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) +#define IDirectPlay3_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) +#define IDirectPlay3_GetCaps(p,a,b) (p)->GetCaps(a,b) +#define IDirectPlay3_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) +#define IDirectPlay3_GetGroupData(p,a,b,c,d) (p)->GetGroupData(a,b,c,d) +#define IDirectPlay3_GetGroupName(p,a,b,c) (p)->GetGroupName(a,b,c) +#define IDirectPlay3_GetPlayerAddress(p,a,b,c) (p)->GetPlayerAddress(a,b,c) +#define IDirectPlay3_GetPlayerCaps(p,a,b,c) (p)->GetPlayerCaps(a,b,c) +#define IDirectPlay3_GetPlayerData(p,a,b,c,d) (p)->GetPlayerData(a,b,c,d) +#define IDirectPlay3_GetPlayerName(p,a,b,c) (p)->GetPlayerName(a,b,c) +#define IDirectPlay3_GetSessionDesc(p,a,b) (p)->GetSessionDesc(a,b) +#define IDirectPlay3_Initialize(p,a) (p)->Initialize(a) +#define IDirectPlay3_Open(p,a,b) (p)->Open(a,b) +#define IDirectPlay3_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) +#define IDirectPlay3_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) +#define IDirectPlay3_SetGroupData(p,a,b,c,d) (p)->SetGroupData(a,b,c,d) +#define IDirectPlay3_SetGroupName(p,a,b,c) (p)->SetGroupName(a,b,c) +#define IDirectPlay3_SetPlayerData(p,a,b,c,d) (p)->SetPlayerData(a,b,c,d) +#define IDirectPlay3_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) +#define IDirectPlay3_SetSessionDesc(p,a,b) (p)->SetSessionDesc(a,b) +#define IDirectPlay3_AddGroupToGroup(p,a,b) (p)->AddGroupToGroup(a,b) +#define IDirectPlay3_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->CreateGroupInGroup(a,b,c,d,e,f) +#define IDirectPlay3_DeleteGroupFromGroup(p,a,b) (p)->DeleteGroupFromGroup(a,b) +#define IDirectPlay3_EnumConnections(p,a,b,c,d) (p)->EnumConnections(a,b,c,d) +#define IDirectPlay3_EnumGroupsInGroup(p,a,b,c,d,e) (p)->EnumGroupsInGroup(a,b,c,d,e) +#define IDirectPlay3_GetGroupConnectionSettings(p,a,b,c,d) (p)->GetGroupConnectionSettings(a,b,c,d) +#define IDirectPlay3_InitializeConnection(p,a,b) (p)->InitializeConnection(a,b) +#define IDirectPlay3_SecureOpen(p,a,b,c,d) (p)->SecureOpen(a,b,c,d) +#define IDirectPlay3_SendChatMessage(p,a,b,c,d) (p)->SendChatMessage(a,b,c,d) +#define IDirectPlay3_SetGroupConnectionSettings(p,a,b,c) (p)->SetGroupConnectionSettings(a,b,c) +#define IDirectPlay3_StartSession(p,a,b) (p)->StartSession(a,b) +#define IDirectPlay3_GetGroupFlags(p,a,b) (p)->GetGroupFlags(a,b) +#define IDirectPlay3_GetGroupParent(p,a,b) (p)->GetGroupParent(a,b) +#define IDirectPlay3_GetPlayerAccount(p,a,b,c,d) (p)->GetPlayerAccount(a,b,c,d) +#define IDirectPlay3_GetPlayerFlags(p,a,b) (p)->GetPlayerFlags(a,b) + +#endif + +/**************************************************************************** + * + * IDirectPlay4 (and IDirectPlay4A) Interface + * + ****************************************************************************/ + +#undef INTERFACE +#define INTERFACE IDirectPlay4 +DECLARE_INTERFACE_( IDirectPlay4, IDirectPlay3 ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectPlay2 methods ***/ + STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; + STDMETHOD(Close) (THIS) PURE; + STDMETHOD(CreateGroup) (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; + STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; + STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; + STDMETHOD(EnumGroupPlayers) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; + STDMETHOD(EnumGroups) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; + STDMETHOD(EnumPlayers) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; + STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE; + STDMETHOD(GetCaps) (THIS_ LPDPCAPS,DWORD) PURE; + STDMETHOD(GetGroupData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; + STDMETHOD(GetGroupName) (THIS_ DPID,LPVOID,LPDWORD) PURE; + STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; + STDMETHOD(GetPlayerAddress) (THIS_ DPID,LPVOID,LPDWORD) PURE; + STDMETHOD(GetPlayerCaps) (THIS_ DPID,LPDPCAPS,DWORD) PURE; + STDMETHOD(GetPlayerData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; + STDMETHOD(GetPlayerName) (THIS_ DPID,LPVOID,LPDWORD) PURE; + STDMETHOD(GetSessionDesc) (THIS_ LPVOID,LPDWORD) PURE; + STDMETHOD(Initialize) (THIS_ LPGUID) PURE; + STDMETHOD(Open) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; + STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; + STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; + STDMETHOD(SetGroupData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(SetGroupName) (THIS_ DPID,LPDPNAME,DWORD) PURE; + STDMETHOD(SetPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(SetPlayerName) (THIS_ DPID,LPDPNAME,DWORD) PURE; + STDMETHOD(SetSessionDesc) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; + /*** IDirectPlay3 methods ***/ + STDMETHOD(AddGroupToGroup) (THIS_ DPID, DPID) PURE; + STDMETHOD(CreateGroupInGroup) (THIS_ DPID,LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; + STDMETHOD(DeleteGroupFromGroup) (THIS_ DPID,DPID) PURE; + STDMETHOD(EnumConnections) (THIS_ LPCGUID,LPDPENUMCONNECTIONSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(EnumGroupsInGroup) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; + STDMETHOD(GetGroupConnectionSettings)(THIS_ DWORD, DPID, LPVOID, LPDWORD) PURE; + STDMETHOD(InitializeConnection) (THIS_ LPVOID,DWORD) PURE; + STDMETHOD(SecureOpen) (THIS_ LPCDPSESSIONDESC2,DWORD,LPCDPSECURITYDESC,LPCDPCREDENTIALS) PURE; + STDMETHOD(SendChatMessage) (THIS_ DPID,DPID,DWORD,LPDPCHAT) PURE; + STDMETHOD(SetGroupConnectionSettings)(THIS_ DWORD,DPID,LPDPLCONNECTION) PURE; + STDMETHOD(StartSession) (THIS_ DWORD,DPID) PURE; + STDMETHOD(GetGroupFlags) (THIS_ DPID,LPDWORD) PURE; + STDMETHOD(GetGroupParent) (THIS_ DPID,LPDPID) PURE; + STDMETHOD(GetPlayerAccount) (THIS_ DPID, DWORD, LPVOID, LPDWORD) PURE; + STDMETHOD(GetPlayerFlags) (THIS_ DPID,LPDWORD) PURE; + /*** IDirectPlay4 methods ***/ + STDMETHOD(GetGroupOwner) (THIS_ DPID, LPDPID) PURE; + STDMETHOD(SetGroupOwner) (THIS_ DPID, DPID) PURE; + STDMETHOD(SendEx) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD, DWORD, DWORD, LPVOID, DWORD_PTR *) PURE; + STDMETHOD(GetMessageQueue) (THIS_ DPID, DPID, DWORD, LPDWORD, LPDWORD) PURE; + STDMETHOD(CancelMessage) (THIS_ DWORD, DWORD) PURE; + STDMETHOD(CancelPriority) (THIS_ DWORD, DWORD, DWORD) PURE; +}; + +/**************************************************************************** + * + * IDirectPlayX interface macros (for IDirectPlay4 and beyond) + * + ****************************************************************************/ + +#if !defined(__cplusplus) || defined(CINTERFACE) + +#define IDirectPlayX_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlayX_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlayX_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlayX_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) +#define IDirectPlayX_CancelMessage(p,a,b) (p)->lpVtbl->CancelMessage(p,a,b) +#define IDirectPlayX_CancelPriority(p,a,b,c) (p)->lpVtbl->CancelPriority(p,a,b,c) +#define IDirectPlayX_Close(p) (p)->lpVtbl->Close(p) +#define IDirectPlayX_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) +#define IDirectPlayX_CreatePlayer(p,a,b,c,d,e,f) (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f) +#define IDirectPlayX_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) +#define IDirectPlayX_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) +#define IDirectPlayX_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) +#define IDirectPlayX_EnumGroupPlayers(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e) +#define IDirectPlayX_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) +#define IDirectPlayX_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) +#define IDirectPlayX_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) +#define IDirectPlayX_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) +#define IDirectPlayX_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) +#define IDirectPlayX_GetMessageQueue(p,a,b,c,d,e) (p)->lpVtbl->GetMessageQueue(p,a,b,c,d,e) +#define IDirectPlayX_GetGroupData(p,a,b,c,d) (p)->lpVtbl->GetGroupData(p,a,b,c,d) +#define IDirectPlayX_GetGroupName(p,a,b,c) (p)->lpVtbl->GetGroupName(p,a,b,c) +#define IDirectPlayX_GetPlayerAddress(p,a,b,c) (p)->lpVtbl->GetPlayerAddress(p,a,b,c) +#define IDirectPlayX_GetPlayerCaps(p,a,b,c) (p)->lpVtbl->GetPlayerCaps(p,a,b,c) +#define IDirectPlayX_GetPlayerData(p,a,b,c,d) (p)->lpVtbl->GetPlayerData(p,a,b,c,d) +#define IDirectPlayX_GetPlayerName(p,a,b,c) (p)->lpVtbl->GetPlayerName(p,a,b,c) +#define IDirectPlayX_GetSessionDesc(p,a,b) (p)->lpVtbl->GetSessionDesc(p,a,b) +#define IDirectPlayX_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#define IDirectPlayX_Open(p,a,b) (p)->lpVtbl->Open(p,a,b) +#define IDirectPlayX_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) +#define IDirectPlayX_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) +#define IDirectPlayX_SendEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->SendEx(p,a,b,c,d,e,f,g,h,i) +#define IDirectPlayX_SetGroupData(p,a,b,c,d) (p)->lpVtbl->SetGroupData(p,a,b,c,d) +#define IDirectPlayX_SetGroupName(p,a,b,c) (p)->lpVtbl->SetGroupName(p,a,b,c) +#define IDirectPlayX_SetPlayerData(p,a,b,c,d) (p)->lpVtbl->SetPlayerData(p,a,b,c,d) +#define IDirectPlayX_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) +#define IDirectPlayX_SetSessionDesc(p,a,b) (p)->lpVtbl->SetSessionDesc(p,a,b) +#define IDirectPlayX_AddGroupToGroup(p,a,b) (p)->lpVtbl->AddGroupToGroup(p,a,b) +#define IDirectPlayX_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->lpVtbl->CreateGroupInGroup(p,a,b,c,d,e,f) +#define IDirectPlayX_DeleteGroupFromGroup(p,a,b) (p)->lpVtbl->DeleteGroupFromGroup(p,a,b) +#define IDirectPlayX_EnumConnections(p,a,b,c,d) (p)->lpVtbl->EnumConnections(p,a,b,c,d) +#define IDirectPlayX_EnumGroupsInGroup(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupsInGroup(p,a,b,c,d,e) +#define IDirectPlayX_GetGroupConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetGroupConnectionSettings(p,a,b,c,d) +#define IDirectPlayX_InitializeConnection(p,a,b) (p)->lpVtbl->InitializeConnection(p,a,b) +#define IDirectPlayX_SecureOpen(p,a,b,c,d) (p)->lpVtbl->SecureOpen(p,a,b,c,d) +#define IDirectPlayX_SendChatMessage(p,a,b,c,d) (p)->lpVtbl->SendChatMessage(p,a,b,c,d) +#define IDirectPlayX_SetGroupConnectionSettings(p,a,b,c) (p)->lpVtbl->SetGroupConnectionSettings(p,a,b,c) +#define IDirectPlayX_StartSession(p,a,b) (p)->lpVtbl->StartSession(p,a,b) +#define IDirectPlayX_GetGroupFlags(p,a,b) (p)->lpVtbl->GetGroupFlags(p,a,b) +#define IDirectPlayX_GetGroupParent(p,a,b) (p)->lpVtbl->GetGroupParent(p,a,b) +#define IDirectPlayX_GetPlayerAccount(p,a,b,c,d) (p)->lpVtbl->GetPlayerAccount(p,a,b,c,d) +#define IDirectPlayX_GetPlayerFlags(p,a,b) (p)->lpVtbl->GetPlayerFlags(p,a,b) +#define IDirectPlayX_GetGroupOwner(p,a,b) (p)->lpVtbl->GetGroupOwner(p,a,b) +#define IDirectPlayX_SetGroupOwner(p,a,b) (p)->lpVtbl->SetGroupOwner(p,a,b) + +#else /* C++ */ + +#define IDirectPlayX_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlayX_AddRef(p) (p)->AddRef() +#define IDirectPlayX_Release(p) (p)->Release() +#define IDirectPlayX_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) +#define IDirectPlayX_CancelMessage(p,a,b) (p)->CancelMessage(a,b) +#define IDirectPlayX_CancelPriority(p,a,b,c) (p)->CancelPriority(a,b,c) +#define IDirectPlayX_Close(p) (p)->Close() +#define IDirectPlayX_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) +#define IDirectPlayX_CreatePlayer(p,a,b,c,d,e,f) (p)->CreatePlayer(a,b,c,d,e,f) +#define IDirectPlayX_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) +#define IDirectPlayX_DestroyGroup(p,a) (p)->DestroyGroup(a) +#define IDirectPlayX_DestroyPlayer(p,a) (p)->DestroyPlayer(a) +#define IDirectPlayX_EnumGroupPlayers(p,a,b,c,d,e) (p)->EnumGroupPlayers(a,b,c,d,e) +#define IDirectPlayX_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) +#define IDirectPlayX_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) +#define IDirectPlayX_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) +#define IDirectPlayX_GetCaps(p,a,b) (p)->GetCaps(a,b) +#define IDirectPlayX_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) +#define IDirectPlayX_GetMessageQueue(p,a,b,c,d,e) (p)->GetMessageQueue(a,b,c,d,e) +#define IDirectPlayX_GetGroupData(p,a,b,c,d) (p)->GetGroupData(a,b,c,d) +#define IDirectPlayX_GetGroupName(p,a,b,c) (p)->GetGroupName(a,b,c) +#define IDirectPlayX_GetPlayerAddress(p,a,b,c) (p)->GetPlayerAddress(a,b,c) +#define IDirectPlayX_GetPlayerCaps(p,a,b,c) (p)->GetPlayerCaps(a,b,c) +#define IDirectPlayX_GetPlayerData(p,a,b,c,d) (p)->GetPlayerData(a,b,c,d) +#define IDirectPlayX_GetPlayerName(p,a,b,c) (p)->GetPlayerName(a,b,c) +#define IDirectPlayX_GetSessionDesc(p,a,b) (p)->GetSessionDesc(a,b) +#define IDirectPlayX_Initialize(p,a) (p)->Initialize(a) +#define IDirectPlayX_Open(p,a,b) (p)->Open(a,b) +#define IDirectPlayX_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) +#define IDirectPlayX_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) +#define IDirectPlayX_SendEx(p,a,b,c,d,e,f,g,h,i) (p)->SendEx(a,b,c,d,e,f,g,h,i) +#define IDirectPlayX_SetGroupData(p,a,b,c,d) (p)->SetGroupData(a,b,c,d) +#define IDirectPlayX_SetGroupName(p,a,b,c) (p)->SetGroupName(a,b,c) +#define IDirectPlayX_SetPlayerData(p,a,b,c,d) (p)->SetPlayerData(a,b,c,d) +#define IDirectPlayX_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) +#define IDirectPlayX_SetSessionDesc(p,a,b) (p)->SetSessionDesc(a,b) +#define IDirectPlayX_AddGroupToGroup(p,a,b) (p)->AddGroupToGroup(a,b) +#define IDirectPlayX_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->CreateGroupInGroup(a,b,c,d,e,f) +#define IDirectPlayX_DeleteGroupFromGroup(p,a,b) (p)->DeleteGroupFromGroup(a,b) +#define IDirectPlayX_EnumConnections(p,a,b,c,d) (p)->EnumConnections(a,b,c,d) +#define IDirectPlayX_EnumGroupsInGroup(p,a,b,c,d,e) (p)->EnumGroupsInGroup(a,b,c,d,e) +#define IDirectPlayX_GetGroupConnectionSettings(p,a,b,c,d) (p)->GetGroupConnectionSettings(a,b,c,d) +#define IDirectPlayX_InitializeConnection(p,a,b) (p)->InitializeConnection(a,b) +#define IDirectPlayX_SecureOpen(p,a,b,c,d) (p)->SecureOpen(a,b,c,d) +#define IDirectPlayX_SendChatMessage(p,a,b,c,d) (p)->SendChatMessage(a,b,c,d) +#define IDirectPlayX_SetGroupConnectionSettings(p,a,b,c) (p)->SetGroupConnectionSettings(a,b,c) +#define IDirectPlayX_StartSession(p,a,b) (p)->StartSession(a,b) +#define IDirectPlayX_GetGroupFlags(p,a,b) (p)->GetGroupFlags(a,b) +#define IDirectPlayX_GetGroupParent(p,a,b) (p)->GetGroupParent(a,b) +#define IDirectPlayX_GetPlayerAccount(p,a,b,c,d) (p)->GetPlayerAccount(a,b,c,d) +#define IDirectPlayX_GetPlayerFlags(p,a,b) (p)->GetPlayerFlags(a,b) +#define IDirectPlayX_GetGroupOwner(p,a,b) (p)->GetGroupOwner(a,b) +#define IDirectPlayX_SetGroupOwner(p,a,b) (p)->SetGroupOwner(a,b) + +#endif + +/**************************************************************************** + * + * EnumConnections API flags + * + ****************************************************************************/ + +/* + * Enumerate Service Providers + */ +#define DPCONNECTION_DIRECTPLAY 0x00000001 + +/* + * Enumerate Lobby Providers + */ +#define DPCONNECTION_DIRECTPLAYLOBBY 0x00000002 + + +/**************************************************************************** + * + * EnumPlayers API flags + * + ****************************************************************************/ + +/* + * Enumerate all players in the current session + */ +#define DPENUMPLAYERS_ALL 0x00000000 +#define DPENUMGROUPS_ALL DPENUMPLAYERS_ALL + + +/* + * Enumerate only local (created by this application) players + * or groups + */ +#define DPENUMPLAYERS_LOCAL 0x00000008 +#define DPENUMGROUPS_LOCAL DPENUMPLAYERS_LOCAL + +/* + * Enumerate only remote (non-local) players + * or groups + */ +#define DPENUMPLAYERS_REMOTE 0x00000010 +#define DPENUMGROUPS_REMOTE DPENUMPLAYERS_REMOTE + +/* + * Enumerate groups along with the players + */ +#define DPENUMPLAYERS_GROUP 0x00000020 + +/* + * Enumerate players or groups in another session + * (must supply lpguidInstance) + */ +#define DPENUMPLAYERS_SESSION 0x00000080 +#define DPENUMGROUPS_SESSION DPENUMPLAYERS_SESSION + +/* + * Enumerate server players + */ +#define DPENUMPLAYERS_SERVERPLAYER 0x00000100 + +/* + * Enumerate spectator players + */ +#define DPENUMPLAYERS_SPECTATOR 0x00000200 + +/* + * Enumerate shortcut groups + */ +#define DPENUMGROUPS_SHORTCUT 0x00000400 + +/* + * Enumerate staging area groups + */ +#define DPENUMGROUPS_STAGINGAREA 0x00000800 + +/* + * Enumerate hidden groups + */ +#define DPENUMGROUPS_HIDDEN 0x00001000 + +/* + * Enumerate the group's owner + */ +#define DPENUMPLAYERS_OWNER 0x00002000 + + +/**************************************************************************** + * + * CreatePlayer API flags + * + ****************************************************************************/ + +/* + * This flag indicates that this player should be designated + * the server player. The app should specify this at CreatePlayer. + */ +#define DPPLAYER_SERVERPLAYER DPENUMPLAYERS_SERVERPLAYER + +/* + * This flag indicates that this player should be designated + * a spectator. The app should specify this at CreatePlayer. + */ +#define DPPLAYER_SPECTATOR DPENUMPLAYERS_SPECTATOR + +/* + * This flag indicates that this player was created locally. + * (returned from GetPlayerFlags) + */ +#define DPPLAYER_LOCAL DPENUMPLAYERS_LOCAL + +/* + * This flag indicates that this player is the group's owner + * (Only returned in EnumGroupPlayers) + */ +#define DPPLAYER_OWNER DPENUMPLAYERS_OWNER + +/**************************************************************************** + * + * CreateGroup API flags + * + ****************************************************************************/ + + +/* + * This flag indicates that the StartSession can be called on the group. + * The app should specify this at CreateGroup, or CreateGroupInGroup. + */ +#define DPGROUP_STAGINGAREA DPENUMGROUPS_STAGINGAREA + +/* + * This flag indicates that this group was created locally. + * (returned from GetGroupFlags) + */ +#define DPGROUP_LOCAL DPENUMGROUPS_LOCAL + +/* + * This flag indicates that this group was created hidden. + */ +#define DPGROUP_HIDDEN DPENUMGROUPS_HIDDEN + + +/**************************************************************************** + * + * EnumSessions API flags + * + ****************************************************************************/ + +/* + * Enumerate sessions which can be joined + */ +#define DPENUMSESSIONS_AVAILABLE 0x00000001 + +/* + * Enumerate all sessions even if they can't be joined. + */ +#define DPENUMSESSIONS_ALL 0x00000002 + + +/* + * Start an asynchronous enum sessions + */ + #define DPENUMSESSIONS_ASYNC 0x00000010 + +/* + * Stop an asynchronous enum sessions + */ + #define DPENUMSESSIONS_STOPASYNC 0x00000020 + +/* + * Enumerate sessions even if they require a password + */ + #define DPENUMSESSIONS_PASSWORDREQUIRED 0x00000040 + +/* + * Return status about progress of enumeration instead of + * showing any status dialogs. + */ + #define DPENUMSESSIONS_RETURNSTATUS 0x00000080 + +/**************************************************************************** + * + * GetCaps and GetPlayerCaps API flags + * + ****************************************************************************/ + +/* + * The latency returned should be for guaranteed message sending. + * Default is non-guaranteed messaging. + */ +#define DPGETCAPS_GUARANTEED 0x00000001 + + +/**************************************************************************** + * + * GetGroupData, GetPlayerData API flags + * Remote and local Group/Player data is maintained separately. + * Default is DPGET_REMOTE. + * + ****************************************************************************/ + +/* + * Get the remote data (set by any DirectPlay object in + * the session using DPSET_REMOTE) + */ +#define DPGET_REMOTE 0x00000000 + +/* + * Get the local data (set by this DirectPlay object + * using DPSET_LOCAL) + */ +#define DPGET_LOCAL 0x00000001 + + +/**************************************************************************** + * + * Open API flags + * + ****************************************************************************/ + +/* + * Join the session that is described by the DPSESSIONDESC2 structure + */ +#define DPOPEN_JOIN 0x00000001 + +/* + * Create a new session as described by the DPSESSIONDESC2 structure + */ +#define DPOPEN_CREATE 0x00000002 + +/* + * Return status about progress of open instead of showing + * any status dialogs. + */ + #define DPOPEN_RETURNSTATUS DPENUMSESSIONS_RETURNSTATUS + + +/**************************************************************************** + * + * DPLCONNECTION flags + * + ****************************************************************************/ + +/* + * This application should create a new session as + * described by the DPSESIONDESC structure + */ +#define DPLCONNECTION_CREATESESSION DPOPEN_CREATE + +/* + * This application should join the session described by + * the DPSESIONDESC structure with the lpAddress data + */ +#define DPLCONNECTION_JOINSESSION DPOPEN_JOIN + +/**************************************************************************** + * + * Receive API flags + * Default is DPRECEIVE_ALL + * + ****************************************************************************/ + +/* + * Get the first message in the queue + */ +#define DPRECEIVE_ALL 0x00000001 + +/* + * Get the first message in the queue directed to a specific player + */ +#define DPRECEIVE_TOPLAYER 0x00000002 + +/* + * Get the first message in the queue from a specific player + */ +#define DPRECEIVE_FROMPLAYER 0x00000004 + +/* + * Get the message but don't remove it from the queue + */ +#define DPRECEIVE_PEEK 0x00000008 + + +/**************************************************************************** + * + * Send API flags + * + ****************************************************************************/ + +/* + * Send the message using a guaranteed send method. + * Default is non-guaranteed. + */ +#define DPSEND_GUARANTEED 0x00000001 + + +/* + * This flag is obsolete. It is ignored by DirectPlay + */ +#define DPSEND_HIGHPRIORITY 0x00000002 + +/* + * This flag is obsolete. It is ignored by DirectPlay + */ +#define DPSEND_OPENSTREAM 0x00000008 + +/* + * This flag is obsolete. It is ignored by DirectPlay + */ +#define DPSEND_CLOSESTREAM 0x00000010 + +/* + * Send the message digitally signed to ensure authenticity. + */ +#define DPSEND_SIGNED 0x00000020 + +/* + * Send the message with encryption to ensure privacy. + */ +#define DPSEND_ENCRYPTED 0x00000040 + +/* + * The message is a lobby system message + */ +#define DPSEND_LOBBYSYSTEMMESSAGE 0x00000080 + + +/* + * Send message asynchronously, must check caps + * before using this flag. It is always provided + * if the protocol flag is set. + */ +#define DPSEND_ASYNC 0x00000200 + +/* + * When an message is completed, don't tell me. + * by default the application is notified with a system message. + */ +#define DPSEND_NOSENDCOMPLETEMSG 0x00000400 + + +/* + * Maximum priority for sends available to applications + */ +#define DPSEND_MAX_PRI 0x0000FFFF +#define DPSEND_MAX_PRIORITY DPSEND_MAX_PRI + + +/**************************************************************************** + * + * SetGroupData, SetGroupName, SetPlayerData, SetPlayerName, + * SetSessionDesc API flags. + * Default is DPSET_REMOTE. + * + ****************************************************************************/ + +/* + * Propagate the data to all players in the session + */ +#define DPSET_REMOTE 0x00000000 + +/* + * Do not propagate the data to other players + */ +#define DPSET_LOCAL 0x00000001 + +/* + * Used with DPSET_REMOTE, use guaranteed message send to + * propagate the data + */ +#define DPSET_GUARANTEED 0x00000002 + +/**************************************************************************** + * + * GetMessageQueue API flags. + * Default is DPMESSAGEQUEUE_SEND + * + ****************************************************************************/ + +/* + * Get Send Queue - requires Service Provider Support + */ +#define DPMESSAGEQUEUE_SEND 0x00000001 + +/* + * Get Receive Queue + */ +#define DPMESSAGEQUEUE_RECEIVE 0x00000002 + + +/**************************************************************************** + * + * Connect API flags + * + ****************************************************************************/ + + +/* + * Start an asynchronous connect which returns status codes + */ +#define DPCONNECT_RETURNSTATUS (DPENUMSESSIONS_RETURNSTATUS) + + +/**************************************************************************** + * + * DirectPlay system messages and message data structures + * + * All system message come 'From' player DPID_SYSMSG. To determine what type + * of message it is, cast the lpData from Receive to DPMSG_GENERIC and check + * the dwType member against one of the following DPSYS_xxx constants. Once + * a match is found, cast the lpData to the corresponding of the DPMSG_xxx + * structures to access the data of the message. + * + ****************************************************************************/ + +/* + * A new player or group has been created in the session + * Use DPMSG_CREATEPLAYERORGROUP. Check dwPlayerType to see if it + * is a player or a group. + */ +#define DPSYS_CREATEPLAYERORGROUP 0x0003 + +/* + * A player has been deleted from the session + * Use DPMSG_DESTROYPLAYERORGROUP + */ +#define DPSYS_DESTROYPLAYERORGROUP 0x0005 + +/* + * A player has been added to a group + * Use DPMSG_ADDPLAYERTOGROUP + */ +#define DPSYS_ADDPLAYERTOGROUP 0x0007 + +/* + * A player has been removed from a group + * Use DPMSG_DELETEPLAYERFROMGROUP + */ +#define DPSYS_DELETEPLAYERFROMGROUP 0x0021 + +/* + * This DirectPlay object lost its connection with all the + * other players in the session. + * Use DPMSG_SESSIONLOST. + */ +#define DPSYS_SESSIONLOST 0x0031 + +/* + * The current host has left the session. + * This DirectPlay object is now the host. + * Use DPMSG_HOST. + */ +#define DPSYS_HOST 0x0101 + +/* + * The remote data associated with a player or + * group has changed. Check dwPlayerType to see + * if it is a player or a group + * Use DPMSG_SETPLAYERORGROUPDATA + */ +#define DPSYS_SETPLAYERORGROUPDATA 0x0102 + +/* + * The name of a player or group has changed. + * Check dwPlayerType to see if it is a player + * or a group. + * Use DPMSG_SETPLAYERORGROUPNAME + */ +#define DPSYS_SETPLAYERORGROUPNAME 0x0103 + +/* + * The session description has changed. + * Use DPMSG_SETSESSIONDESC + */ +#define DPSYS_SETSESSIONDESC 0x0104 + +/* + * A group has been added to a group + * Use DPMSG_ADDGROUPTOGROUP + */ +#define DPSYS_ADDGROUPTOGROUP 0x0105 + +/* + * A group has been removed from a group + * Use DPMSG_DELETEGROUPFROMGROUP + */ +#define DPSYS_DELETEGROUPFROMGROUP 0x0106 + +/* + * A secure player-player message has arrived. + * Use DPMSG_SECUREMESSAGE + */ +#define DPSYS_SECUREMESSAGE 0x0107 + +/* + * Start a new session. + * Use DPMSG_STARTSESSION + */ +#define DPSYS_STARTSESSION 0x0108 + +/* + * A chat message has arrived + * Use DPMSG_CHAT + */ +#define DPSYS_CHAT 0x0109 + +/* + * The owner of a group has changed + * Use DPMSG_SETGROUPOWNER + */ +#define DPSYS_SETGROUPOWNER 0x010A + +/* + * An async send has finished, failed or been cancelled + * Use DPMSG_SENDCOMPLETE + */ +#define DPSYS_SENDCOMPLETE 0x010d + + +/* + * Used in the dwPlayerType field to indicate if it applies to a group + * or a player + */ +#define DPPLAYERTYPE_GROUP 0x00000000 +#define DPPLAYERTYPE_PLAYER 0x00000001 + + +/* + * DPMSG_GENERIC + * Generic message structure used to identify the message type. + */ +typedef struct +{ + DWORD dwType; // Message type +} DPMSG_GENERIC, FAR *LPDPMSG_GENERIC; + +/* + * DPMSG_CREATEPLAYERORGROUP + * System message generated when a new player or group + * created in the session with information about it. + */ +typedef struct +{ + DWORD dwType; // Message type + DWORD dwPlayerType; // Is it a player or group + DPID dpId; // ID of the player or group + DWORD dwCurrentPlayers; // current # players & groups in session + LPVOID lpData; // pointer to remote data + DWORD dwDataSize; // size of remote data + DPNAME dpnName; // structure with name info + // the following fields are only available when using + // the IDirectPlay3 interface or greater + DPID dpIdParent; // id of parent group + DWORD dwFlags; // player or group flags +} DPMSG_CREATEPLAYERORGROUP, FAR *LPDPMSG_CREATEPLAYERORGROUP; + +/* + * DPMSG_DESTROYPLAYERORGROUP + * System message generated when a player or group is being + * destroyed in the session with information about it. + */ +typedef struct +{ + DWORD dwType; // Message type + DWORD dwPlayerType; // Is it a player or group + DPID dpId; // player ID being deleted + LPVOID lpLocalData; // copy of players local data + DWORD dwLocalDataSize; // sizeof local data + LPVOID lpRemoteData; // copy of players remote data + DWORD dwRemoteDataSize; // sizeof remote data + // the following fields are only available when using + // the IDirectPlay3 interface or greater + DPNAME dpnName; // structure with name info + DPID dpIdParent; // id of parent group + DWORD dwFlags; // player or group flags +} DPMSG_DESTROYPLAYERORGROUP, FAR *LPDPMSG_DESTROYPLAYERORGROUP; + +/* + * DPMSG_ADDPLAYERTOGROUP + * System message generated when a player is being added + * to a group. + */ +typedef struct +{ + DWORD dwType; // Message type + DPID dpIdGroup; // group ID being added to + DPID dpIdPlayer; // player ID being added +} DPMSG_ADDPLAYERTOGROUP, FAR *LPDPMSG_ADDPLAYERTOGROUP; + +/* + * DPMSG_DELETEPLAYERFROMGROUP + * System message generated when a player is being + * removed from a group + */ +typedef DPMSG_ADDPLAYERTOGROUP DPMSG_DELETEPLAYERFROMGROUP; +typedef DPMSG_DELETEPLAYERFROMGROUP FAR *LPDPMSG_DELETEPLAYERFROMGROUP; + +/* + * DPMSG_ADDGROUPTOGROUP + * System message generated when a group is being added + * to a group. + */ +typedef struct +{ + DWORD dwType; // Message type + DPID dpIdParentGroup; // group ID being added to + DPID dpIdGroup; // group ID being added +} DPMSG_ADDGROUPTOGROUP, FAR *LPDPMSG_ADDGROUPTOGROUP; + +/* + * DPMSG_DELETEGROUPFROMGROUP + * System message generated when a GROUP is being + * removed from a group + */ +typedef DPMSG_ADDGROUPTOGROUP DPMSG_DELETEGROUPFROMGROUP; +typedef DPMSG_DELETEGROUPFROMGROUP FAR *LPDPMSG_DELETEGROUPFROMGROUP; + +/* + * DPMSG_SETPLAYERORGROUPDATA + * System message generated when remote data for a player or + * group has changed. + */ +typedef struct +{ + DWORD dwType; // Message type + DWORD dwPlayerType; // Is it a player or group + DPID dpId; // ID of player or group + LPVOID lpData; // pointer to remote data + DWORD dwDataSize; // size of remote data +} DPMSG_SETPLAYERORGROUPDATA, FAR *LPDPMSG_SETPLAYERORGROUPDATA; + +/* + * DPMSG_SETPLAYERORGROUPNAME + * System message generated when the name of a player or + * group has changed. + */ +typedef struct +{ + DWORD dwType; // Message type + DWORD dwPlayerType; // Is it a player or group + DPID dpId; // ID of player or group + DPNAME dpnName; // structure with new name info +} DPMSG_SETPLAYERORGROUPNAME, FAR *LPDPMSG_SETPLAYERORGROUPNAME; + +/* + * DPMSG_SETSESSIONDESC + * System message generated when session desc has changed + */ +typedef struct +{ + DWORD dwType; // Message type + DPSESSIONDESC2 dpDesc; // Session desc +} DPMSG_SETSESSIONDESC, FAR *LPDPMSG_SETSESSIONDESC; + +/* + * DPMSG_HOST + * System message generated when the host has migrated to this + * DirectPlay object. + * + */ +typedef DPMSG_GENERIC DPMSG_HOST; +typedef DPMSG_HOST FAR *LPDPMSG_HOST; + +/* + * DPMSG_SESSIONLOST + * System message generated when the connection to the session is lost. + * + */ +typedef DPMSG_GENERIC DPMSG_SESSIONLOST; +typedef DPMSG_SESSIONLOST FAR *LPDPMSG_SESSIONLOST; + +/* + * DPMSG_SECUREMESSAGE + * System message generated when a player requests a secure send + */ +typedef struct +{ + DWORD dwType; // Message Type + DWORD dwFlags; // Signed/Encrypted + DPID dpIdFrom; // ID of Sending Player + LPVOID lpData; // Player message + DWORD dwDataSize; // Size of player message +} DPMSG_SECUREMESSAGE, FAR *LPDPMSG_SECUREMESSAGE; + +/* + * DPMSG_STARTSESSION + * System message containing all information required to + * start a new session + */ +typedef struct +{ + DWORD dwType; // Message type + LPDPLCONNECTION lpConn; // DPLCONNECTION structure +} DPMSG_STARTSESSION, FAR *LPDPMSG_STARTSESSION; + +/* + * DPMSG_CHAT + * System message containing a chat message + */ +typedef struct +{ + DWORD dwType; // Message type + DWORD dwFlags; // Message flags + DPID idFromPlayer; // ID of the Sending Player + DPID idToPlayer; // ID of the To Player + DPID idToGroup; // ID of the To Group + LPDPCHAT lpChat; // Pointer to a structure containing the chat message +} DPMSG_CHAT, FAR *LPDPMSG_CHAT; + +/* + * DPMSG_SETGROUPOWNER + * System message generated when the owner of a group has changed + */ +typedef struct +{ + DWORD dwType; // Message type + DPID idGroup; // ID of the group + DPID idNewOwner; // ID of the player that is the new owner + DPID idOldOwner; // ID of the player that used to be the owner +} DPMSG_SETGROUPOWNER, FAR *LPDPMSG_SETGROUPOWNER; + +/* + * DPMSG_SENDCOMPLETE + * System message generated when finished with an Async Send message + * + * NOTE SENDPARMS has an overlay for DPMSG_SENDCOMPLETE, don't + * change this message w/o changing SENDPARMS. + */ +typedef struct +{ + DWORD dwType; + DPID idFrom; + DPID idTo; + DWORD dwFlags; + DWORD dwPriority; + DWORD dwTimeout; + LPVOID lpvContext; + DWORD dwMsgID; + HRESULT hr; + DWORD dwSendTime; +} DPMSG_SENDCOMPLETE, *LPDPMSG_SENDCOMPLETE; + +/**************************************************************************** + * + * DIRECTPLAY ERRORS + * + * Errors are represented by negative values and cannot be combined. + * + ****************************************************************************/ +#define DP_OK S_OK +#define DPERR_ALREADYINITIALIZED MAKE_DPHRESULT( 5 ) +#define DPERR_ACCESSDENIED MAKE_DPHRESULT( 10 ) +#define DPERR_ACTIVEPLAYERS MAKE_DPHRESULT( 20 ) +#define DPERR_BUFFERTOOSMALL MAKE_DPHRESULT( 30 ) +#define DPERR_CANTADDPLAYER MAKE_DPHRESULT( 40 ) +#define DPERR_CANTCREATEGROUP MAKE_DPHRESULT( 50 ) +#define DPERR_CANTCREATEPLAYER MAKE_DPHRESULT( 60 ) +#define DPERR_CANTCREATESESSION MAKE_DPHRESULT( 70 ) +#define DPERR_CAPSNOTAVAILABLEYET MAKE_DPHRESULT( 80 ) +#define DPERR_EXCEPTION MAKE_DPHRESULT( 90 ) +#define DPERR_GENERIC E_FAIL +#define DPERR_INVALIDFLAGS MAKE_DPHRESULT( 120 ) +#define DPERR_INVALIDOBJECT MAKE_DPHRESULT( 130 ) +#define DPERR_INVALIDPARAM E_INVALIDARG +#define DPERR_INVALIDPARAMS DPERR_INVALIDPARAM +#define DPERR_INVALIDPLAYER MAKE_DPHRESULT( 150 ) +#define DPERR_INVALIDGROUP MAKE_DPHRESULT( 155 ) +#define DPERR_NOCAPS MAKE_DPHRESULT( 160 ) +#define DPERR_NOCONNECTION MAKE_DPHRESULT( 170 ) +#define DPERR_NOMEMORY E_OUTOFMEMORY +#define DPERR_OUTOFMEMORY DPERR_NOMEMORY +#define DPERR_NOMESSAGES MAKE_DPHRESULT( 190 ) +#define DPERR_NONAMESERVERFOUND MAKE_DPHRESULT( 200 ) +#define DPERR_NOPLAYERS MAKE_DPHRESULT( 210 ) +#define DPERR_NOSESSIONS MAKE_DPHRESULT( 220 ) +#define DPERR_PENDING E_PENDING +#define DPERR_SENDTOOBIG MAKE_DPHRESULT( 230 ) +#define DPERR_TIMEOUT MAKE_DPHRESULT( 240 ) +#define DPERR_UNAVAILABLE MAKE_DPHRESULT( 250 ) +#define DPERR_UNSUPPORTED E_NOTIMPL +#define DPERR_BUSY MAKE_DPHRESULT( 270 ) +#define DPERR_USERCANCEL MAKE_DPHRESULT( 280 ) +#define DPERR_NOINTERFACE E_NOINTERFACE +#define DPERR_CANNOTCREATESERVER MAKE_DPHRESULT( 290 ) +#define DPERR_PLAYERLOST MAKE_DPHRESULT( 300 ) +#define DPERR_SESSIONLOST MAKE_DPHRESULT( 310 ) +#define DPERR_UNINITIALIZED MAKE_DPHRESULT( 320 ) +#define DPERR_NONEWPLAYERS MAKE_DPHRESULT( 330 ) +#define DPERR_INVALIDPASSWORD MAKE_DPHRESULT( 340 ) +#define DPERR_CONNECTING MAKE_DPHRESULT( 350 ) +#define DPERR_CONNECTIONLOST MAKE_DPHRESULT( 360 ) +#define DPERR_UNKNOWNMESSAGE MAKE_DPHRESULT( 370 ) +#define DPERR_CANCELFAILED MAKE_DPHRESULT( 380 ) +#define DPERR_INVALIDPRIORITY MAKE_DPHRESULT( 390 ) +#define DPERR_NOTHANDLED MAKE_DPHRESULT( 400 ) +#define DPERR_CANCELLED MAKE_DPHRESULT( 410 ) +#define DPERR_ABORTED MAKE_DPHRESULT( 420 ) + + +#define DPERR_BUFFERTOOLARGE MAKE_DPHRESULT( 1000 ) +#define DPERR_CANTCREATEPROCESS MAKE_DPHRESULT( 1010 ) +#define DPERR_APPNOTSTARTED MAKE_DPHRESULT( 1020 ) +#define DPERR_INVALIDINTERFACE MAKE_DPHRESULT( 1030 ) +#define DPERR_NOSERVICEPROVIDER MAKE_DPHRESULT( 1040 ) +#define DPERR_UNKNOWNAPPLICATION MAKE_DPHRESULT( 1050 ) +#define DPERR_NOTLOBBIED MAKE_DPHRESULT( 1070 ) +#define DPERR_SERVICEPROVIDERLOADED MAKE_DPHRESULT( 1080 ) +#define DPERR_ALREADYREGISTERED MAKE_DPHRESULT( 1090 ) +#define DPERR_NOTREGISTERED MAKE_DPHRESULT( 1100 ) + +// +// Security related errors +// +#define DPERR_AUTHENTICATIONFAILED MAKE_DPHRESULT( 2000 ) +#define DPERR_CANTLOADSSPI MAKE_DPHRESULT( 2010 ) +#define DPERR_ENCRYPTIONFAILED MAKE_DPHRESULT( 2020 ) +#define DPERR_SIGNFAILED MAKE_DPHRESULT( 2030 ) +#define DPERR_CANTLOADSECURITYPACKAGE MAKE_DPHRESULT( 2040 ) +#define DPERR_ENCRYPTIONNOTSUPPORTED MAKE_DPHRESULT( 2050 ) +#define DPERR_CANTLOADCAPI MAKE_DPHRESULT( 2060 ) +#define DPERR_NOTLOGGEDIN MAKE_DPHRESULT( 2070 ) +#define DPERR_LOGONDENIED MAKE_DPHRESULT( 2080 ) + + +/**************************************************************************** + * + * dplay 1.0 obsolete structures + interfaces + * Included for compatibility only. New apps should + * use IDirectPlay2 + * + ****************************************************************************/ + +// define this to ignore obsolete interfaces and constants +#ifndef IDIRECTPLAY2_OR_GREATER + +#define DPOPEN_OPENSESSION DPOPEN_JOIN +#define DPOPEN_CREATESESSION DPOPEN_CREATE + +#define DPENUMSESSIONS_PREVIOUS 0x00000004 + +#define DPENUMPLAYERS_PREVIOUS 0x00000004 + +#define DPSEND_GUARANTEE DPSEND_GUARANTEED +#define DPSEND_TRYONCE 0x00000004 + +#define DPCAPS_NAMESERVICE 0x00000001 +#define DPCAPS_NAMESERVER DPCAPS_ISHOST +#define DPCAPS_GUARANTEED 0x00000004 + +#define DPLONGNAMELEN 52 +#define DPSHORTNAMELEN 20 +#define DPSESSIONNAMELEN 32 +#define DPPASSWORDLEN 16 +#define DPUSERRESERVED 16 + +#define DPSYS_ADDPLAYER 0x0003 +#define DPSYS_DELETEPLAYER 0x0005 + +#define DPSYS_DELETEGROUP 0x0020 +#define DPSYS_DELETEPLAYERFROMGRP 0x0021 +#define DPSYS_CONNECT 0x484b + +typedef struct +{ + DWORD dwType; + DWORD dwPlayerType; + DPID dpId; + char szLongName[DPLONGNAMELEN]; + char szShortName[DPSHORTNAMELEN]; + DWORD dwCurrentPlayers; +} DPMSG_ADDPLAYER; + +typedef DPMSG_ADDPLAYER DPMSG_ADDGROUP; + +typedef struct +{ + DWORD dwType; + DPID dpIdGroup; + DPID dpIdPlayer; +} DPMSG_GROUPADD; + +typedef DPMSG_GROUPADD DPMSG_GROUPDELETE; +typedef struct +{ + DWORD dwType; + DPID dpId; +} DPMSG_DELETEPLAYER; + +typedef BOOL (PASCAL *LPDPENUMPLAYERSCALLBACK)( + DPID dpId, + LPSTR lpFriendlyName, + LPSTR lpFormalName, + DWORD dwFlags, + LPVOID lpContext ); + +typedef struct +{ + DWORD dwSize; + GUID guidSession; + DWORD_PTR dwSession; + DWORD dwMaxPlayers; + DWORD dwCurrentPlayers; + DWORD dwFlags; + char szSessionName[DPSESSIONNAMELEN]; + char szUserField[DPUSERRESERVED]; + DWORD_PTR dwReserved1; + char szPassword[DPPASSWORDLEN]; + DWORD_PTR dwReserved2; + DWORD_PTR dwUser1; + DWORD_PTR dwUser2; + DWORD_PTR dwUser3; + DWORD_PTR dwUser4; +} DPSESSIONDESC,*LPDPSESSIONDESC; + +typedef BOOL (PASCAL * LPDPENUMSESSIONSCALLBACK)( + LPDPSESSIONDESC lpDPSessionDesc, + LPVOID lpContext, + LPDWORD lpdwTimeOut, + DWORD dwFlags); + +/* + * IDirectPlay + */ +#undef INTERFACE +#define INTERFACE IDirectPlay +DECLARE_INTERFACE_( IDirectPlay, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectPlay methods ***/ + STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; + STDMETHOD(Close) (THIS) PURE; + STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPSTR,LPSTR,LPHANDLE) PURE; + STDMETHOD(CreateGroup) (THIS_ LPDPID,LPSTR,LPSTR) PURE; + STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; + STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; + STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; + STDMETHOD(EnableNewPlayers) (THIS_ BOOL) PURE; + STDMETHOD(EnumGroupPlayers) (THIS_ DPID, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(EnumGroups) (THIS_ DWORD_PTR, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(EnumPlayers) (THIS_ DWORD_PTR, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC,DWORD,LPDPENUMSESSIONSCALLBACK,LPVOID,DWORD) PURE; + STDMETHOD(GetCaps) (THIS_ LPDPCAPS) PURE; + STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; + STDMETHOD(GetPlayerCaps) (THIS_ DPID, LPDPCAPS) PURE; + STDMETHOD(GetPlayerName) (THIS_ DPID,LPSTR,LPDWORD,LPSTR,LPDWORD) PURE; + STDMETHOD(Initialize) (THIS_ LPGUID) PURE; + STDMETHOD(Open) (THIS_ LPDPSESSIONDESC) PURE; + STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; + STDMETHOD(SaveSession) (THIS_ LPSTR) PURE; + STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; + STDMETHOD(SetPlayerName) (THIS_ DPID,LPSTR,LPSTR) PURE; +}; + +/**************************************************************************** + * + * IDirectPlay interface macros + * + ****************************************************************************/ + +#if !defined(__cplusplus) || defined(CINTERFACE) + +#define IDirectPlay_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) +#define IDirectPlay_Close(p) (p)->lpVtbl->Close(p) +#define IDirectPlay_CreateGroup(p,a,b,c) (p)->lpVtbl->CreateGroup(p,a,b,c) +#define IDirectPlay_CreatePlayer(p,a,b,c,d) (p)->lpVtbl->CreatePlayer(p,a,b,c,d) +#define IDirectPlay_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) +#define IDirectPlay_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) +#define IDirectPlay_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) +#define IDirectPlay_EnableNewPlayers(p,a) (p)->lpVtbl->EnableNewPlayers(p,a) +#define IDirectPlay_EnumGroupPlayers(p,a,b,c,d) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d) +#define IDirectPlay_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) +#define IDirectPlay_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) +#define IDirectPlay_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) +#define IDirectPlay_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectPlay_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) +#define IDirectPlay_GetPlayerCaps(p,a,b) (p)->lpVtbl->GetPlayerCaps(p,a,b) +#define IDirectPlay_GetPlayerName(p,a,b,c,d,e) (p)->lpVtbl->GetPlayerName(p,a,b,c,d,e) +#define IDirectPlay_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#define IDirectPlay_Open(p,a) (p)->lpVtbl->Open(p,a) +#define IDirectPlay_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) +#define IDirectPlay_SaveSession(p,a) (p)->lpVtbl->SaveSession(p,a) +#define IDirectPlay_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) +#define IDirectPlay_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) + +#else /* C++ */ + +#define IDirectPlay_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) +#define IDirectPlay_Close(p) (p)->Close() +#define IDirectPlay_CreateGroup(p,a,b,c) (p)->CreateGroup(a,b,c) +#define IDirectPlay_CreatePlayer(p,a,b,c,d) (p)->CreatePlayer(a,b,c,d) +#define IDirectPlay_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) +#define IDirectPlay_DestroyGroup(p,a) (p)->DestroyGroup(a) +#define IDirectPlay_DestroyPlayer(p,a) (p)->DestroyPlayer(a) +#define IDirectPlay_EnableNewPlayers(p,a) (p)->EnableNewPlayers(a) +#define IDirectPlay_EnumGroupPlayers(p,a,b,c,d) (p)->EnumGroupPlayers(a,b,c,d) +#define IDirectPlay_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) +#define IDirectPlay_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) +#define IDirectPlay_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) +#define IDirectPlay_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectPlay_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) +#define IDirectPlay_GetPlayerCaps(p,a,b) (p)->GetPlayerCaps(a,b) +#define IDirectPlay_GetPlayerName(p,a,b,c,d,e) (p)->GetPlayerName(a,b,c,d,e) +#define IDirectPlay_Initialize(p,a) (p)->Initialize(a) +#define IDirectPlay_Open(p,a) (p)->Open(a) +#define IDirectPlay_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) +#define IDirectPlay_SaveSession(p,a) (p)->SaveSession(a) +#define IDirectPlay_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) +#define IDirectPlay_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) + +#endif + +DEFINE_GUID(IID_IDirectPlay, 0x5454e9a0, 0xdb65, 0x11ce, 0x92, 0x1c, 0x00, 0xaa, 0x00, 0x6c, 0x49, 0x72); + +#endif // IDIRECTPLAY2_OR_GREATER + +/**************************************************************************** + * + * IDirectPlay macros (included regardless of IDIRECTPLAY2_OR_GREATER flag) + * + ****************************************************************************/ + +#if !defined(__cplusplus) || defined(CINTERFACE) + +#define IDirectPlay_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlay_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlay_Release(p) (p)->lpVtbl->Release(p) + +#else + +#define IDirectPlay_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlay_AddRef(p) (p)->AddRef() +#define IDirectPlay_Release(p) (p)->Release() + +#endif // IDirectPlay interface macros + +#ifdef __cplusplus +}; +#endif + +/* restore warning settings */ +#if _MSC_VER >= 1200 +#pragma warning(pop) +#else +#pragma warning(default:4201) +#endif + +#endif + diff --git a/Src/Decoder_H264_ALL/D3D/include/dplay8.h b/Src/Decoder_H264_ALL/D3D/include/dplay8.h new file mode 100644 index 0000000..c6799a9 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dplay8.h @@ -0,0 +1,1456 @@ +/*========================================================================== + * + * Copyright (C) 1998-2002 Microsoft Corporation. All Rights Reserved. + * + * File: DPlay8.h + * Content: DirectPlay8 include file + * + ***************************************************************************/ + +#ifndef __DIRECTPLAY8_H__ +#define __DIRECTPLAY8_H__ + +#include // for DECLARE_INTERFACE_ and HRESULT + +#include "dpaddr.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + + +/**************************************************************************** + * + * DirectPlay8 CLSIDs + * + ****************************************************************************/ + +// {743F1DC6-5ABA-429f-8BDF-C54D03253DC2} +DEFINE_GUID(CLSID_DirectPlay8Client, +0x743f1dc6, 0x5aba, 0x429f, 0x8b, 0xdf, 0xc5, 0x4d, 0x3, 0x25, 0x3d, 0xc2); + +// {DA825E1B-6830-43d7-835D-0B5AD82956A2} +DEFINE_GUID(CLSID_DirectPlay8Server, +0xda825e1b, 0x6830, 0x43d7, 0x83, 0x5d, 0xb, 0x5a, 0xd8, 0x29, 0x56, 0xa2); + +// {286F484D-375E-4458-A272-B138E2F80A6A} +DEFINE_GUID(CLSID_DirectPlay8Peer, +0x286f484d, 0x375e, 0x4458, 0xa2, 0x72, 0xb1, 0x38, 0xe2, 0xf8, 0xa, 0x6a); + + +// CLSIDs added for DirectX 9 + +// {FC47060E-6153-4b34-B975-8E4121EB7F3C} +DEFINE_GUID(CLSID_DirectPlay8ThreadPool, +0xfc47060e, 0x6153, 0x4b34, 0xb9, 0x75, 0x8e, 0x41, 0x21, 0xeb, 0x7f, 0x3c); + +// {E4C1D9A2-CBF7-48bd-9A69-34A55E0D8941} +DEFINE_GUID(CLSID_DirectPlay8NATResolver, +0xe4c1d9a2, 0xcbf7, 0x48bd, 0x9a, 0x69, 0x34, 0xa5, 0x5e, 0xd, 0x89, 0x41); + +/**************************************************************************** + * + * DirectPlay8 Interface IIDs + * + ****************************************************************************/ + +typedef REFIID DP8REFIID; + + +// {5102DACD-241B-11d3-AEA7-006097B01411} +DEFINE_GUID(IID_IDirectPlay8Client, +0x5102dacd, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); + +// {5102DACE-241B-11d3-AEA7-006097B01411} +DEFINE_GUID(IID_IDirectPlay8Server, +0x5102dace, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); + +// {5102DACF-241B-11d3-AEA7-006097B01411} +DEFINE_GUID(IID_IDirectPlay8Peer, +0x5102dacf, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); + + +// IIDs added for DirectX 9 + +// {0D22EE73-4A46-4a0d-89B2-045B4D666425} +DEFINE_GUID(IID_IDirectPlay8ThreadPool, +0xd22ee73, 0x4a46, 0x4a0d, 0x89, 0xb2, 0x4, 0x5b, 0x4d, 0x66, 0x64, 0x25); + +// {A9E213F2-9A60-486f-BF3B-53408B6D1CBB} +DEFINE_GUID(IID_IDirectPlay8NATResolver, +0xa9e213f2, 0x9a60, 0x486f, 0xbf, 0x3b, 0x53, 0x40, 0x8b, 0x6d, 0x1c, 0xbb); + +/**************************************************************************** + * + * DirectPlay8 Service Provider GUIDs + * + ****************************************************************************/ + + +// {53934290-628D-11D2-AE0F-006097B01411} +DEFINE_GUID(CLSID_DP8SP_IPX, +0x53934290, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); + + +// {6D4A3650-628D-11D2-AE0F-006097B01411} +DEFINE_GUID(CLSID_DP8SP_MODEM, +0x6d4a3650, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); + + +// {743B5D60-628D-11D2-AE0F-006097B01411} +DEFINE_GUID(CLSID_DP8SP_SERIAL, +0x743b5d60, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); + + +// {EBFE7BA0-628D-11D2-AE0F-006097B01411} +DEFINE_GUID(CLSID_DP8SP_TCPIP, +0xebfe7ba0, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); + + +// Service providers added for DirectX 9 + + +// {995513AF-3027-4b9a-956E-C772B3F78006} +DEFINE_GUID(CLSID_DP8SP_BLUETOOTH, +0x995513af, 0x3027, 0x4b9a, 0x95, 0x6e, 0xc7, 0x72, 0xb3, 0xf7, 0x80, 0x6); + + +/**************************************************************************** + * + * DirectPlay8 Interface Pointer definitions + * + ****************************************************************************/ + +typedef struct IDirectPlay8Client *PDIRECTPLAY8CLIENT; + +typedef struct IDirectPlay8Server *PDIRECTPLAY8SERVER; + +typedef struct IDirectPlay8Peer *PDIRECTPLAY8PEER; + + +// Interface pointers added for DirectX 9 + +typedef struct IDirectPlay8ThreadPool *PDIRECTPLAY8THREADPOOL; + +typedef struct IDirectPlay8NATResolver *PDIRECTPLAY8NATRESOLVER; + +/**************************************************************************** + * + * DirectPlay8 Forward Declarations For External Types + * + ****************************************************************************/ + +typedef struct IDirectPlay8LobbiedApplication *PDNLOBBIEDAPPLICATION; +typedef struct IDirectPlay8Address IDirectPlay8Address; + +/**************************************************************************** + * + * DirectPlay8 Callback Functions + * + ****************************************************************************/ + +// +// Callback Function Type Definition +// +typedef HRESULT (WINAPI *PFNDPNMESSAGEHANDLER)(PVOID,DWORD,PVOID); + +/**************************************************************************** + * + * DirectPlay8 Datatypes (Non-Structure / Non-Message) + * + ****************************************************************************/ + +// +// Player IDs. Used to uniquely identify a player in a session +// +typedef DWORD DPNID, *PDPNID; + +// +// Used as identifiers for operations +// +typedef DWORD DPNHANDLE, *PDPNHANDLE; + + + + +/**************************************************************************** + * + * DirectPlay8 Message Identifiers + * + ****************************************************************************/ + +#define DPN_MSGID_OFFSET 0xFFFF0000 +#define DPN_MSGID_ADD_PLAYER_TO_GROUP ( DPN_MSGID_OFFSET | 0x0001 ) +#define DPN_MSGID_APPLICATION_DESC ( DPN_MSGID_OFFSET | 0x0002 ) +#define DPN_MSGID_ASYNC_OP_COMPLETE ( DPN_MSGID_OFFSET | 0x0003 ) +#define DPN_MSGID_CLIENT_INFO ( DPN_MSGID_OFFSET | 0x0004 ) +#define DPN_MSGID_CONNECT_COMPLETE ( DPN_MSGID_OFFSET | 0x0005 ) +#define DPN_MSGID_CREATE_GROUP ( DPN_MSGID_OFFSET | 0x0006 ) +#define DPN_MSGID_CREATE_PLAYER ( DPN_MSGID_OFFSET | 0x0007 ) +#define DPN_MSGID_DESTROY_GROUP ( DPN_MSGID_OFFSET | 0x0008 ) +#define DPN_MSGID_DESTROY_PLAYER ( DPN_MSGID_OFFSET | 0x0009 ) +#define DPN_MSGID_ENUM_HOSTS_QUERY ( DPN_MSGID_OFFSET | 0x000a ) +#define DPN_MSGID_ENUM_HOSTS_RESPONSE ( DPN_MSGID_OFFSET | 0x000b ) +#define DPN_MSGID_GROUP_INFO ( DPN_MSGID_OFFSET | 0x000c ) +#define DPN_MSGID_HOST_MIGRATE ( DPN_MSGID_OFFSET | 0x000d ) +#define DPN_MSGID_INDICATE_CONNECT ( DPN_MSGID_OFFSET | 0x000e ) +#define DPN_MSGID_INDICATED_CONNECT_ABORTED ( DPN_MSGID_OFFSET | 0x000f ) +#define DPN_MSGID_PEER_INFO ( DPN_MSGID_OFFSET | 0x0010 ) +#define DPN_MSGID_RECEIVE ( DPN_MSGID_OFFSET | 0x0011 ) +#define DPN_MSGID_REMOVE_PLAYER_FROM_GROUP ( DPN_MSGID_OFFSET | 0x0012 ) +#define DPN_MSGID_RETURN_BUFFER ( DPN_MSGID_OFFSET | 0x0013 ) +#define DPN_MSGID_SEND_COMPLETE ( DPN_MSGID_OFFSET | 0x0014 ) +#define DPN_MSGID_SERVER_INFO ( DPN_MSGID_OFFSET | 0x0015 ) +#define DPN_MSGID_TERMINATE_SESSION ( DPN_MSGID_OFFSET | 0x0016 ) + +// Messages added for DirectX 9 +#define DPN_MSGID_CREATE_THREAD ( DPN_MSGID_OFFSET | 0x0017 ) +#define DPN_MSGID_DESTROY_THREAD ( DPN_MSGID_OFFSET | 0x0018 ) +#define DPN_MSGID_NAT_RESOLVER_QUERY ( DPN_MSGID_OFFSET | 0x0101 ) + +/**************************************************************************** + * + * DirectPlay8 Constants + * + ****************************************************************************/ + +#define DPNID_ALL_PLAYERS_GROUP 0 + +// +// DESTROY_GROUP reasons +// +#define DPNDESTROYGROUPREASON_NORMAL 0x0001 +#define DPNDESTROYGROUPREASON_AUTODESTRUCTED 0x0002 +#define DPNDESTROYGROUPREASON_SESSIONTERMINATED 0x0003 + +// +// DESTROY_PLAYER reasons +// +#define DPNDESTROYPLAYERREASON_NORMAL 0x0001 +#define DPNDESTROYPLAYERREASON_CONNECTIONLOST 0x0002 +#define DPNDESTROYPLAYERREASON_SESSIONTERMINATED 0x0003 +#define DPNDESTROYPLAYERREASON_HOSTDESTROYEDPLAYER 0x0004 + +#define DPN_MAX_APPDESC_RESERVEDDATA_SIZE 64 + + + +/**************************************************************************** + * + * DirectPlay8 Flags + * + ****************************************************************************/ + +// +// Asynchronous operation flags (for Async Ops) +// +#define DPNOP_SYNC 0x80000000 + +// +// Add player to group flags (for AddPlayerToGroup) +// +#define DPNADDPLAYERTOGROUP_SYNC DPNOP_SYNC + +// +// Cancel flags +// +#define DPNCANCEL_CONNECT 0x00000001 +#define DPNCANCEL_ENUM 0x00000002 +#define DPNCANCEL_SEND 0x00000004 +#define DPNCANCEL_ALL_OPERATIONS 0x00008000 +// Flags added for DirectX 9 +#define DPNCANCEL_PLAYER_SENDS 0x80000000 +#define DPNCANCEL_PLAYER_SENDS_PRIORITY_HIGH (DPNCANCEL_PLAYER_SENDS | 0x00010000) +#define DPNCANCEL_PLAYER_SENDS_PRIORITY_NORMAL (DPNCANCEL_PLAYER_SENDS | 0x00020000) +#define DPNCANCEL_PLAYER_SENDS_PRIORITY_LOW (DPNCANCEL_PLAYER_SENDS | 0x00040000) + +// +// Close flags (for Close, added for DirectX 9) +// +#define DPNCLOSE_IMMEDIATE 0x00000001 + +// +// Connect flags (for Connect) +// +#define DPNCONNECT_SYNC DPNOP_SYNC +#define DPNCONNECT_OKTOQUERYFORADDRESSING 0x0001 + +// +// Create group flags (for CreateGroup) +// +#define DPNCREATEGROUP_SYNC DPNOP_SYNC + +// +// Destroy group flags (for DestroyGroup) +// +#define DPNDESTROYGROUP_SYNC DPNOP_SYNC + +// +// Enumerate clients and groups flags (for EnumPlayersAndGroups) +// +#define DPNENUM_PLAYERS 0x0001 +#define DPNENUM_GROUPS 0x0010 + +// +// Enum hosts flags (for EnumHosts) +// +#define DPNENUMHOSTS_SYNC DPNOP_SYNC +#define DPNENUMHOSTS_OKTOQUERYFORADDRESSING 0x0001 +#define DPNENUMHOSTS_NOBROADCASTFALLBACK 0x0002 + +// +// Enum service provider flags (for EnumSP) +// +#define DPNENUMSERVICEPROVIDERS_ALL 0x0001 + +// +// GetLocalHostAddresses flags (added for DirectX 9) +// +#define DPNGETLOCALHOSTADDRESSES_COMBINED 0x0001 + +// +// Get send queue info flags (for GetSendQueueInfo) +// +#define DPNGETSENDQUEUEINFO_PRIORITY_NORMAL 0x0001 +#define DPNGETSENDQUEUEINFO_PRIORITY_HIGH 0x0002 +#define DPNGETSENDQUEUEINFO_PRIORITY_LOW 0x0004 + +// +// Group information flags (for Group Info) +// +#define DPNGROUP_AUTODESTRUCT 0x0001 + +// +// Host flags (for Host) +// +#define DPNHOST_OKTOQUERYFORADDRESSING 0x0001 + +// +// Set info +// +#define DPNINFO_NAME 0x0001 +#define DPNINFO_DATA 0x0002 + +// +// Initialize flags (for Initialize) +// +#define DPNINITIALIZE_DISABLEPARAMVAL 0x0001 +// Flags added for DirectX 9 +#define DPNINITIALIZE_HINT_LANSESSION 0x0002 +#define DPNINITIALIZE_DISABLELINKTUNING 0x0004 + + +// +// Register Lobby flags +// +#define DPNLOBBY_REGISTER 0x0001 +#define DPNLOBBY_UNREGISTER 0x0002 + +// +// Player information flags (for Player Info / Player Messages) +// +#define DPNPLAYER_LOCAL 0x0002 +#define DPNPLAYER_HOST 0x0004 + +// +// Receive indication flags (added for DirectX 9) +// +#define DPNRECEIVE_GUARANTEED 0x0001 +#define DPNRECEIVE_COALESCED 0x0002 + +// +// Remove player from group flags (for RemovePlayerFromGroup) +// +#define DPNREMOVEPLAYERFROMGROUP_SYNC DPNOP_SYNC + +// +// Send flags (for Send/SendTo) +// +#define DPNSEND_SYNC DPNOP_SYNC +#define DPNSEND_NOCOPY 0x0001 +#define DPNSEND_NOCOMPLETE 0x0002 +#define DPNSEND_COMPLETEONPROCESS 0x0004 +#define DPNSEND_GUARANTEED 0x0008 +#define DPNSEND_NONSEQUENTIAL 0x0010 +#define DPNSEND_NOLOOPBACK 0x0020 +#define DPNSEND_PRIORITY_LOW 0x0040 +#define DPNSEND_PRIORITY_HIGH 0x0080 +// Flag added for DirectX 9 +#define DPNSEND_COALESCE 0x0100 + +// +// Send complete indication flags (added for DirectX 9) +// +#define DPNSENDCOMPLETE_GUARANTEED 0x0001 +#define DPNSENDCOMPLETE_COALESCED 0x0002 + +// +// Session Flags (for DPN_APPLICATION_DESC) +// +#define DPNSESSION_CLIENT_SERVER 0x0001 +#define DPNSESSION_MIGRATE_HOST 0x0004 +#define DPNSESSION_NODPNSVR 0x0040 +#define DPNSESSION_REQUIREPASSWORD 0x0080 +// Flag added for DirectX 9 +#define DPNSESSION_NOENUMS 0x0100 +#define DPNSESSION_FAST_SIGNED 0x0200 +#define DPNSESSION_FULL_SIGNED 0x0400 + +// +// Set client info flags (for SetClientInfo) +// +#define DPNSETCLIENTINFO_SYNC DPNOP_SYNC + +// +// Set group info flags (for SetGroupInfo) +// +#define DPNSETGROUPINFO_SYNC DPNOP_SYNC + +// +// Set peer info flags (for SetPeerInfo) +// +#define DPNSETPEERINFO_SYNC DPNOP_SYNC + +// +// Set server info flags (for SetServerInfo) +// +#define DPNSETSERVERINFO_SYNC DPNOP_SYNC + +// +// SP capabilities flags +// +#define DPNSPCAPS_SUPPORTSDPNSVR 0x0001 +#define DPNSPCAPS_SUPPORTSDPNSRV DPNSPCAPS_SUPPORTSDPNSVR +#define DPNSPCAPS_SUPPORTSBROADCAST 0x0002 +#define DPNSPCAPS_SUPPORTSALLADAPTERS 0x0004 +// Flags added for DirectX 9 +#define DPNSPCAPS_SUPPORTSTHREADPOOL 0x0008 +#define DPNSPCAPS_NETWORKSIMULATOR 0x0010 + +// +// SP information flags (added for DirectX 9) +// +#define DPNSPINFO_NETWORKSIMULATORDEVICE 0x0001 + +/**************************************************************************** + * + * DirectPlay8 Structures (Non-Message) + * + ****************************************************************************/ + +// +// Application description +// +typedef struct _DPN_APPLICATION_DESC +{ + DWORD dwSize; // Size of this structure + DWORD dwFlags; // Flags (DPNSESSION_...) + GUID guidInstance; // Instance GUID + GUID guidApplication; // Application GUID + DWORD dwMaxPlayers; // Maximum # of players allowed (0=no limit) + DWORD dwCurrentPlayers; // Current # of players allowed + WCHAR *pwszSessionName; // Name of the session + WCHAR *pwszPassword; // Password for the session + PVOID pvReservedData; + DWORD dwReservedDataSize; + PVOID pvApplicationReservedData; + DWORD dwApplicationReservedDataSize; +} DPN_APPLICATION_DESC, *PDPN_APPLICATION_DESC; + +// +// Generic Buffer Description +// +typedef struct _BUFFERDESC +{ + DWORD dwBufferSize; + BYTE * pBufferData; +} BUFFERDESC, DPN_BUFFER_DESC, *PDPN_BUFFER_DESC; + +typedef BUFFERDESC FAR * PBUFFERDESC; + +// +// DirectPlay8 capabilities +// +typedef struct _DPN_CAPS +{ + DWORD dwSize; // Size of this structure + DWORD dwFlags; // Flags + DWORD dwConnectTimeout; // ms before a connect request times out + DWORD dwConnectRetries; // # of times to attempt the connection + DWORD dwTimeoutUntilKeepAlive; // ms of inactivity before a keep alive is sent +} DPN_CAPS, *PDPN_CAPS; + +// +// Extended capabilities structures (added for DirectX 9) +// +typedef struct _DPN_CAPS_EX +{ + DWORD dwSize; // Size of this structure + DWORD dwFlags; // Flags + DWORD dwConnectTimeout; // ms before a connect request times out + DWORD dwConnectRetries; // # of times to attempt the connection + DWORD dwTimeoutUntilKeepAlive; // ms of inactivity before a keep alive is sent + DWORD dwMaxRecvMsgSize; // maximum size in bytes of message that can be received + DWORD dwNumSendRetries; // maximum number of send retries before link is considered dead + DWORD dwMaxSendRetryInterval; // maximum period in msec between send retries + DWORD dwDropThresholdRate; // percentage of dropped packets before throttling + DWORD dwThrottleRate; // percentage amount to reduce send window when throttling + DWORD dwNumHardDisconnectSends; // number of hard disconnect frames to send when close immediate flag is specified + DWORD dwMaxHardDisconnectPeriod; // maximum period between hard disconnect sends +} DPN_CAPS_EX, *PDPN_CAPS_EX; + +// +// Connection Statistics information +// +typedef struct _DPN_CONNECTION_INFO +{ + DWORD dwSize; + DWORD dwRoundTripLatencyMS; + DWORD dwThroughputBPS; + DWORD dwPeakThroughputBPS; + + DWORD dwBytesSentGuaranteed; + DWORD dwPacketsSentGuaranteed; + DWORD dwBytesSentNonGuaranteed; + DWORD dwPacketsSentNonGuaranteed; + + DWORD dwBytesRetried; // Guaranteed only + DWORD dwPacketsRetried; // Guaranteed only + DWORD dwBytesDropped; // Non Guaranteed only + DWORD dwPacketsDropped; // Non Guaranteed only + + DWORD dwMessagesTransmittedHighPriority; + DWORD dwMessagesTimedOutHighPriority; + DWORD dwMessagesTransmittedNormalPriority; + DWORD dwMessagesTimedOutNormalPriority; + DWORD dwMessagesTransmittedLowPriority; + DWORD dwMessagesTimedOutLowPriority; + + DWORD dwBytesReceivedGuaranteed; + DWORD dwPacketsReceivedGuaranteed; + DWORD dwBytesReceivedNonGuaranteed; + DWORD dwPacketsReceivedNonGuaranteed; + DWORD dwMessagesReceived; + +} DPN_CONNECTION_INFO, *PDPN_CONNECTION_INFO; + + +// +// Group information structure +// +typedef struct _DPN_GROUP_INFO +{ + DWORD dwSize; // size of this structure + DWORD dwInfoFlags; // information contained + PWSTR pwszName; // Unicode Name + PVOID pvData; // data block + DWORD dwDataSize; // size in BYTES of data block + DWORD dwGroupFlags; // group flags (DPNGROUP_...) +} DPN_GROUP_INFO, *PDPN_GROUP_INFO; + +// +// Player information structure +// +typedef struct _DPN_PLAYER_INFO +{ + DWORD dwSize; // size of this structure + DWORD dwInfoFlags; // information contained + PWSTR pwszName; // Unicode Name + PVOID pvData; // data block + DWORD dwDataSize; // size in BYTES of data block + DWORD dwPlayerFlags; // player flags (DPNPLAYER_...) +} DPN_PLAYER_INFO, *PDPN_PLAYER_INFO; + +typedef struct _DPN_SECURITY_CREDENTIALS DPN_SECURITY_CREDENTIALS, *PDPN_SECURITY_CREDENTIALS; +typedef struct _DPN_SECURITY_DESC DPN_SECURITY_DESC, *PDPN_SECURITY_DESC; + +// +// Service provider & adapter enumeration structure +// +typedef struct _DPN_SERVICE_PROVIDER_INFO +{ + DWORD dwFlags; + GUID guid; // SP Guid + WCHAR *pwszName; // Friendly Name + PVOID pvReserved; + DWORD dwReserved; +} DPN_SERVICE_PROVIDER_INFO, *PDPN_SERVICE_PROVIDER_INFO; + +// +// Service provider caps structure +// +typedef struct _DPN_SP_CAPS +{ + DWORD dwSize; // Size of this structure + DWORD dwFlags; // Flags (DPNSPCAPS_...) + DWORD dwNumThreads; // # of worker threads to use + DWORD dwDefaultEnumCount; // default # of enum requests + DWORD dwDefaultEnumRetryInterval; // default ms between enum requests + DWORD dwDefaultEnumTimeout; // default enum timeout + DWORD dwMaxEnumPayloadSize; // maximum size in bytes for enum payload data + DWORD dwBuffersPerThread; // number of receive buffers per thread + DWORD dwSystemBufferSize; // amount of buffering to do in addition to posted receive buffers +} DPN_SP_CAPS, *PDPN_SP_CAPS; + + +/**************************************************************************** + * + * IDirectPlay8 message handler call back structures + * + ****************************************************************************/ + +// +// Add player to group structure for message handler +// (DPN_MSGID_ADD_PLAYER_TO_GROUP) +// +typedef struct _DPNMSG_ADD_PLAYER_TO_GROUP +{ + DWORD dwSize; // Size of this structure + DPNID dpnidGroup; // DPNID of group + PVOID pvGroupContext; // Group context value + DPNID dpnidPlayer; // DPNID of added player + PVOID pvPlayerContext; // Player context value +} DPNMSG_ADD_PLAYER_TO_GROUP, *PDPNMSG_ADD_PLAYER_TO_GROUP; + +// +// Async operation completion structure for message handler +// (DPN_MSGID_ASYNC_OP_COMPLETE) +// +typedef struct _DPNMSG_ASYNC_OP_COMPLETE +{ + DWORD dwSize; // Size of this structure + DPNHANDLE hAsyncOp; // DirectPlay8 async operation handle + PVOID pvUserContext; // User context supplied + HRESULT hResultCode; // HRESULT of operation +} DPNMSG_ASYNC_OP_COMPLETE, *PDPNMSG_ASYNC_OP_COMPLETE; + +// +// Client info structure for message handler +// (DPN_MSGID_CLIENT_INFO) +// +typedef struct _DPNMSG_CLIENT_INFO +{ + DWORD dwSize; // Size of this structure + DPNID dpnidClient; // DPNID of client + PVOID pvPlayerContext; // Player context value +} DPNMSG_CLIENT_INFO, *PDPNMSG_CLIENT_INFO; + +// +// Connect complete structure for message handler +// (DPN_MSGID_CONNECT_COMPLETE) +// +typedef struct _DPNMSG_CONNECT_COMPLETE +{ + DWORD dwSize; // Size of this structure + DPNHANDLE hAsyncOp; // DirectPlay8 Async operation handle + PVOID pvUserContext; // User context supplied at Connect + HRESULT hResultCode; // HRESULT of connection attempt + PVOID pvApplicationReplyData; // Connection reply data from Host/Server + DWORD dwApplicationReplyDataSize; // Size (in bytes) of pvApplicationReplyData + + // Fields added for DirectX 9 + DPNID dpnidLocal; // DPNID of local player +} DPNMSG_CONNECT_COMPLETE, *PDPNMSG_CONNECT_COMPLETE; + +// +// Create group structure for message handler +// (DPN_MSGID_CREATE_GROUP) +// +typedef struct _DPNMSG_CREATE_GROUP +{ + DWORD dwSize; // Size of this structure + DPNID dpnidGroup; // DPNID of new group + DPNID dpnidOwner; // Owner of newgroup + PVOID pvGroupContext; // Group context value + + // Fields added for DirectX 9 + PVOID pvOwnerContext; // Owner context value +} DPNMSG_CREATE_GROUP, *PDPNMSG_CREATE_GROUP; + +// +// Create player structure for message handler +// (DPN_MSGID_CREATE_PLAYER) +// +typedef struct _DPNMSG_CREATE_PLAYER +{ + DWORD dwSize; // Size of this structure + DPNID dpnidPlayer; // DPNID of new player + PVOID pvPlayerContext; // Player context value +} DPNMSG_CREATE_PLAYER, *PDPNMSG_CREATE_PLAYER; + +// +// Destroy group structure for message handler +// (DPN_MSGID_DESTROY_GROUP) +// +typedef struct _DPNMSG_DESTROY_GROUP +{ + DWORD dwSize; // Size of this structure + DPNID dpnidGroup; // DPNID of destroyed group + PVOID pvGroupContext; // Group context value + DWORD dwReason; // Information only +} DPNMSG_DESTROY_GROUP, *PDPNMSG_DESTROY_GROUP; + +// +// Destroy player structure for message handler +// (DPN_MSGID_DESTROY_PLAYER) +// +typedef struct _DPNMSG_DESTROY_PLAYER +{ + DWORD dwSize; // Size of this structure + DPNID dpnidPlayer; // DPNID of leaving player + PVOID pvPlayerContext; // Player context value + DWORD dwReason; // Information only +} DPNMSG_DESTROY_PLAYER, *PDPNMSG_DESTROY_PLAYER; + +// +// Enumeration request received structure for message handler +// (DPN_MSGID_ENUM_HOSTS_QUERY) +// +typedef struct _DPNMSG_ENUM_HOSTS_QUERY +{ + DWORD dwSize; // Size of this structure. + IDirectPlay8Address *pAddressSender; // Address of client who sent the request + IDirectPlay8Address *pAddressDevice; // Address of device request was received on + PVOID pvReceivedData; // Request data (set on client) + DWORD dwReceivedDataSize; // Request data size (set on client) + DWORD dwMaxResponseDataSize; // Max allowable size of enum response + PVOID pvResponseData; // Optional query repsonse (user set) + DWORD dwResponseDataSize; // Optional query response size (user set) + PVOID pvResponseContext; // Optional query response context (user set) +} DPNMSG_ENUM_HOSTS_QUERY, *PDPNMSG_ENUM_HOSTS_QUERY; + +// +// Enumeration response received structure for message handler +// (DPN_MSGID_ENUM_HOSTS_RESPONSE) +// +typedef struct _DPNMSG_ENUM_HOSTS_RESPONSE +{ + DWORD dwSize; // Size of this structure + IDirectPlay8Address *pAddressSender; // Address of host who responded + IDirectPlay8Address *pAddressDevice; // Device response was received on + const DPN_APPLICATION_DESC *pApplicationDescription; // Application description for the session + PVOID pvResponseData; // Optional response data (set on host) + DWORD dwResponseDataSize; // Optional response data size (set on host) + PVOID pvUserContext; // Context value supplied for enumeration + DWORD dwRoundTripLatencyMS; // Round trip latency in MS +} DPNMSG_ENUM_HOSTS_RESPONSE, *PDPNMSG_ENUM_HOSTS_RESPONSE; + +// +// Group info structure for message handler +// (DPN_MSGID_GROUP_INFO) +// +typedef struct _DPNMSG_GROUP_INFO +{ + DWORD dwSize; // Size of this structure + DPNID dpnidGroup; // DPNID of group + PVOID pvGroupContext; // Group context value +} DPNMSG_GROUP_INFO, *PDPNMSG_GROUP_INFO; + +// +// Migrate host structure for message handler +// (DPN_MSGID_HOST_MIGRATE) +// +typedef struct _DPNMSG_HOST_MIGRATE +{ + DWORD dwSize; // Size of this structure + DPNID dpnidNewHost; // DPNID of new Host player + PVOID pvPlayerContext; // Player context value +} DPNMSG_HOST_MIGRATE, *PDPNMSG_HOST_MIGRATE; + +// +// Indicate connect structure for message handler +// (DPN_MSGID_INDICATE_CONNECT) +// +typedef struct _DPNMSG_INDICATE_CONNECT +{ + DWORD dwSize; // Size of this structure + PVOID pvUserConnectData; // Connecting player data + DWORD dwUserConnectDataSize; // Size (in bytes) of pvUserConnectData + PVOID pvReplyData; // Connection reply data + DWORD dwReplyDataSize; // Size (in bytes) of pvReplyData + PVOID pvReplyContext; // Buffer context for pvReplyData + PVOID pvPlayerContext; // Player context preset + IDirectPlay8Address *pAddressPlayer; // Address of connecting player + IDirectPlay8Address *pAddressDevice; // Address of device receiving connect attempt +} DPNMSG_INDICATE_CONNECT, *PDPNMSG_INDICATE_CONNECT; + +// +// Indicated connect aborted structure for message handler +// (DPN_MSGID_INDICATED_CONNECT_ABORTED) +// +typedef struct _DPNMSG_INDICATED_CONNECT_ABORTED +{ + DWORD dwSize; // Size of this structure + PVOID pvPlayerContext; // Player context preset from DPNMSG_INDICATE_CONNECT +} DPNMSG_INDICATED_CONNECT_ABORTED, *PDPNMSG_INDICATED_CONNECT_ABORTED; + +// +// Peer info structure for message handler +// (DPN_MSGID_PEER_INFO) +// +typedef struct _DPNMSG_PEER_INFO +{ + DWORD dwSize; // Size of this structure + DPNID dpnidPeer; // DPNID of peer + PVOID pvPlayerContext; // Player context value +} DPNMSG_PEER_INFO, *PDPNMSG_PEER_INFO; + +// +// Receive structure for message handler +// (DPN_MSGID_RECEIVE) +// +typedef struct _DPNMSG_RECEIVE +{ + DWORD dwSize; // Size of this structure + DPNID dpnidSender; // DPNID of sending player + PVOID pvPlayerContext; // Player context value of sending player + PBYTE pReceiveData; // Received data + DWORD dwReceiveDataSize; // Size (in bytes) of pReceiveData + DPNHANDLE hBufferHandle; // Buffer handle for pReceiveData + + // Fields added for DirectX 9 + DWORD dwReceiveFlags; // Flags describing how message was received +} DPNMSG_RECEIVE, *PDPNMSG_RECEIVE; + +// +// Remove player from group structure for message handler +// (DPN_MSGID_REMOVE_PLAYER_FROM_GROUP) +// +typedef struct _DPNMSG_REMOVE_PLAYER_FROM_GROUP +{ + DWORD dwSize; // Size of this structure + DPNID dpnidGroup; // DPNID of group + PVOID pvGroupContext; // Group context value + DPNID dpnidPlayer; // DPNID of deleted player + PVOID pvPlayerContext; // Player context value +} DPNMSG_REMOVE_PLAYER_FROM_GROUP, *PDPNMSG_REMOVE_PLAYER_FROM_GROUP; + +// +// Returned buffer structure for message handler +// (DPN_MSGID_RETURN_BUFFER) +// +typedef struct _DPNMSG_RETURN_BUFFER +{ + DWORD dwSize; // Size of this structure + HRESULT hResultCode; // Return value of operation + PVOID pvBuffer; // Buffer being returned + PVOID pvUserContext; // Context associated with buffer +} DPNMSG_RETURN_BUFFER, *PDPNMSG_RETURN_BUFFER; + +// +// Send complete structure for message handler +// (DPN_MSGID_SEND_COMPLETE) +// +typedef struct _DPNMSG_SEND_COMPLETE +{ + DWORD dwSize; // Size of this structure + DPNHANDLE hAsyncOp; // DirectPlay8 Async operation handle + PVOID pvUserContext; // User context supplied at Send/SendTo + HRESULT hResultCode; // HRESULT of send + DWORD dwSendTime; // Send time in ms + + // Fields added for DirectX 9 + DWORD dwFirstFrameRTT; // RTT of the first frame in the message + DWORD dwFirstFrameRetryCount; // Retry count of the first frame + DWORD dwSendCompleteFlags; // Flags describing how message was sent + DPN_BUFFER_DESC *pBuffers; // Pointer to array of buffers sent, if DirectPlay did not make a copy + DWORD dwNumBuffers; // Number of buffers in previous array +} DPNMSG_SEND_COMPLETE, *PDPNMSG_SEND_COMPLETE; + +// +// Server info structure for message handler +// (DPN_MSGID_SERVER_INFO) +// +typedef struct _DPNMSG_SERVER_INFO +{ + DWORD dwSize; // Size of this structure + DPNID dpnidServer; // DPNID of server + PVOID pvPlayerContext; // Player context value +} DPNMSG_SERVER_INFO, *PDPNMSG_SERVER_INFO; + +// +// Terminated session structure for message handler +// (DPN_MSGID_TERMINATE_SESSION) +// +typedef struct _DPNMSG_TERMINATE_SESSION +{ + DWORD dwSize; // Size of this structure + HRESULT hResultCode; // Reason + PVOID pvTerminateData; // Data passed from Host/Server + DWORD dwTerminateDataSize;// Size (in bytes) of pvTerminateData +} DPNMSG_TERMINATE_SESSION, *PDPNMSG_TERMINATE_SESSION; + + +// +// Message structures added for DirectX 9 +// + +// +// Create thread info structure for message handler +// (DPN_MSGID_CREATE_THREAD) +// +typedef struct _DPNMSG_CREATE_THREAD +{ + DWORD dwSize; // Size of this structure + DWORD dwFlags; // Flags describing this thread + DWORD dwProcessorNum; // Index of processor to which thread is bound + PVOID pvUserContext; // Thread context value +} DPNMSG_CREATE_THREAD, *PDPNMSG_CREATE_THREAD; + +// +// Destroy thread info structure for message handler +// (DPN_MSGID_DESTROY_THREAD) +// +typedef struct _DPNMSG_DESTROY_THREAD +{ + DWORD dwSize; // Size of this structure + DWORD dwProcessorNum; // Index of processor to which thread was bound + PVOID pvUserContext; // Thread context value +} DPNMSG_DESTROY_THREAD, *PDPNMSG_DESTROY_THREAD; + + +// +// Query-to-resolve-NAT-address structure for message handler +// (DPN_MSGID_NAT_RESOLVER_QUERY) +// +typedef struct _DPNMSG_NAT_RESOLVER_QUERY +{ + DWORD dwSize; // Size of this structure. + IDirectPlay8Address *pAddressSender; // Address of client that sent the query + IDirectPlay8Address *pAddressDevice; // Address of device on which query was received + WCHAR *pwszUserString; // User specified string, or NULL if none +} DPNMSG_NAT_RESOLVER_QUERY, *PDPNMSG_NAT_RESOLVER_QUERY; + +/**************************************************************************** + * + * DirectPlay8 Functions + * + ****************************************************************************/ + + + +/* + * This function is no longer supported. It is recommended that CoCreateInstance be used to create + * DirectPlay8 objects. + * + * extern HRESULT WINAPI DirectPlay8Create( const CLSID * pcIID, void **ppvInterface, IUnknown *pUnknown ); + * + */ + + +/**************************************************************************** + * + * DirectPlay8 Application Interfaces + * + ****************************************************************************/ + +// +// COM definition for DirectPlay8 Client interface +// +#undef INTERFACE // External COM Implementation +#define INTERFACE IDirectPlay8Client +DECLARE_INTERFACE_(IDirectPlay8Client,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ DP8REFIID riid, LPVOID *ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectPlay8Client methods ***/ + STDMETHOD(Initialize) (THIS_ PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) PURE; + STDMETHOD(EnumServiceProviders) (THIS_ const GUID *const pguidServiceProvider, const GUID *const pguidApplication, DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer, PDWORD const pcbEnumData, PDWORD const pcReturned, const DWORD dwFlags) PURE; + STDMETHOD(EnumHosts) (THIS_ PDPN_APPLICATION_DESC const pApplicationDesc,IDirectPlay8Address *const pAddrHost,IDirectPlay8Address *const pDeviceInfo,PVOID const pUserEnumData,const DWORD dwUserEnumDataSize,const DWORD dwEnumCount,const DWORD dwRetryInterval,const DWORD dwTimeOut,PVOID const pvUserContext,DPNHANDLE *const pAsyncHandle,const DWORD dwFlags) PURE; + STDMETHOD(CancelAsyncOperation) (THIS_ const DPNHANDLE hAsyncHandle, const DWORD dwFlags) PURE; + STDMETHOD(Connect) (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address *const pHostAddr,IDirectPlay8Address *const pDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,const void *const pvUserConnectData,const DWORD dwUserConnectDataSize,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE; + STDMETHOD(Send) (THIS_ const DPN_BUFFER_DESC *const prgBufferDesc,const DWORD cBufferDesc,const DWORD dwTimeOut,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE; + STDMETHOD(GetSendQueueInfo) (THIS_ DWORD *const pdwNumMsgs, DWORD *const pdwNumBytes, const DWORD dwFlags) PURE; + STDMETHOD(GetApplicationDesc) (THIS_ DPN_APPLICATION_DESC *const pAppDescBuffer, DWORD *const pcbDataSize, const DWORD dwFlags) PURE; + STDMETHOD(SetClientInfo) (THIS_ const DPN_PLAYER_INFO *const pdpnPlayerInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; + STDMETHOD(GetServerInfo) (THIS_ DPN_PLAYER_INFO *const pdpnPlayerInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE; + STDMETHOD(GetServerAddress) (THIS_ IDirectPlay8Address **const pAddress,const DWORD dwFlags) PURE; + STDMETHOD(Close) (THIS_ const DWORD dwFlags) PURE; + STDMETHOD(ReturnBuffer) (THIS_ const DPNHANDLE hBufferHandle,const DWORD dwFlags) PURE; + STDMETHOD(GetCaps) (THIS_ DPN_CAPS *const pdpCaps,const DWORD dwFlags) PURE; + STDMETHOD(SetCaps) (THIS_ const DPN_CAPS *const pdpCaps, const DWORD dwFlags) PURE; + STDMETHOD(SetSPCaps) (THIS_ const GUID * const pguidSP, const DPN_SP_CAPS *const pdpspCaps, const DWORD dwFlags ) PURE; + STDMETHOD(GetSPCaps) (THIS_ const GUID * const pguidSP,DPN_SP_CAPS *const pdpspCaps,const DWORD dwFlags) PURE; + STDMETHOD(GetConnectionInfo) (THIS_ DPN_CONNECTION_INFO *const pdpConnectionInfo,const DWORD dwFlags) PURE; + STDMETHOD(RegisterLobby) (THIS_ const DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication *const pIDP8LobbiedApplication,const DWORD dwFlags) PURE; +}; + +// +// COM definition for DirectPlay8 Server interface +// +#undef INTERFACE // External COM Implementation +#define INTERFACE IDirectPlay8Server +DECLARE_INTERFACE_(IDirectPlay8Server,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ DP8REFIID riid, LPVOID *ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectPlay8Server methods ***/ + STDMETHOD(Initialize) (THIS_ PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) PURE; + STDMETHOD(EnumServiceProviders) (THIS_ const GUID *const pguidServiceProvider,const GUID *const pguidApplication,DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer,PDWORD const pcbEnumData,PDWORD const pcReturned,const DWORD dwFlags) PURE; + STDMETHOD(CancelAsyncOperation) (THIS_ const DPNHANDLE hAsyncHandle,const DWORD dwFlags) PURE; + STDMETHOD(GetSendQueueInfo) (THIS_ const DPNID dpnid,DWORD *const pdwNumMsgs, DWORD *const pdwNumBytes, const DWORD dwFlags) PURE; + STDMETHOD(GetApplicationDesc) (THIS_ DPN_APPLICATION_DESC *const pAppDescBuffer, DWORD *const pcbDataSize, const DWORD dwFlags) PURE; + STDMETHOD(SetServerInfo) (THIS_ const DPN_PLAYER_INFO *const pdpnPlayerInfo,PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; + STDMETHOD(GetClientInfo) (THIS_ const DPNID dpnid,DPN_PLAYER_INFO *const pdpnPlayerInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE; + STDMETHOD(GetClientAddress) (THIS_ const DPNID dpnid,IDirectPlay8Address **const pAddress,const DWORD dwFlags) PURE; + STDMETHOD(GetLocalHostAddresses) (THIS_ IDirectPlay8Address **const prgpAddress,DWORD *const pcAddress,const DWORD dwFlags) PURE; + STDMETHOD(SetApplicationDesc) (THIS_ const DPN_APPLICATION_DESC *const pad, const DWORD dwFlags) PURE; + STDMETHOD(Host) (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address **const prgpDeviceInfo,const DWORD cDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,void *const pvPlayerContext,const DWORD dwFlags) PURE; + STDMETHOD(SendTo) (THIS_ const DPNID dpnid,const DPN_BUFFER_DESC *const prgBufferDesc,const DWORD cBufferDesc,const DWORD dwTimeOut,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE; + STDMETHOD(CreateGroup) (THIS_ const DPN_GROUP_INFO *const pdpnGroupInfo,void *const pvGroupContext,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE; + STDMETHOD(DestroyGroup) (THIS_ const DPNID idGroup, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; + STDMETHOD(AddPlayerToGroup) (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; + STDMETHOD(RemovePlayerFromGroup) (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; + STDMETHOD(SetGroupInfo) (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; + STDMETHOD(GetGroupInfo) (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE; + STDMETHOD(EnumPlayersAndGroups) (THIS_ DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE; + STDMETHOD(EnumGroupMembers) (THIS_ const DPNID dpnid, DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE; + STDMETHOD(Close) (THIS_ const DWORD dwFlags) PURE; + STDMETHOD(DestroyClient) (THIS_ const DPNID dpnidClient, const void *const pvDestroyData, const DWORD dwDestroyDataSize, const DWORD dwFlags) PURE; + STDMETHOD(ReturnBuffer) (THIS_ const DPNHANDLE hBufferHandle,const DWORD dwFlags) PURE; + STDMETHOD(GetPlayerContext) (THIS_ const DPNID dpnid,PVOID *const ppvPlayerContext,const DWORD dwFlags) PURE; + STDMETHOD(GetGroupContext) (THIS_ const DPNID dpnid,PVOID *const ppvGroupContext,const DWORD dwFlags) PURE; + STDMETHOD(GetCaps) (THIS_ DPN_CAPS *const pdpCaps,const DWORD dwFlags) PURE; + STDMETHOD(SetCaps) (THIS_ const DPN_CAPS *const pdpCaps, const DWORD dwFlags) PURE; + STDMETHOD(SetSPCaps) (THIS_ const GUID * const pguidSP, const DPN_SP_CAPS *const pdpspCaps, const DWORD dwFlags ) PURE; + STDMETHOD(GetSPCaps) (THIS_ const GUID * const pguidSP, DPN_SP_CAPS *const pdpspCaps,const DWORD dwFlags) PURE; + STDMETHOD(GetConnectionInfo) (THIS_ const DPNID dpnid, DPN_CONNECTION_INFO *const pdpConnectionInfo,const DWORD dwFlags) PURE; + STDMETHOD(RegisterLobby) (THIS_ const DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication *const pIDP8LobbiedApplication,const DWORD dwFlags) PURE; +}; + +// +// COM definition for DirectPlay8 Peer interface +// +#undef INTERFACE // External COM Implementation +#define INTERFACE IDirectPlay8Peer +DECLARE_INTERFACE_(IDirectPlay8Peer,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ DP8REFIID riid, LPVOID *ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectPlay8Peer methods ***/ + STDMETHOD(Initialize) (THIS_ PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) PURE; + STDMETHOD(EnumServiceProviders) (THIS_ const GUID *const pguidServiceProvider, const GUID *const pguidApplication, DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer, DWORD *const pcbEnumData, DWORD *const pcReturned, const DWORD dwFlags) PURE; + STDMETHOD(CancelAsyncOperation) (THIS_ const DPNHANDLE hAsyncHandle, const DWORD dwFlags) PURE; + STDMETHOD(Connect) (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address *const pHostAddr,IDirectPlay8Address *const pDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,const void *const pvUserConnectData,const DWORD dwUserConnectDataSize,void *const pvPlayerContext,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE; + STDMETHOD(SendTo) (THIS_ const DPNID dpnid,const DPN_BUFFER_DESC *const prgBufferDesc,const DWORD cBufferDesc,const DWORD dwTimeOut,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE; + STDMETHOD(GetSendQueueInfo) (THIS_ const DPNID dpnid, DWORD *const pdwNumMsgs, DWORD *const pdwNumBytes, const DWORD dwFlags) PURE; + STDMETHOD(Host) (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address **const prgpDeviceInfo,const DWORD cDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,void *const pvPlayerContext,const DWORD dwFlags) PURE; + STDMETHOD(GetApplicationDesc) (THIS_ DPN_APPLICATION_DESC *const pAppDescBuffer, DWORD *const pcbDataSize, const DWORD dwFlags) PURE; + STDMETHOD(SetApplicationDesc) (THIS_ const DPN_APPLICATION_DESC *const pad, const DWORD dwFlags) PURE; + STDMETHOD(CreateGroup) (THIS_ const DPN_GROUP_INFO *const pdpnGroupInfo,void *const pvGroupContext,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE; + STDMETHOD(DestroyGroup) (THIS_ const DPNID idGroup, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; + STDMETHOD(AddPlayerToGroup) (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; + STDMETHOD(RemovePlayerFromGroup) (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; + STDMETHOD(SetGroupInfo) (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; + STDMETHOD(GetGroupInfo) (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE; + STDMETHOD(EnumPlayersAndGroups) (THIS_ DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE; + STDMETHOD(EnumGroupMembers) (THIS_ const DPNID dpnid, DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE; + STDMETHOD(SetPeerInfo) (THIS_ const DPN_PLAYER_INFO *const pdpnPlayerInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE; + STDMETHOD(GetPeerInfo) (THIS_ const DPNID dpnid,DPN_PLAYER_INFO *const pdpnPlayerInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE; + STDMETHOD(GetPeerAddress) (THIS_ const DPNID dpnid,IDirectPlay8Address **const ppAddress,const DWORD dwFlags) PURE; + STDMETHOD(GetLocalHostAddresses) (THIS_ IDirectPlay8Address **const prgpAddress,DWORD *const pcAddress,const DWORD dwFlags) PURE; + STDMETHOD(Close) (THIS_ const DWORD dwFlags) PURE; + STDMETHOD(EnumHosts) (THIS_ PDPN_APPLICATION_DESC const pApplicationDesc,IDirectPlay8Address *const pAddrHost,IDirectPlay8Address *const pDeviceInfo,PVOID const pUserEnumData,const DWORD dwUserEnumDataSize,const DWORD dwEnumCount,const DWORD dwRetryInterval,const DWORD dwTimeOut,PVOID const pvUserContext,DPNHANDLE *const pAsyncHandle,const DWORD dwFlags) PURE; + STDMETHOD(DestroyPeer) (THIS_ const DPNID dpnidClient, const void *const pvDestroyData, const DWORD dwDestroyDataSize, const DWORD dwFlags) PURE; + STDMETHOD(ReturnBuffer) (THIS_ const DPNHANDLE hBufferHandle,const DWORD dwFlags) PURE; + STDMETHOD(GetPlayerContext) (THIS_ const DPNID dpnid,PVOID *const ppvPlayerContext,const DWORD dwFlags) PURE; + STDMETHOD(GetGroupContext) (THIS_ const DPNID dpnid,PVOID *const ppvGroupContext,const DWORD dwFlags) PURE; + STDMETHOD(GetCaps) (THIS_ DPN_CAPS *const pdpCaps,const DWORD dwFlags) PURE; + STDMETHOD(SetCaps) (THIS_ const DPN_CAPS *const pdpCaps, const DWORD dwFlags) PURE; + STDMETHOD(SetSPCaps) (THIS_ const GUID * const pguidSP, const DPN_SP_CAPS *const pdpspCaps, const DWORD dwFlags ) PURE; + STDMETHOD(GetSPCaps) (THIS_ const GUID * const pguidSP, DPN_SP_CAPS *const pdpspCaps,const DWORD dwFlags) PURE; + STDMETHOD(GetConnectionInfo) (THIS_ const DPNID dpnid, DPN_CONNECTION_INFO *const pdpConnectionInfo,const DWORD dwFlags) PURE; + STDMETHOD(RegisterLobby) (THIS_ const DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication *const pIDP8LobbiedApplication,const DWORD dwFlags) PURE; + STDMETHOD(TerminateSession) (THIS_ void *const pvTerminateData,const DWORD dwTerminateDataSize,const DWORD dwFlags) PURE; +}; + + + +// +// COM definition for DirectPlay8 Thread Pool interface +// +#undef INTERFACE // External COM Implementation +#define INTERFACE IDirectPlay8ThreadPool +DECLARE_INTERFACE_(IDirectPlay8ThreadPool,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ DP8REFIID riid, LPVOID *ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectPlay8ThreadPool methods ***/ + STDMETHOD(Initialize) (THIS_ PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) PURE; + STDMETHOD(Close) (THIS_ const DWORD dwFlags) PURE; + STDMETHOD(GetThreadCount) (THIS_ const DWORD dwProcessorNum, DWORD *const pdwNumThreads, const DWORD dwFlags) PURE; + STDMETHOD(SetThreadCount) (THIS_ const DWORD dwProcessorNum, const DWORD dwNumThreads, const DWORD dwFlags) PURE; + STDMETHOD(DoWork) (THIS_ const DWORD dwAllowedTimeSlice, const DWORD dwFlags) PURE; +}; + + +// +// COM definition for DirectPlay8 NAT Resolver interface +// +#undef INTERFACE // External COM Implementation +#define INTERFACE IDirectPlay8NATResolver +DECLARE_INTERFACE_(IDirectPlay8NATResolver,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ DP8REFIID riid, LPVOID *ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectPlay8NATResolver methods ***/ + STDMETHOD(Initialize) (THIS_ PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) PURE; + STDMETHOD(Start) (THIS_ IDirectPlay8Address **const ppDevices, const DWORD dwNumDevices, const DWORD dwFlags) PURE; + STDMETHOD(Close) (THIS_ const DWORD dwFlags) PURE; + STDMETHOD(EnumDevices) (THIS_ DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer, PDWORD const pdwBufferSize, PDWORD const pdwNumDevices, const DWORD dwFlags) PURE; + STDMETHOD(GetAddresses) (THIS_ IDirectPlay8Address **const ppAddresses, DWORD *const pdwNumAddresses, const DWORD dwFlags) PURE; +}; + + +/**************************************************************************** + * + * IDirectPlay8 application interface macros + * + ****************************************************************************/ + +#if !defined(__cplusplus) || defined(CINTERFACE) + +#define IDirectPlay8Client_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlay8Client_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlay8Client_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlay8Client_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirectPlay8Client_EnumServiceProviders(p,a,b,c,d,e,f) (p)->lpVtbl->EnumServiceProviders(p,a,b,c,d,e,f) +#define IDirectPlay8Client_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) (p)->lpVtbl->EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) +#define IDirectPlay8Client_CancelAsyncOperation(p,a,b) (p)->lpVtbl->CancelAsyncOperation(p,a,b) +#define IDirectPlay8Client_Connect(p,a,b,c,d,e,f,g,h,i,j) (p)->lpVtbl->Connect(p,a,b,c,d,e,f,g,h,i,j) +#define IDirectPlay8Client_Send(p,a,b,c,d,e,f) (p)->lpVtbl->Send(p,a,b,c,d,e,f) +#define IDirectPlay8Client_GetSendQueueInfo(p,a,b,c) (p)->lpVtbl->GetSendQueueInfo(p,a,b,c) +#define IDirectPlay8Client_GetApplicationDesc(p,a,b,c) (p)->lpVtbl->GetApplicationDesc(p,a,b,c) +#define IDirectPlay8Client_SetClientInfo(p,a,b,c,d) (p)->lpVtbl->SetClientInfo(p,a,b,c,d) +#define IDirectPlay8Client_GetServerInfo(p,a,b,c) (p)->lpVtbl->GetServerInfo(p,a,b,c) +#define IDirectPlay8Client_GetServerAddress(p,a,b) (p)->lpVtbl->GetServerAddress(p,a,b) +#define IDirectPlay8Client_Close(p,a) (p)->lpVtbl->Close(p,a) +#define IDirectPlay8Client_ReturnBuffer(p,a,b) (p)->lpVtbl->ReturnBuffer(p,a,b) +#define IDirectPlay8Client_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) +#define IDirectPlay8Client_SetCaps(p,a,b) (p)->lpVtbl->SetCaps(p,a,b) +#define IDirectPlay8Client_SetSPCaps(p,a,b,c) (p)->lpVtbl->SetSPCaps(p,a,b,c) +#define IDirectPlay8Client_GetSPCaps(p,a,b,c) (p)->lpVtbl->GetSPCaps(p,a,b,c) +#define IDirectPlay8Client_GetConnectionInfo(p,a,b) (p)->lpVtbl->GetConnectionInfo(p,a,b) +#define IDirectPlay8Client_RegisterLobby(p,a,b,c) (p)->lpVtbl->RegisterLobby(p,a,b,c) + +#define IDirectPlay8Server_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlay8Server_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlay8Server_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlay8Server_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirectPlay8Server_EnumServiceProviders(p,a,b,c,d,e,f) (p)->lpVtbl->EnumServiceProviders(p,a,b,c,d,e,f) +#define IDirectPlay8Server_CancelAsyncOperation(p,a,b) (p)->lpVtbl->CancelAsyncOperation(p,a,b) +#define IDirectPlay8Server_GetSendQueueInfo(p,a,b,c,d) (p)->lpVtbl->GetSendQueueInfo(p,a,b,c,d) +#define IDirectPlay8Server_GetApplicationDesc(p,a,b,c) (p)->lpVtbl->GetApplicationDesc(p,a,b,c) +#define IDirectPlay8Server_SetServerInfo(p,a,b,c,d) (p)->lpVtbl->SetServerInfo(p,a,b,c,d) +#define IDirectPlay8Server_GetClientInfo(p,a,b,c,d) (p)->lpVtbl->GetClientInfo(p,a,b,c,d) +#define IDirectPlay8Server_GetClientAddress(p,a,b,c) (p)->lpVtbl->GetClientAddress(p,a,b,c) +#define IDirectPlay8Server_GetLocalHostAddresses(p,a,b,c) (p)->lpVtbl->GetLocalHostAddresses(p,a,b,c) +#define IDirectPlay8Server_SetApplicationDesc(p,a,b) (p)->lpVtbl->SetApplicationDesc(p,a,b) +#define IDirectPlay8Server_Host(p,a,b,c,d,e,f,g) (p)->lpVtbl->Host(p,a,b,c,d,e,f,g) +#define IDirectPlay8Server_SendTo(p,a,b,c,d,e,f,g) (p)->lpVtbl->SendTo(p,a,b,c,d,e,f,g) +#define IDirectPlay8Server_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) +#define IDirectPlay8Server_DestroyGroup(p,a,b,c,d) (p)->lpVtbl->DestroyGroup(p,a,b,c,d) +#define IDirectPlay8Server_AddPlayerToGroup(p,a,b,c,d,e) (p)->lpVtbl->AddPlayerToGroup(p,a,b,c,d,e) +#define IDirectPlay8Server_RemovePlayerFromGroup(p,a,b,c,d,e) (p)->lpVtbl->RemovePlayerFromGroup(p,a,b,c,d,e) +#define IDirectPlay8Server_SetGroupInfo(p,a,b,c,d,e) (p)->lpVtbl->SetGroupInfo(p,a,b,c,d,e) +#define IDirectPlay8Server_GetGroupInfo(p,a,b,c,d) (p)->lpVtbl->GetGroupInfo(p,a,b,c,d) +#define IDirectPlay8Server_EnumPlayersAndGroups(p,a,b,c) (p)->lpVtbl->EnumPlayersAndGroups(p,a,b,c) +#define IDirectPlay8Server_EnumGroupMembers(p,a,b,c,d) (p)->lpVtbl->EnumGroupMembers(p,a,b,c,d) +#define IDirectPlay8Server_Close(p,a) (p)->lpVtbl->Close(p,a) +#define IDirectPlay8Server_DestroyClient(p,a,b,c,d) (p)->lpVtbl->DestroyClient(p,a,b,c,d) +#define IDirectPlay8Server_ReturnBuffer(p,a,b) (p)->lpVtbl->ReturnBuffer(p,a,b) +#define IDirectPlay8Server_GetPlayerContext(p,a,b,c) (p)->lpVtbl->GetPlayerContext(p,a,b,c) +#define IDirectPlay8Server_GetGroupContext(p,a,b,c) (p)->lpVtbl->GetGroupContext(p,a,b,c) +#define IDirectPlay8Server_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) +#define IDirectPlay8Server_SetCaps(p,a,b) (p)->lpVtbl->SetCaps(p,a,b) +#define IDirectPlay8Server_SetSPCaps(p,a,b,c) (p)->lpVtbl->SetSPCaps(p,a,b,c) +#define IDirectPlay8Server_GetSPCaps(p,a,b,c) (p)->lpVtbl->GetSPCaps(p,a,b,c) +#define IDirectPlay8Server_GetConnectionInfo(p,a,b,c) (p)->lpVtbl->GetConnectionInfo(p,a,b,c) +#define IDirectPlay8Server_RegisterLobby(p,a,b,c) (p)->lpVtbl->RegisterLobby(p,a,b,c) + +#define IDirectPlay8Peer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlay8Peer_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlay8Peer_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlay8Peer_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirectPlay8Peer_EnumServiceProviders(p,a,b,c,d,e,f) (p)->lpVtbl->EnumServiceProviders(p,a,b,c,d,e,f) +#define IDirectPlay8Peer_CancelAsyncOperation(p,a,b) (p)->lpVtbl->CancelAsyncOperation(p,a,b) +#define IDirectPlay8Peer_Connect(p,a,b,c,d,e,f,g,h,i,j,k) (p)->lpVtbl->Connect(p,a,b,c,d,e,f,g,h,i,j,k) +#define IDirectPlay8Peer_SendTo(p,a,b,c,d,e,f,g) (p)->lpVtbl->SendTo(p,a,b,c,d,e,f,g) +#define IDirectPlay8Peer_GetSendQueueInfo(p,a,b,c,d) (p)->lpVtbl->GetSendQueueInfo(p,a,b,c,d) +#define IDirectPlay8Peer_Host(p,a,b,c,d,e,f,g) (p)->lpVtbl->Host(p,a,b,c,d,e,f,g) +#define IDirectPlay8Peer_GetApplicationDesc(p,a,b,c) (p)->lpVtbl->GetApplicationDesc(p,a,b,c) +#define IDirectPlay8Peer_SetApplicationDesc(p,a,b) (p)->lpVtbl->SetApplicationDesc(p,a,b) +#define IDirectPlay8Peer_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) +#define IDirectPlay8Peer_DestroyGroup(p,a,b,c,d) (p)->lpVtbl->DestroyGroup(p,a,b,c,d) +#define IDirectPlay8Peer_AddPlayerToGroup(p,a,b,c,d,e) (p)->lpVtbl->AddPlayerToGroup(p,a,b,c,d,e) +#define IDirectPlay8Peer_RemovePlayerFromGroup(p,a,b,c,d,e) (p)->lpVtbl->RemovePlayerFromGroup(p,a,b,c,d,e) +#define IDirectPlay8Peer_SetGroupInfo(p,a,b,c,d,e) (p)->lpVtbl->SetGroupInfo(p,a,b,c,d,e) +#define IDirectPlay8Peer_GetGroupInfo(p,a,b,c,d) (p)->lpVtbl->GetGroupInfo(p,a,b,c,d) +#define IDirectPlay8Peer_EnumPlayersAndGroups(p,a,b,c) (p)->lpVtbl->EnumPlayersAndGroups(p,a,b,c) +#define IDirectPlay8Peer_EnumGroupMembers(p,a,b,c,d) (p)->lpVtbl->EnumGroupMembers(p,a,b,c,d) +#define IDirectPlay8Peer_SetPeerInfo(p,a,b,c,d) (p)->lpVtbl->SetPeerInfo(p,a,b,c,d) +#define IDirectPlay8Peer_GetPeerInfo(p,a,b,c,d) (p)->lpVtbl->GetPeerInfo(p,a,b,c,d) +#define IDirectPlay8Peer_GetPeerAddress(p,a,b,c) (p)->lpVtbl->GetPeerAddress(p,a,b,c) +#define IDirectPlay8Peer_GetLocalHostAddresses(p,a,b,c) (p)->lpVtbl->GetLocalHostAddresses(p,a,b,c) +#define IDirectPlay8Peer_Close(p,a) (p)->lpVtbl->Close(p,a) +#define IDirectPlay8Peer_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) (p)->lpVtbl->EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) +#define IDirectPlay8Peer_DestroyPeer(p,a,b,c,d) (p)->lpVtbl->DestroyPeer(p,a,b,c,d) +#define IDirectPlay8Peer_ReturnBuffer(p,a,b) (p)->lpVtbl->ReturnBuffer(p,a,b) +#define IDirectPlay8Peer_GetPlayerContext(p,a,b,c) (p)->lpVtbl->GetPlayerContext(p,a,b,c) +#define IDirectPlay8Peer_GetGroupContext(p,a,b,c) (p)->lpVtbl->GetGroupContext(p,a,b,c) +#define IDirectPlay8Peer_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) +#define IDirectPlay8Peer_SetCaps(p,a,b) (p)->lpVtbl->SetCaps(p,a,b) +#define IDirectPlay8Peer_SetSPCaps(p,a,b,c) (p)->lpVtbl->SetSPCaps(p,a,b,c) +#define IDirectPlay8Peer_GetSPCaps(p,a,b,c) (p)->lpVtbl->GetSPCaps(p,a,b,c) +#define IDirectPlay8Peer_GetConnectionInfo(p,a,b,c) (p)->lpVtbl->GetConnectionInfo(p,a,b,c) +#define IDirectPlay8Peer_RegisterLobby(p,a,b,c) (p)->lpVtbl->RegisterLobby(p,a,b,c) +#define IDirectPlay8Peer_TerminateSession(p,a,b,c) (p)->lpVtbl->TerminateSession(p,a,b,c) + +#define IDirectPlay8ThreadPool_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlay8ThreadPool_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlay8ThreadPool_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlay8ThreadPool_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirectPlay8ThreadPool_Close(p,a) (p)->lpVtbl->Close(p,a) +#define IDirectPlay8ThreadPool_GetThreadCount(p,a,b,c) (p)->lpVtbl->GetThreadCount(p,a,b,c) +#define IDirectPlay8ThreadPool_SetThreadCount(p,a,b,c) (p)->lpVtbl->SetThreadCount(p,a,b,c) +#define IDirectPlay8ThreadPool_DoWork(p,a,b) (p)->lpVtbl->DoWork(p,a,b) + +#define IDirectPlay8NATResolver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlay8NATResolver_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlay8NATResolver_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlay8NATResolver_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirectPlay8NATResolver_Start(p,a,b,c) (p)->lpVtbl->Start(p,a,b,c) +#define IDirectPlay8NATResolver_Close(p,a) (p)->lpVtbl->Close(p,a) +#define IDirectPlay8NATResolver_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) +#define IDirectPlay8NATResolver_GetAddresses(p,a,b,c) (p)->lpVtbl->GetAddresses(p,a,b,c) + +#else /* C++ */ + +#define IDirectPlay8Client_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlay8Client_AddRef(p) (p)->AddRef() +#define IDirectPlay8Client_Release(p) (p)->Release() +#define IDirectPlay8Client_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirectPlay8Client_EnumServiceProviders(p,a,b,c,d,e,f) (p)->EnumServiceProviders(a,b,c,d,e,f) +#define IDirectPlay8Client_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) (p)->EnumHosts(a,b,c,d,e,f,g,h,i,j,k) +#define IDirectPlay8Client_CancelAsyncOperation(p,a,b) (p)->CancelAsyncOperation(a,b) +#define IDirectPlay8Client_Connect(p,a,b,c,d,e,f,g,h,i,j) (p)->Connect(a,b,c,d,e,f,g,h,i,j) +#define IDirectPlay8Client_Send(p,a,b,c,d,e,f) (p)->Send(a,b,c,d,e,f) +#define IDirectPlay8Client_GetSendQueueInfo(p,a,b,c) (p)->GetSendQueueInfo(a,b,c) +#define IDirectPlay8Client_GetApplicationDesc(p,a,b,c) (p)->GetApplicationDesc(a,b,c) +#define IDirectPlay8Client_SetClientInfo(p,a,b,c,d) (p)->SetClientInfo(a,b,c,d) +#define IDirectPlay8Client_GetServerInfo(p,a,b,c) (p)->GetServerInfo(a,b,c) +#define IDirectPlay8Client_GetServerAddress(p,a,b) (p)->GetServerAddress(a,b) +#define IDirectPlay8Client_Close(p,a) (p)->Close(a) +#define IDirectPlay8Client_ReturnBuffer(p,a,b) (p)->ReturnBuffer(a,b) +#define IDirectPlay8Client_GetCaps(p,a,b) (p)->GetCaps(a,b) +#define IDirectPlay8Client_SetCaps(p,a,b) (p)->SetCaps(a,b) +#define IDirectPlay8Client_SetSPCaps(p,a,b,c) (p)->SetSPCaps(a,b,c) +#define IDirectPlay8Client_GetSPCaps(p,a,b,c) (p)->GetSPCaps(a,b,c) +#define IDirectPlay8Client_GetConnectionInfo(p,a,b) (p)->GetConnectionInfo(a,b) +#define IDirectPlay8Client_RegisterLobby(p,a,b,c) (p)->RegisterLobby(a,b,c) + +#define IDirectPlay8Server_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlay8Server_AddRef(p) (p)->AddRef() +#define IDirectPlay8Server_Release(p) (p)->Release() +#define IDirectPlay8Server_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirectPlay8Server_EnumServiceProviders(p,a,b,c,d,e,f) (p)->EnumServiceProviders(a,b,c,d,e,f) +#define IDirectPlay8Server_CancelAsyncOperation(p,a,b) (p)->CancelAsyncOperation(a,b) +#define IDirectPlay8Server_GetSendQueueInfo(p,a,b,c,d) (p)->GetSendQueueInfo(a,b,c,d) +#define IDirectPlay8Server_GetApplicationDesc(p,a,b,c) (p)->GetApplicationDesc(a,b,c) +#define IDirectPlay8Server_SetServerInfo(p,a,b,c,d) (p)->SetServerInfo(a,b,c,d) +#define IDirectPlay8Server_GetClientInfo(p,a,b,c,d) (p)->GetClientInfo(a,b,c,d) +#define IDirectPlay8Server_GetClientAddress(p,a,b,c) (p)->GetClientAddress(a,b,c) +#define IDirectPlay8Server_GetLocalHostAddresses(p,a,b,c) (p)->GetLocalHostAddresses(a,b,c) +#define IDirectPlay8Server_SetApplicationDesc(p,a,b) (p)->SetApplicationDesc(a,b) +#define IDirectPlay8Server_Host(p,a,b,c,d,e,f,g) (p)->Host(a,b,c,d,e,f,g) +#define IDirectPlay8Server_SendTo(p,a,b,c,d,e,f,g) (p)->SendTo(a,b,c,d,e,f,g) +#define IDirectPlay8Server_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) +#define IDirectPlay8Server_DestroyGroup(p,a,b,c,d) (p)->DestroyGroup(a,b,c,d) +#define IDirectPlay8Server_AddPlayerToGroup(p,a,b,c,d,e) (p)->AddPlayerToGroup(a,b,c,d,e) +#define IDirectPlay8Server_RemovePlayerFromGroup(p,a,b,c,d,e) (p)->RemovePlayerFromGroup(a,b,c,d,e) +#define IDirectPlay8Server_SetGroupInfo(p,a,b,c,d,e) (p)->SetGroupInfo(a,b,c,d,e) +#define IDirectPlay8Server_GetGroupInfo(p,a,b,c,d) (p)->GetGroupInfo(a,b,c,d) +#define IDirectPlay8Server_EnumPlayersAndGroups(p,a,b,c) (p)->EnumPlayersAndGroups(a,b,c) +#define IDirectPlay8Server_EnumGroupMembers(p,a,b,c,d) (p)->EnumGroupMembers(a,b,c,d) +#define IDirectPlay8Server_Close(p,a) (p)->Close(a) +#define IDirectPlay8Server_DestroyClient(p,a,b,c,d) (p)->DestroyClient(a,b,c,d) +#define IDirectPlay8Server_ReturnBuffer(p,a,b) (p)->ReturnBuffer(a,b) +#define IDirectPlay8Server_GetPlayerContext(p,a,b,c) (p)->GetPlayerContext(a,b,c) +#define IDirectPlay8Server_GetGroupContext(p,a,b,c) (p)->GetGroupContext(a,b,c) +#define IDirectPlay8Server_GetCaps(p,a,b) (p)->GetCaps(a,b) +#define IDirectPlay8Server_SetCaps(p,a,b) (p)->SetCaps(a,b) +#define IDirectPlay8Server_SetSPCaps(p,a,b,c) (p)->SetSPCaps(a,b,c) +#define IDirectPlay8Server_GetSPCaps(p,a,b,c) (p)->GetSPCaps(a,b,c) +#define IDirectPlay8Server_GetConnectionInfo(p,a,b,c) (p)->GetConnectionInfo(a,b,c) +#define IDirectPlay8Server_RegisterLobby(p,a,b,c) (p)->RegisterLobby(a,b,c) + +#define IDirectPlay8Peer_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlay8Peer_AddRef(p) (p)->AddRef() +#define IDirectPlay8Peer_Release(p) (p)->Release() +#define IDirectPlay8Peer_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirectPlay8Peer_EnumServiceProviders(p,a,b,c,d,e,f) (p)->EnumServiceProviders(a,b,c,d,e,f) +#define IDirectPlay8Peer_CancelAsyncOperation(p,a,b) (p)->CancelAsyncOperation(a,b) +#define IDirectPlay8Peer_Connect(p,a,b,c,d,e,f,g,h,i,j,k) (p)->Connect(a,b,c,d,e,f,g,h,i,j,k) +#define IDirectPlay8Peer_SendTo(p,a,b,c,d,e,f,g) (p)->SendTo(a,b,c,d,e,f,g) +#define IDirectPlay8Peer_GetSendQueueInfo(p,a,b,c,d) (p)->GetSendQueueInfo(a,b,c,d) +#define IDirectPlay8Peer_Host(p,a,b,c,d,e,f,g) (p)->Host(a,b,c,d,e,f,g) +#define IDirectPlay8Peer_GetApplicationDesc(p,a,b,c) (p)->GetApplicationDesc(a,b,c) +#define IDirectPlay8Peer_SetApplicationDesc(p,a,b) (p)->SetApplicationDesc(a,b) +#define IDirectPlay8Peer_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) +#define IDirectPlay8Peer_DestroyGroup(p,a,b,c,d) (p)->DestroyGroup(a,b,c,d) +#define IDirectPlay8Peer_AddPlayerToGroup(p,a,b,c,d,e) (p)->AddPlayerToGroup(a,b,c,d,e) +#define IDirectPlay8Peer_RemovePlayerFromGroup(p,a,b,c,d,e) (p)->RemovePlayerFromGroup(a,b,c,d,e) +#define IDirectPlay8Peer_SetGroupInfo(p,a,b,c,d,e) (p)->SetGroupInfo(a,b,c,d,e) +#define IDirectPlay8Peer_GetGroupInfo(p,a,b,c,d) (p)->GetGroupInfo(a,b,c,d) +#define IDirectPlay8Peer_EnumPlayersAndGroups(p,a,b,c) (p)->EnumPlayersAndGroups(a,b,c) +#define IDirectPlay8Peer_EnumGroupMembers(p,a,b,c,d) (p)->EnumGroupMembers(a,b,c,d) +#define IDirectPlay8Peer_SetPeerInfo(p,a,b,c,d) (p)->SetPeerInfo(a,b,c,d) +#define IDirectPlay8Peer_GetPeerInfo(p,a,b,c,d) (p)->GetPeerInfo(a,b,c,d) +#define IDirectPlay8Peer_GetPeerAddress(p,a,b,c) (p)->GetPeerAddress(a,b,c) +#define IDirectPlay8Peer_GetLocalHostAddresses(p,a,b,c) (p)->GetLocalHostAddresses(a,b,c) +#define IDirectPlay8Peer_Close(p,a) (p)->Close(a) +#define IDirectPlay8Peer_EnumHosts(p,a,b,c,d,e,f,g,h,i,j,k) (p)->EnumHosts(a,b,c,d,e,f,g,h,i,j,k) +#define IDirectPlay8Peer_DestroyPeer(p,a,b,c,d) (p)->DestroyPeer(a,b,c,d) +#define IDirectPlay8Peer_ReturnBuffer(p,a,b) (p)->ReturnBuffer(a,b) +#define IDirectPlay8Peer_GetPlayerContext(p,a,b,c) (p)->GetPlayerContext(a,b,c) +#define IDirectPlay8Peer_GetGroupContext(p,a,b,c) (p)->GetGroupContext(a,b,c) +#define IDirectPlay8Peer_GetCaps(p,a,b) (p)->GetCaps(a,b) +#define IDirectPlay8Peer_SetCaps(p,a,b) (p)->SetCaps(a,b) +#define IDirectPlay8Peer_SetSPCaps(p,a,b,c) (p)->SetSPCaps(a,b,c) +#define IDirectPlay8Peer_GetSPCaps(p,a,b,c) (p)->GetSPCaps(a,b,c) +#define IDirectPlay8Peer_GetConnectionInfo(p,a,b,c) (p)->GetConnectionInfo(a,b,c) +#define IDirectPlay8Peer_RegisterLobby(p,a,b,c) (p)->RegisterLobby(a,b,c) +#define IDirectPlay8Peer_TerminateSession(p,a,b,c) (p)->TerminateSession(a,b,c) + +#define IDirectPlay8ThreadPool_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlay8ThreadPool_AddRef(p) (p)->AddRef() +#define IDirectPlay8ThreadPool_Release(p) (p)->Release() +#define IDirectPlay8ThreadPool_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirectPlay8ThreadPool_Close(p,a) (p)->Close(a) +#define IDirectPlay8ThreadPool_GetThreadCount(p,a,b,c) (p)->GetThreadCount(a,b,c) +#define IDirectPlay8ThreadPool_SetThreadCount(p,a,b,c) (p)->SetThreadCount(a,b,c) +#define IDirectPlay8ThreadPool_DoWork(p,a,b) (p)->DoWork(a,b) + +#define IDirectPlay8NATResolver_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlay8NATResolver_AddRef(p) (p)->AddRef() +#define IDirectPlay8NATResolver_Release(p) (p)->Release() +#define IDirectPlay8NATResolver_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirectPlay8NATResolver_Start(p,a,b,c) (p)->Start(a,b,c) +#define IDirectPlay8NATResolver_Close(p,a) (p)->Close(a) +#define IDirectPlay8NATResolver_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) +#define IDirectPlay8NATResolver_GetAddresses(p,a,b,c) (p)->GetAddresses(a,b,c) + +#endif + + + +/**************************************************************************** + * + * DIRECTPLAY8 ERRORS + * + * Errors are represented by negative values and cannot be combined. + * + ****************************************************************************/ + +#define _DPN_FACILITY_CODE 0x015 +#define _DPNHRESULT_BASE 0x8000 +#define MAKE_DPNHRESULT( code ) MAKE_HRESULT( 1, _DPN_FACILITY_CODE, ( code + _DPNHRESULT_BASE ) ) + +#define DPN_OK S_OK + +#define DPNSUCCESS_EQUAL MAKE_HRESULT( 0, _DPN_FACILITY_CODE, ( 0x5 + _DPNHRESULT_BASE ) ) +#define DPNSUCCESS_NOPLAYERSINGROUP MAKE_HRESULT( 0, _DPN_FACILITY_CODE, ( 0x8 + _DPNHRESULT_BASE ) ) // added for DirectX 9 +#define DPNSUCCESS_NOTEQUAL MAKE_HRESULT( 0, _DPN_FACILITY_CODE, (0x0A + _DPNHRESULT_BASE ) ) +#define DPNSUCCESS_PENDING MAKE_HRESULT( 0, _DPN_FACILITY_CODE, (0x0e + _DPNHRESULT_BASE ) ) + +#define DPNERR_ABORTED MAKE_DPNHRESULT( 0x30 ) +#define DPNERR_ADDRESSING MAKE_DPNHRESULT( 0x40 ) +#define DPNERR_ALREADYCLOSING MAKE_DPNHRESULT( 0x50 ) +#define DPNERR_ALREADYCONNECTED MAKE_DPNHRESULT( 0x60 ) +#define DPNERR_ALREADYDISCONNECTING MAKE_DPNHRESULT( 0x70 ) +#define DPNERR_ALREADYINITIALIZED MAKE_DPNHRESULT( 0x80 ) +#define DPNERR_ALREADYREGISTERED MAKE_DPNHRESULT( 0x90 ) +#define DPNERR_BUFFERTOOSMALL MAKE_DPNHRESULT( 0x100 ) +#define DPNERR_CANNOTCANCEL MAKE_DPNHRESULT( 0x110 ) +#define DPNERR_CANTCREATEGROUP MAKE_DPNHRESULT( 0x120 ) +#define DPNERR_CANTCREATEPLAYER MAKE_DPNHRESULT( 0x130 ) +#define DPNERR_CANTLAUNCHAPPLICATION MAKE_DPNHRESULT( 0x140 ) +#define DPNERR_CONNECTING MAKE_DPNHRESULT( 0x150 ) +#define DPNERR_CONNECTIONLOST MAKE_DPNHRESULT( 0x160 ) +#define DPNERR_CONVERSION MAKE_DPNHRESULT( 0x170 ) +#define DPNERR_DATATOOLARGE MAKE_DPNHRESULT( 0x175 ) +#define DPNERR_DOESNOTEXIST MAKE_DPNHRESULT( 0x180 ) +#define DPNERR_DPNSVRNOTAVAILABLE MAKE_DPNHRESULT( 0x185 ) +#define DPNERR_DUPLICATECOMMAND MAKE_DPNHRESULT( 0x190 ) +#define DPNERR_ENDPOINTNOTRECEIVING MAKE_DPNHRESULT( 0x200 ) +#define DPNERR_ENUMQUERYTOOLARGE MAKE_DPNHRESULT( 0x210 ) +#define DPNERR_ENUMRESPONSETOOLARGE MAKE_DPNHRESULT( 0x220 ) +#define DPNERR_EXCEPTION MAKE_DPNHRESULT( 0x230 ) +#define DPNERR_GENERIC E_FAIL +#define DPNERR_GROUPNOTEMPTY MAKE_DPNHRESULT( 0x240 ) +#define DPNERR_HOSTING MAKE_DPNHRESULT( 0x250 ) +#define DPNERR_HOSTREJECTEDCONNECTION MAKE_DPNHRESULT( 0x260 ) +#define DPNERR_HOSTTERMINATEDSESSION MAKE_DPNHRESULT( 0x270 ) +#define DPNERR_INCOMPLETEADDRESS MAKE_DPNHRESULT( 0x280 ) +#define DPNERR_INVALIDADDRESSFORMAT MAKE_DPNHRESULT( 0x290 ) +#define DPNERR_INVALIDAPPLICATION MAKE_DPNHRESULT( 0x300 ) +#define DPNERR_INVALIDCOMMAND MAKE_DPNHRESULT( 0x310 ) +#define DPNERR_INVALIDDEVICEADDRESS MAKE_DPNHRESULT( 0x320 ) +#define DPNERR_INVALIDENDPOINT MAKE_DPNHRESULT( 0x330 ) +#define DPNERR_INVALIDFLAGS MAKE_DPNHRESULT( 0x340 ) +#define DPNERR_INVALIDGROUP MAKE_DPNHRESULT( 0x350 ) +#define DPNERR_INVALIDHANDLE MAKE_DPNHRESULT( 0x360 ) +#define DPNERR_INVALIDHOSTADDRESS MAKE_DPNHRESULT( 0x370 ) +#define DPNERR_INVALIDINSTANCE MAKE_DPNHRESULT( 0x380 ) +#define DPNERR_INVALIDINTERFACE MAKE_DPNHRESULT( 0x390 ) +#define DPNERR_INVALIDOBJECT MAKE_DPNHRESULT( 0x400 ) +#define DPNERR_INVALIDPARAM E_INVALIDARG +#define DPNERR_INVALIDPASSWORD MAKE_DPNHRESULT( 0x410 ) +#define DPNERR_INVALIDPLAYER MAKE_DPNHRESULT( 0x420 ) +#define DPNERR_INVALIDPOINTER E_POINTER +#define DPNERR_INVALIDPRIORITY MAKE_DPNHRESULT( 0x430 ) +#define DPNERR_INVALIDSTRING MAKE_DPNHRESULT( 0x440 ) +#define DPNERR_INVALIDURL MAKE_DPNHRESULT( 0x450 ) +#define DPNERR_INVALIDVERSION MAKE_DPNHRESULT( 0x460 ) +#define DPNERR_NOCAPS MAKE_DPNHRESULT( 0x470 ) +#define DPNERR_NOCONNECTION MAKE_DPNHRESULT( 0x480 ) +#define DPNERR_NOHOSTPLAYER MAKE_DPNHRESULT( 0x490 ) +#define DPNERR_NOINTERFACE E_NOINTERFACE +#define DPNERR_NOMOREADDRESSCOMPONENTS MAKE_DPNHRESULT( 0x500 ) +#define DPNERR_NORESPONSE MAKE_DPNHRESULT( 0x510 ) +#define DPNERR_NOTALLOWED MAKE_DPNHRESULT( 0x520 ) +#define DPNERR_NOTHOST MAKE_DPNHRESULT( 0x530 ) +#define DPNERR_NOTREADY MAKE_DPNHRESULT( 0x540 ) +#define DPNERR_NOTREGISTERED MAKE_DPNHRESULT( 0x550 ) +#define DPNERR_OUTOFMEMORY E_OUTOFMEMORY +#define DPNERR_PENDING DPNSUCCESS_PENDING +#define DPNERR_PLAYERALREADYINGROUP MAKE_DPNHRESULT( 0x560 ) +#define DPNERR_PLAYERLOST MAKE_DPNHRESULT( 0x570 ) +#define DPNERR_PLAYERNOTINGROUP MAKE_DPNHRESULT( 0x580 ) +#define DPNERR_PLAYERNOTREACHABLE MAKE_DPNHRESULT( 0x590 ) +#define DPNERR_SENDTOOLARGE MAKE_DPNHRESULT( 0x600 ) +#define DPNERR_SESSIONFULL MAKE_DPNHRESULT( 0x610 ) +#define DPNERR_TABLEFULL MAKE_DPNHRESULT( 0x620 ) +#define DPNERR_TIMEDOUT MAKE_DPNHRESULT( 0x630 ) +#define DPNERR_UNINITIALIZED MAKE_DPNHRESULT( 0x640 ) +#define DPNERR_UNSUPPORTED E_NOTIMPL +#define DPNERR_USERCANCEL MAKE_DPNHRESULT( 0x650 ) + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/Src/Decoder_H264_ALL/D3D/include/dplobby.h b/Src/Decoder_H264_ALL/D3D/include/dplobby.h new file mode 100644 index 0000000..c91d323 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dplobby.h @@ -0,0 +1,853 @@ +/*==========================================================================; + * + * Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved. + * + * File: dplobby.h + * Content: DirectPlayLobby include file + ***************************************************************************/ +#ifndef __DPLOBBY_INCLUDED__ +#define __DPLOBBY_INCLUDED__ + +#include "dplay.h" + +/* avoid warnings at Level 4 */ +#pragma warning(disable:4201) + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + * GUIDS used by DirectPlay objects + */ + +/* {AF465C71-9588-11cf-A020-00AA006157AC} */ +DEFINE_GUID(IID_IDirectPlayLobby, 0xaf465c71, 0x9588, 0x11cf, 0xa0, 0x20, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac); +/* {26C66A70-B367-11cf-A024-00AA006157AC} */ +DEFINE_GUID(IID_IDirectPlayLobbyA, 0x26c66a70, 0xb367, 0x11cf, 0xa0, 0x24, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac); +/* {0194C220-A303-11d0-9C4F-00A0C905425E} */ +DEFINE_GUID(IID_IDirectPlayLobby2, 0x194c220, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); +/* {1BB4AF80-A303-11d0-9C4F-00A0C905425E} */ +DEFINE_GUID(IID_IDirectPlayLobby2A, 0x1bb4af80, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); +/* {2DB72490-652C-11d1-A7A8-0000F803ABFC} */ +DEFINE_GUID(IID_IDirectPlayLobby3, 0x2db72490, 0x652c, 0x11d1, 0xa7, 0xa8, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); +/* {2DB72491-652C-11d1-A7A8-0000F803ABFC} */ +DEFINE_GUID(IID_IDirectPlayLobby3A, 0x2db72491, 0x652c, 0x11d1, 0xa7, 0xa8, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); +/* {2FE8F810-B2A5-11d0-A787-0000F803ABFC} */ +DEFINE_GUID(CLSID_DirectPlayLobby, 0x2fe8f810, 0xb2a5, 0x11d0, 0xa7, 0x87, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); + + +/**************************************************************************** + * + * IDirectPlayLobby Structures + * + * Various structures used to invoke DirectPlayLobby. + * + ****************************************************************************/ + +typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBY; +typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBYA; +typedef struct IDirectPlayLobby IDirectPlayLobbyA; + +typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2; +typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2A; +typedef struct IDirectPlayLobby2 IDirectPlayLobby2A; + +typedef struct IDirectPlayLobby3 FAR *LPDIRECTPLAYLOBBY3; +typedef struct IDirectPlayLobby3 FAR *LPDIRECTPLAYLOBBY3A; +typedef struct IDirectPlayLobby3 IDirectPlayLobby3A; + + +/* + * DPLAPPINFO + * Used to hold information about a registered DirectPlay + * application + */ +typedef struct DPLAPPINFO +{ + DWORD dwSize; // Size of this structure + GUID guidApplication; // GUID of the Application + union + { + LPSTR lpszAppNameA; // Pointer to the Application Name + LPWSTR lpszAppName; + }; + +} DPLAPPINFO, FAR *LPDPLAPPINFO; + +/* + * LPCDPLAPPINFO + * A constant pointer to DPLAPPINFO + */ +typedef const DPLAPPINFO FAR *LPCDPLAPPINFO; + +/* + * DPCOMPOUNDADDRESSELEMENT + * + * An array of these is passed to CreateCompoundAddresses() + */ +typedef struct DPCOMPOUNDADDRESSELEMENT +{ + GUID guidDataType; + DWORD dwDataSize; + LPVOID lpData; +} DPCOMPOUNDADDRESSELEMENT, FAR *LPDPCOMPOUNDADDRESSELEMENT; + +/* + * LPCDPCOMPOUNDADDRESSELEMENT + * A constant pointer to DPCOMPOUNDADDRESSELEMENT + */ +typedef const DPCOMPOUNDADDRESSELEMENT FAR *LPCDPCOMPOUNDADDRESSELEMENT; + +/* + * LPDPAPPLICATIONDESC + * Used to register a DirectPlay application + */ +typedef struct DPAPPLICATIONDESC +{ + DWORD dwSize; + DWORD dwFlags; + union + { + LPSTR lpszApplicationNameA; + LPWSTR lpszApplicationName; + }; + GUID guidApplication; + union + { + LPSTR lpszFilenameA; + LPWSTR lpszFilename; + }; + union + { + LPSTR lpszCommandLineA; + LPWSTR lpszCommandLine; + }; + union + { + LPSTR lpszPathA; + LPWSTR lpszPath; + }; + union + { + LPSTR lpszCurrentDirectoryA; + LPWSTR lpszCurrentDirectory; + }; + LPSTR lpszDescriptionA; + LPWSTR lpszDescriptionW; +} DPAPPLICATIONDESC, *LPDPAPPLICATIONDESC; + +/* + * LPDPAPPLICATIONDESC2 + * Used to register a DirectPlay application + */ +typedef struct DPAPPLICATIONDESC2 +{ + DWORD dwSize; + DWORD dwFlags; + union + { + LPSTR lpszApplicationNameA; + LPWSTR lpszApplicationName; + }; + GUID guidApplication; + union + { + LPSTR lpszFilenameA; + LPWSTR lpszFilename; + }; + union + { + LPSTR lpszCommandLineA; + LPWSTR lpszCommandLine; + }; + union + { + LPSTR lpszPathA; + LPWSTR lpszPath; + }; + union + { + LPSTR lpszCurrentDirectoryA; + LPWSTR lpszCurrentDirectory; + }; + LPSTR lpszDescriptionA; + LPWSTR lpszDescriptionW; + union + { + LPSTR lpszAppLauncherNameA; + LPWSTR lpszAppLauncherName; + }; +} DPAPPLICATIONDESC2, *LPDPAPPLICATIONDESC2; + + +/**************************************************************************** + * + * Enumeration Method Callback Prototypes + * + ****************************************************************************/ + +/* + * Callback for EnumAddress() + */ +typedef BOOL (FAR PASCAL *LPDPENUMADDRESSCALLBACK)( + REFGUID guidDataType, + DWORD dwDataSize, + LPCVOID lpData, + LPVOID lpContext); + +/* + * Callback for EnumAddressTypes() + */ +typedef BOOL (FAR PASCAL *LPDPLENUMADDRESSTYPESCALLBACK)( + REFGUID guidDataType, + LPVOID lpContext, + DWORD dwFlags); + +/* + * Callback for EnumLocalApplications() + */ +typedef BOOL (FAR PASCAL * LPDPLENUMLOCALAPPLICATIONSCALLBACK)( + LPCDPLAPPINFO lpAppInfo, + LPVOID lpContext, + DWORD dwFlags); + + +/**************************************************************************** + * + * DirectPlayLobby API Prototypes + * + ****************************************************************************/ +#ifdef UNICODE +#define DirectPlayLobbyCreate DirectPlayLobbyCreateW +#else +#define DirectPlayLobbyCreate DirectPlayLobbyCreateA +#endif /* UNICODE */ + +extern HRESULT WINAPI DirectPlayLobbyCreateW(LPGUID, LPDIRECTPLAYLOBBY *, IUnknown *, LPVOID, DWORD ); +extern HRESULT WINAPI DirectPlayLobbyCreateA(LPGUID, LPDIRECTPLAYLOBBYA *, IUnknown *, LPVOID, DWORD ); + + +/**************************************************************************** + * + * IDirectPlayLobby (and IDirectPlayLobbyA) Interface + * + ****************************************************************************/ +#undef INTERFACE +#define INTERFACE IDirectPlayLobby +DECLARE_INTERFACE_( IDirectPlayLobby, IUnknown ) +{ + /* IUnknown Methods */ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectPlayLobby Methods */ + STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE; + STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE; + STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE; + STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE; + STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE; + STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE; + STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE; + STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE; + STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE; + STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE; + STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE; + +}; + +/**************************************************************************** + * + * IDirectPlayLobby2 (and IDirectPlayLobby2A) Interface + * + ****************************************************************************/ +#undef INTERFACE +#define INTERFACE IDirectPlayLobby2 +DECLARE_INTERFACE_( IDirectPlayLobby2, IDirectPlayLobby ) +{ + /* IUnknown Methods */ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectPlayLobby Methods */ + STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE; + STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE; + STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE; + STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE; + STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE; + STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE; + STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE; + STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE; + STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE; + STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE; + STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE; + + /* IDirectPlayLobby2 Methods */ + STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE; +}; + +/**************************************************************************** + * + * IDirectPlayLobby3 (and IDirectPlayLobby3A) Interface + * + ****************************************************************************/ +#undef INTERFACE +#define INTERFACE IDirectPlayLobby3 +DECLARE_INTERFACE_( IDirectPlayLobby3, IDirectPlayLobby ) +{ + /* IUnknown Methods */ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /* IDirectPlayLobby Methods */ + STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE; + STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE; + STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE; + STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE; + STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE; + STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE; + STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE; + STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE; + STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE; + STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE; + STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE; + + /* IDirectPlayLobby2 Methods */ + STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE; + + /* IDirectPlayLobby3 Methods */ + STDMETHOD(ConnectEx) (THIS_ DWORD, REFIID, LPVOID *, IUnknown FAR *) PURE; + STDMETHOD(RegisterApplication) (THIS_ DWORD, LPVOID) PURE; + STDMETHOD(UnregisterApplication)(THIS_ DWORD, REFGUID) PURE; + STDMETHOD(WaitForConnectionSettings)(THIS_ DWORD) PURE; +}; + +/**************************************************************************** + * + * IDirectPlayLobby interface macros + * + ****************************************************************************/ + +#if !defined(__cplusplus) || defined(CINTERFACE) + +#define IDirectPlayLobby_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlayLobby_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlayLobby_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlayLobby_Connect(p,a,b,c) (p)->lpVtbl->Connect(p,a,b,c) +#define IDirectPlayLobby_ConnectEx(p,a,b,c,d) (p)->lpVtbl->ConnectEx(p,a,b,c,d) +#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->lpVtbl->CreateAddress(p,a,b,c,d,e,f) +#define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->lpVtbl->CreateCompoundAddress(p,a,b,c,d) +#define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->lpVtbl->EnumAddress(p,a,b,c,d) +#define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->lpVtbl->EnumAddressTypes(p,a,b,c,d) +#define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->lpVtbl->EnumLocalApplications(p,a,b,c) +#define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->lpVtbl->GetConnectionSettings(p,a,b,c) +#define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->lpVtbl->ReceiveLobbyMessage(p,a,b,c,d,e) +#define IDirectPlayLobby_RegisterApplication(p,a,b) (p)->lpVtbl->RegisterApplication(p,a,b) +#define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->lpVtbl->RunApplication(p,a,b,c,d) +#define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->lpVtbl->SendLobbyMessage(p,a,b,c,d) +#define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c) +#define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->lpVtbl->SetLobbyMessageEvent(p,a,b,c) +#define IDirectPlayLobby_UnregisterApplication(p,a,b) (p)->lpVtbl->UnregisterApplication(p,a,b) +#define IDirectPlayLobby_WaitForConnectionSettings(p,a) (p)->lpVtbl->WaitForConnectionSettings(p,a) + +#else /* C++ */ + +#define IDirectPlayLobby_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlayLobby_AddRef(p) (p)->AddRef() +#define IDirectPlayLobby_Release(p) (p)->Release() +#define IDirectPlayLobby_Connect(p,a,b,c) (p)->Connect(a,b,c) +#define IDirectPlayLobby_ConnectEx(p,a,b,c,d) (p)->ConnectEx(a,b,c,d) +#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->CreateAddress(a,b,c,d,e,f) +#define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->CreateCompoundAddress(a,b,c,d) +#define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->EnumAddress(a,b,c,d) +#define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->EnumAddressTypes(a,b,c,d) +#define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->EnumLocalApplications(a,b,c) +#define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->GetConnectionSettings(a,b,c) +#define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->ReceiveLobbyMessage(a,b,c,d,e) +#define IDirectPlayLobby_RegisterApplication(p,a,b) (p)->RegisterApplication(a,b) +#define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->RunApplication(a,b,c,d) +#define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->SendLobbyMessage(a,b,c,d) +#define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c) +#define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->SetLobbyMessageEvent(a,b,c) +#define IDirectPlayLobby_UnregisterApplication(p,a,b) (p)->UnregisterApplication(a,b) +#define IDirectPlayLobby_WaitForConnectionSettings(p,a) (p)->WaitForConnectionSettings(a) + +#endif + +/**************************************************************************** + * + * DirectPlayLobby Flags + * + ****************************************************************************/ + +/* + * This flag is used by IDirectPlayLobby->WaitForConnectionSettings to + * cancel a current wait that is in progress. + */ +#define DPLWAIT_CANCEL 0x00000001 + + +/* + * This is a message flag used by ReceiveLobbyMessage. It can be + * returned in the dwMessageFlags parameter to indicate a message from + * the system. + */ +#define DPLMSG_SYSTEM 0x00000001 + +/* + * This is a message flag used by ReceiveLobbyMessage and SendLobbyMessage. + * It is used to indicate that the message is a standard lobby message. + * DPLMSG_SETPROPERTY, DPLMSG_SETPROPERTYRESPONSE, DPLMSG_GETPROPERTY, + * DPLMSG_GETPROPERTYRESPONSE + */ +#define DPLMSG_STANDARD 0x00000002 + +/* + * Lobbyable Application registration flags + */ + +/* + * Applications registered with this flag will not show up when + * applications are enumerated in the lobby. This application + * will only be able to be launched by a lobby client that already + * knows about the application. + */ +#define DPLAPP_NOENUM 0x80000000 + +/* + * Applications registered with this flag want voice to automatically + * be enabled for their application. All players will be launched into + * an 'n'-way voice conference when the application is started. The + * user will be able to enable this flag for existing non-voice + * directplay applications. + */ +#define DPLAPP_AUTOVOICE 0x00000001 + +/* + * Applications that do their own voice conferencing should register with + * this flag to avoid allowing the user to enable other voice chat + * capabilites during the same session. This is to avoid users forcing + * the DPLAPP_AUTOVOICE flag for the application. + */ +#define DPLAPP_SELFVOICE 0x00000002 + +/**************************************************************************** + * + * DirectPlayLobby messages and message data structures + * + * All system messages have a dwMessageFlags value of DPLMSG_SYSTEM returned + * from a call to ReceiveLobbyMessage. + * + * All standard messages have a dwMessageFlags value of DPLMSG_STANDARD returned + * from a call to ReceiveLobbyMessage. + * + ****************************************************************************/ + +/* + * DPLMSG_GENERIC + * Generic message structure used to identify the message type. + */ +typedef struct _DPLMSG_GENERIC +{ + DWORD dwType; // Message type +} DPLMSG_GENERIC, FAR *LPDPLMSG_GENERIC; + +/* + * DPLMSG_SYSTEMMESSAGE + * Generic message format for all system messages -- + * DPLSYS_CONNECTIONSETTINGSREAD, DPLSYS_DPLYCONNECTSUCCEEDED, + * DPLSYS_DPLAYCONNECTFAILED, DPLSYS_APPTERMINATED, DPLSYS_NEWCONNECTIONSETTINGS + */ +typedef struct _DPLMSG_SYSTEMMESSAGE +{ + DWORD dwType; // Message type + GUID guidInstance; // Instance GUID of the dplay session the message corresponds to +} DPLMSG_SYSTEMMESSAGE, FAR *LPDPLMSG_SYSTEMMESSAGE; + +/* + * DPLMSG_SETPROPERTY + * Standard message sent by an application to a lobby to set a + * property + */ +typedef struct _DPLMSG_SETPROPERTY +{ + DWORD dwType; // Message type + DWORD dwRequestID; // Request ID (DPL_NOCONFIRMATION if no confirmation desired) + GUID guidPlayer; // Player GUID + GUID guidPropertyTag; // Property GUID + DWORD dwDataSize; // Size of data + DWORD dwPropertyData[1]; // Buffer containing data +} DPLMSG_SETPROPERTY, FAR *LPDPLMSG_SETPROPERTY; + +#define DPL_NOCONFIRMATION 0 + +/* + * DPLMSG_SETPROPERTYRESPONSE + * Standard message returned by a lobby to confirm a + * DPLMSG_SETPROPERTY message. + */ +typedef struct _DPLMSG_SETPROPERTYRESPONSE +{ + DWORD dwType; // Message type + DWORD dwRequestID; // Request ID + GUID guidPlayer; // Player GUID + GUID guidPropertyTag; // Property GUID + HRESULT hr; // Return Code +} DPLMSG_SETPROPERTYRESPONSE, FAR *LPDPLMSG_SETPROPERTYRESPONSE; + +/* + * DPLMSG_GETPROPERTY + * Standard message sent by an application to a lobby to request + * the current value of a property + */ +typedef struct _DPLMSG_GETPROPERTY +{ + DWORD dwType; // Message type + DWORD dwRequestID; // Request ID + GUID guidPlayer; // Player GUID + GUID guidPropertyTag; // Property GUID +} DPLMSG_GETPROPERTY, FAR *LPDPLMSG_GETPROPERTY; + +/* + * DPLMSG_GETPROPERTYRESPONSE + * Standard message returned by a lobby in response to a + * DPLMSG_GETPROPERTY message. + */ +typedef struct _DPLMSG_GETPROPERTYRESPONSE +{ + DWORD dwType; // Message type + DWORD dwRequestID; // Request ID + GUID guidPlayer; // Player GUID + GUID guidPropertyTag; // Property GUID + HRESULT hr; // Return Code + DWORD dwDataSize; // Size of data + DWORD dwPropertyData[1]; // Buffer containing data +} DPLMSG_GETPROPERTYRESPONSE, FAR *LPDPLMSG_GETPROPERTYRESPONSE; + +/* + * DPLMSG_NEWSESSIONHOST + * Standard message returned by a lobby in response to a + * the session host migrating to a new client + */ +typedef struct _DPLMSG_NEWSESSIONHOST +{ + DWORD dwType; // Message type + GUID guidInstance; // GUID Instance of the session +} DPLMSG_NEWSESSIONHOST, FAR *LPDPLMSG_NEWSESSIONHOST; + + +/****************************************** + * + * DirectPlay Lobby message dwType values + * + *****************************************/ + +/* + * The application has read the connection settings. + * It is now O.K. for the lobby client to release + * its IDirectPlayLobby interface. + */ +#define DPLSYS_CONNECTIONSETTINGSREAD 0x00000001 + +/* + * The application's call to DirectPlayConnect failed + */ +#define DPLSYS_DPLAYCONNECTFAILED 0x00000002 + +/* + * The application has created a DirectPlay session. + */ +#define DPLSYS_DPLAYCONNECTSUCCEEDED 0x00000003 + +/* + * The application has terminated. + */ +#define DPLSYS_APPTERMINATED 0x00000004 + +/* + * The message is a DPLMSG_SETPROPERTY message. + */ +#define DPLSYS_SETPROPERTY 0x00000005 + +/* + * The message is a DPLMSG_SETPROPERTYRESPONSE message. + */ +#define DPLSYS_SETPROPERTYRESPONSE 0x00000006 + +/* + * The message is a DPLMSG_GETPROPERTY message. + */ +#define DPLSYS_GETPROPERTY 0x00000007 + +/* + * The message is a DPLMSG_GETPROPERTYRESPONSE message. + */ +#define DPLSYS_GETPROPERTYRESPONSE 0x00000008 + +/* + * The message is a DPLMSG_NEWSESSIONHOST message. + */ +#define DPLSYS_NEWSESSIONHOST 0x00000009 + +/* + * New connection settings are available. + */ +#define DPLSYS_NEWCONNECTIONSETTINGS 0x0000000A + +/* + * The Lobby Client has released the DirectPlayLobby Interface + */ +#define DPLSYS_LOBBYCLIENTRELEASE 0x0000000B + +/**************************************************************************** + * + * DirectPlay defined property GUIDs and associated data structures + * + ****************************************************************************/ + +/* + * DPLPROPERTY_MessagesSupported + * + * Request whether the lobby supports standard. Lobby with respond with either + * TRUE or FALSE or may not respond at all. + * + * Property data is a single BOOL with TRUE or FALSE + */ +// {762CCDA1-D916-11d0-BA39-00C04FD7ED67} +DEFINE_GUID(DPLPROPERTY_MessagesSupported, +0x762ccda1, 0xd916, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67); + +/* + * DPLPROPERTY_LobbyGuid + * + * Request the GUID that identifies the lobby software that the application + * is communicating with. + * + * Property data is a single GUID. + */ +// {F56920A0-D218-11d0-BA39-00C04FD7ED67} +DEFINE_GUID(DPLPROPERTY_LobbyGuid, +0xf56920a0, 0xd218, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67); + +/* + * DPLPROPERTY_PlayerGuid + * + * Request the GUID that identifies the player on this machine for sending + * property data back to the lobby. + * + * Property data is the DPLDATA_PLAYERDATA structure + */ +// {B4319322-D20D-11d0-BA39-00C04FD7ED67} +DEFINE_GUID(DPLPROPERTY_PlayerGuid, +0xb4319322, 0xd20d, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67); + +/* + * DPLDATA_PLAYERGUID + * + * Data structure to hold the GUID of the player and player creation flags + * from the lobby. + */ +typedef struct _DPLDATA_PLAYERGUID +{ + GUID guidPlayer; + DWORD dwPlayerFlags; +} DPLDATA_PLAYERGUID, FAR *LPDPLDATA_PLAYERGUID; + +/* + * DPLPROPERTY_PlayerScore + * + * Used to send an array of long integers to the lobby indicating the + * score of a player. + * + * Property data is the DPLDATA_PLAYERSCORE structure. + */ +// {48784000-D219-11d0-BA39-00C04FD7ED67} +DEFINE_GUID(DPLPROPERTY_PlayerScore, +0x48784000, 0xd219, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67); + +/* + * DPLDATA_PLAYERSCORE + * + * Data structure to hold an array of long integers representing a player score. + * Application must allocate enough memory to hold all the scores. + */ +typedef struct _DPLDATA_PLAYERSCORE +{ + DWORD dwScoreCount; + LONG Score[1]; +} DPLDATA_PLAYERSCORE, FAR *LPDPLDATA_PLAYERSCORE; + +/**************************************************************************** + * + * DirectPlay Address ID's + * + ****************************************************************************/ + +/* DirectPlay Address + * + * A DirectPlay address consists of multiple chunks of data, each tagged + * with a GUID signifying the type of data in the chunk. The chunk also + * has a length so that unknown chunk types can be skipped. + * + * The EnumAddress() function is used to parse these address data chunks. + */ + +/* + * DPADDRESS + * + * Header for block of address data elements + */ +typedef struct _DPADDRESS +{ + GUID guidDataType; + DWORD dwDataSize; +} DPADDRESS; + +typedef DPADDRESS FAR *LPDPADDRESS; + +/* + * DPAID_TotalSize + * + * Chunk is a DWORD containing size of entire DPADDRESS structure + */ + +// {1318F560-912C-11d0-9DAA-00A0C90A43CB} +DEFINE_GUID(DPAID_TotalSize, +0x1318f560, 0x912c, 0x11d0, 0x9d, 0xaa, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); + +/* + * DPAID_ServiceProvider + * + * Chunk is a GUID describing the service provider that created the chunk. + * All addresses must contain this chunk. + */ + +// {07D916C0-E0AF-11cf-9C4E-00A0C905425E} +DEFINE_GUID(DPAID_ServiceProvider, +0x7d916c0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); + +/* + * DPAID_LobbyProvider + * + * Chunk is a GUID describing the lobby provider that created the chunk. + * All addresses must contain this chunk. + */ + +// {59B95640-9667-11d0-A77D-0000F803ABFC} +DEFINE_GUID(DPAID_LobbyProvider, +0x59b95640, 0x9667, 0x11d0, 0xa7, 0x7d, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); + +/* + * DPAID_Phone and DPAID_PhoneW + * + * Chunk is a string containing a phone number (i.e. "1-800-555-1212") + * in ANSI or UNICODE format + */ + +// {78EC89A0-E0AF-11cf-9C4E-00A0C905425E} +DEFINE_GUID(DPAID_Phone, +0x78ec89a0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); + +// {BA5A7A70-9DBF-11d0-9CC1-00A0C905425E} +DEFINE_GUID(DPAID_PhoneW, +0xba5a7a70, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); + +/* + * DPAID_Modem and DPAID_ModemW + * + * Chunk is a string containing a modem name registered with TAPI + * in ANSI or UNICODE format + */ + +// {F6DCC200-A2FE-11d0-9C4F-00A0C905425E} +DEFINE_GUID(DPAID_Modem, +0xf6dcc200, 0xa2fe, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); + +// {01FD92E0-A2FF-11d0-9C4F-00A0C905425E} +DEFINE_GUID(DPAID_ModemW, +0x1fd92e0, 0xa2ff, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); + +/* + * DPAID_Inet and DPAID_InetW + * + * Chunk is a string containing a TCP/IP host name or an IP address + * (i.e. "dplay.microsoft.com" or "137.55.100.173") in ANSI or UNICODE format + */ + +// {C4A54DA0-E0AF-11cf-9C4E-00A0C905425E} +DEFINE_GUID(DPAID_INet, +0xc4a54da0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); + +// {E63232A0-9DBF-11d0-9CC1-00A0C905425E} +DEFINE_GUID(DPAID_INetW, +0xe63232a0, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); + +/* + * DPAID_InetPort + * + * Chunk is the port number used for creating the apps TCP and UDP sockets. + * WORD value (i.e. 47624). + */ + +// {E4524541-8EA5-11d1-8A96-006097B01411} +DEFINE_GUID(DPAID_INetPort, +0xe4524541, 0x8ea5, 0x11d1, 0x8a, 0x96, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); + +#ifdef BIGMESSAGEDEFENSE +#endif + +/* + * DPCOMPORTADDRESS + * + * Used to specify com port settings. The constants that define baud rate, + * stop bits and parity are defined in WINBASE.H. The constants for flow + * control are given below. + */ + +#define DPCPA_NOFLOW 0 // no flow control +#define DPCPA_XONXOFFFLOW 1 // software flow control +#define DPCPA_RTSFLOW 2 // hardware flow control with RTS +#define DPCPA_DTRFLOW 3 // hardware flow control with DTR +#define DPCPA_RTSDTRFLOW 4 // hardware flow control with RTS and DTR + +typedef struct _DPCOMPORTADDRESS +{ + DWORD dwComPort; // COM port to use (1-4) + DWORD dwBaudRate; // baud rate (100-256k) + DWORD dwStopBits; // no. stop bits (1-2) + DWORD dwParity; // parity (none, odd, even, mark) + DWORD dwFlowControl; // flow control (none, xon/xoff, rts, dtr) +} DPCOMPORTADDRESS; + +typedef DPCOMPORTADDRESS FAR *LPDPCOMPORTADDRESS; + +/* + * DPAID_ComPort + * + * Chunk contains a DPCOMPORTADDRESS structure defining the serial port. + */ + +// {F2F0CE00-E0AF-11cf-9C4E-00A0C905425E} +DEFINE_GUID(DPAID_ComPort, +0xf2f0ce00, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); + +/**************************************************************************** + * + * dplobby 1.0 obsolete definitions + * Included for compatibility only. + * + ****************************************************************************/ +#define DPLAD_SYSTEM DPLMSG_SYSTEM + + +#ifdef __cplusplus +}; +#endif /* __cplusplus */ + +#pragma warning(default:4201) + +#endif /* __DPLOBBY_INCLUDED__ */ + diff --git a/Src/Decoder_H264_ALL/D3D/include/dplobby8.h b/Src/Decoder_H264_ALL/D3D/include/dplobby8.h new file mode 100644 index 0000000..e63a5aa --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dplobby8.h @@ -0,0 +1,407 @@ +/*========================================================================== + * + * Copyright (C) 2000 Microsoft Corporation. All Rights Reserved. + * + * File: DPLobby.h + * Content: DirectPlay8 Lobby Include File + * + ***************************************************************************/ + +#ifndef __DPLOBBY_H__ +#define __DPLOBBY_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/**************************************************************************** + * + * DirectPlay8Lobby CLSIDs + * + ****************************************************************************/ + +// {667955AD-6B3B-43ca-B949-BC69B5BAFF7F} +DEFINE_GUID(CLSID_DirectPlay8LobbiedApplication, +0x667955ad, 0x6b3b, 0x43ca, 0xb9, 0x49, 0xbc, 0x69, 0xb5, 0xba, 0xff, 0x7f); + +// {3B2B6775-70B6-45af-8DEA-A209C69559F3} +DEFINE_GUID(CLSID_DirectPlay8LobbyClient, +0x3b2b6775, 0x70b6, 0x45af, 0x8d, 0xea, 0xa2, 0x9, 0xc6, 0x95, 0x59, 0xf3); + +/**************************************************************************** + * + * DirectPlay8Lobby Interface IIDs + * + ****************************************************************************/ + +// {819074A3-016C-11d3-AE14-006097B01411} +DEFINE_GUID(IID_IDirectPlay8LobbiedApplication, +0x819074a3, 0x16c, 0x11d3, 0xae, 0x14, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); + +// {819074A2-016C-11d3-AE14-006097B01411} +DEFINE_GUID(IID_IDirectPlay8LobbyClient, +0x819074a2, 0x16c, 0x11d3, 0xae, 0x14, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11); + +/**************************************************************************** + * + * DirectPlay8Lobby Interface Pointer + * + ****************************************************************************/ + +typedef struct IDirectPlay8LobbiedApplication *PDIRECTPLAY8LOBBIEDAPPLICATION; +typedef struct IDirectPlay8LobbyClient *PDIRECTPLAY8LOBBYCLIENT; + +/**************************************************************************** + * + * DirectPlay8 Lobby Message IDs + * + ****************************************************************************/ + +#define DPL_MSGID_LOBBY 0x8000 +#define DPL_MSGID_RECEIVE (0x0001 | DPL_MSGID_LOBBY) +#define DPL_MSGID_CONNECT (0x0002 | DPL_MSGID_LOBBY) +#define DPL_MSGID_DISCONNECT (0x0003 | DPL_MSGID_LOBBY) +#define DPL_MSGID_SESSION_STATUS (0x0004 | DPL_MSGID_LOBBY) +#define DPL_MSGID_CONNECTION_SETTINGS (0x0005 | DPL_MSGID_LOBBY) + +/**************************************************************************** + * + * DirectPlay8Lobby Constants + * + ****************************************************************************/ + +// +// Specifies that operation should be performed on all open connections +// +#define DPLHANDLE_ALLCONNECTIONS 0xFFFFFFFF + +// +// The associated game session has suceeded in connecting / hosting +// +#define DPLSESSION_CONNECTED 0x0001 + +// The associated game session failed connecting / hosting +// +#define DPLSESSION_COULDNOTCONNECT 0x0002 + +// +// The associated game session has disconnected +// +#define DPLSESSION_DISCONNECTED 0x0003 + +// +// The associated game session has terminated +// +#define DPLSESSION_TERMINATED 0x0004 + +// +// The associated game session's host has migrated +// +#define DPLSESSION_HOSTMIGRATED 0x0005 + +// +// The associated game session's host has migrated to the local client +// +#define DPLSESSION_HOSTMIGRATEDHERE 0x0006 + + +/**************************************************************************** + * + * DirectPlay8 Lobby Flags + * + ****************************************************************************/ + +// +// Do not automatically make the lobby app unavailable when a connection is established +// +#define DPLAVAILABLE_ALLOWMULTIPLECONNECT 0x0001 + +// +// Launch a new instance of the application to connect to +// +#define DPLCONNECT_LAUNCHNEW 0x0001 + +// +// Launch a new instance of the application if one is not waiting +// +#define DPLCONNECT_LAUNCHNOTFOUND 0x0002 + +// +// When starting the associated game session, start it as a host +// +#define DPLCONNECTSETTINGS_HOST 0x0001 + +// +// Disable parameter validation +// +#define DPLINITIALIZE_DISABLEPARAMVAL 0x0001 + +/**************************************************************************** + * + * DirectPlay8Lobby Structures (Non-Message) + * + ****************************************************************************/ + +// +// Information on a registered game +// +typedef struct _DPL_APPLICATION_INFO { + GUID guidApplication; // GUID of the application + PWSTR pwszApplicationName; // Name of the application + DWORD dwNumRunning; // # of instances of this application running + DWORD dwNumWaiting; // # of instances of this application waiting + DWORD dwFlags; // Flags +} DPL_APPLICATION_INFO, *PDPL_APPLICATION_INFO; + +// +// Settings to be used for connecting / hosting a game session +// +typedef struct _DPL_CONNECTION_SETTINGS { + DWORD dwSize; // Size of this structure + DWORD dwFlags; // Connection settings flags (DPLCONNECTSETTINGS_...) + DPN_APPLICATION_DESC dpnAppDesc; // Application desc for the associated DirectPlay session + IDirectPlay8Address *pdp8HostAddress; // Address of host to connect to + IDirectPlay8Address **ppdp8DeviceAddresses; // Address of device to connect from / host on + DWORD cNumDeviceAddresses; // # of addresses specified in ppdp8DeviceAddresses + PWSTR pwszPlayerName; // Name to give the player +} DPL_CONNECTION_SETTINGS, *PDPL_CONNECTION_SETTINGS; + +// +// Information for performing a lobby connect +// (ConnectApplication) +// +typedef struct _DPL_CONNECT_INFO { + DWORD dwSize; // Size of this structure + DWORD dwFlags; // Flags (DPLCONNECT_...) + GUID guidApplication; // GUID of application to launch + PDPL_CONNECTION_SETTINGS pdplConnectionSettings; + // Settings application should use + PVOID pvLobbyConnectData; // User defined data block + DWORD dwLobbyConnectDataSize; + // Size of user defined data block +} DPL_CONNECT_INFO, *PDPL_CONNECT_INFO; + +// +// Information for registering an application +// (RegisterApplication) +// +typedef struct _DPL_PROGRAM_DESC { + DWORD dwSize; + DWORD dwFlags; + GUID guidApplication; // Application GUID + PWSTR pwszApplicationName; // Unicode application name + PWSTR pwszCommandLine; // Unicode command line arguments + PWSTR pwszCurrentDirectory; // Unicode current directory + PWSTR pwszDescription; // Unicode application description + PWSTR pwszExecutableFilename; // Unicode filename of application executable + PWSTR pwszExecutablePath; // Unicode path of application executable + PWSTR pwszLauncherFilename; // Unicode filename of launcher executable + PWSTR pwszLauncherPath; // Unicode path of launcher executable +} DPL_PROGRAM_DESC, *PDPL_PROGRAM_DESC; + +/**************************************************************************** + * + * DirectPlay8 Lobby Message Structures + * + ****************************************************************************/ + +// +// A connection was established +// (DPL_MSGID_CONNECT) +// +typedef struct _DPL_MESSAGE_CONNECT +{ + DWORD dwSize; // Size of this structure + DPNHANDLE hConnectId; // Handle of new connection + PDPL_CONNECTION_SETTINGS pdplConnectionSettings; // Connection settings for this connection + PVOID pvLobbyConnectData; // User defined lobby data block + DWORD dwLobbyConnectDataSize; // Size of user defined lobby data block + PVOID pvConnectionContext; // Context value for this connection (user set) +} DPL_MESSAGE_CONNECT, *PDPL_MESSAGE_CONNECT; + +// +// Connection settings have been updated +// (DPL_MSGID_CONNECTION_SETTINGS) +// +typedef struct _DPL_MESSAGE_CONNECTION_SETTINGS +{ + DWORD dwSize; // Size of this structure + DPNHANDLE hSender; // Handle of the connection for these settings + PDPL_CONNECTION_SETTINGS pdplConnectionSettings; // Connection settings + PVOID pvConnectionContext; // Context value for this connection +} DPL_MESSAGE_CONNECTION_SETTINGS, *PDPL_MESSAGE_CONNECTION_SETTINGS; + +// +// A connection has been disconnected +// (DPL_MSGID_DISCONNECT) +// +typedef struct _DPL_MESSAGE_DISCONNECT +{ + DWORD dwSize; // Size of this structure + DPNHANDLE hDisconnectId; // Handle of the connection that was terminated + HRESULT hrReason; // Reason the connection was broken + PVOID pvConnectionContext; // Context value for this connection +} DPL_MESSAGE_DISCONNECT, *PDPL_MESSAGE_DISCONNECT; + +// +// Data was received through a connection +// (DPL_MSGID_RECEIVE) +// +typedef struct _DPL_MESSAGE_RECEIVE +{ + DWORD dwSize; // Size of this structure + DPNHANDLE hSender; // Handle of the connection that is from + BYTE *pBuffer; // Contents of the message + DWORD dwBufferSize; // Size of the message context + PVOID pvConnectionContext; // Context value for this connection +} DPL_MESSAGE_RECEIVE, *PDPL_MESSAGE_RECEIVE; + +// +// Current status of the associated connection +// (DPL_MSGID_SESSION_STATUS) +// +typedef struct _DPL_MESSAGE_SESSION_STATUS +{ + DWORD dwSize; // Size of this structure + DPNHANDLE hSender; // Handle of the connection that this is from + DWORD dwStatus; // Status (DPLSESSION_...) + PVOID pvConnectionContext; // Context value for this connection +} DPL_MESSAGE_SESSION_STATUS, *PDPL_MESSAGE_SESSION_STATUS; + +/**************************************************************************** + * + * DirectPlay8Lobby Create + * + ****************************************************************************/ + +/* + * This function is no longer supported. It is recommended that CoCreateInstance be used to create + * DirectPlay8 lobby objects. + * + * extern HRESULT WINAPI DirectPlay8LobbyCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown); + * + */ + +/**************************************************************************** + * + * DirectPlay8 Functions + * + ****************************************************************************/ + +// +// COM definition for DirectPlayLobbyClient +// +#undef INTERFACE // External COM Implementation +#define INTERFACE IDirectPlay8LobbyClient +DECLARE_INTERFACE_(IDirectPlay8LobbyClient,IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + // IDirectPlayLobbyClient methods + STDMETHOD(Initialize) (THIS_ const PVOID pvUserContext,const PFNDPNMESSAGEHANDLER pfn,const DWORD dwFlags) PURE; + STDMETHOD(EnumLocalPrograms) (THIS_ GUID *const pGuidApplication,BYTE *const pEnumData,DWORD *const pdwEnumData,DWORD *const pdwItems, const DWORD dwFlags) PURE; + STDMETHOD(ConnectApplication) (THIS_ DPL_CONNECT_INFO *const pdplConnectionInfo,const PVOID pvConnectionContext,DPNHANDLE *const hApplication,const DWORD dwTimeOut,const DWORD dwFlags) PURE; + STDMETHOD(Send) (THIS_ const DPNHANDLE hConnection,BYTE *const pBuffer,const DWORD pBufferSize,const DWORD dwFlags) PURE; + STDMETHOD(ReleaseApplication) (THIS_ const DPNHANDLE hConnection, const DWORD dwFlags ) PURE; + STDMETHOD(Close) (THIS_ const DWORD dwFlags ) PURE; + STDMETHOD(GetConnectionSettings) (THIS_ const DPNHANDLE hConnection, DPL_CONNECTION_SETTINGS * const pdplSessionInfo, DWORD *pdwInfoSize, const DWORD dwFlags ) PURE; + STDMETHOD(SetConnectionSettings) (THIS_ const DPNHANDLE hConnection, const DPL_CONNECTION_SETTINGS * const pdplSessionInfo, const DWORD dwFlags ) PURE; +}; + + +// +// COM definition for DirectPlayLobbiedApplication +// +#undef INTERFACE // External COM Implementation +#define INTERFACE IDirectPlay8LobbiedApplication +DECLARE_INTERFACE_(IDirectPlay8LobbiedApplication,IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID *ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + // IDirectPlayLobbiedApplication methods + STDMETHOD(Initialize) (THIS_ const PVOID pvUserContext,const PFNDPNMESSAGEHANDLER pfn,DPNHANDLE * const pdpnhConnection, const DWORD dwFlags) PURE; + STDMETHOD(RegisterProgram) (THIS_ PDPL_PROGRAM_DESC pdplProgramDesc,const DWORD dwFlags) PURE; + STDMETHOD(UnRegisterProgram) (THIS_ GUID *pguidApplication,const DWORD dwFlags) PURE; + STDMETHOD(Send) (THIS_ const DPNHANDLE hConnection,BYTE *const pBuffer,const DWORD pBufferSize,const DWORD dwFlags) PURE; + STDMETHOD(SetAppAvailable) (THIS_ const BOOL fAvailable, const DWORD dwFlags ) PURE; + STDMETHOD(UpdateStatus) (THIS_ const DPNHANDLE hConnection, const DWORD dwStatus, const DWORD dwFlags ) PURE; + STDMETHOD(Close) (THIS_ const DWORD dwFlags ) PURE; + STDMETHOD(GetConnectionSettings) (THIS_ const DPNHANDLE hConnection, DPL_CONNECTION_SETTINGS * const pdplSessionInfo, DWORD *pdwInfoSize, const DWORD dwFlags ) PURE; + STDMETHOD(SetConnectionSettings) (THIS_ const DPNHANDLE hConnection, const DPL_CONNECTION_SETTINGS * const pdplSessionInfo, const DWORD dwFlags ) PURE; +}; + + +/**************************************************************************** + * + * DirectPlayLobby Interface Macros + * + ****************************************************************************/ + +#if !defined(__cplusplus) || defined(CINTERFACE) + +#define IDirectPlay8LobbyClient_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlay8LobbyClient_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlay8LobbyClient_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlay8LobbyClient_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) +#define IDirectPlay8LobbyClient_EnumLocalPrograms(p,a,b,c,d,e) (p)->lpVtbl->EnumLocalPrograms(p,a,b,c,d,e) +#define IDirectPlay8LobbyClient_ConnectApplication(p,a,b,c,d,e) (p)->lpVtbl->ConnectApplication(p,a,b,c,d,e) +#define IDirectPlay8LobbyClient_Send(p,a,b,c,d) (p)->lpVtbl->Send(p,a,b,c,d) +#define IDirectPlay8LobbyClient_ReleaseApplication(p,a,b) (p)->lpVtbl->ReleaseApplication(p,a,b) +#define IDirectPlay8LobbyClient_Close(p,a) (p)->lpVtbl->Close(p,a) +#define IDirectPlay8LobbyClient_GetConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetConnectionSettings(p,a,b,c,d) +#define IDirectPlay8LobbyClient_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c) + +#define IDirectPlay8LobbiedApplication_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlay8LobbiedApplication_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlay8LobbiedApplication_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlay8LobbiedApplication_Initialize(p,a,b,c,d) (p)->lpVtbl->Initialize(p,a,b,c,d) +#define IDirectPlay8LobbiedApplication_RegisterProgram(p,a,b) (p)->lpVtbl->RegisterProgram(p,a,b) +#define IDirectPlay8LobbiedApplication_UnRegisterProgram(p,a,b) (p)->lpVtbl->UnRegisterProgram(p,a,b) +#define IDirectPlay8LobbiedApplication_Send(p,a,b,c,d) (p)->lpVtbl->Send(p,a,b,c,d) +#define IDirectPlay8LobbiedApplication_SetAppAvailable(p,a,b) (p)->lpVtbl->SetAppAvailable(p,a,b) +#define IDirectPlay8LobbiedApplication_UpdateStatus(p,a,b,c) (p)->lpVtbl->UpdateStatus(p,a,b,c) +#define IDirectPlay8LobbiedApplication_Close(p,a) (p)->lpVtbl->Close(p,a) +#define IDirectPlay8LobbiedApplication_GetConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetConnectionSettings(p,a,b,c,d) +#define IDirectPlay8LobbiedApplication_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c) + +#else /* C++ */ + +#define IDirectPlay8LobbyClient_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlay8LobbyClient_AddRef(p) (p)->AddRef() +#define IDirectPlay8LobbyClient_Release(p) (p)->Release() +#define IDirectPlay8LobbyClient_Initialize(p,a,b,c) (p)->Initialize(a,b,c) +#define IDirectPlay8LobbyClient_EnumLocalPrograms(p,a,b,c,d,e) (p)->EnumLocalPrograms(a,b,c,d,e) +#define IDirectPlay8LobbyClient_ConnectApplication(p,a,b,c,d,e) (p)->ConnectApplication(a,b,c,d,e) +#define IDirectPlay8LobbyClient_Send(p,a,b,c,d) (p)->Send(a,b,c,d) +#define IDirectPlay8LobbyClient_ReleaseApplication(p,a,b) (p)->ReleaseApplication(a,b) +#define IDirectPlay8LobbyClient_Close(p,a) (p)->Close(a) +#define IDirectPlay8LobbyClient_GetConnectionSettings(p,a,b,c,d) (p)->GetConnectionSettings(a,b,c,d) +#define IDirectPlay8LobbyClient_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c) + +#define IDirectPlay8LobbiedApplication_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlay8LobbiedApplication_AddRef(p) (p)->AddRef() +#define IDirectPlay8LobbiedApplication_Release(p) (p)->Release() +#define IDirectPlay8LobbiedApplication_Initialize(p,a,b,c,d) (p)->Initialize(a,b,c,d) +#define IDirectPlay8LobbiedApplication_RegisterProgram(p,a,b) (p)->RegisterProgram(a,b) +#define IDirectPlay8LobbiedApplication_UnRegisterProgram(p,a,b) (p)->UnRegisterProgram(a,b) +#define IDirectPlay8LobbiedApplication_Send(p,a,b,c,d) (p)->Send(a,b,c,d) +#define IDirectPlay8LobbiedApplication_SetAppAvailable(p,a,b) (p)->SetAppAvailable(a,b) +#define IDirectPlay8LobbiedApplication_UpdateStatus(p,a,b,c) (p)->UpdateStatus(a,b,c) +#define IDirectPlay8LobbiedApplication_Close(p,a) (p)->Close(a) +#define IDirectPlay8LobbiedApplication_GetConnectionSettings(p,a,b,c,d) (p)->GetConnectionSettings(a,b,c,d) +#define IDirectPlay8LobbiedApplication_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c) + +#endif + +#ifdef __cplusplus +} +#endif + +#endif // __DPLOBBY_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/dpnathlp.h b/Src/Decoder_H264_ALL/D3D/include/dpnathlp.h new file mode 100644 index 0000000..720e43a --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dpnathlp.h @@ -0,0 +1,318 @@ +/*************************************************************************** + * + * Copyright (C) 2001-2002 Microsoft Corporation. All Rights Reserved. + * + * File: dpnathlp.h + * + * Content: Header for using DirectPlayNATHelp interface. + * + * + * NOTE: This interface is deprecated and should no longer be used. + * + * + ***************************************************************************/ + + + +#ifndef __DPNATHLP_H__ +#define __DPNATHLP_H__ + + + +#include // for DECLARE_INTERFACE and HRESULT + + + +#ifndef DPNATHLP_EXPORTS +#define DPNATHLPAPI DECLSPEC_IMPORT +#else +#define DPNATHLPAPI +#endif + + + +#ifdef __cplusplus +extern "C" { +#endif + + + + + +/**************************************************************************** + * + * DirectPlay NAT Helper object class IDs + * + ****************************************************************************/ + +// {B9C2E9C4-68C1-4d42-A7A1-E76A26982AD6} +DEFINE_GUID(CLSID_DirectPlayNATHelpUPnP, +0xb9c2e9c4, 0x68c1, 0x4d42, 0xa7, 0xa1, 0xe7, 0x6a, 0x26, 0x98, 0x2a, 0xd6); + +// {963AB779-16A1-477c-A36D-CB5E711938F7} +DEFINE_GUID(CLSID_DirectPlayNATHelpPAST, +0x963ab779, 0x16a1, 0x477c, 0xa3, 0x6d, 0xcb, 0x5e, 0x71, 0x19, 0x38, 0xf7); + + +/**************************************************************************** + * + * DirectPlay NAT Helper interface ID + * + ****************************************************************************/ + +// {154940B6-2278-4a2f-9101-9BA9F431F603} +DEFINE_GUID(IID_IDirectPlayNATHelp, +0x154940b6, 0x2278, 0x4a2f, 0x91, 0x1, 0x9b, 0xa9, 0xf4, 0x31, 0xf6, 0x3); + +/**************************************************************************** + * + * DirectPlay NAT Helper interface pointer definitions + * + ****************************************************************************/ + +typedef struct IDirectPlayNATHelp *PDIRECTPLAYNATHELP; + + + + +/**************************************************************************** + * + * DirectPlay NAT Helper data types + * + ****************************************************************************/ + +// +// Handles used to identify specific port binding groups. If multiple ports +// are registered at the same time, the DPNHHANDLE refers to all ports. +// +typedef DWORD_PTR DPNHHANDLE, * PDPNHHANDLE; + + + + +/**************************************************************************** + * + * DirectPlay NAT Helper constants + * + ****************************************************************************/ + +#define DPNH_MAX_SIMULTANEOUS_PORTS 16 // up to 16 ports may be specified in a single RegisterPorts call + + + + +/**************************************************************************** + * + * DirectPlay NAT Helper API flags + * + ****************************************************************************/ + +// +// Flags that can be passed to Initialize +// +#define DPNHINITIALIZE_DISABLEGATEWAYSUPPORT 0x01 // disables Internet gateway traversal support (cannot be specified with DPNHINITIALIZE_DISABLELOCALFIREWALLSUPPORT) +#define DPNHINITIALIZE_DISABLELOCALFIREWALLSUPPORT 0x02 // disables local firewall traversal support (cannot be specified with DPNHINITIALIZE_DISABLEGATEWAYSUPPORT) + +// +// Flags that can be passed to GetCaps. +// +#define DPNHGETCAPS_UPDATESERVERSTATUS 0x01 // automatically extend expiring leases and detect changes in server status + +// +// Flags that can be passed to RegisterPorts. +// +#define DPNHREGISTERPORTS_TCP 0x01 // request TCP ports instead of UDP +#define DPNHREGISTERPORTS_FIXEDPORTS 0x02 // asks the server to use the same port numbers on the public interface +#define DPNHREGISTERPORTS_SHAREDPORTS 0x04 // requests that the server allow the UDP fixed ports to be shared with other clients (must be specified with DPNHREGISTERPORTS_FIXEDPORTS and cannot be specified with DPNHREGISTERPORTS_TCP) + +// +// Flags that can be passed to GetRegisteredAddresses. +// +#define DPNHGETREGISTEREDADDRESSES_LOCALFIREWALLREMAPONLY 0x01 // retrieve the public address for the local firewall only, even if mapped on remote Internet gateway + +// +// Flags that can be passed to QueryAddress. +// +#define DPNHQUERYADDRESS_TCP 0x01 // request a TCP port instead of UDP +#define DPNHQUERYADDRESS_CACHEFOUND 0x02 // cache the discovered address if found +#define DPNHQUERYADDRESS_CACHENOTFOUND 0x04 // cache the fact that no address was found, if that is the case +#define DPNHQUERYADDRESS_CHECKFORPRIVATEBUTUNMAPPED 0x08 // determine if the address is behind the same Internet gateway, but not mapped on that Internet gateway + +/**************************************************************************** + * + * DirectPlay NAT Helper structure flags + * + ****************************************************************************/ + +// +// DPNHCAPS flags +// +#define DPNHCAPSFLAG_LOCALFIREWALLPRESENT 0x01 // at least one network connection has a local firewall present +#define DPNHCAPSFLAG_GATEWAYPRESENT 0x02 // at least one network connection has an Internet gateway present +#define DPNHCAPSFLAG_GATEWAYISLOCAL 0x04 // a detected Internet gateway is local (i.e. the public address is another network interface on the same machine) +#define DPNHCAPSFLAG_PUBLICADDRESSAVAILABLE 0x08 // at least one server has a valid public address for registered mappings +#define DPNHCAPSFLAG_NOTALLSUPPORTACTIVENOTIFY 0x10 // at least one available server does not support an active-notification mechanisms and must be polled + + + +/**************************************************************************** + * + * DirectPlay NAT Helper structures + * + ****************************************************************************/ + +typedef struct _DPNHCAPS +{ + DWORD dwSize; // size of this structure, must be filled in prior to calling GetCaps + DWORD dwFlags; // flags indicating capabilities of Internet gateway server(s) + DWORD dwNumRegisteredPorts; // number of ports currently registered, including multiple ports registered at the same time (so this may not be equal to the number of DPNHHANDLEs given out) + DWORD dwMinLeaseTimeRemaining; // approximate time remaining, in milliseconds, for the lease that will expire soonest + DWORD dwRecommendedGetCapsInterval; // recommended time, in milliseconds, after which GetCaps should be called again (with DPNHGETCAPS_UPDATESERVERSTATUS flag) +} DPNHCAPS, * PDPNHCAPS; + + + +/**************************************************************************** + * + * Address type flags (returned by GetRegisteredAddresses) + * + ****************************************************************************/ + +#define DPNHADDRESSTYPE_TCP 0x01 // the mappings are for TCP ports instead of UDP +#define DPNHADDRESSTYPE_FIXEDPORTS 0x02 // the mappings are for ports which are the same on the Internet gateway +#define DPNHADDRESSTYPE_SHAREDPORTS 0x04 // the mappings are for shared UDP fixed ports +#define DPNHADDRESSTYPE_LOCALFIREWALL 0x08 // the addresses are opened on a local firewall +#define DPNHADDRESSTYPE_GATEWAY 0x10 // the addresses are registered with an Internet gateway +#define DPNHADDRESSTYPE_GATEWAYISLOCAL 0x20 // the Internet gateway is local (i.e. the public address is another network interface on the same machine) + + + + +/**************************************************************************** + * + * DirectPlay NAT Helper DLL exported functions + * + ****************************************************************************/ + +typedef HRESULT (WINAPI * PFN_DIRECTPLAYNATHELPCREATE)(const GUID * pIID, void ** ppvInterface); + + + + + +/**************************************************************************** + * + * DirectPlay NAT Helper application interfaces + * + ****************************************************************************/ + +#undef INTERFACE +#define INTERFACE IDirectPlayNATHelp +DECLARE_INTERFACE_(IDirectPlayNATHelp, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + /*** IDirectPlayNATHelp methods ***/ + STDMETHOD(Initialize) (THIS_ const DWORD dwFlags) PURE; + STDMETHOD(Close) (THIS_ const DWORD dwFlags) PURE; + STDMETHOD(GetCaps) (THIS_ DPNHCAPS * const dpnhcaps, const DWORD dwFlags) PURE; + STDMETHOD(RegisterPorts) (THIS_ const SOCKADDR * const aLocalAddresses, const DWORD dwAddressesSize, const DWORD dwNumAddresses, const DWORD dwLeaseTime, DPNHHANDLE * const phRegisteredPorts, const DWORD dwFlags) PURE; + STDMETHOD(GetRegisteredAddresses) (THIS_ const DPNHHANDLE hRegisteredPorts, SOCKADDR * const paPublicAddresses, DWORD * const pdwPublicAddressesSize, DWORD * const pdwAddressTypeFlags, DWORD * const pdwLeaseTimeRemaining, const DWORD dwFlags) PURE; + STDMETHOD(DeregisterPorts) (THIS_ const DPNHHANDLE hRegisteredPorts, const DWORD dwFlags) PURE; + STDMETHOD(QueryAddress) (THIS_ const SOCKADDR * const pSourceAddress, const SOCKADDR * const pQueryAddress, SOCKADDR * const pResponseAddress, const int iAddressesSize, const DWORD dwFlags) PURE; + STDMETHOD(SetAlertEvent) (THIS_ const HANDLE hEvent, const DWORD dwFlags) PURE; + STDMETHOD(SetAlertIOCompletionPort) (THIS_ const HANDLE hIOCompletionPort, const DWORD dwCompletionKey, const DWORD dwNumConcurrentThreads, const DWORD dwFlags) PURE; + STDMETHOD(ExtendRegisteredPortsLease) (THIS_ const DPNHHANDLE hRegisteredPorts, const DWORD dwLeaseTime, const DWORD dwFlags) PURE; +}; + + +/**************************************************************************** + * + * DirectPlay NAT Helper application interface macros + * + ****************************************************************************/ + +#if (! defined(__cplusplus) || defined(CINTERFACE)) + +#define IDirectPlayNATHelp_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlayNATHelp_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlayNATHelp_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlayNATHelp_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#define IDirectPlayNATHelp_Close(p,a) (p)->lpVtbl->Close(p,a) +#define IDirectPlayNATHelp_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) +#define IDirectPlayNATHelp_RegisterPorts(p,a,b,c,d,e,f) (p)->lpVtbl->RegisterPorts(p,a,b,c,d,e,f) +#define IDirectPlayNATHelp_GetRegisteredAddresses(p,a,b,c,d,e,f) (p)->lpVtbl->GetRegisteredAddresses(p,a,b,c,d,e,f) +#define IDirectPlayNATHelp_DeregisterPorts(p,a,b) (p)->lpVtbl->DeregisterPorts(p,a,b) +#define IDirectPlayNATHelp_QueryAddress(p,a,b,c,d,e) (p)->lpVtbl->QueryAddress(p,a,b,c,d,e) +#define IDirectPlayNATHelp_SetAlertEvent(p,a,b) (p)->lpVtbl->SetAlertEvent(p,a,b) +#define IDirectPlayNATHelp_SetAlertIOCompletionPort(p,a,b,c,d) (p)->lpVtbl->SetAlertIOCompletionPort(p,a,b,c,d) +#define IDirectPlayNATHelp_ExtendRegisteredPortsLease(p,a,b,c) (p)->lpVtbl->ExtendRegisteredPortsLease(p,a,b,c) + + +#else // C++ + +#define IDirectPlayNATHelp_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlayNATHelp_AddRef(p) (p)->AddRef() +#define IDirectPlayNATHelp_Release(p) (p)->Release() +#define IDirectPlayNATHelp_Initialize(p,a) (p)->Initialize(a) +#define IDirectPlayNATHelp_Close(p,a) (p)->Close(a) +#define IDirectPlayNATHelp_GetCaps(p,a,b) (p)->GetCaps(a,b) +#define IDirectPlayNATHelp_RegisterPorts(p,a,b,c,d,e,f) (p)->RegisterPorts(a,b,c,d,e,f) +#define IDirectPlayNATHelp_GetRegisteredAddresses(p,a,b,c,d,e,f) (p)->GetRegisteredAddresses(a,b,c,d,e,f) +#define IDirectPlayNATHelp_DeregisterPorts(p,a,b) (p)->DeregisterPorts(a,b) +#define IDirectPlayNATHelp_QueryAddress(p,a,b,c,d,e) (p)->QueryAddress(a,b,c,d,e) +#define IDirectPlayNATHelp_SetAlertEvent(p,a,b) (p)->SetAlertEvent(a,b) +#define IDirectPlayNATHelp_SetAlertIOCompletionPort(p,a,b,c,d) (p)->SetAlertIOCompletionPort(a,b,c,d) +#define IDirectPlayNATHelp_ExtendRegisteredPortsLease(p,a,b,c) (p)->ExtendRegisteredPortsLease(a,b,c) + + +#endif + + + +/**************************************************************************** + * + * DirectPlay NAT Helper return codes + * + * Errors are represented by negative values and cannot be combined. + * + ****************************************************************************/ + +#define _DPNH_FACILITY_CODE 0x015 +#define _DPNH_HRESULT_BASE 0xF000 + +#define MAKE_DPNHSUCCESS(code) MAKE_HRESULT(0, _DPNH_FACILITY_CODE, (code + _DPNH_HRESULT_BASE)) +#define MAKE_DPNHFAILURE(code) MAKE_HRESULT(1, _DPNH_FACILITY_CODE, (code + _DPNH_HRESULT_BASE)) + + + +#define DPNH_OK S_OK + +#define DPNHSUCCESS_ADDRESSESCHANGED MAKE_DPNHSUCCESS(0x10) + +#define DPNHERR_ALREADYINITIALIZED MAKE_DPNHFAILURE(0x10) +#define DPNHERR_BUFFERTOOSMALL MAKE_DPNHFAILURE(0x20) +#define DPNHERR_GENERIC E_FAIL +#define DPNHERR_INVALIDFLAGS MAKE_DPNHFAILURE(0x30) +#define DPNHERR_INVALIDOBJECT MAKE_DPNHFAILURE(0x40) +#define DPNHERR_INVALIDPARAM E_INVALIDARG +#define DPNHERR_INVALIDPOINTER E_POINTER +#define DPNHERR_NOMAPPING MAKE_DPNHFAILURE(0x50) +#define DPNHERR_NOMAPPINGBUTPRIVATE MAKE_DPNHFAILURE(0x60) +#define DPNHERR_NOTINITIALIZED MAKE_DPNHFAILURE(0x70) +#define DPNHERR_OUTOFMEMORY E_OUTOFMEMORY +#define DPNHERR_PORTALREADYREGISTERED MAKE_DPNHFAILURE(0x80) +#define DPNHERR_PORTUNAVAILABLE MAKE_DPNHFAILURE(0x90) +#define DPNHERR_REENTRANT MAKE_DPNHFAILURE(0x95) +#define DPNHERR_SERVERNOTAVAILABLE MAKE_DPNHFAILURE(0xA0) +#define DPNHERR_UPDATESERVERSTATUS MAKE_DPNHFAILURE(0xC0) + +#ifdef __cplusplus +} +#endif + +#endif // __DPNATHLP_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/dsconf.h b/Src/Decoder_H264_ALL/D3D/include/dsconf.h new file mode 100644 index 0000000..018f65a --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dsconf.h @@ -0,0 +1,195 @@ +/*==========================================================================; + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: dsconf.h + * Content: DirectSound configuration interface include file + * + **************************************************************************/ + +#ifndef __DSCONF_INCLUDED__ +#define __DSCONF_INCLUDED__ + +#ifndef __DSOUND_INCLUDED__ +#error dsound.h not included +#endif // __DSOUND_INCLUDED__ + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + + +// DirectSound Private Component GUID {11AB3EC0-25EC-11d1-A4D8-00C04FC28ACA} +DEFINE_GUID(CLSID_DirectSoundPrivate, 0x11ab3ec0, 0x25ec, 0x11d1, 0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); + + +// +// DirectSound Device Properties {84624F82-25EC-11d1-A4D8-00C04FC28ACA} +// + +DEFINE_GUID(DSPROPSETID_DirectSoundDevice, 0x84624f82, 0x25ec, 0x11d1, 0xa4, 0xd8, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); + +typedef enum +{ + DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A = 1, + DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1 = 2, + DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 = 3, + DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W = 4, + DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A = 5, + DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W = 6, + DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A = 7, + DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W = 8, +} DSPROPERTY_DIRECTSOUNDDEVICE; + +#if DIRECTSOUND_VERSION >= 0x0700 +#ifdef UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W +#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W +#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W +#else // UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A +#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A +#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A +#endif // UNICODE +#else // DIRECTSOUND_VERSION >= 0x0700 +#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A +#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1 +#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 +#endif // DIRECTSOUND_VERSION >= 0x0700 + +typedef enum +{ + DIRECTSOUNDDEVICE_TYPE_EMULATED, + DIRECTSOUNDDEVICE_TYPE_VXD, + DIRECTSOUNDDEVICE_TYPE_WDM +} DIRECTSOUNDDEVICE_TYPE; + +typedef enum +{ + DIRECTSOUNDDEVICE_DATAFLOW_RENDER, + DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE +} DIRECTSOUNDDEVICE_DATAFLOW; + + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA +{ + LPSTR DeviceName; // waveIn/waveOut device name + DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Data flow (i.e. waveIn or waveOut) + GUID DeviceId; // DirectSound device id +} DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA; + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA +{ + LPWSTR DeviceName; // waveIn/waveOut device name + DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Data flow (i.e. waveIn or waveOut) + GUID DeviceId; // DirectSound device id +} DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA; + +#ifdef UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W_DATA +#else // UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A_DATA +#endif // UNICODE + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA +{ + GUID DeviceId; // DirectSound device id + CHAR DescriptionA[0x100]; // Device description (ANSI) + WCHAR DescriptionW[0x100]; // Device description (Unicode) + CHAR ModuleA[MAX_PATH]; // Device driver module (ANSI) + WCHAR ModuleW[MAX_PATH]; // Device driver module (Unicode) + DIRECTSOUNDDEVICE_TYPE Type; // Device type + DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow + ULONG WaveDeviceId; // Wave device id + ULONG Devnode; // Devnode (or DevInst) +} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA; + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA +{ + DIRECTSOUNDDEVICE_TYPE Type; // Device type + DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow + GUID DeviceId; // DirectSound device id + LPSTR Description; // Device description + LPSTR Module; // Device driver module + LPSTR Interface; // Device interface + ULONG WaveDeviceId; // Wave device id +} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA; + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA +{ + DIRECTSOUNDDEVICE_TYPE Type; // Device type + DIRECTSOUNDDEVICE_DATAFLOW DataFlow; // Device dataflow + GUID DeviceId; // DirectSound device id + LPWSTR Description; // Device description + LPWSTR Module; // Device driver module + LPWSTR Interface; // Device interface + ULONG WaveDeviceId; // Wave device id +} DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA; + +#if DIRECTSOUND_VERSION >= 0x0700 +#ifdef UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA +#else // UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA +#endif // UNICODE +#else // DIRECTSOUND_VERSION >= 0x0700 +#define DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA +#endif // DIRECTSOUND_VERSION >= 0x0700 + +typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA, LPVOID); +typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A_DATA, LPVOID); +typedef BOOL (CALLBACK *LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW)(PDSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W_DATA, LPVOID); + +#if DIRECTSOUND_VERSION >= 0x0700 +#ifdef UNICODE +#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW +#else // UNICODE +#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA +#endif // UNICODE +#else // DIRECTSOUND_VERSION >= 0x0700 +#define LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1 +#endif // DIRECTSOUND_VERSION >= 0x0700 + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA +{ + LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK1 Callback; // Callback function pointer + LPVOID Context; // Callback function context argument +} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA; + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA +{ + LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKA Callback; // Callback function pointer + LPVOID Context; // Callback function context argument +} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA; + +typedef struct _DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA +{ + LPFNDIRECTSOUNDDEVICEENUMERATECALLBACKW Callback; // Callback function pointer + LPVOID Context; // Callback function context argument +} DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA, *PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA; + +#if DIRECTSOUND_VERSION >= 0x0700 +#ifdef UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W_DATA +#else // UNICODE +#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A_DATA +#endif // UNICODE +#else // DIRECTSOUND_VERSION >= 0x0700 +#define DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA +#define PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA PDSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1_DATA +#endif // DIRECTSOUND_VERSION >= 0x0700 + + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif // __DSCONF_INCLUDED__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/dsetup.h b/Src/Decoder_H264_ALL/D3D/include/dsetup.h new file mode 100644 index 0000000..64466cc --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dsetup.h @@ -0,0 +1,290 @@ +/*========================================================================== + * + * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. + * + * File: dsetup.h + * Content: DirectXSetup, error codes and flags + ***************************************************************************/ + +#ifndef __DSETUP_H__ +#define __DSETUP_H__ + +#include // windows stuff + +#ifdef _WIN32 +#define COM_NO_WINDOWS_H +#include +#else +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + +#define FOURCC_VERS mmioFOURCC('v','e','r','s') + +// DSETUP Error Codes, must remain compatible with previous setup. +#define DSETUPERR_SUCCESS_RESTART 1 +#define DSETUPERR_SUCCESS 0 +#define DSETUPERR_BADWINDOWSVERSION -1 +#define DSETUPERR_SOURCEFILENOTFOUND -2 +#define DSETUPERR_NOCOPY -5 +#define DSETUPERR_OUTOFDISKSPACE -6 +#define DSETUPERR_CANTFINDINF -7 +#define DSETUPERR_CANTFINDDIR -8 +#define DSETUPERR_INTERNAL -9 +#define DSETUPERR_UNKNOWNOS -11 +#define DSETUPERR_NEWERVERSION -14 +#define DSETUPERR_NOTADMIN -15 +#define DSETUPERR_UNSUPPORTEDPROCESSOR -16 +#define DSETUPERR_MISSINGCAB_MANAGEDDX -17 +#define DSETUPERR_NODOTNETFRAMEWORKINSTALLED -18 +#define DSETUPERR_CABDOWNLOADFAIL -19 +#define DSETUPERR_DXCOMPONENTFILEINUSE -20 +#define DSETUPERR_UNTRUSTEDCABINETFILE -21 + +// DSETUP flags. DirectX 5.0 apps should use these flags only. +#define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */ +#define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */ +#define DSETUP_DXCORE 0x00010000 /* install DirectX runtime */ +#define DSETUP_DIRECTX (DSETUP_DXCORE|DSETUP_DDRAWDRV|DSETUP_DSOUNDDRV) +#define DSETUP_MANAGEDDX 0x00004000 /* OBSOLETE. install managed DirectX */ +#define DSETUP_TESTINSTALL 0x00020000 /* just test install, don't do anything */ + +// These OBSOLETE flags are here for compatibility with pre-DX5 apps only. +// They are present to allow DX3 apps to be recompiled with DX5 and still work. +// DO NOT USE THEM for DX5. They will go away in future DX releases. +#define DSETUP_DDRAW 0x00000001 /* OBSOLETE. install DirectDraw */ +#define DSETUP_DSOUND 0x00000002 /* OBSOLETE. install DirectSound */ +#define DSETUP_DPLAY 0x00000004 /* OBSOLETE. install DirectPlay */ +#define DSETUP_DPLAYSP 0x00000020 /* OBSOLETE. install DirectPlay Providers */ +#define DSETUP_DVIDEO 0x00000040 /* OBSOLETE. install DirectVideo */ +#define DSETUP_D3D 0x00000200 /* OBSOLETE. install Direct3D */ +#define DSETUP_DINPUT 0x00000800 /* OBSOLETE. install DirectInput */ +#define DSETUP_DIRECTXSETUP 0x00001000 /* OBSOLETE. install DirectXSetup DLL's */ +#define DSETUP_NOUI 0x00002000 /* OBSOLETE. install DirectX with NO UI */ +#define DSETUP_PROMPTFORDRIVERS 0x10000000 /* OBSOLETE. prompt when replacing display/audio drivers */ +#define DSETUP_RESTOREDRIVERS 0x20000000 /* OBSOLETE. restore display/audio drivers */ + + + +//****************************************************************** +// DirectX Setup Callback mechanism +//****************************************************************** + +// DSETUP Message Info Codes, passed to callback as Reason parameter. +#define DSETUP_CB_MSG_NOMESSAGE 0 +#define DSETUP_CB_MSG_INTERNAL_ERROR 10 +#define DSETUP_CB_MSG_BEGIN_INSTALL 13 +#define DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME 14 +#define DSETUP_CB_MSG_PROGRESS 18 +#define DSETUP_CB_MSG_WARNING_DISABLED_COMPONENT 19 + + + + + + +typedef struct _DSETUP_CB_PROGRESS +{ + DWORD dwPhase; + DWORD dwInPhaseMaximum; + DWORD dwInPhaseProgress; + DWORD dwOverallMaximum; + DWORD dwOverallProgress; +} DSETUP_CB_PROGRESS; + + +enum _DSETUP_CB_PROGRESS_PHASE +{ + DSETUP_INITIALIZING, + DSETUP_EXTRACTING, + DSETUP_COPYING, + DSETUP_FINALIZING +}; + + +#ifdef _WIN32 +// +// Data Structures +// +#ifndef UNICODE_ONLY + +typedef struct _DIRECTXREGISTERAPPA { + DWORD dwSize; + DWORD dwFlags; + LPSTR lpszApplicationName; + LPGUID lpGUID; + LPSTR lpszFilename; + LPSTR lpszCommandLine; + LPSTR lpszPath; + LPSTR lpszCurrentDirectory; +} DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA; + +typedef struct _DIRECTXREGISTERAPP2A { + DWORD dwSize; + DWORD dwFlags; + LPSTR lpszApplicationName; + LPGUID lpGUID; + LPSTR lpszFilename; + LPSTR lpszCommandLine; + LPSTR lpszPath; + LPSTR lpszCurrentDirectory; + LPSTR lpszLauncherName; +} DIRECTXREGISTERAPP2A, *PDIRECTXREGISTERAPP2A, *LPDIRECTXREGISTERAPP2A; + +#endif //!UNICODE_ONLY +#ifndef ANSI_ONLY + +typedef struct _DIRECTXREGISTERAPPW { + DWORD dwSize; + DWORD dwFlags; + LPWSTR lpszApplicationName; + LPGUID lpGUID; + LPWSTR lpszFilename; + LPWSTR lpszCommandLine; + LPWSTR lpszPath; + LPWSTR lpszCurrentDirectory; +} DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW; + +typedef struct _DIRECTXREGISTERAPP2W { + DWORD dwSize; + DWORD dwFlags; + LPWSTR lpszApplicationName; + LPGUID lpGUID; + LPWSTR lpszFilename; + LPWSTR lpszCommandLine; + LPWSTR lpszPath; + LPWSTR lpszCurrentDirectory; + LPWSTR lpszLauncherName; +} DIRECTXREGISTERAPP2W, *PDIRECTXREGISTERAPP2W, *LPDIRECTXREGISTERAPP2W; +#endif //!ANSI_ONLY +#ifdef UNICODE +typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP; +typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP; +typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP; +typedef DIRECTXREGISTERAPP2W DIRECTXREGISTERAPP2; +typedef PDIRECTXREGISTERAPP2W PDIRECTXREGISTERAPP2; +typedef LPDIRECTXREGISTERAPP2W LPDIRECTXREGISTERAPP2; +#else +typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP; +typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP; +typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP; +typedef DIRECTXREGISTERAPP2A DIRECTXREGISTERAPP2; +typedef PDIRECTXREGISTERAPP2A PDIRECTXREGISTERAPP2; +typedef LPDIRECTXREGISTERAPP2A LPDIRECTXREGISTERAPP2; +#endif // UNICODE + + +// +// API +// + +#ifndef UNICODE_ONLY +INT +WINAPI +DirectXSetupA( + HWND hWnd, + __in_opt LPSTR lpszRootPath, + DWORD dwFlags + ); +#endif //!UNICODE_ONLY +#ifndef ANSI_ONLY +INT +WINAPI +DirectXSetupW( + HWND hWnd, + __in_opt LPWSTR lpszRootPath, + DWORD dwFlags + ); +#endif //!ANSI_ONLY +#ifdef UNICODE +#define DirectXSetup DirectXSetupW +#else +#define DirectXSetup DirectXSetupA +#endif // !UNICODE + +#ifndef UNICODE_ONLY +INT +WINAPI +DirectXRegisterApplicationA( + HWND hWnd, + LPVOID lpDXRegApp + ); +#endif //!UNICODE_ONLY +#ifndef ANSI_ONLY +INT +WINAPI +DirectXRegisterApplicationW( + HWND hWnd, + LPVOID lpDXRegApp + ); +#endif //!ANSI_ONLY +#ifdef UNICODE +#define DirectXRegisterApplication DirectXRegisterApplicationW +#else +#define DirectXRegisterApplication DirectXRegisterApplicationA +#endif // !UNICODE + +INT +WINAPI +DirectXUnRegisterApplication( + HWND hWnd, + LPGUID lpGUID + ); + +// +// Function Pointers +// +#ifdef UNICODE +typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD); +typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID); +#else +typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD); +typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPVOID); +#endif // UNICODE + +typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason, + DWORD MsgType, /* Same as flags to MessageBox */ + LPSTR szMessage, + LPSTR szName, + void *pInfo); + +INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback); +INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion); +INT WINAPI DirectXSetupShowEULA(HWND hWndParent); +#ifndef UNICODE_ONLY +UINT +WINAPI +DirectXSetupGetEULAA( + __out_ecount(cchEULA) LPSTR lpszEULA, + UINT cchEULA, + WORD LangID + ); +#endif //!UNICODE_ONLY +#ifndef ANSI_ONLY +UINT +WINAPI +DirectXSetupGetEULAW( + __out_ecount(cchEULA) LPWSTR lpszEULA, + UINT cchEULA, + WORD LangID + ); +#endif //!ANSI_ONLY +#ifdef UNICODE +#define DirectXSetupGetEULA DirectXSetupGetEULAW +typedef UINT (WINAPI * LPDIRECTXSETUPGETEULA)(LPWSTR, UINT, WORD); +#else +#define DirectXSetupGetEULA DirectXSetupGetEULAA +typedef UINT (WINAPI * LPDIRECTXSETUPGETEULA)(LPSTR, UINT, WORD); +#endif // !UNICODE + +#endif // WIN32 + + +#ifdef __cplusplus +}; +#endif + +#endif diff --git a/Src/Decoder_H264_ALL/D3D/include/dsound.h b/Src/Decoder_H264_ALL/D3D/include/dsound.h new file mode 100644 index 0000000..ca43f5f --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dsound.h @@ -0,0 +1,2385 @@ +/*==========================================================================; + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: dsound.h + * Content: DirectSound include file + * + **************************************************************************/ + +#define COM_NO_WINDOWS_H +#include +#include +#include + +#ifndef DIRECTSOUND_VERSION + +#if (NTDDI_VERSION < NTDDI_WINXP) /* Windows 2000 */ +#define DIRECTSOUND_VERSION 0x0700 /* Version 7.0 */ +#elif (NTDDI_VERSION < NTDDI_WINXPSP2 || NTDDI_VERSION == NTDDI_WS03) /* Windows XP and SP1, or Windows Server 2003 */ +#define DIRECTSOUND_VERSION 0x0800 /* Version 8.0 */ +#else /* Windows XP SP2 and higher, Windows Server 2003 SP1 and higher, Longhorn, or higher */ +#define DIRECTSOUND_VERSION 0x0900 /* Version 9.0 */ +#endif + +#endif // DIRECTSOUND_VERSION + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +#ifndef __DSOUND_INCLUDED__ +#define __DSOUND_INCLUDED__ + +/* Type definitions shared with Direct3D */ + +#ifndef DX_SHARED_DEFINES + +typedef float D3DVALUE, *LPD3DVALUE; + +#ifndef D3DCOLOR_DEFINED +typedef DWORD D3DCOLOR; +#define D3DCOLOR_DEFINED +#endif + +#ifndef LPD3DCOLOR_DEFINED +typedef DWORD *LPD3DCOLOR; +#define LPD3DCOLOR_DEFINED +#endif + +#ifndef D3DVECTOR_DEFINED +typedef struct _D3DVECTOR { + float x; + float y; + float z; +} D3DVECTOR; +#define D3DVECTOR_DEFINED +#endif + +#ifndef LPD3DVECTOR_DEFINED +typedef D3DVECTOR *LPD3DVECTOR; +#define LPD3DVECTOR_DEFINED +#endif + +#define DX_SHARED_DEFINES +#endif // DX_SHARED_DEFINES + +#define _FACDS 0x878 /* DirectSound's facility code */ +#define MAKE_DSHRESULT(code) MAKE_HRESULT(1, _FACDS, code) + +// DirectSound Component GUID {47D4D946-62E8-11CF-93BC-444553540000} +DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); + +// DirectSound 8.0 Component GUID {3901CC3F-84B5-4FA4-BA35-AA8172B8A09B} +DEFINE_GUID(CLSID_DirectSound8, 0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b); + +// DirectSound Capture Component GUID {B0210780-89CD-11D0-AF08-00A0C925CD16} +DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); + +// DirectSound 8.0 Capture Component GUID {E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1} +DEFINE_GUID(CLSID_DirectSoundCapture8, 0xe4bcac13, 0x7f99, 0x4908, 0x9a, 0x8e, 0x74, 0xe3, 0xbf, 0x24, 0xb6, 0xe1); + +// DirectSound Full Duplex Component GUID {FEA4300C-7959-4147-B26A-2377B9E7A91D} +DEFINE_GUID(CLSID_DirectSoundFullDuplex, 0xfea4300c, 0x7959, 0x4147, 0xb2, 0x6a, 0x23, 0x77, 0xb9, 0xe7, 0xa9, 0x1d); + + +// DirectSound default playback device GUID {DEF00000-9C6D-47ED-AAF1-4DDA8F2B5C03} +DEFINE_GUID(DSDEVID_DefaultPlayback, 0xdef00000, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); + +// DirectSound default capture device GUID {DEF00001-9C6D-47ED-AAF1-4DDA8F2B5C03} +DEFINE_GUID(DSDEVID_DefaultCapture, 0xdef00001, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); + +// DirectSound default device for voice playback {DEF00002-9C6D-47ED-AAF1-4DDA8F2B5C03} +DEFINE_GUID(DSDEVID_DefaultVoicePlayback, 0xdef00002, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); + +// DirectSound default device for voice capture {DEF00003-9C6D-47ED-AAF1-4DDA8F2B5C03} +DEFINE_GUID(DSDEVID_DefaultVoiceCapture, 0xdef00003, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); + + +// +// Forward declarations for interfaces. +// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined +// + +#ifdef __cplusplus +struct IDirectSound; +struct IDirectSoundBuffer; +struct IDirectSound3DListener; +struct IDirectSound3DBuffer; +struct IDirectSoundCapture; +struct IDirectSoundCaptureBuffer; +struct IDirectSoundNotify; +#endif // __cplusplus + +// +// DirectSound 8.0 interfaces. +// + +#if DIRECTSOUND_VERSION >= 0x0800 + +#ifdef __cplusplus +struct IDirectSound8; +struct IDirectSoundBuffer8; +struct IDirectSoundCaptureBuffer8; +struct IDirectSoundFXGargle; +struct IDirectSoundFXChorus; +struct IDirectSoundFXFlanger; +struct IDirectSoundFXEcho; +struct IDirectSoundFXDistortion; +struct IDirectSoundFXCompressor; +struct IDirectSoundFXParamEq; +struct IDirectSoundFXWavesReverb; +struct IDirectSoundFXI3DL2Reverb; +struct IDirectSoundCaptureFXAec; +struct IDirectSoundCaptureFXNoiseSuppress; +struct IDirectSoundFullDuplex; +#endif // __cplusplus + +// IDirectSound8, IDirectSoundBuffer8 and IDirectSoundCaptureBuffer8 are the +// only DirectSound 7.0 interfaces with changed functionality in version 8.0. +// The other level 8 interfaces as equivalent to their level 7 counterparts: + +#define IDirectSoundCapture8 IDirectSoundCapture +#define IDirectSound3DListener8 IDirectSound3DListener +#define IDirectSound3DBuffer8 IDirectSound3DBuffer +#define IDirectSoundNotify8 IDirectSoundNotify +#define IDirectSoundFXGargle8 IDirectSoundFXGargle +#define IDirectSoundFXChorus8 IDirectSoundFXChorus +#define IDirectSoundFXFlanger8 IDirectSoundFXFlanger +#define IDirectSoundFXEcho8 IDirectSoundFXEcho +#define IDirectSoundFXDistortion8 IDirectSoundFXDistortion +#define IDirectSoundFXCompressor8 IDirectSoundFXCompressor +#define IDirectSoundFXParamEq8 IDirectSoundFXParamEq +#define IDirectSoundFXWavesReverb8 IDirectSoundFXWavesReverb +#define IDirectSoundFXI3DL2Reverb8 IDirectSoundFXI3DL2Reverb +#define IDirectSoundCaptureFXAec8 IDirectSoundCaptureFXAec +#define IDirectSoundCaptureFXNoiseSuppress8 IDirectSoundCaptureFXNoiseSuppress +#define IDirectSoundFullDuplex8 IDirectSoundFullDuplex + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +typedef struct IDirectSound *LPDIRECTSOUND; +typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER; +typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER; +typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER; +typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE; +typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER; +typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY; + +#if DIRECTSOUND_VERSION >= 0x0800 + +typedef struct IDirectSoundFXGargle *LPDIRECTSOUNDFXGARGLE; +typedef struct IDirectSoundFXChorus *LPDIRECTSOUNDFXCHORUS; +typedef struct IDirectSoundFXFlanger *LPDIRECTSOUNDFXFLANGER; +typedef struct IDirectSoundFXEcho *LPDIRECTSOUNDFXECHO; +typedef struct IDirectSoundFXDistortion *LPDIRECTSOUNDFXDISTORTION; +typedef struct IDirectSoundFXCompressor *LPDIRECTSOUNDFXCOMPRESSOR; +typedef struct IDirectSoundFXParamEq *LPDIRECTSOUNDFXPARAMEQ; +typedef struct IDirectSoundFXWavesReverb *LPDIRECTSOUNDFXWAVESREVERB; +typedef struct IDirectSoundFXI3DL2Reverb *LPDIRECTSOUNDFXI3DL2REVERB; +typedef struct IDirectSoundCaptureFXAec *LPDIRECTSOUNDCAPTUREFXAEC; +typedef struct IDirectSoundCaptureFXNoiseSuppress *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS; +typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX; + +typedef struct IDirectSound8 *LPDIRECTSOUND8; +typedef struct IDirectSoundBuffer8 *LPDIRECTSOUNDBUFFER8; +typedef struct IDirectSound3DListener8 *LPDIRECTSOUND3DLISTENER8; +typedef struct IDirectSound3DBuffer8 *LPDIRECTSOUND3DBUFFER8; +typedef struct IDirectSoundCapture8 *LPDIRECTSOUNDCAPTURE8; +typedef struct IDirectSoundCaptureBuffer8 *LPDIRECTSOUNDCAPTUREBUFFER8; +typedef struct IDirectSoundNotify8 *LPDIRECTSOUNDNOTIFY8; +typedef struct IDirectSoundFXGargle8 *LPDIRECTSOUNDFXGARGLE8; +typedef struct IDirectSoundFXChorus8 *LPDIRECTSOUNDFXCHORUS8; +typedef struct IDirectSoundFXFlanger8 *LPDIRECTSOUNDFXFLANGER8; +typedef struct IDirectSoundFXEcho8 *LPDIRECTSOUNDFXECHO8; +typedef struct IDirectSoundFXDistortion8 *LPDIRECTSOUNDFXDISTORTION8; +typedef struct IDirectSoundFXCompressor8 *LPDIRECTSOUNDFXCOMPRESSOR8; +typedef struct IDirectSoundFXParamEq8 *LPDIRECTSOUNDFXPARAMEQ8; +typedef struct IDirectSoundFXWavesReverb8 *LPDIRECTSOUNDFXWAVESREVERB8; +typedef struct IDirectSoundFXI3DL2Reverb8 *LPDIRECTSOUNDFXI3DL2REVERB8; +typedef struct IDirectSoundCaptureFXAec8 *LPDIRECTSOUNDCAPTUREFXAEC8; +typedef struct IDirectSoundCaptureFXNoiseSuppress8 *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS8; +typedef struct IDirectSoundFullDuplex8 *LPDIRECTSOUNDFULLDUPLEX8; + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// IID definitions for the unchanged DirectSound 8.0 interfaces +// + +#if DIRECTSOUND_VERSION >= 0x0800 + +#define IID_IDirectSoundCapture8 IID_IDirectSoundCapture +#define IID_IDirectSound3DListener8 IID_IDirectSound3DListener +#define IID_IDirectSound3DBuffer8 IID_IDirectSound3DBuffer +#define IID_IDirectSoundNotify8 IID_IDirectSoundNotify +#define IID_IDirectSoundFXGargle8 IID_IDirectSoundFXGargle +#define IID_IDirectSoundFXChorus8 IID_IDirectSoundFXChorus +#define IID_IDirectSoundFXFlanger8 IID_IDirectSoundFXFlanger +#define IID_IDirectSoundFXEcho8 IID_IDirectSoundFXEcho +#define IID_IDirectSoundFXDistortion8 IID_IDirectSoundFXDistortion +#define IID_IDirectSoundFXCompressor8 IID_IDirectSoundFXCompressor +#define IID_IDirectSoundFXParamEq8 IID_IDirectSoundFXParamEq +#define IID_IDirectSoundFXWavesReverb8 IID_IDirectSoundFXWavesReverb +#define IID_IDirectSoundFXI3DL2Reverb8 IID_IDirectSoundFXI3DL2Reverb +#define IID_IDirectSoundCaptureFXAec8 IID_IDirectSoundCaptureFXAec +#define IID_IDirectSoundCaptureFXNoiseSuppress8 IID_IDirectSoundCaptureFXNoiseSuppress +#define IID_IDirectSoundFullDuplex8 IID_IDirectSoundFullDuplex + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// Compatibility typedefs +// + +#ifndef _LPCWAVEFORMATEX_DEFINED +#define _LPCWAVEFORMATEX_DEFINED +typedef const WAVEFORMATEX *LPCWAVEFORMATEX; +#endif // _LPCWAVEFORMATEX_DEFINED + +#ifndef __LPCGUID_DEFINED__ +#define __LPCGUID_DEFINED__ +typedef const GUID *LPCGUID; +#endif // __LPCGUID_DEFINED__ + +typedef LPDIRECTSOUND *LPLPDIRECTSOUND; +typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER; +typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER; +typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER; +typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE; +typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER; +typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY; + +#if DIRECTSOUND_VERSION >= 0x0800 +typedef LPDIRECTSOUND8 *LPLPDIRECTSOUND8; +typedef LPDIRECTSOUNDBUFFER8 *LPLPDIRECTSOUNDBUFFER8; +typedef LPDIRECTSOUNDCAPTURE8 *LPLPDIRECTSOUNDCAPTURE8; +typedef LPDIRECTSOUNDCAPTUREBUFFER8 *LPLPDIRECTSOUNDCAPTUREBUFFER8; +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// Structures +// + +typedef struct _DSCAPS +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwMinSecondarySampleRate; + DWORD dwMaxSecondarySampleRate; + DWORD dwPrimaryBuffers; + DWORD dwMaxHwMixingAllBuffers; + DWORD dwMaxHwMixingStaticBuffers; + DWORD dwMaxHwMixingStreamingBuffers; + DWORD dwFreeHwMixingAllBuffers; + DWORD dwFreeHwMixingStaticBuffers; + DWORD dwFreeHwMixingStreamingBuffers; + DWORD dwMaxHw3DAllBuffers; + DWORD dwMaxHw3DStaticBuffers; + DWORD dwMaxHw3DStreamingBuffers; + DWORD dwFreeHw3DAllBuffers; + DWORD dwFreeHw3DStaticBuffers; + DWORD dwFreeHw3DStreamingBuffers; + DWORD dwTotalHwMemBytes; + DWORD dwFreeHwMemBytes; + DWORD dwMaxContigFreeHwMemBytes; + DWORD dwUnlockTransferRateHwBuffers; + DWORD dwPlayCpuOverheadSwBuffers; + DWORD dwReserved1; + DWORD dwReserved2; +} DSCAPS, *LPDSCAPS; + +typedef const DSCAPS *LPCDSCAPS; + +typedef struct _DSBCAPS +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwUnlockTransferRate; + DWORD dwPlayCpuOverhead; +} DSBCAPS, *LPDSBCAPS; + +typedef const DSBCAPS *LPCDSBCAPS; + +#if DIRECTSOUND_VERSION >= 0x0800 + + typedef struct _DSEFFECTDESC + { + DWORD dwSize; + DWORD dwFlags; + GUID guidDSFXClass; + DWORD_PTR dwReserved1; + DWORD_PTR dwReserved2; + } DSEFFECTDESC, *LPDSEFFECTDESC; + typedef const DSEFFECTDESC *LPCDSEFFECTDESC; + + #define DSFX_LOCHARDWARE 0x00000001 + #define DSFX_LOCSOFTWARE 0x00000002 + + enum + { + DSFXR_PRESENT, // 0 + DSFXR_LOCHARDWARE, // 1 + DSFXR_LOCSOFTWARE, // 2 + DSFXR_UNALLOCATED, // 3 + DSFXR_FAILED, // 4 + DSFXR_UNKNOWN, // 5 + DSFXR_SENDLOOP // 6 + }; + + typedef struct _DSCEFFECTDESC + { + DWORD dwSize; + DWORD dwFlags; + GUID guidDSCFXClass; + GUID guidDSCFXInstance; + DWORD dwReserved1; + DWORD dwReserved2; + } DSCEFFECTDESC, *LPDSCEFFECTDESC; + typedef const DSCEFFECTDESC *LPCDSCEFFECTDESC; + + #define DSCFX_LOCHARDWARE 0x00000001 + #define DSCFX_LOCSOFTWARE 0x00000002 + + #define DSCFXR_LOCHARDWARE 0x00000010 + #define DSCFXR_LOCSOFTWARE 0x00000020 + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +typedef struct _DSBUFFERDESC +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; + LPWAVEFORMATEX lpwfxFormat; +#if DIRECTSOUND_VERSION >= 0x0700 + GUID guid3DAlgorithm; +#endif +} DSBUFFERDESC, *LPDSBUFFERDESC; + +typedef const DSBUFFERDESC *LPCDSBUFFERDESC; + +// Older version of this structure: + +typedef struct _DSBUFFERDESC1 +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; + LPWAVEFORMATEX lpwfxFormat; +} DSBUFFERDESC1, *LPDSBUFFERDESC1; + +typedef const DSBUFFERDESC1 *LPCDSBUFFERDESC1; + +typedef struct _DS3DBUFFER +{ + DWORD dwSize; + D3DVECTOR vPosition; + D3DVECTOR vVelocity; + DWORD dwInsideConeAngle; + DWORD dwOutsideConeAngle; + D3DVECTOR vConeOrientation; + LONG lConeOutsideVolume; + D3DVALUE flMinDistance; + D3DVALUE flMaxDistance; + DWORD dwMode; +} DS3DBUFFER, *LPDS3DBUFFER; + +typedef const DS3DBUFFER *LPCDS3DBUFFER; + +typedef struct _DS3DLISTENER +{ + DWORD dwSize; + D3DVECTOR vPosition; + D3DVECTOR vVelocity; + D3DVECTOR vOrientFront; + D3DVECTOR vOrientTop; + D3DVALUE flDistanceFactor; + D3DVALUE flRolloffFactor; + D3DVALUE flDopplerFactor; +} DS3DLISTENER, *LPDS3DLISTENER; + +typedef const DS3DLISTENER *LPCDS3DLISTENER; + +typedef struct _DSCCAPS +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwFormats; + DWORD dwChannels; +} DSCCAPS, *LPDSCCAPS; + +typedef const DSCCAPS *LPCDSCCAPS; + +typedef struct _DSCBUFFERDESC1 +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; + LPWAVEFORMATEX lpwfxFormat; +} DSCBUFFERDESC1, *LPDSCBUFFERDESC1; + +typedef struct _DSCBUFFERDESC +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; + LPWAVEFORMATEX lpwfxFormat; +#if DIRECTSOUND_VERSION >= 0x0800 + DWORD dwFXCount; + LPDSCEFFECTDESC lpDSCFXDesc; +#endif +} DSCBUFFERDESC, *LPDSCBUFFERDESC; + +typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC; + +typedef struct _DSCBCAPS +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; +} DSCBCAPS, *LPDSCBCAPS; + +typedef const DSCBCAPS *LPCDSCBCAPS; + +typedef struct _DSBPOSITIONNOTIFY +{ + DWORD dwOffset; + HANDLE hEventNotify; +} DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY; + +typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY; + +// +// DirectSound API +// + +typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID); +typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID); + +extern HRESULT WINAPI DirectSoundCreate(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUND *ppDS, __null LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DirectSoundEnumerateA(__in LPDSENUMCALLBACKA pDSEnumCallback, __in_opt LPVOID pContext); +extern HRESULT WINAPI DirectSoundEnumerateW(__in LPDSENUMCALLBACKW pDSEnumCallback, __in_opt LPVOID pContext); + +extern HRESULT WINAPI DirectSoundCaptureCreate(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUNDCAPTURE *ppDSC, __null LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DirectSoundCaptureEnumerateA(__in LPDSENUMCALLBACKA pDSEnumCallback, __in_opt LPVOID pContext); +extern HRESULT WINAPI DirectSoundCaptureEnumerateW(__in LPDSENUMCALLBACKW pDSEnumCallback, __in_opt LPVOID pContext); + +#if DIRECTSOUND_VERSION >= 0x0800 +extern HRESULT WINAPI DirectSoundCreate8(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUND8 *ppDS8, __null LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DirectSoundCaptureCreate8(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUNDCAPTURE8 *ppDSC8, __null LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DirectSoundFullDuplexCreate +( + __in_opt LPCGUID pcGuidCaptureDevice, + __in_opt LPCGUID pcGuidRenderDevice, + __in LPCDSCBUFFERDESC pcDSCBufferDesc, + __in LPCDSBUFFERDESC pcDSBufferDesc, + HWND hWnd, + DWORD dwLevel, + __deref_out LPDIRECTSOUNDFULLDUPLEX* ppDSFD, + __deref_out LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8, + __deref_out LPDIRECTSOUNDBUFFER8 *ppDSBuffer8, + __null LPUNKNOWN pUnkOuter +); +#define DirectSoundFullDuplexCreate8 DirectSoundFullDuplexCreate + +extern HRESULT WINAPI GetDeviceID(__in_opt LPCGUID pGuidSrc, __out LPGUID pGuidDest); +#endif // DIRECTSOUND_VERSION >= 0x0800 + +#ifdef UNICODE +#define LPDSENUMCALLBACK LPDSENUMCALLBACKW +#define DirectSoundEnumerate DirectSoundEnumerateW +#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW +#else // UNICODE +#define LPDSENUMCALLBACK LPDSENUMCALLBACKA +#define DirectSoundEnumerate DirectSoundEnumerateA +#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA +#endif // UNICODE + +// +// IUnknown +// + +#if !defined(__cplusplus) || defined(CINTERFACE) +#ifndef IUnknown_QueryInterface +#define IUnknown_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#endif // IUnknown_QueryInterface +#ifndef IUnknown_AddRef +#define IUnknown_AddRef(p) (p)->lpVtbl->AddRef(p) +#endif // IUnknown_AddRef +#ifndef IUnknown_Release +#define IUnknown_Release(p) (p)->lpVtbl->Release(p) +#endif // IUnknown_Release +#else // !defined(__cplusplus) || defined(CINTERFACE) +#ifndef IUnknown_QueryInterface +#define IUnknown_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#endif // IUnknown_QueryInterface +#ifndef IUnknown_AddRef +#define IUnknown_AddRef(p) (p)->AddRef() +#endif // IUnknown_AddRef +#ifndef IUnknown_Release +#define IUnknown_Release(p) (p)->Release() +#endif // IUnknown_Release +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#ifndef __IReferenceClock_INTERFACE_DEFINED__ +#define __IReferenceClock_INTERFACE_DEFINED__ + +typedef LONGLONG REFERENCE_TIME; +typedef REFERENCE_TIME *LPREFERENCE_TIME; + +DEFINE_GUID(IID_IReferenceClock, 0x56a86897, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); + +#undef INTERFACE +#define INTERFACE IReferenceClock + +DECLARE_INTERFACE_(IReferenceClock, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IReferenceClock methods + STDMETHOD(GetTime) (THIS_ __out REFERENCE_TIME *pTime) PURE; + STDMETHOD(AdviseTime) (THIS_ REFERENCE_TIME rtBaseTime, REFERENCE_TIME rtStreamTime, + HANDLE hEvent, __out LPDWORD pdwAdviseCookie) PURE; + STDMETHOD(AdvisePeriodic) (THIS_ REFERENCE_TIME rtStartTime, REFERENCE_TIME rtPeriodTime, + HANDLE hSemaphore, __out LPDWORD pdwAdviseCookie) PURE; + STDMETHOD(Unadvise) (THIS_ DWORD dwAdviseCookie) PURE; +}; + +#endif // __IReferenceClock_INTERFACE_DEFINED__ + +#ifndef IReferenceClock_QueryInterface + +#define IReferenceClock_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IReferenceClock_AddRef(p) IUnknown_AddRef(p) +#define IReferenceClock_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IReferenceClock_GetTime(p,a) (p)->lpVtbl->GetTime(p,a) +#define IReferenceClock_AdviseTime(p,a,b,c,d) (p)->lpVtbl->AdviseTime(p,a,b,c,d) +#define IReferenceClock_AdvisePeriodic(p,a,b,c,d) (p)->lpVtbl->AdvisePeriodic(p,a,b,c,d) +#define IReferenceClock_Unadvise(p,a) (p)->lpVtbl->Unadvise(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IReferenceClock_GetTime(p,a) (p)->GetTime(a) +#define IReferenceClock_AdviseTime(p,a,b,c,d) (p)->AdviseTime(a,b,c,d) +#define IReferenceClock_AdvisePeriodic(p,a,b,c,d) (p)->AdvisePeriodic(a,b,c,d) +#define IReferenceClock_Unadvise(p,a) (p)->Unadvise(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // IReferenceClock_QueryInterface + +// +// IDirectSound +// + +DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); + +#undef INTERFACE +#define INTERFACE IDirectSound + +DECLARE_INTERFACE_(IDirectSound, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSound methods + STDMETHOD(CreateSoundBuffer) (THIS_ __in LPCDSBUFFERDESC pcDSBufferDesc, __deref_out LPDIRECTSOUNDBUFFER *ppDSBuffer, __null LPUNKNOWN pUnkOuter) PURE; + STDMETHOD(GetCaps) (THIS_ __out LPDSCAPS pDSCaps) PURE; + STDMETHOD(DuplicateSoundBuffer) (THIS_ __in LPDIRECTSOUNDBUFFER pDSBufferOriginal, __deref_out LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate) PURE; + STDMETHOD(SetCooperativeLevel) (THIS_ HWND hwnd, DWORD dwLevel) PURE; + STDMETHOD(Compact) (THIS) PURE; + STDMETHOD(GetSpeakerConfig) (THIS_ __out LPDWORD pdwSpeakerConfig) PURE; + STDMETHOD(SetSpeakerConfig) (THIS_ DWORD dwSpeakerConfig) PURE; + STDMETHOD(Initialize) (THIS_ __in_opt LPCGUID pcGuidDevice) PURE; +}; + +#define IDirectSound_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSound_AddRef(p) IUnknown_AddRef(p) +#define IDirectSound_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c) +#define IDirectSound_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b) +#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectSound_Compact(p) (p)->lpVtbl->Compact(p) +#define IDirectSound_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a) +#define IDirectSound_SetSpeakerConfig(p,b) (p)->lpVtbl->SetSpeakerConfig(p,b) +#define IDirectSound_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c) +#define IDirectSound_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b) +#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectSound_Compact(p) (p)->Compact() +#define IDirectSound_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a) +#define IDirectSound_SetSpeakerConfig(p,b) (p)->SetSpeakerConfig(b) +#define IDirectSound_Initialize(p,a) (p)->Initialize(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSound8 +// + +DEFINE_GUID(IID_IDirectSound8, 0xC50A7E93, 0xF395, 0x4834, 0x9E, 0xF6, 0x7F, 0xA9, 0x9D, 0xE5, 0x09, 0x66); + +#undef INTERFACE +#define INTERFACE IDirectSound8 + +DECLARE_INTERFACE_(IDirectSound8, IDirectSound) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSound methods + STDMETHOD(CreateSoundBuffer) (THIS_ __in LPCDSBUFFERDESC pcDSBufferDesc, __out LPDIRECTSOUNDBUFFER *ppDSBuffer, __null LPUNKNOWN pUnkOuter) PURE; + STDMETHOD(GetCaps) (THIS_ __out LPDSCAPS pDSCaps) PURE; + STDMETHOD(DuplicateSoundBuffer) (THIS_ __in LPDIRECTSOUNDBUFFER pDSBufferOriginal, __out LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate) PURE; + STDMETHOD(SetCooperativeLevel) (THIS_ HWND hwnd, DWORD dwLevel) PURE; + STDMETHOD(Compact) (THIS) PURE; + STDMETHOD(GetSpeakerConfig) (THIS_ __out LPDWORD pdwSpeakerConfig) PURE; + STDMETHOD(SetSpeakerConfig) (THIS_ DWORD dwSpeakerConfig) PURE; + STDMETHOD(Initialize) (THIS_ __in_opt LPCGUID pcGuidDevice) PURE; + + // IDirectSound8 methods + STDMETHOD(VerifyCertification) (THIS_ __in __out LPDWORD pdwCertified) PURE; +}; + +#define IDirectSound8_QueryInterface(p,a,b) IDirectSound_QueryInterface(p,a,b) +#define IDirectSound8_AddRef(p) IDirectSound_AddRef(p) +#define IDirectSound8_Release(p) IDirectSound_Release(p) +#define IDirectSound8_CreateSoundBuffer(p,a,b,c) IDirectSound_CreateSoundBuffer(p,a,b,c) +#define IDirectSound8_GetCaps(p,a) IDirectSound_GetCaps(p,a) +#define IDirectSound8_DuplicateSoundBuffer(p,a,b) IDirectSound_DuplicateSoundBuffer(p,a,b) +#define IDirectSound8_SetCooperativeLevel(p,a,b) IDirectSound_SetCooperativeLevel(p,a,b) +#define IDirectSound8_Compact(p) IDirectSound_Compact(p) +#define IDirectSound8_GetSpeakerConfig(p,a) IDirectSound_GetSpeakerConfig(p,a) +#define IDirectSound8_SetSpeakerConfig(p,a) IDirectSound_SetSpeakerConfig(p,a) +#define IDirectSound8_Initialize(p,a) IDirectSound_Initialize(p,a) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound8_VerifyCertification(p,a) (p)->lpVtbl->VerifyCertification(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound8_VerifyCertification(p,a) (p)->VerifyCertification(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundBuffer +// + +DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); + +#undef INTERFACE +#define INTERFACE IDirectSoundBuffer + +DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundBuffer methods + STDMETHOD(GetCaps) (THIS_ __out LPDSBCAPS pDSBufferCaps) PURE; + STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCurrentPlayCursor, __out_opt LPDWORD pdwCurrentWriteCursor) PURE; + STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE; + STDMETHOD(GetVolume) (THIS_ __out LPLONG plVolume) PURE; + STDMETHOD(GetPan) (THIS_ __out LPLONG plPan) PURE; + STDMETHOD(GetFrequency) (THIS_ __out LPDWORD pdwFrequency) PURE; + STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; + STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUND pDirectSound, __in LPCDSBUFFERDESC pcDSBufferDesc) PURE; + STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, + __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1, + __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; + STDMETHOD(Play) (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE; + STDMETHOD(SetCurrentPosition) (THIS_ DWORD dwNewPosition) PURE; + STDMETHOD(SetFormat) (THIS_ __in LPCWAVEFORMATEX pcfxFormat) PURE; + STDMETHOD(SetVolume) (THIS_ LONG lVolume) PURE; + STDMETHOD(SetPan) (THIS_ LONG lPan) PURE; + STDMETHOD(SetFrequency) (THIS_ DWORD dwFrequency) PURE; + STDMETHOD(Stop) (THIS) PURE; + STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1, + __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; + STDMETHOD(Restore) (THIS) PURE; +}; + +#define IDirectSoundBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundBuffer_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundBuffer_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b) +#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c) +#define IDirectSoundBuffer_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a) +#define IDirectSoundBuffer_GetPan(p,a) (p)->lpVtbl->GetPan(p,a) +#define IDirectSoundBuffer_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a) +#define IDirectSoundBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a) +#define IDirectSoundBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g) +#define IDirectSoundBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c) +#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a) +#define IDirectSoundBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a) +#define IDirectSoundBuffer_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a) +#define IDirectSoundBuffer_SetPan(p,a) (p)->lpVtbl->SetPan(p,a) +#define IDirectSoundBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a) +#define IDirectSoundBuffer_Stop(p) (p)->lpVtbl->Stop(p) +#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d) +#define IDirectSoundBuffer_Restore(p) (p)->lpVtbl->Restore(p) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundBuffer_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b) +#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c) +#define IDirectSoundBuffer_GetVolume(p,a) (p)->GetVolume(a) +#define IDirectSoundBuffer_GetPan(p,a) (p)->GetPan(a) +#define IDirectSoundBuffer_GetFrequency(p,a) (p)->GetFrequency(a) +#define IDirectSoundBuffer_GetStatus(p,a) (p)->GetStatus(a) +#define IDirectSoundBuffer_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g) +#define IDirectSoundBuffer_Play(p,a,b,c) (p)->Play(a,b,c) +#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a) +#define IDirectSoundBuffer_SetFormat(p,a) (p)->SetFormat(a) +#define IDirectSoundBuffer_SetVolume(p,a) (p)->SetVolume(a) +#define IDirectSoundBuffer_SetPan(p,a) (p)->SetPan(a) +#define IDirectSoundBuffer_SetFrequency(p,a) (p)->SetFrequency(a) +#define IDirectSoundBuffer_Stop(p) (p)->Stop() +#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d) +#define IDirectSoundBuffer_Restore(p) (p)->Restore() +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundBuffer8 +// + +DEFINE_GUID(IID_IDirectSoundBuffer8, 0x6825a449, 0x7524, 0x4d82, 0x92, 0x0f, 0x50, 0xe3, 0x6a, 0xb3, 0xab, 0x1e); + +#undef INTERFACE +#define INTERFACE IDirectSoundBuffer8 + +DECLARE_INTERFACE_(IDirectSoundBuffer8, IDirectSoundBuffer) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundBuffer methods + STDMETHOD(GetCaps) (THIS_ __out LPDSBCAPS pDSBufferCaps) PURE; + STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCurrentPlayCursor, __out_opt LPDWORD pdwCurrentWriteCursor) PURE; + STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE; + STDMETHOD(GetVolume) (THIS_ __out LPLONG plVolume) PURE; + STDMETHOD(GetPan) (THIS_ __out LPLONG plPan) PURE; + STDMETHOD(GetFrequency) (THIS_ __out LPDWORD pdwFrequency) PURE; + STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; + STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUND pDirectSound, __in LPCDSBUFFERDESC pcDSBufferDesc) PURE; + STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, + __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1, + __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; + STDMETHOD(Play) (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE; + STDMETHOD(SetCurrentPosition) (THIS_ DWORD dwNewPosition) PURE; + STDMETHOD(SetFormat) (THIS_ __in LPCWAVEFORMATEX pcfxFormat) PURE; + STDMETHOD(SetVolume) (THIS_ LONG lVolume) PURE; + STDMETHOD(SetPan) (THIS_ LONG lPan) PURE; + STDMETHOD(SetFrequency) (THIS_ DWORD dwFrequency) PURE; + STDMETHOD(Stop) (THIS) PURE; + STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1, + __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; + STDMETHOD(Restore) (THIS) PURE; + + // IDirectSoundBuffer8 methods + STDMETHOD(SetFX) (THIS_ DWORD dwEffectsCount, __in_ecount_opt(dwEffectsCount) LPDSEFFECTDESC pDSFXDesc, __out_ecount_opt(dwEffectsCount) LPDWORD pdwResultCodes) PURE; + STDMETHOD(AcquireResources) (THIS_ DWORD dwFlags, DWORD dwEffectsCount, __out_ecount(dwEffectsCount) LPDWORD pdwResultCodes) PURE; + STDMETHOD(GetObjectInPath) (THIS_ __in REFGUID rguidObject, DWORD dwIndex, __in REFGUID rguidInterface, __deref_out LPVOID *ppObject) PURE; +}; + +// Special GUID meaning "select all objects" for use in GetObjectInPath() +DEFINE_GUID(GUID_All_Objects, 0xaa114de5, 0xc262, 0x4169, 0xa1, 0xc8, 0x23, 0xd6, 0x98, 0xcc, 0x73, 0xb5); + +#define IDirectSoundBuffer8_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundBuffer8_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundBuffer8_Release(p) IUnknown_Release(p) + +#define IDirectSoundBuffer8_GetCaps(p,a) IDirectSoundBuffer_GetCaps(p,a) +#define IDirectSoundBuffer8_GetCurrentPosition(p,a,b) IDirectSoundBuffer_GetCurrentPosition(p,a,b) +#define IDirectSoundBuffer8_GetFormat(p,a,b,c) IDirectSoundBuffer_GetFormat(p,a,b,c) +#define IDirectSoundBuffer8_GetVolume(p,a) IDirectSoundBuffer_GetVolume(p,a) +#define IDirectSoundBuffer8_GetPan(p,a) IDirectSoundBuffer_GetPan(p,a) +#define IDirectSoundBuffer8_GetFrequency(p,a) IDirectSoundBuffer_GetFrequency(p,a) +#define IDirectSoundBuffer8_GetStatus(p,a) IDirectSoundBuffer_GetStatus(p,a) +#define IDirectSoundBuffer8_Initialize(p,a,b) IDirectSoundBuffer_Initialize(p,a,b) +#define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g) IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) +#define IDirectSoundBuffer8_Play(p,a,b,c) IDirectSoundBuffer_Play(p,a,b,c) +#define IDirectSoundBuffer8_SetCurrentPosition(p,a) IDirectSoundBuffer_SetCurrentPosition(p,a) +#define IDirectSoundBuffer8_SetFormat(p,a) IDirectSoundBuffer_SetFormat(p,a) +#define IDirectSoundBuffer8_SetVolume(p,a) IDirectSoundBuffer_SetVolume(p,a) +#define IDirectSoundBuffer8_SetPan(p,a) IDirectSoundBuffer_SetPan(p,a) +#define IDirectSoundBuffer8_SetFrequency(p,a) IDirectSoundBuffer_SetFrequency(p,a) +#define IDirectSoundBuffer8_Stop(p) IDirectSoundBuffer_Stop(p) +#define IDirectSoundBuffer8_Unlock(p,a,b,c,d) IDirectSoundBuffer_Unlock(p,a,b,c,d) +#define IDirectSoundBuffer8_Restore(p) IDirectSoundBuffer_Restore(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->lpVtbl->SetFX(p,a,b,c) +#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->lpVtbl->AcquireResources(p,a,b,c) +#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->SetFX(a,b,c) +#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->AcquireResources(a,b,c) +#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSound3DListener +// + +DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); + +#undef INTERFACE +#define INTERFACE IDirectSound3DListener + +DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSound3DListener methods + STDMETHOD(GetAllParameters) (THIS_ __out LPDS3DLISTENER pListener) PURE; + STDMETHOD(GetDistanceFactor) (THIS_ __out D3DVALUE* pflDistanceFactor) PURE; + STDMETHOD(GetDopplerFactor) (THIS_ __out D3DVALUE* pflDopplerFactor) PURE; + STDMETHOD(GetOrientation) (THIS_ __out D3DVECTOR* pvOrientFront, __out D3DVECTOR* pvOrientTop) PURE; + STDMETHOD(GetPosition) (THIS_ __out D3DVECTOR* pvPosition) PURE; + STDMETHOD(GetRolloffFactor) (THIS_ __out D3DVALUE* pflRolloffFactor) PURE; + STDMETHOD(GetVelocity) (THIS_ __out D3DVECTOR* pvVelocity) PURE; + STDMETHOD(SetAllParameters) (THIS_ __in LPCDS3DLISTENER pcListener, DWORD dwApply) PURE; + STDMETHOD(SetDistanceFactor) (THIS_ D3DVALUE flDistanceFactor, DWORD dwApply) PURE; + STDMETHOD(SetDopplerFactor) (THIS_ D3DVALUE flDopplerFactor, DWORD dwApply) PURE; + STDMETHOD(SetOrientation) (THIS_ D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront, + D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply) PURE; + STDMETHOD(SetPosition) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; + STDMETHOD(SetRolloffFactor) (THIS_ D3DVALUE flRolloffFactor, DWORD dwApply) PURE; + STDMETHOD(SetVelocity) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; + STDMETHOD(CommitDeferredSettings) (THIS) PURE; +}; + +#define IDirectSound3DListener_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSound3DListener_AddRef(p) IUnknown_AddRef(p) +#define IDirectSound3DListener_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound3DListener_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->lpVtbl->GetDistanceFactor(p,a) +#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->lpVtbl->GetDopplerFactor(p,a) +#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->lpVtbl->GetOrientation(p,a,b) +#define IDirectSound3DListener_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a) +#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->lpVtbl->GetRolloffFactor(p,a) +#define IDirectSound3DListener_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a) +#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b) +#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->lpVtbl->SetDistanceFactor(p,a,b) +#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->lpVtbl->SetDopplerFactor(p,a,b) +#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g) +#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d) +#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->lpVtbl->SetRolloffFactor(p,a,b) +#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d) +#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->lpVtbl->CommitDeferredSettings(p) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound3DListener_GetAllParameters(p,a) (p)->GetAllParameters(a) +#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->GetDistanceFactor(a) +#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->GetDopplerFactor(a) +#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->GetOrientation(a,b) +#define IDirectSound3DListener_GetPosition(p,a) (p)->GetPosition(a) +#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->GetRolloffFactor(a) +#define IDirectSound3DListener_GetVelocity(p,a) (p)->GetVelocity(a) +#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b) +#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->SetDistanceFactor(a,b) +#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->SetDopplerFactor(a,b) +#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g) +#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d) +#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->SetRolloffFactor(a,b) +#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d) +#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->CommitDeferredSettings() +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSound3DBuffer +// + +DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); + +#undef INTERFACE +#define INTERFACE IDirectSound3DBuffer + +DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSound3DBuffer methods + STDMETHOD(GetAllParameters) (THIS_ __out LPDS3DBUFFER pDs3dBuffer) PURE; + STDMETHOD(GetConeAngles) (THIS_ __out LPDWORD pdwInsideConeAngle, __out LPDWORD pdwOutsideConeAngle) PURE; + STDMETHOD(GetConeOrientation) (THIS_ __out D3DVECTOR* pvOrientation) PURE; + STDMETHOD(GetConeOutsideVolume) (THIS_ __out LPLONG plConeOutsideVolume) PURE; + STDMETHOD(GetMaxDistance) (THIS_ __out D3DVALUE* pflMaxDistance) PURE; + STDMETHOD(GetMinDistance) (THIS_ __out D3DVALUE* pflMinDistance) PURE; + STDMETHOD(GetMode) (THIS_ __out LPDWORD pdwMode) PURE; + STDMETHOD(GetPosition) (THIS_ __out D3DVECTOR* pvPosition) PURE; + STDMETHOD(GetVelocity) (THIS_ __out D3DVECTOR* pvVelocity) PURE; + STDMETHOD(SetAllParameters) (THIS_ __in LPCDS3DBUFFER pcDs3dBuffer, DWORD dwApply) PURE; + STDMETHOD(SetConeAngles) (THIS_ DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply) PURE; + STDMETHOD(SetConeOrientation) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; + STDMETHOD(SetConeOutsideVolume) (THIS_ LONG lConeOutsideVolume, DWORD dwApply) PURE; + STDMETHOD(SetMaxDistance) (THIS_ D3DVALUE flMaxDistance, DWORD dwApply) PURE; + STDMETHOD(SetMinDistance) (THIS_ D3DVALUE flMinDistance, DWORD dwApply) PURE; + STDMETHOD(SetMode) (THIS_ DWORD dwMode, DWORD dwApply) PURE; + STDMETHOD(SetPosition) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; + STDMETHOD(SetVelocity) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; +}; + +#define IDirectSound3DBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSound3DBuffer_AddRef(p) IUnknown_AddRef(p) +#define IDirectSound3DBuffer_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->lpVtbl->GetConeAngles(p,a,b) +#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->lpVtbl->GetConeOrientation(p,a) +#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->lpVtbl->GetConeOutsideVolume(p,a) +#define IDirectSound3DBuffer_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a) +#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->lpVtbl->GetMinDistance(p,a) +#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->lpVtbl->GetMaxDistance(p,a) +#define IDirectSound3DBuffer_GetMode(p,a) (p)->lpVtbl->GetMode(p,a) +#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a) +#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b) +#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->lpVtbl->SetConeAngles(p,a,b,c) +#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d) +#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) (p)->lpVtbl->SetConeOutsideVolume(p,a,b) +#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d) +#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->lpVtbl->SetMinDistance(p,a,b) +#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->lpVtbl->SetMaxDistance(p,a,b) +#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->lpVtbl->SetMode(p,a,b) +#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->GetAllParameters(a) +#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->GetConeAngles(a,b) +#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->GetConeOrientation(a) +#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->GetConeOutsideVolume(a) +#define IDirectSound3DBuffer_GetPosition(p,a) (p)->GetPosition(a) +#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->GetMinDistance(a) +#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->GetMaxDistance(a) +#define IDirectSound3DBuffer_GetMode(p,a) (p)->GetMode(a) +#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->GetVelocity(a) +#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b) +#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->SetConeAngles(a,b,c) +#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d) +#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) (p)->SetConeOutsideVolume(a,b) +#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d) +#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->SetMinDistance(a,b) +#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->SetMaxDistance(a,b) +#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->SetMode(a,b) +#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundCapture +// + +DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); + +#undef INTERFACE +#define INTERFACE IDirectSoundCapture + +DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCapture methods + STDMETHOD(CreateCaptureBuffer) (THIS_ __in LPCDSCBUFFERDESC pcDSCBufferDesc, __deref_out LPDIRECTSOUNDCAPTUREBUFFER *ppDSCBuffer, __null LPUNKNOWN pUnkOuter) PURE; + STDMETHOD(GetCaps) (THIS_ __out LPDSCCAPS pDSCCaps) PURE; + STDMETHOD(Initialize) (THIS_ __in_opt LPCGUID pcGuidDevice) PURE; +}; + +#define IDirectSoundCapture_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCapture_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCapture_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c) +#define IDirectSoundCapture_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectSoundCapture_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c) +#define IDirectSoundCapture_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectSoundCapture_Initialize(p,a) (p)->Initialize(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundCaptureBuffer +// + +DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); + +#undef INTERFACE +#define INTERFACE IDirectSoundCaptureBuffer + +DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCaptureBuffer methods + STDMETHOD(GetCaps) (THIS_ __out LPDSCBCAPS pDSCBCaps) PURE; + STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCapturePosition, __out_opt LPDWORD pdwReadPosition) PURE; + STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE; + STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; + STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUNDCAPTURE pDirectSoundCapture, __in LPCDSCBUFFERDESC pcDSCBufferDesc) PURE; + STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, + __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1, + __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; + STDMETHOD(Start) (THIS_ DWORD dwFlags) PURE; + STDMETHOD(Stop) (THIS) PURE; + STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1, + __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; +}; + +#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCaptureBuffer_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCaptureBuffer_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b) +#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c) +#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a) +#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g) +#define IDirectSoundCaptureBuffer_Start(p,a) (p)->lpVtbl->Start(p,a) +#define IDirectSoundCaptureBuffer_Stop(p) (p)->lpVtbl->Stop(p) +#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b) +#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c) +#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->GetStatus(a) +#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g) +#define IDirectSoundCaptureBuffer_Start(p,a) (p)->Start(a) +#define IDirectSoundCaptureBuffer_Stop(p) (p)->Stop() +#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundCaptureBuffer8 +// + +DEFINE_GUID(IID_IDirectSoundCaptureBuffer8, 0x990df4, 0xdbb, 0x4872, 0x83, 0x3e, 0x6d, 0x30, 0x3e, 0x80, 0xae, 0xb6); + +#undef INTERFACE +#define INTERFACE IDirectSoundCaptureBuffer8 + +DECLARE_INTERFACE_(IDirectSoundCaptureBuffer8, IDirectSoundCaptureBuffer) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCaptureBuffer methods + STDMETHOD(GetCaps) (THIS_ __out LPDSCBCAPS pDSCBCaps) PURE; + STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCapturePosition, __out_opt LPDWORD pdwReadPosition) PURE; + STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE; + STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; + STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUNDCAPTURE pDirectSoundCapture, __in LPCDSCBUFFERDESC pcDSCBufferDesc) PURE; + STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, + __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1, + __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; + STDMETHOD(Start) (THIS_ DWORD dwFlags) PURE; + STDMETHOD(Stop) (THIS) PURE; + STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1, + __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; + + // IDirectSoundCaptureBuffer8 methods + STDMETHOD(GetObjectInPath) (THIS_ __in REFGUID rguidObject, DWORD dwIndex, __in REFGUID rguidInterface, __deref_out LPVOID *ppObject) PURE; + STDMETHOD(GetFXStatus) (DWORD dwEffectsCount, __out_ecount(dwEffectsCount) LPDWORD pdwFXStatus) PURE; +}; + +#define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCaptureBuffer8_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCaptureBuffer8_Release(p) IUnknown_Release(p) + +#define IDirectSoundCaptureBuffer8_GetCaps(p,a) IDirectSoundCaptureBuffer_GetCaps(p,a) +#define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b) IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) +#define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c) IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) +#define IDirectSoundCaptureBuffer8_GetStatus(p,a) IDirectSoundCaptureBuffer_GetStatus(p,a) +#define IDirectSoundCaptureBuffer8_Initialize(p,a,b) IDirectSoundCaptureBuffer_Initialize(p,a,b) +#define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g) IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) +#define IDirectSoundCaptureBuffer8_Start(p,a) IDirectSoundCaptureBuffer_Start(p,a) +#define IDirectSoundCaptureBuffer8_Stop(p) IDirectSoundCaptureBuffer_Stop(p)) +#define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d) IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d) +#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->lpVtbl->GetFXStatus(p,a,b) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d) +#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->GetFXStatus(a,b) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundNotify +// + +DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); + +#undef INTERFACE +#define INTERFACE IDirectSoundNotify + +DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundNotify methods + STDMETHOD(SetNotificationPositions) (THIS_ DWORD dwPositionNotifies, __in_ecount(dwPositionNotifies) LPCDSBPOSITIONNOTIFY pcPositionNotifies) PURE; +}; + +#define IDirectSoundNotify_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundNotify_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundNotify_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IKsPropertySet +// + +#ifndef _IKsPropertySet_ +#define _IKsPropertySet_ + +#ifdef __cplusplus +// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined +struct IKsPropertySet; +#endif // __cplusplus + +typedef struct IKsPropertySet *LPKSPROPERTYSET; + +#define KSPROPERTY_SUPPORT_GET 0x00000001 +#define KSPROPERTY_SUPPORT_SET 0x00000002 + +DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93); + +#undef INTERFACE +#define INTERFACE IKsPropertySet + +DECLARE_INTERFACE_(IKsPropertySet, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IKsPropertySet methods + STDMETHOD(Get) (THIS_ __in REFGUID rguidPropSet, ULONG ulId, __in_bcount(ulInstanceLength) LPVOID pInstanceData, ULONG ulInstanceLength, + __out_bcount(ulDataLength) LPVOID pPropertyData, ULONG ulDataLength, __out PULONG pulBytesReturned) PURE; + STDMETHOD(Set) (THIS_ __in REFGUID rguidPropSet, ULONG ulId, __in_bcount(ulInstanceLength) LPVOID pInstanceData, ULONG ulInstanceLength, + __in_bcount(ulDataLength) LPVOID pPropertyData, ULONG ulDataLength) PURE; + STDMETHOD(QuerySupport) (THIS_ __in REFGUID rguidPropSet, ULONG ulId, __out PULONG pulTypeSupport) PURE; +}; + +#define IKsPropertySet_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IKsPropertySet_AddRef(p) IUnknown_AddRef(p) +#define IKsPropertySet_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->lpVtbl->Get(p,a,b,c,d,e,f,g) +#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->lpVtbl->Set(p,a,b,c,d,e,f) +#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->Get(a,b,c,d,e,f,g) +#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->Set(a,b,c,d,e,f) +#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->QuerySupport(a,b,c) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // _IKsPropertySet_ + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundFXGargle +// + +DEFINE_GUID(IID_IDirectSoundFXGargle, 0xd616f352, 0xd622, 0x11ce, 0xaa, 0xc5, 0x00, 0x20, 0xaf, 0x0b, 0x99, 0xa3); + +typedef struct _DSFXGargle +{ + DWORD dwRateHz; // Rate of modulation in hz + DWORD dwWaveShape; // DSFXGARGLE_WAVE_xxx +} DSFXGargle, *LPDSFXGargle; + +#define DSFXGARGLE_WAVE_TRIANGLE 0 +#define DSFXGARGLE_WAVE_SQUARE 1 + +typedef const DSFXGargle *LPCDSFXGargle; + +#define DSFXGARGLE_RATEHZ_MIN 1 +#define DSFXGARGLE_RATEHZ_MAX 1000 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXGargle + +DECLARE_INTERFACE_(IDirectSoundFXGargle, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXGargle methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXGargle pcDsFxGargle) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXGargle pDsFxGargle) PURE; +}; + +#define IDirectSoundFXGargle_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXGargle_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXGargle_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXGargle_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXGargle_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXGargle_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXGargle_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXChorus +// + +DEFINE_GUID(IID_IDirectSoundFXChorus, 0x880842e3, 0x145f, 0x43e6, 0xa9, 0x34, 0xa7, 0x18, 0x06, 0xe5, 0x05, 0x47); + +typedef struct _DSFXChorus +{ + FLOAT fWetDryMix; + FLOAT fDepth; + FLOAT fFeedback; + FLOAT fFrequency; + LONG lWaveform; // LFO shape; DSFXCHORUS_WAVE_xxx + FLOAT fDelay; + LONG lPhase; +} DSFXChorus, *LPDSFXChorus; + +typedef const DSFXChorus *LPCDSFXChorus; + +#define DSFXCHORUS_WAVE_TRIANGLE 0 +#define DSFXCHORUS_WAVE_SIN 1 + +#define DSFXCHORUS_WETDRYMIX_MIN 0.0f +#define DSFXCHORUS_WETDRYMIX_MAX 100.0f +#define DSFXCHORUS_DEPTH_MIN 0.0f +#define DSFXCHORUS_DEPTH_MAX 100.0f +#define DSFXCHORUS_FEEDBACK_MIN -99.0f +#define DSFXCHORUS_FEEDBACK_MAX 99.0f +#define DSFXCHORUS_FREQUENCY_MIN 0.0f +#define DSFXCHORUS_FREQUENCY_MAX 10.0f +#define DSFXCHORUS_DELAY_MIN 0.0f +#define DSFXCHORUS_DELAY_MAX 20.0f +#define DSFXCHORUS_PHASE_MIN 0 +#define DSFXCHORUS_PHASE_MAX 4 + +#define DSFXCHORUS_PHASE_NEG_180 0 +#define DSFXCHORUS_PHASE_NEG_90 1 +#define DSFXCHORUS_PHASE_ZERO 2 +#define DSFXCHORUS_PHASE_90 3 +#define DSFXCHORUS_PHASE_180 4 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXChorus + +DECLARE_INTERFACE_(IDirectSoundFXChorus, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXChorus methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXChorus pcDsFxChorus) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXChorus pDsFxChorus) PURE; +}; + +#define IDirectSoundFXChorus_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXChorus_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXChorus_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXChorus_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXChorus_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXChorus_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXChorus_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXFlanger +// + +DEFINE_GUID(IID_IDirectSoundFXFlanger, 0x903e9878, 0x2c92, 0x4072, 0x9b, 0x2c, 0xea, 0x68, 0xf5, 0x39, 0x67, 0x83); + +typedef struct _DSFXFlanger +{ + FLOAT fWetDryMix; + FLOAT fDepth; + FLOAT fFeedback; + FLOAT fFrequency; + LONG lWaveform; + FLOAT fDelay; + LONG lPhase; +} DSFXFlanger, *LPDSFXFlanger; + +typedef const DSFXFlanger *LPCDSFXFlanger; + +#define DSFXFLANGER_WAVE_TRIANGLE 0 +#define DSFXFLANGER_WAVE_SIN 1 + +#define DSFXFLANGER_WETDRYMIX_MIN 0.0f +#define DSFXFLANGER_WETDRYMIX_MAX 100.0f +#define DSFXFLANGER_FREQUENCY_MIN 0.0f +#define DSFXFLANGER_FREQUENCY_MAX 10.0f +#define DSFXFLANGER_DEPTH_MIN 0.0f +#define DSFXFLANGER_DEPTH_MAX 100.0f +#define DSFXFLANGER_PHASE_MIN 0 +#define DSFXFLANGER_PHASE_MAX 4 +#define DSFXFLANGER_FEEDBACK_MIN -99.0f +#define DSFXFLANGER_FEEDBACK_MAX 99.0f +#define DSFXFLANGER_DELAY_MIN 0.0f +#define DSFXFLANGER_DELAY_MAX 4.0f + +#define DSFXFLANGER_PHASE_NEG_180 0 +#define DSFXFLANGER_PHASE_NEG_90 1 +#define DSFXFLANGER_PHASE_ZERO 2 +#define DSFXFLANGER_PHASE_90 3 +#define DSFXFLANGER_PHASE_180 4 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXFlanger + +DECLARE_INTERFACE_(IDirectSoundFXFlanger, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXFlanger methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXFlanger pcDsFxFlanger) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXFlanger pDsFxFlanger) PURE; +}; + +#define IDirectSoundFXFlanger_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXFlanger_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXFlanger_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXFlanger_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXFlanger_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXFlanger_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXFlanger_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXEcho +// + +DEFINE_GUID(IID_IDirectSoundFXEcho, 0x8bd28edf, 0x50db, 0x4e92, 0xa2, 0xbd, 0x44, 0x54, 0x88, 0xd1, 0xed, 0x42); + +typedef struct _DSFXEcho +{ + FLOAT fWetDryMix; + FLOAT fFeedback; + FLOAT fLeftDelay; + FLOAT fRightDelay; + LONG lPanDelay; +} DSFXEcho, *LPDSFXEcho; + +typedef const DSFXEcho *LPCDSFXEcho; + +#define DSFXECHO_WETDRYMIX_MIN 0.0f +#define DSFXECHO_WETDRYMIX_MAX 100.0f +#define DSFXECHO_FEEDBACK_MIN 0.0f +#define DSFXECHO_FEEDBACK_MAX 100.0f +#define DSFXECHO_LEFTDELAY_MIN 1.0f +#define DSFXECHO_LEFTDELAY_MAX 2000.0f +#define DSFXECHO_RIGHTDELAY_MIN 1.0f +#define DSFXECHO_RIGHTDELAY_MAX 2000.0f +#define DSFXECHO_PANDELAY_MIN 0 +#define DSFXECHO_PANDELAY_MAX 1 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXEcho + +DECLARE_INTERFACE_(IDirectSoundFXEcho, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXEcho methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXEcho pcDsFxEcho) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXEcho pDsFxEcho) PURE; +}; + +#define IDirectSoundFXEcho_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXEcho_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXEcho_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXEcho_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXEcho_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXEcho_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXEcho_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXDistortion +// + +DEFINE_GUID(IID_IDirectSoundFXDistortion, 0x8ecf4326, 0x455f, 0x4d8b, 0xbd, 0xa9, 0x8d, 0x5d, 0x3e, 0x9e, 0x3e, 0x0b); + +typedef struct _DSFXDistortion +{ + FLOAT fGain; + FLOAT fEdge; + FLOAT fPostEQCenterFrequency; + FLOAT fPostEQBandwidth; + FLOAT fPreLowpassCutoff; +} DSFXDistortion, *LPDSFXDistortion; + +typedef const DSFXDistortion *LPCDSFXDistortion; + +#define DSFXDISTORTION_GAIN_MIN -60.0f +#define DSFXDISTORTION_GAIN_MAX 0.0f +#define DSFXDISTORTION_EDGE_MIN 0.0f +#define DSFXDISTORTION_EDGE_MAX 100.0f +#define DSFXDISTORTION_POSTEQCENTERFREQUENCY_MIN 100.0f +#define DSFXDISTORTION_POSTEQCENTERFREQUENCY_MAX 8000.0f +#define DSFXDISTORTION_POSTEQBANDWIDTH_MIN 100.0f +#define DSFXDISTORTION_POSTEQBANDWIDTH_MAX 8000.0f +#define DSFXDISTORTION_PRELOWPASSCUTOFF_MIN 100.0f +#define DSFXDISTORTION_PRELOWPASSCUTOFF_MAX 8000.0f + +#undef INTERFACE +#define INTERFACE IDirectSoundFXDistortion + +DECLARE_INTERFACE_(IDirectSoundFXDistortion, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXDistortion methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXDistortion pcDsFxDistortion) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXDistortion pDsFxDistortion) PURE; +}; + +#define IDirectSoundFXDistortion_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXDistortion_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXDistortion_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXDistortion_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXDistortion_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXDistortion_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXDistortion_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXCompressor +// + +DEFINE_GUID(IID_IDirectSoundFXCompressor, 0x4bbd1154, 0x62f6, 0x4e2c, 0xa1, 0x5c, 0xd3, 0xb6, 0xc4, 0x17, 0xf7, 0xa0); + +typedef struct _DSFXCompressor +{ + FLOAT fGain; + FLOAT fAttack; + FLOAT fRelease; + FLOAT fThreshold; + FLOAT fRatio; + FLOAT fPredelay; +} DSFXCompressor, *LPDSFXCompressor; + +typedef const DSFXCompressor *LPCDSFXCompressor; + +#define DSFXCOMPRESSOR_GAIN_MIN -60.0f +#define DSFXCOMPRESSOR_GAIN_MAX 60.0f +#define DSFXCOMPRESSOR_ATTACK_MIN 0.01f +#define DSFXCOMPRESSOR_ATTACK_MAX 500.0f +#define DSFXCOMPRESSOR_RELEASE_MIN 50.0f +#define DSFXCOMPRESSOR_RELEASE_MAX 3000.0f +#define DSFXCOMPRESSOR_THRESHOLD_MIN -60.0f +#define DSFXCOMPRESSOR_THRESHOLD_MAX 0.0f +#define DSFXCOMPRESSOR_RATIO_MIN 1.0f +#define DSFXCOMPRESSOR_RATIO_MAX 100.0f +#define DSFXCOMPRESSOR_PREDELAY_MIN 0.0f +#define DSFXCOMPRESSOR_PREDELAY_MAX 4.0f + +#undef INTERFACE +#define INTERFACE IDirectSoundFXCompressor + +DECLARE_INTERFACE_(IDirectSoundFXCompressor, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXCompressor methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXCompressor pcDsFxCompressor) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXCompressor pDsFxCompressor) PURE; +}; + +#define IDirectSoundFXCompressor_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXCompressor_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXCompressor_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXCompressor_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXCompressor_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXCompressor_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXCompressor_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXParamEq +// + +DEFINE_GUID(IID_IDirectSoundFXParamEq, 0xc03ca9fe, 0xfe90, 0x4204, 0x80, 0x78, 0x82, 0x33, 0x4c, 0xd1, 0x77, 0xda); + +typedef struct _DSFXParamEq +{ + FLOAT fCenter; + FLOAT fBandwidth; + FLOAT fGain; +} DSFXParamEq, *LPDSFXParamEq; + +typedef const DSFXParamEq *LPCDSFXParamEq; + +#define DSFXPARAMEQ_CENTER_MIN 80.0f +#define DSFXPARAMEQ_CENTER_MAX 16000.0f +#define DSFXPARAMEQ_BANDWIDTH_MIN 1.0f +#define DSFXPARAMEQ_BANDWIDTH_MAX 36.0f +#define DSFXPARAMEQ_GAIN_MIN -15.0f +#define DSFXPARAMEQ_GAIN_MAX 15.0f + +#undef INTERFACE +#define INTERFACE IDirectSoundFXParamEq + +DECLARE_INTERFACE_(IDirectSoundFXParamEq, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXParamEq methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXParamEq pcDsFxParamEq) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXParamEq pDsFxParamEq) PURE; +}; + +#define IDirectSoundFXParamEq_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXParamEq_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXParamEq_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXParamEq_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXParamEq_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXParamEq_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXParamEq_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXI3DL2Reverb +// + +DEFINE_GUID(IID_IDirectSoundFXI3DL2Reverb, 0x4b166a6a, 0x0d66, 0x43f3, 0x80, 0xe3, 0xee, 0x62, 0x80, 0xde, 0xe1, 0xa4); + +typedef struct _DSFXI3DL2Reverb +{ + LONG lRoom; // [-10000, 0] default: -1000 mB + LONG lRoomHF; // [-10000, 0] default: 0 mB + FLOAT flRoomRolloffFactor; // [0.0, 10.0] default: 0.0 + FLOAT flDecayTime; // [0.1, 20.0] default: 1.49s + FLOAT flDecayHFRatio; // [0.1, 2.0] default: 0.83 + LONG lReflections; // [-10000, 1000] default: -2602 mB + FLOAT flReflectionsDelay; // [0.0, 0.3] default: 0.007 s + LONG lReverb; // [-10000, 2000] default: 200 mB + FLOAT flReverbDelay; // [0.0, 0.1] default: 0.011 s + FLOAT flDiffusion; // [0.0, 100.0] default: 100.0 % + FLOAT flDensity; // [0.0, 100.0] default: 100.0 % + FLOAT flHFReference; // [20.0, 20000.0] default: 5000.0 Hz +} DSFXI3DL2Reverb, *LPDSFXI3DL2Reverb; + +typedef const DSFXI3DL2Reverb *LPCDSFXI3DL2Reverb; + +#define DSFX_I3DL2REVERB_ROOM_MIN (-10000) +#define DSFX_I3DL2REVERB_ROOM_MAX 0 +#define DSFX_I3DL2REVERB_ROOM_DEFAULT (-1000) + +#define DSFX_I3DL2REVERB_ROOMHF_MIN (-10000) +#define DSFX_I3DL2REVERB_ROOMHF_MAX 0 +#define DSFX_I3DL2REVERB_ROOMHF_DEFAULT (-100) + +#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MIN 0.0f +#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MAX 10.0f +#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_DEFAULT 0.0f + +#define DSFX_I3DL2REVERB_DECAYTIME_MIN 0.1f +#define DSFX_I3DL2REVERB_DECAYTIME_MAX 20.0f +#define DSFX_I3DL2REVERB_DECAYTIME_DEFAULT 1.49f + +#define DSFX_I3DL2REVERB_DECAYHFRATIO_MIN 0.1f +#define DSFX_I3DL2REVERB_DECAYHFRATIO_MAX 2.0f +#define DSFX_I3DL2REVERB_DECAYHFRATIO_DEFAULT 0.83f + +#define DSFX_I3DL2REVERB_REFLECTIONS_MIN (-10000) +#define DSFX_I3DL2REVERB_REFLECTIONS_MAX 1000 +#define DSFX_I3DL2REVERB_REFLECTIONS_DEFAULT (-2602) + +#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_MIN 0.0f +#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_MAX 0.3f +#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_DEFAULT 0.007f + +#define DSFX_I3DL2REVERB_REVERB_MIN (-10000) +#define DSFX_I3DL2REVERB_REVERB_MAX 2000 +#define DSFX_I3DL2REVERB_REVERB_DEFAULT (200) + +#define DSFX_I3DL2REVERB_REVERBDELAY_MIN 0.0f +#define DSFX_I3DL2REVERB_REVERBDELAY_MAX 0.1f +#define DSFX_I3DL2REVERB_REVERBDELAY_DEFAULT 0.011f + +#define DSFX_I3DL2REVERB_DIFFUSION_MIN 0.0f +#define DSFX_I3DL2REVERB_DIFFUSION_MAX 100.0f +#define DSFX_I3DL2REVERB_DIFFUSION_DEFAULT 100.0f + +#define DSFX_I3DL2REVERB_DENSITY_MIN 0.0f +#define DSFX_I3DL2REVERB_DENSITY_MAX 100.0f +#define DSFX_I3DL2REVERB_DENSITY_DEFAULT 100.0f + +#define DSFX_I3DL2REVERB_HFREFERENCE_MIN 20.0f +#define DSFX_I3DL2REVERB_HFREFERENCE_MAX 20000.0f +#define DSFX_I3DL2REVERB_HFREFERENCE_DEFAULT 5000.0f + +#define DSFX_I3DL2REVERB_QUALITY_MIN 0 +#define DSFX_I3DL2REVERB_QUALITY_MAX 3 +#define DSFX_I3DL2REVERB_QUALITY_DEFAULT 2 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXI3DL2Reverb + +DECLARE_INTERFACE_(IDirectSoundFXI3DL2Reverb, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXI3DL2Reverb methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXI3DL2Reverb pcDsFxI3DL2Reverb) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXI3DL2Reverb pDsFxI3DL2Reverb) PURE; + STDMETHOD(SetPreset) (THIS_ DWORD dwPreset) PURE; + STDMETHOD(GetPreset) (THIS_ __out LPDWORD pdwPreset) PURE; + STDMETHOD(SetQuality) (THIS_ LONG lQuality) PURE; + STDMETHOD(GetQuality) (THIS_ __out LONG *plQuality) PURE; +}; + +#define IDirectSoundFXI3DL2Reverb_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXI3DL2Reverb_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXI3DL2Reverb_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXI3DL2Reverb_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXI3DL2Reverb_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#define IDirectSoundFXI3DL2Reverb_SetPreset(p,a) (p)->lpVtbl->SetPreset(p,a) +#define IDirectSoundFXI3DL2Reverb_GetPreset(p,a) (p)->lpVtbl->GetPreset(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXI3DL2Reverb_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXI3DL2Reverb_GetAllParameters(p,a) (p)->GetAllParameters(a) +#define IDirectSoundFXI3DL2Reverb_SetPreset(p,a) (p)->SetPreset(a) +#define IDirectSoundFXI3DL2Reverb_GetPreset(p,a) (p)->GetPreset(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXWavesReverb +// + +DEFINE_GUID(IID_IDirectSoundFXWavesReverb,0x46858c3a,0x0dc6,0x45e3,0xb7,0x60,0xd4,0xee,0xf1,0x6c,0xb3,0x25); + +typedef struct _DSFXWavesReverb +{ + FLOAT fInGain; // [-96.0,0.0] default: 0.0 dB + FLOAT fReverbMix; // [-96.0,0.0] default: 0.0 db + FLOAT fReverbTime; // [0.001,3000.0] default: 1000.0 ms + FLOAT fHighFreqRTRatio; // [0.001,0.999] default: 0.001 +} DSFXWavesReverb, *LPDSFXWavesReverb; + +typedef const DSFXWavesReverb *LPCDSFXWavesReverb; + +#define DSFX_WAVESREVERB_INGAIN_MIN -96.0f +#define DSFX_WAVESREVERB_INGAIN_MAX 0.0f +#define DSFX_WAVESREVERB_INGAIN_DEFAULT 0.0f +#define DSFX_WAVESREVERB_REVERBMIX_MIN -96.0f +#define DSFX_WAVESREVERB_REVERBMIX_MAX 0.0f +#define DSFX_WAVESREVERB_REVERBMIX_DEFAULT 0.0f +#define DSFX_WAVESREVERB_REVERBTIME_MIN 0.001f +#define DSFX_WAVESREVERB_REVERBTIME_MAX 3000.0f +#define DSFX_WAVESREVERB_REVERBTIME_DEFAULT 1000.0f +#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_MIN 0.001f +#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_MAX 0.999f +#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_DEFAULT 0.001f + +#undef INTERFACE +#define INTERFACE IDirectSoundFXWavesReverb + +DECLARE_INTERFACE_(IDirectSoundFXWavesReverb, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXWavesReverb methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXWavesReverb pcDsFxWavesReverb) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXWavesReverb pDsFxWavesReverb) PURE; +}; + +#define IDirectSoundFXWavesReverb_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXWavesReverb_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXWavesReverb_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXWavesReverb_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXWavesReverb_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXWavesReverb_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXWavesReverb_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundCaptureFXAec +// + +DEFINE_GUID(IID_IDirectSoundCaptureFXAec, 0xad74143d, 0x903d, 0x4ab7, 0x80, 0x66, 0x28, 0xd3, 0x63, 0x03, 0x6d, 0x65); + +typedef struct _DSCFXAec +{ + BOOL fEnable; + BOOL fNoiseFill; + DWORD dwMode; +} DSCFXAec, *LPDSCFXAec; + +typedef const DSCFXAec *LPCDSCFXAec; + +// These match the AEC_MODE_* constants in the DDK's ksmedia.h file +#define DSCFX_AEC_MODE_PASS_THROUGH 0x0 +#define DSCFX_AEC_MODE_HALF_DUPLEX 0x1 +#define DSCFX_AEC_MODE_FULL_DUPLEX 0x2 + +// These match the AEC_STATUS_* constants in ksmedia.h +#define DSCFX_AEC_STATUS_HISTORY_UNINITIALIZED 0x0 +#define DSCFX_AEC_STATUS_HISTORY_CONTINUOUSLY_CONVERGED 0x1 +#define DSCFX_AEC_STATUS_HISTORY_PREVIOUSLY_DIVERGED 0x2 +#define DSCFX_AEC_STATUS_CURRENTLY_CONVERGED 0x8 + +#undef INTERFACE +#define INTERFACE IDirectSoundCaptureFXAec + +DECLARE_INTERFACE_(IDirectSoundCaptureFXAec, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCaptureFXAec methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSCFXAec pDscFxAec) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSCFXAec pDscFxAec) PURE; + STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; + STDMETHOD(Reset) (THIS) PURE; +}; + +#define IDirectSoundCaptureFXAec_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCaptureFXAec_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCaptureFXAec_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureFXAec_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundCaptureFXAec_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureFXAec_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundCaptureFXAec_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + + +// +// IDirectSoundCaptureFXNoiseSuppress +// + +DEFINE_GUID(IID_IDirectSoundCaptureFXNoiseSuppress, 0xed311e41, 0xfbae, 0x4175, 0x96, 0x25, 0xcd, 0x8, 0x54, 0xf6, 0x93, 0xca); + +typedef struct _DSCFXNoiseSuppress +{ + BOOL fEnable; +} DSCFXNoiseSuppress, *LPDSCFXNoiseSuppress; + +typedef const DSCFXNoiseSuppress *LPCDSCFXNoiseSuppress; + +#undef INTERFACE +#define INTERFACE IDirectSoundCaptureFXNoiseSuppress + +DECLARE_INTERFACE_(IDirectSoundCaptureFXNoiseSuppress, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCaptureFXNoiseSuppress methods + STDMETHOD(SetAllParameters) (THIS_ __in LPCDSCFXNoiseSuppress pcDscFxNoiseSuppress) PURE; + STDMETHOD(GetAllParameters) (THIS_ __out LPDSCFXNoiseSuppress pDscFxNoiseSuppress) PURE; + STDMETHOD(Reset) (THIS) PURE; +}; + +#define IDirectSoundCaptureFXNoiseSuppress_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCaptureFXNoiseSuppress_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCaptureFXNoiseSuppress_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureFXNoiseSuppress_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundCaptureFXNoiseSuppress_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureFXNoiseSuppress_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundCaptureFXNoiseSuppress_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + + +// +// IDirectSoundFullDuplex +// + +#ifndef _IDirectSoundFullDuplex_ +#define _IDirectSoundFullDuplex_ + +#ifdef __cplusplus +// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined +struct IDirectSoundFullDuplex; +#endif // __cplusplus + +typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX; + +DEFINE_GUID(IID_IDirectSoundFullDuplex, 0xedcb4c7a, 0xdaab, 0x4216, 0xa4, 0x2e, 0x6c, 0x50, 0x59, 0x6d, 0xdc, 0x1d); + +#undef INTERFACE +#define INTERFACE IDirectSoundFullDuplex + +DECLARE_INTERFACE_(IDirectSoundFullDuplex, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFullDuplex methods + STDMETHOD(Initialize) (THIS_ __in LPCGUID pCaptureGuid, __in LPCGUID pRenderGuid, __in LPCDSCBUFFERDESC lpDscBufferDesc, __in LPCDSBUFFERDESC lpDsBufferDesc, HWND hWnd, DWORD dwLevel, + __deref_out LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8, __deref_out LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8) PURE; +}; + +#define IDirectSoundFullDuplex_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFullDuplex_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFullDuplex_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->Initialize(p,a,b,c,d,e,f,g,h) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h) (p)->Initialize(a,b,c,d,e,f,g,h) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // _IDirectSoundFullDuplex_ + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// Return Codes +// + +// The function completed successfully +#define DS_OK S_OK + +// The call succeeded, but we had to substitute the 3D algorithm +#define DS_NO_VIRTUALIZATION MAKE_HRESULT(0, _FACDS, 10) + +// The call failed because resources (such as a priority level) +// were already being used by another caller +#define DSERR_ALLOCATED MAKE_DSHRESULT(10) + +// The control (vol, pan, etc.) requested by the caller is not available +#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30) + +// An invalid parameter was passed to the returning function +#define DSERR_INVALIDPARAM E_INVALIDARG + +// This call is not valid for the current state of this object +#define DSERR_INVALIDCALL MAKE_DSHRESULT(50) + +// An undetermined error occurred inside the DirectSound subsystem +#define DSERR_GENERIC E_FAIL + +// The caller does not have the priority level required for the function to +// succeed +#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70) + +// Not enough free memory is available to complete the operation +#define DSERR_OUTOFMEMORY E_OUTOFMEMORY + +// The specified WAVE format is not supported +#define DSERR_BADFORMAT MAKE_DSHRESULT(100) + +// The function called is not supported at this time +#define DSERR_UNSUPPORTED E_NOTIMPL + +// No sound driver is available for use +#define DSERR_NODRIVER MAKE_DSHRESULT(120) + +// This object is already initialized +#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130) + +// This object does not support aggregation +#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION + +// The buffer memory has been lost, and must be restored +#define DSERR_BUFFERLOST MAKE_DSHRESULT(150) + +// Another app has a higher priority level, preventing this call from +// succeeding +#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160) + +// This object has not been initialized +#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170) + +// The requested COM interface is not available +#define DSERR_NOINTERFACE E_NOINTERFACE + +// Access is denied +#define DSERR_ACCESSDENIED E_ACCESSDENIED + +// Tried to create a DSBCAPS_CTRLFX buffer shorter than DSBSIZE_FX_MIN milliseconds +#define DSERR_BUFFERTOOSMALL MAKE_DSHRESULT(180) + +// Attempt to use DirectSound 8 functionality on an older DirectSound object +#define DSERR_DS8_REQUIRED MAKE_DSHRESULT(190) + +// A circular loop of send effects was detected +#define DSERR_SENDLOOP MAKE_DSHRESULT(200) + +// The GUID specified in an audiopath file does not match a valid MIXIN buffer +#define DSERR_BADSENDBUFFERGUID MAKE_DSHRESULT(210) + +// The object requested was not found (numerically equal to DMUS_E_NOT_FOUND) +#define DSERR_OBJECTNOTFOUND MAKE_DSHRESULT(4449) + +// The effects requested could not be found on the system, or they were found +// but in the wrong order, or in the wrong hardware/software locations. +#define DSERR_FXUNAVAILABLE MAKE_DSHRESULT(220) + +// +// Flags +// + +#define DSCAPS_PRIMARYMONO 0x00000001 +#define DSCAPS_PRIMARYSTEREO 0x00000002 +#define DSCAPS_PRIMARY8BIT 0x00000004 +#define DSCAPS_PRIMARY16BIT 0x00000008 +#define DSCAPS_CONTINUOUSRATE 0x00000010 +#define DSCAPS_EMULDRIVER 0x00000020 +#define DSCAPS_CERTIFIED 0x00000040 +#define DSCAPS_SECONDARYMONO 0x00000100 +#define DSCAPS_SECONDARYSTEREO 0x00000200 +#define DSCAPS_SECONDARY8BIT 0x00000400 +#define DSCAPS_SECONDARY16BIT 0x00000800 + +#define DSSCL_NORMAL 0x00000001 +#define DSSCL_PRIORITY 0x00000002 +#define DSSCL_EXCLUSIVE 0x00000003 +#define DSSCL_WRITEPRIMARY 0x00000004 + +#define DSSPEAKER_DIRECTOUT 0x00000000 +#define DSSPEAKER_HEADPHONE 0x00000001 +#define DSSPEAKER_MONO 0x00000002 +#define DSSPEAKER_QUAD 0x00000003 +#define DSSPEAKER_STEREO 0x00000004 +#define DSSPEAKER_SURROUND 0x00000005 +#define DSSPEAKER_5POINT1 0x00000006 // obsolete 5.1 setting +#define DSSPEAKER_7POINT1 0x00000007 // obsolete 7.1 setting +#define DSSPEAKER_7POINT1_SURROUND 0x00000008 // correct 7.1 Home Theater setting +#define DSSPEAKER_5POINT1_SURROUND 0x00000009 // correct 5.1 setting +#define DSSPEAKER_7POINT1_WIDE DSSPEAKER_7POINT1 +#define DSSPEAKER_5POINT1_BACK DSSPEAKER_5POINT1 + +#define DSSPEAKER_GEOMETRY_MIN 0x00000005 // 5 degrees +#define DSSPEAKER_GEOMETRY_NARROW 0x0000000A // 10 degrees +#define DSSPEAKER_GEOMETRY_WIDE 0x00000014 // 20 degrees +#define DSSPEAKER_GEOMETRY_MAX 0x000000B4 // 180 degrees + +#define DSSPEAKER_COMBINED(c, g) ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16)) +#define DSSPEAKER_CONFIG(a) ((BYTE)(a)) +#define DSSPEAKER_GEOMETRY(a) ((BYTE)(((DWORD)(a) >> 16) & 0x00FF)) + +#define DSBCAPS_PRIMARYBUFFER 0x00000001 +#define DSBCAPS_STATIC 0x00000002 +#define DSBCAPS_LOCHARDWARE 0x00000004 +#define DSBCAPS_LOCSOFTWARE 0x00000008 +#define DSBCAPS_CTRL3D 0x00000010 +#define DSBCAPS_CTRLFREQUENCY 0x00000020 +#define DSBCAPS_CTRLPAN 0x00000040 +#define DSBCAPS_CTRLVOLUME 0x00000080 +#define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100 +#define DSBCAPS_CTRLFX 0x00000200 +#define DSBCAPS_STICKYFOCUS 0x00004000 +#define DSBCAPS_GLOBALFOCUS 0x00008000 +#define DSBCAPS_GETCURRENTPOSITION2 0x00010000 +#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000 +#define DSBCAPS_LOCDEFER 0x00040000 +#define DSBCAPS_TRUEPLAYPOSITION 0x00080000 + +#define DSBPLAY_LOOPING 0x00000001 +#define DSBPLAY_LOCHARDWARE 0x00000002 +#define DSBPLAY_LOCSOFTWARE 0x00000004 +#define DSBPLAY_TERMINATEBY_TIME 0x00000008 +#define DSBPLAY_TERMINATEBY_DISTANCE 0x000000010 +#define DSBPLAY_TERMINATEBY_PRIORITY 0x000000020 + +#define DSBSTATUS_PLAYING 0x00000001 +#define DSBSTATUS_BUFFERLOST 0x00000002 +#define DSBSTATUS_LOOPING 0x00000004 +#define DSBSTATUS_LOCHARDWARE 0x00000008 +#define DSBSTATUS_LOCSOFTWARE 0x00000010 +#define DSBSTATUS_TERMINATED 0x00000020 + +#define DSBLOCK_FROMWRITECURSOR 0x00000001 +#define DSBLOCK_ENTIREBUFFER 0x00000002 + +#define DSBFREQUENCY_ORIGINAL 0 +#define DSBFREQUENCY_MIN 100 +#if DIRECTSOUND_VERSION >= 0x0900 +#define DSBFREQUENCY_MAX 200000 +#else +#define DSBFREQUENCY_MAX 100000 +#endif + +#define DSBPAN_LEFT -10000 +#define DSBPAN_CENTER 0 +#define DSBPAN_RIGHT 10000 + +#define DSBVOLUME_MIN -10000 +#define DSBVOLUME_MAX 0 + +#define DSBSIZE_MIN 4 +#define DSBSIZE_MAX 0x0FFFFFFF +#define DSBSIZE_FX_MIN 150 // NOTE: Milliseconds, not bytes + +#define DSBNOTIFICATIONS_MAX 100000UL + +#define DS3DMODE_NORMAL 0x00000000 +#define DS3DMODE_HEADRELATIVE 0x00000001 +#define DS3DMODE_DISABLE 0x00000002 + +#define DS3D_IMMEDIATE 0x00000000 +#define DS3D_DEFERRED 0x00000001 + +#define DS3D_MINDISTANCEFACTOR FLT_MIN +#define DS3D_MAXDISTANCEFACTOR FLT_MAX +#define DS3D_DEFAULTDISTANCEFACTOR 1.0f + +#define DS3D_MINROLLOFFFACTOR 0.0f +#define DS3D_MAXROLLOFFFACTOR 10.0f +#define DS3D_DEFAULTROLLOFFFACTOR 1.0f + +#define DS3D_MINDOPPLERFACTOR 0.0f +#define DS3D_MAXDOPPLERFACTOR 10.0f +#define DS3D_DEFAULTDOPPLERFACTOR 1.0f + +#define DS3D_DEFAULTMINDISTANCE 1.0f +#define DS3D_DEFAULTMAXDISTANCE 1000000000.0f + +#define DS3D_MINCONEANGLE 0 +#define DS3D_MAXCONEANGLE 360 +#define DS3D_DEFAULTCONEANGLE 360 + +#define DS3D_DEFAULTCONEOUTSIDEVOLUME DSBVOLUME_MAX + +// IDirectSoundCapture attributes + +#define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER +#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED +#define DSCCAPS_MULTIPLECAPTURE 0x00000001 + +// IDirectSoundCaptureBuffer attributes + +#define DSCBCAPS_WAVEMAPPED 0x80000000 +#if DIRECTSOUND_VERSION >= 0x0800 +#define DSCBCAPS_CTRLFX 0x00000200 +#endif + +#define DSCBLOCK_ENTIREBUFFER 0x00000001 + +#define DSCBSTATUS_CAPTURING 0x00000001 +#define DSCBSTATUS_LOOPING 0x00000002 + +#define DSCBSTART_LOOPING 0x00000001 + +#define DSBPN_OFFSETSTOP 0xFFFFFFFF + +#define DS_CERTIFIED 0x00000000 +#define DS_UNCERTIFIED 0x00000001 + +// +// Flags for the I3DL2 effects +// + +// +// I3DL2 Material Presets +// + +enum +{ + DSFX_I3DL2_MATERIAL_PRESET_SINGLEWINDOW, + DSFX_I3DL2_MATERIAL_PRESET_DOUBLEWINDOW, + DSFX_I3DL2_MATERIAL_PRESET_THINDOOR, + DSFX_I3DL2_MATERIAL_PRESET_THICKDOOR, + DSFX_I3DL2_MATERIAL_PRESET_WOODWALL, + DSFX_I3DL2_MATERIAL_PRESET_BRICKWALL, + DSFX_I3DL2_MATERIAL_PRESET_STONEWALL, + DSFX_I3DL2_MATERIAL_PRESET_CURTAIN +}; + +#define I3DL2_MATERIAL_PRESET_SINGLEWINDOW -2800,0.71f +#define I3DL2_MATERIAL_PRESET_DOUBLEWINDOW -5000,0.40f +#define I3DL2_MATERIAL_PRESET_THINDOOR -1800,0.66f +#define I3DL2_MATERIAL_PRESET_THICKDOOR -4400,0.64f +#define I3DL2_MATERIAL_PRESET_WOODWALL -4000,0.50f +#define I3DL2_MATERIAL_PRESET_BRICKWALL -5000,0.60f +#define I3DL2_MATERIAL_PRESET_STONEWALL -6000,0.68f +#define I3DL2_MATERIAL_PRESET_CURTAIN -1200,0.15f + +enum +{ + DSFX_I3DL2_ENVIRONMENT_PRESET_DEFAULT, + DSFX_I3DL2_ENVIRONMENT_PRESET_GENERIC, + DSFX_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL, + DSFX_I3DL2_ENVIRONMENT_PRESET_ROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_BATHROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_STONEROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM, + DSFX_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL, + DSFX_I3DL2_ENVIRONMENT_PRESET_CAVE, + DSFX_I3DL2_ENVIRONMENT_PRESET_ARENA, + DSFX_I3DL2_ENVIRONMENT_PRESET_HANGAR, + DSFX_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY, + DSFX_I3DL2_ENVIRONMENT_PRESET_HALLWAY, + DSFX_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR, + DSFX_I3DL2_ENVIRONMENT_PRESET_ALLEY, + DSFX_I3DL2_ENVIRONMENT_PRESET_FOREST, + DSFX_I3DL2_ENVIRONMENT_PRESET_CITY, + DSFX_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS, + DSFX_I3DL2_ENVIRONMENT_PRESET_QUARRY, + DSFX_I3DL2_ENVIRONMENT_PRESET_PLAIN, + DSFX_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT, + DSFX_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE, + DSFX_I3DL2_ENVIRONMENT_PRESET_UNDERWATER, + DSFX_I3DL2_ENVIRONMENT_PRESET_SMALLROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL, + DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEHALL, + DSFX_I3DL2_ENVIRONMENT_PRESET_PLATE +}; + +// +// I3DL2 Reverberation Presets Values +// + +#define I3DL2_ENVIRONMENT_PRESET_DEFAULT -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f, 200, 0.011f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_GENERIC -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f, 200, 0.011f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_PADDEDCELL -1000,-6000, 0.0f, 0.17f, 0.10f, -1204, 0.001f, 207, 0.002f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_ROOM -1000, -454, 0.0f, 0.40f, 0.83f, -1646, 0.002f, 53, 0.003f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_BATHROOM -1000,-1200, 0.0f, 1.49f, 0.54f, -370, 0.007f, 1030, 0.011f, 100.0f, 60.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_LIVINGROOM -1000,-6000, 0.0f, 0.50f, 0.10f, -1376, 0.003f, -1104, 0.004f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_STONEROOM -1000, -300, 0.0f, 2.31f, 0.64f, -711, 0.012f, 83, 0.017f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_AUDITORIUM -1000, -476, 0.0f, 4.32f, 0.59f, -789, 0.020f, -289, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_CONCERTHALL -1000, -500, 0.0f, 3.92f, 0.70f, -1230, 0.020f, -2, 0.029f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_CAVE -1000, 0, 0.0f, 2.91f, 1.30f, -602, 0.015f, -302, 0.022f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_ARENA -1000, -698, 0.0f, 7.24f, 0.33f, -1166, 0.020f, 16, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_HANGAR -1000,-1000, 0.0f,10.05f, 0.23f, -602, 0.020f, 198, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY -1000,-4000, 0.0f, 0.30f, 0.10f, -1831, 0.002f, -1630, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_HALLWAY -1000, -300, 0.0f, 1.49f, 0.59f, -1219, 0.007f, 441, 0.011f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR -1000, -237, 0.0f, 2.70f, 0.79f, -1214, 0.013f, 395, 0.020f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_ALLEY -1000, -270, 0.0f, 1.49f, 0.86f, -1204, 0.007f, -4, 0.011f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_FOREST -1000,-3300, 0.0f, 1.49f, 0.54f, -2560, 0.162f, -613, 0.088f, 79.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_CITY -1000, -800, 0.0f, 1.49f, 0.67f, -2273, 0.007f, -2217, 0.011f, 50.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_MOUNTAINS -1000,-2500, 0.0f, 1.49f, 0.21f, -2780, 0.300f, -2014, 0.100f, 27.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_QUARRY -1000,-1000, 0.0f, 1.49f, 0.83f,-10000, 0.061f, 500, 0.025f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_PLAIN -1000,-2000, 0.0f, 1.49f, 0.50f, -2466, 0.179f, -2514, 0.100f, 21.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_PARKINGLOT -1000, 0, 0.0f, 1.65f, 1.50f, -1363, 0.008f, -1153, 0.012f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_SEWERPIPE -1000,-1000, 0.0f, 2.81f, 0.14f, 429, 0.014f, 648, 0.021f, 80.0f, 60.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_UNDERWATER -1000,-4000, 0.0f, 1.49f, 0.10f, -449, 0.007f, 1700, 0.011f, 100.0f, 100.0f, 5000.0f + +// +// Examples simulating 'musical' reverb presets +// +// Name Decay time Description +// Small Room 1.1s A small size room with a length of 5m or so. +// Medium Room 1.3s A medium size room with a length of 10m or so. +// Large Room 1.5s A large size room suitable for live performances. +// Medium Hall 1.8s A medium size concert hall. +// Large Hall 1.8s A large size concert hall suitable for a full orchestra. +// Plate 1.3s A plate reverb simulation. +// + +#define I3DL2_ENVIRONMENT_PRESET_SMALLROOM -1000, -600, 0.0f, 1.10f, 0.83f, -400, 0.005f, 500, 0.010f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM -1000, -600, 0.0f, 1.30f, 0.83f, -1000, 0.010f, -200, 0.020f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_LARGEROOM -1000, -600, 0.0f, 1.50f, 0.83f, -1600, 0.020f, -1000, 0.040f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL -1000, -600, 0.0f, 1.80f, 0.70f, -1300, 0.015f, -800, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_LARGEHALL -1000, -600, 0.0f, 1.80f, 0.70f, -2000, 0.030f, -1400, 0.060f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_PLATE -1000, -200, 0.0f, 1.30f, 0.90f, 0, 0.002f, 0, 0.010f, 100.0f, 75.0f, 5000.0f + +// +// DirectSound3D Algorithms +// + +// Default DirectSound3D algorithm {00000000-0000-0000-0000-000000000000} +#define DS3DALG_DEFAULT GUID_NULL + +// No virtualization (Pan3D) {C241333F-1C1B-11d2-94F5-00C04FC28ACA} +DEFINE_GUID(DS3DALG_NO_VIRTUALIZATION, 0xc241333f, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); + +// High-quality HRTF algorithm {C2413340-1C1B-11d2-94F5-00C04FC28ACA} +DEFINE_GUID(DS3DALG_HRTF_FULL, 0xc2413340, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); + +// Lower-quality HRTF algorithm {C2413342-1C1B-11d2-94F5-00C04FC28ACA} +DEFINE_GUID(DS3DALG_HRTF_LIGHT, 0xc2413342, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); + + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// DirectSound Internal Effect Algorithms +// + + +// Gargle {DAFD8210-5711-4B91-9FE3-F75B7AE279BF} +DEFINE_GUID(GUID_DSFX_STANDARD_GARGLE, 0xdafd8210, 0x5711, 0x4b91, 0x9f, 0xe3, 0xf7, 0x5b, 0x7a, 0xe2, 0x79, 0xbf); + +// Chorus {EFE6629C-81F7-4281-BD91-C9D604A95AF6} +DEFINE_GUID(GUID_DSFX_STANDARD_CHORUS, 0xefe6629c, 0x81f7, 0x4281, 0xbd, 0x91, 0xc9, 0xd6, 0x04, 0xa9, 0x5a, 0xf6); + +// Flanger {EFCA3D92-DFD8-4672-A603-7420894BAD98} +DEFINE_GUID(GUID_DSFX_STANDARD_FLANGER, 0xefca3d92, 0xdfd8, 0x4672, 0xa6, 0x03, 0x74, 0x20, 0x89, 0x4b, 0xad, 0x98); + +// Echo/Delay {EF3E932C-D40B-4F51-8CCF-3F98F1B29D5D} +DEFINE_GUID(GUID_DSFX_STANDARD_ECHO, 0xef3e932c, 0xd40b, 0x4f51, 0x8c, 0xcf, 0x3f, 0x98, 0xf1, 0xb2, 0x9d, 0x5d); + +// Distortion {EF114C90-CD1D-484E-96E5-09CFAF912A21} +DEFINE_GUID(GUID_DSFX_STANDARD_DISTORTION, 0xef114c90, 0xcd1d, 0x484e, 0x96, 0xe5, 0x09, 0xcf, 0xaf, 0x91, 0x2a, 0x21); + +// Compressor/Limiter {EF011F79-4000-406D-87AF-BFFB3FC39D57} +DEFINE_GUID(GUID_DSFX_STANDARD_COMPRESSOR, 0xef011f79, 0x4000, 0x406d, 0x87, 0xaf, 0xbf, 0xfb, 0x3f, 0xc3, 0x9d, 0x57); + +// Parametric Equalization {120CED89-3BF4-4173-A132-3CB406CF3231} +DEFINE_GUID(GUID_DSFX_STANDARD_PARAMEQ, 0x120ced89, 0x3bf4, 0x4173, 0xa1, 0x32, 0x3c, 0xb4, 0x06, 0xcf, 0x32, 0x31); + +// I3DL2 Environmental Reverberation: Reverb (Listener) Effect {EF985E71-D5C7-42D4-BA4D-2D073E2E96F4} +DEFINE_GUID(GUID_DSFX_STANDARD_I3DL2REVERB, 0xef985e71, 0xd5c7, 0x42d4, 0xba, 0x4d, 0x2d, 0x07, 0x3e, 0x2e, 0x96, 0xf4); + +// Waves Reverberation {87FC0268-9A55-4360-95AA-004A1D9DE26C} +DEFINE_GUID(GUID_DSFX_WAVES_REVERB, 0x87fc0268, 0x9a55, 0x4360, 0x95, 0xaa, 0x00, 0x4a, 0x1d, 0x9d, 0xe2, 0x6c); + +// +// DirectSound Capture Effect Algorithms +// + + +// Acoustic Echo Canceller {BF963D80-C559-11D0-8A2B-00A0C9255AC1} +// Matches KSNODETYPE_ACOUSTIC_ECHO_CANCEL in ksmedia.h +DEFINE_GUID(GUID_DSCFX_CLASS_AEC, 0xBF963D80L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1); + +// Microsoft AEC {CDEBB919-379A-488a-8765-F53CFD36DE40} +DEFINE_GUID(GUID_DSCFX_MS_AEC, 0xcdebb919, 0x379a, 0x488a, 0x87, 0x65, 0xf5, 0x3c, 0xfd, 0x36, 0xde, 0x40); + +// System AEC {1C22C56D-9879-4f5b-A389-27996DDC2810} +DEFINE_GUID(GUID_DSCFX_SYSTEM_AEC, 0x1c22c56d, 0x9879, 0x4f5b, 0xa3, 0x89, 0x27, 0x99, 0x6d, 0xdc, 0x28, 0x10); + +// Noise Supression {E07F903F-62FD-4e60-8CDD-DEA7236665B5} +// Matches KSNODETYPE_NOISE_SUPPRESS in post Windows ME DDK's ksmedia.h +DEFINE_GUID(GUID_DSCFX_CLASS_NS, 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5); + +// Microsoft Noise Suppresion {11C5C73B-66E9-4ba1-A0BA-E814C6EED92D} +DEFINE_GUID(GUID_DSCFX_MS_NS, 0x11c5c73b, 0x66e9, 0x4ba1, 0xa0, 0xba, 0xe8, 0x14, 0xc6, 0xee, 0xd9, 0x2d); + +// System Noise Suppresion {5AB0882E-7274-4516-877D-4EEE99BA4FD0} +DEFINE_GUID(GUID_DSCFX_SYSTEM_NS, 0x5ab0882e, 0x7274, 0x4516, 0x87, 0x7d, 0x4e, 0xee, 0x99, 0xba, 0x4f, 0xd0); + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +#endif // __DSOUND_INCLUDED__ + + + +#ifdef __cplusplus +}; +#endif // __cplusplus + diff --git a/Src/Decoder_H264_ALL/D3D/include/dvoice.h b/Src/Decoder_H264_ALL/D3D/include/dvoice.h new file mode 100644 index 0000000..000ac51 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dvoice.h @@ -0,0 +1,857 @@ +/*==========================================================================; + * + * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved. + * + * File: dpvoice.h + * Content: DirectPlayVoice include file + ***************************************************************************/ + +#ifndef __DVOICE__ +#define __DVOICE__ + +#include // for DECLARE_INTERFACE and HRESULT +#include +#include +#include +#include "dsound.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/**************************************************************************** + * + * DirectPlayVoice CLSIDs + * + ****************************************************************************/ + + +// {B9F3EB85-B781-4ac1-8D90-93A05EE37D7D} +DEFINE_GUID(CLSID_DirectPlayVoiceClient, +0xb9f3eb85, 0xb781, 0x4ac1, 0x8d, 0x90, 0x93, 0xa0, 0x5e, 0xe3, 0x7d, 0x7d); + +// {D3F5B8E6-9B78-4a4c-94EA-CA2397B663D3} +DEFINE_GUID(CLSID_DirectPlayVoiceServer, +0xd3f5b8e6, 0x9b78, 0x4a4c, 0x94, 0xea, 0xca, 0x23, 0x97, 0xb6, 0x63, 0xd3); + +// {0F0F094B-B01C-4091-A14D-DD0CD807711A} +DEFINE_GUID(CLSID_DirectPlayVoiceTest, +0xf0f094b, 0xb01c, 0x4091, 0xa1, 0x4d, 0xdd, 0xc, 0xd8, 0x7, 0x71, 0x1a); + +/**************************************************************************** + * + * DirectPlayVoice Interface IIDs + * + ****************************************************************************/ + + +// {1DFDC8EA-BCF7-41d6-B295-AB64B3B23306} +DEFINE_GUID(IID_IDirectPlayVoiceClient, +0x1dfdc8ea, 0xbcf7, 0x41d6, 0xb2, 0x95, 0xab, 0x64, 0xb3, 0xb2, 0x33, 0x6); + +// {FAA1C173-0468-43b6-8A2A-EA8A4F2076C9} +DEFINE_GUID(IID_IDirectPlayVoiceServer, +0xfaa1c173, 0x468, 0x43b6, 0x8a, 0x2a, 0xea, 0x8a, 0x4f, 0x20, 0x76, 0xc9); + +// {D26AF734-208B-41da-8224-E0CE79810BE1} +DEFINE_GUID(IID_IDirectPlayVoiceTest, +0xd26af734, 0x208b, 0x41da, 0x82, 0x24, 0xe0, 0xce, 0x79, 0x81, 0xb, 0xe1); + +/**************************************************************************** + * + * DirectPlayVoice Compression Type GUIDs + * + ****************************************************************************/ + +// MS-ADPCM 32.8 kbit/s +// +// {699B52C1-A885-46a8-A308-97172419ADC7} +DEFINE_GUID(DPVCTGUID_ADPCM, +0x699b52c1, 0xa885, 0x46a8, 0xa3, 0x8, 0x97, 0x17, 0x24, 0x19, 0xad, 0xc7); + +// Microsoft GSM 6.10 13 kbit/s +// +// {24768C60-5A0D-11d3-9BE4-525400D985E7} +DEFINE_GUID(DPVCTGUID_GSM, +0x24768c60, 0x5a0d, 0x11d3, 0x9b, 0xe4, 0x52, 0x54, 0x0, 0xd9, 0x85, 0xe7); + +// MS-PCM 64 kbit/s +// +// {8DE12FD4-7CB3-48ce-A7E8-9C47A22E8AC5} +DEFINE_GUID(DPVCTGUID_NONE, +0x8de12fd4, 0x7cb3, 0x48ce, 0xa7, 0xe8, 0x9c, 0x47, 0xa2, 0x2e, 0x8a, 0xc5); + +// Voxware SC03 3.2kbit/s +// +// {7D82A29B-2242-4f82-8F39-5D1153DF3E41} +DEFINE_GUID(DPVCTGUID_SC03, +0x7d82a29b, 0x2242, 0x4f82, 0x8f, 0x39, 0x5d, 0x11, 0x53, 0xdf, 0x3e, 0x41); + +// Voxware SC06 6.4kbit/s +// +// {53DEF900-7168-4633-B47F-D143916A13C7} +DEFINE_GUID(DPVCTGUID_SC06, +0x53def900, 0x7168, 0x4633, 0xb4, 0x7f, 0xd1, 0x43, 0x91, 0x6a, 0x13, 0xc7); + +// TrueSpeech(TM) 8.6 kbit/s +// +// {D7954361-5A0B-11d3-9BE4-525400D985E7} +DEFINE_GUID(DPVCTGUID_TRUESPEECH, +0xd7954361, 0x5a0b, 0x11d3, 0x9b, 0xe4, 0x52, 0x54, 0x0, 0xd9, 0x85, 0xe7); + +// Voxware VR12 1.4kbit/s +// +// {FE44A9FE-8ED4-48bf-9D66-1B1ADFF9FF6D} +DEFINE_GUID(DPVCTGUID_VR12, +0xfe44a9fe, 0x8ed4, 0x48bf, 0x9d, 0x66, 0x1b, 0x1a, 0xdf, 0xf9, 0xff, 0x6d); + +// Define the default compression type +#define DPVCTGUID_DEFAULT DPVCTGUID_SC03 + +/**************************************************************************** + * + * DirectPlayVoice Interface Pointer definitions + * + ****************************************************************************/ + +typedef struct IDirectPlayVoiceClient FAR *LPDIRECTPLAYVOICECLIENT, *PDIRECTPLAYVOICECLIENT; +typedef struct IDirectPlayVoiceServer FAR *LPDIRECTPLAYVOICESERVER, *PDIRECTPLAYVOICESERVER; +typedef struct IDirectPlayVoiceTest FAR *LPDIRECTPLAYVOICETEST, *PDIRECTPLAYVOICETEST; + +/**************************************************************************** + * + * DirectPlayVoice Callback Functions + * + ****************************************************************************/ +typedef HRESULT (FAR PASCAL *PDVMESSAGEHANDLER)( + PVOID pvUserContext, + DWORD dwMessageType, + LPVOID lpMessage +); + +typedef PDVMESSAGEHANDLER LPDVMESSAGEHANDLER; + +/**************************************************************************** + * + * DirectPlayVoice Datatypes (Non-Structure / Non-Message) + * + ****************************************************************************/ + +typedef DWORD DVID, *LPDVID, *PDVID; + +/**************************************************************************** + * + * DirectPlayVoice Message Types + * + ****************************************************************************/ + +#define DVMSGID_BASE 0x0000 + +#define DVMSGID_MINBASE (DVMSGID_CREATEVOICEPLAYER) +#define DVMSGID_CREATEVOICEPLAYER (DVMSGID_BASE+0x0001) +#define DVMSGID_DELETEVOICEPLAYER (DVMSGID_BASE+0x0002) +#define DVMSGID_SESSIONLOST (DVMSGID_BASE+0x0003) +#define DVMSGID_PLAYERVOICESTART (DVMSGID_BASE+0x0004) +#define DVMSGID_PLAYERVOICESTOP (DVMSGID_BASE+0x0005) +#define DVMSGID_RECORDSTART (DVMSGID_BASE+0x0006) +#define DVMSGID_RECORDSTOP (DVMSGID_BASE+0x0007) +#define DVMSGID_CONNECTRESULT (DVMSGID_BASE+0x0008) +#define DVMSGID_DISCONNECTRESULT (DVMSGID_BASE+0x0009) +#define DVMSGID_INPUTLEVEL (DVMSGID_BASE+0x000A) +#define DVMSGID_OUTPUTLEVEL (DVMSGID_BASE+0x000B) +#define DVMSGID_HOSTMIGRATED (DVMSGID_BASE+0x000C) +#define DVMSGID_SETTARGETS (DVMSGID_BASE+0x000D) +#define DVMSGID_PLAYEROUTPUTLEVEL (DVMSGID_BASE+0x000E) +#define DVMSGID_LOSTFOCUS (DVMSGID_BASE+0x0010) +#define DVMSGID_GAINFOCUS (DVMSGID_BASE+0x0011) +#define DVMSGID_LOCALHOSTSETUP (DVMSGID_BASE+0x0012) +#define DVMSGID_MAXBASE (DVMSGID_LOCALHOSTSETUP) + +/**************************************************************************** + * + * DirectPlayVoice Constants + * + ****************************************************************************/ + +// +// Buffer Aggresiveness Value Ranges +// +#define DVBUFFERAGGRESSIVENESS_MIN 0x00000001 +#define DVBUFFERAGGRESSIVENESS_MAX 0x00000064 +#define DVBUFFERAGGRESSIVENESS_DEFAULT 0x00000000 + +// +// Buffer Quality Value Ranges +// +#define DVBUFFERQUALITY_MIN 0x00000001 +#define DVBUFFERQUALITY_MAX 0x00000064 +#define DVBUFFERQUALITY_DEFAULT 0x00000000 + +#define DVID_SYS 0 + +// +// Used to identify the session host in client/server +// +#define DVID_SERVERPLAYER 1 + +// +// Used to target all players +// +#define DVID_ALLPLAYERS 0 + +// +// Used to identify the main buffer +// +#define DVID_REMAINING 0xFFFFFFFF + +// +// Input level range +// +#define DVINPUTLEVEL_MIN 0x00000000 +#define DVINPUTLEVEL_MAX 0x00000063 // 99 decimal + +#define DVNOTIFYPERIOD_MINPERIOD 20 + + +#define DVPLAYBACKVOLUME_DEFAULT DSBVOLUME_MAX + +#define DVRECORDVOLUME_LAST 0x00000001 + + +// +// Use the default value +// +#define DVTHRESHOLD_DEFAULT 0xFFFFFFFF + +// +// Threshold Ranges +// +#define DVTHRESHOLD_MIN 0x00000000 +#define DVTHRESHOLD_MAX 0x00000063 // 99 decimal + +// +// Threshold field is not used +// +#define DVTHRESHOLD_UNUSED 0xFFFFFFFE + +// +// Session Types +// +#define DVSESSIONTYPE_PEER 0x00000001 +#define DVSESSIONTYPE_MIXING 0x00000002 +#define DVSESSIONTYPE_FORWARDING 0x00000003 +#define DVSESSIONTYPE_ECHO 0x00000004 + +/**************************************************************************** + * + * DirectPlayVoice Flags + * + ****************************************************************************/ + + +// +// Enable automatic adjustment of the recording volume +// +#define DVCLIENTCONFIG_AUTORECORDVOLUME 0x00000008 + +// +// Enable automatic voice activation +// +#define DVCLIENTCONFIG_AUTOVOICEACTIVATED 0x00000020 + +// +// Enable echo suppression +// +#define DVCLIENTCONFIG_ECHOSUPPRESSION 0x08000000 + +// +// Voice Activation manual mode +// +#define DVCLIENTCONFIG_MANUALVOICEACTIVATED 0x00000004 + +// +// Only playback voices that have buffers created for them +// +#define DVCLIENTCONFIG_MUTEGLOBAL 0x00000010 + +// +// Mute the playback +// +#define DVCLIENTCONFIG_PLAYBACKMUTE 0x00000002 + +// +// Mute the recording +// +#define DVCLIENTCONFIG_RECORDMUTE 0x00000001 + +// +// Complete the operation before returning +// +#define DVFLAGS_SYNC 0x00000001 + +// +// Just check to see if wizard has been run, and if so what it's results were +// +#define DVFLAGS_QUERYONLY 0x00000002 + +// +// Shutdown the voice session without migrating the host +// +#define DVFLAGS_NOHOSTMIGRATE 0x00000008 + +// +// Allow the back button to be enabled in the wizard +// +#define DVFLAGS_ALLOWBACK 0x00000010 + +// +// Disable host migration in the voice session +// +#define DVSESSION_NOHOSTMIGRATION 0x00000001 + +// +// Server controlled targetting +// +#define DVSESSION_SERVERCONTROLTARGET 0x00000002 + +// +// Use DirectSound Normal Mode instead of priority +// +#define DVSOUNDCONFIG_NORMALMODE 0x00000001 + +// +// Automatically select the microphone +// +#define DVSOUNDCONFIG_AUTOSELECT 0x00000002 + +// +// Run in half duplex mode +// +#define DVSOUNDCONFIG_HALFDUPLEX 0x00000004 + +// +// No volume controls are available for the recording device +// +#define DVSOUNDCONFIG_NORECVOLAVAILABLE 0x00000010 + +// +// Disable capture sharing +// +#define DVSOUNDCONFIG_NOFOCUS 0x20000000 + +// +// Set system conversion quality to high +// +#define DVSOUNDCONFIG_SETCONVERSIONQUALITY 0x00000008 + +// +// Enable strict focus mode +// +#define DVSOUNDCONFIG_STRICTFOCUS 0x40000000 + +// +// Player is in half duplex mode +// +#define DVPLAYERCAPS_HALFDUPLEX 0x00000001 + +// +// Specifies that player is the local player +// +#define DVPLAYERCAPS_LOCAL 0x00000002 + +/**************************************************************************** + * + * DirectPlayVoice Structures (Non-Message) + * + ****************************************************************************/ + + +// +// DirectPlayVoice Caps +// (GetCaps / SetCaps) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DWORD dwFlags; // Caps flags +} DVCAPS, *LPDVCAPS, *PDVCAPS; + +// +// DirectPlayVoice Client Configuration +// (Connect / GetClientConfig) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DWORD dwFlags; // Flags for client config (DVCLIENTCONFIG_...) + LONG lRecordVolume; // Recording volume + LONG lPlaybackVolume; // Playback volume + DWORD dwThreshold; // Voice Activation Threshold + DWORD dwBufferQuality; // Buffer quality + DWORD dwBufferAggressiveness; // Buffer aggressiveness + DWORD dwNotifyPeriod; // Period of notification messages (ms) +} DVCLIENTCONFIG, *LPDVCLIENTCONFIG, *PDVCLIENTCONFIG; + +// +// DirectPlayVoice Compression Type Information +// (GetCompressionTypes) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + GUID guidType; // GUID that identifies this compression type + LPWSTR lpszName; // String name of this compression type + LPWSTR lpszDescription; // Description for this compression type + DWORD dwFlags; // Flags for this compression type + DWORD dwMaxBitsPerSecond; // Maximum # of bit/s this compression type uses +} DVCOMPRESSIONINFO, *LPDVCOMPRESSIONINFO, *PDVCOMPRESSIONINFO; + +// +// DirectPlayVoice Session Description +// (Host / GetSessionDesc) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DWORD dwFlags; // Session flags (DVSESSION_...) + DWORD dwSessionType; // Session type (DVSESSIONTYPE_...) + GUID guidCT; // Compression Type to use + DWORD dwBufferQuality; // Buffer quality + DWORD dwBufferAggressiveness; // Buffer aggresiveness +} DVSESSIONDESC, *LPDVSESSIONDESC, *PDVSESSIONDESC; + +// +// DirectPlayVoice Client Sound Device Configuration +// (Connect / GetSoundDeviceConfig) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DWORD dwFlags; // Flags for sound config (DVSOUNDCONFIG_...) + GUID guidPlaybackDevice; // GUID of the playback device to use + LPDIRECTSOUND lpdsPlaybackDevice; // DirectSound Object to use (optional) + GUID guidCaptureDevice; // GUID of the capture device to use + LPDIRECTSOUNDCAPTURE lpdsCaptureDevice; // DirectSoundCapture Object to use (optional) + HWND hwndAppWindow; // HWND of your application's top-level window + LPDIRECTSOUNDBUFFER lpdsMainBuffer; // DirectSoundBuffer to use for playback (optional) + DWORD dwMainBufferFlags; // Flags to pass to Play() on the main buffer + DWORD dwMainBufferPriority; // Priority to set when calling Play() on the main buffer +} DVSOUNDDEVICECONFIG, *LPDVSOUNDDEVICECONFIG, *PDVSOUNDDEVICECONFIG; + +/**************************************************************************** + * + * DirectPlayVoice message handler call back structures + * + ****************************************************************************/ + +// +// Result of the Connect() call. (If it wasn't called Async) +// (DVMSGID_CONNECTRESULT) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + HRESULT hrResult; // Result of the Connect() call +} DVMSG_CONNECTRESULT, *LPDVMSG_CONNECTRESULT, *PDVMSG_CONNECTRESULT; + +// +// A new player has entered the voice session +// (DVMSGID_CREATEVOICEPLAYER) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DVID dvidPlayer; // DVID of the player who joined + DWORD dwFlags; // Player flags (DVPLAYERCAPS_...) + PVOID pvPlayerContext; // Context value for this player (user set) +} DVMSG_CREATEVOICEPLAYER, *LPDVMSG_CREATEVOICEPLAYER, *PDVMSG_CREATEVOICEPLAYER; + +// +// A player has left the voice session +// (DVMSGID_DELETEVOICEPLAYER) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DVID dvidPlayer; // DVID of the player who left + PVOID pvPlayerContext; // Context value for the player +} DVMSG_DELETEVOICEPLAYER, *LPDVMSG_DELETEVOICEPLAYER, *PDVMSG_DELETEVOICEPLAYER; + +// +// Result of the Disconnect() call. (If it wasn't called Async) +// (DVMSGID_DISCONNECTRESULT) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + HRESULT hrResult; // Result of the Disconnect() call +} DVMSG_DISCONNECTRESULT, *LPDVMSG_DISCONNECTRESULT, *PDVMSG_DISCONNECTRESULT; + +// +// The voice session host has migrated. +// (DVMSGID_HOSTMIGRATED) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DVID dvidNewHostID; // DVID of the player who is now the host + LPDIRECTPLAYVOICESERVER pdvServerInterface; + // Pointer to the new host object (if local player is now host) +} DVMSG_HOSTMIGRATED, *LPDVMSG_HOSTMIGRATED, *PDVMSG_HOSTMIGRATED; + +// +// The current input level / recording volume on the local machine +// (DVMSGID_INPUTLEVEL) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DWORD dwPeakLevel; // Current peak level of the audio + LONG lRecordVolume; // Current recording volume + PVOID pvLocalPlayerContext; // Context value for the local player +} DVMSG_INPUTLEVEL, *LPDVMSG_INPUTLEVEL, *PDVMSG_INPUTLEVEL; + +// +// The local client is about to become the new host +// (DVMSGID_LOCALHOSTSETUP) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + PVOID pvContext; // Context value to be passed to Initialize() of new host object + PDVMESSAGEHANDLER pMessageHandler; // Message handler to be used by new host object +} DVMSG_LOCALHOSTSETUP, *LPDVMSG_LOCALHOSTSETUP, *PDVMSG_LOCALHOSTSETUP; + +// +// The current output level for the combined output of all incoming streams. +// (DVMSGID_OUTPUTLEVEL) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DWORD dwPeakLevel; // Current peak level of the output + LONG lOutputVolume; // Current playback volume + PVOID pvLocalPlayerContext; // Context value for the local player +} DVMSG_OUTPUTLEVEL, *LPDVMSG_OUTPUTLEVEL, *PDVMSG_OUTPUTLEVEL; + +// +// The current peak level of an individual player's incoming audio stream as it is +// being played back. +// (DVMSGID_PLAYEROUTPUTLEVEL) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DVID dvidSourcePlayerID; // DVID of the player + DWORD dwPeakLevel; // Peak level of the player's stream + PVOID pvPlayerContext; // Context value for the player +} DVMSG_PLAYEROUTPUTLEVEL, *LPDVMSG_PLAYEROUTPUTLEVEL, *PDVMSG_PLAYEROUTPUTLEVEL; + +// +// An audio stream from the specified player has started playing back on the local client. +// (DVMSGID_PLAYERVOICESTART). +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DVID dvidSourcePlayerID; // DVID of the Player + PVOID pvPlayerContext; // Context value for this player +} DVMSG_PLAYERVOICESTART, *LPDVMSG_PLAYERVOICESTART, *PDVMSG_PLAYERVOICESTART; + +// +// The audio stream from the specified player has stopped playing back on the local client. +// (DVMSGID_PLAYERVOICESTOP) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DVID dvidSourcePlayerID; // DVID of the player + PVOID pvPlayerContext; // Context value for this player +} DVMSG_PLAYERVOICESTOP, *LPDVMSG_PLAYERVOICESTOP, *PDVMSG_PLAYERVOICESTOP; + +// +// Transmission has started on the local machine +// (DVMSGID_RECORDSTART) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DWORD dwPeakLevel; // Peak level that caused transmission to start + PVOID pvLocalPlayerContext; // Context value for the local player +} DVMSG_RECORDSTART, *LPDVMSG_RECORDSTART, *PDVMSG_RECORDSTART; + +// +// Transmission has stopped on the local machine +// (DVMSGID_RECORDSTOP) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DWORD dwPeakLevel; // Peak level that caused transmission to stop + PVOID pvLocalPlayerContext; // Context value for the local player +} DVMSG_RECORDSTOP, *LPDVMSG_RECORDSTOP, *PDVMSG_RECORDSTOP; + +// +// The voice session has been lost +// (DVMSGID_SESSIONLOST) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + HRESULT hrResult; // Reason the session was disconnected +} DVMSG_SESSIONLOST, *LPDVMSG_SESSIONLOST, *PDVMSG_SESSIONLOST; + +// +// The target list has been updated for the local client +// (DVMSGID_SETTARGETS) +// +typedef struct +{ + DWORD dwSize; // Size of this structure + DWORD dwNumTargets; // # of targets + PDVID pdvidTargets; // An array of DVIDs specifying the current targets +} DVMSG_SETTARGETS, *LPDVMSG_SETTARGETS, *PDVMSG_SETTARGETS; + + +/**************************************************************************** + * + * DirectPlayVoice Functions + * + ****************************************************************************/ + +/* + * + * This function is no longer supported. It is recommended that CoCreateInstance be used to create + * DirectPlay voice objects. + * + * extern HRESULT WINAPI DirectPlayVoiceCreate( const GUID * pcIID, void **ppvInterface, IUnknown *pUnknown); + * + */ + +/**************************************************************************** + * + * DirectPlay8 Application Interfaces + * + ****************************************************************************/ + +#undef INTERFACE +#define INTERFACE IDirectPlayVoiceClient +DECLARE_INTERFACE_( IDirectPlayVoiceClient, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, PVOID *ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IDirectPlayVoiceClient methods ***/ + STDMETHOD_(HRESULT, Initialize) (THIS_ LPUNKNOWN, PDVMESSAGEHANDLER, PVOID, PDWORD, DWORD ) PURE; + STDMETHOD_(HRESULT, Connect) (THIS_ PDVSOUNDDEVICECONFIG, PDVCLIENTCONFIG, DWORD ) PURE; + STDMETHOD_(HRESULT, Disconnect) (THIS_ DWORD ) PURE; + STDMETHOD_(HRESULT, GetSessionDesc)(THIS_ PDVSESSIONDESC ) PURE; + STDMETHOD_(HRESULT, GetClientConfig)(THIS_ PDVCLIENTCONFIG ) PURE; + STDMETHOD_(HRESULT, SetClientConfig)(THIS_ PDVCLIENTCONFIG ) PURE; + STDMETHOD_(HRESULT, GetCaps) (THIS_ PDVCAPS ) PURE; + STDMETHOD_(HRESULT, GetCompressionTypes)( THIS_ PVOID, PDWORD, PDWORD, DWORD ) PURE; + STDMETHOD_(HRESULT, SetTransmitTargets)( THIS_ PDVID, DWORD, DWORD ) PURE; + STDMETHOD_(HRESULT, GetTransmitTargets)( THIS_ PDVID, PDWORD, DWORD ) PURE; + STDMETHOD_(HRESULT, Create3DSoundBuffer)( THIS_ DVID, LPDIRECTSOUNDBUFFER, DWORD, DWORD, LPDIRECTSOUND3DBUFFER * ) PURE; + STDMETHOD_(HRESULT, Delete3DSoundBuffer)( THIS_ DVID, LPDIRECTSOUND3DBUFFER * ) PURE; + STDMETHOD_(HRESULT, SetNotifyMask)( THIS_ PDWORD, DWORD ) PURE; + STDMETHOD_(HRESULT, GetSoundDeviceConfig)( THIS_ PDVSOUNDDEVICECONFIG, PDWORD ) PURE; +}; + + +#undef INTERFACE +#define INTERFACE IDirectPlayVoiceServer +DECLARE_INTERFACE_( IDirectPlayVoiceServer, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectPlayVoiceServer methods ***/ + STDMETHOD_(HRESULT, Initialize) (THIS_ LPUNKNOWN, PDVMESSAGEHANDLER, PVOID, LPDWORD, DWORD ) PURE; + STDMETHOD_(HRESULT, StartSession) (THIS_ PDVSESSIONDESC, DWORD ) PURE; + STDMETHOD_(HRESULT, StopSession) (THIS_ DWORD ) PURE; + STDMETHOD_(HRESULT, GetSessionDesc)(THIS_ PDVSESSIONDESC ) PURE; + STDMETHOD_(HRESULT, SetSessionDesc)(THIS_ PDVSESSIONDESC ) PURE; + STDMETHOD_(HRESULT, GetCaps) (THIS_ PDVCAPS ) PURE; + STDMETHOD_(HRESULT, GetCompressionTypes)( THIS_ PVOID, PDWORD, PDWORD, DWORD ) PURE; + STDMETHOD_(HRESULT, SetTransmitTargets)( THIS_ DVID, PDVID, DWORD, DWORD ) PURE; + STDMETHOD_(HRESULT, GetTransmitTargets)( THIS_ DVID, PDVID, PDWORD, DWORD ) PURE; + STDMETHOD_(HRESULT, SetNotifyMask)( THIS_ PDWORD, DWORD ) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectPlayVoiceTest +DECLARE_INTERFACE_( IDirectPlayVoiceTest, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, PVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectPlayVoiceTest methods ***/ + STDMETHOD_(HRESULT, CheckAudioSetup) (THIS_ const GUID *, const GUID * , HWND, DWORD ) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) + +#define IDirectPlayVoiceClient_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlayVoiceClient_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlayVoiceClient_Release(p) (p)->lpVtbl->Release(p) + +#define IDirectPlayVoiceClient_Initialize(p,a,b,c,d,e) (p)->lpVtbl->Initialize(p,a,b,c,d,e) +#define IDirectPlayVoiceClient_Connect(p,a,b,c) (p)->lpVtbl->Connect(p,a,b,c) +#define IDirectPlayVoiceClient_Disconnect(p,a) (p)->lpVtbl->Disconnect(p,a) +#define IDirectPlayVoiceClient_GetSessionDesc(p,a) (p)->lpVtbl->GetSessionDesc(p,a) +#define IDirectPlayVoiceClient_GetClientConfig(p,a) (p)->lpVtbl->GetClientConfig(p,a) +#define IDirectPlayVoiceClient_SetClientConfig(p,a) (p)->lpVtbl->SetClientConfig(p,a) +#define IDirectPlayVoiceClient_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectPlayVoiceClient_GetCompressionTypes(p,a,b,c,d) (p)->lpVtbl->GetCompressionTypes(p,a,b,c,d) +#define IDirectPlayVoiceClient_SetTransmitTargets(p,a,b,c) (p)->lpVtbl->SetTransmitTargets(p,a,b,c) +#define IDirectPlayVoiceClient_GetTransmitTargets(p,a,b,c) (p)->lpVtbl->GetTransmitTargets(p,a,b,c) +#define IDirectPlayVoiceClient_Create3DSoundBuffer(p,a,b,c,d,e) (p)->lpVtbl->Create3DSoundBuffer(p,a,b,c,d,e) +#define IDirectPlayVoiceClient_Delete3DSoundBuffer(p,a,b) (p)->lpVtbl->Delete3DSoundBuffer(p,a,b) +#define IDirectPlayVoiceClient_SetNotifyMask(p,a,b) (p)->lpVtbl->SetNotifyMask(p,a,b) +#define IDirectPlayVoiceClient_GetSoundDeviceConfig(p,a,b) (p)->lpVtbl->GetSoundDeviceConfig(p,a,b) + +#define IDirectPlayVoiceServer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlayVoiceServer_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlayVoiceServer_Release(p) (p)->lpVtbl->Release(p) + +#define IDirectPlayVoiceServer_Initialize(p,a,b,c,d,e) (p)->lpVtbl->Initialize(p,a,b,c,d,e) +#define IDirectPlayVoiceServer_StartSession(p,a,b) (p)->lpVtbl->StartSession(p,a,b) +#define IDirectPlayVoiceServer_StopSession(p,a) (p)->lpVtbl->StopSession(p,a) +#define IDirectPlayVoiceServer_GetSessionDesc(p,a) (p)->lpVtbl->GetSessionDesc(p,a) +#define IDirectPlayVoiceServer_SetSessionDesc(p,a) (p)->lpVtbl->SetSessionDesc(p,a) +#define IDirectPlayVoiceServer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectPlayVoiceServer_GetCompressionTypes(p,a,b,c,d) (p)->lpVtbl->GetCompressionTypes(p,a,b,c,d) +#define IDirectPlayVoiceServer_SetTransmitTargets(p,a,b,c,d) (p)->lpVtbl->SetTransmitTargets(p,a,b,c,d) +#define IDirectPlayVoiceServer_GetTransmitTargets(p,a,b,c,d) (p)->lpVtbl->GetTransmitTargets(p,a,b,c,d) +#define IDirectPlayVoiceServer_SetNotifyMask(p,a,b) (p)->lpVtbl->SetNotifyMask(p,a,b) +#define IDirectPlayVoiceTest_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlayVoiceTest_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlayVoiceTest_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlayVoiceTest_CheckAudioSetup(p,a,b,c,d) (p)->lpVtbl->CheckAudioSetup(p,a,b,c,d) + + +#else /* C++ */ + +#define IDirectPlayVoiceClient_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlayVoiceClient_AddRef(p) (p)->AddRef() +#define IDirectPlayVoiceClient_Release(p) (p)->Release() + +#define IDirectPlayVoiceClient_Initialize(p,a,b,c,d,e) (p)->Initialize(a,b,c,d,e) +#define IDirectPlayVoiceClient_Connect(p,a,b,c) (p)->Connect(a,b,c) +#define IDirectPlayVoiceClient_Disconnect(p,a) (p)->Disconnect(a) +#define IDirectPlayVoiceClient_GetSessionDesc(p,a) (p)->GetSessionDesc(a) +#define IDirectPlayVoiceClient_GetClientConfig(p,a) (p)->GetClientConfig(a) +#define IDirectPlayVoiceClient_SetClientConfig(p,a) (p)->SetClientConfig(a) +#define IDirectPlayVoiceClient_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectPlayVoiceClient_GetCompressionTypes(p,a,b,c,d) (p)->GetCompressionTypes(a,b,c,d) +#define IDirectPlayVoiceClient_SetTransmitTargets(p,a,b,c) (p)->SetTransmitTargets(a,b,c) +#define IDirectPlayVoiceClient_GetTransmitTargets(p,a,b,c) (p)->GetTransmitTargets(a,b,c) +#define IDirectPlayVoiceClient_Create3DSoundBuffer(p,a,b,c,d,e) (p)->Create3DSoundBuffer(a,b,c,d,e) +#define IDirectPlayVoiceClient_Delete3DSoundBuffer(p,a,b) (p)->Delete3DSoundBuffer(a,b) +#define IDirectPlayVoiceClient_SetNotifyMask(p,a,b) (p)->SetNotifyMask(a,b) +#define IDirectPlayVoiceClient_GetSoundDeviceConfig(p,a,b) (p)->GetSoundDeviceConfig(a,b) + +#define IDirectPlayVoiceServer_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlayVoiceServer_AddRef(p) (p)->AddRef() +#define IDirectPlayVoiceServer_Release(p) (p)->Release() + +#define IDirectPlayVoiceServer_Initialize(p,a,b,c,d,e) (p)->Initialize(a,b,c,d,e) +#define IDirectPlayVoiceServer_StartSession(p,a,b) (p)->StartSession(a,b) +#define IDirectPlayVoiceServer_StopSession(p,a) (p)->StopSession(a) +#define IDirectPlayVoiceServer_GetSessionDesc(p,a) (p)->GetSessionDesc(a) +#define IDirectPlayVoiceServer_SetSessionDesc(p,a) (p)->SetSessionDesc(a) +#define IDirectPlayVoiceServer_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectPlayVoiceServer_GetCompressionTypes(p,a,b,c,d) (p)->GetCompressionTypes(a,b,c,d) +#define IDirectPlayVoiceServer_SetTransmitTargets(p,a,b,c,d) (p)->SetTransmitTargets(a,b,c,d) +#define IDirectPlayVoiceServer_GetTransmitTargets(p,a,b,c,d) (p)->GetTransmitTargets(a,b,c,d) +#define IDirectPlayVoiceServer_SetNotifyMask(p,a,b) (p)->SetNotifyMask(a,b) + +#define IDirectPlayVoiceTest_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlayVoiceTest_AddRef(p) (p)->AddRef() +#define IDirectPlayVoiceTest_Release(p) (p)->Release() +#define IDirectPlayVoiceTest_CheckAudioSetup(p,a,b,c,d) (p)->CheckAudioSetup(a,b,c,d) + + +#endif + + +/**************************************************************************** + * + * DIRECTPLAYVOICE ERRORS + * + * Errors are represented by negative values and cannot be combined. + * + ****************************************************************************/ + +#define _FACDPV 0x15 +#define MAKE_DVHRESULT( code ) MAKE_HRESULT( 1, _FACDPV, code ) + +#define DV_OK S_OK +#define DV_FULLDUPLEX MAKE_HRESULT( 0, _FACDPV, 0x0005 ) +#define DV_HALFDUPLEX MAKE_HRESULT( 0, _FACDPV, 0x000A ) +#define DV_PENDING MAKE_HRESULT( 0, _FACDPV, 0x0010 ) + +#define DVERR_BUFFERTOOSMALL MAKE_DVHRESULT( 0x001E ) +#define DVERR_EXCEPTION MAKE_DVHRESULT( 0x004A ) +#define DVERR_GENERIC E_FAIL +#define DVERR_INVALIDFLAGS MAKE_DVHRESULT( 0x0078 ) +#define DVERR_INVALIDOBJECT MAKE_DVHRESULT( 0x0082 ) +#define DVERR_INVALIDPARAM E_INVALIDARG +#define DVERR_INVALIDPLAYER MAKE_DVHRESULT( 0x0087 ) +#define DVERR_INVALIDGROUP MAKE_DVHRESULT( 0x0091 ) +#define DVERR_INVALIDHANDLE MAKE_DVHRESULT( 0x0096 ) +#define DVERR_OUTOFMEMORY E_OUTOFMEMORY +#define DVERR_PENDING DV_PENDING +#define DVERR_NOTSUPPORTED E_NOTIMPL +#define DVERR_NOINTERFACE E_NOINTERFACE +#define DVERR_SESSIONLOST MAKE_DVHRESULT( 0x012C ) +#define DVERR_NOVOICESESSION MAKE_DVHRESULT( 0x012E ) +#define DVERR_CONNECTIONLOST MAKE_DVHRESULT( 0x0168 ) +#define DVERR_NOTINITIALIZED MAKE_DVHRESULT( 0x0169 ) +#define DVERR_CONNECTED MAKE_DVHRESULT( 0x016A ) +#define DVERR_NOTCONNECTED MAKE_DVHRESULT( 0x016B ) +#define DVERR_CONNECTABORTING MAKE_DVHRESULT( 0x016E ) +#define DVERR_NOTALLOWED MAKE_DVHRESULT( 0x016F ) +#define DVERR_INVALIDTARGET MAKE_DVHRESULT( 0x0170 ) +#define DVERR_TRANSPORTNOTHOST MAKE_DVHRESULT( 0x0171 ) +#define DVERR_COMPRESSIONNOTSUPPORTED MAKE_DVHRESULT( 0x0172 ) +#define DVERR_ALREADYPENDING MAKE_DVHRESULT( 0x0173 ) +#define DVERR_SOUNDINITFAILURE MAKE_DVHRESULT( 0x0174 ) +#define DVERR_TIMEOUT MAKE_DVHRESULT( 0x0175 ) +#define DVERR_CONNECTABORTED MAKE_DVHRESULT( 0x0176 ) +#define DVERR_NO3DSOUND MAKE_DVHRESULT( 0x0177 ) +#define DVERR_ALREADYBUFFERED MAKE_DVHRESULT( 0x0178 ) +#define DVERR_NOTBUFFERED MAKE_DVHRESULT( 0x0179 ) +#define DVERR_HOSTING MAKE_DVHRESULT( 0x017A ) +#define DVERR_NOTHOSTING MAKE_DVHRESULT( 0x017B ) +#define DVERR_INVALIDDEVICE MAKE_DVHRESULT( 0x017C ) +#define DVERR_RECORDSYSTEMERROR MAKE_DVHRESULT( 0x017D ) +#define DVERR_PLAYBACKSYSTEMERROR MAKE_DVHRESULT( 0x017E ) +#define DVERR_SENDERROR MAKE_DVHRESULT( 0x017F ) +#define DVERR_USERCANCEL MAKE_DVHRESULT( 0x0180 ) +#define DVERR_RUNSETUP MAKE_DVHRESULT( 0x0183 ) +#define DVERR_INCOMPATIBLEVERSION MAKE_DVHRESULT( 0x0184 ) +#define DVERR_INITIALIZED MAKE_DVHRESULT( 0x0187 ) +#define DVERR_INVALIDPOINTER E_POINTER +#define DVERR_NOTRANSPORT MAKE_DVHRESULT( 0x0188 ) +#define DVERR_NOCALLBACK MAKE_DVHRESULT( 0x0189 ) +#define DVERR_TRANSPORTNOTINIT MAKE_DVHRESULT( 0x018A ) +#define DVERR_TRANSPORTNOSESSION MAKE_DVHRESULT( 0x018B ) +#define DVERR_TRANSPORTNOPLAYER MAKE_DVHRESULT( 0x018C ) +#define DVERR_USERBACK MAKE_DVHRESULT( 0x018D ) +#define DVERR_NORECVOLAVAILABLE MAKE_DVHRESULT( 0x018E ) +#define DVERR_INVALIDBUFFER MAKE_DVHRESULT( 0x018F ) +#define DVERR_LOCKEDBUFFER MAKE_DVHRESULT( 0x0190 ) + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/Src/Decoder_H264_ALL/D3D/include/dvp.h b/Src/Decoder_H264_ALL/D3D/include/dvp.h new file mode 100644 index 0000000..c573b67 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dvp.h @@ -0,0 +1,968 @@ +/*==========================================================================; + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: dvp.h + * Content: DirectDrawVideoPort include file + * + ***************************************************************************/ + +#ifndef __DVP_INCLUDED__ +#define __DVP_INCLUDED__ + +/* + * GUIDS used by DirectDrawVideoPort objects + */ +#if defined( _WIN32 ) && (!defined( _NO_COM ) || defined( DEFINE_GUID )) +DEFINE_GUID( IID_IDDVideoPortContainer, 0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); +DEFINE_GUID( IID_IDirectDrawVideoPort, 0xB36D93E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 ); +DEFINE_GUID( IID_IDirectDrawVideoPortNotify, 0xA655FB94,0x0589,0x4E57,0xB3,0x33,0x56,0x7A,0x89,0x46,0x8C,0x88); + + + +DEFINE_GUID( DDVPTYPE_E_HREFH_VREFH, 0x54F39980L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +DEFINE_GUID( DDVPTYPE_E_HREFH_VREFL, 0x92783220L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +DEFINE_GUID( DDVPTYPE_E_HREFL_VREFH, 0xA07A02E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +DEFINE_GUID( DDVPTYPE_E_HREFL_VREFL, 0xE09C77E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +DEFINE_GUID( DDVPTYPE_CCIR656, 0xFCA326A0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +DEFINE_GUID( DDVPTYPE_BROOKTREE, 0x1352A560L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +DEFINE_GUID( DDVPTYPE_PHILIPS, 0x332CF160L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8); +#endif + +#ifndef GUID_DEFS_ONLY + +#if defined( _WIN32 ) && !defined( _NO_COM ) +#define COM_NO_WINDOWS_H +#include +#else +#define IUnknown void +#endif + +/* + * These definitions are required to allow polymorphic structure members (i.e. those + * that are referred to both as DWORDs and as pointers) to resolve into a type + * of correct size to hold the largest of those two types (i.e. pointer) on 64 bit + * systems. For 32 bit environments, ULONG_PTR resolves to a DWORD. + */ +#ifndef MAXULONG_PTR +#define ULONG_PTR DWORD +#endif //MAXULONG_PTR + +#ifdef __cplusplus +extern "C" { +#endif + +/*============================================================================ + * + * DirectDraw Structures + * + * Various structures used to invoke DirectDraw. + * + *==========================================================================*/ + +struct IDirectDraw; +struct IDirectDrawSurface; +struct IDirectDrawPalette; +struct IDirectDrawClipper; + +typedef struct IDDVideoPortContainer FAR *LPDDVIDEOPORTCONTAINER; +typedef struct IDirectDrawVideoPort FAR *LPDIRECTDRAWVIDEOPORT; +typedef struct IDirectDrawVideoPortNotify FAR *LPDIRECTDRAWVIDEOPORTNOTIFY; + +typedef struct _DDVIDEOPORTCONNECT FAR *LPDDVIDEOPORTCONNECT; +typedef struct _DDVIDEOPORTCAPS FAR *LPDDVIDEOPORTCAPS; +typedef struct _DDVIDEOPORTDESC FAR *LPDDVIDEOPORTDESC; +typedef struct _DDVIDEOPORTINFO FAR *LPDDVIDEOPORTINFO; +typedef struct _DDVIDEOPORTBANDWIDTH FAR *LPDDVIDEOPORTBANDWIDTH; +typedef struct _DDVIDEOPORTSTATUS FAR *LPDDVIDEOPORTSTATUS; +typedef struct _DDVIDEOPORTNOTIFY FAR *LPDDVIDEOPORTNOTIFY; + +typedef struct IDDVideoPortContainerVtbl DDVIDEOPORTCONTAINERCALLBACKS; +typedef struct IDirectDrawVideoPortVtbl DIRECTDRAWVIDEOPORTCALLBACKS; +typedef struct IDirectDrawVideoPortNotifyVtbl DIRECTDRAWVIDEOPORTNOTIFYCALLBACKS; + + +/* + * API's + */ +typedef HRESULT (FAR PASCAL * LPDDENUMVIDEOCALLBACK)(LPDDVIDEOPORTCAPS, LPVOID); + + +/* + * INTERACES FOLLOW: + * IDirectDrawVideoPort + * IVideoPort + */ + +/* + * IDirectDrawVideoPortContainer + */ +#if defined( _WIN32 ) && !defined( _NO_COM ) +#undef INTERFACE +#define INTERFACE IDDVideoPortContainer +DECLARE_INTERFACE_( IDDVideoPortContainer, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IDirectDrawVideoPort methods ***/ + STDMETHOD(CreateVideoPort)(THIS_ DWORD, LPDDVIDEOPORTDESC, LPDIRECTDRAWVIDEOPORT FAR *, IUnknown FAR *) PURE; + STDMETHOD(EnumVideoPorts)(THIS_ DWORD, LPDDVIDEOPORTCAPS, LPVOID,LPDDENUMVIDEOCALLBACK ) PURE; + STDMETHOD(GetVideoPortConnectInfo)(THIS_ DWORD, __inout LPDWORD pcInfo, __out_ecount_part_opt(*pcInfo, *pcInfo) LPDDVIDEOPORTCONNECT ) PURE; + STDMETHOD(QueryVideoPortStatus)(THIS_ DWORD, LPDDVIDEOPORTSTATUS ) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IVideoPortContainer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) +#define IVideoPortContainer_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IVideoPortContainer_Release(p) (p)->lpVtbl->Release(p) +#define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->lpVtbl->CreateVideoPort(p, a, b, c, d) +#define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->lpVtbl->EnumVideoPorts(p, a, b, c, d) +#define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->lpVtbl->GetVideoPortConnectInfo(p, a, b, c) +#define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->lpVtbl->QueryVideoPortStatus(p, a, b) +#else +#define IVideoPortContainer_QueryInterface(p, a, b) (p)->QueryInterface(a, b) +#define IVideoPortContainer_AddRef(p) (p)->AddRef() +#define IVideoPortContainer_Release(p) (p)->Release() +#define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->CreateVideoPort(a, b, c, d) +#define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->EnumVideoPorts(a, b, c, d) +#define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->GetVideoPortConnectInfo(a, b, c) +#define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->QueryVideoPortStatus(a, b) +#endif + +#endif + + +/* + * IDirectDrawVideoPort + */ +#if defined( _WIN32 ) && !defined( _NO_COM ) +#undef INTERFACE +#define INTERFACE IDirectDrawVideoPort +DECLARE_INTERFACE_( IDirectDrawVideoPort, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IVideoPort methods ***/ + STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; + STDMETHOD(GetBandwidthInfo)(THIS_ LPDDPIXELFORMAT, DWORD, DWORD, DWORD, LPDDVIDEOPORTBANDWIDTH) PURE; + STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; + STDMETHOD(GetInputFormats)(THIS_ LPDWORD lpNumFormats, __out_ecount_part_opt(*lpNumFormats, *lpNumFormats) LPDDPIXELFORMAT, DWORD) PURE; + STDMETHOD(GetOutputFormats)(THIS_ LPDDPIXELFORMAT, LPDWORD lpNumFormats, __out_ecount_part_opt(*lpNumFormats, *lpNumFormats) LPDDPIXELFORMAT, DWORD) PURE; + STDMETHOD(GetFieldPolarity)(THIS_ LPBOOL) PURE; + STDMETHOD(GetVideoLine)(THIS_ LPDWORD) PURE; + STDMETHOD(GetVideoSignalStatus)(THIS_ LPDWORD) PURE; + STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE; + STDMETHOD(SetTargetSurface)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; + STDMETHOD(StartVideo)(THIS_ LPDDVIDEOPORTINFO) PURE; + STDMETHOD(StopVideo)(THIS) PURE; + STDMETHOD(UpdateVideo)(THIS_ LPDDVIDEOPORTINFO) PURE; + STDMETHOD(WaitForSync)(THIS_ DWORD, DWORD, DWORD) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IVideoPort_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IVideoPort_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IVideoPort_Release(p) (p)->lpVtbl->Release(p) +#define IVideoPort_SetTargetSurface(p,a,b) (p)->lpVtbl->SetTargetSurface(p,a,b) +#define IVideoPort_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) +#define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->lpVtbl->GetBandwidthInfo(p,a,b,c,d,e) +#define IVideoPort_GetColorControls(p,a) (p)->lpVtbl->GetColorControls(p,a) +#define IVideoPort_GetInputFormats(p,a,b,c) (p)->lpVtbl->GetInputFormats(p,a,b,c) +#define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->lpVtbl->GetOutputFormats(p,a,b,c,d) +#define IVideoPort_GetFieldPolarity(p,a) (p)->lpVtbl->GetFieldPolarity(p,a) +#define IVideoPort_GetVideoLine(p,a) (p)->lpVtbl->GetVideoLine(p,a) +#define IVideoPort_GetVideoSignalStatus(p,a) (p)->lpVtbl->GetVideoSignalStatus(p,a) +#define IVideoPort_SetColorControls(p,a) (p)->lpVtbl->SetColorControls(p,a) +#define IVideoPort_StartVideo(p,a) (p)->lpVtbl->StartVideo(p,a) +#define IVideoPort_StopVideo(p) (p)->lpVtbl->StopVideo(p) +#define IVideoPort_UpdateVideo(p,a) (p)->lpVtbl->UpdateVideo(p,a) +#define IVideoPort_WaitForSync(p,a,b,c) (p)->lpVtbl->WaitForSync(p,a,b,c) +#else +#define IVideoPort_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IVideoPort_AddRef(p) (p)->AddRef() +#define IVideoPort_Release(p) (p)->Release() +#define IVideoPort_SetTargetSurface(p,a,b) (p)->SetTargetSurface(a,b) +#define IVideoPort_Flip(p,a,b) (p)->Flip(a,b) +#define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->GetBandwidthInfo(a,b,c,d,e) +#define IVideoPort_GetColorControls(p,a) (p)->GetColorControls(a) +#define IVideoPort_GetInputFormats(p,a,b,c) (p)->GetInputFormats(a,b,c) +#define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->GetOutputFormats(a,b,c,d) +#define IVideoPort_GetFieldPolarity(p,a) (p)->GetFieldPolarity(a) +#define IVideoPort_GetVideoLine(p,a) (p)->GetVideoLine(a) +#define IVideoPort_GetVideoSignalStatus(p,a) (p)->GetVideoSignalStatus(a) +#define IVideoPort_SetColorControls(p,a) (p)->SetColorControls(a) +#define IVideoPort_StartVideo(p,a) (p)->StartVideo(a) +#define IVideoPort_StopVideo(p) (p)->StopVideo() +#define IVideoPort_UpdateVideo(p,a) (p)->UpdateVideo(a) +#define IVideoPort_WaitForSync(p,a,b,c) (p)->WaitForSync(a,b,c) +#endif + +#endif + +/* + * IDirectDrawVideoPort + */ +#if (_WIN32_WINNT >= _WIN32_WINNT_WINXP) +#if defined( _WIN32 ) && !defined( _NO_COM ) +#undef INTERFACE +#define INTERFACE IDirectDrawVideoPortNotify +DECLARE_INTERFACE_( IDirectDrawVideoPortNotify, IUnknown ) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + /*** IVideoPort methods ***/ + STDMETHOD(AcquireNotification)(THIS_ HANDLE *, LPDDVIDEOPORTNOTIFY) PURE; + STDMETHOD(ReleaseNotification)(THIS_ HANDLE) PURE; +}; + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IVideoPortNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IVideoPortNotify_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IVideoPortNotify_Release(p) (p)->lpVtbl->Release(p) +#define IVideoPortNotify_AcquireNotification(p,a,b) (p)->lpVtbl->AcquireNotification(p,a,b) +#define IVideoPortNotify_ReleaseNotification(p,a) (p)->lpVtbl->ReleaseNotification(p,a) +#else +#define IVideoPortNotify_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IVideoPortNotify_AddRef(p) (p)->AddRef() +#define IVideoPortNotify_Release(p) (p)->Release() +#define IVideoPortNotify_AcquireNotification(p,a,b) (p)->lpVtbl->AcquireNotification(a,b) +#define IVideoPortNotify_ReleaseNotification(p,a) (p)->lpVtbl->ReleaseNotification(a) +#endif + +#endif +#endif + +/* + * DDVIDEOPORTCONNECT + */ +typedef struct _DDVIDEOPORTCONNECT +{ + DWORD dwSize; // size of the DDVIDEOPORTCONNECT structure + DWORD dwPortWidth; // Width of the video port + GUID guidTypeID; // Description of video port connection + DWORD dwFlags; // Connection flags + ULONG_PTR dwReserved1; // Reserved, set to zero. +} DDVIDEOPORTCONNECT; + + +/* + * DDVIDEOPORTCAPS + */ +typedef struct _DDVIDEOPORTCAPS +{ + DWORD dwSize; // size of the DDVIDEOPORTCAPS structure + DWORD dwFlags; // indicates which fields contain data + DWORD dwMaxWidth; // max width of the video port field + DWORD dwMaxVBIWidth; // max width of the VBI data + DWORD dwMaxHeight; // max height of the video port field + DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1)) + DWORD dwCaps; // Video port capabilities + DWORD dwFX; // More video port capabilities + DWORD dwNumAutoFlipSurfaces; // Max number of autoflippable surfaces allowed + DWORD dwAlignVideoPortBoundary; // Byte restriction of placement within the surface + DWORD dwAlignVideoPortPrescaleWidth;// Byte restriction of width after prescaling + DWORD dwAlignVideoPortCropBoundary; // Byte restriction of left cropping + DWORD dwAlignVideoPortCropWidth; // Byte restriction of cropping width + DWORD dwPreshrinkXStep; // Width can be shrunk in steps of 1/x + DWORD dwPreshrinkYStep; // Height can be shrunk in steps of 1/x + DWORD dwNumVBIAutoFlipSurfaces; // Max number of VBI autoflippable surfaces allowed + DWORD dwNumPreferredAutoflip; // Optimal number of autoflippable surfaces for hardware + WORD wNumFilterTapsX; // Number of taps the prescaler uses in the X direction (0 - no prescale, 1 - replication, etc.) + WORD wNumFilterTapsY; // Number of taps the prescaler uses in the Y direction (0 - no prescale, 1 - replication, etc.) +} DDVIDEOPORTCAPS; + +/* + * The dwMaxWidth and dwMaxVBIWidth members are valid + */ +#define DDVPD_WIDTH 0x00000001l + +/* + * The dwMaxHeight member is valid + */ +#define DDVPD_HEIGHT 0x00000002l + +/* + * The dwVideoPortID member is valid + */ +#define DDVPD_ID 0x00000004l + +/* + * The dwCaps member is valid + */ +#define DDVPD_CAPS 0x00000008l + +/* + * The dwFX member is valid + */ +#define DDVPD_FX 0x00000010l + +/* + * The dwNumAutoFlipSurfaces member is valid + */ +#define DDVPD_AUTOFLIP 0x00000020l + +/* + * All of the alignment members are valid + */ +#define DDVPD_ALIGN 0x00000040l + +/* + * The dwNumPreferredAutoflip member is valid + */ +#define DDVPD_PREFERREDAUTOFLIP 0x00000080l + +/* + * The wNumFilterTapsX and wNumFilterTapsY fields are valid + */ +#define DDVPD_FILTERQUALITY 0x00000100l + +/* + * DDVIDEOPORTDESC + */ +typedef struct _DDVIDEOPORTDESC +{ + DWORD dwSize; // size of the DDVIDEOPORTDESC structure + DWORD dwFieldWidth; // width of the video port field + DWORD dwVBIWidth; // width of the VBI data + DWORD dwFieldHeight; // height of the video port field + DWORD dwMicrosecondsPerField; // Microseconds per video field + DWORD dwMaxPixelsPerSecond; // Maximum pixel rate per second + DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1)) + DWORD dwReserved1; // Reserved for future use - set to zero (struct padding) + DDVIDEOPORTCONNECT VideoPortType; // Description of video port connection + ULONG_PTR dwReserved2; // Reserved for future use - set to zero + ULONG_PTR dwReserved3; // Reserved for future use - set to zero +} DDVIDEOPORTDESC; + + +/* + * DDVIDEOPORTINFO + */ +typedef struct _DDVIDEOPORTINFO +{ + DWORD dwSize; // Size of the structure + DWORD dwOriginX; // Placement of the video data within the surface. + DWORD dwOriginY; // Placement of the video data within the surface. + DWORD dwVPFlags; // Video port options + RECT rCrop; // Cropping rectangle (optional). + DWORD dwPrescaleWidth; // Determines pre-scaling/zooming in the X direction (optional). + DWORD dwPrescaleHeight; // Determines pre-scaling/zooming in the Y direction (optional). + LPDDPIXELFORMAT lpddpfInputFormat; // Video format written to the video port + LPDDPIXELFORMAT lpddpfVBIInputFormat; // Input format of the VBI data + LPDDPIXELFORMAT lpddpfVBIOutputFormat;// Output format of the data + DWORD dwVBIHeight; // Specifies the number of lines of data within the vertical blanking interval. + ULONG_PTR dwReserved1; // Reserved for future use - set to zero + ULONG_PTR dwReserved2; // Reserved for future use - set to zero +} DDVIDEOPORTINFO; + + +/* + * DDVIDEOPORTBANDWIDTH + */ +typedef struct _DDVIDEOPORTBANDWIDTH +{ + DWORD dwSize; // Size of the structure + DWORD dwCaps; + DWORD dwOverlay; // Zoom factor at which overlay is supported + DWORD dwColorkey; // Zoom factor at which overlay w/ colorkey is supported + DWORD dwYInterpolate; // Zoom factor at which overlay w/ Y interpolation is supported + DWORD dwYInterpAndColorkey; // Zoom factor at which ovelray w/ Y interpolation and colorkeying is supported + ULONG_PTR dwReserved1; // Reserved for future use - set to zero + ULONG_PTR dwReserved2; // Reserved for future use - set to zero +} DDVIDEOPORTBANDWIDTH; + + +/* + * DDVIDEOPORTSTATUS + */ +typedef struct _DDVIDEOPORTSTATUS +{ + DWORD dwSize; // Size of the structure + BOOL bInUse; // TRUE if video port is currently being used + DWORD dwFlags; // Currently not used + DWORD dwReserved1; // Reserved for future use + DDVIDEOPORTCONNECT VideoPortType; // Information about the connection + ULONG_PTR dwReserved2; // Reserved for future use + ULONG_PTR dwReserved3; // Reserved for future use +} DDVIDEOPORTSTATUS; + +/* + * DDVIDEOPORTNOTIFY + */ +typedef struct _DDVIDEOPORTNOTIFY +{ + LARGE_INTEGER ApproximateTimeStamp; // Timestamp in the event notification + LONG lField; // 0 if even, 1 if odd, -1 if unknown + UINT dwSurfaceIndex; // Index in the surface chain of the surface that received the sample + LONG lDone; // Call InterlockedIncrement on this when done with sample +} DDVIDEOPORTNOTIFY; + + +/*============================================================================ + * + * Video Port Flags + * + * All flags are bit flags. + * + *==========================================================================*/ + +/**************************************************************************** + * + * VIDEOPORT DDVIDEOPORTCONNECT FLAGS + * + ****************************************************************************/ + +/* + * When this is set by the driver and passed to the client, this + * indicates that the video port is capable of double clocking the data. + * When this is set by the client, this indicates that the video port + * should enable double clocking. This flag is only valid with external + * syncs. + */ +#define DDVPCONNECT_DOUBLECLOCK 0x00000001l + +/* + * When this is set by the driver and passed to the client, this + * indicates that the video port is capable of using an external VACT + * signal. When this is set by the client, this indicates that the + * video port should use the external VACT signal. + */ +#define DDVPCONNECT_VACT 0x00000002l + +/* + * When this is set by the driver and passed to the client, this + * indicates that the video port is capable of treating even fields + * like odd fields and visa versa. When this is set by the client, + * this indicates that the video port should treat even fields like odd + * fields. + */ +#define DDVPCONNECT_INVERTPOLARITY 0x00000004l + +/* + * Indicates that any data written to the video port during the VREF + * period will not be written into the frame buffer. This flag is read only. + */ +#define DDVPCONNECT_DISCARDSVREFDATA 0x00000008l + +/* + * When this is set be the driver and passed to the client, this + * indicates that the device will write half lines into the frame buffer + * if half lines are provided by the decoder. If this is set by the client, + * this indicates that the decoder will be supplying half lines. + */ +#define DDVPCONNECT_HALFLINE 0x00000010l + +/* + * Indicates that the signal is interlaced. This flag is only + * set by the client. + */ +#define DDVPCONNECT_INTERLACED 0x00000020l + +/* + * Indicates that video port is shareable and that this video port + * will use the even fields. This flag is only set by the client. + */ +#define DDVPCONNECT_SHAREEVEN 0x00000040l + +/* + * Indicates that video port is shareable and that this video port + * will use the odd fields. This flag is only set by the client. + */ +#define DDVPCONNECT_SHAREODD 0x00000080l + +/**************************************************************************** + * + * VIDEOPORT DDVIDEOPORTDESC CAPS + * + ****************************************************************************/ + +/* + * Flip can be performed automatically to avoid tearing. + */ +#define DDVPCAPS_AUTOFLIP 0x00000001l + +/* + * Supports interlaced video + */ +#define DDVPCAPS_INTERLACED 0x00000002l + +/* + * Supports non-interlaced video + */ +#define DDVPCAPS_NONINTERLACED 0x00000004l + +/* + * Indicates that the device can return whether the current field + * of an interlaced signal is even or odd. + */ +#define DDVPCAPS_READBACKFIELD 0x00000008l + +/* + * Indicates that the device can return the current line of video + * being written into the frame buffer. + */ +#define DDVPCAPS_READBACKLINE 0x00000010l + +/* + * Allows two gen-locked video streams to share a single video port, + * where one stream uses the even fields and the other uses the odd + * fields. Separate parameters (including address, scaling, + * cropping, etc.) are maintained for both fields.) + */ +#define DDVPCAPS_SHAREABLE 0x00000020l + +/* + * Even fields of video can be automatically discarded. + */ +#define DDVPCAPS_SKIPEVENFIELDS 0x00000040l + +/* + * Odd fields of video can be automatically discarded. + */ +#define DDVPCAPS_SKIPODDFIELDS 0x00000080l + +/* + * Indicates that the device is capable of driving the graphics + * VSYNC with the video port VSYNC. + */ +#define DDVPCAPS_SYNCMASTER 0x00000100l + +/* + * Indicates that data within the vertical blanking interval can + * be written to a different surface. + */ +#define DDVPCAPS_VBISURFACE 0x00000200l + +/* + * Indicates that the video port can perform color operations + * on the incoming data before it is written to the frame buffer. + */ +#define DDVPCAPS_COLORCONTROL 0x00000400l + +/* + * Indicates that the video port can accept VBI data in a different + * width or format than the regular video data. + */ +#define DDVPCAPS_OVERSAMPLEDVBI 0x00000800l + +/* + * Indicates that the video port can write data directly to system memory + */ +#define DDVPCAPS_SYSTEMMEMORY 0x00001000l + +/* + * Indicates that the VBI and video portions of the video stream can + * be controlled by an independent processes. + */ +#define DDVPCAPS_VBIANDVIDEOINDEPENDENT 0x00002000l + +/* + * Indicates that the video port contains high quality hardware + * de-interlacing hardware that should be used instead of the + * bob/weave algorithms. + */ +#define DDVPCAPS_HARDWAREDEINTERLACE 0x00004000l + + +/**************************************************************************** + * + * VIDEOPORT DDVIDEOPORTDESC FX + * + ****************************************************************************/ + +/* + * Limited cropping is available to crop out the vertical interval data. + */ +#define DDVPFX_CROPTOPDATA 0x00000001l + +/* + * Incoming data can be cropped in the X direction before it is written + * to the surface. + */ +#define DDVPFX_CROPX 0x00000002l + +/* + * Incoming data can be cropped in the Y direction before it is written + * to the surface. + */ +#define DDVPFX_CROPY 0x00000004l + +/* + * Supports interleaving interlaced fields in memory. + */ +#define DDVPFX_INTERLEAVE 0x00000008l + +/* + * Supports mirroring left to right as the video data is written + * into the frame buffer. + */ +#define DDVPFX_MIRRORLEFTRIGHT 0x00000010l + +/* + * Supports mirroring top to bottom as the video data is written + * into the frame buffer. + */ +#define DDVPFX_MIRRORUPDOWN 0x00000020l + +/* + * Data can be arbitrarily shrunk in the X direction before it + * is written to the surface. + */ +#define DDVPFX_PRESHRINKX 0x00000040l + +/* + * Data can be arbitrarily shrunk in the Y direction before it + * is written to the surface. + */ +#define DDVPFX_PRESHRINKY 0x00000080l + +/* + * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X + * direction before it is written to the surface. + */ +#define DDVPFX_PRESHRINKXB 0x00000100l + +/* + * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y + * direction before it is written to the surface. + */ +#define DDVPFX_PRESHRINKYB 0x00000200l + +/* + * Data can be shrunk in increments of 1/x in the X direction + * (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkXStep) + * before it is written to the surface. + */ +#define DDVPFX_PRESHRINKXS 0x00000400l + +/* + * Data can be shrunk in increments of 1/x in the Y direction + * (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkYStep) + * before it is written to the surface. + */ +#define DDVPFX_PRESHRINKYS 0x00000800l + +/* + * Data can be arbitrarily stretched in the X direction before + * it is written to the surface. + */ +#define DDVPFX_PRESTRETCHX 0x00001000l + +/* + * Data can be arbitrarily stretched in the Y direction before + * it is written to the surface. + */ +#define DDVPFX_PRESTRETCHY 0x00002000l + +/* + * Data can be integer stretched in the X direction before it is + * written to the surface. + */ +#define DDVPFX_PRESTRETCHXN 0x00004000l + +/* + * Data can be integer stretched in the Y direction before it is + * written to the surface. + */ +#define DDVPFX_PRESTRETCHYN 0x00008000l + +/* + * Indicates that data within the vertical blanking interval can + * be converted independently of the remaining video data. + */ +#define DDVPFX_VBICONVERT 0x00010000l + +/* + * Indicates that scaling can be disabled for data within the + * vertical blanking interval. + */ +#define DDVPFX_VBINOSCALE 0x00020000l + +/* + * Indicates that the video data can ignore the left and right + * cropping coordinates when cropping oversampled VBI data. + */ +#define DDVPFX_IGNOREVBIXCROP 0x00040000l + +/* + * Indicates that interleaving can be disabled for data within the + * vertical blanking interval. + */ +#define DDVPFX_VBINOINTERLEAVE 0x00080000l + + +/**************************************************************************** + * + * VIDEOPORT DDVIDEOPORTINFO FLAGS + * + ****************************************************************************/ + +/* + * Perform automatic flipping. Auto-flipping is performed between + * the overlay surface that was attached to the video port using + * IDirectDrawVideoPort::AttachSurface and the overlay surfaces that + * are attached to the surface via the IDirectDrawSurface::AttachSurface + * method. The flip order is the order in which the overlay surfaces + * were. attached. + */ +#define DDVP_AUTOFLIP 0x00000001l + +/* + * Perform conversion using the ddpfOutputFormat information. + */ +#define DDVP_CONVERT 0x00000002l + +/* + * Perform cropping using the specified rectangle. + */ +#define DDVP_CROP 0x00000004l + +/* + * Indicates that interlaced fields should be interleaved in memory. + */ +#define DDVP_INTERLEAVE 0x00000008l + +/* + * Indicates that the data should be mirrored left to right as it's + * written into the frame buffer. + */ +#define DDVP_MIRRORLEFTRIGHT 0x00000010l + +/* + * Indicates that the data should be mirrored top to bottom as it's + * written into the frame buffer. + */ +#define DDVP_MIRRORUPDOWN 0x00000020l + +/* + * Perform pre-scaling/zooming based on the pre-scale parameters. + */ +#define DDVP_PRESCALE 0x00000040l + +/* + * Ignore input of even fields. + */ +#define DDVP_SKIPEVENFIELDS 0x00000080l + +/* + * Ignore input of odd fields. + */ +#define DDVP_SKIPODDFIELDS 0x00000100l + +/* + * Drive the graphics VSYNCs using the video port VYSNCs. + */ +#define DDVP_SYNCMASTER 0x00000200l + +/* + * The ddpfVBIOutputFormatFormat member contains data that should be used + * to convert the data within the vertical blanking interval. + */ +#define DDVP_VBICONVERT 0x00000400l + +/* + * Indicates that data within the vertical blanking interval + * should not be scaled. + */ +#define DDVP_VBINOSCALE 0x00000800l + +/* + * Indicates that these bob/weave decisions should not be + * overriden by other interfaces. + */ +#define DDVP_OVERRIDEBOBWEAVE 0x00001000l + +/* + * Indicates that the video data should ignore the left and right + * cropping coordinates when cropping the VBI data. + */ +#define DDVP_IGNOREVBIXCROP 0x00002000l + +/* + * Indicates that interleaving can be disabled for data within the + * vertical blanking interval. + */ +#define DDVP_VBINOINTERLEAVE 0x00004000l + +/* + * Indicates that the video port should use the hardware + * de-interlacing hardware. + */ +#define DDVP_HARDWAREDEINTERLACE 0x00008000l + +/**************************************************************************** + * + * DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS + * + ****************************************************************************/ + +/* + * Return formats for the video data + */ +#define DDVPFORMAT_VIDEO 0x00000001l + +/* + * Return formats for the VBI data + */ +#define DDVPFORMAT_VBI 0x00000002l + +/**************************************************************************** + * + * DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS + * + ****************************************************************************/ + +/* + * Surface should receive video data (and VBI data if a surface + * is not explicitly attached for that purpose) + */ +#define DDVPTARGET_VIDEO 0x00000001l + +/* + * Surface should receive VBI data + */ +#define DDVPTARGET_VBI 0x00000002l + + +/**************************************************************************** + * + * DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS + * + ****************************************************************************/ + +/* + * Waits until the beginning of the next VSYNC + */ +#define DDVPWAIT_BEGIN 0x00000001l + +/* + * Waits until the end of the next/current VSYNC + */ +#define DDVPWAIT_END 0x00000002l + +/* + * Waits until the beginning of the specified line + */ +#define DDVPWAIT_LINE 0x00000003l + +/**************************************************************************** + * + * DIRECTDRAWVIDEOPORT FLIP FLAGS + * + ****************************************************************************/ + +/* + * Flips the normal video surface + */ +#define DDVPFLIP_VIDEO 0x00000001l + +/* + * Flips the VBI surface + */ +#define DDVPFLIP_VBI 0x00000002l + +/**************************************************************************** + * + * DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES + * + ****************************************************************************/ + +/* + * No video signal is present at the video port + */ +#define DDVPSQ_NOSIGNAL 0x00000001l + +/* + * A valid video signal is present at the video port + */ +#define DDVPSQ_SIGNALOK 0x00000002l + +/**************************************************************************** + * + * VIDEOPORTBANDWIDTH Flags + * + ****************************************************************************/ + +/* + * The specified height/width refer to the size of the video port data + * written into memory, after prescaling has occured. + */ +#define DDVPB_VIDEOPORT 0x00000001l + +/* + * The specified height/width refer to the source size of the overlay. + */ +#define DDVPB_OVERLAY 0x00000002l + +/* + * This is a query for the device to return which caps this device requires. + */ +#define DDVPB_TYPE 0x00000004l + +/**************************************************************************** + * + * VIDEOPORTBANDWIDTH Caps + * + ****************************************************************************/ + +/* + * The bandwidth for this device is dependant on the overlay source size. + */ +#define DDVPBCAPS_SOURCE 0x00000001l + +/* + * The bandwidth for this device is dependant on the overlay destination + * size. + */ +#define DDVPBCAPS_DESTINATION 0x00000002l + +/**************************************************************************** + * + * DDVIDEOPORTCONTAINER CreateVideoPort flags + * + ****************************************************************************/ + +/* + * The process only wants to control the VBI portion of the video stream. + */ +#define DDVPCREATE_VBIONLY 0x00000001l + +/* + * The process only wants to control the non-VBI (video) portion of + * the video stream. + */ +#define DDVPCREATE_VIDEOONLY 0x00000002l + +/**************************************************************************** + * + * DDVIDEOPORTSTATUS flags + * + ****************************************************************************/ + +/* + * The video port interface is only controlling the VBI portion of the + * video stream + */ +#define DDVPSTATUS_VBIONLY 0x00000001l + +/* + * The video port interface is only controlling the video portion of the + * video stream + */ +#define DDVPSTATUS_VIDEOONLY 0x00000002l + + +#ifdef __cplusplus +}; +#endif + +#endif // GUID_DEFS_ONLY + +#endif + diff --git a/Src/Decoder_H264_ALL/D3D/include/dx7todx8.h b/Src/Decoder_H264_ALL/D3D/include/dx7todx8.h new file mode 100644 index 0000000..a513d69 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dx7todx8.h @@ -0,0 +1,98 @@ +/*==========================================================================; + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: dx7todx8.h + * Content: DX7 to DX8 Direct3D aliases to aid porting DX7 apps to DX8 + * + ***************************************************************************/ + +#ifndef _DX7TODX8_H_ + +/////////////////////////////////////////////////////////////////////////////// +// +// d3d8types.h +// +/////////////////////////////////////////////////////////////////////////////// + +#define D3DTRANSFORMSTATE_WORLD D3DTS_WORLD +#define D3DTRANSFORMSTATE_VIEW D3DTS_VIEW +#define D3DTRANSFORMSTATE_PROJECTION D3DTS_PROJECTION +#define D3DTRANSFORMSTATE_WORLD1 D3DTS_WORLD1 +#define D3DTRANSFORMSTATE_WORLD2 D3DTS_WORLD2 +#define D3DTRANSFORMSTATE_WORLD3 D3DTS_WORLD3 +#define D3DTRANSFORMSTATE_TEXTURE0 D3DTS_TEXTURE0 +#define D3DTRANSFORMSTATE_TEXTURE1 D3DTS_TEXTURE1 +#define D3DTRANSFORMSTATE_TEXTURE2 D3DTS_TEXTURE2 +#define D3DTRANSFORMSTATE_TEXTURE3 D3DTS_TEXTURE3 +#define D3DTRANSFORMSTATE_TEXTURE4 D3DTS_TEXTURE4 +#define D3DTRANSFORMSTATE_TEXTURE5 D3DTS_TEXTURE5 +#define D3DTRANSFORMSTATE_TEXTURE6 D3DTS_TEXTURE6 +#define D3DTRANSFORMSTATE_TEXTURE7 D3DTS_TEXTURE7 +#define D3DTRANSFORMSTATE_FORCE_DWORD D3DTS_FORCE_DWORD + +#define D3DRENDERSTATE_ZENABLE D3DRS_ZENABLE +#define D3DRENDERSTATE_FILLMODE D3DRS_FILLMODE +#define D3DRENDERSTATE_SHADEMODE D3DRS_SHADEMODE +#define D3DRENDERSTATE_LINEPATTERN D3DRS_LINEPATTERN +#define D3DRENDERSTATE_ZWRITEENABLE D3DRS_ZWRITEENABLE +#define D3DRENDERSTATE_ALPHATESTENABLE D3DRS_ALPHATESTENABLE +#define D3DRENDERSTATE_LASTPIXEL D3DRS_LASTPIXEL +#define D3DRENDERSTATE_SRCBLEND D3DRS_SRCBLEND +#define D3DRENDERSTATE_DESTBLEND D3DRS_DESTBLEND +#define D3DRENDERSTATE_CULLMODE D3DRS_CULLMODE +#define D3DRENDERSTATE_ZFUNC D3DRS_ZFUNC +#define D3DRENDERSTATE_ALPHAREF D3DRS_ALPHAREF +#define D3DRENDERSTATE_ALPHAFUNC D3DRS_ALPHAFUNC +#define D3DRENDERSTATE_DITHERENABLE D3DRS_DITHERENABLE +#define D3DRENDERSTATE_ALPHABLENDENABLE D3DRS_ALPHABLENDENABLE +#define D3DRENDERSTATE_FOGENABLE D3DRS_FOGENABLE +#define D3DRENDERSTATE_SPECULARENABLE D3DRS_SPECULARENABLE +#define D3DRENDERSTATE_ZVISIBLE D3DRS_ZVISIBLE +#define D3DRENDERSTATE_FOGCOLOR D3DRS_FOGCOLOR +#define D3DRENDERSTATE_FOGTABLEMODE D3DRS_FOGTABLEMODE +#define D3DRENDERSTATE_FOGSTART D3DRS_FOGSTART +#define D3DRENDERSTATE_FOGEND D3DRS_FOGEND +#define D3DRENDERSTATE_FOGDENSITY D3DRS_FOGDENSITY +#define D3DRENDERSTATE_EDGEANTIALIAS D3DRS_EDGEANTIALIAS +#define D3DRENDERSTATE_ZBIAS D3DRS_ZBIAS +#define D3DRENDERSTATE_RANGEFOGENABLE D3DRS_RANGEFOGENABLE +#define D3DRENDERSTATE_STENCILENABLE D3DRS_STENCILENABLE +#define D3DRENDERSTATE_STENCILFAIL D3DRS_STENCILFAIL +#define D3DRENDERSTATE_STENCILZFAIL D3DRS_STENCILZFAIL +#define D3DRENDERSTATE_STENCILPASS D3DRS_STENCILPASS +#define D3DRENDERSTATE_STENCILFUNC D3DRS_STENCILFUNC +#define D3DRENDERSTATE_STENCILREF D3DRS_STENCILREF +#define D3DRENDERSTATE_STENCILMASK D3DRS_STENCILMASK +#define D3DRENDERSTATE_STENCILWRITEMASK D3DRS_STENCILWRITEMASK +#define D3DRENDERSTATE_TEXTUREFACTOR D3DRS_TEXTUREFACTOR +#define D3DRENDERSTATE_WRAP0 D3DRS_WRAP0 +#define D3DRENDERSTATE_WRAP1 D3DRS_WRAP1 +#define D3DRENDERSTATE_WRAP2 D3DRS_WRAP2 +#define D3DRENDERSTATE_WRAP3 D3DRS_WRAP3 +#define D3DRENDERSTATE_WRAP4 D3DRS_WRAP4 +#define D3DRENDERSTATE_WRAP5 D3DRS_WRAP5 +#define D3DRENDERSTATE_WRAP6 D3DRS_WRAP6 +#define D3DRENDERSTATE_WRAP7 D3DRS_WRAP7 +#define D3DRENDERSTATE_CLIPPING D3DRS_CLIPPING +#define D3DRENDERSTATE_LIGHTING D3DRS_LIGHTING +#define D3DRENDERSTATE_EXTENTS D3DRS_EXTENTS +#define D3DRENDERSTATE_AMBIENT D3DRS_AMBIENT +#define D3DRENDERSTATE_FOGVERTEXMODE D3DRS_FOGVERTEXMODE +#define D3DRENDERSTATE_COLORVERTEX D3DRS_COLORVERTEX +#define D3DRENDERSTATE_LOCALVIEWER D3DRS_LOCALVIEWER +#define D3DRENDERSTATE_NORMALIZENORMALS D3DRS_NORMALIZENORMALS +#define D3DRENDERSTATE_DIFFUSEMATERIALSOURCE D3DRS_DIFFUSEMATERIALSOURCE +#define D3DRENDERSTATE_SPECULARMATERIALSOURCE D3DRS_SPECULARMATERIALSOURCE +#define D3DRENDERSTATE_AMBIENTMATERIALSOURCE D3DRS_AMBIENTMATERIALSOURCE +#define D3DRENDERSTATE_EMISSIVEMATERIALSOURCE D3DRS_EMISSIVEMATERIALSOURCE +#define D3DRENDERSTATE_VERTEXBLEND D3DRS_VERTEXBLEND +#define D3DRENDERSTATE_CLIPPLANEENABLE D3DRS_CLIPPLANEENABLE + +#define RGBA_MAKE D3DCOLOR_RGBA +#define RGB_MAKE D3DCOLOR_XRGB +#define D3DRGBA D3DCOLOR_COLORVALUE +#define D3DRGB(_r,_g,_b) D3DCOLOR_COLORVALUE(_r,_g,_b,1.f) + +#define _DX7TODX8_H_ +#endif //_DX7TODX8_H_ diff --git a/Src/Decoder_H264_ALL/D3D/include/dxerr8.h b/Src/Decoder_H264_ALL/D3D/include/dxerr8.h new file mode 100644 index 0000000..4f4d848 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dxerr8.h @@ -0,0 +1,99 @@ +/*==========================================================================; + * + * + * File: dxerr8.h + * Content: DirectX Error Library Include File + * + ****************************************************************************/ + +#ifndef _DXERR8_H_ +#define _DXERR8_H_ + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +// +// DXGetErrorString8 +// +// Desc: Converts a DirectX HRESULT to a string +// +// Args: HRESULT hr Can be any error code from +// D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW +// +// Return: Converted string +// +const char* WINAPI DXGetErrorString8A(HRESULT hr); +const WCHAR* WINAPI DXGetErrorString8W(HRESULT hr); + +#ifdef UNICODE +#define DXGetErrorString8 DXGetErrorString8W +#else +#define DXGetErrorString8 DXGetErrorString8A +#endif + + +// +// DXGetErrorDescription8 +// +// Desc: Returns a string description of a DirectX HRESULT +// +// Args: HRESULT hr Can be any error code from +// D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW +// +// Return: String description +// +const char* WINAPI DXGetErrorDescription8A(HRESULT hr); +const WCHAR* WINAPI DXGetErrorDescription8W(HRESULT hr); + +#ifdef UNICODE + #define DXGetErrorDescription8 DXGetErrorDescription8W +#else + #define DXGetErrorDescription8 DXGetErrorDescription8A +#endif + + +// +// DXTrace +// +// Desc: Outputs a formatted error message to the debug stream +// +// Args: CHAR* strFile The current file, typically passed in using the +// __FILE__ macro. +// DWORD dwLine The current line number, typically passed in using the +// __LINE__ macro. +// HRESULT hr An HRESULT that will be traced to the debug stream. +// CHAR* strMsg A string that will be traced to the debug stream (may be NULL) +// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info. +// +// Return: The hr that was passed in. +// +HRESULT WINAPI DXTraceA( const char* strFile, DWORD dwLine, HRESULT hr, const char* strMsg, BOOL bPopMsgBox ); +HRESULT WINAPI DXTraceW( const char* strFile, DWORD dwLine, HRESULT hr, const WCHAR* strMsg, BOOL bPopMsgBox ); + +#ifdef UNICODE +#define DXTrace DXTraceW +#else +#define DXTrace DXTraceA +#endif + + +// +// Helper macros +// +#if defined(DEBUG) | defined(_DEBUG) +#define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE ) +#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE ) +#define DXTRACE_ERR_NOMSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE ) +#else +#define DXTRACE_MSG(str) (0L) +#define DXTRACE_ERR(str,hr) (hr) +#define DXTRACE_ERR_NOMSGBOX(str,hr) (hr) +#endif + + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif // _DXERR8_H_ diff --git a/Src/Decoder_H264_ALL/D3D/include/dxerr9.h b/Src/Decoder_H264_ALL/D3D/include/dxerr9.h new file mode 100644 index 0000000..baf6968 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dxerr9.h @@ -0,0 +1,99 @@ +/*==========================================================================; + * + * + * File: dxerr9.h + * Content: DirectX Error Library Include File + * + ****************************************************************************/ + +#ifndef _DXERR9_H_ +#define _DXERR9_H_ + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +// +// DXGetErrorString9 +// +// Desc: Converts a DirectX 9 or earlier HRESULT to a string +// +// Args: HRESULT hr Can be any error code from +// D3D9 D3DX9 D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW +// +// Return: Converted string +// +const char* WINAPI DXGetErrorString9A(HRESULT hr); +const WCHAR* WINAPI DXGetErrorString9W(HRESULT hr); + +#ifdef UNICODE +#define DXGetErrorString9 DXGetErrorString9W +#else +#define DXGetErrorString9 DXGetErrorString9A +#endif + + +// +// DXGetErrorDescription9 +// +// Desc: Returns a string description of a DirectX 9 or earlier HRESULT +// +// Args: HRESULT hr Can be any error code from +// D3D9 D3DX9 D3D8 D3DX8 DDRAW DPLAY8 DMUSIC DSOUND DINPUT DSHOW +// +// Return: String description +// +const char* WINAPI DXGetErrorDescription9A(HRESULT hr); +const WCHAR* WINAPI DXGetErrorDescription9W(HRESULT hr); + +#ifdef UNICODE + #define DXGetErrorDescription9 DXGetErrorDescription9W +#else + #define DXGetErrorDescription9 DXGetErrorDescription9A +#endif + + +// +// DXTrace +// +// Desc: Outputs a formatted error message to the debug stream +// +// Args: CHAR* strFile The current file, typically passed in using the +// __FILE__ macro. +// DWORD dwLine The current line number, typically passed in using the +// __LINE__ macro. +// HRESULT hr An HRESULT that will be traced to the debug stream. +// CHAR* strMsg A string that will be traced to the debug stream (may be NULL) +// BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info. +// +// Return: The hr that was passed in. +// +HRESULT WINAPI DXTraceA( const char* strFile, DWORD dwLine, HRESULT hr, const char* strMsg, BOOL bPopMsgBox ); +HRESULT WINAPI DXTraceW( const char* strFile, DWORD dwLine, HRESULT hr, const WCHAR* strMsg, BOOL bPopMsgBox ); + +#ifdef UNICODE +#define DXTrace DXTraceW +#else +#define DXTrace DXTraceA +#endif + + +// +// Helper macros +// +#if defined(DEBUG) | defined(_DEBUG) +#define DXTRACE_MSG(str) DXTrace( __FILE__, (DWORD)__LINE__, 0, str, FALSE ) +#define DXTRACE_ERR(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, FALSE ) +#define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILE__, (DWORD)__LINE__, hr, str, TRUE ) +#else +#define DXTRACE_MSG(str) (0L) +#define DXTRACE_ERR(str,hr) (hr) +#define DXTRACE_ERR_MSGBOX(str,hr) (hr) +#endif + + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif // _DXERR9_H_ diff --git a/Src/Decoder_H264_ALL/D3D/include/dxfile.h b/Src/Decoder_H264_ALL/D3D/include/dxfile.h new file mode 100644 index 0000000..74e80e5 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dxfile.h @@ -0,0 +1,239 @@ +/*************************************************************************** + * + * Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved. + * + * File: dxfile.h + * + * Content: DirectX File public header file + * + ***************************************************************************/ + +#ifndef __DXFILE_H__ +#define __DXFILE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef DWORD DXFILEFORMAT; + +#define DXFILEFORMAT_BINARY 0 +#define DXFILEFORMAT_TEXT 1 +#define DXFILEFORMAT_COMPRESSED 2 + +typedef DWORD DXFILELOADOPTIONS; + +#define DXFILELOAD_FROMFILE 0x00L +#define DXFILELOAD_FROMRESOURCE 0x01L +#define DXFILELOAD_FROMMEMORY 0x02L +#define DXFILELOAD_FROMSTREAM 0x04L +#define DXFILELOAD_FROMURL 0x08L + +typedef struct _DXFILELOADRESOURCE { + HMODULE hModule; + LPCTSTR lpName; + LPCTSTR lpType; +}DXFILELOADRESOURCE, *LPDXFILELOADRESOURCE; + +typedef struct _DXFILELOADMEMORY { + LPVOID lpMemory; + DWORD dSize; +}DXFILELOADMEMORY, *LPDXFILELOADMEMORY; + +/* + * DirectX File object types. + */ + +#ifndef WIN_TYPES +#define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype +#endif + +WIN_TYPES(IDirectXFile, DIRECTXFILE); +WIN_TYPES(IDirectXFileEnumObject, DIRECTXFILEENUMOBJECT); +WIN_TYPES(IDirectXFileSaveObject, DIRECTXFILESAVEOBJECT); +WIN_TYPES(IDirectXFileObject, DIRECTXFILEOBJECT); +WIN_TYPES(IDirectXFileData, DIRECTXFILEDATA); +WIN_TYPES(IDirectXFileDataReference, DIRECTXFILEDATAREFERENCE); +WIN_TYPES(IDirectXFileBinary, DIRECTXFILEBINARY); + +/* + * API for creating IDirectXFile interface. + */ + +STDAPI DirectXFileCreate(LPDIRECTXFILE *lplpDirectXFile); + +/* + * The methods for IUnknown + */ + +#define IUNKNOWN_METHODS(kind) \ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) kind; \ + STDMETHOD_(ULONG, AddRef) (THIS) kind; \ + STDMETHOD_(ULONG, Release) (THIS) kind + +/* + * The methods for IDirectXFileObject + */ + +#define IDIRECTXFILEOBJECT_METHODS(kind) \ + STDMETHOD(GetName) (THIS_ LPSTR, LPDWORD) kind; \ + STDMETHOD(GetId) (THIS_ LPGUID) kind + +/* + * DirectX File interfaces. + */ + +#undef INTERFACE +#define INTERFACE IDirectXFile + +DECLARE_INTERFACE_(IDirectXFile, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + STDMETHOD(CreateEnumObject) (THIS_ LPVOID, DXFILELOADOPTIONS, + LPDIRECTXFILEENUMOBJECT *) PURE; + STDMETHOD(CreateSaveObject) (THIS_ LPCSTR, DXFILEFORMAT, + LPDIRECTXFILESAVEOBJECT *) PURE; + STDMETHOD(RegisterTemplates) (THIS_ LPVOID, DWORD) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectXFileEnumObject + +DECLARE_INTERFACE_(IDirectXFileEnumObject, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + STDMETHOD(GetNextDataObject) (THIS_ LPDIRECTXFILEDATA *) PURE; + STDMETHOD(GetDataObjectById) (THIS_ REFGUID, LPDIRECTXFILEDATA *) PURE; + STDMETHOD(GetDataObjectByName) (THIS_ LPCSTR, LPDIRECTXFILEDATA *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectXFileSaveObject + +DECLARE_INTERFACE_(IDirectXFileSaveObject, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + STDMETHOD(SaveTemplates) (THIS_ DWORD, const GUID **) PURE; + STDMETHOD(CreateDataObject) (THIS_ REFGUID, LPCSTR, const GUID *, + DWORD, LPVOID, LPDIRECTXFILEDATA *) PURE; + STDMETHOD(SaveData) (THIS_ LPDIRECTXFILEDATA) PURE; +}; + + +#undef INTERFACE +#define INTERFACE IDirectXFileObject + +DECLARE_INTERFACE_(IDirectXFileObject, IUnknown) +{ + IUNKNOWN_METHODS(PURE); + IDIRECTXFILEOBJECT_METHODS(PURE); +}; + +#undef INTERFACE +#define INTERFACE IDirectXFileData + +DECLARE_INTERFACE_(IDirectXFileData, IDirectXFileObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECTXFILEOBJECT_METHODS(PURE); + + STDMETHOD(GetData) (THIS_ LPCSTR, DWORD *, void **) PURE; + STDMETHOD(GetType) (THIS_ const GUID **) PURE; + STDMETHOD(GetNextObject) (THIS_ LPDIRECTXFILEOBJECT *) PURE; + STDMETHOD(AddDataObject) (THIS_ LPDIRECTXFILEDATA) PURE; + STDMETHOD(AddDataReference) (THIS_ LPCSTR, const GUID *) PURE; + STDMETHOD(AddBinaryObject) (THIS_ LPCSTR, const GUID *, LPCSTR, LPVOID, DWORD) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectXFileDataReference + +DECLARE_INTERFACE_(IDirectXFileDataReference, IDirectXFileObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECTXFILEOBJECT_METHODS(PURE); + + STDMETHOD(Resolve) (THIS_ LPDIRECTXFILEDATA *) PURE; +}; + +#undef INTERFACE +#define INTERFACE IDirectXFileBinary + +DECLARE_INTERFACE_(IDirectXFileBinary, IDirectXFileObject) +{ + IUNKNOWN_METHODS(PURE); + IDIRECTXFILEOBJECT_METHODS(PURE); + + STDMETHOD(GetSize) (THIS_ DWORD *) PURE; + STDMETHOD(GetMimeType) (THIS_ LPCSTR *) PURE; + STDMETHOD(Read) (THIS_ LPVOID, DWORD, LPDWORD) PURE; +}; + +/* + * DirectXFile Object Class Id (for CoCreateInstance()) + */ + +DEFINE_GUID(CLSID_CDirectXFile, 0x4516ec43, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3); + +/* + * DirectX File Interface GUIDs. + */ + +DEFINE_GUID(IID_IDirectXFile, 0x3d82ab40, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); +DEFINE_GUID(IID_IDirectXFileEnumObject, 0x3d82ab41, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); +DEFINE_GUID(IID_IDirectXFileSaveObject, 0x3d82ab42, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); +DEFINE_GUID(IID_IDirectXFileObject, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); +DEFINE_GUID(IID_IDirectXFileData, 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); +DEFINE_GUID(IID_IDirectXFileDataReference, 0x3d82ab45, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); +DEFINE_GUID(IID_IDirectXFileBinary, 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* + * DirectX File Header template's GUID. + */ + +DEFINE_GUID(TID_DXFILEHeader, 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + + +/* + * DirectX File errors. + */ + +#define _FACDD 0x876 +#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) + +#define DXFILE_OK 0 + +#define DXFILEERR_BADOBJECT MAKE_DDHRESULT(850) +#define DXFILEERR_BADVALUE MAKE_DDHRESULT(851) +#define DXFILEERR_BADTYPE MAKE_DDHRESULT(852) +#define DXFILEERR_BADSTREAMHANDLE MAKE_DDHRESULT(853) +#define DXFILEERR_BADALLOC MAKE_DDHRESULT(854) +#define DXFILEERR_NOTFOUND MAKE_DDHRESULT(855) +#define DXFILEERR_NOTDONEYET MAKE_DDHRESULT(856) +#define DXFILEERR_FILENOTFOUND MAKE_DDHRESULT(857) +#define DXFILEERR_RESOURCENOTFOUND MAKE_DDHRESULT(858) +#define DXFILEERR_URLNOTFOUND MAKE_DDHRESULT(859) +#define DXFILEERR_BADRESOURCE MAKE_DDHRESULT(860) +#define DXFILEERR_BADFILETYPE MAKE_DDHRESULT(861) +#define DXFILEERR_BADFILEVERSION MAKE_DDHRESULT(862) +#define DXFILEERR_BADFILEFLOATSIZE MAKE_DDHRESULT(863) +#define DXFILEERR_BADFILECOMPRESSIONTYPE MAKE_DDHRESULT(864) +#define DXFILEERR_BADFILE MAKE_DDHRESULT(865) +#define DXFILEERR_PARSEERROR MAKE_DDHRESULT(866) +#define DXFILEERR_NOTEMPLATE MAKE_DDHRESULT(867) +#define DXFILEERR_BADARRAYSIZE MAKE_DDHRESULT(868) +#define DXFILEERR_BADDATAREFERENCE MAKE_DDHRESULT(869) +#define DXFILEERR_INTERNALERROR MAKE_DDHRESULT(870) +#define DXFILEERR_NOMOREOBJECTS MAKE_DDHRESULT(871) +#define DXFILEERR_BADINTRINSICS MAKE_DDHRESULT(872) +#define DXFILEERR_NOMORESTREAMHANDLES MAKE_DDHRESULT(873) +#define DXFILEERR_NOMOREDATA MAKE_DDHRESULT(874) +#define DXFILEERR_BADCACHEFILE MAKE_DDHRESULT(875) +#define DXFILEERR_NOINTERNET MAKE_DDHRESULT(876) + + +#ifdef __cplusplus +}; +#endif + +#endif /* _DXFILE_H_ */ diff --git a/Src/Decoder_H264_ALL/D3D/include/dxsdkver.h b/Src/Decoder_H264_ALL/D3D/include/dxsdkver.h new file mode 100644 index 0000000..13e2c71 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dxsdkver.h @@ -0,0 +1,18 @@ +/*==========================================================================; + * + * + * File: dxsdkver.h + * Content: DirectX SDK Version Include File + * + ****************************************************************************/ + +#ifndef _DXSDKVER_H_ +#define _DXSDKVER_H_ + +#define _DXSDK_PRODUCT_MAJOR 9 +#define _DXSDK_PRODUCT_MINOR 28 +#define _DXSDK_BUILD_MAJOR 1886 +#define _DXSDK_BUILD_MINOR 0 + +#endif // _DXSDKVER_H_ + diff --git a/Src/Decoder_H264_ALL/D3D/include/dxtrans.h b/Src/Decoder_H264_ALL/D3D/include/dxtrans.h new file mode 100644 index 0000000..8df2ff7 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/dxtrans.h @@ -0,0 +1,5362 @@ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 6.00.0357 */ +/* Compiler settings for dxtrans.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 440 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __dxtrans_h__ +#define __dxtrans_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __IDXBaseObject_FWD_DEFINED__ +#define __IDXBaseObject_FWD_DEFINED__ +typedef interface IDXBaseObject IDXBaseObject; +#endif /* __IDXBaseObject_FWD_DEFINED__ */ + + +#ifndef __IDXTransformFactory_FWD_DEFINED__ +#define __IDXTransformFactory_FWD_DEFINED__ +typedef interface IDXTransformFactory IDXTransformFactory; +#endif /* __IDXTransformFactory_FWD_DEFINED__ */ + + +#ifndef __IDXTransform_FWD_DEFINED__ +#define __IDXTransform_FWD_DEFINED__ +typedef interface IDXTransform IDXTransform; +#endif /* __IDXTransform_FWD_DEFINED__ */ + + +#ifndef __IDXSurfacePick_FWD_DEFINED__ +#define __IDXSurfacePick_FWD_DEFINED__ +typedef interface IDXSurfacePick IDXSurfacePick; +#endif /* __IDXSurfacePick_FWD_DEFINED__ */ + + +#ifndef __IDXTBindHost_FWD_DEFINED__ +#define __IDXTBindHost_FWD_DEFINED__ +typedef interface IDXTBindHost IDXTBindHost; +#endif /* __IDXTBindHost_FWD_DEFINED__ */ + + +#ifndef __IDXTaskManager_FWD_DEFINED__ +#define __IDXTaskManager_FWD_DEFINED__ +typedef interface IDXTaskManager IDXTaskManager; +#endif /* __IDXTaskManager_FWD_DEFINED__ */ + + +#ifndef __IDXSurfaceFactory_FWD_DEFINED__ +#define __IDXSurfaceFactory_FWD_DEFINED__ +typedef interface IDXSurfaceFactory IDXSurfaceFactory; +#endif /* __IDXSurfaceFactory_FWD_DEFINED__ */ + + +#ifndef __IDXSurfaceModifier_FWD_DEFINED__ +#define __IDXSurfaceModifier_FWD_DEFINED__ +typedef interface IDXSurfaceModifier IDXSurfaceModifier; +#endif /* __IDXSurfaceModifier_FWD_DEFINED__ */ + + +#ifndef __IDXSurface_FWD_DEFINED__ +#define __IDXSurface_FWD_DEFINED__ +typedef interface IDXSurface IDXSurface; +#endif /* __IDXSurface_FWD_DEFINED__ */ + + +#ifndef __IDXSurfaceInit_FWD_DEFINED__ +#define __IDXSurfaceInit_FWD_DEFINED__ +typedef interface IDXSurfaceInit IDXSurfaceInit; +#endif /* __IDXSurfaceInit_FWD_DEFINED__ */ + + +#ifndef __IDXARGBSurfaceInit_FWD_DEFINED__ +#define __IDXARGBSurfaceInit_FWD_DEFINED__ +typedef interface IDXARGBSurfaceInit IDXARGBSurfaceInit; +#endif /* __IDXARGBSurfaceInit_FWD_DEFINED__ */ + + +#ifndef __IDXARGBReadPtr_FWD_DEFINED__ +#define __IDXARGBReadPtr_FWD_DEFINED__ +typedef interface IDXARGBReadPtr IDXARGBReadPtr; +#endif /* __IDXARGBReadPtr_FWD_DEFINED__ */ + + +#ifndef __IDXARGBReadWritePtr_FWD_DEFINED__ +#define __IDXARGBReadWritePtr_FWD_DEFINED__ +typedef interface IDXARGBReadWritePtr IDXARGBReadWritePtr; +#endif /* __IDXARGBReadWritePtr_FWD_DEFINED__ */ + + +#ifndef __IDXDCLock_FWD_DEFINED__ +#define __IDXDCLock_FWD_DEFINED__ +typedef interface IDXDCLock IDXDCLock; +#endif /* __IDXDCLock_FWD_DEFINED__ */ + + +#ifndef __IDXTScaleOutput_FWD_DEFINED__ +#define __IDXTScaleOutput_FWD_DEFINED__ +typedef interface IDXTScaleOutput IDXTScaleOutput; +#endif /* __IDXTScaleOutput_FWD_DEFINED__ */ + + +#ifndef __IDXGradient_FWD_DEFINED__ +#define __IDXGradient_FWD_DEFINED__ +typedef interface IDXGradient IDXGradient; +#endif /* __IDXGradient_FWD_DEFINED__ */ + + +#ifndef __IDXTScale_FWD_DEFINED__ +#define __IDXTScale_FWD_DEFINED__ +typedef interface IDXTScale IDXTScale; +#endif /* __IDXTScale_FWD_DEFINED__ */ + + +#ifndef __IDXEffect_FWD_DEFINED__ +#define __IDXEffect_FWD_DEFINED__ +typedef interface IDXEffect IDXEffect; +#endif /* __IDXEffect_FWD_DEFINED__ */ + + +#ifndef __IDXLookupTable_FWD_DEFINED__ +#define __IDXLookupTable_FWD_DEFINED__ +typedef interface IDXLookupTable IDXLookupTable; +#endif /* __IDXLookupTable_FWD_DEFINED__ */ + + +#ifndef __IDXRawSurface_FWD_DEFINED__ +#define __IDXRawSurface_FWD_DEFINED__ +typedef interface IDXRawSurface IDXRawSurface; +#endif /* __IDXRawSurface_FWD_DEFINED__ */ + + +#ifndef __IHTMLDXTransform_FWD_DEFINED__ +#define __IHTMLDXTransform_FWD_DEFINED__ +typedef interface IHTMLDXTransform IHTMLDXTransform; +#endif /* __IHTMLDXTransform_FWD_DEFINED__ */ + + +#ifndef __ICSSFilterDispatch_FWD_DEFINED__ +#define __ICSSFilterDispatch_FWD_DEFINED__ +typedef interface ICSSFilterDispatch ICSSFilterDispatch; +#endif /* __ICSSFilterDispatch_FWD_DEFINED__ */ + + +#ifndef __DXTransformFactory_FWD_DEFINED__ +#define __DXTransformFactory_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DXTransformFactory DXTransformFactory; +#else +typedef struct DXTransformFactory DXTransformFactory; +#endif /* __cplusplus */ + +#endif /* __DXTransformFactory_FWD_DEFINED__ */ + + +#ifndef __DXTaskManager_FWD_DEFINED__ +#define __DXTaskManager_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DXTaskManager DXTaskManager; +#else +typedef struct DXTaskManager DXTaskManager; +#endif /* __cplusplus */ + +#endif /* __DXTaskManager_FWD_DEFINED__ */ + + +#ifndef __DXTScale_FWD_DEFINED__ +#define __DXTScale_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DXTScale DXTScale; +#else +typedef struct DXTScale DXTScale; +#endif /* __cplusplus */ + +#endif /* __DXTScale_FWD_DEFINED__ */ + + +#ifndef __DXSurface_FWD_DEFINED__ +#define __DXSurface_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DXSurface DXSurface; +#else +typedef struct DXSurface DXSurface; +#endif /* __cplusplus */ + +#endif /* __DXSurface_FWD_DEFINED__ */ + + +#ifndef __DXSurfaceModifier_FWD_DEFINED__ +#define __DXSurfaceModifier_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DXSurfaceModifier DXSurfaceModifier; +#else +typedef struct DXSurfaceModifier DXSurfaceModifier; +#endif /* __cplusplus */ + +#endif /* __DXSurfaceModifier_FWD_DEFINED__ */ + + +#ifndef __DXGradient_FWD_DEFINED__ +#define __DXGradient_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DXGradient DXGradient; +#else +typedef struct DXGradient DXGradient; +#endif /* __cplusplus */ + +#endif /* __DXGradient_FWD_DEFINED__ */ + + +#ifndef __DXTFilter_FWD_DEFINED__ +#define __DXTFilter_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DXTFilter DXTFilter; +#else +typedef struct DXTFilter DXTFilter; +#endif /* __cplusplus */ + +#endif /* __DXTFilter_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "comcat.h" + +#ifdef __cplusplus +extern "C"{ +#endif + +void * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void * ); + +/* interface __MIDL_itf_dxtrans_0000 */ +/* [local] */ + +#include +#include +#include +#include +#include +#if 0 +// Bogus definition used to make MIDL compiler happy +typedef void DDSURFACEDESC; + +typedef void D3DRMBOX; + +typedef void D3DVECTOR; + +typedef void D3DRMMATRIX4D; + +typedef void *LPSECURITY_ATTRIBUTES; + +#endif +#ifdef _DXTRANSIMPL + #define _DXTRANS_IMPL_EXT _declspec(dllexport) +#else + #define _DXTRANS_IMPL_EXT _declspec(dllimport) +#endif + + + + + + + + + + + + + + + + +// +// All GUIDs for DXTransform are declared in DXTGUID.C in the SDK include directory +// +EXTERN_C const GUID DDPF_RGB1; +EXTERN_C const GUID DDPF_RGB2; +EXTERN_C const GUID DDPF_RGB4; +EXTERN_C const GUID DDPF_RGB8; +EXTERN_C const GUID DDPF_RGB332; +EXTERN_C const GUID DDPF_ARGB4444; +EXTERN_C const GUID DDPF_RGB565; +EXTERN_C const GUID DDPF_BGR565; +EXTERN_C const GUID DDPF_RGB555; +EXTERN_C const GUID DDPF_ARGB1555; +EXTERN_C const GUID DDPF_RGB24; +EXTERN_C const GUID DDPF_BGR24; +EXTERN_C const GUID DDPF_RGB32; +EXTERN_C const GUID DDPF_BGR32; +EXTERN_C const GUID DDPF_ABGR32; +EXTERN_C const GUID DDPF_ARGB32; +EXTERN_C const GUID DDPF_PMARGB32; +EXTERN_C const GUID DDPF_A1; +EXTERN_C const GUID DDPF_A2; +EXTERN_C const GUID DDPF_A4; +EXTERN_C const GUID DDPF_A8; +EXTERN_C const GUID DDPF_Z8; +EXTERN_C const GUID DDPF_Z16; +EXTERN_C const GUID DDPF_Z24; +EXTERN_C const GUID DDPF_Z32; +// +// Component categories +// +EXTERN_C const GUID CATID_DXImageTransform; +EXTERN_C const GUID CATID_DX3DTransform; +EXTERN_C const GUID CATID_DXAuthoringTransform; +EXTERN_C const GUID CATID_DXSurface; +// +// Service IDs +// +EXTERN_C const GUID SID_SDirectDraw; +EXTERN_C const GUID SID_SDirect3DRM; +#define SID_SDXTaskManager CLSID_DXTaskManager +#define SID_SDXSurfaceFactory IID_IDXSurfaceFactory +#define SID_SDXTransformFactory IID_IDXTransformFactory +// +// DXTransforms Core Type Library Version Info +// +#define DXTRANS_TLB_MAJOR_VER 1 +#define DXTRANS_TLB_MINOR_VER 1 + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0000_v0_0_s_ifspec; + +#ifndef __IDXBaseObject_INTERFACE_DEFINED__ +#define __IDXBaseObject_INTERFACE_DEFINED__ + +/* interface IDXBaseObject */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXBaseObject; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("17B59B2B-9CC8-11d1-9053-00C04FD9189D") + IDXBaseObject : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetGenerationId( + /* [out] */ ULONG *pID) = 0; + + virtual HRESULT STDMETHODCALLTYPE IncrementGenerationId( + /* [in] */ BOOL bRefresh) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetObjectSize( + /* [out] */ ULONG *pcbSize) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXBaseObjectVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXBaseObject * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXBaseObject * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXBaseObject * This); + + HRESULT ( STDMETHODCALLTYPE *GetGenerationId )( + IDXBaseObject * This, + /* [out] */ ULONG *pID); + + HRESULT ( STDMETHODCALLTYPE *IncrementGenerationId )( + IDXBaseObject * This, + /* [in] */ BOOL bRefresh); + + HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( + IDXBaseObject * This, + /* [out] */ ULONG *pcbSize); + + END_INTERFACE + } IDXBaseObjectVtbl; + + interface IDXBaseObject + { + CONST_VTBL struct IDXBaseObjectVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXBaseObject_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXBaseObject_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXBaseObject_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXBaseObject_GetGenerationId(This,pID) \ + (This)->lpVtbl -> GetGenerationId(This,pID) + +#define IDXBaseObject_IncrementGenerationId(This,bRefresh) \ + (This)->lpVtbl -> IncrementGenerationId(This,bRefresh) + +#define IDXBaseObject_GetObjectSize(This,pcbSize) \ + (This)->lpVtbl -> GetObjectSize(This,pcbSize) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXBaseObject_GetGenerationId_Proxy( + IDXBaseObject * This, + /* [out] */ ULONG *pID); + + +void __RPC_STUB IDXBaseObject_GetGenerationId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXBaseObject_IncrementGenerationId_Proxy( + IDXBaseObject * This, + /* [in] */ BOOL bRefresh); + + +void __RPC_STUB IDXBaseObject_IncrementGenerationId_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXBaseObject_GetObjectSize_Proxy( + IDXBaseObject * This, + /* [out] */ ULONG *pcbSize); + + +void __RPC_STUB IDXBaseObject_GetObjectSize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXBaseObject_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0260 */ +/* [local] */ + +typedef +enum DXBNDID + { DXB_X = 0, + DXB_Y = 1, + DXB_Z = 2, + DXB_T = 3 + } DXBNDID; + +typedef +enum DXBNDTYPE + { DXBT_DISCRETE = 0, + DXBT_DISCRETE64 = DXBT_DISCRETE + 1, + DXBT_CONTINUOUS = DXBT_DISCRETE64 + 1, + DXBT_CONTINUOUS64 = DXBT_CONTINUOUS + 1 + } DXBNDTYPE; + +typedef struct DXDBND + { + long Min; + long Max; + } DXDBND; + +typedef DXDBND DXDBNDS[ 4 ]; + +typedef struct DXDBND64 + { + LONGLONG Min; + LONGLONG Max; + } DXDBND64; + +typedef DXDBND64 DXDBNDS64[ 4 ]; + +typedef struct DXCBND + { + float Min; + float Max; + } DXCBND; + +typedef DXCBND DXCBNDS[ 4 ]; + +typedef struct DXCBND64 + { + double Min; + double Max; + } DXCBND64; + +typedef DXCBND64 DXCBNDS64[ 4 ]; + +typedef struct DXBNDS + { + DXBNDTYPE eType; + /* [switch_is] */ /* [switch_type] */ union __MIDL___MIDL_itf_dxtrans_0260_0001 + { + /* [case()] */ DXDBND D[ 4 ]; + /* [case()] */ DXDBND64 LD[ 4 ]; + /* [case()] */ DXCBND C[ 4 ]; + /* [case()] */ DXCBND64 LC[ 4 ]; + } u; + } DXBNDS; + +typedef long DXDVEC[ 4 ]; + +typedef LONGLONG DXDVEC64[ 4 ]; + +typedef float DXCVEC[ 4 ]; + +typedef double DXCVEC64[ 4 ]; + +typedef struct DXVEC + { + DXBNDTYPE eType; + /* [switch_is] */ /* [switch_type] */ union __MIDL___MIDL_itf_dxtrans_0260_0002 + { + /* [case()] */ long D[ 4 ]; + /* [case()] */ LONGLONG LD[ 4 ]; + /* [case()] */ float C[ 4 ]; + /* [case()] */ double LC[ 4 ]; + } u; + } DXVEC; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0260_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0260_v0_0_s_ifspec; + +#ifndef __IDXTransformFactory_INTERFACE_DEFINED__ +#define __IDXTransformFactory_INTERFACE_DEFINED__ + +/* interface IDXTransformFactory */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXTransformFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6A950B2B-A971-11d1-81C8-0000F87557DB") + IDXTransformFactory : public IServiceProvider + { + public: + virtual HRESULT STDMETHODCALLTYPE SetService( + /* [in] */ REFGUID guidService, + /* [in] */ IUnknown *pUnkService, + /* [in] */ BOOL bWeakReference) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateTransform( + /* [size_is][in] */ IUnknown **punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown **punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ IPropertyBag *pInitProps, + /* [in] */ IErrorLog *pErrLog, + /* [in] */ REFCLSID TransCLSID, + /* [in] */ REFIID TransIID, + /* [iid_is][out] */ void **ppTransform) = 0; + + virtual HRESULT STDMETHODCALLTYPE InitializeTransform( + /* [in] */ IDXTransform *pTransform, + /* [size_is][in] */ IUnknown **punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown **punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ IPropertyBag *pInitProps, + /* [in] */ IErrorLog *pErrLog) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXTransformFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXTransformFactory * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXTransformFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXTransformFactory * This); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *QueryService )( + IDXTransformFactory * This, + /* [in] */ REFGUID guidService, + /* [in] */ REFIID riid, + /* [out] */ void **ppvObject); + + HRESULT ( STDMETHODCALLTYPE *SetService )( + IDXTransformFactory * This, + /* [in] */ REFGUID guidService, + /* [in] */ IUnknown *pUnkService, + /* [in] */ BOOL bWeakReference); + + HRESULT ( STDMETHODCALLTYPE *CreateTransform )( + IDXTransformFactory * This, + /* [size_is][in] */ IUnknown **punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown **punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ IPropertyBag *pInitProps, + /* [in] */ IErrorLog *pErrLog, + /* [in] */ REFCLSID TransCLSID, + /* [in] */ REFIID TransIID, + /* [iid_is][out] */ void **ppTransform); + + HRESULT ( STDMETHODCALLTYPE *InitializeTransform )( + IDXTransformFactory * This, + /* [in] */ IDXTransform *pTransform, + /* [size_is][in] */ IUnknown **punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown **punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ IPropertyBag *pInitProps, + /* [in] */ IErrorLog *pErrLog); + + END_INTERFACE + } IDXTransformFactoryVtbl; + + interface IDXTransformFactory + { + CONST_VTBL struct IDXTransformFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXTransformFactory_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXTransformFactory_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXTransformFactory_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXTransformFactory_QueryService(This,guidService,riid,ppvObject) \ + (This)->lpVtbl -> QueryService(This,guidService,riid,ppvObject) + + +#define IDXTransformFactory_SetService(This,guidService,pUnkService,bWeakReference) \ + (This)->lpVtbl -> SetService(This,guidService,pUnkService,bWeakReference) + +#define IDXTransformFactory_CreateTransform(This,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,pInitProps,pErrLog,TransCLSID,TransIID,ppTransform) \ + (This)->lpVtbl -> CreateTransform(This,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,pInitProps,pErrLog,TransCLSID,TransIID,ppTransform) + +#define IDXTransformFactory_InitializeTransform(This,pTransform,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,pInitProps,pErrLog) \ + (This)->lpVtbl -> InitializeTransform(This,pTransform,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,pInitProps,pErrLog) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXTransformFactory_SetService_Proxy( + IDXTransformFactory * This, + /* [in] */ REFGUID guidService, + /* [in] */ IUnknown *pUnkService, + /* [in] */ BOOL bWeakReference); + + +void __RPC_STUB IDXTransformFactory_SetService_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransformFactory_CreateTransform_Proxy( + IDXTransformFactory * This, + /* [size_is][in] */ IUnknown **punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown **punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ IPropertyBag *pInitProps, + /* [in] */ IErrorLog *pErrLog, + /* [in] */ REFCLSID TransCLSID, + /* [in] */ REFIID TransIID, + /* [iid_is][out] */ void **ppTransform); + + +void __RPC_STUB IDXTransformFactory_CreateTransform_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransformFactory_InitializeTransform_Proxy( + IDXTransformFactory * This, + /* [in] */ IDXTransform *pTransform, + /* [size_is][in] */ IUnknown **punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown **punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ IPropertyBag *pInitProps, + /* [in] */ IErrorLog *pErrLog); + + +void __RPC_STUB IDXTransformFactory_InitializeTransform_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXTransformFactory_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0261 */ +/* [local] */ + +typedef +enum DXTMISCFLAGS + { DXTMF_BLEND_WITH_OUTPUT = 1L << 0, + DXTMF_DITHER_OUTPUT = 1L << 1, + DXTMF_OPTION_MASK = 0xffff, + DXTMF_VALID_OPTIONS = DXTMF_BLEND_WITH_OUTPUT | DXTMF_DITHER_OUTPUT, + DXTMF_BLEND_SUPPORTED = 1L << 16, + DXTMF_DITHER_SUPPORTED = 1L << 17, + DXTMF_INPLACE_OPERATION = 1L << 24, + DXTMF_BOUNDS_SUPPORTED = 1L << 25, + DXTMF_PLACEMENT_SUPPORTED = 1L << 26, + DXTMF_QUALITY_SUPPORTED = 1L << 27, + DXTMF_OPAQUE_RESULT = 1L << 28 + } DXTMISCFLAGS; + +typedef +enum DXINOUTINFOFLAGS + { DXINOUTF_OPTIONAL = 1L << 0 + } DXINOUTINFOFLAGS; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0261_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0261_v0_0_s_ifspec; + +#ifndef __IDXTransform_INTERFACE_DEFINED__ +#define __IDXTransform_INTERFACE_DEFINED__ + +/* interface IDXTransform */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXTransform; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("30A5FB78-E11F-11d1-9064-00C04FD9189D") + IDXTransform : public IDXBaseObject + { + public: + virtual HRESULT STDMETHODCALLTYPE Setup( + /* [size_is][in] */ IUnknown *const *punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown *const *punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ DWORD dwFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE Execute( + /* [in] */ const GUID *pRequestID, + /* [in] */ const DXBNDS *pClipBnds, + /* [in] */ const DXVEC *pPlacement) = 0; + + virtual HRESULT STDMETHODCALLTYPE MapBoundsIn2Out( + /* [in] */ const DXBNDS *pInBounds, + /* [in] */ ULONG ulNumInBnds, + /* [in] */ ULONG ulOutIndex, + /* [out] */ DXBNDS *pOutBounds) = 0; + + virtual HRESULT STDMETHODCALLTYPE MapBoundsOut2In( + /* [in] */ ULONG ulOutIndex, + /* [in] */ const DXBNDS *pOutBounds, + /* [in] */ ULONG ulInIndex, + /* [out] */ DXBNDS *pInBounds) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetMiscFlags( + /* [in] */ DWORD dwMiscFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetMiscFlags( + /* [out] */ DWORD *pdwMiscFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetInOutInfo( + /* [in] */ BOOL bIsOutput, + /* [in] */ ULONG ulIndex, + /* [out] */ DWORD *pdwFlags, + /* [size_is][out] */ GUID *pIDs, + /* [out][in] */ ULONG *pcIDs, + /* [out] */ IUnknown **ppUnkCurrentObject) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetQuality( + /* [in] */ float fQuality) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetQuality( + /* [out] */ float *fQuality) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXTransformVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXTransform * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXTransform * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXTransform * This); + + HRESULT ( STDMETHODCALLTYPE *GetGenerationId )( + IDXTransform * This, + /* [out] */ ULONG *pID); + + HRESULT ( STDMETHODCALLTYPE *IncrementGenerationId )( + IDXTransform * This, + /* [in] */ BOOL bRefresh); + + HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( + IDXTransform * This, + /* [out] */ ULONG *pcbSize); + + HRESULT ( STDMETHODCALLTYPE *Setup )( + IDXTransform * This, + /* [size_is][in] */ IUnknown *const *punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown *const *punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ DWORD dwFlags); + + HRESULT ( STDMETHODCALLTYPE *Execute )( + IDXTransform * This, + /* [in] */ const GUID *pRequestID, + /* [in] */ const DXBNDS *pClipBnds, + /* [in] */ const DXVEC *pPlacement); + + HRESULT ( STDMETHODCALLTYPE *MapBoundsIn2Out )( + IDXTransform * This, + /* [in] */ const DXBNDS *pInBounds, + /* [in] */ ULONG ulNumInBnds, + /* [in] */ ULONG ulOutIndex, + /* [out] */ DXBNDS *pOutBounds); + + HRESULT ( STDMETHODCALLTYPE *MapBoundsOut2In )( + IDXTransform * This, + /* [in] */ ULONG ulOutIndex, + /* [in] */ const DXBNDS *pOutBounds, + /* [in] */ ULONG ulInIndex, + /* [out] */ DXBNDS *pInBounds); + + HRESULT ( STDMETHODCALLTYPE *SetMiscFlags )( + IDXTransform * This, + /* [in] */ DWORD dwMiscFlags); + + HRESULT ( STDMETHODCALLTYPE *GetMiscFlags )( + IDXTransform * This, + /* [out] */ DWORD *pdwMiscFlags); + + HRESULT ( STDMETHODCALLTYPE *GetInOutInfo )( + IDXTransform * This, + /* [in] */ BOOL bIsOutput, + /* [in] */ ULONG ulIndex, + /* [out] */ DWORD *pdwFlags, + /* [size_is][out] */ GUID *pIDs, + /* [out][in] */ ULONG *pcIDs, + /* [out] */ IUnknown **ppUnkCurrentObject); + + HRESULT ( STDMETHODCALLTYPE *SetQuality )( + IDXTransform * This, + /* [in] */ float fQuality); + + HRESULT ( STDMETHODCALLTYPE *GetQuality )( + IDXTransform * This, + /* [out] */ float *fQuality); + + END_INTERFACE + } IDXTransformVtbl; + + interface IDXTransform + { + CONST_VTBL struct IDXTransformVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXTransform_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXTransform_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXTransform_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXTransform_GetGenerationId(This,pID) \ + (This)->lpVtbl -> GetGenerationId(This,pID) + +#define IDXTransform_IncrementGenerationId(This,bRefresh) \ + (This)->lpVtbl -> IncrementGenerationId(This,bRefresh) + +#define IDXTransform_GetObjectSize(This,pcbSize) \ + (This)->lpVtbl -> GetObjectSize(This,pcbSize) + + +#define IDXTransform_Setup(This,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,dwFlags) \ + (This)->lpVtbl -> Setup(This,punkInputs,ulNumInputs,punkOutputs,ulNumOutputs,dwFlags) + +#define IDXTransform_Execute(This,pRequestID,pClipBnds,pPlacement) \ + (This)->lpVtbl -> Execute(This,pRequestID,pClipBnds,pPlacement) + +#define IDXTransform_MapBoundsIn2Out(This,pInBounds,ulNumInBnds,ulOutIndex,pOutBounds) \ + (This)->lpVtbl -> MapBoundsIn2Out(This,pInBounds,ulNumInBnds,ulOutIndex,pOutBounds) + +#define IDXTransform_MapBoundsOut2In(This,ulOutIndex,pOutBounds,ulInIndex,pInBounds) \ + (This)->lpVtbl -> MapBoundsOut2In(This,ulOutIndex,pOutBounds,ulInIndex,pInBounds) + +#define IDXTransform_SetMiscFlags(This,dwMiscFlags) \ + (This)->lpVtbl -> SetMiscFlags(This,dwMiscFlags) + +#define IDXTransform_GetMiscFlags(This,pdwMiscFlags) \ + (This)->lpVtbl -> GetMiscFlags(This,pdwMiscFlags) + +#define IDXTransform_GetInOutInfo(This,bIsOutput,ulIndex,pdwFlags,pIDs,pcIDs,ppUnkCurrentObject) \ + (This)->lpVtbl -> GetInOutInfo(This,bIsOutput,ulIndex,pdwFlags,pIDs,pcIDs,ppUnkCurrentObject) + +#define IDXTransform_SetQuality(This,fQuality) \ + (This)->lpVtbl -> SetQuality(This,fQuality) + +#define IDXTransform_GetQuality(This,fQuality) \ + (This)->lpVtbl -> GetQuality(This,fQuality) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXTransform_Setup_Proxy( + IDXTransform * This, + /* [size_is][in] */ IUnknown *const *punkInputs, + /* [in] */ ULONG ulNumInputs, + /* [size_is][in] */ IUnknown *const *punkOutputs, + /* [in] */ ULONG ulNumOutputs, + /* [in] */ DWORD dwFlags); + + +void __RPC_STUB IDXTransform_Setup_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_Execute_Proxy( + IDXTransform * This, + /* [in] */ const GUID *pRequestID, + /* [in] */ const DXBNDS *pClipBnds, + /* [in] */ const DXVEC *pPlacement); + + +void __RPC_STUB IDXTransform_Execute_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_MapBoundsIn2Out_Proxy( + IDXTransform * This, + /* [in] */ const DXBNDS *pInBounds, + /* [in] */ ULONG ulNumInBnds, + /* [in] */ ULONG ulOutIndex, + /* [out] */ DXBNDS *pOutBounds); + + +void __RPC_STUB IDXTransform_MapBoundsIn2Out_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_MapBoundsOut2In_Proxy( + IDXTransform * This, + /* [in] */ ULONG ulOutIndex, + /* [in] */ const DXBNDS *pOutBounds, + /* [in] */ ULONG ulInIndex, + /* [out] */ DXBNDS *pInBounds); + + +void __RPC_STUB IDXTransform_MapBoundsOut2In_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_SetMiscFlags_Proxy( + IDXTransform * This, + /* [in] */ DWORD dwMiscFlags); + + +void __RPC_STUB IDXTransform_SetMiscFlags_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_GetMiscFlags_Proxy( + IDXTransform * This, + /* [out] */ DWORD *pdwMiscFlags); + + +void __RPC_STUB IDXTransform_GetMiscFlags_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_GetInOutInfo_Proxy( + IDXTransform * This, + /* [in] */ BOOL bIsOutput, + /* [in] */ ULONG ulIndex, + /* [out] */ DWORD *pdwFlags, + /* [size_is][out] */ GUID *pIDs, + /* [out][in] */ ULONG *pcIDs, + /* [out] */ IUnknown **ppUnkCurrentObject); + + +void __RPC_STUB IDXTransform_GetInOutInfo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_SetQuality_Proxy( + IDXTransform * This, + /* [in] */ float fQuality); + + +void __RPC_STUB IDXTransform_SetQuality_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTransform_GetQuality_Proxy( + IDXTransform * This, + /* [out] */ float *fQuality); + + +void __RPC_STUB IDXTransform_GetQuality_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXTransform_INTERFACE_DEFINED__ */ + + +#ifndef __IDXSurfacePick_INTERFACE_DEFINED__ +#define __IDXSurfacePick_INTERFACE_DEFINED__ + +/* interface IDXSurfacePick */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXSurfacePick; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("30A5FB79-E11F-11d1-9064-00C04FD9189D") + IDXSurfacePick : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE PointPick( + /* [in] */ const DXVEC *pPoint, + /* [out] */ ULONG *pulInputSurfaceIndex, + /* [out] */ DXVEC *pInputPoint) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXSurfacePickVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXSurfacePick * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXSurfacePick * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXSurfacePick * This); + + HRESULT ( STDMETHODCALLTYPE *PointPick )( + IDXSurfacePick * This, + /* [in] */ const DXVEC *pPoint, + /* [out] */ ULONG *pulInputSurfaceIndex, + /* [out] */ DXVEC *pInputPoint); + + END_INTERFACE + } IDXSurfacePickVtbl; + + interface IDXSurfacePick + { + CONST_VTBL struct IDXSurfacePickVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXSurfacePick_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXSurfacePick_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXSurfacePick_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXSurfacePick_PointPick(This,pPoint,pulInputSurfaceIndex,pInputPoint) \ + (This)->lpVtbl -> PointPick(This,pPoint,pulInputSurfaceIndex,pInputPoint) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXSurfacePick_PointPick_Proxy( + IDXSurfacePick * This, + /* [in] */ const DXVEC *pPoint, + /* [out] */ ULONG *pulInputSurfaceIndex, + /* [out] */ DXVEC *pInputPoint); + + +void __RPC_STUB IDXSurfacePick_PointPick_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXSurfacePick_INTERFACE_DEFINED__ */ + + +#ifndef __IDXTBindHost_INTERFACE_DEFINED__ +#define __IDXTBindHost_INTERFACE_DEFINED__ + +/* interface IDXTBindHost */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXTBindHost; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D26BCE55-E9DC-11d1-9066-00C04FD9189D") + IDXTBindHost : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetBindHost( + /* [in] */ IBindHost *pBindHost) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXTBindHostVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXTBindHost * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXTBindHost * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXTBindHost * This); + + HRESULT ( STDMETHODCALLTYPE *SetBindHost )( + IDXTBindHost * This, + /* [in] */ IBindHost *pBindHost); + + END_INTERFACE + } IDXTBindHostVtbl; + + interface IDXTBindHost + { + CONST_VTBL struct IDXTBindHostVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXTBindHost_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXTBindHost_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXTBindHost_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXTBindHost_SetBindHost(This,pBindHost) \ + (This)->lpVtbl -> SetBindHost(This,pBindHost) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXTBindHost_SetBindHost_Proxy( + IDXTBindHost * This, + /* [in] */ IBindHost *pBindHost); + + +void __RPC_STUB IDXTBindHost_SetBindHost_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXTBindHost_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0264 */ +/* [local] */ + +typedef void __stdcall __stdcall DXTASKPROC( + void *pTaskData, + BOOL *pbContinueProcessing); + +typedef DXTASKPROC *PFNDXTASKPROC; + +typedef void __stdcall __stdcall DXAPCPROC( + DWORD dwData); + +typedef DXAPCPROC *PFNDXAPCPROC; + +#ifdef __cplusplus +typedef struct DXTMTASKINFO +{ + PFNDXTASKPROC pfnTaskProc; // Pointer to function to execute + PVOID pTaskData; // Pointer to argument data + PFNDXAPCPROC pfnCompletionAPC; // Pointer to completion APC proc + DWORD dwCompletionData; // Pointer to APC proc data + const GUID* pRequestID; // Used to identify groups of tasks +} DXTMTASKINFO; +#else +typedef struct DXTMTASKINFO + { + PVOID pfnTaskProc; + PVOID pTaskData; + PVOID pfnCompletionAPC; + DWORD dwCompletionData; + const GUID *pRequestID; + } DXTMTASKINFO; + +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0264_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0264_v0_0_s_ifspec; + +#ifndef __IDXTaskManager_INTERFACE_DEFINED__ +#define __IDXTaskManager_INTERFACE_DEFINED__ + +/* interface IDXTaskManager */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXTaskManager; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("254DBBC1-F922-11d0-883A-3C8B00C10000") + IDXTaskManager : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE QueryNumProcessors( + /* [out] */ ULONG *pulNumProc) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetThreadPoolSize( + /* [in] */ ULONG ulNumThreads) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetThreadPoolSize( + /* [out] */ ULONG *pulNumThreads) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetConcurrencyLimit( + /* [in] */ ULONG ulNumThreads) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetConcurrencyLimit( + /* [out] */ ULONG *pulNumThreads) = 0; + + virtual HRESULT STDMETHODCALLTYPE ScheduleTasks( + /* [in] */ DXTMTASKINFO TaskInfo[ ], + /* [in] */ HANDLE Events[ ], + /* [out] */ DWORD TaskIDs[ ], + /* [in] */ ULONG ulNumTasks, + /* [in] */ ULONG ulWaitPeriod) = 0; + + virtual HRESULT STDMETHODCALLTYPE TerminateTasks( + /* [in] */ DWORD TaskIDs[ ], + /* [in] */ ULONG ulCount, + /* [in] */ ULONG ulTimeOut) = 0; + + virtual HRESULT STDMETHODCALLTYPE TerminateRequest( + /* [in] */ REFIID RequestID, + /* [in] */ ULONG ulTimeOut) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXTaskManagerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXTaskManager * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXTaskManager * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXTaskManager * This); + + HRESULT ( STDMETHODCALLTYPE *QueryNumProcessors )( + IDXTaskManager * This, + /* [out] */ ULONG *pulNumProc); + + HRESULT ( STDMETHODCALLTYPE *SetThreadPoolSize )( + IDXTaskManager * This, + /* [in] */ ULONG ulNumThreads); + + HRESULT ( STDMETHODCALLTYPE *GetThreadPoolSize )( + IDXTaskManager * This, + /* [out] */ ULONG *pulNumThreads); + + HRESULT ( STDMETHODCALLTYPE *SetConcurrencyLimit )( + IDXTaskManager * This, + /* [in] */ ULONG ulNumThreads); + + HRESULT ( STDMETHODCALLTYPE *GetConcurrencyLimit )( + IDXTaskManager * This, + /* [out] */ ULONG *pulNumThreads); + + HRESULT ( STDMETHODCALLTYPE *ScheduleTasks )( + IDXTaskManager * This, + /* [in] */ DXTMTASKINFO TaskInfo[ ], + /* [in] */ HANDLE Events[ ], + /* [out] */ DWORD TaskIDs[ ], + /* [in] */ ULONG ulNumTasks, + /* [in] */ ULONG ulWaitPeriod); + + HRESULT ( STDMETHODCALLTYPE *TerminateTasks )( + IDXTaskManager * This, + /* [in] */ DWORD TaskIDs[ ], + /* [in] */ ULONG ulCount, + /* [in] */ ULONG ulTimeOut); + + HRESULT ( STDMETHODCALLTYPE *TerminateRequest )( + IDXTaskManager * This, + /* [in] */ REFIID RequestID, + /* [in] */ ULONG ulTimeOut); + + END_INTERFACE + } IDXTaskManagerVtbl; + + interface IDXTaskManager + { + CONST_VTBL struct IDXTaskManagerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXTaskManager_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXTaskManager_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXTaskManager_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXTaskManager_QueryNumProcessors(This,pulNumProc) \ + (This)->lpVtbl -> QueryNumProcessors(This,pulNumProc) + +#define IDXTaskManager_SetThreadPoolSize(This,ulNumThreads) \ + (This)->lpVtbl -> SetThreadPoolSize(This,ulNumThreads) + +#define IDXTaskManager_GetThreadPoolSize(This,pulNumThreads) \ + (This)->lpVtbl -> GetThreadPoolSize(This,pulNumThreads) + +#define IDXTaskManager_SetConcurrencyLimit(This,ulNumThreads) \ + (This)->lpVtbl -> SetConcurrencyLimit(This,ulNumThreads) + +#define IDXTaskManager_GetConcurrencyLimit(This,pulNumThreads) \ + (This)->lpVtbl -> GetConcurrencyLimit(This,pulNumThreads) + +#define IDXTaskManager_ScheduleTasks(This,TaskInfo,Events,TaskIDs,ulNumTasks,ulWaitPeriod) \ + (This)->lpVtbl -> ScheduleTasks(This,TaskInfo,Events,TaskIDs,ulNumTasks,ulWaitPeriod) + +#define IDXTaskManager_TerminateTasks(This,TaskIDs,ulCount,ulTimeOut) \ + (This)->lpVtbl -> TerminateTasks(This,TaskIDs,ulCount,ulTimeOut) + +#define IDXTaskManager_TerminateRequest(This,RequestID,ulTimeOut) \ + (This)->lpVtbl -> TerminateRequest(This,RequestID,ulTimeOut) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_QueryNumProcessors_Proxy( + IDXTaskManager * This, + /* [out] */ ULONG *pulNumProc); + + +void __RPC_STUB IDXTaskManager_QueryNumProcessors_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_SetThreadPoolSize_Proxy( + IDXTaskManager * This, + /* [in] */ ULONG ulNumThreads); + + +void __RPC_STUB IDXTaskManager_SetThreadPoolSize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_GetThreadPoolSize_Proxy( + IDXTaskManager * This, + /* [out] */ ULONG *pulNumThreads); + + +void __RPC_STUB IDXTaskManager_GetThreadPoolSize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_SetConcurrencyLimit_Proxy( + IDXTaskManager * This, + /* [in] */ ULONG ulNumThreads); + + +void __RPC_STUB IDXTaskManager_SetConcurrencyLimit_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_GetConcurrencyLimit_Proxy( + IDXTaskManager * This, + /* [out] */ ULONG *pulNumThreads); + + +void __RPC_STUB IDXTaskManager_GetConcurrencyLimit_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_ScheduleTasks_Proxy( + IDXTaskManager * This, + /* [in] */ DXTMTASKINFO TaskInfo[ ], + /* [in] */ HANDLE Events[ ], + /* [out] */ DWORD TaskIDs[ ], + /* [in] */ ULONG ulNumTasks, + /* [in] */ ULONG ulWaitPeriod); + + +void __RPC_STUB IDXTaskManager_ScheduleTasks_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_TerminateTasks_Proxy( + IDXTaskManager * This, + /* [in] */ DWORD TaskIDs[ ], + /* [in] */ ULONG ulCount, + /* [in] */ ULONG ulTimeOut); + + +void __RPC_STUB IDXTaskManager_TerminateTasks_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTaskManager_TerminateRequest_Proxy( + IDXTaskManager * This, + /* [in] */ REFIID RequestID, + /* [in] */ ULONG ulTimeOut); + + +void __RPC_STUB IDXTaskManager_TerminateRequest_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXTaskManager_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0265 */ +/* [local] */ + +#ifdef __cplusplus +///////////////////////////////////////////////////// + +class DXBASESAMPLE; +class DXSAMPLE; +class DXPMSAMPLE; + +///////////////////////////////////////////////////// + +class DXBASESAMPLE +{ +public: + BYTE Blue; + BYTE Green; + BYTE Red; + BYTE Alpha; + DXBASESAMPLE() {} + DXBASESAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) : + Alpha(alpha), + Red(red), + Green(green), + Blue(blue) {} + DXBASESAMPLE(const DWORD val) { *this = (*(DXBASESAMPLE *)&val); } + operator DWORD () const {return *((DWORD *)this); } + DWORD operator=(const DWORD val) { return *this = *((DXBASESAMPLE *)&val); } +}; // DXBASESAMPLE + +///////////////////////////////////////////////////// + +class DXSAMPLE : public DXBASESAMPLE +{ +public: + DXSAMPLE() {} + DXSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) : + DXBASESAMPLE(alpha, red, green, blue) {} + DXSAMPLE(const DWORD val) { *this = (*(DXSAMPLE *)&val); } + operator DWORD () const {return *((DWORD *)this); } + DWORD operator=(const DWORD val) { return *this = *((DXSAMPLE *)&val); } + operator DXPMSAMPLE() const; +}; // DXSAMPLE + +///////////////////////////////////////////////////// + +class DXPMSAMPLE : public DXBASESAMPLE +{ +public: + DXPMSAMPLE() {} + DXPMSAMPLE(const BYTE alpha, const BYTE red, const BYTE green, const BYTE blue) : + DXBASESAMPLE(alpha, red, green, blue) {} + DXPMSAMPLE(const DWORD val) { *this = (*(DXPMSAMPLE *)&val); } + operator DWORD () const {return *((DWORD *)this); } + DWORD operator=(const DWORD val) { return *this = *((DXPMSAMPLE *)&val); } + operator DXSAMPLE() const; +}; // DXPMSAMPLE + +// +// The following cast operators are to prevent a direct assignment of a DXSAMPLE to a DXPMSAMPLE +// +inline DXSAMPLE::operator DXPMSAMPLE() const { return *((DXPMSAMPLE *)this); } +inline DXPMSAMPLE::operator DXSAMPLE() const { return *((DXSAMPLE *)this); } +#else // !__cplusplus +typedef struct DXBASESAMPLE + { + BYTE Blue; + BYTE Green; + BYTE Red; + BYTE Alpha; + } DXBASESAMPLE; + +typedef struct DXSAMPLE + { + BYTE Blue; + BYTE Green; + BYTE Red; + BYTE Alpha; + } DXSAMPLE; + +typedef struct DXPMSAMPLE + { + BYTE Blue; + BYTE Green; + BYTE Red; + BYTE Alpha; + } DXPMSAMPLE; + +#endif // !__cplusplus +typedef +enum DXRUNTYPE + { DXRUNTYPE_CLEAR = 0, + DXRUNTYPE_OPAQUE = 1, + DXRUNTYPE_TRANS = 2, + DXRUNTYPE_UNKNOWN = 3 + } DXRUNTYPE; + +#define DX_MAX_RUN_INFO_COUNT ( 128 ) + +// Ignore the definition used by MIDL for TLB generation +#if 0 +typedef struct DXRUNINFO + { + ULONG Bitfields; + } DXRUNINFO; + +#endif // 0 +typedef struct DXRUNINFO +{ + ULONG Type : 2; // Type + ULONG Count : 30; // Number of samples in run +} DXRUNINFO; +typedef +enum DXSFCREATE + { DXSF_FORMAT_IS_CLSID = 1L << 0, + DXSF_NO_LAZY_DDRAW_LOCK = 1L << 1 + } DXSFCREATE; + +typedef +enum DXBLTOPTIONS + { DXBOF_DO_OVER = 1L << 0, + DXBOF_DITHER = 1L << 1 + } DXBLTOPTIONS; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0265_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0265_v0_0_s_ifspec; + +#ifndef __IDXSurfaceFactory_INTERFACE_DEFINED__ +#define __IDXSurfaceFactory_INTERFACE_DEFINED__ + +/* interface IDXSurfaceFactory */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXSurfaceFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("144946F5-C4D4-11d1-81D1-0000F87557DB") + IDXSurfaceFactory : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateSurface( + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkOuter, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateFromDDSurface( + /* [in] */ IUnknown *pDDrawSurface, + /* [in] */ const GUID *pFormatID, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkOuter, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE LoadImage( + /* [in] */ const LPWSTR pszFileName, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE LoadImageFromStream( + /* [in] */ IStream *pStream, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE CopySurfaceToNewFormat( + /* [in] */ IDXSurface *pSrc, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pDestFormatID, + /* [out] */ IDXSurface **ppNewSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateD3DRMTexture( + /* [in] */ IDXSurface *pSrc, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ IUnknown *pD3DRM3, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppTexture3) = 0; + + virtual HRESULT STDMETHODCALLTYPE BitBlt( + /* [in] */ IDXSurface *pDest, + /* [in] */ const DXVEC *pPlacement, + /* [in] */ IDXSurface *pSrc, + /* [in] */ const DXBNDS *pClipBounds, + /* [in] */ DWORD dwFlags) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXSurfaceFactoryVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXSurfaceFactory * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXSurfaceFactory * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXSurfaceFactory * This); + + HRESULT ( STDMETHODCALLTYPE *CreateSurface )( + IDXSurfaceFactory * This, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkOuter, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + HRESULT ( STDMETHODCALLTYPE *CreateFromDDSurface )( + IDXSurfaceFactory * This, + /* [in] */ IUnknown *pDDrawSurface, + /* [in] */ const GUID *pFormatID, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkOuter, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + HRESULT ( STDMETHODCALLTYPE *LoadImage )( + IDXSurfaceFactory * This, + /* [in] */ const LPWSTR pszFileName, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + HRESULT ( STDMETHODCALLTYPE *LoadImageFromStream )( + IDXSurfaceFactory * This, + /* [in] */ IStream *pStream, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + HRESULT ( STDMETHODCALLTYPE *CopySurfaceToNewFormat )( + IDXSurfaceFactory * This, + /* [in] */ IDXSurface *pSrc, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pDestFormatID, + /* [out] */ IDXSurface **ppNewSurface); + + HRESULT ( STDMETHODCALLTYPE *CreateD3DRMTexture )( + IDXSurfaceFactory * This, + /* [in] */ IDXSurface *pSrc, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ IUnknown *pD3DRM3, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppTexture3); + + HRESULT ( STDMETHODCALLTYPE *BitBlt )( + IDXSurfaceFactory * This, + /* [in] */ IDXSurface *pDest, + /* [in] */ const DXVEC *pPlacement, + /* [in] */ IDXSurface *pSrc, + /* [in] */ const DXBNDS *pClipBounds, + /* [in] */ DWORD dwFlags); + + END_INTERFACE + } IDXSurfaceFactoryVtbl; + + interface IDXSurfaceFactory + { + CONST_VTBL struct IDXSurfaceFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXSurfaceFactory_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXSurfaceFactory_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXSurfaceFactory_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXSurfaceFactory_CreateSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags,punkOuter,riid,ppDXSurface) \ + (This)->lpVtbl -> CreateSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags,punkOuter,riid,ppDXSurface) + +#define IDXSurfaceFactory_CreateFromDDSurface(This,pDDrawSurface,pFormatID,dwFlags,punkOuter,riid,ppDXSurface) \ + (This)->lpVtbl -> CreateFromDDSurface(This,pDDrawSurface,pFormatID,dwFlags,punkOuter,riid,ppDXSurface) + +#define IDXSurfaceFactory_LoadImage(This,pszFileName,pDirectDraw,pDDSurfaceDesc,pFormatID,riid,ppDXSurface) \ + (This)->lpVtbl -> LoadImage(This,pszFileName,pDirectDraw,pDDSurfaceDesc,pFormatID,riid,ppDXSurface) + +#define IDXSurfaceFactory_LoadImageFromStream(This,pStream,pDirectDraw,pDDSurfaceDesc,pFormatID,riid,ppDXSurface) \ + (This)->lpVtbl -> LoadImageFromStream(This,pStream,pDirectDraw,pDDSurfaceDesc,pFormatID,riid,ppDXSurface) + +#define IDXSurfaceFactory_CopySurfaceToNewFormat(This,pSrc,pDirectDraw,pDDSurfaceDesc,pDestFormatID,ppNewSurface) \ + (This)->lpVtbl -> CopySurfaceToNewFormat(This,pSrc,pDirectDraw,pDDSurfaceDesc,pDestFormatID,ppNewSurface) + +#define IDXSurfaceFactory_CreateD3DRMTexture(This,pSrc,pDirectDraw,pD3DRM3,riid,ppTexture3) \ + (This)->lpVtbl -> CreateD3DRMTexture(This,pSrc,pDirectDraw,pD3DRM3,riid,ppTexture3) + +#define IDXSurfaceFactory_BitBlt(This,pDest,pPlacement,pSrc,pClipBounds,dwFlags) \ + (This)->lpVtbl -> BitBlt(This,pDest,pPlacement,pSrc,pClipBounds,dwFlags) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_CreateSurface_Proxy( + IDXSurfaceFactory * This, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkOuter, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + +void __RPC_STUB IDXSurfaceFactory_CreateSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_CreateFromDDSurface_Proxy( + IDXSurfaceFactory * This, + /* [in] */ IUnknown *pDDrawSurface, + /* [in] */ const GUID *pFormatID, + /* [in] */ DWORD dwFlags, + /* [in] */ IUnknown *punkOuter, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + +void __RPC_STUB IDXSurfaceFactory_CreateFromDDSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_LoadImage_Proxy( + IDXSurfaceFactory * This, + /* [in] */ const LPWSTR pszFileName, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + +void __RPC_STUB IDXSurfaceFactory_LoadImage_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_LoadImageFromStream_Proxy( + IDXSurfaceFactory * This, + /* [in] */ IStream *pStream, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppDXSurface); + + +void __RPC_STUB IDXSurfaceFactory_LoadImageFromStream_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_CopySurfaceToNewFormat_Proxy( + IDXSurfaceFactory * This, + /* [in] */ IDXSurface *pSrc, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pDestFormatID, + /* [out] */ IDXSurface **ppNewSurface); + + +void __RPC_STUB IDXSurfaceFactory_CopySurfaceToNewFormat_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_CreateD3DRMTexture_Proxy( + IDXSurfaceFactory * This, + /* [in] */ IDXSurface *pSrc, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ IUnknown *pD3DRM3, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppTexture3); + + +void __RPC_STUB IDXSurfaceFactory_CreateD3DRMTexture_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceFactory_BitBlt_Proxy( + IDXSurfaceFactory * This, + /* [in] */ IDXSurface *pDest, + /* [in] */ const DXVEC *pPlacement, + /* [in] */ IDXSurface *pSrc, + /* [in] */ const DXBNDS *pClipBounds, + /* [in] */ DWORD dwFlags); + + +void __RPC_STUB IDXSurfaceFactory_BitBlt_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXSurfaceFactory_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0266 */ +/* [local] */ + +typedef +enum DXSURFMODCOMPOP + { DXSURFMOD_COMP_OVER = 0, + DXSURFMOD_COMP_ALPHA_MASK = 1, + DXSURFMOD_COMP_MAX_VALID = 1 + } DXSURFMODCOMPOP; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0266_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0266_v0_0_s_ifspec; + +#ifndef __IDXSurfaceModifier_INTERFACE_DEFINED__ +#define __IDXSurfaceModifier_INTERFACE_DEFINED__ + +/* interface IDXSurfaceModifier */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXSurfaceModifier; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9EA3B637-C37D-11d1-905E-00C04FD9189D") + IDXSurfaceModifier : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetFillColor( + /* [in] */ DXSAMPLE Color) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetFillColor( + /* [out] */ DXSAMPLE *pColor) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBounds( + /* [in] */ const DXBNDS *pBounds) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBackground( + /* [in] */ IDXSurface *pSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetBackground( + /* [out] */ IDXSurface **ppSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetCompositeOperation( + /* [in] */ DXSURFMODCOMPOP CompOp) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCompositeOperation( + /* [out] */ DXSURFMODCOMPOP *pCompOp) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetForeground( + /* [in] */ IDXSurface *pSurface, + /* [in] */ BOOL bTile, + /* [in] */ const POINT *pOrigin) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetForeground( + /* [out] */ IDXSurface **ppSurface, + /* [out] */ BOOL *pbTile, + /* [out] */ POINT *pOrigin) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetOpacity( + /* [in] */ float Opacity) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetOpacity( + /* [out] */ float *pOpacity) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetLookup( + /* [in] */ IDXLookupTable *pLookupTable) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetLookup( + /* [out] */ IDXLookupTable **ppLookupTable) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXSurfaceModifierVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXSurfaceModifier * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXSurfaceModifier * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXSurfaceModifier * This); + + HRESULT ( STDMETHODCALLTYPE *SetFillColor )( + IDXSurfaceModifier * This, + /* [in] */ DXSAMPLE Color); + + HRESULT ( STDMETHODCALLTYPE *GetFillColor )( + IDXSurfaceModifier * This, + /* [out] */ DXSAMPLE *pColor); + + HRESULT ( STDMETHODCALLTYPE *SetBounds )( + IDXSurfaceModifier * This, + /* [in] */ const DXBNDS *pBounds); + + HRESULT ( STDMETHODCALLTYPE *SetBackground )( + IDXSurfaceModifier * This, + /* [in] */ IDXSurface *pSurface); + + HRESULT ( STDMETHODCALLTYPE *GetBackground )( + IDXSurfaceModifier * This, + /* [out] */ IDXSurface **ppSurface); + + HRESULT ( STDMETHODCALLTYPE *SetCompositeOperation )( + IDXSurfaceModifier * This, + /* [in] */ DXSURFMODCOMPOP CompOp); + + HRESULT ( STDMETHODCALLTYPE *GetCompositeOperation )( + IDXSurfaceModifier * This, + /* [out] */ DXSURFMODCOMPOP *pCompOp); + + HRESULT ( STDMETHODCALLTYPE *SetForeground )( + IDXSurfaceModifier * This, + /* [in] */ IDXSurface *pSurface, + /* [in] */ BOOL bTile, + /* [in] */ const POINT *pOrigin); + + HRESULT ( STDMETHODCALLTYPE *GetForeground )( + IDXSurfaceModifier * This, + /* [out] */ IDXSurface **ppSurface, + /* [out] */ BOOL *pbTile, + /* [out] */ POINT *pOrigin); + + HRESULT ( STDMETHODCALLTYPE *SetOpacity )( + IDXSurfaceModifier * This, + /* [in] */ float Opacity); + + HRESULT ( STDMETHODCALLTYPE *GetOpacity )( + IDXSurfaceModifier * This, + /* [out] */ float *pOpacity); + + HRESULT ( STDMETHODCALLTYPE *SetLookup )( + IDXSurfaceModifier * This, + /* [in] */ IDXLookupTable *pLookupTable); + + HRESULT ( STDMETHODCALLTYPE *GetLookup )( + IDXSurfaceModifier * This, + /* [out] */ IDXLookupTable **ppLookupTable); + + END_INTERFACE + } IDXSurfaceModifierVtbl; + + interface IDXSurfaceModifier + { + CONST_VTBL struct IDXSurfaceModifierVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXSurfaceModifier_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXSurfaceModifier_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXSurfaceModifier_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXSurfaceModifier_SetFillColor(This,Color) \ + (This)->lpVtbl -> SetFillColor(This,Color) + +#define IDXSurfaceModifier_GetFillColor(This,pColor) \ + (This)->lpVtbl -> GetFillColor(This,pColor) + +#define IDXSurfaceModifier_SetBounds(This,pBounds) \ + (This)->lpVtbl -> SetBounds(This,pBounds) + +#define IDXSurfaceModifier_SetBackground(This,pSurface) \ + (This)->lpVtbl -> SetBackground(This,pSurface) + +#define IDXSurfaceModifier_GetBackground(This,ppSurface) \ + (This)->lpVtbl -> GetBackground(This,ppSurface) + +#define IDXSurfaceModifier_SetCompositeOperation(This,CompOp) \ + (This)->lpVtbl -> SetCompositeOperation(This,CompOp) + +#define IDXSurfaceModifier_GetCompositeOperation(This,pCompOp) \ + (This)->lpVtbl -> GetCompositeOperation(This,pCompOp) + +#define IDXSurfaceModifier_SetForeground(This,pSurface,bTile,pOrigin) \ + (This)->lpVtbl -> SetForeground(This,pSurface,bTile,pOrigin) + +#define IDXSurfaceModifier_GetForeground(This,ppSurface,pbTile,pOrigin) \ + (This)->lpVtbl -> GetForeground(This,ppSurface,pbTile,pOrigin) + +#define IDXSurfaceModifier_SetOpacity(This,Opacity) \ + (This)->lpVtbl -> SetOpacity(This,Opacity) + +#define IDXSurfaceModifier_GetOpacity(This,pOpacity) \ + (This)->lpVtbl -> GetOpacity(This,pOpacity) + +#define IDXSurfaceModifier_SetLookup(This,pLookupTable) \ + (This)->lpVtbl -> SetLookup(This,pLookupTable) + +#define IDXSurfaceModifier_GetLookup(This,ppLookupTable) \ + (This)->lpVtbl -> GetLookup(This,ppLookupTable) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetFillColor_Proxy( + IDXSurfaceModifier * This, + /* [in] */ DXSAMPLE Color); + + +void __RPC_STUB IDXSurfaceModifier_SetFillColor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetFillColor_Proxy( + IDXSurfaceModifier * This, + /* [out] */ DXSAMPLE *pColor); + + +void __RPC_STUB IDXSurfaceModifier_GetFillColor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetBounds_Proxy( + IDXSurfaceModifier * This, + /* [in] */ const DXBNDS *pBounds); + + +void __RPC_STUB IDXSurfaceModifier_SetBounds_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetBackground_Proxy( + IDXSurfaceModifier * This, + /* [in] */ IDXSurface *pSurface); + + +void __RPC_STUB IDXSurfaceModifier_SetBackground_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetBackground_Proxy( + IDXSurfaceModifier * This, + /* [out] */ IDXSurface **ppSurface); + + +void __RPC_STUB IDXSurfaceModifier_GetBackground_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetCompositeOperation_Proxy( + IDXSurfaceModifier * This, + /* [in] */ DXSURFMODCOMPOP CompOp); + + +void __RPC_STUB IDXSurfaceModifier_SetCompositeOperation_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetCompositeOperation_Proxy( + IDXSurfaceModifier * This, + /* [out] */ DXSURFMODCOMPOP *pCompOp); + + +void __RPC_STUB IDXSurfaceModifier_GetCompositeOperation_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetForeground_Proxy( + IDXSurfaceModifier * This, + /* [in] */ IDXSurface *pSurface, + /* [in] */ BOOL bTile, + /* [in] */ const POINT *pOrigin); + + +void __RPC_STUB IDXSurfaceModifier_SetForeground_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetForeground_Proxy( + IDXSurfaceModifier * This, + /* [out] */ IDXSurface **ppSurface, + /* [out] */ BOOL *pbTile, + /* [out] */ POINT *pOrigin); + + +void __RPC_STUB IDXSurfaceModifier_GetForeground_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetOpacity_Proxy( + IDXSurfaceModifier * This, + /* [in] */ float Opacity); + + +void __RPC_STUB IDXSurfaceModifier_SetOpacity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetOpacity_Proxy( + IDXSurfaceModifier * This, + /* [out] */ float *pOpacity); + + +void __RPC_STUB IDXSurfaceModifier_GetOpacity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_SetLookup_Proxy( + IDXSurfaceModifier * This, + /* [in] */ IDXLookupTable *pLookupTable); + + +void __RPC_STUB IDXSurfaceModifier_SetLookup_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurfaceModifier_GetLookup_Proxy( + IDXSurfaceModifier * This, + /* [out] */ IDXLookupTable **ppLookupTable); + + +void __RPC_STUB IDXSurfaceModifier_GetLookup_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXSurfaceModifier_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0267 */ +/* [local] */ + +typedef +enum DXSAMPLEFORMATENUM + { DXPF_FLAGSMASK = 0xffff0000, + DXPF_NONPREMULT = 0x10000, + DXPF_TRANSPARENCY = 0x20000, + DXPF_TRANSLUCENCY = 0x40000, + DXPF_2BITERROR = 0x200000, + DXPF_3BITERROR = 0x300000, + DXPF_4BITERROR = 0x400000, + DXPF_5BITERROR = 0x500000, + DXPF_ERRORMASK = 0x700000, + DXPF_NONSTANDARD = 0, + DXPF_PMARGB32 = 1 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY, + DXPF_ARGB32 = 2 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY, + DXPF_ARGB4444 = 3 | DXPF_NONPREMULT | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY | DXPF_4BITERROR, + DXPF_A8 = 4 | DXPF_TRANSPARENCY | DXPF_TRANSLUCENCY, + DXPF_RGB32 = 5, + DXPF_RGB24 = 6, + DXPF_RGB565 = 7 | DXPF_3BITERROR, + DXPF_RGB555 = 8 | DXPF_3BITERROR, + DXPF_RGB8 = 9 | DXPF_5BITERROR, + DXPF_ARGB1555 = 10 | DXPF_TRANSPARENCY | DXPF_3BITERROR, + DXPF_RGB32_CK = DXPF_RGB32 | DXPF_TRANSPARENCY, + DXPF_RGB24_CK = DXPF_RGB24 | DXPF_TRANSPARENCY, + DXPF_RGB555_CK = DXPF_RGB555 | DXPF_TRANSPARENCY, + DXPF_RGB565_CK = DXPF_RGB565 | DXPF_TRANSPARENCY, + DXPF_RGB8_CK = DXPF_RGB8 | DXPF_TRANSPARENCY + } DXSAMPLEFORMATENUM; + +typedef +enum DXLOCKSURF + { DXLOCKF_READ = 0, + DXLOCKF_READWRITE = 1 << 0, + DXLOCKF_EXISTINGINFOONLY = 1 << 1, + DXLOCKF_WANTRUNINFO = 1 << 2, + DXLOCKF_NONPREMULT = 1 << 16, + DXLOCKF_VALIDFLAGS = DXLOCKF_READWRITE | DXLOCKF_EXISTINGINFOONLY | DXLOCKF_WANTRUNINFO | DXLOCKF_NONPREMULT + } DXLOCKSURF; + +typedef +enum DXSURFSTATUS + { DXSURF_TRANSIENT = 1 << 0, + DXSURF_READONLY = 1 << 1, + DXSURF_VALIDFLAGS = DXSURF_TRANSIENT | DXSURF_READONLY + } DXSURFSTATUS; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0267_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0267_v0_0_s_ifspec; + +#ifndef __IDXSurface_INTERFACE_DEFINED__ +#define __IDXSurface_INTERFACE_DEFINED__ + +/* interface IDXSurface */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXSurface; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("B39FD73F-E139-11d1-9065-00C04FD9189D") + IDXSurface : public IDXBaseObject + { + public: + virtual HRESULT STDMETHODCALLTYPE GetPixelFormat( + /* [out] */ GUID *pFormatID, + /* [out] */ DXSAMPLEFORMATENUM *pSampleFormatEnum) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetBounds( + /* [out] */ DXBNDS *pBounds) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetStatusFlags( + /* [out] */ DWORD *pdwStatusFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetStatusFlags( + /* [in] */ DWORD dwStatusFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE LockSurface( + /* [in] */ const DXBNDS *pBounds, + /* [in] */ ULONG ulTimeOut, + /* [in] */ DWORD dwFlags, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppPointer, + /* [out] */ ULONG *pulGenerationId) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDirectDrawSurface( + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppSurface) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetColorKey( + DXSAMPLE *pColorKey) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetColorKey( + DXSAMPLE ColorKey) = 0; + + virtual HRESULT STDMETHODCALLTYPE LockSurfaceDC( + /* [in] */ const DXBNDS *pBounds, + /* [in] */ ULONG ulTimeOut, + /* [in] */ DWORD dwFlags, + /* [out] */ IDXDCLock **ppDCLock) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetAppData( + DWORD_PTR dwAppData) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetAppData( + DWORD_PTR *pdwAppData) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXSurfaceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXSurface * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXSurface * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXSurface * This); + + HRESULT ( STDMETHODCALLTYPE *GetGenerationId )( + IDXSurface * This, + /* [out] */ ULONG *pID); + + HRESULT ( STDMETHODCALLTYPE *IncrementGenerationId )( + IDXSurface * This, + /* [in] */ BOOL bRefresh); + + HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( + IDXSurface * This, + /* [out] */ ULONG *pcbSize); + + HRESULT ( STDMETHODCALLTYPE *GetPixelFormat )( + IDXSurface * This, + /* [out] */ GUID *pFormatID, + /* [out] */ DXSAMPLEFORMATENUM *pSampleFormatEnum); + + HRESULT ( STDMETHODCALLTYPE *GetBounds )( + IDXSurface * This, + /* [out] */ DXBNDS *pBounds); + + HRESULT ( STDMETHODCALLTYPE *GetStatusFlags )( + IDXSurface * This, + /* [out] */ DWORD *pdwStatusFlags); + + HRESULT ( STDMETHODCALLTYPE *SetStatusFlags )( + IDXSurface * This, + /* [in] */ DWORD dwStatusFlags); + + HRESULT ( STDMETHODCALLTYPE *LockSurface )( + IDXSurface * This, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ ULONG ulTimeOut, + /* [in] */ DWORD dwFlags, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppPointer, + /* [out] */ ULONG *pulGenerationId); + + HRESULT ( STDMETHODCALLTYPE *GetDirectDrawSurface )( + IDXSurface * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppSurface); + + HRESULT ( STDMETHODCALLTYPE *GetColorKey )( + IDXSurface * This, + DXSAMPLE *pColorKey); + + HRESULT ( STDMETHODCALLTYPE *SetColorKey )( + IDXSurface * This, + DXSAMPLE ColorKey); + + HRESULT ( STDMETHODCALLTYPE *LockSurfaceDC )( + IDXSurface * This, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ ULONG ulTimeOut, + /* [in] */ DWORD dwFlags, + /* [out] */ IDXDCLock **ppDCLock); + + HRESULT ( STDMETHODCALLTYPE *SetAppData )( + IDXSurface * This, + DWORD_PTR dwAppData); + + HRESULT ( STDMETHODCALLTYPE *GetAppData )( + IDXSurface * This, + DWORD_PTR *pdwAppData); + + END_INTERFACE + } IDXSurfaceVtbl; + + interface IDXSurface + { + CONST_VTBL struct IDXSurfaceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXSurface_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXSurface_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXSurface_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXSurface_GetGenerationId(This,pID) \ + (This)->lpVtbl -> GetGenerationId(This,pID) + +#define IDXSurface_IncrementGenerationId(This,bRefresh) \ + (This)->lpVtbl -> IncrementGenerationId(This,bRefresh) + +#define IDXSurface_GetObjectSize(This,pcbSize) \ + (This)->lpVtbl -> GetObjectSize(This,pcbSize) + + +#define IDXSurface_GetPixelFormat(This,pFormatID,pSampleFormatEnum) \ + (This)->lpVtbl -> GetPixelFormat(This,pFormatID,pSampleFormatEnum) + +#define IDXSurface_GetBounds(This,pBounds) \ + (This)->lpVtbl -> GetBounds(This,pBounds) + +#define IDXSurface_GetStatusFlags(This,pdwStatusFlags) \ + (This)->lpVtbl -> GetStatusFlags(This,pdwStatusFlags) + +#define IDXSurface_SetStatusFlags(This,dwStatusFlags) \ + (This)->lpVtbl -> SetStatusFlags(This,dwStatusFlags) + +#define IDXSurface_LockSurface(This,pBounds,ulTimeOut,dwFlags,riid,ppPointer,pulGenerationId) \ + (This)->lpVtbl -> LockSurface(This,pBounds,ulTimeOut,dwFlags,riid,ppPointer,pulGenerationId) + +#define IDXSurface_GetDirectDrawSurface(This,riid,ppSurface) \ + (This)->lpVtbl -> GetDirectDrawSurface(This,riid,ppSurface) + +#define IDXSurface_GetColorKey(This,pColorKey) \ + (This)->lpVtbl -> GetColorKey(This,pColorKey) + +#define IDXSurface_SetColorKey(This,ColorKey) \ + (This)->lpVtbl -> SetColorKey(This,ColorKey) + +#define IDXSurface_LockSurfaceDC(This,pBounds,ulTimeOut,dwFlags,ppDCLock) \ + (This)->lpVtbl -> LockSurfaceDC(This,pBounds,ulTimeOut,dwFlags,ppDCLock) + +#define IDXSurface_SetAppData(This,dwAppData) \ + (This)->lpVtbl -> SetAppData(This,dwAppData) + +#define IDXSurface_GetAppData(This,pdwAppData) \ + (This)->lpVtbl -> GetAppData(This,pdwAppData) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXSurface_GetPixelFormat_Proxy( + IDXSurface * This, + /* [out] */ GUID *pFormatID, + /* [out] */ DXSAMPLEFORMATENUM *pSampleFormatEnum); + + +void __RPC_STUB IDXSurface_GetPixelFormat_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_GetBounds_Proxy( + IDXSurface * This, + /* [out] */ DXBNDS *pBounds); + + +void __RPC_STUB IDXSurface_GetBounds_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_GetStatusFlags_Proxy( + IDXSurface * This, + /* [out] */ DWORD *pdwStatusFlags); + + +void __RPC_STUB IDXSurface_GetStatusFlags_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_SetStatusFlags_Proxy( + IDXSurface * This, + /* [in] */ DWORD dwStatusFlags); + + +void __RPC_STUB IDXSurface_SetStatusFlags_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_LockSurface_Proxy( + IDXSurface * This, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ ULONG ulTimeOut, + /* [in] */ DWORD dwFlags, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppPointer, + /* [out] */ ULONG *pulGenerationId); + + +void __RPC_STUB IDXSurface_LockSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_GetDirectDrawSurface_Proxy( + IDXSurface * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppSurface); + + +void __RPC_STUB IDXSurface_GetDirectDrawSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_GetColorKey_Proxy( + IDXSurface * This, + DXSAMPLE *pColorKey); + + +void __RPC_STUB IDXSurface_GetColorKey_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_SetColorKey_Proxy( + IDXSurface * This, + DXSAMPLE ColorKey); + + +void __RPC_STUB IDXSurface_SetColorKey_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_LockSurfaceDC_Proxy( + IDXSurface * This, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ ULONG ulTimeOut, + /* [in] */ DWORD dwFlags, + /* [out] */ IDXDCLock **ppDCLock); + + +void __RPC_STUB IDXSurface_LockSurfaceDC_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_SetAppData_Proxy( + IDXSurface * This, + DWORD_PTR dwAppData); + + +void __RPC_STUB IDXSurface_SetAppData_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXSurface_GetAppData_Proxy( + IDXSurface * This, + DWORD_PTR *pdwAppData); + + +void __RPC_STUB IDXSurface_GetAppData_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXSurface_INTERFACE_DEFINED__ */ + + +#ifndef __IDXSurfaceInit_INTERFACE_DEFINED__ +#define __IDXSurfaceInit_INTERFACE_DEFINED__ + +/* interface IDXSurfaceInit */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXSurfaceInit; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9EA3B639-C37D-11d1-905E-00C04FD9189D") + IDXSurfaceInit : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE InitSurface( + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ DWORD dwFlags) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXSurfaceInitVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXSurfaceInit * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXSurfaceInit * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXSurfaceInit * This); + + HRESULT ( STDMETHODCALLTYPE *InitSurface )( + IDXSurfaceInit * This, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ DWORD dwFlags); + + END_INTERFACE + } IDXSurfaceInitVtbl; + + interface IDXSurfaceInit + { + CONST_VTBL struct IDXSurfaceInitVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXSurfaceInit_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXSurfaceInit_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXSurfaceInit_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXSurfaceInit_InitSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags) \ + (This)->lpVtbl -> InitSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXSurfaceInit_InitSurface_Proxy( + IDXSurfaceInit * This, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ DWORD dwFlags); + + +void __RPC_STUB IDXSurfaceInit_InitSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXSurfaceInit_INTERFACE_DEFINED__ */ + + +#ifndef __IDXARGBSurfaceInit_INTERFACE_DEFINED__ +#define __IDXARGBSurfaceInit_INTERFACE_DEFINED__ + +/* interface IDXARGBSurfaceInit */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXARGBSurfaceInit; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9EA3B63A-C37D-11d1-905E-00C04FD9189D") + IDXARGBSurfaceInit : public IDXSurfaceInit + { + public: + virtual HRESULT STDMETHODCALLTYPE InitFromDDSurface( + /* [in] */ IUnknown *pDDrawSurface, + /* [in] */ const GUID *pFormatID, + /* [in] */ DWORD dwFlags) = 0; + + virtual HRESULT STDMETHODCALLTYPE InitFromRawSurface( + /* [in] */ IDXRawSurface *pRawSurface) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXARGBSurfaceInitVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXARGBSurfaceInit * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXARGBSurfaceInit * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXARGBSurfaceInit * This); + + HRESULT ( STDMETHODCALLTYPE *InitSurface )( + IDXARGBSurfaceInit * This, + /* [in] */ IUnknown *pDirectDraw, + /* [in] */ const DDSURFACEDESC *pDDSurfaceDesc, + /* [in] */ const GUID *pFormatID, + /* [in] */ const DXBNDS *pBounds, + /* [in] */ DWORD dwFlags); + + HRESULT ( STDMETHODCALLTYPE *InitFromDDSurface )( + IDXARGBSurfaceInit * This, + /* [in] */ IUnknown *pDDrawSurface, + /* [in] */ const GUID *pFormatID, + /* [in] */ DWORD dwFlags); + + HRESULT ( STDMETHODCALLTYPE *InitFromRawSurface )( + IDXARGBSurfaceInit * This, + /* [in] */ IDXRawSurface *pRawSurface); + + END_INTERFACE + } IDXARGBSurfaceInitVtbl; + + interface IDXARGBSurfaceInit + { + CONST_VTBL struct IDXARGBSurfaceInitVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXARGBSurfaceInit_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXARGBSurfaceInit_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXARGBSurfaceInit_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXARGBSurfaceInit_InitSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags) \ + (This)->lpVtbl -> InitSurface(This,pDirectDraw,pDDSurfaceDesc,pFormatID,pBounds,dwFlags) + + +#define IDXARGBSurfaceInit_InitFromDDSurface(This,pDDrawSurface,pFormatID,dwFlags) \ + (This)->lpVtbl -> InitFromDDSurface(This,pDDrawSurface,pFormatID,dwFlags) + +#define IDXARGBSurfaceInit_InitFromRawSurface(This,pRawSurface) \ + (This)->lpVtbl -> InitFromRawSurface(This,pRawSurface) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXARGBSurfaceInit_InitFromDDSurface_Proxy( + IDXARGBSurfaceInit * This, + /* [in] */ IUnknown *pDDrawSurface, + /* [in] */ const GUID *pFormatID, + /* [in] */ DWORD dwFlags); + + +void __RPC_STUB IDXARGBSurfaceInit_InitFromDDSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXARGBSurfaceInit_InitFromRawSurface_Proxy( + IDXARGBSurfaceInit * This, + /* [in] */ IDXRawSurface *pRawSurface); + + +void __RPC_STUB IDXARGBSurfaceInit_InitFromRawSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXARGBSurfaceInit_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0270 */ +/* [local] */ + +typedef struct tagDXNATIVETYPEINFO + { + BYTE *pCurrentData; + BYTE *pFirstByte; + long lPitch; + DWORD dwColorKey; + } DXNATIVETYPEINFO; + +typedef struct tagDXPACKEDRECTDESC + { + DXBASESAMPLE *pSamples; + BOOL bPremult; + RECT rect; + long lRowPadding; + } DXPACKEDRECTDESC; + +typedef struct tagDXOVERSAMPLEDESC + { + POINT p; + DXPMSAMPLE Color; + } DXOVERSAMPLEDESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0270_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0270_v0_0_s_ifspec; + +#ifndef __IDXARGBReadPtr_INTERFACE_DEFINED__ +#define __IDXARGBReadPtr_INTERFACE_DEFINED__ + +/* interface IDXARGBReadPtr */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXARGBReadPtr; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("EAAAC2D6-C290-11d1-905D-00C04FD9189D") + IDXARGBReadPtr : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetSurface( + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppSurface) = 0; + + virtual DXSAMPLEFORMATENUM STDMETHODCALLTYPE GetNativeType( + /* [out] */ DXNATIVETYPEINFO *pInfo) = 0; + + virtual void STDMETHODCALLTYPE Move( + /* [in] */ long cSamples) = 0; + + virtual void STDMETHODCALLTYPE MoveToRow( + /* [in] */ ULONG y) = 0; + + virtual void STDMETHODCALLTYPE MoveToXY( + /* [in] */ ULONG x, + /* [in] */ ULONG y) = 0; + + virtual ULONG STDMETHODCALLTYPE MoveAndGetRunInfo( + /* [in] */ ULONG Row, + /* [out] */ const DXRUNINFO **ppInfo) = 0; + + virtual DXSAMPLE *STDMETHODCALLTYPE Unpack( + /* [in] */ DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove) = 0; + + virtual DXPMSAMPLE *STDMETHODCALLTYPE UnpackPremult( + /* [in] */ DXPMSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove) = 0; + + virtual void STDMETHODCALLTYPE UnpackRect( + /* [in] */ const DXPACKEDRECTDESC *pRectDesc) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXARGBReadPtrVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXARGBReadPtr * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXARGBReadPtr * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXARGBReadPtr * This); + + HRESULT ( STDMETHODCALLTYPE *GetSurface )( + IDXARGBReadPtr * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppSurface); + + DXSAMPLEFORMATENUM ( STDMETHODCALLTYPE *GetNativeType )( + IDXARGBReadPtr * This, + /* [out] */ DXNATIVETYPEINFO *pInfo); + + void ( STDMETHODCALLTYPE *Move )( + IDXARGBReadPtr * This, + /* [in] */ long cSamples); + + void ( STDMETHODCALLTYPE *MoveToRow )( + IDXARGBReadPtr * This, + /* [in] */ ULONG y); + + void ( STDMETHODCALLTYPE *MoveToXY )( + IDXARGBReadPtr * This, + /* [in] */ ULONG x, + /* [in] */ ULONG y); + + ULONG ( STDMETHODCALLTYPE *MoveAndGetRunInfo )( + IDXARGBReadPtr * This, + /* [in] */ ULONG Row, + /* [out] */ const DXRUNINFO **ppInfo); + + DXSAMPLE *( STDMETHODCALLTYPE *Unpack )( + IDXARGBReadPtr * This, + /* [in] */ DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove); + + DXPMSAMPLE *( STDMETHODCALLTYPE *UnpackPremult )( + IDXARGBReadPtr * This, + /* [in] */ DXPMSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove); + + void ( STDMETHODCALLTYPE *UnpackRect )( + IDXARGBReadPtr * This, + /* [in] */ const DXPACKEDRECTDESC *pRectDesc); + + END_INTERFACE + } IDXARGBReadPtrVtbl; + + interface IDXARGBReadPtr + { + CONST_VTBL struct IDXARGBReadPtrVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXARGBReadPtr_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXARGBReadPtr_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXARGBReadPtr_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXARGBReadPtr_GetSurface(This,riid,ppSurface) \ + (This)->lpVtbl -> GetSurface(This,riid,ppSurface) + +#define IDXARGBReadPtr_GetNativeType(This,pInfo) \ + (This)->lpVtbl -> GetNativeType(This,pInfo) + +#define IDXARGBReadPtr_Move(This,cSamples) \ + (This)->lpVtbl -> Move(This,cSamples) + +#define IDXARGBReadPtr_MoveToRow(This,y) \ + (This)->lpVtbl -> MoveToRow(This,y) + +#define IDXARGBReadPtr_MoveToXY(This,x,y) \ + (This)->lpVtbl -> MoveToXY(This,x,y) + +#define IDXARGBReadPtr_MoveAndGetRunInfo(This,Row,ppInfo) \ + (This)->lpVtbl -> MoveAndGetRunInfo(This,Row,ppInfo) + +#define IDXARGBReadPtr_Unpack(This,pSamples,cSamples,bMove) \ + (This)->lpVtbl -> Unpack(This,pSamples,cSamples,bMove) + +#define IDXARGBReadPtr_UnpackPremult(This,pSamples,cSamples,bMove) \ + (This)->lpVtbl -> UnpackPremult(This,pSamples,cSamples,bMove) + +#define IDXARGBReadPtr_UnpackRect(This,pRectDesc) \ + (This)->lpVtbl -> UnpackRect(This,pRectDesc) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXARGBReadPtr_GetSurface_Proxy( + IDXARGBReadPtr * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppSurface); + + +void __RPC_STUB IDXARGBReadPtr_GetSurface_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +DXSAMPLEFORMATENUM STDMETHODCALLTYPE IDXARGBReadPtr_GetNativeType_Proxy( + IDXARGBReadPtr * This, + /* [out] */ DXNATIVETYPEINFO *pInfo); + + +void __RPC_STUB IDXARGBReadPtr_GetNativeType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadPtr_Move_Proxy( + IDXARGBReadPtr * This, + /* [in] */ long cSamples); + + +void __RPC_STUB IDXARGBReadPtr_Move_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadPtr_MoveToRow_Proxy( + IDXARGBReadPtr * This, + /* [in] */ ULONG y); + + +void __RPC_STUB IDXARGBReadPtr_MoveToRow_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadPtr_MoveToXY_Proxy( + IDXARGBReadPtr * This, + /* [in] */ ULONG x, + /* [in] */ ULONG y); + + +void __RPC_STUB IDXARGBReadPtr_MoveToXY_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +ULONG STDMETHODCALLTYPE IDXARGBReadPtr_MoveAndGetRunInfo_Proxy( + IDXARGBReadPtr * This, + /* [in] */ ULONG Row, + /* [out] */ const DXRUNINFO **ppInfo); + + +void __RPC_STUB IDXARGBReadPtr_MoveAndGetRunInfo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +DXSAMPLE *STDMETHODCALLTYPE IDXARGBReadPtr_Unpack_Proxy( + IDXARGBReadPtr * This, + /* [in] */ DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove); + + +void __RPC_STUB IDXARGBReadPtr_Unpack_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +DXPMSAMPLE *STDMETHODCALLTYPE IDXARGBReadPtr_UnpackPremult_Proxy( + IDXARGBReadPtr * This, + /* [in] */ DXPMSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove); + + +void __RPC_STUB IDXARGBReadPtr_UnpackPremult_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadPtr_UnpackRect_Proxy( + IDXARGBReadPtr * This, + /* [in] */ const DXPACKEDRECTDESC *pRectDesc); + + +void __RPC_STUB IDXARGBReadPtr_UnpackRect_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXARGBReadPtr_INTERFACE_DEFINED__ */ + + +#ifndef __IDXARGBReadWritePtr_INTERFACE_DEFINED__ +#define __IDXARGBReadWritePtr_INTERFACE_DEFINED__ + +/* interface IDXARGBReadWritePtr */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXARGBReadWritePtr; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("EAAAC2D7-C290-11d1-905D-00C04FD9189D") + IDXARGBReadWritePtr : public IDXARGBReadPtr + { + public: + virtual void STDMETHODCALLTYPE PackAndMove( + /* [in] */ const DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples) = 0; + + virtual void STDMETHODCALLTYPE PackPremultAndMove( + /* [in] */ const DXPMSAMPLE *pSamples, + /* [in] */ ULONG cSamples) = 0; + + virtual void STDMETHODCALLTYPE PackRect( + /* [in] */ const DXPACKEDRECTDESC *pRectDesc) = 0; + + virtual void STDMETHODCALLTYPE CopyAndMoveBoth( + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ IDXARGBReadPtr *pSrc, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bIsOpaque) = 0; + + virtual void STDMETHODCALLTYPE CopyRect( + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ const RECT *pDestRect, + /* [in] */ IDXARGBReadPtr *pSrc, + /* [in] */ const POINT *pSrcOrigin, + /* [in] */ BOOL bIsOpaque) = 0; + + virtual void STDMETHODCALLTYPE FillAndMove( + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ DXPMSAMPLE SampVal, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bDoOver) = 0; + + virtual void STDMETHODCALLTYPE FillRect( + /* [in] */ const RECT *pRect, + /* [in] */ DXPMSAMPLE SampVal, + /* [in] */ BOOL bDoOver) = 0; + + virtual void STDMETHODCALLTYPE OverSample( + /* [in] */ const DXOVERSAMPLEDESC *pOverDesc) = 0; + + virtual void STDMETHODCALLTYPE OverArrayAndMove( + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ const DXPMSAMPLE *pSrc, + /* [in] */ ULONG cSamples) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXARGBReadWritePtrVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXARGBReadWritePtr * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXARGBReadWritePtr * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXARGBReadWritePtr * This); + + HRESULT ( STDMETHODCALLTYPE *GetSurface )( + IDXARGBReadWritePtr * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppSurface); + + DXSAMPLEFORMATENUM ( STDMETHODCALLTYPE *GetNativeType )( + IDXARGBReadWritePtr * This, + /* [out] */ DXNATIVETYPEINFO *pInfo); + + void ( STDMETHODCALLTYPE *Move )( + IDXARGBReadWritePtr * This, + /* [in] */ long cSamples); + + void ( STDMETHODCALLTYPE *MoveToRow )( + IDXARGBReadWritePtr * This, + /* [in] */ ULONG y); + + void ( STDMETHODCALLTYPE *MoveToXY )( + IDXARGBReadWritePtr * This, + /* [in] */ ULONG x, + /* [in] */ ULONG y); + + ULONG ( STDMETHODCALLTYPE *MoveAndGetRunInfo )( + IDXARGBReadWritePtr * This, + /* [in] */ ULONG Row, + /* [out] */ const DXRUNINFO **ppInfo); + + DXSAMPLE *( STDMETHODCALLTYPE *Unpack )( + IDXARGBReadWritePtr * This, + /* [in] */ DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove); + + DXPMSAMPLE *( STDMETHODCALLTYPE *UnpackPremult )( + IDXARGBReadWritePtr * This, + /* [in] */ DXPMSAMPLE *pSamples, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bMove); + + void ( STDMETHODCALLTYPE *UnpackRect )( + IDXARGBReadWritePtr * This, + /* [in] */ const DXPACKEDRECTDESC *pRectDesc); + + void ( STDMETHODCALLTYPE *PackAndMove )( + IDXARGBReadWritePtr * This, + /* [in] */ const DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples); + + void ( STDMETHODCALLTYPE *PackPremultAndMove )( + IDXARGBReadWritePtr * This, + /* [in] */ const DXPMSAMPLE *pSamples, + /* [in] */ ULONG cSamples); + + void ( STDMETHODCALLTYPE *PackRect )( + IDXARGBReadWritePtr * This, + /* [in] */ const DXPACKEDRECTDESC *pRectDesc); + + void ( STDMETHODCALLTYPE *CopyAndMoveBoth )( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ IDXARGBReadPtr *pSrc, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bIsOpaque); + + void ( STDMETHODCALLTYPE *CopyRect )( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ const RECT *pDestRect, + /* [in] */ IDXARGBReadPtr *pSrc, + /* [in] */ const POINT *pSrcOrigin, + /* [in] */ BOOL bIsOpaque); + + void ( STDMETHODCALLTYPE *FillAndMove )( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ DXPMSAMPLE SampVal, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bDoOver); + + void ( STDMETHODCALLTYPE *FillRect )( + IDXARGBReadWritePtr * This, + /* [in] */ const RECT *pRect, + /* [in] */ DXPMSAMPLE SampVal, + /* [in] */ BOOL bDoOver); + + void ( STDMETHODCALLTYPE *OverSample )( + IDXARGBReadWritePtr * This, + /* [in] */ const DXOVERSAMPLEDESC *pOverDesc); + + void ( STDMETHODCALLTYPE *OverArrayAndMove )( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ const DXPMSAMPLE *pSrc, + /* [in] */ ULONG cSamples); + + END_INTERFACE + } IDXARGBReadWritePtrVtbl; + + interface IDXARGBReadWritePtr + { + CONST_VTBL struct IDXARGBReadWritePtrVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXARGBReadWritePtr_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXARGBReadWritePtr_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXARGBReadWritePtr_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXARGBReadWritePtr_GetSurface(This,riid,ppSurface) \ + (This)->lpVtbl -> GetSurface(This,riid,ppSurface) + +#define IDXARGBReadWritePtr_GetNativeType(This,pInfo) \ + (This)->lpVtbl -> GetNativeType(This,pInfo) + +#define IDXARGBReadWritePtr_Move(This,cSamples) \ + (This)->lpVtbl -> Move(This,cSamples) + +#define IDXARGBReadWritePtr_MoveToRow(This,y) \ + (This)->lpVtbl -> MoveToRow(This,y) + +#define IDXARGBReadWritePtr_MoveToXY(This,x,y) \ + (This)->lpVtbl -> MoveToXY(This,x,y) + +#define IDXARGBReadWritePtr_MoveAndGetRunInfo(This,Row,ppInfo) \ + (This)->lpVtbl -> MoveAndGetRunInfo(This,Row,ppInfo) + +#define IDXARGBReadWritePtr_Unpack(This,pSamples,cSamples,bMove) \ + (This)->lpVtbl -> Unpack(This,pSamples,cSamples,bMove) + +#define IDXARGBReadWritePtr_UnpackPremult(This,pSamples,cSamples,bMove) \ + (This)->lpVtbl -> UnpackPremult(This,pSamples,cSamples,bMove) + +#define IDXARGBReadWritePtr_UnpackRect(This,pRectDesc) \ + (This)->lpVtbl -> UnpackRect(This,pRectDesc) + + +#define IDXARGBReadWritePtr_PackAndMove(This,pSamples,cSamples) \ + (This)->lpVtbl -> PackAndMove(This,pSamples,cSamples) + +#define IDXARGBReadWritePtr_PackPremultAndMove(This,pSamples,cSamples) \ + (This)->lpVtbl -> PackPremultAndMove(This,pSamples,cSamples) + +#define IDXARGBReadWritePtr_PackRect(This,pRectDesc) \ + (This)->lpVtbl -> PackRect(This,pRectDesc) + +#define IDXARGBReadWritePtr_CopyAndMoveBoth(This,pScratchBuffer,pSrc,cSamples,bIsOpaque) \ + (This)->lpVtbl -> CopyAndMoveBoth(This,pScratchBuffer,pSrc,cSamples,bIsOpaque) + +#define IDXARGBReadWritePtr_CopyRect(This,pScratchBuffer,pDestRect,pSrc,pSrcOrigin,bIsOpaque) \ + (This)->lpVtbl -> CopyRect(This,pScratchBuffer,pDestRect,pSrc,pSrcOrigin,bIsOpaque) + +#define IDXARGBReadWritePtr_FillAndMove(This,pScratchBuffer,SampVal,cSamples,bDoOver) \ + (This)->lpVtbl -> FillAndMove(This,pScratchBuffer,SampVal,cSamples,bDoOver) + +#define IDXARGBReadWritePtr_FillRect(This,pRect,SampVal,bDoOver) \ + (This)->lpVtbl -> FillRect(This,pRect,SampVal,bDoOver) + +#define IDXARGBReadWritePtr_OverSample(This,pOverDesc) \ + (This)->lpVtbl -> OverSample(This,pOverDesc) + +#define IDXARGBReadWritePtr_OverArrayAndMove(This,pScratchBuffer,pSrc,cSamples) \ + (This)->lpVtbl -> OverArrayAndMove(This,pScratchBuffer,pSrc,cSamples) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_PackAndMove_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ const DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples); + + +void __RPC_STUB IDXARGBReadWritePtr_PackAndMove_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_PackPremultAndMove_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ const DXPMSAMPLE *pSamples, + /* [in] */ ULONG cSamples); + + +void __RPC_STUB IDXARGBReadWritePtr_PackPremultAndMove_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_PackRect_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ const DXPACKEDRECTDESC *pRectDesc); + + +void __RPC_STUB IDXARGBReadWritePtr_PackRect_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_CopyAndMoveBoth_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ IDXARGBReadPtr *pSrc, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bIsOpaque); + + +void __RPC_STUB IDXARGBReadWritePtr_CopyAndMoveBoth_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_CopyRect_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ const RECT *pDestRect, + /* [in] */ IDXARGBReadPtr *pSrc, + /* [in] */ const POINT *pSrcOrigin, + /* [in] */ BOOL bIsOpaque); + + +void __RPC_STUB IDXARGBReadWritePtr_CopyRect_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_FillAndMove_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ DXPMSAMPLE SampVal, + /* [in] */ ULONG cSamples, + /* [in] */ BOOL bDoOver); + + +void __RPC_STUB IDXARGBReadWritePtr_FillAndMove_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_FillRect_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ const RECT *pRect, + /* [in] */ DXPMSAMPLE SampVal, + /* [in] */ BOOL bDoOver); + + +void __RPC_STUB IDXARGBReadWritePtr_FillRect_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_OverSample_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ const DXOVERSAMPLEDESC *pOverDesc); + + +void __RPC_STUB IDXARGBReadWritePtr_OverSample_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +void STDMETHODCALLTYPE IDXARGBReadWritePtr_OverArrayAndMove_Proxy( + IDXARGBReadWritePtr * This, + /* [in] */ DXBASESAMPLE *pScratchBuffer, + /* [in] */ const DXPMSAMPLE *pSrc, + /* [in] */ ULONG cSamples); + + +void __RPC_STUB IDXARGBReadWritePtr_OverArrayAndMove_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXARGBReadWritePtr_INTERFACE_DEFINED__ */ + + +#ifndef __IDXDCLock_INTERFACE_DEFINED__ +#define __IDXDCLock_INTERFACE_DEFINED__ + +/* interface IDXDCLock */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXDCLock; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0F619456-CF39-11d1-905E-00C04FD9189D") + IDXDCLock : public IUnknown + { + public: + virtual HDC STDMETHODCALLTYPE GetDC( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXDCLockVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXDCLock * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXDCLock * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXDCLock * This); + + HDC ( STDMETHODCALLTYPE *GetDC )( + IDXDCLock * This); + + END_INTERFACE + } IDXDCLockVtbl; + + interface IDXDCLock + { + CONST_VTBL struct IDXDCLockVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXDCLock_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXDCLock_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXDCLock_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXDCLock_GetDC(This) \ + (This)->lpVtbl -> GetDC(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HDC STDMETHODCALLTYPE IDXDCLock_GetDC_Proxy( + IDXDCLock * This); + + +void __RPC_STUB IDXDCLock_GetDC_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXDCLock_INTERFACE_DEFINED__ */ + + +#ifndef __IDXTScaleOutput_INTERFACE_DEFINED__ +#define __IDXTScaleOutput_INTERFACE_DEFINED__ + +/* interface IDXTScaleOutput */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXTScaleOutput; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("B2024B50-EE77-11d1-9066-00C04FD9189D") + IDXTScaleOutput : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetOutputSize( + /* [in] */ const SIZE OutSize, + /* [in] */ BOOL bMaintainAspect) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXTScaleOutputVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXTScaleOutput * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXTScaleOutput * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXTScaleOutput * This); + + HRESULT ( STDMETHODCALLTYPE *SetOutputSize )( + IDXTScaleOutput * This, + /* [in] */ const SIZE OutSize, + /* [in] */ BOOL bMaintainAspect); + + END_INTERFACE + } IDXTScaleOutputVtbl; + + interface IDXTScaleOutput + { + CONST_VTBL struct IDXTScaleOutputVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXTScaleOutput_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXTScaleOutput_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXTScaleOutput_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXTScaleOutput_SetOutputSize(This,OutSize,bMaintainAspect) \ + (This)->lpVtbl -> SetOutputSize(This,OutSize,bMaintainAspect) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXTScaleOutput_SetOutputSize_Proxy( + IDXTScaleOutput * This, + /* [in] */ const SIZE OutSize, + /* [in] */ BOOL bMaintainAspect); + + +void __RPC_STUB IDXTScaleOutput_SetOutputSize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXTScaleOutput_INTERFACE_DEFINED__ */ + + +#ifndef __IDXGradient_INTERFACE_DEFINED__ +#define __IDXGradient_INTERFACE_DEFINED__ + +/* interface IDXGradient */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXGradient; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("B2024B51-EE77-11d1-9066-00C04FD9189D") + IDXGradient : public IDXTScaleOutput + { + public: + virtual HRESULT STDMETHODCALLTYPE SetGradient( + DXSAMPLE StartColor, + DXSAMPLE EndColor, + BOOL bHorizontal) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetOutputSize( + /* [out] */ SIZE *pOutSize) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXGradientVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXGradient * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXGradient * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXGradient * This); + + HRESULT ( STDMETHODCALLTYPE *SetOutputSize )( + IDXGradient * This, + /* [in] */ const SIZE OutSize, + /* [in] */ BOOL bMaintainAspect); + + HRESULT ( STDMETHODCALLTYPE *SetGradient )( + IDXGradient * This, + DXSAMPLE StartColor, + DXSAMPLE EndColor, + BOOL bHorizontal); + + HRESULT ( STDMETHODCALLTYPE *GetOutputSize )( + IDXGradient * This, + /* [out] */ SIZE *pOutSize); + + END_INTERFACE + } IDXGradientVtbl; + + interface IDXGradient + { + CONST_VTBL struct IDXGradientVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXGradient_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXGradient_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXGradient_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXGradient_SetOutputSize(This,OutSize,bMaintainAspect) \ + (This)->lpVtbl -> SetOutputSize(This,OutSize,bMaintainAspect) + + +#define IDXGradient_SetGradient(This,StartColor,EndColor,bHorizontal) \ + (This)->lpVtbl -> SetGradient(This,StartColor,EndColor,bHorizontal) + +#define IDXGradient_GetOutputSize(This,pOutSize) \ + (This)->lpVtbl -> GetOutputSize(This,pOutSize) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXGradient_SetGradient_Proxy( + IDXGradient * This, + DXSAMPLE StartColor, + DXSAMPLE EndColor, + BOOL bHorizontal); + + +void __RPC_STUB IDXGradient_SetGradient_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXGradient_GetOutputSize_Proxy( + IDXGradient * This, + /* [out] */ SIZE *pOutSize); + + +void __RPC_STUB IDXGradient_GetOutputSize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXGradient_INTERFACE_DEFINED__ */ + + +#ifndef __IDXTScale_INTERFACE_DEFINED__ +#define __IDXTScale_INTERFACE_DEFINED__ + +/* interface IDXTScale */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXTScale; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("B39FD742-E139-11d1-9065-00C04FD9189D") + IDXTScale : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetScales( + /* [in] */ float Scales[ 2 ]) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetScales( + /* [out] */ float Scales[ 2 ]) = 0; + + virtual HRESULT STDMETHODCALLTYPE ScaleFitToSize( + /* [out][in] */ DXBNDS *pClipBounds, + /* [in] */ SIZE FitToSize, + /* [in] */ BOOL bMaintainAspect) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXTScaleVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXTScale * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXTScale * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXTScale * This); + + HRESULT ( STDMETHODCALLTYPE *SetScales )( + IDXTScale * This, + /* [in] */ float Scales[ 2 ]); + + HRESULT ( STDMETHODCALLTYPE *GetScales )( + IDXTScale * This, + /* [out] */ float Scales[ 2 ]); + + HRESULT ( STDMETHODCALLTYPE *ScaleFitToSize )( + IDXTScale * This, + /* [out][in] */ DXBNDS *pClipBounds, + /* [in] */ SIZE FitToSize, + /* [in] */ BOOL bMaintainAspect); + + END_INTERFACE + } IDXTScaleVtbl; + + interface IDXTScale + { + CONST_VTBL struct IDXTScaleVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXTScale_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXTScale_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXTScale_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXTScale_SetScales(This,Scales) \ + (This)->lpVtbl -> SetScales(This,Scales) + +#define IDXTScale_GetScales(This,Scales) \ + (This)->lpVtbl -> GetScales(This,Scales) + +#define IDXTScale_ScaleFitToSize(This,pClipBounds,FitToSize,bMaintainAspect) \ + (This)->lpVtbl -> ScaleFitToSize(This,pClipBounds,FitToSize,bMaintainAspect) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXTScale_SetScales_Proxy( + IDXTScale * This, + /* [in] */ float Scales[ 2 ]); + + +void __RPC_STUB IDXTScale_SetScales_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTScale_GetScales_Proxy( + IDXTScale * This, + /* [out] */ float Scales[ 2 ]); + + +void __RPC_STUB IDXTScale_GetScales_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXTScale_ScaleFitToSize_Proxy( + IDXTScale * This, + /* [out][in] */ DXBNDS *pClipBounds, + /* [in] */ SIZE FitToSize, + /* [in] */ BOOL bMaintainAspect); + + +void __RPC_STUB IDXTScale_ScaleFitToSize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXTScale_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0276 */ +/* [local] */ + +typedef +enum DISPIDDXEFFECT + { DISPID_DXECAPABILITIES = 10000, + DISPID_DXEPROGRESS = DISPID_DXECAPABILITIES + 1, + DISPID_DXESTEP = DISPID_DXEPROGRESS + 1, + DISPID_DXEDURATION = DISPID_DXESTEP + 1, + DISPID_DXE_NEXT_ID = DISPID_DXEDURATION + 1 + } DISPIDDXBOUNDEDEFFECT; + +typedef +enum DXEFFECTTYPE + { DXTET_PERIODIC = 1 << 0, + DXTET_MORPH = 1 << 1 + } DXEFFECTTYPE; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0276_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0276_v0_0_s_ifspec; + +#ifndef __IDXEffect_INTERFACE_DEFINED__ +#define __IDXEffect_INTERFACE_DEFINED__ + +/* interface IDXEffect */ +/* [dual][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXEffect; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("E31FB81B-1335-11d1-8189-0000F87557DB") + IDXEffect : public IDispatch + { + public: + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Capabilities( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Progress( + /* [retval][out] */ float *pVal) = 0; + + virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Progress( + /* [in] */ float newVal) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_StepResolution( + /* [retval][out] */ float *pVal) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Duration( + /* [retval][out] */ float *pVal) = 0; + + virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Duration( + /* [in] */ float newVal) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXEffectVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXEffect * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXEffect * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXEffect * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + IDXEffect * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + IDXEffect * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + IDXEffect * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + IDXEffect * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Capabilities )( + IDXEffect * This, + /* [retval][out] */ long *pVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Progress )( + IDXEffect * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Progress )( + IDXEffect * This, + /* [in] */ float newVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StepResolution )( + IDXEffect * This, + /* [retval][out] */ float *pVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( + IDXEffect * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( + IDXEffect * This, + /* [in] */ float newVal); + + END_INTERFACE + } IDXEffectVtbl; + + interface IDXEffect + { + CONST_VTBL struct IDXEffectVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXEffect_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXEffect_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXEffect_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXEffect_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IDXEffect_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IDXEffect_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IDXEffect_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define IDXEffect_get_Capabilities(This,pVal) \ + (This)->lpVtbl -> get_Capabilities(This,pVal) + +#define IDXEffect_get_Progress(This,pVal) \ + (This)->lpVtbl -> get_Progress(This,pVal) + +#define IDXEffect_put_Progress(This,newVal) \ + (This)->lpVtbl -> put_Progress(This,newVal) + +#define IDXEffect_get_StepResolution(This,pVal) \ + (This)->lpVtbl -> get_StepResolution(This,pVal) + +#define IDXEffect_get_Duration(This,pVal) \ + (This)->lpVtbl -> get_Duration(This,pVal) + +#define IDXEffect_put_Duration(This,newVal) \ + (This)->lpVtbl -> put_Duration(This,newVal) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE IDXEffect_get_Capabilities_Proxy( + IDXEffect * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB IDXEffect_get_Capabilities_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE IDXEffect_get_Progress_Proxy( + IDXEffect * This, + /* [retval][out] */ float *pVal); + + +void __RPC_STUB IDXEffect_get_Progress_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propput] */ HRESULT STDMETHODCALLTYPE IDXEffect_put_Progress_Proxy( + IDXEffect * This, + /* [in] */ float newVal); + + +void __RPC_STUB IDXEffect_put_Progress_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE IDXEffect_get_StepResolution_Proxy( + IDXEffect * This, + /* [retval][out] */ float *pVal); + + +void __RPC_STUB IDXEffect_get_StepResolution_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE IDXEffect_get_Duration_Proxy( + IDXEffect * This, + /* [retval][out] */ float *pVal); + + +void __RPC_STUB IDXEffect_get_Duration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propput] */ HRESULT STDMETHODCALLTYPE IDXEffect_put_Duration_Proxy( + IDXEffect * This, + /* [in] */ float newVal); + + +void __RPC_STUB IDXEffect_put_Duration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXEffect_INTERFACE_DEFINED__ */ + + +#ifndef __IDXLookupTable_INTERFACE_DEFINED__ +#define __IDXLookupTable_INTERFACE_DEFINED__ + +/* interface IDXLookupTable */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXLookupTable; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("01BAFC7F-9E63-11d1-9053-00C04FD9189D") + IDXLookupTable : public IDXBaseObject + { + public: + virtual HRESULT STDMETHODCALLTYPE GetTables( + /* [out] */ BYTE RedLUT[ 256 ], + /* [out] */ BYTE GreenLUT[ 256 ], + /* [out] */ BYTE BlueLUT[ 256 ], + /* [out] */ BYTE AlphaLUT[ 256 ]) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsChannelIdentity( + /* [out] */ DXBASESAMPLE *pSampleBools) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetIndexValues( + /* [in] */ ULONG Index, + /* [out] */ DXBASESAMPLE *pSample) = 0; + + virtual HRESULT STDMETHODCALLTYPE ApplyTables( + /* [out][in] */ DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXLookupTableVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXLookupTable * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXLookupTable * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXLookupTable * This); + + HRESULT ( STDMETHODCALLTYPE *GetGenerationId )( + IDXLookupTable * This, + /* [out] */ ULONG *pID); + + HRESULT ( STDMETHODCALLTYPE *IncrementGenerationId )( + IDXLookupTable * This, + /* [in] */ BOOL bRefresh); + + HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( + IDXLookupTable * This, + /* [out] */ ULONG *pcbSize); + + HRESULT ( STDMETHODCALLTYPE *GetTables )( + IDXLookupTable * This, + /* [out] */ BYTE RedLUT[ 256 ], + /* [out] */ BYTE GreenLUT[ 256 ], + /* [out] */ BYTE BlueLUT[ 256 ], + /* [out] */ BYTE AlphaLUT[ 256 ]); + + HRESULT ( STDMETHODCALLTYPE *IsChannelIdentity )( + IDXLookupTable * This, + /* [out] */ DXBASESAMPLE *pSampleBools); + + HRESULT ( STDMETHODCALLTYPE *GetIndexValues )( + IDXLookupTable * This, + /* [in] */ ULONG Index, + /* [out] */ DXBASESAMPLE *pSample); + + HRESULT ( STDMETHODCALLTYPE *ApplyTables )( + IDXLookupTable * This, + /* [out][in] */ DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples); + + END_INTERFACE + } IDXLookupTableVtbl; + + interface IDXLookupTable + { + CONST_VTBL struct IDXLookupTableVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXLookupTable_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXLookupTable_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXLookupTable_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXLookupTable_GetGenerationId(This,pID) \ + (This)->lpVtbl -> GetGenerationId(This,pID) + +#define IDXLookupTable_IncrementGenerationId(This,bRefresh) \ + (This)->lpVtbl -> IncrementGenerationId(This,bRefresh) + +#define IDXLookupTable_GetObjectSize(This,pcbSize) \ + (This)->lpVtbl -> GetObjectSize(This,pcbSize) + + +#define IDXLookupTable_GetTables(This,RedLUT,GreenLUT,BlueLUT,AlphaLUT) \ + (This)->lpVtbl -> GetTables(This,RedLUT,GreenLUT,BlueLUT,AlphaLUT) + +#define IDXLookupTable_IsChannelIdentity(This,pSampleBools) \ + (This)->lpVtbl -> IsChannelIdentity(This,pSampleBools) + +#define IDXLookupTable_GetIndexValues(This,Index,pSample) \ + (This)->lpVtbl -> GetIndexValues(This,Index,pSample) + +#define IDXLookupTable_ApplyTables(This,pSamples,cSamples) \ + (This)->lpVtbl -> ApplyTables(This,pSamples,cSamples) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXLookupTable_GetTables_Proxy( + IDXLookupTable * This, + /* [out] */ BYTE RedLUT[ 256 ], + /* [out] */ BYTE GreenLUT[ 256 ], + /* [out] */ BYTE BlueLUT[ 256 ], + /* [out] */ BYTE AlphaLUT[ 256 ]); + + +void __RPC_STUB IDXLookupTable_GetTables_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXLookupTable_IsChannelIdentity_Proxy( + IDXLookupTable * This, + /* [out] */ DXBASESAMPLE *pSampleBools); + + +void __RPC_STUB IDXLookupTable_IsChannelIdentity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXLookupTable_GetIndexValues_Proxy( + IDXLookupTable * This, + /* [in] */ ULONG Index, + /* [out] */ DXBASESAMPLE *pSample); + + +void __RPC_STUB IDXLookupTable_GetIndexValues_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IDXLookupTable_ApplyTables_Proxy( + IDXLookupTable * This, + /* [out][in] */ DXSAMPLE *pSamples, + /* [in] */ ULONG cSamples); + + +void __RPC_STUB IDXLookupTable_ApplyTables_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXLookupTable_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0278 */ +/* [local] */ + +typedef struct DXRAWSURFACEINFO + { + BYTE *pFirstByte; + long lPitch; + ULONG Width; + ULONG Height; + const GUID *pPixelFormat; + HDC hdc; + DWORD dwColorKey; + DXBASESAMPLE *pPalette; + } DXRAWSURFACEINFO; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0278_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0278_v0_0_s_ifspec; + +#ifndef __IDXRawSurface_INTERFACE_DEFINED__ +#define __IDXRawSurface_INTERFACE_DEFINED__ + +/* interface IDXRawSurface */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IDXRawSurface; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("09756C8A-D96A-11d1-9062-00C04FD9189D") + IDXRawSurface : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetSurfaceInfo( + DXRAWSURFACEINFO *pSurfaceInfo) = 0; + + }; + +#else /* C style interface */ + + typedef struct IDXRawSurfaceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IDXRawSurface * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IDXRawSurface * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IDXRawSurface * This); + + HRESULT ( STDMETHODCALLTYPE *GetSurfaceInfo )( + IDXRawSurface * This, + DXRAWSURFACEINFO *pSurfaceInfo); + + END_INTERFACE + } IDXRawSurfaceVtbl; + + interface IDXRawSurface + { + CONST_VTBL struct IDXRawSurfaceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDXRawSurface_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDXRawSurface_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDXRawSurface_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDXRawSurface_GetSurfaceInfo(This,pSurfaceInfo) \ + (This)->lpVtbl -> GetSurfaceInfo(This,pSurfaceInfo) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IDXRawSurface_GetSurfaceInfo_Proxy( + IDXRawSurface * This, + DXRAWSURFACEINFO *pSurfaceInfo); + + +void __RPC_STUB IDXRawSurface_GetSurfaceInfo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IDXRawSurface_INTERFACE_DEFINED__ */ + + +#ifndef __IHTMLDXTransform_INTERFACE_DEFINED__ +#define __IHTMLDXTransform_INTERFACE_DEFINED__ + +/* interface IHTMLDXTransform */ +/* [local][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IHTMLDXTransform; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("30E2AB7D-4FDD-4159-B7EA-DC722BF4ADE5") + IHTMLDXTransform : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetHostUrl( + BSTR bstrHostUrl) = 0; + + }; + +#else /* C style interface */ + + typedef struct IHTMLDXTransformVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IHTMLDXTransform * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IHTMLDXTransform * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IHTMLDXTransform * This); + + HRESULT ( STDMETHODCALLTYPE *SetHostUrl )( + IHTMLDXTransform * This, + BSTR bstrHostUrl); + + END_INTERFACE + } IHTMLDXTransformVtbl; + + interface IHTMLDXTransform + { + CONST_VTBL struct IHTMLDXTransformVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IHTMLDXTransform_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IHTMLDXTransform_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IHTMLDXTransform_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IHTMLDXTransform_SetHostUrl(This,bstrHostUrl) \ + (This)->lpVtbl -> SetHostUrl(This,bstrHostUrl) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IHTMLDXTransform_SetHostUrl_Proxy( + IHTMLDXTransform * This, + BSTR bstrHostUrl); + + +void __RPC_STUB IHTMLDXTransform_SetHostUrl_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IHTMLDXTransform_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_dxtrans_0280 */ +/* [local] */ + +typedef +enum DXTFILTER_STATUS + { DXTFILTER_STATUS_Stopped = 0, + DXTFILTER_STATUS_Applied = DXTFILTER_STATUS_Stopped + 1, + DXTFILTER_STATUS_Playing = DXTFILTER_STATUS_Applied + 1, + DXTFILTER_STATUS_MAX = DXTFILTER_STATUS_Playing + 1 + } DXTFILTER_STATUS; + +typedef +enum DXTFILTER_DISPID + { DISPID_DXTFilter_Percent = 1, + DISPID_DXTFilter_Duration = DISPID_DXTFilter_Percent + 1, + DISPID_DXTFilter_Enabled = DISPID_DXTFilter_Duration + 1, + DISPID_DXTFilter_Status = DISPID_DXTFilter_Enabled + 1, + DISPID_DXTFilter_Apply = DISPID_DXTFilter_Status + 1, + DISPID_DXTFilter_Play = DISPID_DXTFilter_Apply + 1, + DISPID_DXTFilter_Stop = DISPID_DXTFilter_Play + 1, + DISPID_DXTFilter_MAX = DISPID_DXTFilter_Stop + 1 + } DXTFILTER_DISPID; + + + +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0280_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_dxtrans_0280_v0_0_s_ifspec; + +#ifndef __ICSSFilterDispatch_INTERFACE_DEFINED__ +#define __ICSSFilterDispatch_INTERFACE_DEFINED__ + +/* interface ICSSFilterDispatch */ +/* [dual][unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_ICSSFilterDispatch; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9519152B-9484-4A6C-B6A7-4F25E92D6C6B") + ICSSFilterDispatch : public IDispatch + { + public: + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Percent( + /* [retval][out] */ float *pVal) = 0; + + virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Percent( + /* [in] */ float newVal) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Duration( + /* [retval][out] */ float *pVal) = 0; + + virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Duration( + /* [in] */ float newVal) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Enabled( + /* [retval][out] */ VARIANT_BOOL *pfVal) = 0; + + virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_Enabled( + /* [in] */ VARIANT_BOOL fVal) = 0; + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_Status( + /* [retval][out] */ DXTFILTER_STATUS *peVal) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE Apply( void) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE Play( + /* [optional][in] */ VARIANT varDuration) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE Stop( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct ICSSFilterDispatchVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICSSFilterDispatch * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICSSFilterDispatch * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ICSSFilterDispatch * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ICSSFilterDispatch * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ICSSFilterDispatch * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ICSSFilterDispatch * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ICSSFilterDispatch * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Percent )( + ICSSFilterDispatch * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Percent )( + ICSSFilterDispatch * This, + /* [in] */ float newVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Duration )( + ICSSFilterDispatch * This, + /* [retval][out] */ float *pVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Duration )( + ICSSFilterDispatch * This, + /* [in] */ float newVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Enabled )( + ICSSFilterDispatch * This, + /* [retval][out] */ VARIANT_BOOL *pfVal); + + /* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Enabled )( + ICSSFilterDispatch * This, + /* [in] */ VARIANT_BOOL fVal); + + /* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Status )( + ICSSFilterDispatch * This, + /* [retval][out] */ DXTFILTER_STATUS *peVal); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Apply )( + ICSSFilterDispatch * This); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Play )( + ICSSFilterDispatch * This, + /* [optional][in] */ VARIANT varDuration); + + /* [id] */ HRESULT ( STDMETHODCALLTYPE *Stop )( + ICSSFilterDispatch * This); + + END_INTERFACE + } ICSSFilterDispatchVtbl; + + interface ICSSFilterDispatch + { + CONST_VTBL struct ICSSFilterDispatchVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICSSFilterDispatch_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ICSSFilterDispatch_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ICSSFilterDispatch_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ICSSFilterDispatch_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ICSSFilterDispatch_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ICSSFilterDispatch_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ICSSFilterDispatch_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ICSSFilterDispatch_get_Percent(This,pVal) \ + (This)->lpVtbl -> get_Percent(This,pVal) + +#define ICSSFilterDispatch_put_Percent(This,newVal) \ + (This)->lpVtbl -> put_Percent(This,newVal) + +#define ICSSFilterDispatch_get_Duration(This,pVal) \ + (This)->lpVtbl -> get_Duration(This,pVal) + +#define ICSSFilterDispatch_put_Duration(This,newVal) \ + (This)->lpVtbl -> put_Duration(This,newVal) + +#define ICSSFilterDispatch_get_Enabled(This,pfVal) \ + (This)->lpVtbl -> get_Enabled(This,pfVal) + +#define ICSSFilterDispatch_put_Enabled(This,fVal) \ + (This)->lpVtbl -> put_Enabled(This,fVal) + +#define ICSSFilterDispatch_get_Status(This,peVal) \ + (This)->lpVtbl -> get_Status(This,peVal) + +#define ICSSFilterDispatch_Apply(This) \ + (This)->lpVtbl -> Apply(This) + +#define ICSSFilterDispatch_Play(This,varDuration) \ + (This)->lpVtbl -> Play(This,varDuration) + +#define ICSSFilterDispatch_Stop(This) \ + (This)->lpVtbl -> Stop(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_get_Percent_Proxy( + ICSSFilterDispatch * This, + /* [retval][out] */ float *pVal); + + +void __RPC_STUB ICSSFilterDispatch_get_Percent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propput] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_put_Percent_Proxy( + ICSSFilterDispatch * This, + /* [in] */ float newVal); + + +void __RPC_STUB ICSSFilterDispatch_put_Percent_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_get_Duration_Proxy( + ICSSFilterDispatch * This, + /* [retval][out] */ float *pVal); + + +void __RPC_STUB ICSSFilterDispatch_get_Duration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propput] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_put_Duration_Proxy( + ICSSFilterDispatch * This, + /* [in] */ float newVal); + + +void __RPC_STUB ICSSFilterDispatch_put_Duration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_get_Enabled_Proxy( + ICSSFilterDispatch * This, + /* [retval][out] */ VARIANT_BOOL *pfVal); + + +void __RPC_STUB ICSSFilterDispatch_get_Enabled_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propput] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_put_Enabled_Proxy( + ICSSFilterDispatch * This, + /* [in] */ VARIANT_BOOL fVal); + + +void __RPC_STUB ICSSFilterDispatch_put_Enabled_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id][propget] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_get_Status_Proxy( + ICSSFilterDispatch * This, + /* [retval][out] */ DXTFILTER_STATUS *peVal); + + +void __RPC_STUB ICSSFilterDispatch_get_Status_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_Apply_Proxy( + ICSSFilterDispatch * This); + + +void __RPC_STUB ICSSFilterDispatch_Apply_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_Play_Proxy( + ICSSFilterDispatch * This, + /* [optional][in] */ VARIANT varDuration); + + +void __RPC_STUB ICSSFilterDispatch_Play_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [id] */ HRESULT STDMETHODCALLTYPE ICSSFilterDispatch_Stop_Proxy( + ICSSFilterDispatch * This); + + +void __RPC_STUB ICSSFilterDispatch_Stop_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ICSSFilterDispatch_INTERFACE_DEFINED__ */ + + + +#ifndef __DXTRANSLib_LIBRARY_DEFINED__ +#define __DXTRANSLib_LIBRARY_DEFINED__ + +/* library DXTRANSLib */ +/* [helpstring][version][uuid] */ + + +EXTERN_C const IID LIBID_DXTRANSLib; + +EXTERN_C const CLSID CLSID_DXTransformFactory; + +#ifdef __cplusplus + +class DECLSPEC_UUID("D1FE6762-FC48-11D0-883A-3C8B00C10000") +DXTransformFactory; +#endif + +EXTERN_C const CLSID CLSID_DXTaskManager; + +#ifdef __cplusplus + +class DECLSPEC_UUID("4CB26C03-FF93-11d0-817E-0000F87557DB") +DXTaskManager; +#endif + +EXTERN_C const CLSID CLSID_DXTScale; + +#ifdef __cplusplus + +class DECLSPEC_UUID("555278E2-05DB-11D1-883A-3C8B00C10000") +DXTScale; +#endif + +EXTERN_C const CLSID CLSID_DXSurface; + +#ifdef __cplusplus + +class DECLSPEC_UUID("0E890F83-5F79-11D1-9043-00C04FD9189D") +DXSurface; +#endif + +EXTERN_C const CLSID CLSID_DXSurfaceModifier; + +#ifdef __cplusplus + +class DECLSPEC_UUID("3E669F1D-9C23-11d1-9053-00C04FD9189D") +DXSurfaceModifier; +#endif + +EXTERN_C const CLSID CLSID_DXGradient; + +#ifdef __cplusplus + +class DECLSPEC_UUID("C6365470-F667-11d1-9067-00C04FD9189D") +DXGradient; +#endif + +EXTERN_C const CLSID CLSID_DXTFilter; + +#ifdef __cplusplus + +class DECLSPEC_UUID("385A91BC-1E8A-4e4a-A7A6-F4FC1E6CA1BD") +DXTFilter; +#endif +#endif /* __DXTRANSLib_LIBRARY_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); +void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * ); + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/Src/Decoder_H264_ALL/D3D/include/gameux.h b/Src/Decoder_H264_ALL/D3D/include/gameux.h new file mode 100644 index 0000000..19e2f95 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/gameux.h @@ -0,0 +1,719 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 7.00.0550 */ +/* Compiler settings for gameux.idl: + Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0550 + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __gameux_h__ +#define __gameux_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __IGameExplorer_FWD_DEFINED__ +#define __IGameExplorer_FWD_DEFINED__ +typedef interface IGameExplorer IGameExplorer; +#endif /* __IGameExplorer_FWD_DEFINED__ */ + + +#ifndef __IGameStatistics_FWD_DEFINED__ +#define __IGameStatistics_FWD_DEFINED__ +typedef interface IGameStatistics IGameStatistics; +#endif /* __IGameStatistics_FWD_DEFINED__ */ + + +#ifndef __IGameStatisticsMgr_FWD_DEFINED__ +#define __IGameStatisticsMgr_FWD_DEFINED__ +typedef interface IGameStatisticsMgr IGameStatisticsMgr; +#endif /* __IGameStatisticsMgr_FWD_DEFINED__ */ + + +#ifndef __IGameExplorer2_FWD_DEFINED__ +#define __IGameExplorer2_FWD_DEFINED__ +typedef interface IGameExplorer2 IGameExplorer2; +#endif /* __IGameExplorer2_FWD_DEFINED__ */ + + +#ifndef __GameExplorer_FWD_DEFINED__ +#define __GameExplorer_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class GameExplorer GameExplorer; +#else +typedef struct GameExplorer GameExplorer; +#endif /* __cplusplus */ + +#endif /* __GameExplorer_FWD_DEFINED__ */ + + +#ifndef __GameStatistics_FWD_DEFINED__ +#define __GameStatistics_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class GameStatistics GameStatistics; +#else +typedef struct GameStatistics GameStatistics; +#endif /* __cplusplus */ + +#endif /* __GameStatistics_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "shobjidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_gameux_0000_0000 */ +/* [local] */ + +#define ID_GDF_XML __GDF_XML +#define ID_GDF_THUMBNAIL __GDF_THUMBNAIL +#define ID_ICON_ICO __ICON_ICO +#define ID_GDF_XML_STR L"__GDF_XML" +#define ID_GDF_THUMBNAIL_STR L"__GDF_THUMBNAIL" +typedef /* [v1_enum] */ +enum GAME_INSTALL_SCOPE + { GIS_NOT_INSTALLED = 1, + GIS_CURRENT_USER = 2, + GIS_ALL_USERS = 3 + } GAME_INSTALL_SCOPE; + + + +extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0000_v0_0_s_ifspec; + +#ifndef __IGameExplorer_INTERFACE_DEFINED__ +#define __IGameExplorer_INTERFACE_DEFINED__ + +/* interface IGameExplorer */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IGameExplorer; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("E7B2FB72-D728-49B3-A5F2-18EBF5F1349E") + IGameExplorer : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddGame( + /* [in] */ __RPC__in BSTR bstrGDFBinaryPath, + /* [in] */ __RPC__in BSTR bstrGameInstallDirectory, + /* [in] */ GAME_INSTALL_SCOPE installScope, + /* [out][in] */ __RPC__inout GUID *pguidInstanceID) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveGame( + /* [in] */ GUID guidInstanceID) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UpdateGame( + /* [in] */ GUID guidInstanceID) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE VerifyAccess( + /* [in] */ __RPC__in BSTR bstrGDFBinaryPath, + /* [out] */ __RPC__out BOOL *pfHasAccess) = 0; + + }; + +#else /* C style interface */ + + typedef struct IGameExplorerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + __RPC__in IGameExplorer * This, + /* [in] */ __RPC__in REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + __RPC__in IGameExplorer * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + __RPC__in IGameExplorer * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AddGame )( + __RPC__in IGameExplorer * This, + /* [in] */ __RPC__in BSTR bstrGDFBinaryPath, + /* [in] */ __RPC__in BSTR bstrGameInstallDirectory, + /* [in] */ GAME_INSTALL_SCOPE installScope, + /* [out][in] */ __RPC__inout GUID *pguidInstanceID); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveGame )( + __RPC__in IGameExplorer * This, + /* [in] */ GUID guidInstanceID); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *UpdateGame )( + __RPC__in IGameExplorer * This, + /* [in] */ GUID guidInstanceID); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *VerifyAccess )( + __RPC__in IGameExplorer * This, + /* [in] */ __RPC__in BSTR bstrGDFBinaryPath, + /* [out] */ __RPC__out BOOL *pfHasAccess); + + END_INTERFACE + } IGameExplorerVtbl; + + interface IGameExplorer + { + CONST_VTBL struct IGameExplorerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IGameExplorer_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IGameExplorer_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IGameExplorer_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IGameExplorer_AddGame(This,bstrGDFBinaryPath,bstrGameInstallDirectory,installScope,pguidInstanceID) \ + ( (This)->lpVtbl -> AddGame(This,bstrGDFBinaryPath,bstrGameInstallDirectory,installScope,pguidInstanceID) ) + +#define IGameExplorer_RemoveGame(This,guidInstanceID) \ + ( (This)->lpVtbl -> RemoveGame(This,guidInstanceID) ) + +#define IGameExplorer_UpdateGame(This,guidInstanceID) \ + ( (This)->lpVtbl -> UpdateGame(This,guidInstanceID) ) + +#define IGameExplorer_VerifyAccess(This,bstrGDFBinaryPath,pfHasAccess) \ + ( (This)->lpVtbl -> VerifyAccess(This,bstrGDFBinaryPath,pfHasAccess) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IGameExplorer_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_gameux_0000_0001 */ +/* [local] */ + +typedef /* [v1_enum] */ +enum GAMESTATS_OPEN_TYPE + { GAMESTATS_OPEN_OPENORCREATE = 0, + GAMESTATS_OPEN_OPENONLY = 1 + } GAMESTATS_OPEN_TYPE; + +typedef /* [v1_enum] */ +enum GAMESTATS_OPEN_RESULT + { GAMESTATS_OPEN_CREATED = 0, + GAMESTATS_OPEN_OPENED = 1 + } GAMESTATS_OPEN_RESULT; + + + +extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_gameux_0000_0001_v0_0_s_ifspec; + +#ifndef __IGameStatistics_INTERFACE_DEFINED__ +#define __IGameStatistics_INTERFACE_DEFINED__ + +/* interface IGameStatistics */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IGameStatistics; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3887C9CA-04A0-42ae-BC4C-5FA6C7721145") + IGameStatistics : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxCategoryLength( + /* [retval][out] */ __RPC__out UINT *cch) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxNameLength( + /* [retval][out] */ __RPC__out UINT *cch) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxValueLength( + /* [retval][out] */ __RPC__out UINT *cch) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxCategories( + /* [retval][out] */ __RPC__out WORD *pMax) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetMaxStatsPerCategory( + /* [retval][out] */ __RPC__out WORD *pMax) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetCategoryTitle( + /* [in] */ WORD categoryIndex, + /* [string][in] */ __RPC__in_string LPCWSTR title) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCategoryTitle( + /* [in] */ WORD categoryIndex, + /* [retval][string][out] */ __RPC__deref_out_opt_string LPWSTR *pTitle) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStatistic( + /* [in] */ WORD categoryIndex, + /* [in] */ WORD statIndex, + /* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pName, + /* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pValue) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetStatistic( + /* [in] */ WORD categoryIndex, + /* [in] */ WORD statIndex, + /* [string][in] */ __RPC__in_string LPCWSTR name, + /* [string][in] */ __RPC__in_string LPCWSTR value) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Save( + /* [in] */ BOOL trackChanges) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetLastPlayedCategory( + /* [in] */ UINT categoryIndex) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetLastPlayedCategory( + /* [retval][out] */ __RPC__out UINT *pCategoryIndex) = 0; + + }; + +#else /* C style interface */ + + typedef struct IGameStatisticsVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + __RPC__in IGameStatistics * This, + /* [in] */ __RPC__in REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + __RPC__in IGameStatistics * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + __RPC__in IGameStatistics * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxCategoryLength )( + __RPC__in IGameStatistics * This, + /* [retval][out] */ __RPC__out UINT *cch); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxNameLength )( + __RPC__in IGameStatistics * This, + /* [retval][out] */ __RPC__out UINT *cch); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxValueLength )( + __RPC__in IGameStatistics * This, + /* [retval][out] */ __RPC__out UINT *cch); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxCategories )( + __RPC__in IGameStatistics * This, + /* [retval][out] */ __RPC__out WORD *pMax); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetMaxStatsPerCategory )( + __RPC__in IGameStatistics * This, + /* [retval][out] */ __RPC__out WORD *pMax); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetCategoryTitle )( + __RPC__in IGameStatistics * This, + /* [in] */ WORD categoryIndex, + /* [string][in] */ __RPC__in_string LPCWSTR title); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCategoryTitle )( + __RPC__in IGameStatistics * This, + /* [in] */ WORD categoryIndex, + /* [retval][string][out] */ __RPC__deref_out_opt_string LPWSTR *pTitle); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStatistic )( + __RPC__in IGameStatistics * This, + /* [in] */ WORD categoryIndex, + /* [in] */ WORD statIndex, + /* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pName, + /* [string][unique][out][in] */ __RPC__deref_opt_inout_opt_string LPWSTR *pValue); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetStatistic )( + __RPC__in IGameStatistics * This, + /* [in] */ WORD categoryIndex, + /* [in] */ WORD statIndex, + /* [string][in] */ __RPC__in_string LPCWSTR name, + /* [string][in] */ __RPC__in_string LPCWSTR value); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Save )( + __RPC__in IGameStatistics * This, + /* [in] */ BOOL trackChanges); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetLastPlayedCategory )( + __RPC__in IGameStatistics * This, + /* [in] */ UINT categoryIndex); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetLastPlayedCategory )( + __RPC__in IGameStatistics * This, + /* [retval][out] */ __RPC__out UINT *pCategoryIndex); + + END_INTERFACE + } IGameStatisticsVtbl; + + interface IGameStatistics + { + CONST_VTBL struct IGameStatisticsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IGameStatistics_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IGameStatistics_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IGameStatistics_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IGameStatistics_GetMaxCategoryLength(This,cch) \ + ( (This)->lpVtbl -> GetMaxCategoryLength(This,cch) ) + +#define IGameStatistics_GetMaxNameLength(This,cch) \ + ( (This)->lpVtbl -> GetMaxNameLength(This,cch) ) + +#define IGameStatistics_GetMaxValueLength(This,cch) \ + ( (This)->lpVtbl -> GetMaxValueLength(This,cch) ) + +#define IGameStatistics_GetMaxCategories(This,pMax) \ + ( (This)->lpVtbl -> GetMaxCategories(This,pMax) ) + +#define IGameStatistics_GetMaxStatsPerCategory(This,pMax) \ + ( (This)->lpVtbl -> GetMaxStatsPerCategory(This,pMax) ) + +#define IGameStatistics_SetCategoryTitle(This,categoryIndex,title) \ + ( (This)->lpVtbl -> SetCategoryTitle(This,categoryIndex,title) ) + +#define IGameStatistics_GetCategoryTitle(This,categoryIndex,pTitle) \ + ( (This)->lpVtbl -> GetCategoryTitle(This,categoryIndex,pTitle) ) + +#define IGameStatistics_GetStatistic(This,categoryIndex,statIndex,pName,pValue) \ + ( (This)->lpVtbl -> GetStatistic(This,categoryIndex,statIndex,pName,pValue) ) + +#define IGameStatistics_SetStatistic(This,categoryIndex,statIndex,name,value) \ + ( (This)->lpVtbl -> SetStatistic(This,categoryIndex,statIndex,name,value) ) + +#define IGameStatistics_Save(This,trackChanges) \ + ( (This)->lpVtbl -> Save(This,trackChanges) ) + +#define IGameStatistics_SetLastPlayedCategory(This,categoryIndex) \ + ( (This)->lpVtbl -> SetLastPlayedCategory(This,categoryIndex) ) + +#define IGameStatistics_GetLastPlayedCategory(This,pCategoryIndex) \ + ( (This)->lpVtbl -> GetLastPlayedCategory(This,pCategoryIndex) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IGameStatistics_INTERFACE_DEFINED__ */ + + +#ifndef __IGameStatisticsMgr_INTERFACE_DEFINED__ +#define __IGameStatisticsMgr_INTERFACE_DEFINED__ + +/* interface IGameStatisticsMgr */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IGameStatisticsMgr; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("AFF3EA11-E70E-407d-95DD-35E612C41CE2") + IGameStatisticsMgr : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetGameStatistics( + /* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath, + /* [in] */ GAMESTATS_OPEN_TYPE openType, + /* [out] */ __RPC__out GAMESTATS_OPEN_RESULT *pOpenResult, + /* [retval][out] */ __RPC__deref_out_opt IGameStatistics **ppiStats) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RemoveGameStatistics( + /* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath) = 0; + + }; + +#else /* C style interface */ + + typedef struct IGameStatisticsMgrVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + __RPC__in IGameStatisticsMgr * This, + /* [in] */ __RPC__in REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + __RPC__in IGameStatisticsMgr * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + __RPC__in IGameStatisticsMgr * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetGameStatistics )( + __RPC__in IGameStatisticsMgr * This, + /* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath, + /* [in] */ GAMESTATS_OPEN_TYPE openType, + /* [out] */ __RPC__out GAMESTATS_OPEN_RESULT *pOpenResult, + /* [retval][out] */ __RPC__deref_out_opt IGameStatistics **ppiStats); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RemoveGameStatistics )( + __RPC__in IGameStatisticsMgr * This, + /* [string][in] */ __RPC__in_string LPCWSTR GDFBinaryPath); + + END_INTERFACE + } IGameStatisticsMgrVtbl; + + interface IGameStatisticsMgr + { + CONST_VTBL struct IGameStatisticsMgrVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IGameStatisticsMgr_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IGameStatisticsMgr_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IGameStatisticsMgr_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IGameStatisticsMgr_GetGameStatistics(This,GDFBinaryPath,openType,pOpenResult,ppiStats) \ + ( (This)->lpVtbl -> GetGameStatistics(This,GDFBinaryPath,openType,pOpenResult,ppiStats) ) + +#define IGameStatisticsMgr_RemoveGameStatistics(This,GDFBinaryPath) \ + ( (This)->lpVtbl -> RemoveGameStatistics(This,GDFBinaryPath) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IGameStatisticsMgr_INTERFACE_DEFINED__ */ + + +#ifndef __IGameExplorer2_INTERFACE_DEFINED__ +#define __IGameExplorer2_INTERFACE_DEFINED__ + +/* interface IGameExplorer2 */ +/* [unique][helpstring][uuid][object] */ + + +EXTERN_C const IID IID_IGameExplorer2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("86874AA7-A1ED-450d-A7EB-B89E20B2FFF3") + IGameExplorer2 : public IUnknown + { + public: + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE InstallGame( + /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath, + /* [unique][in] */ __RPC__in_opt LPCWSTR installDirectory, + /* [in] */ GAME_INSTALL_SCOPE installScope) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE UninstallGame( + /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath) = 0; + + virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CheckAccess( + /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath, + /* [retval][out] */ __RPC__out BOOL *pHasAccess) = 0; + + }; + +#else /* C style interface */ + + typedef struct IGameExplorer2Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + __RPC__in IGameExplorer2 * This, + /* [in] */ __RPC__in REFIID riid, + /* [annotation][iid_is][out] */ + __RPC__deref_out void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + __RPC__in IGameExplorer2 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + __RPC__in IGameExplorer2 * This); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *InstallGame )( + __RPC__in IGameExplorer2 * This, + /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath, + /* [unique][in] */ __RPC__in_opt LPCWSTR installDirectory, + /* [in] */ GAME_INSTALL_SCOPE installScope); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *UninstallGame )( + __RPC__in IGameExplorer2 * This, + /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath); + + /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CheckAccess )( + __RPC__in IGameExplorer2 * This, + /* [string][in] */ __RPC__in_string LPCWSTR binaryGDFPath, + /* [retval][out] */ __RPC__out BOOL *pHasAccess); + + END_INTERFACE + } IGameExplorer2Vtbl; + + interface IGameExplorer2 + { + CONST_VTBL struct IGameExplorer2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IGameExplorer2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define IGameExplorer2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define IGameExplorer2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define IGameExplorer2_InstallGame(This,binaryGDFPath,installDirectory,installScope) \ + ( (This)->lpVtbl -> InstallGame(This,binaryGDFPath,installDirectory,installScope) ) + +#define IGameExplorer2_UninstallGame(This,binaryGDFPath) \ + ( (This)->lpVtbl -> UninstallGame(This,binaryGDFPath) ) + +#define IGameExplorer2_CheckAccess(This,binaryGDFPath,pHasAccess) \ + ( (This)->lpVtbl -> CheckAccess(This,binaryGDFPath,pHasAccess) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IGameExplorer2_INTERFACE_DEFINED__ */ + + + +#ifndef __gameuxLib_LIBRARY_DEFINED__ +#define __gameuxLib_LIBRARY_DEFINED__ + +/* library gameuxLib */ +/* [helpstring][version][uuid] */ + + +EXTERN_C const IID LIBID_gameuxLib; + +EXTERN_C const CLSID CLSID_GameExplorer; + +#ifdef __cplusplus + +class DECLSPEC_UUID("9A5EA990-3034-4D6F-9128-01F3C61022BC") +GameExplorer; +#endif + +EXTERN_C const CLSID CLSID_GameStatistics; + +#ifdef __cplusplus + +class DECLSPEC_UUID("DBC85A2C-C0DC-4961-B6E2-D28B62C11AD4") +GameStatistics; +#endif +#endif /* __gameuxLib_LIBRARY_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); +unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); +unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); +void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * ); + +unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); +unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); +unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); +void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * ); + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + + diff --git a/Src/Decoder_H264_ALL/D3D/include/multimon.h b/Src/Decoder_H264_ALL/D3D/include/multimon.h new file mode 100644 index 0000000..9f23883 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/multimon.h @@ -0,0 +1,501 @@ +//============================================================================= +// +// multimon.h -- Stub module that fakes multiple monitor apis on Win32 OSes +// without them. +// +// By using this header your code will get back default values from +// GetSystemMetrics() for new metrics, and the new multimonitor APIs +// will act like only one display is present on a Win32 OS without +// multimonitor APIs. +// +// Exactly one source must include this with COMPILE_MULTIMON_STUBS defined. +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +//============================================================================= + +#ifdef __cplusplus +extern "C" { // Assume C declarations for C++ +#endif // __cplusplus + +// +// If we are building with Win95/NT4 headers, we need to declare +// the multimonitor-related metrics and APIs ourselves. +// +#ifndef SM_CMONITORS + +#define SM_XVIRTUALSCREEN 76 +#define SM_YVIRTUALSCREEN 77 +#define SM_CXVIRTUALSCREEN 78 +#define SM_CYVIRTUALSCREEN 79 +#define SM_CMONITORS 80 +#define SM_SAMEDISPLAYFORMAT 81 + +// HMONITOR is already declared if WINVER >= 0x0500 in windef.h +// This is for components built with an older version number. +// +#if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500) +DECLARE_HANDLE(HMONITOR); +#define HMONITOR_DECLARED +#endif + +#define MONITOR_DEFAULTTONULL 0x00000000 +#define MONITOR_DEFAULTTOPRIMARY 0x00000001 +#define MONITOR_DEFAULTTONEAREST 0x00000002 + +#define MONITORINFOF_PRIMARY 0x00000001 + +typedef struct tagMONITORINFO +{ + DWORD cbSize; + RECT rcMonitor; + RECT rcWork; + DWORD dwFlags; +} MONITORINFO, *LPMONITORINFO; + +#ifndef CCHDEVICENAME +#define CCHDEVICENAME 32 +#endif + +#ifdef __cplusplus +typedef struct tagMONITORINFOEXA : public tagMONITORINFO +{ + CHAR szDevice[CCHDEVICENAME]; +} MONITORINFOEXA, *LPMONITORINFOEXA; +typedef struct tagMONITORINFOEXW : public tagMONITORINFO +{ + WCHAR szDevice[CCHDEVICENAME]; +} MONITORINFOEXW, *LPMONITORINFOEXW; +#ifdef UNICODE +typedef MONITORINFOEXW MONITORINFOEX; +typedef LPMONITORINFOEXW LPMONITORINFOEX; +#else +typedef MONITORINFOEXA MONITORINFOEX; +typedef LPMONITORINFOEXA LPMONITORINFOEX; +#endif // UNICODE +#else // ndef __cplusplus +typedef struct tagMONITORINFOEXA +{ + MONITORINFO; + CHAR szDevice[CCHDEVICENAME]; +} MONITORINFOEXA, *LPMONITORINFOEXA; +typedef struct tagMONITORINFOEXW +{ + MONITORINFO; + WCHAR szDevice[CCHDEVICENAME]; +} MONITORINFOEXW, *LPMONITORINFOEXW; +#ifdef UNICODE +typedef MONITORINFOEXW MONITORINFOEX; +typedef LPMONITORINFOEXW LPMONITORINFOEX; +#else +typedef MONITORINFOEXA MONITORINFOEX; +typedef LPMONITORINFOEXA LPMONITORINFOEX; +#endif // UNICODE +#endif + +typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM); + +#ifndef DISPLAY_DEVICE_ATTACHED_TO_DESKTOP +typedef struct _DISPLAY_DEVICEA { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD StateFlags; + CHAR DeviceID[128]; + CHAR DeviceKey[128]; +} DISPLAY_DEVICEA, *PDISPLAY_DEVICEA, *LPDISPLAY_DEVICEA; +typedef struct _DISPLAY_DEVICEW { + DWORD cb; + WCHAR DeviceName[32]; + WCHAR DeviceString[128]; + DWORD StateFlags; + WCHAR DeviceID[128]; + WCHAR DeviceKey[128]; +} DISPLAY_DEVICEW, *PDISPLAY_DEVICEW, *LPDISPLAY_DEVICEW; +#ifdef UNICODE +typedef DISPLAY_DEVICEW DISPLAY_DEVICE; +typedef PDISPLAY_DEVICEW PDISPLAY_DEVICE; +typedef LPDISPLAY_DEVICEW LPDISPLAY_DEVICE; +#else +typedef DISPLAY_DEVICEA DISPLAY_DEVICE; +typedef PDISPLAY_DEVICEA PDISPLAY_DEVICE; +typedef LPDISPLAY_DEVICEA LPDISPLAY_DEVICE; +#endif // UNICODE + +#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP 0x00000001 +#define DISPLAY_DEVICE_MULTI_DRIVER 0x00000002 +#define DISPLAY_DEVICE_PRIMARY_DEVICE 0x00000004 +#define DISPLAY_DEVICE_MIRRORING_DRIVER 0x00000008 +#define DISPLAY_DEVICE_VGA_COMPATIBLE 0x00000010 +#endif + +#endif // SM_CMONITORS + +#undef GetMonitorInfo +#undef GetSystemMetrics +#undef MonitorFromWindow +#undef MonitorFromRect +#undef MonitorFromPoint +#undef EnumDisplayMonitors +#undef EnumDisplayDevices + +// +// Define COMPILE_MULTIMON_STUBS to compile the stubs; +// otherwise, you get the declarations. +// +#ifdef COMPILE_MULTIMON_STUBS + +//----------------------------------------------------------------------------- +// +// Implement the API stubs. +// +//----------------------------------------------------------------------------- + +#ifndef _MULTIMON_USE_SECURE_CRT +#if defined(__GOT_SECURE_LIB__) && __GOT_SECURE_LIB__ >= 200402L +#define _MULTIMON_USE_SECURE_CRT 1 +#else +#define _MULTIMON_USE_SECURE_CRT 0 +#endif +#endif + +#ifndef MULTIMON_FNS_DEFINED + +int (WINAPI* g_pfnGetSystemMetrics)(int) = NULL; +HMONITOR (WINAPI* g_pfnMonitorFromWindow)(HWND, DWORD) = NULL; +HMONITOR (WINAPI* g_pfnMonitorFromRect)(LPCRECT, DWORD) = NULL; +HMONITOR (WINAPI* g_pfnMonitorFromPoint)(POINT, DWORD) = NULL; +BOOL (WINAPI* g_pfnGetMonitorInfo)(HMONITOR, LPMONITORINFO) = NULL; +BOOL (WINAPI* g_pfnEnumDisplayMonitors)(HDC, LPCRECT, MONITORENUMPROC, LPARAM) = NULL; +BOOL (WINAPI* g_pfnEnumDisplayDevices)(PVOID, DWORD, PDISPLAY_DEVICE,DWORD) = NULL; +BOOL g_fMultiMonInitDone = FALSE; +BOOL g_fMultimonPlatformNT = FALSE; + +#endif + +BOOL IsPlatformNT() +{ + OSVERSIONINFOA osvi = {0}; + osvi.dwOSVersionInfoSize = sizeof(osvi); + GetVersionExA((OSVERSIONINFOA*)&osvi); + return (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId); +} + +BOOL InitMultipleMonitorStubs(void) +{ + HMODULE hUser32; + if (g_fMultiMonInitDone) + { + return g_pfnGetMonitorInfo != NULL; + } + + g_fMultimonPlatformNT = IsPlatformNT(); + hUser32 = GetModuleHandle(TEXT("USER32")); + if (hUser32 && + (*(FARPROC*)&g_pfnGetSystemMetrics = GetProcAddress(hUser32,"GetSystemMetrics")) != NULL && + (*(FARPROC*)&g_pfnMonitorFromWindow = GetProcAddress(hUser32,"MonitorFromWindow")) != NULL && + (*(FARPROC*)&g_pfnMonitorFromRect = GetProcAddress(hUser32,"MonitorFromRect")) != NULL && + (*(FARPROC*)&g_pfnMonitorFromPoint = GetProcAddress(hUser32,"MonitorFromPoint")) != NULL && + (*(FARPROC*)&g_pfnEnumDisplayMonitors = GetProcAddress(hUser32,"EnumDisplayMonitors")) != NULL && +#ifdef UNICODE + (*(FARPROC*)&g_pfnEnumDisplayDevices = GetProcAddress(hUser32,"EnumDisplayDevicesW")) != NULL && + (*(FARPROC*)&g_pfnGetMonitorInfo = g_fMultimonPlatformNT ? GetProcAddress(hUser32,"GetMonitorInfoW") : + GetProcAddress(hUser32,"GetMonitorInfoA")) != NULL +#else + (*(FARPROC*)&g_pfnGetMonitorInfo = GetProcAddress(hUser32,"GetMonitorInfoA")) != NULL && + (*(FARPROC*)&g_pfnEnumDisplayDevices = GetProcAddress(hUser32,"EnumDisplayDevicesA")) != NULL +#endif + ) { + g_fMultiMonInitDone = TRUE; + return TRUE; + } + else + { + g_pfnGetSystemMetrics = NULL; + g_pfnMonitorFromWindow = NULL; + g_pfnMonitorFromRect = NULL; + g_pfnMonitorFromPoint = NULL; + g_pfnGetMonitorInfo = NULL; + g_pfnEnumDisplayMonitors = NULL; + g_pfnEnumDisplayDevices = NULL; + + g_fMultiMonInitDone = TRUE; + return FALSE; + } +} + +//----------------------------------------------------------------------------- +// +// fake implementations of Monitor APIs that work with the primary display +// no special parameter validation is made since these run in client code +// +//----------------------------------------------------------------------------- + +int WINAPI +xGetSystemMetrics(int nIndex) +{ + if (InitMultipleMonitorStubs()) + return g_pfnGetSystemMetrics(nIndex); + + switch (nIndex) + { + case SM_CMONITORS: + case SM_SAMEDISPLAYFORMAT: + return 1; + + case SM_XVIRTUALSCREEN: + case SM_YVIRTUALSCREEN: + return 0; + + case SM_CXVIRTUALSCREEN: + nIndex = SM_CXSCREEN; + break; + + case SM_CYVIRTUALSCREEN: + nIndex = SM_CYSCREEN; + break; + } + + return GetSystemMetrics(nIndex); +} + +#define xPRIMARY_MONITOR ((HMONITOR)0x12340042) + +HMONITOR WINAPI +xMonitorFromPoint(POINT ptScreenCoords, DWORD dwFlags) +{ + if (InitMultipleMonitorStubs()) + return g_pfnMonitorFromPoint(ptScreenCoords, dwFlags); + + if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) || + ((ptScreenCoords.x >= 0) && + (ptScreenCoords.x < GetSystemMetrics(SM_CXSCREEN)) && + (ptScreenCoords.y >= 0) && + (ptScreenCoords.y < GetSystemMetrics(SM_CYSCREEN)))) + { + return xPRIMARY_MONITOR; + } + + return NULL; +} + +HMONITOR WINAPI +xMonitorFromRect(LPCRECT lprcScreenCoords, DWORD dwFlags) +{ + if (InitMultipleMonitorStubs()) + return g_pfnMonitorFromRect(lprcScreenCoords, dwFlags); + + if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) || + ((lprcScreenCoords->right > 0) && + (lprcScreenCoords->bottom > 0) && + (lprcScreenCoords->left < GetSystemMetrics(SM_CXSCREEN)) && + (lprcScreenCoords->top < GetSystemMetrics(SM_CYSCREEN)))) + { + return xPRIMARY_MONITOR; + } + + return NULL; +} + +HMONITOR WINAPI +xMonitorFromWindow(HWND hWnd, DWORD dwFlags) +{ + WINDOWPLACEMENT wp; + + if (InitMultipleMonitorStubs()) + return g_pfnMonitorFromWindow(hWnd, dwFlags); + + if (dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) + return xPRIMARY_MONITOR; + + if (IsIconic(hWnd) ? + GetWindowPlacement(hWnd, &wp) : + GetWindowRect(hWnd, &wp.rcNormalPosition)) { + + return xMonitorFromRect(&wp.rcNormalPosition, dwFlags); + } + + return NULL; +} + +BOOL WINAPI +xGetMonitorInfo(HMONITOR hMonitor, __inout LPMONITORINFO lpMonitorInfo) +{ + RECT rcWork; + + if (InitMultipleMonitorStubs()) + { + BOOL f = g_pfnGetMonitorInfo(hMonitor, lpMonitorInfo); +#ifdef UNICODE + if (f && !g_fMultimonPlatformNT && (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEX))) + { + MultiByteToWideChar(CP_ACP, 0, + (LPSTR)((MONITORINFOEX*)lpMonitorInfo)->szDevice, -1, + ((MONITORINFOEX*)lpMonitorInfo)->szDevice, (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR))); + } +#endif + return f; + } + + if ((hMonitor == xPRIMARY_MONITOR) && + lpMonitorInfo && + (lpMonitorInfo->cbSize >= sizeof(MONITORINFO)) && + SystemParametersInfoA(SPI_GETWORKAREA, 0, &rcWork, 0)) + { + lpMonitorInfo->rcMonitor.left = 0; + lpMonitorInfo->rcMonitor.top = 0; + lpMonitorInfo->rcMonitor.right = GetSystemMetrics(SM_CXSCREEN); + lpMonitorInfo->rcMonitor.bottom = GetSystemMetrics(SM_CYSCREEN); + lpMonitorInfo->rcWork = rcWork; + lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY; + + if (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEX)) + { +#ifdef UNICODE + MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, ((MONITORINFOEX*)lpMonitorInfo)->szDevice, (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR))); +#else // UNICODE +#if _MULTIMON_USE_SECURE_CRT + strncpy_s(((MONITORINFOEX*)lpMonitorInfo)->szDevice, (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR)), TEXT("DISPLAY"), (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR)) - 1); +#else + lstrcpyn(((MONITORINFOEX*)lpMonitorInfo)->szDevice, TEXT("DISPLAY"), (sizeof(((MONITORINFOEX*)lpMonitorInfo)->szDevice)/sizeof(TCHAR))); +#endif // _MULTIMON_USE_SECURE_CRT +#endif // UNICODE + } + + return TRUE; + } + + return FALSE; +} + +BOOL WINAPI +xEnumDisplayMonitors( + HDC hdcOptionalForPainting, + LPCRECT lprcEnumMonitorsThatIntersect, + MONITORENUMPROC lpfnEnumProc, + LPARAM dwData) +{ + RECT rcLimit; + + if (InitMultipleMonitorStubs()) { + return g_pfnEnumDisplayMonitors( + hdcOptionalForPainting, + lprcEnumMonitorsThatIntersect, + lpfnEnumProc, + dwData); + } + + if (!lpfnEnumProc) + return FALSE; + + rcLimit.left = 0; + rcLimit.top = 0; + rcLimit.right = GetSystemMetrics(SM_CXSCREEN); + rcLimit.bottom = GetSystemMetrics(SM_CYSCREEN); + + if (hdcOptionalForPainting) + { + RECT rcClip; + POINT ptOrg; + + switch (GetClipBox(hdcOptionalForPainting, &rcClip)) + { + default: + if (!GetDCOrgEx(hdcOptionalForPainting, &ptOrg)) + return FALSE; + + OffsetRect(&rcLimit, -ptOrg.x, -ptOrg.y); + if (IntersectRect(&rcLimit, &rcLimit, &rcClip) && + (!lprcEnumMonitorsThatIntersect || + IntersectRect(&rcLimit, &rcLimit, lprcEnumMonitorsThatIntersect))) { + + break; + } + //fall thru + case NULLREGION: + return TRUE; + case ERROR: + return FALSE; + } + } else { + if ( lprcEnumMonitorsThatIntersect && + !IntersectRect(&rcLimit, &rcLimit, lprcEnumMonitorsThatIntersect)) { + + return TRUE; + } + } + + return lpfnEnumProc( + xPRIMARY_MONITOR, + hdcOptionalForPainting, + &rcLimit, + dwData); +} + +BOOL WINAPI +xEnumDisplayDevices( + PVOID Unused, + DWORD iDevNum, + __inout PDISPLAY_DEVICE lpDisplayDevice, + DWORD dwFlags) +{ + if (InitMultipleMonitorStubs()) + return g_pfnEnumDisplayDevices(Unused, iDevNum, lpDisplayDevice, dwFlags); + + if (Unused != NULL) + return FALSE; + + if (iDevNum != 0) + return FALSE; + + if (lpDisplayDevice == NULL || lpDisplayDevice->cb < sizeof(DISPLAY_DEVICE)) + return FALSE; + +#ifdef UNICODE + MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, lpDisplayDevice->DeviceName, (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR))); + MultiByteToWideChar(CP_ACP, 0, "DISPLAY", -1, lpDisplayDevice->DeviceString, (sizeof(lpDisplayDevice->DeviceString)/sizeof(TCHAR))); +#else // UNICODE +#if _MULTIMON_USE_SECURE_CRT + strncpy_s((LPTSTR)lpDisplayDevice->DeviceName, (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)), TEXT("DISPLAY"), (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)) - 1); + strncpy_s((LPTSTR)lpDisplayDevice->DeviceString, (sizeof(lpDisplayDevice->DeviceString)/sizeof(TCHAR)), TEXT("DISPLAY"), (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR)) - 1); +#else + lstrcpyn((LPTSTR)lpDisplayDevice->DeviceName, TEXT("DISPLAY"), (sizeof(lpDisplayDevice->DeviceName)/sizeof(TCHAR))); + lstrcpyn((LPTSTR)lpDisplayDevice->DeviceString, TEXT("DISPLAY"), (sizeof(lpDisplayDevice->DeviceString)/sizeof(TCHAR))); +#endif // _MULTIMON_USE_SECURE_CRT +#endif // UNICODE + + lpDisplayDevice->StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_PRIMARY_DEVICE; + + return TRUE; +} + +#undef xPRIMARY_MONITOR +#undef COMPILE_MULTIMON_STUBS + +#else // COMPILE_MULTIMON_STUBS + +extern int WINAPI xGetSystemMetrics(int); +extern HMONITOR WINAPI xMonitorFromWindow(HWND, DWORD); +extern HMONITOR WINAPI xMonitorFromRect(LPCRECT, DWORD); +extern HMONITOR WINAPI xMonitorFromPoint(POINT, DWORD); +extern BOOL WINAPI xGetMonitorInfo(HMONITOR, LPMONITORINFO); +extern BOOL WINAPI xEnumDisplayMonitors(HDC, LPCRECT, MONITORENUMPROC, LPARAM); +extern BOOL WINAPI xEnumDisplayDevices(PVOID, DWORD, PDISPLAY_DEVICE, DWORD); + +#endif // COMPILE_MULTIMON_STUBS + +// +// build defines that replace the regular APIs with our versions +// +#define GetSystemMetrics xGetSystemMetrics +#define MonitorFromWindow xMonitorFromWindow +#define MonitorFromRect xMonitorFromRect +#define MonitorFromPoint xMonitorFromPoint +#define GetMonitorInfo xGetMonitorInfo +#define EnumDisplayMonitors xEnumDisplayMonitors +#define EnumDisplayDevices xEnumDisplayDevices + +#ifdef __cplusplus +} +#endif // __cplusplus + diff --git a/Src/Decoder_H264_ALL/D3D/include/rmxfguid.h b/Src/Decoder_H264_ALL/D3D/include/rmxfguid.h new file mode 100644 index 0000000..d3326cc --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/rmxfguid.h @@ -0,0 +1,223 @@ +/*************************************************************************** + * + * Copyright (C) 1998-1999 Microsoft Corporation. All Rights Reserved. + * + * File: rmxfguid.h + * + * Content: Defines GUIDs of D3DRM's templates. + * + ***************************************************************************/ + +#ifndef __RMXFGUID_H_ +#define __RMXFGUID_H_ + +/* {2B957100-9E9A-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMInfo, +0x2b957100, 0x9e9a, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {3D82AB44-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMMesh, +0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {3D82AB5E-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMVector, +0x3d82ab5e, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {3D82AB5F-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMMeshFace, +0x3d82ab5f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {3D82AB4D-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMMaterial, +0x3d82ab4d, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {35FF44E1-6C7C-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMaterialArray, +0x35ff44e1, 0x6c7c, 0x11cf, 0x8F, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {3D82AB46-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMFrame, +0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {F6F23F41-7686-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMFrameTransformMatrix, +0xf6f23f41, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {F6F23F42-7686-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMeshMaterialList, +0xf6f23f42, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {F6F23F40-7686-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMeshTextureCoords, +0xf6f23f40, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {F6F23F43-7686-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMeshNormals, +0xf6f23f43, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {F6F23F44-7686-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMCoords2d, +0xf6f23f44, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {F6F23F45-7686-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMatrix4x4, +0xf6f23f45, 0x7686, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {3D82AB4F-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMAnimation, +0x3d82ab4f, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {3D82AB50-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMAnimationSet, +0x3d82ab50, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {10DD46A8-775B-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMAnimationKey, +0x10dd46a8, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); + +/* {10DD46A9-775B-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMFloatKeys, +0x10dd46a9, 0x775b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); + +/* {01411840-7786-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMaterialAmbientColor, +0x01411840, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); + +/* {01411841-7786-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMaterialDiffuseColor, +0x01411841, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); + +/* {01411842-7786-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMaterialSpecularColor, +0x01411842, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); + +/* {D3E16E80-7835-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMaterialEmissiveColor, +0xd3e16e80, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {01411843-7786-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMaterialPower, +0x01411843, 0x7786, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); + +/* {35FF44E0-6C7C-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMColorRGBA, +0x35ff44e0, 0x6c7c, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xA3); + +/* {D3E16E81-7835-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMColorRGB, +0xd3e16e81, 0x7835, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {A42790E0-7810-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMGuid, +0xa42790e0, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {A42790E1-7810-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMTextureFilename, +0xa42790e1, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {A42790E2-7810-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMTextureReference, +0xa42790e2, 0x7810, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {1630B820-7842-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMIndexedColor, +0x1630b820, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {1630B821-7842-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMeshVertexColors, +0x1630b821, 0x7842, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {4885AE60-78E8-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMMaterialWrap, +0x4885ae60, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {537DA6A0-CA37-11d0-941C-0080C80CFA7B} */ +DEFINE_GUID(TID_D3DRMBoolean, +0x537da6a0, 0xca37, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b); + +/* {ED1EC5C0-C0A8-11d0-941C-0080C80CFA7B} */ +DEFINE_GUID(TID_D3DRMMeshFaceWraps, +0xed1ec5c0, 0xc0a8, 0x11d0, 0x94, 0x1c, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b); + +/* {4885AE63-78E8-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMBoolean2d, +0x4885ae63, 0x78e8, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {F406B180-7B3B-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMTimedFloatKeys, +0xf406b180, 0x7b3b, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {E2BF56C0-840F-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMAnimationOptions, +0xe2bf56c0, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {E2BF56C1-840F-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMFramePosition, +0xe2bf56c1, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {E2BF56C2-840F-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMFrameVelocity, +0xe2bf56c2, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {E2BF56C3-840F-11cf-8F52-0040333594A3} */ +DEFINE_GUID(TID_D3DRMFrameRotation, +0xe2bf56c3, 0x840f, 0x11cf, 0x8f, 0x52, 0x0, 0x40, 0x33, 0x35, 0x94, 0xa3); + +/* {3D82AB4A-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMLight, +0x3d82ab4a, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {3D82AB51-62DA-11cf-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMCamera, +0x3d82ab51, 0x62da, 0x11cf, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {E5745280-B24F-11cf-9DD5-00AA00A71A2F} */ +DEFINE_GUID(TID_D3DRMAppData, +0xe5745280, 0xb24f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f); + +/* {AED22740-B31F-11cf-9DD5-00AA00A71A2F} */ +DEFINE_GUID(TID_D3DRMLightUmbra, +0xaed22740, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f); + +/* {AED22742-B31F-11cf-9DD5-00AA00A71A2F} */ +DEFINE_GUID(TID_D3DRMLightRange, +0xaed22742, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f); + +/* {AED22741-B31F-11cf-9DD5-00AA00A71A2F} */ +DEFINE_GUID(TID_D3DRMLightPenumbra, +0xaed22741, 0xb31f, 0x11cf, 0x9d, 0xd5, 0x0, 0xaa, 0x0, 0xa7, 0x1a, 0x2f); + +/* {A8A98BA0-C5E5-11cf-B941-0080C80CFA7B} */ +DEFINE_GUID(TID_D3DRMLightAttenuation, +0xa8a98ba0, 0xc5e5, 0x11cf, 0xb9, 0x41, 0x0, 0x80, 0xc8, 0xc, 0xfa, 0x7b); + +/* {3A23EEA0-94B1-11d0-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMInlineData, +0x3a23eea0, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {3A23EEA1-94B1-11d0-AB39-0020AF71E433} */ +DEFINE_GUID(TID_D3DRMUrl, +0x3a23eea1, 0x94b1, 0x11d0, 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33); + +/* {8A63C360-997D-11d0-941C-0080C80CFA7B} */ +DEFINE_GUID(TID_D3DRMProgressiveMesh, +0x8A63C360, 0x997D, 0x11d0, 0x94, 0x1C, 0x0, 0x80, 0xC8, 0x0C, 0xFA, 0x7B); + +/* {98116AA0-BDBA-11d1-82C0-00A0C9697271} */ +DEFINE_GUID(TID_D3DRMExternalVisual, +0x98116AA0, 0xBDBA, 0x11d1, 0x82, 0xC0, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x71); + +/* {7F0F21E0-BFE1-11d1-82C0-00A0C9697271} */ +DEFINE_GUID(TID_D3DRMStringProperty, +0x7f0f21e0, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71); + +/* {7F0F21E1-BFE1-11d1-82C0-00A0C9697271} */ +DEFINE_GUID(TID_D3DRMPropertyBag, +0x7f0f21e1, 0xbfe1, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71); + +// {7F5D5EA0-D53A-11d1-82C0-00A0C9697271} +DEFINE_GUID(TID_D3DRMRightHanded, +0x7f5d5ea0, 0xd53a, 0x11d1, 0x82, 0xc0, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x71); + +#endif /* __RMXFGUID_H_ */ + diff --git a/Src/Decoder_H264_ALL/D3D/include/rmxftmpl.h b/Src/Decoder_H264_ALL/D3D/include/rmxftmpl.h new file mode 100644 index 0000000..e0018d0 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/rmxftmpl.h @@ -0,0 +1,339 @@ +/* D3DRM XFile templates in binary form */ + +#ifndef _RMXFTMPL_H_ +#define _RMXFTMPL_H_ + +unsigned char D3DRM_XTEMPLATES[] = { + 0x78, 0x6f, 0x66, 0x20, 0x30, 0x33, 0x30, 0x32, 0x62, + 0x69, 0x6e, 0x20, 0x30, 0x30, 0x36, 0x34, 0x1f, 0, 0x1, + 0, 0x6, 0, 0, 0, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0xa, 0, 0x5, 0, 0x43, 0xab, 0x82, 0x3d, 0xda, + 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, + 0x33, 0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x6d, + 0x61, 0x6a, 0x6f, 0x72, 0x14, 0, 0x28, 0, 0x1, 0, + 0x5, 0, 0, 0, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x14, + 0, 0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x66, + 0x6c, 0x61, 0x67, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0, + 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0xa, 0, 0x5, 0, 0x5e, 0xab, 0x82, 0x3d, + 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, + 0xe4, 0x33, 0x2a, 0, 0x1, 0, 0x1, 0, 0, 0, + 0x78, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0, 0, + 0, 0x79, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0, + 0, 0, 0x7a, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, + 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64, + 0x73, 0x32, 0x64, 0xa, 0, 0x5, 0, 0x44, 0x3f, 0xf2, + 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, + 0x35, 0x94, 0xa3, 0x2a, 0, 0x1, 0, 0x1, 0, 0, + 0, 0x75, 0x14, 0, 0x2a, 0, 0x1, 0, 0x1, 0, + 0, 0, 0x76, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, + 0, 0x9, 0, 0, 0, 0x4d, 0x61, 0x74, 0x72, 0x69, + 0x78, 0x34, 0x78, 0x34, 0xa, 0, 0x5, 0, 0x45, 0x3f, + 0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, + 0x33, 0x35, 0x94, 0xa3, 0x34, 0, 0x2a, 0, 0x1, 0, + 0x6, 0, 0, 0, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, + 0xe, 0, 0x3, 0, 0x10, 0, 0, 0, 0xf, 0, + 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x9, 0, + 0, 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, + 0x41, 0xa, 0, 0x5, 0, 0xe0, 0x44, 0xff, 0x35, 0x7c, + 0x6c, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, + 0xa3, 0x2a, 0, 0x1, 0, 0x3, 0, 0, 0, 0x72, + 0x65, 0x64, 0x14, 0, 0x2a, 0, 0x1, 0, 0x5, 0, + 0, 0, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x14, 0, 0x2a, + 0, 0x1, 0, 0x4, 0, 0, 0, 0x62, 0x6c, 0x75, + 0x65, 0x14, 0, 0x2a, 0, 0x1, 0, 0x5, 0, 0, + 0, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x14, 0, 0xb, 0, + 0x1f, 0, 0x1, 0, 0x8, 0, 0, 0, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0xa, 0, 0x5, 0, + 0x81, 0x6e, 0xe1, 0xd3, 0x35, 0x78, 0xcf, 0x11, 0x8f, 0x52, + 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x2a, 0, 0x1, 0, + 0x3, 0, 0, 0, 0x72, 0x65, 0x64, 0x14, 0, 0x2a, + 0, 0x1, 0, 0x5, 0, 0, 0, 0x67, 0x72, 0x65, + 0x65, 0x6e, 0x14, 0, 0x2a, 0, 0x1, 0, 0x4, 0, + 0, 0, 0x62, 0x6c, 0x75, 0x65, 0x14, 0, 0xb, 0, + 0x1f, 0, 0x1, 0, 0xc, 0, 0, 0, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, + 0xa, 0, 0x5, 0, 0x20, 0xb8, 0x30, 0x16, 0x42, 0x78, + 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, + 0x29, 0, 0x1, 0, 0x5, 0, 0, 0, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x14, 0, 0x1, 0, 0x9, 0, 0, + 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41, + 0x1, 0, 0xa, 0, 0, 0, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0xb, 0, + 0x1f, 0, 0x1, 0, 0x7, 0, 0, 0, 0x42, 0x6f, + 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0xa, 0, 0x5, 0, 0xa0, + 0xa6, 0x7d, 0x53, 0x37, 0xca, 0xd0, 0x11, 0x94, 0x1c, 0, + 0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1, 0, 0x9, + 0, 0, 0, 0x74, 0x72, 0x75, 0x65, 0x66, 0x61, 0x6c, + 0x73, 0x65, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, + 0x9, 0, 0, 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, + 0x6e, 0x32, 0x64, 0xa, 0, 0x5, 0, 0x63, 0xae, 0x85, + 0x48, 0xe8, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, + 0x35, 0x94, 0xa3, 0x1, 0, 0x7, 0, 0, 0, 0x42, + 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x1, 0, 0x1, 0, + 0, 0, 0x75, 0x14, 0, 0x1, 0, 0x7, 0, 0, + 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x1, 0, + 0x1, 0, 0, 0, 0x76, 0x14, 0, 0xb, 0, 0x1f, + 0, 0x1, 0, 0xc, 0, 0, 0, 0x4d, 0x61, 0x74, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x57, 0x72, 0x61, 0x70, 0xa, + 0, 0x5, 0, 0x60, 0xae, 0x85, 0x48, 0xe8, 0x78, 0xcf, + 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x1, + 0, 0x7, 0, 0, 0, 0x42, 0x6f, 0x6f, 0x6c, 0x65, + 0x61, 0x6e, 0x1, 0, 0x1, 0, 0, 0, 0x75, 0x14, + 0, 0x1, 0, 0x7, 0, 0, 0, 0x42, 0x6f, 0x6f, + 0x6c, 0x65, 0x61, 0x6e, 0x1, 0, 0x1, 0, 0, 0, + 0x76, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0xf, + 0, 0, 0, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, + 0x46, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0xa, 0, + 0x5, 0, 0xe1, 0x90, 0x27, 0xa4, 0x10, 0x78, 0xcf, 0x11, + 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x31, 0, + 0x1, 0, 0x8, 0, 0, 0, 0x66, 0x69, 0x6c, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x14, 0, 0xb, 0, 0x1f, 0, + 0x1, 0, 0x8, 0, 0, 0, 0x4d, 0x61, 0x74, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0xa, 0, 0x5, 0, 0x4d, 0xab, + 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, + 0xaf, 0x71, 0xe4, 0x33, 0x1, 0, 0x9, 0, 0, 0, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, 0x41, 0x1, + 0, 0x9, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x43, + 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0x2a, 0, 0x1, 0, + 0x5, 0, 0, 0, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x14, + 0, 0x1, 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6c, + 0x6f, 0x72, 0x52, 0x47, 0x42, 0x1, 0, 0xd, 0, 0, + 0, 0x73, 0x70, 0x65, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x43, + 0x6f, 0x6c, 0x6f, 0x72, 0x14, 0, 0x1, 0, 0x8, 0, + 0, 0, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x47, 0x42, + 0x1, 0, 0xd, 0, 0, 0, 0x65, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x14, + 0, 0xe, 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, + 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x8, 0, 0, + 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65, 0xa, + 0, 0x5, 0, 0x5f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, + 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29, + 0, 0x1, 0, 0x12, 0, 0, 0, 0x6e, 0x46, 0x61, + 0x63, 0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, + 0x64, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29, + 0, 0x1, 0, 0x11, 0, 0, 0, 0x66, 0x61, 0x63, + 0x65, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, + 0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1, 0, 0x12, 0, + 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x56, 0x65, 0x72, + 0x74, 0x65, 0x78, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, + 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, + 0xd, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, + 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x73, 0xa, 0, 0x5, + 0, 0xc0, 0xc5, 0x1e, 0xed, 0xa8, 0xc0, 0xd0, 0x11, 0x94, + 0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b, 0x29, 0, 0x1, + 0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, + 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x14, 0, 0x34, 0, 0x1, 0, 0x9, 0, 0, 0, + 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x32, 0x64, 0x1, + 0, 0xe, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, 0x57, + 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0xe, + 0, 0x1, 0, 0xf, 0, 0, 0, 0x6e, 0x46, 0x61, + 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, + 0x1, 0, 0x11, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, + 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f, + 0x72, 0x64, 0x73, 0xa, 0, 0x5, 0, 0x40, 0x3f, 0xf2, + 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, + 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xe, 0, 0, + 0, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, + 0x6f, 0x6f, 0x72, 0x64, 0x73, 0x14, 0, 0x34, 0, 0x1, + 0, 0x8, 0, 0, 0, 0x43, 0x6f, 0x6f, 0x72, 0x64, + 0x73, 0x32, 0x64, 0x1, 0, 0xd, 0, 0, 0, 0x74, + 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x6f, 0x72, + 0x64, 0x73, 0xe, 0, 0x1, 0, 0xe, 0, 0, 0, + 0x6e, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, + 0x6f, 0x72, 0x64, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, + 0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x4d, 0x65, + 0x73, 0x68, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x4c, 0x69, 0x73, 0x74, 0xa, 0, 0x5, 0, 0x42, 0x3f, + 0xf2, 0xf6, 0x86, 0x76, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, + 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa, 0, + 0, 0, 0x6e, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x73, 0x14, 0, 0x29, 0, 0x1, 0, 0xc, 0, + 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x65, 0x73, 0x14, 0, 0x34, 0, 0x29, 0, + 0x1, 0, 0xb, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0xe, 0, 0x1, + 0, 0xc, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0xf, 0, 0x14, + 0, 0xe, 0, 0x1, 0, 0x8, 0, 0, 0, 0x4d, + 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0xf, 0, 0xb, + 0, 0x1f, 0, 0x1, 0, 0xb, 0, 0, 0, 0x4d, + 0x65, 0x73, 0x68, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, + 0xa, 0, 0x5, 0, 0x43, 0x3f, 0xf2, 0xf6, 0x86, 0x76, + 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, + 0x29, 0, 0x1, 0, 0x8, 0, 0, 0, 0x6e, 0x4e, + 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0, 0x34, 0, + 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x1, 0, 0x7, 0, 0, 0, 0x6e, 0x6f, + 0x72, 0x6d, 0x61, 0x6c, 0x73, 0xe, 0, 0x1, 0, 0x8, + 0, 0, 0, 0x6e, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, + 0x73, 0xf, 0, 0x14, 0, 0x29, 0, 0x1, 0, 0xc, + 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, 0x65, 0x4e, 0x6f, + 0x72, 0x6d, 0x61, 0x6c, 0x73, 0x14, 0, 0x34, 0, 0x1, + 0, 0x8, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, + 0x61, 0x63, 0x65, 0x1, 0, 0xb, 0, 0, 0, 0x66, + 0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, + 0xe, 0, 0x1, 0, 0xc, 0, 0, 0, 0x6e, 0x46, + 0x61, 0x63, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x73, + 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, + 0x10, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x56, 0x65, + 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x73, + 0xa, 0, 0x5, 0, 0x21, 0xb8, 0x30, 0x16, 0x42, 0x78, + 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, + 0x29, 0, 0x1, 0, 0xd, 0, 0, 0, 0x6e, 0x56, + 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, + 0x73, 0x14, 0, 0x34, 0, 0x1, 0, 0xc, 0, 0, + 0, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x1, 0, 0xc, 0, 0, 0, 0x76, + 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, + 0x73, 0xe, 0, 0x1, 0, 0xd, 0, 0, 0, 0x6e, + 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, + 0x72, 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, + 0x1, 0, 0x4, 0, 0, 0, 0x4d, 0x65, 0x73, 0x68, + 0xa, 0, 0x5, 0, 0x44, 0xab, 0x82, 0x3d, 0xda, 0x62, + 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, + 0x29, 0, 0x1, 0, 0x9, 0, 0, 0, 0x6e, 0x56, + 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0x14, 0, 0x34, + 0, 0x1, 0, 0x6, 0, 0, 0, 0x56, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x1, 0, 0x8, 0, 0, 0, 0x76, + 0x65, 0x72, 0x74, 0x69, 0x63, 0x65, 0x73, 0xe, 0, 0x1, + 0, 0x9, 0, 0, 0, 0x6e, 0x56, 0x65, 0x72, 0x74, + 0x69, 0x63, 0x65, 0x73, 0xf, 0, 0x14, 0, 0x29, 0, + 0x1, 0, 0x6, 0, 0, 0, 0x6e, 0x46, 0x61, 0x63, + 0x65, 0x73, 0x14, 0, 0x34, 0, 0x1, 0, 0x8, 0, + 0, 0, 0x4d, 0x65, 0x73, 0x68, 0x46, 0x61, 0x63, 0x65, + 0x1, 0, 0x5, 0, 0, 0, 0x66, 0x61, 0x63, 0x65, + 0x73, 0xe, 0, 0x1, 0, 0x6, 0, 0, 0, 0x6e, + 0x46, 0x61, 0x63, 0x65, 0x73, 0xf, 0, 0x14, 0, 0xe, + 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb, + 0, 0x1f, 0, 0x1, 0, 0x14, 0, 0, 0, 0x46, + 0x72, 0x61, 0x6d, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x6f, 0x72, 0x6d, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0xa, + 0, 0x5, 0, 0x41, 0x3f, 0xf2, 0xf6, 0x86, 0x76, 0xcf, + 0x11, 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x1, + 0, 0x9, 0, 0, 0, 0x4d, 0x61, 0x74, 0x72, 0x69, + 0x78, 0x34, 0x78, 0x34, 0x1, 0, 0xb, 0, 0, 0, + 0x66, 0x72, 0x61, 0x6d, 0x65, 0x4d, 0x61, 0x74, 0x72, 0x69, + 0x78, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x5, + 0, 0, 0, 0x46, 0x72, 0x61, 0x6d, 0x65, 0xa, 0, + 0x5, 0, 0x46, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, 0x11, + 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0xe, 0, + 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb, 0, + 0x1f, 0, 0x1, 0, 0x9, 0, 0, 0, 0x46, 0x6c, + 0x6f, 0x61, 0x74, 0x4b, 0x65, 0x79, 0x73, 0xa, 0, 0x5, + 0, 0xa9, 0x46, 0xdd, 0x10, 0x5b, 0x77, 0xcf, 0x11, 0x8f, + 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, + 0, 0x7, 0, 0, 0, 0x6e, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x14, 0, 0x34, 0, 0x2a, 0, 0x1, 0, + 0x6, 0, 0, 0, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0xe, 0, 0x1, 0, 0x7, 0, 0, 0, 0x6e, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0xf, 0, 0x14, 0, 0xb, + 0, 0x1f, 0, 0x1, 0, 0xe, 0, 0, 0, 0x54, + 0x69, 0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, + 0x65, 0x79, 0x73, 0xa, 0, 0x5, 0, 0x80, 0xb1, 0x6, + 0xf4, 0x3b, 0x7b, 0xcf, 0x11, 0x8f, 0x52, 0, 0x40, 0x33, + 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0x4, 0, 0, + 0, 0x74, 0x69, 0x6d, 0x65, 0x14, 0, 0x1, 0, 0x9, + 0, 0, 0, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65, + 0x79, 0x73, 0x1, 0, 0x6, 0, 0, 0, 0x74, 0x66, + 0x6b, 0x65, 0x79, 0x73, 0x14, 0, 0xb, 0, 0x1f, 0, + 0x1, 0, 0xc, 0, 0, 0, 0x41, 0x6e, 0x69, 0x6d, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0xa, 0, + 0x5, 0, 0xa8, 0x46, 0xdd, 0x10, 0x5b, 0x77, 0xcf, 0x11, + 0x8f, 0x52, 0, 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, + 0x1, 0, 0x7, 0, 0, 0, 0x6b, 0x65, 0x79, 0x54, + 0x79, 0x70, 0x65, 0x14, 0, 0x29, 0, 0x1, 0, 0x5, + 0, 0, 0, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x14, 0, + 0x34, 0, 0x1, 0, 0xe, 0, 0, 0, 0x54, 0x69, + 0x6d, 0x65, 0x64, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x4b, 0x65, + 0x79, 0x73, 0x1, 0, 0x4, 0, 0, 0, 0x6b, 0x65, + 0x79, 0x73, 0xe, 0, 0x1, 0, 0x5, 0, 0, 0, + 0x6e, 0x4b, 0x65, 0x79, 0x73, 0xf, 0, 0x14, 0, 0xb, + 0, 0x1f, 0, 0x1, 0, 0x10, 0, 0, 0, 0x41, + 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa, 0, 0x5, 0, 0xc0, + 0x56, 0xbf, 0xe2, 0xf, 0x84, 0xcf, 0x11, 0x8f, 0x52, 0, + 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0xa, + 0, 0, 0, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, + 0x73, 0x65, 0x64, 0x14, 0, 0x29, 0, 0x1, 0, 0xf, + 0, 0, 0, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x14, 0, + 0xb, 0, 0x1f, 0, 0x1, 0, 0x9, 0, 0, 0, + 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa, + 0, 0x5, 0, 0x4f, 0xab, 0x82, 0x3d, 0xda, 0x62, 0xcf, + 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0xe, + 0, 0x12, 0, 0x12, 0, 0x12, 0, 0xf, 0, 0xb, + 0, 0x1f, 0, 0x1, 0, 0xc, 0, 0, 0, 0x41, + 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, + 0x74, 0xa, 0, 0x5, 0, 0x50, 0xab, 0x82, 0x3d, 0xda, + 0x62, 0xcf, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, + 0x33, 0xe, 0, 0x1, 0, 0x9, 0, 0, 0, 0x41, + 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xf, 0, + 0xb, 0, 0x1f, 0, 0x1, 0, 0xa, 0, 0, 0, + 0x49, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, + 0xa, 0, 0x5, 0, 0xa0, 0xee, 0x23, 0x3a, 0xb1, 0x94, + 0xd0, 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, + 0xe, 0, 0x1, 0, 0x6, 0, 0, 0, 0x42, 0x49, + 0x4e, 0x41, 0x52, 0x59, 0xf, 0, 0xb, 0, 0x1f, 0, + 0x1, 0, 0x3, 0, 0, 0, 0x55, 0x72, 0x6c, 0xa, + 0, 0x5, 0, 0xa1, 0xee, 0x23, 0x3a, 0xb1, 0x94, 0xd0, + 0x11, 0xab, 0x39, 0, 0x20, 0xaf, 0x71, 0xe4, 0x33, 0x29, + 0, 0x1, 0, 0x5, 0, 0, 0, 0x6e, 0x55, 0x72, + 0x6c, 0x73, 0x14, 0, 0x34, 0, 0x31, 0, 0x1, 0, + 0x4, 0, 0, 0, 0x75, 0x72, 0x6c, 0x73, 0xe, 0, + 0x1, 0, 0x5, 0, 0, 0, 0x6e, 0x55, 0x72, 0x6c, + 0x73, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, 0, 0x1, + 0, 0xf, 0, 0, 0, 0x50, 0x72, 0x6f, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x68, + 0xa, 0, 0x5, 0, 0x60, 0xc3, 0x63, 0x8a, 0x7d, 0x99, + 0xd0, 0x11, 0x94, 0x1c, 0, 0x80, 0xc8, 0xc, 0xfa, 0x7b, + 0xe, 0, 0x1, 0, 0x3, 0, 0, 0, 0x55, 0x72, + 0x6c, 0x13, 0, 0x1, 0, 0xa, 0, 0, 0, 0x49, + 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0xf, + 0, 0xb, 0, 0x1f, 0, 0x1, 0, 0x4, 0, 0, + 0, 0x47, 0x75, 0x69, 0x64, 0xa, 0, 0x5, 0, 0xe0, + 0x90, 0x27, 0xa4, 0x10, 0x78, 0xcf, 0x11, 0x8f, 0x52, 0, + 0x40, 0x33, 0x35, 0x94, 0xa3, 0x29, 0, 0x1, 0, 0x5, + 0, 0, 0, 0x64, 0x61, 0x74, 0x61, 0x31, 0x14, 0, + 0x28, 0, 0x1, 0, 0x5, 0, 0, 0, 0x64, 0x61, + 0x74, 0x61, 0x32, 0x14, 0, 0x28, 0, 0x1, 0, 0x5, + 0, 0, 0, 0x64, 0x61, 0x74, 0x61, 0x33, 0x14, 0, + 0x34, 0, 0x2d, 0, 0x1, 0, 0x5, 0, 0, 0, + 0x64, 0x61, 0x74, 0x61, 0x34, 0xe, 0, 0x3, 0, 0x8, + 0, 0, 0, 0xf, 0, 0x14, 0, 0xb, 0, 0x1f, + 0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, + 0x79, 0xa, 0, 0x5, 0, 0xe0, 0x21, 0xf, 0x7f, 0xe1, + 0xbf, 0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, + 0x71, 0x31, 0, 0x1, 0, 0x3, 0, 0, 0, 0x6b, + 0x65, 0x79, 0x14, 0, 0x31, 0, 0x1, 0, 0x5, 0, + 0, 0, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x14, 0, 0xb, + 0, 0x1f, 0, 0x1, 0, 0xb, 0, 0, 0, 0x50, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x42, 0x61, 0x67, + 0xa, 0, 0x5, 0, 0xe1, 0x21, 0xf, 0x7f, 0xe1, 0xbf, + 0xd1, 0x11, 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71, + 0xe, 0, 0x1, 0, 0xe, 0, 0, 0, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x79, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0, + 0xe, 0, 0, 0, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x56, 0x69, 0x73, 0x75, 0x61, 0x6c, 0xa, 0, + 0x5, 0, 0xa0, 0x6a, 0x11, 0x98, 0xba, 0xbd, 0xd1, 0x11, + 0x82, 0xc0, 0, 0xa0, 0xc9, 0x69, 0x72, 0x71, 0x1, 0, + 0x4, 0, 0, 0, 0x47, 0x75, 0x69, 0x64, 0x1, 0, + 0x12, 0, 0, 0, 0x67, 0x75, 0x69, 0x64, 0x45, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x69, 0x73, 0x75, + 0x61, 0x6c, 0x14, 0, 0xe, 0, 0x12, 0, 0x12, 0, + 0x12, 0, 0xf, 0, 0xb, 0, 0x1f, 0, 0x1, 0, + 0xb, 0, 0, 0, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48, + 0x61, 0x6e, 0x64, 0x65, 0x64, 0xa, 0, 0x5, 0, 0xa0, + 0x5e, 0x5d, 0x7f, 0x3a, 0xd5, 0xd1, 0x11, 0x82, 0xc0, 0, + 0xa0, 0xc9, 0x69, 0x72, 0x71, 0x29, 0, 0x1, 0, 0xc, + 0, 0, 0, 0x62, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48, + 0x61, 0x6e, 0x64, 0x65, 0x64, 0x14, 0, 0xb, 0 +}; + +#define D3DRM_XTEMPLATE_BYTES 3278 + +#endif /* _RMXFTMPL_H_ */ diff --git a/Src/Decoder_H264_ALL/D3D/include/rpcsal.h b/Src/Decoder_H264_ALL/D3D/include/rpcsal.h new file mode 100644 index 0000000..484ddc9 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/rpcsal.h @@ -0,0 +1,499 @@ +/****************************************************************\ +* * +* rpcsal.h - markers for documenting the semantics of RPC APIs * +* * +* Version 1.0 * +* * +* Copyright (c) 2004 Microsoft Corporation. All rights reserved. * +* * +\****************************************************************/ + +// ------------------------------------------------------------------------------- +// Introduction +// +// rpcsal.h provides a set of annotations to describe how RPC functions use their +// parameters - the assumptions it makes about them, adn the guarantees it makes +// upon finishing. These annotations are similar to those found in specstrings.h, +// but are designed to be used by the MIDL compiler when it generates annotations +// enabled header files. +// +// IDL authors do not need to annotate their functions declarations. The MIDL compiler +// will interpret the IDL directives and use one of the annotations contained +// in this header. This documentation is intended to help those trying to understand +// the MIDL-generated header files or those who maintain their own copies of these files. +// +// ------------------------------------------------------------------------------- +// Differences between rpcsal.h and specstrings.h +// +// There are a few important differences between the annotations found in rpcsal.h and +// those in specstrings.h: +// +// 1. [in] parameters are not marked as read-only. They may be used for scratch space +// at the server and changes will not affect the client. +// 2. String versions of each macro alleviates the need for a special type definition +// +// ------------------------------------------------------------------------------- +// Interpreting RPC Annotations +// +// These annotations are interpreted precisely in the same way as those in specstrings.h. +// Please refer to that header for information related to general usage in annotations. +// +// To construct an RPC annotation, concatenate the appropriate value from each category +// along with a leading __RPC_. A typical annotation looks like "__RPC__in_string". +// +// |----------------------------------------------------------------------------------| +// | RPC Annotations | +// |------------|------------|---------|--------|----------|----------|---------------| +// | Level | Usage | Size | Output | Optional | String | Parameters | +// |------------|------------|---------|--------|----------|----------|---------------| +// | <> | <> | <> | <> | <> | <> | <> | +// | _deref | _in | _ecount | _full | _opt | _string | (size) | +// | _deref_opt | _out | _bcount | _part | | | (size,length) | +// | | _inout | | | | | | +// | | | | | | | | +// |------------|------------|---------|--------|----------|----------|---------------| +// +// Level: Describes the buffer pointer's level of indirection from the parameter or +// return value 'p'. +// +// <> : p is the buffer pointer. +// _deref : *p is the buffer pointer. p must not be NULL. +// _deref_opt : *p may be the buffer pointer. p may be NULL, in which case the rest of +// the annotation is ignored. +// +// Usage: Describes how the function uses the buffer. +// +// <> : The buffer is not accessed. If used on the return value or with _deref, the +// function will provide the buffer, and it will be uninitialized at exit. +// Otherwise, the caller must provide the buffer. This should only be used +// for alloc and free functions. +// _in : The function will only read from the buffer. The caller must provide the +// buffer and initialize it. Cannot be used with _deref. +// _out : The function will only write to the buffer. If used on the return value or +// with _deref, the function will provide the buffer and initialize it. +// Otherwise, the caller must provide the buffer, and the function will +// initialize it. +// _inout : The function may freely read from and write to the buffer. The caller must +// provide the buffer and initialize it. If used with _deref, the buffer may +// be reallocated by the function. +// +// Size: Describes the total size of the buffer. This may be less than the space actually +// allocated for the buffer, in which case it describes the accessible amount. +// +// <> : No buffer size is given. If the type specifies the buffer size (such as +// with LPSTR and LPWSTR), that amount is used. Otherwise, the buffer is one +// element long. Must be used with _in, _out, or _inout. +// _ecount : The buffer size is an explicit element count. +// _bcount : The buffer size is an explicit byte count. +// +// Output: Describes how much of the buffer will be initialized by the function. For +// _inout buffers, this also describes how much is initialized at entry. Omit this +// category for _in buffers; they must be fully initialized by the caller. +// +// <> : The type specifies how much is initialized. For instance, a function initializing +// an LPWSTR must NULL-terminate the string. +// _full : The function initializes the entire buffer. +// _part : The function initializes part of the buffer, and explicitly indicates how much. +// +// Optional: Describes if the buffer itself is optional. +// +// <> : The pointer to the buffer must not be NULL. +// _opt : The pointer to the buffer might be NULL. It will be checked before being dereferenced. +// +// String: Describes if the buffer is NULL terminated +// +// <> : The buffer is not assumed to be NULL terminated +// _string : The buffer is assumed to be NULL terminated once it has been initialized +// +// Parameters: Gives explicit counts for the size and length of the buffer. +// +// <> : There is no explicit count. Use when neither _ecount nor _bcount is used. +// (size) : Only the buffer's total size is given. Use with _ecount or _bcount but not _part. +// (size,length) : The buffer's total size and initialized length are given. Use with _ecount_part +// and _bcount_part. +// +// Notes: +// +// 1. Specifying two buffer annotations on a single parameter results in unspecified behavior +// (e.g. __RPC__in_bcount(5) __RPC__out_bcount(6) +// +// 2. The size of the buffer and the amount that has been initialized are separate concepts. +// Specify the size using _ecount or _bcount. Specify the amount that is initialized using +// _full, _part, or _string. As a special case, a single element buffer does not need +// _ecount, _bcount, _full, or _part +// +// 3. The count may be less than the total size of the buffer in which case it describes the +// accessible portion. +// +// 4. "__RPC__opt" and "__RPC_deref" are not valid annotations. +// +// 5. The placement of _opt when using _deref is important: +// __RPC__deref_opt_... : Input may be NULL +// __RPC__deref_..._opt : Output may be NULL +// __RPC__deref_opt_..._opt : Both input and output may be NULL +// + +#pragma once + +#include + +#ifndef __RPCSAL_H_VERSION__ +#define __RPCSAL_H_VERSION__ ( 100 ) +#endif // __RPCSAL_H_VERSION__ + +#ifdef __REQUIRED_RPCSAL_H_VERSION__ + #if ( __RPCSAL_H_VERSION__ < __REQUIRED_RPCSAL_H_VERSION__ ) + #error incorrect version. Use the header that matches with the MIDL compiler. + #endif +#endif + + +#ifdef __cplusplus +extern "C" { +#endif // #ifdef __cplusplus + +#if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_) + + +// [in] +#define __RPC__in __pre __valid +#define __RPC__in_string __RPC__in __pre __nullterminated +#define __RPC__in_ecount(size) __RPC__in __pre __elem_readableTo(size) +#define __RPC__in_ecount_full(size) __RPC__in_ecount(size) +#define __RPC__in_ecount_full_string(size) __RPC__in_ecount_full(size) __pre __nullterminated +#define __RPC__in_ecount_part(size, length) __RPC__in_ecount(length) __pre __elem_writableTo(size) +#define __RPC__in_ecount_full_opt(size) __RPC__in_ecount_full(size) __pre __exceptthat __maybenull +#define __RPC__in_ecount_full_opt_string(size) __RPC__in_ecount_full_opt(size) __pre __nullterminated +#define __RPC__in_ecount_part_opt(size, length) __RPC__in_ecount_part(size, length) __pre __exceptthat __maybenull +#define __RPC__in_xcount(size) __RPC__in __pre __elem_readableTo(size) +#define __RPC__in_xcount_full(size) __RPC__in_ecount(size) +#define __RPC__in_xcount_full_string(size) __RPC__in_ecount_full(size) __pre __nullterminated +#define __RPC__in_xcount_part(size, length) __RPC__in_ecount(length) __pre __elem_writableTo(size) +#define __RPC__in_xcount_full_opt(size) __RPC__in_ecount_full(size) __pre __exceptthat __maybenull +#define __RPC__in_xcount_full_opt_string(size) __RPC__in_ecount_full_opt(size) __pre __nullterminated +#define __RPC__in_xcount_part_opt(size, length) __RPC__in_ecount_part(size, length) __pre __exceptthat __maybenull + + +#define __RPC__deref_in __RPC__in __deref __notnull +#define __RPC__deref_in_string __RPC__in __pre __deref __nullterminated +#define __RPC__deref_in_opt __RPC__deref_in __deref __exceptthat __maybenull +#define __RPC__deref_in_opt_string __RPC__deref_in_opt __pre __deref __nullterminated +#define __RPC__deref_opt_in __RPC__in __exceptthat __maybenull +#define __RPC__deref_opt_in_string __RPC__deref_opt_in __pre __deref __nullterminated +#define __RPC__deref_opt_in_opt __RPC__deref_opt_in __pre __deref __exceptthat __maybenull +#define __RPC__deref_opt_in_opt_string __RPC__deref_opt_in_opt __pre __deref __nullterminated +#define __RPC__deref_in_ecount(size) __RPC__in __pre __deref __elem_readableTo(size) +#define __RPC__deref_in_ecount_part(size, length) __RPC__deref_in_ecount(size) __pre __deref __elem_readableTo(length) +#define __RPC__deref_in_ecount_full(size) __RPC__deref_in_ecount_part(size, size) +#define __RPC__deref_in_ecount_full_opt(size) __RPC__deref_in_ecount_full(size) __pre __deref __exceptthat __maybenull +#define __RPC__deref_in_ecount_full_opt_string(size) __RPC__deref_in_ecount_full_opt(size) __pre __deref __nullterminated +#define __RPC__deref_in_ecount_full_string(size) __RPC__deref_in_ecount_full(size) __pre __deref __nullterminated +#define __RPC__deref_in_ecount_opt(size) __RPC__deref_in_ecount(size) __pre __deref __exceptthat __maybenull +#define __RPC__deref_in_ecount_opt_string(size) __RPC__deref_in_ecount_opt(size) __pre __deref __nullterminated +#define __RPC__deref_in_ecount_part_opt(size, length) __RPC__deref_in_ecount_opt(size) __pre __deref __elem_readableTo(length) +#define __RPC__deref_in_xcount(size) __RPC__in __pre __deref __elem_readableTo(size) +#define __RPC__deref_in_xcount_part(size, length) __RPC__deref_in_ecount(size) __pre __deref __elem_readableTo(length) +#define __RPC__deref_in_xcount_full(size) __RPC__deref_in_ecount_part(size, size) +#define __RPC__deref_in_xcount_full_opt(size) __RPC__deref_in_ecount_full(size) __pre __deref __exceptthat __maybenull +#define __RPC__deref_in_xcount_full_opt_string(size) __RPC__deref_in_ecount_full_opt(size) __pre __deref __nullterminated +#define __RPC__deref_in_xcount_full_string(size) __RPC__deref_in_ecount_full(size) __pre __deref __nullterminated +#define __RPC__deref_in_xcount_opt(size) __RPC__deref_in_ecount(size) __pre __deref __exceptthat __maybenull +#define __RPC__deref_in_xcount_opt_string(size) __RPC__deref_in_ecount_opt(size) __pre __deref __nullterminated +#define __RPC__deref_in_xcount_part_opt(size, length) __RPC__deref_in_ecount_opt(size) __pre __deref __elem_readableTo(length) + +// [out] +#define __RPC__out __out +#define __RPC__out_ecount(size) __out_ecount(size) __post __elem_writableTo(size) +#define __RPC__out_ecount_string(size) __RPC__out_ecount(size) __post __nullterminated +#define __RPC__out_ecount_part(size, length) __RPC__out_ecount(size) __post __elem_readableTo(length) +#define __RPC__out_ecount_full(size) __RPC__out_ecount_part(size, size) +#define __RPC__out_ecount_full_string(size) __RPC__out_ecount_full(size) __post __nullterminated +#define __RPC__out_xcount(size) __out +#define __RPC__out_xcount_string(size) __RPC__out __post __nullterminated +#define __RPC__out_xcount_part(size, length) __RPC__out +#define __RPC__out_xcount_full(size) __RPC__out +#define __RPC__out_xcount_full_string(size) __RPC__out __post __nullterminated + +// [in,out] +#define __RPC__inout __inout +#define __RPC__inout_string __RPC__inout __pre __nullterminated __post __nullterminated +#define __RPC__inout_ecount(size) __inout_ecount(size) +#define __RPC__inout_ecount_part(size, length) __inout_ecount_part(size, length) +#define __RPC__inout_ecount_full(size) __RPC__inout_ecount_part(size, size) +#define __RPC__inout_ecount_full_string(size) __RPC__inout_ecount_full(size) __pre __nullterminated __post __nullterminated +#define __RPC__inout_xcount(size) __inout +#define __RPC__inout_xcount_part(size, length) __inout +#define __RPC__inout_xcount_full(size) __RPC__inout +#define __RPC__inout_xcount_full_string(size) __RPC__inout __pre __nullterminated __post __nullterminated + +// [in,unique] +#define __RPC__in_opt __RPC__in __pre __exceptthat __maybenull +#define __RPC__in_opt_string __RPC__in_opt __pre __nullterminated +#define __RPC__in_ecount_opt(size) __RPC__in_ecount(size) __pre __exceptthat __maybenull +#define __RPC__in_ecount_opt_string(size) __RPC__in_ecount_opt(size) __pre __nullterminated +#define __RPC__in_xcount_opt(size) __RPC__in_ecount(size) __pre __exceptthat __maybenull +#define __RPC__in_xcount_opt_string(size) __RPC__in_ecount_opt(size) __pre __nullterminated + +// [in,out,unique] +#define __RPC__inout_opt __inout_opt +#define __RPC__inout_opt_string __RPC__inout_opt __pre __nullterminated +#define __RPC__inout_ecount_opt(size) __inout_ecount_opt(size) +#define __RPC__inout_ecount_part_opt(size, length) __inout_ecount_part_opt(size, length) +#define __RPC__inout_ecount_full_opt(size) __RPC__inout_ecount_part_opt(size, size) +#define __RPC__inout_ecount_full_opt_string(size) __RPC__inout_ecount_full_opt(size) __pre __nullterminated __post __nullterminated +#define __RPC__inout_xcount_opt(size) __inout_opt +#define __RPC__inout_xcount_part_opt(size, length) __inout_opt +#define __RPC__inout_xcount_full_opt(size) __RPC__inout_opt +#define __RPC__inout_xcount_full_opt_string(size) __RPC__inout_opt __pre __nullterminated __post __nullterminated + +// [out] ** +#define __RPC__deref_out __deref_out +#define __RPC__deref_out_string __RPC__deref_out __post __deref __nullterminated +// Removed "__post __deref __exceptthat __maybenull" so return values from QueryInterface and the like can be trusted without an explicit NULL check. +// This is a temporary fix until midl.exe can be rev'd to produce more accurate annotations. +#define __RPC__deref_out_opt __RPC__deref_out +#define __RPC__deref_out_opt_string __RPC__deref_out_opt __post __deref __nullterminated __pre __deref __null +#define __RPC__deref_out_ecount(size) __deref_out_ecount(size) __post __deref __elem_writableTo(size) +#define __RPC__deref_out_ecount_part(size, length) __RPC__deref_out_ecount(size) __post __deref __elem_readableTo(length) +#define __RPC__deref_out_ecount_full(size) __RPC__deref_out_ecount_part(size,size) +#define __RPC__deref_out_ecount_full_string(size) __RPC__deref_out_ecount_full(size) __post __deref __nullterminated +#define __RPC__deref_out_xcount(size) __deref_out __post __deref +#define __RPC__deref_out_xcount_part(size, length) __RPC__deref_out __post __deref +#define __RPC__deref_out_xcount_full(size) __RPC__deref_out +#define __RPC__deref_out_xcount_full_string(size) __RPC__deref_out __post __deref __nullterminated + +// [in,out] **, second pointer decoration. +#define __RPC__deref_inout __deref_inout +#define __RPC__deref_inout_string __RPC__deref_inout __pre __deref __nullterminated __post __deref __nullterminated +#define __RPC__deref_inout_opt __deref_inout_opt +#define __RPC__deref_inout_opt_string __RPC__deref_inout_opt __deref __nullterminated +#define __RPC__deref_inout_ecount_opt(size) __deref_inout_ecount_opt(size) +#define __RPC__deref_inout_ecount_part_opt(size, length) __deref_inout_ecount_part_opt(size , length) +#define __RPC__deref_inout_ecount_full_opt(size) __RPC__deref_inout_ecount_part_opt(size, size) +#define __RPC__deref_inout_ecount_full(size) __deref_inout_ecount_full(size) +#define __RPC__deref_inout_ecount_full_string(size) __RPC__deref_inout_ecount_full(size) __post __deref __nullterminated +#define __RPC__deref_inout_ecount_full_opt_string(size) __RPC__deref_inout_ecount_full_opt(size) __pre __deref __nullterminated __post __deref __nullterminated +#define __RPC__deref_inout_xcount_opt(size) __deref_inout_opt +#define __RPC__deref_inout_xcount_part_opt(size, length) __deref_inout_opt +#define __RPC__deref_inout_xcount_full_opt(size) __RPC__deref_inout_opt +#define __RPC__deref_inout_xcount_full(size) __deref_inout +#define __RPC__deref_inout_xcount_full_string(size) __RPC__deref_inout __post __deref __nullterminated +#define __RPC__deref_inout_xcount_full_opt_string(size) __RPC__deref_inout_opt __pre __deref __nullterminated __post __deref __nullterminated + + +// #define __RPC_out_opt out_opt is not allowed in rpc + +// [in,out,unique] +#define __RPC__deref_opt_inout __deref_opt_inout +#define __RPC__deref_opt_inout_ecount(size) __deref_opt_inout_ecount(size) +#define __RPC__deref_opt_inout_string __RPC__deref_opt_inout __pre __deref __nullterminated __post __deref __nullterminated +#define __RPC__deref_opt_inout_ecount_part(size, length) __deref_opt_inout_ecount_part(size, length) +#define __RPC__deref_opt_inout_ecount_full(size) __deref_opt_inout_ecount_full(size) +#define __RPC__deref_opt_inout_ecount_full_string(size) __RPC__deref_opt_inout_ecount_full(size) __pre __deref __nullterminated __post __deref __nullterminated +#define __RPC__deref_opt_inout_xcount_part(size, length) __deref_opt_inout +#define __RPC__deref_opt_inout_xcount_full(size) __deref_opt_inout +#define __RPC__deref_opt_inout_xcount_full_string(size) __RPC__deref_opt_inout __pre __deref __nullterminated __post __deref __nullterminated + + +// We don't need to specify __pre __deref __exceptthat __maybenull : this is default behavior. While this might not hold in SAL 1.1 syntax, SAL team +// believes it's OK. We can revisit if SAL 1.1 can survive. +#define __RPC__deref_out_ecount_opt(size) __RPC__out_ecount(size) __post __deref __exceptthat __maybenull __pre __deref __null +#define __RPC__deref_out_ecount_part_opt(size, length) __RPC__deref_out_ecount_part(size, length) __post __deref __exceptthat __maybenull __pre __deref __null +#define __RPC__deref_out_ecount_full_opt(size) __RPC__deref_out_ecount_part_opt(size, size) __pre __deref __null +#define __RPC__deref_out_ecount_full_opt_string(size) __RPC__deref_out_ecount_part_opt(size, size) __post __deref __nullterminated __pre __deref __null +#define __RPC__deref_out_xcount_opt(size) __RPC__out __post __deref __exceptthat __maybenull __pre __deref __null +#define __RPC__deref_out_xcount_part_opt(size, length) __RPC__deref_out __post __deref __exceptthat __maybenull __pre __deref __null +#define __RPC__deref_out_xcount_full_opt(size) __RPC__deref_out_opt __pre __deref __null +#define __RPC__deref_out_xcount_full_opt_string(size) __RPC__deref_out_opt __post __deref __nullterminated __pre __deref __null + +#define __RPC__deref_opt_inout_opt __deref_opt_inout_opt +#define __RPC__deref_opt_inout_opt_string __RPC__deref_opt_inout_opt __pre __deref __nullterminated __post __deref __nullterminated +#define __RPC__deref_opt_inout_ecount_opt(size) __deref_opt_inout_ecount_opt(size) +#define __RPC__deref_opt_inout_ecount_part_opt(size, length) __deref_opt_inout_ecount_part_opt(size, length) +#define __RPC__deref_opt_inout_ecount_full_opt(size) __RPC__deref_opt_inout_ecount_part_opt(size, size) +#define __RPC__deref_opt_inout_ecount_full_opt_string(size) __RPC__deref_opt_inout_ecount_full_opt(size) __pre __deref __nullterminated __post __deref __nullterminated +#define __RPC__deref_opt_inout_xcount_opt(size) __deref_opt_inout_opt +#define __RPC__deref_opt_inout_xcount_part_opt(size, length) __deref_opt_inout_opt +#define __RPC__deref_opt_inout_xcount_full_opt(size) __RPC__deref_opt_inout_opt +#define __RPC__deref_opt_inout_xcount_full_opt_string(size) __RPC__deref_opt_inout_opt __pre __deref __nullterminated __post __deref __nullterminated + +#define __RPC_full_pointer __maybenull +#define __RPC_unique_pointer __maybenull +#define __RPC_ref_pointer __notnull +#define __RPC_string __nullterminated + +#define __RPC__range(min,max) __range(min,max) +#define __RPC__in_range(min,max) __in_range(min,max) + +#else // not prefast + +#define __RPC__range(min,max) +#define __RPC__in_range(min,max) + +#define __RPC__in +#define __RPC__in_string +#define __RPC__in_opt_string +#define __RPC__in_ecount(size) +#define __RPC__in_ecount_full(size) +#define __RPC__in_ecount_full_string(size) +#define __RPC__in_ecount_part(size, length) +#define __RPC__in_ecount_full_opt(size) +#define __RPC__in_ecount_full_opt_string(size) +#define __RPC__inout_ecount_full_opt_string(size) +#define __RPC__in_ecount_part_opt(size, length) +#define __RPC__in_xcount(size) +#define __RPC__in_xcount_full(size) +#define __RPC__in_xcount_full_string(size) +#define __RPC__in_xcount_part(size, length) +#define __RPC__in_xcount_full_opt(size) +#define __RPC__in_xcount_full_opt_string(size) +#define __RPC__inout_xcount_full_opt_string(size) +#define __RPC__in_xcount_part_opt(size, length) + +#define __RPC__deref_in +#define __RPC__deref_in_string +#define __RPC__deref_in_opt +#define __RPC__deref_in_opt_string +#define __RPC__deref_opt_in +#define __RPC__deref_opt_in_string +#define __RPC__deref_opt_in_opt +#define __RPC__deref_opt_in_opt_string +#define __RPC__deref_in_ecount(size) +#define __RPC__deref_in_ecount_part(size, length) +#define __RPC__deref_in_ecount_full(size) +#define __RPC__deref_in_ecount_full_opt(size) +#define __RPC__deref_in_ecount_full_string(size) +#define __RPC__deref_in_ecount_full_opt_string(size) +#define __RPC__deref_in_ecount_opt(size) +#define __RPC__deref_in_ecount_opt_string(size) +#define __RPC__deref_in_ecount_part_opt(size, length) +#define __RPC__deref_in_xcount(size) +#define __RPC__deref_in_xcount_part(size, length) +#define __RPC__deref_in_xcount_full(size) +#define __RPC__deref_in_xcount_full_opt(size) +#define __RPC__deref_in_xcount_full_string(size) +#define __RPC__deref_in_xcount_full_opt_string(size) +#define __RPC__deref_in_xcount_opt(size) +#define __RPC__deref_in_xcount_opt_string(size) +#define __RPC__deref_in_xcount_part_opt(size, length) + +// [out] +#define __RPC__out +#define __RPC__out_ecount(size) +#define __RPC__out_ecount_part(size, length) +#define __RPC__out_ecount_full(size) +#define __RPC__out_ecount_full_string(size) +#define __RPC__out_xcount(size) +#define __RPC__out_xcount_part(size, length) +#define __RPC__out_xcount_full(size) +#define __RPC__out_xcount_full_string(size) + +// [in,out] +#define __RPC__inout +#define __RPC__inout_string +#define __RPC__opt_inout +#define __RPC__inout_ecount(size) +#define __RPC__inout_ecount_part(size, length) +#define __RPC__inout_ecount_full(size) +#define __RPC__inout_ecount_full_string(size) +#define __RPC__inout_xcount(size) +#define __RPC__inout_xcount_part(size, length) +#define __RPC__inout_xcount_full(size) +#define __RPC__inout_xcount_full_string(size) + +// [in,unique] +#define __RPC__in_opt +#define __RPC__in_ecount_opt(size) +#define __RPC__in_xcount_opt(size) + + +// [in,out,unique] +#define __RPC__inout_opt +#define __RPC__inout_opt_string +#define __RPC__inout_ecount_opt(size) +#define __RPC__inout_ecount_part_opt(size, length) +#define __RPC__inout_ecount_full_opt(size) +#define __RPC__inout_ecount_full_string(size) +#define __RPC__inout_xcount_opt(size) +#define __RPC__inout_xcount_part_opt(size, length) +#define __RPC__inout_xcount_full_opt(size) +#define __RPC__inout_xcount_full_string(size) + +// [out] ** +#define __RPC__deref_out +#define __RPC__deref_out_string +#define __RPC__deref_out_opt +#define __RPC__deref_out_opt_string +#define __RPC__deref_out_ecount(size) +#define __RPC__deref_out_ecount_part(size, length) +#define __RPC__deref_out_ecount_full(size) +#define __RPC__deref_out_ecount_full_string(size) +#define __RPC__deref_out_xcount(size) +#define __RPC__deref_out_xcount_part(size, length) +#define __RPC__deref_out_xcount_full(size) +#define __RPC__deref_out_xcount_full_string(size) + + +// [in,out] **, second pointer decoration. +#define __RPC__deref_inout +#define __RPC__deref_inout_string +#define __RPC__deref_inout_opt +#define __RPC__deref_inout_opt_string +#define __RPC__deref_inout_ecount_full(size) +#define __RPC__deref_inout_ecount_full_string(size) +#define __RPC__deref_inout_ecount_opt(size) +#define __RPC__deref_inout_ecount_part_opt(size, length) +#define __RPC__deref_inout_ecount_full_opt(size) +#define __RPC__deref_inout_ecount_full_opt_string(size) +#define __RPC__deref_inout_xcount_full(size) +#define __RPC__deref_inout_xcount_full_string(size) +#define __RPC__deref_inout_xcount_opt(size) +#define __RPC__deref_inout_xcount_part_opt(size, length) +#define __RPC__deref_inout_xcount_full_opt(size) +#define __RPC__deref_inout_xcount_full_opt_string(size) + +// #define __RPC_out_opt out_opt is not allowed in rpc + +// [in,out,unique] +#define __RPC__deref_opt_inout +#define __RPC__deref_opt_inout_string +#define __RPC__deref_opt_inout_ecount(size) +#define __RPC__deref_opt_inout_ecount_part(size, length) +#define __RPC__deref_opt_inout_ecount_full(size) +#define __RPC__deref_opt_inout_ecount_full_string(size) +#define __RPC__deref_opt_inout_xcount(size) +#define __RPC__deref_opt_inout_xcount_part(size, length) +#define __RPC__deref_opt_inout_xcount_full(size) +#define __RPC__deref_opt_inout_xcount_full_string(size) + +#define __RPC__deref_out_ecount_opt(size) +#define __RPC__deref_out_ecount_part_opt(size, length) +#define __RPC__deref_out_ecount_full_opt(size) +#define __RPC__deref_out_ecount_full_opt_string(size) +#define __RPC__deref_out_xcount_opt(size) +#define __RPC__deref_out_xcount_part_opt(size, length) +#define __RPC__deref_out_xcount_full_opt(size) +#define __RPC__deref_out_xcount_full_opt_string(size) + +#define __RPC__deref_opt_inout_opt +#define __RPC__deref_opt_inout_opt_string +#define __RPC__deref_opt_inout_ecount_opt(size) +#define __RPC__deref_opt_inout_ecount_part_opt(size, length) +#define __RPC__deref_opt_inout_ecount_full_opt(size) +#define __RPC__deref_opt_inout_ecount_full_opt_string(size) +#define __RPC__deref_opt_inout_xcount_opt(size) +#define __RPC__deref_opt_inout_xcount_part_opt(size, length) +#define __RPC__deref_opt_inout_xcount_full_opt(size) +#define __RPC__deref_opt_inout_xcount_full_opt_string(size) + +#define __RPC_full_pointer +#define __RPC_unique_pointer +#define __RPC_ref_pointer +#define __RPC_string + + +#endif + +#ifdef __cplusplus +} +#endif diff --git a/Src/Decoder_H264_ALL/D3D/include/strsafe.h b/Src/Decoder_H264_ALL/D3D/include/strsafe.h new file mode 100644 index 0000000..061b3c4 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/strsafe.h @@ -0,0 +1,6611 @@ +/****************************************************************** +* * +* strsafe.h -- This module defines safer C library string * +* routine replacements. These are meant to make C * +* a bit more safe in reference to security and * +* robustness * +* * +* Copyright (c) Microsoft Corp. All rights reserved. * +* * +******************************************************************/ +#ifndef _STRSAFE_H_INCLUDED_ +#define _STRSAFE_H_INCLUDED_ +#pragma once + +#include // for _vsnprintf, _vsnwprintf, getc, getwc +#include // for memset +#include // for va_start, etc. + + +#ifndef _SIZE_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 size_t; +#else +typedef __w64 unsigned int size_t; +#endif // !_WIN64 +#define _SIZE_T_DEFINED +#endif // !_SIZE_T_DEFINED + +#if !defined(_WCHAR_T_DEFINED) && !defined(_NATIVE_WCHAR_T_DEFINED) +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif + +#ifndef _HRESULT_DEFINED +#define _HRESULT_DEFINED +typedef long HRESULT; +#endif // !_HRESULT_DEFINED + +#ifndef SUCCEEDED +#define SUCCEEDED(hr) ((HRESULT)(hr) >= 0) +#endif + +#ifndef FAILED +#define FAILED(hr) ((HRESULT)(hr) < 0) +#endif + +#ifndef S_OK +#define S_OK ((HRESULT)0x00000000L) +#endif + +#ifdef __cplusplus +#define _STRSAFE_EXTERN_C extern "C" +#else +#define _STRSAFE_EXTERN_C extern +#endif + +// If you do not want to use these functions inline (and instead want to link w/ strsafe.lib), then +// #define STRSAFE_LIB before including this header file. +#if defined(STRSAFE_LIB) +#define STRSAFEAPI _STRSAFE_EXTERN_C HRESULT __stdcall +#pragma comment(lib, "strsafe.lib") +#elif defined(STRSAFE_LIB_IMPL) +#define STRSAFEAPI _STRSAFE_EXTERN_C HRESULT __stdcall +#else +#define STRSAFEAPI __inline HRESULT __stdcall +#define STRSAFE_INLINE +#endif + +// Some functions always run inline because they use stdin and we want to avoid building multiple +// versions of strsafe lib depending on if you use msvcrt, libcmt, etc. +#define STRSAFE_INLINE_API __inline HRESULT __stdcall + +// The user can request no "Cb" or no "Cch" fuctions, but not both! +#if defined(STRSAFE_NO_CB_FUNCTIONS) && defined(STRSAFE_NO_CCH_FUNCTIONS) +#error cannot specify both STRSAFE_NO_CB_FUNCTIONS and STRSAFE_NO_CCH_FUNCTIONS !! +#endif + +// This should only be defined when we are building strsafe.lib +#ifdef STRSAFE_LIB_IMPL +#define STRSAFE_INLINE +#endif + + +// If both strsafe.h and ntstrsafe.h are included, only use definitions from one. +#ifndef _NTSTRSAFE_H_INCLUDED_ + +#define STRSAFE_MAX_CCH 2147483647 // max # of characters we support (same as INT_MAX) + +// Flags for controling the Ex functions +// +// STRSAFE_FILL_BYTE(0xFF) 0x000000FF // bottom byte specifies fill pattern +#define STRSAFE_IGNORE_NULLS 0x00000100 // treat null as TEXT("") -- don't fault on NULL buffers +#define STRSAFE_FILL_BEHIND_NULL 0x00000200 // fill in extra space behind the null terminator +#define STRSAFE_FILL_ON_FAILURE 0x00000400 // on failure, overwrite pszDest with fill pattern and null terminate it +#define STRSAFE_NULL_ON_FAILURE 0x00000800 // on failure, set *pszDest = TEXT('\0') +#define STRSAFE_NO_TRUNCATION 0x00001000 // instead of returning a truncated result, copy/append nothing to pszDest and null terminate it + +#define STRSAFE_VALID_FLAGS (0x000000FF | STRSAFE_IGNORE_NULLS | STRSAFE_FILL_BEHIND_NULL | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION) + +// helper macro to set the fill character and specify buffer filling +#define STRSAFE_FILL_BYTE(x) ((unsigned long)((x & 0x000000FF) | STRSAFE_FILL_BEHIND_NULL)) +#define STRSAFE_FAILURE_BYTE(x) ((unsigned long)((x & 0x000000FF) | STRSAFE_FILL_ON_FAILURE)) + +#define STRSAFE_GET_FILL_PATTERN(dwFlags) ((int)(dwFlags & 0x000000FF)) + +#endif // _NTSTRSAFE_H_INCLUDED_ + +// STRSAFE error return codes +// +#define STRSAFE_E_INSUFFICIENT_BUFFER ((HRESULT)0x8007007AL) // 0x7A = 122L = ERROR_INSUFFICIENT_BUFFER +#define STRSAFE_E_INVALID_PARAMETER ((HRESULT)0x80070057L) // 0x57 = 87L = ERROR_INVALID_PARAMETER +#define STRSAFE_E_END_OF_FILE ((HRESULT)0x80070026L) // 0x26 = 38L = ERROR_HANDLE_EOF + +// prototypes for the worker functions +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCopyWorkerA(char* pszDest, size_t cchDest, const char* pszSrc); +STRSAFEAPI StringCopyWorkerW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc); +STRSAFEAPI StringCopyExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +STRSAFEAPI StringCopyExWorkerW(wchar_t* pszDest, size_t cchDest, size_t cbDest, const wchar_t* pszSrc, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +STRSAFEAPI StringCopyNWorkerA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchSrc); +STRSAFEAPI StringCopyNWorkerW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, size_t cchSrc); +STRSAFEAPI StringCopyNExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, size_t cchSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +STRSAFEAPI StringCopyNExWorkerW(wchar_t* pszDest, size_t cchDest, size_t cbDest, const wchar_t* pszSrc, size_t cchSrc, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +STRSAFEAPI StringCatWorkerA(char* pszDest, size_t cchDest, const char* pszSrc); +STRSAFEAPI StringCatWorkerW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc); +STRSAFEAPI StringCatExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +STRSAFEAPI StringCatExWorkerW(wchar_t* pszDest, size_t cchDest, size_t cbDest, const wchar_t* pszSrc, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +STRSAFEAPI StringCatNWorkerA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchMaxAppend); +STRSAFEAPI StringCatNWorkerW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, size_t cchMaxAppend); +STRSAFEAPI StringCatNExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, size_t cchMaxAppend, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +STRSAFEAPI StringCatNExWorkerW(wchar_t* pszDest, size_t cchDest, size_t cbDest, const wchar_t* pszSrc, size_t cchMaxAppend, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +STRSAFEAPI StringVPrintfWorkerA(char* pszDest, size_t cchDest, const char* pszFormat, va_list argList); +STRSAFEAPI StringVPrintfWorkerW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszFormat, va_list argList); +STRSAFEAPI StringVPrintfExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const char* pszFormat, va_list argList); +STRSAFEAPI StringVPrintfExWorkerW(wchar_t* pszDest, size_t cchDest, size_t cbDest, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const wchar_t* pszFormat, va_list argList); +STRSAFEAPI StringLengthWorkerA(const char* psz, size_t cchMax, size_t* pcch); +STRSAFEAPI StringLengthWorkerW(const wchar_t* psz, size_t cchMax, size_t* pcch); +#endif // STRSAFE_INLINE + +#ifndef STRSAFE_LIB_IMPL +// these functions are always inline +STRSAFE_INLINE_API StringGetsExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +STRSAFE_INLINE_API StringGetsExWorkerW(wchar_t* pszDest, size_t cchDest, size_t cbDest, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +#endif + +#ifdef _NTSTRSAFE_H_INCLUDED_ +#pragma warning(push) +#pragma warning(disable : 4995) +#endif // _NTSTRSAFE_H_INCLUDED_ + + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchCopy( + OUT LPTSTR pszDest, + IN size_t cchDest, + IN LPCTSTR pszSrc + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strcpy'. + The size of the destination buffer (in characters) is a parameter and + this function will not write past the end of this buffer and it will + ALWAYS null terminate the destination buffer (unless it is zero length). + + This routine is not a replacement for strncpy. That function will pad the + destination string with extra null termination characters if the count is + greater than the length of the source string, and it will fail to null + terminate the destination string if the source string length is greater + than or equal to the count. You can not blindly use this instead of strncpy: + it is common for code to use it to "patch" strings and you would introduce + errors if the code started null terminating in the middle of the string. + + This function returns a hresult, and not a pointer. It returns + S_OK if the string was copied without truncation and null terminated, + otherwise it will return a failure code. In failure cases as much of + pszSrc will be copied to pszDest as possible, and pszDest will be null + terminated. + +Arguments: + + pszDest - destination string + + cchDest - size of destination buffer in characters. + length must be = (_tcslen(src) + 1) to hold all of the + source including the null terminator + + pszSrc - source string which must be null terminated + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL. See StringCchCopyEx if you require + the handling of NULL values. + +Return Value: + + S_OK - if there was source data and it was all copied and the + resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the copy + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function. + +--*/ + +STRSAFEAPI StringCchCopyA(char* pszDest, size_t cchDest, const char* pszSrc); +STRSAFEAPI StringCchCopyW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc); +#ifdef UNICODE +#define StringCchCopy StringCchCopyW +#else +#define StringCchCopy StringCchCopyA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCchCopyA(char* pszDest, size_t cchDest, const char* pszSrc) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCopyWorkerA(pszDest, cchDest, pszSrc); + } + + return hr; +} + +STRSAFEAPI StringCchCopyW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCopyWorkerW(pszDest, cchDest, pszSrc); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CCH_FUNCTIONS + + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbCopy( + OUT LPTSTR pszDest, + IN size_t cbDest, + IN LPCTSTR pszSrc + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strcpy'. + The size of the destination buffer (in bytes) is a parameter and this + function will not write past the end of this buffer and it will ALWAYS + null terminate the destination buffer (unless it is zero length). + + This routine is not a replacement for strncpy. That function will pad the + destination string with extra null termination characters if the count is + greater than the length of the source string, and it will fail to null + terminate the destination string if the source string length is greater + than or equal to the count. You can not blindly use this instead of strncpy: + it is common for code to use it to "patch" strings and you would introduce + errors if the code started null terminating in the middle of the string. + + This function returns a hresult, and not a pointer. It returns + S_OK if the string was copied without truncation and null terminated, + otherwise it will return a failure code. In failure cases as much of pszSrc + will be copied to pszDest as possible, and pszDest will be null terminated. + +Arguments: + + pszDest - destination string + + cbDest - size of destination buffer in bytes. + length must be = ((_tcslen(src) + 1) * sizeof(TCHAR)) to + hold all of the source including the null terminator + + pszSrc - source string which must be null terminated + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL. See StringCbCopyEx if you require + the handling of NULL values. + +Return Value: + + S_OK - if there was source data and it was all copied and the + resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the copy + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function. + +--*/ + +STRSAFEAPI StringCbCopyA(char* pszDest, size_t cbDest, const char* pszSrc); +STRSAFEAPI StringCbCopyW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc); +#ifdef UNICODE +#define StringCbCopy StringCbCopyW +#else +#define StringCbCopy StringCbCopyA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCbCopyA(char* pszDest, size_t cbDest, const char* pszSrc) +{ + HRESULT hr; + size_t cchDest; + + // convert to count of characters + cchDest = cbDest / sizeof(char); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCopyWorkerA(pszDest, cchDest, pszSrc); + } + + return hr; +} + +STRSAFEAPI StringCbCopyW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc) +{ + HRESULT hr; + size_t cchDest; + + // convert to count of characters + cchDest = cbDest / sizeof(wchar_t); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCopyWorkerW(pszDest, cchDest, pszSrc); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CB_FUNCTIONS + + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchCopyEx( + OUT LPTSTR pszDest OPTIONAL, + IN size_t cchDest, + IN LPCTSTR pszSrc OPTIONAL, + OUT LPTSTR* ppszDestEnd OPTIONAL, + OUT size_t* pcchRemaining OPTIONAL, + IN DWORD dwFlags + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strcpy' with + some additional parameters. In addition to functionality provided by + StringCchCopy, this routine also returns a pointer to the end of the + destination string and the number of characters left in the destination string + including the null terminator. The flags parameter allows additional controls. + +Arguments: + + pszDest - destination string + + cchDest - size of destination buffer in characters. + length must be = (_tcslen(pszSrc) + 1) to hold all of + the source including the null terminator + + pszSrc - source string which must be null terminated + + ppszDestEnd - if ppszDestEnd is non-null, the function will return a + pointer to the end of the destination string. If the + function copied any data, the result will point to the + null termination character + + pcchRemaining - if pcchRemaining is non-null, the function will return the + number of characters left in the destination string, + including the null terminator + + dwFlags - controls some details of the string copy: + + STRSAFE_FILL_BEHIND_NULL + if the function succeeds, the low byte of dwFlags will be + used to fill the uninitialize part of destination buffer + behind the null terminator + + STRSAFE_IGNORE_NULLS + treat NULL string pointers like empty strings (TEXT("")). + this flag is useful for emulating functions like lstrcpy + + STRSAFE_FILL_ON_FAILURE + if the function fails, the low byte of dwFlags will be + used to fill all of the destination buffer, and it will + be null terminated. This will overwrite any truncated + string returned when the failure is + STRSAFE_E_INSUFFICIENT_BUFFER + + STRSAFE_NO_TRUNCATION / + STRSAFE_NULL_ON_FAILURE + if the function fails, the destination buffer will be set + to the empty string. This will overwrite any truncated string + returned when the failure is STRSAFE_E_INSUFFICIENT_BUFFER. + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag + is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc + may be NULL. An error may still be returned even though NULLS are ignored + due to insufficient space. + +Return Value: + + S_OK - if there was source data and it was all copied and the + resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the copy + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCchCopyExA(char* pszDest, size_t cchDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +STRSAFEAPI StringCchCopyExW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +#ifdef UNICODE +#define StringCchCopyEx StringCchCopyExW +#else +#define StringCchCopyEx StringCchCopyExA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCchCopyExA(char* pszDest, size_t cchDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + + // safe to multiply cchDest * sizeof(char) since cchDest < STRSAFE_MAX_CCH and sizeof(char) is 1 + cbDest = cchDest * sizeof(char); + + hr = StringCopyExWorkerA(pszDest, cchDest, cbDest, pszSrc, ppszDestEnd, pcchRemaining, dwFlags); + } + + return hr; +} + +STRSAFEAPI StringCchCopyExW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + + // safe to multiply cchDest * sizeof(wchar_t) since cchDest < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + cbDest = cchDest * sizeof(wchar_t); + + hr = StringCopyExWorkerW(pszDest, cchDest, cbDest, pszSrc, ppszDestEnd, pcchRemaining, dwFlags); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CCH_FUNCTIONS + + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbCopyEx( + OUT LPTSTR pszDest OPTIONAL, + IN size_t cbDest, + IN LPCTSTR pszSrc OPTIONAL, + OUT LPTSTR* ppszDestEnd OPTIONAL, + OUT size_t* pcbRemaining OPTIONAL, + IN DWORD dwFlags + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strcpy' with + some additional parameters. In addition to functionality provided by + StringCbCopy, this routine also returns a pointer to the end of the + destination string and the number of bytes left in the destination string + including the null terminator. The flags parameter allows additional controls. + +Arguments: + + pszDest - destination string + + cbDest - size of destination buffer in bytes. + length must be ((_tcslen(pszSrc) + 1) * sizeof(TCHAR)) to + hold all of the source including the null terminator + + pszSrc - source string which must be null terminated + + ppszDestEnd - if ppszDestEnd is non-null, the function will return a + pointer to the end of the destination string. If the + function copied any data, the result will point to the + null termination character + + pcbRemaining - pcbRemaining is non-null,the function will return the + number of bytes left in the destination string, + including the null terminator + + dwFlags - controls some details of the string copy: + + STRSAFE_FILL_BEHIND_NULL + if the function succeeds, the low byte of dwFlags will be + used to fill the uninitialize part of destination buffer + behind the null terminator + + STRSAFE_IGNORE_NULLS + treat NULL string pointers like empty strings (TEXT("")). + this flag is useful for emulating functions like lstrcpy + + STRSAFE_FILL_ON_FAILURE + if the function fails, the low byte of dwFlags will be + used to fill all of the destination buffer, and it will + be null terminated. This will overwrite any truncated + string returned when the failure is + STRSAFE_E_INSUFFICIENT_BUFFER + + STRSAFE_NO_TRUNCATION / + STRSAFE_NULL_ON_FAILURE + if the function fails, the destination buffer will be set + to the empty string. This will overwrite any truncated string + returned when the failure is STRSAFE_E_INSUFFICIENT_BUFFER. + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag + is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc + may be NULL. An error may still be returned even though NULLS are ignored + due to insufficient space. + +Return Value: + + S_OK - if there was source data and it was all copied and the + resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the copy + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCbCopyExA(char* pszDest, size_t cbDest, const char* pszSrc, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags); +STRSAFEAPI StringCbCopyExW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc, wchar_t** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags); +#ifdef UNICODE +#define StringCbCopyEx StringCbCopyExW +#else +#define StringCbCopyEx StringCbCopyExA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCbCopyExA(char* pszDest, size_t cbDest, const char* pszSrc, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags) +{ + HRESULT hr; + size_t cchDest; + size_t cchRemaining = 0; + + cchDest = cbDest / sizeof(char); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCopyExWorkerA(pszDest, cchDest, cbDest, pszSrc, ppszDestEnd, &cchRemaining, dwFlags); + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (pcbRemaining) + { + // safe to multiply cchRemaining * sizeof(char) since cchRemaining < STRSAFE_MAX_CCH and sizeof(char) is 1 + *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); + } + } + + return hr; +} + +STRSAFEAPI StringCbCopyExW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc, wchar_t** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags) +{ + HRESULT hr; + size_t cchDest; + size_t cchRemaining = 0; + + cchDest = cbDest / sizeof(wchar_t); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCopyExWorkerW(pszDest, cchDest, cbDest, pszSrc, ppszDestEnd, &cchRemaining, dwFlags); + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (pcbRemaining) + { + // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + *pcbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); + } + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CB_FUNCTIONS + + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchCopyN( + OUT LPTSTR pszDest, + IN size_t cchDest, + IN LPCTSTR pszSrc, + IN size_t cchSrc + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strncpy'. + The size of the destination buffer (in characters) is a parameter and + this function will not write past the end of this buffer and it will + ALWAYS null terminate the destination buffer (unless it is zero length). + + This routine is meant as a replacement for strncpy, but it does behave + differently. This function will not pad the destination buffer with extra + null termination characters if cchSrc is greater than the length of pszSrc. + + This function returns a hresult, and not a pointer. It returns + S_OK if the entire string or the first cchSrc characters were copied + without truncation and the resultant destination string was null terminated, + otherwise it will return a failure code. In failure cases as much of pszSrc + will be copied to pszDest as possible, and pszDest will be null terminated. + +Arguments: + + pszDest - destination string + + cchDest - size of destination buffer in characters. + length must be = (_tcslen(src) + 1) to hold all of the + source including the null terminator + + pszSrc - source string + + cchSrc - maximum number of characters to copy from source string, + not including the null terminator. + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL. See StringCchCopyNEx if you require + the handling of NULL values. + +Return Value: + + S_OK - if there was source data and it was all copied and the + resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the copy + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function. + +--*/ + +STRSAFEAPI StringCchCopyNA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchSrc); +STRSAFEAPI StringCchCopyNW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, size_t cchSrc); +#ifdef UNICODE +#define StringCchCopyN StringCchCopyNW +#else +#define StringCchCopyN StringCchCopyNA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCchCopyNA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchSrc) +{ + HRESULT hr; + + if ((cchDest > STRSAFE_MAX_CCH) || + (cchSrc > STRSAFE_MAX_CCH)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCopyNWorkerA(pszDest, cchDest, pszSrc, cchSrc); + } + + return hr; +} + +STRSAFEAPI StringCchCopyNW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, size_t cchSrc) +{ + HRESULT hr; + + if ((cchDest > STRSAFE_MAX_CCH) || + (cchSrc > STRSAFE_MAX_CCH)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCopyNWorkerW(pszDest, cchDest, pszSrc, cchSrc); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CCH_FUNCTIONS + + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbCopyN( + OUT LPTSTR pszDest, + IN size_t cbDest, + IN LPCTSTR pszSrc, + IN size_t cbSrc + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strncpy'. + The size of the destination buffer (in bytes) is a parameter and this + function will not write past the end of this buffer and it will ALWAYS + null terminate the destination buffer (unless it is zero length). + + This routine is meant as a replacement for strncpy, but it does behave + differently. This function will not pad the destination buffer with extra + null termination characters if cbSrc is greater than the size of pszSrc. + + This function returns a hresult, and not a pointer. It returns + S_OK if the entire string or the first cbSrc characters were + copied without truncation and the resultant destination string was null + terminated, otherwise it will return a failure code. In failure cases as + much of pszSrc will be copied to pszDest as possible, and pszDest will be + null terminated. + +Arguments: + + pszDest - destination string + + cbDest - size of destination buffer in bytes. + length must be = ((_tcslen(src) + 1) * sizeof(TCHAR)) to + hold all of the source including the null terminator + + pszSrc - source string + + cbSrc - maximum number of bytes to copy from source string, + not including the null terminator. + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL. See StringCbCopyEx if you require + the handling of NULL values. + +Return Value: + + S_OK - if there was source data and it was all copied and the + resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the copy + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function. + +--*/ + +STRSAFEAPI StringCbCopyNA(char* pszDest, size_t cbDest, const char* pszSrc, size_t cbSrc); +STRSAFEAPI StringCbCopyNW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc, size_t cbSrc); +#ifdef UNICODE +#define StringCbCopyN StringCbCopyNW +#else +#define StringCbCopyN StringCbCopyNA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCbCopyNA(char* pszDest, size_t cbDest, const char* pszSrc, size_t cbSrc) +{ + HRESULT hr; + size_t cchDest; + size_t cchSrc; + + // convert to count of characters + cchDest = cbDest / sizeof(char); + cchSrc = cbSrc / sizeof(char); + + if ((cchDest > STRSAFE_MAX_CCH) || + (cchSrc > STRSAFE_MAX_CCH)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCopyNWorkerA(pszDest, cchDest, pszSrc, cchSrc); + } + + return hr; +} + +STRSAFEAPI StringCbCopyNW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc, size_t cbSrc) +{ + HRESULT hr; + size_t cchDest; + size_t cchSrc; + + // convert to count of characters + cchDest = cbDest / sizeof(wchar_t); + cchSrc = cbSrc / sizeof(wchar_t); + + if ((cchDest > STRSAFE_MAX_CCH) || + (cchSrc > STRSAFE_MAX_CCH)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCopyNWorkerW(pszDest, cchDest, pszSrc, cchSrc); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CB_FUNCTIONS + + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchCopyNEx( + OUT LPTSTR pszDest OPTIONAL, + IN size_t cchDest, + IN LPCTSTR pszSrc OPTIONAL, + IN size_t cchSrc, + OUT LPTSTR* ppszDestEnd OPTIONAL, + OUT size_t* pcchRemaining OPTIONAL, + IN DWORD dwFlags + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strncpy' with + some additional parameters. In addition to functionality provided by + StringCchCopyN, this routine also returns a pointer to the end of the + destination string and the number of characters left in the destination + string including the null terminator. The flags parameter allows + additional controls. + + This routine is meant as a replacement for strncpy, but it does behave + differently. This function will not pad the destination buffer with extra + null termination characters if cchSrc is greater than the length of pszSrc. + +Arguments: + + pszDest - destination string + + cchDest - size of destination buffer in characters. + length must be = (_tcslen(pszSrc) + 1) to hold all of + the source including the null terminator + + pszSrc - source string + + cchSrc - maximum number of characters to copy from the source + string + + ppszDestEnd - if ppszDestEnd is non-null, the function will return a + pointer to the end of the destination string. If the + function copied any data, the result will point to the + null termination character + + pcchRemaining - if pcchRemaining is non-null, the function will return the + number of characters left in the destination string, + including the null terminator + + dwFlags - controls some details of the string copy: + + STRSAFE_FILL_BEHIND_NULL + if the function succeeds, the low byte of dwFlags will be + used to fill the uninitialize part of destination buffer + behind the null terminator + + STRSAFE_IGNORE_NULLS + treat NULL string pointers like empty strings (TEXT("")). + this flag is useful for emulating functions like lstrcpy + + STRSAFE_FILL_ON_FAILURE + if the function fails, the low byte of dwFlags will be + used to fill all of the destination buffer, and it will + be null terminated. This will overwrite any truncated + string returned when the failure is + STRSAFE_E_INSUFFICIENT_BUFFER + + STRSAFE_NO_TRUNCATION / + STRSAFE_NULL_ON_FAILURE + if the function fails, the destination buffer will be set + to the empty string. This will overwrite any truncated string + returned when the failure is STRSAFE_E_INSUFFICIENT_BUFFER. + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag + is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc + may be NULL. An error may still be returned even though NULLS are ignored + due to insufficient space. + +Return Value: + + S_OK - if there was source data and it was all copied and the + resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the copy + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCchCopyNExA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +STRSAFEAPI StringCchCopyNExW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, size_t cchSrc, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +#ifdef UNICODE +#define StringCchCopyNEx StringCchCopyNExW +#else +#define StringCchCopyNEx StringCchCopyNExA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCchCopyNExA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr; + + if ((cchDest > STRSAFE_MAX_CCH) || + (cchSrc > STRSAFE_MAX_CCH)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + + // safe to multiply cchDest * sizeof(char) since cchDest < STRSAFE_MAX_CCH and sizeof(char) is 1 + cbDest = cchDest * sizeof(char); + + hr = StringCopyNExWorkerA(pszDest, cchDest, cbDest, pszSrc, cchSrc, ppszDestEnd, pcchRemaining, dwFlags); + } + + return hr; +} + +STRSAFEAPI StringCchCopyNExW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, size_t cchSrc, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr; + + if ((cchDest > STRSAFE_MAX_CCH) || + (cchSrc > STRSAFE_MAX_CCH)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + + // safe to multiply cchDest * sizeof(wchar_t) since cchDest < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + cbDest = cchDest * sizeof(wchar_t); + + hr = StringCopyNExWorkerW(pszDest, cchDest, cbDest, pszSrc, cchSrc, ppszDestEnd, pcchRemaining, dwFlags); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CCH_FUNCTIONS + + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbCopyNEx( + OUT LPTSTR pszDest OPTIONAL, + IN size_t cbDest, + IN LPCTSTR pszSrc OPTIONAL, + IN size_t cbSrc, + OUT LPTSTR* ppszDestEnd OPTIONAL, + OUT size_t* pcbRemaining OPTIONAL, + IN DWORD dwFlags + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strncpy' with + some additional parameters. In addition to functionality provided by + StringCbCopyN, this routine also returns a pointer to the end of the + destination string and the number of bytes left in the destination string + including the null terminator. The flags parameter allows additional controls. + + This routine is meant as a replacement for strncpy, but it does behave + differently. This function will not pad the destination buffer with extra + null termination characters if cbSrc is greater than the size of pszSrc. + +Arguments: + + pszDest - destination string + + cbDest - size of destination buffer in bytes. + length must be ((_tcslen(pszSrc) + 1) * sizeof(TCHAR)) to + hold all of the source including the null terminator + + pszSrc - source string + + cbSrc - maximum number of bytes to copy from source string + + ppszDestEnd - if ppszDestEnd is non-null, the function will return a + pointer to the end of the destination string. If the + function copied any data, the result will point to the + null termination character + + pcbRemaining - pcbRemaining is non-null,the function will return the + number of bytes left in the destination string, + including the null terminator + + dwFlags - controls some details of the string copy: + + STRSAFE_FILL_BEHIND_NULL + if the function succeeds, the low byte of dwFlags will be + used to fill the uninitialize part of destination buffer + behind the null terminator + + STRSAFE_IGNORE_NULLS + treat NULL string pointers like empty strings (TEXT("")). + this flag is useful for emulating functions like lstrcpy + + STRSAFE_FILL_ON_FAILURE + if the function fails, the low byte of dwFlags will be + used to fill all of the destination buffer, and it will + be null terminated. This will overwrite any truncated + string returned when the failure is + STRSAFE_E_INSUFFICIENT_BUFFER + + STRSAFE_NO_TRUNCATION / + STRSAFE_NULL_ON_FAILURE + if the function fails, the destination buffer will be set + to the empty string. This will overwrite any truncated string + returned when the failure is STRSAFE_E_INSUFFICIENT_BUFFER. + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag + is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc + may be NULL. An error may still be returned even though NULLS are ignored + due to insufficient space. + +Return Value: + + S_OK - if there was source data and it was all copied and the + resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the copy + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCbCopyNExA(char* pszDest, size_t cbDest, const char* pszSrc, size_t cbSrc, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags); +STRSAFEAPI StringCbCopyNExW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc, size_t cbSrc, wchar_t** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags); +#ifdef UNICODE +#define StringCbCopyNEx StringCbCopyNExW +#else +#define StringCbCopyNEx StringCbCopyNExA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCbCopyNExA(char* pszDest, size_t cbDest, const char* pszSrc, size_t cbSrc, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags) +{ + HRESULT hr; + size_t cchDest; + size_t cchSrc; + size_t cchRemaining = 0; + + cchDest = cbDest / sizeof(char); + cchSrc = cbSrc / sizeof(char); + + if ((cchDest > STRSAFE_MAX_CCH) || + (cchSrc > STRSAFE_MAX_CCH)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCopyNExWorkerA(pszDest, cchDest, cbDest, pszSrc, cchSrc, ppszDestEnd, &cchRemaining, dwFlags); + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (pcbRemaining) + { + // safe to multiply cchRemaining * sizeof(char) since cchRemaining < STRSAFE_MAX_CCH and sizeof(char) is 1 + *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); + } + } + + return hr; +} + +STRSAFEAPI StringCbCopyNExW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc, size_t cbSrc, wchar_t** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags) +{ + HRESULT hr; + size_t cchDest; + size_t cchSrc; + size_t cchRemaining = 0; + + cchDest = cbDest / sizeof(wchar_t); + cchSrc = cbSrc / sizeof(wchar_t); + + if ((cchDest > STRSAFE_MAX_CCH) || + (cchSrc > STRSAFE_MAX_CCH)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCopyNExWorkerW(pszDest, cchDest, cbDest, pszSrc, cchSrc, ppszDestEnd, &cchRemaining, dwFlags); + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (pcbRemaining) + { + // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + *pcbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); + } + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CB_FUNCTIONS + + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchCat( + IN OUT LPTSTR pszDest, + IN size_t cchDest, + IN LPCTSTR pszSrc + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strcat'. + The size of the destination buffer (in characters) is a parameter and this + function will not write past the end of this buffer and it will ALWAYS + null terminate the destination buffer (unless it is zero length). + + This function returns a hresult, and not a pointer. It returns + S_OK if the string was concatenated without truncation and null terminated, + otherwise it will return a failure code. In failure cases as much of pszSrc + will be appended to pszDest as possible, and pszDest will be null + terminated. + +Arguments: + + pszDest - destination string which must be null terminated + + cchDest - size of destination buffer in characters. + length must be = (_tcslen(pszDest) + _tcslen(pszSrc) + 1) + to hold all of the combine string plus the null + terminator + + pszSrc - source string which must be null terminated + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL. See StringCchCatEx if you require + the handling of NULL values. + +Return Value: + + S_OK - if there was source data and it was all concatenated and + the resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the operation + failed due to insufficient space. When this error occurs, + the destination buffer is modified to contain a truncated + version of the ideal result and is null terminated. This + is useful for situations where truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCchCatA(char* pszDest, size_t cchDest, const char* pszSrc); +STRSAFEAPI StringCchCatW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc); +#ifdef UNICODE +#define StringCchCat StringCchCatW +#else +#define StringCchCat StringCchCatA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCchCatA(char* pszDest, size_t cchDest, const char* pszSrc) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCatWorkerA(pszDest, cchDest, pszSrc); + } + + return hr; +} + +STRSAFEAPI StringCchCatW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCatWorkerW(pszDest, cchDest, pszSrc); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CCH_FUNCTIONS + + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbCat( + IN OUT LPTSTR pszDest, + IN size_t cbDest, + IN LPCTSTR pszSrc + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strcat'. + The size of the destination buffer (in bytes) is a parameter and this + function will not write past the end of this buffer and it will ALWAYS + null terminate the destination buffer (unless it is zero length). + + This function returns a hresult, and not a pointer. It returns + S_OK if the string was concatenated without truncation and null terminated, + otherwise it will return a failure code. In failure cases as much of pszSrc + will be appended to pszDest as possible, and pszDest will be null + terminated. + +Arguments: + + pszDest - destination string which must be null terminated + + cbDest - size of destination buffer in bytes. + length must be = ((_tcslen(pszDest) + _tcslen(pszSrc) + 1) * sizeof(TCHAR) + to hold all of the combine string plus the null + terminator + + pszSrc - source string which must be null terminated + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL. See StringCbCatEx if you require + the handling of NULL values. + +Return Value: + + S_OK - if there was source data and it was all concatenated and + the resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the operation + failed due to insufficient space. When this error occurs, + the destination buffer is modified to contain a truncated + version of the ideal result and is null terminated. This + is useful for situations where truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCbCatA(char* pszDest, size_t cbDest, const char* pszSrc); +STRSAFEAPI StringCbCatW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc); +#ifdef UNICODE +#define StringCbCat StringCbCatW +#else +#define StringCbCat StringCbCatA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCbCatA(char* pszDest, size_t cbDest, const char* pszSrc) +{ + HRESULT hr; + size_t cchDest; + + cchDest = cbDest / sizeof(char); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCatWorkerA(pszDest, cchDest, pszSrc); + } + + return hr; +} + +STRSAFEAPI StringCbCatW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc) +{ + HRESULT hr; + size_t cchDest; + + cchDest = cbDest / sizeof(wchar_t); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCatWorkerW(pszDest, cchDest, pszSrc); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CB_FUNCTIONS + + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchCatEx( + IN OUT LPTSTR pszDest OPTIONAL, + IN size_t cchDest, + IN LPCTSTR pszSrc OPTIONAL, + OUT LPTSTR* ppszDestEnd OPTIONAL, + OUT size_t* pcchRemaining OPTIONAL, + IN DWORD dwFlags + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strcat' with + some additional parameters. In addition to functionality provided by + StringCchCat, this routine also returns a pointer to the end of the + destination string and the number of characters left in the destination string + including the null terminator. The flags parameter allows additional controls. + +Arguments: + + pszDest - destination string which must be null terminated + + cchDest - size of destination buffer in characters + length must be (_tcslen(pszDest) + _tcslen(pszSrc) + 1) + to hold all of the combine string plus the null + terminator. + + pszSrc - source string which must be null terminated + + ppszDestEnd - if ppszDestEnd is non-null, the function will return a + pointer to the end of the destination string. If the + function appended any data, the result will point to the + null termination character + + pcchRemaining - if pcchRemaining is non-null, the function will return the + number of characters left in the destination string, + including the null terminator + + dwFlags - controls some details of the string copy: + + STRSAFE_FILL_BEHIND_NULL + if the function succeeds, the low byte of dwFlags will be + used to fill the uninitialize part of destination buffer + behind the null terminator + + STRSAFE_IGNORE_NULLS + treat NULL string pointers like empty strings (TEXT("")). + this flag is useful for emulating functions like lstrcat + + STRSAFE_FILL_ON_FAILURE + if the function fails, the low byte of dwFlags will be + used to fill all of the destination buffer, and it will + be null terminated. This will overwrite any pre-existing + or truncated string + + STRSAFE_NULL_ON_FAILURE + if the function fails, the destination buffer will be set + to the empty string. This will overwrite any pre-existing or + truncated string + + STRSAFE_NO_TRUNCATION + if the function returns STRSAFE_E_INSUFFICIENT_BUFFER, pszDest + will not contain a truncated string, it will remain unchanged. + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag + is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc + may be NULL. An error may still be returned even though NULLS are ignored + due to insufficient space. + +Return Value: + + S_OK - if there was source data and it was all concatenated and + the resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the operation + failed due to insufficient space. When this error + occurs, the destination buffer is modified to contain + a truncated version of the ideal result and is null + terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCchCatExA(char* pszDest, size_t cchDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +STRSAFEAPI StringCchCatExW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +#ifdef UNICODE +#define StringCchCatEx StringCchCatExW +#else +#define StringCchCatEx StringCchCatExA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCchCatExA(char* pszDest, size_t cchDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + + // safe to multiply cchDest * sizeof(char) since cchDest < STRSAFE_MAX_CCH and sizeof(char) is 1 + cbDest = cchDest * sizeof(char); + + hr = StringCatExWorkerA(pszDest, cchDest, cbDest, pszSrc, ppszDestEnd, pcchRemaining, dwFlags); + } + + return hr; +} + +STRSAFEAPI StringCchCatExW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + + // safe to multiply cchDest * sizeof(wchar_t) since cchDest < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + cbDest = cchDest * sizeof(wchar_t); + + hr = StringCatExWorkerW(pszDest, cchDest, cbDest, pszSrc, ppszDestEnd, pcchRemaining, dwFlags); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CCH_FUNCTIONS + + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbCatEx( + IN OUT LPTSTR pszDest OPTIONAL, + IN size_t cbDest, + IN LPCTSTR pszSrc OPTIONAL, + OUT LPTSTR* ppszDestEnd OPTIONAL, + OUT size_t* pcbRemaining OPTIONAL, + IN DWORD dwFlags + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strcat' with + some additional parameters. In addition to functionality provided by + StringCbCat, this routine also returns a pointer to the end of the + destination string and the number of bytes left in the destination string + including the null terminator. The flags parameter allows additional controls. + +Arguments: + + pszDest - destination string which must be null terminated + + cbDest - size of destination buffer in bytes. + length must be ((_tcslen(pszDest) + _tcslen(pszSrc) + 1) * sizeof(TCHAR) + to hold all of the combine string plus the null + terminator. + + pszSrc - source string which must be null terminated + + ppszDestEnd - if ppszDestEnd is non-null, the function will return a + pointer to the end of the destination string. If the + function appended any data, the result will point to the + null termination character + + pcbRemaining - if pcbRemaining is non-null, the function will return + the number of bytes left in the destination string, + including the null terminator + + dwFlags - controls some details of the string copy: + + STRSAFE_FILL_BEHIND_NULL + if the function succeeds, the low byte of dwFlags will be + used to fill the uninitialize part of destination buffer + behind the null terminator + + STRSAFE_IGNORE_NULLS + treat NULL string pointers like empty strings (TEXT("")). + this flag is useful for emulating functions like lstrcat + + STRSAFE_FILL_ON_FAILURE + if the function fails, the low byte of dwFlags will be + used to fill all of the destination buffer, and it will + be null terminated. This will overwrite any pre-existing + or truncated string + + STRSAFE_NULL_ON_FAILURE + if the function fails, the destination buffer will be set + to the empty string. This will overwrite any pre-existing or + truncated string + + STRSAFE_NO_TRUNCATION + if the function returns STRSAFE_E_INSUFFICIENT_BUFFER, pszDest + will not contain a truncated string, it will remain unchanged. + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag + is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc + may be NULL. An error may still be returned even though NULLS are ignored + due to insufficient space. + +Return Value: + + S_OK - if there was source data and it was all concatenated + and the resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the operation + failed due to insufficient space. When this error + occurs, the destination buffer is modified to contain + a truncated version of the ideal result and is null + terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCbCatExA(char* pszDest, size_t cbDest, const char* pszSrc, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags); +STRSAFEAPI StringCbCatExW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc, wchar_t** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags); +#ifdef UNICODE +#define StringCbCatEx StringCbCatExW +#else +#define StringCbCatEx StringCbCatExA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCbCatExA(char* pszDest, size_t cbDest, const char* pszSrc, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags) +{ + HRESULT hr; + size_t cchDest; + size_t cchRemaining = 0; + + cchDest = cbDest / sizeof(char); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCatExWorkerA(pszDest, cchDest, cbDest, pszSrc, ppszDestEnd, &cchRemaining, dwFlags); + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (pcbRemaining) + { + // safe to multiply cchRemaining * sizeof(char) since cchRemaining < STRSAFE_MAX_CCH and sizeof(char) is 1 + *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); + } + } + + return hr; +} + +STRSAFEAPI StringCbCatExW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc, wchar_t** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags) +{ + HRESULT hr; + size_t cchDest; + size_t cchRemaining = 0; + + cchDest = cbDest / sizeof(wchar_t); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCatExWorkerW(pszDest, cchDest, cbDest, pszSrc, ppszDestEnd, &cchRemaining, dwFlags); + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (pcbRemaining) + { + // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + *pcbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); + } + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CB_FUNCTIONS + + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchCatN( + IN OUT LPTSTR pszDest, + IN size_t cchDest, + IN LPCTSTR pszSrc, + IN size_t cchMaxAppend + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strncat'. + The size of the destination buffer (in characters) is a parameter as well as + the maximum number of characters to append, excluding the null terminator. + This function will not write past the end of the destination buffer and it will + ALWAYS null terminate pszDest (unless it is zero length). + + This function returns a hresult, and not a pointer. It returns + S_OK if all of pszSrc or the first cchMaxAppend characters were appended + to the destination string and it was null terminated, otherwise it will + return a failure code. In failure cases as much of pszSrc will be appended + to pszDest as possible, and pszDest will be null terminated. + +Arguments: + + pszDest - destination string which must be null terminated + + cchDest - size of destination buffer in characters. + length must be (_tcslen(pszDest) + min(cchMaxAppend, _tcslen(pszSrc)) + 1) + to hold all of the combine string plus the null + terminator. + + pszSrc - source string + + cchMaxAppend - maximum number of characters to append + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL. See StringCchCatNEx if you require + the handling of NULL values. + +Return Value: + + S_OK - if all of pszSrc or the first cchMaxAppend characters + were concatenated to pszDest and the resultant dest + string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the operation + failed due to insufficient space. When this error + occurs, the destination buffer is modified to contain + a truncated version of the ideal result and is null + terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCchCatNA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchMaxAppend); +STRSAFEAPI StringCchCatNW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, size_t cchMaxAppend); +#ifdef UNICODE +#define StringCchCatN StringCchCatNW +#else +#define StringCchCatN StringCchCatNA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCchCatNA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchMaxAppend) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCatNWorkerA(pszDest, cchDest, pszSrc, cchMaxAppend); + } + + return hr; +} + +STRSAFEAPI StringCchCatNW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, size_t cchMaxAppend) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringCatNWorkerW(pszDest, cchDest, pszSrc, cchMaxAppend); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CCH_FUNCTIONS + + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbCatN( + IN OUT LPTSTR pszDest, + IN size_t cbDest, + IN LPCTSTR pszSrc, + IN size_t cbMaxAppend + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strncat'. + The size of the destination buffer (in bytes) is a parameter as well as + the maximum number of bytes to append, excluding the null terminator. + This function will not write past the end of the destination buffer and it will + ALWAYS null terminate pszDest (unless it is zero length). + + This function returns a hresult, and not a pointer. It returns + S_OK if all of pszSrc or the first cbMaxAppend bytes were appended + to the destination string and it was null terminated, otherwise it will + return a failure code. In failure cases as much of pszSrc will be appended + to pszDest as possible, and pszDest will be null terminated. + +Arguments: + + pszDest - destination string which must be null terminated + + cbDest - size of destination buffer in bytes. + length must be ((_tcslen(pszDest) + min(cbMaxAppend / sizeof(TCHAR), _tcslen(pszSrc)) + 1) * sizeof(TCHAR) + to hold all of the combine string plus the null + terminator. + + pszSrc - source string + + cbMaxAppend - maximum number of bytes to append + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL. See StringCbCatNEx if you require + the handling of NULL values. + +Return Value: + + S_OK - if all of pszSrc or the first cbMaxAppend bytes were + concatenated to pszDest and the resultant dest string + was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the operation + failed due to insufficient space. When this error + occurs, the destination buffer is modified to contain + a truncated version of the ideal result and is null + terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCbCatNA(char* pszDest, size_t cbDest, const char* pszSrc, size_t cbMaxAppend); +STRSAFEAPI StringCbCatNW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc, size_t cbMaxAppend); +#ifdef UNICODE +#define StringCbCatN StringCbCatNW +#else +#define StringCbCatN StringCbCatNA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCbCatNA(char* pszDest, size_t cbDest, const char* pszSrc, size_t cbMaxAppend) +{ + HRESULT hr; + size_t cchDest; + + cchDest = cbDest / sizeof(char); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cchMaxAppend; + + cchMaxAppend = cbMaxAppend / sizeof(char); + + hr = StringCatNWorkerA(pszDest, cchDest, pszSrc, cchMaxAppend); + } + + return hr; +} + +STRSAFEAPI StringCbCatNW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc, size_t cbMaxAppend) +{ + HRESULT hr; + size_t cchDest; + + cchDest = cbDest / sizeof(wchar_t); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cchMaxAppend; + + cchMaxAppend = cbMaxAppend / sizeof(wchar_t); + + hr = StringCatNWorkerW(pszDest, cchDest, pszSrc, cchMaxAppend); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CB_FUNCTIONS + + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchCatNEx( + IN OUT LPTSTR pszDest OPTIONAL, + IN size_t cchDest, + IN LPCTSTR pszSrc OPTIONAL, + IN size_t cchMaxAppend, + OUT LPTSTR* ppszDestEnd OPTIONAL, + OUT size_t* pcchRemaining OPTIONAL, + IN DWORD dwFlags + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strncat', with + some additional parameters. In addition to functionality provided by + StringCchCatN, this routine also returns a pointer to the end of the + destination string and the number of characters left in the destination string + including the null terminator. The flags parameter allows additional controls. + +Arguments: + + pszDest - destination string which must be null terminated + + cchDest - size of destination buffer in characters. + length must be (_tcslen(pszDest) + min(cchMaxAppend, _tcslen(pszSrc)) + 1) + to hold all of the combine string plus the null + terminator. + + pszSrc - source string + + cchMaxAppend - maximum number of characters to append + + ppszDestEnd - if ppszDestEnd is non-null, the function will return a + pointer to the end of the destination string. If the + function appended any data, the result will point to the + null termination character + + pcchRemaining - if pcchRemaining is non-null, the function will return the + number of characters left in the destination string, + including the null terminator + + dwFlags - controls some details of the string copy: + + STRSAFE_FILL_BEHIND_NULL + if the function succeeds, the low byte of dwFlags will be + used to fill the uninitialize part of destination buffer + behind the null terminator + + STRSAFE_IGNORE_NULLS + treat NULL string pointers like empty strings (TEXT("")) + + STRSAFE_FILL_ON_FAILURE + if the function fails, the low byte of dwFlags will be + used to fill all of the destination buffer, and it will + be null terminated. This will overwrite any pre-existing + or truncated string + + STRSAFE_NULL_ON_FAILURE + if the function fails, the destination buffer will be set + to the empty string. This will overwrite any pre-existing or + truncated string + + STRSAFE_NO_TRUNCATION + if the function returns STRSAFE_E_INSUFFICIENT_BUFFER, pszDest + will not contain a truncated string, it will remain unchanged. + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag + is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc + may be NULL. An error may still be returned even though NULLS are ignored + due to insufficient space. + +Return Value: + + S_OK - if all of pszSrc or the first cchMaxAppend characters + were concatenated to pszDest and the resultant dest + string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the operation + failed due to insufficient space. When this error + occurs, the destination buffer is modified to contain + a truncated version of the ideal result and is null + terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCchCatNExA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchMaxAppend, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +STRSAFEAPI StringCchCatNExW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, size_t cchMaxAppend, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +#ifdef UNICODE +#define StringCchCatNEx StringCchCatNExW +#else +#define StringCchCatNEx StringCchCatNExA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCchCatNExA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchMaxAppend, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + + // safe to multiply cchDest * sizeof(char) since cchDest < STRSAFE_MAX_CCH and sizeof(char) is 1 + cbDest = cchDest * sizeof(char); + + hr = StringCatNExWorkerA(pszDest, cchDest, cbDest, pszSrc, cchMaxAppend, ppszDestEnd, pcchRemaining, dwFlags); + } + + return hr; +} + +STRSAFEAPI StringCchCatNExW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, size_t cchMaxAppend, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + + // safe to multiply cchDest * sizeof(wchar_t) since cchDest < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + cbDest = cchDest * sizeof(wchar_t); + + hr = StringCatNExWorkerW(pszDest, cchDest, cbDest, pszSrc, cchMaxAppend, ppszDestEnd, pcchRemaining, dwFlags); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CCH_FUNCTIONS + + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbCatNEx( + IN OUT LPTSTR pszDest OPTIONAL, + IN size_t cbDest, + IN LPCTSTR pszSrc OPTIONAL, + IN size_t cbMaxAppend, + OUT LPTSTR* ppszDestEnd OPTIONAL, + OUT size_t* pcchRemaining OPTIONAL, + IN DWORD dwFlags + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strncat', with + some additional parameters. In addition to functionality provided by + StringCbCatN, this routine also returns a pointer to the end of the + destination string and the number of bytes left in the destination string + including the null terminator. The flags parameter allows additional controls. + +Arguments: + + pszDest - destination string which must be null terminated + + cbDest - size of destination buffer in bytes. + length must be ((_tcslen(pszDest) + min(cbMaxAppend / sizeof(TCHAR), _tcslen(pszSrc)) + 1) * sizeof(TCHAR) + to hold all of the combine string plus the null + terminator. + + pszSrc - source string + + cbMaxAppend - maximum number of bytes to append + + ppszDestEnd - if ppszDestEnd is non-null, the function will return a + pointer to the end of the destination string. If the + function appended any data, the result will point to the + null termination character + + pcbRemaining - if pcbRemaining is non-null, the function will return the + number of bytes left in the destination string, + including the null terminator + + dwFlags - controls some details of the string copy: + + STRSAFE_FILL_BEHIND_NULL + if the function succeeds, the low byte of dwFlags will be + used to fill the uninitialize part of destination buffer + behind the null terminator + + STRSAFE_IGNORE_NULLS + treat NULL string pointers like empty strings (TEXT("")) + + STRSAFE_FILL_ON_FAILURE + if the function fails, the low byte of dwFlags will be + used to fill all of the destination buffer, and it will + be null terminated. This will overwrite any pre-existing + or truncated string + + STRSAFE_NULL_ON_FAILURE + if the function fails, the destination buffer will be set + to the empty string. This will overwrite any pre-existing or + truncated string + + STRSAFE_NO_TRUNCATION + if the function returns STRSAFE_E_INSUFFICIENT_BUFFER, pszDest + will not contain a truncated string, it will remain unchanged. + +Notes: + Behavior is undefined if source and destination strings overlap. + + pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag + is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc + may be NULL. An error may still be returned even though NULLS are ignored + due to insufficient space. + +Return Value: + + S_OK - if all of pszSrc or the first cbMaxAppend bytes were + concatenated to pszDest and the resultant dest string + was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the operation + failed due to insufficient space. When this error + occurs, the destination buffer is modified to contain + a truncated version of the ideal result and is null + terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCbCatNExA(char* pszDest, size_t cbDest, const char* pszSrc, size_t cbMaxAppend, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags); +STRSAFEAPI StringCbCatNExW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc, size_t cbMaxAppend, wchar_t** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags); +#ifdef UNICODE +#define StringCbCatNEx StringCbCatNExW +#else +#define StringCbCatNEx StringCbCatNExA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCbCatNExA(char* pszDest, size_t cbDest, const char* pszSrc, size_t cbMaxAppend, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags) +{ + HRESULT hr; + size_t cchDest; + size_t cchRemaining = 0; + + cchDest = cbDest / sizeof(char); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cchMaxAppend; + + cchMaxAppend = cbMaxAppend / sizeof(char); + + hr = StringCatNExWorkerA(pszDest, cchDest, cbDest, pszSrc, cchMaxAppend, ppszDestEnd, &cchRemaining, dwFlags); + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (pcbRemaining) + { + // safe to multiply cchRemaining * sizeof(char) since cchRemaining < STRSAFE_MAX_CCH and sizeof(char) is 1 + *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); + } + } + + return hr; +} + +STRSAFEAPI StringCbCatNExW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszSrc, size_t cbMaxAppend, wchar_t** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags) +{ + HRESULT hr; + size_t cchDest; + size_t cchRemaining = 0; + + cchDest = cbDest / sizeof(wchar_t); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cchMaxAppend; + + cchMaxAppend = cbMaxAppend / sizeof(wchar_t); + + hr = StringCatNExWorkerW(pszDest, cchDest, cbDest, pszSrc, cchMaxAppend, ppszDestEnd, &cchRemaining, dwFlags); + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (pcbRemaining) + { + // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + *pcbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); + } + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CB_FUNCTIONS + + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchVPrintf( + OUT LPTSTR pszDest, + IN size_t cchDest, + IN LPCTSTR pszFormat, + IN va_list argList + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'vsprintf'. + The size of the destination buffer (in characters) is a parameter and + this function will not write past the end of this buffer and it will + ALWAYS null terminate the destination buffer (unless it is zero length). + + This function returns a hresult, and not a pointer. It returns + S_OK if the string was printed without truncation and null terminated, + otherwise it will return a failure code. In failure cases it will return + a truncated version of the ideal result. + +Arguments: + + pszDest - destination string + + cchDest - size of destination buffer in characters + length must be sufficient to hold the resulting formatted + string, including the null terminator. + + pszFormat - format string which must be null terminated + + argList - va_list from the variable arguments according to the + stdarg.h convention + +Notes: + Behavior is undefined if destination, format strings or any arguments + strings overlap. + + pszDest and pszFormat should not be NULL. See StringCchVPrintfEx if you + require the handling of NULL values. + +Return Value: + + S_OK - if there was sufficient space in the dest buffer for + the resultant string and it was null terminated. + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the print + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCchVPrintfA(char* pszDest, size_t cchDest, const char* pszFormat, va_list argList); +STRSAFEAPI StringCchVPrintfW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszFormat, va_list argList); +#ifdef UNICODE +#define StringCchVPrintf StringCchVPrintfW +#else +#define StringCchVPrintf StringCchVPrintfA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCchVPrintfA(char* pszDest, size_t cchDest, const char* pszFormat, va_list argList) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringVPrintfWorkerA(pszDest, cchDest, pszFormat, argList); + } + + return hr; +} + +STRSAFEAPI StringCchVPrintfW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszFormat, va_list argList) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringVPrintfWorkerW(pszDest, cchDest, pszFormat, argList); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CCH_FUNCTIONS + + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbVPrintf( + OUT LPTSTR pszDest, + IN size_t cbDest, + IN LPCTSTR pszFormat, + IN va_list argList + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'vsprintf'. + The size of the destination buffer (in bytes) is a parameter and + this function will not write past the end of this buffer and it will + ALWAYS null terminate the destination buffer (unless it is zero length). + + This function returns a hresult, and not a pointer. It returns + S_OK if the string was printed without truncation and null terminated, + otherwise it will return a failure code. In failure cases it will return + a truncated version of the ideal result. + +Arguments: + + pszDest - destination string + + cbDest - size of destination buffer in bytes + length must be sufficient to hold the resulting formatted + string, including the null terminator. + + pszFormat - format string which must be null terminated + + argList - va_list from the variable arguments according to the + stdarg.h convention + +Notes: + Behavior is undefined if destination, format strings or any arguments + strings overlap. + + pszDest and pszFormat should not be NULL. See StringCbVPrintfEx if you + require the handling of NULL values. + + +Return Value: + + S_OK - if there was sufficient space in the dest buffer for + the resultant string and it was null terminated. + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the print + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCbVPrintfA(char* pszDest, size_t cbDest, const char* pszFormat, va_list argList); +STRSAFEAPI StringCbVPrintfW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszFormat, va_list argList); +#ifdef UNICODE +#define StringCbVPrintf StringCbVPrintfW +#else +#define StringCbVPrintf StringCbVPrintfA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCbVPrintfA(char* pszDest, size_t cbDest, const char* pszFormat, va_list argList) +{ + HRESULT hr; + size_t cchDest; + + cchDest = cbDest / sizeof(char); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringVPrintfWorkerA(pszDest, cchDest, pszFormat, argList); + } + + return hr; +} + +STRSAFEAPI StringCbVPrintfW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszFormat, va_list argList) +{ + HRESULT hr; + size_t cchDest; + + cchDest = cbDest / sizeof(wchar_t); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringVPrintfWorkerW(pszDest, cchDest, pszFormat, argList); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CB_FUNCTIONS + + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchPrintf( + OUT LPTSTR pszDest, + IN size_t cchDest, + IN LPCTSTR pszFormat, + ... + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'sprintf'. + The size of the destination buffer (in characters) is a parameter and + this function will not write past the end of this buffer and it will + ALWAYS null terminate the destination buffer (unless it is zero length). + + This function returns a hresult, and not a pointer. It returns + S_OK if the string was printed without truncation and null terminated, + otherwise it will return a failure code. In failure cases it will return + a truncated version of the ideal result. + +Arguments: + + pszDest - destination string + + cchDest - size of destination buffer in characters + length must be sufficient to hold the resulting formatted + string, including the null terminator. + + pszFormat - format string which must be null terminated + + ... - additional parameters to be formatted according to + the format string + +Notes: + Behavior is undefined if destination, format strings or any arguments + strings overlap. + + pszDest and pszFormat should not be NULL. See StringCchPrintfEx if you + require the handling of NULL values. + +Return Value: + + S_OK - if there was sufficient space in the dest buffer for + the resultant string and it was null terminated. + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the print + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCchPrintfA(char* pszDest, size_t cchDest, const char* pszFormat, ...); +STRSAFEAPI StringCchPrintfW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszFormat, ...); +#ifdef UNICODE +#define StringCchPrintf StringCchPrintfW +#else +#define StringCchPrintf StringCchPrintfA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCchPrintfA(char* pszDest, size_t cchDest, const char* pszFormat, ...) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + va_list argList; + + va_start(argList, pszFormat); + + hr = StringVPrintfWorkerA(pszDest, cchDest, pszFormat, argList); + + va_end(argList); + } + + return hr; +} + +STRSAFEAPI StringCchPrintfW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszFormat, ...) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + va_list argList; + + va_start(argList, pszFormat); + + hr = StringVPrintfWorkerW(pszDest, cchDest, pszFormat, argList); + + va_end(argList); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CCH_FUNCTIONS + + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbPrintf( + OUT LPTSTR pszDest, + IN size_t cbDest, + IN LPCTSTR pszFormat, + ... + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'sprintf'. + The size of the destination buffer (in bytes) is a parameter and + this function will not write past the end of this buffer and it will + ALWAYS null terminate the destination buffer (unless it is zero length). + + This function returns a hresult, and not a pointer. It returns + S_OK if the string was printed without truncation and null terminated, + otherwise it will return a failure code. In failure cases it will return + a truncated version of the ideal result. + +Arguments: + + pszDest - destination string + + cbDest - size of destination buffer in bytes + length must be sufficient to hold the resulting formatted + string, including the null terminator. + + pszFormat - format string which must be null terminated + + ... - additional parameters to be formatted according to + the format string + +Notes: + Behavior is undefined if destination, format strings or any arguments + strings overlap. + + pszDest and pszFormat should not be NULL. See StringCbPrintfEx if you + require the handling of NULL values. + + +Return Value: + + S_OK - if there was sufficient space in the dest buffer for + the resultant string and it was null terminated. + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the print + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCbPrintfA(char* pszDest, size_t cbDest, const char* pszFormat, ...); +STRSAFEAPI StringCbPrintfW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszFormat, ...); +#ifdef UNICODE +#define StringCbPrintf StringCbPrintfW +#else +#define StringCbPrintf StringCbPrintfA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCbPrintfA(char* pszDest, size_t cbDest, const char* pszFormat, ...) +{ + HRESULT hr; + size_t cchDest; + + cchDest = cbDest / sizeof(char); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + va_list argList; + + va_start(argList, pszFormat); + + hr = StringVPrintfWorkerA(pszDest, cchDest, pszFormat, argList); + + va_end(argList); + } + + return hr; +} + +STRSAFEAPI StringCbPrintfW(wchar_t* pszDest, size_t cbDest, const wchar_t* pszFormat, ...) +{ + HRESULT hr; + size_t cchDest; + + cchDest = cbDest / sizeof(wchar_t); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + va_list argList; + + va_start(argList, pszFormat); + + hr = StringVPrintfWorkerW(pszDest, cchDest, pszFormat, argList); + + va_end(argList); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CB_FUNCTIONS + + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchPrintfEx( + OUT LPTSTR pszDest OPTIONAL, + IN size_t cchDest, + OUT LPTSTR* ppszDestEnd OPTIONAL, + OUT size_t* pcchRemaining OPTIONAL, + IN DWORD dwFlags, + IN LPCTSTR pszFormat OPTIONAL, + ... + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'sprintf' with + some additional parameters. In addition to functionality provided by + StringCchPrintf, this routine also returns a pointer to the end of the + destination string and the number of characters left in the destination string + including the null terminator. The flags parameter allows additional controls. + +Arguments: + + pszDest - destination string + + cchDest - size of destination buffer in characters. + length must be sufficient to contain the resulting + formatted string plus the null terminator. + + ppszDestEnd - if ppszDestEnd is non-null, the function will return a + pointer to the end of the destination string. If the + function printed any data, the result will point to the + null termination character + + pcchRemaining - if pcchRemaining is non-null, the function will return + the number of characters left in the destination string, + including the null terminator + + dwFlags - controls some details of the string copy: + + STRSAFE_FILL_BEHIND_NULL + if the function succeeds, the low byte of dwFlags will be + used to fill the uninitialize part of destination buffer + behind the null terminator + + STRSAFE_IGNORE_NULLS + treat NULL string pointers like empty strings (TEXT("")) + + STRSAFE_FILL_ON_FAILURE + if the function fails, the low byte of dwFlags will be + used to fill all of the destination buffer, and it will + be null terminated. This will overwrite any truncated + string returned when the failure is + STRSAFE_E_INSUFFICIENT_BUFFER + + STRSAFE_NO_TRUNCATION / + STRSAFE_NULL_ON_FAILURE + if the function fails, the destination buffer will be set + to the empty string. This will overwrite any truncated string + returned when the failure is STRSAFE_E_INSUFFICIENT_BUFFER. + + pszFormat - format string which must be null terminated + + ... - additional parameters to be formatted according to + the format string + +Notes: + Behavior is undefined if destination, format strings or any arguments + strings overlap. + + pszDest and pszFormat should not be NULL unless the STRSAFE_IGNORE_NULLS + flag is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and + pszFormat may be NULL. An error may still be returned even though NULLS + are ignored due to insufficient space. + +Return Value: + + S_OK - if there was source data and it was all concatenated and + the resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the print + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCchPrintfExA(char* pszDest, size_t cchDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const char* pszFormat, ...); +STRSAFEAPI StringCchPrintfExW(wchar_t* pszDest, size_t cchDest, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const wchar_t* pszFormat, ...); +#ifdef UNICODE +#define StringCchPrintfEx StringCchPrintfExW +#else +#define StringCchPrintfEx StringCchPrintfExA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCchPrintfExA(char* pszDest, size_t cchDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const char* pszFormat, ...) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + va_list argList; + + // safe to multiply cchDest * sizeof(char) since cchDest < STRSAFE_MAX_CCH and sizeof(char) is 1 + cbDest = cchDest * sizeof(char); + va_start(argList, pszFormat); + + hr = StringVPrintfExWorkerA(pszDest, cchDest, cbDest, ppszDestEnd, pcchRemaining, dwFlags, pszFormat, argList); + + va_end(argList); + } + + return hr; +} + +STRSAFEAPI StringCchPrintfExW(wchar_t* pszDest, size_t cchDest, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const wchar_t* pszFormat, ...) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + va_list argList; + + // safe to multiply cchDest * sizeof(wchar_t) since cchDest < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + cbDest = cchDest * sizeof(wchar_t); + va_start(argList, pszFormat); + + hr = StringVPrintfExWorkerW(pszDest, cchDest, cbDest, ppszDestEnd, pcchRemaining, dwFlags, pszFormat, argList); + + va_end(argList); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CCH_FUNCTIONS + + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbPrintfEx( + OUT LPTSTR pszDest OPTIONAL, + IN size_t cbDest, + OUT LPTSTR* ppszDestEnd OPTIONAL, + OUT size_t* pcbRemaining OPTIONAL, + IN DWORD dwFlags, + IN LPCTSTR pszFormat OPTIONAL, + ... + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'sprintf' with + some additional parameters. In addition to functionality provided by + StringCbPrintf, this routine also returns a pointer to the end of the + destination string and the number of bytes left in the destination string + including the null terminator. The flags parameter allows additional controls. + +Arguments: + + pszDest - destination string + + cbDest - size of destination buffer in bytes. + length must be sufficient to contain the resulting + formatted string plus the null terminator. + + ppszDestEnd - if ppszDestEnd is non-null, the function will return a + pointer to the end of the destination string. If the + function printed any data, the result will point to the + null termination character + + pcbRemaining - if pcbRemaining is non-null, the function will return + the number of bytes left in the destination string, + including the null terminator + + dwFlags - controls some details of the string copy: + + STRSAFE_FILL_BEHIND_NULL + if the function succeeds, the low byte of dwFlags will be + used to fill the uninitialize part of destination buffer + behind the null terminator + + STRSAFE_IGNORE_NULLS + treat NULL string pointers like empty strings (TEXT("")) + + STRSAFE_FILL_ON_FAILURE + if the function fails, the low byte of dwFlags will be + used to fill all of the destination buffer, and it will + be null terminated. This will overwrite any truncated + string returned when the failure is + STRSAFE_E_INSUFFICIENT_BUFFER + + STRSAFE_NO_TRUNCATION / + STRSAFE_NULL_ON_FAILURE + if the function fails, the destination buffer will be set + to the empty string. This will overwrite any truncated string + returned when the failure is STRSAFE_E_INSUFFICIENT_BUFFER. + + pszFormat - format string which must be null terminated + + ... - additional parameters to be formatted according to + the format string + +Notes: + Behavior is undefined if destination, format strings or any arguments + strings overlap. + + pszDest and pszFormat should not be NULL unless the STRSAFE_IGNORE_NULLS + flag is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and + pszFormat may be NULL. An error may still be returned even though NULLS + are ignored due to insufficient space. + +Return Value: + + S_OK - if there was source data and it was all concatenated and + the resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the print + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCbPrintfExA(char* pszDest, size_t cbDest, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const char* pszFormat, ...); +STRSAFEAPI StringCbPrintfExW(wchar_t* pszDest, size_t cbDest, wchar_t** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const wchar_t* pszFormat, ...); +#ifdef UNICODE +#define StringCbPrintfEx StringCbPrintfExW +#else +#define StringCbPrintfEx StringCbPrintfExA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCbPrintfExA(char* pszDest, size_t cbDest, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const char* pszFormat, ...) +{ + HRESULT hr; + size_t cchDest; + size_t cchRemaining = 0; + + cchDest = cbDest / sizeof(char); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + va_list argList; + + va_start(argList, pszFormat); + + hr = StringVPrintfExWorkerA(pszDest, cchDest, cbDest, ppszDestEnd, &cchRemaining, dwFlags, pszFormat, argList); + + va_end(argList); + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (pcbRemaining) + { + // safe to multiply cchRemaining * sizeof(char) since cchRemaining < STRSAFE_MAX_CCH and sizeof(char) is 1 + *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); + } + } + + return hr; +} + +STRSAFEAPI StringCbPrintfExW(wchar_t* pszDest, size_t cbDest, wchar_t** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const wchar_t* pszFormat, ...) +{ + HRESULT hr; + size_t cchDest; + size_t cchRemaining = 0; + + cchDest = cbDest / sizeof(wchar_t); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + va_list argList; + + va_start(argList, pszFormat); + + hr = StringVPrintfExWorkerW(pszDest, cchDest, cbDest, ppszDestEnd, &cchRemaining, dwFlags, pszFormat, argList); + + va_end(argList); + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (pcbRemaining) + { + // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + *pcbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); + } + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CB_FUNCTIONS + + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchVPrintfEx( + OUT LPTSTR pszDest OPTIONAL, + IN size_t cchDest, + OUT LPTSTR* ppszDestEnd OPTIONAL, + OUT size_t* pcchRemaining OPTIONAL, + IN DWORD dwFlags, + IN LPCTSTR pszFormat OPTIONAL, + IN va_list argList + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'vsprintf' with + some additional parameters. In addition to functionality provided by + StringCchVPrintf, this routine also returns a pointer to the end of the + destination string and the number of characters left in the destination string + including the null terminator. The flags parameter allows additional controls. + +Arguments: + + pszDest - destination string + + cchDest - size of destination buffer in characters. + length must be sufficient to contain the resulting + formatted string plus the null terminator. + + ppszDestEnd - if ppszDestEnd is non-null, the function will return a + pointer to the end of the destination string. If the + function printed any data, the result will point to the + null termination character + + pcchRemaining - if pcchRemaining is non-null, the function will return + the number of characters left in the destination string, + including the null terminator + + dwFlags - controls some details of the string copy: + + STRSAFE_FILL_BEHIND_NULL + if the function succeeds, the low byte of dwFlags will be + used to fill the uninitialize part of destination buffer + behind the null terminator + + STRSAFE_IGNORE_NULLS + treat NULL string pointers like empty strings (TEXT("")) + + STRSAFE_FILL_ON_FAILURE + if the function fails, the low byte of dwFlags will be + used to fill all of the destination buffer, and it will + be null terminated. This will overwrite any truncated + string returned when the failure is + STRSAFE_E_INSUFFICIENT_BUFFER + + STRSAFE_NO_TRUNCATION / + STRSAFE_NULL_ON_FAILURE + if the function fails, the destination buffer will be set + to the empty string. This will overwrite any truncated string + returned when the failure is STRSAFE_E_INSUFFICIENT_BUFFER. + + pszFormat - format string which must be null terminated + + argList - va_list from the variable arguments according to the + stdarg.h convention + +Notes: + Behavior is undefined if destination, format strings or any arguments + strings overlap. + + pszDest and pszFormat should not be NULL unless the STRSAFE_IGNORE_NULLS + flag is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and + pszFormat may be NULL. An error may still be returned even though NULLS + are ignored due to insufficient space. + +Return Value: + + S_OK - if there was source data and it was all concatenated and + the resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the print + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCchVPrintfExA(char* pszDest, size_t cchDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const char* pszFormat, va_list argList); +STRSAFEAPI StringCchVPrintfExW(wchar_t* pszDest, size_t cchDest, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const wchar_t* pszFormat, va_list argList); +#ifdef UNICODE +#define StringCchVPrintfEx StringCchVPrintfExW +#else +#define StringCchVPrintfEx StringCchVPrintfExA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCchVPrintfExA(char* pszDest, size_t cchDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const char* pszFormat, va_list argList) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + + // safe to multiply cchDest * sizeof(char) since cchDest < STRSAFE_MAX_CCH and sizeof(char) is 1 + cbDest = cchDest * sizeof(char); + + hr = StringVPrintfExWorkerA(pszDest, cchDest, cbDest, ppszDestEnd, pcchRemaining, dwFlags, pszFormat, argList); + } + + return hr; +} + +STRSAFEAPI StringCchVPrintfExW(wchar_t* pszDest, size_t cchDest, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const wchar_t* pszFormat, va_list argList) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + + // safe to multiply cchDest * sizeof(wchar_t) since cchDest < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + cbDest = cchDest * sizeof(wchar_t); + + hr = StringVPrintfExWorkerW(pszDest, cchDest, cbDest, ppszDestEnd, pcchRemaining, dwFlags, pszFormat, argList); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CCH_FUNCTIONS + + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbVPrintfEx( + OUT LPTSTR pszDest OPTIONAL, + IN size_t cbDest, + OUT LPTSTR* ppszDestEnd OPTIONAL, + OUT size_t* pcbRemaining OPTIONAL, + IN DWORD dwFlags, + IN LPCTSTR pszFormat OPTIONAL, + IN va_list argList + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'vsprintf' with + some additional parameters. In addition to functionality provided by + StringCbVPrintf, this routine also returns a pointer to the end of the + destination string and the number of characters left in the destination string + including the null terminator. The flags parameter allows additional controls. + +Arguments: + + pszDest - destination string + + cbDest - size of destination buffer in bytes. + length must be sufficient to contain the resulting + formatted string plus the null terminator. + + ppszDestEnd - if ppszDestEnd is non-null, the function will return + a pointer to the end of the destination string. If the + function printed any data, the result will point to the + null termination character + + pcbRemaining - if pcbRemaining is non-null, the function will return + the number of bytes left in the destination string, + including the null terminator + + dwFlags - controls some details of the string copy: + + STRSAFE_FILL_BEHIND_NULL + if the function succeeds, the low byte of dwFlags will be + used to fill the uninitialize part of destination buffer + behind the null terminator + + STRSAFE_IGNORE_NULLS + treat NULL string pointers like empty strings (TEXT("")) + + STRSAFE_FILL_ON_FAILURE + if the function fails, the low byte of dwFlags will be + used to fill all of the destination buffer, and it will + be null terminated. This will overwrite any truncated + string returned when the failure is + STRSAFE_E_INSUFFICIENT_BUFFER + + STRSAFE_NO_TRUNCATION / + STRSAFE_NULL_ON_FAILURE + if the function fails, the destination buffer will be set + to the empty string. This will overwrite any truncated string + returned when the failure is STRSAFE_E_INSUFFICIENT_BUFFER. + + pszFormat - format string which must be null terminated + + argList - va_list from the variable arguments according to the + stdarg.h convention + +Notes: + Behavior is undefined if destination, format strings or any arguments + strings overlap. + + pszDest and pszFormat should not be NULL unless the STRSAFE_IGNORE_NULLS + flag is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and + pszFormat may be NULL. An error may still be returned even though NULLS + are ignored due to insufficient space. + +Return Value: + + S_OK - if there was source data and it was all concatenated and + the resultant dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that the print + operation failed due to insufficient space. When this + error occurs, the destination buffer is modified to + contain a truncated version of the ideal result and is + null terminated. This is useful for situations where + truncation is ok. + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function + +--*/ + +STRSAFEAPI StringCbVPrintfExA(char* pszDest, size_t cbDest, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const char* pszFormat, va_list argList); +STRSAFEAPI StringCbVPrintfExW(wchar_t* pszDest, size_t cbDest, wchar_t** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const wchar_t* pszFormat, va_list argList); +#ifdef UNICODE +#define StringCbVPrintfEx StringCbVPrintfExW +#else +#define StringCbVPrintfEx StringCbVPrintfExA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCbVPrintfExA(char* pszDest, size_t cbDest, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const char* pszFormat, va_list argList) +{ + HRESULT hr; + size_t cchDest; + size_t cchRemaining = 0; + + cchDest = cbDest / sizeof(char); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringVPrintfExWorkerA(pszDest, cchDest, cbDest, ppszDestEnd, &cchRemaining, dwFlags, pszFormat, argList); + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (pcbRemaining) + { + // safe to multiply cchRemaining * sizeof(char) since cchRemaining < STRSAFE_MAX_CCH and sizeof(char) is 1 + *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); + } + } + + return hr; +} + +STRSAFEAPI StringCbVPrintfExW(wchar_t* pszDest, size_t cbDest, wchar_t** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const wchar_t* pszFormat, va_list argList) +{ + HRESULT hr; + size_t cchDest; + size_t cchRemaining = 0; + + cchDest = cbDest / sizeof(wchar_t); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringVPrintfExWorkerW(pszDest, cchDest, cbDest, ppszDestEnd, &cchRemaining, dwFlags, pszFormat, argList); + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (pcbRemaining) + { + // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + *pcbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); + } + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CB_FUNCTIONS + + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchGets( + OUT LPTSTR pszDest, + IN size_t cchDest + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'gets'. + The size of the destination buffer (in characters) is a parameter and + this function will not write past the end of this buffer and it will + ALWAYS null terminate the destination buffer (unless it is zero length). + + This routine is not a replacement for fgets. That function does not replace + newline characters with a null terminator. + + This function returns a hresult, and not a pointer. It returns + S_OK if any characters were read from stdin and copied to pszDest and + pszDest was null terminated, otherwise it will return a failure code. + +Arguments: + + pszDest - destination string + + cchDest - size of destination buffer in characters. + +Notes: + pszDest should not be NULL. See StringCchGetsEx if you require the handling + of NULL values. + + cchDest must be > 1 for this function to succeed. + +Return Value: + + S_OK - data was read from stdin and copied, and the resultant + dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_END_OF_FILE / + HRESULT_CODE(hr) == ERROR_HANDLE_EOF + - this return value indicates an error or end-of-file + condition, use feof or ferror to determine which one has + occured. + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that there was + insufficient space in the destination buffer to copy any + data + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function. + +--*/ + +#ifndef STRSAFE_LIB_IMPL +STRSAFE_INLINE_API StringCchGetsA(char* pszDest, size_t cchDest); +STRSAFE_INLINE_API StringCchGetsW(wchar_t* pszDest, size_t cchDest); +#ifdef UNICODE +#define StringCchGets StringCchGetsW +#else +#define StringCchGets StringCchGetsA +#endif // !UNICODE + +STRSAFE_INLINE_API StringCchGetsA(char* pszDest, size_t cchDest) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + + // safe to multiply cchDest * sizeof(char) since cchDest < STRSAFE_MAX_CCH and sizeof(char) is 1 + cbDest = cchDest * sizeof(char); + + hr = StringGetsExWorkerA(pszDest, cchDest, cbDest, NULL, NULL, 0); + } + + return hr; +} + +STRSAFE_INLINE_API StringCchGetsW(wchar_t* pszDest, size_t cchDest) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + + // safe to multiply cchDest * sizeof(wchar_t) since cchDest < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + cbDest = cchDest * sizeof(wchar_t); + + hr = StringGetsExWorkerW(pszDest, cchDest, cbDest, NULL, NULL, 0); + } + + return hr; +} +#endif // !STRSAFE_NO_CCH_FUNCTIONS +#endif // !STRSAFE_LIB_IMPL + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbGets( + OUT LPTSTR pszDest, + IN size_t cbDest + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'gets'. + The size of the destination buffer (in bytes) is a parameter and + this function will not write past the end of this buffer and it will + ALWAYS null terminate the destination buffer (unless it is zero length). + + This routine is not a replacement for fgets. That function does not replace + newline characters with a null terminator. + + This function returns a hresult, and not a pointer. It returns + S_OK if any characters were read from stdin and copied to pszDest + and pszDest was null terminated, otherwise it will return a failure code. + +Arguments: + + pszDest - destination string + + cbDest - size of destination buffer in bytes. + +Notes: + pszDest should not be NULL. See StringCbGetsEx if you require the handling + of NULL values. + + cbDest must be > sizeof(TCHAR) for this function to succeed. + +Return Value: + + S_OK - data was read from stdin and copied, and the resultant + dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_END_OF_FILE / + HRESULT_CODE(hr) == ERROR_HANDLE_EOF + - this return value indicates an error or end-of-file + condition, use feof or ferror to determine which one has + occured. + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that there was + insufficient space in the destination buffer to copy any + data + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function. + +--*/ + +#ifndef STRSAFE_LIB_IMPL +STRSAFE_INLINE_API StringCbGetsA(char* pszDest, size_t cbDest); +STRSAFE_INLINE_API StringCbGetsW(wchar_t* pszDest, size_t cbDest); +#ifdef UNICODE +#define StringCbGets StringCbGetsW +#else +#define StringCbGets StringCbGetsA +#endif // !UNICODE + +STRSAFE_INLINE_API StringCbGetsA(char* pszDest, size_t cbDest) +{ + HRESULT hr; + size_t cchDest; + + // convert to count of characters + cchDest = cbDest / sizeof(char); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringGetsExWorkerA(pszDest, cchDest, cbDest, NULL, NULL, 0); + } + + return hr; +} + +STRSAFE_INLINE_API StringCbGetsW(wchar_t* pszDest, size_t cbDest) +{ + HRESULT hr; + size_t cchDest; + + // convert to count of characters + cchDest = cbDest / sizeof(wchar_t); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringGetsExWorkerW(pszDest, cchDest, cbDest, NULL, NULL, 0); + } + + return hr; +} +#endif // !STRSAFE_NO_CB_FUNCTIONS +#endif // !STRSAFE_LIB_IMPL + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchGetsEx( + OUT LPTSTR pszDest OPTIONAL, + IN size_t cchDest, + OUT LPTSTR* ppszDestEnd OPTIONAL, + OUT size_t* pcchRemaining OPTIONAL, + IN DWORD dwFlags + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'gets' with + some additional parameters. In addition to functionality provided by + StringCchGets, this routine also returns a pointer to the end of the + destination string and the number of characters left in the destination string + including the null terminator. The flags parameter allows additional controls. + +Arguments: + + pszDest - destination string + + cchDest - size of destination buffer in characters. + + ppszDestEnd - if ppszDestEnd is non-null, the function will return a + pointer to the end of the destination string. If the + function copied any data, the result will point to the + null termination character + + pcchRemaining - if pcchRemaining is non-null, the function will return the + number of characters left in the destination string, + including the null terminator + + dwFlags - controls some details of the string copy: + + STRSAFE_FILL_BEHIND_NULL + if the function succeeds, the low byte of dwFlags will be + used to fill the uninitialize part of destination buffer + behind the null terminator + + STRSAFE_IGNORE_NULLS + treat NULL string pointers like empty strings (TEXT("")). + + STRSAFE_FILL_ON_FAILURE + if the function fails, the low byte of dwFlags will be + used to fill all of the destination buffer, and it will + be null terminated. + + STRSAFE_NO_TRUNCATION / + STRSAFE_NULL_ON_FAILURE + if the function fails, the destination buffer will be set + to the empty string. + +Notes: + pszDest should not be NULL unless the STRSAFE_IGNORE_NULLS flag is specified. + If STRSAFE_IGNORE_NULLS is passed and pszDest is NULL, an error may still be + returned even though NULLS are ignored + + cchDest must be > 1 for this function to succeed. + +Return Value: + + S_OK - data was read from stdin and copied, and the resultant + dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_END_OF_FILE / + HRESULT_CODE(hr) == ERROR_HANDLE_EOF + - this return value indicates an error or end-of-file + condition, use feof or ferror to determine which one has + occured. + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that there was + insufficient space in the destination buffer to copy any + data + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function. + +--*/ + +#ifndef STRSAFE_LIB_IMPL +STRSAFE_INLINE_API StringCchGetsExA(char* pszDest, size_t cchDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +STRSAFE_INLINE_API StringCchGetsExW(wchar_t* pszDest, size_t cchDest, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); +#ifdef UNICODE +#define StringCchGetsEx StringCchGetsExW +#else +#define StringCchGetsEx StringCchGetsExA +#endif // !UNICODE + +STRSAFE_INLINE_API StringCchGetsExA(char* pszDest, size_t cchDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + + // safe to multiply cchDest * sizeof(char) since cchDest < STRSAFE_MAX_CCH and sizeof(char) is 1 + cbDest = cchDest * sizeof(char); + + hr = StringGetsExWorkerA(pszDest, cchDest, cbDest, ppszDestEnd, pcchRemaining, dwFlags); + } + + return hr; +} + +STRSAFE_INLINE_API StringCchGetsExW(wchar_t* pszDest, size_t cchDest, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr; + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cbDest; + + // safe to multiply cchDest * sizeof(wchar_t) since cchDest < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + cbDest = cchDest * sizeof(wchar_t); + + hr = StringGetsExWorkerW(pszDest, cchDest, cbDest, ppszDestEnd, pcchRemaining, dwFlags); + } + + return hr; +} +#endif // !STRSAFE_NO_CCH_FUNCTIONS +#endif // !STRSAFE_LIB_IMPL + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbGetsEx( + OUT LPTSTR pszDest OPTIONAL, + IN size_t cbDest, + OUT LPTSTR* ppszDestEnd OPTIONAL, + OUT size_t* pcbRemaining OPTIONAL, + IN DWORD dwFlags + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'gets' with + some additional parameters. In addition to functionality provided by + StringCbGets, this routine also returns a pointer to the end of the + destination string and the number of characters left in the destination string + including the null terminator. The flags parameter allows additional controls. + +Arguments: + + pszDest - destination string + + cbDest - size of destination buffer in bytes. + + ppszDestEnd - if ppszDestEnd is non-null, the function will return a + pointer to the end of the destination string. If the + function copied any data, the result will point to the + null termination character + + pcbRemaining - if pbRemaining is non-null, the function will return the + number of bytes left in the destination string, + including the null terminator + + dwFlags - controls some details of the string copy: + + STRSAFE_FILL_BEHIND_NULL + if the function succeeds, the low byte of dwFlags will be + used to fill the uninitialize part of destination buffer + behind the null terminator + + STRSAFE_IGNORE_NULLS + treat NULL string pointers like empty strings (TEXT("")). + + STRSAFE_FILL_ON_FAILURE + if the function fails, the low byte of dwFlags will be + used to fill all of the destination buffer, and it will + be null terminated. + + STRSAFE_NO_TRUNCATION / + STRSAFE_NULL_ON_FAILURE + if the function fails, the destination buffer will be set + to the empty string. + +Notes: + pszDest should not be NULL unless the STRSAFE_IGNORE_NULLS flag is specified. + If STRSAFE_IGNORE_NULLS is passed and pszDest is NULL, an error may still be + returned even though NULLS are ignored + + cbDest must be > sizeof(TCHAR) for this function to succeed + +Return Value: + + S_OK - data was read from stdin and copied, and the resultant + dest string was null terminated + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + STRSAFE_E_END_OF_FILE / + HRESULT_CODE(hr) == ERROR_HANDLE_EOF + - this return value indicates an error or end-of-file + condition, use feof or ferror to determine which one has + occured. + + STRSAFE_E_INSUFFICIENT_BUFFER / + HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER + - this return value is an indication that there was + insufficient space in the destination buffer to copy any + data + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function. + +--*/ + +#ifndef STRSAFE_LIB_IMPL +STRSAFE_INLINE_API StringCbGetsExA(char* pszDest, size_t cbDest, char** ppszDestEnd, size_t* pbRemaining, unsigned long dwFlags); +STRSAFE_INLINE_API StringCbGetsExW(wchar_t* pszDest, size_t cbDest, wchar_t** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags); +#ifdef UNICODE +#define StringCbGetsEx StringCbGetsExW +#else +#define StringCbGetsEx StringCbGetsExA +#endif // !UNICODE + +STRSAFE_INLINE_API StringCbGetsExA(char* pszDest, size_t cbDest, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags) +{ + HRESULT hr; + size_t cchDest; + size_t cchRemaining = 0; + + cchDest = cbDest / sizeof(char); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringGetsExWorkerA(pszDest, cchDest, cbDest, ppszDestEnd, &cchRemaining, dwFlags); + } + + if (SUCCEEDED(hr) || + (hr == STRSAFE_E_INSUFFICIENT_BUFFER) || + (hr == STRSAFE_E_END_OF_FILE)) + { + if (pcbRemaining) + { + // safe to multiply cchRemaining * sizeof(char) since cchRemaining < STRSAFE_MAX_CCH and sizeof(char) is 1 + *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); + } + } + + return hr; +} + +STRSAFE_INLINE_API StringCbGetsExW(wchar_t* pszDest, size_t cbDest, wchar_t** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags) +{ + HRESULT hr; + size_t cchDest; + size_t cchRemaining = 0; + + cchDest = cbDest / sizeof(wchar_t); + + if (cchDest > STRSAFE_MAX_CCH) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringGetsExWorkerW(pszDest, cchDest, cbDest, ppszDestEnd, &cchRemaining, dwFlags); + } + + if (SUCCEEDED(hr) || + (hr == STRSAFE_E_INSUFFICIENT_BUFFER) || + (hr == STRSAFE_E_END_OF_FILE)) + { + if (pcbRemaining) + { + // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + *pcbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); + } + } + + return hr; +} +#endif // !STRSAFE_NO_CB_FUNCTIONS +#endif // !STRSAFE_LIB_IMPL + +#ifndef STRSAFE_NO_CCH_FUNCTIONS +/*++ + +STDAPI +StringCchLength( + IN LPCTSTR psz, + IN size_t cchMax, + OUT size_t* pcch OPTIONAL + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strlen'. + It is used to make sure a string is not larger than a given length, and + it optionally returns the current length in characters not including + the null terminator. + + This function returns a hresult, and not a pointer. It returns + S_OK if the string is non-null and the length including the null + terminator is less than or equal to cchMax characters. + +Arguments: + + psz - string to check the length of + + cchMax - maximum number of characters including the null terminator + that psz is allowed to contain + + pcch - if the function succeeds and pcch is non-null, the current length + in characters of psz excluding the null terminator will be returned. + This out parameter is equivalent to the return value of strlen(psz) + +Notes: + psz can be null but the function will fail + + cchMax should be greater than zero or the function will fail + +Return Value: + + S_OK - psz is non-null and the length including the null + terminator is less than or equal to cchMax characters + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function. + +--*/ + +STRSAFEAPI StringCchLengthA(const char* psz, size_t cchMax, size_t* pcch); +STRSAFEAPI StringCchLengthW(const wchar_t* psz, size_t cchMax, size_t* pcch); +#ifdef UNICODE +#define StringCchLength StringCchLengthW +#else +#define StringCchLength StringCchLengthA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCchLengthA(const char* psz, size_t cchMax, size_t* pcch) +{ + HRESULT hr; + + if ((psz == NULL) || (cchMax > STRSAFE_MAX_CCH)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringLengthWorkerA(psz, cchMax, pcch); + } + + return hr; +} + +STRSAFEAPI StringCchLengthW(const wchar_t* psz, size_t cchMax, size_t* pcch) +{ + HRESULT hr; + + if ((psz == NULL) || (cchMax > STRSAFE_MAX_CCH)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringLengthWorkerW(psz, cchMax, pcch); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CCH_FUNCTIONS + + +#ifndef STRSAFE_NO_CB_FUNCTIONS +/*++ + +STDAPI +StringCbLength( + IN LPCTSTR psz, + IN size_t cbMax, + OUT size_t* pcb OPTIONAL + ); + +Routine Description: + + This routine is a safer version of the C built-in function 'strlen'. + It is used to make sure a string is not larger than a given length, and + it optionally returns the current length in bytes not including + the null terminator. + + This function returns a hresult, and not a pointer. It returns + S_OK if the string is non-null and the length including the null + terminator is less than or equal to cbMax bytes. + +Arguments: + + psz - string to check the length of + + cbMax - maximum number of bytes including the null terminator + that psz is allowed to contain + + pcb - if the function succeeds and pcb is non-null, the current length + in bytes of psz excluding the null terminator will be returned. + This out parameter is equivalent to the return value of strlen(psz) * sizeof(TCHAR) + +Notes: + psz can be null but the function will fail + + cbMax should be greater than or equal to sizeof(TCHAR) or the function will fail + +Return Value: + + S_OK - psz is non-null and the length including the null + terminator is less than or equal to cbMax bytes + + failure - you can use the macro HRESULT_CODE() to get a win32 + error code for all hresult failure cases + + It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the + return value of this function. + +--*/ + +STRSAFEAPI StringCbLengthA(const char* psz, size_t cchMax, size_t* pcch); +STRSAFEAPI StringCbLengthW(const wchar_t* psz, size_t cchMax, size_t* pcch); +#ifdef UNICODE +#define StringCbLength StringCbLengthW +#else +#define StringCbLength StringCbLengthA +#endif // !UNICODE + +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCbLengthA(const char* psz, size_t cbMax, size_t* pcb) +{ + HRESULT hr; + size_t cchMax; + size_t cch = 0; + + cchMax = cbMax / sizeof(char); + + if ((psz == NULL) || (cchMax > STRSAFE_MAX_CCH)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringLengthWorkerA(psz, cchMax, &cch); + } + + if (SUCCEEDED(hr) && pcb) + { + // safe to multiply cch * sizeof(char) since cch < STRSAFE_MAX_CCH and sizeof(char) is 1 + *pcb = cch * sizeof(char); + } + + return hr; +} + +STRSAFEAPI StringCbLengthW(const wchar_t* psz, size_t cbMax, size_t* pcb) +{ + HRESULT hr; + size_t cchMax; + size_t cch = 0; + + cchMax = cbMax / sizeof(wchar_t); + + if ((psz == NULL) || (cchMax > STRSAFE_MAX_CCH)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = StringLengthWorkerW(psz, cchMax, &cch); + } + + if (SUCCEEDED(hr) && pcb) + { + // safe to multiply cch * sizeof(wchar_t) since cch < STRSAFE_MAX_CCH and sizeof(wchar_t) is 2 + *pcb = cch * sizeof(wchar_t); + } + + return hr; +} +#endif // STRSAFE_INLINE +#endif // !STRSAFE_NO_CB_FUNCTIONS + + +// these are the worker functions that actually do the work +#ifdef STRSAFE_INLINE +STRSAFEAPI StringCopyWorkerA(char* pszDest, size_t cchDest, const char* pszSrc) +{ + HRESULT hr = S_OK; + + if (cchDest == 0) + { + // can not null terminate a zero-byte dest buffer + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + while (cchDest && (*pszSrc != '\0')) + { + *pszDest++ = *pszSrc++; + cchDest--; + } + + if (cchDest == 0) + { + // we are going to truncate pszDest + pszDest--; + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + + *pszDest= '\0'; + } + + return hr; +} + +STRSAFEAPI StringCopyWorkerW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc) +{ + HRESULT hr = S_OK; + + if (cchDest == 0) + { + // can not null terminate a zero-byte dest buffer + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + while (cchDest && (*pszSrc != L'\0')) + { + *pszDest++ = *pszSrc++; + cchDest--; + } + + if (cchDest == 0) + { + // we are going to truncate pszDest + pszDest--; + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + + *pszDest= L'\0'; + } + + return hr; +} + +STRSAFEAPI StringCopyExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr = S_OK; + char* pszDestEnd = pszDest; + size_t cchRemaining = 0; + + // ASSERT(cbDest == (cchDest * sizeof(char)) || + // cbDest == (cchDest * sizeof(char)) + (cbDest % sizeof(char))); + + // only accept valid flags + if (dwFlags & (~STRSAFE_VALID_FLAGS)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + if (dwFlags & STRSAFE_IGNORE_NULLS) + { + if (pszDest == NULL) + { + if ((cchDest != 0) || (cbDest != 0)) + { + // NULL pszDest and non-zero cchDest/cbDest is invalid + hr = STRSAFE_E_INVALID_PARAMETER; + } + } + + if (pszSrc == NULL) + { + pszSrc = ""; + } + } + + if (SUCCEEDED(hr)) + { + if (cchDest == 0) + { + pszDestEnd = pszDest; + cchRemaining = 0; + + // only fail if there was actually src data to copy + if (*pszSrc != '\0') + { + if (pszDest == NULL) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + } + } + else + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + while (cchRemaining && (*pszSrc != '\0')) + { + *pszDestEnd++= *pszSrc++; + cchRemaining--; + } + + if (cchRemaining > 0) + { + if (dwFlags & STRSAFE_FILL_BEHIND_NULL) + { + memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), ((cchRemaining - 1) * sizeof(char)) + (cbDest % sizeof(char))); + } + } + else + { + // we are going to truncate pszDest + pszDestEnd--; + cchRemaining++; + + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + + *pszDestEnd = '\0'; + } + } + } + + if (FAILED(hr)) + { + if (pszDest) + { + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); + + if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + } + else if (cchDest > 0) + { + pszDestEnd = pszDest + cchDest - 1; + cchRemaining = 1; + + // null terminate the end of the string + *pszDestEnd = '\0'; + } + } + + if (dwFlags & (STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION)) + { + if (cchDest > 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + // null terminate the beginning of the string + *pszDestEnd = '\0'; + } + } + } + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (ppszDestEnd) + { + *ppszDestEnd = pszDestEnd; + } + + if (pcchRemaining) + { + *pcchRemaining = cchRemaining; + } + } + + return hr; +} + +STRSAFEAPI StringCopyExWorkerW(wchar_t* pszDest, size_t cchDest, size_t cbDest, const wchar_t* pszSrc, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr = S_OK; + wchar_t* pszDestEnd = pszDest; + size_t cchRemaining = 0; + + // ASSERT(cbDest == (cchDest * sizeof(wchar_t)) || + // cbDest == (cchDest * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t))); + + // only accept valid flags + if (dwFlags & (~STRSAFE_VALID_FLAGS)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + if (dwFlags & STRSAFE_IGNORE_NULLS) + { + if (pszDest == NULL) + { + if ((cchDest != 0) || (cbDest != 0)) + { + // NULL pszDest and non-zero cchDest/cbDest is invalid + hr = STRSAFE_E_INVALID_PARAMETER; + } + } + + if (pszSrc == NULL) + { + pszSrc = L""; + } + } + + if (SUCCEEDED(hr)) + { + if (cchDest == 0) + { + pszDestEnd = pszDest; + cchRemaining = 0; + + // only fail if there was actually src data to copy + if (*pszSrc != L'\0') + { + if (pszDest == NULL) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + } + } + else + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + while (cchRemaining && (*pszSrc != L'\0')) + { + *pszDestEnd++= *pszSrc++; + cchRemaining--; + } + + if (cchRemaining > 0) + { + if (dwFlags & STRSAFE_FILL_BEHIND_NULL) + { + memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), ((cchRemaining - 1) * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t))); + } + } + else + { + // we are going to truncate pszDest + pszDestEnd--; + cchRemaining++; + + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + + *pszDestEnd = L'\0'; + } + } + } + + if (FAILED(hr)) + { + if (pszDest) + { + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); + + if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + } + else if (cchDest > 0) + { + pszDestEnd = pszDest + cchDest - 1; + cchRemaining = 1; + + // null terminate the end of the string + *pszDestEnd = L'\0'; + } + } + + if (dwFlags & (STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION)) + { + if (cchDest > 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + // null terminate the beginning of the string + *pszDestEnd = L'\0'; + } + } + } + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (ppszDestEnd) + { + *ppszDestEnd = pszDestEnd; + } + + if (pcchRemaining) + { + *pcchRemaining = cchRemaining; + } + } + + return hr; +} + +STRSAFEAPI StringCopyNWorkerA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchSrc) +{ + HRESULT hr = S_OK; + + if (cchDest == 0) + { + // can not null terminate a zero-byte dest buffer + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + while (cchDest && cchSrc && (*pszSrc != '\0')) + { + *pszDest++= *pszSrc++; + cchDest--; + cchSrc--; + } + + if (cchDest == 0) + { + // we are going to truncate pszDest + pszDest--; + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + + *pszDest= '\0'; + } + + return hr; +} + +STRSAFEAPI StringCopyNWorkerW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, size_t cchSrc) +{ + HRESULT hr = S_OK; + + if (cchDest == 0) + { + // can not null terminate a zero-byte dest buffer + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + while (cchDest && cchSrc && (*pszSrc != L'\0')) + { + *pszDest++= *pszSrc++; + cchDest--; + cchSrc--; + } + + if (cchDest == 0) + { + // we are going to truncate pszDest + pszDest--; + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + + *pszDest= L'\0'; + } + + return hr; +} + +STRSAFEAPI StringCopyNExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, size_t cchSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr = S_OK; + char* pszDestEnd = pszDest; + size_t cchRemaining = 0; + + // ASSERT(cbDest == (cchDest * sizeof(char)) || + // cbDest == (cchDest * sizeof(char)) + (cbDest % sizeof(char))); + + // only accept valid flags + if (dwFlags & (~STRSAFE_VALID_FLAGS)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + if (dwFlags & STRSAFE_IGNORE_NULLS) + { + if (pszDest == NULL) + { + if ((cchDest != 0) || (cbDest != 0)) + { + // NULL pszDest and non-zero cchDest/cbDest is invalid + hr = STRSAFE_E_INVALID_PARAMETER; + } + } + + if (pszSrc == NULL) + { + pszSrc = ""; + } + } + + if (SUCCEEDED(hr)) + { + if (cchDest == 0) + { + pszDestEnd = pszDest; + cchRemaining = 0; + + // only fail if there was actually src data to copy + if (*pszSrc != '\0') + { + if (pszDest == NULL) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + } + } + else + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + while (cchRemaining && cchSrc && (*pszSrc != '\0')) + { + *pszDestEnd++= *pszSrc++; + cchRemaining--; + cchSrc--; + } + + if (cchRemaining > 0) + { + if (dwFlags & STRSAFE_FILL_BEHIND_NULL) + { + memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), ((cchRemaining - 1) * sizeof(char)) + (cbDest % sizeof(char))); + } + } + else + { + // we are going to truncate pszDest + pszDestEnd--; + cchRemaining++; + + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + + *pszDestEnd = '\0'; + } + } + } + + if (FAILED(hr)) + { + if (pszDest) + { + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); + + if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + } + else if (cchDest > 0) + { + pszDestEnd = pszDest + cchDest - 1; + cchRemaining = 1; + + // null terminate the end of the string + *pszDestEnd = '\0'; + } + } + + if (dwFlags & (STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION)) + { + if (cchDest > 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + // null terminate the beginning of the string + *pszDestEnd = '\0'; + } + } + } + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (ppszDestEnd) + { + *ppszDestEnd = pszDestEnd; + } + + if (pcchRemaining) + { + *pcchRemaining = cchRemaining; + } + } + + return hr; +} + +STRSAFEAPI StringCopyNExWorkerW(wchar_t* pszDest, size_t cchDest, size_t cbDest, const wchar_t* pszSrc, size_t cchSrc, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr = S_OK; + wchar_t* pszDestEnd = pszDest; + size_t cchRemaining = 0; + + // ASSERT(cbDest == (cchDest * sizeof(wchar_t)) || + // cbDest == (cchDest * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t))); + + // only accept valid flags + if (dwFlags & (~STRSAFE_VALID_FLAGS)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + if (dwFlags & STRSAFE_IGNORE_NULLS) + { + if (pszDest == NULL) + { + if ((cchDest != 0) || (cbDest != 0)) + { + // NULL pszDest and non-zero cchDest/cbDest is invalid + hr = STRSAFE_E_INVALID_PARAMETER; + } + } + + if (pszSrc == NULL) + { + pszSrc = L""; + } + } + + if (SUCCEEDED(hr)) + { + if (cchDest == 0) + { + pszDestEnd = pszDest; + cchRemaining = 0; + + // only fail if there was actually src data to copy + if (*pszSrc != L'\0') + { + if (pszDest == NULL) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + } + } + else + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + while (cchRemaining && cchSrc && (*pszSrc != L'\0')) + { + *pszDestEnd++= *pszSrc++; + cchRemaining--; + cchSrc--; + } + + if (cchRemaining > 0) + { + if (dwFlags & STRSAFE_FILL_BEHIND_NULL) + { + memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), ((cchRemaining - 1) * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t))); + } + } + else + { + // we are going to truncate pszDest + pszDestEnd--; + cchRemaining++; + + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + + *pszDestEnd = L'\0'; + } + } + } + + if (FAILED(hr)) + { + if (pszDest) + { + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); + + if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + } + else if (cchDest > 0) + { + pszDestEnd = pszDest + cchDest - 1; + cchRemaining = 1; + + // null terminate the end of the string + *pszDestEnd = L'\0'; + } + } + + if (dwFlags & (STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION)) + { + if (cchDest > 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + // null terminate the beginning of the string + *pszDestEnd = L'\0'; + } + } + } + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (ppszDestEnd) + { + *ppszDestEnd = pszDestEnd; + } + + if (pcchRemaining) + { + *pcchRemaining = cchRemaining; + } + } + + return hr; +} + +STRSAFEAPI StringCatWorkerA(char* pszDest, size_t cchDest, const char* pszSrc) +{ + HRESULT hr; + size_t cchDestCurrent; + + hr = StringLengthWorkerA(pszDest, cchDest, &cchDestCurrent); + + if (SUCCEEDED(hr)) + { + hr = StringCopyWorkerA(pszDest + cchDestCurrent, + cchDest - cchDestCurrent, + pszSrc); + } + + return hr; +} + +STRSAFEAPI StringCatWorkerW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc) +{ + HRESULT hr; + size_t cchDestCurrent; + + hr = StringLengthWorkerW(pszDest, cchDest, &cchDestCurrent); + + if (SUCCEEDED(hr)) + { + hr = StringCopyWorkerW(pszDest + cchDestCurrent, + cchDest - cchDestCurrent, + pszSrc); + } + + return hr; +} + +STRSAFEAPI StringCatExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr = S_OK; + char* pszDestEnd = pszDest; + size_t cchRemaining = 0; + + // ASSERT(cbDest == (cchDest * sizeof(char)) || + // cbDest == (cchDest * sizeof(char)) + (cbDest % sizeof(char))); + + // only accept valid flags + if (dwFlags & (~STRSAFE_VALID_FLAGS)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cchDestCurrent; + + if (dwFlags & STRSAFE_IGNORE_NULLS) + { + if (pszDest == NULL) + { + if ((cchDest == 0) && (cbDest == 0)) + { + cchDestCurrent = 0; + } + else + { + // NULL pszDest and non-zero cchDest/cbDest is invalid + hr = STRSAFE_E_INVALID_PARAMETER; + } + } + else + { + hr = StringLengthWorkerA(pszDest, cchDest, &cchDestCurrent); + + if (SUCCEEDED(hr)) + { + pszDestEnd = pszDest + cchDestCurrent; + cchRemaining = cchDest - cchDestCurrent; + } + } + + if (pszSrc == NULL) + { + pszSrc = ""; + } + } + else + { + hr = StringLengthWorkerA(pszDest, cchDest, &cchDestCurrent); + + if (SUCCEEDED(hr)) + { + pszDestEnd = pszDest + cchDestCurrent; + cchRemaining = cchDest - cchDestCurrent; + } + } + + if (SUCCEEDED(hr)) + { + if (cchDest == 0) + { + // only fail if there was actually src data to append + if (*pszSrc != '\0') + { + if (pszDest == NULL) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + } + } + else + { + // we handle the STRSAFE_FILL_ON_FAILURE and STRSAFE_NULL_ON_FAILURE cases below, so do not pass + // those flags through + hr = StringCopyExWorkerA(pszDestEnd, + cchRemaining, + (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)), + pszSrc, + &pszDestEnd, + &cchRemaining, + dwFlags & (~(STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE))); + } + } + } + + if (FAILED(hr)) + { + if (pszDest) + { + // STRSAFE_NO_TRUNCATION is taken care of by StringCopyExWorkerA() + + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); + + if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + } + else + if (cchDest > 0) + { + pszDestEnd = pszDest + cchDest - 1; + cchRemaining = 1; + + // null terminate the end of the string + *pszDestEnd = '\0'; + } + } + + if (dwFlags & STRSAFE_NULL_ON_FAILURE) + { + if (cchDest > 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + // null terminate the beginning of the string + *pszDestEnd = '\0'; + } + } + } + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (ppszDestEnd) + { + *ppszDestEnd = pszDestEnd; + } + + if (pcchRemaining) + { + *pcchRemaining = cchRemaining; + } + } + + return hr; +} + +STRSAFEAPI StringCatExWorkerW(wchar_t* pszDest, size_t cchDest, size_t cbDest, const wchar_t* pszSrc, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr = S_OK; + wchar_t* pszDestEnd = pszDest; + size_t cchRemaining = 0; + + // ASSERT(cbDest == (cchDest * sizeof(wchar_t)) || + // cbDest == (cchDest * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t))); + + // only accept valid flags + if (dwFlags & (~STRSAFE_VALID_FLAGS)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + size_t cchDestCurrent; + + if (dwFlags & STRSAFE_IGNORE_NULLS) + { + if (pszDest == NULL) + { + if ((cchDest == 0) && (cbDest == 0)) + { + cchDestCurrent = 0; + } + else + { + // NULL pszDest and non-zero cchDest/cbDest is invalid + hr = STRSAFE_E_INVALID_PARAMETER; + } + } + else + { + hr = StringLengthWorkerW(pszDest, cchDest, &cchDestCurrent); + + if (SUCCEEDED(hr)) + { + pszDestEnd = pszDest + cchDestCurrent; + cchRemaining = cchDest - cchDestCurrent; + } + } + + if (pszSrc == NULL) + { + pszSrc = L""; + } + } + else + { + hr = StringLengthWorkerW(pszDest, cchDest, &cchDestCurrent); + + if (SUCCEEDED(hr)) + { + pszDestEnd = pszDest + cchDestCurrent; + cchRemaining = cchDest - cchDestCurrent; + } + } + + if (SUCCEEDED(hr)) + { + if (cchDest == 0) + { + // only fail if there was actually src data to append + if (*pszSrc != L'\0') + { + if (pszDest == NULL) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + } + } + else + { + // we handle the STRSAFE_FILL_ON_FAILURE and STRSAFE_NULL_ON_FAILURE cases below, so do not pass + // those flags through + hr = StringCopyExWorkerW(pszDestEnd, + cchRemaining, + (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)), + pszSrc, + &pszDestEnd, + &cchRemaining, + dwFlags & (~(STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE))); + } + } + } + + if (FAILED(hr)) + { + if (pszDest) + { + // STRSAFE_NO_TRUNCATION is taken care of by StringCopyExWorkerW() + + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); + + if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + } + else if (cchDest > 0) + { + pszDestEnd = pszDest + cchDest - 1; + cchRemaining = 1; + + // null terminate the end of the string + *pszDestEnd = L'\0'; + } + } + + if (dwFlags & STRSAFE_NULL_ON_FAILURE) + { + if (cchDest > 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + // null terminate the beginning of the string + *pszDestEnd = L'\0'; + } + } + } + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (ppszDestEnd) + { + *ppszDestEnd = pszDestEnd; + } + + if (pcchRemaining) + { + *pcchRemaining = cchRemaining; + } + } + + return hr; +} + +STRSAFEAPI StringCatNWorkerA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchMaxAppend) +{ + HRESULT hr; + size_t cchDestCurrent; + + hr = StringLengthWorkerA(pszDest, cchDest, &cchDestCurrent); + + if (SUCCEEDED(hr)) + { + hr = StringCopyNWorkerA(pszDest + cchDestCurrent, + cchDest - cchDestCurrent, + pszSrc, + cchMaxAppend); + } + + return hr; +} + +STRSAFEAPI StringCatNWorkerW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszSrc, size_t cchMaxAppend) +{ + HRESULT hr; + size_t cchDestCurrent; + + hr = StringLengthWorkerW(pszDest, cchDest, &cchDestCurrent); + + if (SUCCEEDED(hr)) + { + hr = StringCopyNWorkerW(pszDest + cchDestCurrent, + cchDest - cchDestCurrent, + pszSrc, + cchMaxAppend); + } + + return hr; +} + +STRSAFEAPI StringCatNExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, size_t cchMaxAppend, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr = S_OK; + char* pszDestEnd = pszDest; + size_t cchRemaining = 0; + size_t cchDestCurrent = 0; + + // ASSERT(cbDest == (cchDest * sizeof(char)) || + // cbDest == (cchDest * sizeof(char)) + (cbDest % sizeof(char))); + + // only accept valid flags + if (dwFlags & (~STRSAFE_VALID_FLAGS)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + if (dwFlags & STRSAFE_IGNORE_NULLS) + { + if (pszDest == NULL) + { + if ((cchDest == 0) && (cbDest == 0)) + { + cchDestCurrent = 0; + } + else + { + // NULL pszDest and non-zero cchDest/cbDest is invalid + hr = STRSAFE_E_INVALID_PARAMETER; + } + } + else + { + hr = StringLengthWorkerA(pszDest, cchDest, &cchDestCurrent); + + if (SUCCEEDED(hr)) + { + pszDestEnd = pszDest + cchDestCurrent; + cchRemaining = cchDest - cchDestCurrent; + } + } + + if (pszSrc == NULL) + { + pszSrc = ""; + } + } + else + { + hr = StringLengthWorkerA(pszDest, cchDest, &cchDestCurrent); + + if (SUCCEEDED(hr)) + { + pszDestEnd = pszDest + cchDestCurrent; + cchRemaining = cchDest - cchDestCurrent; + } + } + + if (SUCCEEDED(hr)) + { + if (cchDest == 0) + { + // only fail if there was actually src data to append + if (*pszSrc != '\0') + { + if (pszDest == NULL) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + } + } + else + { + // we handle the STRSAFE_FILL_ON_FAILURE and STRSAFE_NULL_ON_FAILURE cases below, so do not pass + // those flags through + hr = StringCopyNExWorkerA(pszDestEnd, + cchRemaining, + (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)), + pszSrc, + cchMaxAppend, + &pszDestEnd, + &cchRemaining, + dwFlags & (~(STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE))); + } + } + } + + if (FAILED(hr)) + { + if (pszDest) + { + // STRSAFE_NO_TRUNCATION is taken care of by StringCopyNExWorkerA() + + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); + + if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + } + else if (cchDest > 0) + { + pszDestEnd = pszDest + cchDest - 1; + cchRemaining = 1; + + // null terminate the end of the string + *pszDestEnd = '\0'; + } + } + + if (dwFlags & (STRSAFE_NULL_ON_FAILURE)) + { + if (cchDest > 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + // null terminate the beginning of the string + *pszDestEnd = '\0'; + } + } + } + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (ppszDestEnd) + { + *ppszDestEnd = pszDestEnd; + } + + if (pcchRemaining) + { + *pcchRemaining = cchRemaining; + } + } + + return hr; +} + +STRSAFEAPI StringCatNExWorkerW(wchar_t* pszDest, size_t cchDest, size_t cbDest, const wchar_t* pszSrc, size_t cchMaxAppend, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr = S_OK; + wchar_t* pszDestEnd = pszDest; + size_t cchRemaining = 0; + size_t cchDestCurrent = 0; + + + // ASSERT(cbDest == (cchDest * sizeof(wchar_t)) || + // cbDest == (cchDest * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t))); + + // only accept valid flags + if (dwFlags & (~STRSAFE_VALID_FLAGS)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + if (dwFlags & STRSAFE_IGNORE_NULLS) + { + if (pszDest == NULL) + { + if ((cchDest == 0) && (cbDest == 0)) + { + cchDestCurrent = 0; + } + else + { + // NULL pszDest and non-zero cchDest/cbDest is invalid + hr = STRSAFE_E_INVALID_PARAMETER; + } + } + else + { + hr = StringLengthWorkerW(pszDest, cchDest, &cchDestCurrent); + + if (SUCCEEDED(hr)) + { + pszDestEnd = pszDest + cchDestCurrent; + cchRemaining = cchDest - cchDestCurrent; + } + } + + if (pszSrc == NULL) + { + pszSrc = L""; + } + } + else + { + hr = StringLengthWorkerW(pszDest, cchDest, &cchDestCurrent); + + if (SUCCEEDED(hr)) + { + pszDestEnd = pszDest + cchDestCurrent; + cchRemaining = cchDest - cchDestCurrent; + } + } + + if (SUCCEEDED(hr)) + { + if (cchDest == 0) + { + // only fail if there was actually src data to append + if (*pszSrc != L'\0') + { + if (pszDest == NULL) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + } + } + else + { + // we handle the STRSAFE_FILL_ON_FAILURE and STRSAFE_NULL_ON_FAILURE cases below, so do not pass + // those flags through + hr = StringCopyNExWorkerW(pszDestEnd, + cchRemaining, + (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)), + pszSrc, + cchMaxAppend, + &pszDestEnd, + &cchRemaining, + dwFlags & (~(STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE))); + } + } + } + + if (FAILED(hr)) + { + if (pszDest) + { + // STRSAFE_NO_TRUNCATION is taken care of by StringCopyNExWorkerW() + + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); + + if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + } + else if (cchDest > 0) + { + pszDestEnd = pszDest + cchDest - 1; + cchRemaining = 1; + + // null terminate the end of the string + *pszDestEnd = L'\0'; + } + } + + if (dwFlags & (STRSAFE_NULL_ON_FAILURE)) + { + if (cchDest > 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + // null terminate the beginning of the string + *pszDestEnd = L'\0'; + } + } + } + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (ppszDestEnd) + { + *ppszDestEnd = pszDestEnd; + } + + if (pcchRemaining) + { + *pcchRemaining = cchRemaining; + } + } + + return hr; +} + +STRSAFEAPI StringVPrintfWorkerA(char* pszDest, size_t cchDest, const char* pszFormat, va_list argList) +{ + HRESULT hr = S_OK; + + if (cchDest == 0) + { + // can not null terminate a zero-byte dest buffer + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + int iRet; + size_t cchMax; + + // leave the last space for the null terminator + cchMax = cchDest - 1; + + iRet = _vsnprintf(pszDest, cchMax, pszFormat, argList); + // ASSERT((iRet < 0) || (((size_t)iRet) <= cchMax)); + + if ((iRet < 0) || (((size_t)iRet) > cchMax)) + { + // need to null terminate the string + pszDest += cchMax; + *pszDest = '\0'; + + // we have truncated pszDest + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + else if (((size_t)iRet) == cchMax) + { + // need to null terminate the string + pszDest += cchMax; + *pszDest = '\0'; + } + } + + return hr; +} + +STRSAFEAPI StringVPrintfWorkerW(wchar_t* pszDest, size_t cchDest, const wchar_t* pszFormat, va_list argList) +{ + HRESULT hr = S_OK; + + if (cchDest == 0) + { + // can not null terminate a zero-byte dest buffer + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + int iRet; + size_t cchMax; + + // leave the last space for the null terminator + cchMax = cchDest - 1; + + iRet = _vsnwprintf(pszDest, cchMax, pszFormat, argList); + // ASSERT((iRet < 0) || (((size_t)iRet) <= cchMax)); + + if ((iRet < 0) || (((size_t)iRet) > cchMax)) + { + // need to null terminate the string + pszDest += cchMax; + *pszDest = L'\0'; + + // we have truncated pszDest + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + else if (((size_t)iRet) == cchMax) + { + // need to null terminate the string + pszDest += cchMax; + *pszDest = L'\0'; + } + } + + return hr; +} + +STRSAFEAPI StringVPrintfExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const char* pszFormat, va_list argList) +{ + HRESULT hr = S_OK; + char* pszDestEnd = pszDest; + size_t cchRemaining = 0; + + // ASSERT(cbDest == (cchDest * sizeof(char)) || + // cbDest == (cchDest * sizeof(char)) + (cbDest % sizeof(char))); + + // only accept valid flags + if (dwFlags & (~STRSAFE_VALID_FLAGS)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + if (dwFlags & STRSAFE_IGNORE_NULLS) + { + if (pszDest == NULL) + { + if ((cchDest != 0) || (cbDest != 0)) + { + // NULL pszDest and non-zero cchDest/cbDest is invalid + hr = STRSAFE_E_INVALID_PARAMETER; + } + } + + if (pszFormat == NULL) + { + pszFormat = ""; + } + } + + if (SUCCEEDED(hr)) + { + if (cchDest == 0) + { + pszDestEnd = pszDest; + cchRemaining = 0; + + // only fail if there was actually a non-empty format string + if (*pszFormat != '\0') + { + if (pszDest == NULL) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + } + } + else + { + int iRet; + size_t cchMax; + + // leave the last space for the null terminator + cchMax = cchDest - 1; + + iRet = _vsnprintf(pszDest, cchMax, pszFormat, argList); + // ASSERT((iRet < 0) || (((size_t)iRet) <= cchMax)); + + if ((iRet < 0) || (((size_t)iRet) > cchMax)) + { + // we have truncated pszDest + pszDestEnd = pszDest + cchMax; + cchRemaining = 1; + + // need to null terminate the string + *pszDestEnd = '\0'; + + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + else if (((size_t)iRet) == cchMax) + { + // string fit perfectly + pszDestEnd = pszDest + cchMax; + cchRemaining = 1; + + // need to null terminate the string + *pszDestEnd = '\0'; + } + else if (((size_t)iRet) < cchMax) + { + // there is extra room + pszDestEnd = pszDest + iRet; + cchRemaining = cchDest - iRet; + + if (dwFlags & STRSAFE_FILL_BEHIND_NULL) + { + memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), ((cchRemaining - 1) * sizeof(char)) + (cbDest % sizeof(char))); + } + } + } + } + } + + if (FAILED(hr)) + { + if (pszDest) + { + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); + + if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + } + else if (cchDest > 0) + { + pszDestEnd = pszDest + cchDest - 1; + cchRemaining = 1; + + // null terminate the end of the string + *pszDestEnd = '\0'; + } + } + + if (dwFlags & (STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION)) + { + if (cchDest > 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + // null terminate the beginning of the string + *pszDestEnd = '\0'; + } + } + } + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (ppszDestEnd) + { + *ppszDestEnd = pszDestEnd; + } + + if (pcchRemaining) + { + *pcchRemaining = cchRemaining; + } + } + + return hr; +} + +STRSAFEAPI StringVPrintfExWorkerW(wchar_t* pszDest, size_t cchDest, size_t cbDest, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const wchar_t* pszFormat, va_list argList) +{ + HRESULT hr = S_OK; + wchar_t* pszDestEnd = pszDest; + size_t cchRemaining = 0; + + // ASSERT(cbDest == (cchDest * sizeof(wchar_t)) || + // cbDest == (cchDest * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t))); + + // only accept valid flags + if (dwFlags & (~STRSAFE_VALID_FLAGS)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + if (dwFlags & STRSAFE_IGNORE_NULLS) + { + if (pszDest == NULL) + { + if ((cchDest != 0) || (cbDest != 0)) + { + // NULL pszDest and non-zero cchDest/cbDest is invalid + hr = STRSAFE_E_INVALID_PARAMETER; + } + } + + if (pszFormat == NULL) + { + pszFormat = L""; + } + } + + if (SUCCEEDED(hr)) + { + if (cchDest == 0) + { + pszDestEnd = pszDest; + cchRemaining = 0; + + // only fail if there was actually a non-empty format string + if (*pszFormat != L'\0') + { + if (pszDest == NULL) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + } + } + else + { + int iRet; + size_t cchMax; + + // leave the last space for the null terminator + cchMax = cchDest - 1; + + iRet = _vsnwprintf(pszDest, cchMax, pszFormat, argList); + // ASSERT((iRet < 0) || (((size_t)iRet) <= cchMax)); + + if ((iRet < 0) || (((size_t)iRet) > cchMax)) + { + // we have truncated pszDest + pszDestEnd = pszDest + cchMax; + cchRemaining = 1; + + // need to null terminate the string + *pszDestEnd = L'\0'; + + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + else if (((size_t)iRet) == cchMax) + { + // string fit perfectly + pszDestEnd = pszDest + cchMax; + cchRemaining = 1; + + // need to null terminate the string + *pszDestEnd = L'\0'; + } + else if (((size_t)iRet) < cchMax) + { + // there is extra room + pszDestEnd = pszDest + iRet; + cchRemaining = cchDest - iRet; + + if (dwFlags & STRSAFE_FILL_BEHIND_NULL) + { + memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), ((cchRemaining - 1) * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t))); + } + } + } + } + } + + if (FAILED(hr)) + { + if (pszDest) + { + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); + + if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + } + else if (cchDest > 0) + { + pszDestEnd = pszDest + cchDest - 1; + cchRemaining = 1; + + // null terminate the end of the string + *pszDestEnd = L'\0'; + } + } + + if (dwFlags & (STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION)) + { + if (cchDest > 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + // null terminate the beginning of the string + *pszDestEnd = L'\0'; + } + } + } + } + + if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) + { + if (ppszDestEnd) + { + *ppszDestEnd = pszDestEnd; + } + + if (pcchRemaining) + { + *pcchRemaining = cchRemaining; + } + } + + return hr; +} + +STRSAFEAPI StringLengthWorkerA(const char* psz, size_t cchMax, size_t* pcch) +{ + HRESULT hr = S_OK; + size_t cchMaxPrev = cchMax; + + while (cchMax && (*psz != '\0')) + { + psz++; + cchMax--; + } + + if (cchMax == 0) + { + // the string is longer than cchMax + hr = STRSAFE_E_INVALID_PARAMETER; + } + + if (SUCCEEDED(hr) && pcch) + { + *pcch = cchMaxPrev - cchMax; + } + + return hr; +} + +STRSAFEAPI StringLengthWorkerW(const wchar_t* psz, size_t cchMax, size_t* pcch) +{ + HRESULT hr = S_OK; + size_t cchMaxPrev = cchMax; + + while (cchMax && (*psz != L'\0')) + { + psz++; + cchMax--; + } + + if (cchMax == 0) + { + // the string is longer than cchMax + hr = STRSAFE_E_INVALID_PARAMETER; + } + + if (SUCCEEDED(hr) && pcch) + { + *pcch = cchMaxPrev - cchMax; + } + + return hr; +} +#endif // STRSAFE_INLINE + +#ifndef STRSAFE_LIB_IMPL +STRSAFE_INLINE_API StringGetsExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr = S_OK; + char* pszDestEnd = pszDest; + size_t cchRemaining = 0; + + // ASSERT(cbDest == (cchDest * sizeof(char)) || + // cbDest == (cchDest * sizeof(char)) + (cbDest % sizeof(char))); + + // only accept valid flags + if (dwFlags & (~STRSAFE_VALID_FLAGS)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + if (dwFlags & STRSAFE_IGNORE_NULLS) + { + if (pszDest == NULL) + { + if ((cchDest != 0) || (cbDest != 0)) + { + // NULL pszDest and non-zero cchDest/cbDest is invalid + hr = STRSAFE_E_INVALID_PARAMETER; + } + } + } + + if (SUCCEEDED(hr)) + { + if (cchDest <= 1) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + if (cchDest == 1) + { + *pszDestEnd = '\0'; + } + + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + else + { + char ch; + + pszDestEnd = pszDest; + cchRemaining = cchDest; + + while ((cchRemaining > 1) && (ch = (char)getc(stdin)) != '\n') + { + if (ch == EOF) + { + if (pszDestEnd == pszDest) + { + // we failed to read anything from stdin + hr = STRSAFE_E_END_OF_FILE; + } + break; + } + + *pszDestEnd = ch; + + pszDestEnd++; + cchRemaining--; + } + + if (cchRemaining > 0) + { + // there is extra room + if (dwFlags & STRSAFE_FILL_BEHIND_NULL) + { + memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), ((cchRemaining - 1) * sizeof(char)) + (cbDest % sizeof(char))); + } + } + + *pszDestEnd = '\0'; + } + } + } + + if (FAILED(hr)) + { + if (pszDest) + { + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); + + if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + } + else if (cchDest > 0) + { + pszDestEnd = pszDest + cchDest - 1; + cchRemaining = 1; + + // null terminate the end of the string + *pszDestEnd = '\0'; + } + } + + if (dwFlags & (STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION)) + { + if (cchDest > 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + // null terminate the beginning of the string + *pszDestEnd = '\0'; + } + } + } + } + + if (SUCCEEDED(hr) || + (hr == STRSAFE_E_INSUFFICIENT_BUFFER) || + (hr == STRSAFE_E_END_OF_FILE)) + { + if (ppszDestEnd) + { + *ppszDestEnd = pszDestEnd; + } + + if (pcchRemaining) + { + *pcchRemaining = cchRemaining; + } + } + + return hr; +} + +STRSAFE_INLINE_API StringGetsExWorkerW(wchar_t* pszDest, size_t cchDest, size_t cbDest, wchar_t** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +{ + HRESULT hr = S_OK; + wchar_t* pszDestEnd = pszDest; + size_t cchRemaining = 0; + + // ASSERT(cbDest == (cchDest * sizeof(char)) || + // cbDest == (cchDest * sizeof(char)) + (cbDest % sizeof(char))); + + // only accept valid flags + if (dwFlags & (~STRSAFE_VALID_FLAGS)) + { + hr = STRSAFE_E_INVALID_PARAMETER; + } + else + { + if (dwFlags & STRSAFE_IGNORE_NULLS) + { + if (pszDest == NULL) + { + if ((cchDest != 0) || (cbDest != 0)) + { + // NULL pszDest and non-zero cchDest/cbDest is invalid + hr = STRSAFE_E_INVALID_PARAMETER; + } + } + } + + if (SUCCEEDED(hr)) + { + if (cchDest <= 1) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + if (cchDest == 1) + { + *pszDestEnd = L'\0'; + } + + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } + else + { + wchar_t ch; + + pszDestEnd = pszDest; + cchRemaining = cchDest; + + while ((cchRemaining > 1) && (ch = (wchar_t)getwc(stdin)) != L'\n') + { + if (ch == EOF) + { + if (pszDestEnd == pszDest) + { + // we failed to read anything from stdin + hr = STRSAFE_E_END_OF_FILE; + } + break; + } + + *pszDestEnd = ch; + + pszDestEnd++; + cchRemaining--; + } + + if (cchRemaining > 0) + { + // there is extra room + if (dwFlags & STRSAFE_FILL_BEHIND_NULL) + { + memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), ((cchRemaining - 1) * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t))); + } + } + + *pszDestEnd = L'\0'; + } + } + } + + if (FAILED(hr)) + { + if (pszDest) + { + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); + + if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + } + else if (cchDest > 0) + { + pszDestEnd = pszDest + cchDest - 1; + cchRemaining = 1; + + // null terminate the end of the string + *pszDestEnd = L'\0'; + } + } + + if (dwFlags & (STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION)) + { + if (cchDest > 0) + { + pszDestEnd = pszDest; + cchRemaining = cchDest; + + // null terminate the beginning of the string + *pszDestEnd = L'\0'; + } + } + } + } + + if (SUCCEEDED(hr) || + (hr == STRSAFE_E_INSUFFICIENT_BUFFER) || + (hr == STRSAFE_E_END_OF_FILE)) + { + if (ppszDestEnd) + { + *ppszDestEnd = pszDestEnd; + } + + if (pcchRemaining) + { + *pcchRemaining = cchRemaining; + } + } + + return hr; +} +#endif // !STRSAFE_LIB_IMPL + + +// Do not call these functions, they are worker functions for internal use within this file +#ifdef DEPRECATE_SUPPORTED +#pragma deprecated(StringCopyWorkerA) +#pragma deprecated(StringCopyWorkerW) +#pragma deprecated(StringCopyExWorkerA) +#pragma deprecated(StringCopyExWorkerW) +#pragma deprecated(StringCatWorkerA) +#pragma deprecated(StringCatWorkerW) +#pragma deprecated(StringCatExWorkerA) +#pragma deprecated(StringCatExWorkerW) +#pragma deprecated(StringCatNWorkerA) +#pragma deprecated(StringCatNWorkerW) +#pragma deprecated(StringCatNExWorkerA) +#pragma deprecated(StringCatNExWorkerW) +#pragma deprecated(StringVPrintfWorkerA) +#pragma deprecated(StringVPrintfWorkerW) +#pragma deprecated(StringVPrintfExWorkerA) +#pragma deprecated(StringVPrintfExWorkerW) +#pragma deprecated(StringLengthWorkerA) +#pragma deprecated(StringLengthWorkerW) +#else +#define StringCopyWorkerA StringCopyWorkerA_instead_use_StringCchCopyA_or_StringCchCopyExA; +#define StringCopyWorkerW StringCopyWorkerW_instead_use_StringCchCopyW_or_StringCchCopyExW; +#define StringCopyExWorkerA StringCopyExWorkerA_instead_use_StringCchCopyA_or_StringCchCopyExA; +#define StringCopyExWorkerW StringCopyExWorkerW_instead_use_StringCchCopyW_or_StringCchCopyExW; +#define StringCatWorkerA StringCatWorkerA_instead_use_StringCchCatA_or_StringCchCatExA; +#define StringCatWorkerW StringCatWorkerW_instead_use_StringCchCatW_or_StringCchCatExW; +#define StringCatExWorkerA StringCatExWorkerA_instead_use_StringCchCatA_or_StringCchCatExA; +#define StringCatExWorkerW StringCatExWorkerW_instead_use_StringCchCatW_or_StringCchCatExW; +#define StringCatNWorkerA StringCatNWorkerA_instead_use_StringCchCatNA_or_StrincCbCatNA; +#define StringCatNWorkerW StringCatNWorkerW_instead_use_StringCchCatNW_or_StringCbCatNW; +#define StringCatNExWorkerA StringCatNExWorkerA_instead_use_StringCchCatNExA_or_StringCbCatNExA; +#define StringCatNExWorkerW StringCatNExWorkerW_instead_use_StringCchCatNExW_or_StringCbCatNExW; +#define StringVPrintfWorkerA StringVPrintfWorkerA_instead_use_StringCchVPrintfA_or_StringCchVPrintfExA; +#define StringVPrintfWorkerW StringVPrintfWorkerW_instead_use_StringCchVPrintfW_or_StringCchVPrintfExW; +#define StringVPrintfExWorkerA StringVPrintfExWorkerA_instead_use_StringCchVPrintfA_or_StringCchVPrintfExA; +#define StringVPrintfExWorkerW StringVPrintfExWorkerW_instead_use_StringCchVPrintfW_or_StringCchVPrintfExW; +#define StringLengthWorkerA StringLengthWorkerA_instead_use_StringCchLengthA_or_StringCbLengthA; +#define StringLengthWorkerW StringLengthWorkerW_instead_use_StringCchLengthW_or_StringCbLengthW; +#endif // !DEPRECATE_SUPPORTED + + +#ifndef STRSAFE_NO_DEPRECATE +// Deprecate all of the unsafe functions to generate compiletime errors. If you do not want +// this then you can #define STRSAFE_NO_DEPRECATE before including this file. +#ifdef DEPRECATE_SUPPORTED + +// First all the names that are a/w variants (or shouldn't be #defined by now anyway). +#pragma deprecated(lstrcpyA) +#pragma deprecated(lstrcpyW) +#pragma deprecated(lstrcatA) +#pragma deprecated(lstrcatW) +#pragma deprecated(wsprintfA) +#pragma deprecated(wsprintfW) + +#pragma deprecated(StrCpyW) +#pragma deprecated(StrCatW) +#pragma deprecated(StrNCatA) +#pragma deprecated(StrNCatW) +#pragma deprecated(StrCatNA) +#pragma deprecated(StrCatNW) +#pragma deprecated(wvsprintfA) +#pragma deprecated(wvsprintfW) + +#pragma deprecated(strcpy) +#pragma deprecated(wcscpy) +#pragma deprecated(strcat) +#pragma deprecated(wcscat) +#pragma deprecated(sprintf) +#pragma deprecated(swprintf) +#pragma deprecated(vsprintf) +#pragma deprecated(vswprintf) +#pragma deprecated(_snprintf) +#pragma deprecated(_snwprintf) +#pragma deprecated(_vsnprintf) +#pragma deprecated(_vsnwprintf) +#pragma deprecated(gets) +#pragma deprecated(_getws) + +// Then all the windows.h names - we need to undef and redef based on UNICODE setting +#undef lstrcpy +#undef lstrcat +#undef wsprintf +#undef wvsprintf +#pragma deprecated(lstrcpy) +#pragma deprecated(lstrcat) +#pragma deprecated(wsprintf) +#pragma deprecated(wvsprintf) +#ifdef UNICODE +#define lstrcpy lstrcpyW +#define lstrcat lstrcatW +#define wsprintf wsprintfW +#define wvsprintf wvsprintfW +#else +#define lstrcpy lstrcpyA +#define lstrcat lstrcatA +#define wsprintf wsprintfA +#define wvsprintf wvsprintfA +#endif + +// Then the shlwapi names - they key off UNICODE also. +#undef StrCpyA +#undef StrCpy +#undef StrCatA +#undef StrCat +#undef StrNCat +#undef StrCatN +#pragma deprecated(StrCpyA) +#pragma deprecated(StrCatA) +#pragma deprecated(StrCatN) +#pragma deprecated(StrCpy) +#pragma deprecated(StrCat) +#pragma deprecated(StrNCat) +#define StrCpyA lstrcpyA +#define StrCatA lstrcatA +#define StrCatN StrNCat +#ifdef UNICODE +#define StrCpy StrCpyW +#define StrCat StrCatW +#define StrNCat StrNCatW +#else +#define StrCpy lstrcpyA +#define StrCat lstrcatA +#define StrNCat StrNCatA +#endif + +// Then all the CRT names - we need to undef/redef based on _UNICODE value. +#undef _tcscpy +#undef _ftcscpy +#undef _tcscat +#undef _ftcscat +#undef _stprintf +#undef _sntprintf +#undef _vstprintf +#undef _vsntprintf +#undef _getts +#pragma deprecated(_tcscpy) +#pragma deprecated(_ftcscpy) +#pragma deprecated(_tcscat) +#pragma deprecated(_ftcscat) +#pragma deprecated(_stprintf) +#pragma deprecated(_sntprintf) +#pragma deprecated(_vstprintf) +#pragma deprecated(_vsntprintf) +#pragma deprecated(_getts) +#ifdef _UNICODE +#define _tcscpy wcscpy +#define _ftcscpy wcscpy +#define _tcscat wcscat +#define _ftcscat wcscat +#define _stprintf swprintf +#define _sntprintf _snwprintf +#define _vstprintf vswprintf +#define _vsntprintf _vsnwprintf +#define _getts _getws +#else +#define _tcscpy strcpy +#define _ftcscpy strcpy +#define _tcscat strcat +#define _ftcscat strcat +#define _stprintf sprintf +#define _sntprintf _snprintf +#define _vstprintf vsprintf +#define _vsntprintf _vsnprintf +#define _getts gets +#endif + +#else // DEPRECATE_SUPPORTED + +#undef strcpy +#define strcpy strcpy_instead_use_StringCbCopyA_or_StringCchCopyA; + +#undef wcscpy +#define wcscpy wcscpy_instead_use_StringCbCopyW_or_StringCchCopyW; + +#undef strcat +#define strcat strcat_instead_use_StringCbCatA_or_StringCchCatA; + +#undef wcscat +#define wcscat wcscat_instead_use_StringCbCatW_or_StringCchCatW; + +#undef sprintf +#define sprintf sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA; + +#undef swprintf +#define swprintf swprintf_instead_use_StringCbPrintfW_or_StringCchPrintfW; + +#undef vsprintf +#define vsprintf vsprintf_instead_use_StringCbVPrintfA_or_StringCchVPrintfA; + +#undef vswprintf +#define vswprintf vswprintf_instead_use_StringCbVPrintfW_or_StringCchVPrintfW; + +#undef _snprintf +#define _snprintf _snprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA; + +#undef _snwprintf +#define _snwprintf _snwprintf_instead_use_StringCbPrintfW_or_StringCchPrintfW; + +#undef _vsnprintf +#define _vsnprintf _vsnprintf_instead_use_StringCbVPrintfA_or_StringCchVPrintfA; + +#undef _vsnwprintf +#define _vsnwprintf _vsnwprintf_instead_use_StringCbVPrintfW_or_StringCchVPrintfW; + +#undef strcpyA +#define strcpyA strcpyA_instead_use_StringCbCopyA_or_StringCchCopyA; + +#undef strcpyW +#define strcpyW strcpyW_instead_use_StringCbCopyW_or_StringCchCopyW; + +#undef lstrcpy +#define lstrcpy lstrcpy_instead_use_StringCbCopy_or_StringCchCopy; + +#undef lstrcpyA +#define lstrcpyA lstrcpyA_instead_use_StringCbCopyA_or_StringCchCopyA; + +#undef lstrcpyW +#define lstrcpyW lstrcpyW_instead_use_StringCbCopyW_or_StringCchCopyW; + +#undef StrCpy +#define StrCpy StrCpy_instead_use_StringCbCopy_or_StringCchCopy; + +#undef StrCpyA +#define StrCpyA StrCpyA_instead_use_StringCbCopyA_or_StringCchCopyA; + +#undef StrCpyW +#define StrCpyW StrCpyW_instead_use_StringCbCopyW_or_StringCchCopyW; + +#undef _tcscpy +#define _tcscpy _tcscpy_instead_use_StringCbCopy_or_StringCchCopy; + +#undef _ftcscpy +#define _ftcscpy _ftcscpy_instead_use_StringCbCopy_or_StringCchCopy; + +#undef lstrcat +#define lstrcat lstrcat_instead_use_StringCbCat_or_StringCchCat; + +#undef lstrcatA +#define lstrcatA lstrcatA_instead_use_StringCbCatA_or_StringCchCatA; + +#undef lstrcatW +#define lstrcatW lstrcatW_instead_use_StringCbCatW_or_StringCchCatW; + +#undef StrCat +#define StrCat StrCat_instead_use_StringCbCat_or_StringCchCat; + +#undef StrCatA +#define StrCatA StrCatA_instead_use_StringCbCatA_or_StringCchCatA; + +#undef StrCatW +#define StrCatW StrCatW_instead_use_StringCbCatW_or_StringCchCatW; + +#undef StrNCat +#define StrNCat StrNCat_instead_use_StringCbCatN_or_StringCchCatN; + +#undef StrNCatA +#define StrNCatA StrNCatA_instead_use_StringCbCatNA_or_StringCchCatNA; + +#undef StrNCatW +#define StrNCatW StrNCatW_instead_use_StringCbCatNW_or_StringCchCatNW; + +#undef StrCatN +#define StrCatN StrCatN_instead_use_StringCbCatN_or_StringCchCatN; + +#undef StrCatNA +#define StrCatNA StrCatNA_instead_use_StringCbCatNA_or_StringCchCatNA; + +#undef StrCatNW +#define StrCatNW StrCatNW_instead_use_StringCbCatNW_or_StringCchCatNW; + +#undef _tcscat +#define _tcscat _tcscat_instead_use_StringCbCat_or_StringCchCat; + +#undef _ftcscat +#define _ftcscat _ftcscat_instead_use_StringCbCat_or_StringCchCat; + +#undef wsprintf +#define wsprintf wsprintf_instead_use_StringCbPrintf_or_StringCchPrintf; + +#undef wsprintfA +#define wsprintfA wsprintfA_instead_use_StringCbPrintfA_or_StringCchPrintfA; + +#undef wsprintfW +#define wsprintfW wsprintfW_instead_use_StringCbPrintfW_or_StringCchPrintfW; + +#undef wvsprintf +#define wvsprintf wvsprintf_instead_use_StringCbVPrintf_or_StringCchVPrintf; + +#undef wvsprintfA +#define wvsprintfA wvsprintfA_instead_use_StringCbVPrintfA_or_StringCchVPrintfA; + +#undef wvsprintfW +#define wvsprintfW wvsprintfW_instead_use_StringCbVPrintfW_or_StringCchVPrintfW; + +#undef _vstprintf +#define _vstprintf _vstprintf_instead_use_StringCbVPrintf_or_StringCchVPrintf; + +#undef _vsntprintf +#define _vsntprintf _vsntprintf_instead_use_StringCbVPrintf_or_StringCchVPrintf; + +#undef _stprintf +#define _stprintf _stprintf_instead_use_StringCbPrintf_or_StringCchPrintf; + +#undef _sntprintf +#define _sntprintf _sntprintf_instead_use_StringCbPrintf_or_StringCchPrintf; + +#undef _getts +#define _getts _getts_instead_use_StringCbGets_or_StringCchGets; + +#undef gets +#define gets _gets_instead_use_StringCbGetsA_or_StringCchGetsA; + +#undef _getws +#define _getws _getws_instead_use_StringCbGetsW_or_StringCchGetsW; + +#endif // !DEPRECATE_SUPPORTED +#endif // !STRSAFE_NO_DEPRECATE + +#ifdef _NTSTRSAFE_H_INCLUDED_ +#pragma warning(pop) +#endif // _NTSTRSAFE_H_INCLUDED_ + +#endif // _STRSAFE_H_INCLUDED_ diff --git a/Src/Decoder_H264_ALL/D3D/include/xact.h b/Src/Decoder_H264_ALL/D3D/include/xact.h new file mode 100644 index 0000000..6955b83 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/xact.h @@ -0,0 +1,1643 @@ +/*++ + +Copyright (C) Microsoft Corporation. All rights reserved. + +Module Name: + + xact.h + +Abstract: + + XACT public interfaces, functions and data types + +--*/ + +#pragma once + +#ifndef _XACT_H_ +#define _XACT_H_ + +//------------------------------------------------------------------------------ +// XACT class and interface IDs (Version 2.9) +//------------------------------------------------------------------------------ +#ifndef _XBOX // XACT COM support only exists on Windows + #include // For DEFINE_CLSID, DEFINE_IID and DECLARE_INTERFACE + DEFINE_CLSID(XACTEngine, 343e68e6, 8f82, 4a8d, a2, da, 6e, 9a, 94, 4b, 37, 8c); + DEFINE_CLSID(XACTAuditionEngine, cedde475, 50b5, 47ef, 91, a7, 3b, 49, a0, e8, e5, 88); + DEFINE_CLSID(XACTDebugEngine, 3cbb606b, 06f1, 473e, 9d, d5, 0e, 4a, 3b, 47, 14, 13); + DEFINE_IID(IXACTEngine, 893ff2e4, 8d03, 4d5f, b0, aa, 36, 3a, 9c, bb, f4, 37); +#endif + +// Ignore the rest of this header if only the GUID definitions were requested: +#ifndef GUID_DEFS_ONLY + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ + +#ifndef _XBOX + #include + #include + #include +#else + #include +#endif +#include +#include + +//------------------------------------------------------------------------------ +// Forward Declarations +//------------------------------------------------------------------------------ + +typedef struct IXACTSoundBank IXACTSoundBank; +typedef struct IXACTWaveBank IXACTWaveBank; +typedef struct IXACTCue IXACTCue; +typedef struct IXACTWave IXACTWave; +typedef struct IXACTEngine IXACTEngine; +typedef struct XACT_NOTIFICATION XACT_NOTIFICATION; + + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +typedef WORD XACTINDEX; // All normal indices +typedef BYTE XACTNOTIFICATIONTYPE; // Notification type +typedef FLOAT XACTVARIABLEVALUE; // Variable value +typedef WORD XACTVARIABLEINDEX; // Variable index +typedef WORD XACTCATEGORY; // Sound category +typedef BYTE XACTCHANNEL; // Audio channel +typedef FLOAT XACTVOLUME; // Volume value +typedef LONG XACTTIME; // Time (in ms) +typedef SHORT XACTPITCH; // Pitch value +typedef BYTE XACTLOOPCOUNT; // For all loops / recurrences +typedef BYTE XACTVARIATIONWEIGHT; // Variation weight +typedef BYTE XACTPRIORITY; // Sound priority +typedef BYTE XACTINSTANCELIMIT; // Instance limitations + +//------------------------------------------------------------------------------ +// Standard win32 multimedia definitions +//------------------------------------------------------------------------------ +#ifndef WAVE_FORMAT_IEEE_FLOAT + #define WAVE_FORMAT_IEEE_FLOAT 0x0003 +#endif + +#ifndef WAVE_FORMAT_EXTENSIBLE + #define WAVE_FORMAT_EXTENSIBLE 0xFFFE +#endif + +#ifndef _WAVEFORMATEX_ +#define _WAVEFORMATEX_ + #pragma pack(push, 1) + typedef struct tWAVEFORMATEX + { + WORD wFormatTag; // format type + WORD nChannels; // number of channels (i.e. mono, stereo...) + DWORD nSamplesPerSec; // sample rate + DWORD nAvgBytesPerSec; // for buffer estimation + WORD nBlockAlign; // block size of data + WORD wBitsPerSample; // Number of bits per sample of mono data + WORD cbSize; // The count in bytes of the size of extra information (after cbSize) + + } WAVEFORMATEX, *PWAVEFORMATEX; + typedef WAVEFORMATEX NEAR *NPWAVEFORMATEX; + typedef WAVEFORMATEX FAR *LPWAVEFORMATEX; + #pragma pack(pop) +#endif + +#ifndef _WAVEFORMATEXTENSIBLE_ +#define _WAVEFORMATEXTENSIBLE_ + #pragma pack(push, 1) + typedef struct + { + WAVEFORMATEX Format; // WAVEFORMATEX data + + union + { + WORD wValidBitsPerSample; // Bits of precision + WORD wSamplesPerBlock; // Samples per block of audio data, valid if wBitsPerSample==0 + WORD wReserved; // Unused -- If neither applies, set to zero. + } Samples; + + DWORD dwChannelMask; // Speaker usage bitmask + GUID SubFormat; // Sub-format identifier + } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE; + #pragma pack(pop) +#endif + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ +static const XACTTIME XACTTIME_MIN = LONG_MIN; +static const XACTTIME XACTTIME_MAX = LONG_MAX; // 24 days 20:31:23.647 +static const XACTTIME XACTTIME_INFINITE = LONG_MAX; +static const XACTINSTANCELIMIT XACTINSTANCELIMIT_INFINITE = 0xff; +static const XACTINSTANCELIMIT XACTINSTANCELIMIT_MIN = 0x00; // == 1 instance total (0 additional instances) +static const XACTINSTANCELIMIT XACTINSTANCELIMIT_MAX = 0xfe; // == 255 instances total (254 additional instances) +static const XACTINDEX XACTINDEX_MIN = 0x0; +static const XACTINDEX XACTINDEX_MAX = 0xfffe; +static const XACTINDEX XACTINDEX_INVALID = 0xffff; +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MIN = 0x00; +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MAX = 0xff; +static const XACTVARIABLEVALUE XACTVARIABLEVALUE_MIN = -FLT_MAX; +static const XACTVARIABLEVALUE XACTVARIABLEVALUE_MAX = FLT_MAX; +static const XACTVARIABLEINDEX XACTVARIABLEINDEX_MIN = 0x0000; +static const XACTVARIABLEINDEX XACTVARIABLEINDEX_MAX = 0xfffe; +static const XACTVARIABLEINDEX XACTVARIABLEINDEX_INVALID = 0xffff; +static const XACTCATEGORY XACTCATEGORY_MIN = 0x0; +static const XACTCATEGORY XACTCATEGORY_MAX = 0xfffe; +static const XACTCATEGORY XACTCATEGORY_INVALID = 0xffff; +static const XACTCHANNEL XACTCHANNEL_MIN = 0; +static const XACTCHANNEL XACTCHANNEL_MAX = 0xFF; +static const XACTPITCH XACTPITCH_MIN = -1200; // pitch change allowable per individual content field +static const XACTPITCH XACTPITCH_MAX = 1200; +static const XACTPITCH XACTPITCH_MIN_TOTAL = -2400; // total allowable pitch change, use with IXACTWave.SetPitch() +static const XACTPITCH XACTPITCH_MAX_TOTAL = 2400; +static const XACTVOLUME XACTVOLUME_MIN = 0.0f; +static const XACTVOLUME XACTVOLUME_MAX = FLT_MAX; +static const XACTVARIABLEVALUE XACTPARAMETERVALUE_MIN = -FLT_MAX; +static const XACTVARIABLEVALUE XACTPARAMETERVALUE_MAX = FLT_MAX; +static const XACTLOOPCOUNT XACTLOOPCOUNT_MIN = 0x0; +static const XACTLOOPCOUNT XACTLOOPCOUNT_MAX = 0xfe; +static const XACTLOOPCOUNT XACTLOOPCOUNT_INFINITE = 0xff; +static const DWORD XACTWAVEALIGNMENT_MIN = 2048; +#ifdef _XBOX +static const XAUDIOVOICEINDEX XACTMAXOUTPUTVOICECOUNT = 3; +#endif // _XBOX + + +// ----------------------------------------------------------------------------- +// Cue friendly name length +// ----------------------------------------------------------------------------- +#define XACT_CUE_NAME_LENGTH 0xFF + +// ----------------------------------------------------------------------------- +// Current Content Tool Version +// ----------------------------------------------------------------------------- +#define XACT_CONTENT_VERSION 43 + +// ----------------------------------------------------------------------------- +// XACT Stop Flags +// ----------------------------------------------------------------------------- +static const DWORD XACT_FLAG_STOP_RELEASE = 0x00000000; // Stop with release envelope (or as authored), for looping waves this acts as break loop. +static const DWORD XACT_FLAG_STOP_IMMEDIATE = 0x00000001; // Stop immediately + +// ----------------------------------------------------------------------------- +// XACT Manage Data Flag - XACT will manage the lifetime of this data +// ----------------------------------------------------------------------------- +static const DWORD XACT_FLAG_MANAGEDATA = 0x00000001; + +// ----------------------------------------------------------------------------- +// XACT Content Preparation Flags +// ----------------------------------------------------------------------------- +static const DWORD XACT_FLAG_BACKGROUND_MUSIC = 0x00000002; // Marks the waves as background music. +static const DWORD XACT_FLAG_UNITS_MS = 0x00000004; // Indicates that the units passed in are in milliseconds. +static const DWORD XACT_FLAG_UNITS_SAMPLES = 0x00000008; // Indicates that the units passed in are in samples. + +// ----------------------------------------------------------------------------- +// XACT State flags +// ----------------------------------------------------------------------------- +static const DWORD XACT_STATE_CREATED = 0x00000001; // Created, but nothing else +static const DWORD XACT_STATE_PREPARING = 0x00000002; // In the middle of preparing +static const DWORD XACT_STATE_PREPARED = 0x00000004; // Prepared, but not yet played +static const DWORD XACT_STATE_PLAYING = 0x00000008; // Playing (though could be paused) +static const DWORD XACT_STATE_STOPPING = 0x00000010; // Stopping +static const DWORD XACT_STATE_STOPPED = 0x00000020; // Stopped +static const DWORD XACT_STATE_PAUSED = 0x00000040; // Paused (Can be combined with some of the other state flags above) +static const DWORD XACT_STATE_INUSE = 0x00000080; // Object is in use (used by wavebanks and soundbanks). +static const DWORD XACT_STATE_PREPAREFAILED = 0x80000000; // Object preparation failed. + +//------------------------------------------------------------------------------ +// XACT Parameters +//------------------------------------------------------------------------------ + +#define XACT_FLAG_GLOBAL_SETTINGS_MANAGEDATA XACT_FLAG_MANAGEDATA + +// ----------------------------------------------------------------------------- +// File IO Callbacks +// ----------------------------------------------------------------------------- +typedef BOOL (__stdcall * XACT_READFILE_CALLBACK)(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped); +typedef BOOL (__stdcall * XACT_GETOVERLAPPEDRESULT_CALLBACK)(HANDLE hFile, LPOVERLAPPED lpOverlapped, LPDWORD lpNumberOfBytesTransferred, BOOL bWait); + +typedef struct XACT_FILEIO_CALLBACKS +{ + XACT_READFILE_CALLBACK readFileCallback; + XACT_GETOVERLAPPEDRESULT_CALLBACK getOverlappedResultCallback; + +} XACT_FILEIO_CALLBACKS, *PXACT_FILEIO_CALLBACKS; +typedef const XACT_FILEIO_CALLBACKS *PCXACT_FILEIO_CALLBACKS; + +// ----------------------------------------------------------------------------- +// Notification Callback +// ----------------------------------------------------------------------------- +typedef void (__stdcall * XACT_NOTIFICATION_CALLBACK)(const XACT_NOTIFICATION* pNotification); + +#ifndef _XBOX + +#define XACT_RENDERER_ID_LENGTH 0xff // Maximum number of characters allowed in the renderer ID +#define XACT_RENDERER_NAME_LENGTH 0xff // Maximum number of characters allowed in the renderer display name. + +// ----------------------------------------------------------------------------- +// Renderer Details +// ----------------------------------------------------------------------------- +typedef struct XACT_RENDERER_DETAILS +{ + WCHAR rendererID[XACT_RENDERER_ID_LENGTH]; // The string ID for the rendering device. + WCHAR displayName[XACT_RENDERER_NAME_LENGTH]; // A friendly name suitable for display to a human. + BOOL defaultDevice; // Set to TRUE if this device is the primary audio device on the system. + +} XACT_RENDERER_DETAILS, *LPXACT_RENDERER_DETAILS; +#endif + +// ----------------------------------------------------------------------------- +// Engine Look-Ahead Time +// ----------------------------------------------------------------------------- +#define XACT_ENGINE_LOOKAHEAD_DEFAULT 250 // Default look-ahead time of 250ms can be used during XACT engine initialization. + +// ----------------------------------------------------------------------------- +// Runtime (engine) parameters +// ----------------------------------------------------------------------------- +typedef struct XACT_RUNTIME_PARAMETERS +{ + DWORD lookAheadTime; // Time in ms + void* pGlobalSettingsBuffer; // Buffer containing the global settings file + DWORD globalSettingsBufferSize; // Size of global settings buffer + DWORD globalSettingsFlags; // Flags for global settings + DWORD globalSettingsAllocAttributes; // Global settings buffer allocation attributes (see XMemAlloc) + XACT_FILEIO_CALLBACKS fileIOCallbacks; // File I/O callbacks + XACT_NOTIFICATION_CALLBACK fnNotificationCallback; // Callback that receives notifications. +#ifndef _XBOX + PWSTR pRendererID; // Ptr to the ID for the audio renderer the engine should connect to. +#endif + +} XACT_RUNTIME_PARAMETERS, *LPXACT_RUNTIME_PARAMETERS; +typedef const XACT_RUNTIME_PARAMETERS *LPCXACT_RUNTIME_PARAMETERS; + +//------------------------------------------------------------------------------ +// Streaming Parameters +//------------------------------------------------------------------------------ + +typedef struct XACT_STREAMING_PARAMETERS +{ + HANDLE file; // File handle associated with wavebank data + DWORD offset; // Offset within file of wavebank header (must be sector aligned) + DWORD flags; // Flags (none currently) + WORD packetSize; // Stream packet size (in sectors) to use for each stream (min = 2) + // number of sectors (DVD = 2048 bytes: 2 = 4096, 3 = 6144, 4 = 8192 etc.) + // optimal DVD size is a multiple of 16 (DVD block = 16 DVD sectors) + +} XACT_WAVEBANK_STREAMING_PARAMETERS, *LPXACT_WAVEBANK_STREAMING_PARAMETERS, XACT_STREAMING_PARAMETERS, *LPXACT_STREAMING_PARAMETERS; +typedef const XACT_STREAMING_PARAMETERS *LPCXACT_STREAMING_PARAMETERS; +typedef const XACT_WAVEBANK_STREAMING_PARAMETERS *LPCXACT_WAVEBANK_STREAMING_PARAMETERS; + +// Structure used to report cue properties back to the client. +typedef struct XACT_CUE_PROPERTIES +{ + CHAR friendlyName[XACT_CUE_NAME_LENGTH]; // Empty if the soundbank doesn't contain any friendly names + BOOL interactive; // TRUE if an IA cue; FALSE otherwise + XACTINDEX iaVariableIndex; // Only valid for IA cues; XACTINDEX_INVALID otherwise + XACTINDEX numVariations; // Number of variations in the cue + XACTINSTANCELIMIT maxInstances; // Number of maximum instances for this cue + XACTINSTANCELIMIT currentInstances; // Current active instances of this cue + +} XACT_CUE_PROPERTIES, *LPXACT_CUE_PROPERTIES; + +// Strucutre used to return the track properties. +typedef struct XACT_TRACK_PROPERTIES +{ + XACTTIME duration; // Duration of the track in ms + XACTINDEX numVariations; // Number of wave variations in the track + XACTCHANNEL numChannels; // Number of channels for the active wave variation on this track + XACTINDEX waveVariation; // Index of the active wave variation + XACTLOOPCOUNT loopCount; // Current loop count on this track + +} XACT_TRACK_PROPERTIES, *LPXACT_TRACK_PROPERTIES; + +// Structure used to return the properties of a variation. +typedef struct XACT_VARIATION_PROPERTIES +{ + XACTINDEX index; // Index of the variation in the cue's variation list + XACTVARIATIONWEIGHT weight; // Weight for the active variation. Valid only for complex cues + XACTVARIABLEVALUE iaVariableMin; // Valid only for IA cues + XACTVARIABLEVALUE iaVariableMax; // Valid only for IA cues + BOOL linger; // Valid only for IA cues + +} XACT_VARIATION_PROPERTIES, *LPXACT_VARIATION_PROPERTIES; + +// Structure used to return the properties of the sound referenced by a variation. +typedef struct XACT_SOUND_PROPERTIES +{ + XACTCATEGORY category; // Category this sound belongs to + BYTE priority; // Priority of this variation + XACTPITCH pitch; // Current pitch set on the active variation + XACTVOLUME volume; // Current volume set on the active variation + XACTINDEX numTracks; // Number of tracks in the active variation + XACT_TRACK_PROPERTIES arrTrackProperties[1]; // Array of active track properties (has numTracks number of elements) + +} XACT_SOUND_PROPERTIES, *LPXACT_SOUND_PROPERTIES; + +// Structure used to return the properties of the active variation and the sound referenced. +typedef struct XACT_SOUND_VARIATION_PROPERTIES +{ + XACT_VARIATION_PROPERTIES variationProperties;// Properties for this variation + XACT_SOUND_PROPERTIES soundProperties; // Proeprties for the sound referenced by this variation + +} XACT_SOUND_VARIATION_PROPERTIES, *LPXACT_SOUND_VARIATION_PROPERTIES; + +// Structure used to return the properties of an active cue instance. +typedef struct XACT_CUE_INSTANCE_PROPERTIES +{ + DWORD allocAttributes; // Buffer allocation attributes (see XMemAlloc) + XACT_CUE_PROPERTIES cueProperties; // Properties of the cue that are shared by all instances. + XACT_SOUND_VARIATION_PROPERTIES activeVariationProperties; // Properties if the currently active variation. + +} XACT_CUE_INSTANCE_PROPERTIES, *LPXACT_CUE_INSTANCE_PROPERTIES; + +// Structure used to return the common wave properties. +typedef struct XACT_WAVE_PROPERTIES +{ + char friendlyName[WAVEBANK_ENTRYNAME_LENGTH]; // Friendly name for the wave; empty if the wavebank doesn't contain friendly names. + WAVEBANKMINIWAVEFORMAT format; // Format for the wave. + DWORD durationInSamples; // Duration of the wave in units of one sample + WAVEBANKSAMPLEREGION loopRegion; // Loop region defined in samples. + BOOL streaming; // Set to TRUE if the wave is streaming; FALSE otherwise. + +} XACT_WAVE_PROPERTIES, *LPXACT_WAVE_PROPERTIES; +typedef const XACT_WAVE_PROPERTIES* LPCXACT_WAVE_PROPERTIES; + +// Structure used to return the properties specific to a wave instance. +typedef struct XACT_WAVE_INSTANCE_PROPERTIES +{ + XACT_WAVE_PROPERTIES properties; // Static properties common to all the wave instances. + BOOL backgroundMusic; // Set to TRUE if the wave is tagged as background music; FALSE otherwise. + +} XACT_WAVE_INSTANCE_PROPERTIES, *LPXACT_WAVE_INSTANCE_PROPERTIES; +typedef const XACT_WAVE_INSTANCE_PROPERTIES* LPCXACT_WAVE_INSTANCE_PROPERTIES; + +//------------------------------------------------------------------------------ +// Channel Mapping / Speaker Panning +//------------------------------------------------------------------------------ + +typedef struct XACTCHANNELMAPENTRY +{ + XACTCHANNEL InputChannel; + XACTCHANNEL OutputChannel; + XACTVOLUME Volume; + +} XACTCHANNELMAPENTRY, *LPXACTCHANNELMAPENTRY; +typedef const XACTCHANNELMAPENTRY *LPCXACTCHANNELMAPENTRY; + +typedef struct XACTCHANNELMAP +{ + XACTCHANNEL EntryCount; + XACTCHANNELMAPENTRY* paEntries; + +} XACTCHANNELMAP, *LPXACTCHANNELMAP; +typedef const XACTCHANNELMAP *LPCXACTCHANNELMAP; + +typedef struct XACTCHANNELVOLUMEENTRY +{ + XACTCHANNEL EntryIndex; + XACTVOLUME Volume; + +} XACTCHANNELVOLUMEENTRY, *LPXACTCHANNELVOLUMEENTRY; +typedef const XACTCHANNELVOLUMEENTRY *LPCXACTCHANNELVOLUMEENTRY; + +typedef struct XACTCHANNELVOLUME +{ + XACTCHANNEL EntryCount; + XACTCHANNELVOLUMEENTRY* paEntries; + +} XACTCHANNELVOLUME, *LPXACTCHANNELVOLUME; +typedef const XACTCHANNELVOLUME *LPCXACTCHANNELVOLUME; + +//------------------------------------------------------------------------------ +// Notifications +//------------------------------------------------------------------------------ + +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEPREPARED = 1; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEPLAY = 2; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUESTOP = 3; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEDESTROYED = 4; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MARKER = 5; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED = 6; // None, SoundBank +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKDESTROYED = 7; // None, WaveBank +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_LOCALVARIABLECHANGED = 8; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GLOBALVARIABLECHANGED = 9; // None +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GUICONNECTED = 10; // None +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GUIDISCONNECTED = 11; // None +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEPREPARED = 12; // None, WaveBank & wave index, wave instance. +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEPLAY = 13; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVESTOP = 14; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVELOOPED = 15; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEDESTROYED = 16; // None, WaveBank & wave index, wave instance. +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKPREPARED = 17; // None, WaveBank +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKSTREAMING_INVALIDCONTENT = 18; // None, WaveBank + +static const BYTE XACT_FLAG_NOTIFICATION_PERSIST = 0x01; + +// Pack the notification structures +#pragma pack(push, 1) + +// Notification description used for registering, un-registering and flushing notifications +typedef struct XACT_NOTIFICATION_DESCRIPTION +{ + XACTNOTIFICATIONTYPE type; // Notification type + BYTE flags; // Flags + IXACTSoundBank* pSoundBank; // SoundBank instance + IXACTWaveBank* pWaveBank; // WaveBank instance + IXACTCue* pCue; // Cue instance + IXACTWave* pWave; // Wave instance + XACTINDEX cueIndex; // Cue index + XACTINDEX waveIndex; // Wave index + PVOID pvContext; // User context (optional) + +} XACT_NOTIFICATION_DESCRIPTION, *LPXACT_NOTIFICATION_DESCRIPTION; +typedef const XACT_NOTIFICATION_DESCRIPTION *LPCXACT_NOTIFICATION_DESCRIPTION; + +// Notification structure for all XACTNOTIFICATIONTYPE_CUE* notifications +typedef struct XACT_NOTIFICATION_CUE +{ + XACTINDEX cueIndex; // Cue index + IXACTSoundBank* pSoundBank; // SoundBank instance + IXACTCue* pCue; // Cue instance + +} XACT_NOTIFICATION_CUE, *LPXACT_NOTIFICATION_CUE; +typedef const XACT_NOTIFICATION_CUE *LPCXACT_NOTIFICATION_CUE; + +// Notification structure for all XACTNOTIFICATIONTYPE_MARKER* notifications +typedef struct XACT_NOTIFICATION_MARKER +{ + XACTINDEX cueIndex; // Cue index + IXACTSoundBank* pSoundBank; // SoundBank instance + IXACTCue* pCue; // Cue instance + DWORD marker; // Marker value + +} XACT_NOTIFICATION_MARKER, *LPXACT_NOTIFICATION_MARKER; +typedef const XACT_NOTIFICATION_MARKER *LPCXACT_NOTIFICATION_MARKER; + +// Notification structure for all XACTNOTIFICATIONTYPE_SOUNDBANK* notifications +typedef struct XACT_NOTIFICATION_SOUNDBANK +{ + IXACTSoundBank* pSoundBank; // SoundBank instance + +} XACT_NOTIFICATION_SOUNDBANK, *LPXACT_NOTIFICATION_SOUNDBANK; +typedef const XACT_NOTIFICATION_SOUNDBANK *LPCXACT_NOTIFICATION_SOUNDBANK; + +// Notification structure for all XACTNOTIFICATIONTYPE_WAVEBANK* notifications +typedef struct XACT_NOTIFICATION_WAVEBANK +{ + IXACTWaveBank* pWaveBank; // WaveBank instance + +} XACT_NOTIFICATION_WAVEBANK, *LPXACT_NOTIFICATION_WAVEBANK; +typedef const XACT_NOTIFICATION_WAVEBANK *LPCXACT_NOTIFICATION_WAVEBANK; + +// Notification structure for all XACTNOTIFICATIONTYPE_*VARIABLE* notifications +typedef struct XACT_NOTIFICATION_VARIABLE +{ + XACTINDEX cueIndex; // Cue index + IXACTSoundBank* pSoundBank; // SoundBank instance + IXACTCue* pCue; // Cue instance + XACTVARIABLEINDEX variableIndex; // Variable index + XACTVARIABLEVALUE variableValue; // Variable value + BOOL local; // TRUE if a local variable + +} XACT_NOTIFICATION_VARIABLE, *LPXACT_NOTIFICATION_VARIABLE; +typedef const XACT_NOTIFICATION_VARIABLE *LPCXACT_NOTIFICATION_VARIABLE; + +// Notification structure for all XACTNOTIFICATIONTYPE_GUI* notifications +typedef struct XACT_NOTIFICATION_GUI +{ + DWORD reserved; // Reserved +} XACT_NOTIFICATION_GUI, *LPXACT_NOTIFICATION_GUI; +typedef const XACT_NOTIFICATION_GUI *LPCXACT_NOTIFICATION_GUI; + +// Notification structure for all XACTNOTIFICATIONTYPE_WAVE* notifications +typedef struct XACT_NOTIFICATION_WAVE +{ + IXACTWaveBank* pWaveBank; // WaveBank + XACTINDEX waveIndex; // Wave index + XACTINDEX cueIndex; // Cue index + IXACTSoundBank* pSoundBank; // SoundBank instance + IXACTCue* pCue; // Cue instance + IXACTWave* pWave; // Wave instance + +} XACT_NOTIFICATION_WAVE, *LPXACT_NOTIFICATION_WAVE; +typedef const XACT_NOTIFICATION_WAVE *LPCXACT_NOTIFICATION_WAVE; + +// General notification structure +typedef struct XACT_NOTIFICATION +{ + XACTNOTIFICATIONTYPE type; // Notification type + LONG timeStamp; // Timestamp of notification (milliseconds) + PVOID pvContext; // User context (optional) + union + { + XACT_NOTIFICATION_CUE cue; // XACTNOTIFICATIONTYPE_CUE* + XACT_NOTIFICATION_MARKER marker; // XACTNOTIFICATIONTYPE_MARKER* + XACT_NOTIFICATION_SOUNDBANK soundBank; // XACTNOTIFICATIONTYPE_SOUNDBANK* + XACT_NOTIFICATION_WAVEBANK waveBank; // XACTNOTIFICATIONTYPE_WAVEBANK* + XACT_NOTIFICATION_VARIABLE variable; // XACTNOTIFICATIONTYPE_VARIABLE* + XACT_NOTIFICATION_GUI gui; // XACTNOTIFICATIONTYPE_GUI* + XACT_NOTIFICATION_WAVE wave; // XACTNOTIFICATIONTYPE_WAVE* + }; + +} XACT_NOTIFICATION, *LPXACT_NOTIFICATION; +typedef const XACT_NOTIFICATION *LPCXACT_NOTIFICATION; +#pragma pack(pop) + +//------------------------------------------------------------------------------ +// IXACTSoundBank +//------------------------------------------------------------------------------ + +#define XACT_FLAG_SOUNDBANK_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE +#define XACT_SOUNDBANKSTATE_INUSE XACT_STATE_INUSE + +STDAPI_(XACTINDEX) IXACTSoundBank_GetCueIndex(IXACTSoundBank* pSoundBank, PCSTR szFriendlyName); +STDAPI IXACTSoundBank_GetNumCues(IXACTSoundBank* pSoundBank, XACTINDEX* pnNumCues); +STDAPI IXACTSoundBank_GetCueProperties(IXACTSoundBank* pSoundBank, XACTINDEX nCueIndex, LPXACT_CUE_PROPERTIES pProperties); +STDAPI IXACTSoundBank_Prepare(IXACTSoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, IXACTCue** ppCue); +STDAPI IXACTSoundBank_Play(IXACTSoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, IXACTCue** ppCue); +STDAPI IXACTSoundBank_Stop(IXACTSoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags); +STDAPI IXACTSoundBank_Destroy(IXACTSoundBank* pSoundBank); +STDAPI IXACTSoundBank_GetState(IXACTSoundBank* pSoundBank, DWORD* pdwState); + +#undef INTERFACE +#define INTERFACE IXACTSoundBank + +DECLARE_INTERFACE(IXACTSoundBank) +{ + STDMETHOD_(XACTINDEX, GetCueIndex)(THIS_ PCSTR szFriendlyName) PURE; + STDMETHOD(GetNumCues)(THIS_ XACTINDEX* pnNumCues) PURE; + STDMETHOD(GetCueProperties)(THIS_ XACTINDEX nCueIndex, LPXACT_CUE_PROPERTIES pProperties) PURE; + STDMETHOD(Prepare)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, IXACTCue** ppCue) PURE; + STDMETHOD(Play)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, IXACTCue** ppCue) PURE; + STDMETHOD(Stop)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags) PURE; + STDMETHOD(Destroy)(THIS) PURE; + STDMETHOD(GetState)(THIS_ DWORD* pdwState) PURE; +}; + +#ifdef __cplusplus + +__inline HRESULT __stdcall IXACTSoundBank_Destroy(IXACTSoundBank* pSoundBank) +{ + return pSoundBank->Destroy(); +} + +__inline XACTINDEX __stdcall IXACTSoundBank_GetCueIndex(IXACTSoundBank* pSoundBank, PCSTR szFriendlyName) +{ + return pSoundBank->GetCueIndex(szFriendlyName); +} + +__inline HRESULT __stdcall IXACTSoundBank_GetNumCues(IXACTSoundBank* pSoundBank, XACTINDEX* pnNumCues) +{ + return pSoundBank->GetNumCues(pnNumCues); +} + +__inline HRESULT __stdcall IXACTSoundBank_GetCueProperties(IXACTSoundBank* pSoundBank, XACTINDEX nCueIndex, LPXACT_CUE_PROPERTIES pProperties) +{ + return pSoundBank->GetCueProperties(nCueIndex, pProperties); +} + +__inline HRESULT __stdcall IXACTSoundBank_Prepare(IXACTSoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, IXACTCue** ppCue) +{ + return pSoundBank->Prepare(nCueIndex, dwFlags, timeOffset, ppCue); +} + +__inline HRESULT __stdcall IXACTSoundBank_Play(IXACTSoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, IXACTCue** ppCue) +{ + return pSoundBank->Play(nCueIndex, dwFlags, timeOffset, ppCue); +} + +__inline HRESULT __stdcall IXACTSoundBank_Stop(IXACTSoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags) +{ + return pSoundBank->Stop(nCueIndex, dwFlags); +} + +__inline HRESULT __stdcall IXACTSoundBank_GetState(IXACTSoundBank* pSoundBank, DWORD* pdwState) +{ + return pSoundBank->GetState(pdwState); +} + +#else // __cplusplus + +__inline HRESULT __stdcall IXACTSoundBank_Destroy(IXACTSoundBank* pSoundBank) +{ + return pSoundBank->lpVtbl->Destroy(pSoundBank); +} + +__inline XACTINDEX __stdcall IXACTSoundBank_GetCueIndex(IXACTSoundBank* pSoundBank, PCSTR szFriendlyName) +{ + return pSoundBank->lpVtbl->GetCueIndex(pSoundBank, szFriendlyName); +} + +__inline HRESULT __stdcall IXACTSoundBank_GetNumCues(IXACTSoundBank* pSoundBank, XACTINDEX* pnNumCues) +{ + return pSoundBank->lpVtbl->GetNumCues(pSoundBank, pnNumCues); +} + +__inline HRESULT __stdcall IXACTSoundBank_GetCueProperties(IXACTSoundBank* pSoundBank, XACTINDEX nCueIndex, LPXACT_CUE_PROPERTIES pProperties) +{ + return pSoundBank->lpVtbl->GetCueProperties(pSoundBank, nCueIndex, pProperties); +} + +__inline HRESULT __stdcall IXACTSoundBank_Prepare(IXACTSoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, IXACTCue** ppCue) +{ + return pSoundBank->lpVtbl->Prepare(pSoundBank, nCueIndex, dwFlags, timeOffset, ppCue); +} + +__inline HRESULT __stdcall IXACTSoundBank_Play(IXACTSoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, IXACTCue** ppCue) +{ + return pSoundBank->lpVtbl->Play(pSoundBank, nCueIndex, dwFlags, timeOffset, ppCue); +} + +__inline HRESULT __stdcall IXACTSoundBank_Stop(IXACTSoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags) +{ + return pSoundBank->lpVtbl->Stop(pSoundBank, nCueIndex, dwFlags); +} + +__inline HRESULT __stdcall IXACTSoundBank_GetState(IXACTSoundBank* pSoundBank, DWORD* pdwState) +{ + return pSoundBank->lpVtbl->GetState(pSoundBank, pdwState); +} + +#endif // __cplusplus + +//------------------------------------------------------------------------------ +// IXACTWaveBank +//------------------------------------------------------------------------------ +#define XACT_WAVEBANKSTATE_INUSE XACT_STATE_INUSE // Currently in-use +#define XACT_WAVEBANKSTATE_PREPARED XACT_STATE_PREPARED // Prepared +#define XACT_WAVEBANKSTATE_PREPAREFAILED XACT_STATE_PREPAREFAILED // Prepare failed. + + +STDAPI IXACTWaveBank_Destroy(IXACTWaveBank* pWaveBank); +STDAPI IXACTWaveBank_GetState(IXACTWaveBank* pWaveBank, DWORD* pdwState); +STDAPI IXACTWaveBank_GetNumWaves(IXACTWaveBank* pWaveBank, XACTINDEX* pnNumWaves); +STDAPI_(XACTINDEX) IXACTWaveBank_GetWaveIndex(IXACTWaveBank* pWaveBank, PCSTR szFriendlyName); +STDAPI IXACTWaveBank_GetWaveProperties(IXACTWaveBank* pWaveBank, XACTINDEX nWaveIndex, LPXACT_WAVE_PROPERTIES pWaveProperties); +STDAPI IXACTWaveBank_Prepare(IXACTWaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave); +STDAPI IXACTWaveBank_Play(IXACTWaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave); +STDAPI IXACTWaveBank_Stop(IXACTWaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags); + +#undef INTERFACE +#define INTERFACE IXACTWaveBank + +DECLARE_INTERFACE(IXACTWaveBank) +{ + STDMETHOD(Destroy)(THIS) PURE; + STDMETHOD(GetNumWaves)(THIS_ XACTINDEX* pnNumWaves) PURE; + STDMETHOD_(XACTINDEX, GetWaveIndex)(THIS_ PCSTR szFriendlyName) PURE; + STDMETHOD(GetWaveProperties)(THIS_ XACTINDEX nWaveIndex, LPXACT_WAVE_PROPERTIES pWaveProperties) PURE; + STDMETHOD(Prepare)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave) PURE; + STDMETHOD(Play)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave) PURE; + STDMETHOD(Stop)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags) PURE; + STDMETHOD(GetState)(THIS_ DWORD* pdwState) PURE; +}; + +#ifdef __cplusplus + +__inline HRESULT __stdcall IXACTWaveBank_Destroy(IXACTWaveBank* pWaveBank) +{ + return pWaveBank->Destroy(); +} + +__inline HRESULT __stdcall IXACTWaveBank_GetNumWaves(IXACTWaveBank* pWaveBank, XACTINDEX* pnNumWaves) +{ + return pWaveBank->GetNumWaves(pnNumWaves); +} + +__inline XACTINDEX __stdcall IXACTWaveBank_GetWaveIndex(IXACTWaveBank* pWaveBank, PCSTR szFriendlyName) +{ + return pWaveBank->GetWaveIndex(szFriendlyName); +} + +__inline HRESULT __stdcall IXACTWaveBank_GetWaveProperties(IXACTWaveBank* pWaveBank, XACTINDEX nWaveIndex, LPXACT_WAVE_PROPERTIES pWaveProperties) +{ + return pWaveBank->GetWaveProperties(nWaveIndex, pWaveProperties); +} + +__inline HRESULT __stdcall IXACTWaveBank_Prepare(IXACTWaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave) +{ + return pWaveBank->Prepare(nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACTWaveBank_Play(IXACTWaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave) +{ + return pWaveBank->Play(nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACTWaveBank_Stop(IXACTWaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags) +{ + return pWaveBank->Stop(nWaveIndex, dwFlags); +} + +__inline HRESULT __stdcall IXACTWaveBank_GetState(IXACTWaveBank* pWaveBank, DWORD* pdwState) +{ + return pWaveBank->GetState(pdwState); +} + +#else // __cplusplus + +__inline HRESULT __stdcall IXACTWaveBank_Destroy(IXACTWaveBank* pWaveBank) +{ + return pWaveBank->lpVtbl->Destroy(pWaveBank); +} + +__inline HRESULT __stdcall IXACTWaveBank_GetNumWaves(IXACTWaveBank* pWaveBank, XACTINDEX* pnNumWaves) +{ + return pWaveBank->lpVtbl->GetNumWaves(pWaveBank, pnNumWaves); +} + +__inline XACTINDEX __stdcall IXACTWaveBank_GetWaveIndex(IXACTWaveBank* pWaveBank, PCSTR szFriendlyName) +{ + return pWaveBank->lpVtbl->GetWaveIndex(pWaveBank, szFriendlyName); +} + +__inline HRESULT __stdcall IXACTWaveBank_GetWaveProperties(IXACTWaveBank* pWaveBank, XACTINDEX nWaveIndex, LPXACT_WAVE_PROPERTIES pWaveProperties) +{ + return pWaveBank->lpVtbl->GetWaveProperties(pWaveBank, nWaveIndex, pWaveProperties); +} + +__inline HRESULT __stdcall IXACTWaveBank_Prepare(IXACTWaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave) +{ + return pWaveBank->lpVtbl->Prepare(pWaveBank, nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACTWaveBank_Play(IXACTWaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave) +{ + return pWaveBank->lpVtbl->Play(pWaveBank, nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACTWaveBank_Stop(IXACTWaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags) +{ + return pWaveBank->lpVtbl->Stop(pWaveBank, nWaveIndex, dwFlags); +} + +__inline HRESULT __stdcall IXACTWaveBank_GetState(IXACTWaveBank* pWaveBank, DWORD* pdwState) +{ + return pWaveBank->lpVtbl->GetState(pWaveBank, pdwState); +} +#endif // __cplusplus + + +//------------------------------------------------------------------------------ +// IXACTWave +//------------------------------------------------------------------------------ + +STDAPI IXACTWave_Destroy(IXACTWave* pWave); +STDAPI IXACTWave_Play(IXACTWave* pWave); +STDAPI IXACTWave_Stop(IXACTWave* pWave, DWORD dwFlags); +STDAPI IXACTWave_Pause(IXACTWave* pWave, BOOL fPause); +STDAPI IXACTWave_GetState(IXACTWave* pWave, DWORD* pdwState); +STDAPI IXACTWave_SetPitch(IXACTWave* pWave, XACTPITCH pitch); +STDAPI IXACTWave_SetVolume(IXACTWave* pWave, XACTVOLUME volume); +STDAPI IXACTWave_SetMatrixCoefficients(IXACTWave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, float* pMatrixCoefficients); +STDAPI IXACTWave_GetProperties(IXACTWave* pWave, LPXACT_WAVE_INSTANCE_PROPERTIES pProperties); + +#undef INTERFACE +#define INTERFACE IXACTWave + +DECLARE_INTERFACE(IXACTWave) +{ + STDMETHOD(Destroy)(THIS) PURE; + STDMETHOD(Play)(THIS) PURE; + STDMETHOD(Stop)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(Pause)(THIS_ BOOL fPause) PURE; + STDMETHOD(GetState)(THIS_ DWORD* pdwState) PURE; + STDMETHOD(SetPitch)(THIS_ XACTPITCH pitch) PURE; + STDMETHOD(SetVolume)(THIS_ XACTVOLUME volume) PURE; + STDMETHOD(SetMatrixCoefficients)(THIS_ UINT32 uSrcChannelCount, UINT32 uDstChannelCount, float* pMatrixCoefficients) PURE; + STDMETHOD(GetProperties)(THIS_ LPXACT_WAVE_INSTANCE_PROPERTIES pProperties) PURE; +}; + +#ifdef __cplusplus + +__inline HRESULT __stdcall IXACTWave_Destroy(IXACTWave* pWave) +{ + return pWave->Destroy(); +} + +__inline HRESULT __stdcall IXACTWave_Play(IXACTWave* pWave) +{ + return pWave->Play(); +} + +__inline HRESULT __stdcall IXACTWave_Stop(IXACTWave* pWave, DWORD dwFlags) +{ + return pWave->Stop(dwFlags); +} + +__inline HRESULT __stdcall IXACTWave_Pause(IXACTWave* pWave, BOOL fPause) +{ + return pWave->Pause(fPause); +} + +__inline HRESULT __stdcall IXACTWave_GetState(IXACTWave* pWave, DWORD* pdwState) +{ + return pWave->GetState(pdwState); +} + +__inline HRESULT __stdcall IXACTWave_SetPitch(IXACTWave* pWave, XACTPITCH pitch) +{ + return pWave->SetPitch(pitch); +} + +__inline HRESULT __stdcall IXACTWave_SetVolume(IXACTWave* pWave, XACTVOLUME volume) +{ + return pWave->SetVolume(volume); +} + +__inline HRESULT __stdcall IXACTWave_SetMatrixCoefficients(IXACTWave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, float* pMatrixCoefficients) +{ + return pWave->SetMatrixCoefficients(uSrcChannelCount, uDstChannelCount, pMatrixCoefficients); +} + +__inline HRESULT __stdcall IXACTWave_GetProperties(IXACTWave* pWave, LPXACT_WAVE_INSTANCE_PROPERTIES pProperties) +{ + return pWave->GetProperties(pProperties); +} + +#else // __cplusplus + +__inline HRESULT __stdcall IXACTWave_Destroy(IXACTWave* pWave) +{ + return pWave->lpVtbl->Destroy(pWave); +} + +__inline HRESULT __stdcall IXACTWave_Play(IXACTWave* pWave) +{ + return pWave->lpVtbl->Play(pWave); +} + +__inline HRESULT __stdcall IXACTWave_Stop(IXACTWave* pWave, DWORD dwFlags) +{ + return pWave->lpVtbl->Stop(pWave, dwFlags); +} + +__inline HRESULT __stdcall IXACTWave_Pause(IXACTWave* pWave, BOOL fPause) +{ + return pWave->lpVtbl->Pause(pWave, fPause); +} + +__inline HRESULT __stdcall IXACTWave_GetState(IXACTWave* pWave, DWORD* pdwState) +{ + return pWave->lpVtbl->GetState(pWave, pdwState); +} + +__inline HRESULT __stdcall IXACTWave_SetPitch(IXACTWave* pWave, XACTPITCH pitch) +{ + return pWave->lpVtbl->SetPitch(pWave, pitch); +} + +__inline HRESULT __stdcall IXACTWave_SetVolume(IXACTWave* pWave, XACTVOLUME volume) +{ + return pWave->lpVtbl->SetVolume(pWave, volume); +} + +__inline HRESULT __stdcall IXACTWave_SetMatrixCoefficients(IXACTWave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, float* pMatrixCoefficients) +{ + return pWave->lpVtbl->SetMatrixCoefficients(pWave, uSrcChannelCount, uDstChannelCount, pMatrixCoefficients); +} + +__inline HRESULT __stdcall IXACTWave_GetProperties(IXACTWave* pWave, LPXACT_WAVE_INSTANCE_PROPERTIES pProperties) +{ + return pWave->lpVtbl->GetProperties(pWave, pProperties); +} +#endif // __cplusplus + +//------------------------------------------------------------------------------ +// IXACTCue +//------------------------------------------------------------------------------ + +// Cue Flags +#define XACT_FLAG_CUE_STOP_RELEASE XACT_FLAG_STOP_RELEASE +#define XACT_FLAG_CUE_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE + +// Mutually exclusive states +#define XACT_CUESTATE_CREATED XACT_STATE_CREATED // Created, but nothing else +#define XACT_CUESTATE_PREPARING XACT_STATE_PREPARING // In the middle of preparing +#define XACT_CUESTATE_PREPARED XACT_STATE_PREPARED // Prepared, but not yet played +#define XACT_CUESTATE_PLAYING XACT_STATE_PLAYING // Playing (though could be paused) +#define XACT_CUESTATE_STOPPING XACT_STATE_STOPPING // Stopping +#define XACT_CUESTATE_STOPPED XACT_STATE_STOPPED // Stopped +#define XACT_CUESTATE_PAUSED XACT_STATE_PAUSED // Paused (can be combined with other states) + +STDAPI IXACTCue_Destroy(IXACTCue* pCue); +STDAPI IXACTCue_Play(IXACTCue* pCue); +STDAPI IXACTCue_Stop(IXACTCue* pCue, DWORD dwFlags); +STDAPI IXACTCue_GetState(IXACTCue* pCue, DWORD* pdwState); +STDAPI IXACTCue_GetChannelMap(IXACTCue*, LPXACTCHANNELMAP pChannelMap, DWORD BufferSize, LPDWORD pRequiredSize); +STDAPI IXACTCue_SetChannelMap(IXACTCue*, LPCXACTCHANNELMAP pChannelMap); +STDAPI IXACTCue_GetChannelVolume(IXACTCue*, LPXACTCHANNELVOLUME pVolume); +STDAPI IXACTCue_SetChannelVolume(IXACTCue*, LPCXACTCHANNELVOLUME pVolume); +STDAPI IXACTCue_SetMatrixCoefficients(IXACTCue*, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, float* pMatrixCoefficients); +STDAPI_(XACTVARIABLEINDEX) IXACTCue_GetVariableIndex(IXACTCue* pCue, PCSTR szFriendlyName); +STDAPI IXACTCue_SetVariable(IXACTCue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue); +STDAPI IXACTCue_GetVariable(IXACTCue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE* nValue); +STDAPI IXACTCue_Pause(IXACTCue* pCue, BOOL fPause); +STDAPI IXACTCue_GetProperties(IXACTCue* pCue, LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties); +#ifdef _XBOX +STDAPI IXACTCue_SetVoiceOutput(IXACTCue*, LPCXAUDIOVOICEOUTPUT pVoiceOutput); +STDAPI IXACTCue_SetVoiceOutputVolume(IXACTCue*, LPCXAUDIOVOICEOUTPUTVOLUME pVolume); +#endif // _XBOX + +#undef INTERFACE +#define INTERFACE IXACTCue + +DECLARE_INTERFACE(IXACTCue) +{ + STDMETHOD(Play)(THIS) PURE; + STDMETHOD(Stop)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetState)(THIS_ DWORD* pdwState) PURE; + STDMETHOD(Destroy)(THIS) PURE; + STDMETHOD(GetChannelMap)(THIS_ LPXACTCHANNELMAP pChannelMap, DWORD BufferSize, LPDWORD pRequiredSize) PURE; + STDMETHOD(SetChannelMap)(THIS_ LPCXACTCHANNELMAP pChannelMap) PURE; + STDMETHOD(GetChannelVolume)(THIS_ LPXACTCHANNELVOLUME pVolume) PURE; + STDMETHOD(SetChannelVolume)(THIS_ LPCXACTCHANNELVOLUME pVolume) PURE; + STDMETHOD(SetMatrixCoefficients)(THIS_ UINT32 uSrcChannelCount, UINT32 uDstChannelCount, float* pMatrixCoefficients) PURE; + STDMETHOD_(XACTVARIABLEINDEX, GetVariableIndex)(THIS_ PCSTR szFriendlyName) PURE; + STDMETHOD(SetVariable)(THIS_ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) PURE; + STDMETHOD(GetVariable)(THIS_ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE* nValue) PURE; + STDMETHOD(Pause)(THIS_ BOOL fPause) PURE; + STDMETHOD(GetProperties)(THIS_ LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties) PURE; +#ifdef _XBOX + STDMETHOD(SetVoiceOutput)(THIS_ LPCXAUDIOVOICEOUTPUT pVoiceOutput) PURE; + STDMETHOD(SetVoiceOutputVolume)(THIS_ LPCXAUDIOVOICEOUTPUTVOLUME pVolume) PURE; +#endif // _XBOX +}; + +#ifdef __cplusplus + +__inline HRESULT __stdcall IXACTCue_Play(IXACTCue* pCue) +{ + return pCue->Play(); +} + +__inline HRESULT __stdcall IXACTCue_Stop(IXACTCue* pCue, DWORD dwFlags) +{ + return pCue->Stop(dwFlags); +} + +__inline HRESULT __stdcall IXACTCue_GetState(IXACTCue* pCue, DWORD* pdwState) +{ + return pCue->GetState(pdwState); +} + +__inline HRESULT __stdcall IXACTCue_Destroy(IXACTCue* pCue) +{ + return pCue->Destroy(); +} + +__inline HRESULT __stdcall IXACTCue_GetChannelMap(IXACTCue* pCue, LPXACTCHANNELMAP pChannelMap, DWORD BufferSize, LPDWORD pRequiredSize) +{ + return pCue->GetChannelMap(pChannelMap, BufferSize, pRequiredSize); +} + +__inline HRESULT __stdcall IXACTCue_SetChannelMap(IXACTCue* pCue, LPCXACTCHANNELMAP pChannelMap) +{ + return pCue->SetChannelMap(pChannelMap); +} + +__inline HRESULT __stdcall IXACTCue_GetChannelVolume(IXACTCue* pCue, LPXACTCHANNELVOLUME pVolume) +{ + return pCue->GetChannelVolume(pVolume); +} + +__inline HRESULT __stdcall IXACTCue_SetChannelVolume(IXACTCue* pCue, LPCXACTCHANNELVOLUME pVolume) +{ + return pCue->SetChannelVolume(pVolume); +} + +__inline HRESULT __stdcall IXACTCue_SetMatrixCoefficients(IXACTCue* pCue, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, float* pMatrixCoefficients) +{ + return pCue->SetMatrixCoefficients(uSrcChannelCount, uDstChannelCount, pMatrixCoefficients); +} + +__inline XACTVARIABLEINDEX __stdcall IXACTCue_GetVariableIndex(IXACTCue* pCue, PCSTR szFriendlyName) +{ + return pCue->GetVariableIndex(szFriendlyName); +} + +__inline HRESULT __stdcall IXACTCue_SetVariable(IXACTCue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) +{ + return pCue->SetVariable(nIndex, nValue); +} + +__inline HRESULT __stdcall IXACTCue_GetVariable(IXACTCue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE* pnValue) +{ + return pCue->GetVariable(nIndex, pnValue); +} + +__inline HRESULT __stdcall IXACTCue_Pause(IXACTCue* pCue, BOOL fPause) +{ + return pCue->Pause(fPause); +} + +__inline HRESULT __stdcall IXACTCue_GetProperties(IXACTCue* pCue, LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties) +{ + return pCue->GetProperties(ppProperties); +} + +#ifdef _XBOX +__inline HRESULT __stdcall IXACTCue_SetVoiceOutput(IXACTCue* pCue, LPCXAUDIOVOICEOUTPUT pVoiceOutput) +{ + return pCue->SetVoiceOutput(pVoiceOutput); +} + +__inline HRESULT __stdcall IXACTCue_SetVoiceOutputVolume(IXACTCue* pCue, LPCXAUDIOVOICEOUTPUTVOLUME pVolume) +{ + return pCue->SetVoiceOutputVolume(pVolume); +} +#endif // _XBOX + +#else // __cplusplus + +__inline HRESULT __stdcall IXACTCue_Play(IXACTCue* pCue) +{ + return pCue->lpVtbl->Play(pCue); +} + +__inline HRESULT __stdcall IXACTCue_Stop(IXACTCue* pCue, DWORD dwFlags) +{ + return pCue->lpVtbl->Stop(pCue, dwFlags); +} + +__inline HRESULT __stdcall IXACTCue_GetState(IXACTCue* pCue, DWORD* pdwState) +{ + return pCue->lpVtbl->GetState(pCue, pdwState); +} + +__inline HRESULT __stdcall IXACTCue_Destroy(IXACTCue* pCue) +{ + return pCue->lpVtbl->Destroy(pCue); +} + +__inline HRESULT __stdcall IXACTCue_GetChannelMap(IXACTCue* pCue, LPXACTCHANNELMAP pChannelMap, DWORD BufferSize, LPDWORD pRequiredSize) +{ + return pCue->lpVtbl->GetChannelMap(pCue, pChannelMap, BufferSize, pRequiredSize); +} + +__inline HRESULT __stdcall IXACTCue_SetChannelMap(IXACTCue* pCue, LPCXACTCHANNELMAP pChannelMap) +{ + return pCue->lpVtbl->SetChannelMap(pCue, pChannelMap); +} + +__inline HRESULT __stdcall IXACTCue_GetChannelVolume(IXACTCue* pCue, LPXACTCHANNELVOLUME pVolume) +{ + return pCue->lpVtbl->GetChannelVolume(pCue, pVolume); +} + +__inline HRESULT __stdcall IXACTCue_SetChannelVolume(IXACTCue* pCue, LPCXACTCHANNELVOLUME pVolume) +{ + return pCue->lpVtbl->SetChannelVolume(pCue, pVolume); +} + +__inline HRESULT __stdcall IXACTCue_SetMatrixCoefficients(IXACTCue* pCue, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, float* pMatrixCoefficients) +{ + return pCue->lpVtbl->SetMatrixCoefficients(pCue, uSrcChannelCount, uDstChannelCount, pMatrixCoefficients); +} + +__inline XACTVARIABLEINDEX __stdcall IXACTCue_GetVariableIndex(IXACTCue* pCue, PCSTR szFriendlyName) +{ + return pCue->lpVtbl->GetVariableIndex(pCue, szFriendlyName); +} + +__inline HRESULT __stdcall IXACTCue_SetVariable(IXACTCue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) +{ + return pCue->lpVtbl->SetVariable(pCue, nIndex, nValue); +} + +__inline HRESULT __stdcall IXACTCue_GetVariable(IXACTCue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE* pnValue) +{ + return pCue->lpVtbl->GetVariable(pCue, nIndex, pnValue); +} + +__inline HRESULT __stdcall IXACTCue_Pause(IXACTCue* pCue, BOOL fPause) +{ + return pCue->lpVtbl->Pause(pCue, fPause); +} + +__inline HRESULT __stdcall IXACTCue_GetProperties(IXACTCue* pCue, LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties) +{ + return pCue->lpVtbl->GetProperties(pCue, ppProperties); +} + +#ifdef _XBOX +__inline HRESULT __stdcall IXACTCue_SetVoiceOutput(IXACTCue* pCue, LPCXAUDIOVOICEOUTPUT pVoiceOutput) +{ + return pCue->lpVtbl->SetVoiceOutput(pCue, pVoiceOutput); +} + +__inline HRESULT __stdcall IXACTCue_SetVoiceOutputVolume(IXACTCue* pCue, LPCXAUDIOVOICEOUTPUTVOLUME pVolume) +{ + return pCue->lpVtbl->SetVoiceOutputVolume(pCue, pVolume); +} +#endif // _XBOX + +#endif // __cplusplus + +//------------------------------------------------------------------------------ +// IXACTEngine +//------------------------------------------------------------------------------ + +// Engine flags +#define XACT_FLAG_ENGINE_CREATE_MANAGEDATA XACT_FLAG_MANAGEDATA +#define XACT_FLAG_ENGINE_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE + +STDAPI_(ULONG) IXACTEngine_AddRef(IXACTEngine* pEngine); +STDAPI_(ULONG) IXACTEngine_Release(IXACTEngine* pEngine); +#ifndef _XBOX +STDAPI IXACTEngine_GetRendererCount(IXACTEngine* pEngine, XACTINDEX* pnRendererCount); +STDAPI IXACTEngine_GetRendererDetails(IXACTEngine* pEngine, XACTINDEX nRendererIndex, LPXACT_RENDERER_DETAILS pRendererDetails); +#endif +STDAPI IXACTEngine_GetFinalMixFormat(IXACTEngine* pEngine, WAVEFORMATEXTENSIBLE* pFinalMixFormat); +STDAPI IXACTEngine_Initialize(IXACTEngine* pEngine, const XACT_RUNTIME_PARAMETERS* pParams); +STDAPI IXACTEngine_ShutDown(IXACTEngine* pEngine); +STDAPI IXACTEngine_DoWork(IXACTEngine* pEngine); +STDAPI IXACTEngine_CreateSoundBank(IXACTEngine* pEngine, const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, IXACTSoundBank** ppSoundBank); +STDAPI IXACTEngine_CreateInMemoryWaveBank(IXACTEngine* pEngine, const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, IXACTWaveBank** ppWaveBank); +STDAPI IXACTEngine_CreateStreamingWaveBank(IXACTEngine* pEngine, const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, IXACTWaveBank** ppWaveBank); +STDAPI IXACTEngine_PrepareWave(IXACTEngine* pEngine, DWORD dwFlags, PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave); +STDAPI IXACTEngine_PrepareInMemoryWave(IXACTEngine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, DWORD* pdwSeekTable, BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave); +STDAPI IXACTEngine_PrepareStreamingWave(IXACTEngine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave); +STDAPI IXACTEngine_RegisterNotification(IXACTEngine* pEngine, const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc); +STDAPI IXACTEngine_UnRegisterNotification(IXACTEngine* pEngine, const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc); +STDAPI_(XACTCATEGORY) IXACTEngine_GetCategory(IXACTEngine* pEngine, PCSTR szFriendlyName); +STDAPI IXACTEngine_Stop(IXACTEngine* pEngine, XACTCATEGORY nCategory, DWORD dwFlags); +STDAPI IXACTEngine_SetVolume(IXACTEngine* pEngine, XACTCATEGORY nCategory, XACTVOLUME nVolume); +STDAPI IXACTEngine_Pause(IXACTEngine* pEngine, XACTCATEGORY nCategory, BOOL fPause); +STDAPI_(XACTVARIABLEINDEX) IXACTEngine_GetGlobalVariableIndex(IXACTEngine* pEngine, PCSTR szFriendlyName); +STDAPI IXACTEngine_SetGlobalVariable(IXACTEngine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue); +STDAPI IXACTEngine_GetGlobalVariable(IXACTEngine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE* pnValue); + +#undef INTERFACE +#define INTERFACE IXACTEngine + +#ifdef _XBOX +DECLARE_INTERFACE(IXACTEngine) +{ +#else +DECLARE_INTERFACE_(IXACTEngine, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, OUT void** ppvObj) PURE; +#endif + + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + +#ifndef _XBOX + STDMETHOD(GetRendererCount)(THIS_ XACTINDEX* pnRendererCount) PURE; + STDMETHOD(GetRendererDetails)(THIS_ XACTINDEX nRendererIndex, LPXACT_RENDERER_DETAILS pRendererDetails) PURE; +#endif + + STDMETHOD(GetFinalMixFormat)(THIS_ WAVEFORMATEXTENSIBLE* pFinalMixFormat) PURE; + STDMETHOD(Initialize)(THIS_ const XACT_RUNTIME_PARAMETERS* pParams) PURE; + STDMETHOD(ShutDown)(THIS) PURE; + + STDMETHOD(DoWork)(THIS) PURE; + + STDMETHOD(CreateSoundBank)(THIS_ const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, IXACTSoundBank** ppSoundBank) PURE; + STDMETHOD(CreateInMemoryWaveBank)(THIS_ const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, IXACTWaveBank** ppWaveBank) PURE; + STDMETHOD(CreateStreamingWaveBank)(THIS_ const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, IXACTWaveBank** ppWaveBank) PURE; + + STDMETHOD(PrepareWave)(THIS_ DWORD dwFlags, PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave) PURE; + STDMETHOD(PrepareInMemoryWave)(THIS_ DWORD dwFlags, WAVEBANKENTRY entry, DWORD* pdwSeekTable, BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave) PURE; + STDMETHOD(PrepareStreamingWave)(THIS_ DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave) PURE; + + STDMETHOD(RegisterNotification)(THIS_ const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) PURE; + STDMETHOD(UnRegisterNotification)(THIS_ const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) PURE; + + STDMETHOD_(XACTCATEGORY, GetCategory)(THIS_ PCSTR szFriendlyName) PURE; + STDMETHOD(Stop)(THIS_ XACTCATEGORY nCategory, DWORD dwFlags) PURE; + STDMETHOD(SetVolume)(THIS_ XACTCATEGORY nCategory, XACTVOLUME nVolume) PURE; + STDMETHOD(Pause)(THIS_ XACTCATEGORY nCategory, BOOL fPause) PURE; + + STDMETHOD_(XACTVARIABLEINDEX, GetGlobalVariableIndex)(THIS_ PCSTR szFriendlyName) PURE; + STDMETHOD(SetGlobalVariable)(THIS_ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) PURE; + STDMETHOD(GetGlobalVariable)(THIS_ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE* nValue) PURE; +}; + +#ifdef __cplusplus + +__inline ULONG __stdcall IXACTEngine_AddRef(IXACTEngine* pEngine) +{ + return pEngine->AddRef(); +} + +__inline ULONG __stdcall IXACTEngine_Release(IXACTEngine* pEngine) +{ + return pEngine->Release(); +} + +#ifndef _XBOX +__inline HRESULT __stdcall IXACTEngine_GetRendererCount(IXACTEngine* pEngine, XACTINDEX* pnRendererCount) +{ + return pEngine->GetRendererCount(pnRendererCount); +} + +__inline HRESULT __stdcall IXACTEngine_GetRendererDetails(IXACTEngine* pEngine, XACTINDEX nRendererIndex, LPXACT_RENDERER_DETAILS pRendererDetails) +{ + return pEngine->GetRendererDetails(nRendererIndex, pRendererDetails); +} +#endif + +__inline HRESULT __stdcall IXACTEngine_GetFinalMixFormat(IXACTEngine* pEngine, WAVEFORMATEXTENSIBLE* pFinalMixFormat) +{ + return pEngine->GetFinalMixFormat(pFinalMixFormat); +} + +__inline HRESULT __stdcall IXACTEngine_Initialize(IXACTEngine* pEngine, const XACT_RUNTIME_PARAMETERS* pParams) +{ + return pEngine->Initialize(pParams); +} + +__inline HRESULT __stdcall IXACTEngine_ShutDown(IXACTEngine* pEngine) +{ + return pEngine->ShutDown(); +} + +__inline HRESULT __stdcall IXACTEngine_DoWork(IXACTEngine* pEngine) +{ + return pEngine->DoWork(); +} + +__inline HRESULT __stdcall IXACTEngine_CreateSoundBank(IXACTEngine* pEngine, const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, IXACTSoundBank** ppSoundBank) +{ + return pEngine->CreateSoundBank(pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppSoundBank); +} + +__inline HRESULT __stdcall IXACTEngine_CreateInMemoryWaveBank(IXACTEngine* pEngine, const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, IXACTWaveBank** ppWaveBank) +{ + return pEngine->CreateInMemoryWaveBank(pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppWaveBank); +} + +__inline HRESULT __stdcall IXACTEngine_CreateStreamingWaveBank(IXACTEngine* pEngine, const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, IXACTWaveBank** ppWaveBank) +{ + return pEngine->CreateStreamingWaveBank(pParms, ppWaveBank); +} + +__inline HRESULT __stdcall IXACTEngine_PrepareWave(IXACTEngine* pEngine, DWORD dwFlags, PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave * * ppWave) +{ + return pEngine->PrepareWave(dwFlags, szWavePath, wStreamingPacketSize, dwAlignment, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACTEngine_PrepareInMemoryWave(IXACTEngine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, DWORD* pdwSeekTable, BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave) +{ + return pEngine->PrepareInMemoryWave(dwFlags, entry, pdwSeekTable, pbWaveData, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACTEngine_PrepareStreamingWave(IXACTEngine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave) +{ + return pEngine->PrepareStreamingWave(dwFlags, entry, streamingParams, dwAlignment, pdwSeekTable, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACTEngine_RegisterNotification(IXACTEngine* pEngine, const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) +{ + return pEngine->RegisterNotification(pNotificationDesc); +} + +__inline HRESULT __stdcall IXACTEngine_UnRegisterNotification(IXACTEngine* pEngine, const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) +{ + return pEngine->UnRegisterNotification(pNotificationDesc); +} + +__inline XACTCATEGORY __stdcall IXACTEngine_GetCategory(IXACTEngine* pEngine, PCSTR szFriendlyName) +{ + return pEngine->GetCategory(szFriendlyName); +} + +__inline HRESULT __stdcall IXACTEngine_Stop(IXACTEngine* pEngine, XACTCATEGORY nCategory, DWORD dwFlags) +{ + return pEngine->Stop(nCategory, dwFlags); +} + +__inline HRESULT __stdcall IXACTEngine_SetVolume(IXACTEngine* pEngine, XACTCATEGORY nCategory, XACTVOLUME nVolume) +{ + return pEngine->SetVolume(nCategory, nVolume); +} + +__inline HRESULT __stdcall IXACTEngine_Pause(IXACTEngine* pEngine, XACTCATEGORY nCategory, BOOL fPause) +{ + return pEngine->Pause(nCategory, fPause); +} + +__inline XACTVARIABLEINDEX __stdcall IXACTEngine_GetGlobalVariableIndex(IXACTEngine* pEngine, PCSTR szFriendlyName) +{ + return pEngine->GetGlobalVariableIndex(szFriendlyName); +} + +__inline HRESULT __stdcall IXACTEngine_SetGlobalVariable(IXACTEngine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) +{ + return pEngine->SetGlobalVariable(nIndex, nValue); +} + +__inline HRESULT __stdcall IXACTEngine_GetGlobalVariable(IXACTEngine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE* nValue) +{ + return pEngine->GetGlobalVariable(nIndex, nValue); +} + +#else // __cplusplus + +__inline ULONG __stdcall IXACTEngine_AddRef(IXACTEngine* pEngine) +{ + return pEngine->lpVtbl->AddRef(pEngine); +} + +__inline ULONG __stdcall IXACTEngine_Release(IXACTEngine* pEngine) +{ + return pEngine->lpVtbl->Release(pEngine); +} + +#ifndef _XBOX +__inline HRESULT __stdcall IXACTEngine_GetRendererCount(IXACTEngine* pEngine, XACTINDEX* pnRendererCount) +{ + return pEngine->lpVtbl->GetRendererCount(pEngine, pnRendererCount); +} + +__inline HRESULT __stdcall IXACTEngine_GetRendererDetails(IXACTEngine* pEngine, XACTINDEX nRendererIndex, LPXACT_RENDERER_DETAILS pRendererDetails) +{ + return pEngine->lpVtbl->GetRendererDetails(pEngine, nRendererIndex, pRendererDetails); +} +#endif + +__inline HRESULT __stdcall IXACTEngine_GetFinalMixFormat(IXACTEngine* pEngine, WAVEFORMATEXTENSIBLE* pFinalMixFormat) +{ + return pEngine->lpVtbl->GetFinalMixFormat(pEngine, pFinalMixFormat); +} + +__inline HRESULT __stdcall IXACTEngine_Initialize(IXACTEngine* pEngine, const XACT_RUNTIME_PARAMETERS* pParams) +{ + return pEngine->lpVtbl->Initialize(pEngine, pParams); +} + +__inline HRESULT __stdcall IXACTEngine_ShutDown(IXACTEngine* pEngine) +{ + return pEngine->lpVtbl->ShutDown(pEngine); +} + +__inline HRESULT __stdcall IXACTEngine_DoWork(IXACTEngine* pEngine) +{ + return pEngine->lpVtbl->DoWork(pEngine); +} + +__inline HRESULT __stdcall IXACTEngine_CreateSoundBank(IXACTEngine* pEngine, const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, IXACTSoundBank** ppSoundBank) +{ + return pEngine->lpVtbl->CreateSoundBank(pEngine, pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppSoundBank); +} + +__inline HRESULT __stdcall IXACTEngine_CreateInMemoryWaveBank(IXACTEngine* pEngine, const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, IXACTWaveBank** ppWaveBank) +{ + return pEngine->lpVtbl->CreateInMemoryWaveBank(pEngine, pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppWaveBank); +} + +__inline HRESULT __stdcall IXACTEngine_CreateStreamingWaveBank(IXACTEngine* pEngine, const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, IXACTWaveBank** ppWaveBank) +{ + return pEngine->lpVtbl->CreateStreamingWaveBank(pEngine, pParms, ppWaveBank); +} + +__inline HRESULT __stdcall IXACTEngine_PrepareWave(IXACTEngine* pEngine, DWORD dwFlags, PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave * * ppWave) +{ + return pEngine->lpVtbl->PrepareWave(pEngine, dwFlags, szWavePath, wStreamingPacketSize, dwAlignment, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACTEngine_PrepareInMemoryWave(IXACTEngine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, DWORD* pdwSeekTable, BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave) +{ + return pEngine->lpVtbl->PrepareInMemoryWave(pEngine, dwFlags, entry, pdwSeekTable, pbWaveData, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACTEngine_PrepareStreamingWave(IXACTEngine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, IXACTWave** ppWave) +{ + return pEngine->lpVtbl->PrepareStreamingWave(pEngine, dwFlags, entry, streamingParams, dwAlignment, pdwSeekTable, dwPlayOffset, nLoopCount, ppWave); +} + + +__inline HRESULT __stdcall IXACTEngine_RegisterNotification(IXACTEngine* pEngine, const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) +{ + return pEngine->lpVtbl->RegisterNotification(pEngine, pNotificationDesc); +} + +__inline HRESULT __stdcall IXACTEngine_UnRegisterNotification(IXACTEngine* pEngine, const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) +{ + return pEngine->lpVtbl->UnRegisterNotification(pEngine, pNotificationDesc); +} + +__inline XACTCATEGORY __stdcall IXACTEngine_GetCategory(IXACTEngine* pEngine, PCSTR szFriendlyName) +{ + return pEngine->lpVtbl->GetCategory(pEngine, szFriendlyName); +} + +__inline HRESULT __stdcall IXACTEngine_Stop(IXACTEngine* pEngine, XACTCATEGORY nCategory, DWORD dwFlags) +{ + return pEngine->lpVtbl->Stop(pEngine, nCategory, dwFlags); +} + +__inline HRESULT __stdcall IXACTEngine_SetVolume(IXACTEngine* pEngine, XACTCATEGORY nCategory, XACTVOLUME nVolume) +{ + return pEngine->lpVtbl->SetVolume(pEngine, nCategory, nVolume); +} + +__inline HRESULT __stdcall IXACTEngine_Pause(IXACTEngine* pEngine, XACTCATEGORY nCategory, BOOL fPause) +{ + return pEngine->lpVtbl->Pause(pEngine, nCategory, fPause); +} + +__inline XACTVARIABLEINDEX __stdcall IXACTEngine_GetGlobalVariableIndex(IXACTEngine* pEngine, PCSTR szFriendlyName) +{ + return pEngine->lpVtbl->GetGlobalVariableIndex(pEngine, szFriendlyName); +} + +__inline HRESULT __stdcall IXACTEngine_SetGlobalVariable(IXACTEngine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) +{ + return pEngine->lpVtbl->SetGlobalVariable(pEngine, nIndex, nValue); +} + +__inline HRESULT __stdcall IXACTEngine_GetGlobalVariable(IXACTEngine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE* nValue) +{ + return pEngine->lpVtbl->GetGlobalVariable(pEngine, nIndex, nValue); +} + +#endif // __cplusplus + +//------------------------------------------------------------------------------ +// XACT API's (these are deprecated and will be removed in a future release) +//------------------------------------------------------------------------------ + +#ifdef _XBOX + +#define XACT_FLAG_API_CREATE_MANAGEDATA XACT_FLAG_MANAGEDATA +#define XACT_FLAG_API_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE + +STDAPI XACTInitialize(const XACT_RUNTIME_PARAMETERS* pParams); +STDAPI XACTShutDown(void); +STDAPI XACTDoWork(void); + +STDAPI XACTCreateSoundBank(const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, IXACTSoundBank** ppSoundBank); +STDAPI XACTCreateInMemoryWaveBank(const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, IXACTWaveBank** ppWaveBank); +STDAPI XACTCreateStreamingWaveBank(const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, IXACTWaveBank** ppWaveBank); + +STDAPI XACTRegisterNotification(const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc); +STDAPI XACTUnRegisterNotification(const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc); + +STDAPI_(XACTCATEGORY) XACTGetCategory(PCSTR szFriendlyName); +STDAPI XACTStop(XACTCATEGORY nCategory, DWORD dwFlags); +STDAPI XACTSetVolume(XACTCATEGORY nCategory, XACTVOLUME nVolume); +STDAPI XACTPause(XACTCATEGORY nCategory, BOOL fPause); + +STDAPI_(XACTVARIABLEINDEX) XACTGetGlobalVariableIndex(PCSTR szFriendlyName); +STDAPI XACTSetGlobalVariable(XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue); +STDAPI XACTGetGlobalVariable(XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE* pnValue); + +#endif // #ifdef _XBOX + +//------------------------------------------------------------------------------ +// Create Engine +//------------------------------------------------------------------------------ + +// Flags used only in XACTCreateEngine below. These flags are valid but ignored +// when building for Xbox 360; to enable auditioning on that platform you must +// link explicitly to an auditioning version of the XACT static library. +static const DWORD XACT_FLAG_API_AUDITION_MODE = 0x00000001; +static const DWORD XACT_FLAG_API_DEBUG_MODE = 0x00000002; + +STDAPI XACTCreateEngine(DWORD dwCreationFlags, IXACTEngine** ppEngine); + +#ifndef _XBOX + +#define XACT_DEBUGENGINE_REGISTRY_KEY TEXT("Software\\Microsoft\\XACT") +#define XACT_DEBUGENGINE_REGISTRY_VALUE TEXT("DebugEngine") + +#ifdef __cplusplus + +__inline HRESULT __stdcall XACTCreateEngine(DWORD dwCreationFlags, IXACTEngine** ppEngine) +{ + HRESULT hr; + HKEY key; + DWORD data; + DWORD type = REG_DWORD; + DWORD dataSize = sizeof(DWORD); + BOOL debug = (dwCreationFlags & XACT_FLAG_API_DEBUG_MODE) ? TRUE : FALSE; + BOOL audition = (dwCreationFlags & XACT_FLAG_API_AUDITION_MODE) ? TRUE : FALSE; + + // If neither the debug nor audition flags are set, see if the debug registry key is set + if(!debug && !audition && + (RegOpenKeyEx(HKEY_LOCAL_MACHINE, XACT_DEBUGENGINE_REGISTRY_KEY, 0, KEY_READ, &key) == ERROR_SUCCESS)) + { + if(RegQueryValueEx(key, XACT_DEBUGENGINE_REGISTRY_VALUE, NULL, &type, (LPBYTE)&data, &dataSize) == ERROR_SUCCESS) + { + if(data) + { + debug = TRUE; + } + } + RegCloseKey(key); + } + + // Priority order: Audition, Debug, Retail + hr = CoCreateInstance(audition ? __uuidof(XACTAuditionEngine) + : (debug ? __uuidof(XACTDebugEngine) : __uuidof(XACTEngine)), + NULL, CLSCTX_INPROC_SERVER, __uuidof(IXACTEngine), (void**)ppEngine); + + // If debug engine does not exist fallback to retail version + if(FAILED(hr) && debug && !audition) + { + hr = CoCreateInstance(__uuidof(XACTEngine), NULL, CLSCTX_INPROC_SERVER, __uuidof(IXACTEngine), (void**)ppEngine); + } + + return hr; +} + +#else + +__inline HRESULT __stdcall XACTCreateEngine(DWORD dwCreationFlags, IXACTEngine** ppEngine) +{ + HRESULT hr; + HKEY key; + DWORD data; + DWORD type = REG_DWORD; + DWORD dataSize = sizeof(DWORD); + BOOL debug = (dwCreationFlags & XACT_FLAG_API_DEBUG_MODE) ? TRUE : FALSE; + BOOL audition = (dwCreationFlags & XACT_FLAG_API_AUDITION_MODE) ? TRUE : FALSE; + + // If neither the debug nor audition flags are set, see if the debug registry key is set + if(!debug && !audition && + (RegOpenKeyEx(HKEY_LOCAL_MACHINE, XACT_DEBUGENGINE_REGISTRY_KEY, 0, KEY_READ, &key) == ERROR_SUCCESS)) + { + if(RegQueryValueEx(key, XACT_DEBUGENGINE_REGISTRY_VALUE, NULL, &type, (LPBYTE)&data, &dataSize) == ERROR_SUCCESS) + { + if(data) + { + debug = TRUE; + } + } + RegCloseKey(key); + } + + // Priority order: Audition, Debug, Retail + hr = CoCreateInstance(audition ? &CLSID_XACTAuditionEngine + : (debug ? &CLSID_XACTDebugEngine : &CLSID_XACTEngine), + NULL, CLSCTX_INPROC_SERVER, &IID_IXACTEngine, (void**)ppEngine); + + // If debug engine does not exist fallback to retail version + if(FAILED(hr) && debug && !audition) + { + hr = CoCreateInstance(&CLSID_XACTEngine, NULL, CLSCTX_INPROC_SERVER, &IID_IXACTEngine, (void**)ppEngine); + } + + return hr; +} + +#endif // #ifdef __cplusplus +#endif // #ifndef _XBOX + +//------------------------------------------------------------------------------ +// XACT specific error codes +//------------------------------------------------------------------------------ + +#define FACILITY_XACTENGINE 0xAC7 +#define XACTENGINEERROR(n) MAKE_HRESULT(SEVERITY_ERROR, FACILITY_XACTENGINE, n) + +#define XACTENGINE_E_OUTOFMEMORY E_OUTOFMEMORY // Out of memory +#define XACTENGINE_E_INVALIDARG E_INVALIDARG // Invalid arg +#define XACTENGINE_E_NOTIMPL E_NOTIMPL // Not implemented +#define XACTENGINE_E_FAIL E_FAIL // Unknown error + +#define XACTENGINE_E_ALREADYINITIALIZED XACTENGINEERROR(0x001) // The engine is already initialized +#define XACTENGINE_E_NOTINITIALIZED XACTENGINEERROR(0x002) // The engine has not been initialized +#define XACTENGINE_E_EXPIRED XACTENGINEERROR(0x003) // The engine has expired (demo or pre-release version) +#define XACTENGINE_E_NONOTIFICATIONCALLBACK XACTENGINEERROR(0x004) // No notification callback +#define XACTENGINE_E_NOTIFICATIONREGISTERED XACTENGINEERROR(0x005) // Notification already registered +#define XACTENGINE_E_INVALIDUSAGE XACTENGINEERROR(0x006) // Invalid usage +#define XACTENGINE_E_INVALIDDATA XACTENGINEERROR(0x007) // Invalid data +#define XACTENGINE_E_INSTANCELIMITFAILTOPLAY XACTENGINEERROR(0x008) // Fail to play due to instance limit +#define XACTENGINE_E_NOGLOBALSETTINGS XACTENGINEERROR(0x009) // Global Settings not loaded +#define XACTENGINE_E_INVALIDVARIABLEINDEX XACTENGINEERROR(0x00a) // Invalid variable index +#define XACTENGINE_E_INVALIDCATEGORY XACTENGINEERROR(0x00b) // Invalid category +#define XACTENGINE_E_INVALIDCUEINDEX XACTENGINEERROR(0x00c) // Invalid cue index +#define XACTENGINE_E_INVALIDWAVEINDEX XACTENGINEERROR(0x00d) // Invalid wave index +#define XACTENGINE_E_INVALIDTRACKINDEX XACTENGINEERROR(0x00e) // Invalid track index +#define XACTENGINE_E_INVALIDSOUNDOFFSETORINDEX XACTENGINEERROR(0x00f) // Invalid sound offset or index +#define XACTENGINE_E_READFILE XACTENGINEERROR(0x010) // Error reading a file +#define XACTENGINE_E_UNKNOWNEVENT XACTENGINEERROR(0x011) // Unknown event type +#define XACTENGINE_E_INCALLBACK XACTENGINEERROR(0x012) // Invalid call of method of function from callback +#define XACTENGINE_E_NOWAVEBANK XACTENGINEERROR(0x013) // No wavebank exists for desired operation +#define XACTENGINE_E_SELECTVARIATION XACTENGINEERROR(0x014) // Unable to select a variation +#define XACTENGINE_E_MULTIPLEAUDITIONENGINES XACTENGINEERROR(0x015) // There can be only one audition engine +#define XACTENGINE_E_WAVEBANKNOTPREPARED XACTENGINEERROR(0x016) // The wavebank is not prepared +#define XACTENGINE_E_NORENDERER XACTENGINEERROR(0x017) // No audio device found on. +#define XACTENGINE_E_INVALIDENTRYCOUNT XACTENGINEERROR(0x018) // Invalid entry count for channel maps +#define XACTENGINE_E_SEEKTIMEBEYONDCUEEND XACTENGINEERROR(0x019) // Time offset for seeking is beyond the cue end. +#define XACTENGINE_E_SEEKTIMEBEYONDWAVEEND XACTENGINEERROR(0x019) // Time offset for seeking is beyond the wave end. +#define XACTENGINE_E_NOFRIENDLYNAMES XACTENGINEERROR(0x01a) // Friendly names are not included in the bank. + +#define XACTENGINE_E_AUDITION_WRITEFILE XACTENGINEERROR(0x101) // Error writing a file during auditioning +#define XACTENGINE_E_AUDITION_NOSOUNDBANK XACTENGINEERROR(0x102) // Missing a soundbank +#define XACTENGINE_E_AUDITION_INVALIDRPCINDEX XACTENGINEERROR(0x103) // Missing an RPC curve +#define XACTENGINE_E_AUDITION_MISSINGDATA XACTENGINEERROR(0x104) // Missing data for an audition command +#define XACTENGINE_E_AUDITION_UNKNOWNCOMMAND XACTENGINEERROR(0x105) // Unknown command +#define XACTENGINE_E_AUDITION_INVALIDDSPINDEX XACTENGINEERROR(0x106) // Missing a DSP parameter +#define XACTENGINE_E_AUDITION_MISSINGWAVE XACTENGINEERROR(0x107) // Wave does not exist in auditioned wavebank +#define XACTENGINE_E_AUDITION_CREATEDIRECTORYFAILED XACTENGINEERROR(0x108) // Failed to create a directory for streaming wavebank data +#define XACTENGINE_E_AUDITION_INVALIDSESSION XACTENGINEERROR(0x109) // Invalid audition session +#endif // #ifndef GUID_DEFS_ONLY +#endif // #ifndef _XACT_H_ diff --git a/Src/Decoder_H264_ALL/D3D/include/xact2wb.h b/Src/Decoder_H264_ALL/D3D/include/xact2wb.h new file mode 100644 index 0000000..9105b21 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/xact2wb.h @@ -0,0 +1,402 @@ +/*************************************************************************** + * + * Copyright (C) Microsoft Corporation. All Rights Reserved. + * + * File: xact2wb.h + * Content: XACT 2 wave bank definitions. + * + ****************************************************************************/ + +#ifndef __XACTWB_H__ +#define __XACTWB_H__ + +#ifdef _XBOX +# include +#else +# include +#endif + +#include + +#pragma warning(push) +#pragma warning(disable:4201) +#pragma warning(disable:4214) // nonstandard extension used : bit field types other than int + +#pragma pack(push, 1) +#if !defined(_X86_) + #define XACTUNALIGNED __unaligned +#else + #define XACTUNALIGNED +#endif + +#ifdef _M_PPCBE +#pragma bitfield_order(push, lsb_to_msb) +#endif + +#define WAVEBANK_HEADER_SIGNATURE 'DNBW' // WaveBank RIFF chunk signature +#define WAVEBANK_HEADER_VERSION 42 // Current wavebank file version + +#define WAVEBANK_BANKNAME_LENGTH 64 // Wave bank friendly name length, in characters +#define WAVEBANK_ENTRYNAME_LENGTH 64 // Wave bank entry friendly name length, in characters + +#define WAVEBANK_MAX_DATA_SEGMENT_SIZE 0xFFFFFFFF // Maximum wave bank data segment size, in bytes +#define WAVEBANK_MAX_COMPACT_DATA_SEGMENT_SIZE 0x001FFFFF // Maximum compact wave bank data segment size, in bytes + +typedef DWORD WAVEBANKOFFSET; + +// +// Bank flags +// + +#define WAVEBANK_TYPE_BUFFER 0x00000000 // In-memory buffer +#define WAVEBANK_TYPE_STREAMING 0x00000001 // Streaming +#define WAVEBANK_TYPE_MASK 0x00000001 + +#define WAVEBANK_FLAGS_ENTRYNAMES 0x00010000 // Bank includes entry names +#define WAVEBANK_FLAGS_COMPACT 0x00020000 // Bank uses compact format +#define WAVEBANK_FLAGS_SYNC_DISABLED 0x00040000 // Bank is disabled for audition sync +#define WAVEBANK_FLAGS_SEEKTABLES 0x00080000 // Bank includes seek tables. +#define WAVEBANK_FLAGS_MASK 0x000F0000 + +// +// Entry flags +// + +#define WAVEBANKENTRY_FLAGS_READAHEAD 0x00000001 // Enable stream read-ahead +#define WAVEBANKENTRY_FLAGS_LOOPCACHE 0x00000002 // One or more looping sounds use this wave +#define WAVEBANKENTRY_FLAGS_REMOVELOOPTAIL 0x00000004 // Remove data after the end of the loop region +#define WAVEBANKENTRY_FLAGS_IGNORELOOP 0x00000008 // Used internally when the loop region can't be used +#define WAVEBANKENTRY_FLAGS_MASK 0x00000008 + +// +// Entry wave format identifiers +// + +#define WAVEBANKMINIFORMAT_TAG_PCM 0x0 // PCM data +#define WAVEBANKMINIFORMAT_TAG_XMA 0x1 // XMA data +#define WAVEBANKMINIFORMAT_TAG_ADPCM 0x2 // ADPCM data + +#define WAVEBANKMINIFORMAT_BITDEPTH_8 0x0 // 8-bit data (PCM only) +#define WAVEBANKMINIFORMAT_BITDEPTH_16 0x1 // 16-bit data (PCM only) + +// +// Arbitrary fixed sizes +// +#define WAVEBANKENTRY_XMASTREAMS_MAX 3 // enough for 5.1 channel audio +#define WAVEBANKENTRY_XMACHANNELS_MAX 6 // enough for 5.1 channel audio (cf. XAUDIOCHANNEL_SOURCEMAX) + +// +// DVD data sizes +// + +#define WAVEBANK_DVD_SECTOR_SIZE 2048 +#define WAVEBANK_DVD_BLOCK_SIZE (WAVEBANK_DVD_SECTOR_SIZE * 16) + +// +// Bank alignment presets +// + +#define WAVEBANK_ALIGNMENT_MIN 4 // Minimum alignment +#define WAVEBANK_ALIGNMENT_DVD WAVEBANK_DVD_SECTOR_SIZE // DVD-optimized alignment + +// +// Wave bank segment identifiers +// + +typedef enum WAVEBANKSEGIDX +{ + WAVEBANK_SEGIDX_BANKDATA = 0, // Bank data + WAVEBANK_SEGIDX_ENTRYMETADATA, // Entry meta-data + WAVEBANK_SEGIDX_SEEKTABLES, // Storage for seek tables for the encoded waves. + WAVEBANK_SEGIDX_ENTRYNAMES, // Entry friendly names + WAVEBANK_SEGIDX_ENTRYWAVEDATA, // Entry wave data + WAVEBANK_SEGIDX_COUNT +} WAVEBANKSEGIDX, *LPWAVEBANKSEGIDX; + +typedef const WAVEBANKSEGIDX *LPCWAVEBANKSEGIDX; + +// +// Endianness +// + +#ifdef __cplusplus + +namespace XACTWaveBank +{ + __inline void SwapBytes(XACTUNALIGNED DWORD &dw) + { + +#ifdef _X86_ + + __asm + { + mov edi, dw + mov eax, [edi] + bswap eax + mov [edi], eax + } + +#else // _X86_ + + dw = _byteswap_ulong(dw); + +#endif // _X86_ + + } + + __inline void SwapBytes(XACTUNALIGNED WORD &w) + { + +#ifdef _X86_ + + __asm + { + mov edi, w + mov ax, [edi] + xchg ah, al + mov [edi], ax + } + +#else // _X86_ + + w = _byteswap_ushort(w); + +#endif // _X86_ + + } + +} + +#endif // __cplusplus + +// +// Wave bank region in bytes. +// + +typedef struct WAVEBANKREGION +{ + DWORD dwOffset; // Region offset, in bytes. + DWORD dwLength; // Region length, in bytes. + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwOffset); + XACTWaveBank::SwapBytes(dwLength); + } + +#endif // __cplusplus + +} WAVEBANKREGION, *LPWAVEBANKREGION; + +typedef const WAVEBANKREGION *LPCWAVEBANKREGION; + + +// +// Wave bank region in samples. +// + +typedef struct WAVEBANKSAMPLEREGION +{ + DWORD dwStartSample; // Start sample for the region. + DWORD dwTotalSamples; // Region length in samples. + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwStartSample); + XACTWaveBank::SwapBytes(dwTotalSamples); + } + +#endif // __cplusplus + +} WAVEBANKSAMPLEREGION, *LPWAVEBANKSAMPLEREGION; + +typedef const WAVEBANKSAMPLEREGION *LPCWAVEBANKSAMPLEREGION; + + +// +// Wave bank file header +// + +typedef struct WAVEBANKHEADER +{ + DWORD dwSignature; // File signature + DWORD dwVersion; // Version of the tool that created the file + DWORD dwHeaderVersion; // Version of the file format + WAVEBANKREGION Segments[WAVEBANK_SEGIDX_COUNT]; // Segment lookup table + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwSignature); + XACTWaveBank::SwapBytes(dwVersion); + XACTWaveBank::SwapBytes(dwHeaderVersion); + + for(int i = 0; i < WAVEBANK_SEGIDX_COUNT; i++) + { + Segments[i].SwapBytes(); + } + } + +#endif // __cplusplus + +} WAVEBANKHEADER, *LPWAVEBANKHEADER; + +typedef const WAVEBANKHEADER *LPCWAVEBANKHEADER; + +// +// Entry compressed data format +// + +typedef union WAVEBANKMINIWAVEFORMAT +{ + struct + { + DWORD wFormatTag : 2; // Format tag + DWORD nChannels : 3; // Channel count (1 - 6) + DWORD nSamplesPerSec : 18; // Sampling rate + DWORD wBlockAlign : 8; // Block alignment + DWORD wBitsPerSample : 1; // Bits per sample (8 vs. 16, PCM only) + }; + + DWORD dwValue; + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwValue); + } + + WORD BitsPerSample() const + { + return wBitsPerSample == WAVEBANKMINIFORMAT_BITDEPTH_16 ? 16 : 8; + } + + #define ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET 22 + DWORD BlockAlign() const + { + return wFormatTag != WAVEBANKMINIFORMAT_TAG_ADPCM ? wBlockAlign : + (wBlockAlign + ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET) * nChannels; + } + +#endif // __cplusplus + +} WAVEBANKMINIWAVEFORMAT, *LPWAVEBANKMINIWAVEFORMAT; + +typedef const WAVEBANKMINIWAVEFORMAT *LPCWAVEBANKMINIWAVEFORMAT; + +// +// Entry meta-data +// + +typedef struct WAVEBANKENTRY +{ + union + { + struct + { + // Entry flags + DWORD dwFlags : 4; + + // Duration of the wave, in units of one sample. + // For instance, a ten second long wave sampled + // at 48KHz would have a duration of 480,000. + // This value is not affected by the number of + // channels, the number of bits per sample, or the + // compression format of the wave. + DWORD Duration : 28; + }; + DWORD dwFlagsAndDuration; + }; + + WAVEBANKMINIWAVEFORMAT Format; // Entry format. + WAVEBANKREGION PlayRegion; // Region within the wave data segment that contains this entry. + WAVEBANKSAMPLEREGION LoopRegion; // Region within the wave data (in samples) that should loop. + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwFlagsAndDuration); + Format.SwapBytes(); + PlayRegion.SwapBytes(); + LoopRegion.SwapBytes(); + } + +#endif // __cplusplus + +} WAVEBANKENTRY, *LPWAVEBANKENTRY; + +typedef const WAVEBANKENTRY *LPCWAVEBANKENTRY; + +// +// Compact entry meta-data +// + +typedef struct WAVEBANKENTRYCOMPACT +{ + DWORD dwOffset : 21; // Data offset, in sectors + DWORD dwLengthDeviation : 11; // Data length deviation, in bytes + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(*(LPDWORD)this); + } + +#endif // __cplusplus + +} WAVEBANKENTRYCOMPACT, *LPWAVEBANKENTRYCOMPACT; + +typedef const WAVEBANKENTRYCOMPACT *LPCWAVEBANKENTRYCOMPACT; + +// +// Bank data segment +// + +typedef struct WAVEBANKDATA +{ + DWORD dwFlags; // Bank flags + DWORD dwEntryCount; // Number of entries in the bank + CHAR szBankName[WAVEBANK_BANKNAME_LENGTH]; // Bank friendly name + DWORD dwEntryMetaDataElementSize; // Size of each entry meta-data element, in bytes + DWORD dwEntryNameElementSize; // Size of each entry name element, in bytes + DWORD dwAlignment; // Entry alignment, in bytes + WAVEBANKMINIWAVEFORMAT CompactFormat; // Format data for compact bank + FILETIME BuildTime; // Build timestamp + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwFlags); + XACTWaveBank::SwapBytes(dwEntryCount); + XACTWaveBank::SwapBytes(dwEntryMetaDataElementSize); + XACTWaveBank::SwapBytes(dwEntryNameElementSize); + XACTWaveBank::SwapBytes(dwAlignment); + CompactFormat.SwapBytes(); + XACTWaveBank::SwapBytes(BuildTime.dwLowDateTime); + XACTWaveBank::SwapBytes(BuildTime.dwHighDateTime); + } + +#endif // __cplusplus + +} WAVEBANKDATA, *LPWAVEBANKDATA; + +typedef const WAVEBANKDATA *LPCWAVEBANKDATA; + +#ifdef _M_PPCBE +#pragma bitfield_order(pop) +#endif + +#pragma warning(pop) +#pragma pack(pop) + +#endif // __XACTWB_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/xact3.h b/Src/Decoder_H264_ALL/D3D/include/xact3.h new file mode 100644 index 0000000..7bf3073 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/xact3.h @@ -0,0 +1,1551 @@ +/************************************************************************** + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * Module Name: + * + * xact3.h + * + * Abstract: + * + * XACT public interfaces, functions and data types + * + **************************************************************************/ + +#pragma once + +#ifndef _XACT3_H_ +#define _XACT3_H_ + +//------------------------------------------------------------------------------ +// XACT class and interface IDs (Version 3.6) +//------------------------------------------------------------------------------ +#ifndef _XBOX // XACT COM support only exists on Windows + #include // For DEFINE_CLSID, DEFINE_IID and DECLARE_INTERFACE + DEFINE_CLSID(XACTEngine, 248d8a3b, 6256, 44d3, a0, 18, 2a, c9, 6c, 45, 9f, 47); + DEFINE_CLSID(XACTAuditionEngine, b789aaea, 6a00, 44c1, a3, 55, 62, 79, 00, cb, f2, c6); + DEFINE_CLSID(XACTDebugEngine, e224ecd5, 3970, 4a39, ad, 36, 5d, b1, 39, e8, 92, 45); + DEFINE_IID(IXACT3Engine, b1ee676a, d9cd, 4d2a, 89, a8, fa, 53, eb, 9e, 48, 0b); +#endif + +// Ignore the rest of this header if only the GUID definitions were requested: +#ifndef GUID_DEFS_ONLY + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ + +#ifndef _XBOX + #include + #include + #include +#endif +#include +#include +#include + +//------------------------------------------------------------------------------ +// Forward Declarations +//------------------------------------------------------------------------------ + +typedef struct IXACT3SoundBank IXACT3SoundBank; +typedef struct IXACT3WaveBank IXACT3WaveBank; +typedef struct IXACT3Cue IXACT3Cue; +typedef struct IXACT3Wave IXACT3Wave; +typedef struct IXACT3Engine IXACT3Engine; +typedef struct XACT_NOTIFICATION XACT_NOTIFICATION; + + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +typedef WORD XACTINDEX; // All normal indices +typedef BYTE XACTNOTIFICATIONTYPE; // Notification type +typedef FLOAT XACTVARIABLEVALUE; // Variable value +typedef WORD XACTVARIABLEINDEX; // Variable index +typedef WORD XACTCATEGORY; // Sound category +typedef BYTE XACTCHANNEL; // Audio channel +typedef FLOAT XACTVOLUME; // Volume value +typedef LONG XACTTIME; // Time (in ms) +typedef SHORT XACTPITCH; // Pitch value +typedef BYTE XACTLOOPCOUNT; // For all loops / recurrences +typedef BYTE XACTVARIATIONWEIGHT; // Variation weight +typedef BYTE XACTPRIORITY; // Sound priority +typedef BYTE XACTINSTANCELIMIT; // Instance limitations + +//------------------------------------------------------------------------------ +// Standard win32 multimedia definitions +//------------------------------------------------------------------------------ +#ifndef WAVE_FORMAT_IEEE_FLOAT + #define WAVE_FORMAT_IEEE_FLOAT 0x0003 +#endif + +#ifndef WAVE_FORMAT_EXTENSIBLE + #define WAVE_FORMAT_EXTENSIBLE 0xFFFE +#endif + +#ifndef _WAVEFORMATEX_ +#define _WAVEFORMATEX_ + #pragma pack(push, 1) + typedef struct tWAVEFORMATEX + { + WORD wFormatTag; // format type + WORD nChannels; // number of channels (i.e. mono, stereo...) + DWORD nSamplesPerSec; // sample rate + DWORD nAvgBytesPerSec; // for buffer estimation + WORD nBlockAlign; // block size of data + WORD wBitsPerSample; // Number of bits per sample of mono data + WORD cbSize; // The count in bytes of the size of extra information (after cbSize) + + } WAVEFORMATEX, *PWAVEFORMATEX; + typedef WAVEFORMATEX NEAR *NPWAVEFORMATEX; + typedef WAVEFORMATEX FAR *LPWAVEFORMATEX; + #pragma pack(pop) +#endif + +#ifndef _WAVEFORMATEXTENSIBLE_ +#define _WAVEFORMATEXTENSIBLE_ + #pragma pack(push, 1) + typedef struct + { + WAVEFORMATEX Format; // WAVEFORMATEX data + + union + { + WORD wValidBitsPerSample; // Bits of precision + WORD wSamplesPerBlock; // Samples per block of audio data, valid if wBitsPerSample==0 + WORD wReserved; // Unused -- If neither applies, set to zero. + } Samples; + + DWORD dwChannelMask; // Speaker usage bitmask + GUID SubFormat; // Sub-format identifier + } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE; + #pragma pack(pop) +#endif + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ +static const XACTTIME XACTTIME_MIN = LONG_MIN; +static const XACTTIME XACTTIME_MAX = LONG_MAX; // 24 days 20:31:23.647 +static const XACTTIME XACTTIME_INFINITE = LONG_MAX; +static const XACTINSTANCELIMIT XACTINSTANCELIMIT_INFINITE = 0xff; +static const XACTINSTANCELIMIT XACTINSTANCELIMIT_MIN = 0x00; // == 1 instance total (0 additional instances) +static const XACTINSTANCELIMIT XACTINSTANCELIMIT_MAX = 0xfe; // == 255 instances total (254 additional instances) +static const XACTINDEX XACTINDEX_MIN = 0x0; +static const XACTINDEX XACTINDEX_MAX = 0xfffe; +static const XACTINDEX XACTINDEX_INVALID = 0xffff; +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MIN = 0x00; +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MAX = 0xff; +static const XACTVARIABLEVALUE XACTVARIABLEVALUE_MIN = -FLT_MAX; +static const XACTVARIABLEVALUE XACTVARIABLEVALUE_MAX = FLT_MAX; +static const XACTVARIABLEINDEX XACTVARIABLEINDEX_MIN = 0x0000; +static const XACTVARIABLEINDEX XACTVARIABLEINDEX_MAX = 0xfffe; +static const XACTVARIABLEINDEX XACTVARIABLEINDEX_INVALID = 0xffff; +static const XACTCATEGORY XACTCATEGORY_MIN = 0x0; +static const XACTCATEGORY XACTCATEGORY_MAX = 0xfffe; +static const XACTCATEGORY XACTCATEGORY_INVALID = 0xffff; +static const XACTCHANNEL XACTCHANNEL_MIN = 0; +static const XACTCHANNEL XACTCHANNEL_MAX = 0xFF; +static const XACTPITCH XACTPITCH_MIN = -1200; // pitch change allowable per individual content field +static const XACTPITCH XACTPITCH_MAX = 1200; +static const XACTPITCH XACTPITCH_MIN_TOTAL = -2400; // total allowable pitch change, use with IXACTWave.SetPitch() +static const XACTPITCH XACTPITCH_MAX_TOTAL = 2400; +static const XACTVOLUME XACTVOLUME_MIN = 0.0f; +static const XACTVOLUME XACTVOLUME_MAX = 16777216.0f; // Maximum acceptable volume level (2^24) - matches XAudio2 max volume +static const XACTVARIABLEVALUE XACTPARAMETERVALUE_MIN = -FLT_MAX; +static const XACTVARIABLEVALUE XACTPARAMETERVALUE_MAX = FLT_MAX; +static const XACTLOOPCOUNT XACTLOOPCOUNT_MIN = 0x0; +static const XACTLOOPCOUNT XACTLOOPCOUNT_MAX = 0xfe; +static const XACTLOOPCOUNT XACTLOOPCOUNT_INFINITE = 0xff; +static const DWORD XACTWAVEALIGNMENT_MIN = 2048; +#ifdef _XBOX +static const BYTE XACTMAXOUTPUTVOICECOUNT = 3; +#endif // _XBOX + + +// ----------------------------------------------------------------------------- +// Cue friendly name length +// ----------------------------------------------------------------------------- +#define XACT_CUE_NAME_LENGTH 0xFF + +// ----------------------------------------------------------------------------- +// Current Content Tool Version +// ----------------------------------------------------------------------------- +#define XACT_CONTENT_VERSION 46 + +// ----------------------------------------------------------------------------- +// XACT Stop Flags +// ----------------------------------------------------------------------------- +static const DWORD XACT_FLAG_STOP_RELEASE = 0x00000000; // Stop with release envelope (or as authored), for looping waves this acts as break loop. +static const DWORD XACT_FLAG_STOP_IMMEDIATE = 0x00000001; // Stop immediately + +// ----------------------------------------------------------------------------- +// XACT Manage Data Flag - XACT will manage the lifetime of this data +// ----------------------------------------------------------------------------- +static const DWORD XACT_FLAG_MANAGEDATA = 0x00000001; + +// ----------------------------------------------------------------------------- +// XACT Content Preparation Flags +// ----------------------------------------------------------------------------- +static const DWORD XACT_FLAG_BACKGROUND_MUSIC = 0x00000002; // Marks the waves as background music. +static const DWORD XACT_FLAG_UNITS_MS = 0x00000004; // Indicates that the units passed in are in milliseconds. +static const DWORD XACT_FLAG_UNITS_SAMPLES = 0x00000008; // Indicates that the units passed in are in samples. + +// ----------------------------------------------------------------------------- +// XACT State flags +// ----------------------------------------------------------------------------- +static const DWORD XACT_STATE_CREATED = 0x00000001; // Created, but nothing else +static const DWORD XACT_STATE_PREPARING = 0x00000002; // In the middle of preparing +static const DWORD XACT_STATE_PREPARED = 0x00000004; // Prepared, but not yet played +static const DWORD XACT_STATE_PLAYING = 0x00000008; // Playing (though could be paused) +static const DWORD XACT_STATE_STOPPING = 0x00000010; // Stopping +static const DWORD XACT_STATE_STOPPED = 0x00000020; // Stopped +static const DWORD XACT_STATE_PAUSED = 0x00000040; // Paused (Can be combined with some of the other state flags above) +static const DWORD XACT_STATE_INUSE = 0x00000080; // Object is in use (used by wavebanks and soundbanks). +static const DWORD XACT_STATE_PREPAREFAILED = 0x80000000; // Object preparation failed. + +//------------------------------------------------------------------------------ +// XACT Parameters +//------------------------------------------------------------------------------ + +#define XACT_FLAG_GLOBAL_SETTINGS_MANAGEDATA XACT_FLAG_MANAGEDATA + +// ----------------------------------------------------------------------------- +// File IO Callbacks +// ----------------------------------------------------------------------------- +typedef BOOL (__stdcall * XACT_READFILE_CALLBACK)(__in HANDLE hFile, __out_bcount(nNumberOfBytesToRead) LPVOID lpBuffer, DWORD nNumberOfBytesToRead, __out LPDWORD lpNumberOfBytesRead, __inout LPOVERLAPPED lpOverlapped); +typedef BOOL (__stdcall * XACT_GETOVERLAPPEDRESULT_CALLBACK)(__in HANDLE hFile, __inout LPOVERLAPPED lpOverlapped, __out LPDWORD lpNumberOfBytesTransferred, BOOL bWait); + +typedef struct XACT_FILEIO_CALLBACKS +{ + XACT_READFILE_CALLBACK readFileCallback; + XACT_GETOVERLAPPEDRESULT_CALLBACK getOverlappedResultCallback; + +} XACT_FILEIO_CALLBACKS, *PXACT_FILEIO_CALLBACKS; +typedef const XACT_FILEIO_CALLBACKS *PCXACT_FILEIO_CALLBACKS; + +// ----------------------------------------------------------------------------- +// Notification Callback +// ----------------------------------------------------------------------------- +typedef void (__stdcall * XACT_NOTIFICATION_CALLBACK)(__in const XACT_NOTIFICATION* pNotification); + +#define XACT_RENDERER_ID_LENGTH 0xff // Maximum number of characters allowed in the renderer ID +#define XACT_RENDERER_NAME_LENGTH 0xff // Maximum number of characters allowed in the renderer display name. + +// ----------------------------------------------------------------------------- +// Renderer Details +// ----------------------------------------------------------------------------- +typedef struct XACT_RENDERER_DETAILS +{ + WCHAR rendererID[XACT_RENDERER_ID_LENGTH]; // The string ID for the rendering device. + WCHAR displayName[XACT_RENDERER_NAME_LENGTH]; // A friendly name suitable for display to a human. + BOOL defaultDevice; // Set to TRUE if this device is the primary audio device on the system. + +} XACT_RENDERER_DETAILS, *LPXACT_RENDERER_DETAILS; + +// ----------------------------------------------------------------------------- +// Engine Look-Ahead Time +// ----------------------------------------------------------------------------- +#define XACT_ENGINE_LOOKAHEAD_DEFAULT 250 // Default look-ahead time of 250ms can be used during XACT engine initialization. + +// ----------------------------------------------------------------------------- +// Runtime (engine) parameters +// ----------------------------------------------------------------------------- +typedef struct XACT_RUNTIME_PARAMETERS +{ + DWORD lookAheadTime; // Time in ms + void* pGlobalSettingsBuffer; // Buffer containing the global settings file + DWORD globalSettingsBufferSize; // Size of global settings buffer + DWORD globalSettingsFlags; // Flags for global settings + DWORD globalSettingsAllocAttributes; // Global settings buffer allocation attributes (see XMemAlloc) + XACT_FILEIO_CALLBACKS fileIOCallbacks; // File I/O callbacks + XACT_NOTIFICATION_CALLBACK fnNotificationCallback; // Callback that receives notifications. + PWSTR pRendererID; // Ptr to the ID for the audio renderer the engine should connect to. + IXAudio2* pXAudio2; // XAudio2 object to be used by the engine (NULL if one needs to be created) + IXAudio2MasteringVoice* pMasteringVoice; // Mastering voice to be used by the engine, if pXAudio2 is not NULL. + +} XACT_RUNTIME_PARAMETERS, *LPXACT_RUNTIME_PARAMETERS; +typedef const XACT_RUNTIME_PARAMETERS *LPCXACT_RUNTIME_PARAMETERS; + +//------------------------------------------------------------------------------ +// Streaming Parameters +//------------------------------------------------------------------------------ + +typedef struct XACT_STREAMING_PARAMETERS +{ + HANDLE file; // File handle associated with wavebank data + DWORD offset; // Offset within file of wavebank header (must be sector aligned) + DWORD flags; // Flags (none currently) + WORD packetSize; // Stream packet size (in sectors) to use for each stream (min = 2) + // number of sectors (DVD = 2048 bytes: 2 = 4096, 3 = 6144, 4 = 8192 etc.) + // optimal DVD size is a multiple of 16 (DVD block = 16 DVD sectors) + +} XACT_WAVEBANK_STREAMING_PARAMETERS, *LPXACT_WAVEBANK_STREAMING_PARAMETERS, XACT_STREAMING_PARAMETERS, *LPXACT_STREAMING_PARAMETERS; +typedef const XACT_STREAMING_PARAMETERS *LPCXACT_STREAMING_PARAMETERS; +typedef const XACT_WAVEBANK_STREAMING_PARAMETERS *LPCXACT_WAVEBANK_STREAMING_PARAMETERS; + +// Structure used to report cue properties back to the client. +typedef struct XACT_CUE_PROPERTIES +{ + CHAR friendlyName[XACT_CUE_NAME_LENGTH]; // Empty if the soundbank doesn't contain any friendly names + BOOL interactive; // TRUE if an IA cue; FALSE otherwise + XACTINDEX iaVariableIndex; // Only valid for IA cues; XACTINDEX_INVALID otherwise + XACTINDEX numVariations; // Number of variations in the cue + XACTINSTANCELIMIT maxInstances; // Number of maximum instances for this cue + XACTINSTANCELIMIT currentInstances; // Current active instances of this cue + +} XACT_CUE_PROPERTIES, *LPXACT_CUE_PROPERTIES; + +// Strucutre used to return the track properties. +typedef struct XACT_TRACK_PROPERTIES +{ + XACTTIME duration; // Duration of the track in ms + XACTINDEX numVariations; // Number of wave variations in the track + XACTCHANNEL numChannels; // Number of channels for the active wave variation on this track + XACTINDEX waveVariation; // Index of the active wave variation + XACTLOOPCOUNT loopCount; // Current loop count on this track + +} XACT_TRACK_PROPERTIES, *LPXACT_TRACK_PROPERTIES; + +// Structure used to return the properties of a variation. +typedef struct XACT_VARIATION_PROPERTIES +{ + XACTINDEX index; // Index of the variation in the cue's variation list + XACTVARIATIONWEIGHT weight; // Weight for the active variation. Valid only for complex cues + XACTVARIABLEVALUE iaVariableMin; // Valid only for IA cues + XACTVARIABLEVALUE iaVariableMax; // Valid only for IA cues + BOOL linger; // Valid only for IA cues + +} XACT_VARIATION_PROPERTIES, *LPXACT_VARIATION_PROPERTIES; + +// Structure used to return the properties of the sound referenced by a variation. +typedef struct XACT_SOUND_PROPERTIES +{ + XACTCATEGORY category; // Category this sound belongs to + BYTE priority; // Priority of this variation + XACTPITCH pitch; // Current pitch set on the active variation + XACTVOLUME volume; // Current volume set on the active variation + XACTINDEX numTracks; // Number of tracks in the active variation + XACT_TRACK_PROPERTIES arrTrackProperties[1]; // Array of active track properties (has numTracks number of elements) + +} XACT_SOUND_PROPERTIES, *LPXACT_SOUND_PROPERTIES; + +// Structure used to return the properties of the active variation and the sound referenced. +typedef struct XACT_SOUND_VARIATION_PROPERTIES +{ + XACT_VARIATION_PROPERTIES variationProperties;// Properties for this variation + XACT_SOUND_PROPERTIES soundProperties; // Proeprties for the sound referenced by this variation + +} XACT_SOUND_VARIATION_PROPERTIES, *LPXACT_SOUND_VARIATION_PROPERTIES; + +// Structure used to return the properties of an active cue instance. +typedef struct XACT_CUE_INSTANCE_PROPERTIES +{ + DWORD allocAttributes; // Buffer allocation attributes (see XMemAlloc) + XACT_CUE_PROPERTIES cueProperties; // Properties of the cue that are shared by all instances. + XACT_SOUND_VARIATION_PROPERTIES activeVariationProperties; // Properties if the currently active variation. + +} XACT_CUE_INSTANCE_PROPERTIES, *LPXACT_CUE_INSTANCE_PROPERTIES; + +// Structure used to return the common wave properties. +typedef struct XACT_WAVE_PROPERTIES +{ + char friendlyName[WAVEBANK_ENTRYNAME_LENGTH]; // Friendly name for the wave; empty if the wavebank doesn't contain friendly names. + WAVEBANKMINIWAVEFORMAT format; // Format for the wave. + DWORD durationInSamples; // Duration of the wave in units of one sample + WAVEBANKSAMPLEREGION loopRegion; // Loop region defined in samples. + BOOL streaming; // Set to TRUE if the wave is streaming; FALSE otherwise. + +} XACT_WAVE_PROPERTIES, *LPXACT_WAVE_PROPERTIES; +typedef const XACT_WAVE_PROPERTIES* LPCXACT_WAVE_PROPERTIES; + +// Structure used to return the properties specific to a wave instance. +typedef struct XACT_WAVE_INSTANCE_PROPERTIES +{ + XACT_WAVE_PROPERTIES properties; // Static properties common to all the wave instances. + BOOL backgroundMusic; // Set to TRUE if the wave is tagged as background music; FALSE otherwise. + +} XACT_WAVE_INSTANCE_PROPERTIES, *LPXACT_WAVE_INSTANCE_PROPERTIES; +typedef const XACT_WAVE_INSTANCE_PROPERTIES* LPCXACT_WAVE_INSTANCE_PROPERTIES; + +//------------------------------------------------------------------------------ +// Channel Mapping / Speaker Panning +//------------------------------------------------------------------------------ + +typedef struct XACTCHANNELMAPENTRY +{ + XACTCHANNEL InputChannel; + XACTCHANNEL OutputChannel; + XACTVOLUME Volume; + +} XACTCHANNELMAPENTRY, *LPXACTCHANNELMAPENTRY; +typedef const XACTCHANNELMAPENTRY *LPCXACTCHANNELMAPENTRY; + +typedef struct XACTCHANNELMAP +{ + XACTCHANNEL EntryCount; + XACTCHANNELMAPENTRY* paEntries; + +} XACTCHANNELMAP, *LPXACTCHANNELMAP; +typedef const XACTCHANNELMAP *LPCXACTCHANNELMAP; + +typedef struct XACTCHANNELVOLUMEENTRY +{ + XACTCHANNEL EntryIndex; + XACTVOLUME Volume; + +} XACTCHANNELVOLUMEENTRY, *LPXACTCHANNELVOLUMEENTRY; +typedef const XACTCHANNELVOLUMEENTRY *LPCXACTCHANNELVOLUMEENTRY; + +typedef struct XACTCHANNELVOLUME +{ + XACTCHANNEL EntryCount; + XACTCHANNELVOLUMEENTRY* paEntries; + +} XACTCHANNELVOLUME, *LPXACTCHANNELVOLUME; +typedef const XACTCHANNELVOLUME *LPCXACTCHANNELVOLUME; + +//------------------------------------------------------------------------------ +// Notifications +//------------------------------------------------------------------------------ + +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEPREPARED = 1; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEPLAY = 2; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUESTOP = 3; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_CUEDESTROYED = 4; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_MARKER = 5; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED = 6; // None, SoundBank +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKDESTROYED = 7; // None, WaveBank +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_LOCALVARIABLECHANGED = 8; // None, SoundBank, SoundBank & cue index, cue instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GLOBALVARIABLECHANGED = 9; // None +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GUICONNECTED = 10; // None +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_GUIDISCONNECTED = 11; // None +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEPREPARED = 12; // None, WaveBank & wave index, wave instance. +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEPLAY = 13; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVESTOP = 14; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVELOOPED = 15; // None, SoundBank, SoundBank & cue index, cue instance, WaveBank, wave instance +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEDESTROYED = 16; // None, WaveBank & wave index, wave instance. +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKPREPARED = 17; // None, WaveBank +static const XACTNOTIFICATIONTYPE XACTNOTIFICATIONTYPE_WAVEBANKSTREAMING_INVALIDCONTENT = 18; // None, WaveBank + +static const BYTE XACT_FLAG_NOTIFICATION_PERSIST = 0x01; + +// Pack the notification structures +#pragma pack(push, 1) + +// Notification description used for registering, un-registering and flushing notifications +typedef struct XACT_NOTIFICATION_DESCRIPTION +{ + XACTNOTIFICATIONTYPE type; // Notification type + BYTE flags; // Flags + IXACT3SoundBank* pSoundBank; // SoundBank instance + IXACT3WaveBank* pWaveBank; // WaveBank instance + IXACT3Cue* pCue; // Cue instance + IXACT3Wave* pWave; // Wave instance + XACTINDEX cueIndex; // Cue index + XACTINDEX waveIndex; // Wave index + PVOID pvContext; // User context (optional) + +} XACT_NOTIFICATION_DESCRIPTION, *LPXACT_NOTIFICATION_DESCRIPTION; +typedef const XACT_NOTIFICATION_DESCRIPTION *LPCXACT_NOTIFICATION_DESCRIPTION; + +// Notification structure for all XACTNOTIFICATIONTYPE_CUE* notifications +typedef struct XACT_NOTIFICATION_CUE +{ + XACTINDEX cueIndex; // Cue index + IXACT3SoundBank* pSoundBank; // SoundBank instance + IXACT3Cue* pCue; // Cue instance + +} XACT_NOTIFICATION_CUE, *LPXACT_NOTIFICATION_CUE; +typedef const XACT_NOTIFICATION_CUE *LPCXACT_NOTIFICATION_CUE; + +// Notification structure for all XACTNOTIFICATIONTYPE_MARKER* notifications +typedef struct XACT_NOTIFICATION_MARKER +{ + XACTINDEX cueIndex; // Cue index + IXACT3SoundBank* pSoundBank; // SoundBank instance + IXACT3Cue* pCue; // Cue instance + DWORD marker; // Marker value + +} XACT_NOTIFICATION_MARKER, *LPXACT_NOTIFICATION_MARKER; +typedef const XACT_NOTIFICATION_MARKER *LPCXACT_NOTIFICATION_MARKER; + +// Notification structure for all XACTNOTIFICATIONTYPE_SOUNDBANK* notifications +typedef struct XACT_NOTIFICATION_SOUNDBANK +{ + IXACT3SoundBank* pSoundBank; // SoundBank instance + +} XACT_NOTIFICATION_SOUNDBANK, *LPXACT_NOTIFICATION_SOUNDBANK; +typedef const XACT_NOTIFICATION_SOUNDBANK *LPCXACT_NOTIFICATION_SOUNDBANK; + +// Notification structure for all XACTNOTIFICATIONTYPE_WAVEBANK* notifications +typedef struct XACT_NOTIFICATION_WAVEBANK +{ + IXACT3WaveBank* pWaveBank; // WaveBank instance + +} XACT_NOTIFICATION_WAVEBANK, *LPXACT_NOTIFICATION_WAVEBANK; +typedef const XACT_NOTIFICATION_WAVEBANK *LPCXACT_NOTIFICATION_WAVEBANK; + +// Notification structure for all XACTNOTIFICATIONTYPE_*VARIABLE* notifications +typedef struct XACT_NOTIFICATION_VARIABLE +{ + XACTINDEX cueIndex; // Cue index + IXACT3SoundBank* pSoundBank; // SoundBank instance + IXACT3Cue* pCue; // Cue instance + XACTVARIABLEINDEX variableIndex; // Variable index + XACTVARIABLEVALUE variableValue; // Variable value + BOOL local; // TRUE if a local variable + +} XACT_NOTIFICATION_VARIABLE, *LPXACT_NOTIFICATION_VARIABLE; +typedef const XACT_NOTIFICATION_VARIABLE *LPCXACT_NOTIFICATION_VARIABLE; + +// Notification structure for all XACTNOTIFICATIONTYPE_GUI* notifications +typedef struct XACT_NOTIFICATION_GUI +{ + DWORD reserved; // Reserved +} XACT_NOTIFICATION_GUI, *LPXACT_NOTIFICATION_GUI; +typedef const XACT_NOTIFICATION_GUI *LPCXACT_NOTIFICATION_GUI; + +// Notification structure for all XACTNOTIFICATIONTYPE_WAVE* notifications +typedef struct XACT_NOTIFICATION_WAVE +{ + IXACT3WaveBank* pWaveBank; // WaveBank + XACTINDEX waveIndex; // Wave index + XACTINDEX cueIndex; // Cue index + IXACT3SoundBank* pSoundBank; // SoundBank instance + IXACT3Cue* pCue; // Cue instance + IXACT3Wave* pWave; // Wave instance + +} XACT_NOTIFICATION_WAVE, *LPXACT_NOTIFICATION_WAVE; +typedef const XACT_NOTIFICATION_WAVE *LPCXACT_NOTIFICATION_WAVE; + +// General notification structure +typedef struct XACT_NOTIFICATION +{ + XACTNOTIFICATIONTYPE type; // Notification type + LONG timeStamp; // Timestamp of notification (milliseconds) + PVOID pvContext; // User context (optional) + union + { + XACT_NOTIFICATION_CUE cue; // XACTNOTIFICATIONTYPE_CUE* + XACT_NOTIFICATION_MARKER marker; // XACTNOTIFICATIONTYPE_MARKER* + XACT_NOTIFICATION_SOUNDBANK soundBank; // XACTNOTIFICATIONTYPE_SOUNDBANK* + XACT_NOTIFICATION_WAVEBANK waveBank; // XACTNOTIFICATIONTYPE_WAVEBANK* + XACT_NOTIFICATION_VARIABLE variable; // XACTNOTIFICATIONTYPE_VARIABLE* + XACT_NOTIFICATION_GUI gui; // XACTNOTIFICATIONTYPE_GUI* + XACT_NOTIFICATION_WAVE wave; // XACTNOTIFICATIONTYPE_WAVE* + }; + +} XACT_NOTIFICATION, *LPXACT_NOTIFICATION; +typedef const XACT_NOTIFICATION *LPCXACT_NOTIFICATION; + +#pragma pack(pop) + +//------------------------------------------------------------------------------ +// IXACT3SoundBank +//------------------------------------------------------------------------------ + +#define XACT_FLAG_SOUNDBANK_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE +#define XACT_SOUNDBANKSTATE_INUSE XACT_STATE_INUSE + +STDAPI_(XACTINDEX) IXACT3SoundBank_GetCueIndex(__in IXACT3SoundBank* pSoundBank, __in PCSTR szFriendlyName); +STDAPI IXACT3SoundBank_GetNumCues(__in IXACT3SoundBank* pSoundBank, __out XACTINDEX* pnNumCues); +STDAPI IXACT3SoundBank_GetCueProperties(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties); +STDAPI IXACT3SoundBank_Prepare(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue); +STDAPI IXACT3SoundBank_Play(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue); +STDAPI IXACT3SoundBank_Stop(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags); +STDAPI IXACT3SoundBank_Destroy(__in IXACT3SoundBank* pSoundBank); +STDAPI IXACT3SoundBank_GetState(__in IXACT3SoundBank* pSoundBank, __out DWORD* pdwState); + +#undef INTERFACE +#define INTERFACE IXACT3SoundBank + +DECLARE_INTERFACE(IXACT3SoundBank) +{ + STDMETHOD_(XACTINDEX, GetCueIndex)(THIS_ __in PCSTR szFriendlyName) PURE; + STDMETHOD(GetNumCues)(THIS_ __out XACTINDEX* pnNumCues) PURE; + STDMETHOD(GetCueProperties)(THIS_ XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties) PURE; + STDMETHOD(Prepare)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue) PURE; + STDMETHOD(Play)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue) PURE; + STDMETHOD(Stop)(THIS_ XACTINDEX nCueIndex, DWORD dwFlags) PURE; + STDMETHOD(Destroy)(THIS) PURE; + STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE; +}; + +#ifdef __cplusplus + +__inline HRESULT __stdcall IXACT3SoundBank_Destroy(__in IXACT3SoundBank* pSoundBank) +{ + return pSoundBank->Destroy(); +} + +__inline XACTINDEX __stdcall IXACT3SoundBank_GetCueIndex(__in IXACT3SoundBank* pSoundBank, __in PCSTR szFriendlyName) +{ + return pSoundBank->GetCueIndex(szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3SoundBank_GetNumCues(__in IXACT3SoundBank* pSoundBank, __out XACTINDEX* pnNumCues) +{ + return pSoundBank->GetNumCues(pnNumCues); +} + +__inline HRESULT __stdcall IXACT3SoundBank_GetCueProperties(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties) +{ + return pSoundBank->GetCueProperties(nCueIndex, pProperties); +} + +__inline HRESULT __stdcall IXACT3SoundBank_Prepare(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue) +{ + return pSoundBank->Prepare(nCueIndex, dwFlags, timeOffset, ppCue); +} + +__inline HRESULT __stdcall IXACT3SoundBank_Play(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue) +{ + return pSoundBank->Play(nCueIndex, dwFlags, timeOffset, ppCue); +} + +__inline HRESULT __stdcall IXACT3SoundBank_Stop(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags) +{ + return pSoundBank->Stop(nCueIndex, dwFlags); +} + +__inline HRESULT __stdcall IXACT3SoundBank_GetState(__in IXACT3SoundBank* pSoundBank, __out DWORD* pdwState) +{ + return pSoundBank->GetState(pdwState); +} + +#else // __cplusplus + +__inline HRESULT __stdcall IXACT3SoundBank_Destroy(__in IXACT3SoundBank* pSoundBank) +{ + return pSoundBank->lpVtbl->Destroy(pSoundBank); +} + +__inline XACTINDEX __stdcall IXACT3SoundBank_GetCueIndex(__in IXACT3SoundBank* pSoundBank, __in PCSTR szFriendlyName) +{ + return pSoundBank->lpVtbl->GetCueIndex(pSoundBank, szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3SoundBank_GetNumCues(__in IXACT3SoundBank* pSoundBank, __out XACTINDEX* pnNumCues) +{ + return pSoundBank->lpVtbl->GetNumCues(pSoundBank, pnNumCues); +} + +__inline HRESULT __stdcall IXACT3SoundBank_GetCueProperties(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, __out LPXACT_CUE_PROPERTIES pProperties) +{ + return pSoundBank->lpVtbl->GetCueProperties(pSoundBank, nCueIndex, pProperties); +} + +__inline HRESULT __stdcall IXACT3SoundBank_Prepare(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_out IXACT3Cue** ppCue) +{ + return pSoundBank->lpVtbl->Prepare(pSoundBank, nCueIndex, dwFlags, timeOffset, ppCue); +} + +__inline HRESULT __stdcall IXACT3SoundBank_Play(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, __deref_opt_out IXACT3Cue** ppCue) +{ + return pSoundBank->lpVtbl->Play(pSoundBank, nCueIndex, dwFlags, timeOffset, ppCue); +} + +__inline HRESULT __stdcall IXACT3SoundBank_Stop(__in IXACT3SoundBank* pSoundBank, XACTINDEX nCueIndex, DWORD dwFlags) +{ + return pSoundBank->lpVtbl->Stop(pSoundBank, nCueIndex, dwFlags); +} + +__inline HRESULT __stdcall IXACT3SoundBank_GetState(__in IXACT3SoundBank* pSoundBank, __out DWORD* pdwState) +{ + return pSoundBank->lpVtbl->GetState(pSoundBank, pdwState); +} + +#endif // __cplusplus + +//------------------------------------------------------------------------------ +// IXACT3WaveBank +//------------------------------------------------------------------------------ +#define XACT_WAVEBANKSTATE_INUSE XACT_STATE_INUSE // Currently in-use +#define XACT_WAVEBANKSTATE_PREPARED XACT_STATE_PREPARED // Prepared +#define XACT_WAVEBANKSTATE_PREPAREFAILED XACT_STATE_PREPAREFAILED // Prepare failed. + + +STDAPI IXACT3WaveBank_Destroy(__in IXACT3WaveBank* pWaveBank); +STDAPI IXACT3WaveBank_GetState(__in IXACT3WaveBank* pWaveBank, __out DWORD* pdwState); +STDAPI IXACT3WaveBank_GetNumWaves(__in IXACT3WaveBank* pWaveBank, __out XACTINDEX* pnNumWaves); +STDAPI_(XACTINDEX) IXACT3WaveBank_GetWaveIndex(__in IXACT3WaveBank* pWaveBank, __in PCSTR szFriendlyName); +STDAPI IXACT3WaveBank_GetWaveProperties(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties); +STDAPI IXACT3WaveBank_Prepare(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave); +STDAPI IXACT3WaveBank_Play(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave); +STDAPI IXACT3WaveBank_Stop(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags); + +#undef INTERFACE +#define INTERFACE IXACT3WaveBank + +DECLARE_INTERFACE(IXACT3WaveBank) +{ + STDMETHOD(Destroy)(THIS) PURE; + STDMETHOD(GetNumWaves)(THIS_ __out XACTINDEX* pnNumWaves) PURE; + STDMETHOD_(XACTINDEX, GetWaveIndex)(THIS_ __in PCSTR szFriendlyName) PURE; + STDMETHOD(GetWaveProperties)(THIS_ XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties) PURE; + STDMETHOD(Prepare)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE; + STDMETHOD(Play)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE; + STDMETHOD(Stop)(THIS_ XACTINDEX nWaveIndex, DWORD dwFlags) PURE; + STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE; +}; + +#ifdef __cplusplus + +__inline HRESULT __stdcall IXACT3WaveBank_Destroy(__in IXACT3WaveBank* pWaveBank) +{ + return pWaveBank->Destroy(); +} + +__inline HRESULT __stdcall IXACT3WaveBank_GetNumWaves(__in IXACT3WaveBank* pWaveBank, __out XACTINDEX* pnNumWaves) +{ + return pWaveBank->GetNumWaves(pnNumWaves); +} + +__inline XACTINDEX __stdcall IXACT3WaveBank_GetWaveIndex(__in IXACT3WaveBank* pWaveBank, __in PCSTR szFriendlyName) +{ + return pWaveBank->GetWaveIndex(szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3WaveBank_GetWaveProperties(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties) +{ + return pWaveBank->GetWaveProperties(nWaveIndex, pWaveProperties); +} + +__inline HRESULT __stdcall IXACT3WaveBank_Prepare(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pWaveBank->Prepare(nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3WaveBank_Play(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pWaveBank->Play(nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3WaveBank_Stop(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags) +{ + return pWaveBank->Stop(nWaveIndex, dwFlags); +} + +__inline HRESULT __stdcall IXACT3WaveBank_GetState(__in IXACT3WaveBank* pWaveBank, __out DWORD* pdwState) +{ + return pWaveBank->GetState(pdwState); +} + +#else // __cplusplus + +__inline HRESULT __stdcall IXACT3WaveBank_Destroy(__in IXACT3WaveBank* pWaveBank) +{ + return pWaveBank->lpVtbl->Destroy(pWaveBank); +} + +__inline HRESULT __stdcall IXACT3WaveBank_GetNumWaves(__in IXACT3WaveBank* pWaveBank, __out XACTINDEX* pnNumWaves) +{ + return pWaveBank->lpVtbl->GetNumWaves(pWaveBank, pnNumWaves); +} + +__inline XACTINDEX __stdcall IXACT3WaveBank_GetWaveIndex(__in IXACT3WaveBank* pWaveBank, __in PCSTR szFriendlyName) +{ + return pWaveBank->lpVtbl->GetWaveIndex(pWaveBank, szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3WaveBank_GetWaveProperties(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, __out LPXACT_WAVE_PROPERTIES pWaveProperties) +{ + return pWaveBank->lpVtbl->GetWaveProperties(pWaveBank, nWaveIndex, pWaveProperties); +} + +__inline HRESULT __stdcall IXACT3WaveBank_Prepare(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pWaveBank->lpVtbl->Prepare(pWaveBank, nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3WaveBank_Play(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pWaveBank->lpVtbl->Play(pWaveBank, nWaveIndex, dwFlags, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3WaveBank_Stop(__in IXACT3WaveBank* pWaveBank, XACTINDEX nWaveIndex, DWORD dwFlags) +{ + return pWaveBank->lpVtbl->Stop(pWaveBank, nWaveIndex, dwFlags); +} + +__inline HRESULT __stdcall IXACT3WaveBank_GetState(__in IXACT3WaveBank* pWaveBank, __out DWORD* pdwState) +{ + return pWaveBank->lpVtbl->GetState(pWaveBank, pdwState); +} +#endif // __cplusplus + + +//------------------------------------------------------------------------------ +// IXACT3Wave +//------------------------------------------------------------------------------ + +STDAPI IXACT3Wave_Destroy(__in IXACT3Wave* pWave); +STDAPI IXACT3Wave_Play(__in IXACT3Wave* pWave); +STDAPI IXACT3Wave_Stop(__in IXACT3Wave* pWave, DWORD dwFlags); +STDAPI IXACT3Wave_Pause(__in IXACT3Wave* pWave, BOOL fPause); +STDAPI IXACT3Wave_GetState(__in IXACT3Wave* pWave, __out DWORD* pdwState); +STDAPI IXACT3Wave_SetPitch(__in IXACT3Wave* pWave, XACTPITCH pitch); +STDAPI IXACT3Wave_SetVolume(__in IXACT3Wave* pWave, XACTVOLUME volume); +STDAPI IXACT3Wave_SetMatrixCoefficients(__in IXACT3Wave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients); +STDAPI IXACT3Wave_GetProperties(__in IXACT3Wave* pWave, __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties); + +#undef INTERFACE +#define INTERFACE IXACT3Wave + +DECLARE_INTERFACE(IXACT3Wave) +{ + STDMETHOD(Destroy)(THIS) PURE; + STDMETHOD(Play)(THIS) PURE; + STDMETHOD(Stop)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(Pause)(THIS_ BOOL fPause) PURE; + STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE; + STDMETHOD(SetPitch)(THIS_ XACTPITCH pitch) PURE; + STDMETHOD(SetVolume)(THIS_ XACTVOLUME volume) PURE; + STDMETHOD(SetMatrixCoefficients)(THIS_ UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) PURE; + STDMETHOD(GetProperties)(THIS_ __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties) PURE; +}; + +#ifdef __cplusplus + +__inline HRESULT __stdcall IXACT3Wave_Destroy(__in IXACT3Wave* pWave) +{ + return pWave->Destroy(); +} + +__inline HRESULT __stdcall IXACT3Wave_Play(__in IXACT3Wave* pWave) +{ + return pWave->Play(); +} + +__inline HRESULT __stdcall IXACT3Wave_Stop(__in IXACT3Wave* pWave, DWORD dwFlags) +{ + return pWave->Stop(dwFlags); +} + +__inline HRESULT __stdcall IXACT3Wave_Pause(__in IXACT3Wave* pWave, BOOL fPause) +{ + return pWave->Pause(fPause); +} + +__inline HRESULT __stdcall IXACT3Wave_GetState(__in IXACT3Wave* pWave, __out DWORD* pdwState) +{ + return pWave->GetState(pdwState); +} + +__inline HRESULT __stdcall IXACT3Wave_SetPitch(__in IXACT3Wave* pWave, XACTPITCH pitch) +{ + return pWave->SetPitch(pitch); +} + +__inline HRESULT __stdcall IXACT3Wave_SetVolume(__in IXACT3Wave* pWave, XACTVOLUME volume) +{ + return pWave->SetVolume(volume); +} + +__inline HRESULT __stdcall IXACT3Wave_SetMatrixCoefficients(__in IXACT3Wave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) +{ + return pWave->SetMatrixCoefficients(uSrcChannelCount, uDstChannelCount, pMatrixCoefficients); +} + +__inline HRESULT __stdcall IXACT3Wave_GetProperties(__in IXACT3Wave* pWave, __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties) +{ + return pWave->GetProperties(pProperties); +} + +#else // __cplusplus + +__inline HRESULT __stdcall IXACT3Wave_Destroy(__in IXACT3Wave* pWave) +{ + return pWave->lpVtbl->Destroy(pWave); +} + +__inline HRESULT __stdcall IXACT3Wave_Play(__in IXACT3Wave* pWave) +{ + return pWave->lpVtbl->Play(pWave); +} + +__inline HRESULT __stdcall IXACT3Wave_Stop(__in IXACT3Wave* pWave, DWORD dwFlags) +{ + return pWave->lpVtbl->Stop(pWave, dwFlags); +} + +__inline HRESULT __stdcall IXACT3Wave_Pause(__in IXACT3Wave* pWave, BOOL fPause) +{ + return pWave->lpVtbl->Pause(pWave, fPause); +} + +__inline HRESULT __stdcall IXACT3Wave_GetState(__in IXACT3Wave* pWave, __out DWORD* pdwState) +{ + return pWave->lpVtbl->GetState(pWave, pdwState); +} + +__inline HRESULT __stdcall IXACT3Wave_SetPitch(__in IXACT3Wave* pWave, XACTPITCH pitch) +{ + return pWave->lpVtbl->SetPitch(pWave, pitch); +} + +__inline HRESULT __stdcall IXACT3Wave_SetVolume(__in IXACT3Wave* pWave, XACTVOLUME volume) +{ + return pWave->lpVtbl->SetVolume(pWave, volume); +} + +__inline HRESULT __stdcall IXACT3Wave_SetMatrixCoefficients(__in IXACT3Wave* pWave, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) +{ + return pWave->lpVtbl->SetMatrixCoefficients(pWave, uSrcChannelCount, uDstChannelCount, pMatrixCoefficients); +} + +__inline HRESULT __stdcall IXACT3Wave_GetProperties(__in IXACT3Wave* pWave, __out LPXACT_WAVE_INSTANCE_PROPERTIES pProperties) +{ + return pWave->lpVtbl->GetProperties(pWave, pProperties); +} +#endif // __cplusplus + +//------------------------------------------------------------------------------ +// IXACT3Cue +//------------------------------------------------------------------------------ + +// Cue Flags +#define XACT_FLAG_CUE_STOP_RELEASE XACT_FLAG_STOP_RELEASE +#define XACT_FLAG_CUE_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE + +// Mutually exclusive states +#define XACT_CUESTATE_CREATED XACT_STATE_CREATED // Created, but nothing else +#define XACT_CUESTATE_PREPARING XACT_STATE_PREPARING // In the middle of preparing +#define XACT_CUESTATE_PREPARED XACT_STATE_PREPARED // Prepared, but not yet played +#define XACT_CUESTATE_PLAYING XACT_STATE_PLAYING // Playing (though could be paused) +#define XACT_CUESTATE_STOPPING XACT_STATE_STOPPING // Stopping +#define XACT_CUESTATE_STOPPED XACT_STATE_STOPPED // Stopped +#define XACT_CUESTATE_PAUSED XACT_STATE_PAUSED // Paused (can be combined with other states) + +STDAPI IXACT3Cue_Destroy(__in IXACT3Cue* pCue); +STDAPI IXACT3Cue_Play(__in IXACT3Cue* pCue); +STDAPI IXACT3Cue_Stop(__in IXACT3Cue* pCue, DWORD dwFlags); +STDAPI IXACT3Cue_GetState(__in IXACT3Cue* pCue, __out DWORD* pdwState); +STDAPI IXACT3Cue_SetMatrixCoefficients(__in IXACT3Cue*, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients); +STDAPI_(XACTVARIABLEINDEX) IXACT3Cue_GetVariableIndex(__in IXACT3Cue* pCue, __in PCSTR szFriendlyName); +STDAPI IXACT3Cue_SetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue); +STDAPI IXACT3Cue_GetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue); +STDAPI IXACT3Cue_Pause(__in IXACT3Cue* pCue, BOOL fPause); +STDAPI IXACT3Cue_GetProperties(__in IXACT3Cue* pCue, __out LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties); +STDAPI IXACT3Cue_SetOutputVoices(__in IXACT3Cue* pCue, __in_opt const XAUDIO2_VOICE_SENDS* pSendList); +STDAPI IXACT3Cue_SetOutputVoiceMatrix(__in IXACT3Cue* pCue, __in_opt IXAudio2Voice* pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix); + +#undef INTERFACE +#define INTERFACE IXACT3Cue + +DECLARE_INTERFACE(IXACT3Cue) +{ + STDMETHOD(Play)(THIS) PURE; + STDMETHOD(Stop)(THIS_ DWORD dwFlags) PURE; + STDMETHOD(GetState)(THIS_ __out DWORD* pdwState) PURE; + STDMETHOD(Destroy)(THIS) PURE; + STDMETHOD(SetMatrixCoefficients)(THIS_ UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) PURE; + STDMETHOD_(XACTVARIABLEINDEX, GetVariableIndex)(THIS_ __in PCSTR szFriendlyName) PURE; + STDMETHOD(SetVariable)(THIS_ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) PURE; + STDMETHOD(GetVariable)(THIS_ XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue) PURE; + STDMETHOD(Pause)(THIS_ BOOL fPause) PURE; + STDMETHOD(GetProperties)(THIS_ __out LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties) PURE; + STDMETHOD(SetOutputVoices)(THIS_ __in_opt const XAUDIO2_VOICE_SENDS* pSendList) PURE; + STDMETHOD(SetOutputVoiceMatrix)(THIS_ __in_opt IXAudio2Voice* pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix) PURE; +}; + +#ifdef __cplusplus + +__inline HRESULT __stdcall IXACT3Cue_Play(__in IXACT3Cue* pCue) +{ + return pCue->Play(); +} + +__inline HRESULT __stdcall IXACT3Cue_Stop(__in IXACT3Cue* pCue, DWORD dwFlags) +{ + return pCue->Stop(dwFlags); +} + +__inline HRESULT __stdcall IXACT3Cue_GetState(__in IXACT3Cue* pCue, __out DWORD* pdwState) +{ + return pCue->GetState(pdwState); +} + +__inline HRESULT __stdcall IXACT3Cue_Destroy(__in IXACT3Cue* pCue) +{ + return pCue->Destroy(); +} + +__inline HRESULT __stdcall IXACT3Cue_SetMatrixCoefficients(__in IXACT3Cue* pCue, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) +{ + return pCue->SetMatrixCoefficients(uSrcChannelCount, uDstChannelCount, pMatrixCoefficients); +} + +__inline XACTVARIABLEINDEX __stdcall IXACT3Cue_GetVariableIndex(__in IXACT3Cue* pCue, __in PCSTR szFriendlyName) +{ + return pCue->GetVariableIndex(szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3Cue_SetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) +{ + return pCue->SetVariable(nIndex, nValue); +} + +__inline HRESULT __stdcall IXACT3Cue_GetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* pnValue) +{ + return pCue->GetVariable(nIndex, pnValue); +} + +__inline HRESULT __stdcall IXACT3Cue_Pause(__in IXACT3Cue* pCue, BOOL fPause) +{ + return pCue->Pause(fPause); +} + +__inline HRESULT __stdcall IXACT3Cue_GetProperties(__in IXACT3Cue* pCue, __out LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties) +{ + return pCue->GetProperties(ppProperties); +} + +__inline HRESULT __stdcall IXACT3Cue_SetOutputVoices(__in IXACT3Cue* pCue, __in_opt const XAUDIO2_VOICE_SENDS* pSendList) +{ + return pCue->SetOutputVoices(pSendList); +} + +__inline HRESULT __stdcall IXACT3Cue_SetOutputVoiceMatrix(__in IXACT3Cue* pCue, __in_opt IXAudio2Voice* pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix) +{ + return pCue->SetOutputVoiceMatrix(pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix); +} + +#else // __cplusplus + +__inline HRESULT __stdcall IXACT3Cue_Play(__in IXACT3Cue* pCue) +{ + return pCue->lpVtbl->Play(pCue); +} + +__inline HRESULT __stdcall IXACT3Cue_Stop(__in IXACT3Cue* pCue, DWORD dwFlags) +{ + return pCue->lpVtbl->Stop(pCue, dwFlags); +} + +__inline HRESULT __stdcall IXACT3Cue_GetState(__in IXACT3Cue* pCue, __out DWORD* pdwState) +{ + return pCue->lpVtbl->GetState(pCue, pdwState); +} + +__inline HRESULT __stdcall IXACT3Cue_Destroy(__in IXACT3Cue* pCue) +{ + return pCue->lpVtbl->Destroy(pCue); +} + +__inline HRESULT __stdcall IXACT3Cue_SetMatrixCoefficients(__in IXACT3Cue* pCue, UINT32 uSrcChannelCount, UINT32 uDstChannelCount, __in float* pMatrixCoefficients) +{ + return pCue->lpVtbl->SetMatrixCoefficients(pCue, uSrcChannelCount, uDstChannelCount, pMatrixCoefficients); +} + +__inline XACTVARIABLEINDEX __stdcall IXACT3Cue_GetVariableIndex(__in IXACT3Cue* pCue, __in PCSTR szFriendlyName) +{ + return pCue->lpVtbl->GetVariableIndex(pCue, szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3Cue_SetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) +{ + return pCue->lpVtbl->SetVariable(pCue, nIndex, nValue); +} + +__inline HRESULT __stdcall IXACT3Cue_GetVariable(__in IXACT3Cue* pCue, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* pnValue) +{ + return pCue->lpVtbl->GetVariable(pCue, nIndex, pnValue); +} + +__inline HRESULT __stdcall IXACT3Cue_Pause(__in IXACT3Cue* pCue, BOOL fPause) +{ + return pCue->lpVtbl->Pause(pCue, fPause); +} + +__inline HRESULT __stdcall IXACT3Cue_GetProperties(__in IXACT3Cue* pCue, __out LPXACT_CUE_INSTANCE_PROPERTIES* ppProperties) +{ + return pCue->lpVtbl->GetProperties(pCue, ppProperties); +} + +__inline HRESULT __stdcall IXACT3Cue_SetOutputVoices(__in IXACT3Cue* pCue, __in_opt const XAUDIO2_VOICE_SENDS* pSendList) +{ + return pCue->lpVtbl->SetOutputVoices(pSendList); +} + +__inline HRESULT __stdcall IXACT3Cue_SetOutputVoiceMatrix(__in IXACT3Cue* pCue, __in_opt IXAudio2Voice* pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix) +{ + return pCue->lpVtbl->SetOutputVoiceMatrix(pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix); +} + +#endif // __cplusplus + +//------------------------------------------------------------------------------ +// IXACT3Engine +//------------------------------------------------------------------------------ + +// Engine flags +#define XACT_FLAG_ENGINE_CREATE_MANAGEDATA XACT_FLAG_MANAGEDATA +#define XACT_FLAG_ENGINE_STOP_IMMEDIATE XACT_FLAG_STOP_IMMEDIATE + +STDAPI_(ULONG) IXACT3Engine_AddRef(__in IXACT3Engine* pEngine); +STDAPI_(ULONG) IXACT3Engine_Release(__in IXACT3Engine* pEngine); +STDAPI IXACT3Engine_GetRendererCount(__in IXACT3Engine* pEngine, __out XACTINDEX* pnRendererCount); +STDAPI IXACT3Engine_GetRendererDetails(__in IXACT3Engine* pEngine, XACTINDEX nRendererIndex, __out LPXACT_RENDERER_DETAILS pRendererDetails); +STDAPI IXACT3Engine_GetFinalMixFormat(__in IXACT3Engine* pEngine, __out WAVEFORMATEXTENSIBLE* pFinalMixFormat); +STDAPI IXACT3Engine_Initialize(__in IXACT3Engine* pEngine, __in const XACT_RUNTIME_PARAMETERS* pParams); +STDAPI IXACT3Engine_ShutDown(__in IXACT3Engine* pEngine); +STDAPI IXACT3Engine_DoWork(__in IXACT3Engine* pEngine); +STDAPI IXACT3Engine_CreateSoundBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3SoundBank** ppSoundBank); +STDAPI IXACT3Engine_CreateInMemoryWaveBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3WaveBank** ppWaveBank); +STDAPI IXACT3Engine_CreateStreamingWaveBank(__in IXACT3Engine* pEngine, __in const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, __deref_out IXACT3WaveBank** ppWaveBank); +STDAPI IXACT3Engine_PrepareWave(__in IXACT3Engine* pEngine, DWORD dwFlags, __in PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave); +STDAPI IXACT3Engine_PrepareInMemoryWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, __in_opt DWORD* pdwSeekTable, __in_opt BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave); +STDAPI IXACT3Engine_PrepareStreamingWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, __in_opt DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave); +STDAPI IXACT3Engine_RegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc); +STDAPI IXACT3Engine_UnRegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc); +STDAPI_(XACTCATEGORY) IXACT3Engine_GetCategory(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName); +STDAPI IXACT3Engine_Stop(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, DWORD dwFlags); +STDAPI IXACT3Engine_SetVolume(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, XACTVOLUME nVolume); +STDAPI IXACT3Engine_Pause(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, BOOL fPause); +STDAPI_(XACTVARIABLEINDEX) IXACT3Engine_GetGlobalVariableIndex(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName); +STDAPI IXACT3Engine_SetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue); +STDAPI IXACT3Engine_GetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* pnValue); + +#undef INTERFACE +#define INTERFACE IXACT3Engine + +#ifdef _XBOX +DECLARE_INTERFACE(IXACT3Engine) +{ +#else +DECLARE_INTERFACE_(IXACT3Engine, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ __in REFIID riid, __deref_out void** ppvObj) PURE; +#endif + + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD(GetRendererCount)(THIS_ __out XACTINDEX* pnRendererCount) PURE; + STDMETHOD(GetRendererDetails)(THIS_ XACTINDEX nRendererIndex, __out LPXACT_RENDERER_DETAILS pRendererDetails) PURE; + + STDMETHOD(GetFinalMixFormat)(THIS_ __out WAVEFORMATEXTENSIBLE* pFinalMixFormat) PURE; + STDMETHOD(Initialize)(THIS_ __in const XACT_RUNTIME_PARAMETERS* pParams) PURE; + STDMETHOD(ShutDown)(THIS) PURE; + + STDMETHOD(DoWork)(THIS) PURE; + + STDMETHOD(CreateSoundBank)(THIS_ __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3SoundBank** ppSoundBank) PURE; + STDMETHOD(CreateInMemoryWaveBank)(THIS_ __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3WaveBank** ppWaveBank) PURE; + STDMETHOD(CreateStreamingWaveBank)(THIS_ __in const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, __deref_out IXACT3WaveBank** ppWaveBank) PURE; + + STDMETHOD(PrepareWave)(THIS_ DWORD dwFlags, __in PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE; + STDMETHOD(PrepareInMemoryWave)(THIS_ DWORD dwFlags, WAVEBANKENTRY entry, __in_opt DWORD* pdwSeekTable, __in_opt BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE; + STDMETHOD(PrepareStreamingWave)(THIS_ DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, __in_opt DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) PURE; + + STDMETHOD(RegisterNotification)(THIS_ __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) PURE; + STDMETHOD(UnRegisterNotification)(THIS_ __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) PURE; + + STDMETHOD_(XACTCATEGORY, GetCategory)(THIS_ __in PCSTR szFriendlyName) PURE; + STDMETHOD(Stop)(THIS_ XACTCATEGORY nCategory, DWORD dwFlags) PURE; + STDMETHOD(SetVolume)(THIS_ XACTCATEGORY nCategory, XACTVOLUME nVolume) PURE; + STDMETHOD(Pause)(THIS_ XACTCATEGORY nCategory, BOOL fPause) PURE; + + STDMETHOD_(XACTVARIABLEINDEX, GetGlobalVariableIndex)(THIS_ __in PCSTR szFriendlyName) PURE; + STDMETHOD(SetGlobalVariable)(THIS_ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) PURE; + STDMETHOD(GetGlobalVariable)(THIS_ XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue) PURE; +}; + +#ifdef __cplusplus + +__inline ULONG __stdcall IXACT3Engine_AddRef(__in IXACT3Engine* pEngine) +{ + return pEngine->AddRef(); +} + +__inline ULONG __stdcall IXACT3Engine_Release(__in IXACT3Engine* pEngine) +{ + return pEngine->Release(); +} + +__inline HRESULT __stdcall IXACT3Engine_GetRendererCount(__in IXACT3Engine* pEngine, __out XACTINDEX* pnRendererCount) +{ + return pEngine->GetRendererCount(pnRendererCount); +} + +__inline HRESULT __stdcall IXACT3Engine_GetRendererDetails(__in IXACT3Engine* pEngine, XACTINDEX nRendererIndex, __out LPXACT_RENDERER_DETAILS pRendererDetails) +{ + return pEngine->GetRendererDetails(nRendererIndex, pRendererDetails); +} + +__inline HRESULT __stdcall IXACT3Engine_GetFinalMixFormat(__in IXACT3Engine* pEngine, __out WAVEFORMATEXTENSIBLE* pFinalMixFormat) +{ + return pEngine->GetFinalMixFormat(pFinalMixFormat); +} + +__inline HRESULT __stdcall IXACT3Engine_Initialize(__in IXACT3Engine* pEngine, __in const XACT_RUNTIME_PARAMETERS* pParams) +{ + return pEngine->Initialize(pParams); +} + +__inline HRESULT __stdcall IXACT3Engine_ShutDown(__in IXACT3Engine* pEngine) +{ + return pEngine->ShutDown(); +} + +__inline HRESULT __stdcall IXACT3Engine_DoWork(__in IXACT3Engine* pEngine) +{ + return pEngine->DoWork(); +} + +__inline HRESULT __stdcall IXACT3Engine_CreateSoundBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3SoundBank** ppSoundBank) +{ + return pEngine->CreateSoundBank(pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppSoundBank); +} + +__inline HRESULT __stdcall IXACT3Engine_CreateInMemoryWaveBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3WaveBank** ppWaveBank) +{ + return pEngine->CreateInMemoryWaveBank(pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppWaveBank); +} + +__inline HRESULT __stdcall IXACT3Engine_CreateStreamingWaveBank(__in IXACT3Engine* pEngine, __in const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, __deref_out IXACT3WaveBank** ppWaveBank) +{ + return pEngine->CreateStreamingWaveBank(pParms, ppWaveBank); +} + +__inline HRESULT __stdcall IXACT3Engine_PrepareWave(__in IXACT3Engine* pEngine, DWORD dwFlags, __in PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pEngine->PrepareWave(dwFlags, szWavePath, wStreamingPacketSize, dwAlignment, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3Engine_PrepareInMemoryWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, __in_opt DWORD* pdwSeekTable, __in_opt BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pEngine->PrepareInMemoryWave(dwFlags, entry, pdwSeekTable, pbWaveData, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3Engine_PrepareStreamingWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, __in_opt DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pEngine->PrepareStreamingWave(dwFlags, entry, streamingParams, dwAlignment, pdwSeekTable, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3Engine_RegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) +{ + return pEngine->RegisterNotification(pNotificationDesc); +} + +__inline HRESULT __stdcall IXACT3Engine_UnRegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) +{ + return pEngine->UnRegisterNotification(pNotificationDesc); +} + +__inline XACTCATEGORY __stdcall IXACT3Engine_GetCategory(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName) +{ + return pEngine->GetCategory(szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3Engine_Stop(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, DWORD dwFlags) +{ + return pEngine->Stop(nCategory, dwFlags); +} + +__inline HRESULT __stdcall IXACT3Engine_SetVolume(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, XACTVOLUME nVolume) +{ + return pEngine->SetVolume(nCategory, nVolume); +} + +__inline HRESULT __stdcall IXACT3Engine_Pause(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, BOOL fPause) +{ + return pEngine->Pause(nCategory, fPause); +} + +__inline XACTVARIABLEINDEX __stdcall IXACT3Engine_GetGlobalVariableIndex(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName) +{ + return pEngine->GetGlobalVariableIndex(szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3Engine_SetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) +{ + return pEngine->SetGlobalVariable(nIndex, nValue); +} + +__inline HRESULT __stdcall IXACT3Engine_GetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue) +{ + return pEngine->GetGlobalVariable(nIndex, nValue); +} + +#else // __cplusplus + +__inline ULONG __stdcall IXACT3Engine_AddRef(__in IXACT3Engine* pEngine) +{ + return pEngine->lpVtbl->AddRef(pEngine); +} + +__inline ULONG __stdcall IXACT3Engine_Release(__in IXACT3Engine* pEngine) +{ + return pEngine->lpVtbl->Release(pEngine); +} + +__inline HRESULT __stdcall IXACT3Engine_GetRendererCount(__in IXACT3Engine* pEngine, __out XACTINDEX* pnRendererCount) +{ + return pEngine->lpVtbl->GetRendererCount(pEngine, pnRendererCount); +} + +__inline HRESULT __stdcall IXACT3Engine_GetRendererDetails(__in IXACT3Engine* pEngine, XACTINDEX nRendererIndex, __out LPXACT_RENDERER_DETAILS pRendererDetails) +{ + return pEngine->lpVtbl->GetRendererDetails(pEngine, nRendererIndex, pRendererDetails); +} + +__inline HRESULT __stdcall IXACT3Engine_GetFinalMixFormat(__in IXACT3Engine* pEngine, __out WAVEFORMATEXTENSIBLE* pFinalMixFormat) +{ + return pEngine->lpVtbl->GetFinalMixFormat(pEngine, pFinalMixFormat); +} + +__inline HRESULT __stdcall IXACT3Engine_Initialize(__in IXACT3Engine* pEngine, __in const XACT_RUNTIME_PARAMETERS* pParams) +{ + return pEngine->lpVtbl->Initialize(pEngine, pParams); +} + +__inline HRESULT __stdcall IXACT3Engine_ShutDown(__in IXACT3Engine* pEngine) +{ + return pEngine->lpVtbl->ShutDown(pEngine); +} + +__inline HRESULT __stdcall IXACT3Engine_DoWork(__in IXACT3Engine* pEngine) +{ + return pEngine->lpVtbl->DoWork(pEngine); +} + +__inline HRESULT __stdcall IXACT3Engine_CreateSoundBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3SoundBank** ppSoundBank) +{ + return pEngine->lpVtbl->CreateSoundBank(pEngine, pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppSoundBank); +} + +__inline HRESULT __stdcall IXACT3Engine_CreateInMemoryWaveBank(__in IXACT3Engine* pEngine, __in const void* pvBuffer, DWORD dwSize, DWORD dwFlags, DWORD dwAllocAttributes, __deref_out IXACT3WaveBank** ppWaveBank) +{ + return pEngine->lpVtbl->CreateInMemoryWaveBank(pEngine, pvBuffer, dwSize, dwFlags, dwAllocAttributes, ppWaveBank); +} + +__inline HRESULT __stdcall IXACT3Engine_CreateStreamingWaveBank(__in IXACT3Engine* pEngine, __in const XACT_WAVEBANK_STREAMING_PARAMETERS* pParms, __deref_out IXACT3WaveBank** ppWaveBank) +{ + return pEngine->lpVtbl->CreateStreamingWaveBank(pEngine, pParms, ppWaveBank); +} + +__inline HRESULT __stdcall IXACT3Engine_PrepareWave(__in IXACT3Engine* pEngine, DWORD dwFlags, __in PCSTR szWavePath, WORD wStreamingPacketSize, DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pEngine->lpVtbl->PrepareWave(pEngine, dwFlags, szWavePath, wStreamingPacketSize, dwAlignment, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3Engine_PrepareInMemoryWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, __in_opt DWORD* pdwSeekTable, __in_opt BYTE* pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pEngine->lpVtbl->PrepareInMemoryWave(pEngine, dwFlags, entry, pdwSeekTable, pbWaveData, dwPlayOffset, nLoopCount, ppWave); +} + +__inline HRESULT __stdcall IXACT3Engine_PrepareStreamingWave(__in IXACT3Engine* pEngine, DWORD dwFlags, WAVEBANKENTRY entry, XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, __in_opt DWORD* pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, __deref_out IXACT3Wave** ppWave) +{ + return pEngine->lpVtbl->PrepareStreamingWave(pEngine, dwFlags, entry, streamingParams, dwAlignment, pdwSeekTable, dwPlayOffset, nLoopCount, ppWave); +} + + +__inline HRESULT __stdcall IXACT3Engine_RegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) +{ + return pEngine->lpVtbl->RegisterNotification(pEngine, pNotificationDesc); +} + +__inline HRESULT __stdcall IXACT3Engine_UnRegisterNotification(__in IXACT3Engine* pEngine, __in const XACT_NOTIFICATION_DESCRIPTION* pNotificationDesc) +{ + return pEngine->lpVtbl->UnRegisterNotification(pEngine, pNotificationDesc); +} + +__inline XACTCATEGORY __stdcall IXACT3Engine_GetCategory(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName) +{ + return pEngine->lpVtbl->GetCategory(pEngine, szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3Engine_Stop(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, DWORD dwFlags) +{ + return pEngine->lpVtbl->Stop(pEngine, nCategory, dwFlags); +} + +__inline HRESULT __stdcall IXACT3Engine_SetVolume(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, XACTVOLUME nVolume) +{ + return pEngine->lpVtbl->SetVolume(pEngine, nCategory, nVolume); +} + +__inline HRESULT __stdcall IXACT3Engine_Pause(__in IXACT3Engine* pEngine, XACTCATEGORY nCategory, BOOL fPause) +{ + return pEngine->lpVtbl->Pause(pEngine, nCategory, fPause); +} + +__inline XACTVARIABLEINDEX __stdcall IXACT3Engine_GetGlobalVariableIndex(__in IXACT3Engine* pEngine, __in PCSTR szFriendlyName) +{ + return pEngine->lpVtbl->GetGlobalVariableIndex(pEngine, szFriendlyName); +} + +__inline HRESULT __stdcall IXACT3Engine_SetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) +{ + return pEngine->lpVtbl->SetGlobalVariable(pEngine, nIndex, nValue); +} + +__inline HRESULT __stdcall IXACT3Engine_GetGlobalVariable(__in IXACT3Engine* pEngine, XACTVARIABLEINDEX nIndex, __out XACTVARIABLEVALUE* nValue) +{ + return pEngine->lpVtbl->GetGlobalVariable(pEngine, nIndex, nValue); +} + +#endif // __cplusplus + +//------------------------------------------------------------------------------ +// Create Engine +//------------------------------------------------------------------------------ + +// Flags used only in XACT3CreateEngine below. These flags are valid but ignored +// when building for Xbox 360; to enable auditioning on that platform you must +// link explicitly to an auditioning version of the XACT static library. +static const DWORD XACT_FLAG_API_AUDITION_MODE = 0x00000001; +static const DWORD XACT_FLAG_API_DEBUG_MODE = 0x00000002; + +#ifdef _XBOX + +STDAPI XACT3CreateEngine(DWORD dwCreationFlags, __deref_out IXACT3Engine** ppEngine); + +#else // #ifdef _XBOX + +#define XACT_DEBUGENGINE_REGISTRY_KEY TEXT("Software\\Microsoft\\XACT") +#define XACT_DEBUGENGINE_REGISTRY_VALUE TEXT("DebugEngine") + + +#ifdef __cplusplus + +__inline HRESULT __stdcall XACT3CreateEngine(DWORD dwCreationFlags, __deref_out IXACT3Engine** ppEngine) +{ + HRESULT hr; + HKEY key; + DWORD data; + DWORD type = REG_DWORD; + DWORD dataSize = sizeof(DWORD); + BOOL debug = (dwCreationFlags & XACT_FLAG_API_DEBUG_MODE) ? TRUE : FALSE; + BOOL audition = (dwCreationFlags & XACT_FLAG_API_AUDITION_MODE) ? TRUE : FALSE; + + // If neither the debug nor audition flags are set, see if the debug registry key is set + if(!debug && !audition && + (RegOpenKeyEx(HKEY_LOCAL_MACHINE, XACT_DEBUGENGINE_REGISTRY_KEY, 0, KEY_READ, &key) == ERROR_SUCCESS)) + { + if(RegQueryValueEx(key, XACT_DEBUGENGINE_REGISTRY_VALUE, NULL, &type, (LPBYTE)&data, &dataSize) == ERROR_SUCCESS) + { + if(data) + { + debug = TRUE; + } + } + RegCloseKey(key); + } + + // Priority order: Audition, Debug, Retail + hr = CoCreateInstance(audition ? __uuidof(XACTAuditionEngine) + : (debug ? __uuidof(XACTDebugEngine) : __uuidof(XACTEngine)), + NULL, CLSCTX_INPROC_SERVER, __uuidof(IXACT3Engine), (void**)ppEngine); + + // If debug engine does not exist fallback to retail version + if(FAILED(hr) && debug && !audition) + { + hr = CoCreateInstance(__uuidof(XACTEngine), NULL, CLSCTX_INPROC_SERVER, __uuidof(IXACT3Engine), (void**)ppEngine); + } + + return hr; +} + +#else // #ifdef __cplusplus + +__inline HRESULT __stdcall XACT3CreateEngine(DWORD dwCreationFlags, __deref_out IXACT3Engine** ppEngine) +{ + HRESULT hr; + HKEY key; + DWORD data; + DWORD type = REG_DWORD; + DWORD dataSize = sizeof(DWORD); + BOOL debug = (dwCreationFlags & XACT_FLAG_API_DEBUG_MODE) ? TRUE : FALSE; + BOOL audition = (dwCreationFlags & XACT_FLAG_API_AUDITION_MODE) ? TRUE : FALSE; + + // If neither the debug nor audition flags are set, see if the debug registry key is set + if(!debug && !audition && + (RegOpenKeyEx(HKEY_LOCAL_MACHINE, XACT_DEBUGENGINE_REGISTRY_KEY, 0, KEY_READ, &key) == ERROR_SUCCESS)) + { + if(RegQueryValueEx(key, XACT_DEBUGENGINE_REGISTRY_VALUE, NULL, &type, (LPBYTE)&data, &dataSize) == ERROR_SUCCESS) + { + if(data) + { + debug = TRUE; + } + } + RegCloseKey(key); + } + + // Priority order: Audition, Debug, Retail + hr = CoCreateInstance(audition ? &CLSID_XACTAuditionEngine + : (debug ? &CLSID_XACTDebugEngine : &CLSID_XACTEngine), + NULL, CLSCTX_INPROC_SERVER, &IID_IXACT3Engine, (void**)ppEngine); + + // If debug engine does not exist fallback to retail version + if(FAILED(hr) && debug && !audition) + { + hr = CoCreateInstance(&CLSID_XACTEngine, NULL, CLSCTX_INPROC_SERVER, &IID_IXACT3Engine, (void**)ppEngine); + } + + return hr; +} + +#endif // #ifdef __cplusplus + +#endif // #ifdef _XBOX + +//------------------------------------------------------------------------------ +// XACT specific error codes +//------------------------------------------------------------------------------ + +#define FACILITY_XACTENGINE 0xAC7 +#define XACTENGINEERROR(n) MAKE_HRESULT(SEVERITY_ERROR, FACILITY_XACTENGINE, n) + +#define XACTENGINE_E_OUTOFMEMORY E_OUTOFMEMORY // Out of memory +#define XACTENGINE_E_INVALIDARG E_INVALIDARG // Invalid arg +#define XACTENGINE_E_NOTIMPL E_NOTIMPL // Not implemented +#define XACTENGINE_E_FAIL E_FAIL // Unknown error + +#define XACTENGINE_E_ALREADYINITIALIZED XACTENGINEERROR(0x001) // The engine is already initialized +#define XACTENGINE_E_NOTINITIALIZED XACTENGINEERROR(0x002) // The engine has not been initialized +#define XACTENGINE_E_EXPIRED XACTENGINEERROR(0x003) // The engine has expired (demo or pre-release version) +#define XACTENGINE_E_NONOTIFICATIONCALLBACK XACTENGINEERROR(0x004) // No notification callback +#define XACTENGINE_E_NOTIFICATIONREGISTERED XACTENGINEERROR(0x005) // Notification already registered +#define XACTENGINE_E_INVALIDUSAGE XACTENGINEERROR(0x006) // Invalid usage +#define XACTENGINE_E_INVALIDDATA XACTENGINEERROR(0x007) // Invalid data +#define XACTENGINE_E_INSTANCELIMITFAILTOPLAY XACTENGINEERROR(0x008) // Fail to play due to instance limit +#define XACTENGINE_E_NOGLOBALSETTINGS XACTENGINEERROR(0x009) // Global Settings not loaded +#define XACTENGINE_E_INVALIDVARIABLEINDEX XACTENGINEERROR(0x00a) // Invalid variable index +#define XACTENGINE_E_INVALIDCATEGORY XACTENGINEERROR(0x00b) // Invalid category +#define XACTENGINE_E_INVALIDCUEINDEX XACTENGINEERROR(0x00c) // Invalid cue index +#define XACTENGINE_E_INVALIDWAVEINDEX XACTENGINEERROR(0x00d) // Invalid wave index +#define XACTENGINE_E_INVALIDTRACKINDEX XACTENGINEERROR(0x00e) // Invalid track index +#define XACTENGINE_E_INVALIDSOUNDOFFSETORINDEX XACTENGINEERROR(0x00f) // Invalid sound offset or index +#define XACTENGINE_E_READFILE XACTENGINEERROR(0x010) // Error reading a file +#define XACTENGINE_E_UNKNOWNEVENT XACTENGINEERROR(0x011) // Unknown event type +#define XACTENGINE_E_INCALLBACK XACTENGINEERROR(0x012) // Invalid call of method of function from callback +#define XACTENGINE_E_NOWAVEBANK XACTENGINEERROR(0x013) // No wavebank exists for desired operation +#define XACTENGINE_E_SELECTVARIATION XACTENGINEERROR(0x014) // Unable to select a variation +#define XACTENGINE_E_MULTIPLEAUDITIONENGINES XACTENGINEERROR(0x015) // There can be only one audition engine +#define XACTENGINE_E_WAVEBANKNOTPREPARED XACTENGINEERROR(0x016) // The wavebank is not prepared +#define XACTENGINE_E_NORENDERER XACTENGINEERROR(0x017) // No audio device found on. +#define XACTENGINE_E_INVALIDENTRYCOUNT XACTENGINEERROR(0x018) // Invalid entry count for channel maps +#define XACTENGINE_E_SEEKTIMEBEYONDCUEEND XACTENGINEERROR(0x019) // Time offset for seeking is beyond the cue end. +#define XACTENGINE_E_SEEKTIMEBEYONDWAVEEND XACTENGINEERROR(0x01a) // Time offset for seeking is beyond the wave end. +#define XACTENGINE_E_NOFRIENDLYNAMES XACTENGINEERROR(0x01b) // Friendly names are not included in the bank. + +#define XACTENGINE_E_AUDITION_WRITEFILE XACTENGINEERROR(0x101) // Error writing a file during auditioning +#define XACTENGINE_E_AUDITION_NOSOUNDBANK XACTENGINEERROR(0x102) // Missing a soundbank +#define XACTENGINE_E_AUDITION_INVALIDRPCINDEX XACTENGINEERROR(0x103) // Missing an RPC curve +#define XACTENGINE_E_AUDITION_MISSINGDATA XACTENGINEERROR(0x104) // Missing data for an audition command +#define XACTENGINE_E_AUDITION_UNKNOWNCOMMAND XACTENGINEERROR(0x105) // Unknown command +#define XACTENGINE_E_AUDITION_INVALIDDSPINDEX XACTENGINEERROR(0x106) // Missing a DSP parameter +#define XACTENGINE_E_AUDITION_MISSINGWAVE XACTENGINEERROR(0x107) // Wave does not exist in auditioned wavebank +#define XACTENGINE_E_AUDITION_CREATEDIRECTORYFAILED XACTENGINEERROR(0x108) // Failed to create a directory for streaming wavebank data +#define XACTENGINE_E_AUDITION_INVALIDSESSION XACTENGINEERROR(0x109) // Invalid audition session + +#endif // #ifndef GUID_DEFS_ONLY + +#endif // #ifndef _XACT3_H_ diff --git a/Src/Decoder_H264_ALL/D3D/include/xact3d.h b/Src/Decoder_H264_ALL/D3D/include/xact3d.h new file mode 100644 index 0000000..4675787 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/xact3d.h @@ -0,0 +1,273 @@ +/*-========================================================================-_ + | - XACT3D - | + | Copyright (c) Microsoft Corporation. All rights reserved. | + |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| + |VERSION: 0.1 MODEL: Unmanaged User-mode | + |CONTRACT: N / A EXCEPT: No Exceptions | + |PARENT: N / A MINREQ: Win2000, Xbox360 | + |PROJECT: XACT3D DIALECT: MS Visual C++ 7.0 | + |>------------------------------------------------------------------------<| + | DUTY: XACT 3D support | + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ + NOTES: + 1. See X3DAudio.h for information regarding X3DAudio types. */ + + +#ifndef __XACT3D_H__ +#define __XACT3D_H__ +//---------------------------------------------------// + #include + #include + + #pragma warning(push) + #pragma warning(disable: 4701) // disable "local variable may be used without having been initialized" compile warning + + // Supported speaker positions, represented as azimuth angles. + // + // Here's a picture of the azimuth angles for the 8 cardinal points, + // seen from above. The emitter's base position is at the origin 0. + // + // FRONT + // | 0 <-- azimuth + // | + // 7pi/4 \ | / pi/4 + // \ | / + // LEFT \|/ RIGHT + // 3pi/2-------0-------pi/2 + // /|\ + // / | \ + // 5pi/4 / | \ 3pi/4 + // | + // | pi + // BACK + // + #define LEFT_AZIMUTH (3*X3DAUDIO_PI/2) + #define RIGHT_AZIMUTH (X3DAUDIO_PI/2) + #define FRONT_LEFT_AZIMUTH (7*X3DAUDIO_PI/4) + #define FRONT_RIGHT_AZIMUTH (X3DAUDIO_PI/4) + #define FRONT_CENTER_AZIMUTH 0.0f + #define LOW_FREQUENCY_AZIMUTH X3DAUDIO_2PI + #define BACK_LEFT_AZIMUTH (5*X3DAUDIO_PI/4) + #define BACK_RIGHT_AZIMUTH (3*X3DAUDIO_PI/4) + #define BACK_CENTER_AZIMUTH X3DAUDIO_PI + #define FRONT_LEFT_OF_CENTER_AZIMUTH (15*X3DAUDIO_PI/8) + #define FRONT_RIGHT_OF_CENTER_AZIMUTH (X3DAUDIO_PI/8) + + +//-----------------------------------------------------// + // Supported emitter channel layouts: + static const float aStereoLayout[] = + { + LEFT_AZIMUTH, + RIGHT_AZIMUTH + }; + static const float a2Point1Layout[] = + { + LEFT_AZIMUTH, + RIGHT_AZIMUTH, + LOW_FREQUENCY_AZIMUTH + }; + static const float aQuadLayout[] = + { + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH + }; + static const float a4Point1Layout[] = + { + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + LOW_FREQUENCY_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH + }; + static const float a5Point1Layout[] = + { + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + FRONT_CENTER_AZIMUTH, + LOW_FREQUENCY_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH + }; + static const float a7Point1Layout[] = + { + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + FRONT_CENTER_AZIMUTH, + LOW_FREQUENCY_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH, + LEFT_AZIMUTH, + RIGHT_AZIMUTH + }; + + +//-------------------------------------------------------// + //// + // DESCRIPTION: + // Initializes the 3D API's: + // + // REMARKS: + // This method only needs to be called once. + // X3DAudio will be initialized such that its speaker channel mask + // matches the format of the given XACT engine's final mix. + // + // PARAMETERS: + // pEngine - [in] XACT engine + // X3DInstance - [out] X3DAudio instance handle + // + // RETURN VALUE: + // HResult error code + //// + EXTERN_C HRESULT inline XACT3DInitialize (IXACTEngine* pEngine, X3DAUDIO_HANDLE X3DInstance) + { + HRESULT hr = S_OK; + if (pEngine == NULL) { + hr = E_POINTER; + } + + XACTVARIABLEVALUE nSpeedOfSound; + if (SUCCEEDED(hr)) { + XACTVARIABLEINDEX xactSpeedOfSoundID = pEngine->GetGlobalVariableIndex("SpeedOfSound"); + hr = pEngine->GetGlobalVariable(xactSpeedOfSoundID, &nSpeedOfSound); + } + + if (SUCCEEDED(hr)) { + WAVEFORMATEXTENSIBLE wfxFinalMixFormat; + hr = pEngine->GetFinalMixFormat(&wfxFinalMixFormat); + if (SUCCEEDED(hr)) { + X3DAudioInitialize(wfxFinalMixFormat.dwChannelMask, nSpeedOfSound, X3DInstance); + } + } + return hr; + } + + + //// + // DESCRIPTION: + // Calculates DSP settings with respect to 3D parameters: + // + // REMARKS: + // Note the following flags are always specified for XACT3D calculation: + // X3DAUDIO_CALCULATE_MATRIX | X3DAUDIO_CALCULATE_DOPPLER | X3DAUDIO_CALCULATE_EMITTER_ANGLE + // + // This means the caller must set at least the following fields: + // X3DAUDIO_LISTENER.OrientFront + // X3DAUDIO_LISTENER.OrientTop + // X3DAUDIO_LISTENER.Position + // X3DAUDIO_LISTENER.Velocity + // + // X3DAUDIO_EMITTER.OrientFront + // X3DAUDIO_EMITTER.OrientTop, if emitter is multi-channel + // X3DAUDIO_EMITTER.Position + // X3DAUDIO_EMITTER.Velocity + // X3DAUDIO_EMITTER.InnerRadius + // X3DAUDIO_EMITTER.InnerRadiusAngle + // X3DAUDIO_EMITTER.ChannelCount + // X3DAUDIO_EMITTER.CurveDistanceScaler + // X3DAUDIO_EMITTER.DopplerScaler + // + // X3DAUDIO_DSP_SETTINGS.pMatrixCoefficients, the caller need only allocate space for SrcChannelCount*DstChannelCount elements + // X3DAUDIO_DSP_SETTINGS.SrcChannelCount + // X3DAUDIO_DSP_SETTINGS.DstChannelCount + // + // If X3DAUDIO_EMITTER.pChannelAzimuths is left NULL for multi-channel emitters, + // a default channel radius and channel azimuth array will be applied below. + // Distance curves such as X3DAUDIO_EMITTER.pVolumeCurve should be + // left NULL as XACT's native RPCs will be used to define DSP behaviour + // with respect to normalized distance. + // + // See X3DAudio.h for information regarding X3DAudio types. + // + // PARAMETERS: + // X3DInstance - [in] X3DAudio instance handle, returned from XACT3DInitialize() + // pListener - [in] point of 3D audio reception + // pEmitter - [in] 3D audio source + // pDSPSettings - [out] receives calculation results, applied to an XACT cue via XACT3DApply() + // + // RETURN VALUE: + // HResult error code + //// + EXTERN_C HRESULT inline XACT3DCalculate (X3DAUDIO_HANDLE X3DInstance, const X3DAUDIO_LISTENER* pListener, X3DAUDIO_EMITTER* pEmitter, X3DAUDIO_DSP_SETTINGS* pDSPSettings) + { + HRESULT hr = S_OK; + if (pListener == NULL || pEmitter == NULL || pDSPSettings == NULL) { + hr = E_POINTER; + } + + if (SUCCEEDED(hr)) { + if (pEmitter->ChannelCount > 1 && pEmitter->pChannelAzimuths == NULL) { + pEmitter->ChannelRadius = 1.0f; + + switch (pEmitter->ChannelCount) { + case 2: pEmitter->pChannelAzimuths = (float*)&aStereoLayout[0]; break; + case 3: pEmitter->pChannelAzimuths = (float*)&a2Point1Layout[0]; break; + case 4: pEmitter->pChannelAzimuths = (float*)&aQuadLayout[0]; break; + case 5: pEmitter->pChannelAzimuths = (float*)&a4Point1Layout[0]; break; + case 6: pEmitter->pChannelAzimuths = (float*)&a5Point1Layout[0]; break; + case 8: pEmitter->pChannelAzimuths = (float*)&a7Point1Layout[0]; break; + default: hr = E_FAIL; break; + } + } + } + + if (SUCCEEDED(hr)) { + static X3DAUDIO_DISTANCE_CURVE_POINT DefaultCurvePoints[2] = { 0.0f, 1.0f, 1.0f, 1.0f }; + static X3DAUDIO_DISTANCE_CURVE DefaultCurve = { (X3DAUDIO_DISTANCE_CURVE_POINT*)&DefaultCurvePoints[0], 2 }; + if (pEmitter->pVolumeCurve == NULL) { + pEmitter->pVolumeCurve = &DefaultCurve; + } + if (pEmitter->pLFECurve == NULL) { + pEmitter->pLFECurve = &DefaultCurve; + } + + X3DAudioCalculate(X3DInstance, pListener, pEmitter, (X3DAUDIO_CALCULATE_MATRIX | X3DAUDIO_CALCULATE_DOPPLER | X3DAUDIO_CALCULATE_EMITTER_ANGLE), pDSPSettings); + } + + return hr; + } + + + //// + // DESCRIPTION: + // Applies results from a call to XACT3DCalculate() to a cue. + // + // PARAMETERS: + // pDSPSettings - [in] calculation results generated by XACT3DCalculate() + // pCue - [in] cue to which to apply pDSPSettings + // + // RETURN VALUE: + // HResult error code + //// + EXTERN_C HRESULT inline XACT3DApply (X3DAUDIO_DSP_SETTINGS* pDSPSettings, IXACTCue* pCue) + { + HRESULT hr = S_OK; + if (pDSPSettings == NULL || pCue == NULL) { + hr = E_POINTER; + } + + if (SUCCEEDED(hr)) { + hr = pCue->SetMatrixCoefficients(pDSPSettings->SrcChannelCount, pDSPSettings->DstChannelCount, pDSPSettings->pMatrixCoefficients); + } + if (SUCCEEDED(hr)) { + XACTVARIABLEINDEX xactDistanceID = pCue->GetVariableIndex("Distance"); + hr = pCue->SetVariable(xactDistanceID, pDSPSettings->EmitterToListenerDistance); + } + if (SUCCEEDED(hr)) { + XACTVARIABLEINDEX xactDopplerID = pCue->GetVariableIndex("DopplerPitchScalar"); + hr = pCue->SetVariable(xactDopplerID, pDSPSettings->DopplerFactor); + } + if (SUCCEEDED(hr)) { + XACTVARIABLEINDEX xactOrientationID = pCue->GetVariableIndex("OrientationAngle"); + hr = pCue->SetVariable(xactOrientationID, pDSPSettings->EmitterToListenerAngle * (180.0f / X3DAUDIO_PI)); + } + + return hr; + } + + + #pragma warning(pop) +#endif // __XACT3D_H__ +//---------------------------------<-EOF->----------------------------------// diff --git a/Src/Decoder_H264_ALL/D3D/include/xact3d3.h b/Src/Decoder_H264_ALL/D3D/include/xact3d3.h new file mode 100644 index 0000000..f17e1e5 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/xact3d3.h @@ -0,0 +1,275 @@ +/*-========================================================================-_ + | - XACT3D3 - | + | Copyright (c) Microsoft Corporation. All rights reserved. | + |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| + |VERSION: 0.1 MODEL: Unmanaged User-mode | + |CONTRACT: N / A EXCEPT: No Exceptions | + |PARENT: N / A MINREQ: Win2000, Xbox360 | + |PROJECT: XACT3D DIALECT: MS Visual C++ 7.0 | + |>------------------------------------------------------------------------<| + | DUTY: XACT 3D support | + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ + NOTES: + 1. See X3DAudio.h for information regarding X3DAudio types. */ + + +#ifndef __XACT3D3_H__ +#define __XACT3D3_H__ + +//---------------------------------------------------// + #include + #include + + #pragma warning(push) + #pragma warning(disable: 4701) // disable "local variable may be used without having been initialized" compile warning + + // Supported speaker positions, represented as azimuth angles. + // + // Here's a picture of the azimuth angles for the 8 cardinal points, + // seen from above. The emitter's base position is at the origin 0. + // + // FRONT + // | 0 <-- azimuth + // | + // 7pi/4 \ | / pi/4 + // \ | / + // LEFT \|/ RIGHT + // 3pi/2-------0-------pi/2 + // /|\ + // / | \ + // 5pi/4 / | \ 3pi/4 + // | + // | pi + // BACK + // + #define LEFT_AZIMUTH (3*X3DAUDIO_PI/2) + #define RIGHT_AZIMUTH (X3DAUDIO_PI/2) + #define FRONT_LEFT_AZIMUTH (7*X3DAUDIO_PI/4) + #define FRONT_RIGHT_AZIMUTH (X3DAUDIO_PI/4) + #define FRONT_CENTER_AZIMUTH 0.0f + #define LOW_FREQUENCY_AZIMUTH X3DAUDIO_2PI + #define BACK_LEFT_AZIMUTH (5*X3DAUDIO_PI/4) + #define BACK_RIGHT_AZIMUTH (3*X3DAUDIO_PI/4) + #define BACK_CENTER_AZIMUTH X3DAUDIO_PI + #define FRONT_LEFT_OF_CENTER_AZIMUTH (15*X3DAUDIO_PI/8) + #define FRONT_RIGHT_OF_CENTER_AZIMUTH (X3DAUDIO_PI/8) + + +//-----------------------------------------------------// + // Supported emitter channel layouts: + static const float aStereoLayout[] = + { + LEFT_AZIMUTH, + RIGHT_AZIMUTH + }; + static const float a2Point1Layout[] = + { + LEFT_AZIMUTH, + RIGHT_AZIMUTH, + LOW_FREQUENCY_AZIMUTH + }; + static const float aQuadLayout[] = + { + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH + }; + static const float a4Point1Layout[] = + { + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + LOW_FREQUENCY_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH + }; + static const float a5Point1Layout[] = + { + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + FRONT_CENTER_AZIMUTH, + LOW_FREQUENCY_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH + }; + static const float a7Point1Layout[] = + { + FRONT_LEFT_AZIMUTH, + FRONT_RIGHT_AZIMUTH, + FRONT_CENTER_AZIMUTH, + LOW_FREQUENCY_AZIMUTH, + BACK_LEFT_AZIMUTH, + BACK_RIGHT_AZIMUTH, + LEFT_AZIMUTH, + RIGHT_AZIMUTH + }; + + +//-------------------------------------------------------// + //// + // DESCRIPTION: + // Initializes the 3D API's: + // + // REMARKS: + // This method only needs to be called once. + // X3DAudio will be initialized such that its speaker channel mask + // matches the format of the given XACT engine's final mix. + // + // PARAMETERS: + // pEngine - [in] XACT engine + // X3DInstance - [out] X3DAudio instance handle + // + // RETURN VALUE: + // HResult error code + //// + EXTERN_C HRESULT inline XACT3DInitialize (__in IXACT3Engine* pEngine, __in X3DAUDIO_HANDLE X3DInstance) + { + HRESULT hr = S_OK; + if (pEngine == NULL) { + hr = E_POINTER; + } + + XACTVARIABLEVALUE nSpeedOfSound; + if (SUCCEEDED(hr)) { + XACTVARIABLEINDEX xactSpeedOfSoundID = pEngine->GetGlobalVariableIndex("SpeedOfSound"); + hr = pEngine->GetGlobalVariable(xactSpeedOfSoundID, &nSpeedOfSound); + } + + if (SUCCEEDED(hr)) { + WAVEFORMATEXTENSIBLE wfxFinalMixFormat; + hr = pEngine->GetFinalMixFormat(&wfxFinalMixFormat); + if (SUCCEEDED(hr)) { + X3DAudioInitialize(wfxFinalMixFormat.dwChannelMask, nSpeedOfSound, X3DInstance); + } + } + return hr; + } + + + //// + // DESCRIPTION: + // Calculates DSP settings with respect to 3D parameters: + // + // REMARKS: + // Note the following flags are always specified for XACT3D calculation: + // X3DAUDIO_CALCULATE_MATRIX | X3DAUDIO_CALCULATE_DOPPLER | X3DAUDIO_CALCULATE_EMITTER_ANGLE + // + // This means the caller must set at least the following fields: + // X3DAUDIO_LISTENER.OrientFront + // X3DAUDIO_LISTENER.OrientTop + // X3DAUDIO_LISTENER.Position + // X3DAUDIO_LISTENER.Velocity + // + // X3DAUDIO_EMITTER.OrientFront + // X3DAUDIO_EMITTER.OrientTop, if emitter is multi-channel + // X3DAUDIO_EMITTER.Position + // X3DAUDIO_EMITTER.Velocity + // X3DAUDIO_EMITTER.InnerRadius + // X3DAUDIO_EMITTER.InnerRadiusAngle + // X3DAUDIO_EMITTER.ChannelCount + // X3DAUDIO_EMITTER.CurveDistanceScaler + // X3DAUDIO_EMITTER.DopplerScaler + // + // X3DAUDIO_DSP_SETTINGS.pMatrixCoefficients, the caller need only allocate space for SrcChannelCount*DstChannelCount elements + // X3DAUDIO_DSP_SETTINGS.SrcChannelCount + // X3DAUDIO_DSP_SETTINGS.DstChannelCount + // + // If X3DAUDIO_EMITTER.pChannelAzimuths is left NULL for multi-channel emitters, + // a default channel radius and channel azimuth array will be applied below. + // Distance curves such as X3DAUDIO_EMITTER.pVolumeCurve should be + // left NULL as XACT's native RPCs will be used to define DSP behaviour + // with respect to normalized distance. + // + // See X3DAudio.h for information regarding X3DAudio types. + // + // PARAMETERS: + // X3DInstance - [in] X3DAudio instance handle, returned from XACT3DInitialize() + // pListener - [in] point of 3D audio reception + // pEmitter - [in] 3D audio source + // pDSPSettings - [out] receives calculation results, applied to an XACT cue via XACT3DApply() + // + // RETURN VALUE: + // HResult error code + //// + EXTERN_C HRESULT inline XACT3DCalculate (__in X3DAUDIO_HANDLE X3DInstance, __in const X3DAUDIO_LISTENER* pListener, __inout X3DAUDIO_EMITTER* pEmitter, __inout X3DAUDIO_DSP_SETTINGS* pDSPSettings) + { + HRESULT hr = S_OK; + if (pListener == NULL || pEmitter == NULL || pDSPSettings == NULL) { + hr = E_POINTER; + } + + if (SUCCEEDED(hr)) { + if (pEmitter->ChannelCount > 1 && pEmitter->pChannelAzimuths == NULL) { + pEmitter->ChannelRadius = 1.0f; + + switch (pEmitter->ChannelCount) { + case 2: pEmitter->pChannelAzimuths = (float*)&aStereoLayout[0]; break; + case 3: pEmitter->pChannelAzimuths = (float*)&a2Point1Layout[0]; break; + case 4: pEmitter->pChannelAzimuths = (float*)&aQuadLayout[0]; break; + case 5: pEmitter->pChannelAzimuths = (float*)&a4Point1Layout[0]; break; + case 6: pEmitter->pChannelAzimuths = (float*)&a5Point1Layout[0]; break; + case 8: pEmitter->pChannelAzimuths = (float*)&a7Point1Layout[0]; break; + default: hr = E_FAIL; break; + } + } + } + + if (SUCCEEDED(hr)) { + static X3DAUDIO_DISTANCE_CURVE_POINT DefaultCurvePoints[2] = { 0.0f, 1.0f, 1.0f, 1.0f }; + static X3DAUDIO_DISTANCE_CURVE DefaultCurve = { (X3DAUDIO_DISTANCE_CURVE_POINT*)&DefaultCurvePoints[0], 2 }; + if (pEmitter->pVolumeCurve == NULL) { + pEmitter->pVolumeCurve = &DefaultCurve; + } + if (pEmitter->pLFECurve == NULL) { + pEmitter->pLFECurve = &DefaultCurve; + } + + X3DAudioCalculate(X3DInstance, pListener, pEmitter, (X3DAUDIO_CALCULATE_MATRIX | X3DAUDIO_CALCULATE_DOPPLER | X3DAUDIO_CALCULATE_EMITTER_ANGLE), pDSPSettings); + } + + return hr; + } + + + //// + // DESCRIPTION: + // Applies results from a call to XACT3DCalculate() to a cue. + // + // PARAMETERS: + // pDSPSettings - [in] calculation results generated by XACT3DCalculate() + // pCue - [in] cue to which to apply pDSPSettings + // + // RETURN VALUE: + // HResult error code + //// + EXTERN_C HRESULT inline XACT3DApply (__in const X3DAUDIO_DSP_SETTINGS* pDSPSettings, __in IXACT3Cue* pCue) + { + HRESULT hr = S_OK; + if (pDSPSettings == NULL || pCue == NULL) { + hr = E_POINTER; + } + + if (SUCCEEDED(hr)) { + hr = pCue->SetMatrixCoefficients(pDSPSettings->SrcChannelCount, pDSPSettings->DstChannelCount, pDSPSettings->pMatrixCoefficients); + } + if (SUCCEEDED(hr)) { + XACTVARIABLEINDEX xactDistanceID = pCue->GetVariableIndex("Distance"); + hr = pCue->SetVariable(xactDistanceID, pDSPSettings->EmitterToListenerDistance); + } + if (SUCCEEDED(hr)) { + XACTVARIABLEINDEX xactDopplerID = pCue->GetVariableIndex("DopplerPitchScalar"); + hr = pCue->SetVariable(xactDopplerID, pDSPSettings->DopplerFactor); + } + if (SUCCEEDED(hr)) { + XACTVARIABLEINDEX xactOrientationID = pCue->GetVariableIndex("OrientationAngle"); + hr = pCue->SetVariable(xactOrientationID, pDSPSettings->EmitterToListenerAngle * (180.0f / X3DAUDIO_PI)); + } + + return hr; + } + + + #pragma warning(pop) + +#endif // __XACT3D3_H__ +//---------------------------------<-EOF->----------------------------------// diff --git a/Src/Decoder_H264_ALL/D3D/include/xact3wb.h b/Src/Decoder_H264_ALL/D3D/include/xact3wb.h new file mode 100644 index 0000000..521667b --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/xact3wb.h @@ -0,0 +1,598 @@ +/*************************************************************************** + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: xact3wb.h + * Content: XACT 3 wave bank definitions. + * + ****************************************************************************/ + +#ifndef __XACT3WB_H__ +#define __XACT3WB_H__ + +#ifdef _XBOX +# include +#else +# include +#endif + +#include +#include + +#pragma warning(push) +#pragma warning(disable:4201) +#pragma warning(disable:4214) // nonstandard extension used : bit field types other than int + +#pragma pack(push, 1) +#if !defined(_X86_) + #define XACTUNALIGNED __unaligned +#else + #define XACTUNALIGNED +#endif + +#ifdef _M_PPCBE +#pragma bitfield_order(push, lsb_to_msb) +#endif + +#define WAVEBANK_HEADER_SIGNATURE 'DNBW' // WaveBank RIFF chunk signature +#define WAVEBANK_HEADER_VERSION 44 // Current wavebank file version + +#define WAVEBANK_BANKNAME_LENGTH 64 // Wave bank friendly name length, in characters +#define WAVEBANK_ENTRYNAME_LENGTH 64 // Wave bank entry friendly name length, in characters + +#define WAVEBANK_MAX_DATA_SEGMENT_SIZE 0xFFFFFFFF // Maximum wave bank data segment size, in bytes +#define WAVEBANK_MAX_COMPACT_DATA_SEGMENT_SIZE 0x001FFFFF // Maximum compact wave bank data segment size, in bytes + +typedef DWORD WAVEBANKOFFSET; + +// +// Bank flags +// + +#define WAVEBANK_TYPE_BUFFER 0x00000000 // In-memory buffer +#define WAVEBANK_TYPE_STREAMING 0x00000001 // Streaming +#define WAVEBANK_TYPE_MASK 0x00000001 + +#define WAVEBANK_FLAGS_ENTRYNAMES 0x00010000 // Bank includes entry names +#define WAVEBANK_FLAGS_COMPACT 0x00020000 // Bank uses compact format +#define WAVEBANK_FLAGS_SYNC_DISABLED 0x00040000 // Bank is disabled for audition sync +#define WAVEBANK_FLAGS_SEEKTABLES 0x00080000 // Bank includes seek tables. +#define WAVEBANK_FLAGS_MASK 0x000F0000 + +// +// Entry flags +// + +#define WAVEBANKENTRY_FLAGS_READAHEAD 0x00000001 // Enable stream read-ahead +#define WAVEBANKENTRY_FLAGS_LOOPCACHE 0x00000002 // One or more looping sounds use this wave +#define WAVEBANKENTRY_FLAGS_REMOVELOOPTAIL 0x00000004 // Remove data after the end of the loop region +#define WAVEBANKENTRY_FLAGS_IGNORELOOP 0x00000008 // Used internally when the loop region can't be used +#define WAVEBANKENTRY_FLAGS_MASK 0x00000008 + +// +// Entry wave format identifiers +// + +#define WAVEBANKMINIFORMAT_TAG_PCM 0x0 // PCM data +#define WAVEBANKMINIFORMAT_TAG_XMA 0x1 // XMA data +#define WAVEBANKMINIFORMAT_TAG_ADPCM 0x2 // ADPCM data +#define WAVEBANKMINIFORMAT_TAG_WMA 0x3 // WMA data + +#define WAVEBANKMINIFORMAT_BITDEPTH_8 0x0 // 8-bit data (PCM only) +#define WAVEBANKMINIFORMAT_BITDEPTH_16 0x1 // 16-bit data (PCM only) + +// +// Arbitrary fixed sizes +// +#define WAVEBANKENTRY_XMASTREAMS_MAX 3 // enough for 5.1 channel audio +#define WAVEBANKENTRY_XMACHANNELS_MAX 6 // enough for 5.1 channel audio (cf. XAUDIOCHANNEL_SOURCEMAX) + +// +// DVD data sizes +// + +#define WAVEBANK_DVD_SECTOR_SIZE 2048 +#define WAVEBANK_DVD_BLOCK_SIZE (WAVEBANK_DVD_SECTOR_SIZE * 16) + +// +// Bank alignment presets +// + +#define WAVEBANK_ALIGNMENT_MIN 4 // Minimum alignment +#define WAVEBANK_ALIGNMENT_DVD WAVEBANK_DVD_SECTOR_SIZE // DVD-optimized alignment + +// +// Wave bank segment identifiers +// + +typedef enum WAVEBANKSEGIDX +{ + WAVEBANK_SEGIDX_BANKDATA = 0, // Bank data + WAVEBANK_SEGIDX_ENTRYMETADATA, // Entry meta-data + WAVEBANK_SEGIDX_SEEKTABLES, // Storage for seek tables for the encoded waves. + WAVEBANK_SEGIDX_ENTRYNAMES, // Entry friendly names + WAVEBANK_SEGIDX_ENTRYWAVEDATA, // Entry wave data + WAVEBANK_SEGIDX_COUNT +} WAVEBANKSEGIDX, *LPWAVEBANKSEGIDX; + +typedef const WAVEBANKSEGIDX *LPCWAVEBANKSEGIDX; + +// +// Endianness +// + +#ifdef __cplusplus + +namespace XACTWaveBank +{ + __inline void SwapBytes(XACTUNALIGNED DWORD &dw) + { + +#ifdef _X86_ + + __asm + { + mov edi, dw + mov eax, [edi] + bswap eax + mov [edi], eax + } + +#else // _X86_ + + dw = _byteswap_ulong(dw); + +#endif // _X86_ + + } + + __inline void SwapBytes(XACTUNALIGNED WORD &w) + { + +#ifdef _X86_ + + __asm + { + mov edi, w + mov ax, [edi] + xchg ah, al + mov [edi], ax + } + +#else // _X86_ + + w = _byteswap_ushort(w); + +#endif // _X86_ + + } + +} + +#endif // __cplusplus + +// +// Wave bank region in bytes. +// + +typedef struct WAVEBANKREGION +{ + DWORD dwOffset; // Region offset, in bytes. + DWORD dwLength; // Region length, in bytes. + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwOffset); + XACTWaveBank::SwapBytes(dwLength); + } + +#endif // __cplusplus + +} WAVEBANKREGION, *LPWAVEBANKREGION; + +typedef const WAVEBANKREGION *LPCWAVEBANKREGION; + + +// +// Wave bank region in samples. +// + +typedef struct WAVEBANKSAMPLEREGION +{ + DWORD dwStartSample; // Start sample for the region. + DWORD dwTotalSamples; // Region length in samples. + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwStartSample); + XACTWaveBank::SwapBytes(dwTotalSamples); + } + +#endif // __cplusplus + +} WAVEBANKSAMPLEREGION, *LPWAVEBANKSAMPLEREGION; + +typedef const WAVEBANKSAMPLEREGION *LPCWAVEBANKSAMPLEREGION; + + +// +// Wave bank file header +// + +typedef struct WAVEBANKHEADER +{ + DWORD dwSignature; // File signature + DWORD dwVersion; // Version of the tool that created the file + DWORD dwHeaderVersion; // Version of the file format + WAVEBANKREGION Segments[WAVEBANK_SEGIDX_COUNT]; // Segment lookup table + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwSignature); + XACTWaveBank::SwapBytes(dwVersion); + XACTWaveBank::SwapBytes(dwHeaderVersion); + + for(int i = 0; i < WAVEBANK_SEGIDX_COUNT; i++) + { + Segments[i].SwapBytes(); + } + } + +#endif // __cplusplus + +} WAVEBANKHEADER, *LPWAVEBANKHEADER; + +typedef const WAVEBANKHEADER *LPCWAVEBANKHEADER; + +// +// Table for converting WMA Average Bytes per Second values to the WAVEBANKMINIWAVEFORMAT wBlockAlign field +// NOTE: There can be a max of 8 values in the table. +// + +#define MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES 7 + +static const DWORD aWMAAvgBytesPerSec[] = +{ + 12000, + 24000, + 4000, + 6000, + 8000, + 20000, + 2500 +}; +// bitrate = entry * 8 + +// +// Table for converting WMA Block Align values to the WAVEBANKMINIWAVEFORMAT wBlockAlign field +// NOTE: There can be a max of 32 values in the table. +// + +#define MAX_WMA_BLOCK_ALIGN_ENTRIES 17 + +static const DWORD aWMABlockAlign[] = +{ + 929, + 1487, + 1280, + 2230, + 8917, + 8192, + 4459, + 5945, + 2304, + 1536, + 1485, + 1008, + 2731, + 4096, + 6827, + 5462, + 1280 +}; + +struct WAVEBANKENTRY; + +// +// Entry compressed data format +// + +typedef union WAVEBANKMINIWAVEFORMAT +{ + struct + { + DWORD wFormatTag : 2; // Format tag + DWORD nChannels : 3; // Channel count (1 - 6) + DWORD nSamplesPerSec : 18; // Sampling rate + DWORD wBlockAlign : 8; // Block alignment. For WMA, lower 6 bits block alignment index, upper 2 bits bytes-per-second index. + DWORD wBitsPerSample : 1; // Bits per sample (8 vs. 16, PCM only); WMAudio2/WMAudio3 (for WMA) + }; + + DWORD dwValue; + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwValue); + } + + WORD BitsPerSample() const + { + if (wFormatTag == WAVEBANKMINIFORMAT_TAG_XMA) + return XMA_OUTPUT_SAMPLE_BITS; // First, because most common on Xbox 360 + if (wFormatTag == WAVEBANKMINIFORMAT_TAG_WMA) + return 16; + if (wFormatTag == WAVEBANKMINIFORMAT_TAG_ADPCM) + return 4; // MSADPCM_BITS_PER_SAMPLE == 4 + + // wFormatTag must be WAVEBANKMINIFORMAT_TAG_PCM (2 bits can only represent 4 different values) + return (wBitsPerSample == WAVEBANKMINIFORMAT_BITDEPTH_16) ? 16 : 8; + } + + #define ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET 22 + DWORD BlockAlign() const + { + DWORD dwReturn = 0; + + switch (wFormatTag) + { + case WAVEBANKMINIFORMAT_TAG_PCM: + dwReturn = wBlockAlign; + break; + + case WAVEBANKMINIFORMAT_TAG_XMA: + dwReturn = nChannels * XMA_OUTPUT_SAMPLE_BITS / 8; + break; + + case WAVEBANKMINIFORMAT_TAG_ADPCM: + dwReturn = (wBlockAlign + ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET) * nChannels; + break; + + case WAVEBANKMINIFORMAT_TAG_WMA: + { + DWORD dwBlockAlignIndex = wBlockAlign & 0x1F; + if (dwBlockAlignIndex < MAX_WMA_BLOCK_ALIGN_ENTRIES) + dwReturn = aWMABlockAlign[dwBlockAlignIndex]; + } + break; + } + + return dwReturn; + } + + DWORD AvgBytesPerSec() const + { + DWORD dwReturn = 0; + + switch (wFormatTag) + { + case WAVEBANKMINIFORMAT_TAG_PCM: + case WAVEBANKMINIFORMAT_TAG_XMA: + dwReturn = nSamplesPerSec * wBlockAlign; + break; + + case WAVEBANKMINIFORMAT_TAG_ADPCM: + { + DWORD blockAlign = BlockAlign(); + DWORD samplesPerAdpcmBlock = AdpcmSamplesPerBlock(); + dwReturn = blockAlign * nSamplesPerSec / samplesPerAdpcmBlock; + } + break; + + case WAVEBANKMINIFORMAT_TAG_WMA: + { + DWORD dwBytesPerSecIndex = wBlockAlign >> 5; + if (dwBytesPerSecIndex < MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES) + dwReturn = aWMAAvgBytesPerSec[dwBytesPerSecIndex]; + } + break; + } + + return dwReturn; + } + + DWORD EncodeWMABlockAlign(DWORD dwBlockAlign, DWORD dwAvgBytesPerSec) const + { + DWORD dwReturn = 0; + DWORD dwBlockAlignIndex = 0; + DWORD dwBytesPerSecIndex = 0; + + for (; dwBlockAlignIndex < MAX_WMA_BLOCK_ALIGN_ENTRIES && dwBlockAlign != aWMABlockAlign[dwBlockAlignIndex]; dwBlockAlignIndex++); + + if (dwBlockAlignIndex < MAX_WMA_BLOCK_ALIGN_ENTRIES) + { + for (; dwBytesPerSecIndex < MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES && dwAvgBytesPerSec != aWMAAvgBytesPerSec[dwBytesPerSecIndex]; dwBytesPerSecIndex++); + + if (dwBytesPerSecIndex < MAX_WMA_AVG_BYTES_PER_SEC_ENTRIES) + { + dwReturn = dwBlockAlignIndex | (dwBytesPerSecIndex << 5); + } + } + + return dwReturn; + } + + + void XMA2FillFormatEx(XMA2WAVEFORMATEX *fmt, WORD blockCount, const struct WAVEBANKENTRY* entry) const; + + DWORD AdpcmSamplesPerBlock() const + { + DWORD nBlockAlign = (wBlockAlign + ADPCM_MINIWAVEFORMAT_BLOCKALIGN_CONVERSION_OFFSET) * nChannels; + return nBlockAlign * 2 / (DWORD)nChannels - 12; + } + + void AdpcmFillCoefficientTable(ADPCMWAVEFORMAT *fmt) const + { + // These are fixed since we are always using MS ADPCM + fmt->wNumCoef = 7; /* MSADPCM_NUM_COEFFICIENTS */ + + static ADPCMCOEFSET aCoef[7] = { { 256, 0}, {512, -256}, {0,0}, {192,64}, {240,0}, {460, -208}, {392,-232} }; + memcpy( &fmt->aCoef, aCoef, sizeof(aCoef) ); + } + +#endif // __cplusplus + +} WAVEBANKMINIWAVEFORMAT, *LPWAVEBANKMINIWAVEFORMAT; + +typedef const WAVEBANKMINIWAVEFORMAT *LPCWAVEBANKMINIWAVEFORMAT; + +// +// Entry meta-data +// + +typedef struct WAVEBANKENTRY +{ + union + { + struct + { + // Entry flags + DWORD dwFlags : 4; + + // Duration of the wave, in units of one sample. + // For instance, a ten second long wave sampled + // at 48KHz would have a duration of 480,000. + // This value is not affected by the number of + // channels, the number of bits per sample, or the + // compression format of the wave. + DWORD Duration : 28; + }; + DWORD dwFlagsAndDuration; + }; + + WAVEBANKMINIWAVEFORMAT Format; // Entry format. + WAVEBANKREGION PlayRegion; // Region within the wave data segment that contains this entry. + WAVEBANKSAMPLEREGION LoopRegion; // Region within the wave data (in samples) that should loop. + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwFlagsAndDuration); + Format.SwapBytes(); + PlayRegion.SwapBytes(); + LoopRegion.SwapBytes(); + } + +#endif // __cplusplus + +} WAVEBANKENTRY, *LPWAVEBANKENTRY; + +typedef const WAVEBANKENTRY *LPCWAVEBANKENTRY; + +// +// Compact entry meta-data +// + +typedef struct WAVEBANKENTRYCOMPACT +{ + DWORD dwOffset : 21; // Data offset, in sectors + DWORD dwLengthDeviation : 11; // Data length deviation, in bytes + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(*(LPDWORD)this); + } + +#endif // __cplusplus + +} WAVEBANKENTRYCOMPACT, *LPWAVEBANKENTRYCOMPACT; + +typedef const WAVEBANKENTRYCOMPACT *LPCWAVEBANKENTRYCOMPACT; + +// +// Bank data segment +// + +typedef struct WAVEBANKDATA +{ + DWORD dwFlags; // Bank flags + DWORD dwEntryCount; // Number of entries in the bank + CHAR szBankName[WAVEBANK_BANKNAME_LENGTH]; // Bank friendly name + DWORD dwEntryMetaDataElementSize; // Size of each entry meta-data element, in bytes + DWORD dwEntryNameElementSize; // Size of each entry name element, in bytes + DWORD dwAlignment; // Entry alignment, in bytes + WAVEBANKMINIWAVEFORMAT CompactFormat; // Format data for compact bank + FILETIME BuildTime; // Build timestamp + +#ifdef __cplusplus + + void SwapBytes(void) + { + XACTWaveBank::SwapBytes(dwFlags); + XACTWaveBank::SwapBytes(dwEntryCount); + XACTWaveBank::SwapBytes(dwEntryMetaDataElementSize); + XACTWaveBank::SwapBytes(dwEntryNameElementSize); + XACTWaveBank::SwapBytes(dwAlignment); + CompactFormat.SwapBytes(); + XACTWaveBank::SwapBytes(BuildTime.dwLowDateTime); + XACTWaveBank::SwapBytes(BuildTime.dwHighDateTime); + } + +#endif // __cplusplus + +} WAVEBANKDATA, *LPWAVEBANKDATA; + +typedef const WAVEBANKDATA *LPCWAVEBANKDATA; + +inline void WAVEBANKMINIWAVEFORMAT::XMA2FillFormatEx(XMA2WAVEFORMATEX *fmt, WORD blockCount, const WAVEBANKENTRY* entry) const +{ + // Note caller is responsbile for filling out fmt->wfx with other helper functions. + + fmt->NumStreams = (WORD)( (nChannels + 1) / 2 ); + + switch (nChannels) + { + case 1: fmt->ChannelMask = SPEAKER_MONO; break; + case 2: fmt->ChannelMask = SPEAKER_STEREO; break; + case 3: fmt->ChannelMask = SPEAKER_2POINT1; break; + case 4: fmt->ChannelMask = SPEAKER_QUAD; break; + case 5: fmt->ChannelMask = SPEAKER_4POINT1; break; + case 6: fmt->ChannelMask = SPEAKER_5POINT1; break; + case 7: fmt->ChannelMask = SPEAKER_5POINT1 | SPEAKER_BACK_CENTER; break; + case 8: fmt->ChannelMask = SPEAKER_7POINT1; break; + default: fmt->ChannelMask = 0; break; + } + + fmt->SamplesEncoded = entry->Duration; + fmt->BytesPerBlock = 65536; /* XACT_FIXED_XMA_BLOCK_SIZE */ + + fmt->PlayBegin = entry->PlayRegion.dwOffset; + fmt->PlayLength = entry->PlayRegion.dwLength; + + if (entry->LoopRegion.dwTotalSamples > 0) + { + fmt->LoopBegin = entry->LoopRegion.dwStartSample; + fmt->LoopLength = entry->LoopRegion.dwTotalSamples; + fmt->LoopCount = 0xff; /* XACTLOOPCOUNT_INFINITE */ + } + else + { + fmt->LoopBegin = 0; + fmt->LoopLength = 0; + fmt->LoopCount = 0; + } + + fmt->EncoderVersion = 4; // XMAENCODER_VERSION_XMA2 + + fmt->BlockCount = blockCount; +} + +#ifdef _M_PPCBE +#pragma bitfield_order(pop) +#endif + +#pragma warning(pop) +#pragma pack(pop) + +#endif // __XACTWB_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/xaudio2.h b/Src/Decoder_H264_ALL/D3D/include/xaudio2.h new file mode 100644 index 0000000..ea8db78 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/xaudio2.h @@ -0,0 +1,1278 @@ +/************************************************************************** + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: xaudio2.h + * Content: Declarations for the XAudio2 game audio API. + * + **************************************************************************/ + +#ifndef __XAUDIO2_INCLUDED__ +#define __XAUDIO2_INCLUDED__ + + +/************************************************************************** + * + * XAudio2 COM object class and interface IDs. + * + **************************************************************************/ + +#include // For DEFINE_CLSID and DEFINE_IID + +// XAudio 2.0 (March 2008 SDK) +//DEFINE_CLSID(XAudio2, fac23f48, 31f5, 45a8, b4, 9b, 52, 25, d6, 14, 01, aa); +//DEFINE_CLSID(XAudio2_Debug, fac23f48, 31f5, 45a8, b4, 9b, 52, 25, d6, 14, 01, db); + +// XAudio 2.1 (June 2008 SDK) +//DEFINE_CLSID(XAudio2, e21a7345, eb21, 468e, be, 50, 80, 4d, b9, 7c, f7, 08); +//DEFINE_CLSID(XAudio2_Debug, f7a76c21, 53d4, 46bb, ac, 53, 8b, 45, 9c, ae, 46, bd); + +// XAudio 2.2 (August 2008 SDK) +//DEFINE_CLSID(XAudio2, b802058a, 464a, 42db, bc, 10, b6, 50, d6, f2, 58, 6a); +//DEFINE_CLSID(XAudio2_Debug, 97dfb7e7, 5161, 4015, 87, a9, c7, 9e, 6a, 19, 52, cc); + +// XAudio 2.3 (November 2008 SDK) +//DEFINE_CLSID(XAudio2, 4c5e637a, 16c7, 4de3, 9c, 46, 5e, d2, 21, 81, 96, 2d); +//DEFINE_CLSID(XAudio2_Debug, ef0aa05d, 8075, 4e5d, be, ad, 45, be, 0c, 3c, cb, b3); + +// XAudio 2.4 (March 2009 SDK) +//DEFINE_CLSID(XAudio2, 03219e78, 5bc3, 44d1, b9, 2e, f6, 3d, 89, cc, 65, 26); +//DEFINE_CLSID(XAudio2_Debug, 4256535c, 1ea4, 4d4b, 8a, d5, f9, db, 76, 2e, ca, 9e); + +// XAudio 2.5 (August 2009 SDK) +//DEFINE_CLSID(XAudio2, 4c9b6dde, 6809, 46e6, a2, 78, 9b, 6a, 97, 58, 86, 70); +//DEFINE_CLSID(XAudio2_Debug, 715bdd1a, aa82, 436b, b0, fa, 6a, ce, a3, 9b, d0, a1); + +// XAudio 2.6 (February 2010 SDK) +DEFINE_CLSID(XAudio2, 3eda9b49, 2085, 498b, 9b, b2, 39, a6, 77, 84, 93, de); +DEFINE_CLSID(XAudio2_Debug, 47199894, 7cc2, 444d, 98, 73, ce, d2, 56, 2c, c6, 0e); +DEFINE_IID(IXAudio2, 8bcf1f58, 9fe7, 4583, 8a, c6, e2, ad, c4, 65, c8, bb); + + +// Ignore the rest of this header if only the GUID definitions were requested +#ifndef GUID_DEFS_ONLY + +#ifdef _XBOX + #include // Xbox COM declarations (IUnknown, etc) +#else + #include // Windows COM declarations +#endif + +#include // Markers for documenting API semantics +#include // Basic audio data types and constants +#include // Data types and constants for XMA2 audio + +// All structures defined in this file use tight field packing +#pragma pack(push, 1) + + +/************************************************************************** + * + * XAudio2 constants, flags and error codes. + * + **************************************************************************/ + +// Numeric boundary values +#define XAUDIO2_MAX_BUFFER_BYTES 0x80000000 // Maximum bytes allowed in a source buffer +#define XAUDIO2_MAX_QUEUED_BUFFERS 64 // Maximum buffers allowed in a voice queue +#define XAUDIO2_MAX_BUFFERS_SYSTEM 2 // Maximum buffers allowed for system threads (Xbox 360 only) +#define XAUDIO2_MAX_AUDIO_CHANNELS 64 // Maximum channels in an audio stream +#define XAUDIO2_MIN_SAMPLE_RATE 1000 // Minimum audio sample rate supported +#define XAUDIO2_MAX_SAMPLE_RATE 200000 // Maximum audio sample rate supported +#define XAUDIO2_MAX_VOLUME_LEVEL 16777216.0f // Maximum acceptable volume level (2^24) +#define XAUDIO2_MIN_FREQ_RATIO (1/1024.0f) // Minimum SetFrequencyRatio argument +#define XAUDIO2_MAX_FREQ_RATIO 1024.0f // Maximum MaxFrequencyRatio argument +#define XAUDIO2_DEFAULT_FREQ_RATIO 2.0f // Default MaxFrequencyRatio argument +#define XAUDIO2_MAX_FILTER_ONEOVERQ 1.5f // Maximum XAUDIO2_FILTER_PARAMETERS.OneOverQ +#define XAUDIO2_MAX_FILTER_FREQUENCY 1.0f // Maximum XAUDIO2_FILTER_PARAMETERS.Frequency +#define XAUDIO2_MAX_LOOP_COUNT 254 // Maximum non-infinite XAUDIO2_BUFFER.LoopCount +#define XAUDIO2_MAX_INSTANCES 8 // Maximum simultaneous XAudio2 objects on Xbox 360 + +// For XMA voices on Xbox 360 there is an additional restriction on the MaxFrequencyRatio +// argument and the voice's sample rate: the product of these numbers cannot exceed 600000 +// for one-channel voices or 300000 for voices with more than one channel. +#define XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MONO 600000 +#define XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MULTICHANNEL 300000 + +// Numeric values with special meanings +#define XAUDIO2_COMMIT_NOW 0 // Used as an OperationSet argument +#define XAUDIO2_COMMIT_ALL 0 // Used in IXAudio2::CommitChanges +#define XAUDIO2_INVALID_OPSET (UINT32)(-1) // Not allowed for OperationSet arguments +#define XAUDIO2_NO_LOOP_REGION 0 // Used in XAUDIO2_BUFFER.LoopCount +#define XAUDIO2_LOOP_INFINITE 255 // Used in XAUDIO2_BUFFER.LoopCount +#define XAUDIO2_DEFAULT_CHANNELS 0 // Used in CreateMasteringVoice +#define XAUDIO2_DEFAULT_SAMPLERATE 0 // Used in CreateMasteringVoice + +// Flags +#define XAUDIO2_DEBUG_ENGINE 0x0001 // Used in XAudio2Create on Windows only +#define XAUDIO2_VOICE_NOPITCH 0x0002 // Used in IXAudio2::CreateSourceVoice +#define XAUDIO2_VOICE_NOSRC 0x0004 // Used in IXAudio2::CreateSourceVoice +#define XAUDIO2_VOICE_USEFILTER 0x0008 // Used in IXAudio2::CreateSource/SubmixVoice +#define XAUDIO2_VOICE_MUSIC 0x0010 // Used in IXAudio2::CreateSourceVoice +#define XAUDIO2_PLAY_TAILS 0x0020 // Used in IXAudio2SourceVoice::Stop +#define XAUDIO2_END_OF_STREAM 0x0040 // Used in XAUDIO2_BUFFER.Flags +#define XAUDIO2_SEND_USEFILTER 0x0080 // Used in XAUDIO2_SEND_DESCRIPTOR.Flags + +// Default parameters for the built-in filter +#define XAUDIO2_DEFAULT_FILTER_TYPE LowPassFilter +#define XAUDIO2_DEFAULT_FILTER_FREQUENCY XAUDIO2_MAX_FILTER_FREQUENCY +#define XAUDIO2_DEFAULT_FILTER_ONEOVERQ 1.0f + +// Internal XAudio2 constants +#ifdef _XBOX + #define XAUDIO2_QUANTUM_NUMERATOR 2 // On Xbox 360, XAudio2 processes audio + #define XAUDIO2_QUANTUM_DENOMINATOR 375 // in 5.333ms chunks (= 2/375 seconds) +#else + #define XAUDIO2_QUANTUM_NUMERATOR 1 // On Windows, XAudio2 processes audio + #define XAUDIO2_QUANTUM_DENOMINATOR 100 // in 10ms chunks (= 1/100 seconds) +#endif +#define XAUDIO2_QUANTUM_MS (1000.0f * XAUDIO2_QUANTUM_NUMERATOR / XAUDIO2_QUANTUM_DENOMINATOR) + +// XAudio2 error codes +#define FACILITY_XAUDIO2 0x896 +#define XAUDIO2_E_INVALID_CALL 0x88960001 // An API call or one of its arguments was illegal +#define XAUDIO2_E_XMA_DECODER_ERROR 0x88960002 // The XMA hardware suffered an unrecoverable error +#define XAUDIO2_E_XAPO_CREATION_FAILED 0x88960003 // XAudio2 failed to initialize an XAPO effect +#define XAUDIO2_E_DEVICE_INVALIDATED 0x88960004 // An audio device became unusable (unplugged, etc) + + +/************************************************************************** + * + * Forward declarations for the XAudio2 interfaces. + * + **************************************************************************/ + +#ifdef __cplusplus + #define FWD_DECLARE(x) interface x +#else + #define FWD_DECLARE(x) typedef interface x x +#endif + +FWD_DECLARE(IXAudio2); +FWD_DECLARE(IXAudio2Voice); +FWD_DECLARE(IXAudio2SourceVoice); +FWD_DECLARE(IXAudio2SubmixVoice); +FWD_DECLARE(IXAudio2MasteringVoice); +FWD_DECLARE(IXAudio2EngineCallback); +FWD_DECLARE(IXAudio2VoiceCallback); + + +/************************************************************************** + * + * XAudio2 structures and enumerations. + * + **************************************************************************/ + +// Used in IXAudio2::Initialize +#ifdef _XBOX + typedef enum XAUDIO2_XBOX_HWTHREAD_SPECIFIER + { + XboxThread0 = 0x01, + XboxThread1 = 0x02, + XboxThread2 = 0x04, + XboxThread3 = 0x08, + XboxThread4 = 0x10, + XboxThread5 = 0x20, + XAUDIO2_ANY_PROCESSOR = XboxThread4, + XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR + } XAUDIO2_XBOX_HWTHREAD_SPECIFIER, XAUDIO2_PROCESSOR; +#else + typedef enum XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER + { + Processor1 = 0x00000001, + Processor2 = 0x00000002, + Processor3 = 0x00000004, + Processor4 = 0x00000008, + Processor5 = 0x00000010, + Processor6 = 0x00000020, + Processor7 = 0x00000040, + Processor8 = 0x00000080, + Processor9 = 0x00000100, + Processor10 = 0x00000200, + Processor11 = 0x00000400, + Processor12 = 0x00000800, + Processor13 = 0x00001000, + Processor14 = 0x00002000, + Processor15 = 0x00004000, + Processor16 = 0x00008000, + Processor17 = 0x00010000, + Processor18 = 0x00020000, + Processor19 = 0x00040000, + Processor20 = 0x00080000, + Processor21 = 0x00100000, + Processor22 = 0x00200000, + Processor23 = 0x00400000, + Processor24 = 0x00800000, + Processor25 = 0x01000000, + Processor26 = 0x02000000, + Processor27 = 0x04000000, + Processor28 = 0x08000000, + Processor29 = 0x10000000, + Processor30 = 0x20000000, + Processor31 = 0x40000000, + Processor32 = 0x80000000, + XAUDIO2_ANY_PROCESSOR = 0xffffffff, + XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR + } XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER, XAUDIO2_PROCESSOR; +#endif + +// Used in XAUDIO2_DEVICE_DETAILS below to describe the types of applications +// that the user has specified each device as a default for. 0 means that the +// device isn't the default for any role. +typedef enum XAUDIO2_DEVICE_ROLE +{ + NotDefaultDevice = 0x0, + DefaultConsoleDevice = 0x1, + DefaultMultimediaDevice = 0x2, + DefaultCommunicationsDevice = 0x4, + DefaultGameDevice = 0x8, + GlobalDefaultDevice = 0xf, + InvalidDeviceRole = ~GlobalDefaultDevice +} XAUDIO2_DEVICE_ROLE; + +// Returned by IXAudio2::GetDeviceDetails +typedef struct XAUDIO2_DEVICE_DETAILS +{ + WCHAR DeviceID[256]; // String identifier for the audio device. + WCHAR DisplayName[256]; // Friendly name suitable for display to a human. + XAUDIO2_DEVICE_ROLE Role; // Roles that the device should be used for. + WAVEFORMATEXTENSIBLE OutputFormat; // The device's native PCM audio output format. +} XAUDIO2_DEVICE_DETAILS; + +// Returned by IXAudio2Voice::GetVoiceDetails +typedef struct XAUDIO2_VOICE_DETAILS +{ + UINT32 CreationFlags; // Flags the voice was created with. + UINT32 InputChannels; // Channels in the voice's input audio. + UINT32 InputSampleRate; // Sample rate of the voice's input audio. +} XAUDIO2_VOICE_DETAILS; + +// Used in XAUDIO2_VOICE_SENDS below +typedef struct XAUDIO2_SEND_DESCRIPTOR +{ + UINT32 Flags; // Either 0 or XAUDIO2_SEND_USEFILTER. + IXAudio2Voice* pOutputVoice; // This send's destination voice. +} XAUDIO2_SEND_DESCRIPTOR; + +// Used in the voice creation functions and in IXAudio2Voice::SetOutputVoices +typedef struct XAUDIO2_VOICE_SENDS +{ + UINT32 SendCount; // Number of sends from this voice. + XAUDIO2_SEND_DESCRIPTOR* pSends; // Array of SendCount send descriptors. +} XAUDIO2_VOICE_SENDS; + +// Used in XAUDIO2_EFFECT_CHAIN below +typedef struct XAUDIO2_EFFECT_DESCRIPTOR +{ + IUnknown* pEffect; // Pointer to the effect object's IUnknown interface. + BOOL InitialState; // TRUE if the effect should begin in the enabled state. + UINT32 OutputChannels; // How many output channels the effect should produce. +} XAUDIO2_EFFECT_DESCRIPTOR; + +// Used in the voice creation functions and in IXAudio2Voice::SetEffectChain +typedef struct XAUDIO2_EFFECT_CHAIN +{ + UINT32 EffectCount; // Number of effects in this voice's effect chain. + XAUDIO2_EFFECT_DESCRIPTOR* pEffectDescriptors; // Array of effect descriptors. +} XAUDIO2_EFFECT_CHAIN; + +// Used in XAUDIO2_FILTER_PARAMETERS below +typedef enum XAUDIO2_FILTER_TYPE +{ + LowPassFilter, // Attenuates frequencies above the cutoff frequency. + BandPassFilter, // Attenuates frequencies outside a given range. + HighPassFilter, // Attenuates frequencies below the cutoff frequency. + NotchFilter // Attenuates frequencies inside a given range. +} XAUDIO2_FILTER_TYPE; + +// Used in IXAudio2Voice::Set/GetFilterParameters and Set/GetOutputFilterParameters +typedef struct XAUDIO2_FILTER_PARAMETERS +{ + XAUDIO2_FILTER_TYPE Type; // Low-pass, band-pass or high-pass. + float Frequency; // Radian frequency (2 * sin(pi*CutoffFrequency/SampleRate)); + // must be >= 0 and <= XAUDIO2_MAX_FILTER_FREQUENCY + // (giving a maximum CutoffFrequency of SampleRate/6). + float OneOverQ; // Reciprocal of the filter's quality factor Q; + // must be > 0 and <= XAUDIO2_MAX_FILTER_ONEOVERQ. +} XAUDIO2_FILTER_PARAMETERS; + +// Used in IXAudio2SourceVoice::SubmitSourceBuffer +typedef struct XAUDIO2_BUFFER +{ + UINT32 Flags; // Either 0 or XAUDIO2_END_OF_STREAM. + UINT32 AudioBytes; // Size of the audio data buffer in bytes. + const BYTE* pAudioData; // Pointer to the audio data buffer. + UINT32 PlayBegin; // First sample in this buffer to be played. + UINT32 PlayLength; // Length of the region to be played in samples, + // or 0 to play the whole buffer. + UINT32 LoopBegin; // First sample of the region to be looped. + UINT32 LoopLength; // Length of the desired loop region in samples, + // or 0 to loop the entire buffer. + UINT32 LoopCount; // Number of times to repeat the loop region, + // or XAUDIO2_LOOP_INFINITE to loop forever. + void* pContext; // Context value to be passed back in callbacks. +} XAUDIO2_BUFFER; + +// Used in IXAudio2SourceVoice::SubmitSourceBuffer when submitting XWMA data. +// NOTE: If an XWMA sound is submitted in more than one buffer, each buffer's +// pDecodedPacketCumulativeBytes[PacketCount-1] value must be subtracted from +// all the entries in the next buffer's pDecodedPacketCumulativeBytes array. +// And whether a sound is submitted in more than one buffer or not, the final +// buffer of the sound should use the XAUDIO2_END_OF_STREAM flag, or else the +// client must call IXAudio2SourceVoice::Discontinuity after submitting it. +typedef struct XAUDIO2_BUFFER_WMA +{ + const UINT32* pDecodedPacketCumulativeBytes; // Decoded packet's cumulative size array. + // Each element is the number of bytes accumulated + // when the corresponding XWMA packet is decoded in + // order. The array must have PacketCount elements. + UINT32 PacketCount; // Number of XWMA packets submitted. Must be >= 1 and + // divide evenly into XAUDIO2_BUFFER.AudioBytes. +} XAUDIO2_BUFFER_WMA; + +// Returned by IXAudio2SourceVoice::GetState +typedef struct XAUDIO2_VOICE_STATE +{ + void* pCurrentBufferContext; // The pContext value provided in the XAUDIO2_BUFFER + // that is currently being processed, or NULL if + // there are no buffers in the queue. + UINT32 BuffersQueued; // Number of buffers currently queued on the voice + // (including the one that is being processed). + UINT64 SamplesPlayed; // Total number of samples produced by the voice since + // it began processing the current audio stream. +} XAUDIO2_VOICE_STATE; + +// Returned by IXAudio2::GetPerformanceData +typedef struct XAUDIO2_PERFORMANCE_DATA +{ + // CPU usage information + UINT64 AudioCyclesSinceLastQuery; // CPU cycles spent on audio processing since the + // last call to StartEngine or GetPerformanceData. + UINT64 TotalCyclesSinceLastQuery; // Total CPU cycles elapsed since the last call + // (only counts the CPU XAudio2 is running on). + UINT32 MinimumCyclesPerQuantum; // Fewest CPU cycles spent processing any one + // audio quantum since the last call. + UINT32 MaximumCyclesPerQuantum; // Most CPU cycles spent processing any one + // audio quantum since the last call. + + // Memory usage information + UINT32 MemoryUsageInBytes; // Total heap space currently in use. + + // Audio latency and glitching information + UINT32 CurrentLatencyInSamples; // Minimum delay from when a sample is read from a + // source buffer to when it reaches the speakers. + UINT32 GlitchesSinceEngineStarted; // Audio dropouts since the engine was started. + + // Data about XAudio2's current workload + UINT32 ActiveSourceVoiceCount; // Source voices currently playing. + UINT32 TotalSourceVoiceCount; // Source voices currently existing. + UINT32 ActiveSubmixVoiceCount; // Submix voices currently playing/existing. + + UINT32 ActiveResamplerCount; // Resample xAPOs currently active. + UINT32 ActiveMatrixMixCount; // MatrixMix xAPOs currently active. + + // Usage of the hardware XMA decoder (Xbox 360 only) + UINT32 ActiveXmaSourceVoices; // Number of source voices decoding XMA data. + UINT32 ActiveXmaStreams; // A voice can use more than one XMA stream. +} XAUDIO2_PERFORMANCE_DATA; + +// Used in IXAudio2::SetDebugConfiguration +typedef struct XAUDIO2_DEBUG_CONFIGURATION +{ + UINT32 TraceMask; // Bitmap of enabled debug message types. + UINT32 BreakMask; // Message types that will break into the debugger. + BOOL LogThreadID; // Whether to log the thread ID with each message. + BOOL LogFileline; // Whether to log the source file and line number. + BOOL LogFunctionName; // Whether to log the function name. + BOOL LogTiming; // Whether to log message timestamps. +} XAUDIO2_DEBUG_CONFIGURATION; + +// Values for the TraceMask and BreakMask bitmaps. Only ERRORS and WARNINGS +// are valid in BreakMask. WARNINGS implies ERRORS, DETAIL implies INFO, and +// FUNC_CALLS implies API_CALLS. By default, TraceMask is ERRORS and WARNINGS +// and all the other settings are zero. +#define XAUDIO2_LOG_ERRORS 0x0001 // For handled errors with serious effects. +#define XAUDIO2_LOG_WARNINGS 0x0002 // For handled errors that may be recoverable. +#define XAUDIO2_LOG_INFO 0x0004 // Informational chit-chat (e.g. state changes). +#define XAUDIO2_LOG_DETAIL 0x0008 // More detailed chit-chat. +#define XAUDIO2_LOG_API_CALLS 0x0010 // Public API function entries and exits. +#define XAUDIO2_LOG_FUNC_CALLS 0x0020 // Internal function entries and exits. +#define XAUDIO2_LOG_TIMING 0x0040 // Delays detected and other timing data. +#define XAUDIO2_LOG_LOCKS 0x0080 // Usage of critical sections and mutexes. +#define XAUDIO2_LOG_MEMORY 0x0100 // Memory heap usage information. +#define XAUDIO2_LOG_STREAMING 0x1000 // Audio streaming information. + + +/************************************************************************** + * + * IXAudio2: Top-level XAudio2 COM interface. + * + **************************************************************************/ + +// Use default arguments if compiling as C++ +#ifdef __cplusplus + #define X2DEFAULT(x) =x +#else + #define X2DEFAULT(x) +#endif + +#undef INTERFACE +#define INTERFACE IXAudio2 +DECLARE_INTERFACE_(IXAudio2, IUnknown) +{ + // NAME: IXAudio2::QueryInterface + // DESCRIPTION: Queries for a given COM interface on the XAudio2 object. + // Only IID_IUnknown and IID_IXAudio2 are supported. + // + // ARGUMENTS: + // riid - IID of the interface to be obtained. + // ppvInterface - Returns a pointer to the requested interface. + // + STDMETHOD(QueryInterface) (THIS_ REFIID riid, __deref_out void** ppvInterface) PURE; + + // NAME: IXAudio2::AddRef + // DESCRIPTION: Adds a reference to the XAudio2 object. + // + STDMETHOD_(ULONG, AddRef) (THIS) PURE; + + // NAME: IXAudio2::Release + // DESCRIPTION: Releases a reference to the XAudio2 object. + // + STDMETHOD_(ULONG, Release) (THIS) PURE; + + // NAME: IXAudio2::GetDeviceCount + // DESCRIPTION: Returns the number of audio output devices available. + // + // ARGUMENTS: + // pCount - Returns the device count. + // + STDMETHOD(GetDeviceCount) (THIS_ __out UINT32* pCount) PURE; + + // NAME: IXAudio2::GetDeviceDetails + // DESCRIPTION: Returns information about the device with the given index. + // + // ARGUMENTS: + // Index - Index of the device to be queried. + // pDeviceDetails - Returns the device details. + // + STDMETHOD(GetDeviceDetails) (THIS_ UINT32 Index, __out XAUDIO2_DEVICE_DETAILS* pDeviceDetails) PURE; + + // NAME: IXAudio2::Initialize + // DESCRIPTION: Sets global XAudio2 parameters and prepares it for use. + // + // ARGUMENTS: + // Flags - Flags specifying the XAudio2 object's behavior. Currently unused. + // XAudio2Processor - An XAUDIO2_PROCESSOR enumeration value that specifies + // the hardware thread (Xbox) or processor (Windows) that XAudio2 will use. + // The enumeration values are platform-specific; platform-independent code + // can use XAUDIO2_DEFAULT_PROCESSOR to use the default on each platform. + // + STDMETHOD(Initialize) (THIS_ UINT32 Flags X2DEFAULT(0), + XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)) PURE; + + // NAME: IXAudio2::RegisterForCallbacks + // DESCRIPTION: Adds a new client to receive XAudio2's engine callbacks. + // + // ARGUMENTS: + // pCallback - Callback interface to be called during each processing pass. + // + STDMETHOD(RegisterForCallbacks) (__in IXAudio2EngineCallback* pCallback) PURE; + + // NAME: IXAudio2::UnregisterForCallbacks + // DESCRIPTION: Removes an existing receiver of XAudio2 engine callbacks. + // + // ARGUMENTS: + // pCallback - Previously registered callback interface to be removed. + // + STDMETHOD_(void, UnregisterForCallbacks) (__in IXAudio2EngineCallback* pCallback) PURE; + + // NAME: IXAudio2::CreateSourceVoice + // DESCRIPTION: Creates and configures a source voice. + // + // ARGUMENTS: + // ppSourceVoice - Returns the new object's IXAudio2SourceVoice interface. + // pSourceFormat - Format of the audio that will be fed to the voice. + // Flags - XAUDIO2_VOICE flags specifying the source voice's behavior. + // MaxFrequencyRatio - Maximum SetFrequencyRatio argument to be allowed. + // pCallback - Optional pointer to a client-provided callback interface. + // pSendList - Optional list of voices this voice should send audio to. + // pEffectChain - Optional list of effects to apply to the audio data. + // + STDMETHOD(CreateSourceVoice) (THIS_ __deref_out IXAudio2SourceVoice** ppSourceVoice, + __in const WAVEFORMATEX* pSourceFormat, + UINT32 Flags X2DEFAULT(0), + float MaxFrequencyRatio X2DEFAULT(XAUDIO2_DEFAULT_FREQ_RATIO), + __in_opt IXAudio2VoiceCallback* pCallback X2DEFAULT(NULL), + __in_opt const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL), + __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE; + + // NAME: IXAudio2::CreateSubmixVoice + // DESCRIPTION: Creates and configures a submix voice. + // + // ARGUMENTS: + // ppSubmixVoice - Returns the new object's IXAudio2SubmixVoice interface. + // InputChannels - Number of channels in this voice's input audio data. + // InputSampleRate - Sample rate of this voice's input audio data. + // Flags - XAUDIO2_VOICE flags specifying the submix voice's behavior. + // ProcessingStage - Arbitrary number that determines the processing order. + // pSendList - Optional list of voices this voice should send audio to. + // pEffectChain - Optional list of effects to apply to the audio data. + // + STDMETHOD(CreateSubmixVoice) (THIS_ __deref_out IXAudio2SubmixVoice** ppSubmixVoice, + UINT32 InputChannels, UINT32 InputSampleRate, + UINT32 Flags X2DEFAULT(0), UINT32 ProcessingStage X2DEFAULT(0), + __in_opt const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL), + __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE; + + + // NAME: IXAudio2::CreateMasteringVoice + // DESCRIPTION: Creates and configures a mastering voice. + // + // ARGUMENTS: + // ppMasteringVoice - Returns the new object's IXAudio2MasteringVoice interface. + // InputChannels - Number of channels in this voice's input audio data. + // InputSampleRate - Sample rate of this voice's input audio data. + // Flags - XAUDIO2_VOICE flags specifying the mastering voice's behavior. + // DeviceIndex - Identifier of the device to receive the output audio. + // pEffectChain - Optional list of effects to apply to the audio data. + // + STDMETHOD(CreateMasteringVoice) (THIS_ __deref_out IXAudio2MasteringVoice** ppMasteringVoice, + UINT32 InputChannels X2DEFAULT(XAUDIO2_DEFAULT_CHANNELS), + UINT32 InputSampleRate X2DEFAULT(XAUDIO2_DEFAULT_SAMPLERATE), + UINT32 Flags X2DEFAULT(0), UINT32 DeviceIndex X2DEFAULT(0), + __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE; + + // NAME: IXAudio2::StartEngine + // DESCRIPTION: Creates and starts the audio processing thread. + // + STDMETHOD(StartEngine) (THIS) PURE; + + // NAME: IXAudio2::StopEngine + // DESCRIPTION: Stops and destroys the audio processing thread. + // + STDMETHOD_(void, StopEngine) (THIS) PURE; + + // NAME: IXAudio2::CommitChanges + // DESCRIPTION: Atomically applies a set of operations previously tagged + // with a given identifier. + // + // ARGUMENTS: + // OperationSet - Identifier of the set of operations to be applied. + // + STDMETHOD(CommitChanges) (THIS_ UINT32 OperationSet) PURE; + + // NAME: IXAudio2::GetPerformanceData + // DESCRIPTION: Returns current resource usage details: memory, CPU, etc. + // + // ARGUMENTS: + // pPerfData - Returns the performance data structure. + // + STDMETHOD_(void, GetPerformanceData) (THIS_ __out XAUDIO2_PERFORMANCE_DATA* pPerfData) PURE; + + // NAME: IXAudio2::SetDebugConfiguration + // DESCRIPTION: Configures XAudio2's debug output (in debug builds only). + // + // ARGUMENTS: + // pDebugConfiguration - Structure describing the debug output behavior. + // pReserved - Optional parameter; must be NULL. + // + STDMETHOD_(void, SetDebugConfiguration) (THIS_ __in_opt const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration, + __in_opt __reserved void* pReserved X2DEFAULT(NULL)) PURE; +}; + + +/************************************************************************** + * + * IXAudio2Voice: Base voice management interface. + * + **************************************************************************/ + +#undef INTERFACE +#define INTERFACE IXAudio2Voice +DECLARE_INTERFACE(IXAudio2Voice) +{ + // These methods are declared in a macro so that the same declarations + // can be used in the derived voice types (IXAudio2SourceVoice, etc). + + #define Declare_IXAudio2Voice_Methods() \ + \ + /* NAME: IXAudio2Voice::GetVoiceDetails + // DESCRIPTION: Returns the basic characteristics of this voice. + // + // ARGUMENTS: + // pVoiceDetails - Returns the voice's details. + */\ + STDMETHOD_(void, GetVoiceDetails) (THIS_ __out XAUDIO2_VOICE_DETAILS* pVoiceDetails) PURE; \ + \ + /* NAME: IXAudio2Voice::SetOutputVoices + // DESCRIPTION: Replaces the set of submix/mastering voices that receive + // this voice's output. + // + // ARGUMENTS: + // pSendList - Optional list of voices this voice should send audio to. + */\ + STDMETHOD(SetOutputVoices) (THIS_ __in_opt const XAUDIO2_VOICE_SENDS* pSendList) PURE; \ + \ + /* NAME: IXAudio2Voice::SetEffectChain + // DESCRIPTION: Replaces this voice's current effect chain with a new one. + // + // ARGUMENTS: + // pEffectChain - Structure describing the new effect chain to be used. + */\ + STDMETHOD(SetEffectChain) (THIS_ __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain) PURE; \ + \ + /* NAME: IXAudio2Voice::EnableEffect + // DESCRIPTION: Enables an effect in this voice's effect chain. + // + // ARGUMENTS: + // EffectIndex - Index of an effect within this voice's effect chain. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(EnableEffect) (THIS_ UINT32 EffectIndex, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::DisableEffect + // DESCRIPTION: Disables an effect in this voice's effect chain. + // + // ARGUMENTS: + // EffectIndex - Index of an effect within this voice's effect chain. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(DisableEffect) (THIS_ UINT32 EffectIndex, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::GetEffectState + // DESCRIPTION: Returns the running state of an effect. + // + // ARGUMENTS: + // EffectIndex - Index of an effect within this voice's effect chain. + // pEnabled - Returns the enabled/disabled state of the given effect. + */\ + STDMETHOD_(void, GetEffectState) (THIS_ UINT32 EffectIndex, __out BOOL* pEnabled) PURE; \ + \ + /* NAME: IXAudio2Voice::SetEffectParameters + // DESCRIPTION: Sets effect-specific parameters. + // + // REMARKS: Unlike IXAPOParameters::SetParameters, this method may + // be called from any thread. XAudio2 implements + // appropriate synchronization to copy the parameters to the + // realtime audio processing thread. + // + // ARGUMENTS: + // EffectIndex - Index of an effect within this voice's effect chain. + // pParameters - Pointer to an effect-specific parameters block. + // ParametersByteSize - Size of the pParameters array in bytes. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(SetEffectParameters) (THIS_ UINT32 EffectIndex, \ + __in_bcount(ParametersByteSize) const void* pParameters, \ + UINT32 ParametersByteSize, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::GetEffectParameters + // DESCRIPTION: Obtains the current effect-specific parameters. + // + // ARGUMENTS: + // EffectIndex - Index of an effect within this voice's effect chain. + // pParameters - Returns the current values of the effect-specific parameters. + // ParametersByteSize - Size of the pParameters array in bytes. + */\ + STDMETHOD(GetEffectParameters) (THIS_ UINT32 EffectIndex, \ + __out_bcount(ParametersByteSize) void* pParameters, \ + UINT32 ParametersByteSize) PURE; \ + \ + /* NAME: IXAudio2Voice::SetFilterParameters + // DESCRIPTION: Sets this voice's filter parameters. + // + // ARGUMENTS: + // pParameters - Pointer to the filter's parameter structure. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(SetFilterParameters) (THIS_ __in const XAUDIO2_FILTER_PARAMETERS* pParameters, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::GetFilterParameters + // DESCRIPTION: Returns this voice's current filter parameters. + // + // ARGUMENTS: + // pParameters - Returns the filter parameters. + */\ + STDMETHOD_(void, GetFilterParameters) (THIS_ __out XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \ + \ + /* NAME: IXAudio2Voice::SetOutputFilterParameters + // DESCRIPTION: Sets the filter parameters on one of this voice's sends. + // + // ARGUMENTS: + // pDestinationVoice - Destination voice of the send whose filter parameters will be set. + // pParameters - Pointer to the filter's parameter structure. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(SetOutputFilterParameters) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \ + __in const XAUDIO2_FILTER_PARAMETERS* pParameters, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::GetOutputFilterParameters + // DESCRIPTION: Returns the filter parameters from one of this voice's sends. + // + // ARGUMENTS: + // pDestinationVoice - Destination voice of the send whose filter parameters will be read. + // pParameters - Returns the filter parameters. + */\ + STDMETHOD_(void, GetOutputFilterParameters) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \ + __out XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \ + \ + /* NAME: IXAudio2Voice::SetVolume + // DESCRIPTION: Sets this voice's overall volume level. + // + // ARGUMENTS: + // Volume - New overall volume level to be used, as an amplitude factor. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(SetVolume) (THIS_ float Volume, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::GetVolume + // DESCRIPTION: Obtains this voice's current overall volume level. + // + // ARGUMENTS: + // pVolume: Returns the voice's current overall volume level. + */\ + STDMETHOD_(void, GetVolume) (THIS_ __out float* pVolume) PURE; \ + \ + /* NAME: IXAudio2Voice::SetChannelVolumes + // DESCRIPTION: Sets this voice's per-channel volume levels. + // + // ARGUMENTS: + // Channels - Used to confirm the voice's channel count. + // pVolumes - Array of per-channel volume levels to be used. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(SetChannelVolumes) (THIS_ UINT32 Channels, __in_ecount(Channels) const float* pVolumes, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::GetChannelVolumes + // DESCRIPTION: Returns this voice's current per-channel volume levels. + // + // ARGUMENTS: + // Channels - Used to confirm the voice's channel count. + // pVolumes - Returns an array of the current per-channel volume levels. + */\ + STDMETHOD_(void, GetChannelVolumes) (THIS_ UINT32 Channels, __out_ecount(Channels) float* pVolumes) PURE; \ + \ + /* NAME: IXAudio2Voice::SetOutputMatrix + // DESCRIPTION: Sets the volume levels used to mix from each channel of this + // voice's output audio to each channel of a given destination + // voice's input audio. + // + // ARGUMENTS: + // pDestinationVoice - The destination voice whose mix matrix to change. + // SourceChannels - Used to confirm this voice's output channel count + // (the number of channels produced by the last effect in the chain). + // DestinationChannels - Confirms the destination voice's input channels. + // pLevelMatrix - Array of [SourceChannels * DestinationChannels] send + // levels. The level used to send from source channel S to destination + // channel D should be in pLevelMatrix[S + SourceChannels * D]. + // OperationSet - Used to identify this call as part of a deferred batch. + */\ + STDMETHOD(SetOutputMatrix) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \ + UINT32 SourceChannels, UINT32 DestinationChannels, \ + __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix, \ + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ + \ + /* NAME: IXAudio2Voice::GetOutputMatrix + // DESCRIPTION: Obtains the volume levels used to send each channel of this + // voice's output audio to each channel of a given destination + // voice's input audio. + // + // ARGUMENTS: + // pDestinationVoice - The destination voice whose mix matrix to obtain. + // SourceChannels - Used to confirm this voice's output channel count + // (the number of channels produced by the last effect in the chain). + // DestinationChannels - Confirms the destination voice's input channels. + // pLevelMatrix - Array of send levels, as above. + */\ + STDMETHOD_(void, GetOutputMatrix) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \ + UINT32 SourceChannels, UINT32 DestinationChannels, \ + __out_ecount(SourceChannels * DestinationChannels) float* pLevelMatrix) PURE; \ + \ + /* NAME: IXAudio2Voice::DestroyVoice + // DESCRIPTION: Destroys this voice, stopping it if necessary and removing + // it from the XAudio2 graph. + */\ + STDMETHOD_(void, DestroyVoice) (THIS) PURE + + Declare_IXAudio2Voice_Methods(); +}; + + +/************************************************************************** + * + * IXAudio2SourceVoice: Source voice management interface. + * + **************************************************************************/ + +#undef INTERFACE +#define INTERFACE IXAudio2SourceVoice +DECLARE_INTERFACE_(IXAudio2SourceVoice, IXAudio2Voice) +{ + // Methods from IXAudio2Voice base interface + Declare_IXAudio2Voice_Methods(); + + // NAME: IXAudio2SourceVoice::Start + // DESCRIPTION: Makes this voice start consuming and processing audio. + // + // ARGUMENTS: + // Flags - Flags controlling how the voice should be started. + // OperationSet - Used to identify this call as part of a deferred batch. + // + STDMETHOD(Start) (THIS_ UINT32 Flags X2DEFAULT(0), UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; + + // NAME: IXAudio2SourceVoice::Stop + // DESCRIPTION: Makes this voice stop consuming audio. + // + // ARGUMENTS: + // Flags - Flags controlling how the voice should be stopped. + // OperationSet - Used to identify this call as part of a deferred batch. + // + STDMETHOD(Stop) (THIS_ UINT32 Flags X2DEFAULT(0), UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; + + // NAME: IXAudio2SourceVoice::SubmitSourceBuffer + // DESCRIPTION: Adds a new audio buffer to this voice's input queue. + // + // ARGUMENTS: + // pBuffer - Pointer to the buffer structure to be queued. + // pBufferWMA - Additional structure used only when submitting XWMA data. + // + STDMETHOD(SubmitSourceBuffer) (THIS_ __in const XAUDIO2_BUFFER* pBuffer, __in_opt const XAUDIO2_BUFFER_WMA* pBufferWMA X2DEFAULT(NULL)) PURE; + + // NAME: IXAudio2SourceVoice::FlushSourceBuffers + // DESCRIPTION: Removes all pending audio buffers from this voice's queue. + // + STDMETHOD(FlushSourceBuffers) (THIS) PURE; + + // NAME: IXAudio2SourceVoice::Discontinuity + // DESCRIPTION: Notifies the voice of an intentional break in the stream of + // audio buffers (e.g. the end of a sound), to prevent XAudio2 + // from interpreting an empty buffer queue as a glitch. + // + STDMETHOD(Discontinuity) (THIS) PURE; + + // NAME: IXAudio2SourceVoice::ExitLoop + // DESCRIPTION: Breaks out of the current loop when its end is reached. + // + // ARGUMENTS: + // OperationSet - Used to identify this call as part of a deferred batch. + // + STDMETHOD(ExitLoop) (THIS_ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; + + // NAME: IXAudio2SourceVoice::GetState + // DESCRIPTION: Returns the number of buffers currently queued on this voice, + // the pContext value associated with the currently processing + // buffer (if any), and other voice state information. + // + // ARGUMENTS: + // pVoiceState - Returns the state information. + // + STDMETHOD_(void, GetState) (THIS_ __out XAUDIO2_VOICE_STATE* pVoiceState) PURE; + + // NAME: IXAudio2SourceVoice::SetFrequencyRatio + // DESCRIPTION: Sets this voice's frequency adjustment, i.e. its pitch. + // + // ARGUMENTS: + // Ratio - Frequency change, expressed as source frequency / target frequency. + // OperationSet - Used to identify this call as part of a deferred batch. + // + STDMETHOD(SetFrequencyRatio) (THIS_ float Ratio, + UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; + + // NAME: IXAudio2SourceVoice::GetFrequencyRatio + // DESCRIPTION: Returns this voice's current frequency adjustment ratio. + // + // ARGUMENTS: + // pRatio - Returns the frequency adjustment. + // + STDMETHOD_(void, GetFrequencyRatio) (THIS_ __out float* pRatio) PURE; + + // NAME: IXAudio2SourceVoice::SetSourceSampleRate + // DESCRIPTION: Reconfigures this voice to treat its source data as being + // at a different sample rate than the original one specified + // in CreateSourceVoice's pSourceFormat argument. + // + // ARGUMENTS: + // UINT32 - The intended sample rate of further submitted source data. + // + STDMETHOD(SetSourceSampleRate) (THIS_ UINT32 NewSourceSampleRate) PURE; +}; + + +/************************************************************************** + * + * IXAudio2SubmixVoice: Submixing voice management interface. + * + **************************************************************************/ + +#undef INTERFACE +#define INTERFACE IXAudio2SubmixVoice +DECLARE_INTERFACE_(IXAudio2SubmixVoice, IXAudio2Voice) +{ + // Methods from IXAudio2Voice base interface + Declare_IXAudio2Voice_Methods(); + + // There are currently no methods specific to submix voices. +}; + + +/************************************************************************** + * + * IXAudio2MasteringVoice: Mastering voice management interface. + * + **************************************************************************/ + +#undef INTERFACE +#define INTERFACE IXAudio2MasteringVoice +DECLARE_INTERFACE_(IXAudio2MasteringVoice, IXAudio2Voice) +{ + // Methods from IXAudio2Voice base interface + Declare_IXAudio2Voice_Methods(); + + // There are currently no methods specific to mastering voices. +}; + + +/************************************************************************** + * + * IXAudio2EngineCallback: Client notification interface for engine events. + * + * REMARKS: Contains methods to notify the client when certain events happen + * in the XAudio2 engine. This interface should be implemented by + * the client. XAudio2 will call these methods via the interface + * pointer provided by the client when it calls XAudio2Create or + * IXAudio2::Initialize. + * + **************************************************************************/ + +#undef INTERFACE +#define INTERFACE IXAudio2EngineCallback +DECLARE_INTERFACE(IXAudio2EngineCallback) +{ + // Called by XAudio2 just before an audio processing pass begins. + STDMETHOD_(void, OnProcessingPassStart) (THIS) PURE; + + // Called just after an audio processing pass ends. + STDMETHOD_(void, OnProcessingPassEnd) (THIS) PURE; + + // Called in the event of a critical system error which requires XAudio2 + // to be closed down and restarted. The error code is given in Error. + STDMETHOD_(void, OnCriticalError) (THIS_ HRESULT Error) PURE; +}; + + +/************************************************************************** + * + * IXAudio2VoiceCallback: Client notification interface for voice events. + * + * REMARKS: Contains methods to notify the client when certain events happen + * in an XAudio2 voice. This interface should be implemented by the + * client. XAudio2 will call these methods via an interface pointer + * provided by the client in the IXAudio2::CreateSourceVoice call. + * + **************************************************************************/ + +#undef INTERFACE +#define INTERFACE IXAudio2VoiceCallback +DECLARE_INTERFACE(IXAudio2VoiceCallback) +{ + // Called just before this voice's processing pass begins. + STDMETHOD_(void, OnVoiceProcessingPassStart) (THIS_ UINT32 BytesRequired) PURE; + + // Called just after this voice's processing pass ends. + STDMETHOD_(void, OnVoiceProcessingPassEnd) (THIS) PURE; + + // Called when this voice has just finished playing a buffer stream + // (as marked with the XAUDIO2_END_OF_STREAM flag on the last buffer). + STDMETHOD_(void, OnStreamEnd) (THIS) PURE; + + // Called when this voice is about to start processing a new buffer. + STDMETHOD_(void, OnBufferStart) (THIS_ void* pBufferContext) PURE; + + // Called when this voice has just finished processing a buffer. + // The buffer can now be reused or destroyed. + STDMETHOD_(void, OnBufferEnd) (THIS_ void* pBufferContext) PURE; + + // Called when this voice has just reached the end position of a loop. + STDMETHOD_(void, OnLoopEnd) (THIS_ void* pBufferContext) PURE; + + // Called in the event of a critical error during voice processing, + // such as a failing xAPO or an error from the hardware XMA decoder. + // The voice may have to be destroyed and re-created to recover from + // the error. The callback arguments report which buffer was being + // processed when the error occurred, and its HRESULT code. + STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error) PURE; +}; + + +/************************************************************************** + * + * Macros to make it easier to use the XAudio2 COM interfaces in C code. + * + **************************************************************************/ + +#ifndef __cplusplus + +// IXAudio2 +#define IXAudio2_QueryInterface(This,riid,ppvInterface) ((This)->lpVtbl->QueryInterface(This,riid,ppvInterface)) +#define IXAudio2_AddRef(This) ((This)->lpVtbl->AddRef(This)) +#define IXAudio2_Release(This) ((This)->lpVtbl->Release(This)) +#define IXAudio2_GetDeviceCount(This,puCount) ((This)->lpVtbl->GetDeviceCount(This,puCount)) +#define IXAudio2_GetDeviceDetails(This,Index,pDeviceDetails) ((This)->lpVtbl->GetDeviceDetails(This,Index,pDeviceDetails)) +#define IXAudio2_Initialize(This,Flags,XAudio2Processor) ((This)->lpVtbl->Initialize(This,Flags,XAudio2Processor)) +#define IXAudio2_CreateSourceVoice(This,ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain) ((This)->lpVtbl->CreateSourceVoice(This,ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain)) +#define IXAudio2_CreateSubmixVoice(This,ppSubmixVoice,InputChannels,InputSampleRate,Flags,ProcessingStage,pSendList,pEffectChain) ((This)->lpVtbl->CreateSubmixVoice(This,ppSubmixVoice,InputChannels,InputSampleRate,Flags,ProcessingStage,pSendList,pEffectChain)) +#define IXAudio2_CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceIndex,pEffectChain) ((This)->lpVtbl->CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceIndex,pEffectChain)) +#define IXAudio2_StartEngine(This) ((This)->lpVtbl->StartEngine(This)) +#define IXAudio2_StopEngine(This) ((This)->lpVtbl->StopEngine(This)) +#define IXAudio2_CommitChanges(This,OperationSet) ((This)->lpVtbl->CommitChanges(This,OperationSet)) +#define IXAudio2_GetPerformanceData(This,pPerfData) ((This)->lpVtbl->GetPerformanceData(This,pPerfData)) +#define IXAudio2_SetDebugConfiguration(This,pDebugConfiguration,pReserved) ((This)->lpVtbl->SetDebugConfiguration(This,pDebugConfiguration,pReserved)) + +// IXAudio2Voice +#define IXAudio2Voice_GetVoiceDetails(This,pVoiceDetails) ((This)->lpVtbl->GetVoiceDetails(This,pVoiceDetails)) +#define IXAudio2Voice_SetOutputVoices(This,pSendList) ((This)->lpVtbl->SetOutputVoices(This,pSendList)) +#define IXAudio2Voice_SetEffectChain(This,pEffectChain) ((This)->lpVtbl->SetEffectChain(This,pEffectChain)) +#define IXAudio2Voice_EnableEffect(This,EffectIndex,OperationSet) ((This)->lpVtbl->EnableEffect(This,EffectIndex,OperationSet)) +#define IXAudio2Voice_DisableEffect(This,EffectIndex,OperationSet) ((This)->lpVtbl->DisableEffect(This,EffectIndex,OperationSet)) +#define IXAudio2Voice_GetEffectState(This,EffectIndex,pEnabled) ((This)->lpVtbl->GetEffectState(This,EffectIndex,pEnabled)) +#define IXAudio2Voice_SetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize, OperationSet) ((This)->lpVtbl->SetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize,OperationSet)) +#define IXAudio2Voice_GetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize) ((This)->lpVtbl->GetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize)) +#define IXAudio2Voice_SetFilterParameters(This,pParameters,OperationSet) ((This)->lpVtbl->SetFilterParameters(This,pParameters,OperationSet)) +#define IXAudio2Voice_GetFilterParameters(This,pParameters) ((This)->lpVtbl->GetFilterParameters(This,pParameters)) +#define IXAudio2Voice_SetOutputFilterParameters(This,pDestinationVoice,pParameters,OperationSet) ((This)->lpVtbl->SetOutputFilterParameters(This,pDestinationVoice,pParameters,OperationSet)) +#define IXAudio2Voice_GetOutputFilterParameters(This,pDestinationVoice,pParameters) ((This)->lpVtbl->GetOutputFilterParameters(This,pDestinationVoice,pParameters)) +#define IXAudio2Voice_SetVolume(This,Volume,OperationSet) ((This)->lpVtbl->SetVolume(This,Volume,OperationSet)) +#define IXAudio2Voice_GetVolume(This,pVolume) ((This)->lpVtbl->GetVolume(This,pVolume)) +#define IXAudio2Voice_SetChannelVolumes(This,Channels,pVolumes,OperationSet) ((This)->lpVtbl->SetChannelVolumes(This,Channels,pVolumes,OperationSet)) +#define IXAudio2Voice_GetChannelVolumes(This,Channels,pVolumes) ((This)->lpVtbl->GetChannelVolumes(This,Channels,pVolumes)) +#define IXAudio2Voice_SetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix,OperationSet) ((This)->lpVtbl->SetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix,OperationSet)) +#define IXAudio2Voice_GetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix) ((This)->lpVtbl->GetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix)) +#define IXAudio2Voice_DestroyVoice(This) ((This)->lpVtbl->DestroyVoice(This)) + +// IXAudio2SourceVoice +#define IXAudio2SourceVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails +#define IXAudio2SourceVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices +#define IXAudio2SourceVoice_SetEffectChain IXAudio2Voice_SetEffectChain +#define IXAudio2SourceVoice_EnableEffect IXAudio2Voice_EnableEffect +#define IXAudio2SourceVoice_DisableEffect IXAudio2Voice_DisableEffect +#define IXAudio2SourceVoice_GetEffectState IXAudio2Voice_GetEffectState +#define IXAudio2SourceVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters +#define IXAudio2SourceVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters +#define IXAudio2SourceVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters +#define IXAudio2SourceVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters +#define IXAudio2SourceVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters +#define IXAudio2SourceVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters +#define IXAudio2SourceVoice_SetVolume IXAudio2Voice_SetVolume +#define IXAudio2SourceVoice_GetVolume IXAudio2Voice_GetVolume +#define IXAudio2SourceVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes +#define IXAudio2SourceVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes +#define IXAudio2SourceVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix +#define IXAudio2SourceVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix +#define IXAudio2SourceVoice_DestroyVoice IXAudio2Voice_DestroyVoice +#define IXAudio2SourceVoice_Start(This,Flags,OperationSet) ((This)->lpVtbl->Start(This,Flags,OperationSet)) +#define IXAudio2SourceVoice_Stop(This,Flags,OperationSet) ((This)->lpVtbl->Stop(This,Flags,OperationSet)) +#define IXAudio2SourceVoice_SubmitSourceBuffer(This,pBuffer,pBufferWMA) ((This)->lpVtbl->SubmitSourceBuffer(This,pBuffer,pBufferWMA)) +#define IXAudio2SourceVoice_FlushSourceBuffers(This) ((This)->lpVtbl->FlushSourceBuffers(This)) +#define IXAudio2SourceVoice_Discontinuity(This) ((This)->lpVtbl->Discontinuity(This)) +#define IXAudio2SourceVoice_ExitLoop(This,OperationSet) ((This)->lpVtbl->ExitLoop(This,OperationSet)) +#define IXAudio2SourceVoice_GetState(This,pVoiceState) ((This)->lpVtbl->GetState(This,pVoiceState)) +#define IXAudio2SourceVoice_SetFrequencyRatio(This,Ratio,OperationSet) ((This)->lpVtbl->SetFrequencyRatio(This,Ratio,OperationSet)) +#define IXAudio2SourceVoice_GetFrequencyRatio(This,pRatio) ((This)->lpVtbl->GetFrequencyRatio(This,pRatio)) +#define IXAudio2SourceVoice_SetSourceSampleRate(This,NewSourceSampleRate) ((This)->lpVtbl->SetSourceSampleRate(This,NewSourceSampleRate)) + +// IXAudio2SubmixVoice +#define IXAudio2SubmixVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails +#define IXAudio2SubmixVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices +#define IXAudio2SubmixVoice_SetEffectChain IXAudio2Voice_SetEffectChain +#define IXAudio2SubmixVoice_EnableEffect IXAudio2Voice_EnableEffect +#define IXAudio2SubmixVoice_DisableEffect IXAudio2Voice_DisableEffect +#define IXAudio2SubmixVoice_GetEffectState IXAudio2Voice_GetEffectState +#define IXAudio2SubmixVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters +#define IXAudio2SubmixVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters +#define IXAudio2SubmixVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters +#define IXAudio2SubmixVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters +#define IXAudio2SubmixVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters +#define IXAudio2SubmixVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters +#define IXAudio2SubmixVoice_SetVolume IXAudio2Voice_SetVolume +#define IXAudio2SubmixVoice_GetVolume IXAudio2Voice_GetVolume +#define IXAudio2SubmixVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes +#define IXAudio2SubmixVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes +#define IXAudio2SubmixVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix +#define IXAudio2SubmixVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix +#define IXAudio2SubmixVoice_DestroyVoice IXAudio2Voice_DestroyVoice + +// IXAudio2MasteringVoice +#define IXAudio2MasteringVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails +#define IXAudio2MasteringVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices +#define IXAudio2MasteringVoice_SetEffectChain IXAudio2Voice_SetEffectChain +#define IXAudio2MasteringVoice_EnableEffect IXAudio2Voice_EnableEffect +#define IXAudio2MasteringVoice_DisableEffect IXAudio2Voice_DisableEffect +#define IXAudio2MasteringVoice_GetEffectState IXAudio2Voice_GetEffectState +#define IXAudio2MasteringVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters +#define IXAudio2MasteringVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters +#define IXAudio2MasteringVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters +#define IXAudio2MasteringVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters +#define IXAudio2MasteringVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters +#define IXAudio2MasteringVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters +#define IXAudio2MasteringVoice_SetVolume IXAudio2Voice_SetVolume +#define IXAudio2MasteringVoice_GetVolume IXAudio2Voice_GetVolume +#define IXAudio2MasteringVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes +#define IXAudio2MasteringVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes +#define IXAudio2MasteringVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix +#define IXAudio2MasteringVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix +#define IXAudio2MasteringVoice_DestroyVoice IXAudio2Voice_DestroyVoice + +#endif // #ifndef __cplusplus + + +/************************************************************************** + * + * Utility functions used to convert from pitch in semitones and volume + * in decibels to the frequency and amplitude ratio units used by XAudio2. + * These are only defined if the client #defines XAUDIO2_HELPER_FUNCTIONS + * prior to #including xaudio2.h. + * + **************************************************************************/ + +#ifdef XAUDIO2_HELPER_FUNCTIONS + +#define _USE_MATH_DEFINES // Make math.h define M_PI +#include // For powf, log10f, sinf and asinf + +// Calculate the argument to SetVolume from a decibel value +__inline float XAudio2DecibelsToAmplitudeRatio(float Decibels) +{ + return powf(10.0f, Decibels / 20.0f); +} + +// Recover a volume in decibels from an amplitude factor +__inline float XAudio2AmplitudeRatioToDecibels(float Volume) +{ + if (Volume == 0) + { + return -3.402823466e+38f; // Smallest float value (-FLT_MAX) + } + return 20.0f * log10f(Volume); +} + +// Calculate the argument to SetFrequencyRatio from a semitone value +__inline float XAudio2SemitonesToFrequencyRatio(float Semitones) +{ + // FrequencyRatio = 2 ^ Octaves + // = 2 ^ (Semitones / 12) + return powf(2.0f, Semitones / 12.0f); +} + +// Recover a pitch in semitones from a frequency ratio +__inline float XAudio2FrequencyRatioToSemitones(float FrequencyRatio) +{ + // Semitones = 12 * log2(FrequencyRatio) + // = 12 * log2(10) * log10(FrequencyRatio) + return 39.86313713864835f * log10f(FrequencyRatio); +} + +// Convert from filter cutoff frequencies expressed in Hertz to the radian +// frequency values used in XAUDIO2_FILTER_PARAMETERS.Frequency. Note that +// the highest CutoffFrequency supported is SampleRate/6. Higher values of +// CutoffFrequency will return XAUDIO2_MAX_FILTER_FREQUENCY. +__inline float XAudio2CutoffFrequencyToRadians(float CutoffFrequency, UINT32 SampleRate) +{ + if ((UINT32)(CutoffFrequency * 6.0f) >= SampleRate) + { + return XAUDIO2_MAX_FILTER_FREQUENCY; + } + return 2.0f * sinf((float)M_PI * CutoffFrequency / SampleRate); +} + +// Convert from radian frequencies back to absolute frequencies in Hertz +__inline float XAudio2RadiansToCutoffFrequency(float Radians, float SampleRate) +{ + return SampleRate * asinf(Radians / 2.0f) / (float)M_PI; +} +#endif // #ifdef XAUDIO2_HELPER_FUNCTIONS + + +/************************************************************************** + * + * XAudio2Create: Top-level function that creates an XAudio2 instance. + * + * On Windows this is just an inline function that calls CoCreateInstance + * and Initialize. The arguments are described above, under Initialize, + * except that the XAUDIO2_DEBUG_ENGINE flag can be used here to select + * the debug version of XAudio2. + * + * On Xbox, this function is implemented in the XAudio2 library, and the + * XAUDIO2_DEBUG_ENGINE flag has no effect; the client must explicitly + * link with the debug version of the library to obtain debug behavior. + * + **************************************************************************/ + +#ifdef _XBOX + +STDAPI XAudio2Create(__deref_out IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0), + XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)); + +#else // Windows + +__inline HRESULT XAudio2Create(__deref_out IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0), + XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)) +{ + // Instantiate the appropriate XAudio2 engine + IXAudio2* pXAudio2; + + #ifdef __cplusplus + + HRESULT hr = CoCreateInstance((Flags & XAUDIO2_DEBUG_ENGINE) ? __uuidof(XAudio2_Debug) : __uuidof(XAudio2), + NULL, CLSCTX_INPROC_SERVER, __uuidof(IXAudio2), (void**)&pXAudio2); + if (SUCCEEDED(hr)) + { + hr = pXAudio2->Initialize(Flags, XAudio2Processor); + + if (SUCCEEDED(hr)) + { + *ppXAudio2 = pXAudio2; + } + else + { + pXAudio2->Release(); + } + } + + #else + + HRESULT hr = CoCreateInstance((Flags & XAUDIO2_DEBUG_ENGINE) ? &CLSID_XAudio2_Debug : &CLSID_XAudio2, + NULL, CLSCTX_INPROC_SERVER, &IID_IXAudio2, (void**)&pXAudio2); + if (SUCCEEDED(hr)) + { + hr = pXAudio2->lpVtbl->Initialize(pXAudio2, Flags, XAudio2Processor); + + if (SUCCEEDED(hr)) + { + *ppXAudio2 = pXAudio2; + } + else + { + pXAudio2->lpVtbl->Release(pXAudio2); + } + } + + #endif // #ifdef __cplusplus + + return hr; +} + +#endif // #ifdef _XBOX + + +// Undo the #pragma pack(push, 1) directive at the top of this file +#pragma pack(pop) + +#endif // #ifndef GUID_DEFS_ONLY +#endif // #ifndef __XAUDIO2_INCLUDED__ diff --git a/Src/Decoder_H264_ALL/D3D/include/xaudio2fx.h b/Src/Decoder_H264_ALL/D3D/include/xaudio2fx.h new file mode 100644 index 0000000..ef18cb6 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/xaudio2fx.h @@ -0,0 +1,425 @@ +/************************************************************************** + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: xaudio2fx.h + * Content: Declarations for the audio effects included with XAudio2. + * + **************************************************************************/ + +#ifndef __XAUDIO2FX_INCLUDED__ +#define __XAUDIO2FX_INCLUDED__ + + +/************************************************************************** + * + * XAudio2 effect class IDs. + * + **************************************************************************/ + +#include "comdecl.h" // For DEFINE_CLSID and DEFINE_IID + +// XAudio 2.0 (March 2008 SDK) +//DEFINE_CLSID(AudioVolumeMeter, C0C56F46, 29B1, 44E9, 99, 39, A3, 2C, E8, 68, 67, E2); +//DEFINE_CLSID(AudioVolumeMeter_Debug, C0C56F46, 29B1, 44E9, 99, 39, A3, 2C, E8, 68, 67, DB); +//DEFINE_CLSID(AudioReverb, 6F6EA3A9, 2CF5, 41CF, 91, C1, 21, 70, B1, 54, 00, 63); +//DEFINE_CLSID(AudioReverb_Debug, 6F6EA3A9, 2CF5, 41CF, 91, C1, 21, 70, B1, 54, 00, DB); + +// XAudio 2.1 (June 2008 SDK) +//DEFINE_CLSID(AudioVolumeMeter, c1e3f122, a2ea, 442c, 85, 4f, 20, d9, 8f, 83, 57, a1); +//DEFINE_CLSID(AudioVolumeMeter_Debug, 6d97a461, b02d, 48ae, b5, 43, 82, bc, 35, fd, fa, e2); +//DEFINE_CLSID(AudioReverb, f4769300, b949, 4df9, b3, 33, 00, d3, 39, 32, e9, a6); +//DEFINE_CLSID(AudioReverb_Debug, aea2cabc, 8c7c, 46aa, ba, 44, 0e, 6d, 75, 88, a1, f2); + +// XAudio 2.2 (August 2008 SDK) +//DEFINE_CLSID(AudioVolumeMeter, f5ca7b34, 8055, 42c0, b8, 36, 21, 61, 29, eb, 7e, 30); +//DEFINE_CLSID(AudioVolumeMeter_Debug, f796f5f7, 6059, 4a9f, 98, 2d, 61, ee, c2, ed, 67, ca); +//DEFINE_CLSID(AudioReverb, 629cf0de, 3ecc, 41e7, 99, 26, f7, e4, 3e, eb, ec, 51); +//DEFINE_CLSID(AudioReverb_Debug, 4aae4299, 3260, 46d4, 97, cc, 6c, c7, 60, c8, 53, 29); + +// XAudio 2.3 (November 2008 SDK) +//DEFINE_CLSID(AudioVolumeMeter, e180344b, ac83, 4483, 95, 9e, 18, a5, c5, 6a, 5e, 19); +//DEFINE_CLSID(AudioVolumeMeter_Debug, 922a0a56, 7d13, 40ae, a4, 81, 3c, 6c, 60, f1, 14, 01); +//DEFINE_CLSID(AudioReverb, 9cab402c, 1d37, 44b4, 88, 6d, fa, 4f, 36, 17, 0a, 4c); +//DEFINE_CLSID(AudioReverb_Debug, eadda998, 3be6, 4505, 84, be, ea, 06, 36, 5d, b9, 6b); + +// XAudio 2.4 (March 2009 SDK) +//DEFINE_CLSID(AudioVolumeMeter, c7338b95, 52b8, 4542, aa, 79, 42, eb, 01, 6c, 8c, 1c); +//DEFINE_CLSID(AudioVolumeMeter_Debug, 524bd872, 5c0b, 4217, bd, b8, 0a, 86, 81, 83, 0b, a5); +//DEFINE_CLSID(AudioReverb, 8bb7778b, 645b, 4475, 9a, 73, 1d, e3, 17, 0b, d3, af); +//DEFINE_CLSID(AudioReverb_Debug, da7738a2, cd0c, 4367, 9a, ac, d7, ea, d7, c6, 4f, 98); + +// XAudio 2.5 (March 2009 SDK) +//DEFINE_CLSID(AudioVolumeMeter, 2139e6da, c341, 4774, 9a, c3, b4, e0, 26, 34, 7f, 64); +//DEFINE_CLSID(AudioVolumeMeter_Debug, a5cc4e13, ca00, 416b, a6, ee, 49, fe, e7, b5, 43, d0); +//DEFINE_CLSID(AudioReverb, d06df0d0, 8518, 441e, 82, 2f, 54, 51, d5, c5, 95, b8); +//DEFINE_CLSID(AudioReverb_Debug, 613604ec, 304c, 45ec, a4, ed, 7a, 1c, 61, 2e, 9e, 72); + +// XAudio 2.6 (February 2010 SDK) +DEFINE_CLSID(AudioVolumeMeter, e48c5a3f, 93ef, 43bb, a0, 92, 2c, 7c, eb, 94, 6f, 27); +DEFINE_CLSID(AudioVolumeMeter_Debug, 9a9eaef7, a9e0, 4088, 9b, 1b, 9c, a0, 3a, 1a, ec, d4); +DEFINE_CLSID(AudioReverb, cecec95a, d894, 491a, be, e3, 5e, 10, 6f, b5, 9f, 2d); +DEFINE_CLSID(AudioReverb_Debug, 99a1c72e, 364c, 4c1b, 96, 23, fd, 5c, 8a, bd, 90, c7); + +// Ignore the rest of this header if only the GUID definitions were requested +#ifndef GUID_DEFS_ONLY + +#ifdef _XBOX + #include // Xbox COM declarations (IUnknown, etc) +#else + #include // Windows COM declarations +#endif +#include // For log10() + + +// All structures defined in this file should use tight packing +#pragma pack(push, 1) + + +/************************************************************************** + * + * Effect creation functions. On Windows, these are just inline functions + * that call CoCreateInstance and Initialize; the XAUDIO2FX_DEBUG flag can + * be used to select the debug version of the effects. On Xbox, these map + * to real functions included in xaudio2.lib, and the XAUDIO2FX_DEBUG flag + * is ignored; the application must link with the debug library to use the + * debug functionality. + * + **************************************************************************/ + +// Use default values for some parameters if building C++ code +#ifdef __cplusplus + #define DEFAULT(x) =x +#else + #define DEFAULT(x) +#endif + +#define XAUDIO2FX_DEBUG 1 // To select the debug version of an effect + +#ifdef _XBOX + + STDAPI CreateAudioVolumeMeter(__deref_out IUnknown** ppApo); + STDAPI CreateAudioReverb(__deref_out IUnknown** ppApo); + + __inline HRESULT XAudio2CreateVolumeMeter(__deref_out IUnknown** ppApo, UINT32 /*Flags*/ DEFAULT(0)) + { + return CreateAudioVolumeMeter(ppApo); + } + + __inline HRESULT XAudio2CreateReverb(__deref_out IUnknown** ppApo, UINT32 /*Flags*/ DEFAULT(0)) + { + return CreateAudioReverb(ppApo); + } + +#else // Windows + + __inline HRESULT XAudio2CreateVolumeMeter(__deref_out IUnknown** ppApo, UINT32 Flags DEFAULT(0)) + { + #ifdef __cplusplus + return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? __uuidof(AudioVolumeMeter_Debug) + : __uuidof(AudioVolumeMeter), + NULL, CLSCTX_INPROC_SERVER, __uuidof(IUnknown), (void**)ppApo); + #else + return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? &CLSID_AudioVolumeMeter_Debug + : &CLSID_AudioVolumeMeter, + NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)ppApo); + #endif + } + + __inline HRESULT XAudio2CreateReverb(__deref_out IUnknown** ppApo, UINT32 Flags DEFAULT(0)) + { + #ifdef __cplusplus + return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? __uuidof(AudioReverb_Debug) + : __uuidof(AudioReverb), + NULL, CLSCTX_INPROC_SERVER, __uuidof(IUnknown), (void**)ppApo); + #else + return CoCreateInstance((Flags & XAUDIO2FX_DEBUG) ? &CLSID_AudioReverb_Debug + : &CLSID_AudioReverb, + NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)ppApo); + #endif + } + +#endif // #ifdef _XBOX + + + +/************************************************************************** + * + * Volume meter parameters. + * The volume meter supports FLOAT32 audio formats and must be used in-place. + * + **************************************************************************/ + +// XAUDIO2FX_VOLUMEMETER_LEVELS: Receives results from GetEffectParameters(). +// The user is responsible for allocating pPeakLevels, pRMSLevels, and +// initializing ChannelCount accordingly. +// The volume meter does not support SetEffectParameters(). +typedef struct XAUDIO2FX_VOLUMEMETER_LEVELS +{ + float* pPeakLevels; // Peak levels table: receives maximum absolute level for each channel + // over a processing pass; may be NULL if pRMSLevls != NULL, + // otherwise must have at least ChannelCount elements. + float* pRMSLevels; // Root mean square levels table: receives RMS level for each channel + // over a processing pass; may be NULL if pPeakLevels != NULL, + // otherwise must have at least ChannelCount elements. + UINT32 ChannelCount; // Number of channels being processed by the volume meter APO +} XAUDIO2FX_VOLUMEMETER_LEVELS; + + + +/************************************************************************** + * + * Reverb parameters. + * The reverb supports only FLOAT32 audio with the following channel + * configurations: + * Input: Mono Output: Mono + * Input: Mono Output: 5.1 + * Input: Stereo Output: Stereo + * Input: Stereo Output: 5.1 + * The framerate must be within [20000, 48000] Hz. + * + * When using mono input, delay filters associated with the right channel + * are not executed. In this case, parameters such as PositionRight and + * PositionMatrixRight have no effect. This also means the reverb uses + * less CPU when hosted in a mono submix. + * + **************************************************************************/ + +#define XAUDIO2FX_REVERB_MIN_FRAMERATE 20000 +#define XAUDIO2FX_REVERB_MAX_FRAMERATE 48000 + +// XAUDIO2FX_REVERB_PARAMETERS: Native parameter set for the reverb effect + +typedef struct XAUDIO2FX_REVERB_PARAMETERS +{ + // ratio of wet (processed) signal to dry (original) signal + float WetDryMix; // [0, 100] (percentage) + + // Delay times + UINT32 ReflectionsDelay; // [0, 300] in ms + BYTE ReverbDelay; // [0, 85] in ms + BYTE RearDelay; // [0, 5] in ms + + // Indexed parameters + BYTE PositionLeft; // [0, 30] no units + BYTE PositionRight; // [0, 30] no units, ignored when configured to mono + BYTE PositionMatrixLeft; // [0, 30] no units + BYTE PositionMatrixRight; // [0, 30] no units, ignored when configured to mono + BYTE EarlyDiffusion; // [0, 15] no units + BYTE LateDiffusion; // [0, 15] no units + BYTE LowEQGain; // [0, 12] no units + BYTE LowEQCutoff; // [0, 9] no units + BYTE HighEQGain; // [0, 8] no units + BYTE HighEQCutoff; // [0, 14] no units + + // Direct parameters + float RoomFilterFreq; // [20, 20000] in Hz + float RoomFilterMain; // [-100, 0] in dB + float RoomFilterHF; // [-100, 0] in dB + float ReflectionsGain; // [-100, 20] in dB + float ReverbGain; // [-100, 20] in dB + float DecayTime; // [0.1, inf] in seconds + float Density; // [0, 100] (percentage) + float RoomSize; // [1, 100] in feet +} XAUDIO2FX_REVERB_PARAMETERS; + + +// Maximum, minimum and default values for the parameters above +#define XAUDIO2FX_REVERB_MIN_WET_DRY_MIX 0.0f +#define XAUDIO2FX_REVERB_MIN_REFLECTIONS_DELAY 0 +#define XAUDIO2FX_REVERB_MIN_REVERB_DELAY 0 +#define XAUDIO2FX_REVERB_MIN_REAR_DELAY 0 +#define XAUDIO2FX_REVERB_MIN_POSITION 0 +#define XAUDIO2FX_REVERB_MIN_DIFFUSION 0 +#define XAUDIO2FX_REVERB_MIN_LOW_EQ_GAIN 0 +#define XAUDIO2FX_REVERB_MIN_LOW_EQ_CUTOFF 0 +#define XAUDIO2FX_REVERB_MIN_HIGH_EQ_GAIN 0 +#define XAUDIO2FX_REVERB_MIN_HIGH_EQ_CUTOFF 0 +#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_FREQ 20.0f +#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_MAIN -100.0f +#define XAUDIO2FX_REVERB_MIN_ROOM_FILTER_HF -100.0f +#define XAUDIO2FX_REVERB_MIN_REFLECTIONS_GAIN -100.0f +#define XAUDIO2FX_REVERB_MIN_REVERB_GAIN -100.0f +#define XAUDIO2FX_REVERB_MIN_DECAY_TIME 0.1f +#define XAUDIO2FX_REVERB_MIN_DENSITY 0.0f +#define XAUDIO2FX_REVERB_MIN_ROOM_SIZE 0.0f + +#define XAUDIO2FX_REVERB_MAX_WET_DRY_MIX 100.0f +#define XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY 300 +#define XAUDIO2FX_REVERB_MAX_REVERB_DELAY 85 +#define XAUDIO2FX_REVERB_MAX_REAR_DELAY 5 +#define XAUDIO2FX_REVERB_MAX_POSITION 30 +#define XAUDIO2FX_REVERB_MAX_DIFFUSION 15 +#define XAUDIO2FX_REVERB_MAX_LOW_EQ_GAIN 12 +#define XAUDIO2FX_REVERB_MAX_LOW_EQ_CUTOFF 9 +#define XAUDIO2FX_REVERB_MAX_HIGH_EQ_GAIN 8 +#define XAUDIO2FX_REVERB_MAX_HIGH_EQ_CUTOFF 14 +#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_FREQ 20000.0f +#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_MAIN 0.0f +#define XAUDIO2FX_REVERB_MAX_ROOM_FILTER_HF 0.0f +#define XAUDIO2FX_REVERB_MAX_REFLECTIONS_GAIN 20.0f +#define XAUDIO2FX_REVERB_MAX_REVERB_GAIN 20.0f +#define XAUDIO2FX_REVERB_MAX_DENSITY 100.0f +#define XAUDIO2FX_REVERB_MAX_ROOM_SIZE 100.0f + +#define XAUDIO2FX_REVERB_DEFAULT_WET_DRY_MIX 100.0f +#define XAUDIO2FX_REVERB_DEFAULT_REFLECTIONS_DELAY 5 +#define XAUDIO2FX_REVERB_DEFAULT_REVERB_DELAY 5 +#define XAUDIO2FX_REVERB_DEFAULT_REAR_DELAY 5 +#define XAUDIO2FX_REVERB_DEFAULT_POSITION 6 +#define XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX 27 +#define XAUDIO2FX_REVERB_DEFAULT_EARLY_DIFFUSION 8 +#define XAUDIO2FX_REVERB_DEFAULT_LATE_DIFFUSION 8 +#define XAUDIO2FX_REVERB_DEFAULT_LOW_EQ_GAIN 8 +#define XAUDIO2FX_REVERB_DEFAULT_LOW_EQ_CUTOFF 4 +#define XAUDIO2FX_REVERB_DEFAULT_HIGH_EQ_GAIN 8 +#define XAUDIO2FX_REVERB_DEFAULT_HIGH_EQ_CUTOFF 4 +#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_FREQ 5000.0f +#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_MAIN 0.0f +#define XAUDIO2FX_REVERB_DEFAULT_ROOM_FILTER_HF 0.0f +#define XAUDIO2FX_REVERB_DEFAULT_REFLECTIONS_GAIN 0.0f +#define XAUDIO2FX_REVERB_DEFAULT_REVERB_GAIN 0.0f +#define XAUDIO2FX_REVERB_DEFAULT_DECAY_TIME 1.0f +#define XAUDIO2FX_REVERB_DEFAULT_DENSITY 100.0f +#define XAUDIO2FX_REVERB_DEFAULT_ROOM_SIZE 100.0f + + +// XAUDIO2FX_REVERB_I3DL2_PARAMETERS: Parameter set compliant with the I3DL2 standard + +typedef struct XAUDIO2FX_REVERB_I3DL2_PARAMETERS +{ + // ratio of wet (processed) signal to dry (original) signal + float WetDryMix; // [0, 100] (percentage) + + // Standard I3DL2 parameters + INT32 Room; // [-10000, 0] in mB (hundredths of decibels) + INT32 RoomHF; // [-10000, 0] in mB (hundredths of decibels) + float RoomRolloffFactor; // [0.0, 10.0] + float DecayTime; // [0.1, 20.0] in seconds + float DecayHFRatio; // [0.1, 2.0] + INT32 Reflections; // [-10000, 1000] in mB (hundredths of decibels) + float ReflectionsDelay; // [0.0, 0.3] in seconds + INT32 Reverb; // [-10000, 2000] in mB (hundredths of decibels) + float ReverbDelay; // [0.0, 0.1] in seconds + float Diffusion; // [0.0, 100.0] (percentage) + float Density; // [0.0, 100.0] (percentage) + float HFReference; // [20.0, 20000.0] in Hz +} XAUDIO2FX_REVERB_I3DL2_PARAMETERS; + + +// ReverbConvertI3DL2ToNative: Utility function to map from I3DL2 to native parameters + +__inline void ReverbConvertI3DL2ToNative +( + __in const XAUDIO2FX_REVERB_I3DL2_PARAMETERS* pI3DL2, + __out XAUDIO2FX_REVERB_PARAMETERS* pNative +) +{ + float reflectionsDelay; + float reverbDelay; + + // RoomRolloffFactor is ignored + + // These parameters have no equivalent in I3DL2 + pNative->RearDelay = XAUDIO2FX_REVERB_DEFAULT_REAR_DELAY; // 5 + pNative->PositionLeft = XAUDIO2FX_REVERB_DEFAULT_POSITION; // 6 + pNative->PositionRight = XAUDIO2FX_REVERB_DEFAULT_POSITION; // 6 + pNative->PositionMatrixLeft = XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX; // 27 + pNative->PositionMatrixRight = XAUDIO2FX_REVERB_DEFAULT_POSITION_MATRIX; // 27 + pNative->RoomSize = XAUDIO2FX_REVERB_DEFAULT_ROOM_SIZE; // 100 + pNative->LowEQCutoff = 4; + pNative->HighEQCutoff = 6; + + // The rest of the I3DL2 parameters map to the native property set + pNative->RoomFilterMain = (float)pI3DL2->Room / 100.0f; + pNative->RoomFilterHF = (float)pI3DL2->RoomHF / 100.0f; + + if (pI3DL2->DecayHFRatio >= 1.0f) + { + INT32 index = (INT32)(-4.0 * log10(pI3DL2->DecayHFRatio)); + if (index < -8) index = -8; + pNative->LowEQGain = (BYTE)((index < 0) ? index + 8 : 8); + pNative->HighEQGain = 8; + pNative->DecayTime = pI3DL2->DecayTime * pI3DL2->DecayHFRatio; + } + else + { + INT32 index = (INT32)(4.0 * log10(pI3DL2->DecayHFRatio)); + if (index < -8) index = -8; + pNative->LowEQGain = 8; + pNative->HighEQGain = (BYTE)((index < 0) ? index + 8 : 8); + pNative->DecayTime = pI3DL2->DecayTime; + } + + reflectionsDelay = pI3DL2->ReflectionsDelay * 1000.0f; + if (reflectionsDelay >= XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY) // 300 + { + reflectionsDelay = (float)(XAUDIO2FX_REVERB_MAX_REFLECTIONS_DELAY - 1); + } + else if (reflectionsDelay <= 1) + { + reflectionsDelay = 1; + } + pNative->ReflectionsDelay = (UINT32)reflectionsDelay; + + reverbDelay = pI3DL2->ReverbDelay * 1000.0f; + if (reverbDelay >= XAUDIO2FX_REVERB_MAX_REVERB_DELAY) // 85 + { + reverbDelay = (float)(XAUDIO2FX_REVERB_MAX_REVERB_DELAY - 1); + } + pNative->ReverbDelay = (BYTE)reverbDelay; + + pNative->ReflectionsGain = pI3DL2->Reflections / 100.0f; + pNative->ReverbGain = pI3DL2->Reverb / 100.0f; + pNative->EarlyDiffusion = (BYTE)(15.0f * pI3DL2->Diffusion / 100.0f); + pNative->LateDiffusion = pNative->EarlyDiffusion; + pNative->Density = pI3DL2->Density; + pNative->RoomFilterFreq = pI3DL2->HFReference; + + pNative->WetDryMix = pI3DL2->WetDryMix; +} + + +/************************************************************************** + * + * Standard I3DL2 reverb presets (100% wet). + * + **************************************************************************/ + +#define XAUDIO2FX_I3DL2_PRESET_DEFAULT {100,-10000, 0,0.0f, 1.00f,0.50f,-10000,0.020f,-10000,0.040f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_GENERIC {100, -1000, -100,0.0f, 1.49f,0.83f, -2602,0.007f, 200,0.011f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_PADDEDCELL {100, -1000,-6000,0.0f, 0.17f,0.10f, -1204,0.001f, 207,0.002f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_ROOM {100, -1000, -454,0.0f, 0.40f,0.83f, -1646,0.002f, 53,0.003f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_BATHROOM {100, -1000,-1200,0.0f, 1.49f,0.54f, -370,0.007f, 1030,0.011f,100.0f, 60.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_LIVINGROOM {100, -1000,-6000,0.0f, 0.50f,0.10f, -1376,0.003f, -1104,0.004f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_STONEROOM {100, -1000, -300,0.0f, 2.31f,0.64f, -711,0.012f, 83,0.017f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_AUDITORIUM {100, -1000, -476,0.0f, 4.32f,0.59f, -789,0.020f, -289,0.030f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_CONCERTHALL {100, -1000, -500,0.0f, 3.92f,0.70f, -1230,0.020f, -2,0.029f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_CAVE {100, -1000, 0,0.0f, 2.91f,1.30f, -602,0.015f, -302,0.022f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_ARENA {100, -1000, -698,0.0f, 7.24f,0.33f, -1166,0.020f, 16,0.030f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_HANGAR {100, -1000,-1000,0.0f,10.05f,0.23f, -602,0.020f, 198,0.030f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_CARPETEDHALLWAY {100, -1000,-4000,0.0f, 0.30f,0.10f, -1831,0.002f, -1630,0.030f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_HALLWAY {100, -1000, -300,0.0f, 1.49f,0.59f, -1219,0.007f, 441,0.011f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_STONECORRIDOR {100, -1000, -237,0.0f, 2.70f,0.79f, -1214,0.013f, 395,0.020f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_ALLEY {100, -1000, -270,0.0f, 1.49f,0.86f, -1204,0.007f, -4,0.011f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_FOREST {100, -1000,-3300,0.0f, 1.49f,0.54f, -2560,0.162f, -613,0.088f, 79.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_CITY {100, -1000, -800,0.0f, 1.49f,0.67f, -2273,0.007f, -2217,0.011f, 50.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_MOUNTAINS {100, -1000,-2500,0.0f, 1.49f,0.21f, -2780,0.300f, -2014,0.100f, 27.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_QUARRY {100, -1000,-1000,0.0f, 1.49f,0.83f,-10000,0.061f, 500,0.025f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_PLAIN {100, -1000,-2000,0.0f, 1.49f,0.50f, -2466,0.179f, -2514,0.100f, 21.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_PARKINGLOT {100, -1000, 0,0.0f, 1.65f,1.50f, -1363,0.008f, -1153,0.012f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_SEWERPIPE {100, -1000,-1000,0.0f, 2.81f,0.14f, 429,0.014f, 648,0.021f, 80.0f, 60.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_UNDERWATER {100, -1000,-4000,0.0f, 1.49f,0.10f, -449,0.007f, 1700,0.011f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_SMALLROOM {100, -1000, -600,0.0f, 1.10f,0.83f, -400,0.005f, 500,0.010f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_MEDIUMROOM {100, -1000, -600,0.0f, 1.30f,0.83f, -1000,0.010f, -200,0.020f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_LARGEROOM {100, -1000, -600,0.0f, 1.50f,0.83f, -1600,0.020f, -1000,0.040f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_MEDIUMHALL {100, -1000, -600,0.0f, 1.80f,0.70f, -1300,0.015f, -800,0.030f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_LARGEHALL {100, -1000, -600,0.0f, 1.80f,0.70f, -2000,0.030f, -1400,0.060f,100.0f,100.0f,5000.0f} +#define XAUDIO2FX_I3DL2_PRESET_PLATE {100, -1000, -200,0.0f, 1.30f,0.90f, 0,0.002f, 0,0.010f,100.0f, 75.0f,5000.0f} + + +// Undo the #pragma pack(push, 1) at the top of this file +#pragma pack(pop) + +#endif // #ifndef GUID_DEFS_ONLY +#endif // #ifndef __XAUDIO2FX_INCLUDED__ diff --git a/Src/Decoder_H264_ALL/D3D/include/xma2defs.h b/Src/Decoder_H264_ALL/D3D/include/xma2defs.h new file mode 100644 index 0000000..13a4306 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/xma2defs.h @@ -0,0 +1,718 @@ +/*************************************************************************** + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: xma2defs.h + * Content: Constants, data types and functions for XMA2 compressed audio. + * + ***************************************************************************/ + +#ifndef __XMA2DEFS_INCLUDED__ +#define __XMA2DEFS_INCLUDED__ + +#include // Markers for documenting API semantics +#include // For S_OK, E_FAIL +#include // Basic data types and constants for audio work + + +/*************************************************************************** + * Overview + ***************************************************************************/ + +// A typical XMA2 file contains these RIFF chunks: +// +// 'fmt' or 'XMA2' chunk (or both): A description of the XMA data's structure +// and characteristics (length, channels, sample rate, loops, block size, etc). +// +// 'seek' chunk: A seek table to help navigate the XMA data. +// +// 'data' chunk: The encoded XMA2 data. +// +// The encoded XMA2 data is structured as a set of BLOCKS, which contain PACKETS, +// which contain FRAMES, which contain SUBFRAMES (roughly speaking). The frames +// in a file may also be divided into several subsets, called STREAMS. +// +// FRAME: A variable-sized segment of XMA data that decodes to exactly 512 mono +// or stereo PCM samples. This is the smallest unit of XMA data that can +// be decoded in isolation. Frames are an arbitrary number of bits in +// length, and need not be byte-aligned. See "XMA frame structure" below. +// +// SUBFRAME: A region of bits in an XMA frame that decodes to 128 mono or stereo +// samples. The XMA decoder cannot decode a subframe in isolation; it needs +// a whole frame to work with. However, it can begin emitting the frame's +// decoded samples at any one of the four subframe boundaries. Subframes +// can be addressed for seeking and looping purposes. +// +// PACKET: A 2Kb region containing a 32-bit header and some XMA frames. Frames +// can (and usually do) span packets. A packet's header includes the offset +// in bits of the first frame that begins within that packet. All of the +// frames that begin in a given packet belong to the same "stream" (see the +// Multichannel Audio section below). +// +// STREAM: A set of packets within an XMA file that all contain data for the +// same mono or stereo component of a PCM file with more than two channels. +// The packets comprising a given stream may be interleaved with each other +// more or less arbitrarily; see Multichannel Audio. +// +// BLOCK: An array of XMA packets; or, to break it down differently, a series of +// consecutive XMA frames, padded at the end with reserved data. A block +// must contain at least one 2Kb packet per stream, and it can hold up to +// 4095 packets (8190Kb), but its size is typically in the 32Kb-128Kb range. +// (The size chosen involves a trade-off between memory use and efficiency +// of reading from permanent storage.) +// +// XMA frames do not span blocks, so a block is guaranteed to begin with a +// set of complete frames, one per stream. Also, a block in a multi-stream +// XMA2 file always contains the same number of samples for each stream; +// see Multichannel Audio. +// +// The 'data' chunk in an XMA2 file is an array of XMA2WAVEFORMAT.BlockCount XMA +// blocks, all the same size (as specified in XMA2WAVEFORMAT.BlockSizeInBytes) +// except for the last one, which may be shorter. + + +// MULTICHANNEL AUDIO: the XMA decoder can only decode raw XMA data into either +// mono or stereo PCM data. In order to encode a 6-channel file (say), the file +// must be deinterleaved into 3 stereo streams that are encoded independently, +// producing 3 encoded XMA data streams. Then the packets in these 3 streams +// are interleaved to produce a single XMA2 file, and some information is added +// to the file so that the original 6-channel audio can be reconstructed at +// decode time. This works using the concept of an XMA stream (see above). +// +// The frames for all the streams in an XMA file are interleaved in an arbitrary +// order. To locate a frame that belongs to a given stream in a given XMA block, +// you must examine the first few packets in the block. Here (and only here) the +// packets are guaranteed to be presented in stream order, so that all frames +// beginning in packet 0 belong to stream 0 (the first stereo pair), etc. +// +// (This means that when decoding multi-stream XMA files, only entire XMA blocks +// should be submitted to the decoder; otherwise it cannot know which frames +// belong to which stream.) +// +// Once you have one frame that belongs to a given stream, you can find the next +// one by looking at the frame's 'NextFrameOffsetBits' value (which is stored in +// its first 15 bits; see XMAFRAME below). The GetXmaFrameBitPosition function +// uses this technique. + + +// SEEKING IN XMA2 FILES: Here is some pseudocode to find the byte position and +// subframe in an XMA2 file which will contain sample S when decoded. +// +// 1. Traverse the seek table to find the XMA2 block containing sample S. The +// seek table is an array of big-endian DWORDs, one per block in the file. +// The Nth DWORD is the total number of PCM samples that would be obtained +// by decoding the entire XMA file up to the end of block N. Hence, the +// block we want is the first one whose seek table entry is greater than S. +// (See the GetXmaBlockContainingSample helper function.) +// +// 2. Calculate which frame F within the block found above contains sample S. +// Since each frame decodes to 512 samples, this is straightforward. The +// first frame in the block produces samples X to X + 512, where X is the +// seek table entry for the prior block. So F is (S - X) / 512. +// +// 3. Find the bit offset within the block where frame F starts. Since frames +// are variable-sized, this can only be done by traversing all the frames in +// the block until we reach frame F. (See GetXmaFrameBitPosition.) +// +// 4. Frame F has four 128-sample subframes. To find the subframe containing S, +// we can use the formula (S % 512) / 128. +// +// In the case of multi-stream XMA files, sample S is a multichannel sample with +// parts coming from several frames, one per stream. To find all these frames, +// steps 2-4 need to be repeated for each stream N, using the knowledge that the +// first packets in a block are presented in stream order. The frame traversal +// in step 3 must be started at the first frame in the Nth packet of the block, +// which will be the first frame for stream N. (And the packet header will tell +// you the first frame's start position within the packet.) +// +// Step 1 can be performed using the GetXmaBlockContainingSample function below, +// and steps 2-4 by calling GetXmaDecodePositionForSample once for each stream. + + + +/*************************************************************************** + * XMA constants + ***************************************************************************/ + +// Size of the PCM samples produced by the XMA decoder +#define XMA_OUTPUT_SAMPLE_BYTES 2u +#define XMA_OUTPUT_SAMPLE_BITS (XMA_OUTPUT_SAMPLE_BYTES * 8u) + +// Size of an XMA packet +#define XMA_BYTES_PER_PACKET 2048u +#define XMA_BITS_PER_PACKET (XMA_BYTES_PER_PACKET * 8u) + +// Size of an XMA packet header +#define XMA_PACKET_HEADER_BYTES 4u +#define XMA_PACKET_HEADER_BITS (XMA_PACKET_HEADER_BYTES * 8u) + +// Sample blocks in a decoded XMA frame +#define XMA_SAMPLES_PER_FRAME 512u + +// Sample blocks in a decoded XMA subframe +#define XMA_SAMPLES_PER_SUBFRAME 128u + +// Maximum encoded data that can be submitted to the XMA decoder at a time +#define XMA_READBUFFER_MAX_PACKETS 4095u +#define XMA_READBUFFER_MAX_BYTES (XMA_READBUFFER_MAX_PACKETS * XMA_BYTES_PER_PACKET) + +// Maximum size allowed for the XMA decoder's output buffers +#define XMA_WRITEBUFFER_MAX_BYTES (31u * 256u) + +// Required byte alignment of the XMA decoder's output buffers +#define XMA_WRITEBUFFER_BYTE_ALIGNMENT 256u + +// Decode chunk sizes for the XMA_PLAYBACK_INIT.subframesToDecode field +#define XMA_MIN_SUBFRAMES_TO_DECODE 1u +#define XMA_MAX_SUBFRAMES_TO_DECODE 8u +#define XMA_OPTIMAL_SUBFRAMES_TO_DECODE 4u + +// LoopCount<255 means finite repetitions; LoopCount=255 means infinite looping +#define XMA_MAX_LOOPCOUNT 254u +#define XMA_INFINITE_LOOP 255u + + + +/*************************************************************************** + * XMA format structures + ***************************************************************************/ + +// The currently recommended way to express format information for XMA2 files +// is the XMA2WAVEFORMATEX structure. This structure is fully compliant with +// the WAVEFORMATEX standard and contains all the information needed to parse +// and manage XMA2 files in a compact way. + +#define WAVE_FORMAT_XMA2 0x166 + +typedef struct XMA2WAVEFORMATEX +{ + WAVEFORMATEX wfx; + // Meaning of the WAVEFORMATEX fields here: + // wFormatTag; // Audio format type; always WAVE_FORMAT_XMA2 + // nChannels; // Channel count of the decoded audio + // nSamplesPerSec; // Sample rate of the decoded audio + // nAvgBytesPerSec; // Used internally by the XMA encoder + // nBlockAlign; // Decoded sample size; channels * wBitsPerSample / 8 + // wBitsPerSample; // Bits per decoded mono sample; always 16 for XMA + // cbSize; // Size in bytes of the rest of this structure (34) + + WORD NumStreams; // Number of audio streams (1 or 2 channels each) + DWORD ChannelMask; // Spatial positions of the channels in this file, + // stored as SPEAKER_xxx values (see audiodefs.h) + DWORD SamplesEncoded; // Total number of PCM samples the file decodes to + DWORD BytesPerBlock; // XMA block size (but the last one may be shorter) + DWORD PlayBegin; // First valid sample in the decoded audio + DWORD PlayLength; // Length of the valid part of the decoded audio + DWORD LoopBegin; // Beginning of the loop region in decoded sample terms + DWORD LoopLength; // Length of the loop region in decoded sample terms + BYTE LoopCount; // Number of loop repetitions; 255 = infinite + BYTE EncoderVersion; // Version of XMA encoder that generated the file + WORD BlockCount; // XMA blocks in file (and entries in its seek table) +} XMA2WAVEFORMATEX, *PXMA2WAVEFORMATEX; + + +// The legacy XMA format structures are described here for reference, but they +// should not be used in new content. XMAWAVEFORMAT was the structure used in +// XMA version 1 files. XMA2WAVEFORMAT was used in early XMA2 files; it is not +// placed in the usual 'fmt' RIFF chunk but in its own 'XMA2' chunk. + +#ifndef WAVE_FORMAT_XMA +#define WAVE_FORMAT_XMA 0x0165 + +// Values used in the ChannelMask fields below. Similar to the SPEAKER_xxx +// values defined in audiodefs.h, but modified to fit in a single byte. +#ifndef XMA_SPEAKER_LEFT + #define XMA_SPEAKER_LEFT 0x01 + #define XMA_SPEAKER_RIGHT 0x02 + #define XMA_SPEAKER_CENTER 0x04 + #define XMA_SPEAKER_LFE 0x08 + #define XMA_SPEAKER_LEFT_SURROUND 0x10 + #define XMA_SPEAKER_RIGHT_SURROUND 0x20 + #define XMA_SPEAKER_LEFT_BACK 0x40 + #define XMA_SPEAKER_RIGHT_BACK 0x80 +#endif + + +// Used in XMAWAVEFORMAT for per-stream data +typedef struct XMASTREAMFORMAT +{ + DWORD PsuedoBytesPerSec; // Used by the XMA encoder (typo preserved for legacy reasons) + DWORD SampleRate; // The stream's decoded sample rate (in XMA2 files, + // this is the same for all streams in the file). + DWORD LoopStart; // Bit offset of the frame containing the loop start + // point, relative to the beginning of the stream. + DWORD LoopEnd; // Bit offset of the frame containing the loop end. + BYTE SubframeData; // Two 4-bit numbers specifying the exact location of + // the loop points within the frames that contain them. + // SubframeEnd: Subframe of the loop end frame where + // the loop ends. Ranges from 0 to 3. + // SubframeSkip: Subframes to skip in the start frame to + // reach the loop. Ranges from 0 to 4. + BYTE Channels; // Number of channels in the stream (1 or 2) + WORD ChannelMask; // Spatial positions of the channels in the stream +} XMASTREAMFORMAT; + +// Legacy XMA1 format structure +typedef struct XMAWAVEFORMAT +{ + WORD FormatTag; // Audio format type (always WAVE_FORMAT_XMA) + WORD BitsPerSample; // Bit depth (currently required to be 16) + WORD EncodeOptions; // Options for XMA encoder/decoder + WORD LargestSkip; // Largest skip used in interleaving streams + WORD NumStreams; // Number of interleaved audio streams + BYTE LoopCount; // Number of loop repetitions; 255 = infinite + BYTE Version; // XMA encoder version that generated the file. + // Always 3 or higher for XMA2 files. + XMASTREAMFORMAT XmaStreams[1]; // Per-stream format information; the actual + // array length is in the NumStreams field. +} XMAWAVEFORMAT; + + +// Used in XMA2WAVEFORMAT for per-stream data +typedef struct XMA2STREAMFORMAT +{ + BYTE Channels; // Number of channels in the stream (1 or 2) + BYTE RESERVED; // Reserved for future use + WORD ChannelMask; // Spatial positions of the channels in the stream +} XMA2STREAMFORMAT; + +// Legacy XMA2 format structure (big-endian byte ordering) +typedef struct XMA2WAVEFORMAT +{ + BYTE Version; // XMA encoder version that generated the file. + // Always 3 or higher for XMA2 files. + BYTE NumStreams; // Number of interleaved audio streams + BYTE RESERVED; // Reserved for future use + BYTE LoopCount; // Number of loop repetitions; 255 = infinite + DWORD LoopBegin; // Loop begin point, in samples + DWORD LoopEnd; // Loop end point, in samples + DWORD SampleRate; // The file's decoded sample rate + DWORD EncodeOptions; // Options for the XMA encoder/decoder + DWORD PsuedoBytesPerSec; // Used internally by the XMA encoder + DWORD BlockSizeInBytes; // Size in bytes of this file's XMA blocks (except + // possibly the last one). Always a multiple of + // 2Kb, since XMA blocks are arrays of 2Kb packets. + DWORD SamplesEncoded; // Total number of PCM samples encoded in this file + DWORD SamplesInSource; // Actual number of PCM samples in the source + // material used to generate this file + DWORD BlockCount; // Number of XMA blocks in this file (and hence + // also the number of entries in its seek table) + XMA2STREAMFORMAT Streams[1]; // Per-stream format information; the actual + // array length is in the NumStreams field. +} XMA2WAVEFORMAT; + +#endif // #ifndef WAVE_FORMAT_XMA + + + +/*************************************************************************** + * XMA packet structure (in big-endian form) + ***************************************************************************/ + +typedef struct XMA2PACKET +{ + int FrameCount : 6; // Number of XMA frames that begin in this packet + int FrameOffsetInBits : 15; // Bit of XmaData where the first complete frame begins + int PacketMetaData : 3; // Metadata stored in the packet (always 1 for XMA2) + int PacketSkipCount : 8; // How many packets belonging to other streams must be + // skipped to find the next packet belonging to this one + BYTE XmaData[XMA_BYTES_PER_PACKET - sizeof(DWORD)]; // XMA encoded data +} XMA2PACKET; + +// E.g. if the first DWORD of a packet is 0x30107902: +// +// 001100 000001000001111 001 00000010 +// | | | |____ Skip 2 packets to find the next one for this stream +// | | |___________ XMA2 signature (always 001) +// | |_____________________ First frame starts 527 bits into packet +// |________________________________ Packet contains 12 frames + + +// Helper functions to extract the fields above from an XMA packet. (Note that +// the bitfields cannot be read directly on little-endian architectures such as +// the Intel x86, as they are laid out in big-endian form.) + +__inline DWORD GetXmaPacketFrameCount(__in_bcount(1) const BYTE* pPacket) +{ + return (DWORD)(pPacket[0] >> 2); +} + +__inline DWORD GetXmaPacketFirstFrameOffsetInBits(__in_bcount(3) const BYTE* pPacket) +{ + return ((DWORD)(pPacket[0] & 0x3) << 13) | + ((DWORD)(pPacket[1]) << 5) | + ((DWORD)(pPacket[2]) >> 3); +} + +__inline DWORD GetXmaPacketMetadata(__in_bcount(3) const BYTE* pPacket) +{ + return (DWORD)(pPacket[2] & 0x7); +} + +__inline DWORD GetXmaPacketSkipCount(__in_bcount(4) const BYTE* pPacket) +{ + return (DWORD)(pPacket[3]); +} + + + +/*************************************************************************** + * XMA frame structure + ***************************************************************************/ + +// There is no way to represent the XMA frame as a C struct, since it is a +// variable-sized string of bits that need not be stored at a byte-aligned +// position in memory. This is the layout: +// +// XMAFRAME +// { +// LengthInBits: A 15-bit number representing the length of this frame. +// XmaData: Encoded XMA data; its size in bits is (LengthInBits - 15). +// } + +// Size in bits of the frame's initial LengthInBits field +#define XMA_BITS_IN_FRAME_LENGTH_FIELD 15 + +// Special LengthInBits value that marks an invalid final frame +#define XMA_FINAL_FRAME_MARKER 0x7FFF + + + +/*************************************************************************** + * XMA helper functions + ***************************************************************************/ + +// We define a local ASSERT macro to equal the global one if it exists. +// You can define XMA2DEFS_ASSERT in advance to override this default. +#ifndef XMA2DEFS_ASSERT + #ifdef ASSERT + #define XMA2DEFS_ASSERT ASSERT + #else + #define XMA2DEFS_ASSERT(a) /* No-op by default */ + #endif +#endif + + +// GetXmaBlockContainingSample: Use a given seek table to find the XMA block +// containing a given decoded sample. Note that the seek table entries in an +// XMA file are stored in big-endian form and may need to be converted prior +// to calling this function. + +__inline HRESULT GetXmaBlockContainingSample +( + DWORD nBlockCount, // Blocks in the file (= seek table entries) + __in_ecount(nBlockCount) const DWORD* pSeekTable, // Pointer to the seek table data + DWORD nDesiredSample, // Decoded sample to locate + __out DWORD* pnBlockContainingSample, // Index of the block containing the sample + __out DWORD* pnSampleOffsetWithinBlock // Position of the sample in this block +) +{ + DWORD nPreviousTotalSamples = 0; + DWORD nBlock; + DWORD nTotalSamplesSoFar; + + XMA2DEFS_ASSERT(pSeekTable); + XMA2DEFS_ASSERT(pnBlockContainingSample); + XMA2DEFS_ASSERT(pnSampleOffsetWithinBlock); + + for (nBlock = 0; nBlock < nBlockCount; ++nBlock) + { + nTotalSamplesSoFar = pSeekTable[nBlock]; + if (nTotalSamplesSoFar > nDesiredSample) + { + *pnBlockContainingSample = nBlock; + *pnSampleOffsetWithinBlock = nDesiredSample - nPreviousTotalSamples; + return S_OK; + } + nPreviousTotalSamples = nTotalSamplesSoFar; + } + + return E_FAIL; +} + + +// GetXmaFrameLengthInBits: Reads a given frame's LengthInBits field. + +__inline DWORD GetXmaFrameLengthInBits +( + __in_bcount(nBitPosition / 8 + 3) + __in const BYTE* pPacket, // Pointer to XMA packet[s] containing the frame + DWORD nBitPosition // Bit offset of the frame within this packet +) +{ + DWORD nRegion; + DWORD nBytePosition = nBitPosition / 8; + DWORD nBitOffset = nBitPosition % 8; + + if (nBitOffset < 2) // Only need to read 2 bytes (and might not be safe to read more) + { + nRegion = (DWORD)(pPacket[nBytePosition+0]) << 8 | + (DWORD)(pPacket[nBytePosition+1]); + return (nRegion >> (1 - nBitOffset)) & 0x7FFF; // Last 15 bits + } + else // Need to read 3 bytes + { + nRegion = (DWORD)(pPacket[nBytePosition+0]) << 16 | + (DWORD)(pPacket[nBytePosition+1]) << 8 | + (DWORD)(pPacket[nBytePosition+2]); + return (nRegion >> (9 - nBitOffset)) & 0x7FFF; // Last 15 bits + } +} + + +// GetXmaFrameBitPosition: Calculates the bit offset of a given frame within +// an XMA block or set of blocks. Returns 0 on failure. + +__inline DWORD GetXmaFrameBitPosition +( + __in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s] + DWORD nXmaDataBytes, // Size of pXmaData in bytes + DWORD nStreamIndex, // Stream within which to seek + DWORD nDesiredFrame // Frame sought +) +{ + const BYTE* pCurrentPacket; + DWORD nPacketsExamined = 0; + DWORD nFrameCountSoFar = 0; + DWORD nFramesToSkip; + DWORD nFrameBitOffset; + + XMA2DEFS_ASSERT(pXmaData); + XMA2DEFS_ASSERT(nXmaDataBytes % XMA_BYTES_PER_PACKET == 0); + + // Get the first XMA packet belonging to the desired stream, relying on the + // fact that the first packets for each stream are in consecutive order at + // the beginning of an XMA block. + + pCurrentPacket = pXmaData + nStreamIndex * XMA_BYTES_PER_PACKET; + for (;;) + { + // If we have exceeded the size of the XMA data, return failure + if (pCurrentPacket + XMA_BYTES_PER_PACKET > pXmaData + nXmaDataBytes) + { + return 0; + } + + // If the current packet contains the frame we are looking for... + if (nFrameCountSoFar + GetXmaPacketFrameCount(pCurrentPacket) > nDesiredFrame) + { + // See how many frames in this packet we need to skip to get to it + XMA2DEFS_ASSERT(nDesiredFrame >= nFrameCountSoFar); + nFramesToSkip = nDesiredFrame - nFrameCountSoFar; + + // Get the bit offset of the first frame in this packet + nFrameBitOffset = XMA_PACKET_HEADER_BITS + GetXmaPacketFirstFrameOffsetInBits(pCurrentPacket); + + // Advance nFrameBitOffset to the frame of interest + while (nFramesToSkip--) + { + nFrameBitOffset += GetXmaFrameLengthInBits(pCurrentPacket, nFrameBitOffset); + } + + // The bit offset to return is the number of bits from pXmaData to + // pCurrentPacket plus the bit offset of the frame of interest + return (DWORD)(pCurrentPacket - pXmaData) * 8 + nFrameBitOffset; + } + + // If we haven't found the right packet yet, advance our counters + ++nPacketsExamined; + nFrameCountSoFar += GetXmaPacketFrameCount(pCurrentPacket); + + // And skip to the next packet belonging to the same stream + pCurrentPacket += XMA_BYTES_PER_PACKET * (GetXmaPacketSkipCount(pCurrentPacket) + 1); + } +} + + +// GetLastXmaFrameBitPosition: Calculates the bit offset of the last complete +// frame in an XMA block or set of blocks. + +__inline DWORD GetLastXmaFrameBitPosition +( + __in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s] + DWORD nXmaDataBytes, // Size of pXmaData in bytes + DWORD nStreamIndex // Stream within which to seek +) +{ + const BYTE* pLastPacket; + DWORD nBytesToNextPacket; + DWORD nFrameBitOffset; + DWORD nFramesInLastPacket; + + XMA2DEFS_ASSERT(pXmaData); + XMA2DEFS_ASSERT(nXmaDataBytes % XMA_BYTES_PER_PACKET == 0); + XMA2DEFS_ASSERT(nXmaDataBytes >= XMA_BYTES_PER_PACKET * (nStreamIndex + 1)); + + // Get the first XMA packet belonging to the desired stream, relying on the + // fact that the first packets for each stream are in consecutive order at + // the beginning of an XMA block. + pLastPacket = pXmaData + nStreamIndex * XMA_BYTES_PER_PACKET; + + // Search for the last packet belonging to the desired stream + for (;;) + { + nBytesToNextPacket = XMA_BYTES_PER_PACKET * (GetXmaPacketSkipCount(pLastPacket) + 1); + XMA2DEFS_ASSERT(nBytesToNextPacket); + if (pLastPacket + nBytesToNextPacket + XMA_BYTES_PER_PACKET > pXmaData + nXmaDataBytes) + { + break; // The next packet would extend beyond the end of pXmaData + } + pLastPacket += nBytesToNextPacket; + } + + // The last packet can sometimes have no seekable frames, in which case we + // have to use the previous one + if (GetXmaPacketFrameCount(pLastPacket) == 0) + { + pLastPacket -= nBytesToNextPacket; + } + + // Found the last packet. Get the bit offset of its first frame. + nFrameBitOffset = XMA_PACKET_HEADER_BITS + GetXmaPacketFirstFrameOffsetInBits(pLastPacket); + + // Traverse frames until we reach the last one + nFramesInLastPacket = GetXmaPacketFrameCount(pLastPacket); + while (--nFramesInLastPacket) + { + nFrameBitOffset += GetXmaFrameLengthInBits(pLastPacket, nFrameBitOffset); + } + + // The bit offset to return is the number of bits from pXmaData to + // pLastPacket plus the offset of the last frame in this packet. + return (DWORD)(pLastPacket - pXmaData) * 8 + nFrameBitOffset; +} + + +// GetXmaDecodePositionForSample: Obtains the information needed to make the +// decoder generate audio starting at a given sample position relative to the +// beginning of the given XMA block: the bit offset of the appropriate frame, +// and the right subframe within that frame. This data can be passed directly +// to the XMAPlaybackSetDecodePosition function. + +__inline HRESULT GetXmaDecodePositionForSample +( + __in_bcount(nXmaDataBytes) const BYTE* pXmaData, // Pointer to XMA block[s] + DWORD nXmaDataBytes, // Size of pXmaData in bytes + DWORD nStreamIndex, // Stream within which to seek + DWORD nDesiredSample, // Sample sought + __out DWORD* pnBitOffset, // Returns the bit offset within pXmaData of + // the frame containing the sample sought + __out DWORD* pnSubFrame // Returns the subframe containing the sample +) +{ + DWORD nDesiredFrame = nDesiredSample / XMA_SAMPLES_PER_FRAME; + DWORD nSubFrame = (nDesiredSample % XMA_SAMPLES_PER_FRAME) / XMA_SAMPLES_PER_SUBFRAME; + DWORD nBitOffset = GetXmaFrameBitPosition(pXmaData, nXmaDataBytes, nStreamIndex, nDesiredFrame); + + XMA2DEFS_ASSERT(pnBitOffset); + XMA2DEFS_ASSERT(pnSubFrame); + + if (nBitOffset) + { + *pnBitOffset = nBitOffset; + *pnSubFrame = nSubFrame; + return S_OK; + } + else + { + return E_FAIL; + } +} + + +// GetXmaSampleRate: Obtains the legal XMA sample rate (24, 32, 44.1 or 48Khz) +// corresponding to a generic sample rate. + +__inline DWORD GetXmaSampleRate(DWORD dwGeneralRate) +{ + DWORD dwXmaRate = 48000; // Default XMA rate for all rates above 44100Hz + + if (dwGeneralRate <= 24000) dwXmaRate = 24000; + else if (dwGeneralRate <= 32000) dwXmaRate = 32000; + else if (dwGeneralRate <= 44100) dwXmaRate = 44100; + + return dwXmaRate; +} + + +// Functions to convert between WAVEFORMATEXTENSIBLE channel masks (combinations +// of the SPEAKER_xxx flags defined in audiodefs.h) and XMA channel masks (which +// are limited to eight possible speaker positions: left, right, center, low +// frequency, side left, side right, back left and back right). + +__inline DWORD GetStandardChannelMaskFromXmaMask(BYTE bXmaMask) +{ + DWORD dwStandardMask = 0; + + if (bXmaMask & XMA_SPEAKER_LEFT) dwStandardMask |= SPEAKER_FRONT_LEFT; + if (bXmaMask & XMA_SPEAKER_RIGHT) dwStandardMask |= SPEAKER_FRONT_RIGHT; + if (bXmaMask & XMA_SPEAKER_CENTER) dwStandardMask |= SPEAKER_FRONT_CENTER; + if (bXmaMask & XMA_SPEAKER_LFE) dwStandardMask |= SPEAKER_LOW_FREQUENCY; + if (bXmaMask & XMA_SPEAKER_LEFT_SURROUND) dwStandardMask |= SPEAKER_SIDE_LEFT; + if (bXmaMask & XMA_SPEAKER_RIGHT_SURROUND) dwStandardMask |= SPEAKER_SIDE_RIGHT; + if (bXmaMask & XMA_SPEAKER_LEFT_BACK) dwStandardMask |= SPEAKER_BACK_LEFT; + if (bXmaMask & XMA_SPEAKER_RIGHT_BACK) dwStandardMask |= SPEAKER_BACK_RIGHT; + + return dwStandardMask; +} + +__inline BYTE GetXmaChannelMaskFromStandardMask(DWORD dwStandardMask) +{ + BYTE bXmaMask = 0; + + if (dwStandardMask & SPEAKER_FRONT_LEFT) bXmaMask |= XMA_SPEAKER_LEFT; + if (dwStandardMask & SPEAKER_FRONT_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT; + if (dwStandardMask & SPEAKER_FRONT_CENTER) bXmaMask |= XMA_SPEAKER_CENTER; + if (dwStandardMask & SPEAKER_LOW_FREQUENCY) bXmaMask |= XMA_SPEAKER_LFE; + if (dwStandardMask & SPEAKER_SIDE_LEFT) bXmaMask |= XMA_SPEAKER_LEFT_SURROUND; + if (dwStandardMask & SPEAKER_SIDE_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT_SURROUND; + if (dwStandardMask & SPEAKER_BACK_LEFT) bXmaMask |= XMA_SPEAKER_LEFT_BACK; + if (dwStandardMask & SPEAKER_BACK_RIGHT) bXmaMask |= XMA_SPEAKER_RIGHT_BACK; + + return bXmaMask; +} + + +// LocalizeXma2Format: Modifies a XMA2WAVEFORMATEX structure in place to comply +// with the current platform's byte-ordering rules (little- or big-endian). + +__inline HRESULT LocalizeXma2Format(__inout XMA2WAVEFORMATEX* pXma2Format) +{ + #define XMASWAP2BYTES(n) ((WORD)(((n) >> 8) | (((n) & 0xff) << 8))) + #define XMASWAP4BYTES(n) ((DWORD)((n) >> 24 | (n) << 24 | ((n) & 0xff00) << 8 | ((n) & 0xff0000) >> 8)) + + if (pXma2Format->wfx.wFormatTag == WAVE_FORMAT_XMA2) + { + return S_OK; + } + else if (XMASWAP2BYTES(pXma2Format->wfx.wFormatTag) == WAVE_FORMAT_XMA2) + { + pXma2Format->wfx.wFormatTag = XMASWAP2BYTES(pXma2Format->wfx.wFormatTag); + pXma2Format->wfx.nChannels = XMASWAP2BYTES(pXma2Format->wfx.nChannels); + pXma2Format->wfx.nSamplesPerSec = XMASWAP4BYTES(pXma2Format->wfx.nSamplesPerSec); + pXma2Format->wfx.nAvgBytesPerSec = XMASWAP4BYTES(pXma2Format->wfx.nAvgBytesPerSec); + pXma2Format->wfx.nBlockAlign = XMASWAP2BYTES(pXma2Format->wfx.nBlockAlign); + pXma2Format->wfx.wBitsPerSample = XMASWAP2BYTES(pXma2Format->wfx.wBitsPerSample); + pXma2Format->wfx.cbSize = XMASWAP2BYTES(pXma2Format->wfx.cbSize); + pXma2Format->NumStreams = XMASWAP2BYTES(pXma2Format->NumStreams); + pXma2Format->ChannelMask = XMASWAP4BYTES(pXma2Format->ChannelMask); + pXma2Format->SamplesEncoded = XMASWAP4BYTES(pXma2Format->SamplesEncoded); + pXma2Format->BytesPerBlock = XMASWAP4BYTES(pXma2Format->BytesPerBlock); + pXma2Format->PlayBegin = XMASWAP4BYTES(pXma2Format->PlayBegin); + pXma2Format->PlayLength = XMASWAP4BYTES(pXma2Format->PlayLength); + pXma2Format->LoopBegin = XMASWAP4BYTES(pXma2Format->LoopBegin); + pXma2Format->LoopLength = XMASWAP4BYTES(pXma2Format->LoopLength); + pXma2Format->BlockCount = XMASWAP2BYTES(pXma2Format->BlockCount); + return S_OK; + } + else + { + return E_FAIL; // Not a recognizable XMA2 format + } + + #undef XMASWAP2BYTES + #undef XMASWAP4BYTES +} + + +#endif // #ifndef __XMA2DEFS_INCLUDED__ diff --git a/Src/Decoder_H264_ALL/D3D/include/xnamath.h b/Src/Decoder_H264_ALL/D3D/include/xnamath.h new file mode 100644 index 0000000..49112bd --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/xnamath.h @@ -0,0 +1,2871 @@ +/*++ + +Copyright (c) Microsoft Corporation. All rights reserved. + +Module Name: + + xnamath.h + +Abstract: + + XNA math library for Windows and Xbox 360 +--*/ + +#if defined(_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#ifndef __XNAMATH_H__ +#define __XNAMATH_H__ + +#ifdef __XBOXMATH_H__ +#error XNAMATH and XBOXMATH are incompatible in the same compilation module. Use one or the other. +#endif + +#define XNAMATH_VERSION 202 + +#if !defined(_XM_X64_) && !defined(_XM_X86_) +#if defined(_M_AMD64) || defined(_AMD64_) +#define _XM_X64_ +#elif defined(_M_IX86) || defined(_X86_) +#define _XM_X86_ +#endif +#endif + +#if !defined(_XM_BIGENDIAN_) && !defined(_XM_LITTLEENDIAN_) +#if defined(_XM_X64_) || defined(_XM_X86_) +#define _XM_LITTLEENDIAN_ +#elif defined(_XBOX_VER) +#define _XM_BIGENDIAN_ +#else +#error xnamath.h only supports x86, x64, or XBox 360 targets +#endif +#endif + +#if defined(_XM_X86_) || defined(_XM_X64_) +#define _XM_SSE_INTRINSICS_ +#if !defined(__cplusplus) && !defined(_XM_NO_INTRINSICS_) +#error xnamath.h only supports C compliation for Xbox 360 targets and no intrinsics cases for x86/x64 +#endif +#elif defined(_XBOX_VER) +#if !defined(__VMX128_SUPPORTED) && !defined(_XM_NO_INTRINSICS_) +#error xnamath.h requires VMX128 compiler support for XBOX 360 +#endif // !__VMX128_SUPPORTED && !_XM_NO_INTRINSICS_ +#define _XM_VMX128_INTRINSICS_ +#else +#error xnamath.h only supports x86, x64, or XBox 360 targets +#endif + + +#if defined(_XM_SSE_INTRINSICS_) +#ifndef _XM_NO_INTRINSICS_ +#include +#include +#endif +#elif defined(_XM_VMX128_INTRINSICS_) +#error This version of xnamath.h is for Windows use only +#endif + +#if defined(_XM_SSE_INTRINSICS_) +#pragma warning(push) +#pragma warning(disable:4985) +#endif +#include +#if defined(_XM_SSE_INTRINSICS_) +#pragma warning(pop) +#endif + +#include + +#if !defined(XMINLINE) +#if !defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#define XMINLINE __inline +#else +#define XMINLINE __forceinline +#endif +#endif + +#if !defined(XMFINLINE) +#define XMFINLINE __forceinline +#endif + +#if !defined(XMDEBUG) +#if defined(_DEBUG) +#define XMDEBUG +#endif +#endif // !XMDEBUG + +#if !defined(XMASSERT) +#if defined(_PREFAST_) +#define XMASSERT(Expression) __analysis_assume((Expression)) +#elif defined(XMDEBUG) // !_PREFAST_ +#define XMASSERT(Expression) ((VOID)((Expression) || (XMAssert(#Expression, __FILE__, __LINE__), 0))) +#else // !XMDEBUG +#define XMASSERT(Expression) ((VOID)0) +#endif // !XMDEBUG +#endif // !XMASSERT + +#if !defined(XM_NO_ALIGNMENT) +#define _DECLSPEC_ALIGN_16_ __declspec(align(16)) +#else +#define _DECLSPEC_ALIGN_16_ +#endif + + +#if defined(_MSC_VER) && (_MSC_VER<1500) && (_MSC_VER>=1400) +#define _XM_ISVS2005_ +#endif + +#if defined(_MSC_VER) && (_MSC_VER<1600) && (_MSC_VER>=1500) +#define _XM_ISVS2008_ +#endif + +/**************************************************************************** + * + * Constant definitions + * + ****************************************************************************/ + +#define XM_PI 3.141592654f +#define XM_2PI 6.283185307f +#define XM_1DIVPI 0.318309886f +#define XM_1DIV2PI 0.159154943f +#define XM_PIDIV2 1.570796327f +#define XM_PIDIV4 0.785398163f + +#define XM_SELECT_0 0x00000000 +#define XM_SELECT_1 0xFFFFFFFF + +#define XM_PERMUTE_0X 0x00010203 +#define XM_PERMUTE_0Y 0x04050607 +#define XM_PERMUTE_0Z 0x08090A0B +#define XM_PERMUTE_0W 0x0C0D0E0F +#define XM_PERMUTE_1X 0x10111213 +#define XM_PERMUTE_1Y 0x14151617 +#define XM_PERMUTE_1Z 0x18191A1B +#define XM_PERMUTE_1W 0x1C1D1E1F + +#define XM_CRMASK_CR6 0x000000F0 +#define XM_CRMASK_CR6TRUE 0x00000080 +#define XM_CRMASK_CR6FALSE 0x00000020 +#define XM_CRMASK_CR6BOUNDS XM_CRMASK_CR6FALSE + +#define XM_CACHE_LINE_SIZE 64 + +/**************************************************************************** + * + * Macros + * + ****************************************************************************/ + +// Unit conversion + +XMFINLINE FLOAT XMConvertToRadians(FLOAT fDegrees) { return fDegrees * (XM_PI / 180.0f); } +XMFINLINE FLOAT XMConvertToDegrees(FLOAT fRadians) { return fRadians * (180.0f / XM_PI); } + +// Condition register evaluation proceeding a recording (Rc) comparison + +#define XMComparisonAllTrue(CR) (((CR) & XM_CRMASK_CR6TRUE) == XM_CRMASK_CR6TRUE) +#define XMComparisonAnyTrue(CR) (((CR) & XM_CRMASK_CR6FALSE) != XM_CRMASK_CR6FALSE) +#define XMComparisonAllFalse(CR) (((CR) & XM_CRMASK_CR6FALSE) == XM_CRMASK_CR6FALSE) +#define XMComparisonAnyFalse(CR) (((CR) & XM_CRMASK_CR6TRUE) != XM_CRMASK_CR6TRUE) +#define XMComparisonMixed(CR) (((CR) & XM_CRMASK_CR6) == 0) +#define XMComparisonAllInBounds(CR) (((CR) & XM_CRMASK_CR6BOUNDS) == XM_CRMASK_CR6BOUNDS) +#define XMComparisonAnyOutOfBounds(CR) (((CR) & XM_CRMASK_CR6BOUNDS) != XM_CRMASK_CR6BOUNDS) + + +#define XMMin(a, b) (((a) < (b)) ? (a) : (b)) +#define XMMax(a, b) (((a) > (b)) ? (a) : (b)) + +/**************************************************************************** + * + * Data types + * + ****************************************************************************/ + +#pragma warning(push) +#pragma warning(disable:4201 4365) + +#if !defined (_XM_X86_) && !defined(_XM_X64_) +#pragma bitfield_order(push) +#pragma bitfield_order(lsb_to_msb) +#endif // !_XM_X86_ && !_XM_X64_ + +#if defined(_XM_NO_INTRINSICS_) && !defined(_XBOX_VER) +// The __vector4 structure is an intrinsic on Xbox but must be separately defined +// for x86/x64 +typedef struct __vector4 +{ + union + { + float vector4_f32[4]; + unsigned int vector4_u32[4]; +#ifndef XM_STRICT_VECTOR4 + struct + { + FLOAT x; + FLOAT y; + FLOAT z; + FLOAT w; + }; + FLOAT v[4]; + UINT u[4]; +#endif // !XM_STRICT_VECTOR4 + }; +} __vector4; +#endif // _XM_NO_INTRINSICS_ + +#if (defined (_XM_X86_) || defined(_XM_X64_)) && defined(_XM_NO_INTRINSICS_) +typedef UINT __vector4i[4]; +#else +typedef __declspec(align(16)) UINT __vector4i[4]; +#endif + +// Vector intrinsic: Four 32 bit floating point components aligned on a 16 byte +// boundary and mapped to hardware vector registers +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +typedef __m128 XMVECTOR; +#else +typedef __vector4 XMVECTOR; +#endif + +// Conversion types for constants +typedef _DECLSPEC_ALIGN_16_ struct XMVECTORF32 { + union { + float f[4]; + XMVECTOR v; + }; + +#if defined(__cplusplus) + inline operator XMVECTOR() const { return v; } +#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const { return reinterpret_cast(&v)[0]; } + inline operator __m128d() const { return reinterpret_cast(&v)[0]; } +#endif +#endif // __cplusplus +} XMVECTORF32; + +typedef _DECLSPEC_ALIGN_16_ struct XMVECTORI32 { + union { + INT i[4]; + XMVECTOR v; + }; +#if defined(__cplusplus) + inline operator XMVECTOR() const { return v; } +#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const { return reinterpret_cast(&v)[0]; } + inline operator __m128d() const { return reinterpret_cast(&v)[0]; } +#endif +#endif // __cplusplus +} XMVECTORI32; + +typedef _DECLSPEC_ALIGN_16_ struct XMVECTORU8 { + union { + BYTE u[16]; + XMVECTOR v; + }; +#if defined(__cplusplus) + inline operator XMVECTOR() const { return v; } +#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const { return reinterpret_cast(&v)[0]; } + inline operator __m128d() const { return reinterpret_cast(&v)[0]; } +#endif +#endif // __cplusplus +} XMVECTORU8; + +typedef _DECLSPEC_ALIGN_16_ struct XMVECTORU32 { + union { + UINT u[4]; + XMVECTOR v; + }; +#if defined(__cplusplus) + inline operator XMVECTOR() const { return v; } +#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_SSE_INTRINSICS_) + inline operator __m128i() const { return reinterpret_cast(&v)[0]; } + inline operator __m128d() const { return reinterpret_cast(&v)[0]; } +#endif +#endif // __cplusplus +} XMVECTORU32; + +// Fix-up for (1st-3rd) XMVECTOR parameters that are pass-in-register for x86 and Xbox 360, but not for other targets +#if defined(_XM_VMX128_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +typedef const XMVECTOR FXMVECTOR; +#elif defined(_XM_X86_) && !defined(_XM_NO_INTRINSICS_) +typedef const XMVECTOR FXMVECTOR; +#elif defined(__cplusplus) +typedef const XMVECTOR& FXMVECTOR; +#else +typedef const XMVECTOR FXMVECTOR; +#endif + +// Fix-up for (4th+) XMVECTOR parameters to pass in-register for Xbox 360 and by reference otherwise +#if defined(_XM_VMX128_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) +typedef const XMVECTOR CXMVECTOR; +#elif defined(__cplusplus) +typedef const XMVECTOR& CXMVECTOR; +#else +typedef const XMVECTOR CXMVECTOR; +#endif + +// Vector operators +#if defined(__cplusplus) && !defined(XM_NO_OPERATOR_OVERLOADS) + +XMVECTOR operator+ (FXMVECTOR V); +XMVECTOR operator- (FXMVECTOR V); + +XMVECTOR& operator+= (XMVECTOR& V1, FXMVECTOR V2); +XMVECTOR& operator-= (XMVECTOR& V1, FXMVECTOR V2); +XMVECTOR& operator*= (XMVECTOR& V1, FXMVECTOR V2); +XMVECTOR& operator/= (XMVECTOR& V1, FXMVECTOR V2); +XMVECTOR& operator*= (XMVECTOR& V, FLOAT S); +XMVECTOR& operator/= (XMVECTOR& V, FLOAT S); + +XMVECTOR operator+ (FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR operator- (FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR operator* (FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR operator/ (FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR operator* (FXMVECTOR V, FLOAT S); +XMVECTOR operator* (FLOAT S, FXMVECTOR V); +XMVECTOR operator/ (FXMVECTOR V, FLOAT S); + +#endif // __cplusplus && !XM_NO_OPERATOR_OVERLOADS + +// Matrix type: Sixteen 32 bit floating point components aligned on a +// 16 byte boundary and mapped to four hardware vector registers +#if (defined(_XM_X86_) || defined(_XM_X64_)) && defined(_XM_NO_INTRINSICS_) +typedef struct _XMMATRIX +#else +typedef _DECLSPEC_ALIGN_16_ struct _XMMATRIX +#endif +{ + union + { + XMVECTOR r[4]; + struct + { + FLOAT _11, _12, _13, _14; + FLOAT _21, _22, _23, _24; + FLOAT _31, _32, _33, _34; + FLOAT _41, _42, _43, _44; + }; + FLOAT m[4][4]; + }; + +#ifdef __cplusplus + + _XMMATRIX() {}; + _XMMATRIX(FXMVECTOR R0, FXMVECTOR R1, FXMVECTOR R2, CXMVECTOR R3); + _XMMATRIX(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03, + FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13, + FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23, + FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33); + _XMMATRIX(CONST FLOAT *pArray); + + FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; } + FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; } + + _XMMATRIX& operator= (CONST _XMMATRIX& M); + +#ifndef XM_NO_OPERATOR_OVERLOADS + _XMMATRIX& operator*= (CONST _XMMATRIX& M); + _XMMATRIX operator* (CONST _XMMATRIX& M) CONST; +#endif // !XM_NO_OPERATOR_OVERLOADS + +#endif // __cplusplus + +} XMMATRIX; + +// Fix-up for XMMATRIX parameters to pass in-register on Xbox 360, by reference otherwise +#if defined(_XM_VMX128_INTRINSICS_) +typedef const XMMATRIX CXMMATRIX; +#elif defined(__cplusplus) +typedef const XMMATRIX& CXMMATRIX; +#else +typedef const XMMATRIX CXMMATRIX; +#endif + +// 16 bit floating point number consisting of a sign bit, a 5 bit biased +// exponent, and a 10 bit mantissa +//typedef WORD HALF; +typedef USHORT HALF; + +// 2D Vector; 32 bit floating point components +typedef struct _XMFLOAT2 +{ + FLOAT x; + FLOAT y; + +#ifdef __cplusplus + + _XMFLOAT2() {}; + _XMFLOAT2(FLOAT _x, FLOAT _y) : x(_x), y(_y) {}; + _XMFLOAT2(CONST FLOAT *pArray); + + _XMFLOAT2& operator= (CONST _XMFLOAT2& Float2); + +#endif // __cplusplus + +} XMFLOAT2; + +// 2D Vector; 32 bit floating point components aligned on a 16 byte boundary +typedef __declspec(align(16)) XMFLOAT2 XMFLOAT2A; + +// 2D Vector; 16 bit floating point components +typedef struct _XMHALF2 +{ + HALF x; + HALF y; + +#ifdef __cplusplus + + _XMHALF2() {}; + _XMHALF2(HALF _x, HALF _y) : x(_x), y(_y) {}; + _XMHALF2(CONST HALF *pArray); + _XMHALF2(FLOAT _x, FLOAT _y); + _XMHALF2(CONST FLOAT *pArray); + + _XMHALF2& operator= (CONST _XMHALF2& Half2); + +#endif // __cplusplus + +} XMHALF2; + +// 2D Vector; 16 bit signed normalized integer components +typedef struct _XMSHORTN2 +{ + SHORT x; + SHORT y; + +#ifdef __cplusplus + + _XMSHORTN2() {}; + _XMSHORTN2(SHORT _x, SHORT _y) : x(_x), y(_y) {}; + _XMSHORTN2(CONST SHORT *pArray); + _XMSHORTN2(FLOAT _x, FLOAT _y); + _XMSHORTN2(CONST FLOAT *pArray); + + _XMSHORTN2& operator= (CONST _XMSHORTN2& ShortN2); + +#endif // __cplusplus + +} XMSHORTN2; + +// 2D Vector; 16 bit signed integer components +typedef struct _XMSHORT2 +{ + SHORT x; + SHORT y; + +#ifdef __cplusplus + + _XMSHORT2() {}; + _XMSHORT2(SHORT _x, SHORT _y) : x(_x), y(_y) {}; + _XMSHORT2(CONST SHORT *pArray); + _XMSHORT2(FLOAT _x, FLOAT _y); + _XMSHORT2(CONST FLOAT *pArray); + + _XMSHORT2& operator= (CONST _XMSHORT2& Short2); + +#endif // __cplusplus + +} XMSHORT2; + +// 2D Vector; 16 bit unsigned normalized integer components +typedef struct _XMUSHORTN2 +{ + USHORT x; + USHORT y; + +#ifdef __cplusplus + + _XMUSHORTN2() {}; + _XMUSHORTN2(USHORT _x, USHORT _y) : x(_x), y(_y) {}; + _XMUSHORTN2(CONST USHORT *pArray); + _XMUSHORTN2(FLOAT _x, FLOAT _y); + _XMUSHORTN2(CONST FLOAT *pArray); + + _XMUSHORTN2& operator= (CONST _XMUSHORTN2& UShortN2); + +#endif // __cplusplus + +} XMUSHORTN2; + +// 2D Vector; 16 bit unsigned integer components +typedef struct _XMUSHORT2 +{ + USHORT x; + USHORT y; + +#ifdef __cplusplus + + _XMUSHORT2() {}; + _XMUSHORT2(USHORT _x, USHORT _y) : x(_x), y(_y) {}; + _XMUSHORT2(CONST USHORT *pArray); + _XMUSHORT2(FLOAT _x, FLOAT _y); + _XMUSHORT2(CONST FLOAT *pArray); + + _XMUSHORT2& operator= (CONST _XMUSHORT2& UShort2); + +#endif // __cplusplus + +} XMUSHORT2; + +// 3D Vector; 32 bit floating point components +typedef struct _XMFLOAT3 +{ + FLOAT x; + FLOAT y; + FLOAT z; + +#ifdef __cplusplus + + _XMFLOAT3() {}; + _XMFLOAT3(FLOAT _x, FLOAT _y, FLOAT _z) : x(_x), y(_y), z(_z) {}; + _XMFLOAT3(CONST FLOAT *pArray); + + _XMFLOAT3& operator= (CONST _XMFLOAT3& Float3); + +#endif // __cplusplus + +} XMFLOAT3; + +// 3D Vector; 32 bit floating point components aligned on a 16 byte boundary +typedef __declspec(align(16)) XMFLOAT3 XMFLOAT3A; + +// 3D Vector; 11-11-10 bit normalized components packed into a 32 bit integer +// The normalized 3D Vector is packed into 32 bits as follows: a 10 bit signed, +// normalized integer for the z component and 11 bit signed, normalized +// integers for the x and y components. The z component is stored in the +// most significant bits and the x component in the least significant bits +// (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0] +typedef struct _XMHENDN3 +{ + union + { + struct + { + INT x : 11; // -1023/1023 to 1023/1023 + INT y : 11; // -1023/1023 to 1023/1023 + INT z : 10; // -511/511 to 511/511 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMHENDN3() {}; + _XMHENDN3(UINT Packed) : v(Packed) {}; + _XMHENDN3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMHENDN3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMHENDN3& operator= (CONST _XMHENDN3& HenDN3); + _XMHENDN3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMHENDN3; + +// 3D Vector; 11-11-10 bit components packed into a 32 bit integer +// The 3D Vector is packed into 32 bits as follows: a 10 bit signed, +// integer for the z component and 11 bit signed integers for the +// x and y components. The z component is stored in the +// most significant bits and the x component in the least significant bits +// (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0] +typedef struct _XMHEND3 +{ + union + { + struct + { + INT x : 11; // -1023 to 1023 + INT y : 11; // -1023 to 1023 + INT z : 10; // -511 to 511 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMHEND3() {}; + _XMHEND3(UINT Packed) : v(Packed) {}; + _XMHEND3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMHEND3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMHEND3& operator= (CONST _XMHEND3& HenD3); + _XMHEND3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMHEND3; + +// 3D Vector; 11-11-10 bit normalized components packed into a 32 bit integer +// The normalized 3D Vector is packed into 32 bits as follows: a 10 bit unsigned, +// normalized integer for the z component and 11 bit unsigned, normalized +// integers for the x and y components. The z component is stored in the +// most significant bits and the x component in the least significant bits +// (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0] +typedef struct _XMUHENDN3 +{ + union + { + struct + { + UINT x : 11; // 0/2047 to 2047/2047 + UINT y : 11; // 0/2047 to 2047/2047 + UINT z : 10; // 0/1023 to 1023/1023 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUHENDN3() {}; + _XMUHENDN3(UINT Packed) : v(Packed) {}; + _XMUHENDN3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMUHENDN3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMUHENDN3& operator= (CONST _XMUHENDN3& UHenDN3); + _XMUHENDN3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMUHENDN3; + +// 3D Vector; 11-11-10 bit components packed into a 32 bit integer +// The 3D Vector is packed into 32 bits as follows: a 10 bit unsigned +// integer for the z component and 11 bit unsigned integers +// for the x and y components. The z component is stored in the +// most significant bits and the x component in the least significant bits +// (Z10Y11X11): [32] zzzzzzzz zzyyyyyy yyyyyxxx xxxxxxxx [0] +typedef struct _XMUHEND3 +{ + union + { + struct + { + UINT x : 11; // 0 to 2047 + UINT y : 11; // 0 to 2047 + UINT z : 10; // 0 to 1023 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUHEND3() {}; + _XMUHEND3(UINT Packed) : v(Packed) {}; + _XMUHEND3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMUHEND3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMUHEND3& operator= (CONST _XMUHEND3& UHenD3); + _XMUHEND3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMUHEND3; + +// 3D Vector; 10-11-11 bit normalized components packed into a 32 bit integer +// The normalized 3D Vector is packed into 32 bits as follows: a 10 bit signed, +// normalized integer for the x component and 11 bit signed, normalized +// integers for the y and z components. The z component is stored in the +// most significant bits and the x component in the least significant bits +// (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMDHENN3 +{ + union + { + struct + { + INT x : 10; // -511/511 to 511/511 + INT y : 11; // -1023/1023 to 1023/1023 + INT z : 11; // -1023/1023 to 1023/1023 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMDHENN3() {}; + _XMDHENN3(UINT Packed) : v(Packed) {}; + _XMDHENN3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMDHENN3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMDHENN3& operator= (CONST _XMDHENN3& DHenN3); + _XMDHENN3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMDHENN3; + +// 3D Vector; 10-11-11 bit components packed into a 32 bit integer +// The 3D Vector is packed into 32 bits as follows: a 10 bit signed, +// integer for the x component and 11 bit signed integers for the +// y and z components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMDHEN3 +{ + union + { + struct + { + INT x : 10; // -511 to 511 + INT y : 11; // -1023 to 1023 + INT z : 11; // -1023 to 1023 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMDHEN3() {}; + _XMDHEN3(UINT Packed) : v(Packed) {}; + _XMDHEN3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMDHEN3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMDHEN3& operator= (CONST _XMDHEN3& DHen3); + _XMDHEN3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMDHEN3; + +// 3D Vector; 10-11-11 bit normalized components packed into a 32 bit integer +// The normalized 3D Vector is packed into 32 bits as follows: a 10 bit unsigned, +// normalized integer for the x component and 11 bit unsigned, normalized +// integers for the y and z components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMUDHENN3 +{ + union + { + struct + { + UINT x : 10; // 0/1023 to 1023/1023 + UINT y : 11; // 0/2047 to 2047/2047 + UINT z : 11; // 0/2047 to 2047/2047 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUDHENN3() {}; + _XMUDHENN3(UINT Packed) : v(Packed) {}; + _XMUDHENN3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMUDHENN3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMUDHENN3& operator= (CONST _XMUDHENN3& UDHenN3); + _XMUDHENN3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMUDHENN3; + +// 3D Vector; 10-11-11 bit components packed into a 32 bit integer +// The 3D Vector is packed into 32 bits as follows: a 10 bit unsigned, +// integer for the x component and 11 bit unsigned integers +// for the y and z components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (Z11Y11X10): [32] zzzzzzzz zzzyyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMUDHEN3 +{ + union + { + struct + { + UINT x : 10; // 0 to 1023 + UINT y : 11; // 0 to 2047 + UINT z : 11; // 0 to 2047 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUDHEN3() {}; + _XMUDHEN3(UINT Packed) : v(Packed) {}; + _XMUDHEN3(FLOAT _x, FLOAT _y, FLOAT _z); + _XMUDHEN3(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMUDHEN3& operator= (CONST _XMUDHEN3& UDHen3); + _XMUDHEN3& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMUDHEN3; + +// 3D vector: 5/6/5 unsigned integer components +typedef struct _XMU565 +{ + union + { + struct + { + USHORT x : 5; + USHORT y : 6; + USHORT z : 5; + }; + USHORT v; + }; + +#ifdef __cplusplus + + _XMU565() {}; + _XMU565(USHORT Packed) : v(Packed) {}; + _XMU565(CHAR _x, CHAR _y, CHAR _z) : x(_x), y(_y), z(_z) {}; + _XMU565(CONST CHAR *pArray); + _XMU565(FLOAT _x, FLOAT _y, FLOAT _z); + _XMU565(CONST FLOAT *pArray); + + operator USHORT () { return v; } + + _XMU565& operator= (CONST _XMU565& U565); + _XMU565& operator= (CONST USHORT Packed); + +#endif // __cplusplus + +} XMU565; + +// 3D vector: 11/11/10 floating-point components +// The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent +// and 6-bit mantissa for x component, a 5-bit biased exponent and +// 6-bit mantissa for y component, a 5-bit biased exponent and a 5-bit +// mantissa for z. The z component is stored in the most significant bits +// and the x component in the least significant bits. No sign bits so +// all partial-precision numbers are positive. +// (Z10Y11X11): [32] ZZZZZzzz zzzYYYYY yyyyyyXX XXXxxxxx [0] +typedef struct _XMFLOAT3PK +{ + union + { + struct + { + UINT xm : 6; + UINT xe : 5; + UINT ym : 6; + UINT ye : 5; + UINT zm : 5; + UINT ze : 5; + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMFLOAT3PK() {}; + _XMFLOAT3PK(UINT Packed) : v(Packed) {}; + _XMFLOAT3PK(FLOAT _x, FLOAT _y, FLOAT _z); + _XMFLOAT3PK(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMFLOAT3PK& operator= (CONST _XMFLOAT3PK& float3pk); + _XMFLOAT3PK& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMFLOAT3PK; + +// 3D vector: 9/9/9 floating-point components with shared 5-bit exponent +// The 3D vector is packed into 32 bits as follows: a 5-bit biased exponent +// with 9-bit mantissa for the x, y, and z component. The shared exponent +// is stored in the most significant bits and the x component mantissa is in +// the least significant bits. No sign bits so all partial-precision numbers +// are positive. +// (E5Z9Y9X9): [32] EEEEEzzz zzzzzzyy yyyyyyyx xxxxxxxx [0] +typedef struct _XMFLOAT3SE +{ + union + { + struct + { + UINT xm : 9; + UINT ym : 9; + UINT zm : 9; + UINT e : 5; + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMFLOAT3SE() {}; + _XMFLOAT3SE(UINT Packed) : v(Packed) {}; + _XMFLOAT3SE(FLOAT _x, FLOAT _y, FLOAT _z); + _XMFLOAT3SE(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMFLOAT3SE& operator= (CONST _XMFLOAT3SE& float3se); + _XMFLOAT3SE& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMFLOAT3SE; + +// 4D Vector; 32 bit floating point components +typedef struct _XMFLOAT4 +{ + FLOAT x; + FLOAT y; + FLOAT z; + FLOAT w; + +#ifdef __cplusplus + + _XMFLOAT4() {}; + _XMFLOAT4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMFLOAT4(CONST FLOAT *pArray); + + _XMFLOAT4& operator= (CONST _XMFLOAT4& Float4); + +#endif // __cplusplus + +} XMFLOAT4; + +// 4D Vector; 32 bit floating point components aligned on a 16 byte boundary +typedef __declspec(align(16)) XMFLOAT4 XMFLOAT4A; + +// 4D Vector; 16 bit floating point components +typedef struct _XMHALF4 +{ + HALF x; + HALF y; + HALF z; + HALF w; + +#ifdef __cplusplus + + _XMHALF4() {}; + _XMHALF4(HALF _x, HALF _y, HALF _z, HALF _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMHALF4(CONST HALF *pArray); + _XMHALF4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMHALF4(CONST FLOAT *pArray); + + _XMHALF4& operator= (CONST _XMHALF4& Half4); + +#endif // __cplusplus + +} XMHALF4; + +// 4D Vector; 16 bit signed normalized integer components +typedef struct _XMSHORTN4 +{ + SHORT x; + SHORT y; + SHORT z; + SHORT w; + +#ifdef __cplusplus + + _XMSHORTN4() {}; + _XMSHORTN4(SHORT _x, SHORT _y, SHORT _z, SHORT _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMSHORTN4(CONST SHORT *pArray); + _XMSHORTN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMSHORTN4(CONST FLOAT *pArray); + + _XMSHORTN4& operator= (CONST _XMSHORTN4& ShortN4); + +#endif // __cplusplus + +} XMSHORTN4; + +// 4D Vector; 16 bit signed integer components +typedef struct _XMSHORT4 +{ + SHORT x; + SHORT y; + SHORT z; + SHORT w; + +#ifdef __cplusplus + + _XMSHORT4() {}; + _XMSHORT4(SHORT _x, SHORT _y, SHORT _z, SHORT _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMSHORT4(CONST SHORT *pArray); + _XMSHORT4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMSHORT4(CONST FLOAT *pArray); + + _XMSHORT4& operator= (CONST _XMSHORT4& Short4); + +#endif // __cplusplus + +} XMSHORT4; + +// 4D Vector; 16 bit unsigned normalized integer components +typedef struct _XMUSHORTN4 +{ + USHORT x; + USHORT y; + USHORT z; + USHORT w; + +#ifdef __cplusplus + + _XMUSHORTN4() {}; + _XMUSHORTN4(USHORT _x, USHORT _y, USHORT _z, USHORT _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMUSHORTN4(CONST USHORT *pArray); + _XMUSHORTN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUSHORTN4(CONST FLOAT *pArray); + + _XMUSHORTN4& operator= (CONST _XMUSHORTN4& UShortN4); + +#endif // __cplusplus + +} XMUSHORTN4; + +// 4D Vector; 16 bit unsigned integer components +typedef struct _XMUSHORT4 +{ + USHORT x; + USHORT y; + USHORT z; + USHORT w; + +#ifdef __cplusplus + + _XMUSHORT4() {}; + _XMUSHORT4(USHORT _x, USHORT _y, USHORT _z, USHORT _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMUSHORT4(CONST USHORT *pArray); + _XMUSHORT4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUSHORT4(CONST FLOAT *pArray); + + _XMUSHORT4& operator= (CONST _XMUSHORT4& UShort4); + +#endif // __cplusplus + +} XMUSHORT4; + +// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer +// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, +// normalized integer for the w component and 10 bit signed, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMXDECN4 +{ + union + { + struct + { + INT x : 10; // -511/511 to 511/511 + INT y : 10; // -511/511 to 511/511 + INT z : 10; // -511/511 to 511/511 + UINT w : 2; // 0/3 to 3/3 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMXDECN4() {}; + _XMXDECN4(UINT Packed) : v(Packed) {}; + _XMXDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMXDECN4(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMXDECN4& operator= (CONST _XMXDECN4& XDecN4); + _XMXDECN4& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMXDECN4; + +// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer +// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned +// integer for the w component and 10 bit signed integers for the +// z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMXDEC4 +{ + union + { + struct + { + INT x : 10; // -511 to 511 + INT y : 10; // -511 to 511 + INT z : 10; // -511 to 511 + UINT w : 2; // 0 to 3 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMXDEC4() {}; + _XMXDEC4(UINT Packed) : v(Packed) {}; + _XMXDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMXDEC4(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMXDEC4& operator= (CONST _XMXDEC4& XDec4); + _XMXDEC4& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMXDEC4; + +// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer +// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit signed, +// normalized integer for the w component and 10 bit signed, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMDECN4 +{ + union + { + struct + { + INT x : 10; // -511/511 to 511/511 + INT y : 10; // -511/511 to 511/511 + INT z : 10; // -511/511 to 511/511 + INT w : 2; // -1/1 to 1/1 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMDECN4() {}; + _XMDECN4(UINT Packed) : v(Packed) {}; + _XMDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMDECN4(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMDECN4& operator= (CONST _XMDECN4& DecN4); + _XMDECN4& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMDECN4; + +// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer +// The 4D Vector is packed into 32 bits as follows: a 2 bit signed, +// integer for the w component and 10 bit signed integers for the +// z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMDEC4 +{ + union + { + struct + { + INT x : 10; // -511 to 511 + INT y : 10; // -511 to 511 + INT z : 10; // -511 to 511 + INT w : 2; // -1 to 1 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMDEC4() {}; + _XMDEC4(UINT Packed) : v(Packed) {}; + _XMDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMDEC4(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMDEC4& operator= (CONST _XMDEC4& Dec4); + _XMDEC4& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMDEC4; + +// 4D Vector; 10-10-10-2 bit normalized components packed into a 32 bit integer +// The normalized 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, +// normalized integer for the w component and 10 bit unsigned, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMUDECN4 +{ + union + { + struct + { + UINT x : 10; // 0/1023 to 1023/1023 + UINT y : 10; // 0/1023 to 1023/1023 + UINT z : 10; // 0/1023 to 1023/1023 + UINT w : 2; // 0/3 to 3/3 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUDECN4() {}; + _XMUDECN4(UINT Packed) : v(Packed) {}; + _XMUDECN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUDECN4(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMUDECN4& operator= (CONST _XMUDECN4& UDecN4); + _XMUDECN4& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMUDECN4; + +// 4D Vector; 10-10-10-2 bit components packed into a 32 bit integer +// The 4D Vector is packed into 32 bits as follows: a 2 bit unsigned, +// integer for the w component and 10 bit unsigned integers +// for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W2Z10Y10X10): [32] wwzzzzzz zzzzyyyy yyyyyyxx xxxxxxxx [0] +typedef struct _XMUDEC4 +{ + union + { + struct + { + UINT x : 10; // 0 to 1023 + UINT y : 10; // 0 to 1023 + UINT z : 10; // 0 to 1023 + UINT w : 2; // 0 to 3 + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUDEC4() {}; + _XMUDEC4(UINT Packed) : v(Packed) {}; + _XMUDEC4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUDEC4(CONST FLOAT *pArray); + + operator UINT () { return v; } + + _XMUDEC4& operator= (CONST _XMUDEC4& UDec4); + _XMUDEC4& operator= (CONST UINT Packed); + +#endif // __cplusplus + +} XMUDEC4; + +// 4D Vector; 20-20-20-4 bit normalized components packed into a 64 bit integer +// The normalized 4D Vector is packed into 64 bits as follows: a 4 bit unsigned, +// normalized integer for the w component and 20 bit signed, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0] +typedef struct _XMXICON4 +{ + union + { + struct + { + INT64 x : 20; // -524287/524287 to 524287/524287 + INT64 y : 20; // -524287/524287 to 524287/524287 + INT64 z : 20; // -524287/524287 to 524287/524287 + UINT64 w : 4; // 0/15 to 15/15 + }; + UINT64 v; + }; + +#ifdef __cplusplus + + _XMXICON4() {}; + _XMXICON4(UINT64 Packed) : v(Packed) {}; + _XMXICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMXICON4(CONST FLOAT *pArray); + + operator UINT64 () { return v; } + + _XMXICON4& operator= (CONST _XMXICON4& XIcoN4); + _XMXICON4& operator= (CONST UINT64 Packed); + +#endif // __cplusplus + +} XMXICON4; + +// 4D Vector; 20-20-20-4 bit components packed into a 64 bit integer +// The 4D Vector is packed into 64 bits as follows: a 4 bit unsigned +// integer for the w component and 20 bit signed integers for the +// z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0] +typedef struct _XMXICO4 +{ + union + { + struct + { + INT64 x : 20; // -524287 to 524287 + INT64 y : 20; // -524287 to 524287 + INT64 z : 20; // -524287 to 524287 + UINT64 w : 4; // 0 to 15 + }; + UINT64 v; + }; + +#ifdef __cplusplus + + _XMXICO4() {}; + _XMXICO4(UINT64 Packed) : v(Packed) {}; + _XMXICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMXICO4(CONST FLOAT *pArray); + + operator UINT64 () { return v; } + + _XMXICO4& operator= (CONST _XMXICO4& XIco4); + _XMXICO4& operator= (CONST UINT64 Packed); + +#endif // __cplusplus + +} XMXICO4; + +// 4D Vector; 20-20-20-4 bit normalized components packed into a 64 bit integer +// The normalized 4D Vector is packed into 64 bits as follows: a 4 bit signed, +// normalized integer for the w component and 20 bit signed, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0] +typedef struct _XMICON4 +{ + union + { + struct + { + INT64 x : 20; // -524287/524287 to 524287/524287 + INT64 y : 20; // -524287/524287 to 524287/524287 + INT64 z : 20; // -524287/524287 to 524287/524287 + INT64 w : 4; // -7/7 to 7/7 + }; + UINT64 v; + }; + +#ifdef __cplusplus + + _XMICON4() {}; + _XMICON4(UINT64 Packed) : v(Packed) {}; + _XMICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMICON4(CONST FLOAT *pArray); + + operator UINT64 () { return v; } + + _XMICON4& operator= (CONST _XMICON4& IcoN4); + _XMICON4& operator= (CONST UINT64 Packed); + +#endif // __cplusplus + +} XMICON4; + +// 4D Vector; 20-20-20-4 bit components packed into a 64 bit integer +// The 4D Vector is packed into 64 bits as follows: a 4 bit signed, +// integer for the w component and 20 bit signed integers for the +// z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0] +typedef struct _XMICO4 +{ + union + { + struct + { + INT64 x : 20; // -524287 to 524287 + INT64 y : 20; // -524287 to 524287 + INT64 z : 20; // -524287 to 524287 + INT64 w : 4; // -7 to 7 + }; + UINT64 v; + }; + +#ifdef __cplusplus + + _XMICO4() {}; + _XMICO4(UINT64 Packed) : v(Packed) {}; + _XMICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMICO4(CONST FLOAT *pArray); + + operator UINT64 () { return v; } + + _XMICO4& operator= (CONST _XMICO4& Ico4); + _XMICO4& operator= (CONST UINT64 Packed); + +#endif // __cplusplus + +} XMICO4; + +// 4D Vector; 20-20-20-4 bit normalized components packed into a 64 bit integer +// The normalized 4D Vector is packed into 64 bits as follows: a 4 bit unsigned, +// normalized integer for the w component and 20 bit unsigned, normalized +// integers for the z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0] +typedef struct _XMUICON4 +{ + union + { + struct + { + UINT64 x : 20; // 0/1048575 to 1048575/1048575 + UINT64 y : 20; // 0/1048575 to 1048575/1048575 + UINT64 z : 20; // 0/1048575 to 1048575/1048575 + UINT64 w : 4; // 0/15 to 15/15 + }; + UINT64 v; + }; + +#ifdef __cplusplus + + _XMUICON4() {}; + _XMUICON4(UINT64 Packed) : v(Packed) {}; + _XMUICON4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUICON4(CONST FLOAT *pArray); + + operator UINT64 () { return v; } + + _XMUICON4& operator= (CONST _XMUICON4& UIcoN4); + _XMUICON4& operator= (CONST UINT64 Packed); + +#endif // __cplusplus + +} XMUICON4; + +// 4D Vector; 20-20-20-4 bit components packed into a 64 bit integer +// The 4D Vector is packed into 64 bits as follows: a 4 bit unsigned +// integer for the w component and 20 bit unsigned integers for the +// z, y, and x components. The w component is stored in the +// most significant bits and the x component in the least significant bits +// (W4Z20Y20X20): [64] wwwwzzzz zzzzzzzz zzzzzzzz yyyyyyyy yyyyyyyy yyyyxxxx xxxxxxxx xxxxxxxx [0] +typedef struct _XMUICO4 +{ + union + { + struct + { + UINT64 x : 20; // 0 to 1048575 + UINT64 y : 20; // 0 to 1048575 + UINT64 z : 20; // 0 to 1048575 + UINT64 w : 4; // 0 to 15 + }; + UINT64 v; + }; + +#ifdef __cplusplus + + _XMUICO4() {}; + _XMUICO4(UINT64 Packed) : v(Packed) {}; + _XMUICO4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUICO4(CONST FLOAT *pArray); + + operator UINT64 () { return v; } + + _XMUICO4& operator= (CONST _XMUICO4& UIco4); + _XMUICO4& operator= (CONST UINT64 Packed); + +#endif // __cplusplus + +} XMUICO4; + +// ARGB Color; 8-8-8-8 bit unsigned normalized integer components packed into +// a 32 bit integer. The normalized color is packed into 32 bits using 8 bit +// unsigned, normalized integers for the alpha, red, green, and blue components. +// The alpha component is stored in the most significant bits and the blue +// component in the least significant bits (A8R8G8B8): +// [32] aaaaaaaa rrrrrrrr gggggggg bbbbbbbb [0] +typedef struct _XMCOLOR +{ + union + { + struct + { + UINT b : 8; // Blue: 0/255 to 255/255 + UINT g : 8; // Green: 0/255 to 255/255 + UINT r : 8; // Red: 0/255 to 255/255 + UINT a : 8; // Alpha: 0/255 to 255/255 + }; + UINT c; + }; + +#ifdef __cplusplus + + _XMCOLOR() {}; + _XMCOLOR(UINT Color) : c(Color) {}; + _XMCOLOR(FLOAT _r, FLOAT _g, FLOAT _b, FLOAT _a); + _XMCOLOR(CONST FLOAT *pArray); + + operator UINT () { return c; } + + _XMCOLOR& operator= (CONST _XMCOLOR& Color); + _XMCOLOR& operator= (CONST UINT Color); + +#endif // __cplusplus + +} XMCOLOR; + +// 4D Vector; 8 bit signed normalized integer components +typedef struct _XMBYTEN4 +{ + union + { + struct + { + CHAR x; + CHAR y; + CHAR z; + CHAR w; + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMBYTEN4() {}; + _XMBYTEN4(CHAR _x, CHAR _y, CHAR _z, CHAR _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMBYTEN4(UINT Packed) : v(Packed) {}; + _XMBYTEN4(CONST CHAR *pArray); + _XMBYTEN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMBYTEN4(CONST FLOAT *pArray); + + _XMBYTEN4& operator= (CONST _XMBYTEN4& ByteN4); + +#endif // __cplusplus + +} XMBYTEN4; + +// 4D Vector; 8 bit signed integer components +typedef struct _XMBYTE4 +{ + union + { + struct + { + CHAR x; + CHAR y; + CHAR z; + CHAR w; + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMBYTE4() {}; + _XMBYTE4(CHAR _x, CHAR _y, CHAR _z, CHAR _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMBYTE4(UINT Packed) : v(Packed) {}; + _XMBYTE4(CONST CHAR *pArray); + _XMBYTE4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMBYTE4(CONST FLOAT *pArray); + + _XMBYTE4& operator= (CONST _XMBYTE4& Byte4); + +#endif // __cplusplus + +} XMBYTE4; + +// 4D Vector; 8 bit unsigned normalized integer components +typedef struct _XMUBYTEN4 +{ + union + { + struct + { + BYTE x; + BYTE y; + BYTE z; + BYTE w; + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUBYTEN4() {}; + _XMUBYTEN4(BYTE _x, BYTE _y, BYTE _z, BYTE _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMUBYTEN4(UINT Packed) : v(Packed) {}; + _XMUBYTEN4(CONST BYTE *pArray); + _XMUBYTEN4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUBYTEN4(CONST FLOAT *pArray); + + _XMUBYTEN4& operator= (CONST _XMUBYTEN4& UByteN4); + +#endif // __cplusplus + +} XMUBYTEN4; + +// 4D Vector; 8 bit unsigned integer components +typedef struct _XMUBYTE4 +{ + union + { + struct + { + BYTE x; + BYTE y; + BYTE z; + BYTE w; + }; + UINT v; + }; + +#ifdef __cplusplus + + _XMUBYTE4() {}; + _XMUBYTE4(BYTE _x, BYTE _y, BYTE _z, BYTE _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMUBYTE4(UINT Packed) : v(Packed) {}; + _XMUBYTE4(CONST BYTE *pArray); + _XMUBYTE4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUBYTE4(CONST FLOAT *pArray); + + _XMUBYTE4& operator= (CONST _XMUBYTE4& UByte4); + +#endif // __cplusplus + +} XMUBYTE4; + +// 4D vector; 4 bit unsigned integer components +typedef struct _XMUNIBBLE4 +{ + union + { + struct + { + USHORT x : 4; + USHORT y : 4; + USHORT z : 4; + USHORT w : 4; + }; + USHORT v; + }; + +#ifdef __cplusplus + + _XMUNIBBLE4() {}; + _XMUNIBBLE4(USHORT Packed) : v(Packed) {}; + _XMUNIBBLE4(CHAR _x, CHAR _y, CHAR _z, CHAR _w) : x(_x), y(_y), z(_z), w(_w) {}; + _XMUNIBBLE4(CONST CHAR *pArray); + _XMUNIBBLE4(FLOAT _x, FLOAT _y, FLOAT _z, FLOAT _w); + _XMUNIBBLE4(CONST FLOAT *pArray); + + operator USHORT () { return v; } + + _XMUNIBBLE4& operator= (CONST _XMUNIBBLE4& UNibble4); + _XMUNIBBLE4& operator= (CONST USHORT Packed); + +#endif // __cplusplus + +} XMUNIBBLE4; + +// 4D vector: 5/5/5/1 unsigned integer components +typedef struct _XMU555 +{ + union + { + struct + { + USHORT x : 5; + USHORT y : 5; + USHORT z : 5; + USHORT w : 1; + }; + USHORT v; + }; + +#ifdef __cplusplus + + _XMU555() {}; + _XMU555(USHORT Packed) : v(Packed) {}; + _XMU555(CHAR _x, CHAR _y, CHAR _z, BOOL _w) : x(_x), y(_y), z(_z), w(_w ? 0x1 : 0) {}; + _XMU555(CONST CHAR *pArray, BOOL _w); + _XMU555(FLOAT _x, FLOAT _y, FLOAT _z, BOOL _w); + _XMU555(CONST FLOAT *pArray, BOOL _w); + + operator USHORT () { return v; } + + _XMU555& operator= (CONST _XMU555& U555); + _XMU555& operator= (CONST USHORT Packed); + +#endif // __cplusplus + +} XMU555; + +// 3x3 Matrix: 32 bit floating point components +typedef struct _XMFLOAT3X3 +{ + union + { + struct + { + FLOAT _11, _12, _13; + FLOAT _21, _22, _23; + FLOAT _31, _32, _33; + }; + FLOAT m[3][3]; + }; + +#ifdef __cplusplus + + _XMFLOAT3X3() {}; + _XMFLOAT3X3(FLOAT m00, FLOAT m01, FLOAT m02, + FLOAT m10, FLOAT m11, FLOAT m12, + FLOAT m20, FLOAT m21, FLOAT m22); + _XMFLOAT3X3(CONST FLOAT *pArray); + + FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; } + FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; } + + _XMFLOAT3X3& operator= (CONST _XMFLOAT3X3& Float3x3); + +#endif // __cplusplus + +} XMFLOAT3X3; + +// 4x3 Matrix: 32 bit floating point components +typedef struct _XMFLOAT4X3 +{ + union + { + struct + { + FLOAT _11, _12, _13; + FLOAT _21, _22, _23; + FLOAT _31, _32, _33; + FLOAT _41, _42, _43; + }; + FLOAT m[4][3]; + }; + +#ifdef __cplusplus + + _XMFLOAT4X3() {}; + _XMFLOAT4X3(FLOAT m00, FLOAT m01, FLOAT m02, + FLOAT m10, FLOAT m11, FLOAT m12, + FLOAT m20, FLOAT m21, FLOAT m22, + FLOAT m30, FLOAT m31, FLOAT m32); + _XMFLOAT4X3(CONST FLOAT *pArray); + + FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; } + FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; } + + _XMFLOAT4X3& operator= (CONST _XMFLOAT4X3& Float4x3); + +#endif // __cplusplus + +} XMFLOAT4X3; + +// 4x3 Matrix: 32 bit floating point components aligned on a 16 byte boundary +typedef __declspec(align(16)) XMFLOAT4X3 XMFLOAT4X3A; + +// 4x4 Matrix: 32 bit floating point components +typedef struct _XMFLOAT4X4 +{ + union + { + struct + { + FLOAT _11, _12, _13, _14; + FLOAT _21, _22, _23, _24; + FLOAT _31, _32, _33, _34; + FLOAT _41, _42, _43, _44; + }; + FLOAT m[4][4]; + }; + +#ifdef __cplusplus + + _XMFLOAT4X4() {}; + _XMFLOAT4X4(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03, + FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13, + FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23, + FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33); + _XMFLOAT4X4(CONST FLOAT *pArray); + + FLOAT operator() (UINT Row, UINT Column) CONST { return m[Row][Column]; } + FLOAT& operator() (UINT Row, UINT Column) { return m[Row][Column]; } + + _XMFLOAT4X4& operator= (CONST _XMFLOAT4X4& Float4x4); + +#endif // __cplusplus + +} XMFLOAT4X4; + +// 4x4 Matrix: 32 bit floating point components aligned on a 16 byte boundary +typedef __declspec(align(16)) XMFLOAT4X4 XMFLOAT4X4A; + +#if !defined(_XM_X86_) && !defined(_XM_X64_) +#pragma bitfield_order(pop) +#endif // !_XM_X86_ && !_XM_X64_ + +#pragma warning(pop) + +/**************************************************************************** + * + * Data conversion operations + * + ****************************************************************************/ + +#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_) +#else +XMVECTOR XMConvertVectorIntToFloat(FXMVECTOR VInt, UINT DivExponent); +XMVECTOR XMConvertVectorFloatToInt(FXMVECTOR VFloat, UINT MulExponent); +XMVECTOR XMConvertVectorUIntToFloat(FXMVECTOR VUInt, UINT DivExponent); +XMVECTOR XMConvertVectorFloatToUInt(FXMVECTOR VFloat, UINT MulExponent); +#endif + +FLOAT XMConvertHalfToFloat(HALF Value); +FLOAT* XMConvertHalfToFloatStream(__out_bcount(sizeof(FLOAT)+OutputStride*(HalfCount-1)) FLOAT* pOutputStream, + __in UINT OutputStride, + __in_bcount(sizeof(HALF)+InputStride*(HalfCount-1)) CONST HALF* pInputStream, + __in UINT InputStride, __in UINT HalfCount); +HALF XMConvertFloatToHalf(FLOAT Value); +HALF* XMConvertFloatToHalfStream(__out_bcount(sizeof(HALF)+OutputStride*(FloatCount-1)) HALF* pOutputStream, + __in UINT OutputStride, + __in_bcount(sizeof(FLOAT)+InputStride*(FloatCount-1)) CONST FLOAT* pInputStream, + __in UINT InputStride, __in UINT FloatCount); + +#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_) +#else +XMVECTOR XMVectorSetBinaryConstant(UINT C0, UINT C1, UINT C2, UINT C3); +XMVECTOR XMVectorSplatConstant(INT IntConstant, UINT DivExponent); +XMVECTOR XMVectorSplatConstantInt(INT IntConstant); +#endif + +/**************************************************************************** + * + * Load operations + * + ****************************************************************************/ + +XMVECTOR XMLoadInt(__in CONST UINT* pSource); +XMVECTOR XMLoadFloat(__in CONST FLOAT* pSource); + +XMVECTOR XMLoadInt2(__in_ecount(2) CONST UINT* pSource); +XMVECTOR XMLoadInt2A(__in_ecount(2) CONST UINT* PSource); +XMVECTOR XMLoadFloat2(__in CONST XMFLOAT2* pSource); +XMVECTOR XMLoadFloat2A(__in CONST XMFLOAT2A* pSource); +XMVECTOR XMLoadHalf2(__in CONST XMHALF2* pSource); +XMVECTOR XMLoadShortN2(__in CONST XMSHORTN2* pSource); +XMVECTOR XMLoadShort2(__in CONST XMSHORT2* pSource); +XMVECTOR XMLoadUShortN2(__in CONST XMUSHORTN2* pSource); +XMVECTOR XMLoadUShort2(__in CONST XMUSHORT2* pSource); + +XMVECTOR XMLoadInt3(__in_ecount(3) CONST UINT* pSource); +XMVECTOR XMLoadInt3A(__in_ecount(3) CONST UINT* pSource); +XMVECTOR XMLoadFloat3(__in CONST XMFLOAT3* pSource); +XMVECTOR XMLoadFloat3A(__in CONST XMFLOAT3A* pSource); +XMVECTOR XMLoadHenDN3(__in CONST XMHENDN3* pSource); +XMVECTOR XMLoadHenD3(__in CONST XMHEND3* pSource); +XMVECTOR XMLoadUHenDN3(__in CONST XMUHENDN3* pSource); +XMVECTOR XMLoadUHenD3(__in CONST XMUHEND3* pSource); +XMVECTOR XMLoadDHenN3(__in CONST XMDHENN3* pSource); +XMVECTOR XMLoadDHen3(__in CONST XMDHEN3* pSource); +XMVECTOR XMLoadUDHenN3(__in CONST XMUDHENN3* pSource); +XMVECTOR XMLoadUDHen3(__in CONST XMUDHEN3* pSource); +XMVECTOR XMLoadU565(__in CONST XMU565* pSource); +XMVECTOR XMLoadFloat3PK(__in CONST XMFLOAT3PK* pSource); +XMVECTOR XMLoadFloat3SE(__in CONST XMFLOAT3SE* pSource); + +XMVECTOR XMLoadInt4(__in_ecount(4) CONST UINT* pSource); +XMVECTOR XMLoadInt4A(__in_ecount(4) CONST UINT* pSource); +XMVECTOR XMLoadFloat4(__in CONST XMFLOAT4* pSource); +XMVECTOR XMLoadFloat4A(__in CONST XMFLOAT4A* pSource); +XMVECTOR XMLoadHalf4(__in CONST XMHALF4* pSource); +XMVECTOR XMLoadShortN4(__in CONST XMSHORTN4* pSource); +XMVECTOR XMLoadShort4(__in CONST XMSHORT4* pSource); +XMVECTOR XMLoadUShortN4(__in CONST XMUSHORTN4* pSource); +XMVECTOR XMLoadUShort4(__in CONST XMUSHORT4* pSource); +XMVECTOR XMLoadXIcoN4(__in CONST XMXICON4* pSource); +XMVECTOR XMLoadXIco4(__in CONST XMXICO4* pSource); +XMVECTOR XMLoadIcoN4(__in CONST XMICON4* pSource); +XMVECTOR XMLoadIco4(__in CONST XMICO4* pSource); +XMVECTOR XMLoadUIcoN4(__in CONST XMUICON4* pSource); +XMVECTOR XMLoadUIco4(__in CONST XMUICO4* pSource); +XMVECTOR XMLoadXDecN4(__in CONST XMXDECN4* pSource); +XMVECTOR XMLoadXDec4(__in CONST XMXDEC4* pSource); +XMVECTOR XMLoadDecN4(__in CONST XMDECN4* pSource); +XMVECTOR XMLoadDec4(__in CONST XMDEC4* pSource); +XMVECTOR XMLoadUDecN4(__in CONST XMUDECN4* pSource); +XMVECTOR XMLoadUDec4(__in CONST XMUDEC4* pSource); +XMVECTOR XMLoadByteN4(__in CONST XMBYTEN4* pSource); +XMVECTOR XMLoadByte4(__in CONST XMBYTE4* pSource); +XMVECTOR XMLoadUByteN4(__in CONST XMUBYTEN4* pSource); +XMVECTOR XMLoadUByte4(__in CONST XMUBYTE4* pSource); +XMVECTOR XMLoadUNibble4(__in CONST XMUNIBBLE4* pSource); +XMVECTOR XMLoadU555(__in CONST XMU555* pSource); +XMVECTOR XMLoadColor(__in CONST XMCOLOR* pSource); + +XMMATRIX XMLoadFloat3x3(__in CONST XMFLOAT3X3* pSource); +XMMATRIX XMLoadFloat4x3(__in CONST XMFLOAT4X3* pSource); +XMMATRIX XMLoadFloat4x3A(__in CONST XMFLOAT4X3A* pSource); +XMMATRIX XMLoadFloat4x4(__in CONST XMFLOAT4X4* pSource); +XMMATRIX XMLoadFloat4x4A(__in CONST XMFLOAT4X4A* pSource); + +/**************************************************************************** + * + * Store operations + * + ****************************************************************************/ + +VOID XMStoreInt(__out UINT* pDestination, FXMVECTOR V); +VOID XMStoreFloat(__out FLOAT* pDestination, FXMVECTOR V); + +VOID XMStoreInt2(__out_ecount(2) UINT* pDestination, FXMVECTOR V); +VOID XMStoreInt2A(__out_ecount(2) UINT* pDestination, FXMVECTOR V); +VOID XMStoreFloat2(__out XMFLOAT2* pDestination, FXMVECTOR V); +VOID XMStoreFloat2A(__out XMFLOAT2A* pDestination, FXMVECTOR V); +VOID XMStoreHalf2(__out XMHALF2* pDestination, FXMVECTOR V); +VOID XMStoreShortN2(__out XMSHORTN2* pDestination, FXMVECTOR V); +VOID XMStoreShort2(__out XMSHORT2* pDestination, FXMVECTOR V); +VOID XMStoreUShortN2(__out XMUSHORTN2* pDestination, FXMVECTOR V); +VOID XMStoreUShort2(__out XMUSHORT2* pDestination, FXMVECTOR V); + +VOID XMStoreInt3(__out_ecount(3) UINT* pDestination, FXMVECTOR V); +VOID XMStoreInt3A(__out_ecount(3) UINT* pDestination, FXMVECTOR V); +VOID XMStoreFloat3(__out XMFLOAT3* pDestination, FXMVECTOR V); +VOID XMStoreFloat3A(__out XMFLOAT3A* pDestination, FXMVECTOR V); +VOID XMStoreHenDN3(__out XMHENDN3* pDestination, FXMVECTOR V); +VOID XMStoreHenD3(__out XMHEND3* pDestination, FXMVECTOR V); +VOID XMStoreUHenDN3(__out XMUHENDN3* pDestination, FXMVECTOR V); +VOID XMStoreUHenD3(__out XMUHEND3* pDestination, FXMVECTOR V); +VOID XMStoreDHenN3(__out XMDHENN3* pDestination, FXMVECTOR V); +VOID XMStoreDHen3(__out XMDHEN3* pDestination, FXMVECTOR V); +VOID XMStoreUDHenN3(__out XMUDHENN3* pDestination, FXMVECTOR V); +VOID XMStoreUDHen3(__out XMUDHEN3* pDestination, FXMVECTOR V); +VOID XMStoreU565(__out XMU565* pDestination, FXMVECTOR V); +VOID XMStoreFloat3PK(__out XMFLOAT3PK* pDestination, FXMVECTOR V); +VOID XMStoreFloat3SE(__out XMFLOAT3SE* pDestination, FXMVECTOR V); + +VOID XMStoreInt4(__out_ecount(4) UINT* pDestination, FXMVECTOR V); +VOID XMStoreInt4A(__out_ecount(4) UINT* pDestination, FXMVECTOR V); +VOID XMStoreInt4NC(__out UINT* pDestination, FXMVECTOR V); +VOID XMStoreFloat4(__out XMFLOAT4* pDestination, FXMVECTOR V); +VOID XMStoreFloat4A(__out XMFLOAT4A* pDestination, FXMVECTOR V); +VOID XMStoreFloat4NC(__out XMFLOAT4* pDestination, FXMVECTOR V); +VOID XMStoreHalf4(__out XMHALF4* pDestination, FXMVECTOR V); +VOID XMStoreShortN4(__out XMSHORTN4* pDestination, FXMVECTOR V); +VOID XMStoreShort4(__out XMSHORT4* pDestination, FXMVECTOR V); +VOID XMStoreUShortN4(__out XMUSHORTN4* pDestination, FXMVECTOR V); +VOID XMStoreUShort4(__out XMUSHORT4* pDestination, FXMVECTOR V); +VOID XMStoreXIcoN4(__out XMXICON4* pDestination, FXMVECTOR V); +VOID XMStoreXIco4(__out XMXICO4* pDestination, FXMVECTOR V); +VOID XMStoreIcoN4(__out XMICON4* pDestination, FXMVECTOR V); +VOID XMStoreIco4(__out XMICO4* pDestination, FXMVECTOR V); +VOID XMStoreUIcoN4(__out XMUICON4* pDestination, FXMVECTOR V); +VOID XMStoreUIco4(__out XMUICO4* pDestination, FXMVECTOR V); +VOID XMStoreXDecN4(__out XMXDECN4* pDestination, FXMVECTOR V); +VOID XMStoreXDec4(__out XMXDEC4* pDestination, FXMVECTOR V); +VOID XMStoreDecN4(__out XMDECN4* pDestination, FXMVECTOR V); +VOID XMStoreDec4(__out XMDEC4* pDestination, FXMVECTOR V); +VOID XMStoreUDecN4(__out XMUDECN4* pDestination, FXMVECTOR V); +VOID XMStoreUDec4(__out XMUDEC4* pDestination, FXMVECTOR V); +VOID XMStoreByteN4(__out XMBYTEN4* pDestination, FXMVECTOR V); +VOID XMStoreByte4(__out XMBYTE4* pDestination, FXMVECTOR V); +VOID XMStoreUByteN4(__out XMUBYTEN4* pDestination, FXMVECTOR V); +VOID XMStoreUByte4(__out XMUBYTE4* pDestination, FXMVECTOR V); +VOID XMStoreUNibble4(__out XMUNIBBLE4* pDestination, FXMVECTOR V); +VOID XMStoreU555(__out XMU555* pDestination, FXMVECTOR V); +VOID XMStoreColor(__out XMCOLOR* pDestination, FXMVECTOR V); + +VOID XMStoreFloat3x3(__out XMFLOAT3X3* pDestination, CXMMATRIX M); +VOID XMStoreFloat3x3NC(__out XMFLOAT3X3* pDestination, CXMMATRIX M); +VOID XMStoreFloat4x3(__out XMFLOAT4X3* pDestination, CXMMATRIX M); +VOID XMStoreFloat4x3A(__out XMFLOAT4X3A* pDestination, CXMMATRIX M); +VOID XMStoreFloat4x3NC(__out XMFLOAT4X3* pDestination, CXMMATRIX M); +VOID XMStoreFloat4x4(__out XMFLOAT4X4* pDestination, CXMMATRIX M); +VOID XMStoreFloat4x4A(__out XMFLOAT4X4A* pDestination, CXMMATRIX M); +VOID XMStoreFloat4x4NC(__out XMFLOAT4X4* pDestination, CXMMATRIX M); + +/**************************************************************************** + * + * General vector operations + * + ****************************************************************************/ + +XMVECTOR XMVectorZero(); +XMVECTOR XMVectorSet(FLOAT x, FLOAT y, FLOAT z, FLOAT w); +XMVECTOR XMVectorSetInt(UINT x, UINT y, UINT z, UINT w); +XMVECTOR XMVectorReplicate(FLOAT Value); +XMVECTOR XMVectorReplicatePtr(__in CONST FLOAT *pValue); +XMVECTOR XMVectorReplicateInt(UINT Value); +XMVECTOR XMVectorReplicateIntPtr(__in CONST UINT *pValue); +XMVECTOR XMVectorTrueInt(); +XMVECTOR XMVectorFalseInt(); +XMVECTOR XMVectorSplatX(FXMVECTOR V); +XMVECTOR XMVectorSplatY(FXMVECTOR V); +XMVECTOR XMVectorSplatZ(FXMVECTOR V); +XMVECTOR XMVectorSplatW(FXMVECTOR V); +XMVECTOR XMVectorSplatOne(); +XMVECTOR XMVectorSplatInfinity(); +XMVECTOR XMVectorSplatQNaN(); +XMVECTOR XMVectorSplatEpsilon(); +XMVECTOR XMVectorSplatSignMask(); + +FLOAT XMVectorGetByIndex(FXMVECTOR V,UINT i); +FLOAT XMVectorGetX(FXMVECTOR V); +FLOAT XMVectorGetY(FXMVECTOR V); +FLOAT XMVectorGetZ(FXMVECTOR V); +FLOAT XMVectorGetW(FXMVECTOR V); + +VOID XMVectorGetByIndexPtr(__out FLOAT *f, FXMVECTOR V, UINT i); +VOID XMVectorGetXPtr(__out FLOAT *x, FXMVECTOR V); +VOID XMVectorGetYPtr(__out FLOAT *y, FXMVECTOR V); +VOID XMVectorGetZPtr(__out FLOAT *z, FXMVECTOR V); +VOID XMVectorGetWPtr(__out FLOAT *w, FXMVECTOR V); + +UINT XMVectorGetIntByIndex(FXMVECTOR V,UINT i); +UINT XMVectorGetIntX(FXMVECTOR V); +UINT XMVectorGetIntY(FXMVECTOR V); +UINT XMVectorGetIntZ(FXMVECTOR V); +UINT XMVectorGetIntW(FXMVECTOR V); + +VOID XMVectorGetIntByIndexPtr(__out UINT *x,FXMVECTOR V, UINT i); +VOID XMVectorGetIntXPtr(__out UINT *x, FXMVECTOR V); +VOID XMVectorGetIntYPtr(__out UINT *y, FXMVECTOR V); +VOID XMVectorGetIntZPtr(__out UINT *z, FXMVECTOR V); +VOID XMVectorGetIntWPtr(__out UINT *w, FXMVECTOR V); + +XMVECTOR XMVectorSetByIndex(FXMVECTOR V,FLOAT f,UINT i); +XMVECTOR XMVectorSetX(FXMVECTOR V, FLOAT x); +XMVECTOR XMVectorSetY(FXMVECTOR V, FLOAT y); +XMVECTOR XMVectorSetZ(FXMVECTOR V, FLOAT z); +XMVECTOR XMVectorSetW(FXMVECTOR V, FLOAT w); + +XMVECTOR XMVectorSetByIndexPtr(FXMVECTOR V, __in CONST FLOAT *f, UINT i); +XMVECTOR XMVectorSetXPtr(FXMVECTOR V, __in CONST FLOAT *x); +XMVECTOR XMVectorSetYPtr(FXMVECTOR V, __in CONST FLOAT *y); +XMVECTOR XMVectorSetZPtr(FXMVECTOR V, __in CONST FLOAT *z); +XMVECTOR XMVectorSetWPtr(FXMVECTOR V, __in CONST FLOAT *w); + +XMVECTOR XMVectorSetIntByIndex(FXMVECTOR V, UINT x,UINT i); +XMVECTOR XMVectorSetIntX(FXMVECTOR V, UINT x); +XMVECTOR XMVectorSetIntY(FXMVECTOR V, UINT y); +XMVECTOR XMVectorSetIntZ(FXMVECTOR V, UINT z); +XMVECTOR XMVectorSetIntW(FXMVECTOR V, UINT w); + +XMVECTOR XMVectorSetIntByIndexPtr(FXMVECTOR V, __in CONST UINT *x, UINT i); +XMVECTOR XMVectorSetIntXPtr(FXMVECTOR V, __in CONST UINT *x); +XMVECTOR XMVectorSetIntYPtr(FXMVECTOR V, __in CONST UINT *y); +XMVECTOR XMVectorSetIntZPtr(FXMVECTOR V, __in CONST UINT *z); +XMVECTOR XMVectorSetIntWPtr(FXMVECTOR V, __in CONST UINT *w); + +XMVECTOR XMVectorPermuteControl(UINT ElementIndex0, UINT ElementIndex1, UINT ElementIndex2, UINT ElementIndex3); +XMVECTOR XMVectorPermute(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Control); +XMVECTOR XMVectorSelectControl(UINT VectorIndex0, UINT VectorIndex1, UINT VectorIndex2, UINT VectorIndex3); +XMVECTOR XMVectorSelect(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Control); +XMVECTOR XMVectorMergeXY(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorMergeZW(FXMVECTOR V1, FXMVECTOR V2); + +#if !defined(_XM_NO_INTRINSICS_) && defined(_XM_VMX128_INTRINSICS_) +#else +XMVECTOR XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, UINT Elements); +XMVECTOR XMVectorRotateLeft(FXMVECTOR V, UINT Elements); +XMVECTOR XMVectorRotateRight(FXMVECTOR V, UINT Elements); +XMVECTOR XMVectorSwizzle(FXMVECTOR V, UINT E0, UINT E1, UINT E2, UINT E3); +XMVECTOR XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS, UINT VSLeftRotateElements, + UINT Select0, UINT Select1, UINT Select2, UINT Select3); +#endif + +XMVECTOR XMVectorEqual(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorEqualR(__out UINT* pCR, FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorEqualInt(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorEqualIntR(__out UINT* pCR, FXMVECTOR V, FXMVECTOR V2); +XMVECTOR XMVectorNearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon); +XMVECTOR XMVectorNotEqual(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorNotEqualInt(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorGreater(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorGreaterR(__out UINT* pCR, FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorGreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorGreaterOrEqualR(__out UINT* pCR, FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorLess(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorLessOrEqual(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorInBounds(FXMVECTOR V, FXMVECTOR Bounds); +XMVECTOR XMVectorInBoundsR(__out UINT* pCR, FXMVECTOR V, FXMVECTOR Bounds); + +XMVECTOR XMVectorIsNaN(FXMVECTOR V); +XMVECTOR XMVectorIsInfinite(FXMVECTOR V); + +XMVECTOR XMVectorMin(FXMVECTOR V1,FXMVECTOR V2); +XMVECTOR XMVectorMax(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorRound(FXMVECTOR V); +XMVECTOR XMVectorTruncate(FXMVECTOR V); +XMVECTOR XMVectorFloor(FXMVECTOR V); +XMVECTOR XMVectorCeiling(FXMVECTOR V); +XMVECTOR XMVectorClamp(FXMVECTOR V, FXMVECTOR Min, FXMVECTOR Max); +XMVECTOR XMVectorSaturate(FXMVECTOR V); + +XMVECTOR XMVectorAndInt(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorAndCInt(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorOrInt(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorNorInt(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorXorInt(FXMVECTOR V1, FXMVECTOR V2); + +XMVECTOR XMVectorNegate(FXMVECTOR V); +XMVECTOR XMVectorAdd(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorAddAngles(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorSubtract(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorSubtractAngles(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorMultiply(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorMultiplyAdd(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3); +XMVECTOR XMVectorNegativeMultiplySubtract(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3); +XMVECTOR XMVectorScale(FXMVECTOR V, FLOAT ScaleFactor); +XMVECTOR XMVectorReciprocalEst(FXMVECTOR V); +XMVECTOR XMVectorReciprocal(FXMVECTOR V); +XMVECTOR XMVectorSqrtEst(FXMVECTOR V); +XMVECTOR XMVectorSqrt(FXMVECTOR V); +XMVECTOR XMVectorReciprocalSqrtEst(FXMVECTOR V); +XMVECTOR XMVectorReciprocalSqrt(FXMVECTOR V); +XMVECTOR XMVectorExpEst(FXMVECTOR V); +XMVECTOR XMVectorExp(FXMVECTOR V); +XMVECTOR XMVectorLogEst(FXMVECTOR V); +XMVECTOR XMVectorLog(FXMVECTOR V); +XMVECTOR XMVectorPowEst(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorPow(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorAbs(FXMVECTOR V); +XMVECTOR XMVectorMod(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVectorModAngles(FXMVECTOR Angles); +XMVECTOR XMVectorSin(FXMVECTOR V); +XMVECTOR XMVectorSinEst(FXMVECTOR V); +XMVECTOR XMVectorCos(FXMVECTOR V); +XMVECTOR XMVectorCosEst(FXMVECTOR V); +VOID XMVectorSinCos(__out XMVECTOR* pSin, __out XMVECTOR* pCos, FXMVECTOR V); +VOID XMVectorSinCosEst(__out XMVECTOR* pSin, __out XMVECTOR* pCos, FXMVECTOR V); +XMVECTOR XMVectorTan(FXMVECTOR V); +XMVECTOR XMVectorTanEst(FXMVECTOR V); +XMVECTOR XMVectorSinH(FXMVECTOR V); +XMVECTOR XMVectorSinHEst(FXMVECTOR V); +XMVECTOR XMVectorCosH(FXMVECTOR V); +XMVECTOR XMVectorCosHEst(FXMVECTOR V); +XMVECTOR XMVectorTanH(FXMVECTOR V); +XMVECTOR XMVectorTanHEst(FXMVECTOR V); +XMVECTOR XMVectorASin(FXMVECTOR V); +XMVECTOR XMVectorASinEst(FXMVECTOR V); +XMVECTOR XMVectorACos(FXMVECTOR V); +XMVECTOR XMVectorACosEst(FXMVECTOR V); +XMVECTOR XMVectorATan(FXMVECTOR V); +XMVECTOR XMVectorATanEst(FXMVECTOR V); +XMVECTOR XMVectorATan2(FXMVECTOR Y, FXMVECTOR X); +XMVECTOR XMVectorATan2Est(FXMVECTOR Y, FXMVECTOR X); +XMVECTOR XMVectorLerp(FXMVECTOR V0, FXMVECTOR V1, FLOAT t); +XMVECTOR XMVectorLerpV(FXMVECTOR V0, FXMVECTOR V1, FXMVECTOR T); +XMVECTOR XMVectorHermite(FXMVECTOR Position0, FXMVECTOR Tangent0, FXMVECTOR Position1, CXMVECTOR Tangent1, FLOAT t); +XMVECTOR XMVectorHermiteV(FXMVECTOR Position0, FXMVECTOR Tangent0, FXMVECTOR Position1, CXMVECTOR Tangent1, CXMVECTOR T); +XMVECTOR XMVectorCatmullRom(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, CXMVECTOR Position3, FLOAT t); +XMVECTOR XMVectorCatmullRomV(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, CXMVECTOR Position3, CXMVECTOR T); +XMVECTOR XMVectorBaryCentric(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, FLOAT f, FLOAT g); +XMVECTOR XMVectorBaryCentricV(FXMVECTOR Position0, FXMVECTOR Position1, FXMVECTOR Position2, CXMVECTOR F, CXMVECTOR G); + +/**************************************************************************** + * + * 2D vector operations + * + ****************************************************************************/ + + +BOOL XMVector2Equal(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector2EqualR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2EqualInt(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector2EqualIntR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon); +BOOL XMVector2NotEqual(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2NotEqualInt(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2Greater(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector2GreaterR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector2GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2Less(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2LessOrEqual(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector2InBounds(FXMVECTOR V, FXMVECTOR Bounds); +UINT XMVector2InBoundsR(FXMVECTOR V, FXMVECTOR Bounds); + +BOOL XMVector2IsNaN(FXMVECTOR V); +BOOL XMVector2IsInfinite(FXMVECTOR V); + +XMVECTOR XMVector2Dot(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector2Cross(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector2LengthSq(FXMVECTOR V); +XMVECTOR XMVector2ReciprocalLengthEst(FXMVECTOR V); +XMVECTOR XMVector2ReciprocalLength(FXMVECTOR V); +XMVECTOR XMVector2LengthEst(FXMVECTOR V); +XMVECTOR XMVector2Length(FXMVECTOR V); +XMVECTOR XMVector2NormalizeEst(FXMVECTOR V); +XMVECTOR XMVector2Normalize(FXMVECTOR V); +XMVECTOR XMVector2ClampLength(FXMVECTOR V, FLOAT LengthMin, FLOAT LengthMax); +XMVECTOR XMVector2ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax); +XMVECTOR XMVector2Reflect(FXMVECTOR Incident, FXMVECTOR Normal); +XMVECTOR XMVector2Refract(FXMVECTOR Incident, FXMVECTOR Normal, FLOAT RefractionIndex); +XMVECTOR XMVector2RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex); +XMVECTOR XMVector2Orthogonal(FXMVECTOR V); +XMVECTOR XMVector2AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2); +XMVECTOR XMVector2AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2); +XMVECTOR XMVector2AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector2LinePointDistance(FXMVECTOR LinePoint1, FXMVECTOR LinePoint2, FXMVECTOR Point); +XMVECTOR XMVector2IntersectLine(FXMVECTOR Line1Point1, FXMVECTOR Line1Point2, FXMVECTOR Line2Point1, CXMVECTOR Line2Point2); +XMVECTOR XMVector2Transform(FXMVECTOR V, CXMMATRIX M); +XMFLOAT4* XMVector2TransformStream(__out_bcount(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream, + __in UINT OutputStride, + __in_bcount(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream, + __in UINT InputStride, __in UINT VectorCount, CXMMATRIX M); +XMFLOAT4* XMVector2TransformStreamNC(__out_bcount(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream, + __in UINT OutputStride, + __in_bcount(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream, + __in UINT InputStride, __in UINT VectorCount, CXMMATRIX M); +XMVECTOR XMVector2TransformCoord(FXMVECTOR V, CXMMATRIX M); +XMFLOAT2* XMVector2TransformCoordStream(__out_bcount(sizeof(XMFLOAT2)+OutputStride*(VectorCount-1)) XMFLOAT2* pOutputStream, + __in UINT OutputStride, + __in_bcount(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream, + __in UINT InputStride, __in UINT VectorCount, CXMMATRIX M); +XMVECTOR XMVector2TransformNormal(FXMVECTOR V, CXMMATRIX M); +XMFLOAT2* XMVector2TransformNormalStream(__out_bcount(sizeof(XMFLOAT2)+OutputStride*(VectorCount-1)) XMFLOAT2* pOutputStream, + __in UINT OutputStride, + __in_bcount(sizeof(XMFLOAT2)+InputStride*(VectorCount-1)) CONST XMFLOAT2* pInputStream, + __in UINT InputStride, __in UINT VectorCount, CXMMATRIX M); + +/**************************************************************************** + * + * 3D vector operations + * + ****************************************************************************/ + + +BOOL XMVector3Equal(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector3EqualR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3EqualInt(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector3EqualIntR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon); +BOOL XMVector3NotEqual(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3NotEqualInt(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3Greater(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector3GreaterR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector3GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3Less(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3LessOrEqual(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector3InBounds(FXMVECTOR V, FXMVECTOR Bounds); +UINT XMVector3InBoundsR(FXMVECTOR V, FXMVECTOR Bounds); + +BOOL XMVector3IsNaN(FXMVECTOR V); +BOOL XMVector3IsInfinite(FXMVECTOR V); + +XMVECTOR XMVector3Dot(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector3Cross(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector3LengthSq(FXMVECTOR V); +XMVECTOR XMVector3ReciprocalLengthEst(FXMVECTOR V); +XMVECTOR XMVector3ReciprocalLength(FXMVECTOR V); +XMVECTOR XMVector3LengthEst(FXMVECTOR V); +XMVECTOR XMVector3Length(FXMVECTOR V); +XMVECTOR XMVector3NormalizeEst(FXMVECTOR V); +XMVECTOR XMVector3Normalize(FXMVECTOR V); +XMVECTOR XMVector3ClampLength(FXMVECTOR V, FLOAT LengthMin, FLOAT LengthMax); +XMVECTOR XMVector3ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax); +XMVECTOR XMVector3Reflect(FXMVECTOR Incident, FXMVECTOR Normal); +XMVECTOR XMVector3Refract(FXMVECTOR Incident, FXMVECTOR Normal, FLOAT RefractionIndex); +XMVECTOR XMVector3RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex); +XMVECTOR XMVector3Orthogonal(FXMVECTOR V); +XMVECTOR XMVector3AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2); +XMVECTOR XMVector3AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2); +XMVECTOR XMVector3AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector3LinePointDistance(FXMVECTOR LinePoint1, FXMVECTOR LinePoint2, FXMVECTOR Point); +VOID XMVector3ComponentsFromNormal(__out XMVECTOR* pParallel, __out XMVECTOR* pPerpendicular, FXMVECTOR V, FXMVECTOR Normal); +XMVECTOR XMVector3Rotate(FXMVECTOR V, FXMVECTOR RotationQuaternion); +XMVECTOR XMVector3InverseRotate(FXMVECTOR V, FXMVECTOR RotationQuaternion); +XMVECTOR XMVector3Transform(FXMVECTOR V, CXMMATRIX M); +XMFLOAT4* XMVector3TransformStream(__out_bcount(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream, + __in UINT OutputStride, + __in_bcount(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream, + __in UINT InputStride, __in UINT VectorCount, CXMMATRIX M); +XMFLOAT4* XMVector3TransformStreamNC(__out_bcount(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream, + __in UINT OutputStride, + __in_bcount(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream, + __in UINT InputStride, __in UINT VectorCount, CXMMATRIX M); +XMVECTOR XMVector3TransformCoord(FXMVECTOR V, CXMMATRIX M); +XMFLOAT3* XMVector3TransformCoordStream(__out_bcount(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream, + __in UINT OutputStride, + __in_bcount(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream, + __in UINT InputStride, __in UINT VectorCount, CXMMATRIX M); +XMVECTOR XMVector3TransformNormal(FXMVECTOR V, CXMMATRIX M); +XMFLOAT3* XMVector3TransformNormalStream(__out_bcount(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream, + __in UINT OutputStride, + __in_bcount(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream, + __in UINT InputStride, __in UINT VectorCount, CXMMATRIX M); +XMVECTOR XMVector3Project(FXMVECTOR V, FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ, + CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World); +XMFLOAT3* XMVector3ProjectStream(__out_bcount(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream, + __in UINT OutputStride, + __in_bcount(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream, + __in UINT InputStride, __in UINT VectorCount, + FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ, + CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World); +XMVECTOR XMVector3Unproject(FXMVECTOR V, FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ, + CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World); +XMFLOAT3* XMVector3UnprojectStream(__out_bcount(sizeof(XMFLOAT3)+OutputStride*(VectorCount-1)) XMFLOAT3* pOutputStream, + __in UINT OutputStride, + __in_bcount(sizeof(XMFLOAT3)+InputStride*(VectorCount-1)) CONST XMFLOAT3* pInputStream, + __in UINT InputStride, __in UINT VectorCount, + FLOAT ViewportX, FLOAT ViewportY, FLOAT ViewportWidth, FLOAT ViewportHeight, FLOAT ViewportMinZ, FLOAT ViewportMaxZ, + CXMMATRIX Projection, CXMMATRIX View, CXMMATRIX World); + +/**************************************************************************** + * + * 4D vector operations + * + ****************************************************************************/ + +BOOL XMVector4Equal(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector4EqualR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4EqualInt(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector4EqualIntR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4NearEqual(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR Epsilon); +BOOL XMVector4NotEqual(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4NotEqualInt(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4Greater(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector4GreaterR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4GreaterOrEqual(FXMVECTOR V1, FXMVECTOR V2); +UINT XMVector4GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4Less(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4LessOrEqual(FXMVECTOR V1, FXMVECTOR V2); +BOOL XMVector4InBounds(FXMVECTOR V, FXMVECTOR Bounds); +UINT XMVector4InBoundsR(FXMVECTOR V, FXMVECTOR Bounds); + +BOOL XMVector4IsNaN(FXMVECTOR V); +BOOL XMVector4IsInfinite(FXMVECTOR V); + +XMVECTOR XMVector4Dot(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector4Cross(FXMVECTOR V1, FXMVECTOR V2, FXMVECTOR V3); +XMVECTOR XMVector4LengthSq(FXMVECTOR V); +XMVECTOR XMVector4ReciprocalLengthEst(FXMVECTOR V); +XMVECTOR XMVector4ReciprocalLength(FXMVECTOR V); +XMVECTOR XMVector4LengthEst(FXMVECTOR V); +XMVECTOR XMVector4Length(FXMVECTOR V); +XMVECTOR XMVector4NormalizeEst(FXMVECTOR V); +XMVECTOR XMVector4Normalize(FXMVECTOR V); +XMVECTOR XMVector4ClampLength(FXMVECTOR V, FLOAT LengthMin, FLOAT LengthMax); +XMVECTOR XMVector4ClampLengthV(FXMVECTOR V, FXMVECTOR LengthMin, FXMVECTOR LengthMax); +XMVECTOR XMVector4Reflect(FXMVECTOR Incident, FXMVECTOR Normal); +XMVECTOR XMVector4Refract(FXMVECTOR Incident, FXMVECTOR Normal, FLOAT RefractionIndex); +XMVECTOR XMVector4RefractV(FXMVECTOR Incident, FXMVECTOR Normal, FXMVECTOR RefractionIndex); +XMVECTOR XMVector4Orthogonal(FXMVECTOR V); +XMVECTOR XMVector4AngleBetweenNormalsEst(FXMVECTOR N1, FXMVECTOR N2); +XMVECTOR XMVector4AngleBetweenNormals(FXMVECTOR N1, FXMVECTOR N2); +XMVECTOR XMVector4AngleBetweenVectors(FXMVECTOR V1, FXMVECTOR V2); +XMVECTOR XMVector4Transform(FXMVECTOR V, CXMMATRIX M); +XMFLOAT4* XMVector4TransformStream(__out_bcount(sizeof(XMFLOAT4)+OutputStride*(VectorCount-1)) XMFLOAT4* pOutputStream, + __in UINT OutputStride, + __in_bcount(sizeof(XMFLOAT4)+InputStride*(VectorCount-1)) CONST XMFLOAT4* pInputStream, + __in UINT InputStride, __in UINT VectorCount, CXMMATRIX M); + +/**************************************************************************** + * + * Matrix operations + * + ****************************************************************************/ + +BOOL XMMatrixIsNaN(CXMMATRIX M); +BOOL XMMatrixIsInfinite(CXMMATRIX M); +BOOL XMMatrixIsIdentity(CXMMATRIX M); + +XMMATRIX XMMatrixMultiply(CXMMATRIX M1, CXMMATRIX M2); +XMMATRIX XMMatrixMultiplyTranspose(CXMMATRIX M1, CXMMATRIX M2); +XMMATRIX XMMatrixTranspose(CXMMATRIX M); +XMMATRIX XMMatrixInverse(__out XMVECTOR* pDeterminant, CXMMATRIX M); +XMVECTOR XMMatrixDeterminant(CXMMATRIX M); +BOOL XMMatrixDecompose(__out XMVECTOR *outScale, __out XMVECTOR *outRotQuat, __out XMVECTOR *outTrans, CXMMATRIX M); + +XMMATRIX XMMatrixIdentity(); +XMMATRIX XMMatrixSet(FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03, + FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13, + FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23, + FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33); +XMMATRIX XMMatrixTranslation(FLOAT OffsetX, FLOAT OffsetY, FLOAT OffsetZ); +XMMATRIX XMMatrixTranslationFromVector(FXMVECTOR Offset); +XMMATRIX XMMatrixScaling(FLOAT ScaleX, FLOAT ScaleY, FLOAT ScaleZ); +XMMATRIX XMMatrixScalingFromVector(FXMVECTOR Scale); +XMMATRIX XMMatrixRotationX(FLOAT Angle); +XMMATRIX XMMatrixRotationY(FLOAT Angle); +XMMATRIX XMMatrixRotationZ(FLOAT Angle); +XMMATRIX XMMatrixRotationRollPitchYaw(FLOAT Pitch, FLOAT Yaw, FLOAT Roll); +XMMATRIX XMMatrixRotationRollPitchYawFromVector(FXMVECTOR Angles); +XMMATRIX XMMatrixRotationNormal(FXMVECTOR NormalAxis, FLOAT Angle); +XMMATRIX XMMatrixRotationAxis(FXMVECTOR Axis, FLOAT Angle); +XMMATRIX XMMatrixRotationQuaternion(FXMVECTOR Quaternion); +XMMATRIX XMMatrixTransformation2D(FXMVECTOR ScalingOrigin, FLOAT ScalingOrientation, FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, FLOAT Rotation, CXMVECTOR Translation); +XMMATRIX XMMatrixTransformation(FXMVECTOR ScalingOrigin, FXMVECTOR ScalingOrientationQuaternion, FXMVECTOR Scaling, + CXMVECTOR RotationOrigin, CXMVECTOR RotationQuaternion, CXMVECTOR Translation); +XMMATRIX XMMatrixAffineTransformation2D(FXMVECTOR Scaling, FXMVECTOR RotationOrigin, FLOAT Rotation, FXMVECTOR Translation); +XMMATRIX XMMatrixAffineTransformation(FXMVECTOR Scaling, FXMVECTOR RotationOrigin, FXMVECTOR RotationQuaternion, CXMVECTOR Translation); +XMMATRIX XMMatrixReflect(FXMVECTOR ReflectionPlane); +XMMATRIX XMMatrixShadow(FXMVECTOR ShadowPlane, FXMVECTOR LightPosition); + +XMMATRIX XMMatrixLookAtLH(FXMVECTOR EyePosition, FXMVECTOR FocusPosition, FXMVECTOR UpDirection); +XMMATRIX XMMatrixLookAtRH(FXMVECTOR EyePosition, FXMVECTOR FocusPosition, FXMVECTOR UpDirection); +XMMATRIX XMMatrixLookToLH(FXMVECTOR EyePosition, FXMVECTOR EyeDirection, FXMVECTOR UpDirection); +XMMATRIX XMMatrixLookToRH(FXMVECTOR EyePosition, FXMVECTOR EyeDirection, FXMVECTOR UpDirection); +XMMATRIX XMMatrixPerspectiveLH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixPerspectiveRH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixPerspectiveFovLH(FLOAT FovAngleY, FLOAT AspectHByW, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixPerspectiveFovRH(FLOAT FovAngleY, FLOAT AspectHByW, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixPerspectiveOffCenterLH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixPerspectiveOffCenterRH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixOrthographicLH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixOrthographicRH(FLOAT ViewWidth, FLOAT ViewHeight, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixOrthographicOffCenterLH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ); +XMMATRIX XMMatrixOrthographicOffCenterRH(FLOAT ViewLeft, FLOAT ViewRight, FLOAT ViewBottom, FLOAT ViewTop, FLOAT NearZ, FLOAT FarZ); + +/**************************************************************************** + * + * Quaternion operations + * + ****************************************************************************/ + +BOOL XMQuaternionEqual(FXMVECTOR Q1, FXMVECTOR Q2); +BOOL XMQuaternionNotEqual(FXMVECTOR Q1, FXMVECTOR Q2); + +BOOL XMQuaternionIsNaN(FXMVECTOR Q); +BOOL XMQuaternionIsInfinite(FXMVECTOR Q); +BOOL XMQuaternionIsIdentity(FXMVECTOR Q); + +XMVECTOR XMQuaternionDot(FXMVECTOR Q1, FXMVECTOR Q2); +XMVECTOR XMQuaternionMultiply(FXMVECTOR Q1, FXMVECTOR Q2); +XMVECTOR XMQuaternionLengthSq(FXMVECTOR Q); +XMVECTOR XMQuaternionReciprocalLength(FXMVECTOR Q); +XMVECTOR XMQuaternionLength(FXMVECTOR Q); +XMVECTOR XMQuaternionNormalizeEst(FXMVECTOR Q); +XMVECTOR XMQuaternionNormalize(FXMVECTOR Q); +XMVECTOR XMQuaternionConjugate(FXMVECTOR Q); +XMVECTOR XMQuaternionInverse(FXMVECTOR Q); +XMVECTOR XMQuaternionLn(FXMVECTOR Q); +XMVECTOR XMQuaternionExp(FXMVECTOR Q); +XMVECTOR XMQuaternionSlerp(FXMVECTOR Q0, FXMVECTOR Q1, FLOAT t); +XMVECTOR XMQuaternionSlerpV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR T); +XMVECTOR XMQuaternionSquad(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR Q3, FLOAT t); +XMVECTOR XMQuaternionSquadV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR Q3, CXMVECTOR T); +VOID XMQuaternionSquadSetup(__out XMVECTOR* pA, __out XMVECTOR* pB, __out XMVECTOR* pC, FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR Q3); +XMVECTOR XMQuaternionBaryCentric(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, FLOAT f, FLOAT g); +XMVECTOR XMQuaternionBaryCentricV(FXMVECTOR Q0, FXMVECTOR Q1, FXMVECTOR Q2, CXMVECTOR F, CXMVECTOR G); + +XMVECTOR XMQuaternionIdentity(); +XMVECTOR XMQuaternionRotationRollPitchYaw(FLOAT Pitch, FLOAT Yaw, FLOAT Roll); +XMVECTOR XMQuaternionRotationRollPitchYawFromVector(FXMVECTOR Angles); +XMVECTOR XMQuaternionRotationNormal(FXMVECTOR NormalAxis, FLOAT Angle); +XMVECTOR XMQuaternionRotationAxis(FXMVECTOR Axis, FLOAT Angle); +XMVECTOR XMQuaternionRotationMatrix(CXMMATRIX M); + +VOID XMQuaternionToAxisAngle(__out XMVECTOR* pAxis, __out FLOAT* pAngle, FXMVECTOR Q); + +/**************************************************************************** + * + * Plane operations + * + ****************************************************************************/ + +BOOL XMPlaneEqual(FXMVECTOR P1, FXMVECTOR P2); +BOOL XMPlaneNearEqual(FXMVECTOR P1, FXMVECTOR P2, FXMVECTOR Epsilon); +BOOL XMPlaneNotEqual(FXMVECTOR P1, FXMVECTOR P2); + +BOOL XMPlaneIsNaN(FXMVECTOR P); +BOOL XMPlaneIsInfinite(FXMVECTOR P); + +XMVECTOR XMPlaneDot(FXMVECTOR P, FXMVECTOR V); +XMVECTOR XMPlaneDotCoord(FXMVECTOR P, FXMVECTOR V); +XMVECTOR XMPlaneDotNormal(FXMVECTOR P, FXMVECTOR V); +XMVECTOR XMPlaneNormalizeEst(FXMVECTOR P); +XMVECTOR XMPlaneNormalize(FXMVECTOR P); +XMVECTOR XMPlaneIntersectLine(FXMVECTOR P, FXMVECTOR LinePoint1, FXMVECTOR LinePoint2); +VOID XMPlaneIntersectPlane(__out XMVECTOR* pLinePoint1, __out XMVECTOR* pLinePoint2, FXMVECTOR P1, FXMVECTOR P2); +XMVECTOR XMPlaneTransform(FXMVECTOR P, CXMMATRIX M); +XMFLOAT4* XMPlaneTransformStream(__out_bcount(sizeof(XMFLOAT4)+OutputStride*(PlaneCount-1)) XMFLOAT4* pOutputStream, + __in UINT OutputStride, + __in_bcount(sizeof(XMFLOAT4)+InputStride*(PlaneCount-1)) CONST XMFLOAT4* pInputStream, + __in UINT InputStride, __in UINT PlaneCount, CXMMATRIX M); + +XMVECTOR XMPlaneFromPointNormal(FXMVECTOR Point, FXMVECTOR Normal); +XMVECTOR XMPlaneFromPoints(FXMVECTOR Point1, FXMVECTOR Point2, FXMVECTOR Point3); + +/**************************************************************************** + * + * Color operations + * + ****************************************************************************/ + +BOOL XMColorEqual(FXMVECTOR C1, FXMVECTOR C2); +BOOL XMColorNotEqual(FXMVECTOR C1, FXMVECTOR C2); +BOOL XMColorGreater(FXMVECTOR C1, FXMVECTOR C2); +BOOL XMColorGreaterOrEqual(FXMVECTOR C1, FXMVECTOR C2); +BOOL XMColorLess(FXMVECTOR C1, FXMVECTOR C2); +BOOL XMColorLessOrEqual(FXMVECTOR C1, FXMVECTOR C2); + +BOOL XMColorIsNaN(FXMVECTOR C); +BOOL XMColorIsInfinite(FXMVECTOR C); + +XMVECTOR XMColorNegative(FXMVECTOR C); +XMVECTOR XMColorModulate(FXMVECTOR C1, FXMVECTOR C2); +XMVECTOR XMColorAdjustSaturation(FXMVECTOR C, FLOAT Saturation); +XMVECTOR XMColorAdjustContrast(FXMVECTOR C, FLOAT Contrast); + +/**************************************************************************** + * + * Miscellaneous operations + * + ****************************************************************************/ + +BOOL XMVerifyCPUSupport(); + +VOID XMAssert(__in_z CONST CHAR* pExpression, __in_z CONST CHAR* pFileName, UINT LineNumber); + +XMVECTOR XMFresnelTerm(FXMVECTOR CosIncidentAngle, FXMVECTOR RefractionIndex); + +BOOL XMScalarNearEqual(FLOAT S1, FLOAT S2, FLOAT Epsilon); +FLOAT XMScalarModAngle(FLOAT Value); +FLOAT XMScalarSin(FLOAT Value); +FLOAT XMScalarCos(FLOAT Value); +VOID XMScalarSinCos(__out FLOAT* pSin, __out FLOAT* pCos, FLOAT Value); +FLOAT XMScalarASin(FLOAT Value); +FLOAT XMScalarACos(FLOAT Value); +FLOAT XMScalarSinEst(FLOAT Value); +FLOAT XMScalarCosEst(FLOAT Value); +VOID XMScalarSinCosEst(__out FLOAT* pSin, __out FLOAT* pCos, FLOAT Value); +FLOAT XMScalarASinEst(FLOAT Value); +FLOAT XMScalarACosEst(FLOAT Value); + +/**************************************************************************** + * + * Globals + * + ****************************************************************************/ + +// The purpose of the following global constants is to prevent redundant +// reloading of the constants when they are referenced by more than one +// separate inline math routine called within the same function. Declaring +// a constant locally within a routine is sufficient to prevent redundant +// reloads of that constant when that single routine is called multiple +// times in a function, but if the constant is used (and declared) in a +// separate math routine it would be reloaded. + +#define XMGLOBALCONST extern CONST __declspec(selectany) + +XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients0 = {1.0f, -0.166666667f, 8.333333333e-3f, -1.984126984e-4f}; +XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients1 = {2.755731922e-6f, -2.505210839e-8f, 1.605904384e-10f, -7.647163732e-13f}; +XMGLOBALCONST XMVECTORF32 g_XMSinCoefficients2 = {2.811457254e-15f, -8.220635247e-18f, 1.957294106e-20f, -3.868170171e-23f}; +XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients0 = {1.0f, -0.5f, 4.166666667e-2f, -1.388888889e-3f}; +XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients1 = {2.480158730e-5f, -2.755731922e-7f, 2.087675699e-9f, -1.147074560e-11f}; +XMGLOBALCONST XMVECTORF32 g_XMCosCoefficients2 = {4.779477332e-14f, -1.561920697e-16f, 4.110317623e-19f, -8.896791392e-22f}; +XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients0 = {1.0f, 0.333333333f, 0.133333333f, 5.396825397e-2f}; +XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients1 = {2.186948854e-2f, 8.863235530e-3f, 3.592128167e-3f, 1.455834485e-3f}; +XMGLOBALCONST XMVECTORF32 g_XMTanCoefficients2 = {5.900274264e-4f, 2.391290764e-4f, 9.691537707e-5f, 3.927832950e-5f}; +XMGLOBALCONST XMVECTORF32 g_XMASinCoefficients0 = {-0.05806367563904f, -0.41861972469416f, 0.22480114791621f, 2.17337241360606f}; +XMGLOBALCONST XMVECTORF32 g_XMASinCoefficients1 = {0.61657275907170f, 4.29696498283455f, -1.18942822255452f, -6.53784832094831f}; +XMGLOBALCONST XMVECTORF32 g_XMASinCoefficients2 = {-1.36926553863413f, -4.48179294237210f, 1.41810672941833f, 5.48179257935713f}; +XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients0 = {1.0f, 0.333333334f, 0.2f, 0.142857143f}; +XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients1 = {1.111111111e-1f, 9.090909091e-2f, 7.692307692e-2f, 6.666666667e-2f}; +XMGLOBALCONST XMVECTORF32 g_XMATanCoefficients2 = {5.882352941e-2f, 5.263157895e-2f, 4.761904762e-2f, 4.347826087e-2f}; +XMGLOBALCONST XMVECTORF32 g_XMSinEstCoefficients = {1.0f, -1.66521856991541e-1f, 8.199913018755e-3f, -1.61475937228e-4f}; +XMGLOBALCONST XMVECTORF32 g_XMCosEstCoefficients = {1.0f, -4.95348008918096e-1f, 3.878259962881e-2f, -9.24587976263e-4f}; +XMGLOBALCONST XMVECTORF32 g_XMTanEstCoefficients = {2.484f, -1.954923183e-1f, 2.467401101f, XM_1DIVPI}; +XMGLOBALCONST XMVECTORF32 g_XMATanEstCoefficients = {7.689891418951e-1f, 1.104742493348f, 8.661844266006e-1f, XM_PIDIV2}; +XMGLOBALCONST XMVECTORF32 g_XMASinEstCoefficients = {-1.36178272886711f, 2.37949493464538f, -8.08228565650486e-1f, 2.78440142746736e-1f}; +XMGLOBALCONST XMVECTORF32 g_XMASinEstConstants = {1.00000011921f, XM_PIDIV2, 0.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMPiConstants0 = {XM_PI, XM_2PI, XM_1DIVPI, XM_1DIV2PI}; +XMGLOBALCONST XMVECTORF32 g_XMIdentityR0 = {1.0f, 0.0f, 0.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMIdentityR1 = {0.0f, 1.0f, 0.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMIdentityR2 = {0.0f, 0.0f, 1.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMIdentityR3 = {0.0f, 0.0f, 0.0f, 1.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR0 = {-1.0f,0.0f, 0.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR1 = {0.0f,-1.0f, 0.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR2 = {0.0f, 0.0f,-1.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegIdentityR3 = {0.0f, 0.0f, 0.0f,-1.0f}; +XMGLOBALCONST XMVECTORI32 g_XMNegativeZero = {0x80000000, 0x80000000, 0x80000000, 0x80000000}; +XMGLOBALCONST XMVECTORI32 g_XMNegate3 = {0x80000000, 0x80000000, 0x80000000, 0x00000000}; +XMGLOBALCONST XMVECTORI32 g_XMMask3 = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000}; +XMGLOBALCONST XMVECTORI32 g_XMMaskX = {0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000}; +XMGLOBALCONST XMVECTORI32 g_XMMaskY = {0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000}; +XMGLOBALCONST XMVECTORI32 g_XMMaskZ = {0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000000}; +XMGLOBALCONST XMVECTORI32 g_XMMaskW = {0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF}; +XMGLOBALCONST XMVECTORF32 g_XMOne = { 1.0f, 1.0f, 1.0f, 1.0f}; +XMGLOBALCONST XMVECTORF32 g_XMOne3 = { 1.0f, 1.0f, 1.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMZero = { 0.0f, 0.0f, 0.0f, 0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegativeOne = {-1.0f,-1.0f,-1.0f,-1.0f}; +XMGLOBALCONST XMVECTORF32 g_XMOneHalf = { 0.5f, 0.5f, 0.5f, 0.5f}; +XMGLOBALCONST XMVECTORF32 g_XMNegativeOneHalf = {-0.5f,-0.5f,-0.5f,-0.5f}; +XMGLOBALCONST XMVECTORF32 g_XMNegativeTwoPi = {-XM_2PI, -XM_2PI, -XM_2PI, -XM_2PI}; +XMGLOBALCONST XMVECTORF32 g_XMNegativePi = {-XM_PI, -XM_PI, -XM_PI, -XM_PI}; +XMGLOBALCONST XMVECTORF32 g_XMHalfPi = {XM_PIDIV2, XM_PIDIV2, XM_PIDIV2, XM_PIDIV2}; +XMGLOBALCONST XMVECTORF32 g_XMPi = {XM_PI, XM_PI, XM_PI, XM_PI}; +XMGLOBALCONST XMVECTORF32 g_XMReciprocalPi = {XM_1DIVPI, XM_1DIVPI, XM_1DIVPI, XM_1DIVPI}; +XMGLOBALCONST XMVECTORF32 g_XMTwoPi = {XM_2PI, XM_2PI, XM_2PI, XM_2PI}; +XMGLOBALCONST XMVECTORF32 g_XMReciprocalTwoPi = {XM_1DIV2PI, XM_1DIV2PI, XM_1DIV2PI, XM_1DIV2PI}; +XMGLOBALCONST XMVECTORF32 g_XMEpsilon = {1.192092896e-7f, 1.192092896e-7f, 1.192092896e-7f, 1.192092896e-7f}; +XMGLOBALCONST XMVECTORI32 g_XMInfinity = {0x7F800000, 0x7F800000, 0x7F800000, 0x7F800000}; +XMGLOBALCONST XMVECTORI32 g_XMQNaN = {0x7FC00000, 0x7FC00000, 0x7FC00000, 0x7FC00000}; +XMGLOBALCONST XMVECTORI32 g_XMQNaNTest = {0x007FFFFF, 0x007FFFFF, 0x007FFFFF, 0x007FFFFF}; +XMGLOBALCONST XMVECTORI32 g_XMAbsMask = {0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF}; +XMGLOBALCONST XMVECTORI32 g_XMFltMin = {0x00800000, 0x00800000, 0x00800000, 0x00800000}; +XMGLOBALCONST XMVECTORI32 g_XMFltMax = {0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF, 0x7F7FFFFF}; +XMGLOBALCONST XMVECTORI32 g_XMNegOneMask = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}; +XMGLOBALCONST XMVECTORI32 g_XMMaskA8R8G8B8 = {0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000}; +XMGLOBALCONST XMVECTORI32 g_XMFlipA8R8G8B8 = {0x00000000, 0x00000000, 0x00000000, 0x80000000}; +XMGLOBALCONST XMVECTORF32 g_XMFixAA8R8G8B8 = {0.0f,0.0f,0.0f,(float)(0x80000000U)}; +XMGLOBALCONST XMVECTORF32 g_XMNormalizeA8R8G8B8 = {1.0f/(255.0f*(float)(0x10000)),1.0f/(255.0f*(float)(0x100)),1.0f/255.0f,1.0f/(255.0f*(float)(0x1000000))}; +XMGLOBALCONST XMVECTORI32 g_XMMaskA2B10G10R10 = {0x000003FF, 0x000FFC00, 0x3FF00000, 0xC0000000}; +XMGLOBALCONST XMVECTORI32 g_XMFlipA2B10G10R10 = {0x00000200, 0x00080000, 0x20000000, 0x80000000}; +XMGLOBALCONST XMVECTORF32 g_XMFixAA2B10G10R10 = {-512.0f,-512.0f*(float)(0x400),-512.0f*(float)(0x100000),(float)(0x80000000U)}; +XMGLOBALCONST XMVECTORF32 g_XMNormalizeA2B10G10R10 = {1.0f/511.0f,1.0f/(511.0f*(float)(0x400)),1.0f/(511.0f*(float)(0x100000)),1.0f/(3.0f*(float)(0x40000000))}; +XMGLOBALCONST XMVECTORI32 g_XMMaskX16Y16 = {0x0000FFFF, 0xFFFF0000, 0x00000000, 0x00000000}; +XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16 = {0x00008000, 0x00000000, 0x00000000, 0x00000000}; +XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16 = {-32768.0f,0.0f,0.0f,0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNormalizeX16Y16 = {1.0f/32767.0f,1.0f/(32767.0f*65536.0f),0.0f,0.0f}; +XMGLOBALCONST XMVECTORI32 g_XMMaskX16Y16Z16W16 = {0x0000FFFF, 0x0000FFFF, 0xFFFF0000, 0xFFFF0000}; +XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16Z16W16 = {0x00008000, 0x00008000, 0x00000000, 0x00000000}; +XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16Z16W16 = {-32768.0f,-32768.0f,0.0f,0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNormalizeX16Y16Z16W16 = {1.0f/32767.0f,1.0f/32767.0f,1.0f/(32767.0f*65536.0f),1.0f/(32767.0f*65536.0f)}; +XMGLOBALCONST XMVECTORF32 g_XMNoFraction = {8388608.0f,8388608.0f,8388608.0f,8388608.0f}; +XMGLOBALCONST XMVECTORI32 g_XMMaskByte = {0x000000FF, 0x000000FF, 0x000000FF, 0x000000FF}; +XMGLOBALCONST XMVECTORF32 g_XMNegateX = {-1.0f, 1.0f, 1.0f, 1.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegateY = { 1.0f,-1.0f, 1.0f, 1.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegateZ = { 1.0f, 1.0f,-1.0f, 1.0f}; +XMGLOBALCONST XMVECTORF32 g_XMNegateW = { 1.0f, 1.0f, 1.0f,-1.0f}; +XMGLOBALCONST XMVECTORI32 g_XMSelect0101 = {XM_SELECT_0, XM_SELECT_1, XM_SELECT_0, XM_SELECT_1}; +XMGLOBALCONST XMVECTORI32 g_XMSelect1010 = {XM_SELECT_1, XM_SELECT_0, XM_SELECT_1, XM_SELECT_0}; +XMGLOBALCONST XMVECTORI32 g_XMOneHalfMinusEpsilon = { 0x3EFFFFFD, 0x3EFFFFFD, 0x3EFFFFFD, 0x3EFFFFFD}; +XMGLOBALCONST XMVECTORI32 g_XMSelect1000 = {XM_SELECT_1, XM_SELECT_0, XM_SELECT_0, XM_SELECT_0}; +XMGLOBALCONST XMVECTORI32 g_XMSelect1100 = {XM_SELECT_1, XM_SELECT_1, XM_SELECT_0, XM_SELECT_0}; +XMGLOBALCONST XMVECTORI32 g_XMSelect1110 = {XM_SELECT_1, XM_SELECT_1, XM_SELECT_1, XM_SELECT_0}; +XMGLOBALCONST XMVECTORI32 g_XMSwizzleXYXY = {XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0Y}; +XMGLOBALCONST XMVECTORI32 g_XMSwizzleXYZX = {XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X}; +XMGLOBALCONST XMVECTORI32 g_XMSwizzleYXZW = {XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0Z, XM_PERMUTE_0W}; +XMGLOBALCONST XMVECTORI32 g_XMSwizzleYZXW = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0W}; +XMGLOBALCONST XMVECTORI32 g_XMSwizzleZXYW = {XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0W}; +XMGLOBALCONST XMVECTORI32 g_XMPermute0X0Y1X1Y = {XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_1X, XM_PERMUTE_1Y}; +XMGLOBALCONST XMVECTORI32 g_XMPermute0Z0W1Z1W = {XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_1Z, XM_PERMUTE_1W}; +XMGLOBALCONST XMVECTORF32 g_XMFixupY16 = {1.0f,1.0f/65536.0f,0.0f,0.0f}; +XMGLOBALCONST XMVECTORF32 g_XMFixupY16W16 = {1.0f,1.0f,1.0f/65536.0f,1.0f/65536.0f}; +XMGLOBALCONST XMVECTORI32 g_XMFlipY = {0,0x80000000,0,0}; +XMGLOBALCONST XMVECTORI32 g_XMFlipZ = {0,0,0x80000000,0}; +XMGLOBALCONST XMVECTORI32 g_XMFlipW = {0,0,0,0x80000000}; +XMGLOBALCONST XMVECTORI32 g_XMFlipYZ = {0,0x80000000,0x80000000,0}; +XMGLOBALCONST XMVECTORI32 g_XMFlipZW = {0,0,0x80000000,0x80000000}; +XMGLOBALCONST XMVECTORI32 g_XMFlipYW = {0,0x80000000,0,0x80000000}; +XMGLOBALCONST XMVECTORI32 g_XMMaskHenD3 = {0x7FF,0x7ff<<11,0x3FF<<22,0}; +XMGLOBALCONST XMVECTORI32 g_XMMaskDHen3 = {0x3FF,0x7ff<<10,0x7FF<<21,0}; +XMGLOBALCONST XMVECTORF32 g_XMAddUHenD3 = {0,0,32768.0f*65536.0f,0}; +XMGLOBALCONST XMVECTORF32 g_XMAddHenD3 = {-1024.0f,-1024.0f*2048.0f,0,0}; +XMGLOBALCONST XMVECTORF32 g_XMAddDHen3 = {-512.0f,-1024.0f*1024.0f,0,0}; +XMGLOBALCONST XMVECTORF32 g_XMMulHenD3 = {1.0f,1.0f/2048.0f,1.0f/(2048.0f*2048.0f),0}; +XMGLOBALCONST XMVECTORF32 g_XMMulDHen3 = {1.0f,1.0f/1024.0f,1.0f/(1024.0f*2048.0f),0}; +XMGLOBALCONST XMVECTORI32 g_XMXorHenD3 = {0x400,0x400<<11,0,0}; +XMGLOBALCONST XMVECTORI32 g_XMXorDHen3 = {0x200,0x400<<10,0,0}; +XMGLOBALCONST XMVECTORI32 g_XMMaskIco4 = {0xFFFFF,0xFFFFF000,0xFFFFF,0xF0000000}; +XMGLOBALCONST XMVECTORI32 g_XMXorXIco4 = {0x80000,0,0x80000,0x80000000}; +XMGLOBALCONST XMVECTORI32 g_XMXorIco4 = {0x80000,0,0x80000,0}; +XMGLOBALCONST XMVECTORF32 g_XMAddXIco4 = {-8.0f*65536.0f,0,-8.0f*65536.0f,32768.0f*65536.0f}; +XMGLOBALCONST XMVECTORF32 g_XMAddUIco4 = {0,32768.0f*65536.0f,0,32768.0f*65536.0f}; +XMGLOBALCONST XMVECTORF32 g_XMAddIco4 = {-8.0f*65536.0f,0,-8.0f*65536.0f,0}; +XMGLOBALCONST XMVECTORF32 g_XMMulIco4 = {1.0f,1.0f/4096.0f,1.0f,1.0f/(4096.0f*65536.0f)}; +XMGLOBALCONST XMVECTORI32 g_XMMaskDec4 = {0x3FF,0x3FF<<10,0x3FF<<20,0x3<<30}; +XMGLOBALCONST XMVECTORI32 g_XMXorDec4 = {0x200,0x200<<10,0x200<<20,0}; +XMGLOBALCONST XMVECTORF32 g_XMAddUDec4 = {0,0,0,32768.0f*65536.0f}; +XMGLOBALCONST XMVECTORF32 g_XMAddDec4 = {-512.0f,-512.0f*1024.0f,-512.0f*1024.0f*1024.0f,0}; +XMGLOBALCONST XMVECTORF32 g_XMMulDec4 = {1.0f,1.0f/1024.0f,1.0f/(1024.0f*1024.0f),1.0f/(1024.0f*1024.0f*1024.0f)}; +XMGLOBALCONST XMVECTORI32 g_XMMaskByte4 = {0xFF,0xFF00,0xFF0000,0xFF000000}; +XMGLOBALCONST XMVECTORI32 g_XMXorByte4 = {0x80,0x8000,0x800000,0x00000000}; +XMGLOBALCONST XMVECTORF32 g_XMAddByte4 = {-128.0f,-128.0f*256.0f,-128.0f*65536.0f,0}; + +/**************************************************************************** + * + * Implementation + * + ****************************************************************************/ + +#pragma warning(push) +#pragma warning(disable:4214 4204 4365 4616 6001) + +#if !defined(__cplusplus) && !defined(_XBOX) && defined(_XM_ISVS2005_) + +/* Work around VC 2005 bug where math.h defines logf with a semicolon at the end. + * Note this is fixed as of Visual Studio 2005 Service Pack 1 + */ + +#undef logf +#define logf(x) ((float)log((double)(x))) + +#endif // !defined(__cplusplus) && !defined(_XBOX) && defined(_XM_ISVS2005_) + +//------------------------------------------------------------------------------ + +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) + +XMFINLINE XMVECTOR XMVectorSetBinaryConstant(UINT C0, UINT C1, UINT C2, UINT C3) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult; + vResult.u[0] = (0-(C0&1)) & 0x3F800000; + vResult.u[1] = (0-(C1&1)) & 0x3F800000; + vResult.u[2] = (0-(C2&1)) & 0x3F800000; + vResult.u[3] = (0-(C3&1)) & 0x3F800000; + return vResult.v; +#else // XM_SSE_INTRINSICS_ + static const XMVECTORU32 g_vMask1 = {1,1,1,1}; + // Move the parms to a vector + __m128i vTemp = _mm_set_epi32(C3,C2,C1,C0); + // Mask off the low bits + vTemp = _mm_and_si128(vTemp,g_vMask1); + // 0xFFFFFFFF on true bits + vTemp = _mm_cmpeq_epi32(vTemp,g_vMask1); + // 0xFFFFFFFF -> 1.0f, 0x00000000 -> 0.0f + vTemp = _mm_and_si128(vTemp,g_XMOne); + return reinterpret_cast(&vTemp)[0]; +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSplatConstant(INT IntConstant, UINT DivExponent) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT( IntConstant >= -16 && IntConstant <= 15 ); + XMASSERT(DivExponent<32); + { + XMVECTORI32 V = { IntConstant, IntConstant, IntConstant, IntConstant }; + return XMConvertVectorIntToFloat( V.v, DivExponent); + } +#else // XM_SSE_INTRINSICS_ + XMASSERT( IntConstant >= -16 && IntConstant <= 15 ); + XMASSERT(DivExponent<32); + // Splat the int + __m128i vScale = _mm_set1_epi32(IntConstant); + // Convert to a float + XMVECTOR vResult = _mm_cvtepi32_ps(vScale); + // Convert DivExponent into 1.0f/(1<(&vScale)[0]); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSplatConstantInt(INT IntConstant) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT( IntConstant >= -16 && IntConstant <= 15 ); + { + XMVECTORI32 V = { IntConstant, IntConstant, IntConstant, IntConstant }; + return V.v; + } +#else // XM_SSE_INTRINSICS_ + XMASSERT( IntConstant >= -16 && IntConstant <= 15 ); + __m128i V = _mm_set1_epi32( IntConstant ); + return reinterpret_cast<__m128 *>(&V)[0]; +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorShiftLeft(FXMVECTOR V1, FXMVECTOR V2, UINT Elements) +{ + return XMVectorPermute(V1, V2, XMVectorPermuteControl((Elements), ((Elements) + 1), ((Elements) + 2), ((Elements) + 3))); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorRotateLeft(FXMVECTOR V, UINT Elements) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT( Elements < 4 ); + { + XMVECTORF32 vResult = { V.vector4_f32[Elements & 3], V.vector4_f32[(Elements + 1) & 3], + V.vector4_f32[(Elements + 2) & 3], V.vector4_f32[(Elements + 3) & 3] }; + return vResult.v; + } +#else // XM_SSE_INTRINSICS_ + FLOAT fx = XMVectorGetByIndex(V,(Elements) & 3); + FLOAT fy = XMVectorGetByIndex(V,((Elements) + 1) & 3); + FLOAT fz = XMVectorGetByIndex(V,((Elements) + 2) & 3); + FLOAT fw = XMVectorGetByIndex(V,((Elements) + 3) & 3); + return _mm_set_ps( fw, fz, fy, fx ); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorRotateRight(FXMVECTOR V, UINT Elements) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT( Elements < 4 ); + { + XMVECTORF32 vResult = { V.vector4_f32[(4 - (Elements)) & 3], V.vector4_f32[(5 - (Elements)) & 3], + V.vector4_f32[(6 - (Elements)) & 3], V.vector4_f32[(7 - (Elements)) & 3] }; + return vResult.v; + } +#else // XM_SSE_INTRINSICS_ + FLOAT fx = XMVectorGetByIndex(V,(4 - (Elements)) & 3); + FLOAT fy = XMVectorGetByIndex(V,(5 - (Elements)) & 3); + FLOAT fz = XMVectorGetByIndex(V,(6 - (Elements)) & 3); + FLOAT fw = XMVectorGetByIndex(V,(7 - (Elements)) & 3); + return _mm_set_ps( fw, fz, fy, fx ); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSwizzle(FXMVECTOR V, UINT E0, UINT E1, UINT E2, UINT E3) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT( (E0 < 4) && (E1 < 4) && (E2 < 4) && (E3 < 4) ); + { + XMVECTORF32 vResult = { V.vector4_f32[E0], V.vector4_f32[E1], V.vector4_f32[E2], V.vector4_f32[E3] }; + return vResult.v; + } +#else // XM_SSE_INTRINSICS_ + FLOAT fx = XMVectorGetByIndex(V,E0); + FLOAT fy = XMVectorGetByIndex(V,E1); + FLOAT fz = XMVectorGetByIndex(V,E2); + FLOAT fw = XMVectorGetByIndex(V,E3); + return _mm_set_ps( fw, fz, fy, fx ); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS, UINT VSLeftRotateElements, + UINT Select0, UINT Select1, UINT Select2, UINT Select3) +{ + XMVECTOR Control = XMVectorSelectControl(Select0&1, Select1&1, Select2&1, Select3&1); + return XMVectorSelect( VD, XMVectorRotateLeft(VS, VSLeftRotateElements), Control ); +} + +// Implemented for VMX128 intrinsics as #defines aboves +#endif _XM_NO_INTRINSICS_ || _XM_SSE_INTRINSICS_ + +//------------------------------------------------------------------------------ + +#include "xnamathconvert.inl" +#include "xnamathvector.inl" +#include "xnamathmatrix.inl" +#include "xnamathmisc.inl" + +#pragma warning(pop) + +#endif // __XNAMATH_H__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/xnamathconvert.inl b/Src/Decoder_H264_ALL/D3D/include/xnamathconvert.inl new file mode 100644 index 0000000..3af56ea --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/xnamathconvert.inl @@ -0,0 +1,5785 @@ +/*++ + +Copyright (c) Microsoft Corporation. All rights reserved. + +Module Name: + + xnamathconvert.inl + +Abstract: + + XNA math library for Windows and Xbox 360: Conversion, loading, and storing functions. +--*/ + +#if defined(_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#ifndef __XNAMATHCONVERT_INL__ +#define __XNAMATHCONVERT_INL__ + +#define XM_PACK_FACTOR (FLOAT)(1 << 22) +#define XM_UNPACK_FACTOR_UNSIGNED (FLOAT)(1 << 23) +#define XM_UNPACK_FACTOR_SIGNED XM_PACK_FACTOR + +#define XM_UNPACK_UNSIGNEDN_OFFSET(BitsX, BitsY, BitsZ, BitsW) \ + {-XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsX)) - 1), \ + -XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsY)) - 1), \ + -XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsZ)) - 1), \ + -XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsW)) - 1)} + +#define XM_UNPACK_UNSIGNEDN_SCALE(BitsX, BitsY, BitsZ, BitsW) \ + {XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsX)) - 1), \ + XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsY)) - 1), \ + XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsZ)) - 1), \ + XM_UNPACK_FACTOR_UNSIGNED / (FLOAT)((1 << (BitsW)) - 1)} + +#define XM_UNPACK_SIGNEDN_SCALE(BitsX, BitsY, BitsZ, BitsW) \ + {-XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsX) - 1)) - 1), \ + -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsY) - 1)) - 1), \ + -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsZ) - 1)) - 1), \ + -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsW) - 1)) - 1)} + +//#define XM_UNPACK_SIGNEDN_OFFSET(BitsX, BitsY, BitsZ, BitsW) \ +// {-XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsX) - 1)) - 1) * 3.0f, \ +// -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsY) - 1)) - 1) * 3.0f, \ +// -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsZ) - 1)) - 1) * 3.0f, \ +// -XM_UNPACK_FACTOR_SIGNED / (FLOAT)((1 << ((BitsW) - 1)) - 1) * 3.0f} + +#define XM_PACK_UNSIGNEDN_SCALE(BitsX, BitsY, BitsZ, BitsW) \ + {-(FLOAT)((1 << (BitsX)) - 1) / XM_PACK_FACTOR, \ + -(FLOAT)((1 << (BitsY)) - 1) / XM_PACK_FACTOR, \ + -(FLOAT)((1 << (BitsZ)) - 1) / XM_PACK_FACTOR, \ + -(FLOAT)((1 << (BitsW)) - 1) / XM_PACK_FACTOR} + +#define XM_PACK_SIGNEDN_SCALE(BitsX, BitsY, BitsZ, BitsW) \ + {-(FLOAT)((1 << ((BitsX) - 1)) - 1) / XM_PACK_FACTOR, \ + -(FLOAT)((1 << ((BitsY) - 1)) - 1) / XM_PACK_FACTOR, \ + -(FLOAT)((1 << ((BitsZ) - 1)) - 1) / XM_PACK_FACTOR, \ + -(FLOAT)((1 << ((BitsW) - 1)) - 1) / XM_PACK_FACTOR} + +#define XM_PACK_OFFSET XMVectorSplatConstant(3, 0) +//#define XM_UNPACK_OFFSET XM_PACK_OFFSET + +/**************************************************************************** + * + * Data conversion + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE FLOAT XMConvertHalfToFloat +( + HALF Value +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) + + UINT Mantissa; + UINT Exponent; + UINT Result; + + Mantissa = (UINT)(Value & 0x03FF); + + if ((Value & 0x7C00) != 0) // The value is normalized + { + Exponent = (UINT)((Value >> 10) & 0x1F); + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x0400) == 0); + + Mantissa &= 0x03FF; + } + else // The value is zero + { + Exponent = (UINT)-112; + } + + Result = ((Value & 0x8000) << 16) | // Sign + ((Exponent + 112) << 23) | // Exponent + (Mantissa << 13); // Mantissa + + return *(FLOAT*)&Result; + +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif +} + +//------------------------------------------------------------------------------ + +XMINLINE FLOAT* XMConvertHalfToFloatStream +( + FLOAT* pOutputStream, + UINT OutputStride, + CONST HALF* pInputStream, + UINT InputStride, + UINT HalfCount +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) + + UINT i; + BYTE* pHalf = (BYTE*)pInputStream; + BYTE* pFloat = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < HalfCount; i++) + { + *(FLOAT*)pFloat = XMConvertHalfToFloat(*(HALF*)pHalf); + pHalf += InputStride; + pFloat += OutputStride; + } + + return pOutputStream; + +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE HALF XMConvertFloatToHalf +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) + UINT Result; + + UINT IValue = ((UINT *)(&Value))[0]; + UINT Sign = (IValue & 0x80000000U) >> 16U; + IValue = IValue & 0x7FFFFFFFU; // Hack off the sign + + if (IValue > 0x47FFEFFFU) + { + // The number is too large to be represented as a half. Saturate to infinity. + Result = 0x7FFFU; + } + else + { + if (IValue < 0x38800000U) + { + // The number is too small to be represented as a normalized half. + // Convert it to a denormalized value. + UINT Shift = 113U - (IValue >> 23U); + IValue = (0x800000U | (IValue & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized half. + IValue += 0xC8000000U; + } + + Result = ((IValue + 0x0FFFU + ((IValue >> 13U) & 1U)) >> 13U)&0x7FFFU; + } + return (HALF)(Result|Sign); + +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif +} + +//------------------------------------------------------------------------------ + +XMINLINE HALF* XMConvertFloatToHalfStream +( + HALF* pOutputStream, + UINT OutputStride, + CONST FLOAT* pInputStream, + UINT InputStride, + UINT FloatCount +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) + + UINT i; + BYTE* pFloat = (BYTE*)pInputStream; + BYTE* pHalf = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < FloatCount; i++) + { + *(HALF*)pHalf = XMConvertFloatToHalf(*(FLOAT*)pFloat); + pFloat += InputStride; + pHalf += OutputStride; + } + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) +// For VMX128, these routines are all defines in the main header + +#pragma warning(push) +#pragma warning(disable:4701) // Prevent warnings about 'Result' potentially being used without having been initialized + +XMINLINE XMVECTOR XMConvertVectorIntToFloat +( + FXMVECTOR VInt, + UINT DivExponent +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ElementIndex; + FLOAT fScale; + XMVECTOR Result; + XMASSERT(DivExponent<32); + fScale = 1.0f / (FLOAT)(1U << DivExponent); + ElementIndex = 0; + do { + INT iTemp = (INT)VInt.vector4_u32[ElementIndex]; + Result.vector4_f32[ElementIndex] = ((FLOAT)iTemp) * fScale; + } while (++ElementIndex<4); + return Result; +#else // _XM_SSE_INTRINSICS_ + XMASSERT(DivExponent<32); + // Convert to floats + XMVECTOR vResult = _mm_cvtepi32_ps(reinterpret_cast(&VInt)[0]); + // Convert DivExponent into 1.0f/(1<(&vScale)[0]); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMConvertVectorFloatToInt +( + FXMVECTOR VFloat, + UINT MulExponent +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ElementIndex; + XMVECTOR Result; + FLOAT fScale; + XMASSERT(MulExponent<32); + // Get the scalar factor. + fScale = (FLOAT)(1U << MulExponent); + ElementIndex = 0; + do { + INT iResult; + FLOAT fTemp = VFloat.vector4_f32[ElementIndex]*fScale; + if (fTemp <= -(65536.0f*32768.0f)) { + iResult = (-0x7FFFFFFF)-1; + } else if (fTemp > (65536.0f*32768.0f)-128.0f) { + iResult = 0x7FFFFFFF; + } else { + iResult = (INT)fTemp; + } + Result.vector4_u32[ElementIndex] = (UINT)iResult; + } while (++ElementIndex<4); + return Result; +#else // _XM_SSE_INTRINSICS_ + XMASSERT(MulExponent<32); + static const XMVECTORF32 MaxInt = {65536.0f*32768.0f-128.0f,65536.0f*32768.0f-128.0f,65536.0f*32768.0f-128.0f,65536.0f*32768.0f-128.0f}; + XMVECTOR vResult = _mm_set_ps1((FLOAT)(1U << MulExponent)); + vResult = _mm_mul_ps(vResult,VFloat); + // In case of positive overflow, detect it + XMVECTOR vOverflow = _mm_cmpgt_ps(vResult,MaxInt); + // Float to int conversion + __m128i vResulti = _mm_cvttps_epi32(vResult); + // If there was positive overflow, set to 0x7FFFFFFF + vResult = _mm_and_ps(vOverflow,g_XMAbsMask); + vOverflow = _mm_andnot_ps(vOverflow,reinterpret_cast(&vResulti)[0]); + vOverflow = _mm_or_ps(vOverflow,vResult); + return vOverflow; +#endif +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMConvertVectorUIntToFloat +( + FXMVECTOR VUInt, + UINT DivExponent +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ElementIndex; + FLOAT fScale; + XMVECTOR Result; + XMASSERT(DivExponent<32); + fScale = 1.0f / (FLOAT)(1U << DivExponent); + ElementIndex = 0; + do { + Result.vector4_f32[ElementIndex] = (FLOAT)VUInt.vector4_u32[ElementIndex] * fScale; + } while (++ElementIndex<4); + return Result; +#else // _XM_SSE_INTRINSICS_ + XMASSERT(DivExponent<32); + static const XMVECTORF32 FixUnsigned = {32768.0f*65536.0f,32768.0f*65536.0f,32768.0f*65536.0f,32768.0f*65536.0f}; + // For the values that are higher than 0x7FFFFFFF, a fixup is needed + // Determine which ones need the fix. + XMVECTOR vMask = _mm_and_ps(VUInt,g_XMNegativeZero); + // Force all values positive + XMVECTOR vResult = _mm_xor_ps(VUInt,vMask); + // Convert to floats + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert 0x80000000 -> 0xFFFFFFFF + __m128i iMask = _mm_srai_epi32(reinterpret_cast(&vMask)[0],31); + // For only the ones that are too big, add the fixup + vMask = _mm_and_ps(reinterpret_cast(&iMask)[0],FixUnsigned); + vResult = _mm_add_ps(vResult,vMask); + // Convert DivExponent into 1.0f/(1<(&iMask)[0]); + return vResult; +#endif +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMConvertVectorFloatToUInt +( + FXMVECTOR VFloat, + UINT MulExponent +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ElementIndex; + XMVECTOR Result; + FLOAT fScale; + XMASSERT(MulExponent<32); + // Get the scalar factor. + fScale = (FLOAT)(1U << MulExponent); + ElementIndex = 0; + do { + UINT uResult; + FLOAT fTemp = VFloat.vector4_f32[ElementIndex]*fScale; + if (fTemp <= 0.0f) { + uResult = 0; + } else if (fTemp >= (65536.0f*65536.0f)) { + uResult = 0xFFFFFFFFU; + } else { + uResult = (UINT)fTemp; + } + Result.vector4_u32[ElementIndex] = uResult; + } while (++ElementIndex<4); + return Result; +#else // _XM_SSE_INTRINSICS_ + XMASSERT(MulExponent<32); + static const XMVECTORF32 MaxUInt = {65536.0f*65536.0f-256.0f,65536.0f*65536.0f-256.0f,65536.0f*65536.0f-256.0f,65536.0f*65536.0f-256.0f}; + static const XMVECTORF32 UnsignedFix = {32768.0f*65536.0f,32768.0f*65536.0f,32768.0f*65536.0f,32768.0f*65536.0f}; + XMVECTOR vResult = _mm_set_ps1(static_cast(1U << MulExponent)); + vResult = _mm_mul_ps(vResult,VFloat); + // Clamp to >=0 + vResult = _mm_max_ps(vResult,g_XMZero); + // Any numbers that are too big, set to 0xFFFFFFFFU + XMVECTOR vOverflow = _mm_cmpgt_ps(vResult,MaxUInt); + XMVECTOR vValue = UnsignedFix; + // Too large for a signed integer? + XMVECTOR vMask = _mm_cmpge_ps(vResult,vValue); + // Zero for number's lower than 0x80000000, 32768.0f*65536.0f otherwise + vValue = _mm_and_ps(vValue,vMask); + // Perform fixup only on numbers too large (Keeps low bit precision) + vResult = _mm_sub_ps(vResult,vValue); + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Convert from signed to unsigned pnly if greater than 0x80000000 + vMask = _mm_and_ps(vMask,g_XMNegativeZero); + vResult = _mm_xor_ps(reinterpret_cast(&vResulti)[0],vMask); + // On those that are too large, set to 0xFFFFFFFF + vResult = _mm_or_ps(vResult,vOverflow); + return vResult; +#endif +} + +#pragma warning(pop) + +#endif // _XM_NO_INTRINSICS_ || _XM_SSE_INTRINSICS_ + +/**************************************************************************** + * + * Vector and matrix load operations + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadInt(CONST UINT* pSource) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 3) == 0); + + V.vector4_u32[0] = *pSource; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 3) == 0); + + return _mm_load_ss( (const float*)pSource ); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat(CONST FLOAT* pSource) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 3) == 0); + + V.vector4_f32[0] = *pSource; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 3) == 0); + + return _mm_load_ss( pSource ); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadInt2 +( + CONST UINT* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + + return V; +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pSource); + + __m128 x = _mm_load_ss( (const float*)pSource ); + __m128 y = _mm_load_ss( (const float*)(pSource+1) ); + return _mm_unpacklo_ps( x, y ); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadInt2A +( + CONST UINT* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + __m128i V = _mm_loadl_epi64( (const __m128i*)pSource ); + return reinterpret_cast<__m128 *>(&V)[0]; + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat2 +( + CONST XMFLOAT2* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + XMASSERT(pSource); + + ((UINT *)(&V.vector4_f32[0]))[0] = ((const UINT *)(&pSource->x))[0]; + ((UINT *)(&V.vector4_f32[1]))[0] = ((const UINT *)(&pSource->y))[0]; + return V; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + + __m128 x = _mm_load_ss( &pSource->x ); + __m128 y = _mm_load_ss( &pSource->y ); + return _mm_unpacklo_ps( x, y ); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat2A +( + CONST XMFLOAT2A* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + __m128i V = _mm_loadl_epi64( (const __m128i*)pSource ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadHalf2 +( + CONST XMHALF2* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT(pSource); + { + XMVECTOR vResult = { + XMConvertHalfToFloat(pSource->x), + XMConvertHalfToFloat(pSource->y), + 0.0f, + 0.0f + }; + return vResult; + } +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMVECTOR vResult = { + XMConvertHalfToFloat(pSource->x), + XMConvertHalfToFloat(pSource->y), + 0.0f, + 0.0f + }; + return vResult; + +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadShortN2 +( + CONST XMSHORTN2* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + { + XMVECTOR vResult = { + (FLOAT)pSource->x * (1.0f/32767.0f), + (FLOAT)pSource->y * (1.0f/32767.0f), + 0.0f, + 0.0f + }; + return vResult; + } + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp,g_XMMaskX16Y16); + // x needs to be sign extended + vTemp = _mm_xor_ps(vTemp,g_XMFlipX16Y16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x - 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMFixX16Y16); + // Convert 0-32767 to 0.0f-1.0f + return _mm_mul_ps(vTemp,g_XMNormalizeX16Y16); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadShort2 +( + CONST XMSHORT2* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + + V.vector4_f32[0] = (FLOAT)pSource->x; + V.vector4_f32[1] = (FLOAT)pSource->y; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp,g_XMMaskX16Y16); + // x needs to be sign extended + vTemp = _mm_xor_ps(vTemp,g_XMFlipX16Y16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x - 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMFixX16Y16); + // Y is 65536 too large + return _mm_mul_ps(vTemp,g_XMFixupY16); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUShortN2 +( + CONST XMUSHORTN2* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)pSource->x / 65535.0f; + V.vector4_f32[1] = (FLOAT)pSource->y / 65535.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FixupY16 = {1.0f/65535.0f,1.0f/(65535.0f*65536.0f),0.0f,0.0f}; + static const XMVECTORF32 FixaddY16 = {0,32768.0f*65536.0f,0,0}; + XMASSERT(pSource); + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp,g_XMMaskX16Y16); + // y needs to be sign flipped + vTemp = _mm_xor_ps(vTemp,g_XMFlipY); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // y + 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp,FixaddY16); + // Y is 65536 times too large + vTemp = _mm_mul_ps(vTemp,FixupY16); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUShort2 +( + CONST XMUSHORT2* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)pSource->x; + V.vector4_f32[1] = (FLOAT)pSource->y; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FixaddY16 = {0,32768.0f,0,0}; + XMASSERT(pSource); + // Splat the two shorts in all four entries (WORD alignment okay, + // DWORD alignment preferred) + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->x)); + // Mask x&0xFFFF, y&0xFFFF0000,z&0,w&0 + vTemp = _mm_and_ps(vTemp,g_XMMaskX16Y16); + // y needs to be sign flipped + vTemp = _mm_xor_ps(vTemp,g_XMFlipY); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // Y is 65536 times too large + vTemp = _mm_mul_ps(vTemp,g_XMFixupY16); + // y + 0x8000 to undo the signed order. + vTemp = _mm_add_ps(vTemp,FixaddY16); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadInt3 +( + CONST UINT* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + +#ifdef _XM_ISVS2005_ + __m128i V = _mm_set_epi32( 0, *(pSource+2), *(pSource+1), *pSource ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else + __m128 x = _mm_load_ss( (const float*)pSource ); + __m128 y = _mm_load_ss( (const float*)(pSource+1) ); + __m128 z = _mm_load_ss( (const float*)(pSource+2) ); + __m128 xy = _mm_unpacklo_ps( x, y ); + return _mm_movelh_ps( xy, z ); +#endif // !_XM_ISVS2005_ +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadInt3A +( + CONST UINT* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + + // Reads an extra integer that is 'undefined' + + __m128i V = _mm_load_si128( (const __m128i*)pSource ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat3 +( + CONST XMFLOAT3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + XMASSERT(pSource); + + ((UINT *)(&V.vector4_f32[0]))[0] = ((const UINT *)(&pSource->x))[0]; + ((UINT *)(&V.vector4_f32[1]))[0] = ((const UINT *)(&pSource->y))[0]; + ((UINT *)(&V.vector4_f32[2]))[0] = ((const UINT *)(&pSource->z))[0]; + return V; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + +#ifdef _XM_ISVS2005_ + // This reads 1 floats past the memory that should be ignored. + // Need to continue to do this for VS 2005 due to compiler issue but prefer new method + // to avoid triggering issues with memory debug tools (like AV) + return _mm_loadu_ps( &pSource->x ); +#else + __m128 x = _mm_load_ss( &pSource->x ); + __m128 y = _mm_load_ss( &pSource->y ); + __m128 z = _mm_load_ss( &pSource->z ); + __m128 xy = _mm_unpacklo_ps( x, y ); + return _mm_movelh_ps( xy, z ); +#endif // !_XM_ISVS2005_ +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat3A +( + CONST XMFLOAT3A* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = pSource->z; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + // This reads 1 floats past the memory that should be ignored. + return _mm_load_ps( &pSource->x ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUHenDN3 +( + CONST XMUHENDN3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x7FF; + V.vector4_f32[0] = (FLOAT)Element / 2047.0f; + Element = (pSource->v >> 11) & 0x7FF; + V.vector4_f32[1] = (FLOAT)Element / 2047.0f; + Element = (pSource->v >> 22) & 0x3FF; + V.vector4_f32[2] = (FLOAT)Element / 1023.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 UHenDN3Mul = {1.0f/2047.0f,1.0f/(2047.0f*2048.0f),1.0f/(1023.0f*2048.0f*2048.0f),0}; + XMASSERT(pSource); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskHenD3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMFlipZ); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddUHenD3); + // Normalize x,y and z to -1.0f-1.0f + vResult = _mm_mul_ps(vResult,UHenDN3Mul); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUHenD3 +( + CONST XMUHEND3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x7FF; + V.vector4_f32[0] = (FLOAT)Element; + Element = (pSource->v >> 11) & 0x7FF; + V.vector4_f32[1] = (FLOAT)Element; + Element = (pSource->v >> 22) & 0x3FF; + V.vector4_f32[2] = (FLOAT)Element; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskHenD3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMFlipZ); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddUHenD3); + // Normalize x and y to -1024-1023.0f and z to -512-511.0f + vResult = _mm_mul_ps(vResult,g_XMMulHenD3); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadHenDN3 +( + CONST XMHENDN3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtendXY[] = {0x00000000, 0xFFFFF800}; + static CONST UINT SignExtendZ[] = {0x00000000, 0xFFFFFC00}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 11) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 22) & 0x3FF) != 0x200); + + Element = pSource->v & 0x7FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtendXY[Element >> 10]) / 1023.0f; + Element = (pSource->v >> 11) & 0x7FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtendXY[Element >> 10]) / 1023.0f; + Element = (pSource->v >> 22) & 0x3FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtendZ[Element >> 9]) / 511.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 HenDN3Mul = {1.0f/1023.0f,1.0f/(1023.0f*2048.0f),1.0f/(511.0f*2048.0f*2048.0f),0}; + XMASSERT(pSource); + XMASSERT((pSource->v & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 11) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 22) & 0x3FF) != 0x200); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskHenD3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMXorHenD3); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddHenD3); + // Normalize x,y and z to -1.0f-1.0f + vResult = _mm_mul_ps(vResult,HenDN3Mul); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadHenD3 +( + CONST XMHEND3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtendXY[] = {0x00000000, 0xFFFFF800}; + static CONST UINT SignExtendZ[] = {0x00000000, 0xFFFFFC00}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 11) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 22) & 0x3FF) != 0x200); + + Element = pSource->v & 0x7FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtendXY[Element >> 10]); + Element = (pSource->v >> 11) & 0x7FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtendXY[Element >> 10]); + Element = (pSource->v >> 22) & 0x3FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtendZ[Element >> 9]); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT((pSource->v & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 11) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 22) & 0x3FF) != 0x200); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskHenD3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMXorHenD3); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddHenD3); + // Normalize x and y to -1024-1023.0f and z to -512-511.0f + vResult = _mm_mul_ps(vResult,g_XMMulHenD3); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUDHenN3 +( + CONST XMUDHENN3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)Element / 1023.0f; + Element = (pSource->v >> 10) & 0x7FF; + V.vector4_f32[1] = (FLOAT)Element / 2047.0f; + Element = (pSource->v >> 21) & 0x7FF; + V.vector4_f32[2] = (FLOAT)Element / 2047.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 UDHenN3Mul = {1.0f/1023.0f,1.0f/(2047.0f*1024.0f),1.0f/(2047.0f*1024.0f*2048.0f),0}; + XMASSERT(pSource); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskDHen3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMFlipZ); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddUHenD3); + // Normalize x,y and z to -1.0f-1.0f + vResult = _mm_mul_ps(vResult,UDHenN3Mul); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUDHen3 +( + CONST XMUDHEN3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)Element; + Element = (pSource->v >> 10) & 0x7FF; + V.vector4_f32[1] = (FLOAT)Element; + Element = (pSource->v >> 21) & 0x7FF; + V.vector4_f32[2] = (FLOAT)Element; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskDHen3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMFlipZ); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddUHenD3); + // Normalize x to 0-1023.0f and y and z to 0-2047.0f + vResult = _mm_mul_ps(vResult,g_XMMulDHen3); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadDHenN3 +( + CONST XMDHENN3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtendX[] = {0x00000000, 0xFFFFFC00}; + static CONST UINT SignExtendYZ[] = {0x00000000, 0xFFFFF800}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 21) & 0x7FF) != 0x400); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtendX[Element >> 9]) / 511.0f; + Element = (pSource->v >> 10) & 0x7FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtendYZ[Element >> 10]) / 1023.0f; + Element = (pSource->v >> 21) & 0x7FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtendYZ[Element >> 10]) / 1023.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 DHenN3Mul = {1.0f/511.0f,1.0f/(1023.0f*1024.0f),1.0f/(1023.0f*1024.0f*2048.0f),0}; + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 21) & 0x7FF) != 0x400); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskDHen3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMXorDHen3); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddDHen3); + // Normalize x,y and z to -1.0f-1.0f + vResult = _mm_mul_ps(vResult,DHenN3Mul); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadDHen3 +( + CONST XMDHEN3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtendX[] = {0x00000000, 0xFFFFFC00}; + static CONST UINT SignExtendYZ[] = {0x00000000, 0xFFFFF800}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 21) & 0x7FF) != 0x400); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtendX[Element >> 9]); + Element = (pSource->v >> 10) & 0x7FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtendYZ[Element >> 10]); + Element = (pSource->v >> 21) & 0x7FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtendYZ[Element >> 10]); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x7FF) != 0x400); + XMASSERT(((pSource->v >> 21) & 0x7FF) != 0x400); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,g_XMMaskDHen3); + // Convert x and y to unsigned + vResult = _mm_xor_ps(vResult,g_XMXorDHen3); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Convert x and y back to signed + vResult = _mm_add_ps(vResult,g_XMAddDHen3); + // Normalize x to -210-511.0f and y and z to -1024-1023.0f + vResult = _mm_mul_ps(vResult,g_XMMulDHen3); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadU565 +( + CONST XMU565* pSource +) +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + static const XMVECTORI32 U565And = {0x1F,0x3F<<5,0x1F<<11,0}; + static const XMVECTORF32 U565Mul = {1.0f,1.0f/32.0f,1.0f/2048.f,0}; + XMASSERT(pSource); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,U565And); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Normalize x, y, and z + vResult = _mm_mul_ps(vResult,U565Mul); + return vResult; +#else + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x1F; + V.vector4_f32[0] = (FLOAT)Element; + Element = (pSource->v >> 5) & 0x3F; + V.vector4_f32[1] = (FLOAT)Element; + Element = (pSource->v >> 11) & 0x1F; + V.vector4_f32[2] = (FLOAT)Element; + + return V; +#endif // !_XM_SSE_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat3PK +( + CONST XMFLOAT3PK* pSource +) +{ + _DECLSPEC_ALIGN_16_ UINT Result[4]; + UINT Mantissa; + UINT Exponent; + + XMASSERT(pSource); + + // X Channel (6-bit mantissa) + Mantissa = pSource->xm; + + if ( pSource->xe == 0x1f ) // INF or NAN + { + Result[0] = 0x7f800000 | (pSource->xm << 17); + } + else + { + if ( pSource->xe != 0 ) // The value is normalized + { + Exponent = pSource->xe; + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x40) == 0); + + Mantissa &= 0x3F; + } + else // The value is zero + { + Exponent = (UINT)-112; + } + + Result[0] = ((Exponent + 112) << 23) | (Mantissa << 17); + } + + // Y Channel (6-bit mantissa) + Mantissa = pSource->ym; + + if ( pSource->ye == 0x1f ) // INF or NAN + { + Result[1] = 0x7f800000 | (pSource->ym << 17); + } + else + { + if ( pSource->ye != 0 ) // The value is normalized + { + Exponent = pSource->ye; + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x40) == 0); + + Mantissa &= 0x3F; + } + else // The value is zero + { + Exponent = (UINT)-112; + } + + Result[1] = ((Exponent + 112) << 23) | (Mantissa << 17); + } + + // Z Channel (5-bit mantissa) + Mantissa = pSource->zm; + + if ( pSource->ze == 0x1f ) // INF or NAN + { + Result[2] = 0x7f800000 | (pSource->zm << 17); + } + else + { + if ( pSource->ze != 0 ) // The value is normalized + { + Exponent = pSource->ze; + } + else if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x20) == 0); + + Mantissa &= 0x1F; + } + else // The value is zero + { + Exponent = (UINT)-112; + } + + Result[2] = ((Exponent + 112) << 23) | (Mantissa << 18); + } + + return XMLoadFloat3A( (XMFLOAT3A*)&Result ); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat3SE +( + CONST XMFLOAT3SE* pSource +) +{ + _DECLSPEC_ALIGN_16_ UINT Result[4]; + UINT Mantissa; + UINT Exponent, ExpBits; + + XMASSERT(pSource); + + if ( pSource->e == 0x1f ) // INF or NAN + { + Result[0] = 0x7f800000 | (pSource->xm << 14); + Result[1] = 0x7f800000 | (pSource->ym << 14); + Result[2] = 0x7f800000 | (pSource->zm << 14); + } + else if ( pSource->e != 0 ) // The values are all normalized + { + Exponent = pSource->e; + + ExpBits = (Exponent + 112) << 23; + + Mantissa = pSource->xm; + Result[0] = ExpBits | (Mantissa << 14); + + Mantissa = pSource->ym; + Result[1] = ExpBits | (Mantissa << 14); + + Mantissa = pSource->zm; + Result[2] = ExpBits | (Mantissa << 14); + } + else + { + // X Channel + Mantissa = pSource->xm; + + if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x200) == 0); + + Mantissa &= 0x1FF; + } + else // The value is zero + { + Exponent = (UINT)-112; + } + + Result[0] = ((Exponent + 112) << 23) | (Mantissa << 14); + + // Y Channel + Mantissa = pSource->ym; + + if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x200) == 0); + + Mantissa &= 0x1FF; + } + else // The value is zero + { + Exponent = (UINT)-112; + } + + Result[1] = ((Exponent + 112) << 23) | (Mantissa << 14); + + // Z Channel + Mantissa = pSource->zm; + + if (Mantissa != 0) // The value is denormalized + { + // Normalize the value in the resulting float + Exponent = 1; + + do + { + Exponent--; + Mantissa <<= 1; + } while ((Mantissa & 0x200) == 0); + + Mantissa &= 0x1FF; + } + else // The value is zero + { + Exponent = (UINT)-112; + } + + Result[2] = ((Exponent + 112) << 23) | (Mantissa << 14); + } + + return XMLoadFloat3A( (XMFLOAT3A*)&Result ); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadInt4 +( + CONST UINT* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + V.vector4_u32[3] = pSource[3]; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pSource); + + __m128i V = _mm_loadu_si128( (const __m128i*)pSource ); + return reinterpret_cast<__m128 *>(&V)[0]; + +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadInt4A +( + CONST UINT* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + V.vector4_u32[0] = pSource[0]; + V.vector4_u32[1] = pSource[1]; + V.vector4_u32[2] = pSource[2]; + V.vector4_u32[3] = pSource[3]; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + __m128i V = _mm_load_si128( (const __m128i*)pSource ); + return reinterpret_cast<__m128 *>(&V)[0]; + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat4 +( + CONST XMFLOAT4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + XMASSERT(pSource); + + ((UINT *)(&V.vector4_f32[0]))[0] = ((const UINT *)(&pSource->x))[0]; + ((UINT *)(&V.vector4_f32[1]))[0] = ((const UINT *)(&pSource->y))[0]; + ((UINT *)(&V.vector4_f32[2]))[0] = ((const UINT *)(&pSource->z))[0]; + ((UINT *)(&V.vector4_f32[3]))[0] = ((const UINT *)(&pSource->w))[0]; + return V; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + + return _mm_loadu_ps( &pSource->x ); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadFloat4A +( + CONST XMFLOAT4A* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + V.vector4_f32[0] = pSource->x; + V.vector4_f32[1] = pSource->y; + V.vector4_f32[2] = pSource->z; + V.vector4_f32[3] = pSource->w; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + return _mm_load_ps( &pSource->x ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadHalf4 +( + CONST XMHALF4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT(pSource); + { + XMVECTOR vResult = { + XMConvertHalfToFloat(pSource->x), + XMConvertHalfToFloat(pSource->y), + XMConvertHalfToFloat(pSource->z), + XMConvertHalfToFloat(pSource->w) + }; + return vResult; + } +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMVECTOR vResult = { + XMConvertHalfToFloat(pSource->x), + XMConvertHalfToFloat(pSource->y), + XMConvertHalfToFloat(pSource->z), + XMConvertHalfToFloat(pSource->w) + }; + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadShortN4 +( + CONST XMSHORTN4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + XMASSERT(pSource->z != -32768); + XMASSERT(pSource->w != -32768); + { + XMVECTOR vResult = { + (FLOAT)pSource->x * (1.0f/32767.0f), + (FLOAT)pSource->y * (1.0f/32767.0f), + (FLOAT)pSource->z * (1.0f/32767.0f), + (FLOAT)pSource->w * (1.0f/32767.0f) + }; + return vResult; + } +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + XMASSERT(pSource->z != -32768); + XMASSERT(pSource->w != -32768); + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(reinterpret_cast(&vIntd)[0],g_XMMaskX16Y16Z16W16); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMFlipX16Y16Z16W16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMFixX16Y16Z16W16); + // Convert -32767-32767 to -1.0f-1.0f + vTemp = _mm_mul_ps(vTemp,g_XMNormalizeX16Y16Z16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(3,1,2,0)); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadShort4 +( + CONST XMSHORT4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + XMASSERT(pSource->z != -32768); + XMASSERT(pSource->w != -32768); + + V.vector4_f32[0] = (FLOAT)pSource->x; + V.vector4_f32[1] = (FLOAT)pSource->y; + V.vector4_f32[2] = (FLOAT)pSource->z; + V.vector4_f32[3] = (FLOAT)pSource->w; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT(pSource->x != -32768); + XMASSERT(pSource->y != -32768); + XMASSERT(pSource->z != -32768); + XMASSERT(pSource->w != -32768); + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(reinterpret_cast(&vIntd)[0],g_XMMaskX16Y16Z16W16); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMFlipX16Y16Z16W16); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMFixX16Y16Z16W16); + // Fix y and w because they are 65536 too large + vTemp = _mm_mul_ps(vTemp,g_XMFixupY16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(3,1,2,0)); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUShortN4 +( + CONST XMUSHORTN4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)pSource->x / 65535.0f; + V.vector4_f32[1] = (FLOAT)pSource->y / 65535.0f; + V.vector4_f32[2] = (FLOAT)pSource->z / 65535.0f; + V.vector4_f32[3] = (FLOAT)pSource->w / 65535.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + static const XMVECTORF32 FixupY16W16 = {1.0f/65535.0f,1.0f/65535.0f,1.0f/(65535.0f*65536.0f),1.0f/(65535.0f*65536.0f)}; + static const XMVECTORF32 FixaddY16W16 = {0,0,32768.0f*65536.0f,32768.0f*65536.0f}; + XMASSERT(pSource); + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(reinterpret_cast(&vIntd)[0],g_XMMaskX16Y16Z16W16); + // y and w are signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp,g_XMFlipZW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // y and w + 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp,FixaddY16W16); + // Fix y and w because they are 65536 too large + vTemp = _mm_mul_ps(vTemp,FixupY16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(3,1,2,0)); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUShort4 +( + CONST XMUSHORT4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)pSource->x; + V.vector4_f32[1] = (FLOAT)pSource->y; + V.vector4_f32[2] = (FLOAT)pSource->z; + V.vector4_f32[3] = (FLOAT)pSource->w; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + static const XMVECTORF32 FixaddY16W16 = {0,0,32768.0f,32768.0f}; + XMASSERT(pSource); + // Splat the color in all four entries (x,z,y,w) + __m128d vIntd = _mm_load1_pd(reinterpret_cast(&pSource->x)); + // Shift x&0ffff,z&0xffff,y&0xffff0000,w&0xffff0000 + __m128 vTemp = _mm_and_ps(reinterpret_cast(&vIntd)[0],g_XMMaskX16Y16Z16W16); + // y and w are signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp,g_XMFlipZW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // Fix y and w because they are 65536 too large + vTemp = _mm_mul_ps(vTemp,g_XMFixupY16W16); + // y and w + 0x8000 to complete the conversion + vTemp = _mm_add_ps(vTemp,FixaddY16W16); + // Very important! The entries are x,z,y,w, flip it to x,y,z,w + return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(3,1,2,0)); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadXIcoN4 +( + CONST XMXICON4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFF00000}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 20) & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 40) & 0xFFFFFull) != 0x80000ull); + + Element = (UINT)pSource->v & 0xFFFFF; + V.vector4_f32[0] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f; + Element = (UINT)(pSource->v >> 20) & 0xFFFFF; + V.vector4_f32[1] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f; + Element = (UINT)(pSource->v >> 40) & 0xFFFFF; + V.vector4_f32[2] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f; + V.vector4_f32[3] = (FLOAT)(pSource->v >> 60) / 15.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT((pSource->v & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 20) & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 40) & 0xFFFFFull) != 0x80000ull); + static const XMVECTORF32 LoadXIcoN4Mul = {1.0f/524287.0f,1.0f/(524287.0f*4096.0f),1.0f/524287.0f,1.0f/(15.0f*4096.0f*65536.0f)}; + XMASSERT(pSource); + // Grab the 64 bit structure + __m128d vResultd = _mm_load_sd(reinterpret_cast(&pSource->v)); + // By shifting down 8 bits, y and z are in seperate 32 bit elements + __m128i vResulti = _mm_srli_si128(reinterpret_cast(&vResultd)[0],8/8); + // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z + XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast(&vResultd)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(1,0,1,0)); + // Fix the entries to x,y,z,w + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0)); + // Mask x,y,z and w + vTemp = _mm_and_ps(vTemp,g_XMMaskIco4); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorXIco4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddXIco4); + // Fix y and w because they are too large + vTemp = _mm_mul_ps(vTemp,LoadXIcoN4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadXIco4 +( + CONST XMXICO4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFF00000}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 20) & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 40) & 0xFFFFFull) != 0x80000ull); + + Element = (UINT)pSource->v & 0xFFFFF; + V.vector4_f32[0] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]); + Element = (UINT)(pSource->v >> 20) & 0xFFFFF; + V.vector4_f32[1] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]); + Element = (UINT)(pSource->v >> 40) & 0xFFFFF; + V.vector4_f32[2] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]); + V.vector4_f32[3] = (FLOAT)(pSource->v >> 60); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT((pSource->v & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 20) & 0xFFFFFull) != 0x80000ull); + XMASSERT(((pSource->v >> 40) & 0xFFFFFull) != 0x80000ull); + XMASSERT(pSource); + // Grab the 64 bit structure + __m128d vResultd = _mm_load_sd(reinterpret_cast(&pSource->v)); + // By shifting down 8 bits, y and z are in seperate 32 bit elements + __m128i vResulti = _mm_srli_si128(reinterpret_cast(&vResultd)[0],8/8); + // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z + XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast(&vResultd)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(1,0,1,0)); + // Fix the entries to x,y,z,w + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0)); + // Mask x,y,z and w + vTemp = _mm_and_ps(vTemp,g_XMMaskIco4); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorXIco4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddXIco4); + // Fix y and w because they are too large + vTemp = _mm_mul_ps(vTemp,g_XMMulIco4); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUIcoN4 +( + CONST XMUICON4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)(pSource->v & 0xFFFFF) / 1048575.0f; + V.vector4_f32[1] = (FLOAT)((pSource->v >> 20) & 0xFFFFF) / 1048575.0f; + V.vector4_f32[2] = (FLOAT)((pSource->v >> 40) & 0xFFFFF) / 1048575.0f; + V.vector4_f32[3] = (FLOAT)(pSource->v >> 60) / 15.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadUIcoN4Mul = {1.0f/1048575.0f,1.0f/(1048575.0f*4096.0f),1.0f/1048575.0f,1.0f/(15.0f*4096.0f*65536.0f)}; + XMASSERT(pSource); + // Grab the 64 bit structure + __m128d vResultd = _mm_load_sd(reinterpret_cast(&pSource->v)); + // By shifting down 8 bits, y and z are in seperate 32 bit elements + __m128i vResulti = _mm_srli_si128(reinterpret_cast(&vResultd)[0],8/8); + // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z + XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast(&vResultd)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(1,0,1,0)); + // Fix the entries to x,y,z,w + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0)); + // Mask x,y,z and w + vTemp = _mm_and_ps(vTemp,g_XMMaskIco4); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMFlipYW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddUIco4); + // Fix y and w because they are too large + vTemp = _mm_mul_ps(vTemp,LoadUIcoN4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUIco4 +( + CONST XMUICO4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)(pSource->v & 0xFFFFF); + V.vector4_f32[1] = (FLOAT)((pSource->v >> 20) & 0xFFFFF); + V.vector4_f32[2] = (FLOAT)((pSource->v >> 40) & 0xFFFFF); + V.vector4_f32[3] = (FLOAT)(pSource->v >> 60); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Grab the 64 bit structure + __m128d vResultd = _mm_load_sd(reinterpret_cast(&pSource->v)); + // By shifting down 8 bits, y and z are in seperate 32 bit elements + __m128i vResulti = _mm_srli_si128(reinterpret_cast(&vResultd)[0],8/8); + // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z + XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast(&vResultd)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(1,0,1,0)); + // Fix the entries to x,y,z,w + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0)); + // Mask x,y,z and w + vTemp = _mm_and_ps(vTemp,g_XMMaskIco4); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMFlipYW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddUIco4); + // Fix y and w because they are too large + vTemp = _mm_mul_ps(vTemp,g_XMMulIco4); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadIcoN4 +( + CONST XMICON4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFF00000}; + static CONST UINT SignExtendW[] = {0x00000000, 0xFFFFFFF0}; + + XMASSERT(pSource); + + Element = (UINT)pSource->v & 0xFFFFF; + V.vector4_f32[0] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f; + Element = (UINT)(pSource->v >> 20) & 0xFFFFF; + V.vector4_f32[1] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f; + Element = (UINT)(pSource->v >> 40) & 0xFFFFF; + V.vector4_f32[2] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]) / 524287.0f; + Element = (UINT)(pSource->v >> 60); + V.vector4_f32[3] = (FLOAT)(INT)(Element | SignExtendW[Element >> 3]) / 7.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadIcoN4Mul = {1.0f/524287.0f,1.0f/(524287.0f*4096.0f),1.0f/524287.0f,1.0f/(7.0f*4096.0f*65536.0f)}; + XMASSERT(pSource); + // Grab the 64 bit structure + __m128d vResultd = _mm_load_sd(reinterpret_cast(&pSource->v)); + // By shifting down 8 bits, y and z are in seperate 32 bit elements + __m128i vResulti = _mm_srli_si128(reinterpret_cast(&vResultd)[0],8/8); + // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z + XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast(&vResultd)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(1,0,1,0)); + // Fix the entries to x,y,z,w + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0)); + // Mask x,y,z and w + vTemp = _mm_and_ps(vTemp,g_XMMaskIco4); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorIco4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddIco4); + // Fix y and w because they are too large + vTemp = _mm_mul_ps(vTemp,LoadIcoN4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadIco4 +( + CONST XMICO4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFF00000}; + static CONST UINT SignExtendW[] = {0x00000000, 0xFFFFFFF0}; + + XMASSERT(pSource); + + Element = (UINT)pSource->v & 0xFFFFF; + V.vector4_f32[0] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]); + Element = (UINT)(pSource->v >> 20) & 0xFFFFF; + V.vector4_f32[1] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]); + Element = (UINT)(pSource->v >> 40) & 0xFFFFF; + V.vector4_f32[2] = (FLOAT)(INT)(Element | SignExtend[Element >> 19]); + Element = (UINT)(pSource->v >> 60); + V.vector4_f32[3] = (FLOAT)(INT)(Element | SignExtendW[Element >> 3]); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Grab the 64 bit structure + __m128d vResultd = _mm_load_sd(reinterpret_cast(&pSource->v)); + // By shifting down 8 bits, y and z are in seperate 32 bit elements + __m128i vResulti = _mm_srli_si128(reinterpret_cast(&vResultd)[0],8/8); + // vResultd has x and w, vResulti has y and z, merge into one as x,w,y,z + XMVECTOR vTemp = _mm_shuffle_ps(reinterpret_cast(&vResultd)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(1,0,1,0)); + // Fix the entries to x,y,z,w + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,3,2,0)); + // Mask x,y,z and w + vTemp = _mm_and_ps(vTemp,g_XMMaskIco4); + // x and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorIco4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddIco4); + // Fix y and w because they are too large + vTemp = _mm_mul_ps(vTemp,g_XMMulIco4); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadXDecN4 +( + CONST XMXDECN4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFFFFC00}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f; + Element = (pSource->v >> 10) & 0x3FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f; + Element = (pSource->v >> 20) & 0x3FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f; + V.vector4_f32[3] = (FLOAT)(pSource->v >> 30) / 3.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Splat the color in all four entries + __m128 vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskA2B10G10R10); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMFlipA2B10G10R10); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMFixAA2B10G10R10); + // Convert 0-255 to 0.0f-1.0f + return _mm_mul_ps(vTemp,g_XMNormalizeA2B10G10R10); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadXDec4 +( + CONST XMXDEC4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFFFFC00}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]); + Element = (pSource->v >> 10) & 0x3FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]); + Element = (pSource->v >> 20) & 0x3FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]); + V.vector4_f32[3] = (FLOAT)(pSource->v >> 30); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200); + static const XMVECTORI32 XDec4Xor = {0x200, 0x200<<10, 0x200<<20, 0x80000000}; + static const XMVECTORF32 XDec4Add = {-512.0f,-512.0f*1024.0f,-512.0f*1024.0f*1024.0f,32768*65536.0f}; + XMASSERT(pSource); + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp,XDec4Xor); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp,XDec4Add); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp,g_XMMulDec4); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUDecN4 +( + CONST XMUDECN4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)Element / 1023.0f; + Element = (pSource->v >> 10) & 0x3FF; + V.vector4_f32[1] = (FLOAT)Element / 1023.0f; + Element = (pSource->v >> 20) & 0x3FF; + V.vector4_f32[2] = (FLOAT)Element / 1023.0f; + V.vector4_f32[3] = (FLOAT)(pSource->v >> 30) / 3.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + static const XMVECTORF32 UDecN4Mul = {1.0f/1023.0f,1.0f/(1023.0f*1024.0f),1.0f/(1023.0f*1024.0f*1024.0f),1.0f/(3.0f*1024.0f*1024.0f*1024.0f)}; + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMAddUDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp,UDecN4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUDec4 +( + CONST XMUDEC4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)Element; + Element = (pSource->v >> 10) & 0x3FF; + V.vector4_f32[1] = (FLOAT)Element; + Element = (pSource->v >> 20) & 0x3FF; + V.vector4_f32[2] = (FLOAT)Element; + V.vector4_f32[3] = (FLOAT)(pSource->v >> 30); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMAddUDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp,g_XMMulDec4); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadDecN4 +( + CONST XMDECN4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFFFFC00}; + static CONST UINT SignExtendW[] = {0x00000000, 0xFFFFFFFC}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 30) & 0x3) != 0x2); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f; + Element = (pSource->v >> 10) & 0x3FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f; + Element = (pSource->v >> 20) & 0x3FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]) / 511.0f; + Element = pSource->v >> 30; + V.vector4_f32[3] = (FLOAT)(SHORT)(Element | SignExtendW[Element >> 1]); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 30) & 0x3) != 0x2); + static const XMVECTORF32 DecN4Mul = {1.0f/511.0f,1.0f/(511.0f*1024.0f),1.0f/(511.0f*1024.0f*1024.0f),1.0f/(1024.0f*1024.0f*1024.0f)}; + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorDec4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMAddDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp,DecN4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadDec4 +( + CONST XMDEC4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + UINT Element; + static CONST UINT SignExtend[] = {0x00000000, 0xFFFFFC00}; + static CONST UINT SignExtendW[] = {0x00000000, 0xFFFFFFFC}; + + XMASSERT(pSource); + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 30) & 0x3) != 0x2); + + Element = pSource->v & 0x3FF; + V.vector4_f32[0] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]); + Element = (pSource->v >> 10) & 0x3FF; + V.vector4_f32[1] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]); + Element = (pSource->v >> 20) & 0x3FF; + V.vector4_f32[2] = (FLOAT)(SHORT)(Element | SignExtend[Element >> 9]); + Element = pSource->v >> 30; + V.vector4_f32[3] = (FLOAT)(SHORT)(Element | SignExtendW[Element >> 1]); + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT((pSource->v & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 10) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 20) & 0x3FF) != 0x200); + XMASSERT(((pSource->v >> 30) & 0x3) != 0x2); + XMASSERT(pSource); + // Splat the color in all four entries + XMVECTOR vTemp = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskDec4); + // a is unsigned! Flip the bit to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorDec4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMAddDec4); + // Convert 0-255 to 0.0f-1.0f + vTemp = _mm_mul_ps(vTemp,g_XMMulDec4); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUByteN4 +( + CONST XMUBYTEN4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)pSource->x / 255.0f; + V.vector4_f32[1] = (FLOAT)pSource->y / 255.0f; + V.vector4_f32[2] = (FLOAT)pSource->z / 255.0f; + V.vector4_f32[3] = (FLOAT)pSource->w / 255.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadUByteN4Mul = {1.0f/255.0f,1.0f/(255.0f*256.0f),1.0f/(255.0f*65536.0f),1.0f/(255.0f*65536.0f*256.0f)}; + XMASSERT(pSource); + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskByte4); + // w is signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp,g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // w + 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddUDec4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp,LoadUByteN4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUByte4 +( + CONST XMUBYTE4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + + V.vector4_f32[0] = (FLOAT)pSource->x; + V.vector4_f32[1] = (FLOAT)pSource->y; + V.vector4_f32[2] = (FLOAT)pSource->z; + V.vector4_f32[3] = (FLOAT)pSource->w; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadUByte4Mul = {1.0f,1.0f/256.0f,1.0f/65536.0f,1.0f/(65536.0f*256.0f)}; + XMASSERT(pSource); + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskByte4); + // w is signed! Flip the bits to convert the order to unsigned + vTemp = _mm_xor_ps(vTemp,g_XMFlipW); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // w + 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddUDec4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp,LoadUByte4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadByteN4 +( + CONST XMBYTEN4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(pSource->x != -128); + XMASSERT(pSource->y != -128); + XMASSERT(pSource->z != -128); + XMASSERT(pSource->w != -128); + + V.vector4_f32[0] = (FLOAT)pSource->x / 127.0f; + V.vector4_f32[1] = (FLOAT)pSource->y / 127.0f; + V.vector4_f32[2] = (FLOAT)pSource->z / 127.0f; + V.vector4_f32[3] = (FLOAT)pSource->w / 127.0f; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadByteN4Mul = {1.0f/127.0f,1.0f/(127.0f*256.0f),1.0f/(127.0f*65536.0f),1.0f/(127.0f*65536.0f*256.0f)}; + XMASSERT(pSource); + XMASSERT(pSource->x != -128); + XMASSERT(pSource->y != -128); + XMASSERT(pSource->z != -128); + XMASSERT(pSource->w != -128); + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskByte4); + // x,y and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorByte4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x, y and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddByte4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp,LoadByteN4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadByte4 +( + CONST XMBYTE4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + + XMASSERT(pSource); + XMASSERT(pSource->x != -128); + XMASSERT(pSource->y != -128); + XMASSERT(pSource->z != -128); + XMASSERT(pSource->w != -128); + + V.vector4_f32[0] = (FLOAT)pSource->x; + V.vector4_f32[1] = (FLOAT)pSource->y; + V.vector4_f32[2] = (FLOAT)pSource->z; + V.vector4_f32[3] = (FLOAT)pSource->w; + + return V; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 LoadByte4Mul = {1.0f,1.0f/256.0f,1.0f/65536.0f,1.0f/(65536.0f*256.0f)}; + XMASSERT(pSource); + XMASSERT(pSource->x != -128); + XMASSERT(pSource->y != -128); + XMASSERT(pSource->z != -128); + XMASSERT(pSource->w != -128); + // Splat the color in all four entries (x,z,y,w) + XMVECTOR vTemp = _mm_load1_ps(reinterpret_cast(&pSource->x)); + // Mask x&0ff,y&0xff00,z&0xff0000,w&0xff000000 + vTemp = _mm_and_ps(vTemp,g_XMMaskByte4); + // x,y and z are unsigned! Flip the bits to convert the order to signed + vTemp = _mm_xor_ps(vTemp,g_XMXorByte4); + // Convert to floating point numbers + vTemp = _mm_cvtepi32_ps(reinterpret_cast(&vTemp)[0]); + // x, y and z - 0x80 to complete the conversion + vTemp = _mm_add_ps(vTemp,g_XMAddByte4); + // Fix y, z and w because they are too large + vTemp = _mm_mul_ps(vTemp,LoadByte4Mul); + return vTemp; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadUNibble4 +( + CONST XMUNIBBLE4* pSource +) +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + static const XMVECTORI32 UNibble4And = {0xF,0xF0,0xF00,0xF000}; + static const XMVECTORF32 UNibble4Mul = {1.0f,1.0f/16.f,1.0f/256.f,1.0f/4096.f}; + XMASSERT(pSource); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,UNibble4And); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Normalize x, y, and z + vResult = _mm_mul_ps(vResult,UNibble4Mul); + return vResult; +#else + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0xF; + V.vector4_f32[0] = (FLOAT)Element; + Element = (pSource->v >> 4) & 0xF; + V.vector4_f32[1] = (FLOAT)Element; + Element = (pSource->v >> 8) & 0xF; + V.vector4_f32[2] = (FLOAT)Element; + Element = (pSource->v >> 12) & 0xF; + V.vector4_f32[3] = (FLOAT)Element; + + return V; +#endif // !_XM_SSE_INTRISICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadU555 +( + CONST XMU555* pSource +) +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + static const XMVECTORI32 U555And = {0x1F,0x1F<<5,0x1F<<10,0x8000}; + static const XMVECTORF32 U555Mul = {1.0f,1.0f/32.f,1.0f/1024.f,1.0f/32768.f}; + XMASSERT(pSource); + // Get the 32 bit value and splat it + XMVECTOR vResult = _mm_load_ps1(reinterpret_cast(&pSource->v)); + // Mask off x, y and z + vResult = _mm_and_ps(vResult,U555And); + // Convert to float + vResult = _mm_cvtepi32_ps(reinterpret_cast(&vResult)[0]); + // Normalize x, y, and z + vResult = _mm_mul_ps(vResult,U555Mul); + return vResult; +#else + XMVECTOR V; + UINT Element; + + XMASSERT(pSource); + + Element = pSource->v & 0x1F; + V.vector4_f32[0] = (FLOAT)Element; + Element = (pSource->v >> 5) & 0x1F; + V.vector4_f32[1] = (FLOAT)Element; + Element = (pSource->v >> 10) & 0x1F; + V.vector4_f32[2] = (FLOAT)Element; + Element = (pSource->v >> 15) & 0x1; + V.vector4_f32[3] = (FLOAT)Element; + + return V; +#endif // !_XM_SSE_INTRISICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMLoadColor +( + CONST XMCOLOR* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMASSERT(pSource); + { + // INT -> Float conversions are done in one instruction. + // UINT -> Float calls a runtime function. Keep in INT + INT iColor = (INT)(pSource->c); + XMVECTOR vColor = { + (FLOAT)((iColor >> 16) & 0xFF) * (1.0f/255.0f), + (FLOAT)((iColor >> 8) & 0xFF) * (1.0f/255.0f), + (FLOAT)(iColor & 0xFF) * (1.0f/255.0f), + (FLOAT)((iColor >> 24) & 0xFF) * (1.0f/255.0f) + }; + return vColor; + } +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Splat the color in all four entries + __m128i vInt = _mm_set1_epi32(pSource->c); + // Shift R&0xFF0000, G&0xFF00, B&0xFF, A&0xFF000000 + vInt = _mm_and_si128(vInt,g_XMMaskA8R8G8B8); + // a is unsigned! Flip the bit to convert the order to signed + vInt = _mm_xor_si128(vInt,g_XMFlipA8R8G8B8); + // Convert to floating point numbers + XMVECTOR vTemp = _mm_cvtepi32_ps(vInt); + // RGB + 0, A + 0x80000000.f to undo the signed order. + vTemp = _mm_add_ps(vTemp,g_XMFixAA8R8G8B8); + // Convert 0-255 to 0.0f-1.0f + return _mm_mul_ps(vTemp,g_XMNormalizeA8R8G8B8); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMLoadFloat3x3 +( + CONST XMFLOAT3X3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + + XMASSERT(pSource); + + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = 0.0f; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = 0.0f; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = 0.0f; + + M.r[3].vector4_f32[0] = 0.0f; + M.r[3].vector4_f32[1] = 0.0f; + M.r[3].vector4_f32[2] = 0.0f; + M.r[3].vector4_f32[3] = 1.0f; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + XMVECTOR V1, V2, V3, Z, T1, T2, T3, T4, T5; + + Z = _mm_setzero_ps(); + + XMASSERT(pSource); + + V1 = _mm_loadu_ps( &pSource->m[0][0] ); + V2 = _mm_loadu_ps( &pSource->m[1][1] ); + V3 = _mm_load_ss( &pSource->m[2][2] ); + + T1 = _mm_unpackhi_ps( V1, Z ); + T2 = _mm_unpacklo_ps( V2, Z ); + T3 = _mm_shuffle_ps( V3, T2, _MM_SHUFFLE( 0, 1, 0, 0 ) ); + T4 = _mm_movehl_ps( T2, T3 ); + T5 = _mm_movehl_ps( Z, T1 ); + + M.r[0] = _mm_movelh_ps( V1, T1 ); + M.r[1] = _mm_add_ps( T4, T5 ); + M.r[2] = _mm_shuffle_ps( V2, V3, _MM_SHUFFLE(1, 0, 3, 2) ); + M.r[3] = g_XMIdentityR3; + + return M; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMLoadFloat4x3 +( + CONST XMFLOAT4X3* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX M; + XMASSERT(pSource); + + ((UINT *)(&M.r[0].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[0][0]))[0]; + ((UINT *)(&M.r[0].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[0][1]))[0]; + ((UINT *)(&M.r[0].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[0][2]))[0]; + M.r[0].vector4_f32[3] = 0.0f; + + ((UINT *)(&M.r[1].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[1][0]))[0]; + ((UINT *)(&M.r[1].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[1][1]))[0]; + ((UINT *)(&M.r[1].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[1][2]))[0]; + M.r[1].vector4_f32[3] = 0.0f; + + ((UINT *)(&M.r[2].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[2][0]))[0]; + ((UINT *)(&M.r[2].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[2][1]))[0]; + ((UINT *)(&M.r[2].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[2][2]))[0]; + M.r[2].vector4_f32[3] = 0.0f; + + ((UINT *)(&M.r[3].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[3][0]))[0]; + ((UINT *)(&M.r[3].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[3][1]))[0]; + ((UINT *)(&M.r[3].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[3][2]))[0]; + M.r[3].vector4_f32[3] = 1.0f; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Use unaligned load instructions to + // load the 12 floats + // vTemp1 = x1,y1,z1,x2 + XMVECTOR vTemp1 = _mm_loadu_ps(&pSource->m[0][0]); + // vTemp2 = y2,z2,x3,y3 + XMVECTOR vTemp2 = _mm_loadu_ps(&pSource->m[1][1]); + // vTemp4 = z3,x4,y4,z4 + XMVECTOR vTemp4 = _mm_loadu_ps(&pSource->m[2][2]); + // vTemp3 = x3,y3,z3,z3 + XMVECTOR vTemp3 = _mm_shuffle_ps(vTemp2,vTemp4,_MM_SHUFFLE(0,0,3,2)); + // vTemp2 = y2,z2,x2,x2 + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp1,_MM_SHUFFLE(3,3,1,0)); + // vTemp2 = x2,y2,z2,z2 + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp2,_MM_SHUFFLE(1,1,0,2)); + // vTemp1 = x1,y1,z1,0 + vTemp1 = _mm_and_ps(vTemp1,g_XMMask3); + // vTemp2 = x2,y2,z2,0 + vTemp2 = _mm_and_ps(vTemp2,g_XMMask3); + // vTemp3 = x3,y3,z3,0 + vTemp3 = _mm_and_ps(vTemp3,g_XMMask3); + // vTemp4i = x4,y4,z4,0 + __m128i vTemp4i = _mm_srli_si128(reinterpret_cast(&vTemp4)[0],32/8); + // vTemp4i = x4,y4,z4,1.0f + vTemp4i = _mm_or_si128(vTemp4i,g_XMIdentityR3); + XMMATRIX M(vTemp1, + vTemp2, + vTemp3, + reinterpret_cast(&vTemp4i)[0]); + return M; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMLoadFloat4x3A +( + CONST XMFLOAT4X3A* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = 0.0f; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = 0.0f; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = 0.0f; + + M.r[3].vector4_f32[0] = pSource->m[3][0]; + M.r[3].vector4_f32[1] = pSource->m[3][1]; + M.r[3].vector4_f32[2] = pSource->m[3][2]; + M.r[3].vector4_f32[3] = 1.0f; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + // Use aligned load instructions to + // load the 12 floats + // vTemp1 = x1,y1,z1,x2 + XMVECTOR vTemp1 = _mm_load_ps(&pSource->m[0][0]); + // vTemp2 = y2,z2,x3,y3 + XMVECTOR vTemp2 = _mm_load_ps(&pSource->m[1][1]); + // vTemp4 = z3,x4,y4,z4 + XMVECTOR vTemp4 = _mm_load_ps(&pSource->m[2][2]); + // vTemp3 = x3,y3,z3,z3 + XMVECTOR vTemp3 = _mm_shuffle_ps(vTemp2,vTemp4,_MM_SHUFFLE(0,0,3,2)); + // vTemp2 = y2,z2,x2,x2 + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp1,_MM_SHUFFLE(3,3,1,0)); + // vTemp2 = x2,y2,z2,z2 + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp2,_MM_SHUFFLE(1,1,0,2)); + // vTemp1 = x1,y1,z1,0 + vTemp1 = _mm_and_ps(vTemp1,g_XMMask3); + // vTemp2 = x2,y2,z2,0 + vTemp2 = _mm_and_ps(vTemp2,g_XMMask3); + // vTemp3 = x3,y3,z3,0 + vTemp3 = _mm_and_ps(vTemp3,g_XMMask3); + // vTemp4i = x4,y4,z4,0 + __m128i vTemp4i = _mm_srli_si128(reinterpret_cast(&vTemp4)[0],32/8); + // vTemp4i = x4,y4,z4,1.0f + vTemp4i = _mm_or_si128(vTemp4i,g_XMIdentityR3); + XMMATRIX M(vTemp1, + vTemp2, + vTemp3, + reinterpret_cast(&vTemp4i)[0]); + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMLoadFloat4x4 +( + CONST XMFLOAT4X4* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX M; + XMASSERT(pSource); + + ((UINT *)(&M.r[0].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[0][0]))[0]; + ((UINT *)(&M.r[0].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[0][1]))[0]; + ((UINT *)(&M.r[0].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[0][2]))[0]; + ((UINT *)(&M.r[0].vector4_f32[3]))[0] = ((const UINT *)(&pSource->m[0][3]))[0]; + + ((UINT *)(&M.r[1].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[1][0]))[0]; + ((UINT *)(&M.r[1].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[1][1]))[0]; + ((UINT *)(&M.r[1].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[1][2]))[0]; + ((UINT *)(&M.r[1].vector4_f32[3]))[0] = ((const UINT *)(&pSource->m[1][3]))[0]; + + ((UINT *)(&M.r[2].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[2][0]))[0]; + ((UINT *)(&M.r[2].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[2][1]))[0]; + ((UINT *)(&M.r[2].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[2][2]))[0]; + ((UINT *)(&M.r[2].vector4_f32[3]))[0] = ((const UINT *)(&pSource->m[2][3]))[0]; + + ((UINT *)(&M.r[3].vector4_f32[0]))[0] = ((const UINT *)(&pSource->m[3][0]))[0]; + ((UINT *)(&M.r[3].vector4_f32[1]))[0] = ((const UINT *)(&pSource->m[3][1]))[0]; + ((UINT *)(&M.r[3].vector4_f32[2]))[0] = ((const UINT *)(&pSource->m[3][2]))[0]; + ((UINT *)(&M.r[3].vector4_f32[3]))[0] = ((const UINT *)(&pSource->m[3][3]))[0]; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSource); + XMMATRIX M; + + M.r[0] = _mm_loadu_ps( &pSource->_11 ); + M.r[1] = _mm_loadu_ps( &pSource->_21 ); + M.r[2] = _mm_loadu_ps( &pSource->_31 ); + M.r[3] = _mm_loadu_ps( &pSource->_41 ); + + return M; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMLoadFloat4x4A +( + CONST XMFLOAT4X4A* pSource +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + + XMASSERT(pSource); + XMASSERT(((UINT_PTR)pSource & 0xF) == 0); + + M.r[0].vector4_f32[0] = pSource->m[0][0]; + M.r[0].vector4_f32[1] = pSource->m[0][1]; + M.r[0].vector4_f32[2] = pSource->m[0][2]; + M.r[0].vector4_f32[3] = pSource->m[0][3]; + + M.r[1].vector4_f32[0] = pSource->m[1][0]; + M.r[1].vector4_f32[1] = pSource->m[1][1]; + M.r[1].vector4_f32[2] = pSource->m[1][2]; + M.r[1].vector4_f32[3] = pSource->m[1][3]; + + M.r[2].vector4_f32[0] = pSource->m[2][0]; + M.r[2].vector4_f32[1] = pSource->m[2][1]; + M.r[2].vector4_f32[2] = pSource->m[2][2]; + M.r[2].vector4_f32[3] = pSource->m[2][3]; + + M.r[3].vector4_f32[0] = pSource->m[3][0]; + M.r[3].vector4_f32[1] = pSource->m[3][1]; + M.r[3].vector4_f32[2] = pSource->m[3][2]; + M.r[3].vector4_f32[3] = pSource->m[3][3]; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + + XMASSERT(pSource); + + M.r[0] = _mm_load_ps( &pSource->_11 ); + M.r[1] = _mm_load_ps( &pSource->_21 ); + M.r[2] = _mm_load_ps( &pSource->_31 ); + M.r[3] = _mm_load_ps( &pSource->_41 ); + + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +/**************************************************************************** + * + * Vector and matrix store operations + * + ****************************************************************************/ + +XMFINLINE VOID XMStoreInt +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + *pDestination = XMVectorGetIntX( V ); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + _mm_store_ss( (float*)pDestination, V ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat +( + FLOAT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + *pDestination = XMVectorGetX( V ); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + _mm_store_ss( pDestination, V ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreInt2 +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + XMVECTOR T = _mm_shuffle_ps( V, V, _MM_SHUFFLE( 1, 1, 1, 1 ) ); + _mm_store_ss( (float*)&pDestination[0], V ); + _mm_store_ss( (float*)&pDestination[1], T ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreInt2A +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + _mm_storel_epi64( (__m128i*)pDestination, reinterpret_cast(&V)[0] ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat2 +( + XMFLOAT2* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + XMVECTOR T = _mm_shuffle_ps( V, V, _MM_SHUFFLE( 1, 1, 1, 1 ) ); + _mm_store_ss( &pDestination->x, V ); + _mm_store_ss( &pDestination->y, T ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat2A +( + XMFLOAT2A* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + _mm_storel_epi64( (__m128i*)pDestination, reinterpret_cast(&V)[0] ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreHalf2 +( + XMHALF2* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + + pDestination->x = XMConvertFloatToHalf(V.vector4_f32[0]); + pDestination->y = XMConvertFloatToHalf(V.vector4_f32[1]); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + pDestination->x = XMConvertFloatToHalf(XMVectorGetX(V)); + pDestination->y = XMConvertFloatToHalf(XMVectorGetY(V)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreShortN2 +( + XMSHORTN2* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + N = XMVectorRound(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Scale = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + + XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + vResult = _mm_mul_ps(vResult,Scale); + __m128i vResulti = _mm_cvtps_epi32(vResult); + vResulti = _mm_packs_epi32(vResulti,vResulti); + _mm_store_ss(reinterpret_cast(&pDestination->x),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreShort2 +( + XMSHORT2* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-32767.0f, -32767.0f, -32767.0f, -32767.0f}; + static CONST XMVECTOR Max = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + N = XMVectorRound(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Min = {-32767.0f, -32767.0f, -32767.0f, -32767.0f}; + static CONST XMVECTORF32 Max = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,Min); + vResult = _mm_min_ps(vResult,Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Pack the ints into shorts + vInt = _mm_packs_epi32(vInt,vInt); + _mm_store_ss(reinterpret_cast(&pDestination->x),reinterpret_cast(&vInt)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUShortN2 +( + XMUSHORTN2* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v); + N = XMVectorMultiplyAdd(N, Scale.v, g_XMOneHalf.v); + N = XMVectorTruncate(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Scale = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + vResult = _mm_mul_ps(vResult,Scale); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt,0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt,2)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUShort2 +( + XMUSHORT2* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Max = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max); + N = XMVectorRound(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Max = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt,0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt,2)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreInt3 +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + XMVECTOR T1 = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR T2 = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + _mm_store_ss( (float*)pDestination, V ); + _mm_store_ss( (float*)&pDestination[1], T1 ); + _mm_store_ss( (float*)&pDestination[2], T2 ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreInt3A +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + XMVECTOR T = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + _mm_storel_epi64( (__m128i*)pDestination, reinterpret_cast(&V)[0] ); + _mm_store_ss( (float*)&pDestination[2], T ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat3 +( + XMFLOAT3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + XMVECTOR T1 = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR T2 = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + _mm_store_ss( &pDestination->x, V ); + _mm_store_ss( &pDestination->y, T1 ); + _mm_store_ss( &pDestination->z, T2 ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat3A +( + XMFLOAT3A* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; + +#elif defined(_XM_SSE_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + XMVECTOR T = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + _mm_storel_epi64( (__m128i*)pDestination, reinterpret_cast(&V)[0] ); + _mm_store_ss( &pDestination->z, T ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUHenDN3 +( + XMUHENDN3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {2047.0f, 2047.0f, 1023.0f, 0.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + + pDestination->v = (((UINT)N.vector4_f32[2] & 0x3FF) << 22) | + (((UINT)N.vector4_f32[1] & 0x7FF) << 11) | + (((UINT)N.vector4_f32[0] & 0x7FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleUHenDN3 = {2047.0f, 2047.0f*2048.0f,1023.0f*(2048.0f*2048.0f)/2.0f,1.0f}; + static const XMVECTORI32 MaskUHenDN3 = {0x7FF,0x7FF<<11,0x3FF<<(22-1),0}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUHenDN3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUHenDN3); + // Do a horizontal or of 3 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(0,3,2,1)); + // i = x|y + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti2,_MM_SHUFFLE(0,3,2,1)); + // Add Z to itself to perform a single bit left shift + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUHenD3 +( + XMUHEND3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Max = {2047.0f, 2047.0f, 1023.0f, 0.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max); + + pDestination->v = (((UINT)N.vector4_f32[2] & 0x3FF) << 22) | + (((UINT)N.vector4_f32[1] & 0x7FF) << 11) | + (((UINT)N.vector4_f32[0] & 0x7FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MaxUHenD3 = { 2047.0f, 2047.0f, 1023.0f, 1.0f}; + static const XMVECTORF32 ScaleUHenD3 = {1.0f, 2048.0f,(2048.0f*2048.0f)/2.0f,1.0f}; + static const XMVECTORI32 MaskUHenD3 = {0x7FF,0x7FF<<11,0x3FF<<(22-1),0}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,MaxUHenD3); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUHenD3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUHenD3); + // Do a horizontal or of 3 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(0,3,2,1)); + // i = x|y + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti2,_MM_SHUFFLE(0,3,2,1)); + // Add Z to itself to perform a single bit left shift + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreHenDN3 +( + XMHENDN3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {1023.0f, 1023.0f, 511.0f, 1.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + + pDestination->v = (((INT)N.vector4_f32[2] & 0x3FF) << 22) | + (((INT)N.vector4_f32[1] & 0x7FF) << 11) | + (((INT)N.vector4_f32[0] & 0x7FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleHenDN3 = {1023.0f, 1023.0f*2048.0f,511.0f*(2048.0f*2048.0f),1.0f}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleHenDN3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,g_XMMaskHenD3); + // Do a horizontal or of all 4 entries + vResult = _mm_shuffle_ps(reinterpret_cast(&vResulti)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreHenD3 +( + XMHEND3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-1023.0f, -1023.0f, -511.0f, -1.0f}; + static CONST XMVECTOR Max = {1023.0f, 1023.0f, 511.0f, 1.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + + pDestination->v = (((INT)N.vector4_f32[2] & 0x3FF) << 22) | + (((INT)N.vector4_f32[1] & 0x7FF) << 11) | + (((INT)N.vector4_f32[0] & 0x7FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MinHenD3 = {-1023.0f,-1023.0f,-511.0f,-1.0f}; + static const XMVECTORF32 MaxHenD3 = { 1023.0f, 1023.0f, 511.0f, 1.0f}; + static const XMVECTORF32 ScaleHenD3 = {1.0f, 2048.0f,(2048.0f*2048.0f),1.0f}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,MinHenD3); + vResult = _mm_min_ps(vResult,MaxHenD3); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleHenD3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,g_XMMaskHenD3); + // Do a horizontal or of all 4 entries + vResult = _mm_shuffle_ps(reinterpret_cast(&vResulti)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUDHenN3 +( + XMUDHENN3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {1023.0f, 2047.0f, 2047.0f, 0.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + + pDestination->v = (((UINT)N.vector4_f32[2] & 0x7FF) << 21) | + (((UINT)N.vector4_f32[1] & 0x7FF) << 10) | + (((UINT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleUDHenN3 = {1023.0f,2047.0f*1024.0f,2047.0f*(1024.0f*2048.0f)/2.0f,1.0f}; + static const XMVECTORI32 MaskUDHenN3 = {0x3FF,0x7FF<<10,0x7FF<<(21-1),0}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUDHenN3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUDHenN3); + // Do a horizontal or of 3 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(0,3,2,1)); + // i = x|y + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti2,_MM_SHUFFLE(0,3,2,1)); + // Add Z to itself to perform a single bit left shift + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUDHen3 +( + XMUDHEN3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Max = {1023.0f, 2047.0f, 2047.0f, 0.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max); + + pDestination->v = (((UINT)N.vector4_f32[2] & 0x7FF) << 21) | + (((UINT)N.vector4_f32[1] & 0x7FF) << 10) | + (((UINT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MaxUDHen3 = { 1023.0f, 2047.0f, 2047.0f, 1.0f}; + static const XMVECTORF32 ScaleUDHen3 = {1.0f, 1024.0f,(1024.0f*2048.0f)/2.0f,1.0f}; + static const XMVECTORI32 MaskUDHen3 = {0x3FF,0x7FF<<10,0x7FF<<(21-1),0}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,MaxUDHen3); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUDHen3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUDHen3); + // Do a horizontal or of 3 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(0,3,2,1)); + // i = x|y + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti2,_MM_SHUFFLE(0,3,2,1)); + // Add Z to itself to perform a single bit left shift + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreDHenN3 +( + XMDHENN3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {511.0f, 1023.0f, 1023.0f, 1.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + + pDestination->v = (((INT)N.vector4_f32[2] & 0x7FF) << 21) | + (((INT)N.vector4_f32[1] & 0x7FF) << 10) | + (((INT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleDHenN3 = {511.0f, 1023.0f*1024.0f,1023.0f*(1024.0f*2048.0f),1.0f}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleDHenN3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,g_XMMaskDHen3); + // Do a horizontal or of all 4 entries + vResult = _mm_shuffle_ps(reinterpret_cast(&vResulti)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreDHen3 +( + XMDHEN3* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-511.0f, -1023.0f, -1023.0f, -1.0f}; + static CONST XMVECTOR Max = {511.0f, 1023.0f, 1023.0f, 1.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + + pDestination->v = (((INT)N.vector4_f32[2] & 0x7FF) << 21) | + (((INT)N.vector4_f32[1] & 0x7FF) << 10) | + (((INT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MinDHen3 = {-511.0f,-1023.0f,-1023.0f,-1.0f}; + static const XMVECTORF32 MaxDHen3 = { 511.0f, 1023.0f, 1023.0f, 1.0f}; + static const XMVECTORF32 ScaleDHen3 = {1.0f, 1024.0f,(1024.0f*2048.0f),1.0f}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,MinDHen3); + vResult = _mm_min_ps(vResult,MaxDHen3); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleDHen3); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,g_XMMaskDHen3); + // Do a horizontal or of all 4 entries + vResult = _mm_shuffle_ps(reinterpret_cast(&vResulti)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreU565 +( + XMU565* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Max = {31.0f, 63.0f, 31.0f, 0.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + USHORT x = static_cast(_mm_extract_epi16(vInt,0)); + USHORT y = static_cast(_mm_extract_epi16(vInt,2)); + USHORT z = static_cast(_mm_extract_epi16(vInt,4)); + pDestination->v = ((z & 0x1F) << 11) | + ((y & 0x3F) << 5) | + ((x & 0x1F)); +#else + XMVECTOR N; + static CONST XMVECTORF32 Max = {31.0f, 63.0f, 31.0f, 0.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max.v); + N = XMVectorRound(N); + + pDestination->v = (((USHORT)N.vector4_f32[2] & 0x1F) << 11) | + (((USHORT)N.vector4_f32[1] & 0x3F) << 5) | + (((USHORT)N.vector4_f32[0] & 0x1F)); +#endif !_XM_SSE_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat3PK +( + XMFLOAT3PK* pDestination, + FXMVECTOR V +) +{ + _DECLSPEC_ALIGN_16_ UINT IValue[4]; + UINT I, Sign, j; + UINT Result[3]; + + XMASSERT(pDestination); + + XMStoreFloat3A( (XMFLOAT3A*)&IValue, V ); + + // X & Y Channels (5-bit exponent, 6-bit mantissa) + for(j=0; j < 2; ++j) + { + Sign = IValue[j] & 0x80000000; + I = IValue[j] & 0x7FFFFFFF; + + if ((I & 0x7F800000) == 0x7F800000) + { + // INF or NAN + Result[j] = 0x7c0; + if (( I & 0x7FFFFF ) != 0) + { + Result[j] = 0x7c0 | (((I>>17)|(I>11)|(I>>6)|(I))&0x3f); + } + else if ( Sign ) + { + // -INF is clamped to 0 since 3PK is positive only + Result[j] = 0; + } + } + else if ( Sign ) + { + // 3PK is positive only, so clamp to zero + Result[j] = 0; + } + else if (I > 0x477E0000U) + { + // The number is too large to be represented as a float11, set to max + Result[j] = 0x7BF; + } + else + { + if (I < 0x38800000U) + { + // The number is too small to be represented as a normalized float11 + // Convert it to a denormalized value. + UINT Shift = 113U - (I >> 23U); + I = (0x800000U | (I & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized float11 + I += 0xC8000000U; + } + + Result[j] = ((I + 0xFFFFU + ((I >> 17U) & 1U)) >> 17U)&0x7ffU; + } + } + + // Z Channel (5-bit exponent, 5-bit mantissa) + Sign = IValue[2] & 0x80000000; + I = IValue[2] & 0x7FFFFFFF; + + if ((I & 0x7F800000) == 0x7F800000) + { + // INF or NAN + Result[2] = 0x3e0; + if ( I & 0x7FFFFF ) + { + Result[2] = 0x3e0 | (((I>>18)|(I>13)|(I>>3)|(I))&0x1f); + } + else if ( Sign ) + { + // -INF is clamped to 0 since 3PK is positive only + Result[2] = 0; + } + } + else if ( Sign ) + { + // 3PK is positive only, so clamp to zero + Result[2] = 0; + } + else if (I > 0x477C0000U) + { + // The number is too large to be represented as a float10, set to max + Result[2] = 0x3df; + } + else + { + if (I < 0x38800000U) + { + // The number is too small to be represented as a normalized float10 + // Convert it to a denormalized value. + UINT Shift = 113U - (I >> 23U); + I = (0x800000U | (I & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized float10 + I += 0xC8000000U; + } + + Result[2] = ((I + 0x1FFFFU + ((I >> 18U) & 1U)) >> 18U)&0x3ffU; + } + + // Pack Result into memory + pDestination->v = (Result[0] & 0x7ff) + | ( (Result[1] & 0x7ff) << 11 ) + | ( (Result[2] & 0x3ff) << 22 ); +} + + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat3SE +( + XMFLOAT3SE* pDestination, + FXMVECTOR V +) +{ + _DECLSPEC_ALIGN_16_ UINT IValue[4]; + UINT I, Sign, j, T; + UINT Frac[3]; + UINT Exp[3]; + + + XMASSERT(pDestination); + + XMStoreFloat3A( (XMFLOAT3A*)&IValue, V ); + + // X, Y, Z Channels (5-bit exponent, 9-bit mantissa) + for(j=0; j < 3; ++j) + { + Sign = IValue[j] & 0x80000000; + I = IValue[j] & 0x7FFFFFFF; + + if ((I & 0x7F800000) == 0x7F800000) + { + // INF or NAN + Exp[j] = 0x1f; + if (( I & 0x7FFFFF ) != 0) + { + Frac[j] = ((I>>14)|(I>5)|(I))&0x1ff; + } + else if ( Sign ) + { + // -INF is clamped to 0 since 3SE is positive only + Exp[j] = Frac[j] = 0; + } + } + else if ( Sign ) + { + // 3SE is positive only, so clamp to zero + Exp[j] = Frac[j] = 0; + } + else if (I > 0x477FC000U) + { + // The number is too large, set to max + Exp[j] = 0x1e; + Frac[j] = 0x1ff; + } + else + { + if (I < 0x38800000U) + { + // The number is too small to be represented as a normalized float11 + // Convert it to a denormalized value. + UINT Shift = 113U - (I >> 23U); + I = (0x800000U | (I & 0x7FFFFFU)) >> Shift; + } + else + { + // Rebias the exponent to represent the value as a normalized float11 + I += 0xC8000000U; + } + + T = ((I + 0x1FFFU + ((I >> 14U) & 1U)) >> 14U)&0x3fffU; + + Exp[j] = (T & 0x3E00) >> 9; + Frac[j] = T & 0x1ff; + } + } + + // Adjust to a shared exponent + T = XMMax( Exp[0], XMMax( Exp[1], Exp[2] ) ); + + Frac[0] = Frac[0] >> (T - Exp[0]); + Frac[1] = Frac[1] >> (T - Exp[1]); + Frac[2] = Frac[2] >> (T - Exp[2]); + + // Store packed into memory + pDestination->xm = Frac[0]; + pDestination->ym = Frac[1]; + pDestination->zm = Frac[2]; + pDestination->e = T; +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreInt4 +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; + pDestination[3] = V.vector4_u32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + + _mm_storeu_si128( (__m128i*)pDestination, reinterpret_cast(&V)[0] ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreInt4A +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; + pDestination[3] = V.vector4_u32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + _mm_store_si128( (__m128i*)pDestination, reinterpret_cast(&V)[0] ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreInt4NC +( + UINT* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + pDestination[0] = V.vector4_u32[0]; + pDestination[1] = V.vector4_u32[1]; + pDestination[2] = V.vector4_u32[2]; + pDestination[3] = V.vector4_u32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + _mm_storeu_si128( (__m128i*)pDestination, reinterpret_cast(&V)[0] ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4 +( + XMFLOAT4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; + pDestination->w = V.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + + _mm_storeu_ps( &pDestination->x, V ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4A +( + XMFLOAT4A* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; + pDestination->w = V.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + _mm_store_ps( &pDestination->x, V ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4NC +( + XMFLOAT4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + pDestination->x = V.vector4_f32[0]; + pDestination->y = V.vector4_f32[1]; + pDestination->z = V.vector4_f32[2]; + pDestination->w = V.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 3) == 0); + + _mm_storeu_ps( &pDestination->x, V ); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreHalf4 +( + XMHALF4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + + pDestination->x = XMConvertFloatToHalf(V.vector4_f32[0]); + pDestination->y = XMConvertFloatToHalf(V.vector4_f32[1]); + pDestination->z = XMConvertFloatToHalf(V.vector4_f32[2]); + pDestination->w = XMConvertFloatToHalf(V.vector4_f32[3]); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + pDestination->x = XMConvertFloatToHalf(XMVectorGetX(V)); + pDestination->y = XMConvertFloatToHalf(XMVectorGetY(V)); + pDestination->z = XMConvertFloatToHalf(XMVectorGetZ(V)); + pDestination->w = XMConvertFloatToHalf(XMVectorGetW(V)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreShortN4 +( + XMSHORTN4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + N = XMVectorRound(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + pDestination->z = (SHORT)N.vector4_f32[2]; + pDestination->w = (SHORT)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Scale = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + + XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + vResult = _mm_mul_ps(vResult,Scale); + __m128i vResulti = _mm_cvtps_epi32(vResult); + vResulti = _mm_packs_epi32(vResulti,vResulti); + _mm_store_sd(reinterpret_cast(&pDestination->x),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreShort4 +( + XMSHORT4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-32767.0f, -32767.0f, -32767.0f, -32767.0f}; + static CONST XMVECTOR Max = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + N = XMVectorRound(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + pDestination->z = (SHORT)N.vector4_f32[2]; + pDestination->w = (SHORT)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Min = {-32767.0f, -32767.0f, -32767.0f, -32767.0f}; + static CONST XMVECTORF32 Max = {32767.0f, 32767.0f, 32767.0f, 32767.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,Min); + vResult = _mm_min_ps(vResult,Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Pack the ints into shorts + vInt = _mm_packs_epi32(vInt,vInt); + _mm_store_sd(reinterpret_cast(&pDestination->x),reinterpret_cast(&vInt)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUShortN4 +( + XMUSHORTN4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v); + N = XMVectorMultiplyAdd(N, Scale.v, g_XMOneHalf.v); + N = XMVectorTruncate(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + pDestination->z = (SHORT)N.vector4_f32[2]; + pDestination->w = (SHORT)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Scale = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + vResult = _mm_mul_ps(vResult,Scale); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt,0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt,2)); + pDestination->z = static_cast(_mm_extract_epi16(vInt,4)); + pDestination->w = static_cast(_mm_extract_epi16(vInt,6)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUShort4 +( + XMUSHORT4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Max = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max); + N = XMVectorRound(N); + + pDestination->x = (SHORT)N.vector4_f32[0]; + pDestination->y = (SHORT)N.vector4_f32[1]; + pDestination->z = (SHORT)N.vector4_f32[2]; + pDestination->w = (SHORT)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Max = {65535.0f, 65535.0f, 65535.0f, 65535.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // Since the SSE pack instruction clamps using signed rules, + // manually extract the values to store them to memory + pDestination->x = static_cast(_mm_extract_epi16(vInt,0)); + pDestination->y = static_cast(_mm_extract_epi16(vInt,2)); + pDestination->z = static_cast(_mm_extract_epi16(vInt,4)); + pDestination->w = static_cast(_mm_extract_epi16(vInt,6)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreXIcoN4 +( + XMXICON4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Min = {-1.0f, -1.0f, -1.0f, 0.0f}; + static CONST XMVECTORF32 Scale = {524287.0f, 524287.0f, 524287.0f, 15.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + N = XMVectorRound(N); + + pDestination->v = ((UINT64)N.vector4_f32[3] << 60) | + (((INT64)N.vector4_f32[2] & 0xFFFFF) << 40) | + (((INT64)N.vector4_f32[1] & 0xFFFFF) << 20) | + (((INT64)N.vector4_f32[0] & 0xFFFFF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + // Note: Masks are x,w,y and z + static const XMVECTORF32 MinXIcoN4 = {-1.0f, 0.0f,-1.0f,-1.0f}; + static const XMVECTORF32 ScaleXIcoN4 = {524287.0f,15.0f*4096.0f*65536.0f*0.5f,524287.0f*4096.0f,524287.0f}; + static const XMVECTORI32 MaskXIcoN4 = {0xFFFFF,0xF<<((60-32)-1),0xFFFFF000,0xFFFFF}; + + // Clamp to bounds + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0)); + vResult = _mm_max_ps(vResult,MinXIcoN4); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleXIcoN4); + // Convert to integer (w is unsigned) + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off unused bits + vResulti = _mm_and_si128(vResulti,MaskXIcoN4); + // Isolate Y + __m128i vResulti2 = _mm_and_si128(vResulti,g_XMMaskY); + // Double Y (Really W) to fixup for unsigned conversion + vResulti = _mm_add_epi32(vResulti,vResulti2); + // Shift y and z to straddle the 32-bit boundary + vResulti2 = _mm_srli_si128(vResulti,(64+12)/8); + // Shift it into place + vResulti2 = _mm_slli_si128(vResulti2,20/8); + // i = x|y<<20|z<<40|w<<60 + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_sd(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreXIco4 +( + XMXICO4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Min = {-524287.0f, -524287.0f, -524287.0f, 0.0f}; + static CONST XMVECTORF32 Max = {524287.0f, 524287.0f, 524287.0f, 15.0f}; + + XMASSERT(pDestination); + N = XMVectorClamp(V, Min.v, Max.v); + pDestination->v = ((UINT64)N.vector4_f32[3] << 60) | + (((INT64)N.vector4_f32[2] & 0xFFFFF) << 40) | + (((INT64)N.vector4_f32[1] & 0xFFFFF) << 20) | + (((INT64)N.vector4_f32[0] & 0xFFFFF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + // Note: Masks are x,w,y and z + static const XMVECTORF32 MinXIco4 = {-524287.0f, 0.0f,-524287.0f,-524287.0f}; + static const XMVECTORF32 MaxXIco4 = { 524287.0f,15.0f, 524287.0f, 524287.0f}; + static const XMVECTORF32 ScaleXIco4 = {1.0f,4096.0f*65536.0f*0.5f,4096.0f,1.0f}; + static const XMVECTORI32 MaskXIco4 = {0xFFFFF,0xF<<((60-1)-32),0xFFFFF000,0xFFFFF}; + // Clamp to bounds + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0)); + vResult = _mm_max_ps(vResult,MinXIco4); + vResult = _mm_min_ps(vResult,MaxXIco4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleXIco4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskXIco4); + // Isolate Y + __m128i vResulti2 = _mm_and_si128(vResulti,g_XMMaskY); + // Double Y (Really W) to fixup for unsigned conversion + vResulti = _mm_add_epi32(vResulti,vResulti2); + // Shift y and z to straddle the 32-bit boundary + vResulti2 = _mm_srli_si128(vResulti,(64+12)/8); + // Shift it into place + vResulti2 = _mm_slli_si128(vResulti2,20/8); + // i = x|y<<20|z<<40|w<<60 + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_sd(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUIcoN4 +( + XMUICON4* pDestination, + FXMVECTOR V +) +{ + #define XM_URange ((FLOAT)(1 << 20)) + #define XM_URangeDiv2 ((FLOAT)(1 << 19)) + #define XM_UMaxXYZ ((FLOAT)((1 << 20) - 1)) + #define XM_UMaxW ((FLOAT)((1 << 4) - 1)) + #define XM_ScaleXYZ (-(FLOAT)((1 << 20) - 1) / XM_PACK_FACTOR) + #define XM_ScaleW (-(FLOAT)((1 << 4) - 1) / XM_PACK_FACTOR) + #define XM_Scale (-1.0f / XM_PACK_FACTOR) + #define XM_Offset (3.0f) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {1048575.0f, 1048575.0f, 1048575.0f, 15.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v); + N = XMVectorMultiplyAdd(N, Scale.v, g_XMOneHalf.v); + + pDestination->v = ((UINT64)N.vector4_f32[3] << 60) | + (((UINT64)N.vector4_f32[2] & 0xFFFFF) << 40) | + (((UINT64)N.vector4_f32[1] & 0xFFFFF) << 20) | + (((UINT64)N.vector4_f32[0] & 0xFFFFF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + // Note: Masks are x,w,y and z + static const XMVECTORF32 ScaleUIcoN4 = {1048575.0f,15.0f*4096.0f*65536.0f,1048575.0f*4096.0f,1048575.0f}; + static const XMVECTORI32 MaskUIcoN4 = {0xFFFFF,0xF<<(60-32),0xFFFFF000,0xFFFFF}; + static const XMVECTORF32 AddUIcoN4 = {0.0f,-32768.0f*65536.0f,-32768.0f*65536.0f,0.0f}; + // Clamp to bounds + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0)); + vResult = _mm_max_ps(vResult,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUIcoN4); + // Adjust for unsigned entries + vResult = _mm_add_ps(vResult,AddUIcoN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Fix the signs on the unsigned entries + vResulti = _mm_xor_si128(vResulti,g_XMFlipYZ); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUIcoN4); + // Shift y and z to straddle the 32-bit boundary + __m128i vResulti2 = _mm_srli_si128(vResulti,(64+12)/8); + // Shift it into place + vResulti2 = _mm_slli_si128(vResulti2,20/8); + // i = x|y<<20|z<<40|w<<60 + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_sd(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ + + #undef XM_URange + #undef XM_URangeDiv2 + #undef XM_UMaxXYZ + #undef XM_UMaxW + #undef XM_ScaleXYZ + #undef XM_ScaleW + #undef XM_Scale + #undef XM_Offset +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUIco4 +( + XMUICO4* pDestination, + FXMVECTOR V +) +{ + #define XM_Scale (-1.0f / XM_PACK_FACTOR) + #define XM_URange ((FLOAT)(1 << 20)) + #define XM_URangeDiv2 ((FLOAT)(1 << 19)) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Max = {1048575.0f, 1048575.0f, 1048575.0f, 15.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max); + N = XMVectorRound(N); + + pDestination->v = ((UINT64)N.vector4_f32[3] << 60) | + (((UINT64)N.vector4_f32[2] & 0xFFFFF) << 40) | + (((UINT64)N.vector4_f32[1] & 0xFFFFF) << 20) | + (((UINT64)N.vector4_f32[0] & 0xFFFFF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + // Note: Masks are x,w,y and z + static const XMVECTORF32 MaxUIco4 = { 1048575.0f, 15.0f, 1048575.0f, 1048575.0f}; + static const XMVECTORF32 ScaleUIco4 = {1.0f,4096.0f*65536.0f,4096.0f,1.0f}; + static const XMVECTORI32 MaskUIco4 = {0xFFFFF,0xF<<(60-32),0xFFFFF000,0xFFFFF}; + static const XMVECTORF32 AddUIco4 = {0.0f,-32768.0f*65536.0f,-32768.0f*65536.0f,0.0f}; + // Clamp to bounds + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0)); + vResult = _mm_max_ps(vResult,g_XMZero); + vResult = _mm_min_ps(vResult,MaxUIco4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUIco4); + vResult = _mm_add_ps(vResult,AddUIco4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + vResulti = _mm_xor_si128(vResulti,g_XMFlipYZ); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUIco4); + // Shift y and z to straddle the 32-bit boundary + __m128i vResulti2 = _mm_srli_si128(vResulti,(64+12)/8); + // Shift it into place + vResulti2 = _mm_slli_si128(vResulti2,20/8); + // i = x|y<<20|z<<40|w<<60 + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_sd(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ + + #undef XM_Scale + #undef XM_URange + #undef XM_URangeDiv2 +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreIcoN4 +( + XMICON4* pDestination, + FXMVECTOR V +) +{ + #define XM_Scale (-1.0f / XM_PACK_FACTOR) + #define XM_URange ((FLOAT)(1 << 4)) + #define XM_Offset (3.0f) + #define XM_UMaxXYZ ((FLOAT)((1 << (20 - 1)) - 1)) + #define XM_UMaxW ((FLOAT)((1 << (4 - 1)) - 1)) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {524287.0f, 524287.0f, 524287.0f, 7.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiplyAdd(N, Scale.v, g_XMNegativeZero.v); + N = XMVectorRound(N); + + pDestination->v = ((UINT64)N.vector4_f32[3] << 60) | + (((UINT64)N.vector4_f32[2] & 0xFFFFF) << 40) | + (((UINT64)N.vector4_f32[1] & 0xFFFFF) << 20) | + (((UINT64)N.vector4_f32[0] & 0xFFFFF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + // Note: Masks are x,w,y and z + static const XMVECTORF32 ScaleIcoN4 = {524287.0f,7.0f*4096.0f*65536.0f,524287.0f*4096.0f,524287.0f}; + static const XMVECTORI32 MaskIcoN4 = {0xFFFFF,0xF<<(60-32),0xFFFFF000,0xFFFFF}; + // Clamp to bounds + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0)); + vResult = _mm_max_ps(vResult,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleIcoN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskIcoN4); + // Shift y and z to straddle the 32-bit boundary + __m128i vResulti2 = _mm_srli_si128(vResulti,(64+12)/8); + // Shift it into place + vResulti2 = _mm_slli_si128(vResulti2,20/8); + // i = x|y<<20|z<<40|w<<60 + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_sd(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ + + #undef XM_Scale + #undef XM_URange + #undef XM_Offset + #undef XM_UMaxXYZ + #undef XM_UMaxW +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreIco4 +( + XMICO4* pDestination, + FXMVECTOR V +) +{ + #define XM_Scale (-1.0f / XM_PACK_FACTOR) + #define XM_URange ((FLOAT)(1 << 4)) + #define XM_Offset (3.0f) + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-524287.0f, -524287.0f, -524287.0f, -7.0f}; + static CONST XMVECTOR Max = {524287.0f, 524287.0f, 524287.0f, 7.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + N = XMVectorRound(N); + + pDestination->v = ((INT64)N.vector4_f32[3] << 60) | + (((INT64)N.vector4_f32[2] & 0xFFFFF) << 40) | + (((INT64)N.vector4_f32[1] & 0xFFFFF) << 20) | + (((INT64)N.vector4_f32[0] & 0xFFFFF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + // Note: Masks are x,w,y and z + static const XMVECTORF32 MinIco4 = {-524287.0f,-7.0f,-524287.0f,-524287.0f}; + static const XMVECTORF32 MaxIco4 = { 524287.0f, 7.0f, 524287.0f, 524287.0f}; + static const XMVECTORF32 ScaleIco4 = {1.0f,4096.0f*65536.0f,4096.0f,1.0f}; + static const XMVECTORI32 MaskIco4 = {0xFFFFF,0xF<<(60-32),0xFFFFF000,0xFFFFF}; + // Clamp to bounds + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,1,3,0)); + vResult = _mm_max_ps(vResult,MinIco4); + vResult = _mm_min_ps(vResult,MaxIco4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleIco4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskIco4); + // Shift y and z to straddle the 32-bit boundary + __m128i vResulti2 = _mm_srli_si128(vResulti,(64+12)/8); + // Shift it into place + vResulti2 = _mm_slli_si128(vResulti2,20/8); + // i = x|y<<20|z<<40|w<<60 + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_sd(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ + + #undef XM_Scale + #undef XM_URange + #undef XM_Offset +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreXDecN4 +( + XMXDECN4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Min = {-1.0f, -1.0f, -1.0f, 0.0f}; + static CONST XMVECTORF32 Scale = {511.0f, 511.0f, 511.0f, 3.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + N = XMVectorRound(N); + + pDestination->v = ((UINT)N.vector4_f32[3] << 30) | + (((INT)N.vector4_f32[2] & 0x3FF) << 20) | + (((INT)N.vector4_f32[1] & 0x3FF) << 10) | + (((INT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Min = {-1.0f, -1.0f, -1.0f, 0.0f}; + static const XMVECTORF32 Scale = {511.0f, 511.0f*1024.0f, 511.0f*1048576.0f,3.0f*536870912.0f}; + static const XMVECTORI32 ScaleMask = {0x3FF,0x3FF<<10,0x3FF<<20,0x3<<29}; + XMASSERT(pDestination); + XMVECTOR vResult = _mm_max_ps(V,Min); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,Scale); + // Convert to int (W is unsigned) + __m128i vResulti = _mm_cvtps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,ScaleMask); + // To fix W, add itself to shift it up to <<30 instead of <<29 + __m128i vResultw = _mm_and_si128(vResulti,g_XMMaskW); + vResulti = _mm_add_epi32(vResulti,vResultw); + // Do a horizontal or of all 4 entries + vResult = _mm_shuffle_ps(reinterpret_cast(&vResulti)[0],reinterpret_cast(&vResulti)[0],_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + vResulti = _mm_or_si128(vResulti,reinterpret_cast(&vResult)[0]); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreXDec4 +( + XMXDEC4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-511.0f, -511.0f, -511.0f, 0.0f}; + static CONST XMVECTOR Max = {511.0f, 511.0f, 511.0f, 3.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + + pDestination->v = ((UINT)N.vector4_f32[3] << 30) | + (((INT)N.vector4_f32[2] & 0x3FF) << 20) | + (((INT)N.vector4_f32[1] & 0x3FF) << 10) | + (((INT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MinXDec4 = {-511.0f,-511.0f,-511.0f, 0.0f}; + static const XMVECTORF32 MaxXDec4 = { 511.0f, 511.0f, 511.0f, 3.0f}; + static const XMVECTORF32 ScaleXDec4 = {1.0f,1024.0f/2.0f,1024.0f*1024.0f,1024.0f*1024.0f*1024.0f/2.0f}; + static const XMVECTORI32 MaskXDec4= {0x3FF,0x3FF<<(10-1),0x3FF<<20,0x3<<(30-1)}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,MinXDec4); + vResult = _mm_min_ps(vResult,MaxXDec4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleXDec4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskXDec4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // Perform a single bit left shift on y|w + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUDecN4 +( + XMUDECN4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {1023.0f, 1023.0f, 1023.0f, 3.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + + pDestination->v = ((UINT)N.vector4_f32[3] << 30) | + (((UINT)N.vector4_f32[2] & 0x3FF) << 20) | + (((UINT)N.vector4_f32[1] & 0x3FF) << 10) | + (((UINT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleUDecN4 = {1023.0f,1023.0f*1024.0f*0.5f,1023.0f*1024.0f*1024.0f,3.0f*1024.0f*1024.0f*1024.0f*0.5f}; + static const XMVECTORI32 MaskUDecN4= {0x3FF,0x3FF<<(10-1),0x3FF<<20,0x3<<(30-1)}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUDecN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUDecN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // Perform a left shift by one bit on y|w + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUDec4 +( + XMUDEC4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Max = {1023.0f, 1023.0f, 1023.0f, 3.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max); + + pDestination->v = ((UINT)N.vector4_f32[3] << 30) | + (((UINT)N.vector4_f32[2] & 0x3FF) << 20) | + (((UINT)N.vector4_f32[1] & 0x3FF) << 10) | + (((UINT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MaxUDec4 = { 1023.0f, 1023.0f, 1023.0f, 3.0f}; + static const XMVECTORF32 ScaleUDec4 = {1.0f,1024.0f/2.0f,1024.0f*1024.0f,1024.0f*1024.0f*1024.0f/2.0f}; + static const XMVECTORI32 MaskUDec4= {0x3FF,0x3FF<<(10-1),0x3FF<<20,0x3<<(30-1)}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,MaxUDec4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUDec4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUDec4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // Perform a left shift by one bit on y|w + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreDecN4 +( + XMDECN4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {511.0f, 511.0f, 511.0f, 1.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v); + N = XMVectorMultiply(N, Scale.v); + + pDestination->v = ((INT)N.vector4_f32[3] << 30) | + (((INT)N.vector4_f32[2] & 0x3FF) << 20) | + (((INT)N.vector4_f32[1] & 0x3FF) << 10) | + (((INT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleDecN4 = {511.0f,511.0f*1024.0f,511.0f*1024.0f*1024.0f,1.0f*1024.0f*1024.0f*1024.0f}; + static const XMVECTORI32 MaskDecN4= {0x3FF,0x3FF<<10,0x3FF<<20,0x3<<30}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleDecN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskDecN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreDec4 +( + XMDEC4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-511.0f, -511.0f, -511.0f, -1.0f}; + static CONST XMVECTOR Max = {511.0f, 511.0f, 511.0f, 1.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + + pDestination->v = ((INT)N.vector4_f32[3] << 30) | + (((INT)N.vector4_f32[2] & 0x3FF) << 20) | + (((INT)N.vector4_f32[1] & 0x3FF) << 10) | + (((INT)N.vector4_f32[0] & 0x3FF)); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MinDec4 = {-511.0f,-511.0f,-511.0f,-1.0f}; + static const XMVECTORF32 MaxDec4 = { 511.0f, 511.0f, 511.0f, 1.0f}; + static const XMVECTORF32 ScaleDec4 = {1.0f,1024.0f,1024.0f*1024.0f,1024.0f*1024.0f*1024.0f}; + static const XMVECTORI32 MaskDec4= {0x3FF,0x3FF<<10,0x3FF<<20,0x3<<30}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,MinDec4); + vResult = _mm_min_ps(vResult,MaxDec4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleDec4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskDec4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUByteN4 +( + XMUBYTEN4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {255.0f, 255.0f, 255.0f, 255.0f}; + + XMASSERT(pDestination); + + N = XMVectorSaturate(V); + N = XMVectorMultiply(N, Scale.v); + N = XMVectorRound(N); + + pDestination->x = (BYTE)N.vector4_f32[0]; + pDestination->y = (BYTE)N.vector4_f32[1]; + pDestination->z = (BYTE)N.vector4_f32[2]; + pDestination->w = (BYTE)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleUByteN4 = {255.0f,255.0f*256.0f*0.5f,255.0f*256.0f*256.0f,255.0f*256.0f*256.0f*256.0f*0.5f}; + static const XMVECTORI32 MaskUByteN4 = {0xFF,0xFF<<(8-1),0xFF<<16,0xFF<<(24-1)}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUByteN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUByteN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // Perform a single bit left shift to fix y|w + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUByte4 +( + XMUBYTE4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Max = {255.0f, 255.0f, 255.0f, 255.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max); + N = XMVectorRound(N); + + pDestination->x = (BYTE)N.vector4_f32[0]; + pDestination->y = (BYTE)N.vector4_f32[1]; + pDestination->z = (BYTE)N.vector4_f32[2]; + pDestination->w = (BYTE)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MaxUByte4 = { 255.0f, 255.0f, 255.0f, 255.0f}; + static const XMVECTORF32 ScaleUByte4 = {1.0f,256.0f*0.5f,256.0f*256.0f,256.0f*256.0f*256.0f*0.5f}; + static const XMVECTORI32 MaskUByte4 = {0xFF,0xFF<<(8-1),0xFF<<16,0xFF<<(24-1)}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,MaxUByte4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleUByte4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskUByte4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // Perform a single bit left shift to fix y|w + vResulti2 = _mm_add_epi32(vResulti2,vResulti2); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreByteN4 +( + XMBYTEN4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {127.0f, 127.0f, 127.0f, 127.0f}; + + XMASSERT(pDestination); + + N = XMVectorMultiply(V, Scale.v); + N = XMVectorRound(N); + + pDestination->x = (CHAR)N.vector4_f32[0]; + pDestination->y = (CHAR)N.vector4_f32[1]; + pDestination->z = (CHAR)N.vector4_f32[2]; + pDestination->w = (CHAR)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 ScaleByteN4 = {127.0f,127.0f*256.0f,127.0f*256.0f*256.0f,127.0f*256.0f*256.0f*256.0f}; + static const XMVECTORI32 MaskByteN4 = {0xFF,0xFF<<8,0xFF<<16,0xFF<<24}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleByteN4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskByteN4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreByte4 +( + XMBYTE4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTOR Min = {-127.0f, -127.0f, -127.0f, -127.0f}; + static CONST XMVECTOR Max = {127.0f, 127.0f, 127.0f, 127.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, Min, Max); + N = XMVectorRound(N); + + pDestination->x = (CHAR)N.vector4_f32[0]; + pDestination->y = (CHAR)N.vector4_f32[1]; + pDestination->z = (CHAR)N.vector4_f32[2]; + pDestination->w = (CHAR)N.vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static const XMVECTORF32 MinByte4 = {-127.0f,-127.0f,-127.0f,-127.0f}; + static const XMVECTORF32 MaxByte4 = { 127.0f, 127.0f, 127.0f, 127.0f}; + static const XMVECTORF32 ScaleByte4 = {1.0f,256.0f,256.0f*256.0f,256.0f*256.0f*256.0f}; + static const XMVECTORI32 MaskByte4 = {0xFF,0xFF<<8,0xFF<<16,0xFF<<24}; + // Clamp to bounds + XMVECTOR vResult = _mm_max_ps(V,MinByte4); + vResult = _mm_min_ps(vResult,MaxByte4); + // Scale by multiplication + vResult = _mm_mul_ps(vResult,ScaleByte4); + // Convert to int + __m128i vResulti = _mm_cvttps_epi32(vResult); + // Mask off any fraction + vResulti = _mm_and_si128(vResulti,MaskByte4); + // Do a horizontal or of 4 entries + __m128i vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(3,2,3,2)); + // x = x|z, y = y|w + vResulti = _mm_or_si128(vResulti,vResulti2); + // Move Z to the x position + vResulti2 = _mm_shuffle_epi32(vResulti,_MM_SHUFFLE(1,1,1,1)); + // i = x|y|z|w + vResulti = _mm_or_si128(vResulti,vResulti2); + _mm_store_ss(reinterpret_cast(&pDestination->v),reinterpret_cast(&vResulti)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreUNibble4 +( + XMUNIBBLE4* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Max = {15.0f,15.0f,15.0f,15.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + USHORT x = static_cast(_mm_extract_epi16(vInt,0)); + USHORT y = static_cast(_mm_extract_epi16(vInt,2)); + USHORT z = static_cast(_mm_extract_epi16(vInt,4)); + USHORT w = static_cast(_mm_extract_epi16(vInt,6)); + pDestination->v = ((w & 0xF) << 12) | + ((z & 0xF) << 8) | + ((y & 0xF) << 4) | + ((x & 0xF)); +#else + XMVECTOR N; + static CONST XMVECTORF32 Max = {15.0f,15.0f,15.0f,15.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max.v); + N = XMVectorRound(N); + + pDestination->v = (((USHORT)N.vector4_f32[3] & 0xF) << 12) | + (((USHORT)N.vector4_f32[2] & 0xF) << 8) | + (((USHORT)N.vector4_f32[1] & 0xF) << 4) | + (((USHORT)N.vector4_f32[0] & 0xF)); +#endif !_XM_SSE_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreU555( + XMU555* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Max = {31.0f, 31.0f, 31.0f, 1.0f}; + // Bounds check + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + vResult = _mm_min_ps(vResult,Max); + // Convert to int with rounding + __m128i vInt = _mm_cvtps_epi32(vResult); + // No SSE operations will write to 16-bit values, so we have to extract them manually + USHORT x = static_cast(_mm_extract_epi16(vInt,0)); + USHORT y = static_cast(_mm_extract_epi16(vInt,2)); + USHORT z = static_cast(_mm_extract_epi16(vInt,4)); + USHORT w = static_cast(_mm_extract_epi16(vInt,6)); + pDestination->v = ((w) ? 0x8000 : 0) | + ((z & 0x1F) << 10) | + ((y & 0x1F) << 5) | + ((x & 0x1F)); +#else + XMVECTOR N; + static CONST XMVECTORF32 Max = {31.0f, 31.0f, 31.0f, 1.0f}; + + XMASSERT(pDestination); + + N = XMVectorClamp(V, XMVectorZero(), Max.v); + N = XMVectorRound(N); + + pDestination->v = ((N.vector4_f32[3] > 0.f) ? 0x8000 : 0) | + (((USHORT)N.vector4_f32[2] & 0x1F) << 10) | + (((USHORT)N.vector4_f32[1] & 0x1F) << 5) | + (((USHORT)N.vector4_f32[0] & 0x1F)); +#endif !_XM_SSE_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreColor +( + XMCOLOR* pDestination, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + static CONST XMVECTORF32 Scale = {255.0f, 255.0f, 255.0f, 255.0f}; + + XMASSERT(pDestination); + + N = XMVectorSaturate(V); + N = XMVectorMultiply(N, Scale.v); + N = XMVectorRound(N); + + pDestination->c = ((UINT)N.vector4_f32[3] << 24) | + ((UINT)N.vector4_f32[0] << 16) | + ((UINT)N.vector4_f32[1] << 8) | + ((UINT)N.vector4_f32[2]); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + static CONST XMVECTORF32 Scale = {255.0f,255.0f,255.0f,255.0f}; + // Set <0 to 0 + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + // Set>1 to 1 + vResult = _mm_min_ps(vResult,g_XMOne); + // Convert to 0-255 + vResult = _mm_mul_ps(vResult,Scale); + // Shuffle RGBA to ARGB + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2)); + // Convert to int + __m128i vInt = _mm_cvtps_epi32(vResult); + // Mash to shorts + vInt = _mm_packs_epi32(vInt,vInt); + // Mash to bytes + vInt = _mm_packus_epi16(vInt,vInt); + // Store the color + _mm_store_ss(reinterpret_cast(&pDestination->c),reinterpret_cast<__m128 *>(&vInt)[0]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat3x3 +( + XMFLOAT3X3* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) || defined(_XM_SSE_INTRINSICS_) + + XMStoreFloat3x3NC(pDestination, M); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat3x3NC +( + XMFLOAT3X3* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMVECTOR vTemp1 = M.r[0]; + XMVECTOR vTemp2 = M.r[1]; + XMVECTOR vTemp3 = M.r[2]; + XMVECTOR vWork = _mm_shuffle_ps(vTemp1,vTemp2,_MM_SHUFFLE(0,0,2,2)); + vTemp1 = _mm_shuffle_ps(vTemp1,vWork,_MM_SHUFFLE(2,0,1,0)); + _mm_storeu_ps(&pDestination->m[0][0],vTemp1); + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp3,_MM_SHUFFLE(1,0,2,1)); + _mm_storeu_ps(&pDestination->m[1][1],vTemp2); + vTemp3 = _mm_shuffle_ps(vTemp3,vTemp3,_MM_SHUFFLE(2,2,2,2)); + _mm_store_ss(&pDestination->m[2][2],vTemp3); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4x3 +( + XMFLOAT4X3* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) || defined(_XM_SSE_INTRINSICS_) + + XMStoreFloat4x3NC(pDestination, M); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4x3A +( + XMFLOAT4X3A* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + // x1,y1,z1,w1 + XMVECTOR vTemp1 = M.r[0]; + // x2,y2,z2,w2 + XMVECTOR vTemp2 = M.r[1]; + // x3,y3,z3,w3 + XMVECTOR vTemp3 = M.r[2]; + // x4,y4,z4,w4 + XMVECTOR vTemp4 = M.r[3]; + // z1,z1,x2,y2 + XMVECTOR vTemp = _mm_shuffle_ps(vTemp1,vTemp2,_MM_SHUFFLE(1,0,2,2)); + // y2,z2,x3,y3 (Final) + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp3,_MM_SHUFFLE(1,0,2,1)); + // x1,y1,z1,x2 (Final) + vTemp1 = _mm_shuffle_ps(vTemp1,vTemp,_MM_SHUFFLE(2,0,1,0)); + // z3,z3,x4,x4 + vTemp3 = _mm_shuffle_ps(vTemp3,vTemp4,_MM_SHUFFLE(0,0,2,2)); + // z3,x4,y4,z4 (Final) + vTemp3 = _mm_shuffle_ps(vTemp3,vTemp4,_MM_SHUFFLE(2,1,2,0)); + // Store in 3 operations + _mm_store_ps(&pDestination->m[0][0],vTemp1); + _mm_store_ps(&pDestination->m[1][1],vTemp2); + _mm_store_ps(&pDestination->m[2][2],vTemp3); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4x3NC +( + XMFLOAT4X3* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + XMVECTOR vTemp1 = M.r[0]; + XMVECTOR vTemp2 = M.r[1]; + XMVECTOR vTemp3 = M.r[2]; + XMVECTOR vTemp4 = M.r[3]; + XMVECTOR vTemp2x = _mm_shuffle_ps(vTemp2,vTemp3,_MM_SHUFFLE(1,0,2,1)); + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp1,_MM_SHUFFLE(2,2,0,0)); + vTemp1 = _mm_shuffle_ps(vTemp1,vTemp2,_MM_SHUFFLE(0,2,1,0)); + vTemp3 = _mm_shuffle_ps(vTemp3,vTemp4,_MM_SHUFFLE(0,0,2,2)); + vTemp3 = _mm_shuffle_ps(vTemp3,vTemp4,_MM_SHUFFLE(2,1,2,0)); + _mm_storeu_ps(&pDestination->m[0][0],vTemp1); + _mm_storeu_ps(&pDestination->m[1][1],vTemp2x); + _mm_storeu_ps(&pDestination->m[2][2],vTemp3); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4x4 +( + XMFLOAT4X4* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) + + XMStoreFloat4x4NC(pDestination, M); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + + _mm_storeu_ps( &pDestination->_11, M.r[0] ); + _mm_storeu_ps( &pDestination->_21, M.r[1] ); + _mm_storeu_ps( &pDestination->_31, M.r[2] ); + _mm_storeu_ps( &pDestination->_41, M.r[3] ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4x4A +( + XMFLOAT4X4A* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + XMASSERT(((UINT_PTR)pDestination & 0xF) == 0); + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + pDestination->m[0][3] = M.r[0].vector4_f32[3]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + pDestination->m[1][3] = M.r[1].vector4_f32[3]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + pDestination->m[2][3] = M.r[2].vector4_f32[3]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + pDestination->m[3][3] = M.r[3].vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + + _mm_store_ps( &pDestination->_11, M.r[0] ); + _mm_store_ps( &pDestination->_21, M.r[1] ); + _mm_store_ps( &pDestination->_31, M.r[2] ); + _mm_store_ps( &pDestination->_41, M.r[3] ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMStoreFloat4x4NC +( + XMFLOAT4X4* pDestination, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMASSERT(pDestination); + + pDestination->m[0][0] = M.r[0].vector4_f32[0]; + pDestination->m[0][1] = M.r[0].vector4_f32[1]; + pDestination->m[0][2] = M.r[0].vector4_f32[2]; + pDestination->m[0][3] = M.r[0].vector4_f32[3]; + + pDestination->m[1][0] = M.r[1].vector4_f32[0]; + pDestination->m[1][1] = M.r[1].vector4_f32[1]; + pDestination->m[1][2] = M.r[1].vector4_f32[2]; + pDestination->m[1][3] = M.r[1].vector4_f32[3]; + + pDestination->m[2][0] = M.r[2].vector4_f32[0]; + pDestination->m[2][1] = M.r[2].vector4_f32[1]; + pDestination->m[2][2] = M.r[2].vector4_f32[2]; + pDestination->m[2][3] = M.r[2].vector4_f32[3]; + + pDestination->m[3][0] = M.r[3].vector4_f32[0]; + pDestination->m[3][1] = M.r[3].vector4_f32[1]; + pDestination->m[3][2] = M.r[3].vector4_f32[2]; + pDestination->m[3][3] = M.r[3].vector4_f32[3]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDestination); + _mm_storeu_ps(&pDestination->m[0][0],M.r[0]); + _mm_storeu_ps(&pDestination->m[1][0],M.r[1]); + _mm_storeu_ps(&pDestination->m[2][0],M.r[2]); + _mm_storeu_ps(&pDestination->m[3][0],M.r[3]); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +#endif // __XNAMATHCONVERT_INL__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/xnamathmatrix.inl b/Src/Decoder_H264_ALL/D3D/include/xnamathmatrix.inl new file mode 100644 index 0000000..005ea24 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/xnamathmatrix.inl @@ -0,0 +1,3216 @@ +/*++ + +Copyright (c) Microsoft Corporation. All rights reserved. + +Module Name: + + xnamathmatrix.inl + +Abstract: + + XNA math library for Windows and Xbox 360: Matrix functions +--*/ + +#if defined(_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#ifndef __XNAMATHMATRIX_INL__ +#define __XNAMATHMATRIX_INL__ + +/**************************************************************************** + * + * Matrix + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +// Return TRUE if any entry in the matrix is NaN +XMFINLINE BOOL XMMatrixIsNaN +( + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT i, uTest; + const UINT *pWork; + + i = 16; + pWork = (const UINT *)(&M.m[0][0]); + do { + // Fetch value into integer unit + uTest = pWork[0]; + // Remove sign + uTest &= 0x7FFFFFFFU; + // NaN is 0x7F800001 through 0x7FFFFFFF inclusive + uTest -= 0x7F800001U; + if (uTest<0x007FFFFFU) { + break; // NaN found + } + ++pWork; // Next entry + } while (--i); + return (i!=0); // i == 0 if nothing matched +#elif defined(_XM_SSE_INTRINSICS_) + // Load in registers + XMVECTOR vX = M.r[0]; + XMVECTOR vY = M.r[1]; + XMVECTOR vZ = M.r[2]; + XMVECTOR vW = M.r[3]; + // Test themselves to check for NaN + vX = _mm_cmpneq_ps(vX,vX); + vY = _mm_cmpneq_ps(vY,vY); + vZ = _mm_cmpneq_ps(vZ,vZ); + vW = _mm_cmpneq_ps(vW,vW); + // Or all the results + vX = _mm_or_ps(vX,vZ); + vY = _mm_or_ps(vY,vW); + vX = _mm_or_ps(vX,vY); + // If any tested true, return true + return (_mm_movemask_ps(vX)!=0); +#else +#endif +} + +//------------------------------------------------------------------------------ + +// Return TRUE if any entry in the matrix is +/-INF +XMFINLINE BOOL XMMatrixIsInfinite +( + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT i, uTest; + const UINT *pWork; + + i = 16; + pWork = (const UINT *)(&M.m[0][0]); + do { + // Fetch value into integer unit + uTest = pWork[0]; + // Remove sign + uTest &= 0x7FFFFFFFU; + // INF is 0x7F800000 + if (uTest==0x7F800000U) { + break; // INF found + } + ++pWork; // Next entry + } while (--i); + return (i!=0); // i == 0 if nothing matched +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bits + XMVECTOR vTemp1 = _mm_and_ps(M.r[0],g_XMAbsMask); + XMVECTOR vTemp2 = _mm_and_ps(M.r[1],g_XMAbsMask); + XMVECTOR vTemp3 = _mm_and_ps(M.r[2],g_XMAbsMask); + XMVECTOR vTemp4 = _mm_and_ps(M.r[3],g_XMAbsMask); + // Compare to infinity + vTemp1 = _mm_cmpeq_ps(vTemp1,g_XMInfinity); + vTemp2 = _mm_cmpeq_ps(vTemp2,g_XMInfinity); + vTemp3 = _mm_cmpeq_ps(vTemp3,g_XMInfinity); + vTemp4 = _mm_cmpeq_ps(vTemp4,g_XMInfinity); + // Or the answers together + vTemp1 = _mm_or_ps(vTemp1,vTemp2); + vTemp3 = _mm_or_ps(vTemp3,vTemp4); + vTemp1 = _mm_or_ps(vTemp1,vTemp3); + // If any are infinity, the signs are true. + return (_mm_movemask_ps(vTemp1)!=0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Return TRUE if the XMMatrix is equal to identity +XMFINLINE BOOL XMMatrixIsIdentity +( + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + unsigned int uOne, uZero; + const unsigned int *pWork; + + // Use the integer pipeline to reduce branching to a minimum + pWork = (const unsigned int*)(&M.m[0][0]); + // Convert 1.0f to zero and or them together + uOne = pWork[0]^0x3F800000U; + // Or all the 0.0f entries together + uZero = pWork[1]; + uZero |= pWork[2]; + uZero |= pWork[3]; + // 2nd row + uZero |= pWork[4]; + uOne |= pWork[5]^0x3F800000U; + uZero |= pWork[6]; + uZero |= pWork[7]; + // 3rd row + uZero |= pWork[8]; + uZero |= pWork[9]; + uOne |= pWork[10]^0x3F800000U; + uZero |= pWork[11]; + // 4th row + uZero |= pWork[12]; + uZero |= pWork[13]; + uZero |= pWork[14]; + uOne |= pWork[15]^0x3F800000U; + // If all zero entries are zero, the uZero==0 + uZero &= 0x7FFFFFFF; // Allow -0.0f + // If all 1.0f entries are 1.0f, then uOne==0 + uOne |= uZero; + return (uOne==0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp1 = _mm_cmpeq_ps(M.r[0],g_XMIdentityR0); + XMVECTOR vTemp2 = _mm_cmpeq_ps(M.r[1],g_XMIdentityR1); + XMVECTOR vTemp3 = _mm_cmpeq_ps(M.r[2],g_XMIdentityR2); + XMVECTOR vTemp4 = _mm_cmpeq_ps(M.r[3],g_XMIdentityR3); + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + vTemp3 = _mm_and_ps(vTemp3,vTemp4); + vTemp1 = _mm_and_ps(vTemp1,vTemp3); + return (_mm_movemask_ps(vTemp1)==0x0f); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Perform a 4x4 matrix multiply by a 4x4 matrix +XMFINLINE XMMATRIX XMMatrixMultiply +( + CXMMATRIX M1, + CXMMATRIX M2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX mResult; + // Cache the invariants in registers + float x = M1.m[0][0]; + float y = M1.m[0][1]; + float z = M1.m[0][2]; + float w = M1.m[0][3]; + // Perform the operation on the first row + mResult.m[0][0] = (M2.m[0][0]*x)+(M2.m[1][0]*y)+(M2.m[2][0]*z)+(M2.m[3][0]*w); + mResult.m[0][1] = (M2.m[0][1]*x)+(M2.m[1][1]*y)+(M2.m[2][1]*z)+(M2.m[3][1]*w); + mResult.m[0][2] = (M2.m[0][2]*x)+(M2.m[1][2]*y)+(M2.m[2][2]*z)+(M2.m[3][2]*w); + mResult.m[0][3] = (M2.m[0][3]*x)+(M2.m[1][3]*y)+(M2.m[2][3]*z)+(M2.m[3][3]*w); + // Repeat for all the other rows + x = M1.m[1][0]; + y = M1.m[1][1]; + z = M1.m[1][2]; + w = M1.m[1][3]; + mResult.m[1][0] = (M2.m[0][0]*x)+(M2.m[1][0]*y)+(M2.m[2][0]*z)+(M2.m[3][0]*w); + mResult.m[1][1] = (M2.m[0][1]*x)+(M2.m[1][1]*y)+(M2.m[2][1]*z)+(M2.m[3][1]*w); + mResult.m[1][2] = (M2.m[0][2]*x)+(M2.m[1][2]*y)+(M2.m[2][2]*z)+(M2.m[3][2]*w); + mResult.m[1][3] = (M2.m[0][3]*x)+(M2.m[1][3]*y)+(M2.m[2][3]*z)+(M2.m[3][3]*w); + x = M1.m[2][0]; + y = M1.m[2][1]; + z = M1.m[2][2]; + w = M1.m[2][3]; + mResult.m[2][0] = (M2.m[0][0]*x)+(M2.m[1][0]*y)+(M2.m[2][0]*z)+(M2.m[3][0]*w); + mResult.m[2][1] = (M2.m[0][1]*x)+(M2.m[1][1]*y)+(M2.m[2][1]*z)+(M2.m[3][1]*w); + mResult.m[2][2] = (M2.m[0][2]*x)+(M2.m[1][2]*y)+(M2.m[2][2]*z)+(M2.m[3][2]*w); + mResult.m[2][3] = (M2.m[0][3]*x)+(M2.m[1][3]*y)+(M2.m[2][3]*z)+(M2.m[3][3]*w); + x = M1.m[3][0]; + y = M1.m[3][1]; + z = M1.m[3][2]; + w = M1.m[3][3]; + mResult.m[3][0] = (M2.m[0][0]*x)+(M2.m[1][0]*y)+(M2.m[2][0]*z)+(M2.m[3][0]*w); + mResult.m[3][1] = (M2.m[0][1]*x)+(M2.m[1][1]*y)+(M2.m[2][1]*z)+(M2.m[3][1]*w); + mResult.m[3][2] = (M2.m[0][2]*x)+(M2.m[1][2]*y)+(M2.m[2][2]*z)+(M2.m[3][2]*w); + mResult.m[3][3] = (M2.m[0][3]*x)+(M2.m[1][3]*y)+(M2.m[2][3]*z)+(M2.m[3][3]*w); + return mResult; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX mResult; + // Use vW to hold the original row + XMVECTOR vW = M1.r[0]; + // Splat the component X,Y,Z then W + XMVECTOR vX = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(0,0,0,0)); + XMVECTOR vY = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR vZ = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(2,2,2,2)); + vW = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(3,3,3,3)); + // Perform the opertion on the first row + vX = _mm_mul_ps(vX,M2.r[0]); + vY = _mm_mul_ps(vY,M2.r[1]); + vZ = _mm_mul_ps(vZ,M2.r[2]); + vW = _mm_mul_ps(vW,M2.r[3]); + // Perform a binary add to reduce cumulative errors + vX = _mm_add_ps(vX,vZ); + vY = _mm_add_ps(vY,vW); + vX = _mm_add_ps(vX,vY); + mResult.r[0] = vX; + // Repeat for the other 3 rows + vW = M1.r[1]; + vX = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(0,0,0,0)); + vY = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(1,1,1,1)); + vZ = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(2,2,2,2)); + vW = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(3,3,3,3)); + vX = _mm_mul_ps(vX,M2.r[0]); + vY = _mm_mul_ps(vY,M2.r[1]); + vZ = _mm_mul_ps(vZ,M2.r[2]); + vW = _mm_mul_ps(vW,M2.r[3]); + vX = _mm_add_ps(vX,vZ); + vY = _mm_add_ps(vY,vW); + vX = _mm_add_ps(vX,vY); + mResult.r[1] = vX; + vW = M1.r[2]; + vX = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(0,0,0,0)); + vY = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(1,1,1,1)); + vZ = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(2,2,2,2)); + vW = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(3,3,3,3)); + vX = _mm_mul_ps(vX,M2.r[0]); + vY = _mm_mul_ps(vY,M2.r[1]); + vZ = _mm_mul_ps(vZ,M2.r[2]); + vW = _mm_mul_ps(vW,M2.r[3]); + vX = _mm_add_ps(vX,vZ); + vY = _mm_add_ps(vY,vW); + vX = _mm_add_ps(vX,vY); + mResult.r[2] = vX; + vW = M1.r[3]; + vX = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(0,0,0,0)); + vY = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(1,1,1,1)); + vZ = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(2,2,2,2)); + vW = _mm_shuffle_ps(vW,vW,_MM_SHUFFLE(3,3,3,3)); + vX = _mm_mul_ps(vX,M2.r[0]); + vY = _mm_mul_ps(vY,M2.r[1]); + vZ = _mm_mul_ps(vZ,M2.r[2]); + vW = _mm_mul_ps(vW,M2.r[3]); + vX = _mm_add_ps(vX,vZ); + vY = _mm_add_ps(vY,vW); + vX = _mm_add_ps(vX,vY); + mResult.r[3] = vX; + return mResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixMultiplyTranspose +( + CXMMATRIX M1, + CXMMATRIX M2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX mResult; + // Cache the invariants in registers + float x = M2.m[0][0]; + float y = M2.m[1][0]; + float z = M2.m[2][0]; + float w = M2.m[3][0]; + // Perform the operation on the first row + mResult.m[0][0] = (M1.m[0][0]*x)+(M1.m[0][1]*y)+(M1.m[0][2]*z)+(M1.m[0][3]*w); + mResult.m[0][1] = (M1.m[1][0]*x)+(M1.m[1][1]*y)+(M1.m[1][2]*z)+(M1.m[1][3]*w); + mResult.m[0][2] = (M1.m[2][0]*x)+(M1.m[2][1]*y)+(M1.m[2][2]*z)+(M1.m[2][3]*w); + mResult.m[0][3] = (M1.m[3][0]*x)+(M1.m[3][1]*y)+(M1.m[3][2]*z)+(M1.m[3][3]*w); + // Repeat for all the other rows + x = M2.m[0][1]; + y = M2.m[1][1]; + z = M2.m[2][1]; + w = M2.m[3][1]; + mResult.m[1][0] = (M1.m[0][0]*x)+(M1.m[0][1]*y)+(M1.m[0][2]*z)+(M1.m[0][3]*w); + mResult.m[1][1] = (M1.m[1][0]*x)+(M1.m[1][1]*y)+(M1.m[1][2]*z)+(M1.m[1][3]*w); + mResult.m[1][2] = (M1.m[2][0]*x)+(M1.m[2][1]*y)+(M1.m[2][2]*z)+(M1.m[2][3]*w); + mResult.m[1][3] = (M1.m[3][0]*x)+(M1.m[3][1]*y)+(M1.m[3][2]*z)+(M1.m[3][3]*w); + x = M2.m[0][2]; + y = M2.m[1][2]; + z = M2.m[2][2]; + w = M2.m[3][2]; + mResult.m[2][0] = (M1.m[0][0]*x)+(M1.m[0][1]*y)+(M1.m[0][2]*z)+(M1.m[0][3]*w); + mResult.m[2][1] = (M1.m[1][0]*x)+(M1.m[1][1]*y)+(M1.m[1][2]*z)+(M1.m[1][3]*w); + mResult.m[2][2] = (M1.m[2][0]*x)+(M1.m[2][1]*y)+(M1.m[2][2]*z)+(M1.m[2][3]*w); + mResult.m[2][3] = (M1.m[3][0]*x)+(M1.m[3][1]*y)+(M1.m[3][2]*z)+(M1.m[3][3]*w); + x = M2.m[0][3]; + y = M2.m[1][3]; + z = M2.m[2][3]; + w = M2.m[3][3]; + mResult.m[3][0] = (M1.m[0][0]*x)+(M1.m[0][1]*y)+(M1.m[0][2]*z)+(M1.m[0][3]*w); + mResult.m[3][1] = (M1.m[1][0]*x)+(M1.m[1][1]*y)+(M1.m[1][2]*z)+(M1.m[1][3]*w); + mResult.m[3][2] = (M1.m[2][0]*x)+(M1.m[2][1]*y)+(M1.m[2][2]*z)+(M1.m[2][3]*w); + mResult.m[3][3] = (M1.m[3][0]*x)+(M1.m[3][1]*y)+(M1.m[3][2]*z)+(M1.m[3][3]*w); + return mResult; +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX Product; + XMMATRIX Result; + Product = XMMatrixMultiply(M1, M2); + Result = XMMatrixTranspose(Product); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixTranspose +( + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX P; + XMMATRIX MT; + + // Original matrix: + // + // m00m01m02m03 + // m10m11m12m13 + // m20m21m22m23 + // m30m31m32m33 + + P.r[0] = XMVectorMergeXY(M.r[0], M.r[2]); // m00m20m01m21 + P.r[1] = XMVectorMergeXY(M.r[1], M.r[3]); // m10m30m11m31 + P.r[2] = XMVectorMergeZW(M.r[0], M.r[2]); // m02m22m03m23 + P.r[3] = XMVectorMergeZW(M.r[1], M.r[3]); // m12m32m13m33 + + MT.r[0] = XMVectorMergeXY(P.r[0], P.r[1]); // m00m10m20m30 + MT.r[1] = XMVectorMergeZW(P.r[0], P.r[1]); // m01m11m21m31 + MT.r[2] = XMVectorMergeXY(P.r[2], P.r[3]); // m02m12m22m32 + MT.r[3] = XMVectorMergeZW(P.r[2], P.r[3]); // m03m13m23m33 + + return MT; + +#elif defined(_XM_SSE_INTRINSICS_) + // x.x,x.y,y.x,y.y + XMVECTOR vTemp1 = _mm_shuffle_ps(M.r[0],M.r[1],_MM_SHUFFLE(1,0,1,0)); + // x.z,x.w,y.z,y.w + XMVECTOR vTemp3 = _mm_shuffle_ps(M.r[0],M.r[1],_MM_SHUFFLE(3,2,3,2)); + // z.x,z.y,w.x,w.y + XMVECTOR vTemp2 = _mm_shuffle_ps(M.r[2],M.r[3],_MM_SHUFFLE(1,0,1,0)); + // z.z,z.w,w.z,w.w + XMVECTOR vTemp4 = _mm_shuffle_ps(M.r[2],M.r[3],_MM_SHUFFLE(3,2,3,2)); + XMMATRIX mResult; + + // x.x,y.x,z.x,w.x + mResult.r[0] = _mm_shuffle_ps(vTemp1, vTemp2,_MM_SHUFFLE(2,0,2,0)); + // x.y,y.y,z.y,w.y + mResult.r[1] = _mm_shuffle_ps(vTemp1, vTemp2,_MM_SHUFFLE(3,1,3,1)); + // x.z,y.z,z.z,w.z + mResult.r[2] = _mm_shuffle_ps(vTemp3, vTemp4,_MM_SHUFFLE(2,0,2,0)); + // x.w,y.w,z.w,w.w + mResult.r[3] = _mm_shuffle_ps(vTemp3, vTemp4,_MM_SHUFFLE(3,1,3,1)); + return mResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return the inverse and the determinant of a 4x4 matrix +XMINLINE XMMATRIX XMMatrixInverse +( + XMVECTOR* pDeterminant, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX R; + XMMATRIX MT; + XMVECTOR D0, D1, D2; + XMVECTOR C0, C1, C2, C3, C4, C5, C6, C7; + XMVECTOR V0[4], V1[4]; + XMVECTOR Determinant; + XMVECTOR Reciprocal; + XMMATRIX Result; + static CONST XMVECTORU32 SwizzleXXYY = {XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0Y}; + static CONST XMVECTORU32 SwizzleZWZW = {XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_0Z, XM_PERMUTE_0W}; + static CONST XMVECTORU32 SwizzleYZXY = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0Y}; + static CONST XMVECTORU32 SwizzleZWYZ = {XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_0Y, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 SwizzleWXWX = {XM_PERMUTE_0W, XM_PERMUTE_0X, XM_PERMUTE_0W, XM_PERMUTE_0X}; + static CONST XMVECTORU32 SwizzleZXYX = {XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0X}; + static CONST XMVECTORU32 SwizzleYWXZ = {XM_PERMUTE_0Y, XM_PERMUTE_0W, XM_PERMUTE_0X, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 SwizzleWZWY = {XM_PERMUTE_0W, XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_0Y}; + static CONST XMVECTORU32 Permute0X0Z1X1Z = {XM_PERMUTE_0X, XM_PERMUTE_0Z, XM_PERMUTE_1X, XM_PERMUTE_1Z}; + static CONST XMVECTORU32 Permute0Y0W1Y1W = {XM_PERMUTE_0Y, XM_PERMUTE_0W, XM_PERMUTE_1Y, XM_PERMUTE_1W}; + static CONST XMVECTORU32 Permute1Y0Y0W0X = {XM_PERMUTE_1Y, XM_PERMUTE_0Y, XM_PERMUTE_0W, XM_PERMUTE_0X}; + static CONST XMVECTORU32 Permute0W0X0Y1X = {XM_PERMUTE_0W, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_1X}; + static CONST XMVECTORU32 Permute0Z1Y1X0Z = {XM_PERMUTE_0Z, XM_PERMUTE_1Y, XM_PERMUTE_1X, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 Permute0W1Y0Y0Z = {XM_PERMUTE_0W, XM_PERMUTE_1Y, XM_PERMUTE_0Y, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 Permute0Z0Y1X0X = {XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_1X, XM_PERMUTE_0X}; + static CONST XMVECTORU32 Permute1Y0X0W1X = {XM_PERMUTE_1Y, XM_PERMUTE_0X, XM_PERMUTE_0W, XM_PERMUTE_1X}; + static CONST XMVECTORU32 Permute1W0Y0W0X = {XM_PERMUTE_1W, XM_PERMUTE_0Y, XM_PERMUTE_0W, XM_PERMUTE_0X}; + static CONST XMVECTORU32 Permute0W0X0Y1Z = {XM_PERMUTE_0W, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_1Z}; + static CONST XMVECTORU32 Permute0Z1W1Z0Z = {XM_PERMUTE_0Z, XM_PERMUTE_1W, XM_PERMUTE_1Z, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 Permute0W1W0Y0Z = {XM_PERMUTE_0W, XM_PERMUTE_1W, XM_PERMUTE_0Y, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 Permute0Z0Y1Z0X = {XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_1Z, XM_PERMUTE_0X}; + static CONST XMVECTORU32 Permute1W0X0W1Z = {XM_PERMUTE_1W, XM_PERMUTE_0X, XM_PERMUTE_0W, XM_PERMUTE_1Z}; + + XMASSERT(pDeterminant); + + MT = XMMatrixTranspose(M); + + V0[0] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleXXYY.v); + V1[0] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleZWZW.v); + V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleXXYY.v); + V1[1] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleZWZW.v); + V0[2] = XMVectorPermute(MT.r[2], MT.r[0], Permute0X0Z1X1Z.v); + V1[2] = XMVectorPermute(MT.r[3], MT.r[1], Permute0Y0W1Y1W.v); + + D0 = XMVectorMultiply(V0[0], V1[0]); + D1 = XMVectorMultiply(V0[1], V1[1]); + D2 = XMVectorMultiply(V0[2], V1[2]); + + V0[0] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleZWZW.v); + V1[0] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleXXYY.v); + V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleZWZW.v); + V1[1] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleXXYY.v); + V0[2] = XMVectorPermute(MT.r[2], MT.r[0], Permute0Y0W1Y1W.v); + V1[2] = XMVectorPermute(MT.r[3], MT.r[1], Permute0X0Z1X1Z.v); + + D0 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], D0); + D1 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], D1); + D2 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], D2); + + V0[0] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleYZXY.v); + V1[0] = XMVectorPermute(D0, D2, Permute1Y0Y0W0X.v); + V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleZXYX.v); + V1[1] = XMVectorPermute(D0, D2, Permute0W1Y0Y0Z.v); + V0[2] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleYZXY.v); + V1[2] = XMVectorPermute(D1, D2, Permute1W0Y0W0X.v); + V0[3] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleZXYX.v); + V1[3] = XMVectorPermute(D1, D2, Permute0W1W0Y0Z.v); + + C0 = XMVectorMultiply(V0[0], V1[0]); + C2 = XMVectorMultiply(V0[1], V1[1]); + C4 = XMVectorMultiply(V0[2], V1[2]); + C6 = XMVectorMultiply(V0[3], V1[3]); + + V0[0] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleZWYZ.v); + V1[0] = XMVectorPermute(D0, D2, Permute0W0X0Y1X.v); + V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleWZWY.v); + V1[1] = XMVectorPermute(D0, D2, Permute0Z0Y1X0X.v); + V0[2] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleZWYZ.v); + V1[2] = XMVectorPermute(D1, D2, Permute0W0X0Y1Z.v); + V0[3] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleWZWY.v); + V1[3] = XMVectorPermute(D1, D2, Permute0Z0Y1Z0X.v); + + C0 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], C0); + C2 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], C2); + C4 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], C4); + C6 = XMVectorNegativeMultiplySubtract(V0[3], V1[3], C6); + + V0[0] = XMVectorPermute(MT.r[1], MT.r[1], SwizzleWXWX.v); + V1[0] = XMVectorPermute(D0, D2, Permute0Z1Y1X0Z.v); + V0[1] = XMVectorPermute(MT.r[0], MT.r[0], SwizzleYWXZ.v); + V1[1] = XMVectorPermute(D0, D2, Permute1Y0X0W1X.v); + V0[2] = XMVectorPermute(MT.r[3], MT.r[3], SwizzleWXWX.v); + V1[2] = XMVectorPermute(D1, D2, Permute0Z1W1Z0Z.v); + V0[3] = XMVectorPermute(MT.r[2], MT.r[2], SwizzleYWXZ.v); + V1[3] = XMVectorPermute(D1, D2, Permute1W0X0W1Z.v); + + C1 = XMVectorNegativeMultiplySubtract(V0[0], V1[0], C0); + C0 = XMVectorMultiplyAdd(V0[0], V1[0], C0); + C3 = XMVectorMultiplyAdd(V0[1], V1[1], C2); + C2 = XMVectorNegativeMultiplySubtract(V0[1], V1[1], C2); + C5 = XMVectorNegativeMultiplySubtract(V0[2], V1[2], C4); + C4 = XMVectorMultiplyAdd(V0[2], V1[2], C4); + C7 = XMVectorMultiplyAdd(V0[3], V1[3], C6); + C6 = XMVectorNegativeMultiplySubtract(V0[3], V1[3], C6); + + R.r[0] = XMVectorSelect(C0, C1, g_XMSelect0101.v); + R.r[1] = XMVectorSelect(C2, C3, g_XMSelect0101.v); + R.r[2] = XMVectorSelect(C4, C5, g_XMSelect0101.v); + R.r[3] = XMVectorSelect(C6, C7, g_XMSelect0101.v); + + Determinant = XMVector4Dot(R.r[0], MT.r[0]); + + *pDeterminant = Determinant; + + Reciprocal = XMVectorReciprocal(Determinant); + + Result.r[0] = XMVectorMultiply(R.r[0], Reciprocal); + Result.r[1] = XMVectorMultiply(R.r[1], Reciprocal); + Result.r[2] = XMVectorMultiply(R.r[2], Reciprocal); + Result.r[3] = XMVectorMultiply(R.r[3], Reciprocal); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pDeterminant); + XMMATRIX MT = XMMatrixTranspose(M); + XMVECTOR V00 = _mm_shuffle_ps(MT.r[2], MT.r[2],_MM_SHUFFLE(1,1,0,0)); + XMVECTOR V10 = _mm_shuffle_ps(MT.r[3], MT.r[3],_MM_SHUFFLE(3,2,3,2)); + XMVECTOR V01 = _mm_shuffle_ps(MT.r[0], MT.r[0],_MM_SHUFFLE(1,1,0,0)); + XMVECTOR V11 = _mm_shuffle_ps(MT.r[1], MT.r[1],_MM_SHUFFLE(3,2,3,2)); + XMVECTOR V02 = _mm_shuffle_ps(MT.r[2], MT.r[0],_MM_SHUFFLE(2,0,2,0)); + XMVECTOR V12 = _mm_shuffle_ps(MT.r[3], MT.r[1],_MM_SHUFFLE(3,1,3,1)); + + XMVECTOR D0 = _mm_mul_ps(V00,V10); + XMVECTOR D1 = _mm_mul_ps(V01,V11); + XMVECTOR D2 = _mm_mul_ps(V02,V12); + + V00 = _mm_shuffle_ps(MT.r[2],MT.r[2],_MM_SHUFFLE(3,2,3,2)); + V10 = _mm_shuffle_ps(MT.r[3],MT.r[3],_MM_SHUFFLE(1,1,0,0)); + V01 = _mm_shuffle_ps(MT.r[0],MT.r[0],_MM_SHUFFLE(3,2,3,2)); + V11 = _mm_shuffle_ps(MT.r[1],MT.r[1],_MM_SHUFFLE(1,1,0,0)); + V02 = _mm_shuffle_ps(MT.r[2],MT.r[0],_MM_SHUFFLE(3,1,3,1)); + V12 = _mm_shuffle_ps(MT.r[3],MT.r[1],_MM_SHUFFLE(2,0,2,0)); + + V00 = _mm_mul_ps(V00,V10); + V01 = _mm_mul_ps(V01,V11); + V02 = _mm_mul_ps(V02,V12); + D0 = _mm_sub_ps(D0,V00); + D1 = _mm_sub_ps(D1,V01); + D2 = _mm_sub_ps(D2,V02); + // V11 = D0Y,D0W,D2Y,D2Y + V11 = _mm_shuffle_ps(D0,D2,_MM_SHUFFLE(1,1,3,1)); + V00 = _mm_shuffle_ps(MT.r[1], MT.r[1],_MM_SHUFFLE(1,0,2,1)); + V10 = _mm_shuffle_ps(V11,D0,_MM_SHUFFLE(0,3,0,2)); + V01 = _mm_shuffle_ps(MT.r[0], MT.r[0],_MM_SHUFFLE(0,1,0,2)); + V11 = _mm_shuffle_ps(V11,D0,_MM_SHUFFLE(2,1,2,1)); + // V13 = D1Y,D1W,D2W,D2W + XMVECTOR V13 = _mm_shuffle_ps(D1,D2,_MM_SHUFFLE(3,3,3,1)); + V02 = _mm_shuffle_ps(MT.r[3], MT.r[3],_MM_SHUFFLE(1,0,2,1)); + V12 = _mm_shuffle_ps(V13,D1,_MM_SHUFFLE(0,3,0,2)); + XMVECTOR V03 = _mm_shuffle_ps(MT.r[2], MT.r[2],_MM_SHUFFLE(0,1,0,2)); + V13 = _mm_shuffle_ps(V13,D1,_MM_SHUFFLE(2,1,2,1)); + + XMVECTOR C0 = _mm_mul_ps(V00,V10); + XMVECTOR C2 = _mm_mul_ps(V01,V11); + XMVECTOR C4 = _mm_mul_ps(V02,V12); + XMVECTOR C6 = _mm_mul_ps(V03,V13); + + // V11 = D0X,D0Y,D2X,D2X + V11 = _mm_shuffle_ps(D0,D2,_MM_SHUFFLE(0,0,1,0)); + V00 = _mm_shuffle_ps(MT.r[1], MT.r[1],_MM_SHUFFLE(2,1,3,2)); + V10 = _mm_shuffle_ps(D0,V11,_MM_SHUFFLE(2,1,0,3)); + V01 = _mm_shuffle_ps(MT.r[0], MT.r[0],_MM_SHUFFLE(1,3,2,3)); + V11 = _mm_shuffle_ps(D0,V11,_MM_SHUFFLE(0,2,1,2)); + // V13 = D1X,D1Y,D2Z,D2Z + V13 = _mm_shuffle_ps(D1,D2,_MM_SHUFFLE(2,2,1,0)); + V02 = _mm_shuffle_ps(MT.r[3], MT.r[3],_MM_SHUFFLE(2,1,3,2)); + V12 = _mm_shuffle_ps(D1,V13,_MM_SHUFFLE(2,1,0,3)); + V03 = _mm_shuffle_ps(MT.r[2], MT.r[2],_MM_SHUFFLE(1,3,2,3)); + V13 = _mm_shuffle_ps(D1,V13,_MM_SHUFFLE(0,2,1,2)); + + V00 = _mm_mul_ps(V00,V10); + V01 = _mm_mul_ps(V01,V11); + V02 = _mm_mul_ps(V02,V12); + V03 = _mm_mul_ps(V03,V13); + C0 = _mm_sub_ps(C0,V00); + C2 = _mm_sub_ps(C2,V01); + C4 = _mm_sub_ps(C4,V02); + C6 = _mm_sub_ps(C6,V03); + + V00 = _mm_shuffle_ps(MT.r[1],MT.r[1],_MM_SHUFFLE(0,3,0,3)); + // V10 = D0Z,D0Z,D2X,D2Y + V10 = _mm_shuffle_ps(D0,D2,_MM_SHUFFLE(1,0,2,2)); + V10 = _mm_shuffle_ps(V10,V10,_MM_SHUFFLE(0,2,3,0)); + V01 = _mm_shuffle_ps(MT.r[0],MT.r[0],_MM_SHUFFLE(2,0,3,1)); + // V11 = D0X,D0W,D2X,D2Y + V11 = _mm_shuffle_ps(D0,D2,_MM_SHUFFLE(1,0,3,0)); + V11 = _mm_shuffle_ps(V11,V11,_MM_SHUFFLE(2,1,0,3)); + V02 = _mm_shuffle_ps(MT.r[3],MT.r[3],_MM_SHUFFLE(0,3,0,3)); + // V12 = D1Z,D1Z,D2Z,D2W + V12 = _mm_shuffle_ps(D1,D2,_MM_SHUFFLE(3,2,2,2)); + V12 = _mm_shuffle_ps(V12,V12,_MM_SHUFFLE(0,2,3,0)); + V03 = _mm_shuffle_ps(MT.r[2],MT.r[2],_MM_SHUFFLE(2,0,3,1)); + // V13 = D1X,D1W,D2Z,D2W + V13 = _mm_shuffle_ps(D1,D2,_MM_SHUFFLE(3,2,3,0)); + V13 = _mm_shuffle_ps(V13,V13,_MM_SHUFFLE(2,1,0,3)); + + V00 = _mm_mul_ps(V00,V10); + V01 = _mm_mul_ps(V01,V11); + V02 = _mm_mul_ps(V02,V12); + V03 = _mm_mul_ps(V03,V13); + XMVECTOR C1 = _mm_sub_ps(C0,V00); + C0 = _mm_add_ps(C0,V00); + XMVECTOR C3 = _mm_add_ps(C2,V01); + C2 = _mm_sub_ps(C2,V01); + XMVECTOR C5 = _mm_sub_ps(C4,V02); + C4 = _mm_add_ps(C4,V02); + XMVECTOR C7 = _mm_add_ps(C6,V03); + C6 = _mm_sub_ps(C6,V03); + + C0 = _mm_shuffle_ps(C0,C1,_MM_SHUFFLE(3,1,2,0)); + C2 = _mm_shuffle_ps(C2,C3,_MM_SHUFFLE(3,1,2,0)); + C4 = _mm_shuffle_ps(C4,C5,_MM_SHUFFLE(3,1,2,0)); + C6 = _mm_shuffle_ps(C6,C7,_MM_SHUFFLE(3,1,2,0)); + C0 = _mm_shuffle_ps(C0,C0,_MM_SHUFFLE(3,1,2,0)); + C2 = _mm_shuffle_ps(C2,C2,_MM_SHUFFLE(3,1,2,0)); + C4 = _mm_shuffle_ps(C4,C4,_MM_SHUFFLE(3,1,2,0)); + C6 = _mm_shuffle_ps(C6,C6,_MM_SHUFFLE(3,1,2,0)); + // Get the determinate + XMVECTOR vTemp = XMVector4Dot(C0,MT.r[0]); + *pDeterminant = vTemp; + vTemp = _mm_div_ps(g_XMOne,vTemp); + XMMATRIX mResult; + mResult.r[0] = _mm_mul_ps(C0,vTemp); + mResult.r[1] = _mm_mul_ps(C2,vTemp); + mResult.r[2] = _mm_mul_ps(C4,vTemp); + mResult.r[3] = _mm_mul_ps(C6,vTemp); + return mResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMMatrixDeterminant +( + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V0, V1, V2, V3, V4, V5; + XMVECTOR P0, P1, P2, R, S; + XMVECTOR Result; + static CONST XMVECTORU32 SwizzleYXXX = {XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X}; + static CONST XMVECTORU32 SwizzleZZYY = {XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_0Y}; + static CONST XMVECTORU32 SwizzleWWWZ = {XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0Z}; + static CONST XMVECTOR Sign = {1.0f, -1.0f, 1.0f, -1.0f}; + + V0 = XMVectorPermute(M.r[2], M.r[2], SwizzleYXXX.v); + V1 = XMVectorPermute(M.r[3], M.r[3], SwizzleZZYY.v); + V2 = XMVectorPermute(M.r[2], M.r[2], SwizzleYXXX.v); + V3 = XMVectorPermute(M.r[3], M.r[3], SwizzleWWWZ.v); + V4 = XMVectorPermute(M.r[2], M.r[2], SwizzleZZYY.v); + V5 = XMVectorPermute(M.r[3], M.r[3], SwizzleWWWZ.v); + + P0 = XMVectorMultiply(V0, V1); + P1 = XMVectorMultiply(V2, V3); + P2 = XMVectorMultiply(V4, V5); + + V0 = XMVectorPermute(M.r[2], M.r[2], SwizzleZZYY.v); + V1 = XMVectorPermute(M.r[3], M.r[3], SwizzleYXXX.v); + V2 = XMVectorPermute(M.r[2], M.r[2], SwizzleWWWZ.v); + V3 = XMVectorPermute(M.r[3], M.r[3], SwizzleYXXX.v); + V4 = XMVectorPermute(M.r[2], M.r[2], SwizzleWWWZ.v); + V5 = XMVectorPermute(M.r[3], M.r[3], SwizzleZZYY.v); + + P0 = XMVectorNegativeMultiplySubtract(V0, V1, P0); + P1 = XMVectorNegativeMultiplySubtract(V2, V3, P1); + P2 = XMVectorNegativeMultiplySubtract(V4, V5, P2); + + V0 = XMVectorPermute(M.r[1], M.r[1], SwizzleWWWZ.v); + V1 = XMVectorPermute(M.r[1], M.r[1], SwizzleZZYY.v); + V2 = XMVectorPermute(M.r[1], M.r[1], SwizzleYXXX.v); + + S = XMVectorMultiply(M.r[0], Sign); + R = XMVectorMultiply(V0, P0); + R = XMVectorNegativeMultiplySubtract(V1, P1, R); + R = XMVectorMultiplyAdd(V2, P2, R); + + Result = XMVector4Dot(S, R); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V0, V1, V2, V3, V4, V5; + XMVECTOR P0, P1, P2, R, S; + XMVECTOR Result; + static CONST XMVECTORU32 SwizzleYXXX = {XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X}; + static CONST XMVECTORU32 SwizzleZZYY = {XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_0Y}; + static CONST XMVECTORU32 SwizzleWWWZ = {XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0Z}; + static CONST XMVECTORF32 Sign = {1.0f, -1.0f, 1.0f, -1.0f}; + + V0 = XMVectorPermute(M.r[2], M.r[2], SwizzleYXXX); + V1 = XMVectorPermute(M.r[3], M.r[3], SwizzleZZYY); + V2 = XMVectorPermute(M.r[2], M.r[2], SwizzleYXXX); + V3 = XMVectorPermute(M.r[3], M.r[3], SwizzleWWWZ); + V4 = XMVectorPermute(M.r[2], M.r[2], SwizzleZZYY); + V5 = XMVectorPermute(M.r[3], M.r[3], SwizzleWWWZ); + + P0 = _mm_mul_ps(V0, V1); + P1 = _mm_mul_ps(V2, V3); + P2 = _mm_mul_ps(V4, V5); + + V0 = XMVectorPermute(M.r[2], M.r[2], SwizzleZZYY); + V1 = XMVectorPermute(M.r[3], M.r[3], SwizzleYXXX); + V2 = XMVectorPermute(M.r[2], M.r[2], SwizzleWWWZ); + V3 = XMVectorPermute(M.r[3], M.r[3], SwizzleYXXX); + V4 = XMVectorPermute(M.r[2], M.r[2], SwizzleWWWZ); + V5 = XMVectorPermute(M.r[3], M.r[3], SwizzleZZYY); + + P0 = XMVectorNegativeMultiplySubtract(V0, V1, P0); + P1 = XMVectorNegativeMultiplySubtract(V2, V3, P1); + P2 = XMVectorNegativeMultiplySubtract(V4, V5, P2); + + V0 = XMVectorPermute(M.r[1], M.r[1], SwizzleWWWZ); + V1 = XMVectorPermute(M.r[1], M.r[1], SwizzleZZYY); + V2 = XMVectorPermute(M.r[1], M.r[1], SwizzleYXXX); + + S = _mm_mul_ps(M.r[0], Sign); + R = _mm_mul_ps(V0, P0); + R = XMVectorNegativeMultiplySubtract(V1, P1, R); + R = XMVectorMultiplyAdd(V2, P2, R); + + Result = XMVector4Dot(S, R); + + return Result; + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +#define XMRANKDECOMPOSE(a, b, c, x, y, z) \ + if((x) < (y)) \ + { \ + if((y) < (z)) \ + { \ + (a) = 2; \ + (b) = 1; \ + (c) = 0; \ + } \ + else \ + { \ + (a) = 1; \ + \ + if((x) < (z)) \ + { \ + (b) = 2; \ + (c) = 0; \ + } \ + else \ + { \ + (b) = 0; \ + (c) = 2; \ + } \ + } \ + } \ + else \ + { \ + if((x) < (z)) \ + { \ + (a) = 2; \ + (b) = 0; \ + (c) = 1; \ + } \ + else \ + { \ + (a) = 0; \ + \ + if((y) < (z)) \ + { \ + (b) = 2; \ + (c) = 1; \ + } \ + else \ + { \ + (b) = 1; \ + (c) = 2; \ + } \ + } \ + } + +#define XM_DECOMP_EPSILON 0.0001f + +XMINLINE BOOL XMMatrixDecompose( XMVECTOR *outScale, XMVECTOR *outRotQuat, XMVECTOR *outTrans, CXMMATRIX M ) +{ + FLOAT fDet; + FLOAT *pfScales; + XMVECTOR *ppvBasis[3]; + XMMATRIX matTemp; + UINT a, b, c; + static const XMVECTOR *pvCanonicalBasis[3] = { + &g_XMIdentityR0.v, + &g_XMIdentityR1.v, + &g_XMIdentityR2.v + }; + + // Get the translation + outTrans[0] = M.r[3]; + + ppvBasis[0] = &matTemp.r[0]; + ppvBasis[1] = &matTemp.r[1]; + ppvBasis[2] = &matTemp.r[2]; + + matTemp.r[0] = M.r[0]; + matTemp.r[1] = M.r[1]; + matTemp.r[2] = M.r[2]; + matTemp.r[3] = g_XMIdentityR3.v; + + pfScales = (FLOAT *)outScale; + + XMVectorGetXPtr(&pfScales[0],XMVector3Length(ppvBasis[0][0])); + XMVectorGetXPtr(&pfScales[1],XMVector3Length(ppvBasis[1][0])); + XMVectorGetXPtr(&pfScales[2],XMVector3Length(ppvBasis[2][0])); + + XMRANKDECOMPOSE(a, b, c, pfScales[0], pfScales[1], pfScales[2]) + + if(pfScales[a] < XM_DECOMP_EPSILON) + { + ppvBasis[a][0] = pvCanonicalBasis[a][0]; + } + ppvBasis[a][0] = XMVector3Normalize(ppvBasis[a][0]); + + if(pfScales[b] < XM_DECOMP_EPSILON) + { + UINT aa, bb, cc; + FLOAT fAbsX, fAbsY, fAbsZ; + + fAbsX = fabsf(XMVectorGetX(ppvBasis[a][0])); + fAbsY = fabsf(XMVectorGetY(ppvBasis[a][0])); + fAbsZ = fabsf(XMVectorGetZ(ppvBasis[a][0])); + + XMRANKDECOMPOSE(aa, bb, cc, fAbsX, fAbsY, fAbsZ) + + ppvBasis[b][0] = XMVector3Cross(ppvBasis[a][0],pvCanonicalBasis[cc][0]); + } + + ppvBasis[b][0] = XMVector3Normalize(ppvBasis[b][0]); + + if(pfScales[c] < XM_DECOMP_EPSILON) + { + ppvBasis[c][0] = XMVector3Cross(ppvBasis[a][0],ppvBasis[b][0]); + } + + ppvBasis[c][0] = XMVector3Normalize(ppvBasis[c][0]); + + fDet = XMVectorGetX(XMMatrixDeterminant(matTemp)); + + // use Kramer's rule to check for handedness of coordinate system + if(fDet < 0.0f) + { + // switch coordinate system by negating the scale and inverting the basis vector on the x-axis + pfScales[a] = -pfScales[a]; + ppvBasis[a][0] = XMVectorNegate(ppvBasis[a][0]); + + fDet = -fDet; + } + + fDet -= 1.0f; + fDet *= fDet; + + if(XM_DECOMP_EPSILON < fDet) + { +// Non-SRT matrix encountered + return FALSE; + } + + // generate the quaternion from the matrix + outRotQuat[0] = XMQuaternionRotationMatrix(matTemp); + return TRUE; +} + +//------------------------------------------------------------------------------ +// Transformation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixIdentity() +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.r[0] = g_XMIdentityR0.v; + M.r[1] = g_XMIdentityR1.v; + M.r[2] = g_XMIdentityR2.v; + M.r[3] = g_XMIdentityR3.v; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = g_XMIdentityR0; + M.r[1] = g_XMIdentityR1; + M.r[2] = g_XMIdentityR2; + M.r[3] = g_XMIdentityR3; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixSet +( + FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03, + FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13, + FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23, + FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33 +) +{ + XMMATRIX M; + + M.r[0] = XMVectorSet(m00, m01, m02, m03); + M.r[1] = XMVectorSet(m10, m11, m12, m13); + M.r[2] = XMVectorSet(m20, m21, m22, m23); + M.r[3] = XMVectorSet(m30, m31, m32, m33); + + return M; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixTranslation +( + FLOAT OffsetX, + FLOAT OffsetY, + FLOAT OffsetZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + + M.m[0][0] = 1.0f; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 1.0f; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = 1.0f; + M.m[2][3] = 0.0f; + + M.m[3][0] = OffsetX; + M.m[3][1] = OffsetY; + M.m[3][2] = OffsetZ; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = g_XMIdentityR0; + M.r[1] = g_XMIdentityR1; + M.r[2] = g_XMIdentityR2; + M.r[3] = _mm_set_ps(1.0f,OffsetZ,OffsetY,OffsetX); + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixTranslationFromVector +( + FXMVECTOR Offset +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + M.m[0][0] = 1.0f; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 1.0f; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = 1.0f; + M.m[2][3] = 0.0f; + + M.m[3][0] = Offset.vector4_f32[0]; + M.m[3][1] = Offset.vector4_f32[1]; + M.m[3][2] = Offset.vector4_f32[2]; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_and_ps(Offset,g_XMMask3); + vTemp = _mm_or_ps(vTemp,g_XMIdentityR3); + XMMATRIX M; + M.r[0] = g_XMIdentityR0; + M.r[1] = g_XMIdentityR1; + M.r[2] = g_XMIdentityR2; + M.r[3] = vTemp; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixScaling +( + FLOAT ScaleX, + FLOAT ScaleY, + FLOAT ScaleZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + + M.r[0] = XMVectorSet(ScaleX, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, ScaleY, 0.0f, 0.0f); + M.r[2] = XMVectorSet(0.0f, 0.0f, ScaleZ, 0.0f); + + M.r[3] = g_XMIdentityR3.v; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_set_ps( 0, 0, 0, ScaleX ); + M.r[1] = _mm_set_ps( 0, 0, ScaleY, 0 ); + M.r[2] = _mm_set_ps( 0, ScaleZ, 0, 0 ); + M.r[3] = g_XMIdentityR3; + return M; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixScalingFromVector +( + FXMVECTOR Scale +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX M; + M.m[0][0] = Scale.vector4_f32[0]; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = Scale.vector4_f32[1]; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = Scale.vector4_f32[2]; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + M.r[0] = _mm_and_ps(Scale,g_XMMaskX); + M.r[1] = _mm_and_ps(Scale,g_XMMaskY); + M.r[2] = _mm_and_ps(Scale,g_XMMaskZ); + M.r[3] = g_XMIdentityR3; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixRotationX +( + FLOAT Angle +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX M; + + FLOAT fSinAngle = sinf(Angle); + FLOAT fCosAngle = cosf(Angle); + + M.m[0][0] = 1.0f; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = fCosAngle; + M.m[1][2] = fSinAngle; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = -fSinAngle; + M.m[2][2] = fCosAngle; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + FLOAT SinAngle = sinf(Angle); + FLOAT CosAngle = cosf(Angle); + + XMVECTOR vSin = _mm_set_ss(SinAngle); + XMVECTOR vCos = _mm_set_ss(CosAngle); + // x = 0,y = cos,z = sin, w = 0 + vCos = _mm_shuffle_ps(vCos,vSin,_MM_SHUFFLE(3,0,0,3)); + XMMATRIX M; + M.r[0] = g_XMIdentityR0; + M.r[1] = vCos; + // x = 0,y = sin,z = cos, w = 0 + vCos = _mm_shuffle_ps(vCos,vCos,_MM_SHUFFLE(3,1,2,0)); + // x = 0,y = -sin,z = cos, w = 0 + vCos = _mm_mul_ps(vCos,g_XMNegateY); + M.r[2] = vCos; + M.r[3] = g_XMIdentityR3; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixRotationY +( + FLOAT Angle +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX M; + + FLOAT fSinAngle = sinf(Angle); + FLOAT fCosAngle = cosf(Angle); + + M.m[0][0] = fCosAngle; + M.m[0][1] = 0.0f; + M.m[0][2] = -fSinAngle; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = 1.0f; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = fSinAngle; + M.m[2][1] = 0.0f; + M.m[2][2] = fCosAngle; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; +#elif defined(_XM_SSE_INTRINSICS_) + FLOAT SinAngle = sinf(Angle); + FLOAT CosAngle = cosf(Angle); + + XMVECTOR vSin = _mm_set_ss(SinAngle); + XMVECTOR vCos = _mm_set_ss(CosAngle); + // x = sin,y = 0,z = cos, w = 0 + vSin = _mm_shuffle_ps(vSin,vCos,_MM_SHUFFLE(3,0,3,0)); + XMMATRIX M; + M.r[2] = vSin; + M.r[1] = g_XMIdentityR1; + // x = cos,y = 0,z = sin, w = 0 + vSin = _mm_shuffle_ps(vSin,vSin,_MM_SHUFFLE(3,0,1,2)); + // x = cos,y = 0,z = -sin, w = 0 + vSin = _mm_mul_ps(vSin,g_XMNegateZ); + M.r[0] = vSin; + M.r[3] = g_XMIdentityR3; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixRotationZ +( + FLOAT Angle +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMMATRIX M; + + FLOAT fSinAngle = sinf(Angle); + FLOAT fCosAngle = cosf(Angle); + + M.m[0][0] = fCosAngle; + M.m[0][1] = fSinAngle; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = -fSinAngle; + M.m[1][1] = fCosAngle; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = 1.0f; + M.m[2][3] = 0.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = 0.0f; + M.m[3][3] = 1.0f; + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + FLOAT SinAngle = sinf(Angle); + FLOAT CosAngle = cosf(Angle); + + XMVECTOR vSin = _mm_set_ss(SinAngle); + XMVECTOR vCos = _mm_set_ss(CosAngle); + // x = cos,y = sin,z = 0, w = 0 + vCos = _mm_unpacklo_ps(vCos,vSin); + XMMATRIX M; + M.r[0] = vCos; + // x = sin,y = cos,z = 0, w = 0 + vCos = _mm_shuffle_ps(vCos,vCos,_MM_SHUFFLE(3,2,0,1)); + // x = cos,y = -sin,z = 0, w = 0 + vCos = _mm_mul_ps(vCos,g_XMNegateX); + M.r[1] = vCos; + M.r[2] = g_XMIdentityR2; + M.r[3] = g_XMIdentityR3; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixRotationRollPitchYaw +( + FLOAT Pitch, + FLOAT Yaw, + FLOAT Roll +) +{ + XMVECTOR Angles; + XMMATRIX M; + + Angles = XMVectorSet(Pitch, Yaw, Roll, 0.0f); + M = XMMatrixRotationRollPitchYawFromVector(Angles); + + return M; +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixRotationRollPitchYawFromVector +( + FXMVECTOR Angles // +) +{ + XMVECTOR Q; + XMMATRIX M; + + Q = XMQuaternionRotationRollPitchYawFromVector(Angles); + M = XMMatrixRotationQuaternion(Q); + + return M; +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixRotationNormal +( + FXMVECTOR NormalAxis, + FLOAT Angle +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR A; + XMVECTOR N0, N1; + XMVECTOR V0, V1, V2; + XMVECTOR R0, R1, R2; + XMVECTOR C0, C1, C2; + XMMATRIX M; + static CONST XMVECTORU32 SwizzleYZXW = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0W}; + static CONST XMVECTORU32 SwizzleZXYW = {XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute0Z1Y1Z0X = {XM_PERMUTE_0Z, XM_PERMUTE_1Y, XM_PERMUTE_1Z, XM_PERMUTE_0X}; + static CONST XMVECTORU32 Permute0Y1X0Y1X = {XM_PERMUTE_0Y, XM_PERMUTE_1X, XM_PERMUTE_0Y, XM_PERMUTE_1X}; + static CONST XMVECTORU32 Permute0X1X1Y0W = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute1Z0Y1W0W = {XM_PERMUTE_1Z, XM_PERMUTE_0Y, XM_PERMUTE_1W, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute1X1Y0Z0W = {XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0Z, XM_PERMUTE_0W}; + + FLOAT fSinAngle = sinf(Angle); + FLOAT fCosAngle = cosf(Angle); + + A = XMVectorSet(fSinAngle, fCosAngle, 1.0f - fCosAngle, 0.0f); + + C2 = XMVectorSplatZ(A); + C1 = XMVectorSplatY(A); + C0 = XMVectorSplatX(A); + + N0 = XMVectorPermute(NormalAxis, NormalAxis, SwizzleYZXW.v); + N1 = XMVectorPermute(NormalAxis, NormalAxis, SwizzleZXYW.v); + + V0 = XMVectorMultiply(C2, N0); + V0 = XMVectorMultiply(V0, N1); + + R0 = XMVectorMultiply(C2, NormalAxis); + R0 = XMVectorMultiplyAdd(R0, NormalAxis, C1); + + R1 = XMVectorMultiplyAdd(C0, NormalAxis, V0); + R2 = XMVectorNegativeMultiplySubtract(C0, NormalAxis, V0); + + V0 = XMVectorSelect(A, R0, g_XMSelect1110.v); + V1 = XMVectorPermute(R1, R2, Permute0Z1Y1Z0X.v); + V2 = XMVectorPermute(R1, R2, Permute0Y1X0Y1X.v); + + M.r[0] = XMVectorPermute(V0, V1, Permute0X1X1Y0W.v); + M.r[1] = XMVectorPermute(V0, V1, Permute1Z0Y1W0W.v); + M.r[2] = XMVectorPermute(V0, V2, Permute1X1Y0Z0W.v); + M.r[3] = g_XMIdentityR3.v; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR N0, N1; + XMVECTOR V0, V1, V2; + XMVECTOR R0, R1, R2; + XMVECTOR C0, C1, C2; + XMMATRIX M; + + FLOAT fSinAngle = sinf(Angle); + FLOAT fCosAngle = cosf(Angle); + + C2 = _mm_set_ps1(1.0f - fCosAngle); + C1 = _mm_set_ps1(fCosAngle); + C0 = _mm_set_ps1(fSinAngle); + + N0 = _mm_shuffle_ps(NormalAxis,NormalAxis,_MM_SHUFFLE(3,0,2,1)); +// N0 = XMVectorPermute(NormalAxis, NormalAxis, SwizzleYZXW); + N1 = _mm_shuffle_ps(NormalAxis,NormalAxis,_MM_SHUFFLE(3,1,0,2)); +// N1 = XMVectorPermute(NormalAxis, NormalAxis, SwizzleZXYW); + + V0 = _mm_mul_ps(C2, N0); + V0 = _mm_mul_ps(V0, N1); + + R0 = _mm_mul_ps(C2, NormalAxis); + R0 = _mm_mul_ps(R0, NormalAxis); + R0 = _mm_add_ps(R0, C1); + + R1 = _mm_mul_ps(C0, NormalAxis); + R1 = _mm_add_ps(R1, V0); + R2 = _mm_mul_ps(C0, NormalAxis); + R2 = _mm_sub_ps(V0,R2); + + V0 = _mm_and_ps(R0,g_XMMask3); +// V0 = XMVectorSelect(A, R0, g_XMSelect1110); + V1 = _mm_shuffle_ps(R1,R2,_MM_SHUFFLE(2,1,2,0)); + V1 = _mm_shuffle_ps(V1,V1,_MM_SHUFFLE(0,3,2,1)); +// V1 = XMVectorPermute(R1, R2, Permute0Z1Y1Z0X); + V2 = _mm_shuffle_ps(R1,R2,_MM_SHUFFLE(0,0,1,1)); + V2 = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(2,0,2,0)); +// V2 = XMVectorPermute(R1, R2, Permute0Y1X0Y1X); + + R2 = _mm_shuffle_ps(V0,V1,_MM_SHUFFLE(1,0,3,0)); + R2 = _mm_shuffle_ps(R2,R2,_MM_SHUFFLE(1,3,2,0)); + M.r[0] = R2; +// M.r[0] = XMVectorPermute(V0, V1, Permute0X1X1Y0W); + R2 = _mm_shuffle_ps(V0,V1,_MM_SHUFFLE(3,2,3,1)); + R2 = _mm_shuffle_ps(R2,R2,_MM_SHUFFLE(1,3,0,2)); + M.r[1] = R2; +// M.r[1] = XMVectorPermute(V0, V1, Permute1Z0Y1W0W); + V2 = _mm_shuffle_ps(V2,V0,_MM_SHUFFLE(3,2,1,0)); +// R2 = _mm_shuffle_ps(R2,R2,_MM_SHUFFLE(3,2,1,0)); + M.r[2] = V2; +// M.r[2] = XMVectorPermute(V0, V2, Permute1X1Y0Z0W); + M.r[3] = g_XMIdentityR3; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixRotationAxis +( + FXMVECTOR Axis, + FLOAT Angle +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Normal; + XMMATRIX M; + + XMASSERT(!XMVector3Equal(Axis, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(Axis)); + + Normal = XMVector3Normalize(Axis); + M = XMMatrixRotationNormal(Normal, Angle); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMVector3Equal(Axis, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(Axis)); + XMVECTOR Normal = XMVector3Normalize(Axis); + XMMATRIX M = XMMatrixRotationNormal(Normal, Angle); + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixRotationQuaternion +( + FXMVECTOR Quaternion +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + XMVECTOR Q0, Q1; + XMVECTOR V0, V1, V2; + XMVECTOR R0, R1, R2; + static CONST XMVECTOR Constant1110 = {1.0f, 1.0f, 1.0f, 0.0f}; + static CONST XMVECTORU32 SwizzleXXYW = {XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0W}; + static CONST XMVECTORU32 SwizzleZYZW = {XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0W}; + static CONST XMVECTORU32 SwizzleYZXW = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0X, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute0Y0X0X1W = {XM_PERMUTE_0Y, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_1W}; + static CONST XMVECTORU32 Permute0Z0Z0Y1W = {XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_1W}; + static CONST XMVECTORU32 Permute0Y1X1Y0Z = {XM_PERMUTE_0Y, XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 Permute0X1Z0X1Z = {XM_PERMUTE_0X, XM_PERMUTE_1Z, XM_PERMUTE_0X, XM_PERMUTE_1Z}; + static CONST XMVECTORU32 Permute0X1X1Y0W = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute1Z0Y1W0W = {XM_PERMUTE_1Z, XM_PERMUTE_0Y, XM_PERMUTE_1W, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute1X1Y0Z0W = {XM_PERMUTE_1X, XM_PERMUTE_1Y, XM_PERMUTE_0Z, XM_PERMUTE_0W}; + + Q0 = XMVectorAdd(Quaternion, Quaternion); + Q1 = XMVectorMultiply(Quaternion, Q0); + + V0 = XMVectorPermute(Q1, Constant1110, Permute0Y0X0X1W.v); + V1 = XMVectorPermute(Q1, Constant1110, Permute0Z0Z0Y1W.v); + R0 = XMVectorSubtract(Constant1110, V0); + R0 = XMVectorSubtract(R0, V1); + + V0 = XMVectorPermute(Quaternion, Quaternion, SwizzleXXYW.v); + V1 = XMVectorPermute(Q0, Q0, SwizzleZYZW.v); + V0 = XMVectorMultiply(V0, V1); + + V1 = XMVectorSplatW(Quaternion); + V2 = XMVectorPermute(Q0, Q0, SwizzleYZXW.v); + V1 = XMVectorMultiply(V1, V2); + + R1 = XMVectorAdd(V0, V1); + R2 = XMVectorSubtract(V0, V1); + + V0 = XMVectorPermute(R1, R2, Permute0Y1X1Y0Z.v); + V1 = XMVectorPermute(R1, R2, Permute0X1Z0X1Z.v); + + M.r[0] = XMVectorPermute(R0, V0, Permute0X1X1Y0W.v); + M.r[1] = XMVectorPermute(R0, V0, Permute1Z0Y1W0W.v); + M.r[2] = XMVectorPermute(R0, V1, Permute1X1Y0Z0W.v); + M.r[3] = g_XMIdentityR3.v; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + XMVECTOR Q0, Q1; + XMVECTOR V0, V1, V2; + XMVECTOR R0, R1, R2; + static CONST XMVECTORF32 Constant1110 = {1.0f, 1.0f, 1.0f, 0.0f}; + + Q0 = _mm_add_ps(Quaternion,Quaternion); + Q1 = _mm_mul_ps(Quaternion,Q0); + + V0 = _mm_shuffle_ps(Q1,Q1,_MM_SHUFFLE(3,0,0,1)); + V0 = _mm_and_ps(V0,g_XMMask3); +// V0 = XMVectorPermute(Q1, Constant1110,Permute0Y0X0X1W); + V1 = _mm_shuffle_ps(Q1,Q1,_MM_SHUFFLE(3,1,2,2)); + V1 = _mm_and_ps(V1,g_XMMask3); +// V1 = XMVectorPermute(Q1, Constant1110,Permute0Z0Z0Y1W); + R0 = _mm_sub_ps(Constant1110,V0); + R0 = _mm_sub_ps(R0, V1); + + V0 = _mm_shuffle_ps(Quaternion,Quaternion,_MM_SHUFFLE(3,1,0,0)); +// V0 = XMVectorPermute(Quaternion, Quaternion,SwizzleXXYW); + V1 = _mm_shuffle_ps(Q0,Q0,_MM_SHUFFLE(3,2,1,2)); +// V1 = XMVectorPermute(Q0, Q0,SwizzleZYZW); + V0 = _mm_mul_ps(V0, V1); + + V1 = _mm_shuffle_ps(Quaternion,Quaternion,_MM_SHUFFLE(3,3,3,3)); +// V1 = XMVectorSplatW(Quaternion); + V2 = _mm_shuffle_ps(Q0,Q0,_MM_SHUFFLE(3,0,2,1)); +// V2 = XMVectorPermute(Q0, Q0,SwizzleYZXW); + V1 = _mm_mul_ps(V1, V2); + + R1 = _mm_add_ps(V0, V1); + R2 = _mm_sub_ps(V0, V1); + + V0 = _mm_shuffle_ps(R1,R2,_MM_SHUFFLE(1,0,2,1)); + V0 = _mm_shuffle_ps(V0,V0,_MM_SHUFFLE(1,3,2,0)); +// V0 = XMVectorPermute(R1, R2,Permute0Y1X1Y0Z); + V1 = _mm_shuffle_ps(R1,R2,_MM_SHUFFLE(2,2,0,0)); + V1 = _mm_shuffle_ps(V1,V1,_MM_SHUFFLE(2,0,2,0)); +// V1 = XMVectorPermute(R1, R2,Permute0X1Z0X1Z); + + Q1 = _mm_shuffle_ps(R0,V0,_MM_SHUFFLE(1,0,3,0)); + Q1 = _mm_shuffle_ps(Q1,Q1,_MM_SHUFFLE(1,3,2,0)); + M.r[0] = Q1; +// M.r[0] = XMVectorPermute(R0, V0,Permute0X1X1Y0W); + Q1 = _mm_shuffle_ps(R0,V0,_MM_SHUFFLE(3,2,3,1)); + Q1 = _mm_shuffle_ps(Q1,Q1,_MM_SHUFFLE(1,3,0,2)); + M.r[1] = Q1; +// M.r[1] = XMVectorPermute(R0, V0,Permute1Z0Y1W0W); + Q1 = _mm_shuffle_ps(V1,R0,_MM_SHUFFLE(3,2,1,0)); + M.r[2] = Q1; +// M.r[2] = XMVectorPermute(R0, V1,Permute1X1Y0Z0W); + M.r[3] = g_XMIdentityR3; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixTransformation2D +( + FXMVECTOR ScalingOrigin, + FLOAT ScalingOrientation, + FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, + FLOAT Rotation, + CXMVECTOR Translation +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + XMVECTOR VScaling; + XMVECTOR NegScalingOrigin; + XMVECTOR VScalingOrigin; + XMMATRIX MScalingOriginI; + XMMATRIX MScalingOrientation; + XMMATRIX MScalingOrientationT; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + + // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation * + // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + VScalingOrigin = XMVectorSelect(g_XMSelect1100.v, ScalingOrigin, g_XMSelect1100.v); + NegScalingOrigin = XMVectorNegate(VScalingOrigin); + + MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin); + MScalingOrientation = XMMatrixRotationZ(ScalingOrientation); + MScalingOrientationT = XMMatrixTranspose(MScalingOrientation); + VScaling = XMVectorSelect(g_XMOne.v, Scaling, g_XMSelect1100.v); + MScaling = XMMatrixScalingFromVector(VScaling); + VRotationOrigin = XMVectorSelect(g_XMSelect1100.v, RotationOrigin, g_XMSelect1100.v); + MRotation = XMMatrixRotationZ(Rotation); + VTranslation = XMVectorSelect(g_XMSelect1100.v, Translation,g_XMSelect1100.v); + + M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT); + M = XMMatrixMultiply(M, MScaling); + M = XMMatrixMultiply(M, MScalingOrientation); + M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin); + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + XMVECTOR VScaling; + XMVECTOR NegScalingOrigin; + XMVECTOR VScalingOrigin; + XMMATRIX MScalingOriginI; + XMMATRIX MScalingOrientation; + XMMATRIX MScalingOrientationT; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + + // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation * + // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + static const XMVECTORU32 Mask2 = {0xFFFFFFFF,0xFFFFFFFF,0,0}; + static const XMVECTORF32 ZWOne = {0,0,1.0f,1.0f}; + + VScalingOrigin = _mm_and_ps(ScalingOrigin, Mask2); + NegScalingOrigin = XMVectorNegate(VScalingOrigin); + + MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin); + MScalingOrientation = XMMatrixRotationZ(ScalingOrientation); + MScalingOrientationT = XMMatrixTranspose(MScalingOrientation); + VScaling = _mm_and_ps(Scaling, Mask2); + VScaling = _mm_or_ps(VScaling,ZWOne); + MScaling = XMMatrixScalingFromVector(VScaling); + VRotationOrigin = _mm_and_ps(RotationOrigin, Mask2); + MRotation = XMMatrixRotationZ(Rotation); + VTranslation = _mm_and_ps(Translation, Mask2); + + M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT); + M = XMMatrixMultiply(M, MScaling); + M = XMMatrixMultiply(M, MScalingOrientation); + M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin); + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixTransformation +( + FXMVECTOR ScalingOrigin, + FXMVECTOR ScalingOrientationQuaternion, + FXMVECTOR Scaling, + CXMVECTOR RotationOrigin, + CXMVECTOR RotationQuaternion, + CXMVECTOR Translation +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + XMVECTOR NegScalingOrigin; + XMVECTOR VScalingOrigin; + XMMATRIX MScalingOriginI; + XMMATRIX MScalingOrientation; + XMMATRIX MScalingOrientationT; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + + // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation * + // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + VScalingOrigin = XMVectorSelect(g_XMSelect1110.v, ScalingOrigin, g_XMSelect1110.v); + NegScalingOrigin = XMVectorNegate(ScalingOrigin); + + MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin); + MScalingOrientation = XMMatrixRotationQuaternion(ScalingOrientationQuaternion); + MScalingOrientationT = XMMatrixTranspose(MScalingOrientation); + MScaling = XMMatrixScalingFromVector(Scaling); + VRotationOrigin = XMVectorSelect(g_XMSelect1110.v, RotationOrigin, g_XMSelect1110.v); + MRotation = XMMatrixRotationQuaternion(RotationQuaternion); + VTranslation = XMVectorSelect(g_XMSelect1110.v, Translation, g_XMSelect1110.v); + + M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT); + M = XMMatrixMultiply(M, MScaling); + M = XMMatrixMultiply(M, MScalingOrientation); + M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin); + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + XMVECTOR NegScalingOrigin; + XMVECTOR VScalingOrigin; + XMMATRIX MScalingOriginI; + XMMATRIX MScalingOrientation; + XMMATRIX MScalingOrientationT; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + + // M = Inverse(MScalingOrigin) * Transpose(MScalingOrientation) * MScaling * MScalingOrientation * + // MScalingOrigin * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + VScalingOrigin = _mm_and_ps(ScalingOrigin,g_XMMask3); + NegScalingOrigin = XMVectorNegate(ScalingOrigin); + + MScalingOriginI = XMMatrixTranslationFromVector(NegScalingOrigin); + MScalingOrientation = XMMatrixRotationQuaternion(ScalingOrientationQuaternion); + MScalingOrientationT = XMMatrixTranspose(MScalingOrientation); + MScaling = XMMatrixScalingFromVector(Scaling); + VRotationOrigin = _mm_and_ps(RotationOrigin,g_XMMask3); + MRotation = XMMatrixRotationQuaternion(RotationQuaternion); + VTranslation = _mm_and_ps(Translation,g_XMMask3); + + M = XMMatrixMultiply(MScalingOriginI, MScalingOrientationT); + M = XMMatrixMultiply(M, MScaling); + M = XMMatrixMultiply(M, MScalingOrientation); + M.r[3] = XMVectorAdd(M.r[3], VScalingOrigin); + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixAffineTransformation2D +( + FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, + FLOAT Rotation, + FXMVECTOR Translation +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + XMVECTOR VScaling; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + + // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + VScaling = XMVectorSelect(g_XMOne.v, Scaling, g_XMSelect1100.v); + MScaling = XMMatrixScalingFromVector(VScaling); + VRotationOrigin = XMVectorSelect(g_XMSelect1100.v, RotationOrigin, g_XMSelect1100.v); + MRotation = XMMatrixRotationZ(Rotation); + VTranslation = XMVectorSelect(g_XMSelect1100.v, Translation,g_XMSelect1100.v); + + M = MScaling; + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + XMVECTOR VScaling; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + static const XMVECTORU32 Mask2 = {0xFFFFFFFFU,0xFFFFFFFFU,0,0}; + static const XMVECTORF32 ZW1 = {0,0,1.0f,1.0f}; + + // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + VScaling = _mm_and_ps(Scaling, Mask2); + VScaling = _mm_or_ps(VScaling, ZW1); + MScaling = XMMatrixScalingFromVector(VScaling); + VRotationOrigin = _mm_and_ps(RotationOrigin, Mask2); + MRotation = XMMatrixRotationZ(Rotation); + VTranslation = _mm_and_ps(Translation, Mask2); + + M = MScaling; + M.r[3] = _mm_sub_ps(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = _mm_add_ps(M.r[3], VRotationOrigin); + M.r[3] = _mm_add_ps(M.r[3], VTranslation); + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixAffineTransformation +( + FXMVECTOR Scaling, + FXMVECTOR RotationOrigin, + FXMVECTOR RotationQuaternion, + CXMVECTOR Translation +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + + // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + MScaling = XMMatrixScalingFromVector(Scaling); + VRotationOrigin = XMVectorSelect(g_XMSelect1110.v, RotationOrigin,g_XMSelect1110.v); + MRotation = XMMatrixRotationQuaternion(RotationQuaternion); + VTranslation = XMVectorSelect(g_XMSelect1110.v, Translation,g_XMSelect1110.v); + + M = MScaling; + M.r[3] = XMVectorSubtract(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = XMVectorAdd(M.r[3], VRotationOrigin); + M.r[3] = XMVectorAdd(M.r[3], VTranslation); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + XMMATRIX MScaling; + XMVECTOR VRotationOrigin; + XMMATRIX MRotation; + XMVECTOR VTranslation; + + // M = MScaling * Inverse(MRotationOrigin) * MRotation * MRotationOrigin * MTranslation; + + MScaling = XMMatrixScalingFromVector(Scaling); + VRotationOrigin = _mm_and_ps(RotationOrigin,g_XMMask3); + MRotation = XMMatrixRotationQuaternion(RotationQuaternion); + VTranslation = _mm_and_ps(Translation,g_XMMask3); + + M = MScaling; + M.r[3] = _mm_sub_ps(M.r[3], VRotationOrigin); + M = XMMatrixMultiply(M, MRotation); + M.r[3] = _mm_add_ps(M.r[3], VRotationOrigin); + M.r[3] = _mm_add_ps(M.r[3], VTranslation); + + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixReflect +( + FXMVECTOR ReflectionPlane +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR P; + XMVECTOR S; + XMVECTOR A, B, C, D; + XMMATRIX M; + static CONST XMVECTOR NegativeTwo = {-2.0f, -2.0f, -2.0f, 0.0f}; + + XMASSERT(!XMVector3Equal(ReflectionPlane, XMVectorZero())); + XMASSERT(!XMPlaneIsInfinite(ReflectionPlane)); + + P = XMPlaneNormalize(ReflectionPlane); + S = XMVectorMultiply(P, NegativeTwo); + + A = XMVectorSplatX(P); + B = XMVectorSplatY(P); + C = XMVectorSplatZ(P); + D = XMVectorSplatW(P); + + M.r[0] = XMVectorMultiplyAdd(A, S, g_XMIdentityR0.v); + M.r[1] = XMVectorMultiplyAdd(B, S, g_XMIdentityR1.v); + M.r[2] = XMVectorMultiplyAdd(C, S, g_XMIdentityR2.v); + M.r[3] = XMVectorMultiplyAdd(D, S, g_XMIdentityR3.v); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + static CONST XMVECTORF32 NegativeTwo = {-2.0f, -2.0f, -2.0f, 0.0f}; + + XMASSERT(!XMVector3Equal(ReflectionPlane, XMVectorZero())); + XMASSERT(!XMPlaneIsInfinite(ReflectionPlane)); + + XMVECTOR P = XMPlaneNormalize(ReflectionPlane); + XMVECTOR S = _mm_mul_ps(P,NegativeTwo); + XMVECTOR X = _mm_shuffle_ps(P,P,_MM_SHUFFLE(0,0,0,0)); + XMVECTOR Y = _mm_shuffle_ps(P,P,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR Z = _mm_shuffle_ps(P,P,_MM_SHUFFLE(2,2,2,2)); + P = _mm_shuffle_ps(P,P,_MM_SHUFFLE(3,3,3,3)); + X = _mm_mul_ps(X,S); + Y = _mm_mul_ps(Y,S); + Z = _mm_mul_ps(Z,S); + P = _mm_mul_ps(P,S); + X = _mm_add_ps(X,g_XMIdentityR0); + Y = _mm_add_ps(Y,g_XMIdentityR1); + Z = _mm_add_ps(Z,g_XMIdentityR2); + P = _mm_add_ps(P,g_XMIdentityR3); + M.r[0] = X; + M.r[1] = Y; + M.r[2] = Z; + M.r[3] = P; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixShadow +( + FXMVECTOR ShadowPlane, + FXMVECTOR LightPosition +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR P; + XMVECTOR Dot; + XMVECTOR A, B, C, D; + XMMATRIX M; + static CONST XMVECTORU32 Select0001 = {XM_SELECT_0, XM_SELECT_0, XM_SELECT_0, XM_SELECT_1}; + + XMASSERT(!XMVector3Equal(ShadowPlane, XMVectorZero())); + XMASSERT(!XMPlaneIsInfinite(ShadowPlane)); + + P = XMPlaneNormalize(ShadowPlane); + Dot = XMPlaneDot(P, LightPosition); + P = XMVectorNegate(P); + D = XMVectorSplatW(P); + C = XMVectorSplatZ(P); + B = XMVectorSplatY(P); + A = XMVectorSplatX(P); + Dot = XMVectorSelect(Select0001.v, Dot, Select0001.v); + M.r[3] = XMVectorMultiplyAdd(D, LightPosition, Dot); + Dot = XMVectorRotateLeft(Dot, 1); + M.r[2] = XMVectorMultiplyAdd(C, LightPosition, Dot); + Dot = XMVectorRotateLeft(Dot, 1); + M.r[1] = XMVectorMultiplyAdd(B, LightPosition, Dot); + Dot = XMVectorRotateLeft(Dot, 1); + M.r[0] = XMVectorMultiplyAdd(A, LightPosition, Dot); + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + XMASSERT(!XMVector3Equal(ShadowPlane, XMVectorZero())); + XMASSERT(!XMPlaneIsInfinite(ShadowPlane)); + XMVECTOR P = XMPlaneNormalize(ShadowPlane); + XMVECTOR Dot = XMPlaneDot(P,LightPosition); + // Negate + P = _mm_mul_ps(P,g_XMNegativeOne); + XMVECTOR X = _mm_shuffle_ps(P,P,_MM_SHUFFLE(0,0,0,0)); + XMVECTOR Y = _mm_shuffle_ps(P,P,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR Z = _mm_shuffle_ps(P,P,_MM_SHUFFLE(2,2,2,2)); + P = _mm_shuffle_ps(P,P,_MM_SHUFFLE(3,3,3,3)); + Dot = _mm_and_ps(Dot,g_XMMaskW); + X = _mm_mul_ps(X,LightPosition); + Y = _mm_mul_ps(Y,LightPosition); + Z = _mm_mul_ps(Z,LightPosition); + P = _mm_mul_ps(P,LightPosition); + P = _mm_add_ps(P,Dot); + Dot = _mm_shuffle_ps(Dot,Dot,_MM_SHUFFLE(0,3,2,1)); + Z = _mm_add_ps(Z,Dot); + Dot = _mm_shuffle_ps(Dot,Dot,_MM_SHUFFLE(0,3,2,1)); + Y = _mm_add_ps(Y,Dot); + Dot = _mm_shuffle_ps(Dot,Dot,_MM_SHUFFLE(0,3,2,1)); + X = _mm_add_ps(X,Dot); + // Store the resulting matrix + M.r[0] = X; + M.r[1] = Y; + M.r[2] = Z; + M.r[3] = P; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// View and projection initialization operations +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixLookAtLH +( + FXMVECTOR EyePosition, + FXMVECTOR FocusPosition, + FXMVECTOR UpDirection +) +{ + XMVECTOR EyeDirection; + XMMATRIX M; + + EyeDirection = XMVectorSubtract(FocusPosition, EyePosition); + M = XMMatrixLookToLH(EyePosition, EyeDirection, UpDirection); + + return M; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixLookAtRH +( + FXMVECTOR EyePosition, + FXMVECTOR FocusPosition, + FXMVECTOR UpDirection +) +{ + XMVECTOR NegEyeDirection; + XMMATRIX M; + + NegEyeDirection = XMVectorSubtract(EyePosition, FocusPosition); + M = XMMatrixLookToLH(EyePosition, NegEyeDirection, UpDirection); + + return M; +} + +//------------------------------------------------------------------------------ + +XMINLINE XMMATRIX XMMatrixLookToLH +( + FXMVECTOR EyePosition, + FXMVECTOR EyeDirection, + FXMVECTOR UpDirection +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR NegEyePosition; + XMVECTOR D0, D1, D2; + XMVECTOR R0, R1, R2; + XMMATRIX M; + + XMASSERT(!XMVector3Equal(EyeDirection, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(EyeDirection)); + XMASSERT(!XMVector3Equal(UpDirection, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(UpDirection)); + + R2 = XMVector3Normalize(EyeDirection); + + R0 = XMVector3Cross(UpDirection, R2); + R0 = XMVector3Normalize(R0); + + R1 = XMVector3Cross(R2, R0); + + NegEyePosition = XMVectorNegate(EyePosition); + + D0 = XMVector3Dot(R0, NegEyePosition); + D1 = XMVector3Dot(R1, NegEyePosition); + D2 = XMVector3Dot(R2, NegEyePosition); + + M.r[0] = XMVectorSelect(D0, R0, g_XMSelect1110.v); + M.r[1] = XMVectorSelect(D1, R1, g_XMSelect1110.v); + M.r[2] = XMVectorSelect(D2, R2, g_XMSelect1110.v); + M.r[3] = g_XMIdentityR3.v; + + M = XMMatrixTranspose(M); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + + XMASSERT(!XMVector3Equal(EyeDirection, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(EyeDirection)); + XMASSERT(!XMVector3Equal(UpDirection, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(UpDirection)); + + XMVECTOR R2 = XMVector3Normalize(EyeDirection); + XMVECTOR R0 = XMVector3Cross(UpDirection, R2); + R0 = XMVector3Normalize(R0); + XMVECTOR R1 = XMVector3Cross(R2,R0); + XMVECTOR NegEyePosition = _mm_mul_ps(EyePosition,g_XMNegativeOne); + XMVECTOR D0 = XMVector3Dot(R0,NegEyePosition); + XMVECTOR D1 = XMVector3Dot(R1,NegEyePosition); + XMVECTOR D2 = XMVector3Dot(R2,NegEyePosition); + R0 = _mm_and_ps(R0,g_XMMask3); + R1 = _mm_and_ps(R1,g_XMMask3); + R2 = _mm_and_ps(R2,g_XMMask3); + D0 = _mm_and_ps(D0,g_XMMaskW); + D1 = _mm_and_ps(D1,g_XMMaskW); + D2 = _mm_and_ps(D2,g_XMMaskW); + D0 = _mm_or_ps(D0,R0); + D1 = _mm_or_ps(D1,R1); + D2 = _mm_or_ps(D2,R2); + M.r[0] = D0; + M.r[1] = D1; + M.r[2] = D2; + M.r[3] = g_XMIdentityR3; + M = XMMatrixTranspose(M); + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixLookToRH +( + FXMVECTOR EyePosition, + FXMVECTOR EyeDirection, + FXMVECTOR UpDirection +) +{ + XMVECTOR NegEyeDirection; + XMMATRIX M; + + NegEyeDirection = XMVectorNegate(EyeDirection); + M = XMMatrixLookToLH(EyePosition, NegEyeDirection, UpDirection); + + return M; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixPerspectiveLH +( + FLOAT ViewWidth, + FLOAT ViewHeight, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT TwoNearZ, fRange; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + TwoNearZ = NearZ + NearZ; + fRange = FarZ / (FarZ - NearZ); + M.m[0][0] = TwoNearZ / ViewWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = TwoNearZ / ViewHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = 1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = -fRange * NearZ; + M.m[3][3] = 0.0f; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + XMMATRIX M; + FLOAT TwoNearZ = NearZ + NearZ; + FLOAT fRange = FarZ / (FarZ - NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ / ViewWidth, + TwoNearZ / ViewHeight, + fRange, + -fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // TwoNearZ / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,1.0f + vValues = _mm_shuffle_ps(vValues,g_XMIdentityR3,_MM_SHUFFLE(3,2,3,2)); + // 0,0,fRange,1.0f + vTemp = _mm_setzero_ps(); + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,0,0,0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,0 + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,1,0,0)); + M.r[3] = vTemp; + + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixPerspectiveRH +( + FLOAT ViewWidth, + FLOAT ViewHeight, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT TwoNearZ, fRange; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + TwoNearZ = NearZ + NearZ; + fRange = FarZ / (NearZ - FarZ); + M.m[0][0] = TwoNearZ / ViewWidth; + M.m[0][1] = 0.0f; + M.m[0][2] = 0.0f; + M.m[0][3] = 0.0f; + + M.m[1][0] = 0.0f; + M.m[1][1] = TwoNearZ / ViewHeight; + M.m[1][2] = 0.0f; + M.m[1][3] = 0.0f; + + M.m[2][0] = 0.0f; + M.m[2][1] = 0.0f; + M.m[2][2] = fRange; + M.m[2][3] = -1.0f; + + M.m[3][0] = 0.0f; + M.m[3][1] = 0.0f; + M.m[3][2] = fRange * NearZ; + M.m[3][3] = 0.0f; + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + XMMATRIX M; + FLOAT TwoNearZ = NearZ + NearZ; + FLOAT fRange = FarZ / (NearZ-FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ / ViewWidth, + TwoNearZ / ViewHeight, + fRange, + fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // TwoNearZ / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,-1.0f + vValues = _mm_shuffle_ps(vValues,g_XMNegIdentityR3,_MM_SHUFFLE(3,2,3,2)); + // 0,0,fRange,-1.0f + vTemp = _mm_setzero_ps(); + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,0,0,0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,0 + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,1,0,0)); + M.r[3] = vTemp; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixPerspectiveFovLH +( + FLOAT FovAngleY, + FLOAT AspectRatio, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT SinFov; + FLOAT CosFov; + FLOAT Height; + FLOAT Width; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)); + XMASSERT(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + + Height = CosFov / SinFov; + Width = Height / AspectRatio; + + M.r[0] = XMVectorSet(Width, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, Height, 0.0f, 0.0f); + M.r[2] = XMVectorSet(0.0f, 0.0f, FarZ / (FarZ - NearZ), 1.0f); + M.r[3] = XMVectorSet(0.0f, 0.0f, -M.r[2].vector4_f32[2] * NearZ, 0.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)); + XMASSERT(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + XMMATRIX M; + FLOAT SinFov; + FLOAT CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + FLOAT fRange = FarZ / (FarZ-NearZ); + // Note: This is recorded on the stack + FLOAT Height = CosFov / SinFov; + XMVECTOR rMem = { + Height / AspectRatio, + Height, + fRange, + -fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // CosFov / SinFov,0,0,0 + M.r[0] = vTemp; + // 0,Height / AspectRatio,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues,g_XMIdentityR3,_MM_SHUFFLE(3,2,3,2)); + // 0,0,fRange,1.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,0,0,0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,0.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,1,0,0)); + M.r[3] = vTemp; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixPerspectiveFovRH +( + FLOAT FovAngleY, + FLOAT AspectRatio, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT SinFov; + FLOAT CosFov; + FLOAT Height; + FLOAT Width; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)); + XMASSERT(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + + Height = CosFov / SinFov; + Width = Height / AspectRatio; + + M.r[0] = XMVectorSet(Width, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, Height, 0.0f, 0.0f); + M.r[2] = XMVectorSet(0.0f, 0.0f, FarZ / (NearZ - FarZ), -1.0f); + M.r[3] = XMVectorSet(0.0f, 0.0f, M.r[2].vector4_f32[2] * NearZ, 0.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(FovAngleY, 0.0f, 0.00001f * 2.0f)); + XMASSERT(!XMScalarNearEqual(AspectRatio, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + XMMATRIX M; + FLOAT SinFov; + FLOAT CosFov; + XMScalarSinCos(&SinFov, &CosFov, 0.5f * FovAngleY); + FLOAT fRange = FarZ / (NearZ-FarZ); + // Note: This is recorded on the stack + FLOAT Height = CosFov / SinFov; + XMVECTOR rMem = { + Height / AspectRatio, + Height, + fRange, + fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // CosFov / SinFov,0,0,0 + M.r[0] = vTemp; + // 0,Height / AspectRatio,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,-1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues,g_XMNegIdentityR3,_MM_SHUFFLE(3,2,3,2)); + // 0,0,fRange,-1.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,0,0,0)); + M.r[2] = vTemp; + // 0,0,fRange * NearZ,0.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,1,0,0)); + M.r[3] = vTemp; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixPerspectiveOffCenterLH +( + FLOAT ViewLeft, + FLOAT ViewRight, + FLOAT ViewBottom, + FLOAT ViewTop, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT TwoNearZ; + FLOAT ReciprocalWidth; + FLOAT ReciprocalHeight; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + TwoNearZ = NearZ + NearZ; + ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + + M.r[0] = XMVectorSet(TwoNearZ * ReciprocalWidth, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, TwoNearZ * ReciprocalHeight, 0.0f, 0.0f); + M.r[2] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + FarZ / (FarZ - NearZ), + 1.0f); + M.r[3] = XMVectorSet(0.0f, 0.0f, -M.r[2].vector4_f32[2] * NearZ, 0.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + XMMATRIX M; + FLOAT TwoNearZ = NearZ+NearZ; + FLOAT ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + FLOAT ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + FLOAT fRange = FarZ / (FarZ-NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ*ReciprocalWidth, + TwoNearZ*ReciprocalHeight, + -fRange * NearZ, + 0 + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // TwoNearZ*ReciprocalWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ*ReciprocalHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // 0,0,fRange,1.0f + M.m[2][0] = -(ViewLeft + ViewRight) * ReciprocalWidth; + M.m[2][1] = -(ViewTop + ViewBottom) * ReciprocalHeight; + M.m[2][2] = fRange; + M.m[2][3] = 1.0f; + // 0,0,-fRange * NearZ,0.0f + vValues = _mm_and_ps(vValues,g_XMMaskZ); + M.r[3] = vValues; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixPerspectiveOffCenterRH +( + FLOAT ViewLeft, + FLOAT ViewRight, + FLOAT ViewBottom, + FLOAT ViewTop, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT TwoNearZ; + FLOAT ReciprocalWidth; + FLOAT ReciprocalHeight; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + TwoNearZ = NearZ + NearZ; + ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + + M.r[0] = XMVectorSet(TwoNearZ * ReciprocalWidth, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, TwoNearZ * ReciprocalHeight, 0.0f, 0.0f); + M.r[2] = XMVectorSet((ViewLeft + ViewRight) * ReciprocalWidth, + (ViewTop + ViewBottom) * ReciprocalHeight, + FarZ / (NearZ - FarZ), + -1.0f); + M.r[3] = XMVectorSet(0.0f, 0.0f, M.r[2].vector4_f32[2] * NearZ, 0.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + XMMATRIX M; + FLOAT TwoNearZ = NearZ+NearZ; + FLOAT ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + FLOAT ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + FLOAT fRange = FarZ / (NearZ-FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + TwoNearZ*ReciprocalWidth, + TwoNearZ*ReciprocalHeight, + fRange * NearZ, + 0 + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // TwoNearZ*ReciprocalWidth,0,0,0 + M.r[0] = vTemp; + // 0,TwoNearZ*ReciprocalHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // 0,0,fRange,1.0f + M.m[2][0] = (ViewLeft + ViewRight) * ReciprocalWidth; + M.m[2][1] = (ViewTop + ViewBottom) * ReciprocalHeight; + M.m[2][2] = fRange; + M.m[2][3] = -1.0f; + // 0,0,-fRange * NearZ,0.0f + vValues = _mm_and_ps(vValues,g_XMMaskZ); + M.r[3] = vValues; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixOrthographicLH +( + FLOAT ViewWidth, + FLOAT ViewHeight, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT fRange; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + fRange = 1.0f / (FarZ-NearZ); + M.r[0] = XMVectorSet(2.0f / ViewWidth, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, 2.0f / ViewHeight, 0.0f, 0.0f); + M.r[2] = XMVectorSet(0.0f, 0.0f, fRange, 0.0f); + M.r[3] = XMVectorSet(0.0f, 0.0f, -fRange * NearZ, 1.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + XMMATRIX M; + FLOAT fRange = 1.0f / (FarZ-NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + 2.0f / ViewWidth, + 2.0f / ViewHeight, + fRange, + -fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // 2.0f / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,2.0f / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=-fRange * NearZ,0,1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues,g_XMIdentityR3,_MM_SHUFFLE(3,2,3,2)); + // 0,0,fRange,0.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,0,0,0)); + M.r[2] = vTemp; + // 0,0,-fRange * NearZ,1.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,1,0,0)); + M.r[3] = vTemp; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixOrthographicRH +( + FLOAT ViewWidth, + FLOAT ViewHeight, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + M.r[0] = XMVectorSet(2.0f / ViewWidth, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, 2.0f / ViewHeight, 0.0f, 0.0f); + M.r[2] = XMVectorSet(0.0f, 0.0f, 1.0f / (NearZ - FarZ), 0.0f); + M.r[3] = XMVectorSet(0.0f, 0.0f, M.r[2].vector4_f32[2] * NearZ, 1.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(!XMScalarNearEqual(ViewWidth, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewHeight, 0.0f, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + XMMATRIX M; + FLOAT fRange = 1.0f / (NearZ-FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + 2.0f / ViewWidth, + 2.0f / ViewHeight, + fRange, + fRange * NearZ + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // 2.0f / ViewWidth,0,0,0 + M.r[0] = vTemp; + // 0,2.0f / ViewHeight,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + M.r[1] = vTemp; + // x=fRange,y=fRange * NearZ,0,1.0f + vTemp = _mm_setzero_ps(); + vValues = _mm_shuffle_ps(vValues,g_XMIdentityR3,_MM_SHUFFLE(3,2,3,2)); + // 0,0,fRange,0.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(2,0,0,0)); + M.r[2] = vTemp; + // 0,0,fRange * NearZ,1.0f + vTemp = _mm_shuffle_ps(vTemp,vValues,_MM_SHUFFLE(3,1,0,0)); + M.r[3] = vTemp; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixOrthographicOffCenterLH +( + FLOAT ViewLeft, + FLOAT ViewRight, + FLOAT ViewBottom, + FLOAT ViewTop, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT ReciprocalWidth; + FLOAT ReciprocalHeight; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + + M.r[0] = XMVectorSet(ReciprocalWidth + ReciprocalWidth, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, ReciprocalHeight + ReciprocalHeight, 0.0f, 0.0f); + M.r[2] = XMVectorSet(0.0f, 0.0f, 1.0f / (FarZ - NearZ), 0.0f); + M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + -M.r[2].vector4_f32[2] * NearZ, + 1.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + FLOAT fReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + FLOAT fReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + FLOAT fRange = 1.0f / (FarZ-NearZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + fReciprocalWidth, + fReciprocalHeight, + fRange, + 1.0f + }; + XMVECTOR rMem2 = { + -(ViewLeft + ViewRight), + -(ViewTop + ViewBottom), + -NearZ, + 1.0f + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // fReciprocalWidth*2,0,0,0 + vTemp = _mm_add_ss(vTemp,vTemp); + M.r[0] = vTemp; + // 0,fReciprocalHeight*2,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + vTemp = _mm_add_ps(vTemp,vTemp); + M.r[1] = vTemp; + // 0,0,fRange,0.0f + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskZ); + M.r[2] = vTemp; + // -(ViewLeft + ViewRight)*fReciprocalWidth,-(ViewTop + ViewBottom)*fReciprocalHeight,fRange*-NearZ,1.0f + vValues = _mm_mul_ps(vValues,rMem2); + M.r[3] = vValues; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMMATRIX XMMatrixOrthographicOffCenterRH +( + FLOAT ViewLeft, + FLOAT ViewRight, + FLOAT ViewBottom, + FLOAT ViewTop, + FLOAT NearZ, + FLOAT FarZ +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT ReciprocalWidth; + FLOAT ReciprocalHeight; + XMMATRIX M; + + XMASSERT(!XMScalarNearEqual(ViewRight, ViewLeft, 0.00001f)); + XMASSERT(!XMScalarNearEqual(ViewTop, ViewBottom, 0.00001f)); + XMASSERT(!XMScalarNearEqual(FarZ, NearZ, 0.00001f)); + + ReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + ReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + + M.r[0] = XMVectorSet(ReciprocalWidth + ReciprocalWidth, 0.0f, 0.0f, 0.0f); + M.r[1] = XMVectorSet(0.0f, ReciprocalHeight + ReciprocalHeight, 0.0f, 0.0f); + M.r[2] = XMVectorSet(0.0f, 0.0f, 1.0f / (NearZ - FarZ), 0.0f); + M.r[3] = XMVectorSet(-(ViewLeft + ViewRight) * ReciprocalWidth, + -(ViewTop + ViewBottom) * ReciprocalHeight, + M.r[2].vector4_f32[2] * NearZ, + 1.0f); + + return M; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX M; + FLOAT fReciprocalWidth = 1.0f / (ViewRight - ViewLeft); + FLOAT fReciprocalHeight = 1.0f / (ViewTop - ViewBottom); + FLOAT fRange = 1.0f / (NearZ-FarZ); + // Note: This is recorded on the stack + XMVECTOR rMem = { + fReciprocalWidth, + fReciprocalHeight, + fRange, + 1.0f + }; + XMVECTOR rMem2 = { + -(ViewLeft + ViewRight), + -(ViewTop + ViewBottom), + NearZ, + 1.0f + }; + // Copy from memory to SSE register + XMVECTOR vValues = rMem; + XMVECTOR vTemp = _mm_setzero_ps(); + // Copy x only + vTemp = _mm_move_ss(vTemp,vValues); + // fReciprocalWidth*2,0,0,0 + vTemp = _mm_add_ss(vTemp,vTemp); + M.r[0] = vTemp; + // 0,fReciprocalHeight*2,0,0 + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskY); + vTemp = _mm_add_ps(vTemp,vTemp); + M.r[1] = vTemp; + // 0,0,fRange,0.0f + vTemp = vValues; + vTemp = _mm_and_ps(vTemp,g_XMMaskZ); + M.r[2] = vTemp; + // -(ViewLeft + ViewRight)*fReciprocalWidth,-(ViewTop + ViewBottom)*fReciprocalHeight,fRange*-NearZ,1.0f + vValues = _mm_mul_ps(vValues,rMem2); + M.r[3] = vValues; + return M; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +#ifdef __cplusplus + +/**************************************************************************** + * + * XMMATRIX operators and methods + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMMATRIX::_XMMATRIX +( + FXMVECTOR R0, + FXMVECTOR R1, + FXMVECTOR R2, + CXMVECTOR R3 +) +{ + r[0] = R0; + r[1] = R1; + r[2] = R2; + r[3] = R3; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMMATRIX::_XMMATRIX +( + FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03, + FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13, + FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23, + FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33 +) +{ + r[0] = XMVectorSet(m00, m01, m02, m03); + r[1] = XMVectorSet(m10, m11, m12, m13); + r[2] = XMVectorSet(m20, m21, m22, m23); + r[3] = XMVectorSet(m30, m31, m32, m33); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMMATRIX::_XMMATRIX +( + CONST FLOAT* pArray +) +{ + r[0] = XMLoadFloat4((XMFLOAT4*)pArray); + r[1] = XMLoadFloat4((XMFLOAT4*)(pArray + 4)); + r[2] = XMLoadFloat4((XMFLOAT4*)(pArray + 8)); + r[3] = XMLoadFloat4((XMFLOAT4*)(pArray + 12)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMMATRIX& _XMMATRIX::operator= +( + CONST _XMMATRIX& M +) +{ + r[0] = M.r[0]; + r[1] = M.r[1]; + r[2] = M.r[2]; + r[3] = M.r[3]; + return *this; +} + +//------------------------------------------------------------------------------ + +#ifndef XM_NO_OPERATOR_OVERLOADS + +#if !defined(_XBOX_VER) && defined(_XM_ISVS2005_) && defined(_XM_X64_) +#pragma warning(push) +#pragma warning(disable : 4328) +#endif + +XMFINLINE _XMMATRIX& _XMMATRIX::operator*= +( + CONST _XMMATRIX& M +) +{ + *this = XMMatrixMultiply(*this, M); + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMMATRIX _XMMATRIX::operator* +( + CONST _XMMATRIX& M +) CONST +{ + return XMMatrixMultiply(*this, M); +} + +#if !defined(_XBOX_VER) && defined(_XM_ISVS2005_) && defined(_XM_X64_) +#pragma warning(pop) +#endif + +#endif // !XM_NO_OPERATOR_OVERLOADS + +/**************************************************************************** + * + * XMFLOAT3X3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT3X3::_XMFLOAT3X3 +( + FLOAT m00, FLOAT m01, FLOAT m02, + FLOAT m10, FLOAT m11, FLOAT m12, + FLOAT m20, FLOAT m21, FLOAT m22 +) +{ + m[0][0] = m00; + m[0][1] = m01; + m[0][2] = m02; + + m[1][0] = m10; + m[1][1] = m11; + m[1][2] = m12; + + m[2][0] = m20; + m[2][1] = m21; + m[2][2] = m22; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT3X3::_XMFLOAT3X3 +( + CONST FLOAT* pArray +) +{ + UINT Row; + UINT Column; + + for (Row = 0; Row < 3; Row++) + { + for (Column = 0; Column < 3; Column++) + { + m[Row][Column] = pArray[Row * 3 + Column]; + } + } +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT3X3& _XMFLOAT3X3::operator= +( + CONST _XMFLOAT3X3& Float3x3 +) +{ + _11 = Float3x3._11; + _12 = Float3x3._12; + _13 = Float3x3._13; + _21 = Float3x3._21; + _22 = Float3x3._22; + _23 = Float3x3._23; + _31 = Float3x3._31; + _32 = Float3x3._32; + _33 = Float3x3._33; + + return *this; +} + +/**************************************************************************** + * + * XMFLOAT4X3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4X3::_XMFLOAT4X3 +( + FLOAT m00, FLOAT m01, FLOAT m02, + FLOAT m10, FLOAT m11, FLOAT m12, + FLOAT m20, FLOAT m21, FLOAT m22, + FLOAT m30, FLOAT m31, FLOAT m32 +) +{ + m[0][0] = m00; + m[0][1] = m01; + m[0][2] = m02; + + m[1][0] = m10; + m[1][1] = m11; + m[1][2] = m12; + + m[2][0] = m20; + m[2][1] = m21; + m[2][2] = m22; + + m[3][0] = m30; + m[3][1] = m31; + m[3][2] = m32; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4X3::_XMFLOAT4X3 +( + CONST FLOAT* pArray +) +{ + UINT Row; + UINT Column; + + for (Row = 0; Row < 4; Row++) + { + for (Column = 0; Column < 3; Column++) + { + m[Row][Column] = pArray[Row * 3 + Column]; + } + } +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4X3& _XMFLOAT4X3::operator= +( + CONST _XMFLOAT4X3& Float4x3 +) +{ + XMVECTOR V1 = XMLoadFloat4((XMFLOAT4*)&Float4x3._11); + XMVECTOR V2 = XMLoadFloat4((XMFLOAT4*)&Float4x3._22); + XMVECTOR V3 = XMLoadFloat4((XMFLOAT4*)&Float4x3._33); + + XMStoreFloat4((XMFLOAT4*)&_11, V1); + XMStoreFloat4((XMFLOAT4*)&_22, V2); + XMStoreFloat4((XMFLOAT4*)&_33, V3); + + return *this; +} + +/**************************************************************************** + * + * XMFLOAT4X4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4X4::_XMFLOAT4X4 +( + FLOAT m00, FLOAT m01, FLOAT m02, FLOAT m03, + FLOAT m10, FLOAT m11, FLOAT m12, FLOAT m13, + FLOAT m20, FLOAT m21, FLOAT m22, FLOAT m23, + FLOAT m30, FLOAT m31, FLOAT m32, FLOAT m33 +) +{ + m[0][0] = m00; + m[0][1] = m01; + m[0][2] = m02; + m[0][3] = m03; + + m[1][0] = m10; + m[1][1] = m11; + m[1][2] = m12; + m[1][3] = m13; + + m[2][0] = m20; + m[2][1] = m21; + m[2][2] = m22; + m[2][3] = m23; + + m[3][0] = m30; + m[3][1] = m31; + m[3][2] = m32; + m[3][3] = m33; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4X4::_XMFLOAT4X4 +( + CONST FLOAT* pArray +) +{ + UINT Row; + UINT Column; + + for (Row = 0; Row < 4; Row++) + { + for (Column = 0; Column < 4; Column++) + { + m[Row][Column] = pArray[Row * 4 + Column]; + } + } +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4X4& _XMFLOAT4X4::operator= +( + CONST _XMFLOAT4X4& Float4x4 +) +{ + XMVECTOR V1 = XMLoadFloat4((XMFLOAT4*)&Float4x4._11); + XMVECTOR V2 = XMLoadFloat4((XMFLOAT4*)&Float4x4._21); + XMVECTOR V3 = XMLoadFloat4((XMFLOAT4*)&Float4x4._31); + XMVECTOR V4 = XMLoadFloat4((XMFLOAT4*)&Float4x4._41); + + XMStoreFloat4((XMFLOAT4*)&_11, V1); + XMStoreFloat4((XMFLOAT4*)&_21, V2); + XMStoreFloat4((XMFLOAT4*)&_31, V3); + XMStoreFloat4((XMFLOAT4*)&_41, V4); + + return *this; +} + +#endif // __cplusplus + +#endif // __XNAMATHMATRIX_INL__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/xnamathmisc.inl b/Src/Decoder_H264_ALL/D3D/include/xnamathmisc.inl new file mode 100644 index 0000000..c937ee1 --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/xnamathmisc.inl @@ -0,0 +1,2464 @@ +/*++ + +Copyright (c) Microsoft Corporation. All rights reserved. + +Module Name: + + xnamathmisc.inl + +Abstract: + + XNA math library for Windows and Xbox 360: Quaternion, plane, and color functions. +--*/ + +#if defined(_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#ifndef __XNAMATHMISC_INL__ +#define __XNAMATHMISC_INL__ + +/**************************************************************************** + * + * Quaternion + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMQuaternionEqual +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) +{ + return XMVector4Equal(Q1, Q2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMQuaternionNotEqual +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) +{ + return XMVector4NotEqual(Q1, Q2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMQuaternionIsNaN +( + FXMVECTOR Q +) +{ + return XMVector4IsNaN(Q); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMQuaternionIsInfinite +( + FXMVECTOR Q +) +{ + return XMVector4IsInfinite(Q); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMQuaternionIsIdentity +( + FXMVECTOR Q +) +{ +#if defined(_XM_NO_INTRINSICS_) + + return XMVector4Equal(Q, g_XMIdentityR3.v); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(Q,g_XMIdentityR3); + return (_mm_movemask_ps(vTemp)==0x0f) ? true : false; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionDot +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) +{ + return XMVector4Dot(Q1, Q2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionMultiply +( + FXMVECTOR Q1, + FXMVECTOR Q2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR NegativeQ1; + XMVECTOR Q2X; + XMVECTOR Q2Y; + XMVECTOR Q2Z; + XMVECTOR Q2W; + XMVECTOR Q1WZYX; + XMVECTOR Q1ZWXY; + XMVECTOR Q1YXWZ; + XMVECTOR Result; + CONST XMVECTORU32 ControlWZYX = {XM_PERMUTE_0W, XM_PERMUTE_1Z, XM_PERMUTE_0Y, XM_PERMUTE_1X}; + CONST XMVECTORU32 ControlZWXY = {XM_PERMUTE_0Z, XM_PERMUTE_0W, XM_PERMUTE_1X, XM_PERMUTE_1Y}; + CONST XMVECTORU32 ControlYXWZ = {XM_PERMUTE_1Y, XM_PERMUTE_0X, XM_PERMUTE_0W, XM_PERMUTE_1Z}; + + NegativeQ1 = XMVectorNegate(Q1); + + Q2W = XMVectorSplatW(Q2); + Q2X = XMVectorSplatX(Q2); + Q2Y = XMVectorSplatY(Q2); + Q2Z = XMVectorSplatZ(Q2); + + Q1WZYX = XMVectorPermute(Q1, NegativeQ1, ControlWZYX.v); + Q1ZWXY = XMVectorPermute(Q1, NegativeQ1, ControlZWXY.v); + Q1YXWZ = XMVectorPermute(Q1, NegativeQ1, ControlYXWZ.v); + + Result = XMVectorMultiply(Q1, Q2W); + Result = XMVectorMultiplyAdd(Q1WZYX, Q2X, Result); + Result = XMVectorMultiplyAdd(Q1ZWXY, Q2Y, Result); + Result = XMVectorMultiplyAdd(Q1YXWZ, Q2Z, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 ControlWZYX = { 1.0f,-1.0f, 1.0f,-1.0f}; + static CONST XMVECTORF32 ControlZWXY = { 1.0f, 1.0f,-1.0f,-1.0f}; + static CONST XMVECTORF32 ControlYXWZ = {-1.0f, 1.0f, 1.0f,-1.0f}; + // Copy to SSE registers and use as few as possible for x86 + XMVECTOR Q2X = Q2; + XMVECTOR Q2Y = Q2; + XMVECTOR Q2Z = Q2; + XMVECTOR vResult = Q2; + // Splat with one instruction + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,3,3,3)); + Q2X = _mm_shuffle_ps(Q2X,Q2X,_MM_SHUFFLE(0,0,0,0)); + Q2Y = _mm_shuffle_ps(Q2Y,Q2Y,_MM_SHUFFLE(1,1,1,1)); + Q2Z = _mm_shuffle_ps(Q2Z,Q2Z,_MM_SHUFFLE(2,2,2,2)); + // Retire Q1 and perform Q1*Q2W + vResult = _mm_mul_ps(vResult,Q1); + XMVECTOR Q1Shuffle = Q1; + // Shuffle the copies of Q1 + Q1Shuffle = _mm_shuffle_ps(Q1Shuffle,Q1Shuffle,_MM_SHUFFLE(0,1,2,3)); + // Mul by Q1WZYX + Q2X = _mm_mul_ps(Q2X,Q1Shuffle); + Q1Shuffle = _mm_shuffle_ps(Q1Shuffle,Q1Shuffle,_MM_SHUFFLE(2,3,0,1)); + // Flip the signs on y and z + Q2X = _mm_mul_ps(Q2X,ControlWZYX); + // Mul by Q1ZWXY + Q2Y = _mm_mul_ps(Q2Y,Q1Shuffle); + Q1Shuffle = _mm_shuffle_ps(Q1Shuffle,Q1Shuffle,_MM_SHUFFLE(0,1,2,3)); + // Flip the signs on z and w + Q2Y = _mm_mul_ps(Q2Y,ControlZWXY); + // Mul by Q1YXWZ + Q2Z = _mm_mul_ps(Q2Z,Q1Shuffle); + vResult = _mm_add_ps(vResult,Q2X); + // Flip the signs on x and w + Q2Z = _mm_mul_ps(Q2Z,ControlYXWZ); + Q2Y = _mm_add_ps(Q2Y,Q2Z); + vResult = _mm_add_ps(vResult,Q2Y); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionLengthSq +( + FXMVECTOR Q +) +{ + return XMVector4LengthSq(Q); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionReciprocalLength +( + FXMVECTOR Q +) +{ + return XMVector4ReciprocalLength(Q); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionLength +( + FXMVECTOR Q +) +{ + return XMVector4Length(Q); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionNormalizeEst +( + FXMVECTOR Q +) +{ + return XMVector4NormalizeEst(Q); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionNormalize +( + FXMVECTOR Q +) +{ + return XMVector4Normalize(Q); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionConjugate +( + FXMVECTOR Q +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result = { + -Q.vector4_f32[0], + -Q.vector4_f32[1], + -Q.vector4_f32[2], + Q.vector4_f32[3] + }; + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 NegativeOne3 = {-1.0f,-1.0f,-1.0f,1.0f}; + XMVECTOR Result = _mm_mul_ps(Q,NegativeOne3); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionInverse +( + FXMVECTOR Q +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Conjugate; + XMVECTOR L; + XMVECTOR Control; + XMVECTOR Result; + CONST XMVECTOR Zero = XMVectorZero(); + + L = XMVector4LengthSq(Q); + Conjugate = XMQuaternionConjugate(Q); + + Control = XMVectorLessOrEqual(L, g_XMEpsilon.v); + + L = XMVectorReciprocal(L); + Result = XMVectorMultiply(Conjugate, L); + + Result = XMVectorSelect(Result, Zero, Control); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Conjugate; + XMVECTOR L; + XMVECTOR Control; + XMVECTOR Result; + XMVECTOR Zero = XMVectorZero(); + + L = XMVector4LengthSq(Q); + Conjugate = XMQuaternionConjugate(Q); + Control = XMVectorLessOrEqual(L, g_XMEpsilon); + Result = _mm_div_ps(Conjugate,L); + Result = XMVectorSelect(Result, Zero, Control); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionLn +( + FXMVECTOR Q +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Q0; + XMVECTOR QW; + XMVECTOR Theta; + XMVECTOR SinTheta; + XMVECTOR S; + XMVECTOR ControlW; + XMVECTOR Result; + static CONST XMVECTOR OneMinusEpsilon = {1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f}; + + QW = XMVectorSplatW(Q); + Q0 = XMVectorSelect(g_XMSelect1110.v, Q, g_XMSelect1110.v); + + ControlW = XMVectorInBounds(QW, OneMinusEpsilon); + + Theta = XMVectorACos(QW); + SinTheta = XMVectorSin(Theta); + + S = XMVectorReciprocal(SinTheta); + S = XMVectorMultiply(Theta, S); + + Result = XMVectorMultiply(Q0, S); + + Result = XMVectorSelect(Q0, Result, ControlW); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 OneMinusEpsilon = {1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f}; + static CONST XMVECTORF32 NegOneMinusEpsilon = {-(1.0f - 0.00001f), -(1.0f - 0.00001f),-(1.0f - 0.00001f),-(1.0f - 0.00001f)}; + // Get W only + XMVECTOR QW = _mm_shuffle_ps(Q,Q,_MM_SHUFFLE(3,3,3,3)); + // W = 0 + XMVECTOR Q0 = _mm_and_ps(Q,g_XMMask3); + // Use W if within bounds + XMVECTOR ControlW = _mm_cmple_ps(QW,OneMinusEpsilon); + XMVECTOR vTemp2 = _mm_cmpge_ps(QW,NegOneMinusEpsilon); + ControlW = _mm_and_ps(ControlW,vTemp2); + // Get theta + XMVECTOR vTheta = XMVectorACos(QW); + // Get Sine of theta + vTemp2 = XMVectorSin(vTheta); + // theta/sine of theta + vTheta = _mm_div_ps(vTheta,vTemp2); + // Here's the answer + vTheta = _mm_mul_ps(vTheta,Q0); + // Was W in bounds? If not, return input as is + vTheta = XMVectorSelect(Q0,vTheta,ControlW); + return vTheta; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionExp +( + FXMVECTOR Q +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Theta; + XMVECTOR SinTheta; + XMVECTOR CosTheta; + XMVECTOR S; + XMVECTOR Control; + XMVECTOR Zero; + XMVECTOR Result; + + Theta = XMVector3Length(Q); + XMVectorSinCos(&SinTheta, &CosTheta, Theta); + + S = XMVectorReciprocal(Theta); + S = XMVectorMultiply(SinTheta, S); + + Result = XMVectorMultiply(Q, S); + + Zero = XMVectorZero(); + Control = XMVectorNearEqual(Theta, Zero, g_XMEpsilon.v); + Result = XMVectorSelect(Result, Q, Control); + + Result = XMVectorSelect(CosTheta, Result, g_XMSelect1110.v); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Theta; + XMVECTOR SinTheta; + XMVECTOR CosTheta; + XMVECTOR S; + XMVECTOR Control; + XMVECTOR Zero; + XMVECTOR Result; + Theta = XMVector3Length(Q); + XMVectorSinCos(&SinTheta, &CosTheta, Theta); + S = _mm_div_ps(SinTheta,Theta); + Result = _mm_mul_ps(Q, S); + Zero = XMVectorZero(); + Control = XMVectorNearEqual(Theta, Zero, g_XMEpsilon); + Result = XMVectorSelect(Result,Q,Control); + Result = _mm_and_ps(Result,g_XMMask3); + CosTheta = _mm_and_ps(CosTheta,g_XMMaskW); + Result = _mm_or_ps(Result,CosTheta); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMQuaternionSlerp +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FLOAT t +) +{ + XMVECTOR T = XMVectorReplicate(t); + return XMQuaternionSlerpV(Q0, Q1, T); +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMQuaternionSlerpV +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR T +) +{ +#if defined(_XM_NO_INTRINSICS_) + + // Result = Q0 * sin((1.0 - t) * Omega) / sin(Omega) + Q1 * sin(t * Omega) / sin(Omega) + XMVECTOR Omega; + XMVECTOR CosOmega; + XMVECTOR SinOmega; + XMVECTOR InvSinOmega; + XMVECTOR V01; + XMVECTOR C1000; + XMVECTOR SignMask; + XMVECTOR S0; + XMVECTOR S1; + XMVECTOR Sign; + XMVECTOR Control; + XMVECTOR Result; + XMVECTOR Zero; + CONST XMVECTOR OneMinusEpsilon = {1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f}; + + XMASSERT((T.vector4_f32[1] == T.vector4_f32[0]) && (T.vector4_f32[2] == T.vector4_f32[0]) && (T.vector4_f32[3] == T.vector4_f32[0])); + + CosOmega = XMQuaternionDot(Q0, Q1); + + Zero = XMVectorZero(); + Control = XMVectorLess(CosOmega, Zero); + Sign = XMVectorSelect(g_XMOne.v, g_XMNegativeOne.v, Control); + + CosOmega = XMVectorMultiply(CosOmega, Sign); + + Control = XMVectorLess(CosOmega, OneMinusEpsilon); + + SinOmega = XMVectorNegativeMultiplySubtract(CosOmega, CosOmega, g_XMOne.v); + SinOmega = XMVectorSqrt(SinOmega); + + Omega = XMVectorATan2(SinOmega, CosOmega); + + SignMask = XMVectorSplatSignMask(); + C1000 = XMVectorSetBinaryConstant(1, 0, 0, 0); + V01 = XMVectorShiftLeft(T, Zero, 2); + SignMask = XMVectorShiftLeft(SignMask, Zero, 3); + V01 = XMVectorXorInt(V01, SignMask); + V01 = XMVectorAdd(C1000, V01); + + InvSinOmega = XMVectorReciprocal(SinOmega); + + S0 = XMVectorMultiply(V01, Omega); + S0 = XMVectorSin(S0); + S0 = XMVectorMultiply(S0, InvSinOmega); + + S0 = XMVectorSelect(V01, S0, Control); + + S1 = XMVectorSplatY(S0); + S0 = XMVectorSplatX(S0); + + S1 = XMVectorMultiply(S1, Sign); + + Result = XMVectorMultiply(Q0, S0); + Result = XMVectorMultiplyAdd(Q1, S1, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Result = Q0 * sin((1.0 - t) * Omega) / sin(Omega) + Q1 * sin(t * Omega) / sin(Omega) + XMVECTOR Omega; + XMVECTOR CosOmega; + XMVECTOR SinOmega; + XMVECTOR V01; + XMVECTOR S0; + XMVECTOR S1; + XMVECTOR Sign; + XMVECTOR Control; + XMVECTOR Result; + XMVECTOR Zero; + static const XMVECTORF32 OneMinusEpsilon = {1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f, 1.0f - 0.00001f}; + static const XMVECTORI32 SignMask2 = {0x80000000,0x00000000,0x00000000,0x00000000}; + static const XMVECTORI32 MaskXY = {0xFFFFFFFF,0xFFFFFFFF,0x00000000,0x00000000}; + + XMASSERT((XMVectorGetY(T) == XMVectorGetX(T)) && (XMVectorGetZ(T) == XMVectorGetX(T)) && (XMVectorGetW(T) == XMVectorGetX(T))); + + CosOmega = XMQuaternionDot(Q0, Q1); + + Zero = XMVectorZero(); + Control = XMVectorLess(CosOmega, Zero); + Sign = XMVectorSelect(g_XMOne, g_XMNegativeOne, Control); + + CosOmega = _mm_mul_ps(CosOmega, Sign); + + Control = XMVectorLess(CosOmega, OneMinusEpsilon); + + SinOmega = _mm_mul_ps(CosOmega,CosOmega); + SinOmega = _mm_sub_ps(g_XMOne,SinOmega); + SinOmega = _mm_sqrt_ps(SinOmega); + + Omega = XMVectorATan2(SinOmega, CosOmega); + + V01 = _mm_shuffle_ps(T,T,_MM_SHUFFLE(2,3,0,1)); + V01 = _mm_and_ps(V01,MaskXY); + V01 = _mm_xor_ps(V01,SignMask2); + V01 = _mm_add_ps(g_XMIdentityR0, V01); + + S0 = _mm_mul_ps(V01, Omega); + S0 = XMVectorSin(S0); + S0 = _mm_div_ps(S0, SinOmega); + + S0 = XMVectorSelect(V01, S0, Control); + + S1 = XMVectorSplatY(S0); + S0 = XMVectorSplatX(S0); + + S1 = _mm_mul_ps(S1, Sign); + Result = _mm_mul_ps(Q0, S0); + S1 = _mm_mul_ps(S1, Q1); + Result = _mm_add_ps(Result,S1); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionSquad +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + CXMVECTOR Q3, + FLOAT t +) +{ + XMVECTOR T = XMVectorReplicate(t); + return XMQuaternionSquadV(Q0, Q1, Q2, Q3, T); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionSquadV +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + CXMVECTOR Q3, + CXMVECTOR T +) +{ + XMVECTOR Q03; + XMVECTOR Q12; + XMVECTOR TP; + XMVECTOR Two; + XMVECTOR Result; + + XMASSERT( (XMVectorGetY(T) == XMVectorGetX(T)) && (XMVectorGetZ(T) == XMVectorGetX(T)) && (XMVectorGetW(T) == XMVectorGetX(T)) ); + + TP = T; + Two = XMVectorSplatConstant(2, 0); + + Q03 = XMQuaternionSlerpV(Q0, Q3, T); + Q12 = XMQuaternionSlerpV(Q1, Q2, T); + + TP = XMVectorNegativeMultiplySubtract(TP, TP, TP); + TP = XMVectorMultiply(TP, Two); + + Result = XMQuaternionSlerpV(Q03, Q12, TP); + + return Result; + +} + +//------------------------------------------------------------------------------ + +XMINLINE VOID XMQuaternionSquadSetup +( + XMVECTOR* pA, + XMVECTOR* pB, + XMVECTOR* pC, + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + CXMVECTOR Q3 +) +{ + XMVECTOR SQ0, SQ2, SQ3; + XMVECTOR InvQ1, InvQ2; + XMVECTOR LnQ0, LnQ1, LnQ2, LnQ3; + XMVECTOR ExpQ02, ExpQ13; + XMVECTOR LS01, LS12, LS23; + XMVECTOR LD01, LD12, LD23; + XMVECTOR Control0, Control1, Control2; + XMVECTOR NegativeOneQuarter; + + XMASSERT(pA); + XMASSERT(pB); + XMASSERT(pC); + + LS12 = XMQuaternionLengthSq(XMVectorAdd(Q1, Q2)); + LD12 = XMQuaternionLengthSq(XMVectorSubtract(Q1, Q2)); + SQ2 = XMVectorNegate(Q2); + + Control1 = XMVectorLess(LS12, LD12); + SQ2 = XMVectorSelect(Q2, SQ2, Control1); + + LS01 = XMQuaternionLengthSq(XMVectorAdd(Q0, Q1)); + LD01 = XMQuaternionLengthSq(XMVectorSubtract(Q0, Q1)); + SQ0 = XMVectorNegate(Q0); + + LS23 = XMQuaternionLengthSq(XMVectorAdd(SQ2, Q3)); + LD23 = XMQuaternionLengthSq(XMVectorSubtract(SQ2, Q3)); + SQ3 = XMVectorNegate(Q3); + + Control0 = XMVectorLess(LS01, LD01); + Control2 = XMVectorLess(LS23, LD23); + + SQ0 = XMVectorSelect(Q0, SQ0, Control0); + SQ3 = XMVectorSelect(Q3, SQ3, Control2); + + InvQ1 = XMQuaternionInverse(Q1); + InvQ2 = XMQuaternionInverse(SQ2); + + LnQ0 = XMQuaternionLn(XMQuaternionMultiply(InvQ1, SQ0)); + LnQ2 = XMQuaternionLn(XMQuaternionMultiply(InvQ1, SQ2)); + LnQ1 = XMQuaternionLn(XMQuaternionMultiply(InvQ2, Q1)); + LnQ3 = XMQuaternionLn(XMQuaternionMultiply(InvQ2, SQ3)); + + NegativeOneQuarter = XMVectorSplatConstant(-1, 2); + + ExpQ02 = XMVectorMultiply(XMVectorAdd(LnQ0, LnQ2), NegativeOneQuarter); + ExpQ13 = XMVectorMultiply(XMVectorAdd(LnQ1, LnQ3), NegativeOneQuarter); + ExpQ02 = XMQuaternionExp(ExpQ02); + ExpQ13 = XMQuaternionExp(ExpQ13); + + *pA = XMQuaternionMultiply(Q1, ExpQ02); + *pB = XMQuaternionMultiply(SQ2, ExpQ13); + *pC = SQ2; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionBaryCentric +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + FLOAT f, + FLOAT g +) +{ + XMVECTOR Q01; + XMVECTOR Q02; + FLOAT s; + XMVECTOR Result; + + s = f + g; + + if ((s < 0.00001f) && (s > -0.00001f)) + { + Result = Q0; + } + else + { + Q01 = XMQuaternionSlerp(Q0, Q1, s); + Q02 = XMQuaternionSlerp(Q0, Q2, s); + + Result = XMQuaternionSlerp(Q01, Q02, g / s); + } + + return Result; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionBaryCentricV +( + FXMVECTOR Q0, + FXMVECTOR Q1, + FXMVECTOR Q2, + CXMVECTOR F, + CXMVECTOR G +) +{ + XMVECTOR Q01; + XMVECTOR Q02; + XMVECTOR S, GS; + XMVECTOR Epsilon; + XMVECTOR Result; + + XMASSERT( (XMVectorGetY(F) == XMVectorGetX(F)) && (XMVectorGetZ(F) == XMVectorGetX(F)) && (XMVectorGetW(F) == XMVectorGetX(F)) ); + XMASSERT( (XMVectorGetY(G) == XMVectorGetX(G)) && (XMVectorGetZ(G) == XMVectorGetX(G)) && (XMVectorGetW(G) == XMVectorGetX(G)) ); + + Epsilon = XMVectorSplatConstant(1, 16); + + S = XMVectorAdd(F, G); + + if (XMVector4InBounds(S, Epsilon)) + { + Result = Q0; + } + else + { + Q01 = XMQuaternionSlerpV(Q0, Q1, S); + Q02 = XMQuaternionSlerpV(Q0, Q2, S); + GS = XMVectorReciprocal(S); + GS = XMVectorMultiply(G, GS); + + Result = XMQuaternionSlerpV(Q01, Q02, GS); + } + + return Result; +} + +//------------------------------------------------------------------------------ +// Transformation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionIdentity() +{ +#if defined(_XM_NO_INTRINSICS_) + return g_XMIdentityR3.v; +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMIdentityR3; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionRotationRollPitchYaw +( + FLOAT Pitch, + FLOAT Yaw, + FLOAT Roll +) +{ + XMVECTOR Angles; + XMVECTOR Q; + + Angles = XMVectorSet(Pitch, Yaw, Roll, 0.0f); + Q = XMQuaternionRotationRollPitchYawFromVector(Angles); + + return Q; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionRotationRollPitchYawFromVector +( + FXMVECTOR Angles // +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Q, Q0, Q1; + XMVECTOR P0, P1, Y0, Y1, R0, R1; + XMVECTOR HalfAngles; + XMVECTOR SinAngles, CosAngles; + static CONST XMVECTORU32 ControlPitch = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1X, XM_PERMUTE_1X}; + static CONST XMVECTORU32 ControlYaw = {XM_PERMUTE_1Y, XM_PERMUTE_0Y, XM_PERMUTE_1Y, XM_PERMUTE_1Y}; + static CONST XMVECTORU32 ControlRoll = {XM_PERMUTE_1Z, XM_PERMUTE_1Z, XM_PERMUTE_0Z, XM_PERMUTE_1Z}; + static CONST XMVECTOR Sign = {1.0f, -1.0f, -1.0f, 1.0f}; + + HalfAngles = XMVectorMultiply(Angles, g_XMOneHalf.v); + XMVectorSinCos(&SinAngles, &CosAngles, HalfAngles); + + P0 = XMVectorPermute(SinAngles, CosAngles, ControlPitch.v); + Y0 = XMVectorPermute(SinAngles, CosAngles, ControlYaw.v); + R0 = XMVectorPermute(SinAngles, CosAngles, ControlRoll.v); + P1 = XMVectorPermute(CosAngles, SinAngles, ControlPitch.v); + Y1 = XMVectorPermute(CosAngles, SinAngles, ControlYaw.v); + R1 = XMVectorPermute(CosAngles, SinAngles, ControlRoll.v); + + Q1 = XMVectorMultiply(P1, Sign); + Q0 = XMVectorMultiply(P0, Y0); + Q1 = XMVectorMultiply(Q1, Y1); + Q0 = XMVectorMultiply(Q0, R0); + Q = XMVectorMultiplyAdd(Q1, R1, Q0); + + return Q; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Q, Q0, Q1; + XMVECTOR P0, P1, Y0, Y1, R0, R1; + XMVECTOR HalfAngles; + XMVECTOR SinAngles, CosAngles; + static CONST XMVECTORI32 ControlPitch = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1X, XM_PERMUTE_1X}; + static CONST XMVECTORI32 ControlYaw = {XM_PERMUTE_1Y, XM_PERMUTE_0Y, XM_PERMUTE_1Y, XM_PERMUTE_1Y}; + static CONST XMVECTORI32 ControlRoll = {XM_PERMUTE_1Z, XM_PERMUTE_1Z, XM_PERMUTE_0Z, XM_PERMUTE_1Z}; + static CONST XMVECTORF32 Sign = {1.0f, -1.0f, -1.0f, 1.0f}; + + HalfAngles = _mm_mul_ps(Angles, g_XMOneHalf); + XMVectorSinCos(&SinAngles, &CosAngles, HalfAngles); + + P0 = XMVectorPermute(SinAngles, CosAngles, ControlPitch); + Y0 = XMVectorPermute(SinAngles, CosAngles, ControlYaw); + R0 = XMVectorPermute(SinAngles, CosAngles, ControlRoll); + P1 = XMVectorPermute(CosAngles, SinAngles, ControlPitch); + Y1 = XMVectorPermute(CosAngles, SinAngles, ControlYaw); + R1 = XMVectorPermute(CosAngles, SinAngles, ControlRoll); + + Q1 = _mm_mul_ps(P1, Sign); + Q0 = _mm_mul_ps(P0, Y0); + Q1 = _mm_mul_ps(Q1, Y1); + Q0 = _mm_mul_ps(Q0, R0); + Q = _mm_mul_ps(Q1, R1); + Q = _mm_add_ps(Q,Q0); + return Q; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionRotationNormal +( + FXMVECTOR NormalAxis, + FLOAT Angle +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Q; + XMVECTOR N; + XMVECTOR Scale; + + N = XMVectorSelect(g_XMOne.v, NormalAxis, g_XMSelect1110.v); + + XMScalarSinCos(&Scale.vector4_f32[2], &Scale.vector4_f32[3], 0.5f * Angle); + + Scale.vector4_f32[0] = Scale.vector4_f32[1] = Scale.vector4_f32[2]; + + Q = XMVectorMultiply(N, Scale); + + return Q; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR N = _mm_and_ps(NormalAxis,g_XMMask3); + N = _mm_or_ps(N,g_XMIdentityR3); + XMVECTOR Scale = _mm_set_ps1(0.5f * Angle); + XMVECTOR vSine; + XMVECTOR vCosine; + XMVectorSinCos(&vSine,&vCosine,Scale); + Scale = _mm_and_ps(vSine,g_XMMask3); + vCosine = _mm_and_ps(vCosine,g_XMMaskW); + Scale = _mm_or_ps(Scale,vCosine); + N = _mm_mul_ps(N,Scale); + return N; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMQuaternionRotationAxis +( + FXMVECTOR Axis, + FLOAT Angle +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Normal; + XMVECTOR Q; + + XMASSERT(!XMVector3Equal(Axis, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(Axis)); + + Normal = XMVector3Normalize(Axis); + Q = XMQuaternionRotationNormal(Normal, Angle); + + return Q; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Normal; + XMVECTOR Q; + + XMASSERT(!XMVector3Equal(Axis, XMVectorZero())); + XMASSERT(!XMVector3IsInfinite(Axis)); + + Normal = XMVector3Normalize(Axis); + Q = XMQuaternionRotationNormal(Normal, Angle); + return Q; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMQuaternionRotationMatrix +( + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) + + XMVECTOR Q0, Q1, Q2; + XMVECTOR M00, M11, M22; + XMVECTOR CQ0, CQ1, C; + XMVECTOR CX, CY, CZ, CW; + XMVECTOR SQ1, Scale; + XMVECTOR Rsq, Sqrt, VEqualsNaN; + XMVECTOR A, B, P; + XMVECTOR PermuteSplat, PermuteSplatT; + XMVECTOR SignB, SignBT; + XMVECTOR PermuteControl, PermuteControlT; + XMVECTOR Result; + static CONST XMVECTORF32 OneQuarter = {0.25f, 0.25f, 0.25f, 0.25f}; + static CONST XMVECTORF32 SignPNNP = {1.0f, -1.0f, -1.0f, 1.0f}; + static CONST XMVECTORF32 SignNPNP = {-1.0f, 1.0f, -1.0f, 1.0f}; + static CONST XMVECTORF32 SignNNPP = {-1.0f, -1.0f, 1.0f, 1.0f}; + static CONST XMVECTORF32 SignPNPP = {1.0f, -1.0f, 1.0f, 1.0f}; + static CONST XMVECTORF32 SignPPNP = {1.0f, 1.0f, -1.0f, 1.0f}; + static CONST XMVECTORF32 SignNPPP = {-1.0f, 1.0f, 1.0f, 1.0f}; + static CONST XMVECTORU32 Permute0X0X0Y0W = {XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0Y, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute0Y0Z0Z1W = {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_1W}; + static CONST XMVECTORU32 SplatX = {XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X}; + static CONST XMVECTORU32 SplatY = {XM_PERMUTE_0Y, XM_PERMUTE_0Y, XM_PERMUTE_0Y, XM_PERMUTE_0Y}; + static CONST XMVECTORU32 SplatZ = {XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Z, XM_PERMUTE_0Z}; + static CONST XMVECTORU32 SplatW = {XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0W, XM_PERMUTE_0W}; + static CONST XMVECTORU32 PermuteC = {XM_PERMUTE_0X, XM_PERMUTE_0Z, XM_PERMUTE_1X, XM_PERMUTE_1Y}; + static CONST XMVECTORU32 PermuteA = {XM_PERMUTE_0Y, XM_PERMUTE_1Y, XM_PERMUTE_1Z, XM_PERMUTE_0W}; + static CONST XMVECTORU32 PermuteB = {XM_PERMUTE_1X, XM_PERMUTE_1W, XM_PERMUTE_0Z, XM_PERMUTE_0W}; + static CONST XMVECTORU32 Permute0 = {XM_PERMUTE_0X, XM_PERMUTE_1X, XM_PERMUTE_1Z, XM_PERMUTE_1Y}; + static CONST XMVECTORU32 Permute1 = {XM_PERMUTE_1X, XM_PERMUTE_0Y, XM_PERMUTE_1Y, XM_PERMUTE_1Z}; + static CONST XMVECTORU32 Permute2 = {XM_PERMUTE_1Z, XM_PERMUTE_1Y, XM_PERMUTE_0Z, XM_PERMUTE_1X}; + static CONST XMVECTORU32 Permute3 = {XM_PERMUTE_1Y, XM_PERMUTE_1Z, XM_PERMUTE_1X, XM_PERMUTE_0W}; + + M00 = XMVectorSplatX(M.r[0]); + M11 = XMVectorSplatY(M.r[1]); + M22 = XMVectorSplatZ(M.r[2]); + + Q0 = XMVectorMultiply(SignPNNP.v, M00); + Q0 = XMVectorMultiplyAdd(SignNPNP.v, M11, Q0); + Q0 = XMVectorMultiplyAdd(SignNNPP.v, M22, Q0); + + Q1 = XMVectorAdd(Q0, g_XMOne.v); + + Rsq = XMVectorReciprocalSqrt(Q1); + VEqualsNaN = XMVectorIsNaN(Rsq); + Sqrt = XMVectorMultiply(Q1, Rsq); + Q1 = XMVectorSelect(Sqrt, Q1, VEqualsNaN); + + Q1 = XMVectorMultiply(Q1, g_XMOneHalf.v); + + SQ1 = XMVectorMultiply(Rsq, g_XMOneHalf.v); + + CQ0 = XMVectorPermute(Q0, Q0, Permute0X0X0Y0W.v); + CQ1 = XMVectorPermute(Q0, g_XMEpsilon.v, Permute0Y0Z0Z1W.v); + C = XMVectorGreaterOrEqual(CQ0, CQ1); + + CX = XMVectorSplatX(C); + CY = XMVectorSplatY(C); + CZ = XMVectorSplatZ(C); + CW = XMVectorSplatW(C); + + PermuteSplat = XMVectorSelect(SplatZ.v, SplatY.v, CZ); + SignB = XMVectorSelect(SignNPPP.v, SignPPNP.v, CZ); + PermuteControl = XMVectorSelect(Permute2.v, Permute1.v, CZ); + + PermuteSplat = XMVectorSelect(PermuteSplat, SplatZ.v, CX); + SignB = XMVectorSelect(SignB, SignNPPP.v, CX); + PermuteControl = XMVectorSelect(PermuteControl, Permute2.v, CX); + + PermuteSplatT = XMVectorSelect(PermuteSplat,SplatX.v, CY); + SignBT = XMVectorSelect(SignB, SignPNPP.v, CY); + PermuteControlT = XMVectorSelect(PermuteControl,Permute0.v, CY); + + PermuteSplat = XMVectorSelect(PermuteSplat, PermuteSplatT, CX); + SignB = XMVectorSelect(SignB, SignBT, CX); + PermuteControl = XMVectorSelect(PermuteControl, PermuteControlT, CX); + + PermuteSplat = XMVectorSelect(PermuteSplat,SplatW.v, CW); + SignB = XMVectorSelect(SignB, g_XMNegativeOne.v, CW); + PermuteControl = XMVectorSelect(PermuteControl,Permute3.v, CW); + + Scale = XMVectorPermute(SQ1, SQ1, PermuteSplat); + + P = XMVectorPermute(M.r[1], M.r[2],PermuteC.v); // {M10, M12, M20, M21} + A = XMVectorPermute(M.r[0], P, PermuteA.v); // {M01, M12, M20, M03} + B = XMVectorPermute(M.r[0], P, PermuteB.v); // {M10, M21, M02, M03} + + Q2 = XMVectorMultiplyAdd(SignB, B, A); + Q2 = XMVectorMultiply(Q2, Scale); + + Result = XMVectorPermute(Q1, Q2, PermuteControl); + + return Result; + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Conversion operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMQuaternionToAxisAngle +( + XMVECTOR* pAxis, + FLOAT* pAngle, + FXMVECTOR Q +) +{ + XMASSERT(pAxis); + XMASSERT(pAngle); + + *pAxis = Q; + +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + *pAngle = 2.0f * acosf(XMVectorGetW(Q)); +#else + *pAngle = 2.0f * XMScalarACos(XMVectorGetW(Q)); +#endif +} + +/**************************************************************************** + * + * Plane + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMPlaneEqual +( + FXMVECTOR P1, + FXMVECTOR P2 +) +{ + return XMVector4Equal(P1, P2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMPlaneNearEqual +( + FXMVECTOR P1, + FXMVECTOR P2, + FXMVECTOR Epsilon +) +{ + XMVECTOR NP1 = XMPlaneNormalize(P1); + XMVECTOR NP2 = XMPlaneNormalize(P2); + return XMVector4NearEqual(NP1, NP2, Epsilon); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMPlaneNotEqual +( + FXMVECTOR P1, + FXMVECTOR P2 +) +{ + return XMVector4NotEqual(P1, P2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMPlaneIsNaN +( + FXMVECTOR P +) +{ + return XMVector4IsNaN(P); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMPlaneIsInfinite +( + FXMVECTOR P +) +{ + return XMVector4IsInfinite(P); +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneDot +( + FXMVECTOR P, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + return XMVector4Dot(P, V); + +#elif defined(_XM_SSE_INTRINSICS_) + __m128 vTemp2 = V; + __m128 vTemp = _mm_mul_ps(P,vTemp2); + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp,_MM_SHUFFLE(1,0,0,0)); // Copy X to the Z position and Y to the W position + vTemp2 = _mm_add_ps(vTemp2,vTemp); // Add Z = X+Z; W = Y+W; + vTemp = _mm_shuffle_ps(vTemp,vTemp2,_MM_SHUFFLE(0,3,0,0)); // Copy W to the Z position + vTemp = _mm_add_ps(vTemp,vTemp2); // Add Z and W together + return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(2,2,2,2)); // Splat Z and return +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneDotCoord +( + FXMVECTOR P, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V3; + XMVECTOR Result; + + // Result = P[0] * V[0] + P[1] * V[1] + P[2] * V[2] + P[3] + V3 = XMVectorSelect(g_XMOne.v, V, g_XMSelect1110.v); + Result = XMVector4Dot(P, V3); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp2 = _mm_and_ps(V,g_XMMask3); + vTemp2 = _mm_or_ps(vTemp2,g_XMIdentityR3); + XMVECTOR vTemp = _mm_mul_ps(P,vTemp2); + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp,_MM_SHUFFLE(1,0,0,0)); // Copy X to the Z position and Y to the W position + vTemp2 = _mm_add_ps(vTemp2,vTemp); // Add Z = X+Z; W = Y+W; + vTemp = _mm_shuffle_ps(vTemp,vTemp2,_MM_SHUFFLE(0,3,0,0)); // Copy W to the Z position + vTemp = _mm_add_ps(vTemp,vTemp2); // Add Z and W together + return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(2,2,2,2)); // Splat Z and return +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneDotNormal +( + FXMVECTOR P, + FXMVECTOR V +) +{ + return XMVector3Dot(P, V); +} + +//------------------------------------------------------------------------------ +// XMPlaneNormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +XMFINLINE XMVECTOR XMPlaneNormalizeEst +( + FXMVECTOR P +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector3ReciprocalLength(P); + Result = XMVectorMultiply(P, Result); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(P,P); + // x=Dot.y, y=Dot.z + XMVECTOR vTemp = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(2,1,2,1)); + // Result.x = x+y + vDot = _mm_add_ss(vDot,vTemp); + // x=Dot.z + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + // Result.x = (x+y)+z + vDot = _mm_add_ss(vDot,vTemp); + // Splat x + vDot = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(0,0,0,0)); + // Get the reciprocal + vDot = _mm_rsqrt_ps(vDot); + // Get the reciprocal + vDot = _mm_mul_ps(vDot,P); + return vDot; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneNormalize +( + FXMVECTOR P +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT fLengthSq = sqrtf((P.vector4_f32[0]*P.vector4_f32[0])+(P.vector4_f32[1]*P.vector4_f32[1])+(P.vector4_f32[2]*P.vector4_f32[2])); + // Prevent divide by zero + if (fLengthSq) { + fLengthSq = 1.0f/fLengthSq; + } + { + XMVECTOR vResult = { + P.vector4_f32[0]*fLengthSq, + P.vector4_f32[1]*fLengthSq, + P.vector4_f32[2]*fLengthSq, + P.vector4_f32[3]*fLengthSq + }; + return vResult; + } +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z only + XMVECTOR vLengthSq = _mm_mul_ps(P,P); + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,1,2,1)); + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq,g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_div_ps(P,vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult,vLengthSq); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneIntersectLine +( + FXMVECTOR P, + FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1; + XMVECTOR V2; + XMVECTOR D; + XMVECTOR ReciprocalD; + XMVECTOR VT; + XMVECTOR Point; + XMVECTOR Zero; + XMVECTOR Control; + XMVECTOR Result; + + V1 = XMVector3Dot(P, LinePoint1); + V2 = XMVector3Dot(P, LinePoint2); + D = XMVectorSubtract(V1, V2); + + ReciprocalD = XMVectorReciprocal(D); + VT = XMPlaneDotCoord(P, LinePoint1); + VT = XMVectorMultiply(VT, ReciprocalD); + + Point = XMVectorSubtract(LinePoint2, LinePoint1); + Point = XMVectorMultiplyAdd(Point, VT, LinePoint1); + + Zero = XMVectorZero(); + Control = XMVectorNearEqual(D, Zero, g_XMEpsilon.v); + + Result = XMVectorSelect(Point, g_XMQNaN.v, Control); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1; + XMVECTOR V2; + XMVECTOR D; + XMVECTOR VT; + XMVECTOR Point; + XMVECTOR Zero; + XMVECTOR Control; + XMVECTOR Result; + + V1 = XMVector3Dot(P, LinePoint1); + V2 = XMVector3Dot(P, LinePoint2); + D = _mm_sub_ps(V1, V2); + + VT = XMPlaneDotCoord(P, LinePoint1); + VT = _mm_div_ps(VT, D); + + Point = _mm_sub_ps(LinePoint2, LinePoint1); + Point = _mm_mul_ps(Point,VT); + Point = _mm_add_ps(Point,LinePoint1); + Zero = XMVectorZero(); + Control = XMVectorNearEqual(D, Zero, g_XMEpsilon); + Result = XMVectorSelect(Point, g_XMQNaN, Control); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE VOID XMPlaneIntersectPlane +( + XMVECTOR* pLinePoint1, + XMVECTOR* pLinePoint2, + FXMVECTOR P1, + FXMVECTOR P2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1; + XMVECTOR V2; + XMVECTOR V3; + XMVECTOR LengthSq; + XMVECTOR RcpLengthSq; + XMVECTOR Point; + XMVECTOR P1W; + XMVECTOR P2W; + XMVECTOR Control; + XMVECTOR LinePoint1; + XMVECTOR LinePoint2; + + XMASSERT(pLinePoint1); + XMASSERT(pLinePoint2); + + V1 = XMVector3Cross(P2, P1); + + LengthSq = XMVector3LengthSq(V1); + + V2 = XMVector3Cross(P2, V1); + + P1W = XMVectorSplatW(P1); + Point = XMVectorMultiply(V2, P1W); + + V3 = XMVector3Cross(V1, P1); + + P2W = XMVectorSplatW(P2); + Point = XMVectorMultiplyAdd(V3, P2W, Point); + + RcpLengthSq = XMVectorReciprocal(LengthSq); + LinePoint1 = XMVectorMultiply(Point, RcpLengthSq); + + LinePoint2 = XMVectorAdd(LinePoint1, V1); + + Control = XMVectorLessOrEqual(LengthSq, g_XMEpsilon.v); + *pLinePoint1 = XMVectorSelect(LinePoint1,g_XMQNaN.v, Control); + *pLinePoint2 = XMVectorSelect(LinePoint2,g_XMQNaN.v, Control); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pLinePoint1); + XMASSERT(pLinePoint2); + XMVECTOR V1; + XMVECTOR V2; + XMVECTOR V3; + XMVECTOR LengthSq; + XMVECTOR Point; + XMVECTOR P1W; + XMVECTOR P2W; + XMVECTOR Control; + XMVECTOR LinePoint1; + XMVECTOR LinePoint2; + + V1 = XMVector3Cross(P2, P1); + + LengthSq = XMVector3LengthSq(V1); + + V2 = XMVector3Cross(P2, V1); + + P1W = _mm_shuffle_ps(P1,P1,_MM_SHUFFLE(3,3,3,3)); + Point = _mm_mul_ps(V2, P1W); + + V3 = XMVector3Cross(V1, P1); + + P2W = _mm_shuffle_ps(P2,P2,_MM_SHUFFLE(3,3,3,3)); + V3 = _mm_mul_ps(V3,P2W); + Point = _mm_add_ps(Point,V3); + LinePoint1 = _mm_div_ps(Point,LengthSq); + + LinePoint2 = _mm_add_ps(LinePoint1, V1); + + Control = XMVectorLessOrEqual(LengthSq, g_XMEpsilon); + *pLinePoint1 = XMVectorSelect(LinePoint1,g_XMQNaN, Control); + *pLinePoint2 = XMVectorSelect(LinePoint2,g_XMQNaN, Control); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneTransform +( + FXMVECTOR P, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR W; + XMVECTOR Result; + + W = XMVectorSplatW(P); + Z = XMVectorSplatZ(P); + Y = XMVectorSplatY(P); + X = XMVectorSplatX(P); + + Result = XMVectorMultiply(W, M.r[3]); + Result = XMVectorMultiplyAdd(Z, M.r[2], Result); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR X = _mm_shuffle_ps(P,P,_MM_SHUFFLE(0,0,0,0)); + XMVECTOR Y = _mm_shuffle_ps(P,P,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR Z = _mm_shuffle_ps(P,P,_MM_SHUFFLE(2,2,2,2)); + XMVECTOR W = _mm_shuffle_ps(P,P,_MM_SHUFFLE(3,3,3,3)); + X = _mm_mul_ps(X, M.r[0]); + Y = _mm_mul_ps(Y, M.r[1]); + Z = _mm_mul_ps(Z, M.r[2]); + W = _mm_mul_ps(W, M.r[3]); + X = _mm_add_ps(X,Z); + Y = _mm_add_ps(Y,W); + X = _mm_add_ps(X,Y); + return X; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMFLOAT4* XMPlaneTransformStream +( + XMFLOAT4* pOutputStream, + UINT OutputStride, + CONST XMFLOAT4* pInputStream, + UINT InputStride, + UINT PlaneCount, + CXMMATRIX M +) +{ + return XMVector4TransformStream(pOutputStream, + OutputStride, + pInputStream, + InputStride, + PlaneCount, + M); +} + +//------------------------------------------------------------------------------ +// Conversion operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneFromPointNormal +( + FXMVECTOR Point, + FXMVECTOR Normal +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR W; + XMVECTOR Result; + + W = XMVector3Dot(Point, Normal); + W = XMVectorNegate(W); + Result = XMVectorSelect(W, Normal, g_XMSelect1110.v); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR W; + XMVECTOR Result; + W = XMVector3Dot(Point,Normal); + W = _mm_mul_ps(W,g_XMNegativeOne); + Result = _mm_and_ps(Normal,g_XMMask3); + W = _mm_and_ps(W,g_XMMaskW); + Result = _mm_or_ps(Result,W); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMPlaneFromPoints +( + FXMVECTOR Point1, + FXMVECTOR Point2, + FXMVECTOR Point3 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR N; + XMVECTOR D; + XMVECTOR V21; + XMVECTOR V31; + XMVECTOR Result; + + V21 = XMVectorSubtract(Point1, Point2); + V31 = XMVectorSubtract(Point1, Point3); + + N = XMVector3Cross(V21, V31); + N = XMVector3Normalize(N); + + D = XMPlaneDotNormal(N, Point1); + D = XMVectorNegate(D); + + Result = XMVectorSelect(D, N, g_XMSelect1110.v); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR N; + XMVECTOR D; + XMVECTOR V21; + XMVECTOR V31; + XMVECTOR Result; + + V21 = _mm_sub_ps(Point1, Point2); + V31 = _mm_sub_ps(Point1, Point3); + + N = XMVector3Cross(V21, V31); + N = XMVector3Normalize(N); + + D = XMPlaneDotNormal(N, Point1); + D = _mm_mul_ps(D,g_XMNegativeOne); + N = _mm_and_ps(N,g_XMMask3); + D = _mm_and_ps(D,g_XMMaskW); + Result = _mm_or_ps(D,N); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +/**************************************************************************** + * + * Color + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) +{ + return XMVector4Equal(C1, C2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorNotEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) +{ + return XMVector4NotEqual(C1, C2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorGreater +( + FXMVECTOR C1, + FXMVECTOR C2 +) +{ + return XMVector4Greater(C1, C2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorGreaterOrEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) +{ + return XMVector4GreaterOrEqual(C1, C2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorLess +( + FXMVECTOR C1, + FXMVECTOR C2 +) +{ + return XMVector4Less(C1, C2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorLessOrEqual +( + FXMVECTOR C1, + FXMVECTOR C2 +) +{ + return XMVector4LessOrEqual(C1, C2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorIsNaN +( + FXMVECTOR C +) +{ + return XMVector4IsNaN(C); +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMColorIsInfinite +( + FXMVECTOR C +) +{ + return XMVector4IsInfinite(C); +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMColorNegative +( + FXMVECTOR vColor +) +{ +#if defined(_XM_NO_INTRINSICS_) +// XMASSERT(XMVector4GreaterOrEqual(C, XMVectorReplicate(0.0f))); +// XMASSERT(XMVector4LessOrEqual(C, XMVectorReplicate(1.0f))); + XMVECTOR vResult = { + 1.0f - vColor.vector4_f32[0], + 1.0f - vColor.vector4_f32[1], + 1.0f - vColor.vector4_f32[2], + vColor.vector4_f32[3] + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + // Negate only x,y and z. + XMVECTOR vTemp = _mm_xor_ps(vColor,g_XMNegate3); + // Add 1,1,1,0 to -x,-y,-z,w + return _mm_add_ps(vTemp,g_XMOne3); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMColorModulate +( + FXMVECTOR C1, + FXMVECTOR C2 +) +{ + return XMVectorMultiply(C1, C2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMColorAdjustSaturation +( + FXMVECTOR vColor, + FLOAT fSaturation +) +{ +#if defined(_XM_NO_INTRINSICS_) + CONST XMVECTOR gvLuminance = {0.2125f, 0.7154f, 0.0721f, 0.0f}; + + // Luminance = 0.2125f * C[0] + 0.7154f * C[1] + 0.0721f * C[2]; + // Result = (C - Luminance) * Saturation + Luminance; + + FLOAT fLuminance = (vColor.vector4_f32[0]*gvLuminance.vector4_f32[0])+(vColor.vector4_f32[1]*gvLuminance.vector4_f32[1])+(vColor.vector4_f32[2]*gvLuminance.vector4_f32[2]); + XMVECTOR vResult = { + ((vColor.vector4_f32[0] - fLuminance)*fSaturation)+fLuminance, + ((vColor.vector4_f32[1] - fLuminance)*fSaturation)+fLuminance, + ((vColor.vector4_f32[2] - fLuminance)*fSaturation)+fLuminance, + vColor.vector4_f32[3]}; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 gvLuminance = {0.2125f, 0.7154f, 0.0721f, 0.0f}; +// Mul RGB by intensity constants + XMVECTOR vLuminance = _mm_mul_ps(vColor,gvLuminance); +// vResult.x = vLuminance.y, vResult.y = vLuminance.y, +// vResult.z = vLuminance.z, vResult.w = vLuminance.z + XMVECTOR vResult = vLuminance; + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(2,2,1,1)); +// vLuminance.x += vLuminance.y + vLuminance = _mm_add_ss(vLuminance,vResult); +// Splat vLuminance.z + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(2,2,2,2)); +// vLuminance.x += vLuminance.z (Dot product) + vLuminance = _mm_add_ss(vLuminance,vResult); +// Splat vLuminance + vLuminance = _mm_shuffle_ps(vLuminance,vLuminance,_MM_SHUFFLE(0,0,0,0)); +// Splat fSaturation + XMVECTOR vSaturation = _mm_set_ps1(fSaturation); +// vResult = ((vColor-vLuminance)*vSaturation)+vLuminance; + vResult = _mm_sub_ps(vColor,vLuminance); + vResult = _mm_mul_ps(vResult,vSaturation); + vResult = _mm_add_ps(vResult,vLuminance); +// Retain w from the source color + vLuminance = _mm_shuffle_ps(vResult,vColor,_MM_SHUFFLE(3,2,2,2)); // x = vResult.z,y = vResult.z,z = vColor.z,w=vColor.w + vResult = _mm_shuffle_ps(vResult,vLuminance,_MM_SHUFFLE(3,0,1,0)); // x = vResult.x,y = vResult.y,z = vResult.z,w=vColor.w + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMColorAdjustContrast +( + FXMVECTOR vColor, + FLOAT fContrast +) +{ +#if defined(_XM_NO_INTRINSICS_) + // Result = (vColor - 0.5f) * fContrast + 0.5f; + XMVECTOR vResult = { + ((vColor.vector4_f32[0]-0.5f) * fContrast) + 0.5f, + ((vColor.vector4_f32[1]-0.5f) * fContrast) + 0.5f, + ((vColor.vector4_f32[2]-0.5f) * fContrast) + 0.5f, + vColor.vector4_f32[3] // Leave W untouched + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vScale = _mm_set_ps1(fContrast); // Splat the scale + XMVECTOR vResult = _mm_sub_ps(vColor,g_XMOneHalf); // Subtract 0.5f from the source (Saving source) + vResult = _mm_mul_ps(vResult,vScale); // Mul by scale + vResult = _mm_add_ps(vResult,g_XMOneHalf); // Add 0.5f +// Retain w from the source color + vScale = _mm_shuffle_ps(vResult,vColor,_MM_SHUFFLE(3,2,2,2)); // x = vResult.z,y = vResult.z,z = vColor.z,w=vColor.w + vResult = _mm_shuffle_ps(vResult,vScale,_MM_SHUFFLE(3,0,1,0)); // x = vResult.x,y = vResult.y,z = vResult.z,w=vColor.w + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +/**************************************************************************** + * + * Miscellaneous + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMINLINE BOOL XMVerifyCPUSupport() +{ +#if defined(_XM_NO_INTRINSICS_) || !defined(_XM_SSE_INTRINSICS_) + return TRUE; +#else // _XM_SSE_INTRINSICS_ + // Note that on Windows 2000 or older, SSE2 detection is not supported so this will always fail + // Detecting SSE2 on older versions of Windows would require using cpuid directly + return ( IsProcessorFeaturePresent( PF_XMMI_INSTRUCTIONS_AVAILABLE ) && IsProcessorFeaturePresent( PF_XMMI64_INSTRUCTIONS_AVAILABLE ) ); +#endif +} + + +//------------------------------------------------------------------------------ + +#define XMASSERT_LINE_STRING_SIZE 16 + +XMINLINE VOID XMAssert +( + CONST CHAR* pExpression, + CONST CHAR* pFileName, + UINT LineNumber +) +{ + CHAR aLineString[XMASSERT_LINE_STRING_SIZE]; + CHAR* pLineString; + UINT Line; + + aLineString[XMASSERT_LINE_STRING_SIZE - 2] = '0'; + aLineString[XMASSERT_LINE_STRING_SIZE - 1] = '\0'; + for (Line = LineNumber, pLineString = aLineString + XMASSERT_LINE_STRING_SIZE - 2; + Line != 0 && pLineString >= aLineString; + Line /= 10, pLineString--) + { + *pLineString = (CHAR)('0' + (Line % 10)); + } + +#ifndef NO_OUTPUT_DEBUG_STRING + OutputDebugStringA("Assertion failed: "); + OutputDebugStringA(pExpression); + OutputDebugStringA(", file "); + OutputDebugStringA(pFileName); + OutputDebugStringA(", line "); + OutputDebugStringA(pLineString + 1); + OutputDebugStringA("\r\n"); +#else + DbgPrint("Assertion failed: %s, file %s, line %d\r\n", pExpression, pFileName, LineNumber); +#endif + + __debugbreak(); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMFresnelTerm +( + FXMVECTOR CosIncidentAngle, + FXMVECTOR RefractionIndex +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR G; + XMVECTOR D, S; + XMVECTOR V0, V1, V2, V3; + XMVECTOR Result; + + // Result = 0.5f * (g - c)^2 / (g + c)^2 * ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1) where + // c = CosIncidentAngle + // g = sqrt(c^2 + RefractionIndex^2 - 1) + + XMASSERT(!XMVector4IsInfinite(CosIncidentAngle)); + + G = XMVectorMultiplyAdd(RefractionIndex, RefractionIndex, g_XMNegativeOne.v); + G = XMVectorMultiplyAdd(CosIncidentAngle, CosIncidentAngle, G); + G = XMVectorAbs(G); + G = XMVectorSqrt(G); + + S = XMVectorAdd(G, CosIncidentAngle); + D = XMVectorSubtract(G, CosIncidentAngle); + + V0 = XMVectorMultiply(D, D); + V1 = XMVectorMultiply(S, S); + V1 = XMVectorReciprocal(V1); + V0 = XMVectorMultiply(g_XMOneHalf.v, V0); + V0 = XMVectorMultiply(V0, V1); + + V2 = XMVectorMultiplyAdd(CosIncidentAngle, S, g_XMNegativeOne.v); + V3 = XMVectorMultiplyAdd(CosIncidentAngle, D, g_XMOne.v); + V2 = XMVectorMultiply(V2, V2); + V3 = XMVectorMultiply(V3, V3); + V3 = XMVectorReciprocal(V3); + V2 = XMVectorMultiplyAdd(V2, V3, g_XMOne.v); + + Result = XMVectorMultiply(V0, V2); + + Result = XMVectorSaturate(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Result = 0.5f * (g - c)^2 / (g + c)^2 * ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1) where + // c = CosIncidentAngle + // g = sqrt(c^2 + RefractionIndex^2 - 1) + + XMASSERT(!XMVector4IsInfinite(CosIncidentAngle)); + + // G = sqrt(abs((RefractionIndex^2-1) + CosIncidentAngle^2)) + XMVECTOR G = _mm_mul_ps(RefractionIndex,RefractionIndex); + XMVECTOR vTemp = _mm_mul_ps(CosIncidentAngle,CosIncidentAngle); + G = _mm_sub_ps(G,g_XMOne); + vTemp = _mm_add_ps(vTemp,G); + // max((0-vTemp),vTemp) == abs(vTemp) + // The abs is needed to deal with refraction and cosine being zero + G = _mm_setzero_ps(); + G = _mm_sub_ps(G,vTemp); + G = _mm_max_ps(G,vTemp); + // Last operation, the sqrt() + G = _mm_sqrt_ps(G); + + // Calc G-C and G+C + XMVECTOR GAddC = _mm_add_ps(G,CosIncidentAngle); + XMVECTOR GSubC = _mm_sub_ps(G,CosIncidentAngle); + // Perform the term (0.5f *(g - c)^2) / (g + c)^2 + XMVECTOR vResult = _mm_mul_ps(GSubC,GSubC); + vTemp = _mm_mul_ps(GAddC,GAddC); + vResult = _mm_mul_ps(vResult,g_XMOneHalf); + vResult = _mm_div_ps(vResult,vTemp); + // Perform the term ((c * (g + c) - 1)^2 / (c * (g - c) + 1)^2 + 1) + GAddC = _mm_mul_ps(GAddC,CosIncidentAngle); + GSubC = _mm_mul_ps(GSubC,CosIncidentAngle); + GAddC = _mm_sub_ps(GAddC,g_XMOne); + GSubC = _mm_add_ps(GSubC,g_XMOne); + GAddC = _mm_mul_ps(GAddC,GAddC); + GSubC = _mm_mul_ps(GSubC,GSubC); + GAddC = _mm_div_ps(GAddC,GSubC); + GAddC = _mm_add_ps(GAddC,g_XMOne); + // Multiply the two term parts + vResult = _mm_mul_ps(vResult,GAddC); + // Clamp to 0.0 - 1.0f + vResult = _mm_max_ps(vResult,g_XMZero); + vResult = _mm_min_ps(vResult,g_XMOne); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMScalarNearEqual +( + FLOAT S1, + FLOAT S2, + FLOAT Epsilon +) +{ + FLOAT Delta = S1 - S2; +#if defined(_XM_NO_INTRINSICS_) + UINT AbsDelta = *(UINT*)&Delta & 0x7FFFFFFF; + return (*(FLOAT*)&AbsDelta <= Epsilon); +#elif defined(_XM_SSE_INTRINSICS_) + return (fabsf(Delta) <= Epsilon); +#else + return (__fabs(Delta) <= Epsilon); +#endif +} + +//------------------------------------------------------------------------------ +// Modulo the range of the given angle such that -XM_PI <= Angle < XM_PI +XMFINLINE FLOAT XMScalarModAngle +( + FLOAT Angle +) +{ + // Note: The modulo is performed with unsigned math only to work + // around a precision error on numbers that are close to PI + float fTemp; +#if defined(_XM_NO_INTRINSICS_) || !defined(_XM_VMX128_INTRINSICS_) + // Normalize the range from 0.0f to XM_2PI + Angle = Angle + XM_PI; + // Perform the modulo, unsigned + fTemp = fabsf(Angle); + fTemp = fTemp - (XM_2PI * (FLOAT)((INT)(fTemp/XM_2PI))); + // Restore the number to the range of -XM_PI to XM_PI-epsilon + fTemp = fTemp - XM_PI; + // If the modulo'd value was negative, restore negation + if (Angle<0.0f) { + fTemp = -fTemp; + } + return fTemp; +#else +#endif +} + +//------------------------------------------------------------------------------ + +XMINLINE FLOAT XMScalarSin +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT ValueMod; + FLOAT ValueSq; + XMVECTOR V0123, V0246, V1357, V9111315, V17192123; + XMVECTOR V1, V7, V8; + XMVECTOR R0, R1, R2; + + ValueMod = XMScalarModAngle(Value); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! - V^15 / 15! + + // V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI) + + ValueSq = ValueMod * ValueMod; + + V0123 = XMVectorSet(1.0f, ValueMod, ValueSq, ValueSq * ValueMod); + V1 = XMVectorSplatY(V0123); + V0246 = XMVectorMultiply(V0123, V0123); + V1357 = XMVectorMultiply(V0246, V1); + V7 = XMVectorSplatW(V1357); + V8 = XMVectorMultiply(V7, V1); + V9111315 = XMVectorMultiply(V1357, V8); + V17192123 = XMVectorMultiply(V9111315, V8); + + R0 = XMVector4Dot(V1357, g_XMSinCoefficients0.v); + R1 = XMVector4Dot(V9111315, g_XMSinCoefficients1.v); + R2 = XMVector4Dot(V17192123, g_XMSinCoefficients2.v); + + return R0.vector4_f32[0] + R1.vector4_f32[0] + R2.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + return sinf( Value ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE FLOAT XMScalarCos +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT ValueMod; + FLOAT ValueSq; + XMVECTOR V0123, V0246, V8101214, V16182022; + XMVECTOR V2, V6, V8; + XMVECTOR R0, R1, R2; + + ValueMod = XMScalarModAngle(Value); + + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + + // V^12 / 12! - V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI) + + ValueSq = ValueMod * ValueMod; + + V0123 = XMVectorSet(1.0f, ValueMod, ValueSq, ValueSq * ValueMod); + V0246 = XMVectorMultiply(V0123, V0123); + + V2 = XMVectorSplatZ(V0123); + V6 = XMVectorSplatW(V0246); + V8 = XMVectorMultiply(V6, V2); + + V8101214 = XMVectorMultiply(V0246, V8); + V16182022 = XMVectorMultiply(V8101214, V8); + + R0 = XMVector4Dot(V0246, g_XMCosCoefficients0.v); + R1 = XMVector4Dot(V8101214, g_XMCosCoefficients1.v); + R2 = XMVector4Dot(V16182022, g_XMCosCoefficients2.v); + + return R0.vector4_f32[0] + R1.vector4_f32[0] + R2.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + return cosf(Value); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE VOID XMScalarSinCos +( + FLOAT* pSin, + FLOAT* pCos, + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT ValueMod; + FLOAT ValueSq; + XMVECTOR V0123, V0246, V1357, V8101214, V9111315, V16182022, V17192123; + XMVECTOR V1, V2, V6, V8; + XMVECTOR S0, S1, S2, C0, C1, C2; + + XMASSERT(pSin); + XMASSERT(pCos); + + ValueMod = XMScalarModAngle(Value); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! - V^15 / 15! + + // V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI) + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + + // V^12 / 12! - V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI) + + ValueSq = ValueMod * ValueMod; + + V0123 = XMVectorSet(1.0f, ValueMod, ValueSq, ValueSq * ValueMod); + + V1 = XMVectorSplatY(V0123); + V2 = XMVectorSplatZ(V0123); + + V0246 = XMVectorMultiply(V0123, V0123); + V1357 = XMVectorMultiply(V0246, V1); + + V6 = XMVectorSplatW(V0246); + V8 = XMVectorMultiply(V6, V2); + + V8101214 = XMVectorMultiply(V0246, V8); + V9111315 = XMVectorMultiply(V1357, V8); + V16182022 = XMVectorMultiply(V8101214, V8); + V17192123 = XMVectorMultiply(V9111315, V8); + + C0 = XMVector4Dot(V0246, g_XMCosCoefficients0.v); + S0 = XMVector4Dot(V1357, g_XMSinCoefficients0.v); + C1 = XMVector4Dot(V8101214, g_XMCosCoefficients1.v); + S1 = XMVector4Dot(V9111315, g_XMSinCoefficients1.v); + C2 = XMVector4Dot(V16182022, g_XMCosCoefficients2.v); + S2 = XMVector4Dot(V17192123, g_XMSinCoefficients2.v); + + *pCos = C0.vector4_f32[0] + C1.vector4_f32[0] + C2.vector4_f32[0]; + *pSin = S0.vector4_f32[0] + S1.vector4_f32[0] + S2.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSin); + XMASSERT(pCos); + + *pSin = sinf(Value); + *pCos = cosf(Value); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE FLOAT XMScalarASin +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT AbsValue, Value2, Value3, D; + XMVECTOR AbsV, R0, R1, Result; + XMVECTOR V3; + + *(UINT*)&AbsValue = *(UINT*)&Value & 0x7FFFFFFF; + + Value2 = Value * AbsValue; + Value3 = Value * Value2; + D = (Value - Value2) / sqrtf(1.00000011921f - AbsValue); + + AbsV = XMVectorReplicate(AbsValue); + + V3.vector4_f32[0] = Value3; + V3.vector4_f32[1] = 1.0f; + V3.vector4_f32[2] = Value3; + V3.vector4_f32[3] = 1.0f; + + R1 = XMVectorSet(D, D, Value, Value); + R1 = XMVectorMultiply(R1, V3); + + R0 = XMVectorMultiplyAdd(AbsV, g_XMASinCoefficients0.v, g_XMASinCoefficients1.v); + R0 = XMVectorMultiplyAdd(AbsV, R0, g_XMASinCoefficients2.v); + + Result = XMVector4Dot(R0, R1); + + return Result.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + return asinf(Value); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE FLOAT XMScalarACos +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + return XM_PIDIV2 - XMScalarASin(Value); + +#elif defined(_XM_SSE_INTRINSICS_) + return acosf(Value); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE FLOAT XMScalarSinEst +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT ValueSq; + XMVECTOR V; + XMVECTOR Y; + XMVECTOR Result; + + XMASSERT(Value >= -XM_PI); + XMASSERT(Value < XM_PI); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI) + + ValueSq = Value * Value; + + V = XMVectorSet(1.0f, Value, ValueSq, ValueSq * Value); + Y = XMVectorSplatY(V); + V = XMVectorMultiply(V, V); + V = XMVectorMultiply(V, Y); + + Result = XMVector4Dot(V, g_XMSinEstCoefficients.v); + + return Result.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(Value >= -XM_PI); + XMASSERT(Value < XM_PI); + float ValueSq = Value*Value; + XMVECTOR vValue = _mm_set_ps1(Value); + XMVECTOR vTemp = _mm_set_ps(ValueSq * Value,ValueSq,Value,1.0f); + vTemp = _mm_mul_ps(vTemp,vTemp); + vTemp = _mm_mul_ps(vTemp,vValue); + // vTemp = Value,Value^3,Value^5,Value^7 + vTemp = _mm_mul_ps(vTemp,g_XMSinEstCoefficients); + vValue = _mm_shuffle_ps(vValue,vTemp,_MM_SHUFFLE(1,0,0,0)); // Copy X to the Z position and Y to the W position + vValue = _mm_add_ps(vValue,vTemp); // Add Z = X+Z; W = Y+W; + vTemp = _mm_shuffle_ps(vTemp,vValue,_MM_SHUFFLE(0,3,0,0)); // Copy W to the Z position + vTemp = _mm_add_ps(vTemp,vValue); // Add Z and W together + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(2,2,2,2)); // Splat Z and return +#if defined(_MSC_VER) && (_MSC_VER>=1500) + return _mm_cvtss_f32(vTemp); +#else + return vTemp.m128_f32[0]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE FLOAT XMScalarCosEst +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT ValueSq; + XMVECTOR V; + XMVECTOR Result; + XMASSERT(Value >= -XM_PI); + XMASSERT(Value < XM_PI); + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! (for -PI <= V < PI) + ValueSq = Value * Value; + V = XMVectorSet(1.0f, Value, ValueSq, ValueSq * Value); + V = XMVectorMultiply(V, V); + Result = XMVector4Dot(V, g_XMCosEstCoefficients.v); + return Result.vector4_f32[0]; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(Value >= -XM_PI); + XMASSERT(Value < XM_PI); + float ValueSq = Value*Value; + XMVECTOR vValue = _mm_setzero_ps(); + XMVECTOR vTemp = _mm_set_ps(ValueSq * Value,ValueSq,Value,1.0f); + vTemp = _mm_mul_ps(vTemp,vTemp); + // vTemp = 1.0f,Value^2,Value^4,Value^6 + vTemp = _mm_mul_ps(vTemp,g_XMCosEstCoefficients); + vValue = _mm_shuffle_ps(vValue,vTemp,_MM_SHUFFLE(1,0,0,0)); // Copy X to the Z position and Y to the W position + vValue = _mm_add_ps(vValue,vTemp); // Add Z = X+Z; W = Y+W; + vTemp = _mm_shuffle_ps(vTemp,vValue,_MM_SHUFFLE(0,3,0,0)); // Copy W to the Z position + vTemp = _mm_add_ps(vTemp,vValue); // Add Z and W together + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(2,2,2,2)); // Splat Z and return +#if defined(_MSC_VER) && (_MSC_VER>=1500) + return _mm_cvtss_f32(vTemp); +#else + return vTemp.m128_f32[0]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMScalarSinCosEst +( + FLOAT* pSin, + FLOAT* pCos, + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT ValueSq; + XMVECTOR V, Sin, Cos; + XMVECTOR Y; + + XMASSERT(pSin); + XMASSERT(pCos); + XMASSERT(Value >= -XM_PI); + XMASSERT(Value < XM_PI); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI) + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! (for -PI <= V < PI) + + ValueSq = Value * Value; + V = XMVectorSet(1.0f, Value, ValueSq, Value * ValueSq); + Y = XMVectorSplatY(V); + Cos = XMVectorMultiply(V, V); + Sin = XMVectorMultiply(Cos, Y); + + Cos = XMVector4Dot(Cos, g_XMCosEstCoefficients.v); + Sin = XMVector4Dot(Sin, g_XMSinEstCoefficients.v); + + *pCos = Cos.vector4_f32[0]; + *pSin = Sin.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSin); + XMASSERT(pCos); + XMASSERT(Value >= -XM_PI); + XMASSERT(Value < XM_PI); + float ValueSq = Value * Value; + XMVECTOR Cos = _mm_set_ps(Value * ValueSq,ValueSq,Value,1.0f); + XMVECTOR Sin = _mm_set_ps1(Value); + Cos = _mm_mul_ps(Cos,Cos); + Sin = _mm_mul_ps(Sin,Cos); + // Cos = 1.0f,Value^2,Value^4,Value^6 + Cos = XMVector4Dot(Cos,g_XMCosEstCoefficients); + _mm_store_ss(pCos,Cos); + // Sin = Value,Value^3,Value^5,Value^7 + Sin = XMVector4Dot(Sin, g_XMSinEstCoefficients); + _mm_store_ss(pSin,Sin); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE FLOAT XMScalarASinEst +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR VR, CR, CS; + XMVECTOR Result; + FLOAT AbsV, V2, D; + CONST FLOAT OnePlusEps = 1.00000011921f; + + *(UINT*)&AbsV = *(UINT*)&Value & 0x7FFFFFFF; + V2 = Value * AbsV; + D = OnePlusEps - AbsV; + + CS = XMVectorSet(Value, 1.0f, 1.0f, V2); + VR = XMVectorSet(sqrtf(D), Value, V2, D * AbsV); + CR = XMVectorMultiply(CS, g_XMASinEstCoefficients.v); + + Result = XMVector4Dot(VR, CR); + + return Result.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + CONST FLOAT OnePlusEps = 1.00000011921f; + FLOAT AbsV = fabsf(Value); + FLOAT V2 = Value * AbsV; // Square with sign retained + FLOAT D = OnePlusEps - AbsV; + + XMVECTOR Result = _mm_set_ps(V2,1.0f,1.0f,Value); + XMVECTOR VR = _mm_set_ps(D * AbsV,V2,Value,sqrtf(D)); + Result = _mm_mul_ps(Result, g_XMASinEstCoefficients); + Result = XMVector4Dot(VR,Result); +#if defined(_MSC_VER) && (_MSC_VER>=1500) + return _mm_cvtss_f32(Result); +#else + return Result.m128_f32[0]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE FLOAT XMScalarACosEst +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR VR, CR, CS; + XMVECTOR Result; + FLOAT AbsV, V2, D; + CONST FLOAT OnePlusEps = 1.00000011921f; + + // return XM_PIDIV2 - XMScalarASin(Value); + + *(UINT*)&AbsV = *(UINT*)&Value & 0x7FFFFFFF; + V2 = Value * AbsV; + D = OnePlusEps - AbsV; + + CS = XMVectorSet(Value, 1.0f, 1.0f, V2); + VR = XMVectorSet(sqrtf(D), Value, V2, D * AbsV); + CR = XMVectorMultiply(CS, g_XMASinEstCoefficients.v); + + Result = XMVector4Dot(VR, CR); + + return XM_PIDIV2 - Result.vector4_f32[0]; + +#elif defined(_XM_SSE_INTRINSICS_) + CONST FLOAT OnePlusEps = 1.00000011921f; + FLOAT AbsV = fabsf(Value); + FLOAT V2 = Value * AbsV; // Value^2 retaining sign + FLOAT D = OnePlusEps - AbsV; + XMVECTOR Result = _mm_set_ps(V2,1.0f,1.0f,Value); + XMVECTOR VR = _mm_set_ps(D * AbsV,V2,Value,sqrtf(D)); + Result = _mm_mul_ps(Result,g_XMASinEstCoefficients); + Result = XMVector4Dot(VR,Result); +#if defined(_MSC_VER) && (_MSC_VER>=1500) + return XM_PIDIV2 - _mm_cvtss_f32(Result); +#else + return XM_PIDIV2 - Result.m128_f32[0]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +#endif // __XNAMATHMISC_INL__ + diff --git a/Src/Decoder_H264_ALL/D3D/include/xnamathvector.inl b/Src/Decoder_H264_ALL/D3D/include/xnamathvector.inl new file mode 100644 index 0000000..8ae7c2b --- /dev/null +++ b/Src/Decoder_H264_ALL/D3D/include/xnamathvector.inl @@ -0,0 +1,13189 @@ +/*++ + +Copyright (c) Microsoft Corporation. All rights reserved. + +Module Name: + + xnamathvector.inl + +Abstract: + + XNA math library for Windows and Xbox 360: Vector functions +--*/ + +#if defined(_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#ifndef __XNAMATHVECTOR_INL__ +#define __XNAMATHVECTOR_INL__ + +#if defined(_XM_NO_INTRINSICS_) +#define XMISNAN(x) ((*(UINT*)&(x) & 0x7F800000) == 0x7F800000 && (*(UINT*)&(x) & 0x7FFFFF) != 0) +#define XMISINF(x) ((*(UINT*)&(x) & 0x7FFFFFFF) == 0x7F800000) +#endif + +/**************************************************************************** + * + * General Vector + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Assignment operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Return a vector with all elements equaling zero +XMFINLINE XMVECTOR XMVectorZero() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult = {0.0f,0.0f,0.0f,0.0f}; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_setzero_ps(); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with four floating point values +XMFINLINE XMVECTOR XMVectorSet +( + FLOAT x, + FLOAT y, + FLOAT z, + FLOAT w +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORF32 vResult = {x,y,z,w}; + return vResult.v; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_set_ps( w, z, y, x ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with four integer values +XMFINLINE XMVECTOR XMVectorSetInt +( + UINT x, + UINT y, + UINT z, + UINT w +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult = {x,y,z,w}; + return vResult.v; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_set_epi32( w, z, y, x ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated floating point value +XMFINLINE XMVECTOR XMVectorReplicate +( + FLOAT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) + XMVECTORF32 vResult = {Value,Value,Value,Value}; + return vResult.v; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_set_ps1( Value ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated floating point value passed by pointer +XMFINLINE XMVECTOR XMVectorReplicatePtr +( + CONST FLOAT *pValue +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) + FLOAT Value = pValue[0]; + XMVECTORF32 vResult = {Value,Value,Value,Value}; + return vResult.v; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_load_ps1( pValue ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated integer value +XMFINLINE XMVECTOR XMVectorReplicateInt +( + UINT Value +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) + XMVECTORU32 vResult = {Value,Value,Value,Value}; + return vResult.v; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_set1_epi32( Value ); + return reinterpret_cast(&vTemp)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with a replicated integer value passed by pointer +XMFINLINE XMVECTOR XMVectorReplicateIntPtr +( + CONST UINT *pValue +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) + UINT Value = pValue[0]; + XMVECTORU32 vResult = {Value,Value,Value,Value}; + return vResult.v; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_load_ps1(reinterpret_cast(pValue)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with all bits set (true mask) +XMFINLINE XMVECTOR XMVectorTrueInt() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vResult = {0xFFFFFFFFU,0xFFFFFFFFU,0xFFFFFFFFU,0xFFFFFFFFU}; + return vResult.v; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_set1_epi32(-1); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Initialize a vector with all bits clear (false mask) +XMFINLINE XMVECTOR XMVectorFalseInt() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult = {0.0f,0.0f,0.0f,0.0f}; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_setzero_ps(); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Replicate the x component of the vector +XMFINLINE XMVECTOR XMVectorSplatX +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_f32[0] = + vResult.vector4_f32[1] = + vResult.vector4_f32[2] = + vResult.vector4_f32[3] = V.vector4_f32[0]; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_shuffle_ps( V, V, _MM_SHUFFLE(0, 0, 0, 0) ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Replicate the y component of the vector +XMFINLINE XMVECTOR XMVectorSplatY +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_f32[0] = + vResult.vector4_f32[1] = + vResult.vector4_f32[2] = + vResult.vector4_f32[3] = V.vector4_f32[1]; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_shuffle_ps( V, V, _MM_SHUFFLE(1, 1, 1, 1) ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Replicate the z component of the vector +XMFINLINE XMVECTOR XMVectorSplatZ +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_f32[0] = + vResult.vector4_f32[1] = + vResult.vector4_f32[2] = + vResult.vector4_f32[3] = V.vector4_f32[2]; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_shuffle_ps( V, V, _MM_SHUFFLE(2, 2, 2, 2) ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Replicate the w component of the vector +XMFINLINE XMVECTOR XMVectorSplatW +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_f32[0] = + vResult.vector4_f32[1] = + vResult.vector4_f32[2] = + vResult.vector4_f32[3] = V.vector4_f32[3]; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_shuffle_ps( V, V, _MM_SHUFFLE(3, 3, 3, 3) ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return a vector of 1.0f,1.0f,1.0f,1.0f +XMFINLINE XMVECTOR XMVectorSplatOne() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_f32[0] = + vResult.vector4_f32[1] = + vResult.vector4_f32[2] = + vResult.vector4_f32[3] = 1.0f; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMOne; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return a vector of INF,INF,INF,INF +XMFINLINE XMVECTOR XMVectorSplatInfinity() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_u32[0] = + vResult.vector4_u32[1] = + vResult.vector4_u32[2] = + vResult.vector4_u32[3] = 0x7F800000; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMInfinity; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return a vector of Q_NAN,Q_NAN,Q_NAN,Q_NAN +XMFINLINE XMVECTOR XMVectorSplatQNaN() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_u32[0] = + vResult.vector4_u32[1] = + vResult.vector4_u32[2] = + vResult.vector4_u32[3] = 0x7FC00000; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMQNaN; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return a vector of 1.192092896e-7f,1.192092896e-7f,1.192092896e-7f,1.192092896e-7f +XMFINLINE XMVECTOR XMVectorSplatEpsilon() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_u32[0] = + vResult.vector4_u32[1] = + vResult.vector4_u32[2] = + vResult.vector4_u32[3] = 0x34000000; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + return g_XMEpsilon; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return a vector of -0.0f (0x80000000),-0.0f,-0.0f,-0.0f +XMFINLINE XMVECTOR XMVectorSplatSignMask() +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult; + vResult.vector4_u32[0] = + vResult.vector4_u32[1] = + vResult.vector4_u32[2] = + vResult.vector4_u32[3] = 0x80000000U; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_set1_epi32( 0x80000000 ); + return reinterpret_cast<__m128*>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return a floating point value via an index. This is not a recommended +// function to use due to performance loss. +XMFINLINE FLOAT XMVectorGetByIndex(FXMVECTOR V,UINT i) +{ + XMASSERT( i <= 3 ); +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[i]; +#elif defined(_XM_SSE_INTRINSICS_) + return V.m128_f32[i]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return the X component in an FPU register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE FLOAT XMVectorGetX(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[0]; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_MSC_VER) && (_MSC_VER>=1500) + return _mm_cvtss_f32(V); +#else + return V.m128_f32[0]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Return the Y component in an FPU register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE FLOAT XMVectorGetY(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[1]; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_MSC_VER) && (_MSC_VER>=1500) + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + return _mm_cvtss_f32(vTemp); +#else + return V.m128_f32[1]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Return the Z component in an FPU register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE FLOAT XMVectorGetZ(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[2]; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_MSC_VER) && (_MSC_VER>=1500) + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + return _mm_cvtss_f32(vTemp); +#else + return V.m128_f32[2]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Return the W component in an FPU register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE FLOAT XMVectorGetW(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_f32[3]; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_MSC_VER) && (_MSC_VER>=1500) + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,3,3,3)); + return _mm_cvtss_f32(vTemp); +#else + return V.m128_f32[3]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Store a component indexed by i into a 32 bit float location in memory. +// This causes Load/Hit/Store on VMX targets +XMFINLINE VOID XMVectorGetByIndexPtr(FLOAT *f,FXMVECTOR V,UINT i) +{ + XMASSERT( f != 0 ); + XMASSERT( i < 4 ); +#if defined(_XM_NO_INTRINSICS_) + *f = V.vector4_f32[i]; +#elif defined(_XM_SSE_INTRINSICS_) + *f = V.m128_f32[i]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Store the X component into a 32 bit float location in memory. +XMFINLINE VOID XMVectorGetXPtr(FLOAT *x,FXMVECTOR V) +{ + XMASSERT( x != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *x = V.vector4_f32[0]; +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ss(x,V); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Store the Y component into a 32 bit float location in memory. +XMFINLINE VOID XMVectorGetYPtr(FLOAT *y,FXMVECTOR V) +{ + XMASSERT( y != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *y = V.vector4_f32[1]; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + _mm_store_ss(y,vResult); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Store the Z component into a 32 bit float location in memory. +XMFINLINE VOID XMVectorGetZPtr(FLOAT *z,FXMVECTOR V) +{ + XMASSERT( z != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *z = V.vector4_f32[2]; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + _mm_store_ss(z,vResult); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Store the W component into a 32 bit float location in memory. +XMFINLINE VOID XMVectorGetWPtr(FLOAT *w,FXMVECTOR V) +{ + XMASSERT( w != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *w = V.vector4_f32[3]; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,3,3,3)); + _mm_store_ss(w,vResult); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Return an integer value via an index. This is not a recommended +// function to use due to performance loss. +XMFINLINE UINT XMVectorGetIntByIndex(FXMVECTOR V, UINT i) +{ + XMASSERT( i < 4 ); +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[i]; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_MSC_VER) && (_MSC_VER<1400) + XMVECTORU32 tmp; + tmp.v = V; + return tmp.u[i]; +#else + return V.m128_u32[i]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Return the X component in an integer register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE UINT XMVectorGetIntX(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[0]; +#elif defined(_XM_SSE_INTRINSICS_) + return static_cast(_mm_cvtsi128_si32(reinterpret_cast(&V)[0])); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Return the Y component in an integer register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE UINT XMVectorGetIntY(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[1]; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vResulti = _mm_shuffle_epi32(reinterpret_cast(&V)[0],_MM_SHUFFLE(1,1,1,1)); + return static_cast(_mm_cvtsi128_si32(vResulti)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Return the Z component in an integer register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE UINT XMVectorGetIntZ(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[2]; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vResulti = _mm_shuffle_epi32(reinterpret_cast(&V)[0],_MM_SHUFFLE(2,2,2,2)); + return static_cast(_mm_cvtsi128_si32(vResulti)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Return the W component in an integer register. +// This causes Load/Hit/Store on VMX targets +XMFINLINE UINT XMVectorGetIntW(FXMVECTOR V) +{ +#if defined(_XM_NO_INTRINSICS_) + return V.vector4_u32[3]; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vResulti = _mm_shuffle_epi32(reinterpret_cast(&V)[0],_MM_SHUFFLE(3,3,3,3)); + return static_cast(_mm_cvtsi128_si32(vResulti)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Store a component indexed by i into a 32 bit integer location in memory. +// This causes Load/Hit/Store on VMX targets +XMFINLINE VOID XMVectorGetIntByIndexPtr(UINT *x,FXMVECTOR V,UINT i) +{ + XMASSERT( x != 0 ); + XMASSERT( i < 4 ); +#if defined(_XM_NO_INTRINSICS_) + *x = V.vector4_u32[i]; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_MSC_VER) && (_MSC_VER<1400) + XMVECTORU32 tmp; + tmp.v = V; + *x = tmp.u[i]; +#else + *x = V.m128_u32[i]; +#endif +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Store the X component into a 32 bit integer location in memory. +XMFINLINE VOID XMVectorGetIntXPtr(UINT *x,FXMVECTOR V) +{ + XMASSERT( x != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *x = V.vector4_u32[0]; +#elif defined(_XM_SSE_INTRINSICS_) + _mm_store_ss(reinterpret_cast(x),V); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Store the Y component into a 32 bit integer location in memory. +XMFINLINE VOID XMVectorGetIntYPtr(UINT *y,FXMVECTOR V) +{ + XMASSERT( y != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *y = V.vector4_u32[1]; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + _mm_store_ss(reinterpret_cast(y),vResult); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Store the Z component into a 32 bit integer locaCantion in memory. +XMFINLINE VOID XMVectorGetIntZPtr(UINT *z,FXMVECTOR V) +{ + XMASSERT( z != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *z = V.vector4_u32[2]; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + _mm_store_ss(reinterpret_cast(z),vResult); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Store the W component into a 32 bit integer location in memory. +XMFINLINE VOID XMVectorGetIntWPtr(UINT *w,FXMVECTOR V) +{ + XMASSERT( w != 0 ); +#if defined(_XM_NO_INTRINSICS_) + *w = V.vector4_u32[3]; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,3,3,3)); + _mm_store_ss(reinterpret_cast(w),vResult); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Set a single indexed floating point component +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetByIndex(FXMVECTOR V, FLOAT f,UINT i) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( i <= 3 ); + U = V; + U.vector4_f32[i] = f; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( i <= 3 ); + XMVECTOR U = V; + U.m128_f32[i] = f; + return U; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to a passed floating point value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetX(FXMVECTOR V, FLOAT x) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_f32[0] = x; + U.vector4_f32[1] = V.vector4_f32[1]; + U.vector4_f32[2] = V.vector4_f32[2]; + U.vector4_f32[3] = V.vector4_f32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_f32[0] = x; + return vResult; +#else + XMVECTOR vResult = _mm_set_ss(x); + vResult = _mm_move_ss(V,vResult); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the Y component of a vector to a passed floating point value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetY(FXMVECTOR V, FLOAT y) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_f32[0] = V.vector4_f32[0]; + U.vector4_f32[1] = y; + U.vector4_f32[2] = V.vector4_f32[2]; + U.vector4_f32[3] = V.vector4_f32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_f32[1] = y; + return vResult; +#else + // Swap y and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,2,0,1)); + // Convert input to vector + XMVECTOR vTemp = _mm_set_ss(y); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap y and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,2,0,1)); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} +// Sets the Z component of a vector to a passed floating point value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetZ(FXMVECTOR V, FLOAT z) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_f32[0] = V.vector4_f32[0]; + U.vector4_f32[1] = V.vector4_f32[1]; + U.vector4_f32[2] = z; + U.vector4_f32[3] = V.vector4_f32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_f32[2] = z; + return vResult; +#else + // Swap z and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,0,1,2)); + // Convert input to vector + XMVECTOR vTemp = _mm_set_ss(z); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap z and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2)); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the W component of a vector to a passed floating point value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetW(FXMVECTOR V, FLOAT w) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_f32[0] = V.vector4_f32[0]; + U.vector4_f32[1] = V.vector4_f32[1]; + U.vector4_f32[2] = V.vector4_f32[2]; + U.vector4_f32[3] = w; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_f32[3] = w; + return vResult; +#else + // Swap w and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,2,1,3)); + // Convert input to vector + XMVECTOR vTemp = _mm_set_ss(w); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap w and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,2,1,3)); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Sets a component of a vector to a floating point value passed by pointer +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetByIndexPtr(FXMVECTOR V,CONST FLOAT *f,UINT i) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( f != 0 ); + XMASSERT( i <= 3 ); + U = V; + U.vector4_f32[i] = *f; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( f != 0 ); + XMASSERT( i <= 3 ); + XMVECTOR U = V; + U.m128_f32[i] = *f; + return U; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to a floating point value passed by pointer +XMFINLINE XMVECTOR XMVectorSetXPtr(FXMVECTOR V,CONST FLOAT *x) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( x != 0 ); + U.vector4_f32[0] = *x; + U.vector4_f32[1] = V.vector4_f32[1]; + U.vector4_f32[2] = V.vector4_f32[2]; + U.vector4_f32[3] = V.vector4_f32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( x != 0 ); + XMVECTOR vResult = _mm_load_ss(x); + vResult = _mm_move_ss(V,vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the Y component of a vector to a floating point value passed by pointer +XMFINLINE XMVECTOR XMVectorSetYPtr(FXMVECTOR V,CONST FLOAT *y) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( y != 0 ); + U.vector4_f32[0] = V.vector4_f32[0]; + U.vector4_f32[1] = *y; + U.vector4_f32[2] = V.vector4_f32[2]; + U.vector4_f32[3] = V.vector4_f32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( y != 0 ); + // Swap y and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,2,0,1)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(y); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap y and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,2,0,1)); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the Z component of a vector to a floating point value passed by pointer +XMFINLINE XMVECTOR XMVectorSetZPtr(FXMVECTOR V,CONST FLOAT *z) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( z != 0 ); + U.vector4_f32[0] = V.vector4_f32[0]; + U.vector4_f32[1] = V.vector4_f32[1]; + U.vector4_f32[2] = *z; + U.vector4_f32[3] = V.vector4_f32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( z != 0 ); + // Swap z and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,0,1,2)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(z); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap z and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2)); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the W component of a vector to a floating point value passed by pointer +XMFINLINE XMVECTOR XMVectorSetWPtr(FXMVECTOR V,CONST FLOAT *w) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( w != 0 ); + U.vector4_f32[0] = V.vector4_f32[0]; + U.vector4_f32[1] = V.vector4_f32[1]; + U.vector4_f32[2] = V.vector4_f32[2]; + U.vector4_f32[3] = *w; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( w != 0 ); + // Swap w and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,2,1,3)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(w); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap w and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,2,1,3)); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Sets a component of a vector to an integer passed by value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetIntByIndex(FXMVECTOR V, UINT x, UINT i) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( i <= 3 ); + U = V; + U.vector4_u32[i] = x; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( i <= 3 ); + XMVECTORU32 tmp; + tmp.v = V; + tmp.u[i] = x; + return tmp; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to an integer passed by value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetIntX(FXMVECTOR V, UINT x) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_u32[0] = x; + U.vector4_u32[1] = V.vector4_u32[1]; + U.vector4_u32[2] = V.vector4_u32[2]; + U.vector4_u32[3] = V.vector4_u32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_i32[0] = x; + return vResult; +#else + __m128i vTemp = _mm_cvtsi32_si128(x); + XMVECTOR vResult = _mm_move_ss(V,reinterpret_cast(&vTemp)[0]); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the Y component of a vector to an integer passed by value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetIntY(FXMVECTOR V, UINT y) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_u32[0] = V.vector4_u32[0]; + U.vector4_u32[1] = y; + U.vector4_u32[2] = V.vector4_u32[2]; + U.vector4_u32[3] = V.vector4_u32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_i32[1] = y; + return vResult; +#else // Swap y and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,2,0,1)); + // Convert input to vector + __m128i vTemp = _mm_cvtsi32_si128(y); + // Replace the x component + vResult = _mm_move_ss(vResult,reinterpret_cast(&vTemp)[0]); + // Swap y and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,2,0,1)); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the Z component of a vector to an integer passed by value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetIntZ(FXMVECTOR V, UINT z) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_u32[0] = V.vector4_u32[0]; + U.vector4_u32[1] = V.vector4_u32[1]; + U.vector4_u32[2] = z; + U.vector4_u32[3] = V.vector4_u32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_i32[2] = z; + return vResult; +#else + // Swap z and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,0,1,2)); + // Convert input to vector + __m128i vTemp = _mm_cvtsi32_si128(z); + // Replace the x component + vResult = _mm_move_ss(vResult,reinterpret_cast(&vTemp)[0]); + // Swap z and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2)); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the W component of a vector to an integer passed by value +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetIntW(FXMVECTOR V, UINT w) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + U.vector4_u32[0] = V.vector4_u32[0]; + U.vector4_u32[1] = V.vector4_u32[1]; + U.vector4_u32[2] = V.vector4_u32[2]; + U.vector4_u32[3] = w; + return U; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_XM_ISVS2005_) + XMVECTOR vResult = V; + vResult.m128_i32[3] = w; + return vResult; +#else + // Swap w and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,2,1,3)); + // Convert input to vector + __m128i vTemp = _mm_cvtsi32_si128(w); + // Replace the x component + vResult = _mm_move_ss(vResult,reinterpret_cast(&vTemp)[0]); + // Swap w and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,2,1,3)); + return vResult; +#endif // _XM_ISVS2005_ +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Sets a component of a vector to an integer value passed by pointer +// This causes Load/Hit/Store on VMX targets +XMFINLINE XMVECTOR XMVectorSetIntByIndexPtr(FXMVECTOR V, CONST UINT *x,UINT i) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( x != 0 ); + XMASSERT( i <= 3 ); + U = V; + U.vector4_u32[i] = *x; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( x != 0 ); + XMASSERT( i <= 3 ); + XMVECTORU32 tmp; + tmp.v = V; + tmp.u[i] = *x; + return tmp; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Sets the X component of a vector to an integer value passed by pointer +XMFINLINE XMVECTOR XMVectorSetIntXPtr(FXMVECTOR V,CONST UINT *x) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( x != 0 ); + U.vector4_u32[0] = *x; + U.vector4_u32[1] = V.vector4_u32[1]; + U.vector4_u32[2] = V.vector4_u32[2]; + U.vector4_u32[3] = V.vector4_u32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( x != 0 ); + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(x)); + XMVECTOR vResult = _mm_move_ss(V,vTemp); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the Y component of a vector to an integer value passed by pointer +XMFINLINE XMVECTOR XMVectorSetIntYPtr(FXMVECTOR V,CONST UINT *y) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( y != 0 ); + U.vector4_u32[0] = V.vector4_u32[0]; + U.vector4_u32[1] = *y; + U.vector4_u32[2] = V.vector4_u32[2]; + U.vector4_u32[3] = V.vector4_u32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( y != 0 ); + // Swap y and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,2,0,1)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(y)); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap y and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,2,0,1)); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the Z component of a vector to an integer value passed by pointer +XMFINLINE XMVECTOR XMVectorSetIntZPtr(FXMVECTOR V,CONST UINT *z) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( z != 0 ); + U.vector4_u32[0] = V.vector4_u32[0]; + U.vector4_u32[1] = V.vector4_u32[1]; + U.vector4_u32[2] = *z; + U.vector4_u32[3] = V.vector4_u32[3]; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( z != 0 ); + // Swap z and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,0,1,2)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(z)); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap z and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,0,1,2)); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +// Sets the W component of a vector to an integer value passed by pointer +XMFINLINE XMVECTOR XMVectorSetIntWPtr(FXMVECTOR V,CONST UINT *w) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR U; + XMASSERT( w != 0 ); + U.vector4_u32[0] = V.vector4_u32[0]; + U.vector4_u32[1] = V.vector4_u32[1]; + U.vector4_u32[2] = V.vector4_u32[2]; + U.vector4_u32[3] = *w; + return U; +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( w != 0 ); + // Swap w and x + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,2,1,3)); + // Convert input to vector + XMVECTOR vTemp = _mm_load_ss(reinterpret_cast(w)); + // Replace the x component + vResult = _mm_move_ss(vResult,vTemp); + // Swap w and x again + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,2,1,3)); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Define a control vector to be used in XMVectorPermute +// operations. Visualize the two vectors V1 and V2 given +// in a permute as arranged back to back in a linear fashion, +// such that they form an array of 8 floating point values. +// The four integers specified in XMVectorPermuteControl +// will serve as indices into the array to select components +// from the two vectors. ElementIndex0 is used to select +// an element from the vectors to be placed in the first +// component of the resulting vector, ElementIndex1 is used +// to select an element for the second component, etc. + +XMFINLINE XMVECTOR XMVectorPermuteControl +( + UINT ElementIndex0, + UINT ElementIndex1, + UINT ElementIndex2, + UINT ElementIndex3 +) +{ +#if defined(_XM_SSE_INTRINSICS_) || defined(_XM_NO_INTRINSICS_) + XMVECTORU32 vControl; + static CONST UINT ControlElement[] = { + XM_PERMUTE_0X, + XM_PERMUTE_0Y, + XM_PERMUTE_0Z, + XM_PERMUTE_0W, + XM_PERMUTE_1X, + XM_PERMUTE_1Y, + XM_PERMUTE_1Z, + XM_PERMUTE_1W + }; + XMASSERT(ElementIndex0 < 8); + XMASSERT(ElementIndex1 < 8); + XMASSERT(ElementIndex2 < 8); + XMASSERT(ElementIndex3 < 8); + + vControl.u[0] = ControlElement[ElementIndex0]; + vControl.u[1] = ControlElement[ElementIndex1]; + vControl.u[2] = ControlElement[ElementIndex2]; + vControl.u[3] = ControlElement[ElementIndex3]; + return vControl.v; +#else +#endif +} + +//------------------------------------------------------------------------------ + +// Using a control vector made up of 16 bytes from 0-31, remap V1 and V2's byte +// entries into a single 16 byte vector and return it. Index 0-15 = V1, +// 16-31 = V2 +XMFINLINE XMVECTOR XMVectorPermute +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Control +) +{ +#if defined(_XM_NO_INTRINSICS_) + const BYTE *aByte[2]; + XMVECTOR Result; + UINT i, uIndex, VectorIndex; + const BYTE *pControl; + BYTE *pWork; + + // Indices must be in range from 0 to 31 + XMASSERT((Control.vector4_u32[0] & 0xE0E0E0E0) == 0); + XMASSERT((Control.vector4_u32[1] & 0xE0E0E0E0) == 0); + XMASSERT((Control.vector4_u32[2] & 0xE0E0E0E0) == 0); + XMASSERT((Control.vector4_u32[3] & 0xE0E0E0E0) == 0); + + // 0-15 = V1, 16-31 = V2 + aByte[0] = (const BYTE*)(&V1); + aByte[1] = (const BYTE*)(&V2); + i = 16; + pControl = (const BYTE *)(&Control); + pWork = (BYTE *)(&Result); + do { + // Get the byte to map from + uIndex = pControl[0]; + ++pControl; + VectorIndex = (uIndex>>4)&1; + uIndex &= 0x0F; +#if defined(_XM_LITTLEENDIAN_) + uIndex ^= 3; // Swap byte ordering on little endian machines +#endif + pWork[0] = aByte[VectorIndex][uIndex]; + ++pWork; + } while (--i); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) +#if defined(_PREFAST_) || defined(XMDEBUG) + // Indices must be in range from 0 to 31 + static const XMVECTORI32 PremuteTest = {0xE0E0E0E0,0xE0E0E0E0,0xE0E0E0E0,0xE0E0E0E0}; + XMVECTOR vAssert = _mm_and_ps(Control,PremuteTest); + __m128i vAsserti = _mm_cmpeq_epi32(reinterpret_cast(&vAssert)[0],g_XMZero); + XMASSERT(_mm_movemask_ps(*reinterpret_cast(&vAsserti)) == 0xf); +#endif + // Store the vectors onto local memory on the stack + XMVECTOR Array[2]; + Array[0] = V1; + Array[1] = V2; + // Output vector, on the stack + XMVECTORU8 vResult; + // Get pointer to the two vectors on the stack + const BYTE *pInput = reinterpret_cast(Array); + // Store the Control vector on the stack to access the bytes + // don't use Control, it can cause a register variable to spill on the stack. + XMVECTORU8 vControl; + vControl.v = Control; // Write to memory + UINT i = 0; + do { + UINT ComponentIndex = vControl.u[i] & 0x1FU; + ComponentIndex ^= 3; // Swap byte ordering + vResult.u[i] = pInput[ComponentIndex]; + } while (++i<16); + return vResult; +#else // _XM_SSE_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Define a control vector to be used in XMVectorSelect +// operations. The four integers specified in XMVectorSelectControl +// serve as indices to select between components in two vectors. +// The first index controls selection for the first component of +// the vectors involved in a select operation, the second index +// controls selection for the second component etc. A value of +// zero for an index causes the corresponding component from the first +// vector to be selected whereas a one causes the component from the +// second vector to be selected instead. + +XMFINLINE XMVECTOR XMVectorSelectControl +( + UINT VectorIndex0, + UINT VectorIndex1, + UINT VectorIndex2, + UINT VectorIndex3 +) +{ +#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) + // x=Index0,y=Index1,z=Index2,w=Index3 + __m128i vTemp = _mm_set_epi32(VectorIndex3,VectorIndex2,VectorIndex1,VectorIndex0); + // Any non-zero entries become 0xFFFFFFFF else 0 + vTemp = _mm_cmpgt_epi32(vTemp,g_XMZero); + return reinterpret_cast<__m128 *>(&vTemp)[0]; +#else + XMVECTOR ControlVector; + CONST UINT ControlElement[] = + { + XM_SELECT_0, + XM_SELECT_1 + }; + + XMASSERT(VectorIndex0 < 2); + XMASSERT(VectorIndex1 < 2); + XMASSERT(VectorIndex2 < 2); + XMASSERT(VectorIndex3 < 2); + + ControlVector.vector4_u32[0] = ControlElement[VectorIndex0]; + ControlVector.vector4_u32[1] = ControlElement[VectorIndex1]; + ControlVector.vector4_u32[2] = ControlElement[VectorIndex2]; + ControlVector.vector4_u32[3] = ControlElement[VectorIndex3]; + + return ControlVector; + +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSelect +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Control +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = (V1.vector4_u32[0] & ~Control.vector4_u32[0]) | (V2.vector4_u32[0] & Control.vector4_u32[0]); + Result.vector4_u32[1] = (V1.vector4_u32[1] & ~Control.vector4_u32[1]) | (V2.vector4_u32[1] & Control.vector4_u32[1]); + Result.vector4_u32[2] = (V1.vector4_u32[2] & ~Control.vector4_u32[2]) | (V2.vector4_u32[2] & Control.vector4_u32[2]); + Result.vector4_u32[3] = (V1.vector4_u32[3] & ~Control.vector4_u32[3]) | (V2.vector4_u32[3] & Control.vector4_u32[3]); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp1 = _mm_andnot_ps(Control,V1); + XMVECTOR vTemp2 = _mm_and_ps(V2,Control); + return _mm_or_ps(vTemp1,vTemp2); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorMergeXY +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = V1.vector4_u32[0]; + Result.vector4_u32[1] = V2.vector4_u32[0]; + Result.vector4_u32[2] = V1.vector4_u32[1]; + Result.vector4_u32[3] = V2.vector4_u32[1]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_unpacklo_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorMergeZW +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = V1.vector4_u32[2]; + Result.vector4_u32[1] = V2.vector4_u32[2]; + Result.vector4_u32[2] = V1.vector4_u32[3]; + Result.vector4_u32[3] = V2.vector4_u32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_unpackhi_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + + Control.vector4_u32[0] = (V1.vector4_f32[0] == V2.vector4_f32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V1.vector4_f32[1] == V2.vector4_f32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V1.vector4_f32[2] == V2.vector4_f32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V1.vector4_f32[3] == V2.vector4_f32[3]) ? 0xFFFFFFFF : 0; + + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpeq_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorEqualR +( + UINT* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ux, uy, uz, uw, CR; + XMVECTOR Control; + + XMASSERT( pCR ); + + ux = (V1.vector4_f32[0] == V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uy = (V1.vector4_f32[1] == V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uz = (V1.vector4_f32[2] == V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uw = (V1.vector4_f32[3] == V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + CR = 0; + if (ux&uy&uz&uw) + { + // All elements are greater + CR = XM_CRMASK_CR6TRUE; + } + else if (!(ux|uy|uz|uw)) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + Control.vector4_u32[0] = ux; + Control.vector4_u32[1] = uy; + Control.vector4_u32[2] = uz; + Control.vector4_u32[3] = uw; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( pCR ); + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); + UINT CR = 0; + int iTest = _mm_movemask_ps(vTemp); + if (iTest==0xf) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vTemp; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Treat the components of the vectors as unsigned integers and +// compare individual bits between the two. This is useful for +// comparing control vectors and result vectors returned from +// other comparison operations. + +XMFINLINE XMVECTOR XMVectorEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + + Control.vector4_u32[0] = (V1.vector4_u32[0] == V2.vector4_u32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V1.vector4_u32[1] == V2.vector4_u32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V1.vector4_u32[2] == V2.vector4_u32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V1.vector4_u32[3] == V2.vector4_u32[3]) ? 0xFFFFFFFF : 0; + + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_cmpeq_epi32( reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0] ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorEqualIntR +( + UINT* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + + XMASSERT(pCR); + + Control = XMVectorEqualInt(V1, V2); + + *pCR = 0; + + if (XMVector4EqualInt(Control, XMVectorTrueInt())) + { + // All elements are equal + *pCR |= XM_CRMASK_CR6TRUE; + } + else if (XMVector4EqualInt(Control, XMVectorFalseInt())) + { + // All elements are not equal + *pCR |= XM_CRMASK_CR6FALSE; + } + + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pCR); + __m128i V = _mm_cmpeq_epi32( reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0] ); + int iTemp = _mm_movemask_ps(reinterpret_cast(&V)[0]); + UINT CR = 0; + if (iTemp==0x0F) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTemp) + { + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorNearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT fDeltax, fDeltay, fDeltaz, fDeltaw; + XMVECTOR Control; + + fDeltax = V1.vector4_f32[0]-V2.vector4_f32[0]; + fDeltay = V1.vector4_f32[1]-V2.vector4_f32[1]; + fDeltaz = V1.vector4_f32[2]-V2.vector4_f32[2]; + fDeltaw = V1.vector4_f32[3]-V2.vector4_f32[3]; + + fDeltax = fabsf(fDeltax); + fDeltay = fabsf(fDeltay); + fDeltaz = fabsf(fDeltaz); + fDeltaw = fabsf(fDeltaw); + + Control.vector4_u32[0] = (fDeltax <= Epsilon.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[1] = (fDeltay <= Epsilon.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[2] = (fDeltaz <= Epsilon.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[3] = (fDeltaw <= Epsilon.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1,V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp,vDelta); + vTemp = _mm_max_ps(vTemp,vDelta); + vTemp = _mm_cmple_ps(vTemp,Epsilon); + return vTemp; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorNotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = (V1.vector4_f32[0] != V2.vector4_f32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V1.vector4_f32[1] != V2.vector4_f32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V1.vector4_f32[2] != V2.vector4_f32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V1.vector4_f32[3] != V2.vector4_f32[3]) ? 0xFFFFFFFF : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpneq_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorNotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = (V1.vector4_u32[0] != V2.vector4_u32[0]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[1] = (V1.vector4_u32[1] != V2.vector4_u32[1]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[2] = (V1.vector4_u32[2] != V2.vector4_u32[2]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[3] = (V1.vector4_u32[3] != V2.vector4_u32[3]) ? 0xFFFFFFFFU : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_cmpeq_epi32( reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0] ); + return _mm_xor_ps(reinterpret_cast<__m128 *>(&V)[0],g_XMNegOneMask); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorGreater +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = (V1.vector4_f32[0] > V2.vector4_f32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V1.vector4_f32[1] > V2.vector4_f32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V1.vector4_f32[2] > V2.vector4_f32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V1.vector4_f32[3] > V2.vector4_f32[3]) ? 0xFFFFFFFF : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpgt_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorGreaterR +( + UINT* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ux, uy, uz, uw, CR; + XMVECTOR Control; + + XMASSERT( pCR ); + + ux = (V1.vector4_f32[0] > V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uy = (V1.vector4_f32[1] > V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uz = (V1.vector4_f32[2] > V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uw = (V1.vector4_f32[3] > V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + CR = 0; + if (ux&uy&uz&uw) + { + // All elements are greater + CR = XM_CRMASK_CR6TRUE; + } + else if (!(ux|uy|uz|uw)) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + Control.vector4_u32[0] = ux; + Control.vector4_u32[1] = uy; + Control.vector4_u32[2] = uz; + Control.vector4_u32[3] = uw; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( pCR ); + XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2); + UINT CR = 0; + int iTest = _mm_movemask_ps(vTemp); + if (iTest==0xf) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vTemp; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorGreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = (V1.vector4_f32[0] >= V2.vector4_f32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V1.vector4_f32[1] >= V2.vector4_f32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V1.vector4_f32[2] >= V2.vector4_f32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V1.vector4_f32[3] >= V2.vector4_f32[3]) ? 0xFFFFFFFF : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmpge_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorGreaterOrEqualR +( + UINT* pCR, + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ux, uy, uz, uw, CR; + XMVECTOR Control; + + XMASSERT( pCR ); + + ux = (V1.vector4_f32[0] >= V2.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uy = (V1.vector4_f32[1] >= V2.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uz = (V1.vector4_f32[2] >= V2.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uw = (V1.vector4_f32[3] >= V2.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + CR = 0; + if (ux&uy&uz&uw) + { + // All elements are greater + CR = XM_CRMASK_CR6TRUE; + } + else if (!(ux|uy|uz|uw)) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + Control.vector4_u32[0] = ux; + Control.vector4_u32[1] = uy; + Control.vector4_u32[2] = uz; + Control.vector4_u32[3] = uw; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( pCR ); + XMVECTOR vTemp = _mm_cmpge_ps(V1,V2); + UINT CR = 0; + int iTest = _mm_movemask_ps(vTemp); + if (iTest==0xf) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + // All elements are not greater + CR = XM_CRMASK_CR6FALSE; + } + *pCR = CR; + return vTemp; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorLess +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = (V1.vector4_f32[0] < V2.vector4_f32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V1.vector4_f32[1] < V2.vector4_f32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V1.vector4_f32[2] < V2.vector4_f32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V1.vector4_f32[3] < V2.vector4_f32[3]) ? 0xFFFFFFFF : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmplt_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorLessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = (V1.vector4_f32[0] <= V2.vector4_f32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V1.vector4_f32[1] <= V2.vector4_f32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V1.vector4_f32[2] <= V2.vector4_f32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V1.vector4_f32[3] <= V2.vector4_f32[3]) ? 0xFFFFFFFF : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_cmple_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorInBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = (V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[1] = (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[2] = (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) ? 0xFFFFFFFF : 0; + Control.vector4_u32[3] = (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3]) ? 0xFFFFFFFF : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + return vTemp1; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorInBoundsR +( + UINT* pCR, + FXMVECTOR V, + FXMVECTOR Bounds +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT ux, uy, uz, uw, CR; + XMVECTOR Control; + + XMASSERT( pCR != 0 ); + + ux = (V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + uy = (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + uz = (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + uw = (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + + CR = 0; + + if (ux&uy&uz&uw) + { + // All elements are in bounds + CR = XM_CRMASK_CR6BOUNDS; + } + *pCR = CR; + Control.vector4_u32[0] = ux; + Control.vector4_u32[1] = uy; + Control.vector4_u32[2] = uz; + Control.vector4_u32[3] = uw; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT( pCR != 0 ); + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + + UINT CR = 0; + if (_mm_movemask_ps(vTemp1)==0xf) { + // All elements are in bounds + CR = XM_CRMASK_CR6BOUNDS; + } + *pCR = CR; + return vTemp1; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorIsNaN +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = XMISNAN(V.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[1] = XMISNAN(V.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[2] = XMISNAN(V.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[3] = XMISNAN(V.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the exponent + __m128i vTempInf = _mm_and_si128(reinterpret_cast(&V)[0],g_XMInfinity); + // Mask off the mantissa + __m128i vTempNan = _mm_and_si128(reinterpret_cast(&V)[0],g_XMQNaNTest); + // Are any of the exponents == 0x7F800000? + vTempInf = _mm_cmpeq_epi32(vTempInf,g_XMInfinity); + // Are any of the mantissa's zero? (SSE2 doesn't have a neq test) + vTempNan = _mm_cmpeq_epi32(vTempNan,g_XMZero); + // Perform a not on the NaN test to be true on NON-zero mantissas + vTempNan = _mm_andnot_si128(vTempNan,vTempInf); + // If any are NaN, the signs are true after the merge above + return reinterpret_cast(&vTempNan)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorIsInfinite +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Control; + Control.vector4_u32[0] = XMISINF(V.vector4_f32[0]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[1] = XMISINF(V.vector4_f32[1]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[2] = XMISINF(V.vector4_f32[2]) ? 0xFFFFFFFFU : 0; + Control.vector4_u32[3] = XMISINF(V.vector4_f32[3]) ? 0xFFFFFFFFU : 0; + return Control; + +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + __m128 vTemp = _mm_and_ps(V,g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp,g_XMInfinity); + // If any are infinity, the signs are true. + return vTemp; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Rounding and clamping operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorMin +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result.vector4_f32[0] = (V1.vector4_f32[0] < V2.vector4_f32[0]) ? V1.vector4_f32[0] : V2.vector4_f32[0]; + Result.vector4_f32[1] = (V1.vector4_f32[1] < V2.vector4_f32[1]) ? V1.vector4_f32[1] : V2.vector4_f32[1]; + Result.vector4_f32[2] = (V1.vector4_f32[2] < V2.vector4_f32[2]) ? V1.vector4_f32[2] : V2.vector4_f32[2]; + Result.vector4_f32[3] = (V1.vector4_f32[3] < V2.vector4_f32[3]) ? V1.vector4_f32[3] : V2.vector4_f32[3]; + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_min_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorMax +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result.vector4_f32[0] = (V1.vector4_f32[0] > V2.vector4_f32[0]) ? V1.vector4_f32[0] : V2.vector4_f32[0]; + Result.vector4_f32[1] = (V1.vector4_f32[1] > V2.vector4_f32[1]) ? V1.vector4_f32[1] : V2.vector4_f32[1]; + Result.vector4_f32[2] = (V1.vector4_f32[2] > V2.vector4_f32[2]) ? V1.vector4_f32[2] : V2.vector4_f32[2]; + Result.vector4_f32[3] = (V1.vector4_f32[3] > V2.vector4_f32[3]) ? V1.vector4_f32[3] : V2.vector4_f32[3]; + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_max_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorRound +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + XMVECTOR Bias; + CONST XMVECTOR Zero = XMVectorZero(); + CONST XMVECTOR BiasPos = XMVectorReplicate(0.5f); + CONST XMVECTOR BiasNeg = XMVectorReplicate(-0.5f); + + Bias = XMVectorLess(V, Zero); + Bias = XMVectorSelect(BiasPos, BiasNeg, Bias); + Result = XMVectorAdd(V, Bias); + Result = XMVectorTruncate(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // To handle NAN, INF and numbers greater than 8388608, use masking + // Get the abs value + __m128i vTest = _mm_and_si128(reinterpret_cast(&V)[0],g_XMAbsMask); + // Test for greater than 8388608 (All floats with NO fractionals, NAN and INF + vTest = _mm_cmplt_epi32(vTest,g_XMNoFraction); + // Convert to int and back to float for rounding + __m128i vInt = _mm_cvtps_epi32(V); + // Convert back to floats + XMVECTOR vResult = _mm_cvtepi32_ps(vInt); + // All numbers less than 8388608 will use the round to int + vResult = _mm_and_ps(vResult,reinterpret_cast(&vTest)[0]); + // All others, use the ORIGINAL value + vTest = _mm_andnot_si128(vTest,reinterpret_cast(&V)[0]); + vResult = _mm_or_ps(vResult,reinterpret_cast(&vTest)[0]); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorTruncate +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Result; + Result.vector4_f32[0] = (FLOAT)((INT)V.vector4_f32[0]); + Result.vector4_f32[1] = (FLOAT)((INT)V.vector4_f32[1]); + Result.vector4_f32[2] = (FLOAT)((INT)V.vector4_f32[2]); + Result.vector4_f32[3] = (FLOAT)((INT)V.vector4_f32[3]); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // To handle NAN, INF and numbers greater than 8388608, use masking + // Get the abs value + __m128i vTest = _mm_and_si128(reinterpret_cast(&V)[0],g_XMAbsMask); + // Test for greater than 8388608 (All floats with NO fractionals, NAN and INF + vTest = _mm_cmplt_epi32(vTest,g_XMNoFraction); + // Convert to int and back to float for rounding with truncation + __m128i vInt = _mm_cvttps_epi32(V); + // Convert back to floats + XMVECTOR vResult = _mm_cvtepi32_ps(vInt); + // All numbers less than 8388608 will use the round to int + vResult = _mm_and_ps(vResult,reinterpret_cast(&vTest)[0]); + // All others, use the ORIGINAL value + vTest = _mm_andnot_si128(vTest,reinterpret_cast(&V)[0]); + vResult = _mm_or_ps(vResult,reinterpret_cast(&vTest)[0]); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorFloor +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR vResult = { + floorf(V.vector4_f32[0]), + floorf(V.vector4_f32[1]), + floorf(V.vector4_f32[2]), + floorf(V.vector4_f32[3]) + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_sub_ps(V,g_XMOneHalfMinusEpsilon); + __m128i vInt = _mm_cvtps_epi32(vResult); + vResult = _mm_cvtepi32_ps(vInt); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorCeiling +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult = { + ceilf(V.vector4_f32[0]), + ceilf(V.vector4_f32[1]), + ceilf(V.vector4_f32[2]), + ceilf(V.vector4_f32[3]) + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_add_ps(V,g_XMOneHalfMinusEpsilon); + __m128i vInt = _mm_cvtps_epi32(vResult); + vResult = _mm_cvtepi32_ps(vInt); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorClamp +( + FXMVECTOR V, + FXMVECTOR Min, + FXMVECTOR Max +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + XMASSERT(XMVector4LessOrEqual(Min, Max)); + + Result = XMVectorMax(Min, V); + Result = XMVectorMin(Max, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult; + XMASSERT(XMVector4LessOrEqual(Min, Max)); + vResult = _mm_max_ps(Min,V); + vResult = _mm_min_ps(vResult,Max); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSaturate +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + CONST XMVECTOR Zero = XMVectorZero(); + + return XMVectorClamp(V, Zero, g_XMOne.v); + +#elif defined(_XM_SSE_INTRINSICS_) + // Set <0 to 0 + XMVECTOR vResult = _mm_max_ps(V,g_XMZero); + // Set>1 to 1 + return _mm_min_ps(vResult,g_XMOne); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Bitwise logical operations +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorAndInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = V1.vector4_u32[0] & V2.vector4_u32[0]; + Result.vector4_u32[1] = V1.vector4_u32[1] & V2.vector4_u32[1]; + Result.vector4_u32[2] = V1.vector4_u32[2] & V2.vector4_u32[2]; + Result.vector4_u32[3] = V1.vector4_u32[3] & V2.vector4_u32[3]; + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_and_ps(V1,V2); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorAndCInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = V1.vector4_u32[0] & ~V2.vector4_u32[0]; + Result.vector4_u32[1] = V1.vector4_u32[1] & ~V2.vector4_u32[1]; + Result.vector4_u32[2] = V1.vector4_u32[2] & ~V2.vector4_u32[2]; + Result.vector4_u32[3] = V1.vector4_u32[3] & ~V2.vector4_u32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_andnot_si128( reinterpret_cast(&V2)[0], reinterpret_cast(&V1)[0] ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorOrInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = V1.vector4_u32[0] | V2.vector4_u32[0]; + Result.vector4_u32[1] = V1.vector4_u32[1] | V2.vector4_u32[1]; + Result.vector4_u32[2] = V1.vector4_u32[2] | V2.vector4_u32[2]; + Result.vector4_u32[3] = V1.vector4_u32[3] | V2.vector4_u32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_or_si128( reinterpret_cast(&V1)[0], reinterpret_cast(&V2)[0] ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorNorInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = ~(V1.vector4_u32[0] | V2.vector4_u32[0]); + Result.vector4_u32[1] = ~(V1.vector4_u32[1] | V2.vector4_u32[1]); + Result.vector4_u32[2] = ~(V1.vector4_u32[2] | V2.vector4_u32[2]); + Result.vector4_u32[3] = ~(V1.vector4_u32[3] | V2.vector4_u32[3]); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i Result; + Result = _mm_or_si128( reinterpret_cast(&V1)[0], reinterpret_cast(&V2)[0] ); + Result = _mm_andnot_si128( Result,g_XMNegOneMask); + return reinterpret_cast<__m128 *>(&Result)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorXorInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_u32[0] = V1.vector4_u32[0] ^ V2.vector4_u32[0]; + Result.vector4_u32[1] = V1.vector4_u32[1] ^ V2.vector4_u32[1]; + Result.vector4_u32[2] = V1.vector4_u32[2] ^ V2.vector4_u32[2]; + Result.vector4_u32[3] = V1.vector4_u32[3] ^ V2.vector4_u32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i V = _mm_xor_si128( reinterpret_cast(&V1)[0], reinterpret_cast(&V2)[0] ); + return reinterpret_cast<__m128 *>(&V)[0]; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorNegate +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_f32[0] = -V.vector4_f32[0]; + Result.vector4_f32[1] = -V.vector4_f32[1]; + Result.vector4_f32[2] = -V.vector4_f32[2]; + Result.vector4_f32[3] = -V.vector4_f32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Z; + + Z = _mm_setzero_ps(); + + return _mm_sub_ps( Z, V ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorAdd +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_f32[0] = V1.vector4_f32[0] + V2.vector4_f32[0]; + Result.vector4_f32[1] = V1.vector4_f32[1] + V2.vector4_f32[1]; + Result.vector4_f32[2] = V1.vector4_f32[2] + V2.vector4_f32[2]; + Result.vector4_f32[3] = V1.vector4_f32[3] + V2.vector4_f32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_add_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorAddAngles +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Mask; + XMVECTOR Offset; + XMVECTOR Result; + CONST XMVECTOR Zero = XMVectorZero(); + + // Add the given angles together. If the range of V1 is such + // that -Pi <= V1 < Pi and the range of V2 is such that + // -2Pi <= V2 <= 2Pi, then the range of the resulting angle + // will be -Pi <= Result < Pi. + Result = XMVectorAdd(V1, V2); + + Mask = XMVectorLess(Result, g_XMNegativePi.v); + Offset = XMVectorSelect(Zero, g_XMTwoPi.v, Mask); + + Mask = XMVectorGreaterOrEqual(Result, g_XMPi.v); + Offset = XMVectorSelect(Offset, g_XMNegativeTwoPi.v, Mask); + + Result = XMVectorAdd(Result, Offset); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Adjust the angles + XMVECTOR vResult = _mm_add_ps(V1,V2); + // Less than Pi? + XMVECTOR vOffset = _mm_cmplt_ps(vResult,g_XMNegativePi); + vOffset = _mm_and_ps(vOffset,g_XMTwoPi); + // Add 2Pi to all entries less than -Pi + vResult = _mm_add_ps(vResult,vOffset); + // Greater than or equal to Pi? + vOffset = _mm_cmpge_ps(vResult,g_XMPi); + vOffset = _mm_and_ps(vOffset,g_XMTwoPi); + // Sub 2Pi to all entries greater than Pi + vResult = _mm_sub_ps(vResult,vOffset); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSubtract +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_f32[0] = V1.vector4_f32[0] - V2.vector4_f32[0]; + Result.vector4_f32[1] = V1.vector4_f32[1] - V2.vector4_f32[1]; + Result.vector4_f32[2] = V1.vector4_f32[2] - V2.vector4_f32[2]; + Result.vector4_f32[3] = V1.vector4_f32[3] - V2.vector4_f32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_sub_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSubtractAngles +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Mask; + XMVECTOR Offset; + XMVECTOR Result; + CONST XMVECTOR Zero = XMVectorZero(); + + // Subtract the given angles. If the range of V1 is such + // that -Pi <= V1 < Pi and the range of V2 is such that + // -2Pi <= V2 <= 2Pi, then the range of the resulting angle + // will be -Pi <= Result < Pi. + Result = XMVectorSubtract(V1, V2); + + Mask = XMVectorLess(Result, g_XMNegativePi.v); + Offset = XMVectorSelect(Zero, g_XMTwoPi.v, Mask); + + Mask = XMVectorGreaterOrEqual(Result, g_XMPi.v); + Offset = XMVectorSelect(Offset, g_XMNegativeTwoPi.v, Mask); + + Result = XMVectorAdd(Result, Offset); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Adjust the angles + XMVECTOR vResult = _mm_sub_ps(V1,V2); + // Less than Pi? + XMVECTOR vOffset = _mm_cmplt_ps(vResult,g_XMNegativePi); + vOffset = _mm_and_ps(vOffset,g_XMTwoPi); + // Add 2Pi to all entries less than -Pi + vResult = _mm_add_ps(vResult,vOffset); + // Greater than or equal to Pi? + vOffset = _mm_cmpge_ps(vResult,g_XMPi); + vOffset = _mm_and_ps(vOffset,g_XMTwoPi); + // Sub 2Pi to all entries greater than Pi + vResult = _mm_sub_ps(vResult,vOffset); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorMultiply +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Result = { + V1.vector4_f32[0] * V2.vector4_f32[0], + V1.vector4_f32[1] * V2.vector4_f32[1], + V1.vector4_f32[2] * V2.vector4_f32[2], + V1.vector4_f32[3] * V2.vector4_f32[3] + }; + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_mul_ps( V1, V2 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorMultiplyAdd +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR V3 +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult = { + (V1.vector4_f32[0] * V2.vector4_f32[0]) + V3.vector4_f32[0], + (V1.vector4_f32[1] * V2.vector4_f32[1]) + V3.vector4_f32[1], + (V1.vector4_f32[2] * V2.vector4_f32[2]) + V3.vector4_f32[2], + (V1.vector4_f32[3] * V2.vector4_f32[3]) + V3.vector4_f32[3] + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_mul_ps( V1, V2 ); + return _mm_add_ps(vResult, V3 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorNegativeMultiplySubtract +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR V3 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR vResult = { + V3.vector4_f32[0] - (V1.vector4_f32[0] * V2.vector4_f32[0]), + V3.vector4_f32[1] - (V1.vector4_f32[1] * V2.vector4_f32[1]), + V3.vector4_f32[2] - (V1.vector4_f32[2] * V2.vector4_f32[2]), + V3.vector4_f32[3] - (V1.vector4_f32[3] * V2.vector4_f32[3]) + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR R = _mm_mul_ps( V1, V2 ); + return _mm_sub_ps( V3, R ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorScale +( + FXMVECTOR V, + FLOAT ScaleFactor +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult = { + V.vector4_f32[0] * ScaleFactor, + V.vector4_f32[1] * ScaleFactor, + V.vector4_f32[2] * ScaleFactor, + V.vector4_f32[3] * ScaleFactor + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_set_ps1(ScaleFactor); + return _mm_mul_ps(vResult,V); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorReciprocalEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + UINT i; + + // Avoid C4701 + Result.vector4_f32[0] = 0.0f; + + for (i = 0; i < 4; i++) + { + if (XMISINF(V.vector4_f32[i])) + { + Result.vector4_f32[i] = (V.vector4_f32[i] < 0.0f) ? -0.0f : 0.0f; + } + else if (V.vector4_f32[i] == -0.0f) + { + Result.vector4_u32[i] = 0xFF800000; + } + else if (V.vector4_f32[i] == 0.0f) + { + Result.vector4_u32[i] = 0x7F800000; + } + else + { + Result.vector4_f32[i] = 1.0f / V.vector4_f32[i]; + } + } + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_rcp_ps(V); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorReciprocal +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + return XMVectorReciprocalEst(V); +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_div_ps(g_XMOne,V); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Return an estimated square root +XMFINLINE XMVECTOR XMVectorSqrtEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Select; + + // if (x == +Infinity) sqrt(x) = +Infinity + // if (x == +0.0f) sqrt(x) = +0.0f + // if (x == -0.0f) sqrt(x) = -0.0f + // if (x < -0.0f) sqrt(x) = QNaN + + XMVECTOR Result = XMVectorReciprocalSqrtEst(V); + XMVECTOR Zero = XMVectorZero(); + XMVECTOR VEqualsInfinity = XMVectorEqualInt(V, g_XMInfinity.v); + XMVECTOR VEqualsZero = XMVectorEqual(V, Zero); + Result = XMVectorMultiply(V, Result); + Select = XMVectorEqualInt(VEqualsInfinity, VEqualsZero); + Result = XMVectorSelect(V, Result, Select); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_sqrt_ps(V); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSqrt +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Zero; + XMVECTOR VEqualsInfinity, VEqualsZero; + XMVECTOR Select; + XMVECTOR Result; + + // if (x == +Infinity) sqrt(x) = +Infinity + // if (x == +0.0f) sqrt(x) = +0.0f + // if (x == -0.0f) sqrt(x) = -0.0f + // if (x < -0.0f) sqrt(x) = QNaN + + Result = XMVectorReciprocalSqrt(V); + Zero = XMVectorZero(); + VEqualsInfinity = XMVectorEqualInt(V, g_XMInfinity.v); + VEqualsZero = XMVectorEqual(V, Zero); + Result = XMVectorMultiply(V, Result); + Select = XMVectorEqualInt(VEqualsInfinity, VEqualsZero); + Result = XMVectorSelect(V, Result, Select); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_sqrt_ps(V); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorReciprocalSqrtEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + UINT i; + + // Avoid C4701 + Result.vector4_f32[0] = 0.0f; + + for (i = 0; i < 4; i++) + { + if (V.vector4_f32[i] == 0.0f) + { + Result.vector4_u32[i] = 0x7F800000; + } + else if (V.vector4_f32[i] == -0.0f) + { + Result.vector4_u32[i] = 0xFF800000; + } + else if (V.vector4_f32[i] < 0.0f) + { + Result.vector4_u32[i] = 0x7FFFFFFF; + } + else if (XMISINF(V.vector4_f32[i])) + { + Result.vector4_f32[i] = 0.0f; + } + else + { + Result.vector4_f32[i] = 1.0f / sqrtf(V.vector4_f32[i]); + } + } + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + return _mm_rsqrt_ps(V); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorReciprocalSqrt +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + return XMVectorReciprocalSqrtEst(V); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_sqrt_ps(V); + vResult = _mm_div_ps(g_XMOne,vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorExpEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result.vector4_f32[0] = powf(2.0f, V.vector4_f32[0]); + Result.vector4_f32[1] = powf(2.0f, V.vector4_f32[1]); + Result.vector4_f32[2] = powf(2.0f, V.vector4_f32[2]); + Result.vector4_f32[3] = powf(2.0f, V.vector4_f32[3]); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_setr_ps( + powf(2.0f,XMVectorGetX(V)), + powf(2.0f,XMVectorGetY(V)), + powf(2.0f,XMVectorGetZ(V)), + powf(2.0f,XMVectorGetW(V))); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorExp +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR E, S; + XMVECTOR R, R2, R3, R4; + XMVECTOR V0, V1; + XMVECTOR C0X, C0Y, C0Z, C0W; + XMVECTOR C1X, C1Y, C1Z, C1W; + XMVECTOR Result; + static CONST XMVECTOR C0 = {1.0f, -6.93147182e-1f, 2.40226462e-1f, -5.55036440e-2f}; + static CONST XMVECTOR C1 = {9.61597636e-3f, -1.32823968e-3f, 1.47491097e-4f, -1.08635004e-5f}; + + R = XMVectorFloor(V); + E = XMVectorExpEst(R); + R = XMVectorSubtract(V, R); + R2 = XMVectorMultiply(R, R); + R3 = XMVectorMultiply(R, R2); + R4 = XMVectorMultiply(R2, R2); + + C0X = XMVectorSplatX(C0); + C0Y = XMVectorSplatY(C0); + C0Z = XMVectorSplatZ(C0); + C0W = XMVectorSplatW(C0); + + C1X = XMVectorSplatX(C1); + C1Y = XMVectorSplatY(C1); + C1Z = XMVectorSplatZ(C1); + C1W = XMVectorSplatW(C1); + + V0 = XMVectorMultiplyAdd(R, C0Y, C0X); + V0 = XMVectorMultiplyAdd(R2, C0Z, V0); + V0 = XMVectorMultiplyAdd(R3, C0W, V0); + + V1 = XMVectorMultiplyAdd(R, C1Y, C1X); + V1 = XMVectorMultiplyAdd(R2, C1Z, V1); + V1 = XMVectorMultiplyAdd(R3, C1W, V1); + + S = XMVectorMultiplyAdd(R4, V1, V0); + + S = XMVectorReciprocal(S); + Result = XMVectorMultiply(E, S); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 C0 = {1.0f, -6.93147182e-1f, 2.40226462e-1f, -5.55036440e-2f}; + static CONST XMVECTORF32 C1 = {9.61597636e-3f, -1.32823968e-3f, 1.47491097e-4f, -1.08635004e-5f}; + + // Get the integer of the input + XMVECTOR R = XMVectorFloor(V); + // Get the exponent estimate + XMVECTOR E = XMVectorExpEst(R); + // Get the fractional only + R = _mm_sub_ps(V,R); + // Get R^2 + XMVECTOR R2 = _mm_mul_ps(R,R); + // And R^3 + XMVECTOR R3 = _mm_mul_ps(R,R2); + + XMVECTOR V0 = _mm_load_ps1(&C0.f[1]); + V0 = _mm_mul_ps(V0,R); + XMVECTOR vConstants = _mm_load_ps1(&C0.f[0]); + V0 = _mm_add_ps(V0,vConstants); + vConstants = _mm_load_ps1(&C0.f[2]); + vConstants = _mm_mul_ps(vConstants,R2); + V0 = _mm_add_ps(V0,vConstants); + vConstants = _mm_load_ps1(&C0.f[3]); + vConstants = _mm_mul_ps(vConstants,R3); + V0 = _mm_add_ps(V0,vConstants); + + XMVECTOR V1 = _mm_load_ps1(&C1.f[1]); + V1 = _mm_mul_ps(V1,R); + vConstants = _mm_load_ps1(&C1.f[0]); + V1 = _mm_add_ps(V1,vConstants); + vConstants = _mm_load_ps1(&C1.f[2]); + vConstants = _mm_mul_ps(vConstants,R2); + V1 = _mm_add_ps(V1,vConstants); + vConstants = _mm_load_ps1(&C1.f[3]); + vConstants = _mm_mul_ps(vConstants,R3); + V1 = _mm_add_ps(V1,vConstants); + // R2 = R^4 + R2 = _mm_mul_ps(R2,R2); + R2 = _mm_mul_ps(R2,V1); + R2 = _mm_add_ps(R2,V0); + E = _mm_div_ps(E,R2); + return E; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorLogEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + FLOAT fScale = (1.0f / logf(2.0f)); + XMVECTOR Result; + + Result.vector4_f32[0] = logf(V.vector4_f32[0])*fScale; + Result.vector4_f32[1] = logf(V.vector4_f32[1])*fScale; + Result.vector4_f32[2] = logf(V.vector4_f32[2])*fScale; + Result.vector4_f32[3] = logf(V.vector4_f32[3])*fScale; + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vScale = _mm_set_ps1(1.0f / logf(2.0f)); + XMVECTOR vResult = _mm_setr_ps( + logf(XMVectorGetX(V)), + logf(XMVectorGetY(V)), + logf(XMVectorGetZ(V)), + logf(XMVectorGetW(V))); + vResult = _mm_mul_ps(vResult,vScale); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorLog +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT fScale = (1.0f / logf(2.0f)); + XMVECTOR Result; + + Result.vector4_f32[0] = logf(V.vector4_f32[0])*fScale; + Result.vector4_f32[1] = logf(V.vector4_f32[1])*fScale; + Result.vector4_f32[2] = logf(V.vector4_f32[2])*fScale; + Result.vector4_f32[3] = logf(V.vector4_f32[3])*fScale; + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vScale = _mm_set_ps1(1.0f / logf(2.0f)); + XMVECTOR vResult = _mm_setr_ps( + logf(XMVectorGetX(V)), + logf(XMVectorGetY(V)), + logf(XMVectorGetZ(V)), + logf(XMVectorGetW(V))); + vResult = _mm_mul_ps(vResult,vScale); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorPowEst +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_f32[0] = powf(V1.vector4_f32[0], V2.vector4_f32[0]); + Result.vector4_f32[1] = powf(V1.vector4_f32[1], V2.vector4_f32[1]); + Result.vector4_f32[2] = powf(V1.vector4_f32[2], V2.vector4_f32[2]); + Result.vector4_f32[3] = powf(V1.vector4_f32[3], V2.vector4_f32[3]); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_setr_ps( + powf(XMVectorGetX(V1),XMVectorGetX(V2)), + powf(XMVectorGetY(V1),XMVectorGetY(V2)), + powf(XMVectorGetZ(V1),XMVectorGetZ(V2)), + powf(XMVectorGetW(V1),XMVectorGetW(V2))); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorPow +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) + + return XMVectorPowEst(V1, V2); + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorAbs +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult = { + fabsf(V.vector4_f32[0]), + fabsf(V.vector4_f32[1]), + fabsf(V.vector4_f32[2]), + fabsf(V.vector4_f32[3]) + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_setzero_ps(); + vResult = _mm_sub_ps(vResult,V); + vResult = _mm_max_ps(vResult,V); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorMod +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Reciprocal; + XMVECTOR Quotient; + XMVECTOR Result; + + // V1 % V2 = V1 - V2 * truncate(V1 / V2) + Reciprocal = XMVectorReciprocal(V2); + Quotient = XMVectorMultiply(V1, Reciprocal); + Quotient = XMVectorTruncate(Quotient); + Result = XMVectorNegativeMultiplySubtract(V2, Quotient, V1); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_div_ps(V1, V2); + vResult = XMVectorTruncate(vResult); + vResult = _mm_mul_ps(vResult,V2); + vResult = _mm_sub_ps(V1,vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorModAngles +( + FXMVECTOR Angles +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR Result; + + // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI + V = XMVectorMultiply(Angles, g_XMReciprocalTwoPi.v); + V = XMVectorRound(V); + Result = XMVectorNegativeMultiplySubtract(g_XMTwoPi.v, V, Angles); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Modulo the range of the given angles such that -XM_PI <= Angles < XM_PI + XMVECTOR vResult = _mm_mul_ps(Angles,g_XMReciprocalTwoPi); + // Use the inline function due to complexity for rounding + vResult = XMVectorRound(vResult); + vResult = _mm_mul_ps(vResult,g_XMTwoPi); + vResult = _mm_sub_ps(Angles,vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorSin +( + FXMVECTOR V +) +{ + +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2, V3, V5, V7, V9, V11, V13, V15, V17, V19, V21, V23; + XMVECTOR S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11; + XMVECTOR Result; + + V1 = XMVectorModAngles(V); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! - + // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI) + V2 = XMVectorMultiply(V1, V1); + V3 = XMVectorMultiply(V2, V1); + V5 = XMVectorMultiply(V3, V2); + V7 = XMVectorMultiply(V5, V2); + V9 = XMVectorMultiply(V7, V2); + V11 = XMVectorMultiply(V9, V2); + V13 = XMVectorMultiply(V11, V2); + V15 = XMVectorMultiply(V13, V2); + V17 = XMVectorMultiply(V15, V2); + V19 = XMVectorMultiply(V17, V2); + V21 = XMVectorMultiply(V19, V2); + V23 = XMVectorMultiply(V21, V2); + + S1 = XMVectorSplatY(g_XMSinCoefficients0.v); + S2 = XMVectorSplatZ(g_XMSinCoefficients0.v); + S3 = XMVectorSplatW(g_XMSinCoefficients0.v); + S4 = XMVectorSplatX(g_XMSinCoefficients1.v); + S5 = XMVectorSplatY(g_XMSinCoefficients1.v); + S6 = XMVectorSplatZ(g_XMSinCoefficients1.v); + S7 = XMVectorSplatW(g_XMSinCoefficients1.v); + S8 = XMVectorSplatX(g_XMSinCoefficients2.v); + S9 = XMVectorSplatY(g_XMSinCoefficients2.v); + S10 = XMVectorSplatZ(g_XMSinCoefficients2.v); + S11 = XMVectorSplatW(g_XMSinCoefficients2.v); + + Result = XMVectorMultiplyAdd(S1, V3, V1); + Result = XMVectorMultiplyAdd(S2, V5, Result); + Result = XMVectorMultiplyAdd(S3, V7, Result); + Result = XMVectorMultiplyAdd(S4, V9, Result); + Result = XMVectorMultiplyAdd(S5, V11, Result); + Result = XMVectorMultiplyAdd(S6, V13, Result); + Result = XMVectorMultiplyAdd(S7, V15, Result); + Result = XMVectorMultiplyAdd(S8, V17, Result); + Result = XMVectorMultiplyAdd(S9, V19, Result); + Result = XMVectorMultiplyAdd(S10, V21, Result); + Result = XMVectorMultiplyAdd(S11, V23, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR vResult = XMVectorModAngles(V); + // Each on is V to the "num" power + // V2 = V1^2 + XMVECTOR V2 = _mm_mul_ps(vResult,vResult); + // V1^3 + XMVECTOR vPower = _mm_mul_ps(vResult,V2); + XMVECTOR vConstants = _mm_load_ps1(&g_XMSinCoefficients0.f[1]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^5 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients0.f[2]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^7 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients0.f[3]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^9 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients1.f[0]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^11 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients1.f[1]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^13 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients1.f[2]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^15 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients1.f[3]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^17 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients2.f[0]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^19 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients2.f[1]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^21 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients2.f[2]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^23 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMSinCoefficients2.f[3]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorCos +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2, V4, V6, V8, V10, V12, V14, V16, V18, V20, V22; + XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11; + XMVECTOR Result; + + V1 = XMVectorModAngles(V); + + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! - + // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI) + V2 = XMVectorMultiply(V1, V1); + V4 = XMVectorMultiply(V2, V2); + V6 = XMVectorMultiply(V4, V2); + V8 = XMVectorMultiply(V4, V4); + V10 = XMVectorMultiply(V6, V4); + V12 = XMVectorMultiply(V6, V6); + V14 = XMVectorMultiply(V8, V6); + V16 = XMVectorMultiply(V8, V8); + V18 = XMVectorMultiply(V10, V8); + V20 = XMVectorMultiply(V10, V10); + V22 = XMVectorMultiply(V12, V10); + + C1 = XMVectorSplatY(g_XMCosCoefficients0.v); + C2 = XMVectorSplatZ(g_XMCosCoefficients0.v); + C3 = XMVectorSplatW(g_XMCosCoefficients0.v); + C4 = XMVectorSplatX(g_XMCosCoefficients1.v); + C5 = XMVectorSplatY(g_XMCosCoefficients1.v); + C6 = XMVectorSplatZ(g_XMCosCoefficients1.v); + C7 = XMVectorSplatW(g_XMCosCoefficients1.v); + C8 = XMVectorSplatX(g_XMCosCoefficients2.v); + C9 = XMVectorSplatY(g_XMCosCoefficients2.v); + C10 = XMVectorSplatZ(g_XMCosCoefficients2.v); + C11 = XMVectorSplatW(g_XMCosCoefficients2.v); + + Result = XMVectorMultiplyAdd(C1, V2, g_XMOne.v); + Result = XMVectorMultiplyAdd(C2, V4, Result); + Result = XMVectorMultiplyAdd(C3, V6, Result); + Result = XMVectorMultiplyAdd(C4, V8, Result); + Result = XMVectorMultiplyAdd(C5, V10, Result); + Result = XMVectorMultiplyAdd(C6, V12, Result); + Result = XMVectorMultiplyAdd(C7, V14, Result); + Result = XMVectorMultiplyAdd(C8, V16, Result); + Result = XMVectorMultiplyAdd(C9, V18, Result); + Result = XMVectorMultiplyAdd(C10, V20, Result); + Result = XMVectorMultiplyAdd(C11, V22, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Force the value within the bounds of pi + XMVECTOR V2 = XMVectorModAngles(V); + // Each on is V to the "num" power + // V2 = V1^2 + V2 = _mm_mul_ps(V2,V2); + // V^2 + XMVECTOR vConstants = _mm_load_ps1(&g_XMCosCoefficients0.f[1]); + vConstants = _mm_mul_ps(vConstants,V2); + XMVECTOR vResult = _mm_add_ps(vConstants,g_XMOne); + + // V^4 + XMVECTOR vPower = _mm_mul_ps(V2,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients0.f[2]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^6 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients0.f[3]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^8 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients1.f[0]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^10 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients1.f[1]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^12 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients1.f[2]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^14 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients1.f[3]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^16 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients2.f[0]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^18 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients2.f[1]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^20 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients2.f[2]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + + // V^22 + vPower = _mm_mul_ps(vPower,V2); + vConstants = _mm_load_ps1(&g_XMCosCoefficients2.f[3]); + vConstants = _mm_mul_ps(vConstants,vPower); + vResult = _mm_add_ps(vResult,vConstants); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE VOID XMVectorSinCos +( + XMVECTOR* pSin, + XMVECTOR* pCos, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13; + XMVECTOR V14, V15, V16, V17, V18, V19, V20, V21, V22, V23; + XMVECTOR S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11; + XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11; + XMVECTOR Sin, Cos; + + XMASSERT(pSin); + XMASSERT(pCos); + + V1 = XMVectorModAngles(V); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! - + // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI) + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! - + // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI) + + V2 = XMVectorMultiply(V1, V1); + V3 = XMVectorMultiply(V2, V1); + V4 = XMVectorMultiply(V2, V2); + V5 = XMVectorMultiply(V3, V2); + V6 = XMVectorMultiply(V3, V3); + V7 = XMVectorMultiply(V4, V3); + V8 = XMVectorMultiply(V4, V4); + V9 = XMVectorMultiply(V5, V4); + V10 = XMVectorMultiply(V5, V5); + V11 = XMVectorMultiply(V6, V5); + V12 = XMVectorMultiply(V6, V6); + V13 = XMVectorMultiply(V7, V6); + V14 = XMVectorMultiply(V7, V7); + V15 = XMVectorMultiply(V8, V7); + V16 = XMVectorMultiply(V8, V8); + V17 = XMVectorMultiply(V9, V8); + V18 = XMVectorMultiply(V9, V9); + V19 = XMVectorMultiply(V10, V9); + V20 = XMVectorMultiply(V10, V10); + V21 = XMVectorMultiply(V11, V10); + V22 = XMVectorMultiply(V11, V11); + V23 = XMVectorMultiply(V12, V11); + + S1 = XMVectorSplatY(g_XMSinCoefficients0.v); + S2 = XMVectorSplatZ(g_XMSinCoefficients0.v); + S3 = XMVectorSplatW(g_XMSinCoefficients0.v); + S4 = XMVectorSplatX(g_XMSinCoefficients1.v); + S5 = XMVectorSplatY(g_XMSinCoefficients1.v); + S6 = XMVectorSplatZ(g_XMSinCoefficients1.v); + S7 = XMVectorSplatW(g_XMSinCoefficients1.v); + S8 = XMVectorSplatX(g_XMSinCoefficients2.v); + S9 = XMVectorSplatY(g_XMSinCoefficients2.v); + S10 = XMVectorSplatZ(g_XMSinCoefficients2.v); + S11 = XMVectorSplatW(g_XMSinCoefficients2.v); + + C1 = XMVectorSplatY(g_XMCosCoefficients0.v); + C2 = XMVectorSplatZ(g_XMCosCoefficients0.v); + C3 = XMVectorSplatW(g_XMCosCoefficients0.v); + C4 = XMVectorSplatX(g_XMCosCoefficients1.v); + C5 = XMVectorSplatY(g_XMCosCoefficients1.v); + C6 = XMVectorSplatZ(g_XMCosCoefficients1.v); + C7 = XMVectorSplatW(g_XMCosCoefficients1.v); + C8 = XMVectorSplatX(g_XMCosCoefficients2.v); + C9 = XMVectorSplatY(g_XMCosCoefficients2.v); + C10 = XMVectorSplatZ(g_XMCosCoefficients2.v); + C11 = XMVectorSplatW(g_XMCosCoefficients2.v); + + Sin = XMVectorMultiplyAdd(S1, V3, V1); + Sin = XMVectorMultiplyAdd(S2, V5, Sin); + Sin = XMVectorMultiplyAdd(S3, V7, Sin); + Sin = XMVectorMultiplyAdd(S4, V9, Sin); + Sin = XMVectorMultiplyAdd(S5, V11, Sin); + Sin = XMVectorMultiplyAdd(S6, V13, Sin); + Sin = XMVectorMultiplyAdd(S7, V15, Sin); + Sin = XMVectorMultiplyAdd(S8, V17, Sin); + Sin = XMVectorMultiplyAdd(S9, V19, Sin); + Sin = XMVectorMultiplyAdd(S10, V21, Sin); + Sin = XMVectorMultiplyAdd(S11, V23, Sin); + + Cos = XMVectorMultiplyAdd(C1, V2, g_XMOne.v); + Cos = XMVectorMultiplyAdd(C2, V4, Cos); + Cos = XMVectorMultiplyAdd(C3, V6, Cos); + Cos = XMVectorMultiplyAdd(C4, V8, Cos); + Cos = XMVectorMultiplyAdd(C5, V10, Cos); + Cos = XMVectorMultiplyAdd(C6, V12, Cos); + Cos = XMVectorMultiplyAdd(C7, V14, Cos); + Cos = XMVectorMultiplyAdd(C8, V16, Cos); + Cos = XMVectorMultiplyAdd(C9, V18, Cos); + Cos = XMVectorMultiplyAdd(C10, V20, Cos); + Cos = XMVectorMultiplyAdd(C11, V22, Cos); + + *pSin = Sin; + *pCos = Cos; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSin); + XMASSERT(pCos); + XMVECTOR V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13; + XMVECTOR V14, V15, V16, V17, V18, V19, V20, V21, V22, V23; + XMVECTOR S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11; + XMVECTOR C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11; + XMVECTOR Sin, Cos; + + V1 = XMVectorModAngles(V); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! + V^9 / 9! - V^11 / 11! + V^13 / 13! - + // V^15 / 15! + V^17 / 17! - V^19 / 19! + V^21 / 21! - V^23 / 23! (for -PI <= V < PI) + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! + V^8 / 8! - V^10 / 10! + V^12 / 12! - + // V^14 / 14! + V^16 / 16! - V^18 / 18! + V^20 / 20! - V^22 / 22! (for -PI <= V < PI) + + V2 = XMVectorMultiply(V1, V1); + V3 = XMVectorMultiply(V2, V1); + V4 = XMVectorMultiply(V2, V2); + V5 = XMVectorMultiply(V3, V2); + V6 = XMVectorMultiply(V3, V3); + V7 = XMVectorMultiply(V4, V3); + V8 = XMVectorMultiply(V4, V4); + V9 = XMVectorMultiply(V5, V4); + V10 = XMVectorMultiply(V5, V5); + V11 = XMVectorMultiply(V6, V5); + V12 = XMVectorMultiply(V6, V6); + V13 = XMVectorMultiply(V7, V6); + V14 = XMVectorMultiply(V7, V7); + V15 = XMVectorMultiply(V8, V7); + V16 = XMVectorMultiply(V8, V8); + V17 = XMVectorMultiply(V9, V8); + V18 = XMVectorMultiply(V9, V9); + V19 = XMVectorMultiply(V10, V9); + V20 = XMVectorMultiply(V10, V10); + V21 = XMVectorMultiply(V11, V10); + V22 = XMVectorMultiply(V11, V11); + V23 = XMVectorMultiply(V12, V11); + + S1 = _mm_load_ps1(&g_XMSinCoefficients0.f[1]); + S2 = _mm_load_ps1(&g_XMSinCoefficients0.f[2]); + S3 = _mm_load_ps1(&g_XMSinCoefficients0.f[3]); + S4 = _mm_load_ps1(&g_XMSinCoefficients1.f[0]); + S5 = _mm_load_ps1(&g_XMSinCoefficients1.f[1]); + S6 = _mm_load_ps1(&g_XMSinCoefficients1.f[2]); + S7 = _mm_load_ps1(&g_XMSinCoefficients1.f[3]); + S8 = _mm_load_ps1(&g_XMSinCoefficients2.f[0]); + S9 = _mm_load_ps1(&g_XMSinCoefficients2.f[1]); + S10 = _mm_load_ps1(&g_XMSinCoefficients2.f[2]); + S11 = _mm_load_ps1(&g_XMSinCoefficients2.f[3]); + + C1 = _mm_load_ps1(&g_XMCosCoefficients0.f[1]); + C2 = _mm_load_ps1(&g_XMCosCoefficients0.f[2]); + C3 = _mm_load_ps1(&g_XMCosCoefficients0.f[3]); + C4 = _mm_load_ps1(&g_XMCosCoefficients1.f[0]); + C5 = _mm_load_ps1(&g_XMCosCoefficients1.f[1]); + C6 = _mm_load_ps1(&g_XMCosCoefficients1.f[2]); + C7 = _mm_load_ps1(&g_XMCosCoefficients1.f[3]); + C8 = _mm_load_ps1(&g_XMCosCoefficients2.f[0]); + C9 = _mm_load_ps1(&g_XMCosCoefficients2.f[1]); + C10 = _mm_load_ps1(&g_XMCosCoefficients2.f[2]); + C11 = _mm_load_ps1(&g_XMCosCoefficients2.f[3]); + + S1 = _mm_mul_ps(S1,V3); + Sin = _mm_add_ps(S1,V1); + Sin = XMVectorMultiplyAdd(S2, V5, Sin); + Sin = XMVectorMultiplyAdd(S3, V7, Sin); + Sin = XMVectorMultiplyAdd(S4, V9, Sin); + Sin = XMVectorMultiplyAdd(S5, V11, Sin); + Sin = XMVectorMultiplyAdd(S6, V13, Sin); + Sin = XMVectorMultiplyAdd(S7, V15, Sin); + Sin = XMVectorMultiplyAdd(S8, V17, Sin); + Sin = XMVectorMultiplyAdd(S9, V19, Sin); + Sin = XMVectorMultiplyAdd(S10, V21, Sin); + Sin = XMVectorMultiplyAdd(S11, V23, Sin); + + Cos = _mm_mul_ps(C1,V2); + Cos = _mm_add_ps(Cos,g_XMOne); + Cos = XMVectorMultiplyAdd(C2, V4, Cos); + Cos = XMVectorMultiplyAdd(C3, V6, Cos); + Cos = XMVectorMultiplyAdd(C4, V8, Cos); + Cos = XMVectorMultiplyAdd(C5, V10, Cos); + Cos = XMVectorMultiplyAdd(C6, V12, Cos); + Cos = XMVectorMultiplyAdd(C7, V14, Cos); + Cos = XMVectorMultiplyAdd(C8, V16, Cos); + Cos = XMVectorMultiplyAdd(C9, V18, Cos); + Cos = XMVectorMultiplyAdd(C10, V20, Cos); + Cos = XMVectorMultiplyAdd(C11, V22, Cos); + + *pSin = Sin; + *pCos = Cos; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorTan +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + // Cody and Waite algorithm to compute tangent. + + XMVECTOR VA, VB, VC, VC2; + XMVECTOR T0, T1, T2, T3, T4, T5, T6, T7; + XMVECTOR C0, C1, TwoDivPi, Epsilon; + XMVECTOR N, D; + XMVECTOR R0, R1; + XMVECTOR VIsZero, VCNearZero, VBIsEven; + XMVECTOR Zero; + XMVECTOR Result; + UINT i; + static CONST XMVECTOR TanCoefficients0 = {1.0f, -4.667168334e-1f, 2.566383229e-2f, -3.118153191e-4f}; + static CONST XMVECTOR TanCoefficients1 = {4.981943399e-7f, -1.333835001e-1f, 3.424887824e-3f, -1.786170734e-5f}; + static CONST XMVECTOR TanConstants = {1.570796371f, 6.077100628e-11f, 0.000244140625f, 2.0f / XM_PI}; + static CONST XMVECTORU32 Mask = {0x1, 0x1, 0x1, 0x1}; + + TwoDivPi = XMVectorSplatW(TanConstants); + + Zero = XMVectorZero(); + + C0 = XMVectorSplatX(TanConstants); + C1 = XMVectorSplatY(TanConstants); + Epsilon = XMVectorSplatZ(TanConstants); + + VA = XMVectorMultiply(V, TwoDivPi); + + VA = XMVectorRound(VA); + + VC = XMVectorNegativeMultiplySubtract(VA, C0, V); + + VB = XMVectorAbs(VA); + + VC = XMVectorNegativeMultiplySubtract(VA, C1, VC); + + for (i = 0; i < 4; i++) + { + VB.vector4_u32[i] = (UINT)VB.vector4_f32[i]; + } + + VC2 = XMVectorMultiply(VC, VC); + + T7 = XMVectorSplatW(TanCoefficients1); + T6 = XMVectorSplatZ(TanCoefficients1); + T4 = XMVectorSplatX(TanCoefficients1); + T3 = XMVectorSplatW(TanCoefficients0); + T5 = XMVectorSplatY(TanCoefficients1); + T2 = XMVectorSplatZ(TanCoefficients0); + T1 = XMVectorSplatY(TanCoefficients0); + T0 = XMVectorSplatX(TanCoefficients0); + + VBIsEven = XMVectorAndInt(VB, Mask.v); + VBIsEven = XMVectorEqualInt(VBIsEven, Zero); + + N = XMVectorMultiplyAdd(VC2, T7, T6); + D = XMVectorMultiplyAdd(VC2, T4, T3); + N = XMVectorMultiplyAdd(VC2, N, T5); + D = XMVectorMultiplyAdd(VC2, D, T2); + N = XMVectorMultiply(VC2, N); + D = XMVectorMultiplyAdd(VC2, D, T1); + N = XMVectorMultiplyAdd(VC, N, VC); + VCNearZero = XMVectorInBounds(VC, Epsilon); + D = XMVectorMultiplyAdd(VC2, D, T0); + + N = XMVectorSelect(N, VC, VCNearZero); + D = XMVectorSelect(D, g_XMOne.v, VCNearZero); + + R0 = XMVectorNegate(N); + R1 = XMVectorReciprocal(D); + R0 = XMVectorReciprocal(R0); + R1 = XMVectorMultiply(N, R1); + R0 = XMVectorMultiply(D, R0); + + VIsZero = XMVectorEqual(V, Zero); + + Result = XMVectorSelect(R0, R1, VBIsEven); + + Result = XMVectorSelect(Result, Zero, VIsZero); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Cody and Waite algorithm to compute tangent. + + XMVECTOR VA, VB, VC, VC2; + XMVECTOR T0, T1, T2, T3, T4, T5, T6, T7; + XMVECTOR C0, C1, TwoDivPi, Epsilon; + XMVECTOR N, D; + XMVECTOR R0, R1; + XMVECTOR VIsZero, VCNearZero, VBIsEven; + XMVECTOR Zero; + XMVECTOR Result; + static CONST XMVECTORF32 TanCoefficients0 = {1.0f, -4.667168334e-1f, 2.566383229e-2f, -3.118153191e-4f}; + static CONST XMVECTORF32 TanCoefficients1 = {4.981943399e-7f, -1.333835001e-1f, 3.424887824e-3f, -1.786170734e-5f}; + static CONST XMVECTORF32 TanConstants = {1.570796371f, 6.077100628e-11f, 0.000244140625f, 2.0f / XM_PI}; + static CONST XMVECTORI32 Mask = {0x1, 0x1, 0x1, 0x1}; + + TwoDivPi = XMVectorSplatW(TanConstants); + + Zero = XMVectorZero(); + + C0 = XMVectorSplatX(TanConstants); + C1 = XMVectorSplatY(TanConstants); + Epsilon = XMVectorSplatZ(TanConstants); + + VA = XMVectorMultiply(V, TwoDivPi); + + VA = XMVectorRound(VA); + + VC = XMVectorNegativeMultiplySubtract(VA, C0, V); + + VB = XMVectorAbs(VA); + + VC = XMVectorNegativeMultiplySubtract(VA, C1, VC); + + reinterpret_cast<__m128i *>(&VB)[0] = _mm_cvttps_epi32(VB); + + VC2 = XMVectorMultiply(VC, VC); + + T7 = XMVectorSplatW(TanCoefficients1); + T6 = XMVectorSplatZ(TanCoefficients1); + T4 = XMVectorSplatX(TanCoefficients1); + T3 = XMVectorSplatW(TanCoefficients0); + T5 = XMVectorSplatY(TanCoefficients1); + T2 = XMVectorSplatZ(TanCoefficients0); + T1 = XMVectorSplatY(TanCoefficients0); + T0 = XMVectorSplatX(TanCoefficients0); + + VBIsEven = XMVectorAndInt(VB,Mask); + VBIsEven = XMVectorEqualInt(VBIsEven, Zero); + + N = XMVectorMultiplyAdd(VC2, T7, T6); + D = XMVectorMultiplyAdd(VC2, T4, T3); + N = XMVectorMultiplyAdd(VC2, N, T5); + D = XMVectorMultiplyAdd(VC2, D, T2); + N = XMVectorMultiply(VC2, N); + D = XMVectorMultiplyAdd(VC2, D, T1); + N = XMVectorMultiplyAdd(VC, N, VC); + VCNearZero = XMVectorInBounds(VC, Epsilon); + D = XMVectorMultiplyAdd(VC2, D, T0); + + N = XMVectorSelect(N, VC, VCNearZero); + D = XMVectorSelect(D, g_XMOne, VCNearZero); + R0 = XMVectorNegate(N); + R1 = _mm_div_ps(N,D); + R0 = _mm_div_ps(D,R0); + VIsZero = XMVectorEqual(V, Zero); + Result = XMVectorSelect(R0, R1, VBIsEven); + Result = XMVectorSelect(Result, Zero, VIsZero); + + return Result; + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorSinH +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = XMVectorMultiplyAdd(V, Scale.v, g_XMNegativeOne.v); + V2 = XMVectorNegativeMultiplySubtract(V, Scale.v, g_XMNegativeOne.v); + + E1 = XMVectorExp(V1); + E2 = XMVectorExp(V2); + + Result = XMVectorSubtract(E1, E2); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = _mm_mul_ps(V, Scale); + V1 = _mm_add_ps(V1,g_XMNegativeOne); + V2 = _mm_mul_ps(V, Scale); + V2 = _mm_sub_ps(g_XMNegativeOne,V2); + E1 = XMVectorExp(V1); + E2 = XMVectorExp(V2); + + Result = _mm_sub_ps(E1, E2); + + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorCosH +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTOR Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = XMVectorMultiplyAdd(V, Scale, g_XMNegativeOne.v); + V2 = XMVectorNegativeMultiplySubtract(V, Scale, g_XMNegativeOne.v); + + E1 = XMVectorExp(V1); + E2 = XMVectorExp(V2); + + Result = XMVectorAdd(E1, E2); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = _mm_mul_ps(V,Scale); + V1 = _mm_add_ps(V1,g_XMNegativeOne); + V2 = _mm_mul_ps(V, Scale); + V2 = _mm_sub_ps(g_XMNegativeOne,V2); + E1 = XMVectorExp(V1); + E2 = XMVectorExp(V2); + Result = _mm_add_ps(E1, E2); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorTanH +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR E; + XMVECTOR Result; + static CONST XMVECTORF32 Scale = {2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f}; // 2.0f / ln(2.0f) + + E = XMVectorMultiply(V, Scale.v); + E = XMVectorExp(E); + E = XMVectorMultiplyAdd(E, g_XMOneHalf.v, g_XMOneHalf.v); + E = XMVectorReciprocal(E); + + Result = XMVectorSubtract(g_XMOne.v, E); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 Scale = {2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f}; // 2.0f / ln(2.0f) + + XMVECTOR E = _mm_mul_ps(V, Scale); + E = XMVectorExp(E); + E = _mm_mul_ps(E,g_XMOneHalf); + E = _mm_add_ps(E,g_XMOneHalf); + E = XMVectorReciprocal(E); + E = _mm_sub_ps(g_XMOne, E); + return E; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorASin +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V2, V3, AbsV; + XMVECTOR C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11; + XMVECTOR R0, R1, R2, R3, R4; + XMVECTOR OneMinusAbsV; + XMVECTOR Rsq; + XMVECTOR Result; + static CONST XMVECTOR OnePlusEpsilon = {1.00000011921f, 1.00000011921f, 1.00000011921f, 1.00000011921f}; + + // asin(V) = V * (C0 + C1 * V + C2 * V^2 + C3 * V^3 + C4 * V^4 + C5 * V^5) + (1 - V) * rsq(1 - V) * + // V * (C6 + C7 * V + C8 * V^2 + C9 * V^3 + C10 * V^4 + C11 * V^5) + + AbsV = XMVectorAbs(V); + + V2 = XMVectorMultiply(V, V); + V3 = XMVectorMultiply(V2, AbsV); + + R4 = XMVectorNegativeMultiplySubtract(AbsV, V, V); + + OneMinusAbsV = XMVectorSubtract(OnePlusEpsilon, AbsV); + Rsq = XMVectorReciprocalSqrt(OneMinusAbsV); + + C0 = XMVectorSplatX(g_XMASinCoefficients0.v); + C1 = XMVectorSplatY(g_XMASinCoefficients0.v); + C2 = XMVectorSplatZ(g_XMASinCoefficients0.v); + C3 = XMVectorSplatW(g_XMASinCoefficients0.v); + + C4 = XMVectorSplatX(g_XMASinCoefficients1.v); + C5 = XMVectorSplatY(g_XMASinCoefficients1.v); + C6 = XMVectorSplatZ(g_XMASinCoefficients1.v); + C7 = XMVectorSplatW(g_XMASinCoefficients1.v); + + C8 = XMVectorSplatX(g_XMASinCoefficients2.v); + C9 = XMVectorSplatY(g_XMASinCoefficients2.v); + C10 = XMVectorSplatZ(g_XMASinCoefficients2.v); + C11 = XMVectorSplatW(g_XMASinCoefficients2.v); + + R0 = XMVectorMultiplyAdd(C3, AbsV, C7); + R1 = XMVectorMultiplyAdd(C1, AbsV, C5); + R2 = XMVectorMultiplyAdd(C2, AbsV, C6); + R3 = XMVectorMultiplyAdd(C0, AbsV, C4); + + R0 = XMVectorMultiplyAdd(R0, AbsV, C11); + R1 = XMVectorMultiplyAdd(R1, AbsV, C9); + R2 = XMVectorMultiplyAdd(R2, AbsV, C10); + R3 = XMVectorMultiplyAdd(R3, AbsV, C8); + + R0 = XMVectorMultiplyAdd(R2, V3, R0); + R1 = XMVectorMultiplyAdd(R3, V3, R1); + + R0 = XMVectorMultiply(V, R0); + R1 = XMVectorMultiply(R4, R1); + + Result = XMVectorMultiplyAdd(R1, Rsq, R0); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 OnePlusEpsilon = {1.00000011921f, 1.00000011921f, 1.00000011921f, 1.00000011921f}; + + // asin(V) = V * (C0 + C1 * V + C2 * V^2 + C3 * V^3 + C4 * V^4 + C5 * V^5) + (1 - V) * rsq(1 - V) * + // V * (C6 + C7 * V + C8 * V^2 + C9 * V^3 + C10 * V^4 + C11 * V^5) + // Get abs(V) + XMVECTOR vAbsV = _mm_setzero_ps(); + vAbsV = _mm_sub_ps(vAbsV,V); + vAbsV = _mm_max_ps(vAbsV,V); + + XMVECTOR R0 = vAbsV; + XMVECTOR vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[3]); + R0 = _mm_mul_ps(R0,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[3]); + R0 = _mm_add_ps(R0,vConstants); + + XMVECTOR R1 = vAbsV; + vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[1]); + R1 = _mm_mul_ps(R1,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[1]); + R1 = _mm_add_ps(R1, vConstants); + + XMVECTOR R2 = vAbsV; + vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[2]); + R2 = _mm_mul_ps(R2,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[2]); + R2 = _mm_add_ps(R2, vConstants); + + XMVECTOR R3 = vAbsV; + vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[0]); + R3 = _mm_mul_ps(R3,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[0]); + R3 = _mm_add_ps(R3, vConstants); + + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[3]); + R0 = _mm_mul_ps(R0,vAbsV); + R0 = _mm_add_ps(R0,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[1]); + R1 = _mm_mul_ps(R1,vAbsV); + R1 = _mm_add_ps(R1,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[2]); + R2 = _mm_mul_ps(R2,vAbsV); + R2 = _mm_add_ps(R2,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[0]); + R3 = _mm_mul_ps(R3,vAbsV); + R3 = _mm_add_ps(R3,vConstants); + + // V3 = V^3 + vConstants = _mm_mul_ps(V,V); + vConstants = _mm_mul_ps(vConstants, vAbsV); + // Mul by V^3 + R2 = _mm_mul_ps(R2,vConstants); + R3 = _mm_mul_ps(R3,vConstants); + // Merge the results + R0 = _mm_add_ps(R0,R2); + R1 = _mm_add_ps(R1,R3); + + R0 = _mm_mul_ps(R0,V); + // vConstants = V-(V^2 retaining sign) + vConstants = _mm_mul_ps(vAbsV, V); + vConstants = _mm_sub_ps(V,vConstants); + R1 = _mm_mul_ps(R1,vConstants); + vConstants = _mm_sub_ps(OnePlusEpsilon,vAbsV); + // Do NOT use rsqrt/mul. This needs the precision + vConstants = _mm_sqrt_ps(vConstants); + R1 = _mm_div_ps(R1,vConstants); + R0 = _mm_add_ps(R0,R1); + return R0; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorACos +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V2, V3, AbsV; + XMVECTOR C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11; + XMVECTOR R0, R1, R2, R3, R4; + XMVECTOR OneMinusAbsV; + XMVECTOR Rsq; + XMVECTOR Result; + static CONST XMVECTOR OnePlusEpsilon = {1.00000011921f, 1.00000011921f, 1.00000011921f, 1.00000011921f}; + + // acos(V) = PI / 2 - asin(V) + + AbsV = XMVectorAbs(V); + + V2 = XMVectorMultiply(V, V); + V3 = XMVectorMultiply(V2, AbsV); + + R4 = XMVectorNegativeMultiplySubtract(AbsV, V, V); + + OneMinusAbsV = XMVectorSubtract(OnePlusEpsilon, AbsV); + Rsq = XMVectorReciprocalSqrt(OneMinusAbsV); + + C0 = XMVectorSplatX(g_XMASinCoefficients0.v); + C1 = XMVectorSplatY(g_XMASinCoefficients0.v); + C2 = XMVectorSplatZ(g_XMASinCoefficients0.v); + C3 = XMVectorSplatW(g_XMASinCoefficients0.v); + + C4 = XMVectorSplatX(g_XMASinCoefficients1.v); + C5 = XMVectorSplatY(g_XMASinCoefficients1.v); + C6 = XMVectorSplatZ(g_XMASinCoefficients1.v); + C7 = XMVectorSplatW(g_XMASinCoefficients1.v); + + C8 = XMVectorSplatX(g_XMASinCoefficients2.v); + C9 = XMVectorSplatY(g_XMASinCoefficients2.v); + C10 = XMVectorSplatZ(g_XMASinCoefficients2.v); + C11 = XMVectorSplatW(g_XMASinCoefficients2.v); + + R0 = XMVectorMultiplyAdd(C3, AbsV, C7); + R1 = XMVectorMultiplyAdd(C1, AbsV, C5); + R2 = XMVectorMultiplyAdd(C2, AbsV, C6); + R3 = XMVectorMultiplyAdd(C0, AbsV, C4); + + R0 = XMVectorMultiplyAdd(R0, AbsV, C11); + R1 = XMVectorMultiplyAdd(R1, AbsV, C9); + R2 = XMVectorMultiplyAdd(R2, AbsV, C10); + R3 = XMVectorMultiplyAdd(R3, AbsV, C8); + + R0 = XMVectorMultiplyAdd(R2, V3, R0); + R1 = XMVectorMultiplyAdd(R3, V3, R1); + + R0 = XMVectorMultiply(V, R0); + R1 = XMVectorMultiply(R4, R1); + + Result = XMVectorMultiplyAdd(R1, Rsq, R0); + + Result = XMVectorSubtract(g_XMHalfPi.v, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 OnePlusEpsilon = {1.00000011921f, 1.00000011921f, 1.00000011921f, 1.00000011921f}; + // Uses only 6 registers for good code on x86 targets + // acos(V) = PI / 2 - asin(V) + // Get abs(V) + XMVECTOR vAbsV = _mm_setzero_ps(); + vAbsV = _mm_sub_ps(vAbsV,V); + vAbsV = _mm_max_ps(vAbsV,V); + // Perform the series in precision groups to + // retain precision across 20 bits. (3 bits of imprecision due to operations) + XMVECTOR R0 = vAbsV; + XMVECTOR vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[3]); + R0 = _mm_mul_ps(R0,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[3]); + R0 = _mm_add_ps(R0,vConstants); + R0 = _mm_mul_ps(R0,vAbsV); + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[3]); + R0 = _mm_add_ps(R0,vConstants); + + XMVECTOR R1 = vAbsV; + vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[1]); + R1 = _mm_mul_ps(R1,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[1]); + R1 = _mm_add_ps(R1,vConstants); + R1 = _mm_mul_ps(R1, vAbsV); + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[1]); + R1 = _mm_add_ps(R1,vConstants); + + XMVECTOR R2 = vAbsV; + vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[2]); + R2 = _mm_mul_ps(R2,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[2]); + R2 = _mm_add_ps(R2,vConstants); + R2 = _mm_mul_ps(R2, vAbsV); + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[2]); + R2 = _mm_add_ps(R2,vConstants); + + XMVECTOR R3 = vAbsV; + vConstants = _mm_load_ps1(&g_XMASinCoefficients0.f[0]); + R3 = _mm_mul_ps(R3,vConstants); + vConstants = _mm_load_ps1(&g_XMASinCoefficients1.f[0]); + R3 = _mm_add_ps(R3,vConstants); + R3 = _mm_mul_ps(R3, vAbsV); + vConstants = _mm_load_ps1(&g_XMASinCoefficients2.f[0]); + R3 = _mm_add_ps(R3,vConstants); + + // vConstants = V^3 + vConstants = _mm_mul_ps(V,V); + vConstants = _mm_mul_ps(vConstants,vAbsV); + R2 = _mm_mul_ps(R2,vConstants); + R3 = _mm_mul_ps(R3,vConstants); + // Add the pair of values together here to retain + // as much precision as possible + R0 = _mm_add_ps(R0,R2); + R1 = _mm_add_ps(R1,R3); + + R0 = _mm_mul_ps(R0,V); + // vConstants = V-(V*abs(V)) + vConstants = _mm_mul_ps(V,vAbsV); + vConstants = _mm_sub_ps(V,vConstants); + R1 = _mm_mul_ps(R1,vConstants); + // Episilon exists to allow 1.0 as an answer + vConstants = _mm_sub_ps(OnePlusEpsilon, vAbsV); + // Use sqrt instead of rsqrt for precision + vConstants = _mm_sqrt_ps(vConstants); + R1 = _mm_div_ps(R1,vConstants); + R1 = _mm_add_ps(R1,R0); + vConstants = _mm_sub_ps(g_XMHalfPi,R1); + return vConstants; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorATan +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + // Cody and Waite algorithm to compute inverse tangent. + + XMVECTOR N, D; + XMVECTOR VF, G, ReciprocalF, AbsF, FA, FB; + XMVECTOR Sqrt3, Sqrt3MinusOne, TwoMinusSqrt3; + XMVECTOR HalfPi, OneThirdPi, OneSixthPi, Epsilon, MinV, MaxV; + XMVECTOR Zero; + XMVECTOR NegativeHalfPi; + XMVECTOR Angle1, Angle2; + XMVECTOR F_GT_One, F_GT_TwoMinusSqrt3, AbsF_LT_Epsilon, V_LT_Zero, V_GT_MaxV, V_LT_MinV; + XMVECTOR NegativeResult, Result; + XMVECTOR P0, P1, P2, P3, Q0, Q1, Q2, Q3; + static CONST XMVECTOR ATanConstants0 = {-1.3688768894e+1f, -2.0505855195e+1f, -8.4946240351f, -8.3758299368e-1f}; + static CONST XMVECTOR ATanConstants1 = {4.1066306682e+1f, 8.6157349597e+1f, 5.9578436142e+1f, 1.5024001160e+1f}; + static CONST XMVECTOR ATanConstants2 = {1.732050808f, 7.320508076e-1f, 2.679491924e-1f, 0.000244140625f}; // + static CONST XMVECTOR ATanConstants3 = {XM_PIDIV2, XM_PI / 3.0f, XM_PI / 6.0f, 8.507059173e+37f}; // + + Zero = XMVectorZero(); + + P0 = XMVectorSplatX(ATanConstants0); + P1 = XMVectorSplatY(ATanConstants0); + P2 = XMVectorSplatZ(ATanConstants0); + P3 = XMVectorSplatW(ATanConstants0); + + Q0 = XMVectorSplatX(ATanConstants1); + Q1 = XMVectorSplatY(ATanConstants1); + Q2 = XMVectorSplatZ(ATanConstants1); + Q3 = XMVectorSplatW(ATanConstants1); + + Sqrt3 = XMVectorSplatX(ATanConstants2); + Sqrt3MinusOne = XMVectorSplatY(ATanConstants2); + TwoMinusSqrt3 = XMVectorSplatZ(ATanConstants2); + Epsilon = XMVectorSplatW(ATanConstants2); + + HalfPi = XMVectorSplatX(ATanConstants3); + OneThirdPi = XMVectorSplatY(ATanConstants3); + OneSixthPi = XMVectorSplatZ(ATanConstants3); + MaxV = XMVectorSplatW(ATanConstants3); + + VF = XMVectorAbs(V); + ReciprocalF = XMVectorReciprocal(VF); + + F_GT_One = XMVectorGreater(VF, g_XMOne.v); + + VF = XMVectorSelect(VF, ReciprocalF, F_GT_One); + Angle1 = XMVectorSelect(Zero, HalfPi, F_GT_One); + Angle2 = XMVectorSelect(OneSixthPi, OneThirdPi, F_GT_One); + + F_GT_TwoMinusSqrt3 = XMVectorGreater(VF, TwoMinusSqrt3); + + FA = XMVectorMultiplyAdd(Sqrt3MinusOne, VF, VF); + FA = XMVectorAdd(FA, g_XMNegativeOne.v); + FB = XMVectorAdd(VF, Sqrt3); + FB = XMVectorReciprocal(FB); + FA = XMVectorMultiply(FA, FB); + + VF = XMVectorSelect(VF, FA, F_GT_TwoMinusSqrt3); + Angle1 = XMVectorSelect(Angle1, Angle2, F_GT_TwoMinusSqrt3); + + AbsF = XMVectorAbs(VF); + AbsF_LT_Epsilon = XMVectorLess(AbsF, Epsilon); + + G = XMVectorMultiply(VF, VF); + + D = XMVectorAdd(G, Q3); + D = XMVectorMultiplyAdd(D, G, Q2); + D = XMVectorMultiplyAdd(D, G, Q1); + D = XMVectorMultiplyAdd(D, G, Q0); + D = XMVectorReciprocal(D); + + N = XMVectorMultiplyAdd(P3, G, P2); + N = XMVectorMultiplyAdd(N, G, P1); + N = XMVectorMultiplyAdd(N, G, P0); + N = XMVectorMultiply(N, G); + Result = XMVectorMultiply(N, D); + + Result = XMVectorMultiplyAdd(Result, VF, VF); + + Result = XMVectorSelect(Result, VF, AbsF_LT_Epsilon); + + NegativeResult = XMVectorNegate(Result); + Result = XMVectorSelect(Result, NegativeResult, F_GT_One); + + Result = XMVectorAdd(Result, Angle1); + + V_LT_Zero = XMVectorLess(V, Zero); + NegativeResult = XMVectorNegate(Result); + Result = XMVectorSelect(Result, NegativeResult, V_LT_Zero); + + MinV = XMVectorNegate(MaxV); + NegativeHalfPi = XMVectorNegate(HalfPi); + V_GT_MaxV = XMVectorGreater(V, MaxV); + V_LT_MinV = XMVectorLess(V, MinV); + Result = XMVectorSelect(Result, g_XMHalfPi.v, V_GT_MaxV); + Result = XMVectorSelect(Result, NegativeHalfPi, V_LT_MinV); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 ATanConstants0 = {-1.3688768894e+1f, -2.0505855195e+1f, -8.4946240351f, -8.3758299368e-1f}; + static CONST XMVECTORF32 ATanConstants1 = {4.1066306682e+1f, 8.6157349597e+1f, 5.9578436142e+1f, 1.5024001160e+1f}; + static CONST XMVECTORF32 ATanConstants2 = {1.732050808f, 7.320508076e-1f, 2.679491924e-1f, 0.000244140625f}; // + static CONST XMVECTORF32 ATanConstants3 = {XM_PIDIV2, XM_PI / 3.0f, XM_PI / 6.0f, 8.507059173e+37f}; // + + XMVECTOR VF = XMVectorAbs(V); + XMVECTOR F_GT_One = _mm_cmpgt_ps(VF,g_XMOne); + XMVECTOR ReciprocalF = XMVectorReciprocal(VF); + VF = XMVectorSelect(VF, ReciprocalF, F_GT_One); + XMVECTOR Zero = XMVectorZero(); + XMVECTOR HalfPi = _mm_load_ps1(&ATanConstants3.f[0]); + XMVECTOR Angle1 = XMVectorSelect(Zero, HalfPi, F_GT_One); + // Pi/3 + XMVECTOR vConstants = _mm_load_ps1(&ATanConstants3.f[1]); + // Pi/6 + XMVECTOR Angle2 = _mm_load_ps1(&ATanConstants3.f[2]); + Angle2 = XMVectorSelect(Angle2, vConstants, F_GT_One); + + // 1-sqrt(3) + XMVECTOR FA = _mm_load_ps1(&ATanConstants2.f[1]); + FA = _mm_mul_ps(FA,VF); + FA = _mm_add_ps(FA,VF); + FA = _mm_add_ps(FA,g_XMNegativeOne); + // sqrt(3) + vConstants = _mm_load_ps1(&ATanConstants2.f[0]); + vConstants = _mm_add_ps(vConstants,VF); + FA = _mm_div_ps(FA,vConstants); + + // 2-sqrt(3) + vConstants = _mm_load_ps1(&ATanConstants2.f[2]); + // >2-sqrt(3)? + vConstants = _mm_cmpgt_ps(VF,vConstants); + VF = XMVectorSelect(VF, FA, vConstants); + Angle1 = XMVectorSelect(Angle1, Angle2, vConstants); + + XMVECTOR AbsF = XMVectorAbs(VF); + + XMVECTOR G = _mm_mul_ps(VF,VF); + XMVECTOR D = _mm_load_ps1(&ATanConstants1.f[3]); + D = _mm_add_ps(D,G); + D = _mm_mul_ps(D,G); + vConstants = _mm_load_ps1(&ATanConstants1.f[2]); + D = _mm_add_ps(D,vConstants); + D = _mm_mul_ps(D,G); + vConstants = _mm_load_ps1(&ATanConstants1.f[1]); + D = _mm_add_ps(D,vConstants); + D = _mm_mul_ps(D,G); + vConstants = _mm_load_ps1(&ATanConstants1.f[0]); + D = _mm_add_ps(D,vConstants); + + XMVECTOR N = _mm_load_ps1(&ATanConstants0.f[3]); + N = _mm_mul_ps(N,G); + vConstants = _mm_load_ps1(&ATanConstants0.f[2]); + N = _mm_add_ps(N,vConstants); + N = _mm_mul_ps(N,G); + vConstants = _mm_load_ps1(&ATanConstants0.f[1]); + N = _mm_add_ps(N,vConstants); + N = _mm_mul_ps(N,G); + vConstants = _mm_load_ps1(&ATanConstants0.f[0]); + N = _mm_add_ps(N,vConstants); + N = _mm_mul_ps(N,G); + XMVECTOR Result = _mm_div_ps(N,D); + + Result = _mm_mul_ps(Result,VF); + Result = _mm_add_ps(Result,VF); + // Epsilon + vConstants = _mm_load_ps1(&ATanConstants2.f[3]); + vConstants = _mm_cmpge_ps(vConstants,AbsF); + Result = XMVectorSelect(Result,VF,vConstants); + + XMVECTOR NegativeResult = _mm_mul_ps(Result,g_XMNegativeOne); + Result = XMVectorSelect(Result,NegativeResult,F_GT_One); + Result = _mm_add_ps(Result,Angle1); + + Zero = _mm_cmpge_ps(Zero,V); + NegativeResult = _mm_mul_ps(Result,g_XMNegativeOne); + Result = XMVectorSelect(Result,NegativeResult,Zero); + + XMVECTOR MaxV = _mm_load_ps1(&ATanConstants3.f[3]); + XMVECTOR MinV = _mm_mul_ps(MaxV,g_XMNegativeOne); + // Negate HalfPi + HalfPi = _mm_mul_ps(HalfPi,g_XMNegativeOne); + MaxV = _mm_cmple_ps(MaxV,V); + MinV = _mm_cmpge_ps(MinV,V); + Result = XMVectorSelect(Result,g_XMHalfPi,MaxV); + // HalfPi = -HalfPi + Result = XMVectorSelect(Result,HalfPi,MinV); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVectorATan2 +( + FXMVECTOR Y, + FXMVECTOR X +) +{ +#if defined(_XM_NO_INTRINSICS_) + + // Return the inverse tangent of Y / X in the range of -Pi to Pi with the following exceptions: + + // Y == 0 and X is Negative -> Pi with the sign of Y + // y == 0 and x is positive -> 0 with the sign of y + // Y != 0 and X == 0 -> Pi / 2 with the sign of Y + // Y != 0 and X is Negative -> atan(y/x) + (PI with the sign of Y) + // X == -Infinity and Finite Y -> Pi with the sign of Y + // X == +Infinity and Finite Y -> 0 with the sign of Y + // Y == Infinity and X is Finite -> Pi / 2 with the sign of Y + // Y == Infinity and X == -Infinity -> 3Pi / 4 with the sign of Y + // Y == Infinity and X == +Infinity -> Pi / 4 with the sign of Y + + XMVECTOR Reciprocal; + XMVECTOR V; + XMVECTOR YSign; + XMVECTOR Pi, PiOverTwo, PiOverFour, ThreePiOverFour; + XMVECTOR YEqualsZero, XEqualsZero, XIsPositive, YEqualsInfinity, XEqualsInfinity; + XMVECTOR ATanResultValid; + XMVECTOR R0, R1, R2, R3, R4, R5; + XMVECTOR Zero; + XMVECTOR Result; + static CONST XMVECTOR ATan2Constants = {XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f}; + + Zero = XMVectorZero(); + ATanResultValid = XMVectorTrueInt(); + + Pi = XMVectorSplatX(ATan2Constants); + PiOverTwo = XMVectorSplatY(ATan2Constants); + PiOverFour = XMVectorSplatZ(ATan2Constants); + ThreePiOverFour = XMVectorSplatW(ATan2Constants); + + YEqualsZero = XMVectorEqual(Y, Zero); + XEqualsZero = XMVectorEqual(X, Zero); + XIsPositive = XMVectorAndInt(X, g_XMNegativeZero.v); + XIsPositive = XMVectorEqualInt(XIsPositive, Zero); + YEqualsInfinity = XMVectorIsInfinite(Y); + XEqualsInfinity = XMVectorIsInfinite(X); + + YSign = XMVectorAndInt(Y, g_XMNegativeZero.v); + Pi = XMVectorOrInt(Pi, YSign); + PiOverTwo = XMVectorOrInt(PiOverTwo, YSign); + PiOverFour = XMVectorOrInt(PiOverFour, YSign); + ThreePiOverFour = XMVectorOrInt(ThreePiOverFour, YSign); + + R1 = XMVectorSelect(Pi, YSign, XIsPositive); + R2 = XMVectorSelect(ATanResultValid, PiOverTwo, XEqualsZero); + R3 = XMVectorSelect(R2, R1, YEqualsZero); + R4 = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive); + R5 = XMVectorSelect(PiOverTwo, R4, XEqualsInfinity); + Result = XMVectorSelect(R3, R5, YEqualsInfinity); + ATanResultValid = XMVectorEqualInt(Result, ATanResultValid); + + Reciprocal = XMVectorReciprocal(X); + V = XMVectorMultiply(Y, Reciprocal); + R0 = XMVectorATan(V); + + R1 = XMVectorSelect( Pi, Zero, XIsPositive ); + R2 = XMVectorAdd(R0, R1); + + Result = XMVectorSelect(Result, R2, ATanResultValid); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 ATan2Constants = {XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f}; + + // Mask if Y>0 && Y!=INF + XMVECTOR YEqualsInfinity = XMVectorIsInfinite(Y); + // Get the sign of (Y&0x80000000) + XMVECTOR YSign = _mm_and_ps(Y, g_XMNegativeZero); + // Get the sign bits of X + XMVECTOR XIsPositive = _mm_and_ps(X,g_XMNegativeZero); + // Change them to masks + XIsPositive = XMVectorEqualInt(XIsPositive,g_XMZero); + // Get Pi + XMVECTOR Pi = _mm_load_ps1(&ATan2Constants.f[0]); + // Copy the sign of Y + Pi = _mm_or_ps(Pi,YSign); + XMVECTOR R1 = XMVectorSelect(Pi,YSign,XIsPositive); + // Mask for X==0 + XMVECTOR vConstants = _mm_cmpeq_ps(X,g_XMZero); + // Get Pi/2 with with sign of Y + XMVECTOR PiOverTwo = _mm_load_ps1(&ATan2Constants.f[1]); + PiOverTwo = _mm_or_ps(PiOverTwo,YSign); + XMVECTOR R2 = XMVectorSelect(g_XMNegOneMask,PiOverTwo,vConstants); + // Mask for Y==0 + vConstants = _mm_cmpeq_ps(Y,g_XMZero); + R2 = XMVectorSelect(R2,R1,vConstants); + // Get Pi/4 with sign of Y + XMVECTOR PiOverFour = _mm_load_ps1(&ATan2Constants.f[2]); + PiOverFour = _mm_or_ps(PiOverFour,YSign); + // Get (Pi*3)/4 with sign of Y + XMVECTOR ThreePiOverFour = _mm_load_ps1(&ATan2Constants.f[3]); + ThreePiOverFour = _mm_or_ps(ThreePiOverFour,YSign); + vConstants = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive); + XMVECTOR XEqualsInfinity = XMVectorIsInfinite(X); + vConstants = XMVectorSelect(PiOverTwo,vConstants,XEqualsInfinity); + + XMVECTOR vResult = XMVectorSelect(R2,vConstants,YEqualsInfinity); + vConstants = XMVectorSelect(R1,vResult,YEqualsInfinity); + // At this point, any entry that's zero will get the result + // from XMVectorATan(), otherwise, return the failsafe value + vResult = XMVectorSelect(vResult,vConstants,XEqualsInfinity); + // Any entries not 0xFFFFFFFF, are considered precalculated + XMVECTOR ATanResultValid = XMVectorEqualInt(vResult,g_XMNegOneMask); + // Let's do the ATan2 function + vConstants = _mm_div_ps(Y,X); + vConstants = XMVectorATan(vConstants); + // Discard entries that have been declared void + + XMVECTOR R3 = XMVectorSelect( Pi, g_XMZero, XIsPositive ); + vConstants = _mm_add_ps( vConstants, R3 ); + + vResult = XMVectorSelect(vResult,vConstants,ATanResultValid); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSinEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V2, V3, V5, V7; + XMVECTOR S1, S2, S3; + XMVECTOR Result; + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI) + V2 = XMVectorMultiply(V, V); + V3 = XMVectorMultiply(V2, V); + V5 = XMVectorMultiply(V3, V2); + V7 = XMVectorMultiply(V5, V2); + + S1 = XMVectorSplatY(g_XMSinEstCoefficients.v); + S2 = XMVectorSplatZ(g_XMSinEstCoefficients.v); + S3 = XMVectorSplatW(g_XMSinEstCoefficients.v); + + Result = XMVectorMultiplyAdd(S1, V3, V); + Result = XMVectorMultiplyAdd(S2, V5, Result); + Result = XMVectorMultiplyAdd(S3, V7, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI) + XMVECTOR V2 = _mm_mul_ps(V,V); + XMVECTOR V3 = _mm_mul_ps(V2,V); + XMVECTOR vResult = _mm_load_ps1(&g_XMSinEstCoefficients.f[1]); + vResult = _mm_mul_ps(vResult,V3); + vResult = _mm_add_ps(vResult,V); + XMVECTOR vConstants = _mm_load_ps1(&g_XMSinEstCoefficients.f[2]); + // V^5 + V3 = _mm_mul_ps(V3,V2); + vConstants = _mm_mul_ps(vConstants,V3); + vResult = _mm_add_ps(vResult,vConstants); + vConstants = _mm_load_ps1(&g_XMSinEstCoefficients.f[3]); + // V^7 + V3 = _mm_mul_ps(V3,V2); + vConstants = _mm_mul_ps(vConstants,V3); + vResult = _mm_add_ps(vResult,vConstants); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorCosEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V2, V4, V6; + XMVECTOR C0, C1, C2, C3; + XMVECTOR Result; + + V2 = XMVectorMultiply(V, V); + V4 = XMVectorMultiply(V2, V2); + V6 = XMVectorMultiply(V4, V2); + + C0 = XMVectorSplatX(g_XMCosEstCoefficients.v); + C1 = XMVectorSplatY(g_XMCosEstCoefficients.v); + C2 = XMVectorSplatZ(g_XMCosEstCoefficients.v); + C3 = XMVectorSplatW(g_XMCosEstCoefficients.v); + + Result = XMVectorMultiplyAdd(C1, V2, C0); + Result = XMVectorMultiplyAdd(C2, V4, Result); + Result = XMVectorMultiplyAdd(C3, V6, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Get V^2 + XMVECTOR V2 = _mm_mul_ps(V,V); + XMVECTOR vResult = _mm_load_ps1(&g_XMCosEstCoefficients.f[1]); + vResult = _mm_mul_ps(vResult,V2); + XMVECTOR vConstants = _mm_load_ps1(&g_XMCosEstCoefficients.f[0]); + vResult = _mm_add_ps(vResult,vConstants); + vConstants = _mm_load_ps1(&g_XMCosEstCoefficients.f[2]); + // Get V^4 + XMVECTOR V4 = _mm_mul_ps(V2, V2); + vConstants = _mm_mul_ps(vConstants,V4); + vResult = _mm_add_ps(vResult,vConstants); + vConstants = _mm_load_ps1(&g_XMCosEstCoefficients.f[3]); + // It's really V^6 + V4 = _mm_mul_ps(V4,V2); + vConstants = _mm_mul_ps(vConstants,V4); + vResult = _mm_add_ps(vResult,vConstants); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMVectorSinCosEst +( + XMVECTOR* pSin, + XMVECTOR* pCos, + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V2, V3, V4, V5, V6, V7; + XMVECTOR S1, S2, S3; + XMVECTOR C0, C1, C2, C3; + XMVECTOR Sin, Cos; + + XMASSERT(pSin); + XMASSERT(pCos); + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI) + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! (for -PI <= V < PI) + V2 = XMVectorMultiply(V, V); + V3 = XMVectorMultiply(V2, V); + V4 = XMVectorMultiply(V2, V2); + V5 = XMVectorMultiply(V3, V2); + V6 = XMVectorMultiply(V3, V3); + V7 = XMVectorMultiply(V4, V3); + + S1 = XMVectorSplatY(g_XMSinEstCoefficients.v); + S2 = XMVectorSplatZ(g_XMSinEstCoefficients.v); + S3 = XMVectorSplatW(g_XMSinEstCoefficients.v); + + C0 = XMVectorSplatX(g_XMCosEstCoefficients.v); + C1 = XMVectorSplatY(g_XMCosEstCoefficients.v); + C2 = XMVectorSplatZ(g_XMCosEstCoefficients.v); + C3 = XMVectorSplatW(g_XMCosEstCoefficients.v); + + Sin = XMVectorMultiplyAdd(S1, V3, V); + Sin = XMVectorMultiplyAdd(S2, V5, Sin); + Sin = XMVectorMultiplyAdd(S3, V7, Sin); + + Cos = XMVectorMultiplyAdd(C1, V2, C0); + Cos = XMVectorMultiplyAdd(C2, V4, Cos); + Cos = XMVectorMultiplyAdd(C3, V6, Cos); + + *pSin = Sin; + *pCos = Cos; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pSin); + XMASSERT(pCos); + XMVECTOR V2, V3, V4, V5, V6, V7; + XMVECTOR S1, S2, S3; + XMVECTOR C0, C1, C2, C3; + XMVECTOR Sin, Cos; + + // sin(V) ~= V - V^3 / 3! + V^5 / 5! - V^7 / 7! (for -PI <= V < PI) + // cos(V) ~= 1 - V^2 / 2! + V^4 / 4! - V^6 / 6! (for -PI <= V < PI) + V2 = XMVectorMultiply(V, V); + V3 = XMVectorMultiply(V2, V); + V4 = XMVectorMultiply(V2, V2); + V5 = XMVectorMultiply(V3, V2); + V6 = XMVectorMultiply(V3, V3); + V7 = XMVectorMultiply(V4, V3); + + S1 = _mm_load_ps1(&g_XMSinEstCoefficients.f[1]); + S2 = _mm_load_ps1(&g_XMSinEstCoefficients.f[2]); + S3 = _mm_load_ps1(&g_XMSinEstCoefficients.f[3]); + + C0 = _mm_load_ps1(&g_XMCosEstCoefficients.f[0]); + C1 = _mm_load_ps1(&g_XMCosEstCoefficients.f[1]); + C2 = _mm_load_ps1(&g_XMCosEstCoefficients.f[2]); + C3 = _mm_load_ps1(&g_XMCosEstCoefficients.f[3]); + + Sin = XMVectorMultiplyAdd(S1, V3, V); + Sin = XMVectorMultiplyAdd(S2, V5, Sin); + Sin = XMVectorMultiplyAdd(S3, V7, Sin); + + Cos = XMVectorMultiplyAdd(C1, V2, C0); + Cos = XMVectorMultiplyAdd(C2, V4, Cos); + Cos = XMVectorMultiplyAdd(C3, V6, Cos); + + *pSin = Sin; + *pCos = Cos; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorTanEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2, V1T0, V1T1, V2T2; + XMVECTOR T0, T1, T2; + XMVECTOR N, D; + XMVECTOR OneOverPi; + XMVECTOR Result; + + OneOverPi = XMVectorSplatW(g_XMTanEstCoefficients.v); + + V1 = XMVectorMultiply(V, OneOverPi); + V1 = XMVectorRound(V1); + + V1 = XMVectorNegativeMultiplySubtract(g_XMPi.v, V1, V); + + T0 = XMVectorSplatX(g_XMTanEstCoefficients.v); + T1 = XMVectorSplatY(g_XMTanEstCoefficients.v); + T2 = XMVectorSplatZ(g_XMTanEstCoefficients.v); + + V2T2 = XMVectorNegativeMultiplySubtract(V1, V1, T2); + V2 = XMVectorMultiply(V1, V1); + V1T0 = XMVectorMultiply(V1, T0); + V1T1 = XMVectorMultiply(V1, T1); + + D = XMVectorReciprocalEst(V2T2); + N = XMVectorMultiplyAdd(V2, V1T1, V1T0); + + Result = XMVectorMultiply(N, D); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1, V2, V1T0, V1T1, V2T2; + XMVECTOR T0, T1, T2; + XMVECTOR N, D; + XMVECTOR OneOverPi; + XMVECTOR Result; + + OneOverPi = XMVectorSplatW(g_XMTanEstCoefficients); + + V1 = XMVectorMultiply(V, OneOverPi); + V1 = XMVectorRound(V1); + + V1 = XMVectorNegativeMultiplySubtract(g_XMPi, V1, V); + + T0 = XMVectorSplatX(g_XMTanEstCoefficients); + T1 = XMVectorSplatY(g_XMTanEstCoefficients); + T2 = XMVectorSplatZ(g_XMTanEstCoefficients); + + V2T2 = XMVectorNegativeMultiplySubtract(V1, V1, T2); + V2 = XMVectorMultiply(V1, V1); + V1T0 = XMVectorMultiply(V1, T0); + V1T1 = XMVectorMultiply(V1, T1); + + D = XMVectorReciprocalEst(V2T2); + N = XMVectorMultiplyAdd(V2, V1T1, V1T0); + + Result = XMVectorMultiply(N, D); + + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorSinHEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = XMVectorMultiplyAdd(V, Scale.v, g_XMNegativeOne.v); + V2 = XMVectorNegativeMultiplySubtract(V, Scale.v, g_XMNegativeOne.v); + + E1 = XMVectorExpEst(V1); + E2 = XMVectorExpEst(V2); + + Result = XMVectorSubtract(E1, E2); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = _mm_mul_ps(V,Scale); + V1 = _mm_add_ps(V1,g_XMNegativeOne); + V2 = _mm_mul_ps(V,Scale); + V2 = _mm_sub_ps(g_XMNegativeOne,V2); + E1 = XMVectorExpEst(V1); + E2 = XMVectorExpEst(V2); + Result = _mm_sub_ps(E1, E2); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorCosHEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTOR Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = XMVectorMultiplyAdd(V, Scale, g_XMNegativeOne.v); + V2 = XMVectorNegativeMultiplySubtract(V, Scale, g_XMNegativeOne.v); + + E1 = XMVectorExpEst(V1); + E2 = XMVectorExpEst(V2); + + Result = XMVectorAdd(E1, E2); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1, V2; + XMVECTOR E1, E2; + XMVECTOR Result; + static CONST XMVECTORF32 Scale = {1.442695040888963f, 1.442695040888963f, 1.442695040888963f, 1.442695040888963f}; // 1.0f / ln(2.0f) + + V1 = _mm_mul_ps(V,Scale); + V1 = _mm_add_ps(V1,g_XMNegativeOne); + V2 = _mm_mul_ps(V, Scale); + V2 = _mm_sub_ps(g_XMNegativeOne,V2); + E1 = XMVectorExpEst(V1); + E2 = XMVectorExpEst(V2); + Result = _mm_add_ps(E1, E2); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorTanHEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR E; + XMVECTOR Result; + static CONST XMVECTOR Scale = {2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f}; // 2.0f / ln(2.0f) + + E = XMVectorMultiply(V, Scale); + E = XMVectorExpEst(E); + E = XMVectorMultiplyAdd(E, g_XMOneHalf.v, g_XMOneHalf.v); + E = XMVectorReciprocalEst(E); + + Result = XMVectorSubtract(g_XMOne.v, E); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 Scale = {2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f, 2.8853900817779268f}; // 2.0f / ln(2.0f) + + XMVECTOR E = _mm_mul_ps(V, Scale); + E = XMVectorExpEst(E); + E = _mm_mul_ps(E,g_XMOneHalf); + E = _mm_add_ps(E,g_XMOneHalf); + E = XMVectorReciprocalEst(E); + E = _mm_sub_ps(g_XMOne, E); + return E; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorASinEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR AbsV, V2, VD, VC0, V2C3; + XMVECTOR C0, C1, C2, C3; + XMVECTOR D, Rsq, SqrtD; + XMVECTOR OnePlusEps; + XMVECTOR Result; + + AbsV = XMVectorAbs(V); + + OnePlusEps = XMVectorSplatX(g_XMASinEstConstants.v); + + C0 = XMVectorSplatX(g_XMASinEstCoefficients.v); + C1 = XMVectorSplatY(g_XMASinEstCoefficients.v); + C2 = XMVectorSplatZ(g_XMASinEstCoefficients.v); + C3 = XMVectorSplatW(g_XMASinEstCoefficients.v); + + D = XMVectorSubtract(OnePlusEps, AbsV); + + Rsq = XMVectorReciprocalSqrtEst(D); + SqrtD = XMVectorMultiply(D, Rsq); + + V2 = XMVectorMultiply(V, AbsV); + V2C3 = XMVectorMultiply(V2, C3); + VD = XMVectorMultiply(D, AbsV); + VC0 = XMVectorMultiply(V, C0); + + Result = XMVectorMultiply(V, C1); + Result = XMVectorMultiplyAdd(V2, C2, Result); + Result = XMVectorMultiplyAdd(V2C3, VD, Result); + Result = XMVectorMultiplyAdd(VC0, SqrtD, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Get abs(V) + XMVECTOR vAbsV = _mm_setzero_ps(); + vAbsV = _mm_sub_ps(vAbsV,V); + vAbsV = _mm_max_ps(vAbsV,V); + + XMVECTOR D = _mm_load_ps1(&g_XMASinEstConstants.f[0]); + D = _mm_sub_ps(D,vAbsV); + // Since this is an estimate, rqsrt is okay + XMVECTOR vConstants = _mm_rsqrt_ps(D); + XMVECTOR SqrtD = _mm_mul_ps(D,vConstants); + // V2 = V^2 retaining sign + XMVECTOR V2 = _mm_mul_ps(V,vAbsV); + D = _mm_mul_ps(D,vAbsV); + + XMVECTOR vResult = _mm_load_ps1(&g_XMASinEstCoefficients.f[1]); + vResult = _mm_mul_ps(vResult,V); + vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[2]); + vConstants = _mm_mul_ps(vConstants,V2); + vResult = _mm_add_ps(vResult,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[3]); + vConstants = _mm_mul_ps(vConstants,V2); + vConstants = _mm_mul_ps(vConstants,D); + vResult = _mm_add_ps(vResult,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[0]); + vConstants = _mm_mul_ps(vConstants,V); + vConstants = _mm_mul_ps(vConstants,SqrtD); + vResult = _mm_add_ps(vResult,vConstants); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorACosEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR AbsV, V2, VD, VC0, V2C3; + XMVECTOR C0, C1, C2, C3; + XMVECTOR D, Rsq, SqrtD; + XMVECTOR OnePlusEps, HalfPi; + XMVECTOR Result; + + // acos(V) = PI / 2 - asin(V) + + AbsV = XMVectorAbs(V); + + OnePlusEps = XMVectorSplatX(g_XMASinEstConstants.v); + HalfPi = XMVectorSplatY(g_XMASinEstConstants.v); + + C0 = XMVectorSplatX(g_XMASinEstCoefficients.v); + C1 = XMVectorSplatY(g_XMASinEstCoefficients.v); + C2 = XMVectorSplatZ(g_XMASinEstCoefficients.v); + C3 = XMVectorSplatW(g_XMASinEstCoefficients.v); + + D = XMVectorSubtract(OnePlusEps, AbsV); + + Rsq = XMVectorReciprocalSqrtEst(D); + SqrtD = XMVectorMultiply(D, Rsq); + + V2 = XMVectorMultiply(V, AbsV); + V2C3 = XMVectorMultiply(V2, C3); + VD = XMVectorMultiply(D, AbsV); + VC0 = XMVectorMultiply(V, C0); + + Result = XMVectorMultiply(V, C1); + Result = XMVectorMultiplyAdd(V2, C2, Result); + Result = XMVectorMultiplyAdd(V2C3, VD, Result); + Result = XMVectorMultiplyAdd(VC0, SqrtD, Result); + Result = XMVectorSubtract(HalfPi, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // acos(V) = PI / 2 - asin(V) + // Get abs(V) + XMVECTOR vAbsV = _mm_setzero_ps(); + vAbsV = _mm_sub_ps(vAbsV,V); + vAbsV = _mm_max_ps(vAbsV,V); + // Calc D + XMVECTOR D = _mm_load_ps1(&g_XMASinEstConstants.f[0]); + D = _mm_sub_ps(D,vAbsV); + // SqrtD = sqrt(D-abs(V)) estimated + XMVECTOR vConstants = _mm_rsqrt_ps(D); + XMVECTOR SqrtD = _mm_mul_ps(D,vConstants); + // V2 = V^2 while retaining sign + XMVECTOR V2 = _mm_mul_ps(V, vAbsV); + // Drop vAbsV here. D = (Const-abs(V))*abs(V) + D = _mm_mul_ps(D, vAbsV); + + XMVECTOR vResult = _mm_load_ps1(&g_XMASinEstCoefficients.f[1]); + vResult = _mm_mul_ps(vResult,V); + vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[2]); + vConstants = _mm_mul_ps(vConstants,V2); + vResult = _mm_add_ps(vResult,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[3]); + vConstants = _mm_mul_ps(vConstants,V2); + vConstants = _mm_mul_ps(vConstants,D); + vResult = _mm_add_ps(vResult,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinEstCoefficients.f[0]); + vConstants = _mm_mul_ps(vConstants,V); + vConstants = _mm_mul_ps(vConstants,SqrtD); + vResult = _mm_add_ps(vResult,vConstants); + + vConstants = _mm_load_ps1(&g_XMASinEstConstants.f[1]); + vResult = _mm_sub_ps(vConstants,vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorATanEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR AbsV, V2S2, N, D; + XMVECTOR S0, S1, S2; + XMVECTOR HalfPi; + XMVECTOR Result; + + S0 = XMVectorSplatX(g_XMATanEstCoefficients.v); + S1 = XMVectorSplatY(g_XMATanEstCoefficients.v); + S2 = XMVectorSplatZ(g_XMATanEstCoefficients.v); + HalfPi = XMVectorSplatW(g_XMATanEstCoefficients.v); + + AbsV = XMVectorAbs(V); + + V2S2 = XMVectorMultiplyAdd(V, V, S2); + N = XMVectorMultiplyAdd(AbsV, HalfPi, S0); + D = XMVectorMultiplyAdd(AbsV, S1, V2S2); + N = XMVectorMultiply(N, V); + D = XMVectorReciprocalEst(D); + + Result = XMVectorMultiply(N, D); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Get abs(V) + XMVECTOR vAbsV = _mm_setzero_ps(); + vAbsV = _mm_sub_ps(vAbsV,V); + vAbsV = _mm_max_ps(vAbsV,V); + + XMVECTOR vResult = _mm_load_ps1(&g_XMATanEstCoefficients.f[3]); + vResult = _mm_mul_ps(vResult,vAbsV); + XMVECTOR vConstants = _mm_load_ps1(&g_XMATanEstCoefficients.f[0]); + vResult = _mm_add_ps(vResult,vConstants); + vResult = _mm_mul_ps(vResult,V); + + XMVECTOR D = _mm_mul_ps(V,V); + vConstants = _mm_load_ps1(&g_XMATanEstCoefficients.f[2]); + D = _mm_add_ps(D,vConstants); + vConstants = _mm_load_ps1(&g_XMATanEstCoefficients.f[1]); + vConstants = _mm_mul_ps(vConstants,vAbsV); + D = _mm_add_ps(D,vConstants); + vResult = _mm_div_ps(vResult,D); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorATan2Est +( + FXMVECTOR Y, + FXMVECTOR X +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Reciprocal; + XMVECTOR V; + XMVECTOR YSign; + XMVECTOR Pi, PiOverTwo, PiOverFour, ThreePiOverFour; + XMVECTOR YEqualsZero, XEqualsZero, XIsPositive, YEqualsInfinity, XEqualsInfinity; + XMVECTOR ATanResultValid; + XMVECTOR R0, R1, R2, R3, R4, R5; + XMVECTOR Zero; + XMVECTOR Result; + static CONST XMVECTOR ATan2Constants = {XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f}; + + Zero = XMVectorZero(); + ATanResultValid = XMVectorTrueInt(); + + Pi = XMVectorSplatX(ATan2Constants); + PiOverTwo = XMVectorSplatY(ATan2Constants); + PiOverFour = XMVectorSplatZ(ATan2Constants); + ThreePiOverFour = XMVectorSplatW(ATan2Constants); + + YEqualsZero = XMVectorEqual(Y, Zero); + XEqualsZero = XMVectorEqual(X, Zero); + XIsPositive = XMVectorAndInt(X, g_XMNegativeZero.v); + XIsPositive = XMVectorEqualInt(XIsPositive, Zero); + YEqualsInfinity = XMVectorIsInfinite(Y); + XEqualsInfinity = XMVectorIsInfinite(X); + + YSign = XMVectorAndInt(Y, g_XMNegativeZero.v); + Pi = XMVectorOrInt(Pi, YSign); + PiOverTwo = XMVectorOrInt(PiOverTwo, YSign); + PiOverFour = XMVectorOrInt(PiOverFour, YSign); + ThreePiOverFour = XMVectorOrInt(ThreePiOverFour, YSign); + + R1 = XMVectorSelect(Pi, YSign, XIsPositive); + R2 = XMVectorSelect(ATanResultValid, PiOverTwo, XEqualsZero); + R3 = XMVectorSelect(R2, R1, YEqualsZero); + R4 = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive); + R5 = XMVectorSelect(PiOverTwo, R4, XEqualsInfinity); + Result = XMVectorSelect(R3, R5, YEqualsInfinity); + ATanResultValid = XMVectorEqualInt(Result, ATanResultValid); + + Reciprocal = XMVectorReciprocalEst(X); + V = XMVectorMultiply(Y, Reciprocal); + R0 = XMVectorATanEst(V); + + R1 = XMVectorSelect( Pi, Zero, XIsPositive ); + R2 = XMVectorAdd(R0, R1); + + Result = XMVectorSelect(Result, R2, ATanResultValid); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static CONST XMVECTORF32 ATan2Constants = {XM_PI, XM_PIDIV2, XM_PIDIV4, XM_PI * 3.0f / 4.0f}; + + // Mask if Y>0 && Y!=INF + XMVECTOR YEqualsInfinity = XMVectorIsInfinite(Y); + // Get the sign of (Y&0x80000000) + XMVECTOR YSign = _mm_and_ps(Y, g_XMNegativeZero); + // Get the sign bits of X + XMVECTOR XIsPositive = _mm_and_ps(X,g_XMNegativeZero); + // Change them to masks + XIsPositive = XMVectorEqualInt(XIsPositive,g_XMZero); + // Get Pi + XMVECTOR Pi = _mm_load_ps1(&ATan2Constants.f[0]); + // Copy the sign of Y + Pi = _mm_or_ps(Pi,YSign); + XMVECTOR R1 = XMVectorSelect(Pi,YSign,XIsPositive); + // Mask for X==0 + XMVECTOR vConstants = _mm_cmpeq_ps(X,g_XMZero); + // Get Pi/2 with with sign of Y + XMVECTOR PiOverTwo = _mm_load_ps1(&ATan2Constants.f[1]); + PiOverTwo = _mm_or_ps(PiOverTwo,YSign); + XMVECTOR R2 = XMVectorSelect(g_XMNegOneMask,PiOverTwo,vConstants); + // Mask for Y==0 + vConstants = _mm_cmpeq_ps(Y,g_XMZero); + R2 = XMVectorSelect(R2,R1,vConstants); + // Get Pi/4 with sign of Y + XMVECTOR PiOverFour = _mm_load_ps1(&ATan2Constants.f[2]); + PiOverFour = _mm_or_ps(PiOverFour,YSign); + // Get (Pi*3)/4 with sign of Y + XMVECTOR ThreePiOverFour = _mm_load_ps1(&ATan2Constants.f[3]); + ThreePiOverFour = _mm_or_ps(ThreePiOverFour,YSign); + vConstants = XMVectorSelect(ThreePiOverFour, PiOverFour, XIsPositive); + XMVECTOR XEqualsInfinity = XMVectorIsInfinite(X); + vConstants = XMVectorSelect(PiOverTwo,vConstants,XEqualsInfinity); + + XMVECTOR vResult = XMVectorSelect(R2,vConstants,YEqualsInfinity); + vConstants = XMVectorSelect(R1,vResult,YEqualsInfinity); + // At this point, any entry that's zero will get the result + // from XMVectorATan(), otherwise, return the failsafe value + vResult = XMVectorSelect(vResult,vConstants,XEqualsInfinity); + // Any entries not 0xFFFFFFFF, are considered precalculated + XMVECTOR ATanResultValid = XMVectorEqualInt(vResult,g_XMNegOneMask); + // Let's do the ATan2 function + XMVECTOR Reciprocal = _mm_rcp_ps(X); + vConstants = _mm_mul_ps(Y, Reciprocal); + vConstants = XMVectorATanEst(vConstants); + // Discard entries that have been declared void + + XMVECTOR R3 = XMVectorSelect( Pi, g_XMZero, XIsPositive ); + vConstants = _mm_add_ps( vConstants, R3 ); + + vResult = XMVectorSelect(vResult,vConstants,ATanResultValid); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorLerp +( + FXMVECTOR V0, + FXMVECTOR V1, + FLOAT t +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Scale; + XMVECTOR Length; + XMVECTOR Result; + + // V0 + t * (V1 - V0) + Scale = XMVectorReplicate(t); + Length = XMVectorSubtract(V1, V0); + Result = XMVectorMultiplyAdd(Length, Scale, V0); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR L, S; + XMVECTOR Result; + + L = _mm_sub_ps( V1, V0 ); + + S = _mm_set_ps1( t ); + + Result = _mm_mul_ps( L, S ); + + return _mm_add_ps( Result, V0 ); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorLerpV +( + FXMVECTOR V0, + FXMVECTOR V1, + FXMVECTOR T +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Length; + XMVECTOR Result; + + // V0 + T * (V1 - V0) + Length = XMVectorSubtract(V1, V0); + Result = XMVectorMultiplyAdd(Length, T, V0); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Length; + XMVECTOR Result; + + Length = _mm_sub_ps( V1, V0 ); + + Result = _mm_mul_ps( Length, T ); + + return _mm_add_ps( Result, V0 ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorHermite +( + FXMVECTOR Position0, + FXMVECTOR Tangent0, + FXMVECTOR Position1, + CXMVECTOR Tangent1, + FLOAT t +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR P0; + XMVECTOR T0; + XMVECTOR P1; + XMVECTOR T1; + XMVECTOR Result; + FLOAT t2; + FLOAT t3; + + // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 + + // (t^3 - 2 * t^2 + t) * Tangent0 + + // (-2 * t^3 + 3 * t^2) * Position1 + + // (t^3 - t^2) * Tangent1 + t2 = t * t; + t3 = t * t2; + + P0 = XMVectorReplicate(2.0f * t3 - 3.0f * t2 + 1.0f); + T0 = XMVectorReplicate(t3 - 2.0f * t2 + t); + P1 = XMVectorReplicate(-2.0f * t3 + 3.0f * t2); + T1 = XMVectorReplicate(t3 - t2); + + Result = XMVectorMultiply(P0, Position0); + Result = XMVectorMultiplyAdd(T0, Tangent0, Result); + Result = XMVectorMultiplyAdd(P1, Position1, Result); + Result = XMVectorMultiplyAdd(T1, Tangent1, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + FLOAT t2 = t * t; + FLOAT t3 = t * t2; + + XMVECTOR P0 = _mm_set_ps1(2.0f * t3 - 3.0f * t2 + 1.0f); + XMVECTOR T0 = _mm_set_ps1(t3 - 2.0f * t2 + t); + XMVECTOR P1 = _mm_set_ps1(-2.0f * t3 + 3.0f * t2); + XMVECTOR T1 = _mm_set_ps1(t3 - t2); + + XMVECTOR vResult = _mm_mul_ps(P0, Position0); + XMVECTOR vTemp = _mm_mul_ps(T0, Tangent0); + vResult = _mm_add_ps(vResult,vTemp); + vTemp = _mm_mul_ps(P1, Position1); + vResult = _mm_add_ps(vResult,vTemp); + vTemp = _mm_mul_ps(T1, Tangent1); + vResult = _mm_add_ps(vResult,vTemp); + return vResult; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorHermiteV +( + FXMVECTOR Position0, + FXMVECTOR Tangent0, + FXMVECTOR Position1, + CXMVECTOR Tangent1, + CXMVECTOR T +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR P0; + XMVECTOR T0; + XMVECTOR P1; + XMVECTOR T1; + XMVECTOR Result; + XMVECTOR T2; + XMVECTOR T3; + + // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 + + // (t^3 - 2 * t^2 + t) * Tangent0 + + // (-2 * t^3 + 3 * t^2) * Position1 + + // (t^3 - t^2) * Tangent1 + T2 = XMVectorMultiply(T, T); + T3 = XMVectorMultiply(T , T2); + + P0 = XMVectorReplicate(2.0f * T3.vector4_f32[0] - 3.0f * T2.vector4_f32[0] + 1.0f); + T0 = XMVectorReplicate(T3.vector4_f32[1] - 2.0f * T2.vector4_f32[1] + T.vector4_f32[1]); + P1 = XMVectorReplicate(-2.0f * T3.vector4_f32[2] + 3.0f * T2.vector4_f32[2]); + T1 = XMVectorReplicate(T3.vector4_f32[3] - T2.vector4_f32[3]); + + Result = XMVectorMultiply(P0, Position0); + Result = XMVectorMultiplyAdd(T0, Tangent0, Result); + Result = XMVectorMultiplyAdd(P1, Position1, Result); + Result = XMVectorMultiplyAdd(T1, Tangent1, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 CatMulT2 = {-3.0f,-2.0f,3.0f,-1.0f}; + static const XMVECTORF32 CatMulT3 = {2.0f,1.0f,-2.0f,1.0f}; + + // Result = (2 * t^3 - 3 * t^2 + 1) * Position0 + + // (t^3 - 2 * t^2 + t) * Tangent0 + + // (-2 * t^3 + 3 * t^2) * Position1 + + // (t^3 - t^2) * Tangent1 + XMVECTOR T2 = _mm_mul_ps(T,T); + XMVECTOR T3 = _mm_mul_ps(T,T2); + // Mul by the constants against t^2 + T2 = _mm_mul_ps(T2,CatMulT2); + // Mul by the constants against t^3 + T3 = _mm_mul_ps(T3,CatMulT3); + // T3 now has the pre-result. + T3 = _mm_add_ps(T3,T2); + // I need to add t.y only + T2 = _mm_and_ps(T,g_XMMaskY); + T3 = _mm_add_ps(T3,T2); + // Add 1.0f to x + T3 = _mm_add_ps(T3,g_XMIdentityR0); + // Now, I have the constants created + // Mul the x constant to Position0 + XMVECTOR vResult = _mm_shuffle_ps(T3,T3,_MM_SHUFFLE(0,0,0,0)); + vResult = _mm_mul_ps(vResult,Position0); + // Mul the y constant to Tangent0 + T2 = _mm_shuffle_ps(T3,T3,_MM_SHUFFLE(1,1,1,1)); + T2 = _mm_mul_ps(T2,Tangent0); + vResult = _mm_add_ps(vResult,T2); + // Mul the z constant to Position1 + T2 = _mm_shuffle_ps(T3,T3,_MM_SHUFFLE(2,2,2,2)); + T2 = _mm_mul_ps(T2,Position1); + vResult = _mm_add_ps(vResult,T2); + // Mul the w constant to Tangent1 + T3 = _mm_shuffle_ps(T3,T3,_MM_SHUFFLE(3,3,3,3)); + T3 = _mm_mul_ps(T3,Tangent1); + vResult = _mm_add_ps(vResult,T3); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorCatmullRom +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + CXMVECTOR Position3, + FLOAT t +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR P0; + XMVECTOR P1; + XMVECTOR P2; + XMVECTOR P3; + XMVECTOR Result; + FLOAT t2; + FLOAT t3; + + // Result = ((-t^3 + 2 * t^2 - t) * Position0 + + // (3 * t^3 - 5 * t^2 + 2) * Position1 + + // (-3 * t^3 + 4 * t^2 + t) * Position2 + + // (t^3 - t^2) * Position3) * 0.5 + t2 = t * t; + t3 = t * t2; + + P0 = XMVectorReplicate((-t3 + 2.0f * t2 - t) * 0.5f); + P1 = XMVectorReplicate((3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f); + P2 = XMVectorReplicate((-3.0f * t3 + 4.0f * t2 + t) * 0.5f); + P3 = XMVectorReplicate((t3 - t2) * 0.5f); + + Result = XMVectorMultiply(P0, Position0); + Result = XMVectorMultiplyAdd(P1, Position1, Result); + Result = XMVectorMultiplyAdd(P2, Position2, Result); + Result = XMVectorMultiplyAdd(P3, Position3, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + FLOAT t2 = t * t; + FLOAT t3 = t * t2; + + XMVECTOR P0 = _mm_set_ps1((-t3 + 2.0f * t2 - t) * 0.5f); + XMVECTOR P1 = _mm_set_ps1((3.0f * t3 - 5.0f * t2 + 2.0f) * 0.5f); + XMVECTOR P2 = _mm_set_ps1((-3.0f * t3 + 4.0f * t2 + t) * 0.5f); + XMVECTOR P3 = _mm_set_ps1((t3 - t2) * 0.5f); + + P0 = _mm_mul_ps(P0, Position0); + P1 = _mm_mul_ps(P1, Position1); + P2 = _mm_mul_ps(P2, Position2); + P3 = _mm_mul_ps(P3, Position3); + P0 = _mm_add_ps(P0,P1); + P2 = _mm_add_ps(P2,P3); + P0 = _mm_add_ps(P0,P2); + return P0; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorCatmullRomV +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + CXMVECTOR Position3, + CXMVECTOR T +) +{ +#if defined(_XM_NO_INTRINSICS_) + float fx = T.vector4_f32[0]; + float fy = T.vector4_f32[1]; + float fz = T.vector4_f32[2]; + float fw = T.vector4_f32[3]; + XMVECTOR vResult = { + 0.5f*((-fx*fx*fx+2*fx*fx-fx)*Position0.vector4_f32[0]+ + (3*fx*fx*fx-5*fx*fx+2)*Position1.vector4_f32[0]+ + (-3*fx*fx*fx+4*fx*fx+fx)*Position2.vector4_f32[0]+ + (fx*fx*fx-fx*fx)*Position3.vector4_f32[0]), + 0.5f*((-fy*fy*fy+2*fy*fy-fy)*Position0.vector4_f32[1]+ + (3*fy*fy*fy-5*fy*fy+2)*Position1.vector4_f32[1]+ + (-3*fy*fy*fy+4*fy*fy+fy)*Position2.vector4_f32[1]+ + (fy*fy*fy-fy*fy)*Position3.vector4_f32[1]), + 0.5f*((-fz*fz*fz+2*fz*fz-fz)*Position0.vector4_f32[2]+ + (3*fz*fz*fz-5*fz*fz+2)*Position1.vector4_f32[2]+ + (-3*fz*fz*fz+4*fz*fz+fz)*Position2.vector4_f32[2]+ + (fz*fz*fz-fz*fz)*Position3.vector4_f32[2]), + 0.5f*((-fw*fw*fw+2*fw*fw-fw)*Position0.vector4_f32[3]+ + (3*fw*fw*fw-5*fw*fw+2)*Position1.vector4_f32[3]+ + (-3*fw*fw*fw+4*fw*fw+fw)*Position2.vector4_f32[3]+ + (fw*fw*fw-fw*fw)*Position3.vector4_f32[3]) + }; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 Catmul2 = {2.0f,2.0f,2.0f,2.0f}; + static const XMVECTORF32 Catmul3 = {3.0f,3.0f,3.0f,3.0f}; + static const XMVECTORF32 Catmul4 = {4.0f,4.0f,4.0f,4.0f}; + static const XMVECTORF32 Catmul5 = {5.0f,5.0f,5.0f,5.0f}; + // Cache T^2 and T^3 + XMVECTOR T2 = _mm_mul_ps(T,T); + XMVECTOR T3 = _mm_mul_ps(T,T2); + // Perform the Position0 term + XMVECTOR vResult = _mm_add_ps(T2,T2); + vResult = _mm_sub_ps(vResult,T); + vResult = _mm_sub_ps(vResult,T3); + vResult = _mm_mul_ps(vResult,Position0); + // Perform the Position1 term and add + XMVECTOR vTemp = _mm_mul_ps(T3,Catmul3); + XMVECTOR vTemp2 = _mm_mul_ps(T2,Catmul5); + vTemp = _mm_sub_ps(vTemp,vTemp2); + vTemp = _mm_add_ps(vTemp,Catmul2); + vTemp = _mm_mul_ps(vTemp,Position1); + vResult = _mm_add_ps(vResult,vTemp); + // Perform the Position2 term and add + vTemp = _mm_mul_ps(T2,Catmul4); + vTemp2 = _mm_mul_ps(T3,Catmul3); + vTemp = _mm_sub_ps(vTemp,vTemp2); + vTemp = _mm_add_ps(vTemp,T); + vTemp = _mm_mul_ps(vTemp,Position2); + vResult = _mm_add_ps(vResult,vTemp); + // Position3 is the last term + T3 = _mm_sub_ps(T3,T2); + T3 = _mm_mul_ps(T3,Position3); + vResult = _mm_add_ps(vResult,T3); + // Multiply by 0.5f and exit + vResult = _mm_mul_ps(vResult,g_XMOneHalf); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorBaryCentric +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + FLOAT f, + FLOAT g +) +{ +#if defined(_XM_NO_INTRINSICS_) + + // Result = Position0 + f * (Position1 - Position0) + g * (Position2 - Position0) + XMVECTOR P10; + XMVECTOR P20; + XMVECTOR ScaleF; + XMVECTOR ScaleG; + XMVECTOR Result; + + P10 = XMVectorSubtract(Position1, Position0); + ScaleF = XMVectorReplicate(f); + + P20 = XMVectorSubtract(Position2, Position0); + ScaleG = XMVectorReplicate(g); + + Result = XMVectorMultiplyAdd(P10, ScaleF, Position0); + Result = XMVectorMultiplyAdd(P20, ScaleG, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR R1 = _mm_sub_ps(Position1,Position0); + XMVECTOR SF = _mm_set_ps1(f); + XMVECTOR R2 = _mm_sub_ps(Position2,Position0); + XMVECTOR SG = _mm_set_ps1(g); + R1 = _mm_mul_ps(R1,SF); + R2 = _mm_mul_ps(R2,SG); + R1 = _mm_add_ps(R1,Position0); + R1 = _mm_add_ps(R1,R2); + return R1; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVectorBaryCentricV +( + FXMVECTOR Position0, + FXMVECTOR Position1, + FXMVECTOR Position2, + CXMVECTOR F, + CXMVECTOR G +) +{ +#if defined(_XM_NO_INTRINSICS_) + + // Result = Position0 + f * (Position1 - Position0) + g * (Position2 - Position0) + XMVECTOR P10; + XMVECTOR P20; + XMVECTOR Result; + + P10 = XMVectorSubtract(Position1, Position0); + P20 = XMVectorSubtract(Position2, Position0); + + Result = XMVectorMultiplyAdd(P10, F, Position0); + Result = XMVectorMultiplyAdd(P20, G, Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR R1 = _mm_sub_ps(Position1,Position0); + XMVECTOR R2 = _mm_sub_ps(Position2,Position0); + R1 = _mm_mul_ps(R1,F); + R2 = _mm_mul_ps(R2,G); + R1 = _mm_add_ps(R1,Position0); + R1 = _mm_add_ps(R1,R2); + return R1; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +/**************************************************************************** + * + * 2D Vector + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2Equal +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); +// z and w are don't care + return (((_mm_movemask_ps(vTemp)&3)==3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector2EqualR(V1, V2)); +#endif +} + + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector2EqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + UINT CR = 0; + + if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && + (V1.vector4_f32[1] == V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && + (V1.vector4_f32[1] != V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); +// z and w are don't care + int iTest = _mm_movemask_ps(vTemp)&3; + UINT CR = 0; + if (iTest==3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2EqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + return (((_mm_movemask_ps(reinterpret_cast(&vTemp)[0])&3)==3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector2EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector2EqualIntR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + UINT CR = 0; + if ((V1.vector4_u32[0] == V2.vector4_u32[0]) && + (V1.vector4_u32[1] == V2.vector4_u32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_u32[0] != V2.vector4_u32[0]) && + (V1.vector4_u32[1] != V2.vector4_u32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + int iTest = _mm_movemask_ps(reinterpret_cast(&vTemp)[0])&3; + UINT CR = 0; + if (iTest==3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2NearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT dx, dy; + dx = fabsf(V1.vector4_f32[0]-V2.vector4_f32[0]); + dy = fabsf(V1.vector4_f32[1]-V2.vector4_f32[1]); + return ((dx <= Epsilon.vector4_f32[0]) && + (dy <= Epsilon.vector4_f32[1])); +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1,V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp,vDelta); + vTemp = _mm_max_ps(vTemp,vDelta); + vTemp = _mm_cmple_ps(vTemp,Epsilon); + // z and w are don't care + return (((_mm_movemask_ps(vTemp)&3)==0x3) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2NotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); +// z and w are don't care + return (((_mm_movemask_ps(vTemp)&3)!=3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAnyFalse(XMVector2EqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2NotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + return (((_mm_movemask_ps(reinterpret_cast(&vTemp)[0])&3)!=3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAnyFalse(XMVector2EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2Greater +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1])) != 0); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2); +// z and w are don't care + return (((_mm_movemask_ps(vTemp)&3)==3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector2GreaterR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector2GreaterR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + UINT CR = 0; + if ((V1.vector4_f32[0] > V2.vector4_f32[0]) && + (V1.vector4_f32[1] > V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] <= V2.vector4_f32[0]) && + (V1.vector4_f32[1] <= V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2); + int iTest = _mm_movemask_ps(vTemp)&3; + UINT CR = 0; + if (iTest==3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2GreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&3)==3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector2GreaterOrEqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector2GreaterOrEqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && + (V1.vector4_f32[1] >= V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && + (V1.vector4_f32[1] < V2.vector4_f32[1])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1,V2); + int iTest = _mm_movemask_ps(vTemp)&3; + UINT CR = 0; + if (iTest == 3) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2Less +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmplt_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&3)==3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector2GreaterR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2LessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmple_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&3)==3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector2GreaterOrEqualR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2InBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) +{ + #if defined(_XM_NO_INTRINSICS_) + return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1])) != 0); + #elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + // x and y in bounds? (z and w are don't care) + return (((_mm_movemask_ps(vTemp1)&0x3)==0x3) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllInBounds(XMVector2InBoundsR(V, Bounds)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector2InBoundsR +( + FXMVECTOR V, + FXMVECTOR Bounds +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if ((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1])) + { + CR = XM_CRMASK_CR6BOUNDS; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + // x and y in bounds? (z and w are don't care) + return ((_mm_movemask_ps(vTemp1)&0x3)==0x3) ? XM_CRMASK_CR6BOUNDS : 0; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2IsNaN +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (XMISNAN(V.vector4_f32[0]) || + XMISNAN(V.vector4_f32[1])); +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the exponent + __m128i vTempInf = _mm_and_si128(reinterpret_cast(&V)[0],g_XMInfinity); + // Mask off the mantissa + __m128i vTempNan = _mm_and_si128(reinterpret_cast(&V)[0],g_XMQNaNTest); + // Are any of the exponents == 0x7F800000? + vTempInf = _mm_cmpeq_epi32(vTempInf,g_XMInfinity); + // Are any of the mantissa's zero? (SSE2 doesn't have a neq test) + vTempNan = _mm_cmpeq_epi32(vTempNan,g_XMZero); + // Perform a not on the NaN test to be true on NON-zero mantissas + vTempNan = _mm_andnot_si128(vTempNan,vTempInf); + // If x or y are NaN, the signs are true after the merge above + return ((_mm_movemask_ps(reinterpret_cast(&vTempNan)[0])&3) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector2IsInfinite +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + return (XMISINF(V.vector4_f32[0]) || + XMISINF(V.vector4_f32[1])); +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + __m128 vTemp = _mm_and_ps(V,g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp,g_XMInfinity); + // If x or z are infinity, the signs are true. + return ((_mm_movemask_ps(vTemp)&3) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Dot +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_f32[0] = + Result.vector4_f32[1] = + Result.vector4_f32[2] = + Result.vector4_f32[3] = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V1,V2); + // vTemp has y splatted + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Cross +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT fCross = (V1.vector4_f32[0] * V2.vector4_f32[1]) - (V1.vector4_f32[1] * V2.vector4_f32[0]); + XMVECTOR vResult = { + fCross, + fCross, + fCross, + fCross + }; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Swap x and y + XMVECTOR vResult = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(0,1,0,1)); + // Perform the muls + vResult = _mm_mul_ps(vResult,V1); + // Splat y + XMVECTOR vTemp = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(1,1,1,1)); + // Sub the values + vResult = _mm_sub_ss(vResult,vTemp); + // Splat the cross product + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,0,0,0)); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2LengthSq +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + return XMVector2Dot(V, V); +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has y splatted + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + return vLengthSq; +#else + return XMVector2Dot(V, V); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2ReciprocalLengthEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector2LengthSq(V); + Result = XMVectorReciprocalSqrtEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has y splatted + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_rsqrt_ss(vLengthSq); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2ReciprocalLength +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector2LengthSq(V); + Result = XMVectorReciprocalSqrt(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has y splatted + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_sqrt_ss(vLengthSq); + vLengthSq = _mm_div_ss(g_XMOne,vLengthSq); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2LengthEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Result; + Result = XMVector2LengthSq(V); + Result = XMVectorSqrtEst(Result); + return Result; +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has y splatted + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_sqrt_ss(vLengthSq); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Length +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector2LengthSq(V); + Result = XMVectorSqrt(Result); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has y splatted + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// XMVector2NormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +XMFINLINE XMVECTOR XMVector2NormalizeEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector2ReciprocalLength(V); + Result = XMVectorMultiply(V, Result); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has y splatted + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + // x+y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_rsqrt_ss(vLengthSq); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + vLengthSq = _mm_mul_ps(vLengthSq,V); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Normalize +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR LengthSq; + XMVECTOR Zero; + XMVECTOR InfiniteLength; + XMVECTOR ZeroLength; + XMVECTOR Select; + XMVECTOR Result; + + LengthSq = XMVector2LengthSq(V); + Zero = XMVectorZero(); + Result = XMVectorReciprocalSqrt(LengthSq); + InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); + ZeroLength = XMVectorEqual(LengthSq, Zero); + Result = XMVectorMultiply(V, Result); + Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Result = XMVectorSelect(LengthSq, Result, Select); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x and y only + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,1,1,1)); + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq,g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_div_ps(V,vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult,vLengthSq); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2ClampLength +( + FXMVECTOR V, + FLOAT LengthMin, + FLOAT LengthMax +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR ClampMax; + XMVECTOR ClampMin; + + ClampMax = XMVectorReplicate(LengthMax); + ClampMin = XMVectorReplicate(LengthMin); + + return XMVector2ClampLengthV(V, ClampMin, ClampMax); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR ClampMax = _mm_set_ps1(LengthMax); + XMVECTOR ClampMin = _mm_set_ps1(LengthMin); + return XMVector2ClampLengthV(V, ClampMin, ClampMax); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2ClampLengthV +( + FXMVECTOR V, + FXMVECTOR LengthMin, + FXMVECTOR LengthMax +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR ClampLength; + XMVECTOR LengthSq; + XMVECTOR RcpLength; + XMVECTOR Length; + XMVECTOR Normal; + XMVECTOR Zero; + XMVECTOR InfiniteLength; + XMVECTOR ZeroLength; + XMVECTOR Select; + XMVECTOR ControlMax; + XMVECTOR ControlMin; + XMVECTOR Control; + XMVECTOR Result; + + XMASSERT((LengthMin.vector4_f32[1] == LengthMin.vector4_f32[0])); + XMASSERT((LengthMax.vector4_f32[1] == LengthMax.vector4_f32[0])); + XMASSERT(XMVector2GreaterOrEqual(LengthMin, XMVectorZero())); + XMASSERT(XMVector2GreaterOrEqual(LengthMax, XMVectorZero())); + XMASSERT(XMVector2GreaterOrEqual(LengthMax, LengthMin)); + + LengthSq = XMVector2LengthSq(V); + + Zero = XMVectorZero(); + + RcpLength = XMVectorReciprocalSqrt(LengthSq); + + InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); + ZeroLength = XMVectorEqual(LengthSq, Zero); + + Length = XMVectorMultiply(LengthSq, RcpLength); + + Normal = XMVectorMultiply(V, RcpLength); + + Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + + ControlMax = XMVectorGreater(Length, LengthMax); + ControlMin = XMVectorLess(Length, LengthMin); + + ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + + Result = XMVectorMultiply(Normal, ClampLength); + + // Preserve the original vector (with no precision loss) if the length falls within the given range + Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR ClampLength; + XMVECTOR LengthSq; + XMVECTOR RcpLength; + XMVECTOR Length; + XMVECTOR Normal; + XMVECTOR InfiniteLength; + XMVECTOR ZeroLength; + XMVECTOR Select; + XMVECTOR ControlMax; + XMVECTOR ControlMin; + XMVECTOR Control; + XMVECTOR Result; + + XMASSERT((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin))); + XMASSERT((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax))); + XMASSERT(XMVector2GreaterOrEqual(LengthMin, g_XMZero)); + XMASSERT(XMVector2GreaterOrEqual(LengthMax, g_XMZero)); + XMASSERT(XMVector2GreaterOrEqual(LengthMax, LengthMin)); + LengthSq = XMVector2LengthSq(V); + RcpLength = XMVectorReciprocalSqrt(LengthSq); + InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity); + ZeroLength = XMVectorEqual(LengthSq, g_XMZero); + Length = _mm_mul_ps(LengthSq, RcpLength); + Normal = _mm_mul_ps(V, RcpLength); + Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + ControlMax = XMVectorGreater(Length, LengthMax); + ControlMin = XMVectorLess(Length, LengthMin); + ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + Result = _mm_mul_ps(Normal, ClampLength); + // Preserve the original vector (with no precision loss) if the length falls within the given range + Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Reflect +( + FXMVECTOR Incident, + FXMVECTOR Normal +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + Result = XMVector2Dot(Incident, Normal); + Result = XMVectorAdd(Result, Result); + Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + XMVECTOR Result = XMVector2Dot(Incident,Normal); + Result = _mm_add_ps(Result, Result); + Result = _mm_mul_ps(Result, Normal); + Result = _mm_sub_ps(Incident,Result); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Refract +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FLOAT RefractionIndex +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Index; + Index = XMVectorReplicate(RefractionIndex); + return XMVector2RefractV(Incident, Normal, Index); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Index = _mm_set_ps1(RefractionIndex); + return XMVector2RefractV(Incident,Normal,Index); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +// Return the refraction of a 2D vector +XMFINLINE XMVECTOR XMVector2RefractV +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FXMVECTOR RefractionIndex +) +{ +#if defined(_XM_NO_INTRINSICS_) + float IDotN; + float RX,RY; + XMVECTOR vResult; + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + IDotN = (Incident.vector4_f32[0]*Normal.vector4_f32[0])+(Incident.vector4_f32[1]*Normal.vector4_f32[1]); + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + RY = 1.0f-(IDotN*IDotN); + RX = 1.0f-(RY*RefractionIndex.vector4_f32[0]*RefractionIndex.vector4_f32[0]); + RY = 1.0f-(RY*RefractionIndex.vector4_f32[1]*RefractionIndex.vector4_f32[1]); + if (RX>=0.0f) { + RX = (RefractionIndex.vector4_f32[0]*Incident.vector4_f32[0])-(Normal.vector4_f32[0]*((RefractionIndex.vector4_f32[0]*IDotN)+sqrtf(RX))); + } else { + RX = 0.0f; + } + if (RY>=0.0f) { + RY = (RefractionIndex.vector4_f32[1]*Incident.vector4_f32[1])-(Normal.vector4_f32[1]*((RefractionIndex.vector4_f32[1]*IDotN)+sqrtf(RY))); + } else { + RY = 0.0f; + } + vResult.vector4_f32[0] = RX; + vResult.vector4_f32[1] = RY; + vResult.vector4_f32[2] = 0.0f; + vResult.vector4_f32[3] = 0.0f; + return vResult; +#elif defined(_XM_SSE_INTRINSICS_) + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + // Get the 2D Dot product of Incident-Normal + XMVECTOR IDotN = _mm_mul_ps(Incident,Normal); + XMVECTOR vTemp = _mm_shuffle_ps(IDotN,IDotN,_MM_SHUFFLE(1,1,1,1)); + IDotN = _mm_add_ss(IDotN,vTemp); + IDotN = _mm_shuffle_ps(IDotN,IDotN,_MM_SHUFFLE(0,0,0,0)); + // vTemp = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + vTemp = _mm_mul_ps(IDotN,IDotN); + vTemp = _mm_sub_ps(g_XMOne,vTemp); + vTemp = _mm_mul_ps(vTemp,RefractionIndex); + vTemp = _mm_mul_ps(vTemp,RefractionIndex); + vTemp = _mm_sub_ps(g_XMOne,vTemp); + // If any terms are <=0, sqrt() will fail, punt to zero + XMVECTOR vMask = _mm_cmpgt_ps(vTemp,g_XMZero); + // R = RefractionIndex * IDotN + sqrt(R) + vTemp = _mm_sqrt_ps(vTemp); + XMVECTOR vResult = _mm_mul_ps(RefractionIndex,IDotN); + vTemp = _mm_add_ps(vTemp,vResult); + // Result = RefractionIndex * Incident - Normal * R + vResult = _mm_mul_ps(RefractionIndex,Incident); + vTemp = _mm_mul_ps(vTemp,Normal); + vResult = _mm_sub_ps(vResult,vTemp); + vResult = _mm_and_ps(vResult,vMask); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Orthogonal +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_f32[0] = -V.vector4_f32[1]; + Result.vector4_f32[1] = V.vector4_f32[0]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,2,0,1)); + vResult = _mm_mul_ps(vResult,g_XMNegateX); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2AngleBetweenNormalsEst +( + FXMVECTOR N1, + FXMVECTOR N2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR NegativeOne; + XMVECTOR One; + XMVECTOR Result; + + Result = XMVector2Dot(N1, N2); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + Result = XMVectorClamp(Result, NegativeOne, One); + Result = XMVectorACosEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XMVector2Dot(N1,N2); + // Clamp to -1.0f to 1.0f + vResult = _mm_max_ps(vResult,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne);; + vResult = XMVectorACosEst(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2AngleBetweenNormals +( + FXMVECTOR N1, + FXMVECTOR N2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR NegativeOne; + XMVECTOR One; + XMVECTOR Result; + + Result = XMVector2Dot(N1, N2); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + Result = XMVectorClamp(Result, NegativeOne, One); + Result = XMVectorACos(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XMVector2Dot(N1,N2); + // Clamp to -1.0f to 1.0f + vResult = _mm_max_ps(vResult,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne);; + vResult = XMVectorACos(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2AngleBetweenVectors +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR L1; + XMVECTOR L2; + XMVECTOR Dot; + XMVECTOR CosAngle; + XMVECTOR NegativeOne; + XMVECTOR One; + XMVECTOR Result; + + L1 = XMVector2ReciprocalLength(V1); + L2 = XMVector2ReciprocalLength(V2); + + Dot = XMVector2Dot(V1, V2); + + L1 = XMVectorMultiply(L1, L2); + + CosAngle = XMVectorMultiply(Dot, L1); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + CosAngle = XMVectorClamp(CosAngle, NegativeOne, One); + + Result = XMVectorACos(CosAngle); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR L1; + XMVECTOR L2; + XMVECTOR Dot; + XMVECTOR CosAngle; + XMVECTOR Result; + L1 = XMVector2ReciprocalLength(V1); + L2 = XMVector2ReciprocalLength(V2); + Dot = XMVector2Dot(V1, V2); + L1 = _mm_mul_ps(L1, L2); + CosAngle = _mm_mul_ps(Dot, L1); + CosAngle = XMVectorClamp(CosAngle, g_XMNegativeOne,g_XMOne); + Result = XMVectorACos(CosAngle); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2LinePointDistance +( + FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2, + FXMVECTOR Point +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR PointVector; + XMVECTOR LineVector; + XMVECTOR ReciprocalLengthSq; + XMVECTOR PointProjectionScale; + XMVECTOR DistanceVector; + XMVECTOR Result; + + // Given a vector PointVector from LinePoint1 to Point and a vector + // LineVector from LinePoint1 to LinePoint2, the scaled distance + // PointProjectionScale from LinePoint1 to the perpendicular projection + // of PointVector onto the line is defined as: + // + // PointProjectionScale = dot(PointVector, LineVector) / LengthSq(LineVector) + + PointVector = XMVectorSubtract(Point, LinePoint1); + LineVector = XMVectorSubtract(LinePoint2, LinePoint1); + + ReciprocalLengthSq = XMVector2LengthSq(LineVector); + ReciprocalLengthSq = XMVectorReciprocal(ReciprocalLengthSq); + + PointProjectionScale = XMVector2Dot(PointVector, LineVector); + PointProjectionScale = XMVectorMultiply(PointProjectionScale, ReciprocalLengthSq); + + DistanceVector = XMVectorMultiply(LineVector, PointProjectionScale); + DistanceVector = XMVectorSubtract(PointVector, DistanceVector); + + Result = XMVector2Length(DistanceVector); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR PointVector = _mm_sub_ps(Point,LinePoint1); + XMVECTOR LineVector = _mm_sub_ps(LinePoint2,LinePoint1); + XMVECTOR ReciprocalLengthSq = XMVector2LengthSq(LineVector); + XMVECTOR vResult = XMVector2Dot(PointVector,LineVector); + vResult = _mm_div_ps(vResult,ReciprocalLengthSq); + vResult = _mm_mul_ps(vResult,LineVector); + vResult = _mm_sub_ps(PointVector,vResult); + vResult = XMVector2Length(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2IntersectLine +( + FXMVECTOR Line1Point1, + FXMVECTOR Line1Point2, + FXMVECTOR Line2Point1, + CXMVECTOR Line2Point2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V1; + XMVECTOR V2; + XMVECTOR V3; + XMVECTOR C1; + XMVECTOR C2; + XMVECTOR Result; + CONST XMVECTOR Zero = XMVectorZero(); + + V1 = XMVectorSubtract(Line1Point2, Line1Point1); + V2 = XMVectorSubtract(Line2Point2, Line2Point1); + V3 = XMVectorSubtract(Line1Point1, Line2Point1); + + C1 = XMVector2Cross(V1, V2); + C2 = XMVector2Cross(V2, V3); + + if (XMVector2NearEqual(C1, Zero, g_XMEpsilon.v)) + { + if (XMVector2NearEqual(C2, Zero, g_XMEpsilon.v)) + { + // Coincident + Result = g_XMInfinity.v; + } + else + { + // Parallel + Result = g_XMQNaN.v; + } + } + else + { + // Intersection point = Line1Point1 + V1 * (C2 / C1) + XMVECTOR Scale; + Scale = XMVectorReciprocal(C1); + Scale = XMVectorMultiply(C2, Scale); + Result = XMVectorMultiplyAdd(V1, Scale, Line1Point1); + } + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR V1 = _mm_sub_ps(Line1Point2, Line1Point1); + XMVECTOR V2 = _mm_sub_ps(Line2Point2, Line2Point1); + XMVECTOR V3 = _mm_sub_ps(Line1Point1, Line2Point1); + // Generate the cross products + XMVECTOR C1 = XMVector2Cross(V1, V2); + XMVECTOR C2 = XMVector2Cross(V2, V3); + // If C1 is not close to epsilon, use the calculated value + XMVECTOR vResultMask = _mm_setzero_ps(); + vResultMask = _mm_sub_ps(vResultMask,C1); + vResultMask = _mm_max_ps(vResultMask,C1); + // 0xFFFFFFFF if the calculated value is to be used + vResultMask = _mm_cmpgt_ps(vResultMask,g_XMEpsilon); + // If C1 is close to epsilon, which fail type is it? INFINITY or NAN? + XMVECTOR vFailMask = _mm_setzero_ps(); + vFailMask = _mm_sub_ps(vFailMask,C2); + vFailMask = _mm_max_ps(vFailMask,C2); + vFailMask = _mm_cmple_ps(vFailMask,g_XMEpsilon); + XMVECTOR vFail = _mm_and_ps(vFailMask,g_XMInfinity); + vFailMask = _mm_andnot_ps(vFailMask,g_XMQNaN); + // vFail is NAN or INF + vFail = _mm_or_ps(vFail,vFailMask); + // Intersection point = Line1Point1 + V1 * (C2 / C1) + XMVECTOR vResult = _mm_div_ps(C2,C1); + vResult = _mm_mul_ps(vResult,V1); + vResult = _mm_add_ps(vResult,Line1Point1); + // Use result, or failure value + vResult = _mm_and_ps(vResult,vResultMask); + vResultMask = _mm_andnot_ps(vResultMask,vFail); + vResult = _mm_or_ps(vResult,vResultMask); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2Transform +( + FXMVECTOR V, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Result; + + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); + + Result = XMVectorMultiplyAdd(Y, M.r[1], M.r[3]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,0,0,0)); + vResult = _mm_mul_ps(vResult,M.r[0]); + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + vTemp = _mm_mul_ps(vTemp,M.r[1]); + vResult = _mm_add_ps(vResult,vTemp); + vResult = _mm_add_ps(vResult,M.r[3]); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT4* XMVector2TransformStream +( + XMFLOAT4* pOutputStream, + UINT OutputStride, + CONST XMFLOAT2* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat2((XMFLOAT2*)pInputVector); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); +// Y = XMVectorReplicate(((XMFLOAT2*)pInputVector)->y); +// X = XMVectorReplicate(((XMFLOAT2*)pInputVector)->x); + + Result = XMVectorMultiplyAdd(Y, M.r[1], M.r[3]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + XMStoreFloat4((XMFLOAT4*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + UINT i; + const BYTE* pInputVector = (const BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + for (i = 0; i < VectorCount; i++) + { + XMVECTOR X = _mm_load_ps1(&reinterpret_cast(pInputVector)->x); + XMVECTOR vResult = _mm_load_ps1(&reinterpret_cast(pInputVector)->y); + vResult = _mm_mul_ps(vResult,M.r[1]); + vResult = _mm_add_ps(vResult,M.r[3]); + X = _mm_mul_ps(X,M.r[0]); + vResult = _mm_add_ps(vResult,X); + _mm_storeu_ps(reinterpret_cast(pOutputVector),vResult); + pInputVector += InputStride; + pOutputVector += OutputStride; + } + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT4* XMVector2TransformStreamNC +( + XMFLOAT4* pOutputStream, + UINT OutputStride, + CONST XMFLOAT2* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) || defined(_XM_SSE_INTRINSICS_) + return XMVector2TransformStream( pOutputStream, OutputStride, pInputStream, InputStride, VectorCount, M ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2TransformCoord +( + FXMVECTOR V, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR X; + XMVECTOR Y; + XMVECTOR InverseW; + XMVECTOR Result; + + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); + + Result = XMVectorMultiplyAdd(Y, M.r[1], M.r[3]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + InverseW = XMVectorSplatW(Result); + InverseW = XMVectorReciprocal(InverseW); + + Result = XMVectorMultiply(Result, InverseW); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,0,0,0)); + vResult = _mm_mul_ps(vResult,M.r[0]); + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + vTemp = _mm_mul_ps(vTemp,M.r[1]); + vResult = _mm_add_ps(vResult,vTemp); + vResult = _mm_add_ps(vResult,M.r[3]); + vTemp = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,3,3,3)); + vResult = _mm_div_ps(vResult,vTemp); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT2* XMVector2TransformCoordStream +( + XMFLOAT2* pOutputStream, + UINT OutputStride, + CONST XMFLOAT2* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR X; + XMVECTOR Y; + XMVECTOR InverseW; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat2((XMFLOAT2*)pInputVector); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); +// Y = XMVectorReplicate(((XMFLOAT2*)pInputVector)->y); +// X = XMVectorReplicate(((XMFLOAT2*)pInputVector)->x); + + Result = XMVectorMultiplyAdd(Y, M.r[1], M.r[3]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + InverseW = XMVectorSplatW(Result); + InverseW = XMVectorReciprocal(InverseW); + + Result = XMVectorMultiply(Result, InverseW); + + XMStoreFloat2((XMFLOAT2*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + UINT i; + const BYTE *pInputVector = (BYTE*)pInputStream; + BYTE *pOutputVector = (BYTE*)pOutputStream; + + for (i = 0; i < VectorCount; i++) + { + XMVECTOR X = _mm_load_ps1(&reinterpret_cast(pInputVector)->x); + XMVECTOR vResult = _mm_load_ps1(&reinterpret_cast(pInputVector)->y); + vResult = _mm_mul_ps(vResult,M.r[1]); + vResult = _mm_add_ps(vResult,M.r[3]); + X = _mm_mul_ps(X,M.r[0]); + vResult = _mm_add_ps(vResult,X); + X = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,3,3,3)); + vResult = _mm_div_ps(vResult,X); + _mm_store_sd(reinterpret_cast(pOutputVector),reinterpret_cast<__m128d *>(&vResult)[0]); + pInputVector += InputStride; + pOutputVector += OutputStride; + } + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector2TransformNormal +( + FXMVECTOR V, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Result; + + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); + + Result = XMVectorMultiply(Y, M.r[1]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,0,0,0)); + vResult = _mm_mul_ps(vResult,M.r[0]); + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + vTemp = _mm_mul_ps(vTemp,M.r[1]); + vResult = _mm_add_ps(vResult,vTemp); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT2* XMVector2TransformNormalStream +( + XMFLOAT2* pOutputStream, + UINT OutputStride, + CONST XMFLOAT2* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat2((XMFLOAT2*)pInputVector); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); +// Y = XMVectorReplicate(((XMFLOAT2*)pInputVector)->y); +// X = XMVectorReplicate(((XMFLOAT2*)pInputVector)->x); + + Result = XMVectorMultiply(Y, M.r[1]); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + XMStoreFloat2((XMFLOAT2*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + UINT i; + const BYTE*pInputVector = (const BYTE*)pInputStream; + BYTE *pOutputVector = (BYTE*)pOutputStream; + for (i = 0; i < VectorCount; i++) + { + XMVECTOR X = _mm_load_ps1(&reinterpret_cast(pInputVector)->x); + XMVECTOR vResult = _mm_load_ps1(&reinterpret_cast(pInputVector)->y); + vResult = _mm_mul_ps(vResult,M.r[1]); + X = _mm_mul_ps(X,M.r[0]); + vResult = _mm_add_ps(vResult,X); + _mm_store_sd(reinterpret_cast(pOutputVector),reinterpret_cast(&vResult)[0]); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +/**************************************************************************** + * + * 3D Vector + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3Equal +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1]) && (V1.vector4_f32[2] == V2.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&7)==7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector3EqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector3EqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && + (V1.vector4_f32[1] == V2.vector4_f32[1]) && + (V1.vector4_f32[2] == V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && + (V1.vector4_f32[1] != V2.vector4_f32[1]) && + (V1.vector4_f32[2] != V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); + int iTest = _mm_movemask_ps(vTemp)&7; + UINT CR = 0; + if (iTest==7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3EqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1]) && (V1.vector4_u32[2] == V2.vector4_u32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + return (((_mm_movemask_ps(reinterpret_cast(&vTemp)[0])&7)==7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector3EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector3EqualIntR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if ((V1.vector4_u32[0] == V2.vector4_u32[0]) && + (V1.vector4_u32[1] == V2.vector4_u32[1]) && + (V1.vector4_u32[2] == V2.vector4_u32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_u32[0] != V2.vector4_u32[0]) && + (V1.vector4_u32[1] != V2.vector4_u32[1]) && + (V1.vector4_u32[2] != V2.vector4_u32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + int iTemp = _mm_movemask_ps(reinterpret_cast(&vTemp)[0])&7; + UINT CR = 0; + if (iTemp==7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTemp) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3NearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT dx, dy, dz; + + dx = fabsf(V1.vector4_f32[0]-V2.vector4_f32[0]); + dy = fabsf(V1.vector4_f32[1]-V2.vector4_f32[1]); + dz = fabsf(V1.vector4_f32[2]-V2.vector4_f32[2]); + return (((dx <= Epsilon.vector4_f32[0]) && + (dy <= Epsilon.vector4_f32[1]) && + (dz <= Epsilon.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1,V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp,vDelta); + vTemp = _mm_max_ps(vTemp,vDelta); + vTemp = _mm_cmple_ps(vTemp,Epsilon); + // w is don't care + return (((_mm_movemask_ps(vTemp)&7)==0x7) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3NotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1]) || (V1.vector4_f32[2] != V2.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&7)!=7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAnyFalse(XMVector3EqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3NotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1]) || (V1.vector4_u32[2] != V2.vector4_u32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + return (((_mm_movemask_ps(reinterpret_cast(&vTemp)[0])&7)!=7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAnyFalse(XMVector3EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3Greater +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1]) && (V1.vector4_f32[2] > V2.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&7)==7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector3GreaterR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector3GreaterR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if ((V1.vector4_f32[0] > V2.vector4_f32[0]) && + (V1.vector4_f32[1] > V2.vector4_f32[1]) && + (V1.vector4_f32[2] > V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] <= V2.vector4_f32[0]) && + (V1.vector4_f32[1] <= V2.vector4_f32[1]) && + (V1.vector4_f32[2] <= V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2); + UINT CR = 0; + int iTest = _mm_movemask_ps(vTemp)&7; + if (iTest==7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3GreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1]) && (V1.vector4_f32[2] >= V2.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&7)==7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector3GreaterOrEqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector3GreaterOrEqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + UINT CR = 0; + if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && + (V1.vector4_f32[1] >= V2.vector4_f32[1]) && + (V1.vector4_f32[2] >= V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && + (V1.vector4_f32[1] < V2.vector4_f32[1]) && + (V1.vector4_f32[2] < V2.vector4_f32[2])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1,V2); + UINT CR = 0; + int iTest = _mm_movemask_ps(vTemp)&7; + if (iTest==7) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3Less +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1]) && (V1.vector4_f32[2] < V2.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmplt_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&7)==7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector3GreaterR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3LessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1]) && (V1.vector4_f32[2] <= V2.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmple_ps(V1,V2); + return (((_mm_movemask_ps(vTemp)&7)==7) != 0); +#else // _XM_VMX128_INTRINSICS_ + return XMComparisonAllTrue(XMVector3GreaterOrEqualR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3InBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) && + (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + // x,y and z in bounds? (w is don't care) + return (((_mm_movemask_ps(vTemp1)&0x7)==0x7) != 0); +#else + return XMComparisonAllInBounds(XMVector3InBoundsR(V, Bounds)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector3InBoundsR +( + FXMVECTOR V, + FXMVECTOR Bounds +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if ((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) && + (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2])) + { + CR = XM_CRMASK_CR6BOUNDS; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + // x,y and z in bounds? (w is don't care) + return ((_mm_movemask_ps(vTemp1)&0x7)==0x7) ? XM_CRMASK_CR6BOUNDS : 0; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3IsNaN +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + return (XMISNAN(V.vector4_f32[0]) || + XMISNAN(V.vector4_f32[1]) || + XMISNAN(V.vector4_f32[2])); + +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the exponent + __m128i vTempInf = _mm_and_si128(reinterpret_cast(&V)[0],g_XMInfinity); + // Mask off the mantissa + __m128i vTempNan = _mm_and_si128(reinterpret_cast(&V)[0],g_XMQNaNTest); + // Are any of the exponents == 0x7F800000? + vTempInf = _mm_cmpeq_epi32(vTempInf,g_XMInfinity); + // Are any of the mantissa's zero? (SSE2 doesn't have a neq test) + vTempNan = _mm_cmpeq_epi32(vTempNan,g_XMZero); + // Perform a not on the NaN test to be true on NON-zero mantissas + vTempNan = _mm_andnot_si128(vTempNan,vTempInf); + // If x, y or z are NaN, the signs are true after the merge above + return ((_mm_movemask_ps(reinterpret_cast(&vTempNan)[0])&7) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector3IsInfinite +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (XMISINF(V.vector4_f32[0]) || + XMISINF(V.vector4_f32[1]) || + XMISINF(V.vector4_f32[2])); +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + __m128 vTemp = _mm_and_ps(V,g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp,g_XMInfinity); + // If x,y or z are infinity, the signs are true. + return ((_mm_movemask_ps(vTemp)&7) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Dot +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT fValue = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1] + V1.vector4_f32[2] * V2.vector4_f32[2]; + XMVECTOR vResult = { + fValue, + fValue, + fValue, + fValue + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(V1,V2); + // x=Dot.vector4_f32[1], y=Dot.vector4_f32[2] + XMVECTOR vTemp = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(2,1,2,1)); + // Result.vector4_f32[0] = x+y + vDot = _mm_add_ss(vDot,vTemp); + // x=Dot.vector4_f32[2] + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + // Result.vector4_f32[0] = (x+y)+z + vDot = _mm_add_ss(vDot,vTemp); + // Splat x + return _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(0,0,0,0)); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Cross +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR vResult = { + (V1.vector4_f32[1] * V2.vector4_f32[2]) - (V1.vector4_f32[2] * V2.vector4_f32[1]), + (V1.vector4_f32[2] * V2.vector4_f32[0]) - (V1.vector4_f32[0] * V2.vector4_f32[2]), + (V1.vector4_f32[0] * V2.vector4_f32[1]) - (V1.vector4_f32[1] * V2.vector4_f32[0]), + 0.0f + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + // y1,z1,x1,w1 + XMVECTOR vTemp1 = _mm_shuffle_ps(V1,V1,_MM_SHUFFLE(3,0,2,1)); + // z2,x2,y2,w2 + XMVECTOR vTemp2 = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(3,1,0,2)); + // Perform the left operation + XMVECTOR vResult = _mm_mul_ps(vTemp1,vTemp2); + // z1,x1,y1,w1 + vTemp1 = _mm_shuffle_ps(vTemp1,vTemp1,_MM_SHUFFLE(3,0,2,1)); + // y2,z2,x2,w2 + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp2,_MM_SHUFFLE(3,1,0,2)); + // Perform the right operation + vTemp1 = _mm_mul_ps(vTemp1,vTemp2); + // Subract the right from left, and return answer + vResult = _mm_sub_ps(vResult,vTemp1); + // Set w to zero + return _mm_and_ps(vResult,g_XMMask3); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3LengthSq +( + FXMVECTOR V +) +{ + return XMVector3Dot(V, V); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3ReciprocalLengthEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorReciprocalSqrtEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and y + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,2,1,2)); + // x+z, y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + // y,y,y,y + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + // x+z+y,??,??,?? + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + // Splat the length squared + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + // Get the reciprocal + vLengthSq = _mm_rsqrt_ps(vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3ReciprocalLength +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorReciprocalSqrt(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(V,V); + // x=Dot.y, y=Dot.z + XMVECTOR vTemp = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(2,1,2,1)); + // Result.x = x+y + vDot = _mm_add_ss(vDot,vTemp); + // x=Dot.z + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + // Result.x = (x+y)+z + vDot = _mm_add_ss(vDot,vTemp); + // Splat x + vDot = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(0,0,0,0)); + // Get the reciprocal + vDot = _mm_sqrt_ps(vDot); + // Get the reciprocal + vDot = _mm_div_ps(g_XMOne,vDot); + return vDot; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3LengthEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorSqrtEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and y + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,2,1,2)); + // x+z, y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + // y,y,y,y + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + // x+z+y,??,??,?? + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + // Splat the length squared + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + // Get the length + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Length +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector3LengthSq(V); + Result = XMVectorSqrt(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and y + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,2,1,2)); + // x+z, y + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + // y,y,y,y + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + // x+z+y,??,??,?? + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + // Splat the length squared + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + // Get the length + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// XMVector3NormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +XMFINLINE XMVECTOR XMVector3NormalizeEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector3ReciprocalLength(V); + Result = XMVectorMultiply(V, Result); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product + XMVECTOR vDot = _mm_mul_ps(V,V); + // x=Dot.y, y=Dot.z + XMVECTOR vTemp = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(2,1,2,1)); + // Result.x = x+y + vDot = _mm_add_ss(vDot,vTemp); + // x=Dot.z + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + // Result.x = (x+y)+z + vDot = _mm_add_ss(vDot,vTemp); + // Splat x + vDot = _mm_shuffle_ps(vDot,vDot,_MM_SHUFFLE(0,0,0,0)); + // Get the reciprocal + vDot = _mm_rsqrt_ps(vDot); + // Perform the normalization + vDot = _mm_mul_ps(vDot,V); + return vDot; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Normalize +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT fLengthSq; + XMVECTOR vResult; + + fLengthSq = sqrtf((V.vector4_f32[0]*V.vector4_f32[0])+(V.vector4_f32[1]*V.vector4_f32[1])+(V.vector4_f32[2]*V.vector4_f32[2])); + // Prevent divide by zero + if (fLengthSq) { + fLengthSq = 1.0f/fLengthSq; + } + + vResult.vector4_f32[0] = V.vector4_f32[0]*fLengthSq; + vResult.vector4_f32[1] = V.vector4_f32[1]*fLengthSq; + vResult.vector4_f32[2] = V.vector4_f32[2]*fLengthSq; + vResult.vector4_f32[3] = V.vector4_f32[3]*fLengthSq; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y and z only + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,1,2,1)); + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vTemp = _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(1,1,1,1)); + vLengthSq = _mm_add_ss(vLengthSq,vTemp); + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(0,0,0,0)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq,g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V,vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult,vLengthSq); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3ClampLength +( + FXMVECTOR V, + FLOAT LengthMin, + FLOAT LengthMax +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR ClampMax; + XMVECTOR ClampMin; + + ClampMax = XMVectorReplicate(LengthMax); + ClampMin = XMVectorReplicate(LengthMin); + + return XMVector3ClampLengthV(V, ClampMin, ClampMax); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR ClampMax = _mm_set_ps1(LengthMax); + XMVECTOR ClampMin = _mm_set_ps1(LengthMin); + return XMVector3ClampLengthV(V,ClampMin,ClampMax); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3ClampLengthV +( + FXMVECTOR V, + FXMVECTOR LengthMin, + FXMVECTOR LengthMax +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR ClampLength; + XMVECTOR LengthSq; + XMVECTOR RcpLength; + XMVECTOR Length; + XMVECTOR Normal; + XMVECTOR Zero; + XMVECTOR InfiniteLength; + XMVECTOR ZeroLength; + XMVECTOR Select; + XMVECTOR ControlMax; + XMVECTOR ControlMin; + XMVECTOR Control; + XMVECTOR Result; + + XMASSERT((LengthMin.vector4_f32[1] == LengthMin.vector4_f32[0]) && (LengthMin.vector4_f32[2] == LengthMin.vector4_f32[0])); + XMASSERT((LengthMax.vector4_f32[1] == LengthMax.vector4_f32[0]) && (LengthMax.vector4_f32[2] == LengthMax.vector4_f32[0])); + XMASSERT(XMVector3GreaterOrEqual(LengthMin, XMVectorZero())); + XMASSERT(XMVector3GreaterOrEqual(LengthMax, XMVectorZero())); + XMASSERT(XMVector3GreaterOrEqual(LengthMax, LengthMin)); + + LengthSq = XMVector3LengthSq(V); + + Zero = XMVectorZero(); + + RcpLength = XMVectorReciprocalSqrt(LengthSq); + + InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); + ZeroLength = XMVectorEqual(LengthSq, Zero); + + Normal = XMVectorMultiply(V, RcpLength); + + Length = XMVectorMultiply(LengthSq, RcpLength); + + Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + + ControlMax = XMVectorGreater(Length, LengthMax); + ControlMin = XMVectorLess(Length, LengthMin); + + ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + + Result = XMVectorMultiply(Normal, ClampLength); + + // Preserve the original vector (with no precision loss) if the length falls within the given range + Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR ClampLength; + XMVECTOR LengthSq; + XMVECTOR RcpLength; + XMVECTOR Length; + XMVECTOR Normal; + XMVECTOR InfiniteLength; + XMVECTOR ZeroLength; + XMVECTOR Select; + XMVECTOR ControlMax; + XMVECTOR ControlMin; + XMVECTOR Control; + XMVECTOR Result; + + XMASSERT((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetZ(LengthMin) == XMVectorGetX(LengthMin))); + XMASSERT((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetZ(LengthMax) == XMVectorGetX(LengthMax))); + XMASSERT(XMVector3GreaterOrEqual(LengthMin, g_XMZero)); + XMASSERT(XMVector3GreaterOrEqual(LengthMax, g_XMZero)); + XMASSERT(XMVector3GreaterOrEqual(LengthMax, LengthMin)); + + LengthSq = XMVector3LengthSq(V); + RcpLength = XMVectorReciprocalSqrt(LengthSq); + InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity); + ZeroLength = XMVectorEqual(LengthSq,g_XMZero); + Normal = _mm_mul_ps(V, RcpLength); + Length = _mm_mul_ps(LengthSq, RcpLength); + Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + ControlMax = XMVectorGreater(Length, LengthMax); + ControlMin = XMVectorLess(Length, LengthMin); + ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + Result = _mm_mul_ps(Normal, ClampLength); + // Preserve the original vector (with no precision loss) if the length falls within the given range + Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Reflect +( + FXMVECTOR Incident, + FXMVECTOR Normal +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + Result = XMVector3Dot(Incident, Normal); + Result = XMVectorAdd(Result, Result); + Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + XMVECTOR Result = XMVector3Dot(Incident, Normal); + Result = _mm_add_ps(Result, Result); + Result = _mm_mul_ps(Result, Normal); + Result = _mm_sub_ps(Incident,Result); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Refract +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FLOAT RefractionIndex +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Index; + Index = XMVectorReplicate(RefractionIndex); + return XMVector3RefractV(Incident, Normal, Index); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Index = _mm_set_ps1(RefractionIndex); + return XMVector3RefractV(Incident,Normal,Index); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3RefractV +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FXMVECTOR RefractionIndex +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR IDotN; + XMVECTOR R; + CONST XMVECTOR Zero = XMVectorZero(); + + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + + IDotN = XMVector3Dot(Incident, Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + R = XMVectorNegativeMultiplySubtract(IDotN, IDotN, g_XMOne.v); + R = XMVectorMultiply(R, RefractionIndex); + R = XMVectorNegativeMultiplySubtract(R, RefractionIndex, g_XMOne.v); + + if (XMVector4LessOrEqual(R, Zero)) + { + // Total internal reflection + return Zero; + } + else + { + XMVECTOR Result; + + // R = RefractionIndex * IDotN + sqrt(R) + R = XMVectorSqrt(R); + R = XMVectorMultiplyAdd(RefractionIndex, IDotN, R); + + // Result = RefractionIndex * Incident - Normal * R + Result = XMVectorMultiply(RefractionIndex, Incident); + Result = XMVectorNegativeMultiplySubtract(Normal, R, Result); + + return Result; + } + +#elif defined(_XM_SSE_INTRINSICS_) + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + XMVECTOR IDotN = XMVector3Dot(Incident, Normal); + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + XMVECTOR R = _mm_mul_ps(IDotN, IDotN); + R = _mm_sub_ps(g_XMOne,R); + R = _mm_mul_ps(R, RefractionIndex); + R = _mm_mul_ps(R, RefractionIndex); + R = _mm_sub_ps(g_XMOne,R); + + XMVECTOR vResult = _mm_cmple_ps(R,g_XMZero); + if (_mm_movemask_ps(vResult)==0x0f) + { + // Total internal reflection + vResult = g_XMZero; + } + else + { + // R = RefractionIndex * IDotN + sqrt(R) + R = _mm_sqrt_ps(R); + vResult = _mm_mul_ps(RefractionIndex,IDotN); + R = _mm_add_ps(R,vResult); + // Result = RefractionIndex * Incident - Normal * R + vResult = _mm_mul_ps(RefractionIndex, Incident); + R = _mm_mul_ps(R,Normal); + vResult = _mm_sub_ps(vResult,R); + } + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Orthogonal +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR NegativeV; + XMVECTOR Z, YZYY; + XMVECTOR ZIsNegative, YZYYIsNegative; + XMVECTOR S, D; + XMVECTOR R0, R1; + XMVECTOR Select; + XMVECTOR Zero; + XMVECTOR Result; + static CONST XMVECTORU32 Permute1X0X0X0X = {XM_PERMUTE_1X, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X}; + static CONST XMVECTORU32 Permute0Y0Z0Y0Y= {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_0Y}; + + Zero = XMVectorZero(); + Z = XMVectorSplatZ(V); + YZYY = XMVectorPermute(V, V, Permute0Y0Z0Y0Y.v); + + NegativeV = XMVectorSubtract(Zero, V); + + ZIsNegative = XMVectorLess(Z, Zero); + YZYYIsNegative = XMVectorLess(YZYY, Zero); + + S = XMVectorAdd(YZYY, Z); + D = XMVectorSubtract(YZYY, Z); + + Select = XMVectorEqualInt(ZIsNegative, YZYYIsNegative); + + R0 = XMVectorPermute(NegativeV, S, Permute1X0X0X0X.v); + R1 = XMVectorPermute(V, D, Permute1X0X0X0X.v); + + Result = XMVectorSelect(R1, R0, Select); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR NegativeV; + XMVECTOR Z, YZYY; + XMVECTOR ZIsNegative, YZYYIsNegative; + XMVECTOR S, D; + XMVECTOR R0, R1; + XMVECTOR Select; + XMVECTOR Zero; + XMVECTOR Result; + static CONST XMVECTORI32 Permute1X0X0X0X = {XM_PERMUTE_1X, XM_PERMUTE_0X, XM_PERMUTE_0X, XM_PERMUTE_0X}; + static CONST XMVECTORI32 Permute0Y0Z0Y0Y= {XM_PERMUTE_0Y, XM_PERMUTE_0Z, XM_PERMUTE_0Y, XM_PERMUTE_0Y}; + + Zero = XMVectorZero(); + Z = XMVectorSplatZ(V); + YZYY = XMVectorPermute(V, V, Permute0Y0Z0Y0Y); + + NegativeV = _mm_sub_ps(Zero, V); + + ZIsNegative = XMVectorLess(Z, Zero); + YZYYIsNegative = XMVectorLess(YZYY, Zero); + + S = _mm_add_ps(YZYY, Z); + D = _mm_sub_ps(YZYY, Z); + + Select = XMVectorEqualInt(ZIsNegative, YZYYIsNegative); + + R0 = XMVectorPermute(NegativeV, S, Permute1X0X0X0X); + R1 = XMVectorPermute(V, D,Permute1X0X0X0X); + Result = XMVectorSelect(R1, R0, Select); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3AngleBetweenNormalsEst +( + FXMVECTOR N1, + FXMVECTOR N2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + XMVECTOR NegativeOne; + XMVECTOR One; + + Result = XMVector3Dot(N1, N2); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + Result = XMVectorClamp(Result, NegativeOne, One); + Result = XMVectorACosEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XMVector3Dot(N1,N2); + // Clamp to -1.0f to 1.0f + vResult = _mm_max_ps(vResult,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + vResult = XMVectorACosEst(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3AngleBetweenNormals +( + FXMVECTOR N1, + FXMVECTOR N2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + XMVECTOR NegativeOne; + XMVECTOR One; + + Result = XMVector3Dot(N1, N2); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + Result = XMVectorClamp(Result, NegativeOne, One); + Result = XMVectorACos(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XMVector3Dot(N1,N2); + // Clamp to -1.0f to 1.0f + vResult = _mm_max_ps(vResult,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne); + vResult = XMVectorACos(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3AngleBetweenVectors +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR L1; + XMVECTOR L2; + XMVECTOR Dot; + XMVECTOR CosAngle; + XMVECTOR NegativeOne; + XMVECTOR One; + XMVECTOR Result; + + L1 = XMVector3ReciprocalLength(V1); + L2 = XMVector3ReciprocalLength(V2); + + Dot = XMVector3Dot(V1, V2); + + L1 = XMVectorMultiply(L1, L2); + + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + + CosAngle = XMVectorMultiply(Dot, L1); + + CosAngle = XMVectorClamp(CosAngle, NegativeOne, One); + + Result = XMVectorACos(CosAngle); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR L1; + XMVECTOR L2; + XMVECTOR Dot; + XMVECTOR CosAngle; + XMVECTOR Result; + + L1 = XMVector3ReciprocalLength(V1); + L2 = XMVector3ReciprocalLength(V2); + Dot = XMVector3Dot(V1, V2); + L1 = _mm_mul_ps(L1, L2); + CosAngle = _mm_mul_ps(Dot, L1); + CosAngle = XMVectorClamp(CosAngle,g_XMNegativeOne,g_XMOne); + Result = XMVectorACos(CosAngle); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3LinePointDistance +( + FXMVECTOR LinePoint1, + FXMVECTOR LinePoint2, + FXMVECTOR Point +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR PointVector; + XMVECTOR LineVector; + XMVECTOR ReciprocalLengthSq; + XMVECTOR PointProjectionScale; + XMVECTOR DistanceVector; + XMVECTOR Result; + + // Given a vector PointVector from LinePoint1 to Point and a vector + // LineVector from LinePoint1 to LinePoint2, the scaled distance + // PointProjectionScale from LinePoint1 to the perpendicular projection + // of PointVector onto the line is defined as: + // + // PointProjectionScale = dot(PointVector, LineVector) / LengthSq(LineVector) + + PointVector = XMVectorSubtract(Point, LinePoint1); + LineVector = XMVectorSubtract(LinePoint2, LinePoint1); + + ReciprocalLengthSq = XMVector3LengthSq(LineVector); + ReciprocalLengthSq = XMVectorReciprocal(ReciprocalLengthSq); + + PointProjectionScale = XMVector3Dot(PointVector, LineVector); + PointProjectionScale = XMVectorMultiply(PointProjectionScale, ReciprocalLengthSq); + + DistanceVector = XMVectorMultiply(LineVector, PointProjectionScale); + DistanceVector = XMVectorSubtract(PointVector, DistanceVector); + + Result = XMVector3Length(DistanceVector); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR PointVector = _mm_sub_ps(Point,LinePoint1); + XMVECTOR LineVector = _mm_sub_ps(LinePoint2,LinePoint1); + XMVECTOR ReciprocalLengthSq = XMVector3LengthSq(LineVector); + XMVECTOR vResult = XMVector3Dot(PointVector,LineVector); + vResult = _mm_div_ps(vResult,ReciprocalLengthSq); + vResult = _mm_mul_ps(vResult,LineVector); + vResult = _mm_sub_ps(PointVector,vResult); + vResult = XMVector3Length(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE VOID XMVector3ComponentsFromNormal +( + XMVECTOR* pParallel, + XMVECTOR* pPerpendicular, + FXMVECTOR V, + FXMVECTOR Normal +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Parallel; + XMVECTOR Scale; + + XMASSERT(pParallel); + XMASSERT(pPerpendicular); + + Scale = XMVector3Dot(V, Normal); + + Parallel = XMVectorMultiply(Normal, Scale); + + *pParallel = Parallel; + *pPerpendicular = XMVectorSubtract(V, Parallel); + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pParallel); + XMASSERT(pPerpendicular); + XMVECTOR Scale = XMVector3Dot(V, Normal); + XMVECTOR Parallel = _mm_mul_ps(Normal,Scale); + *pParallel = Parallel; + *pPerpendicular = _mm_sub_ps(V,Parallel); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Transform a vector using a rotation expressed as a unit quaternion + +XMFINLINE XMVECTOR XMVector3Rotate +( + FXMVECTOR V, + FXMVECTOR RotationQuaternion +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR A; + XMVECTOR Q; + XMVECTOR Result; + + A = XMVectorSelect(g_XMSelect1110.v, V, g_XMSelect1110.v); + Q = XMQuaternionConjugate(RotationQuaternion); + Result = XMQuaternionMultiply(Q, A); + Result = XMQuaternionMultiply(Result, RotationQuaternion); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR A; + XMVECTOR Q; + XMVECTOR Result; + + A = _mm_and_ps(V,g_XMMask3); + Q = XMQuaternionConjugate(RotationQuaternion); + Result = XMQuaternionMultiply(Q, A); + Result = XMQuaternionMultiply(Result, RotationQuaternion); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Transform a vector using the inverse of a rotation expressed as a unit quaternion + +XMFINLINE XMVECTOR XMVector3InverseRotate +( + FXMVECTOR V, + FXMVECTOR RotationQuaternion +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR A; + XMVECTOR Q; + XMVECTOR Result; + + A = XMVectorSelect(g_XMSelect1110.v, V, g_XMSelect1110.v); + Result = XMQuaternionMultiply(RotationQuaternion, A); + Q = XMQuaternionConjugate(RotationQuaternion); + Result = XMQuaternionMultiply(Result, Q); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR A; + XMVECTOR Q; + XMVECTOR Result; + A = _mm_and_ps(V,g_XMMask3); + Result = XMQuaternionMultiply(RotationQuaternion, A); + Q = XMQuaternionConjugate(RotationQuaternion); + Result = XMQuaternionMultiply(Result, Q); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Transform +( + FXMVECTOR V, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR Result; + + Z = XMVectorSplatZ(V); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); + + Result = XMVectorMultiplyAdd(Z, M.r[2], M.r[3]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,0,0,0)); + vResult = _mm_mul_ps(vResult,M.r[0]); + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + vTemp = _mm_mul_ps(vTemp,M.r[1]); + vResult = _mm_add_ps(vResult,vTemp); + vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + vTemp = _mm_mul_ps(vTemp,M.r[2]); + vResult = _mm_add_ps(vResult,vTemp); + vResult = _mm_add_ps(vResult,M.r[3]); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT4* XMVector3TransformStream +( + XMFLOAT4* pOutputStream, + UINT OutputStride, + CONST XMFLOAT3* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat3((XMFLOAT3*)pInputVector); + Z = XMVectorSplatZ(V); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); + + Result = XMVectorMultiplyAdd(Z, M.r[2], M.r[3]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + XMStoreFloat4((XMFLOAT4*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + UINT i; + const BYTE* pInputVector = (const BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + for (i = 0; i < VectorCount; i++) + { + XMVECTOR X = _mm_load_ps1(&reinterpret_cast(pInputVector)->x); + XMVECTOR Y = _mm_load_ps1(&reinterpret_cast(pInputVector)->y); + XMVECTOR vResult = _mm_load_ps1(&reinterpret_cast(pInputVector)->z); + vResult = _mm_mul_ps(vResult,M.r[2]); + vResult = _mm_add_ps(vResult,M.r[3]); + Y = _mm_mul_ps(Y,M.r[1]); + vResult = _mm_add_ps(vResult,Y); + X = _mm_mul_ps(X,M.r[0]); + vResult = _mm_add_ps(vResult,X); + _mm_storeu_ps(reinterpret_cast(pOutputVector),vResult); + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT4* XMVector3TransformStreamNC +( + XMFLOAT4* pOutputStream, + UINT OutputStride, + CONST XMFLOAT3* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) || defined(XM_NO_MISALIGNED_VECTOR_ACCESS) || defined(_XM_SSE_INTRINSICS_) + return XMVector3TransformStream( pOutputStream, OutputStride, pInputStream, InputStride, VectorCount, M ); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3TransformCoord +( + FXMVECTOR V, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR InverseW; + XMVECTOR Result; + + Z = XMVectorSplatZ(V); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); + + Result = XMVectorMultiplyAdd(Z, M.r[2], M.r[3]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + InverseW = XMVectorSplatW(Result); + InverseW = XMVectorReciprocal(InverseW); + + Result = XMVectorMultiply(Result, InverseW); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,0,0,0)); + vResult = _mm_mul_ps(vResult,M.r[0]); + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + vTemp = _mm_mul_ps(vTemp,M.r[1]); + vResult = _mm_add_ps(vResult,vTemp); + vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + vTemp = _mm_mul_ps(vTemp,M.r[2]); + vResult = _mm_add_ps(vResult,vTemp); + vResult = _mm_add_ps(vResult,M.r[3]); + vTemp = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,3,3,3)); + vResult = _mm_div_ps(vResult,vTemp); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT3* XMVector3TransformCoordStream +( + XMFLOAT3* pOutputStream, + UINT OutputStride, + CONST XMFLOAT3* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR InverseW; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat3((XMFLOAT3*)pInputVector); + Z = XMVectorSplatZ(V); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); +// Z = XMVectorReplicate(((XMFLOAT3*)pInputVector)->z); +// Y = XMVectorReplicate(((XMFLOAT3*)pInputVector)->y); +// X = XMVectorReplicate(((XMFLOAT3*)pInputVector)->x); + + Result = XMVectorMultiplyAdd(Z, M.r[2], M.r[3]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + InverseW = XMVectorSplatW(Result); + InverseW = XMVectorReciprocal(InverseW); + + Result = XMVectorMultiply(Result, InverseW); + + XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + UINT i; + const BYTE *pInputVector = (BYTE*)pInputStream; + BYTE *pOutputVector = (BYTE*)pOutputStream; + + for (i = 0; i < VectorCount; i++) + { + XMVECTOR X = _mm_load_ps1(&reinterpret_cast(pInputVector)->x); + XMVECTOR Y = _mm_load_ps1(&reinterpret_cast(pInputVector)->y); + XMVECTOR vResult = _mm_load_ps1(&reinterpret_cast(pInputVector)->z); + vResult = _mm_mul_ps(vResult,M.r[2]); + vResult = _mm_add_ps(vResult,M.r[3]); + Y = _mm_mul_ps(Y,M.r[1]); + vResult = _mm_add_ps(vResult,Y); + X = _mm_mul_ps(X,M.r[0]); + vResult = _mm_add_ps(vResult,X); + + X = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(3,3,3,3)); + vResult = _mm_div_ps(vResult,X); + _mm_store_ss(&reinterpret_cast(pOutputVector)->x,vResult); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + _mm_store_ss(&reinterpret_cast(pOutputVector)->y,vResult); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + _mm_store_ss(&reinterpret_cast(pOutputVector)->z,vResult); + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3TransformNormal +( + FXMVECTOR V, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR Result; + + Z = XMVectorSplatZ(V); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); + + Result = XMVectorMultiply(Z, M.r[2]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,0,0,0)); + vResult = _mm_mul_ps(vResult,M.r[0]); + XMVECTOR vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + vTemp = _mm_mul_ps(vTemp,M.r[1]); + vResult = _mm_add_ps(vResult,vTemp); + vTemp = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + vTemp = _mm_mul_ps(vTemp,M.r[2]); + vResult = _mm_add_ps(vResult,vTemp); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT3* XMVector3TransformNormalStream +( + XMFLOAT3* pOutputStream, + UINT OutputStride, + CONST XMFLOAT3* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat3((XMFLOAT3*)pInputVector); + Z = XMVectorSplatZ(V); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); +// Z = XMVectorReplicate(((XMFLOAT3*)pInputVector)->z); +// Y = XMVectorReplicate(((XMFLOAT3*)pInputVector)->y); +// X = XMVectorReplicate(((XMFLOAT3*)pInputVector)->x); + + Result = XMVectorMultiply(Z, M.r[2]); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + UINT i; + const BYTE *pInputVector = (BYTE*)pInputStream; + BYTE *pOutputVector = (BYTE*)pOutputStream; + + for (i = 0; i < VectorCount; i++) + { + XMVECTOR X = _mm_load_ps1(&reinterpret_cast(pInputVector)->x); + XMVECTOR Y = _mm_load_ps1(&reinterpret_cast(pInputVector)->y); + XMVECTOR vResult = _mm_load_ps1(&reinterpret_cast(pInputVector)->z); + vResult = _mm_mul_ps(vResult,M.r[2]); + Y = _mm_mul_ps(Y,M.r[1]); + vResult = _mm_add_ps(vResult,Y); + X = _mm_mul_ps(X,M.r[0]); + vResult = _mm_add_ps(vResult,X); + _mm_store_ss(&reinterpret_cast(pOutputVector)->x,vResult); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + _mm_store_ss(&reinterpret_cast(pOutputVector)->y,vResult); + vResult = _mm_shuffle_ps(vResult,vResult,_MM_SHUFFLE(0,3,2,1)); + _mm_store_ss(&reinterpret_cast(pOutputVector)->z,vResult); + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMVECTOR XMVector3Project +( + FXMVECTOR V, + FLOAT ViewportX, + FLOAT ViewportY, + FLOAT ViewportWidth, + FLOAT ViewportHeight, + FLOAT ViewportMinZ, + FLOAT ViewportMaxZ, + CXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX Transform; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR Result; + FLOAT HalfViewportWidth = ViewportWidth * 0.5f; + FLOAT HalfViewportHeight = ViewportHeight * 0.5f; + + Scale = XMVectorSet(HalfViewportWidth, + -HalfViewportHeight, + ViewportMaxZ - ViewportMinZ, + 0.0f); + + Offset = XMVectorSet(ViewportX + HalfViewportWidth, + ViewportY + HalfViewportHeight, + ViewportMinZ, + 0.0f); + + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + + Result = XMVector3TransformCoord(V, Transform); + + Result = XMVectorMultiplyAdd(Result, Scale, Offset); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX Transform; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR Result; + FLOAT HalfViewportWidth = ViewportWidth * 0.5f; + FLOAT HalfViewportHeight = ViewportHeight * 0.5f; + + Scale = XMVectorSet(HalfViewportWidth, + -HalfViewportHeight, + ViewportMaxZ - ViewportMinZ, + 0.0f); + + Offset = XMVectorSet(ViewportX + HalfViewportWidth, + ViewportY + HalfViewportHeight, + ViewportMinZ, + 0.0f); + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Result = XMVector3TransformCoord(V, Transform); + Result = _mm_mul_ps(Result,Scale); + Result = _mm_add_ps(Result,Offset); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT3* XMVector3ProjectStream +( + XMFLOAT3* pOutputStream, + UINT OutputStride, + CONST XMFLOAT3* pInputStream, + UINT InputStride, + UINT VectorCount, + FLOAT ViewportX, + FLOAT ViewportY, + FLOAT ViewportWidth, + FLOAT ViewportHeight, + FLOAT ViewportMinZ, + FLOAT ViewportMaxZ, + CXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX Transform; + XMVECTOR V; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR Result; + UINT i; + FLOAT HalfViewportWidth = ViewportWidth * 0.5f; + FLOAT HalfViewportHeight = ViewportHeight * 0.5f; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + Scale = XMVectorSet(HalfViewportWidth, + -HalfViewportHeight, + ViewportMaxZ - ViewportMinZ, + 1.0f); + + Offset = XMVectorSet(ViewportX + HalfViewportWidth, + ViewportY + HalfViewportHeight, + ViewportMinZ, + 0.0f); + + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat3((XMFLOAT3*)pInputVector); + + Result = XMVector3TransformCoord(V, Transform); + + Result = XMVectorMultiplyAdd(Result, Scale, Offset); + + XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + XMMATRIX Transform; + XMVECTOR V; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR Result; + UINT i; + FLOAT HalfViewportWidth = ViewportWidth * 0.5f; + FLOAT HalfViewportHeight = ViewportHeight * 0.5f; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + Scale = XMVectorSet(HalfViewportWidth, + -HalfViewportHeight, + ViewportMaxZ - ViewportMinZ, + 1.0f); + + Offset = XMVectorSet(ViewportX + HalfViewportWidth, + ViewportY + HalfViewportHeight, + ViewportMinZ, + 0.0f); + + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat3((XMFLOAT3*)pInputVector); + + Result = XMVector3TransformCoord(V, Transform); + + Result = _mm_mul_ps(Result,Scale); + Result = _mm_add_ps(Result,Offset); + XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); + pInputVector += InputStride; + pOutputVector += OutputStride; + } + return pOutputStream; + +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector3Unproject +( + FXMVECTOR V, + FLOAT ViewportX, + FLOAT ViewportY, + FLOAT ViewportWidth, + FLOAT ViewportHeight, + FLOAT ViewportMinZ, + FLOAT ViewportMaxZ, + CXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX Transform; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR Determinant; + XMVECTOR Result; + CONST XMVECTOR D = XMVectorSet(-1.0f, 1.0f, 0.0f, 0.0f); + + Scale = XMVectorSet(ViewportWidth * 0.5f, + -ViewportHeight * 0.5f, + ViewportMaxZ - ViewportMinZ, + 1.0f); + Scale = XMVectorReciprocal(Scale); + + Offset = XMVectorSet(-ViewportX, + -ViewportY, + -ViewportMinZ, + 0.0f); + Offset = XMVectorMultiplyAdd(Scale, Offset, D); + + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(&Determinant, Transform); + + Result = XMVectorMultiplyAdd(V, Scale, Offset); + + Result = XMVector3TransformCoord(Result, Transform); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMMATRIX Transform; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR Determinant; + XMVECTOR Result; + CONST XMVECTORF32 D = {-1.0f, 1.0f, 0.0f, 0.0f}; + + Scale = XMVectorSet(ViewportWidth * 0.5f, + -ViewportHeight * 0.5f, + ViewportMaxZ - ViewportMinZ, + 1.0f); + Scale = XMVectorReciprocal(Scale); + + Offset = XMVectorSet(-ViewportX, + -ViewportY, + -ViewportMinZ, + 0.0f); + Offset = _mm_mul_ps(Offset,Scale); + Offset = _mm_add_ps(Offset,D); + + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(&Determinant, Transform); + + Result = _mm_mul_ps(V,Scale); + Result = _mm_add_ps(Result,Offset); + + Result = XMVector3TransformCoord(Result, Transform); + + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT3* XMVector3UnprojectStream +( + XMFLOAT3* pOutputStream, + UINT OutputStride, + CONST XMFLOAT3* pInputStream, + UINT InputStride, + UINT VectorCount, + FLOAT ViewportX, + FLOAT ViewportY, + FLOAT ViewportWidth, + FLOAT ViewportHeight, + FLOAT ViewportMinZ, + FLOAT ViewportMaxZ, + CXMMATRIX Projection, + CXMMATRIX View, + CXMMATRIX World) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMMATRIX Transform; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR V; + XMVECTOR Determinant; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + CONST XMVECTOR D = XMVectorSet(-1.0f, 1.0f, 0.0f, 0.0f); + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + Scale = XMVectorSet(ViewportWidth * 0.5f, + -ViewportHeight * 0.5f, + ViewportMaxZ - ViewportMinZ, + 1.0f); + Scale = XMVectorReciprocal(Scale); + + Offset = XMVectorSet(-ViewportX, + -ViewportY, + -ViewportMinZ, + 0.0f); + Offset = XMVectorMultiplyAdd(Scale, Offset, D); + + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(&Determinant, Transform); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat3((XMFLOAT3*)pInputVector); + + Result = XMVectorMultiplyAdd(V, Scale, Offset); + + Result = XMVector3TransformCoord(Result, Transform); + + XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + XMMATRIX Transform; + XMVECTOR Scale; + XMVECTOR Offset; + XMVECTOR V; + XMVECTOR Determinant; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + CONST XMVECTORF32 D = {-1.0f, 1.0f, 0.0f, 0.0f}; + + Scale = XMVectorSet(ViewportWidth * 0.5f, + -ViewportHeight * 0.5f, + ViewportMaxZ - ViewportMinZ, + 1.0f); + Scale = XMVectorReciprocal(Scale); + + Offset = XMVectorSet(-ViewportX, + -ViewportY, + -ViewportMinZ, + 0.0f); + Offset = _mm_mul_ps(Offset,Scale); + Offset = _mm_add_ps(Offset,D); + + Transform = XMMatrixMultiply(World, View); + Transform = XMMatrixMultiply(Transform, Projection); + Transform = XMMatrixInverse(&Determinant, Transform); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat3((XMFLOAT3*)pInputVector); + + Result = XMVectorMultiplyAdd(V, Scale, Offset); + + Result = XMVector3TransformCoord(Result, Transform); + + XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +/**************************************************************************** + * + * 4D Vector + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ +// Comparison operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4Equal +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] == V2.vector4_f32[0]) && (V1.vector4_f32[1] == V2.vector4_f32[1]) && (V1.vector4_f32[2] == V2.vector4_f32[2]) && (V1.vector4_f32[3] == V2.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); + return ((_mm_movemask_ps(vTemp)==0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4EqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector4EqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + UINT CR = 0; + + if ((V1.vector4_f32[0] == V2.vector4_f32[0]) && + (V1.vector4_f32[1] == V2.vector4_f32[1]) && + (V1.vector4_f32[2] == V2.vector4_f32[2]) && + (V1.vector4_f32[3] == V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] != V2.vector4_f32[0]) && + (V1.vector4_f32[1] != V2.vector4_f32[1]) && + (V1.vector4_f32[2] != V2.vector4_f32[2]) && + (V1.vector4_f32[3] != V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpeq_ps(V1,V2); + int iTest = _mm_movemask_ps(vTemp); + UINT CR = 0; + if (iTest==0xf) // All equal? + { + CR = XM_CRMASK_CR6TRUE; + } + else if (iTest==0) // All not equal? + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4EqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] == V2.vector4_u32[0]) && (V1.vector4_u32[1] == V2.vector4_u32[1]) && (V1.vector4_u32[2] == V2.vector4_u32[2]) && (V1.vector4_u32[3] == V2.vector4_u32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + return ((_mm_movemask_ps(reinterpret_cast(&vTemp)[0])==0xf) != 0); +#else + return XMComparisonAllTrue(XMVector4EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector4EqualIntR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if (V1.vector4_u32[0] == V2.vector4_u32[0] && + V1.vector4_u32[1] == V2.vector4_u32[1] && + V1.vector4_u32[2] == V2.vector4_u32[2] && + V1.vector4_u32[3] == V2.vector4_u32[3]) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (V1.vector4_u32[0] != V2.vector4_u32[0] && + V1.vector4_u32[1] != V2.vector4_u32[1] && + V1.vector4_u32[2] != V2.vector4_u32[2] && + V1.vector4_u32[3] != V2.vector4_u32[3]) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + int iTest = _mm_movemask_ps(reinterpret_cast(&vTemp)[0]); + UINT CR = 0; + if (iTest==0xf) // All equal? + { + CR = XM_CRMASK_CR6TRUE; + } + else if (iTest==0) // All not equal? + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +XMFINLINE BOOL XMVector4NearEqual +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR Epsilon +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT dx, dy, dz, dw; + + dx = fabsf(V1.vector4_f32[0]-V2.vector4_f32[0]); + dy = fabsf(V1.vector4_f32[1]-V2.vector4_f32[1]); + dz = fabsf(V1.vector4_f32[2]-V2.vector4_f32[2]); + dw = fabsf(V1.vector4_f32[3]-V2.vector4_f32[3]); + return (((dx <= Epsilon.vector4_f32[0]) && + (dy <= Epsilon.vector4_f32[1]) && + (dz <= Epsilon.vector4_f32[2]) && + (dw <= Epsilon.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Get the difference + XMVECTOR vDelta = _mm_sub_ps(V1,V2); + // Get the absolute value of the difference + XMVECTOR vTemp = _mm_setzero_ps(); + vTemp = _mm_sub_ps(vTemp,vDelta); + vTemp = _mm_max_ps(vTemp,vDelta); + vTemp = _mm_cmple_ps(vTemp,Epsilon); + return ((_mm_movemask_ps(vTemp)==0xf) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4NotEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] != V2.vector4_f32[0]) || (V1.vector4_f32[1] != V2.vector4_f32[1]) || (V1.vector4_f32[2] != V2.vector4_f32[2]) || (V1.vector4_f32[3] != V2.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpneq_ps(V1,V2); + return ((_mm_movemask_ps(vTemp)) != 0); +#else + return XMComparisonAnyFalse(XMVector4EqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4NotEqualInt +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_u32[0] != V2.vector4_u32[0]) || (V1.vector4_u32[1] != V2.vector4_u32[1]) || (V1.vector4_u32[2] != V2.vector4_u32[2]) || (V1.vector4_u32[3] != V2.vector4_u32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + __m128i vTemp = _mm_cmpeq_epi32(reinterpret_cast(&V1)[0],reinterpret_cast(&V2)[0]); + return ((_mm_movemask_ps(reinterpret_cast(&vTemp)[0])!=0xF) != 0); +#else + return XMComparisonAnyFalse(XMVector4EqualIntR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4Greater +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] > V2.vector4_f32[0]) && (V1.vector4_f32[1] > V2.vector4_f32[1]) && (V1.vector4_f32[2] > V2.vector4_f32[2]) && (V1.vector4_f32[3] > V2.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2); + return ((_mm_movemask_ps(vTemp)==0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector4GreaterR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if (V1.vector4_f32[0] > V2.vector4_f32[0] && + V1.vector4_f32[1] > V2.vector4_f32[1] && + V1.vector4_f32[2] > V2.vector4_f32[2] && + V1.vector4_f32[3] > V2.vector4_f32[3]) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (V1.vector4_f32[0] <= V2.vector4_f32[0] && + V1.vector4_f32[1] <= V2.vector4_f32[1] && + V1.vector4_f32[2] <= V2.vector4_f32[2] && + V1.vector4_f32[3] <= V2.vector4_f32[3]) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + UINT CR = 0; + XMVECTOR vTemp = _mm_cmpgt_ps(V1,V2); + int iTest = _mm_movemask_ps(vTemp); + if (iTest==0xf) { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4GreaterOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] >= V2.vector4_f32[0]) && (V1.vector4_f32[1] >= V2.vector4_f32[1]) && (V1.vector4_f32[2] >= V2.vector4_f32[2]) && (V1.vector4_f32[3] >= V2.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmpge_ps(V1,V2); + return ((_mm_movemask_ps(vTemp)==0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterOrEqualR(V1, V2)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector4GreaterOrEqualR +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + UINT CR = 0; + if ((V1.vector4_f32[0] >= V2.vector4_f32[0]) && + (V1.vector4_f32[1] >= V2.vector4_f32[1]) && + (V1.vector4_f32[2] >= V2.vector4_f32[2]) && + (V1.vector4_f32[3] >= V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6TRUE; + } + else if ((V1.vector4_f32[0] < V2.vector4_f32[0]) && + (V1.vector4_f32[1] < V2.vector4_f32[1]) && + (V1.vector4_f32[2] < V2.vector4_f32[2]) && + (V1.vector4_f32[3] < V2.vector4_f32[3])) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + UINT CR = 0; + XMVECTOR vTemp = _mm_cmpge_ps(V1,V2); + int iTest = _mm_movemask_ps(vTemp); + if (iTest==0x0f) + { + CR = XM_CRMASK_CR6TRUE; + } + else if (!iTest) + { + CR = XM_CRMASK_CR6FALSE; + } + return CR; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4Less +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] < V2.vector4_f32[0]) && (V1.vector4_f32[1] < V2.vector4_f32[1]) && (V1.vector4_f32[2] < V2.vector4_f32[2]) && (V1.vector4_f32[3] < V2.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmplt_ps(V1,V2); + return ((_mm_movemask_ps(vTemp)==0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4LessOrEqual +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V1.vector4_f32[0] <= V2.vector4_f32[0]) && (V1.vector4_f32[1] <= V2.vector4_f32[1]) && (V1.vector4_f32[2] <= V2.vector4_f32[2]) && (V1.vector4_f32[3] <= V2.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp = _mm_cmple_ps(V1,V2); + return ((_mm_movemask_ps(vTemp)==0x0f) != 0); +#else + return XMComparisonAllTrue(XMVector4GreaterOrEqualR(V2, V1)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4InBounds +( + FXMVECTOR V, + FXMVECTOR Bounds +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) && + (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) && + (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3])) != 0); +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + // All in bounds? + return ((_mm_movemask_ps(vTemp1)==0x0f) != 0); +#else + return XMComparisonAllInBounds(XMVector4InBoundsR(V, Bounds)); +#endif +} + +//------------------------------------------------------------------------------ + +XMFINLINE UINT XMVector4InBoundsR +( + FXMVECTOR V, + FXMVECTOR Bounds +) +{ +#if defined(_XM_NO_INTRINSICS_) + + UINT CR = 0; + if ((V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0]) && + (V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1]) && + (V.vector4_f32[2] <= Bounds.vector4_f32[2] && V.vector4_f32[2] >= -Bounds.vector4_f32[2]) && + (V.vector4_f32[3] <= Bounds.vector4_f32[3] && V.vector4_f32[3] >= -Bounds.vector4_f32[3])) + { + CR = XM_CRMASK_CR6BOUNDS; + } + return CR; + +#elif defined(_XM_SSE_INTRINSICS_) + // Test if less than or equal + XMVECTOR vTemp1 = _mm_cmple_ps(V,Bounds); + // Negate the bounds + XMVECTOR vTemp2 = _mm_mul_ps(Bounds,g_XMNegativeOne); + // Test if greater or equal (Reversed) + vTemp2 = _mm_cmple_ps(vTemp2,V); + // Blend answers + vTemp1 = _mm_and_ps(vTemp1,vTemp2); + // All in bounds? + return (_mm_movemask_ps(vTemp1)==0x0f) ? XM_CRMASK_CR6BOUNDS : 0; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4IsNaN +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + return (XMISNAN(V.vector4_f32[0]) || + XMISNAN(V.vector4_f32[1]) || + XMISNAN(V.vector4_f32[2]) || + XMISNAN(V.vector4_f32[3])); +#elif defined(_XM_SSE_INTRINSICS_) + // Test against itself. NaN is always not equal + XMVECTOR vTempNan = _mm_cmpneq_ps(V,V); + // If any are NaN, the mask is non-zero + return (_mm_movemask_ps(vTempNan)!=0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE BOOL XMVector4IsInfinite +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + return (XMISINF(V.vector4_f32[0]) || + XMISINF(V.vector4_f32[1]) || + XMISINF(V.vector4_f32[2]) || + XMISINF(V.vector4_f32[3])); + +#elif defined(_XM_SSE_INTRINSICS_) + // Mask off the sign bit + XMVECTOR vTemp = _mm_and_ps(V,g_XMAbsMask); + // Compare to infinity + vTemp = _mm_cmpeq_ps(vTemp,g_XMInfinity); + // If any are infinity, the signs are true. + return (_mm_movemask_ps(vTemp) != 0); +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// Computation operations +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Dot +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result.vector4_f32[0] = + Result.vector4_f32[1] = + Result.vector4_f32[2] = + Result.vector4_f32[3] = V1.vector4_f32[0] * V2.vector4_f32[0] + V1.vector4_f32[1] * V2.vector4_f32[1] + V1.vector4_f32[2] * V2.vector4_f32[2] + V1.vector4_f32[3] * V2.vector4_f32[3]; + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vTemp2 = V2; + XMVECTOR vTemp = _mm_mul_ps(V1,vTemp2); + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp,_MM_SHUFFLE(1,0,0,0)); // Copy X to the Z position and Y to the W position + vTemp2 = _mm_add_ps(vTemp2,vTemp); // Add Z = X+Z; W = Y+W; + vTemp = _mm_shuffle_ps(vTemp,vTemp2,_MM_SHUFFLE(0,3,0,0)); // Copy W to the Z position + vTemp = _mm_add_ps(vTemp,vTemp2); // Add Z and W together + return _mm_shuffle_ps(vTemp,vTemp,_MM_SHUFFLE(2,2,2,2)); // Splat Z and return +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Cross +( + FXMVECTOR V1, + FXMVECTOR V2, + FXMVECTOR V3 +) +{ +#if defined(_XM_NO_INTRINSICS_) + XMVECTOR Result; + + Result.vector4_f32[0] = (((V2.vector4_f32[2]*V3.vector4_f32[3])-(V2.vector4_f32[3]*V3.vector4_f32[2]))*V1.vector4_f32[1])-(((V2.vector4_f32[1]*V3.vector4_f32[3])-(V2.vector4_f32[3]*V3.vector4_f32[1]))*V1.vector4_f32[2])+(((V2.vector4_f32[1]*V3.vector4_f32[2])-(V2.vector4_f32[2]*V3.vector4_f32[1]))*V1.vector4_f32[3]); + Result.vector4_f32[1] = (((V2.vector4_f32[3]*V3.vector4_f32[2])-(V2.vector4_f32[2]*V3.vector4_f32[3]))*V1.vector4_f32[0])-(((V2.vector4_f32[3]*V3.vector4_f32[0])-(V2.vector4_f32[0]*V3.vector4_f32[3]))*V1.vector4_f32[2])+(((V2.vector4_f32[2]*V3.vector4_f32[0])-(V2.vector4_f32[0]*V3.vector4_f32[2]))*V1.vector4_f32[3]); + Result.vector4_f32[2] = (((V2.vector4_f32[1]*V3.vector4_f32[3])-(V2.vector4_f32[3]*V3.vector4_f32[1]))*V1.vector4_f32[0])-(((V2.vector4_f32[0]*V3.vector4_f32[3])-(V2.vector4_f32[3]*V3.vector4_f32[0]))*V1.vector4_f32[1])+(((V2.vector4_f32[0]*V3.vector4_f32[1])-(V2.vector4_f32[1]*V3.vector4_f32[0]))*V1.vector4_f32[3]); + Result.vector4_f32[3] = (((V2.vector4_f32[2]*V3.vector4_f32[1])-(V2.vector4_f32[1]*V3.vector4_f32[2]))*V1.vector4_f32[0])-(((V2.vector4_f32[2]*V3.vector4_f32[0])-(V2.vector4_f32[0]*V3.vector4_f32[2]))*V1.vector4_f32[1])+(((V2.vector4_f32[1]*V3.vector4_f32[0])-(V2.vector4_f32[0]*V3.vector4_f32[1]))*V1.vector4_f32[2]); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // V2zwyz * V3wzwy + XMVECTOR vResult = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(2,1,3,2)); + XMVECTOR vTemp3 = _mm_shuffle_ps(V3,V3,_MM_SHUFFLE(1,3,2,3)); + vResult = _mm_mul_ps(vResult,vTemp3); + // - V2wzwy * V3zwyz + XMVECTOR vTemp2 = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(1,3,2,3)); + vTemp3 = _mm_shuffle_ps(vTemp3,vTemp3,_MM_SHUFFLE(1,3,0,1)); + vTemp2 = _mm_mul_ps(vTemp2,vTemp3); + vResult = _mm_sub_ps(vResult,vTemp2); + // term1 * V1yxxx + XMVECTOR vTemp1 = _mm_shuffle_ps(V1,V1,_MM_SHUFFLE(0,0,0,1)); + vResult = _mm_mul_ps(vResult,vTemp1); + + // V2ywxz * V3wxwx + vTemp2 = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(2,0,3,1)); + vTemp3 = _mm_shuffle_ps(V3,V3,_MM_SHUFFLE(0,3,0,3)); + vTemp3 = _mm_mul_ps(vTemp3,vTemp2); + // - V2wxwx * V3ywxz + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp2,_MM_SHUFFLE(2,1,2,1)); + vTemp1 = _mm_shuffle_ps(V3,V3,_MM_SHUFFLE(2,0,3,1)); + vTemp2 = _mm_mul_ps(vTemp2,vTemp1); + vTemp3 = _mm_sub_ps(vTemp3,vTemp2); + // vResult - temp * V1zzyy + vTemp1 = _mm_shuffle_ps(V1,V1,_MM_SHUFFLE(1,1,2,2)); + vTemp1 = _mm_mul_ps(vTemp1,vTemp3); + vResult = _mm_sub_ps(vResult,vTemp1); + + // V2yzxy * V3zxyx + vTemp2 = _mm_shuffle_ps(V2,V2,_MM_SHUFFLE(1,0,2,1)); + vTemp3 = _mm_shuffle_ps(V3,V3,_MM_SHUFFLE(0,1,0,2)); + vTemp3 = _mm_mul_ps(vTemp3,vTemp2); + // - V2zxyx * V3yzxy + vTemp2 = _mm_shuffle_ps(vTemp2,vTemp2,_MM_SHUFFLE(2,0,2,1)); + vTemp1 = _mm_shuffle_ps(V3,V3,_MM_SHUFFLE(1,0,2,1)); + vTemp1 = _mm_mul_ps(vTemp1,vTemp2); + vTemp3 = _mm_sub_ps(vTemp3,vTemp1); + // vResult + term * V1wwwz + vTemp1 = _mm_shuffle_ps(V1,V1,_MM_SHUFFLE(2,3,3,3)); + vTemp3 = _mm_mul_ps(vTemp3,vTemp1); + vResult = _mm_add_ps(vResult,vTemp3); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4LengthSq +( + FXMVECTOR V +) +{ + return XMVector4Dot(V, V); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4ReciprocalLengthEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorReciprocalSqrtEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and w + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(3,2,3,2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,0,0,0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp,vLengthSq,_MM_SHUFFLE(3,3,0,0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // Splat the length + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,2,2,2)); + // Get the reciprocal + vLengthSq = _mm_rsqrt_ps(vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4ReciprocalLength +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorReciprocalSqrt(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and w + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(3,2,3,2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,0,0,0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp,vLengthSq,_MM_SHUFFLE(3,3,0,0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // Splat the length + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,2,2,2)); + // Get the reciprocal + vLengthSq = _mm_sqrt_ps(vLengthSq); + // Accurate! + vLengthSq = _mm_div_ps(g_XMOne,vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4LengthEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorSqrtEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and w + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(3,2,3,2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,0,0,0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp,vLengthSq,_MM_SHUFFLE(3,3,0,0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // Splat the length + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,2,2,2)); + // Prepare for the division + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Length +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + Result = XMVector4LengthSq(V); + Result = XMVectorSqrt(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and w + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(3,2,3,2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,0,0,0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp,vLengthSq,_MM_SHUFFLE(3,3,0,0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // Splat the length + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,2,2,2)); + // Prepare for the division + vLengthSq = _mm_sqrt_ps(vLengthSq); + return vLengthSq; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ +// XMVector4NormalizeEst uses a reciprocal estimate and +// returns QNaN on zero and infinite vectors. + +XMFINLINE XMVECTOR XMVector4NormalizeEst +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result = XMVector4ReciprocalLength(V); + Result = XMVectorMultiply(V, Result); + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and w + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(3,2,3,2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,0,0,0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp,vLengthSq,_MM_SHUFFLE(3,3,0,0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // Splat the length + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,2,2,2)); + // Prepare for the division + XMVECTOR vResult = _mm_rsqrt_ps(vLengthSq); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq,g_XMInfinity); + // Reciprocal mul to perform the normalization + vResult = _mm_mul_ps(vResult,V); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult,vLengthSq); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Normalize +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR LengthSq; + XMVECTOR Zero; + XMVECTOR InfiniteLength; + XMVECTOR ZeroLength; + XMVECTOR Select; + XMVECTOR Result; + + LengthSq = XMVector4LengthSq(V); + Zero = XMVectorZero(); + Result = XMVectorReciprocalSqrt(LengthSq); + InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); + ZeroLength = XMVectorEqual(LengthSq, Zero); + Result = XMVectorMultiply(V, Result); + Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Result = XMVectorSelect(LengthSq, Result, Select); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Perform the dot product on x,y,z and w + XMVECTOR vLengthSq = _mm_mul_ps(V,V); + // vTemp has z and w + XMVECTOR vTemp = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(3,2,3,2)); + // x+z, y+w + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // x+z,x+z,x+z,y+w + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(1,0,0,0)); + // ??,??,y+w,y+w + vTemp = _mm_shuffle_ps(vTemp,vLengthSq,_MM_SHUFFLE(3,3,0,0)); + // ??,??,x+z+y+w,?? + vLengthSq = _mm_add_ps(vLengthSq,vTemp); + // Splat the length + vLengthSq = _mm_shuffle_ps(vLengthSq,vLengthSq,_MM_SHUFFLE(2,2,2,2)); + // Prepare for the division + XMVECTOR vResult = _mm_sqrt_ps(vLengthSq); + // Failsafe on zero (Or epsilon) length planes + // If the length is infinity, set the elements to zero + vLengthSq = _mm_cmpneq_ps(vLengthSq,g_XMInfinity); + // Divide to perform the normalization + vResult = _mm_div_ps(V,vResult); + // Any that are infinity, set to zero + vResult = _mm_and_ps(vResult,vLengthSq); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4ClampLength +( + FXMVECTOR V, + FLOAT LengthMin, + FLOAT LengthMax +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR ClampMax; + XMVECTOR ClampMin; + + ClampMax = XMVectorReplicate(LengthMax); + ClampMin = XMVectorReplicate(LengthMin); + + return XMVector4ClampLengthV(V, ClampMin, ClampMax); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR ClampMax = _mm_set_ps1(LengthMax); + XMVECTOR ClampMin = _mm_set_ps1(LengthMin); + return XMVector4ClampLengthV(V, ClampMin, ClampMax); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4ClampLengthV +( + FXMVECTOR V, + FXMVECTOR LengthMin, + FXMVECTOR LengthMax +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR ClampLength; + XMVECTOR LengthSq; + XMVECTOR RcpLength; + XMVECTOR Length; + XMVECTOR Normal; + XMVECTOR Zero; + XMVECTOR InfiniteLength; + XMVECTOR ZeroLength; + XMVECTOR Select; + XMVECTOR ControlMax; + XMVECTOR ControlMin; + XMVECTOR Control; + XMVECTOR Result; + + XMASSERT((LengthMin.vector4_f32[1] == LengthMin.vector4_f32[0]) && (LengthMin.vector4_f32[2] == LengthMin.vector4_f32[0]) && (LengthMin.vector4_f32[3] == LengthMin.vector4_f32[0])); + XMASSERT((LengthMax.vector4_f32[1] == LengthMax.vector4_f32[0]) && (LengthMax.vector4_f32[2] == LengthMax.vector4_f32[0]) && (LengthMax.vector4_f32[3] == LengthMax.vector4_f32[0])); + XMASSERT(XMVector4GreaterOrEqual(LengthMin, XMVectorZero())); + XMASSERT(XMVector4GreaterOrEqual(LengthMax, XMVectorZero())); + XMASSERT(XMVector4GreaterOrEqual(LengthMax, LengthMin)); + + LengthSq = XMVector4LengthSq(V); + + Zero = XMVectorZero(); + + RcpLength = XMVectorReciprocalSqrt(LengthSq); + + InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity.v); + ZeroLength = XMVectorEqual(LengthSq, Zero); + + Normal = XMVectorMultiply(V, RcpLength); + + Length = XMVectorMultiply(LengthSq, RcpLength); + + Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + + ControlMax = XMVectorGreater(Length, LengthMax); + ControlMin = XMVectorLess(Length, LengthMin); + + ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + + Result = XMVectorMultiply(Normal, ClampLength); + + // Preserve the original vector (with no precision loss) if the length falls within the given range + Control = XMVectorEqualInt(ControlMax, ControlMin); + Result = XMVectorSelect(Result, V, Control); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR ClampLength; + XMVECTOR LengthSq; + XMVECTOR RcpLength; + XMVECTOR Length; + XMVECTOR Normal; + XMVECTOR Zero; + XMVECTOR InfiniteLength; + XMVECTOR ZeroLength; + XMVECTOR Select; + XMVECTOR ControlMax; + XMVECTOR ControlMin; + XMVECTOR Control; + XMVECTOR Result; + + XMASSERT((XMVectorGetY(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetZ(LengthMin) == XMVectorGetX(LengthMin)) && (XMVectorGetW(LengthMin) == XMVectorGetX(LengthMin))); + XMASSERT((XMVectorGetY(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetZ(LengthMax) == XMVectorGetX(LengthMax)) && (XMVectorGetW(LengthMax) == XMVectorGetX(LengthMax))); + XMASSERT(XMVector4GreaterOrEqual(LengthMin, g_XMZero)); + XMASSERT(XMVector4GreaterOrEqual(LengthMax, g_XMZero)); + XMASSERT(XMVector4GreaterOrEqual(LengthMax, LengthMin)); + + LengthSq = XMVector4LengthSq(V); + Zero = XMVectorZero(); + RcpLength = XMVectorReciprocalSqrt(LengthSq); + InfiniteLength = XMVectorEqualInt(LengthSq, g_XMInfinity); + ZeroLength = XMVectorEqual(LengthSq, Zero); + Normal = _mm_mul_ps(V, RcpLength); + Length = _mm_mul_ps(LengthSq, RcpLength); + Select = XMVectorEqualInt(InfiniteLength, ZeroLength); + Length = XMVectorSelect(LengthSq, Length, Select); + Normal = XMVectorSelect(LengthSq, Normal, Select); + ControlMax = XMVectorGreater(Length, LengthMax); + ControlMin = XMVectorLess(Length, LengthMin); + ClampLength = XMVectorSelect(Length, LengthMax, ControlMax); + ClampLength = XMVectorSelect(ClampLength, LengthMin, ControlMin); + Result = _mm_mul_ps(Normal, ClampLength); + // Preserve the original vector (with no precision loss) if the length falls within the given range + Control = XMVectorEqualInt(ControlMax,ControlMin); + Result = XMVectorSelect(Result,V,Control); + return Result; + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Reflect +( + FXMVECTOR Incident, + FXMVECTOR Normal +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + Result = XMVector4Dot(Incident, Normal); + Result = XMVectorAdd(Result, Result); + Result = XMVectorNegativeMultiplySubtract(Result, Normal, Incident); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + // Result = Incident - (2 * dot(Incident, Normal)) * Normal + XMVECTOR Result = XMVector4Dot(Incident,Normal); + Result = _mm_add_ps(Result,Result); + Result = _mm_mul_ps(Result,Normal); + Result = _mm_sub_ps(Incident,Result); + return Result; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Refract +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FLOAT RefractionIndex +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Index; + Index = XMVectorReplicate(RefractionIndex); + return XMVector4RefractV(Incident, Normal, Index); + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR Index = _mm_set_ps1(RefractionIndex); + return XMVector4RefractV(Incident,Normal,Index); +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4RefractV +( + FXMVECTOR Incident, + FXMVECTOR Normal, + FXMVECTOR RefractionIndex +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR IDotN; + XMVECTOR R; + CONST XMVECTOR Zero = XMVectorZero(); + + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + + IDotN = XMVector4Dot(Incident, Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + R = XMVectorNegativeMultiplySubtract(IDotN, IDotN, g_XMOne.v); + R = XMVectorMultiply(R, RefractionIndex); + R = XMVectorNegativeMultiplySubtract(R, RefractionIndex, g_XMOne.v); + + if (XMVector4LessOrEqual(R, Zero)) + { + // Total internal reflection + return Zero; + } + else + { + XMVECTOR Result; + + // R = RefractionIndex * IDotN + sqrt(R) + R = XMVectorSqrt(R); + R = XMVectorMultiplyAdd(RefractionIndex, IDotN, R); + + // Result = RefractionIndex * Incident - Normal * R + Result = XMVectorMultiply(RefractionIndex, Incident); + Result = XMVectorNegativeMultiplySubtract(Normal, R, Result); + + return Result; + } + +#elif defined(_XM_SSE_INTRINSICS_) + // Result = RefractionIndex * Incident - Normal * (RefractionIndex * dot(Incident, Normal) + + // sqrt(1 - RefractionIndex * RefractionIndex * (1 - dot(Incident, Normal) * dot(Incident, Normal)))) + + XMVECTOR IDotN = XMVector4Dot(Incident,Normal); + + // R = 1.0f - RefractionIndex * RefractionIndex * (1.0f - IDotN * IDotN) + XMVECTOR R = _mm_mul_ps(IDotN,IDotN); + R = _mm_sub_ps(g_XMOne,R); + R = _mm_mul_ps(R, RefractionIndex); + R = _mm_mul_ps(R, RefractionIndex); + R = _mm_sub_ps(g_XMOne,R); + + XMVECTOR vResult = _mm_cmple_ps(R,g_XMZero); + if (_mm_movemask_ps(vResult)==0x0f) + { + // Total internal reflection + vResult = g_XMZero; + } + else + { + // R = RefractionIndex * IDotN + sqrt(R) + R = _mm_sqrt_ps(R); + vResult = _mm_mul_ps(RefractionIndex, IDotN); + R = _mm_add_ps(R,vResult); + // Result = RefractionIndex * Incident - Normal * R + vResult = _mm_mul_ps(RefractionIndex, Incident); + R = _mm_mul_ps(R,Normal); + vResult = _mm_sub_ps(vResult,R); + } + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Orthogonal +( + FXMVECTOR V +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR Result; + Result.vector4_f32[0] = V.vector4_f32[2]; + Result.vector4_f32[1] = V.vector4_f32[3]; + Result.vector4_f32[2] = -V.vector4_f32[0]; + Result.vector4_f32[3] = -V.vector4_f32[1]; + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + static const XMVECTORF32 FlipZW = {1.0f,1.0f,-1.0f,-1.0f}; + XMVECTOR vResult = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,0,3,2)); + vResult = _mm_mul_ps(vResult,FlipZW); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4AngleBetweenNormalsEst +( + FXMVECTOR N1, + FXMVECTOR N2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR NegativeOne; + XMVECTOR One; + XMVECTOR Result; + + Result = XMVector4Dot(N1, N2); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + Result = XMVectorClamp(Result, NegativeOne, One); + Result = XMVectorACosEst(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XMVector4Dot(N1,N2); + // Clamp to -1.0f to 1.0f + vResult = _mm_max_ps(vResult,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne);; + vResult = XMVectorACosEst(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4AngleBetweenNormals +( + FXMVECTOR N1, + FXMVECTOR N2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR NegativeOne; + XMVECTOR One; + XMVECTOR Result; + + Result = XMVector4Dot(N1, N2); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + Result = XMVectorClamp(Result, NegativeOne, One); + Result = XMVectorACos(Result); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR vResult = XMVector4Dot(N1,N2); + // Clamp to -1.0f to 1.0f + vResult = _mm_max_ps(vResult,g_XMNegativeOne); + vResult = _mm_min_ps(vResult,g_XMOne);; + vResult = XMVectorACos(vResult); + return vResult; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4AngleBetweenVectors +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR L1; + XMVECTOR L2; + XMVECTOR Dot; + XMVECTOR CosAngle; + XMVECTOR NegativeOne; + XMVECTOR One; + XMVECTOR Result; + + L1 = XMVector4ReciprocalLength(V1); + L2 = XMVector4ReciprocalLength(V2); + + Dot = XMVector4Dot(V1, V2); + + L1 = XMVectorMultiply(L1, L2); + + CosAngle = XMVectorMultiply(Dot, L1); + NegativeOne = XMVectorSplatConstant(-1, 0); + One = XMVectorSplatOne(); + CosAngle = XMVectorClamp(CosAngle, NegativeOne, One); + + Result = XMVectorACos(CosAngle); + + return Result; + +#elif defined(_XM_SSE_INTRINSICS_) + XMVECTOR L1; + XMVECTOR L2; + XMVECTOR Dot; + XMVECTOR CosAngle; + XMVECTOR Result; + + L1 = XMVector4ReciprocalLength(V1); + L2 = XMVector4ReciprocalLength(V2); + Dot = XMVector4Dot(V1, V2); + L1 = _mm_mul_ps(L1,L2); + CosAngle = _mm_mul_ps(Dot,L1); + CosAngle = XMVectorClamp(CosAngle, g_XMNegativeOne, g_XMOne); + Result = XMVectorACos(CosAngle); + return Result; + +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR XMVector4Transform +( + FXMVECTOR V, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + FLOAT fX = (M.m[0][0]*V.vector4_f32[0])+(M.m[1][0]*V.vector4_f32[1])+(M.m[2][0]*V.vector4_f32[2])+(M.m[3][0]*V.vector4_f32[3]); + FLOAT fY = (M.m[0][1]*V.vector4_f32[0])+(M.m[1][1]*V.vector4_f32[1])+(M.m[2][1]*V.vector4_f32[2])+(M.m[3][1]*V.vector4_f32[3]); + FLOAT fZ = (M.m[0][2]*V.vector4_f32[0])+(M.m[1][2]*V.vector4_f32[1])+(M.m[2][2]*V.vector4_f32[2])+(M.m[3][2]*V.vector4_f32[3]); + FLOAT fW = (M.m[0][3]*V.vector4_f32[0])+(M.m[1][3]*V.vector4_f32[1])+(M.m[2][3]*V.vector4_f32[2])+(M.m[3][3]*V.vector4_f32[3]); + XMVECTOR vResult = { + fX, + fY, + fZ, + fW + }; + return vResult; + +#elif defined(_XM_SSE_INTRINSICS_) + // Splat x,y,z and w + XMVECTOR vTempX = _mm_shuffle_ps(V,V,_MM_SHUFFLE(0,0,0,0)); + XMVECTOR vTempY = _mm_shuffle_ps(V,V,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR vTempZ = _mm_shuffle_ps(V,V,_MM_SHUFFLE(2,2,2,2)); + XMVECTOR vTempW = _mm_shuffle_ps(V,V,_MM_SHUFFLE(3,3,3,3)); + // Mul by the matrix + vTempX = _mm_mul_ps(vTempX,M.r[0]); + vTempY = _mm_mul_ps(vTempY,M.r[1]); + vTempZ = _mm_mul_ps(vTempZ,M.r[2]); + vTempW = _mm_mul_ps(vTempW,M.r[3]); + // Add them all together + vTempX = _mm_add_ps(vTempX,vTempY); + vTempZ = _mm_add_ps(vTempZ,vTempW); + vTempX = _mm_add_ps(vTempX,vTempZ); + return vTempX; +#else // _XM_VMX128_INTRINSICS_ +#endif // _XM_VMX128_INTRINSICS_ +} + +//------------------------------------------------------------------------------ + +XMINLINE XMFLOAT4* XMVector4TransformStream +( + XMFLOAT4* pOutputStream, + UINT OutputStride, + CONST XMFLOAT4* pInputStream, + UINT InputStride, + UINT VectorCount, + CXMMATRIX M +) +{ +#if defined(_XM_NO_INTRINSICS_) + + XMVECTOR V; + XMVECTOR X; + XMVECTOR Y; + XMVECTOR Z; + XMVECTOR W; + XMVECTOR Result; + UINT i; + BYTE* pInputVector = (BYTE*)pInputStream; + BYTE* pOutputVector = (BYTE*)pOutputStream; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + for (i = 0; i < VectorCount; i++) + { + V = XMLoadFloat4((XMFLOAT4*)pInputVector); + W = XMVectorSplatW(V); + Z = XMVectorSplatZ(V); + Y = XMVectorSplatY(V); + X = XMVectorSplatX(V); +// W = XMVectorReplicate(((XMFLOAT4*)pInputVector)->w); +// Z = XMVectorReplicate(((XMFLOAT4*)pInputVector)->z); +// Y = XMVectorReplicate(((XMFLOAT4*)pInputVector)->y); +// X = XMVectorReplicate(((XMFLOAT4*)pInputVector)->x); + + Result = XMVectorMultiply(W, M.r[3]); + Result = XMVectorMultiplyAdd(Z, M.r[2], Result); + Result = XMVectorMultiplyAdd(Y, M.r[1], Result); + Result = XMVectorMultiplyAdd(X, M.r[0], Result); + + XMStoreFloat4((XMFLOAT4*)pOutputVector, Result); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + + return pOutputStream; + +#elif defined(_XM_SSE_INTRINSICS_) + UINT i; + + XMASSERT(pOutputStream); + XMASSERT(pInputStream); + + const BYTE*pInputVector = reinterpret_cast(pInputStream); + BYTE* pOutputVector = reinterpret_cast(pOutputStream); + for (i = 0; i < VectorCount; i++) + { + // Fetch the row and splat it + XMVECTOR vTempx = _mm_loadu_ps(reinterpret_cast(pInputVector)); + XMVECTOR vTempy = _mm_shuffle_ps(vTempx,vTempx,_MM_SHUFFLE(1,1,1,1)); + XMVECTOR vTempz = _mm_shuffle_ps(vTempx,vTempx,_MM_SHUFFLE(2,2,2,2)); + XMVECTOR vTempw = _mm_shuffle_ps(vTempx,vTempx,_MM_SHUFFLE(3,3,3,3)); + vTempx = _mm_shuffle_ps(vTempx,vTempx,_MM_SHUFFLE(0,0,0,0)); + vTempx = _mm_mul_ps(vTempx,M.r[0]); + vTempy = _mm_mul_ps(vTempy,M.r[1]); + vTempz = _mm_mul_ps(vTempz,M.r[2]); + vTempw = _mm_mul_ps(vTempw,M.r[3]); + vTempx = _mm_add_ps(vTempx,vTempy); + vTempw = _mm_add_ps(vTempw,vTempz); + vTempw = _mm_add_ps(vTempw,vTempx); + // Store the transformed vector + _mm_storeu_ps(reinterpret_cast(pOutputVector),vTempw); + + pInputVector += InputStride; + pOutputVector += OutputStride; + } + return pOutputStream; +#elif defined(XM_NO_MISALIGNED_VECTOR_ACCESS) +#endif // _XM_VMX128_INTRINSICS_ +} + +#ifdef __cplusplus + +/**************************************************************************** + * + * XMVECTOR operators + * + ****************************************************************************/ + +#ifndef XM_NO_OPERATOR_OVERLOADS + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator+ (FXMVECTOR V) +{ + return V; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator- (FXMVECTOR V) +{ + return XMVectorNegate(V); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR& operator+= +( + XMVECTOR& V1, + FXMVECTOR V2 +) +{ + V1 = XMVectorAdd(V1, V2); + return V1; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR& operator-= +( + XMVECTOR& V1, + FXMVECTOR V2 +) +{ + V1 = XMVectorSubtract(V1, V2); + return V1; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR& operator*= +( + XMVECTOR& V1, + FXMVECTOR V2 +) +{ + V1 = XMVectorMultiply(V1, V2); + return V1; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR& operator/= +( + XMVECTOR& V1, + FXMVECTOR V2 +) +{ + XMVECTOR InvV = XMVectorReciprocal(V2); + V1 = XMVectorMultiply(V1, InvV); + return V1; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR& operator*= +( + XMVECTOR& V, + CONST FLOAT S +) +{ + V = XMVectorScale(V, S); + return V; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR& operator/= +( + XMVECTOR& V, + CONST FLOAT S +) +{ + V = XMVectorScale(V, 1.0f / S); + return V; +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator+ +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ + return XMVectorAdd(V1, V2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator- +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ + return XMVectorSubtract(V1, V2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator* +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ + return XMVectorMultiply(V1, V2); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator/ +( + FXMVECTOR V1, + FXMVECTOR V2 +) +{ + XMVECTOR InvV = XMVectorReciprocal(V2); + return XMVectorMultiply(V1, InvV); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator* +( + FXMVECTOR V, + CONST FLOAT S +) +{ + return XMVectorScale(V, S); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator/ +( + FXMVECTOR V, + CONST FLOAT S +) +{ + return XMVectorScale(V, 1.0f / S); +} + +//------------------------------------------------------------------------------ + +XMFINLINE XMVECTOR operator* +( + FLOAT S, + FXMVECTOR V +) +{ + return XMVectorScale(V, S); +} + +#endif // !XM_NO_OPERATOR_OVERLOADS + +/**************************************************************************** + * + * XMFLOAT2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT2::_XMFLOAT2 +( + CONST FLOAT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT2& _XMFLOAT2::operator= +( + CONST _XMFLOAT2& Float2 +) +{ + x = Float2.x; + y = Float2.y; + return *this; +} + +/**************************************************************************** + * + * XMHALF2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF2::_XMHALF2 +( + CONST HALF* pArray +) +{ + x = pArray[0]; + y = pArray[1]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF2::_XMHALF2 +( + FLOAT _x, + FLOAT _y +) +{ + x = XMConvertFloatToHalf(_x); + y = XMConvertFloatToHalf(_y); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF2::_XMHALF2 +( + CONST FLOAT* pArray +) +{ + x = XMConvertFloatToHalf(pArray[0]); + y = XMConvertFloatToHalf(pArray[1]); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF2& _XMHALF2::operator= +( + CONST _XMHALF2& Half2 +) +{ + x = Half2.x; + y = Half2.y; + return *this; +} + +/**************************************************************************** + * + * XMSHORTN2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN2::_XMSHORTN2 +( + CONST SHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN2::_XMSHORTN2 +( + FLOAT _x, + FLOAT _y +) +{ + XMStoreShortN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN2::_XMSHORTN2 +( + CONST FLOAT* pArray +) +{ + XMStoreShortN2(this, XMLoadFloat2((XMFLOAT2*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN2& _XMSHORTN2::operator= +( + CONST _XMSHORTN2& ShortN2 +) +{ + x = ShortN2.x; + y = ShortN2.y; + return *this; +} + +/**************************************************************************** + * + * XMSHORT2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT2::_XMSHORT2 +( + CONST SHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT2::_XMSHORT2 +( + FLOAT _x, + FLOAT _y +) +{ + XMStoreShort2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT2::_XMSHORT2 +( + CONST FLOAT* pArray +) +{ + XMStoreShort2(this, XMLoadFloat2((XMFLOAT2*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT2& _XMSHORT2::operator= +( + CONST _XMSHORT2& Short2 +) +{ + x = Short2.x; + y = Short2.y; + return *this; +} + +/**************************************************************************** + * + * XMUSHORTN2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN2::_XMUSHORTN2 +( + CONST USHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN2::_XMUSHORTN2 +( + FLOAT _x, + FLOAT _y +) +{ + XMStoreUShortN2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN2::_XMUSHORTN2 +( + CONST FLOAT* pArray +) +{ + XMStoreUShortN2(this, XMLoadFloat2((XMFLOAT2*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN2& _XMUSHORTN2::operator= +( + CONST _XMUSHORTN2& UShortN2 +) +{ + x = UShortN2.x; + y = UShortN2.y; + return *this; +} + +/**************************************************************************** + * + * XMUSHORT2 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT2::_XMUSHORT2 +( + CONST USHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT2::_XMUSHORT2 +( + FLOAT _x, + FLOAT _y +) +{ + XMStoreUShort2(this, XMVectorSet(_x, _y, 0.0f, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT2::_XMUSHORT2 +( + CONST FLOAT* pArray +) +{ + XMStoreUShort2(this, XMLoadFloat2((XMFLOAT2*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT2& _XMUSHORT2::operator= +( + CONST _XMUSHORT2& UShort2 +) +{ + x = UShort2.x; + y = UShort2.y; + return *this; +} + +/**************************************************************************** + * + * XMFLOAT3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT3::_XMFLOAT3 +( + CONST FLOAT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT3& _XMFLOAT3::operator= +( + CONST _XMFLOAT3& Float3 +) +{ + x = Float3.x; + y = Float3.y; + z = Float3.z; + return *this; +} + +/**************************************************************************** + * + * XMHENDN3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHENDN3::_XMHENDN3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreHenDN3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHENDN3::_XMHENDN3 +( + CONST FLOAT* pArray +) +{ + XMStoreHenDN3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHENDN3& _XMHENDN3::operator= +( + CONST _XMHENDN3& HenDN3 +) +{ + v = HenDN3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHENDN3& _XMHENDN3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMHEND3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHEND3::_XMHEND3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreHenD3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHEND3::_XMHEND3 +( + CONST FLOAT* pArray +) +{ + XMStoreHenD3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHEND3& _XMHEND3::operator= +( + CONST _XMHEND3& HenD3 +) +{ + v = HenD3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHEND3& _XMHEND3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUHENDN3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHENDN3::_XMUHENDN3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreUHenDN3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHENDN3::_XMUHENDN3 +( + CONST FLOAT* pArray +) +{ + XMStoreUHenDN3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHENDN3& _XMUHENDN3::operator= +( + CONST _XMUHENDN3& UHenDN3 +) +{ + v = UHenDN3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHENDN3& _XMUHENDN3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUHEND3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHEND3::_XMUHEND3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreUHenD3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHEND3::_XMUHEND3 +( + CONST FLOAT* pArray +) +{ + XMStoreUHenD3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHEND3& _XMUHEND3::operator= +( + CONST _XMUHEND3& UHenD3 +) +{ + v = UHenD3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUHEND3& _XMUHEND3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMDHENN3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHENN3::_XMDHENN3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreDHenN3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHENN3::_XMDHENN3 +( + CONST FLOAT* pArray +) +{ + XMStoreDHenN3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHENN3& _XMDHENN3::operator= +( + CONST _XMDHENN3& DHenN3 +) +{ + v = DHenN3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHENN3& _XMDHENN3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMDHEN3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHEN3::_XMDHEN3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreDHen3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHEN3::_XMDHEN3 +( + CONST FLOAT* pArray +) +{ + XMStoreDHen3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHEN3& _XMDHEN3::operator= +( + CONST _XMDHEN3& DHen3 +) +{ + v = DHen3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDHEN3& _XMDHEN3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUDHENN3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHENN3::_XMUDHENN3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreUDHenN3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHENN3::_XMUDHENN3 +( + CONST FLOAT* pArray +) +{ + XMStoreUDHenN3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHENN3& _XMUDHENN3::operator= +( + CONST _XMUDHENN3& UDHenN3 +) +{ + v = UDHenN3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHENN3& _XMUDHENN3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUDHEN3 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHEN3::_XMUDHEN3 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreUDHen3(this, XMVectorSet(_x, _y, _z, 0.0f)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHEN3::_XMUDHEN3 +( + CONST FLOAT* pArray +) +{ + XMStoreUDHen3(this, XMLoadFloat3((XMFLOAT3*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHEN3& _XMUDHEN3::operator= +( + CONST _XMUDHEN3& UDHen3 +) +{ + v = UDHen3.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDHEN3& _XMUDHEN3::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMU565 operators + * + ****************************************************************************/ + +XMFINLINE _XMU565::_XMU565 +( + CONST CHAR *pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; +} + +XMFINLINE _XMU565::_XMU565 +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreU565(this, XMVectorSet( _x, _y, _z, 0.0f )); +} + +XMFINLINE _XMU565::_XMU565 +( + CONST FLOAT *pArray +) +{ + XMStoreU565(this, XMLoadFloat3((XMFLOAT3*)pArray )); +} + +XMFINLINE _XMU565& _XMU565::operator= +( + CONST _XMU565& U565 +) +{ + v = U565.v; + return *this; +} + +XMFINLINE _XMU565& _XMU565::operator= +( + CONST USHORT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMFLOAT3PK operators + * + ****************************************************************************/ + +XMFINLINE _XMFLOAT3PK::_XMFLOAT3PK +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreFloat3PK(this, XMVectorSet( _x, _y, _z, 0.0f )); +} + +XMFINLINE _XMFLOAT3PK::_XMFLOAT3PK +( + CONST FLOAT *pArray +) +{ + XMStoreFloat3PK(this, XMLoadFloat3((XMFLOAT3*)pArray )); +} + +XMFINLINE _XMFLOAT3PK& _XMFLOAT3PK::operator= +( + CONST _XMFLOAT3PK& float3pk +) +{ + v = float3pk.v; + return *this; +} + +XMFINLINE _XMFLOAT3PK& _XMFLOAT3PK::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMFLOAT3SE operators + * + ****************************************************************************/ + +XMFINLINE _XMFLOAT3SE::_XMFLOAT3SE +( + FLOAT _x, + FLOAT _y, + FLOAT _z +) +{ + XMStoreFloat3SE(this, XMVectorSet( _x, _y, _z, 0.0f )); +} + +XMFINLINE _XMFLOAT3SE::_XMFLOAT3SE +( + CONST FLOAT *pArray +) +{ + XMStoreFloat3SE(this, XMLoadFloat3((XMFLOAT3*)pArray )); +} + +XMFINLINE _XMFLOAT3SE& _XMFLOAT3SE::operator= +( + CONST _XMFLOAT3SE& float3se +) +{ + v = float3se.v; + return *this; +} + +XMFINLINE _XMFLOAT3SE& _XMFLOAT3SE::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMFLOAT4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4::_XMFLOAT4 +( + CONST FLOAT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMFLOAT4& _XMFLOAT4::operator= +( + CONST _XMFLOAT4& Float4 +) +{ + x = Float4.x; + y = Float4.y; + z = Float4.z; + w = Float4.w; + return *this; +} + +/**************************************************************************** + * + * XMHALF4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF4::_XMHALF4 +( + CONST HALF* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF4::_XMHALF4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + x = XMConvertFloatToHalf(_x); + y = XMConvertFloatToHalf(_y); + z = XMConvertFloatToHalf(_z); + w = XMConvertFloatToHalf(_w); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF4::_XMHALF4 +( + CONST FLOAT* pArray +) +{ + XMConvertFloatToHalfStream(&x, sizeof(HALF), pArray, sizeof(FLOAT), 4); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMHALF4& _XMHALF4::operator= +( + CONST _XMHALF4& Half4 +) +{ + x = Half4.x; + y = Half4.y; + z = Half4.z; + w = Half4.w; + return *this; +} + +/**************************************************************************** + * + * XMSHORTN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN4::_XMSHORTN4 +( + CONST SHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN4::_XMSHORTN4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreShortN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN4::_XMSHORTN4 +( + CONST FLOAT* pArray +) +{ + XMStoreShortN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORTN4& _XMSHORTN4::operator= +( + CONST _XMSHORTN4& ShortN4 +) +{ + x = ShortN4.x; + y = ShortN4.y; + z = ShortN4.z; + w = ShortN4.w; + return *this; +} + +/**************************************************************************** + * + * XMSHORT4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT4::_XMSHORT4 +( + CONST SHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT4::_XMSHORT4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreShort4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT4::_XMSHORT4 +( + CONST FLOAT* pArray +) +{ + XMStoreShort4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMSHORT4& _XMSHORT4::operator= +( + CONST _XMSHORT4& Short4 +) +{ + x = Short4.x; + y = Short4.y; + z = Short4.z; + w = Short4.w; + return *this; +} + +/**************************************************************************** + * + * XMUSHORTN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN4::_XMUSHORTN4 +( + CONST USHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN4::_XMUSHORTN4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUShortN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN4::_XMUSHORTN4 +( + CONST FLOAT* pArray +) +{ + XMStoreUShortN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORTN4& _XMUSHORTN4::operator= +( + CONST _XMUSHORTN4& UShortN4 +) +{ + x = UShortN4.x; + y = UShortN4.y; + z = UShortN4.z; + w = UShortN4.w; + return *this; +} + +/**************************************************************************** + * + * XMUSHORT4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT4::_XMUSHORT4 +( + CONST USHORT* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT4::_XMUSHORT4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUShort4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT4::_XMUSHORT4 +( + CONST FLOAT* pArray +) +{ + XMStoreUShort4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUSHORT4& _XMUSHORT4::operator= +( + CONST _XMUSHORT4& UShort4 +) +{ + x = UShort4.x; + y = UShort4.y; + z = UShort4.z; + w = UShort4.w; + return *this; +} + +/**************************************************************************** + * + * XMXDECN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDECN4::_XMXDECN4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreXDecN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDECN4::_XMXDECN4 +( + CONST FLOAT* pArray +) +{ + XMStoreXDecN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDECN4& _XMXDECN4::operator= +( + CONST _XMXDECN4& XDecN4 +) +{ + v = XDecN4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDECN4& _XMXDECN4::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMXDEC4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDEC4::_XMXDEC4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreXDec4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDEC4::_XMXDEC4 +( + CONST FLOAT* pArray +) +{ + XMStoreXDec4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDEC4& _XMXDEC4::operator= +( + CONST _XMXDEC4& XDec4 +) +{ + v = XDec4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXDEC4& _XMXDEC4::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMDECN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDECN4::_XMDECN4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreDecN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDECN4::_XMDECN4 +( + CONST FLOAT* pArray +) +{ + XMStoreDecN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDECN4& _XMDECN4::operator= +( + CONST _XMDECN4& DecN4 +) +{ + v = DecN4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDECN4& _XMDECN4::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMDEC4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDEC4::_XMDEC4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreDec4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDEC4::_XMDEC4 +( + CONST FLOAT* pArray +) +{ + XMStoreDec4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDEC4& _XMDEC4::operator= +( + CONST _XMDEC4& Dec4 +) +{ + v = Dec4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMDEC4& _XMDEC4::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUDECN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDECN4::_XMUDECN4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUDecN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDECN4::_XMUDECN4 +( + CONST FLOAT* pArray +) +{ + XMStoreUDecN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDECN4& _XMUDECN4::operator= +( + CONST _XMUDECN4& UDecN4 +) +{ + v = UDecN4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDECN4& _XMUDECN4::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUDEC4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDEC4::_XMUDEC4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUDec4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDEC4::_XMUDEC4 +( + CONST FLOAT* pArray +) +{ + XMStoreUDec4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDEC4& _XMUDEC4::operator= +( + CONST _XMUDEC4& UDec4 +) +{ + v = UDec4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUDEC4& _XMUDEC4::operator= +( + CONST UINT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMXICON4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICON4::_XMXICON4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreXIcoN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICON4::_XMXICON4 +( + CONST FLOAT* pArray +) +{ + XMStoreXIcoN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICON4& _XMXICON4::operator= +( + CONST _XMXICON4& XIcoN4 +) +{ + v = XIcoN4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICON4& _XMXICON4::operator= +( + CONST UINT64 Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMXICO4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICO4::_XMXICO4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreXIco4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICO4::_XMXICO4 +( + CONST FLOAT* pArray +) +{ + XMStoreXIco4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICO4& _XMXICO4::operator= +( + CONST _XMXICO4& XIco4 +) +{ + v = XIco4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMXICO4& _XMXICO4::operator= +( + CONST UINT64 Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMICON4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICON4::_XMICON4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreIcoN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICON4::_XMICON4 +( + CONST FLOAT* pArray +) +{ + XMStoreIcoN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICON4& _XMICON4::operator= +( + CONST _XMICON4& IcoN4 +) +{ + v = IcoN4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICON4& _XMICON4::operator= +( + CONST UINT64 Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMICO4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICO4::_XMICO4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreIco4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICO4::_XMICO4 +( + CONST FLOAT* pArray +) +{ + XMStoreIco4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICO4& _XMICO4::operator= +( + CONST _XMICO4& Ico4 +) +{ + v = Ico4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMICO4& _XMICO4::operator= +( + CONST UINT64 Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUICON4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICON4::_XMUICON4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUIcoN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICON4::_XMUICON4 +( + CONST FLOAT* pArray +) +{ + XMStoreUIcoN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICON4& _XMUICON4::operator= +( + CONST _XMUICON4& UIcoN4 +) +{ + v = UIcoN4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICON4& _XMUICON4::operator= +( + CONST UINT64 Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMUICO4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICO4::_XMUICO4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUIco4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICO4::_XMUICO4 +( + CONST FLOAT* pArray +) +{ + XMStoreUIco4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICO4& _XMUICO4::operator= +( + CONST _XMUICO4& UIco4 +) +{ + v = UIco4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUICO4& _XMUICO4::operator= +( + CONST UINT64 Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMCOLOR4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMCOLOR::_XMCOLOR +( + FLOAT _r, + FLOAT _g, + FLOAT _b, + FLOAT _a +) +{ + XMStoreColor(this, XMVectorSet(_r, _g, _b, _a)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMCOLOR::_XMCOLOR +( + CONST FLOAT* pArray +) +{ + XMStoreColor(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMCOLOR& _XMCOLOR::operator= +( + CONST _XMCOLOR& Color +) +{ + c = Color.c; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMCOLOR& _XMCOLOR::operator= +( + CONST UINT Color +) +{ + c = Color; + return *this; +} + +/**************************************************************************** + * + * XMBYTEN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTEN4::_XMBYTEN4 +( + CONST CHAR* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTEN4::_XMBYTEN4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreByteN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTEN4::_XMBYTEN4 +( + CONST FLOAT* pArray +) +{ + XMStoreByteN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTEN4& _XMBYTEN4::operator= +( + CONST _XMBYTEN4& ByteN4 +) +{ + x = ByteN4.x; + y = ByteN4.y; + z = ByteN4.z; + w = ByteN4.w; + return *this; +} + +/**************************************************************************** + * + * XMBYTE4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTE4::_XMBYTE4 +( + CONST CHAR* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTE4::_XMBYTE4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreByte4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTE4::_XMBYTE4 +( + CONST FLOAT* pArray +) +{ + XMStoreByte4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMBYTE4& _XMBYTE4::operator= +( + CONST _XMBYTE4& Byte4 +) +{ + x = Byte4.x; + y = Byte4.y; + z = Byte4.z; + w = Byte4.w; + return *this; +} + +/**************************************************************************** + * + * XMUBYTEN4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTEN4::_XMUBYTEN4 +( + CONST BYTE* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTEN4::_XMUBYTEN4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUByteN4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTEN4::_XMUBYTEN4 +( + CONST FLOAT* pArray +) +{ + XMStoreUByteN4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTEN4& _XMUBYTEN4::operator= +( + CONST _XMUBYTEN4& UByteN4 +) +{ + x = UByteN4.x; + y = UByteN4.y; + z = UByteN4.z; + w = UByteN4.w; + return *this; +} + +/**************************************************************************** + * + * XMUBYTE4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTE4::_XMUBYTE4 +( + CONST BYTE* pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTE4::_XMUBYTE4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUByte4(this, XMVectorSet(_x, _y, _z, _w)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTE4::_XMUBYTE4 +( + CONST FLOAT* pArray +) +{ + XMStoreUByte4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUBYTE4& _XMUBYTE4::operator= +( + CONST _XMUBYTE4& UByte4 +) +{ + x = UByte4.x; + y = UByte4.y; + z = UByte4.z; + w = UByte4.w; + return *this; +} + +/**************************************************************************** + * + * XMUNIBBLE4 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUNIBBLE4::_XMUNIBBLE4 +( + CONST CHAR *pArray +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = pArray[3]; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUNIBBLE4::_XMUNIBBLE4 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + FLOAT _w +) +{ + XMStoreUNibble4(this, XMVectorSet( _x, _y, _z, _w )); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUNIBBLE4::_XMUNIBBLE4 +( + CONST FLOAT *pArray +) +{ + XMStoreUNibble4(this, XMLoadFloat4((XMFLOAT4*)pArray)); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUNIBBLE4& _XMUNIBBLE4::operator= +( + CONST _XMUNIBBLE4& UNibble4 +) +{ + v = UNibble4.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMUNIBBLE4& _XMUNIBBLE4::operator= +( + CONST USHORT Packed +) +{ + v = Packed; + return *this; +} + +/**************************************************************************** + * + * XMU555 operators + * + ****************************************************************************/ + +//------------------------------------------------------------------------------ + +XMFINLINE _XMU555::_XMU555 +( + CONST CHAR *pArray, + BOOL _w +) +{ + x = pArray[0]; + y = pArray[1]; + z = pArray[2]; + w = _w; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMU555::_XMU555 +( + FLOAT _x, + FLOAT _y, + FLOAT _z, + BOOL _w +) +{ + XMStoreU555(this, XMVectorSet(_x, _y, _z, ((_w) ? 1.0f : 0.0f) )); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMU555::_XMU555 +( + CONST FLOAT *pArray, + BOOL _w +) +{ + XMVECTOR V = XMLoadFloat3((XMFLOAT3*)pArray); + XMStoreU555(this, XMVectorSetW(V, ((_w) ? 1.0f : 0.0f) )); +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMU555& _XMU555::operator= +( + CONST _XMU555& U555 +) +{ + v = U555.v; + return *this; +} + +//------------------------------------------------------------------------------ + +XMFINLINE _XMU555& _XMU555::operator= +( + CONST USHORT Packed +) +{ + v = Packed; + return *this; +} + +#endif // __cplusplus + +#if defined(_XM_NO_INTRINSICS_) +#undef XMISNAN +#undef XMISINF +#endif + +#endif // __XNAMATHVECTOR_INL__ + diff --git a/Src/Decoder_H264_ALL/D3DVidRender.cpp b/Src/Decoder_H264_ALL/D3DVidRender.cpp new file mode 100644 index 0000000..619ed0a --- /dev/null +++ b/Src/Decoder_H264_ALL/D3DVidRender.cpp @@ -0,0 +1,372 @@ +#include "D3DVidRender.h" + +#pragma comment(lib, "d3d9.lib") +#pragma comment(lib, "d3dx9.lib") + +// 使用stdio.h和strsafe.h,可实现类似TRACE的功能 +/*void LogTrace(LPCTSTR pszFormat, ...) +{ + va_list pArgs; + + char szMessageBuffer[16380]={0}; + va_start( pArgs, pszFormat ); + _vsntprintf( szMessageBuffer, 16380, pszFormat, pArgs ); + va_end( pArgs ); + + OutputDebugString(szMessageBuffer); +}*/ + +CD3DVidRender::CD3DVidRender(void) +{ + m_pDirect3D9 = NULL; + m_pDirect3DDevice = NULL; + m_pDirect3DSurfaceRender = NULL; + m_pBackBuffer = NULL; +} + +CD3DVidRender::~CD3DVidRender(void) +{ +} + +void CD3DVidRender::Cleanup() +{ + if (m_pBackBuffer) + { + m_pBackBuffer->Release(); + m_pBackBuffer = NULL; + } + if(m_pDirect3DSurfaceRender) + { + m_pDirect3DSurfaceRender->Release(); + m_pDirect3DSurfaceRender = NULL; + } + if(m_pDirect3DDevice) + { + m_pDirect3DDevice->Release(); + m_pDirect3DDevice = NULL; + } + if(m_pDirect3D9) + { + m_pDirect3D9->Release(); + m_pDirect3D9 = NULL; + } + if (m_pD3DXFont) + { + m_pD3DXFont->Release() ; + m_pD3DXFont = NULL ; + } +} + +BOOL CD3DVidRender::InitD3D_RGB32(HWND hwnd, int img_width, int img_height) +{ + HRESULT lRet; + + if (m_pDirect3D9) + { + m_pDirect3D9->Release(); + m_pDirect3D9 = NULL; + } + m_pDirect3D9 = Direct3DCreate9(D3D_SDK_VERSION); + if(m_pDirect3D9 == NULL) + { + return FALSE; + } + + ZeroMemory(&d3dpp, sizeof(d3dpp)); + d3dpp.Windowed = TRUE; + d3dpp.hDeviceWindow = hwnd; + d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; + d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; + d3dpp.EnableAutoDepthStencil = FALSE; + d3dpp.Flags = D3DPRESENTFLAG_VIDEO; + d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; + d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; + + D3DCAPS9 caps; + DWORD BehaviorFlags = D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED; + HRESULT hr = m_pDirect3D9->GetDeviceCaps ( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &caps ) ; + if ( SUCCEEDED(hr) ) + { + if ( caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT ) + { + BehaviorFlags = D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE; + } + else + { + BehaviorFlags = D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE; + } + } + + if (m_pDirect3DDevice) + { + m_pDirect3DDevice->Release(); + m_pDirect3DDevice = NULL; + } + lRet = m_pDirect3D9->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, BehaviorFlags, &d3dpp, &m_pDirect3DDevice); + if(FAILED(lRet)) + { + return FALSE; + } + + if (m_pDirect3DSurfaceRender) + { + m_pDirect3DSurfaceRender->Release(); + m_pDirect3DSurfaceRender = NULL; + } + lRet = m_pDirect3DDevice->CreateOffscreenPlainSurface(img_width, img_height, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, +&m_pDirect3DSurfaceRender, NULL); + if(FAILED(lRet)) + { + return FALSE; + } + + //// create the font + //ZeroMemory(&m_font_desc, sizeof(m_font_desc)); + + //// set font descripter + //strcpy(m_font_desc.FaceName, "楷体"); + //m_font_desc.Height = 32; + + //// Creates a font object indirectly for both a device and a font + //D3DXCreateFontIndirect(m_pDirect3DDevice, &m_font_desc, &m_pD3DXFont); + + return TRUE; +} + +BOOL CD3DVidRender::InitD3D_YUV(HWND hwnd,int img_width, int img_height) +{ + HRESULT lRet; + + if (m_pDirect3D9) + { + m_pDirect3D9->Release(); + m_pDirect3D9 = NULL; + } + m_pDirect3D9 = Direct3DCreate9( D3D_SDK_VERSION ); + if( m_pDirect3D9 == NULL ) + { + return FALSE; + } + + ZeroMemory( &d3dpp, sizeof(d3dpp) ); + d3dpp.Windowed = TRUE; + d3dpp.hDeviceWindow = hwnd; + d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; + d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; + d3dpp.EnableAutoDepthStencil = FALSE; + d3dpp.Flags = D3DPRESENTFLAG_VIDEO; + d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; + d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; + + D3DCAPS9 caps; + DWORD BehaviorFlags = D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED; + HRESULT hr = m_pDirect3D9->GetDeviceCaps ( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &caps ) ; + if ( SUCCEEDED(hr) ) + { + if ( caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT ) + { + BehaviorFlags = D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE ; + } + else + { + BehaviorFlags = D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE; + } + } + + if (m_pDirect3DDevice) + { + m_pDirect3DDevice->Release(); + m_pDirect3DDevice = NULL; + } + lRet = m_pDirect3D9->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, BehaviorFlags, &d3dpp, &m_pDirect3DDevice ); + if(FAILED(lRet)) + { + return FALSE; + } + + if (m_pDirect3DSurfaceRender) + { + m_pDirect3DSurfaceRender->Release(); + m_pDirect3DSurfaceRender = NULL; + } + lRet = m_pDirect3DDevice->CreateOffscreenPlainSurface( img_width, img_height, (D3DFORMAT)MAKEFOURCC('Y', 'V', '1', '2'), D3DPOOL_DEFAULT, &m_pDirect3DSurfaceRender, NULL); + if(FAILED(lRet)) + { + return FALSE; + } + + return TRUE; +} + +BOOL CD3DVidRender::Render_RGB32(unsigned char * pdata, int img_width, int img_height) +{ + if (NULL == m_pDirect3DSurfaceRender) + { + return FALSE ; + } + + HRESULT lRet; + + D3DLOCKED_RECT d3d_rect; + lRet = m_pDirect3DSurfaceRender->LockRect(&d3d_rect, NULL, D3DLOCK_DONOTWAIT); + if(FAILED(lRet)) + { + return FALSE; + } + + byte * pSrc = pdata; + byte * pDest = (BYTE *)d3d_rect.pBits; + int lPitch = d3d_rect.Pitch; + unsigned long i = 0; + + for (i = 0; i < img_height; i++) + { + memmove(pDest, pSrc, img_width * 4); + pDest += lPitch; + pSrc += img_width * 4; + } + + lRet = m_pDirect3DSurfaceRender->UnlockRect(); + if(FAILED(lRet)) + { + return FALSE; + } + + if (m_pDirect3DDevice == NULL) + { + return FALSE; + } + + m_pDirect3DDevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), 1.0f, 0); + m_pDirect3DDevice->BeginScene(); + + if (m_pBackBuffer) + { + m_pBackBuffer->Release(); + m_pBackBuffer = NULL; + } + m_pDirect3DDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &m_pBackBuffer); + GetClientRect(d3dpp.hDeviceWindow, &m_rtViewport); + calculate_display_rect(&m_rtViewport,img_width,img_height, m_rtViewport.right, m_rtViewport.bottom) ; + m_pDirect3DDevice->StretchRect(m_pDirect3DSurfaceRender, NULL, m_pBackBuffer, &m_rtViewport, D3DTEXF_LINEAR); + //if (m_pDirect3DDevice != NULL) + //{ + // m_rtFont = m_rtViewport ; + // m_rtFont.top = (m_rtViewport.bottom - m_rtViewport.top) * 3 / 4 ; + // m_pD3DXFont->DrawTextW(NULL, L"Programming is fun!哈哈", -1, &m_rtFont, DT_CENTER | DT_VCENTER, D3DCOLOR_XRGB(255,0,0)); + //} + m_pDirect3DDevice->EndScene(); + m_pDirect3DDevice->Present(NULL, NULL, NULL, NULL); + + RECT rcCurrentClient; + GetClientRect(d3dpp.hDeviceWindow, &rcCurrentClient); + if( ( UINT )rcCurrentClient.right != d3dpp.BackBufferWidth || + ( UINT )rcCurrentClient.bottom != d3dpp.BackBufferHeight ) + { + d3dpp.BackBufferWidth = rcCurrentClient.right; + d3dpp.BackBufferHeight = rcCurrentClient.bottom; + + InitD3D_RGB32(d3dpp.hDeviceWindow, img_width, img_height); + } + + if (m_pDirect3DDevice && m_pDirect3DDevice->TestCooperativeLevel() == D3DERR_DEVICENOTRESET) + { + InitD3D_RGB32(d3dpp.hDeviceWindow, img_width, img_height); + } + + return TRUE; +} + +void CD3DVidRender::calculate_display_rect(RECT *rect,int img_width, int img_height, int scr_width, int scr_height) +{ + double video_W = img_width ; // 视频宽度 + double video_H = img_height ; // 视频高度 + double show_H = scr_height ; //播放区域高度 + double show_W = scr_width ; //播放区域宽度 + + if((video_W / video_H) <= show_W / show_H) + { + int adjust_W =(int)(show_W - (video_W / video_H ) * show_H) / 2 ; + + rect->left = adjust_W ; + rect->top = 0 ; + rect->right = scr_width - adjust_W ; + rect->bottom = scr_height ; + } + else if((video_W / video_H) > show_W / show_H) + { + int adjust_H = (int)(show_H - (video_H / video_W) * show_W) / 2 ; + + rect->left = 0 ; + rect->top = adjust_H ; + rect->right = scr_width ; + rect->bottom = scr_height - adjust_H ; + } +} + +BOOL CD3DVidRender::Render_YUV(unsigned char * pdata, int img_width, int img_height) +{ + HRESULT lRet = -1; + + D3DLOCKED_RECT d3d_rect; + lRet = m_pDirect3DSurfaceRender->LockRect(&d3d_rect, NULL, D3DLOCK_DONOTWAIT); + if(FAILED(lRet)) + { + return FALSE; + } + + byte *pSrc = pdata; + byte * pDest = (BYTE *)d3d_rect.pBits; + int stride = d3d_rect.Pitch; + unsigned long i = 0; + + for(i = 0; i < img_height; i ++) + { + memmove(pDest + i * stride,pSrc + i * img_width, img_width); + } + for(i = 0; i < img_height/2; i ++) + { + memmove(pDest + stride * img_height + i * stride / 2,pSrc + img_width * img_height + img_width * img_height / 4 + i * img_width / 2, img_width / 2); + } + for(i = 0; i < img_height / 2; i ++) + { + memmove(pDest + stride * img_height + stride * img_height / 4 + i * stride / 2,pSrc + img_width * img_height + i * img_width / 2, img_width / 2); + } + + lRet = m_pDirect3DSurfaceRender->UnlockRect(); + if(FAILED(lRet)) + { + return FALSE; + } + + m_pDirect3DDevice->Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), 1.0f, 0 ); + m_pDirect3DDevice->BeginScene(); + if (m_pBackBuffer) + { + m_pBackBuffer->Release(); + m_pBackBuffer = NULL; + } + m_pDirect3DDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &m_pBackBuffer); + GetClientRect(d3dpp.hDeviceWindow, &m_rtViewport); + m_pDirect3DDevice->StretchRect(m_pDirect3DSurfaceRender, NULL, m_pBackBuffer, &m_rtViewport, D3DTEXF_LINEAR); + m_pDirect3DDevice->EndScene(); + m_pDirect3DDevice->Present( NULL, NULL, NULL, NULL ); + + RECT rcCurrentClient; + GetClientRect(d3dpp.hDeviceWindow, &rcCurrentClient); + if( ( UINT )rcCurrentClient.right != d3dpp.BackBufferWidth || + ( UINT )rcCurrentClient.bottom != d3dpp.BackBufferHeight ) + { + d3dpp.BackBufferWidth = rcCurrentClient.right; + d3dpp.BackBufferHeight = rcCurrentClient.bottom; + + InitD3D_YUV(d3dpp.hDeviceWindow, img_width, img_height); + } + + if (m_pDirect3DDevice && m_pDirect3DDevice->TestCooperativeLevel() == D3DERR_DEVICENOTRESET) + { + InitD3D_YUV(d3dpp.hDeviceWindow, img_width, img_height); + } + + return TRUE; +} \ No newline at end of file diff --git a/Src/Decoder_H264_ALL/D3DVidRender.h b/Src/Decoder_H264_ALL/D3DVidRender.h new file mode 100644 index 0000000..e61496d --- /dev/null +++ b/Src/Decoder_H264_ALL/D3DVidRender.h @@ -0,0 +1,34 @@ +#pragma once +#include "d3d9.h" +#include "d3dx9.h" + +class CD3DVidRender +{ +public: + CD3DVidRender(void); + ~CD3DVidRender(void); + + void Cleanup(); + + BOOL InitD3D_RGB32(HWND hwnd, int img_width, int img_height); + + BOOL InitD3D_YUV(HWND hwnd, int img_width, int img_height); + + BOOL Render_RGB32(unsigned char* pdata, int width, int height); + + BOOL Render_YUV(unsigned char * pdata, int img_width, int img_height); + + void calculate_display_rect(RECT *rect,int img_width, int img_height, int scr_width, int scr_height) ; + +public: + RECT m_rtViewport; + D3DPRESENT_PARAMETERS d3dpp; + IDirect3D9 * m_pDirect3D9; + IDirect3DDevice9 * m_pDirect3DDevice; + IDirect3DSurface9 * m_pDirect3DSurfaceRender; + IDirect3DSurface9 * m_pBackBuffer; + + RECT m_rtFont; + ID3DXFont* m_pD3DXFont; + D3DXFONT_DESC m_font_desc; +}; diff --git a/Src/Decoder_H264_ALL/DecoderFactory.cpp b/Src/Decoder_H264_ALL/DecoderFactory.cpp new file mode 100644 index 0000000..d026896 --- /dev/null +++ b/Src/Decoder_H264_ALL/DecoderFactory.cpp @@ -0,0 +1,39 @@ +#define _DECODER_INTERFACE_EXPORT_ +#include "DecoderFactory.h" +#include "DecoderHardwareDInterface.h" +#include "DecoderSoftwareInterface.h" + +DecoderFactory::DecoderFactory(void) +{ +} + + +DecoderFactory::~DecoderFactory(void) +{ +} + +DecoderInterface* DecoderFactory::CreateDecoder(EnumDecoderType type) +{ + DecoderInterface * decoder = NULL; + switch (type) + { + case DEC_SOFTWARE: + decoder = new DecoderSoftwareInterface(); + break; + case DEC_HARDWARE: + decoder = new DecoderHardwareDInterface(); + break; + default: + break; + } + return decoder; +} + +void DecoderFactory::DestroyDecoder(DecoderInterface* decoder) +{ + if (decoder) + { + delete decoder; + decoder = NULL; + } +} \ No newline at end of file diff --git a/Src/Decoder_H264_ALL/DecoderFactory.h b/Src/Decoder_H264_ALL/DecoderFactory.h new file mode 100644 index 0000000..7e7113b --- /dev/null +++ b/Src/Decoder_H264_ALL/DecoderFactory.h @@ -0,0 +1,40 @@ +#pragma once +#include + +#ifdef _DECODER_INTERFACE_EXPORT_ +#define _DECODER_INTERFACE_ _declspec(dllexport) +#else +#define _DECODER_INTERFACE_ _declspec(dllimport) +#endif + +typedef enum DecoderType +{ + DEC_SOFTWARE = 0, + DEC_HARDWARE = 1, +}EnumDecoderType; + +typedef void (*DecodeCallbackFun)(unsigned char* data,int width,int height); + +class _DECODER_INTERFACE_ DecoderInterface +{ +public: + DecoderInterface(void){}; + ~DecoderInterface(void){}; + + virtual bool init(int srcWth,int srcHth,int dstWth = 0,int dstHth = 0,int oPixFmt = 0,HWND hwnd = 0) = 0; + virtual void decoding(unsigned char* in_buf,int in_len) = 0; + virtual void release() = 0; + + virtual void setDecodingCallback(DecodeCallbackFun fun) = 0; +}; + +class _DECODER_INTERFACE_ DecoderFactory +{ +public: + DecoderFactory(void); + ~DecoderFactory(void); + + static DecoderInterface* CreateDecoder(EnumDecoderType type = DEC_SOFTWARE); + static void DestroyDecoder(DecoderInterface* deoder); +}; + diff --git a/Src/Decoder_H264_ALL/DecoderHardwareDInterface.cpp b/Src/Decoder_H264_ALL/DecoderHardwareDInterface.cpp new file mode 100644 index 0000000..f34b770 --- /dev/null +++ b/Src/Decoder_H264_ALL/DecoderHardwareDInterface.cpp @@ -0,0 +1,28 @@ +#include "DecoderHardwareDInterface.h" + +DecoderHardwareDInterface::DecoderHardwareDInterface(void) +{ +} + + +DecoderHardwareDInterface::~DecoderHardwareDInterface(void) +{ +} + +bool DecoderHardwareDInterface::init(int srcWth,int srcHth,int dstWth,int dstHth,int oPixFmt,HWND hwnd) +{ + return decoder.decoder_hw_init(srcWth,srcHth,dstWth,dstHth,oPixFmt,hwnd); +} +void DecoderHardwareDInterface::decoding(unsigned char* in_buf,int in_len) +{ + decoder.decoder_hw_decoding(in_buf,in_len); +} +void DecoderHardwareDInterface::release() +{ + decoder.decoder_hw_release(); +} + +void DecoderHardwareDInterface::setDecodingCallback(CallbackFun fun) +{ + decoder.set_decoding_callback(fun); +} diff --git a/Src/Decoder_H264_ALL/DecoderHardwareDInterface.h b/Src/Decoder_H264_ALL/DecoderHardwareDInterface.h new file mode 100644 index 0000000..5d0faff --- /dev/null +++ b/Src/Decoder_H264_ALL/DecoderHardwareDInterface.h @@ -0,0 +1,21 @@ +#pragma once +#define _DECODER_INTERFACE_EXPORT_ + +#include "DecoderFactory.h" +#include "decoder_hw_d.h" + +class DecoderHardwareDInterface : public DecoderInterface +{ +public: + DecoderHardwareDInterface(void); + ~DecoderHardwareDInterface(void); + + bool init(int srcWth,int srcHth,int dstWth = 0,int dstHth = 0,int oPixFmt = 0,HWND hwnd = 0); + void decoding(unsigned char* in_buf,int in_len); + void release(); + + void setDecodingCallback(CallbackFun fun); +private: + Decoder_Hardware_D decoder; +}; + diff --git a/Src/Decoder_H264_ALL/DecoderSoftwareInterface.cpp b/Src/Decoder_H264_ALL/DecoderSoftwareInterface.cpp new file mode 100644 index 0000000..d9f567b --- /dev/null +++ b/Src/Decoder_H264_ALL/DecoderSoftwareInterface.cpp @@ -0,0 +1,28 @@ +#include "DecoderSoftwareInterface.h" + +DecoderSoftwareInterface::DecoderSoftwareInterface(void) +{ +} + + +DecoderSoftwareInterface::~DecoderSoftwareInterface(void) +{ +} + +bool DecoderSoftwareInterface::init(int srcWth,int srcHth,int dstWth,int dstHth,int oPixFmt,HWND hwnd) +{ + return decoder.decoder_sw_init(srcWth,srcHth,dstWth,dstHth,oPixFmt); +} +void DecoderSoftwareInterface::decoding(unsigned char* in_buf,int in_len) +{ + decoder.decoder_sw_decoding(in_buf,in_len); +} +void DecoderSoftwareInterface::release() +{ + decoder.decoder_sw_release(); +} + + void DecoderSoftwareInterface::setDecodingCallback(CallbackFun fun) + { + decoder.set_decoding_callback(fun); + } diff --git a/Src/Decoder_H264_ALL/DecoderSoftwareInterface.h b/Src/Decoder_H264_ALL/DecoderSoftwareInterface.h new file mode 100644 index 0000000..f840e9d --- /dev/null +++ b/Src/Decoder_H264_ALL/DecoderSoftwareInterface.h @@ -0,0 +1,22 @@ +#pragma once +#define _DECODER_INTERFACE_EXPORT_ + +#include "DecoderFactory.h" +#include "decoder_sw.h" + +class DecoderSoftwareInterface : public DecoderInterface +{ +public: + DecoderSoftwareInterface(void); + ~DecoderSoftwareInterface(void); + + bool init(int srcWth,int srcHth,int dstWth = 0,int dstHth = 0,int oPixFmt = 0,HWND hwnd = 0); + void decoding(unsigned char* in_buf,int in_len); + void release(); + + void setDecodingCallback(CallbackFun fun); + +private: + Decoder_Software decoder; +}; + diff --git a/Src/Decoder_H264_ALL/Decoder_H264_ALL.vcxproj b/Src/Decoder_H264_ALL/Decoder_H264_ALL.vcxproj new file mode 100644 index 0000000..0229420 --- /dev/null +++ b/Src/Decoder_H264_ALL/Decoder_H264_ALL.vcxproj @@ -0,0 +1,113 @@ +锘 + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + + + + + + + + + + + + + + + {5756743E-2CA9-41B7-A71D-0A4044E2F1A0} + Win32Proj + Decoder_Hardware + + + + DynamicLibrary + true + MultiByte + + + DynamicLibrary + false + true + MultiByte + + + + + + + + + + + + + true + $(ProjectName)D + + + false + $(ProjectName)R + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;DECODER_HARDWARE_EXPORTS;%(PreprocessorDefinitions) + include;D3D\include + Async + + + Windows + true + lib;D3D\lib + + + copy $(OutDir)$(ProjectName)D.lib ..\..\Lib\$(ProjectName)D.lib +copy $(OutDir)$(ProjectName)D.dll ..\..\Bin\$(ProjectName)D.dll + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;DECODER_HARDWARE_EXPORTS;%(PreprocessorDefinitions) + include;D3D\include + Async + + + Windows + true + true + false + lib;D3D\lib + + + copy $(OutDir)$(ProjectName)R.lib ..\..\Lib\$(ProjectName)R.lib +copy $(OutDir)$(ProjectName)R.dll ..\..\Bin\$(ProjectName)R.dll + + + + + + \ No newline at end of file diff --git a/Src/Decoder_H264_ALL/Decoder_H264_ALL.vcxproj.filters b/Src/Decoder_H264_ALL/Decoder_H264_ALL.vcxproj.filters new file mode 100644 index 0000000..9db1f18 --- /dev/null +++ b/Src/Decoder_H264_ALL/Decoder_H264_ALL.vcxproj.filters @@ -0,0 +1,63 @@ +锘 + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 婧愭枃浠 + + + 婧愭枃浠 + + + 婧愭枃浠 + + + 婧愭枃浠 + + + 婧愭枃浠 + + + 婧愭枃浠 + + + 婧愭枃浠 + + + + + 澶存枃浠 + + + 澶存枃浠 + + + 澶存枃浠 + + + 澶存枃浠 + + + 澶存枃浠 + + + 澶存枃浠 + + + 澶存枃浠 + + + \ No newline at end of file diff --git a/Src/Decoder_H264_ALL/decoder_hw_d.cpp b/Src/Decoder_H264_ALL/decoder_hw_d.cpp new file mode 100644 index 0000000..2336de6 --- /dev/null +++ b/Src/Decoder_H264_ALL/decoder_hw_d.cpp @@ -0,0 +1,341 @@ +#include +#include "decoder_hw_d.h" + +AVPixelFormat GetHwFormat(AVCodecContext *s, const AVPixelFormat *pix_fmts) +{ + InputStream* ist = (InputStream*)s->opaque; + ist->active_hwaccel_id = HWACCEL_DXVA2; + ist->hwaccel_pix_fmt = AV_PIX_FMT_DXVA2_VLD; + return ist->hwaccel_pix_fmt; +} + +bool Decoder_Hardware_D::ffmpeg_ref_release() +{ + if (codecctx->opaque) + { + delete codecctx->opaque; + codecctx->opaque = NULL; + } + if (codecctx) + { + avcodec_close(codecctx); + av_free(codecctx); + codecctx = NULL; + } + if (mFrameYUV) + { + av_frame_free(&mFrameYUV); + mFrameYUV = NULL; + } + if (mSrcFrame) + { + av_frame_free(&mSrcFrame); + mSrcFrame = NULL; + } + if (mDstFrame) + { + av_frame_free(&mDstFrame); + mDstFrame = NULL; + } + if (img_convert_ctx) + { + sws_freeContext(img_convert_ctx); + img_convert_ctx = NULL; + } + if (scxt) + { + sws_freeContext(scxt); + scxt = NULL; + } +// av_free_packet(&pkt); +// av_packet_unref(&pkt); + if (s) + { + av_parser_close(s); + s= NULL; + } + return true; +} + +void Decoder_Hardware_D::pic_ref_mem_release() +{ + if (mOutBuf) + { +// delete[] mOutBuf; + av_free(mOutBuf); + mOutBuf = NULL; + } + if (mBufYUV) + { + av_free(mBufYUV); + mBufYUV = NULL; + } + return; +} + +bool Decoder_Hardware_D::decoder_hw_init(int srcWth,int srcHth,int dstWth,int dstHth,int oPixFmt,HWND hwnd) +{ + av_register_all();//注册解码器 + // av_log_set_level(AV_LOG_DEBUG); + + codec = avcodec_find_decoder(AV_CODEC_ID_H264);//根据流信息找到解码器 + if (!codec) { + ffmpeg_ref_release(); + return false; + } + + + codecctx = avcodec_alloc_context3(codec); + if (!codecctx) { + ffmpeg_ref_release(); + return false; + } + + codecctx->coded_width = srcWth; + codecctx->coded_height = srcHth; + codecctx->pix_fmt = AV_PIX_FMT_YUV420P; + + AVCodecContext *temp_codecctx = codecctx; + memcpy(temp_codecctx, codecctx, sizeof(codecctx)); + bAccel = true; + if (bAccel) + { + codecctx->thread_count = 1; // Multithreading is apparently not compatible with hardware decoding + InputStream *ist = new InputStream(); + ist->hwaccel_id = HWACCEL_AUTO; + ist->active_hwaccel_id = HWACCEL_AUTO; + ist->hwaccel_device = "dxva2"; + ist->dec = codec; + ist->dec_ctx = codecctx; + + codecctx->opaque = ist; + if (dxva2_init(codecctx,hwnd) == 0) + { + codecctx->get_buffer2 = ist->hwaccel_get_buffer; + codecctx->get_format = GetHwFormat; + codecctx->thread_safe_callbacks = 1; + } + else + { + bAccel = false; + } + } + + if (dstWth == 0 || dstHth == 0) + { + dstWth = srcWth; + dstHth = srcHth; + } + + mSrcWth = srcWth; + mSrcHth = srcHth; + mDstWth = dstWth; + mDstHth = dstHth; + +// //对于YUV内存有一半的余量 +// mOutBuf = new uint8_t[mDstWth*mDstHth*3]; + + mPixFmt = oPixFmt; + + mSrcFrame = av_frame_alloc(); + if (!mSrcFrame) { + ffmpeg_ref_release(); + return false; + } + mDstFrame = av_frame_alloc(); + if (!mDstFrame) { + ffmpeg_ref_release(); + return false; + } + + if (!bAccel) + { + avcodec_close(codecctx); + codecctx = temp_codecctx; + + m_D3DVidRender.InitD3D_YUV(hwnd, mSrcWth, mSrcHth); + + mFrameYUV = av_frame_alloc(); + if (!mFrameYUV) { + ffmpeg_ref_release(); + return false; + } + mBufYUV = (uint8_t *)av_malloc(av_image_get_buffer_size(AV_PIX_FMT_YUV420P, mSrcWth, mSrcHth, 1)); + av_image_fill_arrays(mFrameYUV->data, ((AVPicture *)mFrameYUV)->linesize, mBufYUV, + AV_PIX_FMT_YUV420P, mSrcWth, mSrcHth, 1); + img_convert_ctx = sws_getContext(mSrcWth, mSrcHth, codecctx->pix_fmt, mSrcWth, mSrcHth, AV_PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL); + if (!img_convert_ctx) + { + ffmpeg_ref_release(); + return false; + } + + + switch (oPixFmt) + { + case 1: + { + opix_fmt = AV_PIX_FMT_RGB24; + } + break; + case 2: + { + opix_fmt = AV_PIX_FMT_BGR24; + } + break; + default: + { + opix_fmt = AV_PIX_FMT_YUV420P; + } + break; + } + + ipix_fmt = AV_PIX_FMT_YUV420P; + scxt = sws_getContext(mSrcWth,mSrcHth,ipix_fmt,mDstWth,mDstHth,opix_fmt,SWS_BILINEAR,NULL,NULL,NULL); + if (!scxt) + { + ffmpeg_ref_release(); + return false; + } + + } + else + { + switch (oPixFmt) + { + case 1: + { + opix_fmt = AV_PIX_FMT_RGB24; + } + break; + case 2: + { + opix_fmt = AV_PIX_FMT_BGR24; + } + break; + default: + { + opix_fmt = AV_PIX_FMT_YUV420P; + } + break; + } + + ipix_fmt = AV_PIX_FMT_NV12; + scxt = sws_getContext(mSrcWth,mSrcHth,ipix_fmt,mDstWth,mDstHth,opix_fmt,SWS_BICUBIC/*SWS_BILINEAR*/,NULL,NULL,NULL); + if (!scxt) + { + ffmpeg_ref_release(); + return false; + } + } + + mOutBuf = (uint8_t *)av_malloc(av_image_get_buffer_size(opix_fmt, mDstWth, mDstHth, 1)); + int ret = av_image_fill_arrays(mDstFrame->data, ((AVPicture *)mDstFrame)->linesize, mOutBuf, + opix_fmt, mDstWth, mDstHth, 1); + + /* open it */ + if (avcodec_open2(codecctx, codec, NULL) < 0) { + ffmpeg_ref_release(); + return false; + } + + s = av_parser_init(AV_CODEC_ID_H264); + + frameCount = 0; + sTime = GetTickCount(); + return true; + +} +void Decoder_Hardware_D::decoder_hw_release() +{ + ffmpeg_ref_release(); + pic_ref_mem_release(); + + eTime = GetTickCount(); + DWORD dTime = eTime - sTime; + + FILE* cfile; + cfile = fopen( "D://run_info.txt", "ab+" ); +// char data[255]; +// sprintf(data,"all frame count:%ld\nstart time:%ld\nend time:%ld\ndiff time:%ld\n",frameCount,sTime,eTime,dTime); +// fwrite(data,1,sizeof(data),cfile); + fprintf(cfile,"all frame count:%ld start time:%ld end time:%ld diff time:%ld\r\r\n",frameCount,sTime,eTime,dTime); + + fclose(cfile); + + +} + +void Decoder_Hardware_D::decoder_hw_decoding(unsigned char* in_buf,int in_len) +{ + int len,size; + unsigned char* Parser_buf = NULL; + while (in_len) + { + len = av_parser_parse2(s,codecctx,&Parser_buf,&size,in_buf,in_len,0,0,0); + in_buf += len; + in_len -= len; + if (size) + { + + int got_picture = 0; + av_init_packet(&pkt);//无需再次初始化 + pkt.data = /*inbuf_H264*/Parser_buf; + pkt.size = /*in_len*/size; + int bytes_used = avcodec_decode_video2(codecctx, mSrcFrame, &got_picture, &pkt); + if (got_picture) + { + if (bAccel) + { + //获取数据同时渲染 + dxva2_draw_call(codecctx, mSrcFrame); + + frameCount ++; +// memcpy(data,pFrameBGR->data[0],codecctx->width*codecctx->height*3); + + if (decodingCallback) + { + dxva2_retrieve_data_call(codecctx, mSrcFrame); + decoder_sws_scale_callback(); + } + } + else + { + sws_scale(img_convert_ctx, (const uint8_t* const*)mSrcFrame->data, mSrcFrame->linesize, + 0, mSrcHth, mFrameYUV->data, mFrameYUV->linesize); + + m_D3DVidRender.Render_YUV(mBufYUV, mSrcFrame->width, mSrcFrame->height); + + frameCount ++; + + if (decodingCallback) + { + decoder_sws_scale_callback(); + } + } + } + + av_packet_unref(&pkt); + } + } +} + +void Decoder_Hardware_D::decoder_sws_scale_callback() +{ + if (opix_fmt == AV_PIX_FMT_RGB24 || opix_fmt == AV_PIX_FMT_BGR24) + { + //翻转yuv + mSrcFrame->data[0] += mSrcFrame->linesize[0]*(mSrcHth -1); + mSrcFrame->linesize[0] *= -1; + mSrcFrame->data[1] += mSrcFrame->linesize[1]*(mSrcHth/2 -1); + mSrcFrame->linesize[1] *= -1; + mSrcFrame->data[2] += mSrcFrame->linesize[2]*(mSrcHth/2 -1); + mSrcFrame->linesize[2] *= -1; + } + + sws_scale(scxt,(const uint8_t* const*)mSrcFrame->data,mSrcFrame->linesize, + 0,mSrcHth,mDstFrame->data,mDstFrame->linesize); + + decodingCallback(mOutBuf/*mDstFrame->data[0]*/,mDstWth,mDstHth); + +} diff --git a/Src/Decoder_H264_ALL/decoder_hw_d.h b/Src/Decoder_H264_ALL/decoder_hw_d.h new file mode 100644 index 0000000..379ccdd --- /dev/null +++ b/Src/Decoder_H264_ALL/decoder_hw_d.h @@ -0,0 +1,115 @@ +extern "C" +{ +#include "libavutil/avstring.h" +#include "libavutil/mathematics.h" +#include "libavutil/pixdesc.h" +#include "libavutil/imgutils.h" +#include "libavutil/dict.h" +#include "libavutil/parseutils.h" +#include "libavutil/samplefmt.h" +#include "libavutil/avassert.h" +#include "libavutil/time.h" +#include "libavformat/avformat.h" +#include "libavdevice/avdevice.h" +#include "libswscale/swscale.h" +#include "libavutil/opt.h" +#include "libavcodec/avfft.h" +#include "libswresample/swresample.h" + +#include "libavfilter/avfiltergraph.h" +#include "libavfilter/buffersink.h" +#include "libavfilter/buffersrc.h" +#include "libavutil/avutil.h" +} +#include "SDL/SDL.h" +#include "SDL/SDL_thread.h" + +#pragma comment(lib, "SDL2.lib") +#pragma comment(lib, "SDL2main.lib") + +#pragma comment(lib, "avcodec.lib") +#pragma comment(lib, "avformat.lib") +#pragma comment(lib, "avutil.lib") +#pragma comment(lib, "avfilter.lib") +#pragma comment(lib, "avdevice.lib") +#pragma comment(lib, "postproc.lib") +#pragma comment(lib, "swresample.lib") +#pragma comment(lib, "swscale.lib") + +#include "ffmpeg_dxva2_d.h" +#include "D3DVidRender.h" + + +typedef void (*CallbackFun)(unsigned char* data,int width,int height); + +class Decoder_Hardware_D +{ +public: + Decoder_Hardware_D() + { + mSrcWth = 0; + mSrcHth = 0; + mDstWth = 0; + mDstHth = 0; + mPixFmt = 0; + mOutBuf = NULL; + mBufYUV = NULL; + codec = NULL; + codecctx = NULL; + //pkt; + img_convert_ctx = NULL ; + scxt = NULL ; + mFrameYUV = NULL; + mSrcFrame = NULL; + mDstFrame = NULL; + s = NULL; + bAccel = true; + ipix_fmt = AV_PIX_FMT_YUV420P; + opix_fmt = AV_PIX_FMT_YUV420P; + + decodingCallback = NULL; + + frameCount = 0; + sTime = 0; + eTime = 0; + } + ~Decoder_Hardware_D(){} + + bool decoder_hw_init(int srcWth,int srcHth,int dstWth,int dstHth,int oPixFmt,HWND hwnd); + void decoder_hw_decoding(unsigned char* in_buf,int in_len); + void decoder_hw_release(); + void set_decoding_callback(CallbackFun fun){decodingCallback = fun;} + +protected: + bool ffmpeg_ref_release(); + void pic_ref_mem_release(); + void decoder_sws_scale_callback(); +private: + + CD3DVidRender m_D3DVidRender; + + int mSrcWth; + int mSrcHth; + int mDstWth; + int mDstHth; + int mPixFmt; + uint8_t *mOutBuf; + uint8_t *mBufYUV; + AVCodec *codec; + AVCodecContext *codecctx; + AVPacket pkt; + struct SwsContext *img_convert_ctx; + struct SwsContext *scxt; + AVFrame *mFrameYUV; + AVFrame *mSrcFrame; + AVFrame *mDstFrame; + AVCodecParserContext *s; + bool bAccel; + AVPixelFormat ipix_fmt; + AVPixelFormat opix_fmt; + + CallbackFun decodingCallback; + + DWORD frameCount; + DWORD sTime,eTime; +}; \ No newline at end of file diff --git a/Src/Decoder_H264_ALL/decoder_sw.cpp b/Src/Decoder_H264_ALL/decoder_sw.cpp new file mode 100644 index 0000000..0d35eb1 --- /dev/null +++ b/Src/Decoder_H264_ALL/decoder_sw.cpp @@ -0,0 +1,264 @@ +#include +#include "decoder_sw.h" + +void Decoder_Software::ffmpeg_ref_release() +{ + if (codecctx) + { + avcodec_close(codecctx); + av_free(codecctx); + codecctx = NULL; + } + if (mSrcFrame) + { + av_frame_free(&mSrcFrame); + mSrcFrame = NULL; + } + if (mDstFrame) + { + av_frame_free(&mDstFrame); + mDstFrame = NULL; + } + if (scxt) + { + sws_freeContext(scxt); + scxt = NULL; + } +// av_free_packet(&pkt); + if (s) + { + av_parser_close(s); + s= NULL; + } + return; +} + +void Decoder_Software::pic_ref_mem_release() +{ + if (mOutBuf) + { +// delete[] mOutBuf; + av_free(mOutBuf); + mOutBuf = NULL; + } + return; +} +//oPixFmt: 0-YUV 1-RGB 2-BGR +bool Decoder_Software::decoder_sw_init(int srcWth,int srcHth,int dstWth,int dstHth,int oPixFmt) +{ + // av_register_all(); + avcodec_register_all(); + + /* find the mpeg1 video decoder */ + codec = avcodec_find_decoder(AV_CODEC_ID_H264); + if (!codec) + { + ffmpeg_ref_release(); + return false; + } + + codecctx = avcodec_alloc_context3(codec); + if (!codecctx) + { + ffmpeg_ref_release(); + return false; + } + if(codec->capabilities&CODEC_CAP_TRUNCATED) + codecctx->flags|= CODEC_FLAG_TRUNCATED; /* we do not send complete frames */ + // codecctx->flags2 |= CODEC_FLAG2_FAST; + + // codecctx->width = img_width; + // codecctx->height = img_height; + codecctx->pix_fmt = AV_PIX_FMT_YUV420P; + + /* open it */ + if (avcodec_open2(codecctx, codec, NULL) < 0) + { + ffmpeg_ref_release(); + return false; + } + + if (dstWth == 0 || dstHth == 0) + { + dstWth = srcWth; + dstHth = srcHth; + } + + mSrcWth = srcWth; + mSrcHth = srcHth; + mDstWth = dstWth; + mDstHth = dstHth; + +// //对于YUV内存有一半的余量 + // mOutBuf = new uint8_t[mDstWth*mDstHth*3]; + + mPixFmt = oPixFmt; + + switch (oPixFmt) + { + case 1: + { + opix_fmt = AV_PIX_FMT_RGB24; + } + break; + case 2: + { + opix_fmt = AV_PIX_FMT_BGR24; + } + break; + default: + { + opix_fmt = AV_PIX_FMT_YUV420P; + } + break; + } + + scxt = sws_getContext(mSrcWth,mSrcHth,codecctx->pix_fmt,mDstWth,mDstHth,opix_fmt,SWS_BILINEAR,NULL,NULL,NULL); + if (!scxt) + { + ffmpeg_ref_release(); + return false; + } + + mSrcFrame = av_frame_alloc(); + if (!mSrcFrame) + { + ffmpeg_ref_release(); + return false; + } + + mDstFrame = av_frame_alloc(); + if (!mDstFrame) + { + ffmpeg_ref_release(); + return false; + } + + mOutBuf = (uint8_t *)av_malloc(av_image_get_buffer_size(opix_fmt, mDstWth, mDstHth, 1)); + av_image_fill_arrays(mDstFrame->data, ((AVPicture *)mDstFrame)->linesize, mOutBuf, opix_fmt, mDstWth, mDstHth, 1); + + s = av_parser_init(AV_CODEC_ID_H264); + + return true; +} +void Decoder_Software::decoder_sw_release() +{ + ffmpeg_ref_release(); + pic_ref_mem_release(); +} + +// 实现1 +bool YV12_to_RGB24(unsigned char* pYV12, unsigned char* pRGB24, int iWidth, int iHeight) +{ + if(!pYV12 || !pRGB24) + return false; + + const long nYLen = long(iHeight * iWidth); + const int nHfWidth = (iWidth>>1); + + if(nYLen < 1 || nHfWidth < 1) + return false; + + unsigned char* yData = pYV12; + unsigned char* vData = &yData[nYLen]; + unsigned char* uData = &vData[nYLen>>2]; + if(!uData || !vData) + return false; + + int rgb[3]; + int i, j, m, n, x, y; + m = -iWidth; + n = -nHfWidth; + for(y = 0; y < iHeight; y++) + { + m += iWidth; + + if(!(y % 2)) + n += nHfWidth; + + for(x = 0; x < iWidth; x++) + { + i = m + x; + j = n + (x>>1); + rgb[2] = int(yData[i] + 1.370705 * (vData[j] - 128)); // r分量值 + rgb[1] = int(yData[i] - 0.698001 * (uData[j] - 128) - 0.703125 * (vData[j] - 128)); // g分量值 + rgb[0] = int(yData[i] + 1.732446 * (uData[j] - 128)); // b分量值 + j = nYLen - iWidth - m + x; + i = (j<<1) + j; + for(j = 0; j<3; j++) + { + if(rgb[j] >= 0 && rgb[j] <= 255) + { + pRGB24[i + j] = rgb[j]; + } + else + { + pRGB24[i + j] = (rgb[j] < 0) ? 0 : 255; + } + } + } + } + + return true; +} + +void Decoder_Software::decoder_sw_decoding(unsigned char* in_buf,int in_len) +{ + if (in_buf == nullptr || in_len <= 0) + { + return; + } + + unsigned char* Parser_buf = nullptr; + int len = 0,size = 0 ; + while (in_len) + { + len = av_parser_parse2(s,codecctx,&Parser_buf,&size,in_buf,in_len,0,0,0); + in_buf += len; + in_len -= len; + if (size) + { + av_init_packet(&pkt);//无需再次初始化 + pkt.data = Parser_buf; + pkt.size = size; + int got_picture = 0; + int ret = avcodec_decode_video2(codecctx,mSrcFrame,&got_picture,&pkt); + if (got_picture > 0 && ret > 0) + { + //callback + if (decodingCallback > 0) + { + if (opix_fmt == AV_PIX_FMT_RGB24 || opix_fmt == AV_PIX_FMT_BGR24) + { + //翻转yuv + mSrcFrame->data[0] += mSrcFrame->linesize[0]*(mSrcHth -1); + mSrcFrame->linesize[0] *= -1; + mSrcFrame->data[1] += mSrcFrame->linesize[1]*(mSrcHth/2 -1); + mSrcFrame->linesize[1] *= -1; + mSrcFrame->data[2] += mSrcFrame->linesize[2]*(mSrcHth/2 -1); + mSrcFrame->linesize[2] *= -1; + } + + + //将yuv转换为bgr + try + { + int ret = sws_scale(scxt, + mSrcFrame->data, + mSrcFrame->linesize, + 0, + mSrcHth, + mDstFrame->data, + mDstFrame->linesize); + } + catch (...) + { + int error = 0; + } + + decodingCallback(mOutBuf,mDstWth,mDstHth); + } + } + } + } +} \ No newline at end of file diff --git a/Src/Decoder_H264_ALL/decoder_sw.h b/Src/Decoder_H264_ALL/decoder_sw.h new file mode 100644 index 0000000..4ce038e --- /dev/null +++ b/Src/Decoder_H264_ALL/decoder_sw.h @@ -0,0 +1,68 @@ +extern "C" +{ +#include "libavcodec/avcodec.h" +#include "libavformat/avformat.h" +#include "libswscale/swscale.h" +#include "libavutil/imgutils.h" +} + +#pragma comment(lib, "avcodec.lib") +#pragma comment(lib, "avformat.lib") +#pragma comment(lib, "avutil.lib") +#pragma comment(lib, "swscale.lib") + +typedef void (*CallbackFun)(unsigned char* data,int width,int height); + +class Decoder_Software +{ +public: + Decoder_Software() + { + mSrcWth = 0; + mSrcHth = 0; + mDstWth = 0; + mDstHth = 0; + mPixFmt = 0; + dst_bgr_pic_size = 0; + dst_yuv_pic_size = 0; + codec = NULL; + codecctx= NULL; + mSrcFrame = NULL; + mDstFrame = NULL; + scxt = NULL; +// AVPacket pkt; + s = NULL; + opix_fmt = AV_PIX_FMT_YUV420P; + + mOutBuf = NULL; + } + ~Decoder_Software(){} + + bool decoder_sw_init(int srcWth,int srcHth,int dstWth,int dstHth,int oPixFmt); + void decoder_sw_decoding(unsigned char* in_buf,int in_len); + void decoder_sw_release(); + void set_decoding_callback(CallbackFun fun){decodingCallback = fun;} + +protected: + void ffmpeg_ref_release(); + void pic_ref_mem_release(); +private: + int mSrcWth; + int mSrcHth; + int mDstWth; + int mDstHth; + int mPixFmt; + int dst_bgr_pic_size; + int dst_yuv_pic_size; + AVCodec *codec; + AVCodecContext *codecctx; + AVFrame *mSrcFrame; + AVFrame *mDstFrame; + SwsContext *scxt; + AVPacket pkt; + AVCodecParserContext *s; + uint8_t *mOutBuf; + AVPixelFormat opix_fmt; + + CallbackFun decodingCallback; +}; \ No newline at end of file diff --git a/Src/Decoder_H264_ALL/ffmpeg_dxva2_d.cpp b/Src/Decoder_H264_ALL/ffmpeg_dxva2_d.cpp new file mode 100644 index 0000000..403bb5b --- /dev/null +++ b/Src/Decoder_H264_ALL/ffmpeg_dxva2_d.cpp @@ -0,0 +1,782 @@ +/* +* This file is part of FFmpeg. +* +* FFmpeg is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* FFmpeg is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with FFmpeg; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include + +#include "ffmpeg_dxva2_d.h" + +extern "C" +{ + +#include "libavcodec/dxva2.h" + +#include "libavutil/avassert.h" +#include "libavutil/buffer.h" +#include "libavutil/frame.h" +#include "libavutil/imgutils.h" +#include "libavutil/pixfmt.h" +} + +typedef struct { + const char *name; + D3DFORMAT format; + AVPixelFormat codec; +} d3d_format_t; +/* XXX Prefered format must come first */ +static const d3d_format_t d3d_formats[] = { + { "YV12", (D3DFORMAT)MAKEFOURCC('Y', 'V', '1', '2'), AV_PIX_FMT_YUV420P }, + { "NV12", (D3DFORMAT)MAKEFOURCC('N', 'V', '1', '2'), AV_PIX_FMT_NV12 }, + + { NULL, (D3DFORMAT)0, AV_PIX_FMT_NONE } +}; + +/* define all the GUIDs used directly here, +to avoid problems with inconsistent dxva2api.h versions in mingw-w64 and different MSVC version */ +#include +DEFINE_GUID(IID_IDirectXVideoDecoderService, 0xfc51a551, 0xd5e7, 0x11d9, 0xaf, 0x55, 0x00, 0x05, 0x4e, 0x43, 0xff, 0x02); + +DEFINE_GUID(DXVA2_ModeMPEG2_VLD, 0xee27417f, 0x5e28, 0x4e65, 0xbe, 0xea, 0x1d, 0x26, 0xb5, 0x08, 0xad, 0xc9); +DEFINE_GUID(DXVA2_ModeMPEG2and1_VLD, 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60); +DEFINE_GUID(DXVA2_ModeH264_E, 0x1b81be68, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5); +DEFINE_GUID(DXVA2_ModeH264_F, 0x1b81be69, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5); +DEFINE_GUID(DXVADDI_Intel_ModeH264_E, 0x604F8E68, 0x4951, 0x4C54, 0x88, 0xFE, 0xAB, 0xD2, 0x5C, 0x15, 0xB3, 0xD6); +DEFINE_GUID(DXVA2_ModeVC1_D, 0x1b81beA3, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5); +DEFINE_GUID(DXVA2_ModeVC1_D2010, 0x1b81beA4, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5); +DEFINE_GUID(DXVA2_ModeHEVC_VLD_Main, 0x5b11d51b, 0x2f4c, 0x4452, 0xbc, 0xc3, 0x09, 0xf2, 0xa1, 0x16, 0x0c, 0xc0); +DEFINE_GUID(DXVA2_ModeHEVC_VLD_Main10, 0x107af0e0, 0xef1a, 0x4d19, 0xab, 0xa8, 0x67, 0xa1, 0x63, 0x07, 0x3d, 0x13); +DEFINE_GUID(DXVA2_ModeVP9_VLD_Profile0, 0x463707f8, 0xa1d0, 0x4585, 0x87, 0x6d, 0x83, 0xaa, 0x6d, 0x60, 0xb8, 0x9e); +DEFINE_GUID(DXVA2_NoEncrypt, 0x1b81beD0, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5); +DEFINE_GUID(GUID_NULL, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); + +typedef IDirect3D9* WINAPI pDirect3DCreate9(UINT); +typedef HRESULT WINAPI pCreateDeviceManager9(UINT *, IDirect3DDeviceManager9 **); + +CRITICAL_SECTION cs; + +typedef struct dxva2_mode { + const GUID *guid; + enum AVCodecID codec; +} dxva2_mode; + +static const dxva2_mode dxva2_modes[] = { + /* MPEG-2 */ + { &DXVA2_ModeMPEG2_VLD, AV_CODEC_ID_MPEG2VIDEO }, + { &DXVA2_ModeMPEG2and1_VLD, AV_CODEC_ID_MPEG2VIDEO }, + + /* H.264 */ + { &DXVA2_ModeH264_F, AV_CODEC_ID_H264 }, + { &DXVA2_ModeH264_E, AV_CODEC_ID_H264 }, + /* Intel specific H.264 mode */ + { &DXVADDI_Intel_ModeH264_E, AV_CODEC_ID_H264 }, + + /* VC-1 / WMV3 */ + { &DXVA2_ModeVC1_D2010, AV_CODEC_ID_VC1 }, + { &DXVA2_ModeVC1_D2010, AV_CODEC_ID_WMV3 }, + { &DXVA2_ModeVC1_D, AV_CODEC_ID_VC1 }, + { &DXVA2_ModeVC1_D, AV_CODEC_ID_WMV3 }, + + /* HEVC/H.265 */ + { &DXVA2_ModeHEVC_VLD_Main, AV_CODEC_ID_HEVC }, + { &DXVA2_ModeHEVC_VLD_Main10, AV_CODEC_ID_HEVC }, + + /* VP8/9 */ + { &DXVA2_ModeVP9_VLD_Profile0, AV_CODEC_ID_VP9 }, + + { NULL, AV_CODEC_ID_NONE }, +}; + +typedef struct surface_info { + int used; + uint64_t age; +} surface_info; + +typedef struct DXVA2Context { + HMODULE d3dlib; + HMODULE dxva2lib; + + HANDLE deviceHandle; + + IDirect3D9 *d3d9; + IDirect3DDevice9 *d3d9device; + IDirect3DDeviceManager9 *d3d9devmgr; + IDirectXVideoDecoderService *decoder_service; + IDirectXVideoDecoder *decoder; + + GUID decoder_guid; + DXVA2_ConfigPictureDecode decoder_config; + + LPDIRECT3DSURFACE9 *surfaces; + surface_info *surface_infos; + uint32_t num_surfaces; + uint64_t surface_age; + + AVFrame *tmp_frame; +} DXVA2Context; + +typedef struct DXVA2SurfaceWrapper { + DXVA2Context *ctx; + LPDIRECT3DSURFACE9 surface; + IDirectXVideoDecoder *decoder; +} DXVA2SurfaceWrapper; + +static void dxva2_destroy_decoder(AVCodecContext *s) +{ + InputStream *ist = (InputStream *)s->opaque; + DXVA2Context *ctx = (DXVA2Context *)ist->hwaccel_ctx; + int i; + + if (ctx->surfaces) + { + for (i = 0; i < ctx->num_surfaces; i++) + { + if (ctx->surfaces[i]) + IDirect3DSurface9_Release(ctx->surfaces[i]); + } + } + av_freep(&ctx->surfaces); + av_freep(&ctx->surface_infos); + ctx->num_surfaces = 0; + ctx->surface_age = 0; + + if (ctx->decoder) { + //IDirectXVideoDecoder_Release(ctx->decoder); + ctx->decoder->Release(); + ctx->decoder = NULL; + } +} + +static void dxva2_uninit(AVCodecContext *s) +{ + InputStream *ist = (InputStream *)s->opaque; + DXVA2Context *ctx = (DXVA2Context *)ist->hwaccel_ctx; + + ist->hwaccel_uninit = NULL; + ist->hwaccel_get_buffer = NULL; + ist->hwaccel_retrieve_data = NULL; + + if (ctx->decoder) + dxva2_destroy_decoder(s); + + if (ctx->decoder_service) + //IDirectXVideoDecoderService_Release(ctx->decoder_service); + ctx->decoder_service->Release(); + + if (ctx->d3d9devmgr && ctx->deviceHandle != INVALID_HANDLE_VALUE) + //IDirect3DDeviceManager9_CloseDeviceHandle(ctx->d3d9devmgr, ctx->deviceHandle); + ctx->d3d9devmgr->CloseDeviceHandle(ctx->deviceHandle); + + if (ctx->d3d9devmgr) + //IDirect3DDeviceManager9_Release(ctx->d3d9devmgr); + ctx->d3d9devmgr->Release(); + + if (ctx->d3d9device) + IDirect3DDevice9_Release(ctx->d3d9device); + + if (ctx->d3d9) + IDirect3D9_Release(ctx->d3d9); + + if (ctx->d3dlib) + FreeLibrary(ctx->d3dlib); + + if (ctx->dxva2lib) + FreeLibrary(ctx->dxva2lib); + + av_frame_free(&ctx->tmp_frame); + + av_freep(&ist->hwaccel_ctx); + av_freep(&s->hwaccel_context); + + DeleteCriticalSection(&cs); + +} + +static void dxva2_release_buffer(void *opaque, uint8_t *data) +{ + DXVA2SurfaceWrapper *w = (DXVA2SurfaceWrapper *)opaque; + DXVA2Context *ctx = w->ctx; + int i; + + for (i = 0; i < ctx->num_surfaces; i++) + { + if (ctx->surfaces[i] == w->surface) + { + ctx->surface_infos[i].used = 0; + break; + } + } + IDirect3DSurface9_Release(w->surface); + //IDirectXVideoDecoder_Release(w->decoder); + w->decoder->Release(); + av_free(w); +} + +static int dxva2_get_buffer(AVCodecContext *s, AVFrame *frame, int flags) +{ + InputStream *ist = (InputStream *)s->opaque; + DXVA2Context *ctx = (DXVA2Context *)ist->hwaccel_ctx; + int i, old_unused = -1; + LPDIRECT3DSURFACE9 surface; + DXVA2SurfaceWrapper *w = NULL; + + av_assert0(frame->format == AV_PIX_FMT_DXVA2_VLD); + + for (i = 0; i < ctx->num_surfaces; i++) + { + surface_info *info = &ctx->surface_infos[i]; + if (!info->used && (old_unused == -1 || info->age < ctx->surface_infos[old_unused].age)) + old_unused = i; + } + if (old_unused == -1) { + av_log(NULL, AV_LOG_ERROR, "No free DXVA2 surface!\n"); + return AVERROR(ENOMEM); + } + i = old_unused; + + surface = ctx->surfaces[i]; + + w = (DXVA2SurfaceWrapper *)av_mallocz(sizeof(*w)); + if (!w) + return AVERROR(ENOMEM); + + frame->buf[0] = av_buffer_create((uint8_t*)surface, 0, + dxva2_release_buffer, w, + AV_BUFFER_FLAG_READONLY); + if (!frame->buf[0]) { + av_free(w); + return AVERROR(ENOMEM); + } + + w->ctx = ctx; + w->surface = surface; + IDirect3DSurface9_AddRef(w->surface); + w->decoder = ctx->decoder; + //IDirectXVideoDecoder_AddRef(w->decoder); + w->decoder->AddRef(); + + ctx->surface_infos[i].used = 1; + ctx->surface_infos[i].age = ctx->surface_age++; + + frame->data[3] = (uint8_t *)surface; + + return 0; +} + +D3DPRESENT_PARAMETERS d3dpp = { 0 }; +RECT m_rtViewport; +IDirect3DSurface9 * m_pDirect3DSurfaceRender = NULL; +IDirect3DSurface9 * m_pBackBuffer = NULL; +static int dxva2_draw(AVCodecContext *s, AVFrame *frame) +{ + // 调试记录 + // 姓名:张治国 日期:2018年5月25日 + // 内容1:渲染区域初始化为小,变大之后不显示图像,尚无调试结果,因此可以先初始化为大,再变小,问题解决 + // 内容2:给函数StretchRect第四个参数赋值应置为NULL,否则在显示区域变化后,会出现渲染不完全的黑边 + LPDIRECT3DSURFACE9 surface = (LPDIRECT3DSURFACE9)frame->data[3]; + InputStream *ist = (InputStream *)s->opaque; + DXVA2Context *ctx = (DXVA2Context *)ist->hwaccel_ctx; + + EnterCriticalSection(&cs); + + ctx->d3d9device->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); + ctx->d3d9device->BeginScene(); + if (m_pBackBuffer) + { + m_pBackBuffer->Release(); + m_pBackBuffer = NULL; + } + // 该代码将离屏表面的数据传给了后台缓冲表面 + ctx->d3d9device->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &m_pBackBuffer); + GetClientRect(d3dpp.hDeviceWindow, &m_rtViewport); + // 此处将一个矩形区域的像素从内存的surface上转移到图像显示界面上 + // 如果在StretchRect中的第四个参数传递控件大小,则会判定逻辑出错,导致硬件渲染不完整 + //ctx->d3d9device->StretchRect(surface, NULL, m_pBackBuffer, &m_rtViewport, D3DTEXF_LINEAR); + ctx->d3d9device->StretchRect(surface, NULL, m_pBackBuffer, NULL, D3DTEXF_LINEAR); + ctx->d3d9device->EndScene(); + ctx->d3d9device->Present(NULL, NULL, NULL, NULL); + + LeaveCriticalSection(&cs); + + return 0; +} + +static int dxva2_retrieve_data(AVCodecContext *s, AVFrame *frame) +{ + LPDIRECT3DSURFACE9 surface = (LPDIRECT3DSURFACE9)frame->data[3]; + InputStream *ist = (InputStream *)s->opaque; + DXVA2Context *ctx = (DXVA2Context *)ist->hwaccel_ctx; + D3DSURFACE_DESC surfaceDesc; + D3DLOCKED_RECT LockedRect; + HRESULT hr; + int ret, nbytes; + + IDirect3DSurface9_GetDesc(surface, &surfaceDesc); + + ctx->tmp_frame->width = frame->width; + ctx->tmp_frame->height = frame->height; + // switch (ctx->surface_format){ + // case MKTAG('N','V','1','2'): + ctx->tmp_frame->format = AV_PIX_FMT_NV12; + nbytes = 1; + // break; + // case MKTAG('P','0','1','0'): + // ctx->tmp_frame->format = AV_PIX_FMT_P010; + // nbytes = 2; + // break; + // default: + // av_assert0(0); + // } + + ret = av_frame_get_buffer(ctx->tmp_frame, 32); + if (ret < 0) + return ret; + + hr = IDirect3DSurface9_LockRect(surface, &LockedRect, NULL, D3DLOCK_READONLY); + if (FAILED(hr)) { + av_log(NULL, AV_LOG_ERROR, "Unable to lock DXVA2 surface\n"); + return AVERROR_UNKNOWN; + } + + av_image_copy_plane(ctx->tmp_frame->data[0], ctx->tmp_frame->linesize[0], + (uint8_t*)LockedRect.pBits, + LockedRect.Pitch, frame->width * nbytes, frame->height); + + av_image_copy_plane(ctx->tmp_frame->data[1], ctx->tmp_frame->linesize[1], + (uint8_t*)LockedRect.pBits + LockedRect.Pitch * surfaceDesc.Height, + LockedRect.Pitch, frame->width * nbytes, frame->height / 2); + + IDirect3DSurface9_UnlockRect(surface); + + ret = av_frame_copy_props(ctx->tmp_frame, frame); + if (ret < 0) + goto fail; + + av_frame_unref(frame); + av_frame_move_ref(frame, ctx->tmp_frame); + + return 0; +fail: + av_frame_unref(ctx->tmp_frame); + return ret; +} + +static int dxva2_alloc(AVCodecContext *s, HWND hwnd) +{ + InputStream *ist = (InputStream *)s->opaque; + int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR; + DXVA2Context *ctx; + pDirect3DCreate9 *createD3D = NULL; + pCreateDeviceManager9 *createDeviceManager = NULL; + HRESULT hr; + D3DDISPLAYMODE d3ddm; + unsigned resetToken = 0; + UINT adapter = D3DADAPTER_DEFAULT; + + ctx = (DXVA2Context *)av_mallocz(sizeof(*ctx)); + if (!ctx) + return AVERROR(ENOMEM); + + ctx->deviceHandle = INVALID_HANDLE_VALUE; + + ist->hwaccel_ctx = ctx; + ist->hwaccel_uninit = dxva2_uninit; + ist->hwaccel_get_buffer = dxva2_get_buffer; + ist->hwaccel_retrieve_data = dxva2_retrieve_data; + + ctx->d3dlib = LoadLibrary("d3d9.dll"); + if (!ctx->d3dlib) { + av_log(NULL, loglevel, "Failed to load D3D9 library\n"); + goto fail; + } + ctx->dxva2lib = LoadLibrary("dxva2.dll"); + if (!ctx->dxva2lib) { + av_log(NULL, loglevel, "Failed to load DXVA2 library\n"); + goto fail; + } + + createD3D = (pDirect3DCreate9 *)GetProcAddress(ctx->d3dlib, "Direct3DCreate9"); + if (!createD3D) { + av_log(NULL, loglevel, "Failed to locate Direct3DCreate9\n"); + goto fail; + } + createDeviceManager = (pCreateDeviceManager9 *)GetProcAddress(ctx->dxva2lib, "DXVA2CreateDirect3DDeviceManager9"); + if (!createDeviceManager) { + av_log(NULL, loglevel, "Failed to locate DXVA2CreateDirect3DDeviceManager9\n"); + goto fail; + } + + ctx->d3d9 = createD3D(D3D_SDK_VERSION); + if (!ctx->d3d9) { + av_log(NULL, loglevel, "Failed to create IDirect3D object\n"); + goto fail; + } + + if (ist->hwaccel_device) { + adapter = atoi(ist->hwaccel_device); + printf("Using HWAccel device %d\n", adapter); + } + + IDirect3D9_GetAdapterDisplayMode(ctx->d3d9, adapter, &d3ddm); + d3dpp.Windowed = TRUE; + d3dpp.BackBufferCount = 0; + d3dpp.hDeviceWindow = hwnd; + d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; + d3dpp.BackBufferFormat = d3ddm.Format; + d3dpp.EnableAutoDepthStencil = FALSE; + d3dpp.Flags = D3DPRESENTFLAG_VIDEO; + d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; + d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; + + D3DCAPS9 caps; + DWORD BehaviorFlags = D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED; + hr = ctx->d3d9->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &caps); + if (SUCCEEDED(hr)) + { + if (caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) + { + BehaviorFlags = D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE; + } + else + { + BehaviorFlags = D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE; + } + } + + if (ctx->d3d9device) + { + ctx->d3d9device->Release(); + ctx->d3d9device = NULL; + } + + hr = IDirect3D9_CreateDevice(ctx->d3d9, adapter, D3DDEVTYPE_HAL, /*GetDesktopWindow()*/hwnd, BehaviorFlags, &d3dpp, &ctx->d3d9device); + if (FAILED(hr)) { + av_log(NULL, loglevel, "Failed to create Direct3D device\n"); + goto fail; + } + + hr = createDeviceManager(&resetToken, &ctx->d3d9devmgr); + if (FAILED(hr)) { + av_log(NULL, loglevel, "Failed to create Direct3D device manager\n"); + goto fail; + } + + //hr = IDirect3DDeviceManager9_ResetDevice(ctx->d3d9devmgr, ctx->d3d9device, resetToken); + hr = ctx->d3d9devmgr->ResetDevice(ctx->d3d9device, resetToken); + if (FAILED(hr)) { + av_log(NULL, loglevel, "Failed to bind Direct3D device to device manager\n"); + goto fail; + } + + //hr = IDirect3DDeviceManager9_OpenDeviceHandle(ctx->d3d9devmgr, &ctx->deviceHandle); + hr = ctx->d3d9devmgr->OpenDeviceHandle(&ctx->deviceHandle); + if (FAILED(hr)) { + av_log(NULL, loglevel, "Failed to open device handle\n"); + goto fail; + } + + //hr = IDirect3DDeviceManager9_GetVideoService(ctx->d3d9devmgr, ctx->deviceHandle, &IID_IDirectXVideoDecoderService, (void **)&ctx->decoder_service); + hr = ctx->d3d9devmgr->GetVideoService(ctx->deviceHandle, IID_IDirectXVideoDecoderService, (void **)&ctx->decoder_service); + if (FAILED(hr)) { + av_log(NULL, loglevel, "Failed to create IDirectXVideoDecoderService\n"); + goto fail; + } + + ctx->tmp_frame = av_frame_alloc(); + if (!ctx->tmp_frame) + goto fail; + + s->hwaccel_context = av_mallocz(sizeof(struct dxva_context)); + if (!s->hwaccel_context) + goto fail; + + return 0; +fail: + dxva2_uninit(s); + return AVERROR(EINVAL); +} + +static int dxva2_get_decoder_configuration(AVCodecContext *s, const GUID *device_guid, + const DXVA2_VideoDesc *desc, + DXVA2_ConfigPictureDecode *config) +{ + InputStream *ist = (InputStream *)s->opaque; + int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR; + DXVA2Context *ctx = (DXVA2Context *)ist->hwaccel_ctx; + unsigned cfg_count = 0, best_score = 0; + DXVA2_ConfigPictureDecode *cfg_list = NULL; + DXVA2_ConfigPictureDecode best_cfg = { { 0 } }; + HRESULT hr; + int i; + + //hr = IDirectXVideoDecoderService_GetDecoderConfigurations(ctx->decoder_service, device_guid, desc, NULL, &cfg_count, &cfg_list); + hr = ctx->decoder_service->GetDecoderConfigurations(*device_guid, desc, NULL, &cfg_count, &cfg_list); + if (FAILED(hr)) { + av_log(NULL, loglevel, "Unable to retrieve decoder configurations\n"); + return AVERROR(EINVAL); + } + + for (i = 0; i < cfg_count; i++) + { + DXVA2_ConfigPictureDecode *cfg = &cfg_list[i]; + + unsigned score; + if (cfg->ConfigBitstreamRaw == 1) + score = 1; + else if (s->codec_id == AV_CODEC_ID_H264 && cfg->ConfigBitstreamRaw == 2) + score = 2; + else + continue; + if (IsEqualGUID(cfg->guidConfigBitstreamEncryption, DXVA2_NoEncrypt)) + score += 16; + if (score > best_score) { + best_score = score; + best_cfg = *cfg; + } + } + CoTaskMemFree(cfg_list); + + if (!best_score) { + av_log(NULL, loglevel, "No valid decoder configuration available\n"); + return AVERROR(EINVAL); + } + + *config = best_cfg; + return 0; +} + +static const d3d_format_t *D3dFindFormat(D3DFORMAT format) +{ + for (unsigned i = 0; d3d_formats[i].name; i++) { + if (d3d_formats[i].format == format) + return &d3d_formats[i]; + } + return NULL; +} + +static int dxva2_create_decoder(AVCodecContext *s) +{ + InputStream *ist = (InputStream *)s->opaque; + int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR; + DXVA2Context *ctx = (DXVA2Context *)ist->hwaccel_ctx; + struct dxva_context *dxva_ctx = (dxva_context *)s->hwaccel_context; + GUID *guid_list = NULL; + unsigned guid_count = 0, i, j; + GUID device_guid = GUID_NULL; + D3DFORMAT target_format = D3DFMT_UNKNOWN; + DXVA2_VideoDesc desc = { 0 }; + DXVA2_ConfigPictureDecode config; + HRESULT hr; + int surface_alignment; + int ret; + + //hr = IDirectXVideoDecoderService_GetDecoderDeviceGuids(ctx->decoder_service, &guid_count, &guid_list); + hr = ctx->decoder_service->GetDecoderDeviceGuids(&guid_count, &guid_list); + if (FAILED(hr)) { + av_log(NULL, loglevel, "Failed to retrieve decoder device GUIDs\n"); + goto fail; + } + + for (i = 0; dxva2_modes[i].guid; i++) { + D3DFORMAT *target_list = NULL; + unsigned target_count = 0; + const dxva2_mode *mode = &dxva2_modes[i]; + if (mode->codec != s->codec_id) + continue; + + for (j = 0; j < guid_count; j++) { + if (IsEqualGUID(*mode->guid, guid_list[j])) + break; + } + if (j == guid_count) + continue; + + //hr = IDirectXVideoDecoderService_GetDecoderRenderTargets(ctx->decoder_service, mode->guid, &target_count, &target_list); + hr = ctx->decoder_service->GetDecoderRenderTargets(*mode->guid, &target_count, &target_list); + if (FAILED(hr)) { + continue; + } + + for (unsigned j = 0; j < target_count; j++) + { + const D3DFORMAT f = target_list[j]; + const d3d_format_t *format = D3dFindFormat(f); + if (format) { + printf("%s is supported for output\n", format->name); + } + else { + printf("%d is supported for output (%4.4s)\n", f, (const char*)&f); + } + } + +// system("pause"); + + for (unsigned int j = 0; j < target_count; j++) + { + const D3DFORMAT format = target_list[j]; + if (format == MKTAG('N', 'V', '1', '2')) + { + target_format = format; + break; + } + } + CoTaskMemFree(target_list); + if (target_format) { + device_guid = *mode->guid; + break; + } + } + CoTaskMemFree(guid_list); + + if (IsEqualGUID(device_guid, GUID_NULL)) { + av_log(NULL, loglevel, "No decoder device for codec found\n"); + goto fail; + } + + desc.SampleWidth = s->coded_width; + desc.SampleHeight = s->coded_height; + desc.Format = target_format; + + ret = dxva2_get_decoder_configuration(s, &device_guid, &desc, &config); + if (ret < 0) { + goto fail; + } + + /* decoding MPEG-2 requires additional alignment on some Intel GPUs, + but it causes issues for H.264 on certain AMD GPUs..... */ + if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) + surface_alignment = 32; + /* the HEVC DXVA2 spec asks for 128 pixel aligned surfaces to ensure + all coding features have enough room to work with */ + else if (s->codec_id == AV_CODEC_ID_HEVC) + surface_alignment = 128; + else + surface_alignment = 16; + + /* 4 base work surfaces */ + ctx->num_surfaces = 4; + + /* add surfaces based on number of possible refs */ + if (s->codec_id == AV_CODEC_ID_H264 || s->codec_id == AV_CODEC_ID_HEVC) + ctx->num_surfaces += 16; + else if (s->codec_id == AV_CODEC_ID_VP9) + ctx->num_surfaces += 8; + else + ctx->num_surfaces += 2; + + /* add extra surfaces for frame threading */ + if (s->active_thread_type & FF_THREAD_FRAME) + ctx->num_surfaces += s->thread_count; + + ctx->surfaces = (LPDIRECT3DSURFACE9 *)av_mallocz(ctx->num_surfaces * sizeof(*ctx->surfaces)); + ctx->surface_infos = (surface_info *)av_mallocz(ctx->num_surfaces * sizeof(*ctx->surface_infos)); + + if (!ctx->surfaces || !ctx->surface_infos) { + av_log(NULL, loglevel, "Unable to allocate surface arrays\n"); + goto fail; + } + + /*hr = IDirectXVideoDecoderService_CreateSurface(ctx->decoder_service, + FFALIGN(s->coded_width, surface_alignment), + FFALIGN(s->coded_height, surface_alignment), + ctx->num_surfaces - 1, + target_format, D3DPOOL_DEFAULT, 0, + DXVA2_VideoDecoderRenderTarget, + ctx->surfaces, NULL);*/ + hr = ctx->decoder_service->CreateSurface(FFALIGN(s->coded_width, surface_alignment), + FFALIGN(s->coded_height, surface_alignment), + ctx->num_surfaces - 1, + target_format, D3DPOOL_DEFAULT, 0, + DXVA2_VideoDecoderRenderTarget, + ctx->surfaces, NULL); + + if (FAILED(hr)) { + av_log(NULL, loglevel, "Failed to create %d video surfaces\n", ctx->num_surfaces); + goto fail; + } + + /*hr = IDirectXVideoDecoderService_CreateVideoDecoder(ctx->decoder_service, &device_guid, + &desc, &config, ctx->surfaces, + ctx->num_surfaces, &ctx->decoder);*/ + hr = ctx->decoder_service->CreateVideoDecoder(device_guid, + &desc, &config, ctx->surfaces, + ctx->num_surfaces, &ctx->decoder); + if (FAILED(hr)) { + av_log(NULL, loglevel, "Failed to create DXVA2 video decoder\n"); + goto fail; + } + + ctx->decoder_guid = device_guid; + ctx->decoder_config = config; + + dxva_ctx->cfg = &ctx->decoder_config; + dxva_ctx->decoder = ctx->decoder; + dxva_ctx->surface = ctx->surfaces; + dxva_ctx->surface_count = ctx->num_surfaces; + + if (IsEqualGUID(ctx->decoder_guid, DXVADDI_Intel_ModeH264_E)) + dxva_ctx->workaround |= FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO; + + return 0; +fail: + dxva2_destroy_decoder(s); + return AVERROR(EINVAL); +} + +int dxva2_init(AVCodecContext *s, HWND hwnd) +{ + InitializeCriticalSection(&cs); + + InputStream *ist = (InputStream *)s->opaque; + int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR; + DXVA2Context *ctx; + int ret; + + if (!ist->hwaccel_ctx && hwnd != NULL) { + ret = dxva2_alloc(s,hwnd); + if (ret < 0) + return ret; + } + ctx = (DXVA2Context *)ist->hwaccel_ctx; + + if (s->codec_id == AV_CODEC_ID_H264 && + (s->profile & ~FF_PROFILE_H264_CONSTRAINED) > FF_PROFILE_H264_HIGH) { + av_log(NULL, loglevel, "Unsupported H.264 profile for DXVA2 HWAccel: %d\n", s->profile); + return AVERROR(EINVAL); + } + + if (ctx->decoder) + dxva2_destroy_decoder(s); + + ret = dxva2_create_decoder(s); + if (ret < 0) { + av_log(NULL, loglevel, "Error creating the DXVA2 decoder\n"); + return ret; + } + + return 0; +} + +int dxva2_retrieve_data_call(AVCodecContext *s, AVFrame *frame) +{ + return dxva2_retrieve_data(s, frame); +} + +int dxva2_draw_call(AVCodecContext *s, AVFrame *frame) +{ + return dxva2_draw(s, frame); +} \ No newline at end of file diff --git a/Src/Decoder_H264_ALL/ffmpeg_dxva2_d.h b/Src/Decoder_H264_ALL/ffmpeg_dxva2_d.h new file mode 100644 index 0000000..6841a34 --- /dev/null +++ b/Src/Decoder_H264_ALL/ffmpeg_dxva2_d.h @@ -0,0 +1,145 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef FFMPEG_DXVA2_H +#define FFMPEG_DXVA2_H + +//#include "windows.h" + +extern "C"{ +#include "libavcodec/avcodec.h" +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" +} + +enum HWAccelID { + HWACCEL_NONE = 0, + HWACCEL_AUTO, + HWACCEL_VDPAU, + HWACCEL_DXVA2, + HWACCEL_VDA, + HWACCEL_VIDEOTOOLBOX, + HWACCEL_QSV, +}; + +typedef struct AVStream AVStream; +typedef struct AVCodecContext AVCodecContext; +typedef struct AVCodec AVCodec; +typedef struct AVFrame AVFrame; +typedef struct AVDictionary AVDictionary; + +typedef struct InputStream { + int file_index; + AVStream *st; + int discard; /* true if stream data should be discarded */ + int user_set_discard; + int decoding_needed; /* non zero if the packets must be decoded in 'raw_fifo', see DECODING_FOR_* */ +#define DECODING_FOR_OST 1 +#define DECODING_FOR_FILTER 2 + + AVCodecContext *dec_ctx; + AVCodec *dec; + AVFrame *decoded_frame; + AVFrame *filter_frame; /* a ref of decoded_frame, to be sent to filters */ + + int64_t start; /* time when read started */ + /* predicted dts of the next packet read for this stream or (when there are + * several frames in a packet) of the next frame in current packet (in AV_TIME_BASE units) */ + int64_t next_dts; + int64_t dts; ///< dts of the last packet read for this stream (in AV_TIME_BASE units) + + int64_t next_pts; ///< synthetic pts for the next decode frame (in AV_TIME_BASE units) + int64_t pts; ///< current pts of the decoded frame (in AV_TIME_BASE units) + int wrap_correction_done; + + int64_t filter_in_rescale_delta_last; + + int64_t min_pts; /* pts with the smallest value in a current stream */ + int64_t max_pts; /* pts with the higher value in a current stream */ + int64_t nb_samples; /* number of samples in the last decoded audio frame before looping */ + + double ts_scale; + int saw_first_ts; + int showed_multi_packet_warning; + AVDictionary *decoder_opts; + AVRational framerate; /* framerate forced with -r */ + int top_field_first; + int guess_layout_max; + + int autorotate; + int resample_height; + int resample_width; + int resample_pix_fmt; + + int resample_sample_fmt; + int resample_sample_rate; + int resample_channels; + uint64_t resample_channel_layout; + + int fix_sub_duration; + struct { /* previous decoded subtitle and related variables */ + int got_output; + int ret; + AVSubtitle subtitle; + } prev_sub; + + struct sub2video { + int64_t last_pts; + int64_t end_pts; + AVFrame *frame; + int w, h; + } sub2video; + + int dr1; + + /* decoded data from this stream goes into all those filters + * currently video and audio only */ + //InputFilter **filters; + //int nb_filters; + + //int reinit_filters; + + /* hwaccel options */ + enum HWAccelID hwaccel_id; + char *hwaccel_device; + + /* hwaccel context */ + enum HWAccelID active_hwaccel_id; + void *hwaccel_ctx; + void(*hwaccel_uninit)(AVCodecContext *s); + int(*hwaccel_get_buffer)(AVCodecContext *s, AVFrame *frame, int flags); + int(*hwaccel_retrieve_data)(AVCodecContext *s, AVFrame *frame); + enum AVPixelFormat hwaccel_pix_fmt; + enum AVPixelFormat hwaccel_retrieved_pix_fmt; + + /* stats */ + // combined size of all the packets read + uint64_t data_size; + /* number of packets successfully read for this stream */ + uint64_t nb_packets; + // number of frames/samples retrieved from the decoder + uint64_t frames_decoded; + uint64_t samples_decoded; +} InputStream; + + +int dxva2_init(AVCodecContext *s, HWND hwnd); +int dxva2_retrieve_data_call(AVCodecContext *s, AVFrame *frame); +int dxva2_draw_call(AVCodecContext *s, AVFrame *frame); + +#endif /* FFMPEG_DXVA2_H */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL.h b/Src/Decoder_H264_ALL/include/SDL/SDL.h new file mode 100644 index 0000000..7647b51 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL.h @@ -0,0 +1,132 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL.h + * + * Main include header for the SDL library + */ + + +#ifndef _SDL_H +#define _SDL_H + +#include "SDL_main.h" +#include "SDL_stdinc.h" +#include "SDL_assert.h" +#include "SDL_atomic.h" +#include "SDL_audio.h" +#include "SDL_clipboard.h" +#include "SDL_cpuinfo.h" +#include "SDL_endian.h" +#include "SDL_error.h" +#include "SDL_events.h" +#include "SDL_filesystem.h" +#include "SDL_joystick.h" +#include "SDL_gamecontroller.h" +#include "SDL_haptic.h" +#include "SDL_hints.h" +#include "SDL_loadso.h" +#include "SDL_log.h" +#include "SDL_messagebox.h" +#include "SDL_mutex.h" +#include "SDL_power.h" +#include "SDL_render.h" +#include "SDL_rwops.h" +#include "SDL_system.h" +#include "SDL_thread.h" +#include "SDL_timer.h" +#include "SDL_version.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* As of version 0.5, SDL is loaded dynamically into the application */ + +/** + * \name SDL_INIT_* + * + * These are the flags which may be passed to SDL_Init(). You should + * specify the subsystems which you will be using in your application. + */ +/* @{ */ +#define SDL_INIT_TIMER 0x00000001 +#define SDL_INIT_AUDIO 0x00000010 +#define SDL_INIT_VIDEO 0x00000020 /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ +#define SDL_INIT_JOYSTICK 0x00000200 /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */ +#define SDL_INIT_HAPTIC 0x00001000 +#define SDL_INIT_GAMECONTROLLER 0x00002000 /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */ +#define SDL_INIT_EVENTS 0x00004000 +#define SDL_INIT_NOPARACHUTE 0x00100000 /**< compatibility; this flag is ignored. */ +#define SDL_INIT_EVERYTHING ( \ + SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \ + SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \ + ) +/* @} */ + +/** + * This function initializes the subsystems specified by \c flags + */ +extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); + +/** + * This function initializes specific SDL subsystems + * + * Subsystem initialization is ref-counted, you must call + * SDL_QuitSubSystem for each SDL_InitSubSystem to correctly + * shutdown a subsystem manually (or call SDL_Quit to force shutdown). + * If a subsystem is already loaded then this call will + * increase the ref-count and return. + */ +extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); + +/** + * This function cleans up specific SDL subsystems + */ +extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); + +/** + * This function returns a mask of the specified subsystems which have + * previously been initialized. + * + * If \c flags is 0, it returns a mask of all initialized subsystems. + */ +extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); + +/** + * This function cleans up all initialized subsystems. You should + * call it upon all exit conditions. + */ +extern DECLSPEC void SDLCALL SDL_Quit(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_H */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_assert.h b/Src/Decoder_H264_ALL/include/SDL/SDL_assert.h new file mode 100644 index 0000000..402981f --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_assert.h @@ -0,0 +1,289 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_assert_h +#define _SDL_assert_h + +#include "SDL_config.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef SDL_ASSERT_LEVEL +#ifdef SDL_DEFAULT_ASSERT_LEVEL +#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL +#elif defined(_DEBUG) || defined(DEBUG) || \ + (defined(__GNUC__) && !defined(__OPTIMIZE__)) +#define SDL_ASSERT_LEVEL 2 +#else +#define SDL_ASSERT_LEVEL 1 +#endif +#endif /* SDL_ASSERT_LEVEL */ + +/* +These are macros and not first class functions so that the debugger breaks +on the assertion line and not in some random guts of SDL, and so each +assert can have unique static variables associated with it. +*/ + +#if defined(_MSC_VER) +/* Don't include intrin.h here because it contains C++ code */ + extern void __cdecl __debugbreak(void); + #define SDL_TriggerBreakpoint() __debugbreak() +#elif (!defined(__NACL__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) + #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) +#elif defined(HAVE_SIGNAL_H) + #include + #define SDL_TriggerBreakpoint() raise(SIGTRAP) +#else + /* How do we trigger breakpoints on this platform? */ + #define SDL_TriggerBreakpoint() +#endif + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */ +# define SDL_FUNCTION __func__ +#elif ((__GNUC__ >= 2) || defined(_MSC_VER)) +# define SDL_FUNCTION __FUNCTION__ +#else +# define SDL_FUNCTION "???" +#endif +#define SDL_FILE __FILE__ +#define SDL_LINE __LINE__ + +/* +sizeof (x) makes the compiler still parse the expression even without +assertions enabled, so the code is always checked at compile time, but +doesn't actually generate code for it, so there are no side effects or +expensive checks at run time, just the constant size of what x WOULD be, +which presumably gets optimized out as unused. +This also solves the problem of... + + int somevalue = blah(); + SDL_assert(somevalue == 1); + +...which would cause compiles to complain that somevalue is unused if we +disable assertions. +*/ + +/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking + this condition isn't constant. And looks like an owl's face! */ +#ifdef _MSC_VER /* stupid /W4 warnings. */ +#define SDL_NULL_WHILE_LOOP_CONDITION (0,0) +#else +#define SDL_NULL_WHILE_LOOP_CONDITION (0) +#endif + +#define SDL_disabled_assert(condition) \ + do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION) + +typedef enum +{ + SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */ + SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */ + SDL_ASSERTION_ABORT, /**< Terminate the program. */ + SDL_ASSERTION_IGNORE, /**< Ignore the assert. */ + SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */ +} SDL_AssertState; + +typedef struct SDL_AssertData +{ + int always_ignore; + unsigned int trigger_count; + const char *condition; + const char *filename; + int linenum; + const char *function; + const struct SDL_AssertData *next; +} SDL_AssertData; + +#if (SDL_ASSERT_LEVEL > 0) + +/* Never call this directly. Use the SDL_assert* macros. */ +extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, + const char *, + const char *, int) +#if defined(__clang__) +#if __has_feature(attribute_analyzer_noreturn) +/* this tells Clang's static analysis that we're a custom assert function, + and that the analyzer should assume the condition was always true past this + SDL_assert test. */ + __attribute__((analyzer_noreturn)) +#endif +#endif +; + +/* the do {} while(0) avoids dangling else problems: + if (x) SDL_assert(y); else blah(); + ... without the do/while, the "else" could attach to this macro's "if". + We try to handle just the minimum we need here in a macro...the loop, + the static vars, and break points. The heavy lifting is handled in + SDL_ReportAssertion(), in SDL_assert.c. +*/ +#define SDL_enabled_assert(condition) \ + do { \ + while ( !(condition) ) { \ + static struct SDL_AssertData sdl_assert_data = { \ + 0, 0, #condition, 0, 0, 0, 0 \ + }; \ + const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \ + if (sdl_assert_state == SDL_ASSERTION_RETRY) { \ + continue; /* go again. */ \ + } else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \ + SDL_TriggerBreakpoint(); \ + } \ + break; /* not retrying. */ \ + } \ + } while (SDL_NULL_WHILE_LOOP_CONDITION) + +#endif /* enabled assertions support code */ + +/* Enable various levels of assertions. */ +#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ +# define SDL_assert(condition) SDL_disabled_assert(condition) +# define SDL_assert_release(condition) SDL_disabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 1 /* release settings. */ +# define SDL_assert(condition) SDL_disabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */ +# define SDL_assert(condition) SDL_enabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */ +# define SDL_assert(condition) SDL_enabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition) +#else +# error Unknown assertion level. +#endif + +/* this assertion is never disabled at any level. */ +#define SDL_assert_always(condition) SDL_enabled_assert(condition) + + +typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)( + const SDL_AssertData* data, void* userdata); + +/** + * \brief Set an application-defined assertion handler. + * + * This allows an app to show its own assertion UI and/or force the + * response to an assertion failure. If the app doesn't provide this, SDL + * will try to do the right thing, popping up a system-specific GUI dialog, + * and probably minimizing any fullscreen windows. + * + * This callback may fire from any thread, but it runs wrapped in a mutex, so + * it will only fire from one thread at a time. + * + * Setting the callback to NULL restores SDL's original internal handler. + * + * This callback is NOT reset to SDL's internal handler upon SDL_Quit()! + * + * \return SDL_AssertState value of how to handle the assertion failure. + * + * \param handler Callback function, called when an assertion fails. + * \param userdata A pointer passed to the callback as-is. + */ +extern DECLSPEC void SDLCALL SDL_SetAssertionHandler( + SDL_AssertionHandler handler, + void *userdata); + +/** + * \brief Get the default assertion handler. + * + * This returns the function pointer that is called by default when an + * assertion is triggered. This is an internal function provided by SDL, + * that is used for assertions when SDL_SetAssertionHandler() hasn't been + * used to provide a different function. + * + * \return The default SDL_AssertionHandler that is called when an assert triggers. + */ +extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void); + +/** + * \brief Get the current assertion handler. + * + * This returns the function pointer that is called when an assertion is + * triggered. This is either the value last passed to + * SDL_SetAssertionHandler(), or if no application-specified function is + * set, is equivalent to calling SDL_GetDefaultAssertionHandler(). + * + * \param puserdata Pointer to a void*, which will store the "userdata" + * pointer that was passed to SDL_SetAssertionHandler(). + * This value will always be NULL for the default handler. + * If you don't care about this data, it is safe to pass + * a NULL pointer to this function to ignore it. + * \return The SDL_AssertionHandler that is called when an assert triggers. + */ +extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata); + +/** + * \brief Get a list of all assertion failures. + * + * Get all assertions triggered since last call to SDL_ResetAssertionReport(), + * or the start of the program. + * + * The proper way to examine this data looks something like this: + * + * + * const SDL_AssertData *item = SDL_GetAssertionReport(); + * while (item) { + * printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n", + * item->condition, item->function, item->filename, + * item->linenum, item->trigger_count, + * item->always_ignore ? "yes" : "no"); + * item = item->next; + * } + * + * + * \return List of all assertions. + * \sa SDL_ResetAssertionReport + */ +extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void); + +/** + * \brief Reset the list of all assertion failures. + * + * Reset list of all assertions triggered. + * + * \sa SDL_GetAssertionReport + */ +extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void); + + +/* these had wrong naming conventions until 2.0.4. Please update your app! */ +#define SDL_assert_state SDL_AssertState +#define SDL_assert_data SDL_AssertData + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_assert_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_atomic.h b/Src/Decoder_H264_ALL/include/SDL/SDL_atomic.h new file mode 100644 index 0000000..56aa81d --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_atomic.h @@ -0,0 +1,268 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_atomic.h + * + * Atomic operations. + * + * IMPORTANT: + * If you are not an expert in concurrent lockless programming, you should + * only be using the atomic lock and reference counting functions in this + * file. In all other cases you should be protecting your data structures + * with full mutexes. + * + * The list of "safe" functions to use are: + * SDL_AtomicLock() + * SDL_AtomicUnlock() + * SDL_AtomicIncRef() + * SDL_AtomicDecRef() + * + * Seriously, here be dragons! + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * + * You can find out a little more about lockless programming and the + * subtle issues that can arise here: + * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx + * + * There's also lots of good information here: + * http://www.1024cores.net/home/lock-free-algorithms + * http://preshing.com/ + * + * These operations may or may not actually be implemented using + * processor specific atomic operations. When possible they are + * implemented as true processor specific atomic operations. When that + * is not possible the are implemented using locks that *do* use the + * available atomic operations. + * + * All of the atomic operations that modify memory are full memory barriers. + */ + +#ifndef _SDL_atomic_h_ +#define _SDL_atomic_h_ + +#include "SDL_stdinc.h" +#include "SDL_platform.h" + +#include "begin_code.h" + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name SDL AtomicLock + * + * The atomic locks are efficient spinlocks using CPU instructions, + * but are vulnerable to starvation and can spin forever if a thread + * holding a lock has been terminated. For this reason you should + * minimize the code executed inside an atomic lock and never do + * expensive things like API or system calls while holding them. + * + * The atomic locks are not safe to lock recursively. + * + * Porting Note: + * The spin lock functions and type are required and can not be + * emulated because they are used in the atomic emulation code. + */ +/* @{ */ + +typedef int SDL_SpinLock; + +/** + * \brief Try to lock a spin lock by setting it to a non-zero value. + * + * \param lock Points to the lock. + * + * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock); + +/** + * \brief Lock a spin lock by setting it to a non-zero value. + * + * \param lock Points to the lock. + */ +extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock); + +/** + * \brief Unlock a spin lock by setting it to 0. Always returns immediately + * + * \param lock Points to the lock. + */ +extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock); + +/* @} *//* SDL AtomicLock */ + + +/** + * The compiler barrier prevents the compiler from reordering + * reads and writes to globally visible variables across the call. + */ +#if defined(_MSC_VER) && (_MSC_VER > 1200) +void _ReadWriteBarrier(void); +#pragma intrinsic(_ReadWriteBarrier) +#define SDL_CompilerBarrier() _ReadWriteBarrier() +#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) +/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */ +#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory") +#else +#define SDL_CompilerBarrier() \ +{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); } +#endif + +/** + * Memory barriers are designed to prevent reads and writes from being + * reordered by the compiler and being seen out of order on multi-core CPUs. + * + * A typical pattern would be for thread A to write some data and a flag, + * and for thread B to read the flag and get the data. In this case you + * would insert a release barrier between writing the data and the flag, + * guaranteeing that the data write completes no later than the flag is + * written, and you would insert an acquire barrier between reading the + * flag and reading the data, to ensure that all the reads associated + * with the flag have completed. + * + * In this pattern you should always see a release barrier paired with + * an acquire barrier and you should gate the data reads/writes with a + * single flag variable. + * + * For more information on these semantics, take a look at the blog post: + * http://preshing.com/20120913/acquire-and-release-semantics + */ +#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory") +#elif defined(__GNUC__) && defined(__arm__) +#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") +#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) +#ifdef __thumb__ +/* The mcr instruction isn't available in thumb mode, use real functions */ +extern DECLSPEC void SDLCALL SDL_MemoryBarrierRelease(); +extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquire(); +#else +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") +#endif /* __thumb__ */ +#else +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory") +#endif /* __GNUC__ && __arm__ */ +#else +#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) +/* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */ +#include +#define SDL_MemoryBarrierRelease() __machine_rel_barrier() +#define SDL_MemoryBarrierAcquire() __machine_acq_barrier() +#else +/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */ +#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier() +#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier() +#endif +#endif + +/** + * \brief A type representing an atomic integer value. It is a struct + * so people don't accidentally use numeric operations on it. + */ +typedef struct { int value; } SDL_atomic_t; + +/** + * \brief Set an atomic variable to a new value if it is currently an old value. + * + * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise. + * + * \note If you don't know what this function is for, you shouldn't use it! +*/ +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval); + +/** + * \brief Set an atomic variable to a value. + * + * \return The previous value of the atomic variable. + */ +extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v); + +/** + * \brief Get the value of an atomic variable + */ +extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a); + +/** + * \brief Add to an atomic variable. + * + * \return The previous value of the atomic variable. + * + * \note This same style can be used for any number operation + */ +extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v); + +/** + * \brief Increment an atomic variable used as a reference count. + */ +#ifndef SDL_AtomicIncRef +#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1) +#endif + +/** + * \brief Decrement an atomic variable used as a reference count. + * + * \return SDL_TRUE if the variable reached zero after decrementing, + * SDL_FALSE otherwise + */ +#ifndef SDL_AtomicDecRef +#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1) +#endif + +/** + * \brief Set a pointer to a new value if it is currently an old value. + * + * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise. + * + * \note If you don't know what this function is for, you shouldn't use it! +*/ +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval); + +/** + * \brief Set a pointer to a value atomically. + * + * \return The previous value of the pointer. + */ +extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v); + +/** + * \brief Get the value of a pointer atomically. + */ +extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif + +#include "close_code.h" + +#endif /* _SDL_atomic_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_audio.h b/Src/Decoder_H264_ALL/include/SDL/SDL_audio.h new file mode 100644 index 0000000..4f65521 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_audio.h @@ -0,0 +1,605 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_audio.h + * + * Access to the raw audio mixing buffer for the SDL library. + */ + +#ifndef _SDL_audio_h +#define _SDL_audio_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_endian.h" +#include "SDL_mutex.h" +#include "SDL_thread.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Audio format flags. + * + * These are what the 16 bits in SDL_AudioFormat currently mean... + * (Unspecified bits are always zero). + * + * \verbatim + ++-----------------------sample is signed if set + || + || ++-----------sample is bigendian if set + || || + || || ++---sample is float if set + || || || + || || || +---sample bit size---+ + || || || | | + 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 + \endverbatim + * + * There are macros in SDL 2.0 and later to query these bits. + */ +typedef Uint16 SDL_AudioFormat; + +/** + * \name Audio flags + */ +/* @{ */ + +#define SDL_AUDIO_MASK_BITSIZE (0xFF) +#define SDL_AUDIO_MASK_DATATYPE (1<<8) +#define SDL_AUDIO_MASK_ENDIAN (1<<12) +#define SDL_AUDIO_MASK_SIGNED (1<<15) +#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE) +#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE) +#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN) +#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED) +#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x)) +#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x)) +#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x)) + +/** + * \name Audio format flags + * + * Defaults to LSB byte order. + */ +/* @{ */ +#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ +#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ +#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ +#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ +#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ +#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ +#define AUDIO_U16 AUDIO_U16LSB +#define AUDIO_S16 AUDIO_S16LSB +/* @} */ + +/** + * \name int32 support + */ +/* @{ */ +#define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */ +#define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */ +#define AUDIO_S32 AUDIO_S32LSB +/* @} */ + +/** + * \name float32 support + */ +/* @{ */ +#define AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */ +#define AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */ +#define AUDIO_F32 AUDIO_F32LSB +/* @} */ + +/** + * \name Native audio byte ordering + */ +/* @{ */ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define AUDIO_U16SYS AUDIO_U16LSB +#define AUDIO_S16SYS AUDIO_S16LSB +#define AUDIO_S32SYS AUDIO_S32LSB +#define AUDIO_F32SYS AUDIO_F32LSB +#else +#define AUDIO_U16SYS AUDIO_U16MSB +#define AUDIO_S16SYS AUDIO_S16MSB +#define AUDIO_S32SYS AUDIO_S32MSB +#define AUDIO_F32SYS AUDIO_F32MSB +#endif +/* @} */ + +/** + * \name Allow change flags + * + * Which audio format changes are allowed when opening a device. + */ +/* @{ */ +#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001 +#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002 +#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004 +#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE) +/* @} */ + +/* @} *//* Audio flags */ + +/** + * This function is called when the audio device needs more data. + * + * \param userdata An application-specific parameter saved in + * the SDL_AudioSpec structure + * \param stream A pointer to the audio data buffer. + * \param len The length of that buffer in bytes. + * + * Once the callback returns, the buffer will no longer be valid. + * Stereo samples are stored in a LRLRLR ordering. + * + * You can choose to avoid callbacks and use SDL_QueueAudio() instead, if + * you like. Just open your audio device with a NULL callback. + */ +typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, + int len); + +/** + * The calculated values in this structure are calculated by SDL_OpenAudio(). + */ +typedef struct SDL_AudioSpec +{ + int freq; /**< DSP frequency -- samples per second */ + SDL_AudioFormat format; /**< Audio data format */ + Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ + Uint8 silence; /**< Audio buffer silence value (calculated) */ + Uint16 samples; /**< Audio buffer size in samples (power of 2) */ + Uint16 padding; /**< Necessary for some compile environments */ + Uint32 size; /**< Audio buffer size in bytes (calculated) */ + SDL_AudioCallback callback; /**< Callback that feeds the audio device (NULL to use SDL_QueueAudio()). */ + void *userdata; /**< Userdata passed to callback (ignored for NULL callbacks). */ +} SDL_AudioSpec; + + +struct SDL_AudioCVT; +typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt, + SDL_AudioFormat format); + +/** + * A structure to hold a set of audio conversion filters and buffers. + */ +#ifdef __GNUC__ +/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't + pad it out to 88 bytes to guarantee ABI compatibility between compilers. + vvv + The next time we rev the ABI, make sure to size the ints and add padding. +*/ +#define SDL_AUDIOCVT_PACKED __attribute__((packed)) +#else +#define SDL_AUDIOCVT_PACKED +#endif +/* */ +typedef struct SDL_AudioCVT +{ + int needed; /**< Set to 1 if conversion possible */ + SDL_AudioFormat src_format; /**< Source audio format */ + SDL_AudioFormat dst_format; /**< Target audio format */ + double rate_incr; /**< Rate conversion increment */ + Uint8 *buf; /**< Buffer to hold entire audio data */ + int len; /**< Length of original audio buffer */ + int len_cvt; /**< Length of converted audio buffer */ + int len_mult; /**< buffer must be len*len_mult big */ + double len_ratio; /**< Given len, final size is len*len_ratio */ + SDL_AudioFilter filters[10]; /**< Filter list */ + int filter_index; /**< Current audio conversion function */ +} SDL_AUDIOCVT_PACKED SDL_AudioCVT; + + +/* Function prototypes */ + +/** + * \name Driver discovery functions + * + * These functions return the list of built in audio drivers, in the + * order that they are normally initialized by default. + */ +/* @{ */ +extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); +extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); +/* @} */ + +/** + * \name Initialization and cleanup + * + * \internal These functions are used internally, and should not be used unless + * you have a specific need to specify the audio driver you want to + * use. You should normally use SDL_Init() or SDL_InitSubSystem(). + */ +/* @{ */ +extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); +extern DECLSPEC void SDLCALL SDL_AudioQuit(void); +/* @} */ + +/** + * This function returns the name of the current audio driver, or NULL + * if no driver has been initialized. + */ +extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); + +/** + * This function opens the audio device with the desired parameters, and + * returns 0 if successful, placing the actual hardware parameters in the + * structure pointed to by \c obtained. If \c obtained is NULL, the audio + * data passed to the callback function will be guaranteed to be in the + * requested format, and will be automatically converted to the hardware + * audio format if necessary. This function returns -1 if it failed + * to open the audio device, or couldn't set up the audio thread. + * + * When filling in the desired audio spec structure, + * - \c desired->freq should be the desired audio frequency in samples-per- + * second. + * - \c desired->format should be the desired audio format. + * - \c desired->samples is the desired size of the audio buffer, in + * samples. This number should be a power of two, and may be adjusted by + * the audio driver to a value more suitable for the hardware. Good values + * seem to range between 512 and 8096 inclusive, depending on the + * application and CPU speed. Smaller values yield faster response time, + * but can lead to underflow if the application is doing heavy processing + * and cannot fill the audio buffer in time. A stereo sample consists of + * both right and left channels in LR ordering. + * Note that the number of samples is directly related to time by the + * following formula: \code ms = (samples*1000)/freq \endcode + * - \c desired->size is the size in bytes of the audio buffer, and is + * calculated by SDL_OpenAudio(). + * - \c desired->silence is the value used to set the buffer to silence, + * and is calculated by SDL_OpenAudio(). + * - \c desired->callback should be set to a function that will be called + * when the audio device is ready for more data. It is passed a pointer + * to the audio buffer, and the length in bytes of the audio buffer. + * This function usually runs in a separate thread, and so you should + * protect data structures that it accesses by calling SDL_LockAudio() + * and SDL_UnlockAudio() in your code. Alternately, you may pass a NULL + * pointer here, and call SDL_QueueAudio() with some frequency, to queue + * more audio samples to be played. + * - \c desired->userdata is passed as the first parameter to your callback + * function. If you passed a NULL callback, this value is ignored. + * + * The audio device starts out playing silence when it's opened, and should + * be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready + * for your audio callback function to be called. Since the audio driver + * may modify the requested size of the audio buffer, you should allocate + * any local mixing buffers after you open the audio device. + */ +extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired, + SDL_AudioSpec * obtained); + +/** + * SDL Audio Device IDs. + * + * A successful call to SDL_OpenAudio() is always device id 1, and legacy + * SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls + * always returns devices >= 2 on success. The legacy calls are good both + * for backwards compatibility and when you don't care about multiple, + * specific, or capture devices. + */ +typedef Uint32 SDL_AudioDeviceID; + +/** + * Get the number of available devices exposed by the current driver. + * Only valid after a successfully initializing the audio subsystem. + * Returns -1 if an explicit list of devices can't be determined; this is + * not an error. For example, if SDL is set up to talk to a remote audio + * server, it can't list every one available on the Internet, but it will + * still allow a specific host to be specified to SDL_OpenAudioDevice(). + * + * In many common cases, when this function returns a value <= 0, it can still + * successfully open the default device (NULL for first argument of + * SDL_OpenAudioDevice()). + */ +extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture); + +/** + * Get the human-readable name of a specific audio device. + * Must be a value between 0 and (number of audio devices-1). + * Only valid after a successfully initializing the audio subsystem. + * The values returned by this function reflect the latest call to + * SDL_GetNumAudioDevices(); recall that function to redetect available + * hardware. + * + * The string returned by this function is UTF-8 encoded, read-only, and + * managed internally. You are not to free it. If you need to keep the + * string for any length of time, you should make your own copy of it, as it + * will be invalid next time any of several other SDL functions is called. + */ +extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index, + int iscapture); + + +/** + * Open a specific audio device. Passing in a device name of NULL requests + * the most reasonable default (and is equivalent to calling SDL_OpenAudio()). + * + * The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but + * some drivers allow arbitrary and driver-specific strings, such as a + * hostname/IP address for a remote audio server, or a filename in the + * diskaudio driver. + * + * \return 0 on error, a valid device ID that is >= 2 on success. + * + * SDL_OpenAudio(), unlike this function, always acts on device ID 1. + */ +extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char + *device, + int iscapture, + const + SDL_AudioSpec * + desired, + SDL_AudioSpec * + obtained, + int + allowed_changes); + + + +/** + * \name Audio state + * + * Get the current audio state. + */ +/* @{ */ +typedef enum +{ + SDL_AUDIO_STOPPED = 0, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED +} SDL_AudioStatus; +extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void); + +extern DECLSPEC SDL_AudioStatus SDLCALL +SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev); +/* @} *//* Audio State */ + +/** + * \name Pause audio functions + * + * These functions pause and unpause the audio callback processing. + * They should be called with a parameter of 0 after opening the audio + * device to start playing sound. This is so you can safely initialize + * data for your callback function after opening the audio device. + * Silence will be written to the audio device during the pause. + */ +/* @{ */ +extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); +extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev, + int pause_on); +/* @} *//* Pause audio functions */ + +/** + * This function loads a WAVE from the data source, automatically freeing + * that source if \c freesrc is non-zero. For example, to load a WAVE file, + * you could do: + * \code + * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); + * \endcode + * + * If this function succeeds, it returns the given SDL_AudioSpec, + * filled with the audio data format of the wave data, and sets + * \c *audio_buf to a malloc()'d buffer containing the audio data, + * and sets \c *audio_len to the length of that audio buffer, in bytes. + * You need to free the audio buffer with SDL_FreeWAV() when you are + * done with it. + * + * This function returns NULL and sets the SDL error message if the + * wave file cannot be opened, uses an unknown data format, or is + * corrupt. Currently raw and MS-ADPCM WAVE files are supported. + */ +extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, + int freesrc, + SDL_AudioSpec * spec, + Uint8 ** audio_buf, + Uint32 * audio_len); + +/** + * Loads a WAV from a file. + * Compatibility convenience function. + */ +#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ + SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) + +/** + * This function frees data previously allocated with SDL_LoadWAV_RW() + */ +extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf); + +/** + * This function takes a source format and rate and a destination format + * and rate, and initializes the \c cvt structure with information needed + * by SDL_ConvertAudio() to convert a buffer of audio data from one format + * to the other. + * + * \return -1 if the format conversion is not supported, 0 if there's + * no conversion needed, or 1 if the audio filter is set up. + */ +extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, + SDL_AudioFormat src_format, + Uint8 src_channels, + int src_rate, + SDL_AudioFormat dst_format, + Uint8 dst_channels, + int dst_rate); + +/** + * Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(), + * created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of + * audio data in the source format, this function will convert it in-place + * to the desired format. + * + * The data conversion may expand the size of the audio data, so the buffer + * \c cvt->buf should be allocated after the \c cvt structure is initialized by + * SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long. + */ +extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt); + +#define SDL_MIX_MAXVOLUME 128 +/** + * This takes two audio buffers of the playing audio format and mixes + * them, performing addition, volume adjustment, and overflow clipping. + * The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME + * for full audio volume. Note this does not change hardware volume. + * This is provided for convenience -- you can mix your own audio data. + */ +extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src, + Uint32 len, int volume); + +/** + * This works like SDL_MixAudio(), but you specify the audio format instead of + * using the format of audio device 1. Thus it can be used when no audio + * device is open at all. + */ +extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, + const Uint8 * src, + SDL_AudioFormat format, + Uint32 len, int volume); + +/** + * Queue more audio on non-callback devices. + * + * SDL offers two ways to feed audio to the device: you can either supply a + * callback that SDL triggers with some frequency to obtain more audio + * (pull method), or you can supply no callback, and then SDL will expect + * you to supply data at regular intervals (push method) with this function. + * + * There are no limits on the amount of data you can queue, short of + * exhaustion of address space. Queued data will drain to the device as + * necessary without further intervention from you. If the device needs + * audio but there is not enough queued, it will play silence to make up + * the difference. This means you will have skips in your audio playback + * if you aren't routinely queueing sufficient data. + * + * This function copies the supplied data, so you are safe to free it when + * the function returns. This function is thread-safe, but queueing to the + * same device from two threads at once does not promise which buffer will + * be queued first. + * + * You may not queue audio on a device that is using an application-supplied + * callback; doing so returns an error. You have to use the audio callback + * or queue audio with this function, but not both. + * + * You should not call SDL_LockAudio() on the device before queueing; SDL + * handles locking internally for this function. + * + * \param dev The device ID to which we will queue audio. + * \param data The data to queue to the device for later playback. + * \param len The number of bytes (not samples!) to which (data) points. + * \return zero on success, -1 on error. + * + * \sa SDL_GetQueuedAudioSize + * \sa SDL_ClearQueuedAudio + */ +extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len); + +/** + * Get the number of bytes of still-queued audio. + * + * This is the number of bytes that have been queued for playback with + * SDL_QueueAudio(), but have not yet been sent to the hardware. + * + * Once we've sent it to the hardware, this function can not decide the exact + * byte boundary of what has been played. It's possible that we just gave the + * hardware several kilobytes right before you called this function, but it + * hasn't played any of it yet, or maybe half of it, etc. + * + * You may not queue audio on a device that is using an application-supplied + * callback; calling this function on such a device always returns 0. + * You have to use the audio callback or queue audio with SDL_QueueAudio(), + * but not both. + * + * You should not call SDL_LockAudio() on the device before querying; SDL + * handles locking internally for this function. + * + * \param dev The device ID of which we will query queued audio size. + * \return Number of bytes (not samples!) of queued audio. + * + * \sa SDL_QueueAudio + * \sa SDL_ClearQueuedAudio + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev); + +/** + * Drop any queued audio data waiting to be sent to the hardware. + * + * Immediately after this call, SDL_GetQueuedAudioSize() will return 0 and + * the hardware will start playing silence if more audio isn't queued. + * + * This will not prevent playback of queued audio that's already been sent + * to the hardware, as we can not undo that, so expect there to be some + * fraction of a second of audio that might still be heard. This can be + * useful if you want to, say, drop any pending music during a level change + * in your game. + * + * You may not queue audio on a device that is using an application-supplied + * callback; calling this function on such a device is always a no-op. + * You have to use the audio callback or queue audio with SDL_QueueAudio(), + * but not both. + * + * You should not call SDL_LockAudio() on the device before clearing the + * queue; SDL handles locking internally for this function. + * + * This function always succeeds and thus returns void. + * + * \param dev The device ID of which to clear the audio queue. + * + * \sa SDL_QueueAudio + * \sa SDL_GetQueuedAudioSize + */ +extern DECLSPEC void SDLCALL SDL_ClearQueuedAudio(SDL_AudioDeviceID dev); + + +/** + * \name Audio lock functions + * + * The lock manipulated by these functions protects the callback function. + * During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that + * the callback function is not running. Do not call these from the callback + * function or you will cause deadlock. + */ +/* @{ */ +extern DECLSPEC void SDLCALL SDL_LockAudio(void); +extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev); +extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); +extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev); +/* @} *//* Audio lock functions */ + +/** + * This function shuts down audio processing and closes the audio device. + */ +extern DECLSPEC void SDLCALL SDL_CloseAudio(void); +extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_audio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_bits.h b/Src/Decoder_H264_ALL/include/SDL/SDL_bits.h new file mode 100644 index 0000000..528da2e --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_bits.h @@ -0,0 +1,97 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_bits.h + * + * Functions for fiddling with bits and bitmasks. + */ + +#ifndef _SDL_bits_h +#define _SDL_bits_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_bits.h + */ + +/** + * Get the index of the most significant bit. Result is undefined when called + * with 0. This operation can also be stated as "count leading zeroes" and + * "log base 2". + * + * \return Index of the most significant bit, or -1 if the value is 0. + */ +SDL_FORCE_INLINE int +SDL_MostSignificantBitIndex32(Uint32 x) +{ +#if defined(__GNUC__) && __GNUC__ >= 4 + /* Count Leading Zeroes builtin in GCC. + * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html + */ + if (x == 0) { + return -1; + } + return 31 - __builtin_clz(x); +#else + /* Based off of Bit Twiddling Hacks by Sean Eron Anderson + * , released in the public domain. + * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog + */ + const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; + const int S[] = {1, 2, 4, 8, 16}; + + int msbIndex = 0; + int i; + + if (x == 0) { + return -1; + } + + for (i = 4; i >= 0; i--) + { + if (x & b[i]) + { + x >>= S[i]; + msbIndex |= S[i]; + } + } + + return msbIndex; +#endif +} + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_bits_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_blendmode.h b/Src/Decoder_H264_ALL/include/SDL/SDL_blendmode.h new file mode 100644 index 0000000..56d8ad6 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_blendmode.h @@ -0,0 +1,63 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_blendmode.h + * + * Header file declaring the SDL_BlendMode enumeration + */ + +#ifndef _SDL_blendmode_h +#define _SDL_blendmode_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The blend mode used in SDL_RenderCopy() and drawing operations. + */ +typedef enum +{ + SDL_BLENDMODE_NONE = 0x00000000, /**< no blending + dstRGBA = srcRGBA */ + SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending + dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) + dstA = srcA + (dstA * (1-srcA)) */ + SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending + dstRGB = (srcRGB * srcA) + dstRGB + dstA = dstA */ + SDL_BLENDMODE_MOD = 0x00000004 /**< color modulate + dstRGB = srcRGB * dstRGB + dstA = dstA */ +} SDL_BlendMode; + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_blendmode_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_clipboard.h b/Src/Decoder_H264_ALL/include/SDL/SDL_clipboard.h new file mode 100644 index 0000000..a5556f2 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_clipboard.h @@ -0,0 +1,71 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_clipboard.h + * + * Include file for SDL clipboard handling + */ + +#ifndef _SDL_clipboard_h +#define _SDL_clipboard_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Function prototypes */ + +/** + * \brief Put UTF-8 text into the clipboard + * + * \sa SDL_GetClipboardText() + */ +extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); + +/** + * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() + * + * \sa SDL_SetClipboardText() + */ +extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); + +/** + * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty + * + * \sa SDL_GetClipboardText() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_clipboard_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_config.h b/Src/Decoder_H264_ALL/include/SDL/SDL_config.h new file mode 100644 index 0000000..890986c --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_config.h @@ -0,0 +1,221 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_windows_h +#define _SDL_config_windows_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) +#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) +#define HAVE_STDINT_H 1 +#elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +#endif +#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +#endif +#else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +#endif +typedef unsigned int uintptr_t; +#endif /* __GNUC__ || _MSC_VER */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ + +#ifdef _WIN64 +# define SIZEOF_VOIDP 8 +#else +# define SIZEOF_VOIDP 4 +#endif + +#define HAVE_DDRAW_H 1 +#define HAVE_DINPUT_H 1 +#define HAVE_DSOUND_H 1 +#define HAVE_DXGI_H 1 +#define HAVE_XINPUT_H 1 + +/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ +#ifdef HAVE_LIBC +/* Useful headers */ +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE__LTOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 +#define HAVE_ACOS 1 +#define HAVE_ASIN 1 +#define HAVE_CEIL 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#if _MSC_VER >= 1800 +#define HAVE_STRTOLL 1 +#define HAVE_VSSCANF 1 +#define HAVE_COPYSIGN 1 +#define HAVE_SCALBN 1 +#endif +#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES) +#define HAVE_M_PI 1 +#endif +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#endif + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_DSOUND 1 +#define SDL_AUDIO_DRIVER_XAUDIO2 1 +#define SDL_AUDIO_DRIVER_WINMM 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_DINPUT 1 +#define SDL_JOYSTICK_XINPUT 1 +#define SDL_HAPTIC_DINPUT 1 +#define SDL_HAPTIC_XINPUT 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WINDOWS 1 + +/* Enable various threading systems */ +#define SDL_THREAD_WINDOWS 1 + +/* Enable various timer systems */ +#define SDL_TIMER_WINDOWS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_WINDOWS 1 + +#ifndef SDL_VIDEO_RENDER_D3D +#define SDL_VIDEO_RENDER_D3D 1 +#endif +#ifndef SDL_VIDEO_RENDER_D3D11 +#define SDL_VIDEO_RENDER_D3D11 0 +#endif + +/* Enable OpenGL support */ +#ifndef SDL_VIDEO_OPENGL +#define SDL_VIDEO_OPENGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_WGL +#define SDL_VIDEO_OPENGL_WGL 1 +#endif +#ifndef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 1 +#endif +#ifndef SDL_VIDEO_RENDER_OGL_ES2 +#define SDL_VIDEO_RENDER_OGL_ES2 1 +#endif +#ifndef SDL_VIDEO_OPENGL_ES2 +#define SDL_VIDEO_OPENGL_ES2 1 +#endif +#ifndef SDL_VIDEO_OPENGL_EGL +#define SDL_VIDEO_OPENGL_EGL 1 +#endif + + +/* Enable system power support */ +#define SDL_POWER_WINDOWS 1 + +/* Enable filesystem support */ +#define SDL_FILESYSTEM_WINDOWS 1 + +/* Enable assembly routines (Win64 doesn't have inline asm) */ +#ifndef _WIN64 +#define SDL_ASSEMBLY_ROUTINES 1 +#endif + +#endif /* _SDL_config_windows_h */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_cpuinfo.h b/Src/Decoder_H264_ALL/include/SDL/SDL_cpuinfo.h new file mode 100644 index 0000000..d0ba47b --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_cpuinfo.h @@ -0,0 +1,161 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_cpuinfo.h + * + * CPU feature detection for SDL. + */ + +#ifndef _SDL_cpuinfo_h +#define _SDL_cpuinfo_h + +#include "SDL_stdinc.h" + +/* Need to do this here because intrin.h has C++ code in it */ +/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */ +#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64)) +#include +#ifndef _WIN64 +#define __MMX__ +#define __3dNOW__ +#endif +#define __SSE__ +#define __SSE2__ +#elif defined(__MINGW64_VERSION_MAJOR) +#include +#else +#ifdef __ALTIVEC__ +#if HAVE_ALTIVEC_H && !defined(__APPLE_ALTIVEC__) +#include +#undef pixel +#endif +#endif +#ifdef __MMX__ +#include +#endif +#ifdef __3dNOW__ +#include +#endif +#ifdef __SSE__ +#include +#endif +#ifdef __SSE2__ +#include +#endif +#endif + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* This is a guess for the cacheline size used for padding. + * Most x86 processors have a 64 byte cache line. + * The 64-bit PowerPC processors have a 128 byte cache line. + * We'll use the larger value to be generally safe. + */ +#define SDL_CACHELINE_SIZE 128 + +/** + * This function returns the number of CPU cores available. + */ +extern DECLSPEC int SDLCALL SDL_GetCPUCount(void); + +/** + * This function returns the L1 cache line size of the CPU + * + * This is useful for determining multi-threaded structure padding + * or SIMD prefetch sizes. + */ +extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void); + +/** + * This function returns true if the CPU has the RDTSC instruction. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); + +/** + * This function returns true if the CPU has AltiVec features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); + +/** + * This function returns true if the CPU has MMX features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); + +/** + * This function returns true if the CPU has 3DNow! features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); + +/** + * This function returns true if the CPU has SSE features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); + +/** + * This function returns true if the CPU has SSE2 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); + +/** + * This function returns true if the CPU has SSE3 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void); + +/** + * This function returns true if the CPU has SSE4.1 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void); + +/** + * This function returns true if the CPU has SSE4.2 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void); + +/** + * This function returns true if the CPU has AVX features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void); + +/** + * This function returns true if the CPU has AVX2 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void); + +/** + * This function returns the amount of RAM configured in the system, in MB. + */ +extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_cpuinfo_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_egl.h b/Src/Decoder_H264_ALL/include/SDL/SDL_egl.h new file mode 100644 index 0000000..bea2a6c --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_egl.h @@ -0,0 +1,1673 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_egl.h + * + * This is a simple file to encapsulate the EGL API headers. + */ +#ifndef _MSC_VER + +#include +#include + +#else /* _MSC_VER */ + +/* EGL headers for Visual Studio */ + +#ifndef __khrplatform_h_ +#define __khrplatform_h_ + +/* +** Copyright (c) 2008-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Khronos platform-specific types and definitions. +* +* $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $ +* +* Adopters may modify this file to suit their platform. Adopters are +* encouraged to submit platform specific modifications to the Khronos +* group so that they can be included in future versions of this file. +* Please submit changes by sending them to the public Khronos Bugzilla +* (http://khronos.org/bugzilla) by filing a bug against product +* "Khronos (general)" component "Registry". +* +* A predefined template which fills in some of the bug fields can be +* reached using http://tinyurl.com/khrplatform-h-bugreport, but you +* must create a Bugzilla login first. +* +* +* See the Implementer's Guidelines for information about where this file +* should be located on your system and for more details of its use: +* http://www.khronos.org/registry/implementers_guide.pdf +* +* This file should be included as +* #include +* by Khronos client API header files that use its types and defines. +* +* The types in khrplatform.h should only be used to define API-specific types. +* +* Types defined in khrplatform.h: +* khronos_int8_t signed 8 bit +* khronos_uint8_t unsigned 8 bit +* khronos_int16_t signed 16 bit +* khronos_uint16_t unsigned 16 bit +* khronos_int32_t signed 32 bit +* khronos_uint32_t unsigned 32 bit +* khronos_int64_t signed 64 bit +* khronos_uint64_t unsigned 64 bit +* khronos_intptr_t signed same number of bits as a pointer +* khronos_uintptr_t unsigned same number of bits as a pointer +* khronos_ssize_t signed size +* khronos_usize_t unsigned size +* khronos_float_t signed 32 bit floating point +* khronos_time_ns_t unsigned 64 bit time in nanoseconds +* khronos_utime_nanoseconds_t unsigned time interval or absolute time in +* nanoseconds +* khronos_stime_nanoseconds_t signed time interval in nanoseconds +* khronos_boolean_enum_t enumerated boolean type. This should +* only be used as a base type when a client API's boolean type is +* an enum. Client APIs which use an integer or other type for +* booleans cannot use this as the base type for their boolean. +* +* Tokens defined in khrplatform.h: +* +* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. +* +* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. +* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. +* +* Calling convention macros defined in this file: +* KHRONOS_APICALL +* KHRONOS_APIENTRY +* KHRONOS_APIATTRIBUTES +* +* These may be used in function prototypes as: +* +* KHRONOS_APICALL void KHRONOS_APIENTRY funcname( +* int arg1, +* int arg2) KHRONOS_APIATTRIBUTES; +*/ + +/*------------------------------------------------------------------------- +* Definition of KHRONOS_APICALL +*------------------------------------------------------------------------- +* This precedes the return type of the function in the function prototype. +*/ +#if defined(_WIN32) && !defined(__SCITECH_SNAP__) +# define KHRONOS_APICALL __declspec(dllimport) +#elif defined (__SYMBIAN32__) +# define KHRONOS_APICALL IMPORT_C +#else +# define KHRONOS_APICALL +#endif + +/*------------------------------------------------------------------------- +* Definition of KHRONOS_APIENTRY +*------------------------------------------------------------------------- +* This follows the return type of the function and precedes the function +* name in the function prototype. +*/ +#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) +/* Win32 but not WinCE */ +# define KHRONOS_APIENTRY __stdcall +#else +# define KHRONOS_APIENTRY +#endif + +/*------------------------------------------------------------------------- +* Definition of KHRONOS_APIATTRIBUTES +*------------------------------------------------------------------------- +* This follows the closing parenthesis of the function prototype arguments. +*/ +#if defined (__ARMCC_2__) +#define KHRONOS_APIATTRIBUTES __softfp +#else +#define KHRONOS_APIATTRIBUTES +#endif + +/*------------------------------------------------------------------------- +* basic type definitions +*-----------------------------------------------------------------------*/ +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) + + +/* +* Using +*/ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__VMS ) || defined(__sgi) + +/* +* Using +*/ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) + +/* +* Win32 +*/ +typedef __int32 khronos_int32_t; +typedef unsigned __int32 khronos_uint32_t; +typedef __int64 khronos_int64_t; +typedef unsigned __int64 khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__sun__) || defined(__digital__) + +/* +* Sun or Digital +*/ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#if defined(__arch64__) || defined(_LP64) +typedef long int khronos_int64_t; +typedef unsigned long int khronos_uint64_t; +#else +typedef long long int khronos_int64_t; +typedef unsigned long long int khronos_uint64_t; +#endif /* __arch64__ */ +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif 0 + +/* +* Hypothetical platform with no float or int64 support +*/ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#define KHRONOS_SUPPORT_INT64 0 +#define KHRONOS_SUPPORT_FLOAT 0 + +#else + +/* +* Generic fallback +*/ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#endif + + +/* +* Types that are (so far) the same on all platforms +*/ +typedef signed char khronos_int8_t; +typedef unsigned char khronos_uint8_t; +typedef signed short int khronos_int16_t; +typedef unsigned short int khronos_uint16_t; + +/* +* Types that differ between LLP64 and LP64 architectures - in LLP64, +* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears +* to be the only LLP64 architecture in current use. +*/ +#ifdef _WIN64 +typedef signed long long int khronos_intptr_t; +typedef unsigned long long int khronos_uintptr_t; +typedef signed long long int khronos_ssize_t; +typedef unsigned long long int khronos_usize_t; +#else +typedef signed long int khronos_intptr_t; +typedef unsigned long int khronos_uintptr_t; +typedef signed long int khronos_ssize_t; +typedef unsigned long int khronos_usize_t; +#endif + +#if KHRONOS_SUPPORT_FLOAT +/* +* Float type +*/ +typedef float khronos_float_t; +#endif + +#if KHRONOS_SUPPORT_INT64 +/* Time types +* +* These types can be used to represent a time interval in nanoseconds or +* an absolute Unadjusted System Time. Unadjusted System Time is the number +* of nanoseconds since some arbitrary system event (e.g. since the last +* time the system booted). The Unadjusted System Time is an unsigned +* 64 bit value that wraps back to 0 every 584 years. Time intervals +* may be either signed or unsigned. +*/ +typedef khronos_uint64_t khronos_utime_nanoseconds_t; +typedef khronos_int64_t khronos_stime_nanoseconds_t; +#endif + +/* +* Dummy value used to pad enum types to 32 bits. +*/ +#ifndef KHRONOS_MAX_ENUM +#define KHRONOS_MAX_ENUM 0x7FFFFFFF +#endif + +/* +* Enumerated boolean type +* +* Values other than zero should be considered to be true. Therefore +* comparisons should not be made against KHRONOS_TRUE. +*/ +typedef enum { + KHRONOS_FALSE = 0, + KHRONOS_TRUE = 1, + KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM +} khronos_boolean_enum_t; + +#endif /* __khrplatform_h_ */ + + +#ifndef __eglplatform_h_ +#define __eglplatform_h_ + +/* +** Copyright (c) 2007-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Platform-specific types and definitions for egl.h +* $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $ +* +* Adopters may modify khrplatform.h and this file to suit their platform. +* You are encouraged to submit all modifications to the Khronos group so that +* they can be included in future versions of this file. Please submit changes +* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) +* by filing a bug against product "EGL" component "Registry". +*/ + +/*#include */ + +/* Macros used in EGL function prototype declarations. +* +* EGL functions should be prototyped as: +* +* EGLAPI return-type EGLAPIENTRY eglFunction(arguments); +* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); +* +* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h +*/ + +#ifndef EGLAPI +#define EGLAPI KHRONOS_APICALL +#endif + +#ifndef EGLAPIENTRY +#define EGLAPIENTRY KHRONOS_APIENTRY +#endif +#define EGLAPIENTRYP EGLAPIENTRY* + +/* The types NativeDisplayType, NativeWindowType, and NativePixmapType +* are aliases of window-system-dependent types, such as X Display * or +* Windows Device Context. They must be defined in platform-specific +* code below. The EGL-prefixed versions of Native*Type are the same +* types, renamed in EGL 1.3 so all types in the API start with "EGL". +* +* Khronos STRONGLY RECOMMENDS that you use the default definitions +* provided below, since these changes affect both binary and source +* portability of applications using EGL running on different EGL +* implementations. +*/ + +#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#include + +#if __WINRT__ +#include +typedef IUnknown * EGLNativeWindowType; +typedef IUnknown * EGLNativePixmapType; +typedef IUnknown * EGLNativeDisplayType; +#else +typedef HDC EGLNativeDisplayType; +typedef HBITMAP EGLNativePixmapType; +typedef HWND EGLNativeWindowType; +#endif + +#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ + +typedef int EGLNativeDisplayType; +typedef void *EGLNativeWindowType; +typedef void *EGLNativePixmapType; + +#elif defined(WL_EGL_PLATFORM) + +typedef struct wl_display *EGLNativeDisplayType; +typedef struct wl_egl_pixmap *EGLNativePixmapType; +typedef struct wl_egl_window *EGLNativeWindowType; + +#elif defined(__GBM__) + +typedef struct gbm_device *EGLNativeDisplayType; +typedef struct gbm_bo *EGLNativePixmapType; +typedef void *EGLNativeWindowType; + +#elif defined(__ANDROID__) /* Android */ + +struct ANativeWindow; +struct egl_native_pixmap_t; + +typedef struct ANativeWindow *EGLNativeWindowType; +typedef struct egl_native_pixmap_t *EGLNativePixmapType; +typedef void *EGLNativeDisplayType; + +#elif defined(MIR_EGL_PLATFORM) + +#include +typedef MirEGLNativeDisplayType EGLNativeDisplayType; +typedef void *EGLNativePixmapType; +typedef MirEGLNativeWindowType EGLNativeWindowType; + +#elif defined(__unix__) + +#ifdef MESA_EGL_NO_X11_HEADERS + +typedef void *EGLNativeDisplayType; +typedef khronos_uintptr_t EGLNativePixmapType; +typedef khronos_uintptr_t EGLNativeWindowType; + +#else + +/* X11 (tentative) */ +#include +#include + +typedef Display *EGLNativeDisplayType; +typedef Pixmap EGLNativePixmapType; +typedef Window EGLNativeWindowType; + +#endif /* MESA_EGL_NO_X11_HEADERS */ + +#else +#error "Platform not recognized" +#endif + +/* EGL 1.2 types, renamed for consistency in EGL 1.3 */ +typedef EGLNativeDisplayType NativeDisplayType; +typedef EGLNativePixmapType NativePixmapType; +typedef EGLNativeWindowType NativeWindowType; + + +/* Define EGLint. This must be a signed integral type large enough to contain +* all legal attribute names and values passed into and out of EGL, whether +* their type is boolean, bitmask, enumerant (symbolic constant), integer, +* handle, or other. While in general a 32-bit integer will suffice, if +* handles are 64 bit types, then EGLint should be defined as a signed 64-bit +* integer type. +*/ +typedef khronos_int32_t EGLint; + +#endif /* __eglplatform_h */ + +#ifndef __egl_h_ +#define __egl_h_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2013-2015 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ +/* +** This header is generated from the Khronos OpenGL / OpenGL ES XML +** API Registry. The current version of the Registry, generator scripts +** used to make the header, and the header can be found at +** http://www.opengl.org/registry/ +** +** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $ +*/ + +/*#include */ + +/* Generated on date 20150623 */ + +/* Generated C header for: + * API: egl + * Versions considered: .* + * Versions emitted: .* + * Default extensions included: None + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ + +#ifndef EGL_VERSION_1_0 +#define EGL_VERSION_1_0 1 +typedef unsigned int EGLBoolean; +typedef void *EGLDisplay; +typedef void *EGLConfig; +typedef void *EGLSurface; +typedef void *EGLContext; +typedef void (*__eglMustCastToProperFunctionPointerType)(void); +#define EGL_ALPHA_SIZE 0x3021 +#define EGL_BAD_ACCESS 0x3002 +#define EGL_BAD_ALLOC 0x3003 +#define EGL_BAD_ATTRIBUTE 0x3004 +#define EGL_BAD_CONFIG 0x3005 +#define EGL_BAD_CONTEXT 0x3006 +#define EGL_BAD_CURRENT_SURFACE 0x3007 +#define EGL_BAD_DISPLAY 0x3008 +#define EGL_BAD_MATCH 0x3009 +#define EGL_BAD_NATIVE_PIXMAP 0x300A +#define EGL_BAD_NATIVE_WINDOW 0x300B +#define EGL_BAD_PARAMETER 0x300C +#define EGL_BAD_SURFACE 0x300D +#define EGL_BLUE_SIZE 0x3022 +#define EGL_BUFFER_SIZE 0x3020 +#define EGL_CONFIG_CAVEAT 0x3027 +#define EGL_CONFIG_ID 0x3028 +#define EGL_CORE_NATIVE_ENGINE 0x305B +#define EGL_DEPTH_SIZE 0x3025 +#define EGL_DONT_CARE ((EGLint)-1) +#define EGL_DRAW 0x3059 +#define EGL_EXTENSIONS 0x3055 +#define EGL_FALSE 0 +#define EGL_GREEN_SIZE 0x3023 +#define EGL_HEIGHT 0x3056 +#define EGL_LARGEST_PBUFFER 0x3058 +#define EGL_LEVEL 0x3029 +#define EGL_MAX_PBUFFER_HEIGHT 0x302A +#define EGL_MAX_PBUFFER_PIXELS 0x302B +#define EGL_MAX_PBUFFER_WIDTH 0x302C +#define EGL_NATIVE_RENDERABLE 0x302D +#define EGL_NATIVE_VISUAL_ID 0x302E +#define EGL_NATIVE_VISUAL_TYPE 0x302F +#define EGL_NONE 0x3038 +#define EGL_NON_CONFORMANT_CONFIG 0x3051 +#define EGL_NOT_INITIALIZED 0x3001 +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_SURFACE ((EGLSurface)0) +#define EGL_PBUFFER_BIT 0x0001 +#define EGL_PIXMAP_BIT 0x0002 +#define EGL_READ 0x305A +#define EGL_RED_SIZE 0x3024 +#define EGL_SAMPLES 0x3031 +#define EGL_SAMPLE_BUFFERS 0x3032 +#define EGL_SLOW_CONFIG 0x3050 +#define EGL_STENCIL_SIZE 0x3026 +#define EGL_SUCCESS 0x3000 +#define EGL_SURFACE_TYPE 0x3033 +#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 +#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 +#define EGL_TRANSPARENT_RED_VALUE 0x3037 +#define EGL_TRANSPARENT_RGB 0x3052 +#define EGL_TRANSPARENT_TYPE 0x3034 +#define EGL_TRUE 1 +#define EGL_VENDOR 0x3053 +#define EGL_VERSION 0x3054 +#define EGL_WIDTH 0x3057 +#define EGL_WINDOW_BIT 0x0004 +EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); +EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); +EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface); +EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); +EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); +EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void); +EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw); +EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id); +EGLAPI EGLint EGLAPIENTRY eglGetError (void); +EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname); +EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor); +EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); +EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name); +EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface); +EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine); +#endif /* EGL_VERSION_1_0 */ + +#ifndef EGL_VERSION_1_1 +#define EGL_VERSION_1_1 1 +#define EGL_BACK_BUFFER 0x3084 +#define EGL_BIND_TO_TEXTURE_RGB 0x3039 +#define EGL_BIND_TO_TEXTURE_RGBA 0x303A +#define EGL_CONTEXT_LOST 0x300E +#define EGL_MIN_SWAP_INTERVAL 0x303B +#define EGL_MAX_SWAP_INTERVAL 0x303C +#define EGL_MIPMAP_TEXTURE 0x3082 +#define EGL_MIPMAP_LEVEL 0x3083 +#define EGL_NO_TEXTURE 0x305C +#define EGL_TEXTURE_2D 0x305F +#define EGL_TEXTURE_FORMAT 0x3080 +#define EGL_TEXTURE_RGB 0x305D +#define EGL_TEXTURE_RGBA 0x305E +#define EGL_TEXTURE_TARGET 0x3081 +EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); +EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval); +#endif /* EGL_VERSION_1_1 */ + +#ifndef EGL_VERSION_1_2 +#define EGL_VERSION_1_2 1 +typedef unsigned int EGLenum; +typedef void *EGLClientBuffer; +#define EGL_ALPHA_FORMAT 0x3088 +#define EGL_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_ALPHA_FORMAT_PRE 0x308C +#define EGL_ALPHA_MASK_SIZE 0x303E +#define EGL_BUFFER_PRESERVED 0x3094 +#define EGL_BUFFER_DESTROYED 0x3095 +#define EGL_CLIENT_APIS 0x308D +#define EGL_COLORSPACE 0x3087 +#define EGL_COLORSPACE_sRGB 0x3089 +#define EGL_COLORSPACE_LINEAR 0x308A +#define EGL_COLOR_BUFFER_TYPE 0x303F +#define EGL_CONTEXT_CLIENT_TYPE 0x3097 +#define EGL_DISPLAY_SCALING 10000 +#define EGL_HORIZONTAL_RESOLUTION 0x3090 +#define EGL_LUMINANCE_BUFFER 0x308F +#define EGL_LUMINANCE_SIZE 0x303D +#define EGL_OPENGL_ES_BIT 0x0001 +#define EGL_OPENVG_BIT 0x0002 +#define EGL_OPENGL_ES_API 0x30A0 +#define EGL_OPENVG_API 0x30A1 +#define EGL_OPENVG_IMAGE 0x3096 +#define EGL_PIXEL_ASPECT_RATIO 0x3092 +#define EGL_RENDERABLE_TYPE 0x3040 +#define EGL_RENDER_BUFFER 0x3086 +#define EGL_RGB_BUFFER 0x308E +#define EGL_SINGLE_BUFFER 0x3085 +#define EGL_SWAP_BEHAVIOR 0x3093 +#define EGL_UNKNOWN ((EGLint)-1) +#define EGL_VERTICAL_RESOLUTION 0x3091 +EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api); +EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void); +#endif /* EGL_VERSION_1_2 */ + +#ifndef EGL_VERSION_1_3 +#define EGL_VERSION_1_3 1 +#define EGL_CONFORMANT 0x3042 +#define EGL_CONTEXT_CLIENT_VERSION 0x3098 +#define EGL_MATCH_NATIVE_PIXMAP 0x3041 +#define EGL_OPENGL_ES2_BIT 0x0004 +#define EGL_VG_ALPHA_FORMAT 0x3088 +#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_VG_ALPHA_FORMAT_PRE 0x308C +#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 +#define EGL_VG_COLORSPACE 0x3087 +#define EGL_VG_COLORSPACE_sRGB 0x3089 +#define EGL_VG_COLORSPACE_LINEAR 0x308A +#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 +#endif /* EGL_VERSION_1_3 */ + +#ifndef EGL_VERSION_1_4 +#define EGL_VERSION_1_4 1 +#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) +#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 +#define EGL_MULTISAMPLE_RESOLVE 0x3099 +#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A +#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B +#define EGL_OPENGL_API 0x30A2 +#define EGL_OPENGL_BIT 0x0008 +#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 +EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void); +#endif /* EGL_VERSION_1_4 */ + +#ifndef EGL_VERSION_1_5 +#define EGL_VERSION_1_5 1 +typedef void *EGLSync; +typedef intptr_t EGLAttrib; +typedef khronos_utime_nanoseconds_t EGLTime; +typedef void *EGLImage; +#define EGL_CONTEXT_MAJOR_VERSION 0x3098 +#define EGL_CONTEXT_MINOR_VERSION 0x30FB +#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD +#define EGL_NO_RESET_NOTIFICATION 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 +#define EGL_OPENGL_ES3_BIT 0x00000040 +#define EGL_CL_EVENT_HANDLE 0x309C +#define EGL_SYNC_CL_EVENT 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0 +#define EGL_SYNC_TYPE 0x30F7 +#define EGL_SYNC_STATUS 0x30F1 +#define EGL_SYNC_CONDITION 0x30F8 +#define EGL_SIGNALED 0x30F2 +#define EGL_UNSIGNALED 0x30F3 +#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001 +#define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull +#define EGL_TIMEOUT_EXPIRED 0x30F5 +#define EGL_CONDITION_SATISFIED 0x30F6 +#define EGL_NO_SYNC ((EGLSync)0) +#define EGL_SYNC_FENCE 0x30F9 +#define EGL_GL_COLORSPACE 0x309D +#define EGL_GL_COLORSPACE_SRGB 0x3089 +#define EGL_GL_COLORSPACE_LINEAR 0x308A +#define EGL_GL_RENDERBUFFER 0x30B9 +#define EGL_GL_TEXTURE_2D 0x30B1 +#define EGL_GL_TEXTURE_LEVEL 0x30BC +#define EGL_GL_TEXTURE_3D 0x30B2 +#define EGL_GL_TEXTURE_ZOFFSET 0x30BD +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 +#define EGL_IMAGE_PRESERVED 0x30D2 +#define EGL_NO_IMAGE ((EGLImage)0) +EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync); +EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); +EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value); +EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy, EGLImage image); +EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags); +#endif /* EGL_VERSION_1_5 */ + +#ifdef __cplusplus +} +#endif + +#endif /* __egl_h_ */ + + + +#ifndef __eglext_h_ +#define __eglext_h_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2013-2015 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ +/* +** This header is generated from the Khronos OpenGL / OpenGL ES XML +** API Registry. The current version of the Registry, generator scripts +** used to make the header, and the header can be found at +** http://www.opengl.org/registry/ +** +** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $ +*/ + +/*#include */ + +#define EGL_EGLEXT_VERSION 20150623 + +/* Generated C header for: + * API: egl + * Versions considered: .* + * Versions emitted: _nomatch_^ + * Default extensions included: egl + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ + +#ifndef EGL_KHR_cl_event +#define EGL_KHR_cl_event 1 +#define EGL_CL_EVENT_HANDLE_KHR 0x309C +#define EGL_SYNC_CL_EVENT_KHR 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF +#endif /* EGL_KHR_cl_event */ + +#ifndef EGL_KHR_cl_event2 +#define EGL_KHR_cl_event2 1 +typedef void *EGLSyncKHR; +typedef intptr_t EGLAttribKHR; +typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list); +#endif +#endif /* EGL_KHR_cl_event2 */ + +#ifndef EGL_KHR_client_get_all_proc_addresses +#define EGL_KHR_client_get_all_proc_addresses 1 +#endif /* EGL_KHR_client_get_all_proc_addresses */ + +#ifndef EGL_KHR_config_attribs +#define EGL_KHR_config_attribs 1 +#define EGL_CONFORMANT_KHR 0x3042 +#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 +#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 +#endif /* EGL_KHR_config_attribs */ + +#ifndef EGL_KHR_create_context +#define EGL_KHR_create_context 1 +#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 +#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB +#define EGL_CONTEXT_FLAGS_KHR 0x30FC +#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD +#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF +#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 +#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 +#endif /* EGL_KHR_create_context */ + +#ifndef EGL_KHR_create_context_no_error +#define EGL_KHR_create_context_no_error 1 +#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3 +#endif /* EGL_KHR_create_context_no_error */ + +#ifndef EGL_KHR_fence_sync +#define EGL_KHR_fence_sync 1 +typedef khronos_utime_nanoseconds_t EGLTimeKHR; +#ifdef KHRONOS_SUPPORT_INT64 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 +#define EGL_SYNC_CONDITION_KHR 0x30F8 +#define EGL_SYNC_FENCE_KHR 0x30F9 +typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); +typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync); +EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); +#endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_KHR_fence_sync */ + +#ifndef EGL_KHR_get_all_proc_addresses +#define EGL_KHR_get_all_proc_addresses 1 +#endif /* EGL_KHR_get_all_proc_addresses */ + +#ifndef EGL_KHR_gl_colorspace +#define EGL_KHR_gl_colorspace 1 +#define EGL_GL_COLORSPACE_KHR 0x309D +#define EGL_GL_COLORSPACE_SRGB_KHR 0x3089 +#define EGL_GL_COLORSPACE_LINEAR_KHR 0x308A +#endif /* EGL_KHR_gl_colorspace */ + +#ifndef EGL_KHR_gl_renderbuffer_image +#define EGL_KHR_gl_renderbuffer_image 1 +#define EGL_GL_RENDERBUFFER_KHR 0x30B9 +#endif /* EGL_KHR_gl_renderbuffer_image */ + +#ifndef EGL_KHR_gl_texture_2D_image +#define EGL_KHR_gl_texture_2D_image 1 +#define EGL_GL_TEXTURE_2D_KHR 0x30B1 +#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC +#endif /* EGL_KHR_gl_texture_2D_image */ + +#ifndef EGL_KHR_gl_texture_3D_image +#define EGL_KHR_gl_texture_3D_image 1 +#define EGL_GL_TEXTURE_3D_KHR 0x30B2 +#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD +#endif /* EGL_KHR_gl_texture_3D_image */ + +#ifndef EGL_KHR_gl_texture_cubemap_image +#define EGL_KHR_gl_texture_cubemap_image 1 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 +#endif /* EGL_KHR_gl_texture_cubemap_image */ + +#ifndef EGL_KHR_image +#define EGL_KHR_image 1 +typedef void *EGLImageKHR; +#define EGL_NATIVE_PIXMAP_KHR 0x30B0 +#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0) +typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image); +#endif +#endif /* EGL_KHR_image */ + +#ifndef EGL_KHR_image_base +#define EGL_KHR_image_base 1 +#define EGL_IMAGE_PRESERVED_KHR 0x30D2 +#endif /* EGL_KHR_image_base */ + +#ifndef EGL_KHR_image_pixmap +#define EGL_KHR_image_pixmap 1 +#endif /* EGL_KHR_image_pixmap */ + +#ifndef EGL_KHR_lock_surface +#define EGL_KHR_lock_surface 1 +#define EGL_READ_SURFACE_BIT_KHR 0x0001 +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 +#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 +#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 +#define EGL_MATCH_FORMAT_KHR 0x3043 +#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 +#define EGL_FORMAT_RGB_565_KHR 0x30C1 +#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 +#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 +#define EGL_BITMAP_POINTER_KHR 0x30C6 +#define EGL_BITMAP_PITCH_KHR 0x30C7 +#define EGL_BITMAP_ORIGIN_KHR 0x30C8 +#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 +#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA +#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB +#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC +#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD +#define EGL_LOWER_LEFT_KHR 0x30CE +#define EGL_UPPER_LEFT_KHR 0x30CF +typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay dpy, EGLSurface surface); +#endif +#endif /* EGL_KHR_lock_surface */ + +#ifndef EGL_KHR_lock_surface2 +#define EGL_KHR_lock_surface2 1 +#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 +#endif /* EGL_KHR_lock_surface2 */ + +#ifndef EGL_KHR_lock_surface3 +#define EGL_KHR_lock_surface3 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACE64KHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface64KHR (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value); +#endif +#endif /* EGL_KHR_lock_surface3 */ + +#ifndef EGL_KHR_partial_update +#define EGL_KHR_partial_update 1 +#define EGL_BUFFER_AGE_KHR 0x313D +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSetDamageRegionKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#endif +#endif /* EGL_KHR_partial_update */ + +#ifndef EGL_KHR_platform_android +#define EGL_KHR_platform_android 1 +#define EGL_PLATFORM_ANDROID_KHR 0x3141 +#endif /* EGL_KHR_platform_android */ + +#ifndef EGL_KHR_platform_gbm +#define EGL_KHR_platform_gbm 1 +#define EGL_PLATFORM_GBM_KHR 0x31D7 +#endif /* EGL_KHR_platform_gbm */ + +#ifndef EGL_KHR_platform_wayland +#define EGL_KHR_platform_wayland 1 +#define EGL_PLATFORM_WAYLAND_KHR 0x31D8 +#endif /* EGL_KHR_platform_wayland */ + +#ifndef EGL_KHR_platform_x11 +#define EGL_KHR_platform_x11 1 +#define EGL_PLATFORM_X11_KHR 0x31D5 +#define EGL_PLATFORM_X11_SCREEN_KHR 0x31D6 +#endif /* EGL_KHR_platform_x11 */ + +#ifndef EGL_KHR_reusable_sync +#define EGL_KHR_reusable_sync 1 +#ifdef KHRONOS_SUPPORT_INT64 +#define EGL_SYNC_STATUS_KHR 0x30F1 +#define EGL_SIGNALED_KHR 0x30F2 +#define EGL_UNSIGNALED_KHR 0x30F3 +#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 +#define EGL_CONDITION_SATISFIED_KHR 0x30F6 +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_REUSABLE_KHR 0x30FA +#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 +#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull +#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0) +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); +#endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_KHR_reusable_sync */ + +#ifndef EGL_KHR_stream +#define EGL_KHR_stream 1 +typedef void *EGLStreamKHR; +typedef khronos_uint64_t EGLuint64KHR; +#ifdef KHRONOS_SUPPORT_INT64 +#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0) +#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 +#define EGL_PRODUCER_FRAME_KHR 0x3212 +#define EGL_CONSUMER_FRAME_KHR 0x3213 +#define EGL_STREAM_STATE_KHR 0x3214 +#define EGL_STREAM_STATE_CREATED_KHR 0x3215 +#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 +#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 +#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 +#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 +#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A +#define EGL_BAD_STREAM_KHR 0x321B +#define EGL_BAD_STATE_KHR 0x321C +typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR (EGLDisplay dpy, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR (EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value); +#endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_KHR_stream */ + +#ifndef EGL_KHR_stream_consumer_gltexture +#define EGL_KHR_stream_consumer_gltexture 1 +#ifdef EGL_KHR_stream +#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR (EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR (EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR (EGLDisplay dpy, EGLStreamKHR stream); +#endif +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_consumer_gltexture */ + +#ifndef EGL_KHR_stream_cross_process_fd +#define EGL_KHR_stream_cross_process_fd 1 +typedef int EGLNativeFileDescriptorKHR; +#ifdef EGL_KHR_stream +#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1)) +typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR (EGLDisplay dpy, EGLStreamKHR stream); +EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); +#endif +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_cross_process_fd */ + +#ifndef EGL_KHR_stream_fifo +#define EGL_KHR_stream_fifo 1 +#ifdef EGL_KHR_stream +#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC +#define EGL_STREAM_TIME_NOW_KHR 0x31FD +#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE +#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value); +#endif +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_fifo */ + +#ifndef EGL_KHR_stream_producer_aldatalocator +#define EGL_KHR_stream_producer_aldatalocator 1 +#ifdef EGL_KHR_stream +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_producer_aldatalocator */ + +#ifndef EGL_KHR_stream_producer_eglsurface +#define EGL_KHR_stream_producer_eglsurface 1 +#ifdef EGL_KHR_stream +#define EGL_STREAM_BIT_KHR 0x0800 +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list); +#endif +#endif /* EGL_KHR_stream */ +#endif /* EGL_KHR_stream_producer_eglsurface */ + +#ifndef EGL_KHR_surfaceless_context +#define EGL_KHR_surfaceless_context 1 +#endif /* EGL_KHR_surfaceless_context */ + +#ifndef EGL_KHR_swap_buffers_with_damage +#define EGL_KHR_swap_buffers_with_damage 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#endif +#endif /* EGL_KHR_swap_buffers_with_damage */ + +#ifndef EGL_KHR_vg_parent_image +#define EGL_KHR_vg_parent_image 1 +#define EGL_VG_PARENT_IMAGE_KHR 0x30BA +#endif /* EGL_KHR_vg_parent_image */ + +#ifndef EGL_KHR_wait_sync +#define EGL_KHR_wait_sync 1 +typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); +#endif +#endif /* EGL_KHR_wait_sync */ + +#ifndef EGL_ANDROID_blob_cache +#define EGL_ANDROID_blob_cache 1 +typedef khronos_ssize_t EGLsizeiANDROID; +typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize); +typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize); +typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); +#endif +#endif /* EGL_ANDROID_blob_cache */ + +#ifndef EGL_ANDROID_framebuffer_target +#define EGL_ANDROID_framebuffer_target 1 +#define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 +#endif /* EGL_ANDROID_framebuffer_target */ + +#ifndef EGL_ANDROID_image_native_buffer +#define EGL_ANDROID_image_native_buffer 1 +#define EGL_NATIVE_BUFFER_ANDROID 0x3140 +#endif /* EGL_ANDROID_image_native_buffer */ + +#ifndef EGL_ANDROID_native_fence_sync +#define EGL_ANDROID_native_fence_sync 1 +#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 +#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 +#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146 +#define EGL_NO_NATIVE_FENCE_FD_ANDROID -1 +typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID (EGLDisplay dpy, EGLSyncKHR sync); +#endif +#endif /* EGL_ANDROID_native_fence_sync */ + +#ifndef EGL_ANDROID_recordable +#define EGL_ANDROID_recordable 1 +#define EGL_RECORDABLE_ANDROID 0x3142 +#endif /* EGL_ANDROID_recordable */ + +#ifndef EGL_ANGLE_d3d_share_handle_client_buffer +#define EGL_ANGLE_d3d_share_handle_client_buffer 1 +#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 +#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */ + +#ifndef EGL_ANGLE_device_d3d +#define EGL_ANGLE_device_d3d 1 +#define EGL_D3D9_DEVICE_ANGLE 0x33A0 +#define EGL_D3D11_DEVICE_ANGLE 0x33A1 +#endif /* EGL_ANGLE_device_d3d */ + +#ifndef EGL_ANGLE_query_surface_pointer +#define EGL_ANGLE_query_surface_pointer 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value); +#endif +#endif /* EGL_ANGLE_query_surface_pointer */ + +#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle +#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 +#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ + +#ifndef EGL_ANGLE_window_fixed_size +#define EGL_ANGLE_window_fixed_size 1 +#define EGL_FIXED_SIZE_ANGLE 0x3201 +#endif /* EGL_ANGLE_window_fixed_size */ + +#ifndef EGL_ARM_pixmap_multisample_discard +#define EGL_ARM_pixmap_multisample_discard 1 +#define EGL_DISCARD_SAMPLES_ARM 0x3286 +#endif /* EGL_ARM_pixmap_multisample_discard */ + +#ifndef EGL_EXT_buffer_age +#define EGL_EXT_buffer_age 1 +#define EGL_BUFFER_AGE_EXT 0x313D +#endif /* EGL_EXT_buffer_age */ + +#ifndef EGL_EXT_client_extensions +#define EGL_EXT_client_extensions 1 +#endif /* EGL_EXT_client_extensions */ + +#ifndef EGL_EXT_create_context_robustness +#define EGL_EXT_create_context_robustness 1 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 +#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF +#endif /* EGL_EXT_create_context_robustness */ + +#ifndef EGL_EXT_device_base +#define EGL_EXT_device_base 1 +typedef void *EGLDeviceEXT; +#define EGL_NO_DEVICE_EXT ((EGLDeviceEXT)(0)) +#define EGL_BAD_DEVICE_EXT 0x322B +#define EGL_DEVICE_EXT 0x322C +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); +typedef const char *(EGLAPIENTRYP PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value); +EGLAPI const char *EGLAPIENTRY eglQueryDeviceStringEXT (EGLDeviceEXT device, EGLint name); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryDevicesEXT (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint attribute, EGLAttrib *value); +#endif +#endif /* EGL_EXT_device_base */ + +#ifndef EGL_EXT_device_drm +#define EGL_EXT_device_drm 1 +#define EGL_DRM_DEVICE_FILE_EXT 0x3233 +#endif /* EGL_EXT_device_drm */ + +#ifndef EGL_EXT_device_enumeration +#define EGL_EXT_device_enumeration 1 +#endif /* EGL_EXT_device_enumeration */ + +#ifndef EGL_EXT_device_openwf +#define EGL_EXT_device_openwf 1 +#define EGL_OPENWF_DEVICE_ID_EXT 0x3237 +#endif /* EGL_EXT_device_openwf */ + +#ifndef EGL_EXT_device_query +#define EGL_EXT_device_query 1 +#endif /* EGL_EXT_device_query */ + +#ifndef EGL_EXT_image_dma_buf_import +#define EGL_EXT_image_dma_buf_import 1 +#define EGL_LINUX_DMA_BUF_EXT 0x3270 +#define EGL_LINUX_DRM_FOURCC_EXT 0x3271 +#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 +#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 +#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 +#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 +#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 +#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 +#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 +#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 +#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A +#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B +#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C +#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D +#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E +#define EGL_ITU_REC601_EXT 0x327F +#define EGL_ITU_REC709_EXT 0x3280 +#define EGL_ITU_REC2020_EXT 0x3281 +#define EGL_YUV_FULL_RANGE_EXT 0x3282 +#define EGL_YUV_NARROW_RANGE_EXT 0x3283 +#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284 +#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 +#endif /* EGL_EXT_image_dma_buf_import */ + +#ifndef EGL_EXT_multiview_window +#define EGL_EXT_multiview_window 1 +#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 +#endif /* EGL_EXT_multiview_window */ + +#ifndef EGL_EXT_output_base +#define EGL_EXT_output_base 1 +typedef void *EGLOutputLayerEXT; +typedef void *EGLOutputPortEXT; +#define EGL_NO_OUTPUT_LAYER_EXT ((EGLOutputLayerEXT)0) +#define EGL_NO_OUTPUT_PORT_EXT ((EGLOutputPortEXT)0) +#define EGL_BAD_OUTPUT_LAYER_EXT 0x322D +#define EGL_BAD_OUTPUT_PORT_EXT 0x322E +#define EGL_SWAP_INTERVAL_EXT 0x322F +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); +typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); +typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputLayersEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers); +EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputPortsEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports); +EGLAPI EGLBoolean EGLAPIENTRY eglOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value); +EGLAPI const char *EGLAPIENTRY eglQueryOutputLayerStringEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); +EGLAPI EGLBoolean EGLAPIENTRY eglOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value); +EGLAPI const char *EGLAPIENTRY eglQueryOutputPortStringEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); +#endif +#endif /* EGL_EXT_output_base */ + +#ifndef EGL_EXT_output_drm +#define EGL_EXT_output_drm 1 +#define EGL_DRM_CRTC_EXT 0x3234 +#define EGL_DRM_PLANE_EXT 0x3235 +#define EGL_DRM_CONNECTOR_EXT 0x3236 +#endif /* EGL_EXT_output_drm */ + +#ifndef EGL_EXT_output_openwf +#define EGL_EXT_output_openwf 1 +#define EGL_OPENWF_PIPELINE_ID_EXT 0x3238 +#define EGL_OPENWF_PORT_ID_EXT 0x3239 +#endif /* EGL_EXT_output_openwf */ + +#ifndef EGL_EXT_platform_base +#define EGL_EXT_platform_base 1 +typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list); +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT (EGLenum platform, void *native_display, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); +EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); +#endif +#endif /* EGL_EXT_platform_base */ + +#ifndef EGL_EXT_platform_device +#define EGL_EXT_platform_device 1 +#define EGL_PLATFORM_DEVICE_EXT 0x313F +#endif /* EGL_EXT_platform_device */ + +#ifndef EGL_EXT_platform_wayland +#define EGL_EXT_platform_wayland 1 +#define EGL_PLATFORM_WAYLAND_EXT 0x31D8 +#endif /* EGL_EXT_platform_wayland */ + +#ifndef EGL_EXT_platform_x11 +#define EGL_EXT_platform_x11 1 +#define EGL_PLATFORM_X11_EXT 0x31D5 +#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6 +#endif /* EGL_EXT_platform_x11 */ + +#ifndef EGL_EXT_protected_surface +#define EGL_EXT_protected_surface 1 +#define EGL_PROTECTED_CONTENT_EXT 0x32C0 +#endif /* EGL_EXT_protected_surface */ + +#ifndef EGL_EXT_stream_consumer_egloutput +#define EGL_EXT_stream_consumer_egloutput 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); +#endif +#endif /* EGL_EXT_stream_consumer_egloutput */ + +#ifndef EGL_EXT_swap_buffers_with_damage +#define EGL_EXT_swap_buffers_with_damage 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); +#endif +#endif /* EGL_EXT_swap_buffers_with_damage */ + +#ifndef EGL_EXT_yuv_surface +#define EGL_EXT_yuv_surface 1 +#define EGL_YUV_ORDER_EXT 0x3301 +#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 +#define EGL_YUV_SUBSAMPLE_EXT 0x3312 +#define EGL_YUV_DEPTH_RANGE_EXT 0x3317 +#define EGL_YUV_CSC_STANDARD_EXT 0x330A +#define EGL_YUV_PLANE_BPP_EXT 0x331A +#define EGL_YUV_BUFFER_EXT 0x3300 +#define EGL_YUV_ORDER_YUV_EXT 0x3302 +#define EGL_YUV_ORDER_YVU_EXT 0x3303 +#define EGL_YUV_ORDER_YUYV_EXT 0x3304 +#define EGL_YUV_ORDER_UYVY_EXT 0x3305 +#define EGL_YUV_ORDER_YVYU_EXT 0x3306 +#define EGL_YUV_ORDER_VYUY_EXT 0x3307 +#define EGL_YUV_ORDER_AYUV_EXT 0x3308 +#define EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313 +#define EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314 +#define EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315 +#define EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318 +#define EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319 +#define EGL_YUV_CSC_STANDARD_601_EXT 0x330B +#define EGL_YUV_CSC_STANDARD_709_EXT 0x330C +#define EGL_YUV_CSC_STANDARD_2020_EXT 0x330D +#define EGL_YUV_PLANE_BPP_0_EXT 0x331B +#define EGL_YUV_PLANE_BPP_8_EXT 0x331C +#define EGL_YUV_PLANE_BPP_10_EXT 0x331D +#endif /* EGL_EXT_yuv_surface */ + +#ifndef EGL_HI_clientpixmap +#define EGL_HI_clientpixmap 1 +struct EGLClientPixmapHI { + void *pData; + EGLint iWidth; + EGLint iHeight; + EGLint iStride; +}; +#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 +typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap); +#endif +#endif /* EGL_HI_clientpixmap */ + +#ifndef EGL_HI_colorformats +#define EGL_HI_colorformats 1 +#define EGL_COLOR_FORMAT_HI 0x8F70 +#define EGL_COLOR_RGB_HI 0x8F71 +#define EGL_COLOR_RGBA_HI 0x8F72 +#define EGL_COLOR_ARGB_HI 0x8F73 +#endif /* EGL_HI_colorformats */ + +#ifndef EGL_IMG_context_priority +#define EGL_IMG_context_priority 1 +#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 +#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 +#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 +#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 +#endif /* EGL_IMG_context_priority */ + +#ifndef EGL_MESA_drm_image +#define EGL_MESA_drm_image 1 +#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 +#define EGL_DRM_BUFFER_USE_MESA 0x31D1 +#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 +#define EGL_DRM_BUFFER_MESA 0x31D3 +#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 +#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 +#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 +typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride); +#endif +#endif /* EGL_MESA_drm_image */ + +#ifndef EGL_MESA_image_dma_buf_export +#define EGL_MESA_image_dma_buf_export 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageQueryMESA (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers); +EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageMESA (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets); +#endif +#endif /* EGL_MESA_image_dma_buf_export */ + +#ifndef EGL_MESA_platform_gbm +#define EGL_MESA_platform_gbm 1 +#define EGL_PLATFORM_GBM_MESA 0x31D7 +#endif /* EGL_MESA_platform_gbm */ + +#ifndef EGL_NOK_swap_region +#define EGL_NOK_swap_region 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); +#endif +#endif /* EGL_NOK_swap_region */ + +#ifndef EGL_NOK_swap_region2 +#define EGL_NOK_swap_region2 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegion2NOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects); +#endif +#endif /* EGL_NOK_swap_region2 */ + +#ifndef EGL_NOK_texture_from_pixmap +#define EGL_NOK_texture_from_pixmap 1 +#define EGL_Y_INVERTED_NOK 0x307F +#endif /* EGL_NOK_texture_from_pixmap */ + +#ifndef EGL_NV_3dvision_surface +#define EGL_NV_3dvision_surface 1 +#define EGL_AUTO_STEREO_NV 0x3136 +#endif /* EGL_NV_3dvision_surface */ + +#ifndef EGL_NV_coverage_sample +#define EGL_NV_coverage_sample 1 +#define EGL_COVERAGE_BUFFERS_NV 0x30E0 +#define EGL_COVERAGE_SAMPLES_NV 0x30E1 +#endif /* EGL_NV_coverage_sample */ + +#ifndef EGL_NV_coverage_sample_resolve +#define EGL_NV_coverage_sample_resolve 1 +#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 +#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 +#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 +#endif /* EGL_NV_coverage_sample_resolve */ + +#ifndef EGL_NV_cuda_event +#define EGL_NV_cuda_event 1 +#define EGL_CUDA_EVENT_HANDLE_NV 0x323B +#define EGL_SYNC_CUDA_EVENT_NV 0x323C +#define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D +#endif /* EGL_NV_cuda_event */ + +#ifndef EGL_NV_depth_nonlinear +#define EGL_NV_depth_nonlinear 1 +#define EGL_DEPTH_ENCODING_NV 0x30E2 +#define EGL_DEPTH_ENCODING_NONE_NV 0 +#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 +#endif /* EGL_NV_depth_nonlinear */ + +#ifndef EGL_NV_device_cuda +#define EGL_NV_device_cuda 1 +#define EGL_CUDA_DEVICE_NV 0x323A +#endif /* EGL_NV_device_cuda */ + +#ifndef EGL_NV_native_query +#define EGL_NV_native_query 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType *display_id); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV (EGLDisplay dpy, EGLNativeDisplayType *display_id); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap); +#endif +#endif /* EGL_NV_native_query */ + +#ifndef EGL_NV_post_convert_rounding +#define EGL_NV_post_convert_rounding 1 +#endif /* EGL_NV_post_convert_rounding */ + +#ifndef EGL_NV_post_sub_buffer +#define EGL_NV_post_sub_buffer 1 +#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE +typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); +#endif +#endif /* EGL_NV_post_sub_buffer */ + +#ifndef EGL_NV_stream_sync +#define EGL_NV_stream_sync 1 +#define EGL_SYNC_NEW_FRAME_NV 0x321F +typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateStreamSyncNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list); +#endif +#endif /* EGL_NV_stream_sync */ + +#ifndef EGL_NV_sync +#define EGL_NV_sync 1 +typedef void *EGLSyncNV; +typedef khronos_utime_nanoseconds_t EGLTimeNV; +#ifdef KHRONOS_SUPPORT_INT64 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 +#define EGL_SYNC_STATUS_NV 0x30E7 +#define EGL_SIGNALED_NV 0x30E8 +#define EGL_UNSIGNALED_NV 0x30E9 +#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 +#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull +#define EGL_ALREADY_SIGNALED_NV 0x30EA +#define EGL_TIMEOUT_EXPIRED_NV 0x30EB +#define EGL_CONDITION_SATISFIED_NV 0x30EC +#define EGL_SYNC_TYPE_NV 0x30ED +#define EGL_SYNC_CONDITION_NV 0x30EE +#define EGL_SYNC_FENCE_NV 0x30EF +#define EGL_NO_SYNC_NV ((EGLSyncNV)0) +typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync); +typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync); +EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync); +EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode); +EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value); +#endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_NV_sync */ + +#ifndef EGL_NV_system_time +#define EGL_NV_system_time 1 +typedef khronos_utime_nanoseconds_t EGLuint64NV; +#ifdef KHRONOS_SUPPORT_INT64 +typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void); +typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV (void); +EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void); +#endif +#endif /* KHRONOS_SUPPORT_INT64 */ +#endif /* EGL_NV_system_time */ + +#ifndef EGL_TIZEN_image_native_buffer +#define EGL_TIZEN_image_native_buffer 1 +#define EGL_NATIVE_BUFFER_TIZEN 0x32A0 +#endif /* EGL_TIZEN_image_native_buffer */ + +#ifndef EGL_TIZEN_image_native_surface +#define EGL_TIZEN_image_native_surface 1 +#define EGL_NATIVE_SURFACE_TIZEN 0x32A1 +#endif /* EGL_TIZEN_image_native_surface */ + +#ifdef __cplusplus +} +#endif + +#endif /* __eglext_h_ */ + + +#endif /* _MSC_VER */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_endian.h b/Src/Decoder_H264_ALL/include/SDL/SDL_endian.h new file mode 100644 index 0000000..9100b10 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_endian.h @@ -0,0 +1,239 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_endian.h + * + * Functions for reading and writing endian-specific values + */ + +#ifndef _SDL_endian_h +#define _SDL_endian_h + +#include "SDL_stdinc.h" + +/** + * \name The two types of endianness + */ +/* @{ */ +#define SDL_LIL_ENDIAN 1234 +#define SDL_BIG_ENDIAN 4321 +/* @} */ + +#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ +#ifdef __linux__ +#include +#define SDL_BYTEORDER __BYTE_ORDER +#else /* __linux__ */ +#if defined(__hppa__) || \ + defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ + (defined(__MIPS__) && defined(__MISPEB__)) || \ + defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ + defined(__sparc__) +#define SDL_BYTEORDER SDL_BIG_ENDIAN +#else +#define SDL_BYTEORDER SDL_LIL_ENDIAN +#endif +#endif /* __linux__ */ +#endif /* !SDL_BYTEORDER */ + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_endian.h + */ +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0": "=q"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + int result; + + __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x)); + return (Uint16)result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc"); + return x; +} +#else +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + return SDL_static_cast(Uint16, ((x << 8) | (x >> 8))); +} +#endif + +#if defined(__GNUC__) && defined(__i386__) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("bswap %0": "=r"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("bswapl %0": "=r"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + Uint32 result; + + __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x)); + __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x)); + __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x)); + return result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc"); + return x; +} +#else +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) | + ((x >> 8) & 0x0000FF00) | (x >> 24))); +} +#endif + +#if defined(__GNUC__) && defined(__i386__) +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) +{ + union + { + struct + { + Uint32 a, b; + } s; + Uint64 u; + } v; + v.u = x; + __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a), + "1"(v.s. + b)); + return v.u; +} +#elif defined(__GNUC__) && defined(__x86_64__) +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) +{ + __asm__("bswapq %0": "=r"(x):"0"(x)); + return x; +} +#else +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) +{ + Uint32 hi, lo; + + /* Separate into high and low 32-bit values and swap them */ + lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x >>= 32; + hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x = SDL_Swap32(lo); + x <<= 32; + x |= SDL_Swap32(hi); + return (x); +} +#endif + + +SDL_FORCE_INLINE float +SDL_SwapFloat(float x) +{ + union + { + float f; + Uint32 ui32; + } swapper; + swapper.f = x; + swapper.ui32 = SDL_Swap32(swapper.ui32); + return swapper.f; +} + + +/** + * \name Swap to native + * Byteswap item from the specified endianness to the native endianness. + */ +/* @{ */ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define SDL_SwapLE16(X) (X) +#define SDL_SwapLE32(X) (X) +#define SDL_SwapLE64(X) (X) +#define SDL_SwapFloatLE(X) (X) +#define SDL_SwapBE16(X) SDL_Swap16(X) +#define SDL_SwapBE32(X) SDL_Swap32(X) +#define SDL_SwapBE64(X) SDL_Swap64(X) +#define SDL_SwapFloatBE(X) SDL_SwapFloat(X) +#else +#define SDL_SwapLE16(X) SDL_Swap16(X) +#define SDL_SwapLE32(X) SDL_Swap32(X) +#define SDL_SwapLE64(X) SDL_Swap64(X) +#define SDL_SwapFloatLE(X) SDL_SwapFloat(X) +#define SDL_SwapBE16(X) (X) +#define SDL_SwapBE32(X) (X) +#define SDL_SwapBE64(X) (X) +#define SDL_SwapFloatBE(X) (X) +#endif +/* @} *//* Swap to native */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_endian_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_error.h b/Src/Decoder_H264_ALL/include/SDL/SDL_error.h new file mode 100644 index 0000000..2f3b4b5 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_error.h @@ -0,0 +1,76 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_error.h + * + * Simple error message routines for SDL. + */ + +#ifndef _SDL_error_h +#define _SDL_error_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Public functions */ +/* SDL_SetError() unconditionally returns -1. */ +extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); +extern DECLSPEC const char *SDLCALL SDL_GetError(void); +extern DECLSPEC void SDLCALL SDL_ClearError(void); + +/** + * \name Internal error functions + * + * \internal + * Private error reporting function - used internally. + */ +/* @{ */ +#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) +#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) +#define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) +typedef enum +{ + SDL_ENOMEM, + SDL_EFREAD, + SDL_EFWRITE, + SDL_EFSEEK, + SDL_UNSUPPORTED, + SDL_LASTERROR +} SDL_errorcode; +/* SDL_Error() unconditionally returns -1. */ +extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); +/* @} *//* Internal error functions */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_error_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_events.h b/Src/Decoder_H264_ALL/include/SDL/SDL_events.h new file mode 100644 index 0000000..1437f4c --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_events.h @@ -0,0 +1,750 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_events.h + * + * Include file for SDL event handling. + */ + +#ifndef _SDL_events_h +#define _SDL_events_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" +#include "SDL_keyboard.h" +#include "SDL_mouse.h" +#include "SDL_joystick.h" +#include "SDL_gamecontroller.h" +#include "SDL_quit.h" +#include "SDL_gesture.h" +#include "SDL_touch.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* General keyboard/mouse state definitions */ +#define SDL_RELEASED 0 +#define SDL_PRESSED 1 + +/** + * \brief The types of events that can be delivered. + */ +typedef enum +{ + SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */ + + /* Application events */ + SDL_QUIT = 0x100, /**< User-requested quit */ + + /* These application events have special meaning on iOS, see README-ios.md for details */ + SDL_APP_TERMINATING, /**< The application is being terminated by the OS + Called on iOS in applicationWillTerminate() + Called on Android in onDestroy() + */ + SDL_APP_LOWMEMORY, /**< The application is low on memory, free memory if possible. + Called on iOS in applicationDidReceiveMemoryWarning() + Called on Android in onLowMemory() + */ + SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background + Called on iOS in applicationWillResignActive() + Called on Android in onPause() + */ + SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time + Called on iOS in applicationDidEnterBackground() + Called on Android in onPause() + */ + SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground + Called on iOS in applicationWillEnterForeground() + Called on Android in onResume() + */ + SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive + Called on iOS in applicationDidBecomeActive() + Called on Android in onResume() + */ + + /* Window events */ + SDL_WINDOWEVENT = 0x200, /**< Window state change */ + SDL_SYSWMEVENT, /**< System specific event */ + + /* Keyboard events */ + SDL_KEYDOWN = 0x300, /**< Key pressed */ + SDL_KEYUP, /**< Key released */ + SDL_TEXTEDITING, /**< Keyboard text editing (composition) */ + SDL_TEXTINPUT, /**< Keyboard text input */ + SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an + input language or keyboard layout change. + */ + + /* Mouse events */ + SDL_MOUSEMOTION = 0x400, /**< Mouse moved */ + SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ + SDL_MOUSEBUTTONUP, /**< Mouse button released */ + SDL_MOUSEWHEEL, /**< Mouse wheel motion */ + + /* Joystick events */ + SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */ + SDL_JOYBALLMOTION, /**< Joystick trackball motion */ + SDL_JOYHATMOTION, /**< Joystick hat position change */ + SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ + SDL_JOYBUTTONUP, /**< Joystick button released */ + SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */ + SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */ + + /* Game controller events */ + SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */ + SDL_CONTROLLERBUTTONDOWN, /**< Game controller button pressed */ + SDL_CONTROLLERBUTTONUP, /**< Game controller button released */ + SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */ + SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */ + SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */ + + /* Touch events */ + SDL_FINGERDOWN = 0x700, + SDL_FINGERUP, + SDL_FINGERMOTION, + + /* Gesture events */ + SDL_DOLLARGESTURE = 0x800, + SDL_DOLLARRECORD, + SDL_MULTIGESTURE, + + /* Clipboard events */ + SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */ + + /* Drag and drop events */ + SDL_DROPFILE = 0x1000, /**< The system requests a file open */ + + /* Audio hotplug events */ + SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */ + SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */ + + /* Render events */ + SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */ + SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */ + + /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use, + * and should be allocated with SDL_RegisterEvents() + */ + SDL_USEREVENT = 0x8000, + + /** + * This last event is only for bounding internal arrays + */ + SDL_LASTEVENT = 0xFFFF +} SDL_EventType; + +/** + * \brief Fields shared by every event + */ +typedef struct SDL_CommonEvent +{ + Uint32 type; + Uint32 timestamp; +} SDL_CommonEvent; + +/** + * \brief Window state change event data (event.window.*) + */ +typedef struct SDL_WindowEvent +{ + Uint32 type; /**< ::SDL_WINDOWEVENT */ + Uint32 timestamp; + Uint32 windowID; /**< The associated window */ + Uint8 event; /**< ::SDL_WindowEventID */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint32 data1; /**< event dependent data */ + Sint32 data2; /**< event dependent data */ +} SDL_WindowEvent; + +/** + * \brief Keyboard button event structure (event.key.*) + */ +typedef struct SDL_KeyboardEvent +{ + Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ + Uint32 timestamp; + Uint32 windowID; /**< The window with keyboard focus, if any */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 repeat; /**< Non-zero if this is a key repeat */ + Uint8 padding2; + Uint8 padding3; + SDL_Keysym keysym; /**< The key that was pressed or released */ +} SDL_KeyboardEvent; + +#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) +/** + * \brief Keyboard text editing event structure (event.edit.*) + */ +typedef struct SDL_TextEditingEvent +{ + Uint32 type; /**< ::SDL_TEXTEDITING */ + Uint32 timestamp; + Uint32 windowID; /**< The window with keyboard focus, if any */ + char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */ + Sint32 start; /**< The start cursor of selected editing text */ + Sint32 length; /**< The length of selected editing text */ +} SDL_TextEditingEvent; + + +#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32) +/** + * \brief Keyboard text input event structure (event.text.*) + */ +typedef struct SDL_TextInputEvent +{ + Uint32 type; /**< ::SDL_TEXTINPUT */ + Uint32 timestamp; + Uint32 windowID; /**< The window with keyboard focus, if any */ + char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */ +} SDL_TextInputEvent; + +/** + * \brief Mouse motion event structure (event.motion.*) + */ +typedef struct SDL_MouseMotionEvent +{ + Uint32 type; /**< ::SDL_MOUSEMOTION */ + Uint32 timestamp; + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Uint32 state; /**< The current button state */ + Sint32 x; /**< X coordinate, relative to window */ + Sint32 y; /**< Y coordinate, relative to window */ + Sint32 xrel; /**< The relative motion in the X direction */ + Sint32 yrel; /**< The relative motion in the Y direction */ +} SDL_MouseMotionEvent; + +/** + * \brief Mouse button event structure (event.button.*) + */ +typedef struct SDL_MouseButtonEvent +{ + Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */ + Uint32 timestamp; + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Uint8 button; /**< The mouse button index */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */ + Uint8 padding1; + Sint32 x; /**< X coordinate, relative to window */ + Sint32 y; /**< Y coordinate, relative to window */ +} SDL_MouseButtonEvent; + +/** + * \brief Mouse wheel event structure (event.wheel.*) + */ +typedef struct SDL_MouseWheelEvent +{ + Uint32 type; /**< ::SDL_MOUSEWHEEL */ + Uint32 timestamp; + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */ + Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */ + Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */ +} SDL_MouseWheelEvent; + +/** + * \brief Joystick axis motion event structure (event.jaxis.*) + */ +typedef struct SDL_JoyAxisEvent +{ + Uint32 type; /**< ::SDL_JOYAXISMOTION */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 axis; /**< The joystick axis index */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 value; /**< The axis value (range: -32768 to 32767) */ + Uint16 padding4; +} SDL_JoyAxisEvent; + +/** + * \brief Joystick trackball motion event structure (event.jball.*) + */ +typedef struct SDL_JoyBallEvent +{ + Uint32 type; /**< ::SDL_JOYBALLMOTION */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 ball; /**< The joystick trackball index */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 xrel; /**< The relative motion in the X direction */ + Sint16 yrel; /**< The relative motion in the Y direction */ +} SDL_JoyBallEvent; + +/** + * \brief Joystick hat position change event structure (event.jhat.*) + */ +typedef struct SDL_JoyHatEvent +{ + Uint32 type; /**< ::SDL_JOYHATMOTION */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 hat; /**< The joystick hat index */ + Uint8 value; /**< The hat position value. + * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP + * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT + * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN + * + * Note that zero means the POV is centered. + */ + Uint8 padding1; + Uint8 padding2; +} SDL_JoyHatEvent; + +/** + * \brief Joystick button event structure (event.jbutton.*) + */ +typedef struct SDL_JoyButtonEvent +{ + Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 button; /**< The joystick button index */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 padding1; + Uint8 padding2; +} SDL_JoyButtonEvent; + +/** + * \brief Joystick device event structure (event.jdevice.*) + */ +typedef struct SDL_JoyDeviceEvent +{ + Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */ + Uint32 timestamp; + Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */ +} SDL_JoyDeviceEvent; + + +/** + * \brief Game controller axis motion event structure (event.caxis.*) + */ +typedef struct SDL_ControllerAxisEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 value; /**< The axis value (range: -32768 to 32767) */ + Uint16 padding4; +} SDL_ControllerAxisEvent; + + +/** + * \brief Game controller button event structure (event.cbutton.*) + */ +typedef struct SDL_ControllerButtonEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 button; /**< The controller button (SDL_GameControllerButton) */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 padding1; + Uint8 padding2; +} SDL_ControllerButtonEvent; + + +/** + * \brief Controller device event structure (event.cdevice.*) + */ +typedef struct SDL_ControllerDeviceEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */ + Uint32 timestamp; + Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ +} SDL_ControllerDeviceEvent; + +/** + * \brief Audio device event structure (event.adevice.*) + */ +typedef struct SDL_AudioDeviceEvent +{ + Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */ + Uint32 timestamp; + Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */ + Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; +} SDL_AudioDeviceEvent; + + +/** + * \brief Touch finger event structure (event.tfinger.*) + */ +typedef struct SDL_TouchFingerEvent +{ + Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */ + Uint32 timestamp; + SDL_TouchID touchId; /**< The touch device id */ + SDL_FingerID fingerId; + float x; /**< Normalized in the range 0...1 */ + float y; /**< Normalized in the range 0...1 */ + float dx; /**< Normalized in the range -1...1 */ + float dy; /**< Normalized in the range -1...1 */ + float pressure; /**< Normalized in the range 0...1 */ +} SDL_TouchFingerEvent; + + +/** + * \brief Multiple Finger Gesture Event (event.mgesture.*) + */ +typedef struct SDL_MultiGestureEvent +{ + Uint32 type; /**< ::SDL_MULTIGESTURE */ + Uint32 timestamp; + SDL_TouchID touchId; /**< The touch device index */ + float dTheta; + float dDist; + float x; + float y; + Uint16 numFingers; + Uint16 padding; +} SDL_MultiGestureEvent; + + +/** + * \brief Dollar Gesture Event (event.dgesture.*) + */ +typedef struct SDL_DollarGestureEvent +{ + Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */ + Uint32 timestamp; + SDL_TouchID touchId; /**< The touch device id */ + SDL_GestureID gestureId; + Uint32 numFingers; + float error; + float x; /**< Normalized center of gesture */ + float y; /**< Normalized center of gesture */ +} SDL_DollarGestureEvent; + + +/** + * \brief An event used to request a file open by the system (event.drop.*) + * This event is enabled by default, you can disable it with SDL_EventState(). + * \note If this event is enabled, you must free the filename in the event. + */ +typedef struct SDL_DropEvent +{ + Uint32 type; /**< ::SDL_DROPFILE */ + Uint32 timestamp; + char *file; /**< The file name, which should be freed with SDL_free() */ +} SDL_DropEvent; + + +/** + * \brief The "quit requested" event + */ +typedef struct SDL_QuitEvent +{ + Uint32 type; /**< ::SDL_QUIT */ + Uint32 timestamp; +} SDL_QuitEvent; + +/** + * \brief OS Specific event + */ +typedef struct SDL_OSEvent +{ + Uint32 type; /**< ::SDL_QUIT */ + Uint32 timestamp; +} SDL_OSEvent; + +/** + * \brief A user-defined event type (event.user.*) + */ +typedef struct SDL_UserEvent +{ + Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */ + Uint32 timestamp; + Uint32 windowID; /**< The associated window if any */ + Sint32 code; /**< User defined event code */ + void *data1; /**< User defined data pointer */ + void *data2; /**< User defined data pointer */ +} SDL_UserEvent; + + +struct SDL_SysWMmsg; +typedef struct SDL_SysWMmsg SDL_SysWMmsg; + +/** + * \brief A video driver dependent system event (event.syswm.*) + * This event is disabled by default, you can enable it with SDL_EventState() + * + * \note If you want to use this event, you should include SDL_syswm.h. + */ +typedef struct SDL_SysWMEvent +{ + Uint32 type; /**< ::SDL_SYSWMEVENT */ + Uint32 timestamp; + SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ +} SDL_SysWMEvent; + +/** + * \brief General event structure + */ +typedef union SDL_Event +{ + Uint32 type; /**< Event type, shared with all events */ + SDL_CommonEvent common; /**< Common event data */ + SDL_WindowEvent window; /**< Window event data */ + SDL_KeyboardEvent key; /**< Keyboard event data */ + SDL_TextEditingEvent edit; /**< Text editing event data */ + SDL_TextInputEvent text; /**< Text input event data */ + SDL_MouseMotionEvent motion; /**< Mouse motion event data */ + SDL_MouseButtonEvent button; /**< Mouse button event data */ + SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ + SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ + SDL_JoyBallEvent jball; /**< Joystick ball event data */ + SDL_JoyHatEvent jhat; /**< Joystick hat event data */ + SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ + SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ + SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ + SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ + SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ + SDL_AudioDeviceEvent adevice; /**< Audio device event data */ + SDL_QuitEvent quit; /**< Quit request event data */ + SDL_UserEvent user; /**< Custom event data */ + SDL_SysWMEvent syswm; /**< System dependent window event data */ + SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ + SDL_MultiGestureEvent mgesture; /**< Gesture event data */ + SDL_DollarGestureEvent dgesture; /**< Gesture event data */ + SDL_DropEvent drop; /**< Drag and drop event data */ + + /* This is necessary for ABI compatibility between Visual C++ and GCC + Visual C++ will respect the push pack pragma and use 52 bytes for + this structure, and GCC will use the alignment of the largest datatype + within the union, which is 8 bytes. + + So... we'll add padding to force the size to be 56 bytes for both. + */ + Uint8 padding[56]; +} SDL_Event; + + +/* Function prototypes */ + +/** + * Pumps the event loop, gathering events from the input devices. + * + * This function updates the event queue and internal input device state. + * + * This should only be run in the thread that sets the video mode. + */ +extern DECLSPEC void SDLCALL SDL_PumpEvents(void); + +/* @{ */ +typedef enum +{ + SDL_ADDEVENT, + SDL_PEEKEVENT, + SDL_GETEVENT +} SDL_eventaction; + +/** + * Checks the event queue for messages and optionally returns them. + * + * If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to + * the back of the event queue. + * + * If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front + * of the event queue, within the specified minimum and maximum type, + * will be returned and will not be removed from the queue. + * + * If \c action is ::SDL_GETEVENT, up to \c numevents events at the front + * of the event queue, within the specified minimum and maximum type, + * will be returned and will be removed from the queue. + * + * \return The number of events actually stored, or -1 if there was an error. + * + * This function is thread-safe. + */ +extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents, + SDL_eventaction action, + Uint32 minType, Uint32 maxType); +/* @} */ + +/** + * Checks to see if certain event types are in the event queue. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type); +extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType); + +/** + * This function clears events from the event queue + * This function only affects currently queued events. If you want to make + * sure that all pending OS events are flushed, you can call SDL_PumpEvents() + * on the main thread immediately before the flush call. + */ +extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type); +extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType); + +/** + * \brief Polls for currently pending events. + * + * \return 1 if there are any pending events, or 0 if there are none available. + * + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); + +/** + * \brief Waits indefinitely for the next available event. + * + * \return 1, or 0 if there was an error while waiting for events. + * + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event); + +/** + * \brief Waits until the specified timeout (in milliseconds) for the next + * available event. + * + * \return 1, or 0 if there was an error while waiting for events. + * + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. + * \param timeout The timeout (in milliseconds) to wait for next event. + */ +extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event, + int timeout); + +/** + * \brief Add an event to the event queue. + * + * \return 1 on success, 0 if the event was filtered, or -1 if the event queue + * was full or there was some other error. + */ +extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event); + +typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); + +/** + * Sets up a filter to process all events before they change internal state and + * are posted to the internal event queue. + * + * The filter is prototyped as: + * \code + * int SDL_EventFilter(void *userdata, SDL_Event * event); + * \endcode + * + * If the filter returns 1, then the event will be added to the internal queue. + * If it returns 0, then the event will be dropped from the queue, but the + * internal state will still be updated. This allows selective filtering of + * dynamically arriving events. + * + * \warning Be very careful of what you do in the event filter function, as + * it may run in a different thread! + * + * There is one caveat when dealing with the ::SDL_QuitEvent event type. The + * event filter is only called when the window manager desires to close the + * application window. If the event filter returns 1, then the window will + * be closed, otherwise the window will remain open if possible. + * + * If the quit event is generated by an interrupt signal, it will bypass the + * internal queue and be delivered to the application at the next event poll. + */ +extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, + void *userdata); + +/** + * Return the current event filter - can be used to "chain" filters. + * If there is no event filter set, this function returns SDL_FALSE. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter, + void **userdata); + +/** + * Add a function which is called when an event is added to the queue. + */ +extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, + void *userdata); + +/** + * Remove an event watch function added with SDL_AddEventWatch() + */ +extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, + void *userdata); + +/** + * Run the filter function on the current event queue, removing any + * events for which the filter returns 0. + */ +extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, + void *userdata); + +/* @{ */ +#define SDL_QUERY -1 +#define SDL_IGNORE 0 +#define SDL_DISABLE 0 +#define SDL_ENABLE 1 + +/** + * This function allows you to set the state of processing certain events. + * - If \c state is set to ::SDL_IGNORE, that event will be automatically + * dropped from the event queue and will not event be filtered. + * - If \c state is set to ::SDL_ENABLE, that event will be processed + * normally. + * - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the + * current processing state of the specified event. + */ +extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state); +/* @} */ +#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY) + +/** + * This function allocates a set of user-defined events, and returns + * the beginning event number for that set of events. + * + * If there aren't enough user-defined events left, this function + * returns (Uint32)-1 + */ +extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_events_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_filesystem.h b/Src/Decoder_H264_ALL/include/SDL/SDL_filesystem.h new file mode 100644 index 0000000..02999ed --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_filesystem.h @@ -0,0 +1,136 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_filesystem.h + * + * \brief Include file for filesystem SDL API functions + */ + +#ifndef _SDL_filesystem_h +#define _SDL_filesystem_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Get the path where the application resides. + * + * Get the "base path". This is the directory where the application was run + * from, which is probably the installation directory, and may or may not + * be the process's current working directory. + * + * This returns an absolute path in UTF-8 encoding, and is guaranteed to + * end with a path separator ('\\' on Windows, '/' most other places). + * + * The pointer returned by this function is owned by you. Please call + * SDL_free() on the pointer when you are done with it, or it will be a + * memory leak. This is not necessarily a fast call, though, so you should + * call this once near startup and save the string if you need it. + * + * Some platforms can't determine the application's path, and on other + * platforms, this might be meaningless. In such cases, this function will + * return NULL. + * + * \return String of base dir in UTF-8 encoding, or NULL on error. + * + * \sa SDL_GetPrefPath + */ +extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); + +/** + * \brief Get the user-and-app-specific path where files can be written. + * + * Get the "pref dir". This is meant to be where users can write personal + * files (preferences and save games, etc) that are specific to your + * application. This directory is unique per user, per application. + * + * This function will decide the appropriate location in the native filesystem, + * create the directory if necessary, and return a string of the absolute + * path to the directory in UTF-8 encoding. + * + * On Windows, the string might look like: + * "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\" + * + * On Linux, the string might look like: + * "/home/bob/.local/share/My Program Name/" + * + * On Mac OS X, the string might look like: + * "/Users/bob/Library/Application Support/My Program Name/" + * + * (etc.) + * + * You specify the name of your organization (if it's not a real organization, + * your name or an Internet domain you own might do) and the name of your + * application. These should be untranslated proper names. + * + * Both the org and app strings may become part of a directory name, so + * please follow these rules: + * + * - Try to use the same org string (including case-sensitivity) for + * all your applications that use this function. + * - Always use a unique app string for each one, and make sure it never + * changes for an app once you've decided on it. + * - Unicode characters are legal, as long as it's UTF-8 encoded, but... + * - ...only use letters, numbers, and spaces. Avoid punctuation like + * "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. + * + * This returns an absolute path in UTF-8 encoding, and is guaranteed to + * end with a path separator ('\\' on Windows, '/' most other places). + * + * The pointer returned by this function is owned by you. Please call + * SDL_free() on the pointer when you are done with it, or it will be a + * memory leak. This is not necessarily a fast call, though, so you should + * call this once near startup and save the string if you need it. + * + * You should assume the path returned by this function is the only safe + * place to write files (and that SDL_GetBasePath(), while it might be + * writable, or even the parent of the returned path, aren't where you + * should be writing things). + * + * Some platforms can't determine the pref path, and on other + * platforms, this might be meaningless. In such cases, this function will + * return NULL. + * + * \param org The name of your organization. + * \param app The name of your application. + * \return UTF-8 string of user dir in platform-dependent notation. NULL + * if there's a problem (creating directory failed, etc). + * + * \sa SDL_GetBasePath + */ +extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_filesystem_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_gamecontroller.h b/Src/Decoder_H264_ALL/include/SDL/SDL_gamecontroller.h new file mode 100644 index 0000000..42087ee --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_gamecontroller.h @@ -0,0 +1,323 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_gamecontroller.h + * + * Include file for SDL game controller event handling + */ + +#ifndef _SDL_gamecontroller_h +#define _SDL_gamecontroller_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_rwops.h" +#include "SDL_joystick.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_gamecontroller.h + * + * In order to use these functions, SDL_Init() must have been called + * with the ::SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system + * for game controllers, and load appropriate drivers. + * + * If you would like to receive controller updates while the application + * is in the background, you should set the following hint before calling + * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS + */ + +/* The gamecontroller structure used to identify an SDL game controller */ +struct _SDL_GameController; +typedef struct _SDL_GameController SDL_GameController; + + +typedef enum +{ + SDL_CONTROLLER_BINDTYPE_NONE = 0, + SDL_CONTROLLER_BINDTYPE_BUTTON, + SDL_CONTROLLER_BINDTYPE_AXIS, + SDL_CONTROLLER_BINDTYPE_HAT +} SDL_GameControllerBindType; + +/** + * Get the SDL joystick layer binding for this controller button/axis mapping + */ +typedef struct SDL_GameControllerButtonBind +{ + SDL_GameControllerBindType bindType; + union + { + int button; + int axis; + struct { + int hat; + int hat_mask; + } hat; + } value; + +} SDL_GameControllerButtonBind; + + +/** + * To count the number of game controllers in the system for the following: + * int nJoysticks = SDL_NumJoysticks(); + * int nGameControllers = 0; + * for ( int i = 0; i < nJoysticks; i++ ) { + * if ( SDL_IsGameController(i) ) { + * nGameControllers++; + * } + * } + * + * Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is: + * guid,name,mappings + * + * Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones. + * Under Windows there is a reserved GUID of "xinput" that covers any XInput devices. + * The mapping format for joystick is: + * bX - a joystick button, index X + * hX.Y - hat X with value Y + * aX - axis X of the joystick + * Buttons can be used as a controller axis and vice versa. + * + * This string shows an example of a valid mapping for a controller + * "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7", + * + */ + +/** + * Load a set of mappings from a seekable SDL data stream (memory or file), filtered by the current SDL_GetPlatform() + * A community sourced database of controllers is available at https://raw.github.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt + * + * If \c freerw is non-zero, the stream will be closed after being read. + * + * \return number of mappings added, -1 on error + */ +extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW( SDL_RWops * rw, int freerw ); + +/** + * Load a set of mappings from a file, filtered by the current SDL_GetPlatform() + * + * Convenience macro. + */ +#define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1) + +/** + * Add or update an existing mapping configuration + * + * \return 1 if mapping is added, 0 if updated, -1 on error + */ +extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping( const char* mappingString ); + +/** + * Get a mapping string for a GUID + * + * \return the mapping string. Must be freed with SDL_free. Returns NULL if no mapping is available + */ +extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID( SDL_JoystickGUID guid ); + +/** + * Get a mapping string for an open GameController + * + * \return the mapping string. Must be freed with SDL_free. Returns NULL if no mapping is available + */ +extern DECLSPEC char * SDLCALL SDL_GameControllerMapping( SDL_GameController * gamecontroller ); + +/** + * Is the joystick on this index supported by the game controller interface? + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index); + + +/** + * Get the implementation dependent name of a game controller. + * This can be called before any controllers are opened. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index); + +/** + * Open a game controller for use. + * The index passed as an argument refers to the N'th game controller on the system. + * This index is not the value which will identify this controller in future + * controller events. The joystick's instance id (::SDL_JoystickID) will be + * used there instead. + * + * \return A controller identifier, or NULL if an error occurred. + */ +extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index); + +/** + * Return the SDL_GameController associated with an instance id. + */ +extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid); + +/** + * Return the name for this currently opened controller + */ +extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller); + +/** + * Returns SDL_TRUE if the controller has been opened and currently connected, + * or SDL_FALSE if it has not. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller); + +/** + * Get the underlying joystick object used by a controller + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller); + +/** + * Enable/disable controller event polling. + * + * If controller events are disabled, you must call SDL_GameControllerUpdate() + * yourself and check the state of the controller when you want controller + * information. + * + * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state); + +/** + * Update the current state of the open game controllers. + * + * This is called automatically by the event loop if any game controller + * events are enabled. + */ +extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void); + + +/** + * The list of axes available from a controller + */ +typedef enum +{ + SDL_CONTROLLER_AXIS_INVALID = -1, + SDL_CONTROLLER_AXIS_LEFTX, + SDL_CONTROLLER_AXIS_LEFTY, + SDL_CONTROLLER_AXIS_RIGHTX, + SDL_CONTROLLER_AXIS_RIGHTY, + SDL_CONTROLLER_AXIS_TRIGGERLEFT, + SDL_CONTROLLER_AXIS_TRIGGERRIGHT, + SDL_CONTROLLER_AXIS_MAX +} SDL_GameControllerAxis; + +/** + * turn this string into a axis mapping + */ +extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString); + +/** + * turn this axis enum into a string mapping + */ +extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis); + +/** + * Get the SDL joystick layer binding for this controller button mapping + */ +extern DECLSPEC SDL_GameControllerButtonBind SDLCALL +SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, + SDL_GameControllerAxis axis); + +/** + * Get the current state of an axis control on a game controller. + * + * The state is a value ranging from -32768 to 32767 (except for the triggers, + * which range from 0 to 32767). + * + * The axis indices start at index 0. + */ +extern DECLSPEC Sint16 SDLCALL +SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, + SDL_GameControllerAxis axis); + +/** + * The list of buttons available from a controller + */ +typedef enum +{ + SDL_CONTROLLER_BUTTON_INVALID = -1, + SDL_CONTROLLER_BUTTON_A, + SDL_CONTROLLER_BUTTON_B, + SDL_CONTROLLER_BUTTON_X, + SDL_CONTROLLER_BUTTON_Y, + SDL_CONTROLLER_BUTTON_BACK, + SDL_CONTROLLER_BUTTON_GUIDE, + SDL_CONTROLLER_BUTTON_START, + SDL_CONTROLLER_BUTTON_LEFTSTICK, + SDL_CONTROLLER_BUTTON_RIGHTSTICK, + SDL_CONTROLLER_BUTTON_LEFTSHOULDER, + SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, + SDL_CONTROLLER_BUTTON_DPAD_UP, + SDL_CONTROLLER_BUTTON_DPAD_DOWN, + SDL_CONTROLLER_BUTTON_DPAD_LEFT, + SDL_CONTROLLER_BUTTON_DPAD_RIGHT, + SDL_CONTROLLER_BUTTON_MAX +} SDL_GameControllerButton; + +/** + * turn this string into a button mapping + */ +extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *pchString); + +/** + * turn this button enum into a string mapping + */ +extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button); + +/** + * Get the SDL joystick layer binding for this controller button mapping + */ +extern DECLSPEC SDL_GameControllerButtonBind SDLCALL +SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, + SDL_GameControllerButton button); + + +/** + * Get the current state of a button on a game controller. + * + * The button indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller, + SDL_GameControllerButton button); + +/** + * Close a controller previously opened with SDL_GameControllerOpen(). + */ +extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_gamecontroller_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_gesture.h b/Src/Decoder_H264_ALL/include/SDL/SDL_gesture.h new file mode 100644 index 0000000..3c29ca7 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_gesture.h @@ -0,0 +1,87 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_gesture.h + * + * Include file for SDL gesture event handling. + */ + +#ifndef _SDL_gesture_h +#define _SDL_gesture_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "SDL_touch.h" + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef Sint64 SDL_GestureID; + +/* Function prototypes */ + +/** + * \brief Begin Recording a gesture on the specified touch, or all touches (-1) + * + * + */ +extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); + + +/** + * \brief Save all currently loaded Dollar Gesture templates + * + * + */ +extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); + +/** + * \brief Save a currently loaded Dollar Gesture template + * + * + */ +extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); + + +/** + * \brief Load Dollar Gesture templates from a file + * + * + */ +extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_gesture_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_haptic.h b/Src/Decoder_H264_ALL/include/SDL/SDL_haptic.h new file mode 100644 index 0000000..b36d78b --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_haptic.h @@ -0,0 +1,1223 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_haptic.h + * + * \brief The SDL Haptic subsystem allows you to control haptic (force feedback) + * devices. + * + * The basic usage is as follows: + * - Initialize the Subsystem (::SDL_INIT_HAPTIC). + * - Open a Haptic Device. + * - SDL_HapticOpen() to open from index. + * - SDL_HapticOpenFromJoystick() to open from an existing joystick. + * - Create an effect (::SDL_HapticEffect). + * - Upload the effect with SDL_HapticNewEffect(). + * - Run the effect with SDL_HapticRunEffect(). + * - (optional) Free the effect with SDL_HapticDestroyEffect(). + * - Close the haptic device with SDL_HapticClose(). + * + * \par Simple rumble example: + * \code + * SDL_Haptic *haptic; + * + * // Open the device + * haptic = SDL_HapticOpen( 0 ); + * if (haptic == NULL) + * return -1; + * + * // Initialize simple rumble + * if (SDL_HapticRumbleInit( haptic ) != 0) + * return -1; + * + * // Play effect at 50% strength for 2 seconds + * if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0) + * return -1; + * SDL_Delay( 2000 ); + * + * // Clean up + * SDL_HapticClose( haptic ); + * \endcode + * + * \par Complete example: + * \code + * int test_haptic( SDL_Joystick * joystick ) { + * SDL_Haptic *haptic; + * SDL_HapticEffect effect; + * int effect_id; + * + * // Open the device + * haptic = SDL_HapticOpenFromJoystick( joystick ); + * if (haptic == NULL) return -1; // Most likely joystick isn't haptic + * + * // See if it can do sine waves + * if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) { + * SDL_HapticClose(haptic); // No sine effect + * return -1; + * } + * + * // Create the effect + * memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default + * effect.type = SDL_HAPTIC_SINE; + * effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates + * effect.periodic.direction.dir[0] = 18000; // Force comes from south + * effect.periodic.period = 1000; // 1000 ms + * effect.periodic.magnitude = 20000; // 20000/32767 strength + * effect.periodic.length = 5000; // 5 seconds long + * effect.periodic.attack_length = 1000; // Takes 1 second to get max strength + * effect.periodic.fade_length = 1000; // Takes 1 second to fade away + * + * // Upload the effect + * effect_id = SDL_HapticNewEffect( haptic, &effect ); + * + * // Test the effect + * SDL_HapticRunEffect( haptic, effect_id, 1 ); + * SDL_Delay( 5000); // Wait for the effect to finish + * + * // We destroy the effect, although closing the device also does this + * SDL_HapticDestroyEffect( haptic, effect_id ); + * + * // Close the device + * SDL_HapticClose(haptic); + * + * return 0; // Success + * } + * \endcode + */ + +#ifndef _SDL_haptic_h +#define _SDL_haptic_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_joystick.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * \typedef SDL_Haptic + * + * \brief The haptic structure used to identify an SDL haptic. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticOpenFromJoystick + * \sa SDL_HapticClose + */ +struct _SDL_Haptic; +typedef struct _SDL_Haptic SDL_Haptic; + + +/** + * \name Haptic features + * + * Different haptic features a device can have. + */ +/* @{ */ + +/** + * \name Haptic effects + */ +/* @{ */ + +/** + * \brief Constant effect supported. + * + * Constant haptic effect. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_CONSTANT (1<<0) + +/** + * \brief Sine wave effect supported. + * + * Periodic haptic effect that simulates sine waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SINE (1<<1) + +/** + * \brief Left/Right effect supported. + * + * Haptic effect for direct control over high/low frequency motors. + * + * \sa SDL_HapticLeftRight + * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry, + * we ran out of bits, and this is important for XInput devices. + */ +#define SDL_HAPTIC_LEFTRIGHT (1<<2) + +/* !!! FIXME: put this back when we have more bits in 2.1 */ +/* #define SDL_HAPTIC_SQUARE (1<<2) */ + +/** + * \brief Triangle wave effect supported. + * + * Periodic haptic effect that simulates triangular waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_TRIANGLE (1<<3) + +/** + * \brief Sawtoothup wave effect supported. + * + * Periodic haptic effect that simulates saw tooth up waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SAWTOOTHUP (1<<4) + +/** + * \brief Sawtoothdown wave effect supported. + * + * Periodic haptic effect that simulates saw tooth down waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SAWTOOTHDOWN (1<<5) + +/** + * \brief Ramp effect supported. + * + * Ramp haptic effect. + * + * \sa SDL_HapticRamp + */ +#define SDL_HAPTIC_RAMP (1<<6) + +/** + * \brief Spring effect supported - uses axes position. + * + * Condition haptic effect that simulates a spring. Effect is based on the + * axes position. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_SPRING (1<<7) + +/** + * \brief Damper effect supported - uses axes velocity. + * + * Condition haptic effect that simulates dampening. Effect is based on the + * axes velocity. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_DAMPER (1<<8) + +/** + * \brief Inertia effect supported - uses axes acceleration. + * + * Condition haptic effect that simulates inertia. Effect is based on the axes + * acceleration. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_INERTIA (1<<9) + +/** + * \brief Friction effect supported - uses axes movement. + * + * Condition haptic effect that simulates friction. Effect is based on the + * axes movement. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_FRICTION (1<<10) + +/** + * \brief Custom effect is supported. + * + * User defined custom haptic effect. + */ +#define SDL_HAPTIC_CUSTOM (1<<11) + +/* @} *//* Haptic effects */ + +/* These last few are features the device has, not effects */ + +/** + * \brief Device can set global gain. + * + * Device supports setting the global gain. + * + * \sa SDL_HapticSetGain + */ +#define SDL_HAPTIC_GAIN (1<<12) + +/** + * \brief Device can set autocenter. + * + * Device supports setting autocenter. + * + * \sa SDL_HapticSetAutocenter + */ +#define SDL_HAPTIC_AUTOCENTER (1<<13) + +/** + * \brief Device can be queried for effect status. + * + * Device can be queried for effect status. + * + * \sa SDL_HapticGetEffectStatus + */ +#define SDL_HAPTIC_STATUS (1<<14) + +/** + * \brief Device can be paused. + * + * \sa SDL_HapticPause + * \sa SDL_HapticUnpause + */ +#define SDL_HAPTIC_PAUSE (1<<15) + + +/** + * \name Direction encodings + */ +/* @{ */ + +/** + * \brief Uses polar coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_POLAR 0 + +/** + * \brief Uses cartesian coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_CARTESIAN 1 + +/** + * \brief Uses spherical coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_SPHERICAL 2 + +/* @} *//* Direction encodings */ + +/* @} *//* Haptic features */ + +/* + * Misc defines. + */ + +/** + * \brief Used to play a device an infinite number of times. + * + * \sa SDL_HapticRunEffect + */ +#define SDL_HAPTIC_INFINITY 4294967295U + + +/** + * \brief Structure that represents a haptic direction. + * + * This is the direction where the force comes from, + * instead of the direction in which the force is exerted. + * + * Directions can be specified by: + * - ::SDL_HAPTIC_POLAR : Specified by polar coordinates. + * - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. + * - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates. + * + * Cardinal directions of the haptic device are relative to the positioning + * of the device. North is considered to be away from the user. + * + * The following diagram represents the cardinal directions: + * \verbatim + .--. + |__| .-------. + |=.| |.-----.| + |--| || || + | | |'-----'| + |__|~')_____(' + [ COMPUTER ] + + + North (0,-1) + ^ + | + | + (-1,0) West <----[ HAPTIC ]----> East (1,0) + | + | + v + South (0,1) + + + [ USER ] + \|||/ + (o o) + ---ooO-(_)-Ooo--- + \endverbatim + * + * If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a + * degree starting north and turning clockwise. ::SDL_HAPTIC_POLAR only uses + * the first \c dir parameter. The cardinal directions would be: + * - North: 0 (0 degrees) + * - East: 9000 (90 degrees) + * - South: 18000 (180 degrees) + * - West: 27000 (270 degrees) + * + * If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions + * (X axis, Y axis and Z axis (with 3 axes)). ::SDL_HAPTIC_CARTESIAN uses + * the first three \c dir parameters. The cardinal directions would be: + * - North: 0,-1, 0 + * - East: 1, 0, 0 + * - South: 0, 1, 0 + * - West: -1, 0, 0 + * + * The Z axis represents the height of the effect if supported, otherwise + * it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you + * can use any multiple you want, only the direction matters. + * + * If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations. + * The first two \c dir parameters are used. The \c dir parameters are as + * follows (all values are in hundredths of degrees): + * - Degrees from (1, 0) rotated towards (0, 1). + * - Degrees towards (0, 0, 1) (device needs at least 3 axes). + * + * + * Example of force coming from the south with all encodings (force coming + * from the south means the user will have to pull the stick to counteract): + * \code + * SDL_HapticDirection direction; + * + * // Cartesian directions + * direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding. + * direction.dir[0] = 0; // X position + * direction.dir[1] = 1; // Y position + * // Assuming the device has 2 axes, we don't need to specify third parameter. + * + * // Polar directions + * direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding. + * direction.dir[0] = 18000; // Polar only uses first parameter + * + * // Spherical coordinates + * direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding + * direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters. + * \endcode + * + * \sa SDL_HAPTIC_POLAR + * \sa SDL_HAPTIC_CARTESIAN + * \sa SDL_HAPTIC_SPHERICAL + * \sa SDL_HapticEffect + * \sa SDL_HapticNumAxes + */ +typedef struct SDL_HapticDirection +{ + Uint8 type; /**< The type of encoding. */ + Sint32 dir[3]; /**< The encoded direction. */ +} SDL_HapticDirection; + + +/** + * \brief A structure containing a template for a Constant effect. + * + * The struct is exclusive to the ::SDL_HAPTIC_CONSTANT effect. + * + * A constant effect applies a constant force in the specified direction + * to the joystick. + * + * \sa SDL_HAPTIC_CONSTANT + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticConstant +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_CONSTANT */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Constant */ + Sint16 level; /**< Strength of the constant effect. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticConstant; + +/** + * \brief A structure containing a template for a Periodic effect. + * + * The struct handles the following effects: + * - ::SDL_HAPTIC_SINE + * - ::SDL_HAPTIC_LEFTRIGHT + * - ::SDL_HAPTIC_TRIANGLE + * - ::SDL_HAPTIC_SAWTOOTHUP + * - ::SDL_HAPTIC_SAWTOOTHDOWN + * + * A periodic effect consists in a wave-shaped effect that repeats itself + * over time. The type determines the shape of the wave and the parameters + * determine the dimensions of the wave. + * + * Phase is given by hundredth of a degree meaning that giving the phase a value + * of 9000 will displace it 25% of its period. Here are sample values: + * - 0: No phase displacement. + * - 9000: Displaced 25% of its period. + * - 18000: Displaced 50% of its period. + * - 27000: Displaced 75% of its period. + * - 36000: Displaced 100% of its period, same as 0, but 0 is preferred. + * + * Examples: + * \verbatim + SDL_HAPTIC_SINE + __ __ __ __ + / \ / \ / \ / + / \__/ \__/ \__/ + + SDL_HAPTIC_SQUARE + __ __ __ __ __ + | | | | | | | | | | + | |__| |__| |__| |__| | + + SDL_HAPTIC_TRIANGLE + /\ /\ /\ /\ /\ + / \ / \ / \ / \ / + / \/ \/ \/ \/ + + SDL_HAPTIC_SAWTOOTHUP + /| /| /| /| /| /| /| + / | / | / | / | / | / | / | + / |/ |/ |/ |/ |/ |/ | + + SDL_HAPTIC_SAWTOOTHDOWN + \ |\ |\ |\ |\ |\ |\ | + \ | \ | \ | \ | \ | \ | \ | + \| \| \| \| \| \| \| + \endverbatim + * + * \sa SDL_HAPTIC_SINE + * \sa SDL_HAPTIC_LEFTRIGHT + * \sa SDL_HAPTIC_TRIANGLE + * \sa SDL_HAPTIC_SAWTOOTHUP + * \sa SDL_HAPTIC_SAWTOOTHDOWN + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticPeriodic +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT, + ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or + ::SDL_HAPTIC_SAWTOOTHDOWN */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Periodic */ + Uint16 period; /**< Period of the wave. */ + Sint16 magnitude; /**< Peak value; if negative, equivalent to 180 degrees extra phase shift. */ + Sint16 offset; /**< Mean value of the wave. */ + Uint16 phase; /**< Positive phase shift given by hundredth of a degree. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticPeriodic; + +/** + * \brief A structure containing a template for a Condition effect. + * + * The struct handles the following effects: + * - ::SDL_HAPTIC_SPRING: Effect based on axes position. + * - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity. + * - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration. + * - ::SDL_HAPTIC_FRICTION: Effect based on axes movement. + * + * Direction is handled by condition internals instead of a direction member. + * The condition effect specific members have three parameters. The first + * refers to the X axis, the second refers to the Y axis and the third + * refers to the Z axis. The right terms refer to the positive side of the + * axis and the left terms refer to the negative side of the axis. Please + * refer to the ::SDL_HapticDirection diagram for which side is positive and + * which is negative. + * + * \sa SDL_HapticDirection + * \sa SDL_HAPTIC_SPRING + * \sa SDL_HAPTIC_DAMPER + * \sa SDL_HAPTIC_INERTIA + * \sa SDL_HAPTIC_FRICTION + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticCondition +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER, + ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */ + SDL_HapticDirection direction; /**< Direction of the effect - Not used ATM. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Condition */ + Uint16 right_sat[3]; /**< Level when joystick is to the positive side; max 0xFFFF. */ + Uint16 left_sat[3]; /**< Level when joystick is to the negative side; max 0xFFFF. */ + Sint16 right_coeff[3]; /**< How fast to increase the force towards the positive side. */ + Sint16 left_coeff[3]; /**< How fast to increase the force towards the negative side. */ + Uint16 deadband[3]; /**< Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. */ + Sint16 center[3]; /**< Position of the dead zone. */ +} SDL_HapticCondition; + +/** + * \brief A structure containing a template for a Ramp effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_RAMP effect. + * + * The ramp effect starts at start strength and ends at end strength. + * It augments in linear fashion. If you use attack and fade with a ramp + * the effects get added to the ramp effect making the effect become + * quadratic instead of linear. + * + * \sa SDL_HAPTIC_RAMP + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticRamp +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_RAMP */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Ramp */ + Sint16 start; /**< Beginning strength level. */ + Sint16 end; /**< Ending strength level. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticRamp; + +/** + * \brief A structure containing a template for a Left/Right effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect. + * + * The Left/Right effect is used to explicitly control the large and small + * motors, commonly found in modern game controllers. One motor is high + * frequency, the other is low frequency. + * + * \sa SDL_HAPTIC_LEFTRIGHT + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticLeftRight +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_LEFTRIGHT */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + + /* Rumble */ + Uint16 large_magnitude; /**< Control of the large controller motor. */ + Uint16 small_magnitude; /**< Control of the small controller motor. */ +} SDL_HapticLeftRight; + +/** + * \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect. + * + * A custom force feedback effect is much like a periodic effect, where the + * application can define its exact shape. You will have to allocate the + * data yourself. Data should consist of channels * samples Uint16 samples. + * + * If channels is one, the effect is rotated using the defined direction. + * Otherwise it uses the samples in data for the different axes. + * + * \sa SDL_HAPTIC_CUSTOM + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticCustom +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_CUSTOM */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Custom */ + Uint8 channels; /**< Axes to use, minimum of one. */ + Uint16 period; /**< Sample periods. */ + Uint16 samples; /**< Amount of samples. */ + Uint16 *data; /**< Should contain channels*samples items. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticCustom; + +/** + * \brief The generic template for any haptic effect. + * + * All values max at 32767 (0x7FFF). Signed values also can be negative. + * Time values unless specified otherwise are in milliseconds. + * + * You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767 + * value. Neither delay, interval, attack_length nor fade_length support + * ::SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends. + * + * Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of + * ::SDL_HAPTIC_INFINITY. + * + * Button triggers may not be supported on all devices, it is advised to not + * use them if possible. Buttons start at index 1 instead of index 0 like + * the joystick. + * + * If both attack_length and fade_level are 0, the envelope is not used, + * otherwise both values are used. + * + * Common parts: + * \code + * // Replay - All effects have this + * Uint32 length; // Duration of effect (ms). + * Uint16 delay; // Delay before starting effect. + * + * // Trigger - All effects have this + * Uint16 button; // Button that triggers effect. + * Uint16 interval; // How soon before effect can be triggered again. + * + * // Envelope - All effects except condition effects have this + * Uint16 attack_length; // Duration of the attack (ms). + * Uint16 attack_level; // Level at the start of the attack. + * Uint16 fade_length; // Duration of the fade out (ms). + * Uint16 fade_level; // Level at the end of the fade. + * \endcode + * + * + * Here we have an example of a constant effect evolution in time: + * \verbatim + Strength + ^ + | + | effect level --> _________________ + | / \ + | / \ + | / \ + | / \ + | attack_level --> | \ + | | | <--- fade_level + | + +--------------------------------------------------> Time + [--] [---] + attack_length fade_length + + [------------------][-----------------------] + delay length + \endverbatim + * + * Note either the attack_level or the fade_level may be above the actual + * effect level. + * + * \sa SDL_HapticConstant + * \sa SDL_HapticPeriodic + * \sa SDL_HapticCondition + * \sa SDL_HapticRamp + * \sa SDL_HapticLeftRight + * \sa SDL_HapticCustom + */ +typedef union SDL_HapticEffect +{ + /* Common for all force feedback effects */ + Uint16 type; /**< Effect type. */ + SDL_HapticConstant constant; /**< Constant effect. */ + SDL_HapticPeriodic periodic; /**< Periodic effect. */ + SDL_HapticCondition condition; /**< Condition effect. */ + SDL_HapticRamp ramp; /**< Ramp effect. */ + SDL_HapticLeftRight leftright; /**< Left/Right effect. */ + SDL_HapticCustom custom; /**< Custom effect. */ +} SDL_HapticEffect; + + +/* Function prototypes */ +/** + * \brief Count the number of haptic devices attached to the system. + * + * \return Number of haptic devices detected on the system. + */ +extern DECLSPEC int SDLCALL SDL_NumHaptics(void); + +/** + * \brief Get the implementation dependent name of a Haptic device. + * + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. + * + * \param device_index Index of the device to get its name. + * \return Name of the device or NULL on error. + * + * \sa SDL_NumHaptics + */ +extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index); + +/** + * \brief Opens a Haptic device for usage. + * + * The index passed as an argument refers to the N'th Haptic device on this + * system. + * + * When opening a haptic device, its gain will be set to maximum and + * autocenter will be disabled. To modify these values use + * SDL_HapticSetGain() and SDL_HapticSetAutocenter(). + * + * \param device_index Index of the device to open. + * \return Device identifier or NULL on error. + * + * \sa SDL_HapticIndex + * \sa SDL_HapticOpenFromMouse + * \sa SDL_HapticOpenFromJoystick + * \sa SDL_HapticClose + * \sa SDL_HapticSetGain + * \sa SDL_HapticSetAutocenter + * \sa SDL_HapticPause + * \sa SDL_HapticStopAll + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index); + +/** + * \brief Checks if the haptic device at index has been opened. + * + * \param device_index Index to check to see if it has been opened. + * \return 1 if it has been opened or 0 if it hasn't. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticIndex + */ +extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index); + +/** + * \brief Gets the index of a haptic device. + * + * \param haptic Haptic device to get the index of. + * \return The index of the haptic device or -1 on error. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticOpened + */ +extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic); + +/** + * \brief Gets whether or not the current mouse has haptic capabilities. + * + * \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't. + * + * \sa SDL_HapticOpenFromMouse + */ +extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void); + +/** + * \brief Tries to open a haptic device from the current mouse. + * + * \return The haptic device identifier or NULL on error. + * + * \sa SDL_MouseIsHaptic + * \sa SDL_HapticOpen + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void); + +/** + * \brief Checks to see if a joystick has haptic features. + * + * \param joystick Joystick to test for haptic capabilities. + * \return 1 if the joystick is haptic, 0 if it isn't + * or -1 if an error ocurred. + * + * \sa SDL_HapticOpenFromJoystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick); + +/** + * \brief Opens a Haptic device for usage from a Joystick device. + * + * You must still close the haptic device separately. It will not be closed + * with the joystick. + * + * When opening from a joystick you should first close the haptic device before + * closing the joystick device. If not, on some implementations the haptic + * device will also get unallocated and you'll be unable to use force feedback + * on that device. + * + * \param joystick Joystick to create a haptic device from. + * \return A valid haptic device identifier on success or NULL on error. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticClose + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick * + joystick); + +/** + * \brief Closes a Haptic device previously opened with SDL_HapticOpen(). + * + * \param haptic Haptic device to close. + */ +extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic); + +/** + * \brief Returns the number of effects a haptic device can store. + * + * On some platforms this isn't fully supported, and therefore is an + * approximation. Always check to see if your created effect was actually + * created and do not rely solely on SDL_HapticNumEffects(). + * + * \param haptic The haptic device to query effect max. + * \return The number of effects the haptic device can store or + * -1 on error. + * + * \sa SDL_HapticNumEffectsPlaying + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic); + +/** + * \brief Returns the number of effects a haptic device can play at the same + * time. + * + * This is not supported on all platforms, but will always return a value. + * Added here for the sake of completeness. + * + * \param haptic The haptic device to query maximum playing effects. + * \return The number of effects the haptic device can play at the same time + * or -1 on error. + * + * \sa SDL_HapticNumEffects + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); + +/** + * \brief Gets the haptic device's supported features in bitwise manner. + * + * Example: + * \code + * if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) { + * printf("We have constant haptic effect!"); + * } + * \endcode + * + * \param haptic The haptic device to query. + * \return Haptic features in bitwise manner (OR'd). + * + * \sa SDL_HapticNumEffects + * \sa SDL_HapticEffectSupported + */ +extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic); + + +/** + * \brief Gets the number of haptic axes the device has. + * + * \sa SDL_HapticDirection + */ +extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic); + +/** + * \brief Checks to see if effect is supported by haptic. + * + * \param haptic Haptic device to check on. + * \param effect Effect to check to see if it is supported. + * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. + * + * \sa SDL_HapticQuery + * \sa SDL_HapticNewEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, + SDL_HapticEffect * + effect); + +/** + * \brief Creates a new haptic effect on the device. + * + * \param haptic Haptic device to create the effect on. + * \param effect Properties of the effect to create. + * \return The id of the effect on success or -1 on error. + * + * \sa SDL_HapticUpdateEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, + SDL_HapticEffect * effect); + +/** + * \brief Updates the properties of an effect. + * + * Can be used dynamically, although behaviour when dynamically changing + * direction may be strange. Specifically the effect may reupload itself + * and start playing from the start. You cannot change the type either when + * running SDL_HapticUpdateEffect(). + * + * \param haptic Haptic device that has the effect. + * \param effect Effect to update. + * \param data New effect properties to use. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticNewEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, + int effect, + SDL_HapticEffect * data); + +/** + * \brief Runs the haptic effect on its associated haptic device. + * + * If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over + * repeating the envelope (attack and fade) every time. If you only want the + * effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length + * parameter. + * + * \param haptic Haptic device to run the effect on. + * \param effect Identifier of the haptic effect to run. + * \param iterations Number of iterations to run the effect. Use + * ::SDL_HAPTIC_INFINITY for infinity. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticStopEffect + * \sa SDL_HapticDestroyEffect + * \sa SDL_HapticGetEffectStatus + */ +extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, + int effect, + Uint32 iterations); + +/** + * \brief Stops the haptic effect on its associated haptic device. + * + * \param haptic Haptic device to stop the effect on. + * \param effect Identifier of the effect to stop. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, + int effect); + +/** + * \brief Destroys a haptic effect on the device. + * + * This will stop the effect if it's running. Effects are automatically + * destroyed when the device is closed. + * + * \param haptic Device to destroy the effect on. + * \param effect Identifier of the effect to destroy. + * + * \sa SDL_HapticNewEffect + */ +extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic, + int effect); + +/** + * \brief Gets the status of the current effect on the haptic device. + * + * Device must support the ::SDL_HAPTIC_STATUS feature. + * + * \param haptic Haptic device to query the effect status on. + * \param effect Identifier of the effect to query its status. + * \return 0 if it isn't playing, 1 if it is playing or -1 on error. + * + * \sa SDL_HapticRunEffect + * \sa SDL_HapticStopEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic, + int effect); + +/** + * \brief Sets the global gain of the device. + * + * Device must support the ::SDL_HAPTIC_GAIN feature. + * + * The user may specify the maximum gain by setting the environment variable + * SDL_HAPTIC_GAIN_MAX which should be between 0 and 100. All calls to + * SDL_HapticSetGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the + * maximum. + * + * \param haptic Haptic device to set the gain on. + * \param gain Value to set the gain to, should be between 0 and 100. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain); + +/** + * \brief Sets the global autocenter of the device. + * + * Autocenter should be between 0 and 100. Setting it to 0 will disable + * autocentering. + * + * Device must support the ::SDL_HAPTIC_AUTOCENTER feature. + * + * \param haptic Haptic device to set autocentering on. + * \param autocenter Value to set autocenter to, 0 disables autocentering. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, + int autocenter); + +/** + * \brief Pauses a haptic device. + * + * Device must support the ::SDL_HAPTIC_PAUSE feature. Call + * SDL_HapticUnpause() to resume playback. + * + * Do not modify the effects nor add new ones while the device is paused. + * That can cause all sorts of weird errors. + * + * \param haptic Haptic device to pause. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticUnpause + */ +extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic); + +/** + * \brief Unpauses a haptic device. + * + * Call to unpause after SDL_HapticPause(). + * + * \param haptic Haptic device to unpause. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticPause + */ +extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic); + +/** + * \brief Stops all the currently playing effects on a haptic device. + * + * \param haptic Haptic device to stop. + * \return 0 on success or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic); + +/** + * \brief Checks to see if rumble is supported on a haptic device. + * + * \param haptic Haptic device to check to see if it supports rumble. + * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. + * + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumblePlay + * \sa SDL_HapticRumbleStop + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic); + +/** + * \brief Initializes the haptic device for simple rumble playback. + * + * \param haptic Haptic device to initialize for simple rumble playback. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumblePlay + * \sa SDL_HapticRumbleStop + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic); + +/** + * \brief Runs simple rumble on a haptic device + * + * \param haptic Haptic device to play rumble effect on. + * \param strength Strength of the rumble to play as a 0-1 float value. + * \param length Length of the rumble to play in milliseconds. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumbleStop + */ +extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length ); + +/** + * \brief Stops the simple rumble on a haptic device. + * + * \param haptic Haptic to stop the rumble on. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumblePlay + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_haptic_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_hints.h b/Src/Decoder_H264_ALL/include/SDL/SDL_hints.h new file mode 100644 index 0000000..3bd5435 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_hints.h @@ -0,0 +1,711 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_hints.h + * + * Official documentation for SDL configuration variables + * + * This file contains functions to set and get configuration hints, + * as well as listing each of them alphabetically. + * + * The convention for naming hints is SDL_HINT_X, where "SDL_X" is + * the environment variable that can be used to override the default. + * + * In general these hints are just that - they may or may not be + * supported or applicable on any given platform, but they provide + * a way for an application or user to give the library a hint as + * to how they would like the library to work. + */ + +#ifndef _SDL_hints_h +#define _SDL_hints_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface. + * + * SDL can try to accelerate the SDL screen surface by using streaming + * textures with a 3D rendering engine. This variable controls whether and + * how this is done. + * + * This variable can be set to the following values: + * "0" - Disable 3D acceleration + * "1" - Enable 3D acceleration, using the default renderer. + * "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.) + * + * By default SDL tries to make a best guess for each platform whether + * to use acceleration or not. + */ +#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" + +/** + * \brief A variable specifying which render driver to use. + * + * If the application doesn't pick a specific renderer to use, this variable + * specifies the name of the preferred renderer. If the preferred renderer + * can't be initialized, the normal default renderer is used. + * + * This variable is case insensitive and can be set to the following values: + * "direct3d" + * "opengl" + * "opengles2" + * "opengles" + * "software" + * + * The default varies by platform, but it's the first one in the list that + * is available on the current platform. + */ +#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" + +/** + * \brief A variable controlling whether the OpenGL render driver uses shaders if they are available. + * + * This variable can be set to the following values: + * "0" - Disable shaders + * "1" - Enable shaders + * + * By default shaders are used if OpenGL supports them. + */ +#define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS" + +/** + * \brief A variable controlling whether the Direct3D device is initialized for thread-safe operations. + * + * This variable can be set to the following values: + * "0" - Thread-safety is not enabled (faster) + * "1" - Thread-safety is enabled + * + * By default the Direct3D device is created with thread-safety disabled. + */ +#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE" + +/** + * \brief A variable controlling whether to enable Direct3D 11+'s Debug Layer. + * + * This variable does not have any effect on the Direct3D 9 based renderer. + * + * This variable can be set to the following values: + * "0" - Disable Debug Layer use + * "1" - Enable Debug Layer use + * + * By default, SDL does not use Direct3D Debug Layer. + */ +#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" + +/** + * \brief A variable controlling the scaling quality + * + * This variable can be set to the following values: + * "0" or "nearest" - Nearest pixel sampling + * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D) + * "2" or "best" - Currently this is the same as "linear" + * + * By default nearest pixel sampling is used + */ +#define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY" + +/** + * \brief A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing. + * + * This variable can be set to the following values: + * "0" - Disable vsync + * "1" - Enable vsync + * + * By default SDL does not sync screen surface updates with vertical refresh. + */ +#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" + +/** + * \brief A variable controlling whether the screensaver is enabled. + * + * This variable can be set to the following values: + * "0" - Disable screensaver + * "1" - Enable screensaver + * + * By default SDL will disable the screensaver. + */ +#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" + +/** + * \brief A variable controlling whether the X11 VidMode extension should be used. + * + * This variable can be set to the following values: + * "0" - Disable XVidMode + * "1" - Enable XVidMode + * + * By default SDL will use XVidMode if it is available. + */ +#define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE" + +/** + * \brief A variable controlling whether the X11 Xinerama extension should be used. + * + * This variable can be set to the following values: + * "0" - Disable Xinerama + * "1" - Enable Xinerama + * + * By default SDL will use Xinerama if it is available. + */ +#define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA" + +/** + * \brief A variable controlling whether the X11 XRandR extension should be used. + * + * This variable can be set to the following values: + * "0" - Disable XRandR + * "1" - Enable XRandR + * + * By default SDL will not use XRandR because of window manager issues. + */ +#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" + +/** + * \brief A variable controlling whether the X11 _NET_WM_PING protocol should be supported. + * + * This variable can be set to the following values: + * "0" - Disable _NET_WM_PING + * "1" - Enable _NET_WM_PING + * + * By default SDL will use _NET_WM_PING, but for applications that know they + * will not always be able to respond to ping requests in a timely manner they can + * turn it off to avoid the window manager thinking the app is hung. + * The hint is checked in CreateWindow. + */ +#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" + +/** + * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden + * + * This variable can be set to the following values: + * "0" - The window frame is not interactive when the cursor is hidden (no move, resize, etc) + * "1" - The window frame is interactive when the cursor is hidden + * + * By default SDL will allow interaction with the window frame when the cursor is hidden + */ +#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" + +/** + * \brief A variable controlling whether the windows message loop is processed by SDL + * + * This variable can be set to the following values: + * "0" - The window message loop is not run + * "1" - The window message loop is processed in SDL_PumpEvents() + * + * By default SDL will process the windows message loop + */ +#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP" + +/** + * \brief A variable controlling whether grabbing input grabs the keyboard + * + * This variable can be set to the following values: + * "0" - Grab will affect only the mouse + * "1" - Grab will affect mouse and keyboard + * + * By default SDL will not grab the keyboard so system shortcuts still work. + */ +#define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD" + +/** +* \brief A variable controlling whether relative mouse mode is implemented using mouse warping +* +* This variable can be set to the following values: +* "0" - Relative mouse mode uses raw input +* "1" - Relative mouse mode uses mouse warping +* +* By default SDL will use raw input for relative mouse mode +*/ +#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" + +/** + * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true. + * + */ +#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" + +/** + * \brief A variable controlling whether the idle timer is disabled on iOS. + * + * When an iOS app does not receive touches for some time, the screen is + * dimmed automatically. For games where the accelerometer is the only input + * this is problematic. This functionality can be disabled by setting this + * hint. + * + * As of SDL 2.0.4, SDL_EnableScreenSaver and SDL_DisableScreenSaver accomplish + * the same thing on iOS. They should be preferred over this hint. + * + * This variable can be set to the following values: + * "0" - Enable idle timer + * "1" - Disable idle timer + */ +#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED" + +/** + * \brief A variable controlling which orientations are allowed on iOS. + * + * In some circumstances it is necessary to be able to explicitly control + * which UI orientations are allowed. + * + * This variable is a space delimited list of the following values: + * "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown" + */ +#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS" + +/** + * \brief A variable controlling whether the Android / iOS built-in + * accelerometer should be listed as a joystick device, rather than listing + * actual joysticks only. + * + * This variable can be set to the following values: + * "0" - List only real joysticks and accept input from them + * "1" - List real joysticks along with the accelerometer as if it were a 3 axis joystick (the default). + */ +#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK" + + +/** + * \brief A variable that lets you disable the detection and use of Xinput gamepad devices + * + * The variable can be set to the following values: + * "0" - Disable XInput detection (only uses direct input) + * "1" - Enable XInput detection (the default) + */ +#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" + + +/** + * \brief A variable that causes SDL to use the old axis and button mapping for XInput devices. + * + * This hint is for backwards compatibility only and will be removed in SDL 2.1 + * + * The default value is "0". This hint must be set before SDL_Init() + */ +#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING" + + +/** + * \brief A variable that lets you manually hint extra gamecontroller db entries + * + * The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h + * + * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() + */ +#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG" + + +/** + * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background. + * + * The variable can be set to the following values: + * "0" - Disable joystick & gamecontroller input events when the + * application is in the background. + * "1" - Enable joystick & gamecontroller input events when the + * application is in the background. + * + * The default value is "0". This hint may be set at any time. + */ +#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" + + +/** + * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it. + * This is a debugging aid for developers and not expected to be used by end users. The default is "1" + * + * This variable can be set to the following values: + * "0" - don't allow topmost + * "1" - allow topmost + */ +#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST" + + +/** + * \brief A variable that controls the timer resolution, in milliseconds. + * + * The higher resolution the timer, the more frequently the CPU services + * timer interrupts, and the more precise delays are, but this takes up + * power and CPU time. This hint is only used on Windows 7 and earlier. + * + * See this blog post for more information: + * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/ + * + * If this variable is set to "0", the system timer resolution is not set. + * + * The default value is "1". This hint may be set at any time. + */ +#define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION" + + + +/** +* \brief A string specifying SDL's threads stack size in bytes or "0" for the backend's default size +* +* Use this hint in case you need to set SDL's threads stack size to other than the default. +* This is specially useful if you build SDL against a non glibc libc library (such as musl) which +* provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses). +* Support for this hint is currently available only in the pthread backend. +*/ +#define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" + +/** + * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) + */ +#define SDL_HINT_VIDEO_HIGHDPI_DISABLED "SDL_VIDEO_HIGHDPI_DISABLED" + +/** + * \brief A variable that determines whether ctrl+click should generate a right-click event on Mac + * + * If present, holding ctrl while left clicking will generate a right click + * event when on Mac. + */ +#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK" + +/** +* \brief A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries +* +* SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It +* can use two different sets of binaries, those compiled by the user from source +* or those provided by the Chrome browser. In the later case, these binaries require +* that SDL loads a DLL providing the shader compiler. +* +* This variable can be set to the following values: +* "d3dcompiler_46.dll" - default, best for Vista or later. +* "d3dcompiler_43.dll" - for XP support. +* "none" - do not load any library, useful if you compiled ANGLE from source and included the compiler in your binaries. +* +*/ +#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" + +/** +* \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p"). +* +* If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has +* SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly +* created SDL_Window: +* +* 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is +* needed for example when sharing an OpenGL context across multiple windows. +* +* 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for +* OpenGL rendering. +* +* This variable can be set to the following values: +* The address (as a string "%p") of the SDL_Window* that new windows created with SDL_CreateWindowFrom() should +* share a pixel format with. +*/ +#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT" + +/** + * \brief A URL to a WinRT app's privacy policy + * + * All network-enabled WinRT apps must make a privacy policy available to its + * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be + * be available in the Windows Settings charm, as accessed from within the app. + * SDL provides code to add a URL-based link there, which can point to the app's + * privacy policy. + * + * To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL + * before calling any SDL_Init functions. The contents of the hint should + * be a valid URL. For example, "http://www.example.com". + * + * The default value is "", which will prevent SDL from adding a privacy policy + * link to the Settings charm. This hint should only be set during app init. + * + * The label text of an app's "Privacy Policy" link may be customized via another + * hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. + * + * Please note that on Windows Phone, Microsoft does not provide standard UI + * for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL + * will not get used on that platform. Network-enabled phone apps should display + * their privacy policy through some other, in-app means. + */ +#define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_WINRT_PRIVACY_POLICY_URL" + +/** \brief Label text for a WinRT app's privacy policy link + * + * Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT, + * Microsoft mandates that this policy be available via the Windows Settings charm. + * SDL provides code to add a link there, with its label text being set via the + * optional hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. + * + * Please note that a privacy policy's contents are not set via this hint. A separate + * hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the + * policy. + * + * The contents of this hint should be encoded as a UTF8 string. + * + * The default value is "Privacy Policy". This hint should only be set during app + * initialization, preferably before any calls to SDL_Init. + * + * For additional information on linking to a privacy policy, see the documentation for + * SDL_HINT_WINRT_PRIVACY_POLICY_URL. + */ +#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_WINRT_PRIVACY_POLICY_LABEL" + +/** \brief Allows back-button-press events on Windows Phone to be marked as handled + * + * Windows Phone devices typically feature a Back button. When pressed, + * the OS will emit back-button-press events, which apps are expected to + * handle in an appropriate manner. If apps do not explicitly mark these + * events as 'Handled', then the OS will invoke its default behavior for + * unhandled back-button-press events, which on Windows Phone 8 and 8.1 is to + * terminate the app (and attempt to switch to the previous app, or to the + * device's home screen). + * + * Setting the SDL_HINT_WINRT_HANDLE_BACK_BUTTON hint to "1" will cause SDL + * to mark back-button-press events as Handled, if and when one is sent to + * the app. + * + * Internally, Windows Phone sends back button events as parameters to + * special back-button-press callback functions. Apps that need to respond + * to back-button-press events are expected to register one or more + * callback functions for such, shortly after being launched (during the + * app's initialization phase). After the back button is pressed, the OS + * will invoke these callbacks. If the app's callback(s) do not explicitly + * mark the event as handled by the time they return, or if the app never + * registers one of these callback, the OS will consider the event + * un-handled, and it will apply its default back button behavior (terminate + * the app). + * + * SDL registers its own back-button-press callback with the Windows Phone + * OS. This callback will emit a pair of SDL key-press events (SDL_KEYDOWN + * and SDL_KEYUP), each with a scancode of SDL_SCANCODE_AC_BACK, after which + * it will check the contents of the hint, SDL_HINT_WINRT_HANDLE_BACK_BUTTON. + * If the hint's value is set to "1", the back button event's Handled + * property will get set to 'true'. If the hint's value is set to something + * else, or if it is unset, SDL will leave the event's Handled property + * alone. (By default, the OS sets this property to 'false', to note.) + * + * SDL apps can either set SDL_HINT_WINRT_HANDLE_BACK_BUTTON well before a + * back button is pressed, or can set it in direct-response to a back button + * being pressed. + * + * In order to get notified when a back button is pressed, SDL apps should + * register a callback function with SDL_AddEventWatch(), and have it listen + * for SDL_KEYDOWN events that have a scancode of SDL_SCANCODE_AC_BACK. + * (Alternatively, SDL_KEYUP events can be listened-for. Listening for + * either event type is suitable.) Any value of SDL_HINT_WINRT_HANDLE_BACK_BUTTON + * set by such a callback, will be applied to the OS' current + * back-button-press event. + * + * More details on back button behavior in Windows Phone apps can be found + * at the following page, on Microsoft's developer site: + * http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx + */ +#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_WINRT_HANDLE_BACK_BUTTON" + +/** + * \brief A variable that dictates policy for fullscreen Spaces on Mac OS X. + * + * This hint only applies to Mac OS X. + * + * The variable can be set to the following values: + * "0" - Disable Spaces support (FULLSCREEN_DESKTOP won't use them and + * SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen" + * button on their titlebars). + * "1" - Enable Spaces support (FULLSCREEN_DESKTOP will use them and + * SDL_WINDOW_RESIZABLE windows will offer the "fullscreen" + * button on their titlebars). + * + * The default value is "1". Spaces are disabled regardless of this hint if + * the OS isn't at least Mac OS X Lion (10.7). This hint must be set before + * any windows are created. + */ +#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" + +/** +* \brief When set don't force the SDL app to become a foreground process +* +* This hint only applies to Mac OS X. +* +*/ +#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" + +/** + * \brief Android APK expansion main file version. Should be a string number like "1", "2" etc. + * + * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION. + * + * If both hints were set then SDL_RWFromFile() will look into expansion files + * after a given relative path was not found in the internal storage and assets. + * + * By default this hint is not set and the APK expansion files are not searched. + */ +#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION" + +/** + * \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc. + * + * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION. + * + * If both hints were set then SDL_RWFromFile() will look into expansion files + * after a given relative path was not found in the internal storage and assets. + * + * By default this hint is not set and the APK expansion files are not searched. + */ +#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION" + +/** + * \brief A variable to control whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events. + * + * The variable can be set to the following values: + * "0" - SDL_TEXTEDITING events are sent, and it is the application's + * responsibility to render the text from these events and + * differentiate it somehow from committed text. (default) + * "1" - If supported by the IME then SDL_TEXTEDITING events are not sent, + * and text that is being composed will be rendered in its own UI. + */ +#define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING" + + /** + * \brief A variable to control whether mouse and touch events are to be treated together or separately + * + * The variable can be set to the following values: + * "0" - Mouse events will be handled as touch events, and touch will raise fake mouse + * events. This is the behaviour of SDL <= 2.0.3. (default) + * "1" - Mouse events will be handled separately from pure touch events. + * + * The value of this hint is used at runtime, so it can be changed at any time. + */ +#define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH "SDL_ANDROID_SEPARATE_MOUSE_AND_TOUCH" + +/** + * \brief override the binding element for keyboard inputs for Emscripten builds + * + * This hint only applies to the emscripten platform + * + * The variable can be one of + * "#window" - The javascript window object (this is the default) + * "#document" - The javascript document object + * "#screen" - the javascript window.screen object + * "#canvas" - the WebGL canvas element + * any other string without a leading # sign applies to the element on the page with that ID. + */ +#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" + +/** + * \brief Tell SDL not to catch the SIGINT or SIGTERM signals. + * + * This hint only applies to Unix-like platforms. + * + * The variable can be set to the following values: + * "0" - SDL will install a SIGINT and SIGTERM handler, and when it + * catches a signal, convert it into an SDL_QUIT event. + * "1" - SDL will not install a signal handler at all. + */ +#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" + +/** + * \brief Tell SDL not to generate window-close events for Alt+F4 on Windows. + * + * The variable can be set to the following values: + * "0" - SDL will generate a window-close event when it sees Alt+F4. + * "1" - SDL will only do normal key handling for Alt+F4. + */ +#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4" + +/** + * \brief An enumeration of hint priorities + */ +typedef enum +{ + SDL_HINT_DEFAULT, + SDL_HINT_NORMAL, + SDL_HINT_OVERRIDE +} SDL_HintPriority; + + +/** + * \brief Set a hint with a specific priority + * + * The priority controls the behavior when setting a hint that already + * has a value. Hints will replace existing hints of their priority and + * lower. Environment variables are considered to have override priority. + * + * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, + const char *value, + SDL_HintPriority priority); + +/** + * \brief Set a hint with normal priority + * + * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, + const char *value); + +/** + * \brief Get a hint + * + * \return The string value of a hint variable. + */ +extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); + +/** + * \brief Add a function to watch a particular hint + * + * \param name The hint to watch + * \param callback The function to call when the hint value changes + * \param userdata A pointer to pass to the callback function + */ +typedef void (*SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); +extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); + +/** + * \brief Remove a function watching a particular hint + * + * \param name The hint being watched + * \param callback The function being called when the hint value changes + * \param userdata A pointer being passed to the callback function + */ +extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); + +/** + * \brief Clear all hints + * + * This function is called during SDL_Quit() to free stored hints. + */ +extern DECLSPEC void SDLCALL SDL_ClearHints(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_hints_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_joystick.h b/Src/Decoder_H264_ALL/include/SDL/SDL_joystick.h new file mode 100644 index 0000000..266f3b3 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_joystick.h @@ -0,0 +1,273 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_joystick.h + * + * Include file for SDL joystick event handling + * + * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks, with the exact joystick + * behind a device_index changing as joysticks are plugged and unplugged. + * + * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted + * then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in. + * + * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of + * the device (a X360 wired controller for example). This identifier is platform dependent. + * + * + */ + +#ifndef _SDL_joystick_h +#define _SDL_joystick_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_joystick.h + * + * In order to use these functions, SDL_Init() must have been called + * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system + * for joysticks, and load appropriate drivers. + * + * If you would like to receive joystick updates while the application + * is in the background, you should set the following hint before calling + * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS + */ + +/* The joystick structure used to identify an SDL joystick */ +struct _SDL_Joystick; +typedef struct _SDL_Joystick SDL_Joystick; + +/* A structure that encodes the stable unique id for a joystick device */ +typedef struct { + Uint8 data[16]; +} SDL_JoystickGUID; + +typedef Sint32 SDL_JoystickID; + +typedef enum +{ + SDL_JOYSTICK_POWER_UNKNOWN = -1, + SDL_JOYSTICK_POWER_EMPTY, + SDL_JOYSTICK_POWER_LOW, + SDL_JOYSTICK_POWER_MEDIUM, + SDL_JOYSTICK_POWER_FULL, + SDL_JOYSTICK_POWER_WIRED, + SDL_JOYSTICK_POWER_MAX +} SDL_JoystickPowerLevel; + +/* Function prototypes */ +/** + * Count the number of joysticks attached to the system right now + */ +extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); + +/** + * Get the implementation dependent name of a joystick. + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index); + +/** + * Open a joystick for use. + * The index passed as an argument refers to the N'th joystick on the system. + * This index is not the value which will identify this joystick in future + * joystick events. The joystick's instance id (::SDL_JoystickID) will be used + * there instead. + * + * \return A joystick identifier, or NULL if an error occurred. + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); + +/** + * Return the SDL_Joystick associated with an instance id. + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID joyid); + +/** + * Return the name for this currently opened joystick. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick); + +/** + * Return the GUID for the joystick at this index + */ +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index); + +/** + * Return the GUID for this opened joystick + */ +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick); + +/** + * Return a string representation for this guid. pszGUID must point to at least 33 bytes + * (32 for the string plus a NULL terminator). + */ +extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID); + +/** + * convert a string into a joystick formatted guid + */ +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID); + +/** + * Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick); + +/** + * Get the instance ID of an opened joystick or -1 if the joystick is invalid. + */ +extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick); + +/** + * Get the number of general axis controls on a joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); + +/** + * Get the number of trackballs on a joystick. + * + * Joystick trackballs have only relative motion events associated + * with them and their state cannot be polled. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick); + +/** + * Get the number of POV hats on a joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick); + +/** + * Get the number of buttons on a joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); + +/** + * Update the current state of the open joysticks. + * + * This is called automatically by the event loop if any joystick + * events are enabled. + */ +extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); + +/** + * Enable/disable joystick event polling. + * + * If joystick events are disabled, you must call SDL_JoystickUpdate() + * yourself and check the state of the joystick when you want joystick + * information. + * + * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. + */ +extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); + +/** + * Get the current state of an axis control on a joystick. + * + * The state is a value ranging from -32768 to 32767. + * + * The axis indices start at index 0. + */ +extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, + int axis); + +/** + * \name Hat positions + */ +/* @{ */ +#define SDL_HAT_CENTERED 0x00 +#define SDL_HAT_UP 0x01 +#define SDL_HAT_RIGHT 0x02 +#define SDL_HAT_DOWN 0x04 +#define SDL_HAT_LEFT 0x08 +#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) +#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) +#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) +#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) +/* @} */ + +/** + * Get the current state of a POV hat on a joystick. + * + * The hat indices start at index 0. + * + * \return The return value is one of the following positions: + * - ::SDL_HAT_CENTERED + * - ::SDL_HAT_UP + * - ::SDL_HAT_RIGHT + * - ::SDL_HAT_DOWN + * - ::SDL_HAT_LEFT + * - ::SDL_HAT_RIGHTUP + * - ::SDL_HAT_RIGHTDOWN + * - ::SDL_HAT_LEFTUP + * - ::SDL_HAT_LEFTDOWN + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, + int hat); + +/** + * Get the ball axis change since the last poll. + * + * \return 0, or -1 if you passed it invalid parameters. + * + * The ball indices start at index 0. + */ +extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, + int ball, int *dx, int *dy); + +/** + * Get the current state of a button on a joystick. + * + * The button indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, + int button); + +/** + * Close a joystick previously opened with SDL_JoystickOpen(). + */ +extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); + +/** + * Return the battery level of this joystick + */ +extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick * joystick); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_joystick_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_keyboard.h b/Src/Decoder_H264_ALL/include/SDL/SDL_keyboard.h new file mode 100644 index 0000000..bbba0f0 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_keyboard.h @@ -0,0 +1,217 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_keyboard.h + * + * Include file for SDL keyboard event handling + */ + +#ifndef _SDL_keyboard_h +#define _SDL_keyboard_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_keycode.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The SDL keysym structure, used in key events. + * + * \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event. + */ +typedef struct SDL_Keysym +{ + SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */ + SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */ + Uint16 mod; /**< current key modifiers */ + Uint32 unused; +} SDL_Keysym; + +/* Function prototypes */ + +/** + * \brief Get the window which currently has keyboard focus. + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); + +/** + * \brief Get a snapshot of the current state of the keyboard. + * + * \param numkeys if non-NULL, receives the length of the returned array. + * + * \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values. + * + * \b Example: + * \code + * const Uint8 *state = SDL_GetKeyboardState(NULL); + * if ( state[SDL_SCANCODE_RETURN] ) { + * printf(" is pressed.\n"); + * } + * \endcode + */ +extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); + +/** + * \brief Get the current key modifier state for the keyboard. + */ +extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); + +/** + * \brief Set the current key modifier state for the keyboard. + * + * \note This does not change the keyboard state, only the key modifier flags. + */ +extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); + +/** + * \brief Get the key code corresponding to the given scancode according + * to the current keyboard layout. + * + * See ::SDL_Keycode for details. + * + * \sa SDL_GetKeyName() + */ +extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); + +/** + * \brief Get the scancode corresponding to the given key code according to the + * current keyboard layout. + * + * See ::SDL_Scancode for details. + * + * \sa SDL_GetScancodeName() + */ +extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key); + +/** + * \brief Get a human-readable name for a scancode. + * + * \return A pointer to the name for the scancode. + * If the scancode doesn't have a name, this function returns + * an empty string (""). + * + * \sa SDL_Scancode + */ +extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); + +/** + * \brief Get a scancode from a human-readable name + * + * \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized + * + * \sa SDL_Scancode + */ +extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name); + +/** + * \brief Get a human-readable name for a key. + * + * \return A pointer to a UTF-8 string that stays valid at least until the next + * call to this function. If you need it around any longer, you must + * copy it. If the key doesn't have a name, this function returns an + * empty string (""). + * + * \sa SDL_Key + */ +extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); + +/** + * \brief Get a key code from a human-readable name + * + * \return key code, or SDLK_UNKNOWN if the name wasn't recognized + * + * \sa SDL_Keycode + */ +extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); + +/** + * \brief Start accepting Unicode text input events. + * This function will show the on-screen keyboard if supported. + * + * \sa SDL_StopTextInput() + * \sa SDL_SetTextInputRect() + * \sa SDL_HasScreenKeyboardSupport() + */ +extern DECLSPEC void SDLCALL SDL_StartTextInput(void); + +/** + * \brief Return whether or not Unicode text input events are enabled. + * + * \sa SDL_StartTextInput() + * \sa SDL_StopTextInput() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void); + +/** + * \brief Stop receiving any text input events. + * This function will hide the on-screen keyboard if supported. + * + * \sa SDL_StartTextInput() + * \sa SDL_HasScreenKeyboardSupport() + */ +extern DECLSPEC void SDLCALL SDL_StopTextInput(void); + +/** + * \brief Set the rectangle used to type Unicode text inputs. + * This is used as a hint for IME and on-screen keyboard placement. + * + * \sa SDL_StartTextInput() + */ +extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect); + +/** + * \brief Returns whether the platform has some screen keyboard support. + * + * \return SDL_TRUE if some keyboard support is available else SDL_FALSE. + * + * \note Not all screen keyboard functions are supported on all platforms. + * + * \sa SDL_IsScreenKeyboardShown() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void); + +/** + * \brief Returns whether the screen keyboard is shown for given window. + * + * \param window The window for which screen keyboard should be queried. + * + * \return SDL_TRUE if screen keyboard is shown else SDL_FALSE. + * + * \sa SDL_HasScreenKeyboardSupport() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_keyboard_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_keycode.h b/Src/Decoder_H264_ALL/include/SDL/SDL_keycode.h new file mode 100644 index 0000000..7be9635 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_keycode.h @@ -0,0 +1,341 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_keycode.h + * + * Defines constants which identify keyboard keys and modifiers. + */ + +#ifndef _SDL_keycode_h +#define _SDL_keycode_h + +#include "SDL_stdinc.h" +#include "SDL_scancode.h" + +/** + * \brief The SDL virtual key representation. + * + * Values of this type are used to represent keyboard keys using the current + * layout of the keyboard. These values include Unicode values representing + * the unmodified character that would be generated by pressing the key, or + * an SDLK_* constant for those keys that do not generate characters. + */ +typedef Sint32 SDL_Keycode; + +#define SDLK_SCANCODE_MASK (1<<30) +#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) + +enum +{ + SDLK_UNKNOWN = 0, + + SDLK_RETURN = '\r', + SDLK_ESCAPE = '\033', + SDLK_BACKSPACE = '\b', + SDLK_TAB = '\t', + SDLK_SPACE = ' ', + SDLK_EXCLAIM = '!', + SDLK_QUOTEDBL = '"', + SDLK_HASH = '#', + SDLK_PERCENT = '%', + SDLK_DOLLAR = '$', + SDLK_AMPERSAND = '&', + SDLK_QUOTE = '\'', + SDLK_LEFTPAREN = '(', + SDLK_RIGHTPAREN = ')', + SDLK_ASTERISK = '*', + SDLK_PLUS = '+', + SDLK_COMMA = ',', + SDLK_MINUS = '-', + SDLK_PERIOD = '.', + SDLK_SLASH = '/', + SDLK_0 = '0', + SDLK_1 = '1', + SDLK_2 = '2', + SDLK_3 = '3', + SDLK_4 = '4', + SDLK_5 = '5', + SDLK_6 = '6', + SDLK_7 = '7', + SDLK_8 = '8', + SDLK_9 = '9', + SDLK_COLON = ':', + SDLK_SEMICOLON = ';', + SDLK_LESS = '<', + SDLK_EQUALS = '=', + SDLK_GREATER = '>', + SDLK_QUESTION = '?', + SDLK_AT = '@', + /* + Skip uppercase letters + */ + SDLK_LEFTBRACKET = '[', + SDLK_BACKSLASH = '\\', + SDLK_RIGHTBRACKET = ']', + SDLK_CARET = '^', + SDLK_UNDERSCORE = '_', + SDLK_BACKQUOTE = '`', + SDLK_a = 'a', + SDLK_b = 'b', + SDLK_c = 'c', + SDLK_d = 'd', + SDLK_e = 'e', + SDLK_f = 'f', + SDLK_g = 'g', + SDLK_h = 'h', + SDLK_i = 'i', + SDLK_j = 'j', + SDLK_k = 'k', + SDLK_l = 'l', + SDLK_m = 'm', + SDLK_n = 'n', + SDLK_o = 'o', + SDLK_p = 'p', + SDLK_q = 'q', + SDLK_r = 'r', + SDLK_s = 's', + SDLK_t = 't', + SDLK_u = 'u', + SDLK_v = 'v', + SDLK_w = 'w', + SDLK_x = 'x', + SDLK_y = 'y', + SDLK_z = 'z', + + SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK), + + SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1), + SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2), + SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3), + SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4), + SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5), + SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6), + SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7), + SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8), + SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9), + SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10), + SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11), + SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12), + + SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN), + SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK), + SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE), + SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT), + SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME), + SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP), + SDLK_DELETE = '\177', + SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END), + SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN), + SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT), + SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT), + SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN), + SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP), + + SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR), + SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE), + SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY), + SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS), + SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS), + SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER), + SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1), + SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2), + SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3), + SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4), + SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5), + SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6), + SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7), + SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8), + SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9), + SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0), + SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD), + + SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION), + SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER), + SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS), + SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13), + SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14), + SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15), + SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16), + SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17), + SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18), + SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19), + SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20), + SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21), + SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22), + SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23), + SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24), + SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE), + SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP), + SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU), + SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT), + SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP), + SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN), + SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO), + SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT), + SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY), + SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE), + SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND), + SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE), + SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP), + SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN), + SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA), + SDLK_KP_EQUALSAS400 = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400), + + SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE), + SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ), + SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL), + SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR), + SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR), + SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2), + SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR), + SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT), + SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER), + SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN), + SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL), + SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL), + + SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00), + SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000), + SDLK_THOUSANDSSEPARATOR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR), + SDLK_DECIMALSEPARATOR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR), + SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT), + SDLK_CURRENCYSUBUNIT = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT), + SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN), + SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN), + SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE), + SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE), + SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB), + SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE), + SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A), + SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B), + SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C), + SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D), + SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E), + SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F), + SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR), + SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER), + SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT), + SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS), + SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER), + SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND), + SDLK_KP_DBLAMPERSAND = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND), + SDLK_KP_VERTICALBAR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR), + SDLK_KP_DBLVERTICALBAR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR), + SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON), + SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH), + SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE), + SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT), + SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM), + SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE), + SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL), + SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR), + SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD), + SDLK_KP_MEMSUBTRACT = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT), + SDLK_KP_MEMMULTIPLY = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY), + SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE), + SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS), + SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR), + SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY), + SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY), + SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL), + SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL), + SDLK_KP_HEXADECIMAL = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL), + + SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL), + SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT), + SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT), + SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI), + SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL), + SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT), + SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT), + SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI), + + SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE), + + SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT), + SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV), + SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP), + SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY), + SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE), + SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT), + SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW), + SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL), + SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR), + SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER), + SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH), + SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME), + SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK), + SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD), + SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP), + SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH), + SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS), + + SDLK_BRIGHTNESSDOWN = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN), + SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP), + SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH), + SDLK_KBDILLUMTOGGLE = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE), + SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN), + SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP), + SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT), + SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP) +}; + +/** + * \brief Enumeration of valid key mods (possibly OR'd together). + */ +typedef enum +{ + KMOD_NONE = 0x0000, + KMOD_LSHIFT = 0x0001, + KMOD_RSHIFT = 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LGUI = 0x0400, + KMOD_RGUI = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, + KMOD_RESERVED = 0x8000 +} SDL_Keymod; + +#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) +#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) +#define KMOD_ALT (KMOD_LALT|KMOD_RALT) +#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI) + +#endif /* _SDL_keycode_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_loadso.h b/Src/Decoder_H264_ALL/include/SDL/SDL_loadso.h new file mode 100644 index 0000000..3d540bd --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_loadso.h @@ -0,0 +1,81 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_loadso.h + * + * System dependent library loading routines + * + * Some things to keep in mind: + * \li These functions only work on C function names. Other languages may + * have name mangling and intrinsic language support that varies from + * compiler to compiler. + * \li Make sure you declare your function pointers with the same calling + * convention as the actual library function. Your code will crash + * mysteriously if you do not do this. + * \li Avoid namespace collisions. If you load a symbol from the library, + * it is not defined whether or not it goes into the global symbol + * namespace for the application. If it does and it conflicts with + * symbols in your code or other shared libraries, you will not get + * the results you expect. :) + */ + +#ifndef _SDL_loadso_h +#define _SDL_loadso_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function dynamically loads a shared object and returns a pointer + * to the object handle (or NULL if there was an error). + * The 'sofile' parameter is a system dependent name of the object file. + */ +extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); + +/** + * Given an object handle, this function looks up the address of the + * named function in the shared object and returns it. This address + * is no longer valid after calling SDL_UnloadObject(). + */ +extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, + const char *name); + +/** + * Unload a shared object from memory. + */ +extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_loadso_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_log.h b/Src/Decoder_H264_ALL/include/SDL/SDL_log.h new file mode 100644 index 0000000..09be110 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_log.h @@ -0,0 +1,211 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_log.h + * + * Simple log messages with categories and priorities. + * + * By default logs are quiet, but if you're debugging SDL you might want: + * + * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN); + * + * Here's where the messages go on different platforms: + * Windows: debug output stream + * Android: log output + * Others: standard error output (stderr) + */ + +#ifndef _SDL_log_h +#define _SDL_log_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * \brief The maximum size of a log message + * + * Messages longer than the maximum size will be truncated + */ +#define SDL_MAX_LOG_MESSAGE 4096 + +/** + * \brief The predefined log categories + * + * By default the application category is enabled at the INFO level, + * the assert category is enabled at the WARN level, test is enabled + * at the VERBOSE level and all other categories are enabled at the + * CRITICAL level. + */ +enum +{ + SDL_LOG_CATEGORY_APPLICATION, + SDL_LOG_CATEGORY_ERROR, + SDL_LOG_CATEGORY_ASSERT, + SDL_LOG_CATEGORY_SYSTEM, + SDL_LOG_CATEGORY_AUDIO, + SDL_LOG_CATEGORY_VIDEO, + SDL_LOG_CATEGORY_RENDER, + SDL_LOG_CATEGORY_INPUT, + SDL_LOG_CATEGORY_TEST, + + /* Reserved for future SDL library use */ + SDL_LOG_CATEGORY_RESERVED1, + SDL_LOG_CATEGORY_RESERVED2, + SDL_LOG_CATEGORY_RESERVED3, + SDL_LOG_CATEGORY_RESERVED4, + SDL_LOG_CATEGORY_RESERVED5, + SDL_LOG_CATEGORY_RESERVED6, + SDL_LOG_CATEGORY_RESERVED7, + SDL_LOG_CATEGORY_RESERVED8, + SDL_LOG_CATEGORY_RESERVED9, + SDL_LOG_CATEGORY_RESERVED10, + + /* Beyond this point is reserved for application use, e.g. + enum { + MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM, + MYAPP_CATEGORY_AWESOME2, + MYAPP_CATEGORY_AWESOME3, + ... + }; + */ + SDL_LOG_CATEGORY_CUSTOM +}; + +/** + * \brief The predefined log priorities + */ +typedef enum +{ + SDL_LOG_PRIORITY_VERBOSE = 1, + SDL_LOG_PRIORITY_DEBUG, + SDL_LOG_PRIORITY_INFO, + SDL_LOG_PRIORITY_WARN, + SDL_LOG_PRIORITY_ERROR, + SDL_LOG_PRIORITY_CRITICAL, + SDL_NUM_LOG_PRIORITIES +} SDL_LogPriority; + + +/** + * \brief Set the priority of all log categories + */ +extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority); + +/** + * \brief Set the priority of a particular log category + */ +extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category, + SDL_LogPriority priority); + +/** + * \brief Get the priority of a particular log category + */ +extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category); + +/** + * \brief Reset all priorities to default. + * + * \note This is called in SDL_Quit(). + */ +extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void); + +/** + * \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO + */ +extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_VERBOSE + */ +extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_DEBUG + */ +extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_INFO + */ +extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_WARN + */ +extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_ERROR + */ +extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_CRITICAL + */ +extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Log a message with the specified category and priority. + */ +extern DECLSPEC void SDLCALL SDL_LogMessage(int category, + SDL_LogPriority priority, + SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3); + +/** + * \brief Log a message with the specified category and priority. + */ +extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, + SDL_LogPriority priority, + const char *fmt, va_list ap); + +/** + * \brief The prototype for the log output function + */ +typedef void (*SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message); + +/** + * \brief Get the current log output function. + */ +extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata); + +/** + * \brief This function allows you to replace the default log output + * function with one of your own. + */ +extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_log_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_main.h b/Src/Decoder_H264_ALL/include/SDL/SDL_main.h new file mode 100644 index 0000000..9ce3754 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_main.h @@ -0,0 +1,161 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_main_h +#define _SDL_main_h + +#include "SDL_stdinc.h" + +/** + * \file SDL_main.h + * + * Redefine main() on some platforms so that it is called by SDL. + */ + +#ifndef SDL_MAIN_HANDLED +#if defined(__WIN32__) +/* On Windows SDL provides WinMain(), which parses the command line and passes + the arguments to your main function. + + If you provide your own WinMain(), you may define SDL_MAIN_HANDLED + */ +#define SDL_MAIN_AVAILABLE + +#elif defined(__WINRT__) +/* On WinRT, SDL provides a main function that initializes CoreApplication, + creating an instance of IFrameworkView in the process. + + Please note that #include'ing SDL_main.h is not enough to get a main() + function working. In non-XAML apps, the file, + src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled + into the app itself. In XAML apps, the function, SDL_WinRTRunApp must be + called, with a pointer to the Direct3D-hosted XAML control passed in. +*/ +#define SDL_MAIN_NEEDED + +#elif defined(__IPHONEOS__) +/* On iOS SDL provides a main function that creates an application delegate + and starts the iOS application run loop. + + See src/video/uikit/SDL_uikitappdelegate.m for more details. + */ +#define SDL_MAIN_NEEDED + +#elif defined(__ANDROID__) +/* On Android SDL provides a Java class in SDLActivity.java that is the + main activity entry point. + + See README-android.txt for more details on extending that class. + */ +#define SDL_MAIN_NEEDED + +#elif defined(__NACL__) +/* On NACL we use ppapi_simple to set up the application helper code, + then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before + starting the user main function. + All user code is run in a separate thread by ppapi_simple, thus + allowing for blocking io to take place via nacl_io +*/ +#define SDL_MAIN_NEEDED + +#endif +#endif /* SDL_MAIN_HANDLED */ + +#ifdef __cplusplus +#define C_LINKAGE "C" +#else +#define C_LINKAGE +#endif /* __cplusplus */ + +/** + * \file SDL_main.h + * + * The application's main() function must be called with C linkage, + * and should be declared like this: + * \code + * #ifdef __cplusplus + * extern "C" + * #endif + * int main(int argc, char *argv[]) + * { + * } + * \endcode + */ + +#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) +#define main SDL_main +#endif + +/** + * The prototype for the application's main() function + */ +extern C_LINKAGE int SDL_main(int argc, char *argv[]); + + +#include "begin_code.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This is called by the real SDL main function to let the rest of the + * library know that initialization was done properly. + * + * Calling this yourself without knowing what you're doing can cause + * crashes and hard to diagnose problems with your application. + */ +extern DECLSPEC void SDLCALL SDL_SetMainReady(void); + +#ifdef __WIN32__ + +/** + * This can be called to set the application class at startup + */ +extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, + void *hInst); +extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); + +#endif /* __WIN32__ */ + + +#ifdef __WINRT__ + +/** + * \brief Initializes and launches an SDL/WinRT application. + * + * \param mainFunction The SDL app's C-style main(). + * \param reserved Reserved for future use; should be NULL + * \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more + * information on the failure. + */ +extern DECLSPEC int SDLCALL SDL_WinRTRunApp(int (*mainFunction)(int, char **), void * reserved); + +#endif /* __WINRT__ */ + + +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_main_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_messagebox.h b/Src/Decoder_H264_ALL/include/SDL/SDL_messagebox.h new file mode 100644 index 0000000..ec370db --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_messagebox.h @@ -0,0 +1,144 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_messagebox_h +#define _SDL_messagebox_h + +#include "SDL_stdinc.h" +#include "SDL_video.h" /* For SDL_Window */ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief SDL_MessageBox flags. If supported will display warning icon, etc. + */ +typedef enum +{ + SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */ + SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */ + SDL_MESSAGEBOX_INFORMATION = 0x00000040 /**< informational dialog */ +} SDL_MessageBoxFlags; + +/** + * \brief Flags for SDL_MessageBoxButtonData. + */ +typedef enum +{ + SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */ + SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */ +} SDL_MessageBoxButtonFlags; + +/** + * \brief Individual button data. + */ +typedef struct +{ + Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */ + int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */ + const char * text; /**< The UTF-8 button text */ +} SDL_MessageBoxButtonData; + +/** + * \brief RGB value used in a message box color scheme + */ +typedef struct +{ + Uint8 r, g, b; +} SDL_MessageBoxColor; + +typedef enum +{ + SDL_MESSAGEBOX_COLOR_BACKGROUND, + SDL_MESSAGEBOX_COLOR_TEXT, + SDL_MESSAGEBOX_COLOR_BUTTON_BORDER, + SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND, + SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, + SDL_MESSAGEBOX_COLOR_MAX +} SDL_MessageBoxColorType; + +/** + * \brief A set of colors to use for message box dialogs + */ +typedef struct +{ + SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX]; +} SDL_MessageBoxColorScheme; + +/** + * \brief MessageBox structure containing title, text, window, etc. + */ +typedef struct +{ + Uint32 flags; /**< ::SDL_MessageBoxFlags */ + SDL_Window *window; /**< Parent window, can be NULL */ + const char *title; /**< UTF-8 title */ + const char *message; /**< UTF-8 message text */ + + int numbuttons; + const SDL_MessageBoxButtonData *buttons; + + const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */ +} SDL_MessageBoxData; + +/** + * \brief Create a modal message box. + * + * \param messageboxdata The SDL_MessageBoxData structure with title, text, etc. + * \param buttonid The pointer to which user id of hit button should be copied. + * + * \return -1 on error, otherwise 0 and buttonid contains user id of button + * hit or -1 if dialog was closed. + * + * \note This function should be called on the thread that created the parent + * window, or on the main thread if the messagebox has no parent. It will + * block execution of that thread until the user clicks a button or + * closes the messagebox. + */ +extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); + +/** + * \brief Create a simple modal message box + * + * \param flags ::SDL_MessageBoxFlags + * \param title UTF-8 title text + * \param message UTF-8 message text + * \param window The parent window, or NULL for no parent + * + * \return 0 on success, -1 on error + * + * \sa SDL_ShowMessageBox + */ +extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_messagebox_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_mouse.h b/Src/Decoder_H264_ALL/include/SDL/SDL_mouse.h new file mode 100644 index 0000000..ea9622f --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_mouse.h @@ -0,0 +1,300 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_mouse.h + * + * Include file for SDL mouse event handling. + */ + +#ifndef _SDL_mouse_h +#define _SDL_mouse_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct SDL_Cursor SDL_Cursor; /* Implementation dependent */ + +/** + * \brief Cursor types for SDL_CreateSystemCursor. + */ +typedef enum +{ + SDL_SYSTEM_CURSOR_ARROW, /**< Arrow */ + SDL_SYSTEM_CURSOR_IBEAM, /**< I-beam */ + SDL_SYSTEM_CURSOR_WAIT, /**< Wait */ + SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair */ + SDL_SYSTEM_CURSOR_WAITARROW, /**< Small wait cursor (or Wait if not available) */ + SDL_SYSTEM_CURSOR_SIZENWSE, /**< Double arrow pointing northwest and southeast */ + SDL_SYSTEM_CURSOR_SIZENESW, /**< Double arrow pointing northeast and southwest */ + SDL_SYSTEM_CURSOR_SIZEWE, /**< Double arrow pointing west and east */ + SDL_SYSTEM_CURSOR_SIZENS, /**< Double arrow pointing north and south */ + SDL_SYSTEM_CURSOR_SIZEALL, /**< Four pointed arrow pointing north, south, east, and west */ + SDL_SYSTEM_CURSOR_NO, /**< Slashed circle or crossbones */ + SDL_SYSTEM_CURSOR_HAND, /**< Hand */ + SDL_NUM_SYSTEM_CURSORS +} SDL_SystemCursor; + +/** + * \brief Scroll direction types for the Scroll event + */ +typedef enum +{ + SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */ + SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */ +} SDL_MouseWheelDirection; + +/* Function prototypes */ + +/** + * \brief Get the window which currently has mouse focus. + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void); + +/** + * \brief Retrieve the current state of the mouse. + * + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse cursor position relative to the focus window for the currently + * selected mouse. You can pass NULL for either x or y. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y); + +/** + * \brief Get the current state of the mouse, in relation to the desktop + * + * This works just like SDL_GetMouseState(), but the coordinates will be + * reported relative to the top-left of the desktop. This can be useful if + * you need to track the mouse outside of a specific window and + * SDL_CaptureMouse() doesn't fit your needs. For example, it could be + * useful if you need to track the mouse while dragging a window, where + * coordinates relative to a window might not be in sync at all times. + * + * \note SDL_GetMouseState() returns the mouse position as SDL understands + * it from the last pump of the event queue. This function, however, + * queries the OS for the current mouse position, and as such, might + * be a slightly less efficient function. Unless you know what you're + * doing and have a good reason to use this function, you probably want + * SDL_GetMouseState() instead. + * + * \param x Returns the current X coord, relative to the desktop. Can be NULL. + * \param y Returns the current Y coord, relative to the desktop. Can be NULL. + * \return The current button state as a bitmask, which can be tested using the SDL_BUTTON(X) macros. + * + * \sa SDL_GetMouseState + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y); + +/** + * \brief Retrieve the relative state of the mouse. + * + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse deltas since the last call to SDL_GetRelativeMouseState(). + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); + +/** + * \brief Moves the mouse to the given position within the window. + * + * \param window The window to move the mouse into, or NULL for the current mouse focus + * \param x The x coordinate within the window + * \param y The y coordinate within the window + * + * \note This function generates a mouse motion event + */ +extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, + int x, int y); + +/** + * \brief Moves the mouse to the given position in global screen space. + * + * \param x The x coordinate + * \param y The y coordinate + * \return 0 on success, -1 on error (usually: unsupported by a platform). + * + * \note This function generates a mouse motion event + */ +extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y); + +/** + * \brief Set relative mouse mode. + * + * \param enabled Whether or not to enable relative mode + * + * \return 0 on success, or -1 if relative mode is not supported. + * + * While the mouse is in relative mode, the cursor is hidden, and the + * driver will try to report continuous motion in the current window. + * Only relative motion events will be delivered, the mouse position + * will not change. + * + * \note This function will flush any pending mouse motion. + * + * \sa SDL_GetRelativeMouseMode() + */ +extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); + +/** + * \brief Capture the mouse, to track input outside an SDL window. + * + * \param enabled Whether or not to enable capturing + * + * Capturing enables your app to obtain mouse events globally, instead of + * just within your window. Not all video targets support this function. + * When capturing is enabled, the current window will get all mouse events, + * but unlike relative mode, no change is made to the cursor and it is + * not restrained to your window. + * + * This function may also deny mouse input to other windows--both those in + * your application and others on the system--so you should use this + * function sparingly, and in small bursts. For example, you might want to + * track the mouse while the user is dragging something, until the user + * releases a mouse button. It is not recommended that you capture the mouse + * for long periods of time, such as the entire time your app is running. + * + * While captured, mouse events still report coordinates relative to the + * current (foreground) window, but those coordinates may be outside the + * bounds of the window (including negative values). Capturing is only + * allowed for the foreground window. If the window loses focus while + * capturing, the capture will be disabled automatically. + * + * While capturing is enabled, the current window will have the + * SDL_WINDOW_MOUSE_CAPTURE flag set. + * + * \return 0 on success, or -1 if not supported. + */ +extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled); + +/** + * \brief Query whether relative mouse mode is enabled. + * + * \sa SDL_SetRelativeMouseMode() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); + +/** + * \brief Create a cursor, using the specified bitmap data and + * mask (in MSB format). + * + * The cursor width must be a multiple of 8 bits. + * + * The cursor is created in black and white according to the following: + * + * + * + * + * + * + *
data mask resulting pixel on screen
0 1 White
1 1 Black
0 0 Transparent
1 0 Inverted color if possible, black + * if not.
+ * + * \sa SDL_FreeCursor() + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, + const Uint8 * mask, + int w, int h, int hot_x, + int hot_y); + +/** + * \brief Create a color cursor. + * + * \sa SDL_FreeCursor() + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, + int hot_x, + int hot_y); + +/** + * \brief Create a system cursor. + * + * \sa SDL_FreeCursor() + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id); + +/** + * \brief Set the active cursor. + */ +extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); + +/** + * \brief Return the active cursor. + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); + +/** + * \brief Return the default cursor. + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); + +/** + * \brief Frees a cursor created with SDL_CreateCursor(). + * + * \sa SDL_CreateCursor() + */ +extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); + +/** + * \brief Toggle whether or not the cursor is shown. + * + * \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current + * state. + * + * \return 1 if the cursor is shown, or 0 if the cursor is hidden. + */ +extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); + +/** + * Used as a mask when testing buttons in buttonstate. + * - Button 1: Left mouse button + * - Button 2: Middle mouse button + * - Button 3: Right mouse button + */ +#define SDL_BUTTON(X) (1 << ((X)-1)) +#define SDL_BUTTON_LEFT 1 +#define SDL_BUTTON_MIDDLE 2 +#define SDL_BUTTON_RIGHT 3 +#define SDL_BUTTON_X1 4 +#define SDL_BUTTON_X2 5 +#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) +#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) +#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) +#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) +#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_mouse_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_mutex.h b/Src/Decoder_H264_ALL/include/SDL/SDL_mutex.h new file mode 100644 index 0000000..b7e3973 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_mutex.h @@ -0,0 +1,251 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_mutex_h +#define _SDL_mutex_h + +/** + * \file SDL_mutex.h + * + * Functions to provide thread synchronization primitives. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Synchronization functions which can time out return this value + * if they time out. + */ +#define SDL_MUTEX_TIMEDOUT 1 + +/** + * This is the timeout value which corresponds to never time out. + */ +#define SDL_MUTEX_MAXWAIT (~(Uint32)0) + + +/** + * \name Mutex functions + */ +/* @{ */ + +/* The SDL mutex structure, defined in SDL_sysmutex.c */ +struct SDL_mutex; +typedef struct SDL_mutex SDL_mutex; + +/** + * Create a mutex, initialized unlocked. + */ +extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void); + +/** + * Lock the mutex. + * + * \return 0, or -1 on error. + */ +#define SDL_mutexP(m) SDL_LockMutex(m) +extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex); + +/** + * Try to lock the mutex + * + * \return 0, SDL_MUTEX_TIMEDOUT, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex); + +/** + * Unlock the mutex. + * + * \return 0, or -1 on error. + * + * \warning It is an error to unlock a mutex that has not been locked by + * the current thread, and doing so results in undefined behavior. + */ +#define SDL_mutexV(m) SDL_UnlockMutex(m) +extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex); + +/** + * Destroy a mutex. + */ +extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex); + +/* @} *//* Mutex functions */ + + +/** + * \name Semaphore functions + */ +/* @{ */ + +/* The SDL semaphore structure, defined in SDL_syssem.c */ +struct SDL_semaphore; +typedef struct SDL_semaphore SDL_sem; + +/** + * Create a semaphore, initialized with value, returns NULL on failure. + */ +extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value); + +/** + * Destroy a semaphore. + */ +extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem); + +/** + * This function suspends the calling thread until the semaphore pointed + * to by \c sem has a positive count. It then atomically decreases the + * semaphore count. + */ +extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem); + +/** + * Non-blocking variant of SDL_SemWait(). + * + * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would + * block, and -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem); + +/** + * Variant of SDL_SemWait() with a timeout in milliseconds. + * + * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not + * succeed in the allotted time, and -1 on error. + * + * \warning On some platforms this function is implemented by looping with a + * delay of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms); + +/** + * Atomically increases the semaphore's count (not blocking). + * + * \return 0, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem); + +/** + * Returns the current count of the semaphore. + */ +extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem); + +/* @} *//* Semaphore functions */ + + +/** + * \name Condition variable functions + */ +/* @{ */ + +/* The SDL condition variable structure, defined in SDL_syscond.c */ +struct SDL_cond; +typedef struct SDL_cond SDL_cond; + +/** + * Create a condition variable. + * + * Typical use of condition variables: + * + * Thread A: + * SDL_LockMutex(lock); + * while ( ! condition ) { + * SDL_CondWait(cond, lock); + * } + * SDL_UnlockMutex(lock); + * + * Thread B: + * SDL_LockMutex(lock); + * ... + * condition = true; + * ... + * SDL_CondSignal(cond); + * SDL_UnlockMutex(lock); + * + * There is some discussion whether to signal the condition variable + * with the mutex locked or not. There is some potential performance + * benefit to unlocking first on some platforms, but there are some + * potential race conditions depending on how your code is structured. + * + * In general it's safer to signal the condition variable while the + * mutex is locked. + */ +extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void); + +/** + * Destroy a condition variable. + */ +extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond); + +/** + * Restart one of the threads that are waiting on the condition variable. + * + * \return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond); + +/** + * Restart all threads that are waiting on the condition variable. + * + * \return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond); + +/** + * Wait on the condition variable, unlocking the provided mutex. + * + * \warning The mutex must be locked before entering this function! + * + * The mutex is re-locked once the condition variable is signaled. + * + * \return 0 when it is signaled, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex); + +/** + * Waits for at most \c ms milliseconds, and returns 0 if the condition + * variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not + * signaled in the allotted time, and -1 on error. + * + * \warning On some platforms this function is implemented by looping with a + * delay of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond, + SDL_mutex * mutex, Uint32 ms); + +/* @} *//* Condition variable functions */ + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_mutex_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_name.h b/Src/Decoder_H264_ALL/include/SDL/SDL_name.h new file mode 100644 index 0000000..06cd4a5 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_name.h @@ -0,0 +1,33 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDLname_h_ +#define _SDLname_h_ + +#if defined(__STDC__) || defined(__cplusplus) +#define NeedFunctionPrototypes 1 +#endif + +#define SDL_NAME(X) SDL_##X + +#endif /* _SDLname_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_opengl.h b/Src/Decoder_H264_ALL/include/SDL/SDL_opengl.h new file mode 100644 index 0000000..780919b --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_opengl.h @@ -0,0 +1,2176 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_opengl.h + * + * This is a simple file to encapsulate the OpenGL API headers. + */ + +/** + * \def NO_SDL_GLEXT + * + * Define this if you have your own version of glext.h and want to disable the + * version included in SDL_opengl.h. + */ + +#ifndef _SDL_opengl_h +#define _SDL_opengl_h + +#include "SDL_config.h" + +#ifndef __IPHONEOS__ /* No OpenGL on iOS. */ + +/* + * Mesa 3-D graphics library + * + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef __gl_h_ +#define __gl_h_ + +#if defined(USE_MGL_NAMESPACE) +#include "gl_mangle.h" +#endif + + +/********************************************************************** + * Begin system-specific stuff. + */ + +#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) +#define __WIN32__ +#endif + +#if defined(__WIN32__) && !defined(__CYGWIN__) +# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ +# define GLAPI __declspec(dllexport) +# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ +# define GLAPI __declspec(dllimport) +# else /* for use with static link lib build of Win32 edition only */ +# define GLAPI extern +# endif /* _STATIC_MESA support */ +# if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */ +# define GLAPIENTRY +# else +# define GLAPIENTRY __stdcall +# endif +#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ +# define GLAPI extern +# define GLAPIENTRY __stdcall +#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +# define GLAPI __attribute__((visibility("default"))) +# define GLAPIENTRY +#endif /* WIN32 && !CYGWIN */ + +/* + * WINDOWS: Include windows.h here to define APIENTRY. + * It is also useful when applications include this file by + * including only glut.h, since glut.h depends on windows.h. + * Applications needing to include windows.h with parms other + * than "WIN32_LEAN_AND_MEAN" may include windows.h before + * glut.h or gl.h. + */ +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#ifndef NOMINMAX /* don't define min() and max(). */ +#define NOMINMAX +#endif +#include +#endif + +#ifndef GLAPI +#define GLAPI extern +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef APIENTRY +#define APIENTRY GLAPIENTRY +#endif + +/* "P" suffix to be used for a pointer to a function */ +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif + +#ifndef GLAPIENTRYP +#define GLAPIENTRYP GLAPIENTRY * +#endif + +#if defined(PRAGMA_EXPORT_SUPPORTED) +#pragma export on +#endif + +/* + * End system-specific stuff. + **********************************************************************/ + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define GL_VERSION_1_1 1 +#define GL_VERSION_1_2 1 +#define GL_VERSION_1_3 1 +#define GL_ARB_imaging 1 + + +/* + * Datatypes + */ +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef void GLvoid; +typedef signed char GLbyte; /* 1-byte signed */ +typedef short GLshort; /* 2-byte signed */ +typedef int GLint; /* 4-byte signed */ +typedef unsigned char GLubyte; /* 1-byte unsigned */ +typedef unsigned short GLushort; /* 2-byte unsigned */ +typedef unsigned int GLuint; /* 4-byte unsigned */ +typedef int GLsizei; /* 4-byte signed */ +typedef float GLfloat; /* single precision float */ +typedef float GLclampf; /* single precision float in [0,1] */ +typedef double GLdouble; /* double precision float */ +typedef double GLclampd; /* double precision float in [0,1] */ + + + +/* + * Constants + */ + +/* Boolean values */ +#define GL_FALSE 0 +#define GL_TRUE 1 + +/* Data types */ +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A + +/* Primitives */ +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON 0x0009 + +/* Vertex Arrays */ +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D + +/* Matrix Mode */ +#define GL_MATRIX_MODE 0x0BA0 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 + +/* Points */ +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_POINT_SIZE_RANGE 0x0B12 + +/* Lines */ +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_WIDTH_RANGE 0x0B22 + +/* Polygons */ +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_POLYGON_OFFSET_FILL 0x8037 + +/* Display Lists */ +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_LIST_MODE 0x0B30 + +/* Depth buffer */ +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_BITS 0x0D56 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_COMPONENT 0x1902 + +/* Lighting */ +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_SHININESS 0x1601 +#define GL_EMISSION 0x1600 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_SHADE_MODEL 0x0B54 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_NORMALIZE 0x0BA1 + +/* User clipping planes */ +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 + +/* Accumulation buffer */ +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_ACCUM 0x0100 +#define GL_ADD 0x0104 +#define GL_LOAD 0x0101 +#define GL_MULT 0x0103 +#define GL_RETURN 0x0102 + +/* Alpha testing */ +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_ALPHA_TEST_FUNC 0x0BC1 + +/* Blending */ +#define GL_BLEND 0x0BE2 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND_DST 0x0BE0 +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 + +/* Render Mode */ +#define GL_FEEDBACK 0x1C01 +#define GL_RENDER 0x1C00 +#define GL_SELECT 0x1C02 + +/* Feedback */ +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 + +/* Selection */ +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 + +/* Fog */ +#define GL_FOG 0x0B60 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_COLOR 0x0B66 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_LINEAR 0x2601 +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 + +/* Logic Ops */ +#define GL_LOGIC_OP 0x0BF1 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_CLEAR 0x1500 +#define GL_SET 0x150F +#define GL_COPY 0x1503 +#define GL_COPY_INVERTED 0x150C +#define GL_NOOP 0x1505 +#define GL_INVERT 0x150A +#define GL_AND 0x1501 +#define GL_NAND 0x150E +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_XOR 0x1506 +#define GL_EQUIV 0x1509 +#define GL_AND_REVERSE 0x1502 +#define GL_AND_INVERTED 0x1504 +#define GL_OR_REVERSE 0x150B +#define GL_OR_INVERTED 0x150D + +/* Stencil */ +#define GL_STENCIL_BITS 0x0D57 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_STENCIL_INDEX 0x1901 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 + +/* Buffers, Pixel Drawing/Reading */ +#define GL_NONE 0 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +/*GL_FRONT 0x0404 */ +/*GL_BACK 0x0405 */ +/*GL_FRONT_AND_BACK 0x0408 */ +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_COLOR_INDEX 0x1900 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_ALPHA_BITS 0x0D55 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_INDEX_BITS 0x0D51 +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_READ_BUFFER 0x0C02 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_BITMAP 0x1A00 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_DITHER 0x0BD0 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 + +/* Implementation limits */ +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B + +/* Gets */ +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_MODE 0x0C30 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_RENDER_MODE 0x0C40 +#define GL_RGBA_MODE 0x0C31 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_VIEWPORT 0x0BA2 + +/* Evaluators */ +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 + +/* Hints */ +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 + +/* Scissor box */ +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 + +/* Pixel Mode / Transfer */ +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 + +/* Texture mapping */ +#define GL_TEXTURE_ENV 0x2300 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_LINEAR 0x2400 +#define GL_EYE_PLANE 0x2502 +#define GL_SPHERE_MAP 0x2402 +#define GL_DECAL 0x2101 +#define GL_MODULATE 0x2100 +#define GL_NEAREST 0x2600 +#define GL_REPEAT 0x2901 +#define GL_CLAMP 0x2900 +#define GL_S 0x2000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 + +/* Utility */ +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 + +/* Errors */ +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 + +/* glPush/PopAttrib bits */ +#define GL_CURRENT_BIT 0x00000001 +#define GL_POINT_BIT 0x00000002 +#define GL_LINE_BIT 0x00000004 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_HINT_BIT 0x00008000 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000FFFFF + + +/* OpenGL 1.1 */ +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_R3_G3_B2 0x2A10 +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF +#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF + + + +/* + * Miscellaneous + */ + +GLAPI void GLAPIENTRY glClearIndex( GLfloat c ); + +GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); + +GLAPI void GLAPIENTRY glClear( GLbitfield mask ); + +GLAPI void GLAPIENTRY glIndexMask( GLuint mask ); + +GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); + +GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref ); + +GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor ); + +GLAPI void GLAPIENTRY glLogicOp( GLenum opcode ); + +GLAPI void GLAPIENTRY glCullFace( GLenum mode ); + +GLAPI void GLAPIENTRY glFrontFace( GLenum mode ); + +GLAPI void GLAPIENTRY glPointSize( GLfloat size ); + +GLAPI void GLAPIENTRY glLineWidth( GLfloat width ); + +GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern ); + +GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode ); + +GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units ); + +GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask ); + +GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask ); + +GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag ); + +GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag ); + +GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height); + +GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation ); + +GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation ); + +GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode ); + +GLAPI void GLAPIENTRY glReadBuffer( GLenum mode ); + +GLAPI void GLAPIENTRY glEnable( GLenum cap ); + +GLAPI void GLAPIENTRY glDisable( GLenum cap ); + +GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap ); + + +GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */ + +GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */ + + +GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params ); + +GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params ); + +GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params ); + +GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask ); + +GLAPI void GLAPIENTRY glPopAttrib( void ); + + +GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */ + +GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */ + + +GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode ); + +GLAPI GLenum GLAPIENTRY glGetError( void ); + +GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name ); + +GLAPI void GLAPIENTRY glFinish( void ); + +GLAPI void GLAPIENTRY glFlush( void ); + +GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode ); + + +/* + * Depth Buffer + */ + +GLAPI void GLAPIENTRY glClearDepth( GLclampd depth ); + +GLAPI void GLAPIENTRY glDepthFunc( GLenum func ); + +GLAPI void GLAPIENTRY glDepthMask( GLboolean flag ); + +GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val ); + + +/* + * Accumulation Buffer + */ + +GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); + +GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value ); + + +/* + * Transformation + */ + +GLAPI void GLAPIENTRY glMatrixMode( GLenum mode ); + +GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble near_val, GLdouble far_val ); + +GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble near_val, GLdouble far_val ); + +GLAPI void GLAPIENTRY glViewport( GLint x, GLint y, + GLsizei width, GLsizei height ); + +GLAPI void GLAPIENTRY glPushMatrix( void ); + +GLAPI void GLAPIENTRY glPopMatrix( void ); + +GLAPI void GLAPIENTRY glLoadIdentity( void ); + +GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m ); +GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m ); + +GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m ); +GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m ); + +GLAPI void GLAPIENTRY glRotated( GLdouble angle, + GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glRotatef( GLfloat angle, + GLfloat x, GLfloat y, GLfloat z ); + +GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z ); + +GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z ); + + +/* + * Display Lists + */ + +GLAPI GLboolean GLAPIENTRY glIsList( GLuint list ); + +GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range ); + +GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range ); + +GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode ); + +GLAPI void GLAPIENTRY glEndList( void ); + +GLAPI void GLAPIENTRY glCallList( GLuint list ); + +GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type, + const GLvoid *lists ); + +GLAPI void GLAPIENTRY glListBase( GLuint base ); + + +/* + * Drawing Functions + */ + +GLAPI void GLAPIENTRY glBegin( GLenum mode ); + +GLAPI void GLAPIENTRY glEnd( void ); + + +GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y ); +GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y ); +GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y ); +GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y ); + +GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z ); +GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z ); + +GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); +GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w ); +GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w ); + +GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex2iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex3iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex4iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz ); +GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz ); +GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ); +GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz ); +GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz ); + +GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glNormal3iv( const GLint *v ); +GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glIndexd( GLdouble c ); +GLAPI void GLAPIENTRY glIndexf( GLfloat c ); +GLAPI void GLAPIENTRY glIndexi( GLint c ); +GLAPI void GLAPIENTRY glIndexs( GLshort c ); +GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */ + +GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c ); +GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c ); +GLAPI void GLAPIENTRY glIndexiv( const GLint *c ); +GLAPI void GLAPIENTRY glIndexsv( const GLshort *c ); +GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */ + +GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue ); +GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue ); +GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue ); +GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue ); +GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue ); +GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue ); +GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue ); +GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue ); + +GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green, + GLbyte blue, GLbyte alpha ); +GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green, + GLdouble blue, GLdouble alpha ); +GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green, + GLfloat blue, GLfloat alpha ); +GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green, + GLint blue, GLint alpha ); +GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green, + GLshort blue, GLshort alpha ); +GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green, + GLubyte blue, GLubyte alpha ); +GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green, + GLuint blue, GLuint alpha ); +GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green, + GLushort blue, GLushort alpha ); + + +GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glColor3iv( const GLint *v ); +GLAPI void GLAPIENTRY glColor3sv( const GLshort *v ); +GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v ); +GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v ); +GLAPI void GLAPIENTRY glColor3usv( const GLushort *v ); + +GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glColor4iv( const GLint *v ); +GLAPI void GLAPIENTRY glColor4sv( const GLshort *v ); +GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v ); +GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v ); +GLAPI void GLAPIENTRY glColor4usv( const GLushort *v ); + + +GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s ); +GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s ); +GLAPI void GLAPIENTRY glTexCoord1i( GLint s ); +GLAPI void GLAPIENTRY glTexCoord1s( GLshort s ); + +GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t ); +GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t ); +GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t ); +GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t ); + +GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r ); +GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ); +GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r ); +GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r ); + +GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ); +GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ); +GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q ); +GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ); + +GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y ); +GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y ); +GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y ); +GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y ); + +GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z ); +GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z ); + +GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); +GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w ); +GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ); + +GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ); +GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ); +GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 ); +GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ); + + +GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 ); +GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 ); +GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 ); +GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 ); + + +/* + * Vertex Arrays (1.1) + */ + +GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride, + const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride, + const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params ); + +GLAPI void GLAPIENTRY glArrayElement( GLint i ); + +GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count ); + +GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count, + GLenum type, const GLvoid *indices ); + +GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride, + const GLvoid *pointer ); + +/* + * Lighting + */ + +GLAPI void GLAPIENTRY glShadeModel( GLenum mode ); + +GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname, + const GLfloat *params ); +GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname, + GLfloat *params ); +GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params ); + +GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode ); + + +/* + * Raster functions + */ + +GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor ); + +GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize, + const GLfloat *values ); +GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize, + const GLuint *values ); +GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize, + const GLushort *values ); + +GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values ); +GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values ); +GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values ); + +GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height, + GLfloat xorig, GLfloat yorig, + GLfloat xmove, GLfloat ymove, + const GLubyte *bitmap ); + +GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + GLvoid *pixels ); + +GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum type ); + +/* + * Stenciling + */ + +GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask ); + +GLAPI void GLAPIENTRY glStencilMask( GLuint mask ); + +GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass ); + +GLAPI void GLAPIENTRY glClearStencil( GLint s ); + + + +/* + * Texture mapping + */ + +GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param ); +GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params ); +GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); +GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname, + const GLfloat *params ); +GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target, + GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target, + GLenum pname, GLint *params ); + +GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level, + GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level, + GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLsizei height, + GLint border, GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level, + GLenum format, GLenum type, + GLvoid *pixels ); + + +/* 1.1 functions */ + +GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures ); + +GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures); + +GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture ); + +GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n, + const GLuint *textures, + const GLclampf *priorities ); + +GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n, + const GLuint *textures, + GLboolean *residences ); + +GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture ); + + +GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level, + GLint xoffset, + GLsizei width, GLenum format, + GLenum type, const GLvoid *pixels ); + + +GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ); + + +GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, + GLsizei width, GLint border ); + + +GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, + GLsizei width, GLsizei height, + GLint border ); + + +GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level, + GLint xoffset, GLint x, GLint y, + GLsizei width ); + + +GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height ); + + +/* + * Evaluators + */ + +GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2, + GLint stride, + GLint order, const GLdouble *points ); +GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2, + GLint stride, + GLint order, const GLfloat *points ); + +GLAPI void GLAPIENTRY glMap2d( GLenum target, + GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, + GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, + const GLdouble *points ); +GLAPI void GLAPIENTRY glMap2f( GLenum target, + GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, + GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, + const GLfloat *points ); + +GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v ); +GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v ); +GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v ); + +GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u ); +GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u ); + +GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u ); +GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u ); + +GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v ); +GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v ); + +GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u ); +GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u ); + +GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); +GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); + +GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2, + GLint vn, GLdouble v1, GLdouble v2 ); +GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2, + GLint vn, GLfloat v1, GLfloat v2 ); + +GLAPI void GLAPIENTRY glEvalPoint1( GLint i ); + +GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j ); + +GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 ); + +GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); + + +/* + * Fog + */ + +GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param ); + +GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params ); + +GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params ); + + +/* + * Selection and Feedback + */ + +GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); + +GLAPI void GLAPIENTRY glPassThrough( GLfloat token ); + +GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer ); + +GLAPI void GLAPIENTRY glInitNames( void ); + +GLAPI void GLAPIENTRY glLoadName( GLuint name ); + +GLAPI void GLAPIENTRY glPushName( GLuint name ); + +GLAPI void GLAPIENTRY glPopName( void ); + + + +/* + * OpenGL 1.2 + */ + +#define GL_RESCALE_NORMAL 0x803A +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_TEXTURE_BINDING_3D 0x806A + +GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, + GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); + +GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLsizei height, + GLsizei depth, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint zoffset, GLsizei width, + GLsizei height, GLsizei depth, + GLenum format, + GLenum type, const GLvoid *pixels); + +GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint zoffset, GLint x, + GLint y, GLsizei width, + GLsizei height ); + +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + + +/* + * GL_ARB_imaging + */ + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_BLEND_EQUATION 0x8009 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_BLEND_COLOR 0x8005 + + +GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat, + GLsizei width, GLenum format, + GLenum type, const GLvoid *table ); + +GLAPI void GLAPIENTRY glColorSubTable( GLenum target, + GLsizei start, GLsizei count, + GLenum format, GLenum type, + const GLvoid *data ); + +GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname, + const GLint *params); + +GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname, + const GLfloat *params); + +GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start, + GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, + GLenum type, GLvoid *table ); + +GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glBlendEquation( GLenum mode ); + +GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green, + GLclampf blue, GLclampf alpha ); + +GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width, + GLenum internalformat, GLboolean sink ); + +GLAPI void GLAPIENTRY glResetHistogram( GLenum target ); + +GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset, + GLenum format, GLenum type, + GLvoid *values ); + +GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat, + GLboolean sink ); + +GLAPI void GLAPIENTRY glResetMinmax( GLenum target ); + +GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset, + GLenum format, GLenum types, + GLvoid *values ); + +GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target, + GLenum internalformat, GLsizei width, GLenum format, GLenum type, + const GLvoid *image ); + +GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target, + GLenum internalformat, GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid *image ); + +GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname, + GLfloat params ); + +GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname, + const GLfloat *params ); + +GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname, + GLint params ); + +GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target, + GLenum internalformat, GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target, + GLenum internalformat, GLint x, GLint y, GLsizei width, + GLsizei height); + +GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format, + GLenum type, GLvoid *image ); + +GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, + GLenum internalformat, GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid *row, const GLvoid *column ); + +GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, + GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); + + + + +/* + * OpenGL 1.3 + */ + +/* multitexture */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +/* texture_cube_map */ +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +/* texture_compression */ +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +/* multisample */ +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +/* transpose_matrix */ +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +/* texture_env_combine */ +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +/* texture_env_dot3 */ +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +/* texture_border_clamp */ +#define GL_CLAMP_TO_BORDER 0x812D + +GLAPI void GLAPIENTRY glActiveTexture( GLenum texture ); + +GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture ); + +GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img ); + +GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v ); + + +GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] ); + +GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] ); + +GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] ); + +GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); + +GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); + + +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); + + + +/* + * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) + */ +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); +GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); +GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); +GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); +GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); +GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); +GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); + +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + +#endif /* GL_ARB_multitexture */ + + + +/* + * Define this token if you want "old-style" header file behaviour (extensions + * defined in gl.h). Otherwise, extensions will be included from glext.h. + */ +#if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY) +#include "SDL_opengl_glext.h" +#endif /* GL_GLEXT_LEGACY */ + + + +/* + * ???. GL_MESA_packed_depth_stencil + * XXX obsolete + */ +#ifndef GL_MESA_packed_depth_stencil +#define GL_MESA_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_MESA 0x8750 +#define GL_UNSIGNED_INT_24_8_MESA 0x8751 +#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752 +#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753 +#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754 + +#endif /* GL_MESA_packed_depth_stencil */ + + +#ifndef GL_ATI_blend_equation_separate +#define GL_ATI_blend_equation_separate 1 + +#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D + +GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA ); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA); + +#endif /* GL_ATI_blend_equation_separate */ + + +/* GL_OES_EGL_image */ +#ifndef GL_OES_EGL_image +typedef void* GLeglImageOES; +#endif + +#ifndef GL_OES_EGL_image +#define GL_OES_EGL_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); +GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); +#endif +typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); +typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); +#endif + + +/** + ** NOTE!!!!! If you add new functions to this file, or update + ** glext.h be sure to regenerate the gl_mangle.h file. See comments + ** in that file for details. + **/ + + + +/********************************************************************** + * Begin system-specific stuff + */ +#if defined(PRAGMA_EXPORT_SUPPORTED) +#pragma export off +#endif + +/* + * End system-specific stuff + **********************************************************************/ + + +#ifdef __cplusplus +} +#endif + +#endif /* __gl_h_ */ + +#endif /* !__IPHONEOS__ */ + +#endif /* _SDL_opengl_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_opengl_glext.h b/Src/Decoder_H264_ALL/include/SDL/SDL_opengl_glext.h new file mode 100644 index 0000000..cd3869f --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_opengl_glext.h @@ -0,0 +1,11177 @@ +#ifndef __glext_h_ +#define __glext_h_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2013-2014 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ +/* +** This header is generated from the Khronos OpenGL / OpenGL ES XML +** API Registry. The current version of the Registry, generator scripts +** used to make the header, and the header can be found at +** http://www.opengl.org/registry/ +** +** Khronos $Revision: 26745 $ on $Date: 2014-05-21 03:12:26 -0700 (Wed, 21 May 2014) $ +*/ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +#define GL_GLEXT_VERSION 20140521 + +/* Generated C header for: + * API: gl + * Profile: compatibility + * Versions considered: .* + * Versions emitted: 1\.[2-9]|[234]\.[0-9] + * Default extensions included: gl + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_RESCALE_NORMAL 0x803A +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif +#endif /* GL_VERSION_1_2 */ + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTexture (GLenum texture); +GLAPI void APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, void *img); +GLAPI void APIENTRY glClientActiveTexture (GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m); +#endif +#endif /* GL_VERSION_1_3 */ + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); +GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param); +GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params); +GLAPI void APIENTRY glFogCoordf (GLfloat coord); +GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord); +GLAPI void APIENTRY glFogCoordd (GLdouble coord); +GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord); +GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v); +GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2iv (const GLint *v); +GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2sv (const GLshort *v); +GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3iv (const GLint *v); +GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3sv (const GLshort *v); +GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void APIENTRY glBlendEquation (GLenum mode); +#endif +#endif /* GL_VERSION_1_4 */ + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +#include +#ifdef __MACOSX__ +typedef long GLsizeiptr; +typedef long GLintptr; +#else +typedef ptrdiff_t GLsizeiptr; +typedef ptrdiff_t GLintptr; +#endif +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#define GL_SRC1_ALPHA 0x8589 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_FOG_COORD_SRC 0x8450 +#define GL_FOG_COORD 0x8451 +#define GL_CURRENT_FOG_COORD 0x8453 +#define GL_FOG_COORD_ARRAY_TYPE 0x8454 +#define GL_FOG_COORD_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORD_ARRAY_POINTER 0x8456 +#define GL_FOG_COORD_ARRAY 0x8457 +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D +#define GL_SRC0_RGB 0x8580 +#define GL_SRC1_RGB 0x8581 +#define GL_SRC2_RGB 0x8582 +#define GL_SRC0_ALPHA 0x8588 +#define GL_SRC2_ALPHA 0x858A +typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void *data); +typedef void *(APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void **params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsQuery (GLuint id); +GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id); +GLAPI void APIENTRY glEndQuery (GLenum target); +GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params); +GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer); +GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); +GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, void *data); +GLAPI void *APIENTRY glMapBuffer (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params); +#endif +#endif /* GL_VERSION_1_5 */ + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +typedef char GLchar; +#define GL_BLEND_EQUATION_RGB 0x8009 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_TEXTURE_COORDS 0x8871 +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); +GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); +GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader); +GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); +GLAPI void APIENTRY glCompileShader (GLuint shader); +GLAPI GLuint APIENTRY glCreateProgram (void); +GLAPI GLuint APIENTRY glCreateShader (GLenum type); +GLAPI void APIENTRY glDeleteProgram (GLuint program); +GLAPI void APIENTRY glDeleteShader (GLuint shader); +GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader); +GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index); +GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index); +GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); +GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); +GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); +GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer); +GLAPI GLboolean APIENTRY glIsProgram (GLuint program); +GLAPI GLboolean APIENTRY glIsShader (GLuint shader); +GLAPI void APIENTRY glLinkProgram (GLuint program); +GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); +GLAPI void APIENTRY glUseProgram (GLuint program); +GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0); +GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glUniform1i (GLint location, GLint v0); +GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glValidateProgram (GLuint program); +GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +#endif +#endif /* GL_VERSION_2_0 */ + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif +#endif /* GL_VERSION_2_1 */ + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 +typedef unsigned short GLhalf; +#define GL_COMPARE_REF_TO_TEXTURE 0x884E +#define GL_CLIP_DISTANCE0 0x3000 +#define GL_CLIP_DISTANCE1 0x3001 +#define GL_CLIP_DISTANCE2 0x3002 +#define GL_CLIP_DISTANCE3 0x3003 +#define GL_CLIP_DISTANCE4 0x3004 +#define GL_CLIP_DISTANCE5 0x3005 +#define GL_CLIP_DISTANCE6 0x3006 +#define GL_CLIP_DISTANCE7 0x3007 +#define GL_MAX_CLIP_DISTANCES 0x0D32 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_MAX_VARYING_COMPONENTS 0x8B4B +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 +#define GL_INDEX 0x8222 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_FRAMEBUFFER_SRGB 0x8DB9 +#define GL_HALF_FLOAT 0x140B +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C +#define GL_VERTEX_ARRAY_BINDING 0x85B5 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_ALPHA_INTEGER 0x8D97 +typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void *(APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data); +GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data); +GLAPI void APIENTRY glEnablei (GLenum target, GLuint index); +GLAPI void APIENTRY glDisablei (GLenum target, GLuint index); +GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index); +GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedback (void); +GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); +GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp); +GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode); +GLAPI void APIENTRY glEndConditionalRender (void); +GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params); +GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params); +GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0); +GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value); +GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value); +GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value); +GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +GLAPI const GLubyte *APIENTRY glGetStringi (GLenum name, GLuint index); +GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer); +GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); +GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer); +GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); +GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); +GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); +GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target); +GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateMipmap (GLenum target); +GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void *APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glBindVertexArray (GLuint array); +GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays); +GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays); +GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array); +#endif +#endif /* GL_VERSION_3_0 */ + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFFu +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); +typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); +typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); +GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index); +GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); +GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName); +GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +#endif +#endif /* GL_VERSION_3_1 */ + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 +typedef struct __GLsync *GLsync; +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GL_EXT_timer_query extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) || defined(__digital__) +#include +#if defined(__STDC__) +#if defined(__arch64__) || defined(_LP64) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) || defined(__sgi) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#elif defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +/* Fallback if nothing above works */ +#include +#endif +#endif +typedef uint64_t GLuint64; +typedef int64_t GLint64; +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 +#define GL_DEPTH_CLAMP 0x864F +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 +typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode); +typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags); +typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync); +typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); +typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data); +typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); +GLAPI void APIENTRY glProvokingVertex (GLenum mode); +GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags); +GLAPI GLboolean APIENTRY glIsSync (GLsync sync); +GLAPI void APIENTRY glDeleteSync (GLsync sync); +GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data); +GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); +GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val); +GLAPI void APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask); +#endif +#endif /* GL_VERSION_3_2 */ + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_SRC1_COLOR 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC +#define GL_ANY_SAMPLES_PASSED 0x8C2F +#define GL_SAMPLER_BINDING 0x8919 +#define GL_RGB10_A2UI 0x906F +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 +#define GL_INT_2_10_10_10_REV 0x8D9F +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers); +typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers); +typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers); +GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers); +GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler); +GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler); +GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param); +GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param); +GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param); +GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param); +GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param); +GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params); +GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target); +GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params); +GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor); +GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color); +GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color); +GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color); +GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color); +#endif +#endif /* GL_VERSION_3_3 */ + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_MAX_VERTEX_STREAMS 0x8E71 +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B +#define GL_PATCHES 0x000E +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +#define GL_ISOLINES 0x8E7A +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value); +typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect); +typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params); +typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name); +typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices); +typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values); +typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values); +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMinSampleShading (GLfloat value); +GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const void *indirect); +GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect); +GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x); +GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y); +GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params); +GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name); +GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); +GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices); +GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params); +GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values); +GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value); +GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values); +GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids); +GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids); +GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id); +GLAPI void APIENTRY glPauseTransformFeedback (void); +GLAPI void APIENTRY glResumeTransformFeedback (void); +GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id); +GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream); +GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id); +GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index); +GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params); +#endif +#endif /* GL_VERSION_4_0 */ + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#define GL_RGB565 0x8D62 +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_ALL_SHADER_BITS 0xFFFFFFFF +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); +typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); +typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); +typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar *const*strings); +typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines); +typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v); +typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f); +typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReleaseShaderCompiler (void); +GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f); +GLAPI void APIENTRY glClearDepthf (GLfloat d); +GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); +GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); +GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value); +GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program); +GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program); +GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar *const*strings); +GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines); +GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines); +GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params); +GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0); +GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0); +GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0); +GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0); +GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1); +GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v); +GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v); +GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLdouble n, GLdouble f); +GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data); +GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data); +#endif +#endif /* GL_VERSION_4_1 */ + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E +#define GL_NUM_SAMPLE_COUNTS 0x9380 +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); +typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); +typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei instancecount); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); +GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); +GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers); +GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount); +GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); +#endif +#endif /* GL_VERSION_4_2 */ + +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF +#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_MAX_LABEL_LENGTH 0x82E8 +#define GL_DEBUG_OUTPUT 0x92E0 +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +#define GL_MAX_UNIFORM_LOCATIONS 0x826E +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F +#define GL_IS_PER_PATCH 0x92E7 +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF +#define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA +#define GL_VERTEX_BINDING_BUFFER 0x8F4F +#define GL_DISPLAY_LIST 0x82E7 +typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); +typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); +typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); +typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); +typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params); +typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); +typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); +typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); +typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); +typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void); +typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label); +typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect); +GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); +GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level); +GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glInvalidateBufferData (GLuint buffer); +GLAPI void APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments); +GLAPI void APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glMultiDrawArraysIndirect (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); +GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params); +GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name); +GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); +GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name); +GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name); +GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); +GLAPI void APIENTRY glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +GLAPI void APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI void APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex); +GLAPI void APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor); +GLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +GLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message); +GLAPI void APIENTRY glPopDebugGroup (void); +GLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +GLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +GLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label); +GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +#endif +#endif /* GL_VERSION_4_3 */ + +#ifndef GL_VERSION_4_4 +#define GL_VERSION_4_4 1 +#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 +#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 +#define GL_TEXTURE_BUFFER_BINDING 0x8C2A +#define GL_MAP_PERSISTENT_BIT 0x0040 +#define GL_MAP_COHERENT_BIT 0x0080 +#define GL_DYNAMIC_STORAGE_BIT 0x0100 +#define GL_CLIENT_STORAGE_BIT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F +#define GL_BUFFER_STORAGE_FLAGS 0x8220 +#define GL_CLEAR_TEXTURE 0x9365 +#define GL_LOCATION_COMPONENT 0x934A +#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B +#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C +#define GL_QUERY_BUFFER 0x9192 +#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 +#define GL_QUERY_BUFFER_BINDING 0x9193 +#define GL_QUERY_RESULT_NO_WAIT 0x9194 +#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 +typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (APIENTRYP PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers); +typedef void (APIENTRYP PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes); +typedef void (APIENTRYP PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures); +typedef void (APIENTRYP PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint *samplers); +typedef void (APIENTRYP PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures); +typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferStorage (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); +GLAPI void APIENTRY glClearTexImage (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glBindBuffersBase (GLenum target, GLuint first, GLsizei count, const GLuint *buffers); +GLAPI void APIENTRY glBindBuffersRange (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes); +GLAPI void APIENTRY glBindTextures (GLuint first, GLsizei count, const GLuint *textures); +GLAPI void APIENTRY glBindSamplers (GLuint first, GLsizei count, const GLuint *samplers); +GLAPI void APIENTRY glBindImageTextures (GLuint first, GLsizei count, const GLuint *textures); +GLAPI void APIENTRY glBindVertexBuffers (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); +#endif +#endif /* GL_VERSION_4_4 */ + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 +#endif /* GL_ARB_ES2_compatibility */ + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 +#endif /* GL_ARB_ES3_compatibility */ + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 +#endif /* GL_ARB_arrays_of_arrays */ + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 +#endif /* GL_ARB_base_instance */ + +#ifndef GL_ARB_bindless_texture +#define GL_ARB_bindless_texture 1 +typedef uint64_t GLuint64EXT; +#define GL_UNSIGNED_INT64_ARB 0x140F +typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); +typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint64 APIENTRY glGetTextureHandleARB (GLuint texture); +GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleARB (GLuint texture, GLuint sampler); +GLAPI void APIENTRY glMakeTextureHandleResidentARB (GLuint64 handle); +GLAPI void APIENTRY glMakeTextureHandleNonResidentARB (GLuint64 handle); +GLAPI GLuint64 APIENTRY glGetImageHandleARB (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +GLAPI void APIENTRY glMakeImageHandleResidentARB (GLuint64 handle, GLenum access); +GLAPI void APIENTRY glMakeImageHandleNonResidentARB (GLuint64 handle); +GLAPI void APIENTRY glUniformHandleui64ARB (GLint location, GLuint64 value); +GLAPI void APIENTRY glUniformHandleui64vARB (GLint location, GLsizei count, const GLuint64 *value); +GLAPI void APIENTRY glProgramUniformHandleui64ARB (GLuint program, GLint location, GLuint64 value); +GLAPI void APIENTRY glProgramUniformHandleui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +GLAPI GLboolean APIENTRY glIsTextureHandleResidentARB (GLuint64 handle); +GLAPI GLboolean APIENTRY glIsImageHandleResidentARB (GLuint64 handle); +GLAPI void APIENTRY glVertexAttribL1ui64ARB (GLuint index, GLuint64EXT x); +GLAPI void APIENTRY glVertexAttribL1ui64vARB (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glGetVertexAttribLui64vARB (GLuint index, GLenum pname, GLuint64EXT *params); +#endif +#endif /* GL_ARB_bindless_texture */ + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 +#endif /* GL_ARB_blend_func_extended */ + +#ifndef GL_ARB_buffer_storage +#define GL_ARB_buffer_storage 1 +#endif /* GL_ARB_buffer_storage */ + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 +struct _cl_context; +struct _cl_event; +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 +typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context *context, struct _cl_event *event, GLbitfield flags); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context *context, struct _cl_event *event, GLbitfield flags); +#endif +#endif /* GL_ARB_cl_event */ + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 +#endif /* GL_ARB_clear_buffer_object */ + +#ifndef GL_ARB_clear_texture +#define GL_ARB_clear_texture 1 +#endif /* GL_ARB_clear_texture */ + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp); +#endif +#endif /* GL_ARB_color_buffer_float */ + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 +#endif /* GL_ARB_compatibility */ + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#endif /* GL_ARB_compute_shader */ + +#ifndef GL_ARB_compute_variable_group_size +#define GL_ARB_compute_variable_group_size 1 +#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 +#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB +#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 +#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDispatchComputeGroupSizeARB (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); +#endif +#endif /* GL_ARB_compute_variable_group_size */ + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 +#endif /* GL_ARB_conservative_depth */ + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 +#define GL_COPY_READ_BUFFER_BINDING 0x8F36 +#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 +#endif /* GL_ARB_copy_buffer */ + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 +#endif /* GL_ARB_copy_image */ + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const void *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#endif +#endif /* GL_ARB_debug_output */ + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 +#endif /* GL_ARB_depth_buffer_float */ + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 +#endif /* GL_ARB_depth_clamp */ + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif /* GL_ARB_depth_texture */ + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs); +#endif +#endif /* GL_ARB_draw_buffers */ + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 +typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif +#endif /* GL_ARB_draw_buffers_blend */ + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 +#endif /* GL_ARB_draw_elements_base_vertex */ + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 +#endif /* GL_ARB_draw_indirect */ + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#endif +#endif /* GL_ARB_draw_instanced */ + +#ifndef GL_ARB_enhanced_layouts +#define GL_ARB_enhanced_layouts 1 +#endif /* GL_ARB_enhanced_layouts */ + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 +#endif /* GL_ARB_explicit_attrib_location */ + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 +#endif /* GL_ARB_explicit_uniform_location */ + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 +#endif /* GL_ARB_fragment_coord_conventions */ + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 +#endif /* GL_ARB_fragment_layer_viewport */ + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const void *string); +GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program); +GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs); +GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, void *string); +GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program); +#endif +#endif /* GL_ARB_fragment_program */ + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 +#endif /* GL_ARB_fragment_program_shadow */ + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#endif /* GL_ARB_fragment_shader */ + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 +#endif /* GL_ARB_framebuffer_no_attachments */ + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 +#endif /* GL_ARB_framebuffer_object */ + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 +#endif /* GL_ARB_framebuffer_sRGB */ + +#ifndef GL_KHR_context_flush_control +#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB +#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC +#endif /* GL_KHR_context_flush_control */ + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 +#define GL_LINES_ADJACENCY_ARB 0x000A +#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B +#define GL_TRIANGLES_ADJACENCY_ARB 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value); +GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif +#endif /* GL_ARB_geometry_shader4 */ + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 +#endif /* GL_ARB_get_program_binary */ + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 +#endif /* GL_ARB_gpu_shader5 */ + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 +#endif /* GL_ARB_gpu_shader_fp64 */ + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 +typedef unsigned short GLhalfARB; +#define GL_HALF_FLOAT_ARB 0x140B +#endif /* GL_ARB_half_float_pixel */ + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 +#endif /* GL_ARB_half_float_vertex */ + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 +#define GL_BLEND_COLOR 0x8005 +#define GL_BLEND_EQUATION 0x8009 +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, void *table); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, void *image); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); +GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glResetHistogram (GLenum target); +GLAPI void APIENTRY glResetMinmax (GLenum target); +#endif +#endif /* GL_ARB_imaging */ + +#ifndef GL_ARB_indirect_parameters +#define GL_ARB_indirect_parameters 1 +#define GL_PARAMETER_BUFFER_ARB 0x80EE +#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysIndirectCountARB (GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawElementsIndirectCountARB (GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +#endif +#endif /* GL_ARB_indirect_parameters */ + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor); +#endif +#endif /* GL_ARB_instanced_arrays */ + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 +#endif /* GL_ARB_internalformat_query */ + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 +#define GL_SRGB_DECODE_ARB 0x8299 +#endif /* GL_ARB_internalformat_query2 */ + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 +#endif /* GL_ARB_invalidate_subdata */ + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 +#endif /* GL_ARB_map_buffer_alignment */ + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 +#endif /* GL_ARB_map_buffer_range */ + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer); +#endif +#endif /* GL_ARB_matrix_palette */ + +#ifndef GL_ARB_multi_bind +#define GL_ARB_multi_bind 1 +#endif /* GL_ARB_multi_bind */ + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 +#endif /* GL_ARB_multi_draw_indirect */ + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLfloat value, GLboolean invert); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleCoverageARB (GLfloat value, GLboolean invert); +#endif +#endif /* GL_ARB_multisample */ + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTextureARB (GLenum texture); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v); +#endif +#endif /* GL_ARB_multitexture */ + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id); +GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id); +GLAPI void APIENTRY glEndQueryARB (GLenum target); +GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params); +#endif +#endif /* GL_ARB_occlusion_query */ + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 +#endif /* GL_ARB_occlusion_query2 */ + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#endif /* GL_ARB_pixel_buffer_object */ + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params); +#endif +#endif /* GL_ARB_point_parameters */ + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#endif /* GL_ARB_point_sprite */ + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 +#endif /* GL_ARB_program_interface_query */ + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 +#endif /* GL_ARB_provoking_vertex */ + +#ifndef GL_ARB_query_buffer_object +#define GL_ARB_query_buffer_object 1 +#endif /* GL_ARB_query_buffer_object */ + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 +#endif /* GL_ARB_robust_buffer_access_behavior */ + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 +typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img); +typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void *img); +typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values); +typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern); +typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); +typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); +typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); +typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void); +GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img); +GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, void *img); +GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values); +GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values); +GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values); +GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern); +GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); +GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); +GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); +GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +#endif +#endif /* GL_ARB_robustness */ + +#ifndef GL_ARB_robustness_isolation +#define GL_ARB_robustness_isolation 1 +#endif /* GL_ARB_robustness_isolation */ + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLfloat value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMinSampleShadingARB (GLfloat value); +#endif +#endif /* GL_ARB_sample_shading */ + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 +#endif /* GL_ARB_sampler_objects */ + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 +#endif /* GL_ARB_seamless_cube_map */ + +#ifndef GL_ARB_seamless_cubemap_per_texture +#define GL_ARB_seamless_cubemap_per_texture 1 +#endif /* GL_ARB_seamless_cubemap_per_texture */ + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 +#endif /* GL_ARB_separate_shader_objects */ + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 +#endif /* GL_ARB_shader_atomic_counters */ + +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 +#endif /* GL_ARB_shader_bit_encoding */ + +#ifndef GL_ARB_shader_draw_parameters +#define GL_ARB_shader_draw_parameters 1 +#endif /* GL_ARB_shader_draw_parameters */ + +#ifndef GL_ARB_shader_group_vote +#define GL_ARB_shader_group_vote 1 +#endif /* GL_ARB_shader_group_vote */ + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 +#endif /* GL_ARB_shader_image_load_store */ + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 +#endif /* GL_ARB_shader_image_size */ + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 +#ifdef __APPLE__ +typedef void *GLhandleARB; +#else +typedef unsigned int GLhandleARB; +#endif +typedef char GLcharARB; +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length); +typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj); +GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname); +GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj); +GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType); +GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length); +GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj); +GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); +GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj); +GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj); +GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj); +GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj); +GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0); +GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0); +GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name); +GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params); +GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params); +GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#endif +#endif /* GL_ARB_shader_objects */ + +#ifndef GL_ARB_shader_precision +#define GL_ARB_shader_precision 1 +#endif /* GL_ARB_shader_precision */ + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 +#endif /* GL_ARB_shader_stencil_export */ + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 +#endif /* GL_ARB_shader_storage_buffer_object */ + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 +#endif /* GL_ARB_shader_subroutine */ + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 +#endif /* GL_ARB_shader_texture_lod */ + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C +#endif /* GL_ARB_shading_language_100 */ + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 +#endif /* GL_ARB_shading_language_420pack */ + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA +typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); +typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length); +typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); +GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name); +GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length); +GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name); +GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); +GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params); +#endif +#endif /* GL_ARB_shading_language_include */ + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 +#endif /* GL_ARB_shading_language_packing */ + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif /* GL_ARB_shadow */ + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif /* GL_ARB_shadow_ambient */ + +#ifndef GL_ARB_sparse_texture +#define GL_ARB_sparse_texture 1 +#define GL_TEXTURE_SPARSE_ARB 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 +#define GL_MIN_SPARSE_LEVEL_ARB 0x919B +#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 +#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 +typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexPageCommitmentARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); +#endif +#endif /* GL_ARB_sparse_texture */ + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 +#endif /* GL_ARB_stencil_texturing */ + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 +#endif /* GL_ARB_sync */ + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 +#endif /* GL_ARB_tessellation_shader */ + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif /* GL_ARB_texture_border_clamp */ + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E +typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer); +#endif +#endif /* GL_ARB_texture_buffer_object */ + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 +#endif /* GL_ARB_texture_buffer_range */ + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, void *img); +#endif +#endif /* GL_ARB_texture_compression */ + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F +#endif /* GL_ARB_texture_compression_bptc */ + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 +#endif /* GL_ARB_texture_compression_rgtc */ + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif /* GL_ARB_texture_cube_map */ + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F +#endif /* GL_ARB_texture_cube_map_array */ + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif /* GL_ARB_texture_env_add */ + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif /* GL_ARB_texture_env_combine */ + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +#endif /* GL_ARB_texture_env_crossbar */ + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif /* GL_ARB_texture_env_dot3 */ + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#endif /* GL_ARB_texture_float */ + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F +#endif /* GL_ARB_texture_gather */ + +#ifndef GL_ARB_texture_mirror_clamp_to_edge +#define GL_ARB_texture_mirror_clamp_to_edge 1 +#endif /* GL_ARB_texture_mirror_clamp_to_edge */ + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif /* GL_ARB_texture_mirrored_repeat */ + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 +#endif /* GL_ARB_texture_multisample */ + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +#endif /* GL_ARB_texture_non_power_of_two */ + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 +#endif /* GL_ARB_texture_query_levels */ + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 +#endif /* GL_ARB_texture_query_lod */ + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#endif /* GL_ARB_texture_rectangle */ + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 +#endif /* GL_ARB_texture_rg */ + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 +#endif /* GL_ARB_texture_rgb10_a2ui */ + +#ifndef GL_ARB_texture_stencil8 +#define GL_ARB_texture_stencil8 1 +#endif /* GL_ARB_texture_stencil8 */ + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 +#endif /* GL_ARB_texture_storage */ + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 +#endif /* GL_ARB_texture_storage_multisample */ + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 +#endif /* GL_ARB_texture_swizzle */ + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 +#endif /* GL_ARB_texture_view */ + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 +#endif /* GL_ARB_timer_query */ + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 +#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 +#endif /* GL_ARB_transform_feedback2 */ + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 +#endif /* GL_ARB_transform_feedback3 */ + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 +#endif /* GL_ARB_transform_feedback_instanced */ + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m); +#endif +#endif /* GL_ARB_transpose_matrix */ + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#endif /* GL_ARB_uniform_buffer_object */ + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 +#endif /* GL_ARB_vertex_array_bgra */ + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 +#endif /* GL_ARB_vertex_array_object */ + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 +#endif /* GL_ARB_vertex_attrib_64bit */ + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 +#endif /* GL_ARB_vertex_attrib_binding */ + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); +typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); +typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); +typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); +typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); +typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights); +GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights); +GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights); +GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights); +GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights); +GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights); +GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights); +GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights); +GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glVertexBlendARB (GLint count); +#endif +#endif /* GL_ARB_vertex_blend */ + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +#ifdef __MACOSX__ /* The OS X headers haven't caught up with Khronos yet */ +typedef long GLsizeiptrARB; +typedef long GLintptrARB; +#else +typedef ptrdiff_t GLsizeiptrARB; +typedef ptrdiff_t GLintptrARB; +#endif +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); +typedef void *(APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void **params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); +GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); +GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); +GLAPI void *APIENTRY glMapBufferARB (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, void **params); +#endif +#endif /* GL_ARB_vertex_buffer_object */ + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void **pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index); +GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index); +GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, void **pointer); +#endif +#endif /* GL_ARB_vertex_program */ + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name); +GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name); +#endif +#endif /* GL_ARB_vertex_shader */ + +#ifndef GL_ARB_vertex_type_10f_11f_11f_rev +#define GL_ARB_vertex_type_10f_11f_11f_rev 1 +#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 +#endif /* GL_ARB_viewport_array */ + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v); +GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v); +GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v); +#endif +#endif /* GL_ARB_window_pos */ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 +#endif /* GL_KHR_debug */ + +#ifndef GL_KHR_texture_compression_astc_hdr +#define GL_KHR_texture_compression_astc_hdr 1 +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD +#endif /* GL_KHR_texture_compression_astc_hdr */ + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 +#endif /* GL_KHR_texture_compression_astc_ldr */ + +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 +typedef void (APIENTRYP PFNGLMULTITEXCOORD1BOESPROC) (GLenum texture, GLbyte s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1BVOESPROC) (GLenum texture, const GLbyte *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2BOESPROC) (GLenum texture, GLbyte s, GLbyte t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2BVOESPROC) (GLenum texture, const GLbyte *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3BVOESPROC) (GLenum texture, const GLbyte *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4BVOESPROC) (GLenum texture, const GLbyte *coords); +typedef void (APIENTRYP PFNGLTEXCOORD1BOESPROC) (GLbyte s); +typedef void (APIENTRYP PFNGLTEXCOORD1BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLTEXCOORD2BOESPROC) (GLbyte s, GLbyte t); +typedef void (APIENTRYP PFNGLTEXCOORD2BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLTEXCOORD3BOESPROC) (GLbyte s, GLbyte t, GLbyte r); +typedef void (APIENTRYP PFNGLTEXCOORD3BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLTEXCOORD4BOESPROC) (GLbyte s, GLbyte t, GLbyte r, GLbyte q); +typedef void (APIENTRYP PFNGLTEXCOORD4BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLVERTEX2BOESPROC) (GLbyte x); +typedef void (APIENTRYP PFNGLVERTEX2BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLVERTEX3BOESPROC) (GLbyte x, GLbyte y); +typedef void (APIENTRYP PFNGLVERTEX3BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLVERTEX4BOESPROC) (GLbyte x, GLbyte y, GLbyte z); +typedef void (APIENTRYP PFNGLVERTEX4BVOESPROC) (const GLbyte *coords); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiTexCoord1bOES (GLenum texture, GLbyte s); +GLAPI void APIENTRY glMultiTexCoord1bvOES (GLenum texture, const GLbyte *coords); +GLAPI void APIENTRY glMultiTexCoord2bOES (GLenum texture, GLbyte s, GLbyte t); +GLAPI void APIENTRY glMultiTexCoord2bvOES (GLenum texture, const GLbyte *coords); +GLAPI void APIENTRY glMultiTexCoord3bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r); +GLAPI void APIENTRY glMultiTexCoord3bvOES (GLenum texture, const GLbyte *coords); +GLAPI void APIENTRY glMultiTexCoord4bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); +GLAPI void APIENTRY glMultiTexCoord4bvOES (GLenum texture, const GLbyte *coords); +GLAPI void APIENTRY glTexCoord1bOES (GLbyte s); +GLAPI void APIENTRY glTexCoord1bvOES (const GLbyte *coords); +GLAPI void APIENTRY glTexCoord2bOES (GLbyte s, GLbyte t); +GLAPI void APIENTRY glTexCoord2bvOES (const GLbyte *coords); +GLAPI void APIENTRY glTexCoord3bOES (GLbyte s, GLbyte t, GLbyte r); +GLAPI void APIENTRY glTexCoord3bvOES (const GLbyte *coords); +GLAPI void APIENTRY glTexCoord4bOES (GLbyte s, GLbyte t, GLbyte r, GLbyte q); +GLAPI void APIENTRY glTexCoord4bvOES (const GLbyte *coords); +GLAPI void APIENTRY glVertex2bOES (GLbyte x); +GLAPI void APIENTRY glVertex2bvOES (const GLbyte *coords); +GLAPI void APIENTRY glVertex3bOES (GLbyte x, GLbyte y); +GLAPI void APIENTRY glVertex3bvOES (const GLbyte *coords); +GLAPI void APIENTRY glVertex4bOES (GLbyte x, GLbyte y, GLbyte z); +GLAPI void APIENTRY glVertex4bvOES (const GLbyte *coords); +#endif +#endif /* GL_OES_byte_coordinates */ + +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 +#endif /* GL_OES_compressed_paletted_texture */ + +#ifndef GL_OES_fixed_point +#define GL_OES_fixed_point 1 +typedef GLint GLfixed; +#define GL_FIXED_OES 0x140C +typedef void (APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLfixed ref); +typedef void (APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLfixed depth); +typedef void (APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation); +typedef void (APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLfixed n, GLfixed f); +typedef void (APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *param); +typedef void (APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +typedef void (APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum plane, GLfixed *equation); +typedef void (APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *param); +typedef void (APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width); +typedef void (APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m); +typedef void (APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *param); +typedef void (APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz); +typedef void (APIENTRYP PFNGLORTHOXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +typedef void (APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size); +typedef void (APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units); +typedef void (APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEOESPROC) (GLfixed value, GLboolean invert); +typedef void (APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLACCUMXOESPROC) (GLenum op, GLfixed value); +typedef void (APIENTRYP PFNGLBITMAPXOESPROC) (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap); +typedef void (APIENTRYP PFNGLBLENDCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (APIENTRYP PFNGLCLEARACCUMXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (APIENTRYP PFNGLCOLOR3XOESPROC) (GLfixed red, GLfixed green, GLfixed blue); +typedef void (APIENTRYP PFNGLCOLOR3XVOESPROC) (const GLfixed *components); +typedef void (APIENTRYP PFNGLCOLOR4XVOESPROC) (const GLfixed *components); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLEVALCOORD1XOESPROC) (GLfixed u); +typedef void (APIENTRYP PFNGLEVALCOORD1XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLEVALCOORD2XOESPROC) (GLfixed u, GLfixed v); +typedef void (APIENTRYP PFNGLEVALCOORD2XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLFEEDBACKBUFFERXOESPROC) (GLsizei n, GLenum type, const GLfixed *buffer); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETMAPXVOESPROC) (GLenum target, GLenum query, GLfixed *v); +typedef void (APIENTRYP PFNGLGETMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLGETPIXELMAPXVPROC) (GLenum map, GLint size, GLfixed *values); +typedef void (APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERXVOESPROC) (GLenum target, GLint level, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLINDEXXOESPROC) (GLfixed component); +typedef void (APIENTRYP PFNGLINDEXXVOESPROC) (const GLfixed *component); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXXOESPROC) (const GLfixed *m); +typedef void (APIENTRYP PFNGLMAP1XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); +typedef void (APIENTRYP PFNGLMAP2XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); +typedef void (APIENTRYP PFNGLMAPGRID1XOESPROC) (GLint n, GLfixed u1, GLfixed u2); +typedef void (APIENTRYP PFNGLMAPGRID2XOESPROC) (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXXOESPROC) (const GLfixed *m); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1XOESPROC) (GLenum texture, GLfixed s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1XVOESPROC) (GLenum texture, const GLfixed *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2XOESPROC) (GLenum texture, GLfixed s, GLfixed t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2XVOESPROC) (GLenum texture, const GLfixed *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3XVOESPROC) (GLenum texture, const GLfixed *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4XVOESPROC) (GLenum texture, const GLfixed *coords); +typedef void (APIENTRYP PFNGLNORMAL3XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLPASSTHROUGHXOESPROC) (GLfixed token); +typedef void (APIENTRYP PFNGLPIXELMAPXPROC) (GLenum map, GLint size, const GLfixed *values); +typedef void (APIENTRYP PFNGLPIXELSTOREXPROC) (GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLPIXELTRANSFERXOESPROC) (GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLPIXELZOOMXOESPROC) (GLfixed xfactor, GLfixed yfactor); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESXOESPROC) (GLsizei n, const GLuint *textures, const GLfixed *priorities); +typedef void (APIENTRYP PFNGLRASTERPOS2XOESPROC) (GLfixed x, GLfixed y); +typedef void (APIENTRYP PFNGLRASTERPOS2XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLRASTERPOS3XOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLRASTERPOS3XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLRASTERPOS4XOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed w); +typedef void (APIENTRYP PFNGLRASTERPOS4XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLRECTXOESPROC) (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); +typedef void (APIENTRYP PFNGLRECTXVOESPROC) (const GLfixed *v1, const GLfixed *v2); +typedef void (APIENTRYP PFNGLTEXCOORD1XOESPROC) (GLfixed s); +typedef void (APIENTRYP PFNGLTEXCOORD1XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLTEXCOORD2XOESPROC) (GLfixed s, GLfixed t); +typedef void (APIENTRYP PFNGLTEXCOORD2XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLTEXCOORD3XOESPROC) (GLfixed s, GLfixed t, GLfixed r); +typedef void (APIENTRYP PFNGLTEXCOORD3XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLTEXCOORD4XOESPROC) (GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (APIENTRYP PFNGLTEXCOORD4XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLVERTEX2XOESPROC) (GLfixed x); +typedef void (APIENTRYP PFNGLVERTEX2XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLVERTEX3XOESPROC) (GLfixed x, GLfixed y); +typedef void (APIENTRYP PFNGLVERTEX3XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLVERTEX4XOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLVERTEX4XVOESPROC) (const GLfixed *coords); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAlphaFuncxOES (GLenum func, GLfixed ref); +GLAPI void APIENTRY glClearColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI void APIENTRY glClearDepthxOES (GLfixed depth); +GLAPI void APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation); +GLAPI void APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI void APIENTRY glDepthRangexOES (GLfixed n, GLfixed f); +GLAPI void APIENTRY glFogxOES (GLenum pname, GLfixed param); +GLAPI void APIENTRY glFogxvOES (GLenum pname, const GLfixed *param); +GLAPI void APIENTRY glFrustumxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +GLAPI void APIENTRY glGetClipPlanexOES (GLenum plane, GLfixed *equation); +GLAPI void APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetTexEnvxvOES (GLenum target, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glLightModelxOES (GLenum pname, GLfixed param); +GLAPI void APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *param); +GLAPI void APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param); +GLAPI void APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glLineWidthxOES (GLfixed width); +GLAPI void APIENTRY glLoadMatrixxOES (const GLfixed *m); +GLAPI void APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param); +GLAPI void APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *param); +GLAPI void APIENTRY glMultMatrixxOES (const GLfixed *m); +GLAPI void APIENTRY glMultiTexCoord4xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GLAPI void APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz); +GLAPI void APIENTRY glOrthoxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +GLAPI void APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glPointSizexOES (GLfixed size); +GLAPI void APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units); +GLAPI void APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glSampleCoverageOES (GLfixed value, GLboolean invert); +GLAPI void APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param); +GLAPI void APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param); +GLAPI void APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glAccumxOES (GLenum op, GLfixed value); +GLAPI void APIENTRY glBitmapxOES (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap); +GLAPI void APIENTRY glBlendColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI void APIENTRY glClearAccumxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI void APIENTRY glColor3xOES (GLfixed red, GLfixed green, GLfixed blue); +GLAPI void APIENTRY glColor3xvOES (const GLfixed *components); +GLAPI void APIENTRY glColor4xvOES (const GLfixed *components); +GLAPI void APIENTRY glConvolutionParameterxOES (GLenum target, GLenum pname, GLfixed param); +GLAPI void APIENTRY glConvolutionParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glEvalCoord1xOES (GLfixed u); +GLAPI void APIENTRY glEvalCoord1xvOES (const GLfixed *coords); +GLAPI void APIENTRY glEvalCoord2xOES (GLfixed u, GLfixed v); +GLAPI void APIENTRY glEvalCoord2xvOES (const GLfixed *coords); +GLAPI void APIENTRY glFeedbackBufferxOES (GLsizei n, GLenum type, const GLfixed *buffer); +GLAPI void APIENTRY glGetConvolutionParameterxvOES (GLenum target, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetHistogramParameterxvOES (GLenum target, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetLightxOES (GLenum light, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetMapxvOES (GLenum target, GLenum query, GLfixed *v); +GLAPI void APIENTRY glGetMaterialxOES (GLenum face, GLenum pname, GLfixed param); +GLAPI void APIENTRY glGetPixelMapxv (GLenum map, GLint size, GLfixed *values); +GLAPI void APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetTexLevelParameterxvOES (GLenum target, GLint level, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glIndexxOES (GLfixed component); +GLAPI void APIENTRY glIndexxvOES (const GLfixed *component); +GLAPI void APIENTRY glLoadTransposeMatrixxOES (const GLfixed *m); +GLAPI void APIENTRY glMap1xOES (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); +GLAPI void APIENTRY glMap2xOES (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); +GLAPI void APIENTRY glMapGrid1xOES (GLint n, GLfixed u1, GLfixed u2); +GLAPI void APIENTRY glMapGrid2xOES (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); +GLAPI void APIENTRY glMultTransposeMatrixxOES (const GLfixed *m); +GLAPI void APIENTRY glMultiTexCoord1xOES (GLenum texture, GLfixed s); +GLAPI void APIENTRY glMultiTexCoord1xvOES (GLenum texture, const GLfixed *coords); +GLAPI void APIENTRY glMultiTexCoord2xOES (GLenum texture, GLfixed s, GLfixed t); +GLAPI void APIENTRY glMultiTexCoord2xvOES (GLenum texture, const GLfixed *coords); +GLAPI void APIENTRY glMultiTexCoord3xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r); +GLAPI void APIENTRY glMultiTexCoord3xvOES (GLenum texture, const GLfixed *coords); +GLAPI void APIENTRY glMultiTexCoord4xvOES (GLenum texture, const GLfixed *coords); +GLAPI void APIENTRY glNormal3xvOES (const GLfixed *coords); +GLAPI void APIENTRY glPassThroughxOES (GLfixed token); +GLAPI void APIENTRY glPixelMapx (GLenum map, GLint size, const GLfixed *values); +GLAPI void APIENTRY glPixelStorex (GLenum pname, GLfixed param); +GLAPI void APIENTRY glPixelTransferxOES (GLenum pname, GLfixed param); +GLAPI void APIENTRY glPixelZoomxOES (GLfixed xfactor, GLfixed yfactor); +GLAPI void APIENTRY glPrioritizeTexturesxOES (GLsizei n, const GLuint *textures, const GLfixed *priorities); +GLAPI void APIENTRY glRasterPos2xOES (GLfixed x, GLfixed y); +GLAPI void APIENTRY glRasterPos2xvOES (const GLfixed *coords); +GLAPI void APIENTRY glRasterPos3xOES (GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glRasterPos3xvOES (const GLfixed *coords); +GLAPI void APIENTRY glRasterPos4xOES (GLfixed x, GLfixed y, GLfixed z, GLfixed w); +GLAPI void APIENTRY glRasterPos4xvOES (const GLfixed *coords); +GLAPI void APIENTRY glRectxOES (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); +GLAPI void APIENTRY glRectxvOES (const GLfixed *v1, const GLfixed *v2); +GLAPI void APIENTRY glTexCoord1xOES (GLfixed s); +GLAPI void APIENTRY glTexCoord1xvOES (const GLfixed *coords); +GLAPI void APIENTRY glTexCoord2xOES (GLfixed s, GLfixed t); +GLAPI void APIENTRY glTexCoord2xvOES (const GLfixed *coords); +GLAPI void APIENTRY glTexCoord3xOES (GLfixed s, GLfixed t, GLfixed r); +GLAPI void APIENTRY glTexCoord3xvOES (const GLfixed *coords); +GLAPI void APIENTRY glTexCoord4xOES (GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GLAPI void APIENTRY glTexCoord4xvOES (const GLfixed *coords); +GLAPI void APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param); +GLAPI void APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glVertex2xOES (GLfixed x); +GLAPI void APIENTRY glVertex2xvOES (const GLfixed *coords); +GLAPI void APIENTRY glVertex3xOES (GLfixed x, GLfixed y); +GLAPI void APIENTRY glVertex3xvOES (const GLfixed *coords); +GLAPI void APIENTRY glVertex4xOES (GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glVertex4xvOES (const GLfixed *coords); +#endif +#endif /* GL_OES_fixed_point */ + +#ifndef GL_OES_query_matrix +#define GL_OES_query_matrix 1 +typedef GLbitfield (APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed *mantissa, GLint *exponent); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLbitfield APIENTRY glQueryMatrixxOES (GLfixed *mantissa, GLint *exponent); +#endif +#endif /* GL_OES_query_matrix */ + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif /* GL_OES_read_format */ + +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 +typedef void (APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth); +typedef void (APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation); +typedef void (APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); +typedef void (APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +typedef void (APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat *equation); +typedef void (APIENTRYP PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClearDepthfOES (GLclampf depth); +GLAPI void APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation); +GLAPI void APIENTRY glDepthRangefOES (GLclampf n, GLclampf f); +GLAPI void APIENTRY glFrustumfOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +GLAPI void APIENTRY glGetClipPlanefOES (GLenum plane, GLfloat *equation); +GLAPI void APIENTRY glOrthofOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +#endif +#endif /* GL_OES_single_precision */ + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif /* GL_3DFX_multisample */ + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask); +#endif +#endif /* GL_3DFX_tbuffer */ + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif /* GL_3DFX_texture_compression_FXT1 */ + +#ifndef GL_AMD_blend_minmax_factor +#define GL_AMD_blend_minmax_factor 1 +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D +#endif /* GL_AMD_blend_minmax_factor */ + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 +#endif /* GL_AMD_conservative_depth */ + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 +typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, void *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +#endif +#endif /* GL_AMD_debug_output */ + +#ifndef GL_AMD_depth_clamp_separate +#define GL_AMD_depth_clamp_separate 1 +#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E +#define GL_DEPTH_CLAMP_FAR_AMD 0x901F +#endif /* GL_AMD_depth_clamp_separate */ + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 +typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +#endif +#endif /* GL_AMD_draw_buffers_blend */ + +#ifndef GL_AMD_gcn_shader +#define GL_AMD_gcn_shader 1 +#endif /* GL_AMD_gcn_shader */ + +#ifndef GL_AMD_gpu_shader_int64 +#define GL_AMD_gpu_shader_int64 1 +typedef int64_t GLint64EXT; +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB +typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); +GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); +GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); +GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params); +GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); +GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); +GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif +#endif /* GL_AMD_gpu_shader_int64 */ + +#ifndef GL_AMD_interleaved_elements +#define GL_AMD_interleaved_elements 1 +#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 +#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 +typedef void (APIENTRYP PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribParameteriAMD (GLuint index, GLenum pname, GLint param); +#endif +#endif /* GL_AMD_interleaved_elements */ + +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); +#endif +#endif /* GL_AMD_multi_draw_indirect */ + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 +typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names); +typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names); +typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names); +GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names); +GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name); +#endif +#endif /* GL_AMD_name_gen_delete */ + +#ifndef GL_AMD_occlusion_query_event +#define GL_AMD_occlusion_query_event 1 +#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F +#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 +#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 +#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 +#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 +#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF +typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glQueryObjectParameteruiAMD (GLenum target, GLuint id, GLenum pname, GLuint param); +#endif +#endif /* GL_AMD_occlusion_query_event */ + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); +typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data); +GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); +GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); +GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor); +GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor); +GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif +#endif /* GL_AMD_performance_monitor */ + +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 +#endif /* GL_AMD_pinned_memory */ + +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 +#endif /* GL_AMD_query_buffer_object */ + +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F +typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val); +#endif +#endif /* GL_AMD_sample_positions */ + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +#ifndef GL_AMD_shader_atomic_counter_ops +#define GL_AMD_shader_atomic_counter_ops 1 +#endif /* GL_AMD_shader_atomic_counter_ops */ + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 +#endif /* GL_AMD_shader_stencil_export */ + +#ifndef GL_AMD_shader_trinary_minmax +#define GL_AMD_shader_trinary_minmax 1 +#endif /* GL_AMD_shader_trinary_minmax */ + +#ifndef GL_AMD_sparse_texture +#define GL_AMD_sparse_texture 1 +#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A +#define GL_MIN_SPARSE_LEVEL_AMD 0x919B +#define GL_MIN_LOD_WARNING_AMD 0x919C +#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 +typedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +typedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexStorageSparseAMD (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +GLAPI void APIENTRY glTextureStorageSparseAMD (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +#endif +#endif /* GL_AMD_sparse_texture */ + +#ifndef GL_AMD_stencil_operation_extended +#define GL_AMD_stencil_operation_extended 1 +#define GL_SET_AMD 0x874A +#define GL_REPLACE_VALUE_AMD 0x874B +#define GL_STENCIL_OP_VALUE_AMD 0x874C +#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D +typedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value); +#endif +#endif /* GL_AMD_stencil_operation_extended */ + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 +#endif /* GL_AMD_texture_texture4 */ + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +#ifndef GL_AMD_transform_feedback4 +#define GL_AMD_transform_feedback4 1 +#define GL_STREAM_RASTERIZATION_AMD 0x91A0 +#endif /* GL_AMD_transform_feedback4 */ + +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 +#endif /* GL_AMD_vertex_shader_layer */ + +#ifndef GL_AMD_vertex_shader_tessellator +#define GL_AMD_vertex_shader_tessellator 1 +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 +typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor); +GLAPI void APIENTRY glTessellationModeAMD (GLenum mode); +#endif +#endif /* GL_AMD_vertex_shader_tessellator */ + +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 +#endif /* GL_AMD_vertex_shader_viewport_index */ + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 +#endif /* GL_APPLE_aux_depth_stencil */ + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 +#endif /* GL_APPLE_client_storage */ + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const void *pointer); +GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count); +GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#endif +#endif /* GL_APPLE_element_array */ + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B +typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); +typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); +typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences); +GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences); +GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence); +GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name); +GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name); +#endif +#endif /* GL_APPLE_fence */ + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F +#endif /* GL_APPLE_float_pixels */ + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 +typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size); +#endif +#endif /* GL_APPLE_flush_buffer_range */ + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D +typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); +GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); +GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params); +#endif +#endif /* GL_APPLE_object_purgeable */ + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 +#define GL_RGB_422_APPLE 0x8A1F +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_RGB_RAW_422_APPLE 0x8A51 +#endif /* GL_APPLE_rgb_422 */ + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 +#endif /* GL_APPLE_row_bytes */ + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif /* GL_APPLE_specular_vector */ + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF +typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const void *pointer); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const void *pointer); +GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, void **params); +#endif +#endif /* GL_APPLE_texture_range */ + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif /* GL_APPLE_transform_hint */ + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array); +GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays); +GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array); +#endif +#endif /* GL_APPLE_vertex_array_object */ + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, void *pointer); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, void *pointer); +GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param); +#endif +#endif /* GL_APPLE_vertex_array_range */ + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname); +GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname); +GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname); +GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +#endif +#endif /* GL_APPLE_vertex_program_evaluators */ + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 +#define GL_YCBCR_422_APPLE 0x85B9 +#endif /* GL_APPLE_ycbcr_422 */ + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 +typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs); +#endif +#endif /* GL_ATI_draw_buffers */ + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerATI (GLenum type, const void *pointer); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif +#endif /* GL_ATI_element_array */ + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param); +#endif +#endif /* GL_ATI_envmap_bumpmap */ + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id); +GLAPI void APIENTRY glBeginFragmentShaderATI (void); +GLAPI void APIENTRY glEndFragmentShaderATI (void); +GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle); +GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value); +#endif +#endif /* GL_ATI_fragment_shader */ + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 +typedef void *(APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void *APIENTRY glMapObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer); +#endif +#endif /* GL_ATI_map_object_buffer */ + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD +#endif /* GL_ATI_meminfo */ + +#ifndef GL_ATI_pixel_format_float +#define GL_ATI_pixel_format_float 1 +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 +#endif /* GL_ATI_pixel_format_float */ + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param); +#endif +#endif /* GL_ATI_pn_triangles */ + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#endif +#endif /* GL_ATI_separate_stencil */ + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 +#endif /* GL_ATI_text_fragment_shader */ + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 +#endif /* GL_ATI_texture_env_combine3 */ + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F +#endif /* GL_ATI_texture_float */ + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#endif /* GL_ATI_texture_mirror_once */ + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage); +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const void *pointer, GLenum usage); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params); +#endif +#endif /* GL_ATI_vertex_array_object */ + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 +typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params); +#endif +#endif /* GL_ATI_vertex_attrib_array_object */ + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x); +GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords); +GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param); +#endif +#endif /* GL_ATI_vertex_streams */ + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif /* GL_EXT_422_pixels */ + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#define GL_ABGR_EXT 0x8000 +#endif /* GL_EXT_abgr */ + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif /* GL_EXT_bgra */ + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF +typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); +typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer); +GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location); +GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location); +#endif +#endif /* GL_EXT_bindable_uniform */ + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +#endif +#endif /* GL_EXT_blend_color */ + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha); +#endif +#endif /* GL_EXT_blend_equation_separate */ + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif +#endif /* GL_EXT_blend_func_separate */ + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#endif /* GL_EXT_blend_logic_op */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_BLEND_EQUATION_EXT 0x8009 +typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationEXT (GLenum mode); +#endif +#endif /* GL_EXT_blend_minmax */ + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif /* GL_EXT_blend_subtract */ + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif /* GL_EXT_clip_volume_hint */ + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif /* GL_EXT_cmyka */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif +#endif /* GL_EXT_color_subtable */ + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count); +GLAPI void APIENTRY glUnlockArraysEXT (void); +#endif +#endif /* GL_EXT_compiled_vertex_array */ + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, void *image); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); +#endif +#endif /* GL_EXT_convolution */ + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *v); +GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *v); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v); +GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v); +GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const void *pointer); +#endif +#endif /* GL_EXT_coordinate_frame */ + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif +#endif /* GL_EXT_copy_texture */ + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params); +#endif +#endif /* GL_EXT_cull_vertex */ + +#ifndef GL_EXT_debug_label +#define GL_EXT_debug_label 1 +#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F +#define GL_PROGRAM_OBJECT_EXT 0x8B40 +#define GL_SHADER_OBJECT_EXT 0x8B48 +#define GL_BUFFER_OBJECT_EXT 0x9151 +#define GL_QUERY_OBJECT_EXT 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 +typedef void (APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); +typedef void (APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); +GLAPI void APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); +#endif +#endif /* GL_EXT_debug_label */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 +typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); +GLAPI void APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); +GLAPI void APIENTRY glPopGroupMarkerEXT (void); +#endif +#endif /* GL_EXT_debug_marker */ + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax); +#endif +#endif /* GL_EXT_depth_bounds_test */ + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F +typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); +typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, void **data); +typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, void *img); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, void *img); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void **params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void **params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void *string); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void **param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void **param); +typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode); +GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glMatrixPopEXT (GLenum mode); +GLAPI void APIENTRY glMatrixPushEXT (GLenum mode); +GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask); +GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask); +GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture); +GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data); +GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data); +GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, void **data); +GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index); +GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index); +GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index); +GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data); +GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data); +GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, void *img); +GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, void *img); +GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI void *APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access); +GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer); +GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, void **params); +GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); +GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); +GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); +GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params); +GLAPI void APIENTRY glEnableClientStateiEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glDisableClientStateiEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glGetFloati_vEXT (GLenum pname, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetDoublei_vEXT (GLenum pname, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetPointeri_vEXT (GLenum pname, GLuint index, void **params); +GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); +GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, void *string); +GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target); +GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target); +GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target); +GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode); +GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode); +GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glVertexArrayVertexOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayEdgeFlagOffsetEXT (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayIndexOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayNormalOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayMultiTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayFogCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArraySecondaryColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayVertexAttribOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayVertexAttribIOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glEnableVertexArrayEXT (GLuint vaobj, GLenum array); +GLAPI void APIENTRY glDisableVertexArrayEXT (GLuint vaobj, GLenum array); +GLAPI void APIENTRY glEnableVertexArrayAttribEXT (GLuint vaobj, GLuint index); +GLAPI void APIENTRY glDisableVertexArrayAttribEXT (GLuint vaobj, GLuint index); +GLAPI void APIENTRY glGetVertexArrayIntegervEXT (GLuint vaobj, GLenum pname, GLint *param); +GLAPI void APIENTRY glGetVertexArrayPointervEXT (GLuint vaobj, GLenum pname, void **param); +GLAPI void APIENTRY glGetVertexArrayIntegeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, GLint *param); +GLAPI void APIENTRY glGetVertexArrayPointeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, void **param); +GLAPI void *APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glNamedBufferStorageEXT (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); +GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param); +GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x); +GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y); +GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glTextureBufferRangeEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI void APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glTextureStorage2DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTextureStorage3DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glVertexArrayBindVertexBufferEXT (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI void APIENTRY glVertexArrayVertexAttribFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribIFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribLFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribBindingEXT (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +GLAPI void APIENTRY glVertexArrayVertexBindingDivisorEXT (GLuint vaobj, GLuint bindingindex, GLuint divisor); +GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glTexturePageCommitmentEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); +GLAPI void APIENTRY glVertexArrayVertexAttribDivisorEXT (GLuint vaobj, GLuint index, GLuint divisor); +#endif +#endif /* GL_EXT_direct_state_access */ + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 +typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +#endif +#endif /* GL_EXT_draw_buffers2 */ + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#endif +#endif /* GL_EXT_draw_instanced */ + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +#endif +#endif /* GL_EXT_draw_range_elements */ + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const void *pointer); +#endif +#endif /* GL_EXT_fog_coord */ + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif +#endif /* GL_EXT_framebuffer_blit */ + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif +#endif /* GL_EXT_framebuffer_multisample */ + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer); +GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers); +GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer); +GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer); +GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers); +GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers); +GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target); +GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target); +#endif +#endif /* GL_EXT_framebuffer_object */ + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#endif /* GL_EXT_framebuffer_sRGB */ + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +#define GL_LINES_ADJACENCY_EXT 0x000A +#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B +#define GL_TRIANGLES_ADJACENCY_EXT 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); +#endif +#endif /* GL_EXT_geometry_shader4 */ + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#endif +#endif /* GL_EXT_gpu_program_parameters */ + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 +#define GL_MIN_PROGRAM_TEXEL_OFFSET_EXT 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_EXT 0x8905 +typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params); +GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name); +GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0); +GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value); +#endif +#endif /* GL_EXT_gpu_shader4 */ + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glResetHistogramEXT (GLenum target); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum target); +#endif +#endif /* GL_EXT_histogram */ + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif /* GL_EXT_index_array_formats */ + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref); +#endif +#endif /* GL_EXT_index_func */ + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode); +#endif +#endif /* GL_EXT_index_material */ + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#endif /* GL_EXT_index_texture */ + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyTextureEXT (GLenum mode); +GLAPI void APIENTRY glTextureLightEXT (GLenum pname); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode); +#endif +#endif /* GL_EXT_light_texture */ + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#endif /* GL_EXT_misc_attribute */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); +#endif +#endif /* GL_EXT_multi_draw_arrays */ + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern); +#endif +#endif /* GL_EXT_multisample */ + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 +#endif /* GL_EXT_packed_depth_stencil */ + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C +#endif /* GL_EXT_packed_float */ + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif /* GL_EXT_packed_pixels */ + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table); +GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, void *data); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +#endif +#endif /* GL_EXT_paletted_texture */ + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF +#endif /* GL_EXT_pixel_buffer_object */ + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetPixelTransformParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetPixelTransformParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +#endif +#endif /* GL_EXT_pixel_transform */ + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif /* GL_EXT_pixel_transform_color_table */ + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params); +#endif +#endif /* GL_EXT_point_parameters */ + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias); +#endif +#endif /* GL_EXT_polygon_offset */ + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode); +#endif +#endif /* GL_EXT_provoking_vertex */ + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif /* GL_EXT_rescale_normal */ + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer); +#endif +#endif /* GL_EXT_secondary_color */ + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D +typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); +typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program); +GLAPI void APIENTRY glActiveProgramEXT (GLuint program); +GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string); +#endif +#endif /* GL_EXT_separate_shader_objects */ + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif /* GL_EXT_separate_specular_color */ + +#ifndef GL_EXT_shader_image_load_formatted +#define GL_EXT_shader_image_load_formatted 1 +#endif /* GL_EXT_shader_image_load_formatted */ + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF +typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers); +#endif +#endif /* GL_EXT_shader_image_load_store */ + +#ifndef GL_EXT_shader_integer_mix +#define GL_EXT_shader_integer_mix 1 +#endif /* GL_EXT_shader_integer_mix */ + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +#endif /* GL_EXT_shadow_funcs */ + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif /* GL_EXT_shared_texture_palette */ + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 +typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag); +#endif +#endif /* GL_EXT_stencil_clear_tag */ + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face); +#endif +#endif /* GL_EXT_stencil_two_side */ + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif /* GL_EXT_stencil_wrap */ + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +#endif +#endif /* GL_EXT_subtexture */ + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif /* GL_EXT_texture */ + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +#endif +#endif /* GL_EXT_texture3D */ + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +#endif /* GL_EXT_texture_array */ + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E +typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); +#endif +#endif /* GL_EXT_texture_buffer_object */ + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 +#endif /* GL_EXT_texture_compression_latc */ + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#endif /* GL_EXT_texture_compression_rgtc */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif /* GL_EXT_texture_compression_s3tc */ + +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif /* GL_EXT_texture_cube_map */ + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif /* GL_EXT_texture_env_add */ + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#endif /* GL_EXT_texture_env_combine */ + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif /* GL_EXT_texture_env_dot3 */ + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif /* GL_EXT_texture_filter_anisotropic */ + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#endif +#endif /* GL_EXT_texture_integer */ + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif /* GL_EXT_texture_lod_bias */ + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 +#endif /* GL_EXT_texture_mirror_clamp */ + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif +#endif /* GL_EXT_texture_object */ + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); +#endif +#endif /* GL_EXT_texture_perturb_normal */ + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#endif /* GL_EXT_texture_sRGB */ + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A +#endif /* GL_EXT_texture_sRGB_decode */ + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F +#endif /* GL_EXT_texture_shared_exponent */ + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#endif /* GL_EXT_texture_snorm */ + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 +#endif /* GL_EXT_texture_swizzle */ + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 +#define GL_TIME_ELAPSED_EXT 0x88BF +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); +#endif +#endif /* GL_EXT_timer_query */ + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedbackEXT (void); +GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); +GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +#endif +#endif /* GL_EXT_transform_feedback */ + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, void **params); +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glArrayElementEXT (GLint i); +GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer); +GLAPI void APIENTRY glGetPointervEXT (GLenum pname, void **params); +GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +#endif +#endif /* GL_EXT_vertex_array */ + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 +#endif /* GL_EXT_vertex_array_bgra */ + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params); +#endif +#endif /* GL_EXT_vertex_attrib_64bit */ + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const void *addr); +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const void *addr); +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const void *addr); +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data); +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVertexShaderEXT (void); +GLAPI void APIENTRY glEndVertexShaderEXT (void); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id); +GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1); +GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num); +GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const void *addr); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const void *addr); +GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr); +GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr); +GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr); +GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr); +GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr); +GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr); +GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr); +GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr); +GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const void *addr); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, void **data); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +#endif +#endif /* GL_EXT_vertex_shader */ + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer); +#endif +#endif /* GL_EXT_vertex_weighting */ + +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 +#define GL_SYNC_X11_FENCE_EXT 0x90E1 +typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); +#endif +#endif /* GL_EXT_x11_sync_object */ + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 +typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); +#endif +#endif /* GL_GREMEDY_frame_terminator */ + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const void *string); +#endif +#endif /* GL_GREMEDY_string_marker */ + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif /* GL_HP_convolution_border_modes */ + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params); +#endif +#endif /* GL_HP_image_transform */ + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif /* GL_HP_occlusion_test */ + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif /* GL_HP_texture_lighting */ + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#define GL_CULL_VERTEX_IBM 103050 +#endif /* GL_IBM_cull_vertex */ + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride); +#endif +#endif /* GL_IBM_multimode_draw_arrays */ + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif /* GL_IBM_rasterpos_clip */ + +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 +typedef void (APIENTRYP PFNGLFLUSHSTATICDATAIBMPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushStaticDataIBM (GLenum target); +#endif +#endif /* GL_IBM_static_data */ + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif /* GL_IBM_texture_mirrored_repeat */ + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean **pointer, GLint ptrstride); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +#endif +#endif /* GL_IBM_vertex_array_lists */ + +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif +#endif /* GL_INGR_blend_func_separate */ + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif /* GL_INGR_color_clamp */ + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#define GL_INTERLACE_READ_INGR 0x8568 +#endif /* GL_INGR_interlace_read */ + +#ifndef GL_INTEL_fragment_shader_ordering +#define GL_INTEL_fragment_shader_ordering 1 +#endif /* GL_INTEL_fragment_shader_ordering */ + +#ifndef GL_INTEL_map_texture +#define GL_INTEL_map_texture 1 +#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF +#define GL_LAYOUT_DEFAULT_INTEL 0 +#define GL_LAYOUT_LINEAR_INTEL 1 +#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 +typedef void (APIENTRYP PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); +typedef void *(APIENTRYP PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSyncTextureINTEL (GLuint texture); +GLAPI void APIENTRY glUnmapTexture2DINTEL (GLuint texture, GLint level); +GLAPI void *APIENTRY glMapTexture2DINTEL (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout); +#endif +#endif /* GL_INTEL_map_texture */ + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void **pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const void **pointer); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const void **pointer); +GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const void **pointer); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const void **pointer); +#endif +#endif /* GL_INTEL_parallel_arrays */ + +#ifndef GL_INTEL_performance_query +#define GL_INTEL_performance_query 1 +#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 +#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 +#define GL_PERFQUERY_WAIT_INTEL 0x83FB +#define GL_PERFQUERY_FLUSH_INTEL 0x83FA +#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 +#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 +#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 +#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 +#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 +#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 +#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 +#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 +#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 +#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA +#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB +#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC +#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD +#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE +#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF +#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 +typedef void (APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle); +typedef void (APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId); +typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId); +typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); +typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten); +typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId); +typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle); +GLAPI void APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle); +GLAPI void APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle); +GLAPI void APIENTRY glEndPerfQueryINTEL (GLuint queryHandle); +GLAPI void APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId); +GLAPI void APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId); +GLAPI void APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); +GLAPI void APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten); +GLAPI void APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId); +GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); +#endif +#endif /* GL_INTEL_performance_query */ + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E +#endif /* GL_MESAX_texture_stack */ + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 +#define GL_PACK_INVERT_MESA 0x8758 +#endif /* GL_MESA_pack_invert */ + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glResizeBuffersMESA (void); +#endif +#endif /* GL_MESA_resize_buffers */ + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v); +#endif +#endif /* GL_MESA_window_pos */ + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 +#endif /* GL_MESA_ycbcr_texture */ + +#ifndef GL_NVX_conditional_render +#define GL_NVX_conditional_render 1 +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVXPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginConditionalRenderNVX (GLuint id); +GLAPI void APIENTRY glEndConditionalRenderNVX (void); +#endif +#endif /* GL_NVX_conditional_render */ + +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info 1 +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B +#endif /* GL_NVX_gpu_memory_info */ + +#ifndef GL_NV_bindless_multi_draw_indirect +#define GL_NV_bindless_multi_draw_indirect 1 +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +#endif +#endif /* GL_NV_bindless_multi_draw_indirect */ + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 +typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint64 APIENTRY glGetTextureHandleNV (GLuint texture); +GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler); +GLAPI void APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle); +GLAPI void APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle); +GLAPI GLuint64 APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +GLAPI void APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access); +GLAPI void APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle); +GLAPI void APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value); +GLAPI void APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value); +GLAPI void APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value); +GLAPI void APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +GLAPI GLboolean APIENTRY glIsTextureHandleResidentNV (GLuint64 handle); +GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); +#endif +#endif /* GL_NV_bindless_texture */ + +#ifndef GL_NV_blend_equation_advanced +#define GL_NV_blend_equation_advanced 1 +#define GL_BLEND_OVERLAP_NV 0x9281 +#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLUE_NV 0x1905 +#define GL_COLORBURN_NV 0x929A +#define GL_COLORDODGE_NV 0x9299 +#define GL_CONJOINT_NV 0x9284 +#define GL_CONTRAST_NV 0x92A1 +#define GL_DARKEN_NV 0x9297 +#define GL_DIFFERENCE_NV 0x929E +#define GL_DISJOINT_NV 0x9283 +#define GL_DST_ATOP_NV 0x928F +#define GL_DST_IN_NV 0x928B +#define GL_DST_NV 0x9287 +#define GL_DST_OUT_NV 0x928D +#define GL_DST_OVER_NV 0x9289 +#define GL_EXCLUSION_NV 0x92A0 +#define GL_GREEN_NV 0x1904 +#define GL_HARDLIGHT_NV 0x929B +#define GL_HARDMIX_NV 0x92A9 +#define GL_HSL_COLOR_NV 0x92AF +#define GL_HSL_HUE_NV 0x92AD +#define GL_HSL_LUMINOSITY_NV 0x92B0 +#define GL_HSL_SATURATION_NV 0x92AE +#define GL_INVERT_OVG_NV 0x92B4 +#define GL_INVERT_RGB_NV 0x92A3 +#define GL_LIGHTEN_NV 0x9298 +#define GL_LINEARBURN_NV 0x92A5 +#define GL_LINEARDODGE_NV 0x92A4 +#define GL_LINEARLIGHT_NV 0x92A7 +#define GL_MINUS_CLAMPED_NV 0x92B3 +#define GL_MINUS_NV 0x929F +#define GL_MULTIPLY_NV 0x9294 +#define GL_OVERLAY_NV 0x9296 +#define GL_PINLIGHT_NV 0x92A8 +#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 +#define GL_PLUS_CLAMPED_NV 0x92B1 +#define GL_PLUS_DARKER_NV 0x9292 +#define GL_PLUS_NV 0x9291 +#define GL_RED_NV 0x1903 +#define GL_SCREEN_NV 0x9295 +#define GL_SOFTLIGHT_NV 0x929C +#define GL_SRC_ATOP_NV 0x928E +#define GL_SRC_IN_NV 0x928A +#define GL_SRC_NV 0x9286 +#define GL_SRC_OUT_NV 0x928C +#define GL_SRC_OVER_NV 0x9288 +#define GL_UNCORRELATED_NV 0x9282 +#define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_XOR_NV 0x1506 +typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendParameteriNV (GLenum pname, GLint value); +GLAPI void APIENTRY glBlendBarrierNV (void); +#endif +#endif /* GL_NV_blend_equation_advanced */ + +#ifndef GL_NV_blend_equation_advanced_coherent +#define GL_NV_blend_equation_advanced_coherent 1 +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 +#endif /* GL_NV_blend_equation_advanced_coherent */ + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif /* GL_NV_blend_square */ + +#ifndef GL_NV_compute_program5 +#define GL_NV_compute_program5 1 +#define GL_COMPUTE_PROGRAM_NV 0x90FB +#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC +#endif /* GL_NV_compute_program5 */ + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); +GLAPI void APIENTRY glEndConditionalRenderNV (void); +#endif +#endif /* GL_NV_conditional_render */ + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif /* GL_NV_copy_depth_to_color */ + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 +typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif +#endif /* GL_NV_copy_image */ + +#ifndef GL_NV_deep_texture3D +#define GL_NV_deep_texture3D 1 +#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 +#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 +#endif /* GL_NV_deep_texture3D */ + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF +typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glClearDepthdNV (GLdouble depth); +GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax); +#endif +#endif /* GL_NV_depth_buffer_float */ + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +#define GL_DEPTH_CLAMP_NV 0x864F +#endif /* GL_NV_depth_clamp */ + +#ifndef GL_NV_draw_texture +#define GL_NV_draw_texture 1 +typedef void (APIENTRYP PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawTextureNV (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); +#endif +#endif /* GL_NV_draw_texture */ + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); +typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); +GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode); +#endif +#endif /* GL_NV_evaluators */ + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val); +GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask); +GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer); +#endif +#endif /* GL_NV_explicit_multisample */ + +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); +GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence); +GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); +GLAPI void APIENTRY glFinishFenceNV (GLuint fence); +GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition); +#endif +#endif /* GL_NV_fence */ + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E +#endif /* GL_NV_float_buffer */ + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +#endif /* GL_NV_fog_distance */ + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#endif +#endif /* GL_NV_fragment_program */ + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 +#endif /* GL_NV_fragment_program2 */ + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 +#endif /* GL_NV_fragment_program4 */ + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 +#endif /* GL_NV_fragment_program_option */ + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#endif +#endif /* GL_NV_framebuffer_multisample_coverage */ + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 +typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit); +GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif +#endif /* GL_NV_geometry_program4 */ + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 +#endif /* GL_NV_geometry_shader4 */ + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params); +GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params); +#endif +#endif /* GL_NV_gpu_program4 */ + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F +#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44 +#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45 +typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param); +#endif +#endif /* GL_NV_gpu_program5 */ + +#ifndef GL_NV_gpu_program5_mem_extended +#define GL_NV_gpu_program5_mem_extended 1 +#endif /* GL_NV_gpu_program5_mem_extended */ + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 +#endif /* GL_NV_gpu_shader5 */ + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +typedef unsigned short GLhalfNV; +#define GL_HALF_FLOAT_NV 0x140B +typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); +typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); +typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y); +GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s); +GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t); +GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s); +GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t); +GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog); +GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog); +GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight); +GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight); +GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x); +GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y); +GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +#endif +#endif /* GL_NV_half_float */ + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif /* GL_NV_light_max_exponent */ + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 +#define GL_COLOR_SAMPLES_NV 0x8E20 +#endif /* GL_NV_multisample_coverage */ + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif /* GL_NV_multisample_filter_hint */ + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id); +GLAPI void APIENTRY glEndOcclusionQueryNV (void); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params); +#endif +#endif /* GL_NV_occlusion_query */ + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif /* GL_NV_packed_depth_stencil */ + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params); +#endif +#endif /* GL_NV_parameter_buffer_object */ + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 +#endif /* GL_NV_parameter_buffer_object2 */ + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_CLOSE_PATH_NV 0x00 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_LINE_TO_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_BOLD_BIT_NV 0x01 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 +#define GL_FONT_ASCENDER_BIT_NV 0x00200000 +#define GL_FONT_DESCENDER_BIT_NV 0x00400000 +#define GL_FONT_HEIGHT_BIT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 +#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC) (GLuint path); +typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); +typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); +typedef void (APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value); +typedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value); +typedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray); +typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func); +typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); +typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); +typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value); +typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value); +typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands); +typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords); +typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray); +typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); +typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint *value); +typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat *value); +typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint *value); +typedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat *value); +typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range); +GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range); +GLAPI GLboolean APIENTRY glIsPathNV (GLuint path); +GLAPI void APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +GLAPI void APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); +GLAPI void APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +GLAPI void APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); +GLAPI void APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString); +GLAPI void APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI void APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI void APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); +GLAPI void APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath); +GLAPI void APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +GLAPI void APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value); +GLAPI void APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value); +GLAPI void APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value); +GLAPI void APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value); +GLAPI void APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray); +GLAPI void APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask); +GLAPI void APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units); +GLAPI void APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask); +GLAPI void APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask); +GLAPI void APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glPathCoverDepthFuncNV (GLenum func); +GLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); +GLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); +GLAPI void APIENTRY glPathFogGenNV (GLenum genMode); +GLAPI void APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode); +GLAPI void APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode); +GLAPI void APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value); +GLAPI void APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value); +GLAPI void APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands); +GLAPI void APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords); +GLAPI void APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray); +GLAPI void APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +GLAPI void APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); +GLAPI void APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +GLAPI void APIENTRY glGetPathColorGenivNV (GLenum color, GLenum pname, GLint *value); +GLAPI void APIENTRY glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat *value); +GLAPI void APIENTRY glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint *value); +GLAPI void APIENTRY glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat *value); +GLAPI GLboolean APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y); +GLAPI GLboolean APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y); +GLAPI GLfloat APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments); +GLAPI GLboolean APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +#endif +#endif /* GL_NV_path_rendering */ + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, const void *pointer); +typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, const void *pointer); +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target); +#endif +#endif /* GL_NV_pixel_data_range */ + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param); +GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params); +#endif +#endif /* GL_NV_point_sprite */ + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B +typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params); +GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params); +#endif +#endif /* GL_NV_present_video */ + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPrimitiveRestartNV (void); +GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index); +#endif +#endif /* GL_NV_primitive_restart */ + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param); +GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params); +#endif +#endif /* GL_NV_register_combiners */ + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params); +#endif +#endif /* GL_NV_register_combiners2 */ + +#ifndef GL_NV_shader_atomic_counters +#define GL_NV_shader_atomic_counters 1 +#endif /* GL_NV_shader_atomic_counters */ + +#ifndef GL_NV_shader_atomic_float +#define GL_NV_shader_atomic_float 1 +#endif /* GL_NV_shader_atomic_float */ + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 +typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result); +typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access); +GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target); +GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target); +GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access); +GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer); +GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer); +GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result); +GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value); +GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value); +GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif +#endif /* GL_NV_shader_buffer_load */ + +#ifndef GL_NV_shader_buffer_store +#define GL_NV_shader_buffer_store 1 +#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 +#endif /* GL_NV_shader_buffer_store */ + +#ifndef GL_NV_shader_storage_buffer_object +#define GL_NV_shader_storage_buffer_object 1 +#endif /* GL_NV_shader_storage_buffer_object */ + +#ifndef GL_NV_shader_thread_group +#define GL_NV_shader_thread_group 1 +#define GL_WARP_SIZE_NV 0x9339 +#define GL_WARPS_PER_SM_NV 0x933A +#define GL_SM_COUNT_NV 0x933B +#endif /* GL_NV_shader_thread_group */ + +#ifndef GL_NV_shader_thread_shuffle +#define GL_NV_shader_thread_shuffle 1 +#endif /* GL_NV_shader_thread_shuffle */ + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 +#endif /* GL_NV_tessellation_program5 */ + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif /* GL_NV_texgen_emboss */ + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif /* GL_NV_texgen_reflection */ + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 +typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureBarrierNV (void); +#endif +#endif /* GL_NV_texture_barrier */ + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#endif /* GL_NV_texture_compression_vtc */ + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif /* GL_NV_texture_env_combine4 */ + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F +#endif /* GL_NV_texture_expand_normal */ + +#ifndef GL_NV_texture_multisample +#define GL_NV_texture_multisample 1 +#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 +#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +#endif +#endif /* GL_NV_texture_multisample */ + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 +#endif /* GL_NV_texture_rectangle */ + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#endif /* GL_NV_texture_shader */ + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif /* GL_NV_texture_shader2 */ + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#endif /* GL_NV_texture_shader3 */ + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F +#define GL_LAYER_NV 0x8DAA +#define GL_NEXT_BUFFER_NV -2 +#define GL_SKIP_COMPONENTS4_NV -3 +#define GL_SKIP_COMPONENTS3_NV -4 +#define GL_SKIP_COMPONENTS2_NV -5 +#define GL_SKIP_COMPONENTS1_NV -6 +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedbackNV (void); +GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode); +GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name); +GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location); +GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); +#endif +#endif /* GL_NV_transform_feedback */ + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids); +GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids); +GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id); +GLAPI void APIENTRY glPauseTransformFeedbackNV (void); +GLAPI void APIENTRY glResumeTransformFeedbackNV (void); +GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id); +#endif +#endif /* GL_NV_transform_feedback2 */ + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 +typedef GLintptr GLvdpauSurfaceNV; +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE +typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const void *vdpDevice, const void *getProcAddress); +typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); +typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVDPAUInitNV (const void *vdpDevice, const void *getProcAddress); +GLAPI void APIENTRY glVDPAUFiniNV (void); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI GLboolean APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access); +GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); +GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); +#endif +#endif /* GL_NV_vdpau_interop */ + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const void *pointer); +#endif +#endif /* GL_NV_vertex_array_range */ + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif /* GL_NV_vertex_array_range2 */ + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x); +GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x); +GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); +#endif +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 +typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride); +GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result); +#endif +#endif /* GL_NV_vertex_buffer_unified_memory */ + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void **pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences); +GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params); +GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, void **pointer); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id); +GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v); +#endif +#endif /* GL_NV_vertex_program */ + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +#endif /* GL_NV_vertex_program1_1 */ + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +#endif /* GL_NV_vertex_program2 */ + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 +#endif /* GL_NV_vertex_program2_option */ + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 +#endif /* GL_NV_vertex_program3 */ + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params); +#endif +#endif /* GL_NV_vertex_program4 */ + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C +typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); +typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot); +GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot); +GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); +GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); +GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); +GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); +#endif +#endif /* GL_NV_video_capture */ + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#endif /* GL_OML_interlace */ + +#ifndef GL_OML_resample +#define GL_OML_resample 1 +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#endif /* GL_OML_resample */ + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#endif /* GL_OML_subsample */ + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode); +#endif +#endif /* GL_PGI_misc_hints */ + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif /* GL_PGI_vertex_hints */ + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif /* GL_REND_screen_coordinates */ + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 +#endif /* GL_S3_s3tc */ + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points); +#endif +#endif /* GL_SGIS_detail_texture */ + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points); +#endif +#endif /* GL_SGIS_fog_function */ + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif /* GL_SGIS_generate_mipmap */ + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern); +#endif +#endif /* GL_SGIS_multisample */ + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params); +#endif +#endif /* GL_SGIS_pixel_texture */ + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif /* GL_SGIS_point_line_texgen */ + +#ifndef GL_SGIS_point_parameters +#define GL_SGIS_point_parameters 1 +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params); +#endif +#endif /* GL_SGIS_point_parameters */ + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points); +#endif +#endif /* GL_SGIS_sharpen_texture */ + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels); +#endif +#endif /* GL_SGIS_texture4D */ + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif /* GL_SGIS_texture_border_clamp */ + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif +#endif /* GL_SGIS_texture_color_mask */ + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif /* GL_SGIS_texture_edge_clamp */ + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif +#endif /* GL_SGIS_texture_filter4 */ + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif /* GL_SGIS_texture_lod */ + +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif /* GL_SGIS_texture_select */ + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#define GL_ASYNC_MARKER_SGIX 0x8329 +typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker); +#endif +#endif /* GL_SGIX_async */ + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif /* GL_SGIX_async_histogram */ + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif /* GL_SGIX_async_pixel */ + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif /* GL_SGIX_blend_alpha_minmax */ + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif /* GL_SGIX_calligraphic_fragment */ + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif /* GL_SGIX_clipmap */ + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif /* GL_SGIX_convolution_accuracy */ + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif /* GL_SGIX_depth_pass_instrument */ + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif /* GL_SGIX_depth_texture */ + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushRasterSGIX (void); +#endif +#endif /* GL_SGIX_flush_raster */ + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif /* GL_SGIX_fog_offset */ + +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params); +GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param); +#endif +#endif /* GL_SGIX_fragment_lighting */ + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameZoomSGIX (GLint factor); +#endif +#endif /* GL_SGIX_framezoom */ + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const void *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const void *params); +#endif +#endif /* GL_SGIX_igloo_interface */ + +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker); +GLAPI void APIENTRY glStartInstrumentsSGIX (void); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker); +#endif +#endif /* GL_SGIX_instruments */ + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#define GL_INTERLACE_SGIX 0x8094 +#endif /* GL_SGIX_interlace */ + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif /* GL_SGIX_ir_instrument1 */ + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#define GL_LIST_PRIORITY_SGIX 0x8182 +typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params); +GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param); +GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params); +#endif +#endif /* GL_SGIX_list_priority */ + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode); +#endif +#endif /* GL_SGIX_pixel_texture */ + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif /* GL_SGIX_pixel_tiles */ + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +GLAPI void APIENTRY glDeformSGIX (GLbitfield mask); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask); +#endif +#endif /* GL_SGIX_polynomial_ffd */ + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation); +#endif +#endif /* GL_SGIX_reference_plane */ + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif /* GL_SGIX_resample */ + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#endif /* GL_SGIX_scalebias_hint */ + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif /* GL_SGIX_shadow */ + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif /* GL_SGIX_shadow_ambient */ + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params); +#endif +#endif /* GL_SGIX_sprite */ + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif /* GL_SGIX_subsample */ + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTagSampleBufferSGIX (void); +#endif +#endif /* GL_SGIX_tag_sample_buffer */ + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif /* GL_SGIX_texture_add_env */ + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#endif /* GL_SGIX_texture_coordinate_clamp */ + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif /* GL_SGIX_texture_lod_bias */ + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif /* GL_SGIX_texture_multi_buffer */ + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif /* GL_SGIX_texture_scale_bias */ + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif /* GL_SGIX_vertex_preclip */ + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif /* GL_SGIX_ycrcb */ + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif /* GL_SGIX_ycrcb_subsample */ + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif /* GL_SGIX_ycrcba */ + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif /* GL_SGI_color_matrix */ + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, void *table); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params); +#endif +#endif /* GL_SGI_color_table */ + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif /* GL_SGI_texture_color_table */ + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFinishTextureSUNX (void); +#endif +#endif /* GL_SUNX_constant_data */ + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif /* GL_SUN_convolution_border_modes */ + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor); +#endif +#endif /* GL_SUN_global_alpha */ + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif +#endif /* GL_SUN_mesh_array */ + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +#define GL_SLICE_ACCUM_SUN 0x85CC +#endif /* GL_SUN_slice_accum */ + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void **pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const void **pointer); +#endif +#endif /* GL_SUN_triangle_list */ + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif +#endif /* GL_SUN_vertex */ + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif /* GL_WIN_phong_shading */ + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif /* GL_WIN_specular_fog */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_opengles.h b/Src/Decoder_H264_ALL/include/SDL/SDL_opengles.h new file mode 100644 index 0000000..bcc1277 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_opengles.h @@ -0,0 +1,38 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_opengles.h + * + * This is a simple file to encapsulate the OpenGL ES 1.X API headers. + */ + +#ifdef __IPHONEOS__ +#include +#include +#else +#include +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2.h b/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2.h new file mode 100644 index 0000000..edcd1a2 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2.h @@ -0,0 +1,50 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_opengles2.h + * + * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. + */ +#ifndef _MSC_VER + +#ifdef __IPHONEOS__ +#include +#include +#else +#include +#include +#include +#endif + +#else /* _MSC_VER */ + +/* OpenGL ES2 headers for Visual Studio */ +#include "SDL_opengles2_khrplatform.h" +#include "SDL_opengles2_gl2platform.h" +#include "SDL_opengles2_gl2.h" +#include "SDL_opengles2_gl2ext.h" + +#endif /* _MSC_VER */ + +#ifndef APIENTRY +#define APIENTRY GL_APIENTRY +#endif diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2_gl2.h b/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2_gl2.h new file mode 100644 index 0000000..c62fb0a --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2_gl2.h @@ -0,0 +1,621 @@ +#ifndef __gl2_h_ +#define __gl2_h_ + +/* $Revision: 20555 $ on $Date:: 2013-02-12 14:32:47 -0800 #$ */ + +/*#include */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This document is licensed under the SGI Free Software B License Version + * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . + */ + +/*------------------------------------------------------------------------- + * Data type definitions + *-----------------------------------------------------------------------*/ + +typedef void GLvoid; +typedef char GLchar; +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef khronos_int8_t GLbyte; +typedef short GLshort; +typedef int GLint; +typedef int GLsizei; +typedef khronos_uint8_t GLubyte; +typedef unsigned short GLushort; +typedef unsigned int GLuint; +typedef khronos_float_t GLfloat; +typedef khronos_float_t GLclampf; +typedef khronos_int32_t GLfixed; + +/* GL types for handling large vertex buffer objects */ +typedef khronos_intptr_t GLintptr; +typedef khronos_ssize_t GLsizeiptr; + +/* OpenGL ES core versions */ +#define GL_ES_VERSION_2_0 1 + +/* ClearBufferMask */ +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_COLOR_BUFFER_BIT 0x00004000 + +/* Boolean */ +#define GL_FALSE 0 +#define GL_TRUE 1 + +/* BeginMode */ +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 + +/* AlphaFunction (not supported in ES20) */ +/* GL_NEVER */ +/* GL_LESS */ +/* GL_EQUAL */ +/* GL_LEQUAL */ +/* GL_GREATER */ +/* GL_NOTEQUAL */ +/* GL_GEQUAL */ +/* GL_ALWAYS */ + +/* BlendingFactorDest */ +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 + +/* BlendingFactorSrc */ +/* GL_ZERO */ +/* GL_ONE */ +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +/* GL_SRC_ALPHA */ +/* GL_ONE_MINUS_SRC_ALPHA */ +/* GL_DST_ALPHA */ +/* GL_ONE_MINUS_DST_ALPHA */ + +/* BlendEquationSeparate */ +#define GL_FUNC_ADD 0x8006 +#define GL_BLEND_EQUATION 0x8009 +#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */ +#define GL_BLEND_EQUATION_ALPHA 0x883D + +/* BlendSubtract */ +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B + +/* Separate Blend Functions */ +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 + +/* Buffer Objects */ +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 + +#define GL_STREAM_DRAW 0x88E0 +#define GL_STATIC_DRAW 0x88E4 +#define GL_DYNAMIC_DRAW 0x88E8 + +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 + +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 + +/* CullFaceMode */ +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_FRONT_AND_BACK 0x0408 + +/* DepthFunction */ +/* GL_NEVER */ +/* GL_LESS */ +/* GL_EQUAL */ +/* GL_LEQUAL */ +/* GL_GREATER */ +/* GL_NOTEQUAL */ +/* GL_GEQUAL */ +/* GL_ALWAYS */ + +/* EnableCap */ +#define GL_TEXTURE_2D 0x0DE1 +#define GL_CULL_FACE 0x0B44 +#define GL_BLEND 0x0BE2 +#define GL_DITHER 0x0BD0 +#define GL_STENCIL_TEST 0x0B90 +#define GL_DEPTH_TEST 0x0B71 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_COVERAGE 0x80A0 + +/* ErrorCode */ +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_OUT_OF_MEMORY 0x0505 + +/* FrontFaceDirection */ +#define GL_CW 0x0900 +#define GL_CCW 0x0901 + +/* GetPName */ +#define GL_LINE_WIDTH 0x0B21 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +/* GL_SCISSOR_TEST */ +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +/* GL_POLYGON_OFFSET_FILL */ +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB + +/* GetTextureParameter */ +/* GL_TEXTURE_MAG_FILTER */ +/* GL_TEXTURE_MIN_FILTER */ +/* GL_TEXTURE_WRAP_S */ +/* GL_TEXTURE_WRAP_T */ + +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 + +/* HintMode */ +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 + +/* HintTarget */ +#define GL_GENERATE_MIPMAP_HINT 0x8192 + +/* DataType */ +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_FIXED 0x140C + +/* PixelFormat */ +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A + +/* PixelType */ +/* GL_UNSIGNED_BYTE */ +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 + +/* Shaders */ +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#define GL_SHADER_TYPE 0x8B4F +#define GL_DELETE_STATUS 0x8B80 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D + +/* StencilFunction */ +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 + +/* StencilOp */ +/* GL_ZERO */ +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_INVERT 0x150A +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 + +/* StringName */ +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 + +/* TextureMagFilter */ +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 + +/* TextureMinFilter */ +/* GL_NEAREST */ +/* GL_LINEAR */ +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 + +/* TextureParameterName */ +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 + +/* TextureTarget */ +/* GL_TEXTURE_2D */ +#define GL_TEXTURE 0x1702 + +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C + +/* TextureUnit */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 + +/* TextureWrapMode */ +#define GL_REPEAT 0x2901 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_MIRRORED_REPEAT 0x8370 + +/* Uniform Types */ +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_CUBE 0x8B60 + +/* Vertex Arrays */ +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F + +/* Read Format */ +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B + +/* Shader Source */ +#define GL_COMPILE_STATUS 0x8B81 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_SHADER_COMPILER 0x8DFA + +/* Shader Binary */ +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 + +/* Shader Precision-Specified Types */ +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 + +/* Framebuffer Object. */ +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 + +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGB565 0x8D62 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_STENCIL_INDEX8 0x8D48 + +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 + +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 + +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 + +#define GL_NONE 0 + +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD + +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 + +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 + +/*------------------------------------------------------------------------- + * GL core functions. + *-----------------------------------------------------------------------*/ + +GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); +GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); +GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name); +GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); +GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); +GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); +GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode ); +GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); +GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); +GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); +GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); +GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); +GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth); +GL_APICALL void GL_APIENTRY glClearStencil (GLint s); +GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); +GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data); +GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data); +GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); +GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); +GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); +GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers); +GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers); +GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); +GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers); +GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); +GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures); +GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); +GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); +GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar); +GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); +GL_APICALL void GL_APIENTRY glDisable (GLenum cap); +GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); +GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices); +GL_APICALL void GL_APIENTRY glEnable (GLenum cap); +GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); +GL_APICALL void GL_APIENTRY glFinish (void); +GL_APICALL void GL_APIENTRY glFlush (void); +GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); +GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers); +GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); +GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers); +GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers); +GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures); +GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); +GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name); +GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params); +GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params); +GL_APICALL GLenum GL_APIENTRY glGetError (void); +GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params); +GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog); +GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog); +GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); +GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); +GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name); +GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params); +GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params); +GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params); +GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name); +GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params); +GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params); +GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer); +GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); +GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); +GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); +GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); +GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); +GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); +GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); +GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); +GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); +GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); +GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); +GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); +GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); +GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length); +GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length); +GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); +GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass); +GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels); +GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params); +GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params); +GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels); +GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x); +GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v); +GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x); +GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v); +GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y); +GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v); +GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y); +GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v); +GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z); +GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v); +GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z); +GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v); +GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v); +GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w); +GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v); +GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); +GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); +GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x); +GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values); +GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y); +GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values); +GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z); +GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values); +GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values); +GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr); +GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#ifdef __cplusplus +} +#endif + +#endif /* __gl2_h_ */ + diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2_gl2ext.h b/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2_gl2ext.h new file mode 100644 index 0000000..e8ca8b1 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2_gl2ext.h @@ -0,0 +1,2050 @@ +#ifndef __gl2ext_h_ +#define __gl2ext_h_ + +/* $Revision: 22801 $ on $Date:: 2013-08-21 03:20:48 -0700 #$ */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * This document is licensed under the SGI Free Software B License Version + * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . + */ + +#ifndef GL_APIENTRYP +# define GL_APIENTRYP GL_APIENTRY* +#endif + +/* New types shared by several extensions */ + +#ifndef __gl3_h_ +/* These are defined with respect to in the + * Apple extension spec, but they are also used by non-APPLE + * extensions, and in the Khronos header we use the Khronos + * portable types in khrplatform.h, which must be defined. + */ +typedef khronos_int64_t GLint64; +typedef khronos_uint64_t GLuint64; +typedef struct __GLsync *GLsync; +#endif + + +/*------------------------------------------------------------------------* + * OES extension tokens + *------------------------------------------------------------------------*/ + +/* GL_OES_compressed_ETC1_RGB8_texture */ +#ifndef GL_OES_compressed_ETC1_RGB8_texture +#define GL_ETC1_RGB8_OES 0x8D64 +#endif + +/* GL_OES_compressed_paletted_texture */ +#ifndef GL_OES_compressed_paletted_texture +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 +#endif + +/* GL_OES_depth24 */ +#ifndef GL_OES_depth24 +#define GL_DEPTH_COMPONENT24_OES 0x81A6 +#endif + +/* GL_OES_depth32 */ +#ifndef GL_OES_depth32 +#define GL_DEPTH_COMPONENT32_OES 0x81A7 +#endif + +/* GL_OES_depth_texture */ +/* No new tokens introduced by this extension. */ + +/* GL_OES_EGL_image */ +#ifndef GL_OES_EGL_image +typedef void* GLeglImageOES; +#endif + +/* GL_OES_EGL_image_external */ +#ifndef GL_OES_EGL_image_external +/* GLeglImageOES defined in GL_OES_EGL_image already. */ +#define GL_TEXTURE_EXTERNAL_OES 0x8D65 +#define GL_SAMPLER_EXTERNAL_OES 0x8D66 +#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 +#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 +#endif + +/* GL_OES_element_index_uint */ +#ifndef GL_OES_element_index_uint +#define GL_UNSIGNED_INT 0x1405 +#endif + +/* GL_OES_get_program_binary */ +#ifndef GL_OES_get_program_binary +#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE +#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF +#endif + +/* GL_OES_mapbuffer */ +#ifndef GL_OES_mapbuffer +#define GL_WRITE_ONLY_OES 0x88B9 +#define GL_BUFFER_ACCESS_OES 0x88BB +#define GL_BUFFER_MAPPED_OES 0x88BC +#define GL_BUFFER_MAP_POINTER_OES 0x88BD +#endif + +/* GL_OES_packed_depth_stencil */ +#ifndef GL_OES_packed_depth_stencil +#define GL_DEPTH_STENCIL_OES 0x84F9 +#define GL_UNSIGNED_INT_24_8_OES 0x84FA +#define GL_DEPTH24_STENCIL8_OES 0x88F0 +#endif + +/* GL_OES_required_internalformat */ +#ifndef GL_OES_required_internalformat +#define GL_ALPHA8_OES 0x803C +#define GL_DEPTH_COMPONENT16_OES 0x81A5 +/* reuse GL_DEPTH_COMPONENT24_OES */ +/* reuse GL_DEPTH24_STENCIL8_OES */ +/* reuse GL_DEPTH_COMPONENT32_OES */ +#define GL_LUMINANCE4_ALPHA4_OES 0x8043 +#define GL_LUMINANCE8_ALPHA8_OES 0x8045 +#define GL_LUMINANCE8_OES 0x8040 +#define GL_RGBA4_OES 0x8056 +#define GL_RGB5_A1_OES 0x8057 +#define GL_RGB565_OES 0x8D62 +/* reuse GL_RGB8_OES */ +/* reuse GL_RGBA8_OES */ +/* reuse GL_RGB10_EXT */ +/* reuse GL_RGB10_A2_EXT */ +#endif + +/* GL_OES_rgb8_rgba8 */ +#ifndef GL_OES_rgb8_rgba8 +#define GL_RGB8_OES 0x8051 +#define GL_RGBA8_OES 0x8058 +#endif + +/* GL_OES_standard_derivatives */ +#ifndef GL_OES_standard_derivatives +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B +#endif + +/* GL_OES_stencil1 */ +#ifndef GL_OES_stencil1 +#define GL_STENCIL_INDEX1_OES 0x8D46 +#endif + +/* GL_OES_stencil4 */ +#ifndef GL_OES_stencil4 +#define GL_STENCIL_INDEX4_OES 0x8D47 +#endif + +#ifndef GL_OES_surfaceless_context +#define GL_FRAMEBUFFER_UNDEFINED_OES 0x8219 +#endif + +/* GL_OES_texture_3D */ +#ifndef GL_OES_texture_3D +#define GL_TEXTURE_WRAP_R_OES 0x8072 +#define GL_TEXTURE_3D_OES 0x806F +#define GL_TEXTURE_BINDING_3D_OES 0x806A +#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073 +#define GL_SAMPLER_3D_OES 0x8B5F +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4 +#endif + +/* GL_OES_texture_float */ +/* No new tokens introduced by this extension. */ + +/* GL_OES_texture_float_linear */ +/* No new tokens introduced by this extension. */ + +/* GL_OES_texture_half_float */ +#ifndef GL_OES_texture_half_float +#define GL_HALF_FLOAT_OES 0x8D61 +#endif + +/* GL_OES_texture_half_float_linear */ +/* No new tokens introduced by this extension. */ + +/* GL_OES_texture_npot */ +/* No new tokens introduced by this extension. */ + +/* GL_OES_vertex_array_object */ +#ifndef GL_OES_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 +#endif + +/* GL_OES_vertex_half_float */ +/* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */ + +/* GL_OES_vertex_type_10_10_10_2 */ +#ifndef GL_OES_vertex_type_10_10_10_2 +#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6 +#define GL_INT_10_10_10_2_OES 0x8DF7 +#endif + +/*------------------------------------------------------------------------* + * KHR extension tokens + *------------------------------------------------------------------------*/ + +#ifndef GL_KHR_debug +typedef void (GL_APIENTRYP GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245 +#define GL_DEBUG_SOURCE_API_KHR 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A +#define GL_DEBUG_SOURCE_OTHER_KHR 0x824B +#define GL_DEBUG_TYPE_ERROR_KHR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250 +#define GL_DEBUG_TYPE_OTHER_KHR 0x8251 +#define GL_DEBUG_TYPE_MARKER_KHR 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D +#define GL_BUFFER_KHR 0x82E0 +#define GL_SHADER_KHR 0x82E1 +#define GL_PROGRAM_KHR 0x82E2 +#define GL_QUERY_KHR 0x82E3 +/* PROGRAM_PIPELINE only in GL */ +#define GL_SAMPLER_KHR 0x82E6 +/* DISPLAY_LIST only in GL */ +#define GL_MAX_LABEL_LENGTH_KHR 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147 +#define GL_DEBUG_SEVERITY_LOW_KHR 0x9148 +#define GL_DEBUG_OUTPUT_KHR 0x92E0 +#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002 +#define GL_STACK_OVERFLOW_KHR 0x0503 +#define GL_STACK_UNDERFLOW_KHR 0x0504 +#endif + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD +#endif + +/*------------------------------------------------------------------------* + * AMD extension tokens + *------------------------------------------------------------------------*/ + +/* GL_AMD_compressed_3DC_texture */ +#ifndef GL_AMD_compressed_3DC_texture +#define GL_3DC_X_AMD 0x87F9 +#define GL_3DC_XY_AMD 0x87FA +#endif + +/* GL_AMD_compressed_ATC_texture */ +#ifndef GL_AMD_compressed_ATC_texture +#define GL_ATC_RGB_AMD 0x8C92 +#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 +#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE +#endif + +/* GL_AMD_performance_monitor */ +#ifndef GL_AMD_performance_monitor +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 +#endif + +/* GL_AMD_program_binary_Z400 */ +#ifndef GL_AMD_program_binary_Z400 +#define GL_Z400_BINARY_AMD 0x8740 +#endif + +/*------------------------------------------------------------------------* + * ANGLE extension tokens + *------------------------------------------------------------------------*/ + +/* GL_ANGLE_depth_texture */ +#ifndef GL_ANGLE_depth_texture +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_DEPTH_STENCIL_OES 0x84F9 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_UNSIGNED_INT 0x1405 +#define GL_UNSIGNED_INT_24_8_OES 0x84FA +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT32_OES 0x81A7 +#define GL_DEPTH24_STENCIL8_OES 0x88F0 +#endif + +/* GL_ANGLE_framebuffer_blit */ +#ifndef GL_ANGLE_framebuffer_blit +#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA +#endif + +/* GL_ANGLE_framebuffer_multisample */ +#ifndef GL_ANGLE_framebuffer_multisample +#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 +#define GL_MAX_SAMPLES_ANGLE 0x8D57 +#endif + +/* GL_ANGLE_instanced_arrays */ +#ifndef GL_ANGLE_instanced_arrays +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE +#endif + +/* GL_ANGLE_pack_reverse_row_order */ +#ifndef GL_ANGLE_pack_reverse_row_order +#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 +#endif + +/* GL_ANGLE_program_binary */ +#ifndef GL_ANGLE_program_binary +#define GL_PROGRAM_BINARY_ANGLE 0x93A6 +#endif + +/* GL_ANGLE_texture_compression_dxt3 */ +#ifndef GL_ANGLE_texture_compression_dxt3 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#endif + +/* GL_ANGLE_texture_compression_dxt5 */ +#ifndef GL_ANGLE_texture_compression_dxt5 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 +#endif + +/* GL_ANGLE_texture_usage */ +#ifndef GL_ANGLE_texture_usage +#define GL_TEXTURE_USAGE_ANGLE 0x93A2 +#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 +#endif + +/* GL_ANGLE_translated_shader_source */ +#ifndef GL_ANGLE_translated_shader_source +#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 +#endif + +/*------------------------------------------------------------------------* + * APPLE extension tokens + *------------------------------------------------------------------------*/ + +/* GL_APPLE_copy_texture_levels */ +/* No new tokens introduced by this extension. */ + +/* GL_APPLE_framebuffer_multisample */ +#ifndef GL_APPLE_framebuffer_multisample +#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 +#define GL_MAX_SAMPLES_APPLE 0x8D57 +#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA +#endif + +/* GL_APPLE_rgb_422 */ +#ifndef GL_APPLE_rgb_422 +#define GL_RGB_422_APPLE 0x8A1F +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#endif + +/* GL_APPLE_sync */ +#ifndef GL_APPLE_sync + +#define GL_SYNC_OBJECT_APPLE 0x8A53 +#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 +#define GL_OBJECT_TYPE_APPLE 0x9112 +#define GL_SYNC_CONDITION_APPLE 0x9113 +#define GL_SYNC_STATUS_APPLE 0x9114 +#define GL_SYNC_FLAGS_APPLE 0x9115 +#define GL_SYNC_FENCE_APPLE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 +#define GL_UNSIGNALED_APPLE 0x9118 +#define GL_SIGNALED_APPLE 0x9119 +#define GL_ALREADY_SIGNALED_APPLE 0x911A +#define GL_TIMEOUT_EXPIRED_APPLE 0x911B +#define GL_CONDITION_SATISFIED_APPLE 0x911C +#define GL_WAIT_FAILED_APPLE 0x911D +#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 +#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull +#endif + +/* GL_APPLE_texture_format_BGRA8888 */ +#ifndef GL_APPLE_texture_format_BGRA8888 +#define GL_BGRA_EXT 0x80E1 +#endif + +/* GL_APPLE_texture_max_level */ +#ifndef GL_APPLE_texture_max_level +#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D +#endif + +/*------------------------------------------------------------------------* + * ARM extension tokens + *------------------------------------------------------------------------*/ + +/* GL_ARM_mali_program_binary */ +#ifndef GL_ARM_mali_program_binary +#define GL_MALI_PROGRAM_BINARY_ARM 0x8F61 +#endif + +/* GL_ARM_mali_shader_binary */ +#ifndef GL_ARM_mali_shader_binary +#define GL_MALI_SHADER_BINARY_ARM 0x8F60 +#endif + +/* GL_ARM_rgba8 */ +/* No new tokens introduced by this extension. */ + +/*------------------------------------------------------------------------* + * EXT extension tokens + *------------------------------------------------------------------------*/ + +/* GL_EXT_blend_minmax */ +#ifndef GL_EXT_blend_minmax +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#endif + +/* GL_EXT_color_buffer_half_float */ +#ifndef GL_EXT_color_buffer_half_float +#define GL_RGBA16F_EXT 0x881A +#define GL_RGB16F_EXT 0x881B +#define GL_RG16F_EXT 0x822F +#define GL_R16F_EXT 0x822D +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211 +#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17 +#endif + +/* GL_EXT_debug_label */ +#ifndef GL_EXT_debug_label +#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F +#define GL_PROGRAM_OBJECT_EXT 0x8B40 +#define GL_SHADER_OBJECT_EXT 0x8B48 +#define GL_BUFFER_OBJECT_EXT 0x9151 +#define GL_QUERY_OBJECT_EXT 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 +#endif + +/* GL_EXT_debug_marker */ +/* No new tokens introduced by this extension. */ + +/* GL_EXT_discard_framebuffer */ +#ifndef GL_EXT_discard_framebuffer +#define GL_COLOR_EXT 0x1800 +#define GL_DEPTH_EXT 0x1801 +#define GL_STENCIL_EXT 0x1802 +#endif + +#ifndef GL_EXT_disjoint_timer_query +#define GL_QUERY_COUNTER_BITS_EXT 0x8864 +#define GL_CURRENT_QUERY_EXT 0x8865 +#define GL_QUERY_RESULT_EXT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867 +#define GL_TIME_ELAPSED_EXT 0x88BF +#define GL_TIMESTAMP_EXT 0x8E28 +#define GL_GPU_DISJOINT_EXT 0x8FBB +#endif + +#ifndef GL_EXT_draw_buffers +#define GL_EXT_draw_buffers 1 +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_MAX_DRAW_BUFFERS_EXT 0x8824 +#define GL_DRAW_BUFFER0_EXT 0x8825 +#define GL_DRAW_BUFFER1_EXT 0x8826 +#define GL_DRAW_BUFFER2_EXT 0x8827 +#define GL_DRAW_BUFFER3_EXT 0x8828 +#define GL_DRAW_BUFFER4_EXT 0x8829 +#define GL_DRAW_BUFFER5_EXT 0x882A +#define GL_DRAW_BUFFER6_EXT 0x882B +#define GL_DRAW_BUFFER7_EXT 0x882C +#define GL_DRAW_BUFFER8_EXT 0x882D +#define GL_DRAW_BUFFER9_EXT 0x882E +#define GL_DRAW_BUFFER10_EXT 0x882F +#define GL_DRAW_BUFFER11_EXT 0x8830 +#define GL_DRAW_BUFFER12_EXT 0x8831 +#define GL_DRAW_BUFFER13_EXT 0x8832 +#define GL_DRAW_BUFFER14_EXT 0x8833 +#define GL_DRAW_BUFFER15_EXT 0x8834 +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#endif + +/* GL_EXT_map_buffer_range */ +#ifndef GL_EXT_map_buffer_range +#define GL_MAP_READ_BIT_EXT 0x0001 +#define GL_MAP_WRITE_BIT_EXT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 +#endif + +/* GL_EXT_multisampled_render_to_texture */ +#ifndef GL_EXT_multisampled_render_to_texture +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C +/* reuse values from GL_EXT_framebuffer_multisample (desktop extension) */ +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#endif + +/* GL_EXT_multiview_draw_buffers */ +#ifndef GL_EXT_multiview_draw_buffers +#define GL_COLOR_ATTACHMENT_EXT 0x90F0 +#define GL_MULTIVIEW_EXT 0x90F1 +#define GL_DRAW_BUFFER_EXT 0x0C01 +#define GL_READ_BUFFER_EXT 0x0C02 +#define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2 +#endif + +/* GL_EXT_multi_draw_arrays */ +/* No new tokens introduced by this extension. */ + +/* GL_EXT_occlusion_query_boolean */ +#ifndef GL_EXT_occlusion_query_boolean +#define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A +#define GL_CURRENT_QUERY_EXT 0x8865 +#define GL_QUERY_RESULT_EXT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867 +#endif + +/* GL_EXT_read_format_bgra */ +#ifndef GL_EXT_read_format_bgra +#define GL_BGRA_EXT 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 +#endif + +/* GL_EXT_robustness */ +#ifndef GL_EXT_robustness +/* reuse GL_NO_ERROR */ +#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255 +#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3 +#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256 +#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252 +#define GL_NO_RESET_NOTIFICATION_EXT 0x8261 +#endif + +/* GL_EXT_separate_shader_objects */ +#ifndef GL_EXT_separate_shader_objects +#define GL_VERTEX_SHADER_BIT_EXT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002 +#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF +#define GL_PROGRAM_SEPARABLE_EXT 0x8258 +#define GL_ACTIVE_PROGRAM_EXT 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A +#endif + +/* GL_EXT_shader_framebuffer_fetch */ +#ifndef GL_EXT_shader_framebuffer_fetch +#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 +#endif + +/* GL_EXT_shader_texture_lod */ +/* No new tokens introduced by this extension. */ + +/* GL_EXT_shadow_samplers */ +#ifndef GL_EXT_shadow_samplers +#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C +#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D +#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E +#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62 +#endif + +/* GL_EXT_sRGB */ +#ifndef GL_EXT_sRGB +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 +#endif + +/* GL_EXT_sRGB_write_control */ +#ifndef GL_EXT_sRGB_write_control +#define GL_EXT_sRGB_write_control 1 +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#endif + +/* GL_EXT_texture_compression_dxt1 */ +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#endif + +/* GL_EXT_texture_filter_anisotropic */ +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +/* GL_EXT_texture_format_BGRA8888 */ +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_BGRA_EXT 0x80E1 +#endif + +/* GL_EXT_texture_rg */ +#ifndef GL_EXT_texture_rg +#define GL_RED_EXT 0x1903 +#define GL_RG_EXT 0x8227 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B +#endif + +/* GL_EXT_texture_sRGB_decode */ +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A +#endif + +/* GL_EXT_texture_storage */ +#ifndef GL_EXT_texture_storage +#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F +#define GL_ALPHA8_EXT 0x803C +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_RGBA32F_EXT 0x8814 +#define GL_RGB32F_EXT 0x8815 +#define GL_ALPHA32F_EXT 0x8816 +#define GL_LUMINANCE32F_EXT 0x8818 +#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 +/* reuse GL_RGBA16F_EXT */ +/* reuse GL_RGB16F_EXT */ +#define GL_ALPHA16F_EXT 0x881C +#define GL_LUMINANCE16F_EXT 0x881E +#define GL_LUMINANCE_ALPHA16F_EXT 0x881F +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGB10_EXT 0x8052 +#define GL_BGRA8_EXT 0x93A1 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B +#define GL_R32F_EXT 0x822E +#define GL_RG32F_EXT 0x8230 +#define GL_R16F_EXT 0x822D +#define GL_RG16F_EXT 0x822F +#endif + +/* GL_EXT_texture_type_2_10_10_10_REV */ +#ifndef GL_EXT_texture_type_2_10_10_10_REV +#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 +#endif + +/* GL_EXT_unpack_subimage */ +#ifndef GL_EXT_unpack_subimage +#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 +#define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 +#endif + +/*------------------------------------------------------------------------* + * DMP extension tokens + *------------------------------------------------------------------------*/ + +/* GL_DMP_shader_binary */ +#ifndef GL_DMP_shader_binary +#define GL_SHADER_BINARY_DMP 0x9250 +#endif + +/*------------------------------------------------------------------------* + * FJ extension tokens + *------------------------------------------------------------------------*/ + +/* GL_FJ_shader_binary_GCCSO */ +#ifndef GL_FJ_shader_binary_GCCSO +#define GL_GCCSO_SHADER_BINARY_FJ 0x9260 +#endif + +/*------------------------------------------------------------------------* + * IMG extension tokens + *------------------------------------------------------------------------*/ + +/* GL_IMG_program_binary */ +#ifndef GL_IMG_program_binary +#define GL_SGX_PROGRAM_BINARY_IMG 0x9130 +#endif + +/* GL_IMG_read_format */ +#ifndef GL_IMG_read_format +#define GL_BGRA_IMG 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 +#endif + +/* GL_IMG_shader_binary */ +#ifndef GL_IMG_shader_binary +#define GL_SGX_BINARY_IMG 0x8C0A +#endif + +/* GL_IMG_texture_compression_pvrtc */ +#ifndef GL_IMG_texture_compression_pvrtc +#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 +#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 +#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 +#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 +#endif + +/* GL_IMG_texture_compression_pvrtc2 */ +#ifndef GL_IMG_texture_compression_pvrtc2 +#define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137 +#define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138 +#endif + +/* GL_IMG_multisampled_render_to_texture */ +#ifndef GL_IMG_multisampled_render_to_texture +#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 +#define GL_MAX_SAMPLES_IMG 0x9135 +#define GL_TEXTURE_SAMPLES_IMG 0x9136 +#endif + +/*------------------------------------------------------------------------* + * NV extension tokens + *------------------------------------------------------------------------*/ + +/* GL_NV_coverage_sample */ +#ifndef GL_NV_coverage_sample +#define GL_COVERAGE_COMPONENT_NV 0x8ED0 +#define GL_COVERAGE_COMPONENT4_NV 0x8ED1 +#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2 +#define GL_COVERAGE_BUFFERS_NV 0x8ED3 +#define GL_COVERAGE_SAMPLES_NV 0x8ED4 +#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5 +#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6 +#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7 +#define GL_COVERAGE_BUFFER_BIT_NV 0x00008000 +#endif + +/* GL_NV_depth_nonlinear */ +#ifndef GL_NV_depth_nonlinear +#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C +#endif + +/* GL_NV_draw_buffers */ +#ifndef GL_NV_draw_buffers +#define GL_MAX_DRAW_BUFFERS_NV 0x8824 +#define GL_DRAW_BUFFER0_NV 0x8825 +#define GL_DRAW_BUFFER1_NV 0x8826 +#define GL_DRAW_BUFFER2_NV 0x8827 +#define GL_DRAW_BUFFER3_NV 0x8828 +#define GL_DRAW_BUFFER4_NV 0x8829 +#define GL_DRAW_BUFFER5_NV 0x882A +#define GL_DRAW_BUFFER6_NV 0x882B +#define GL_DRAW_BUFFER7_NV 0x882C +#define GL_DRAW_BUFFER8_NV 0x882D +#define GL_DRAW_BUFFER9_NV 0x882E +#define GL_DRAW_BUFFER10_NV 0x882F +#define GL_DRAW_BUFFER11_NV 0x8830 +#define GL_DRAW_BUFFER12_NV 0x8831 +#define GL_DRAW_BUFFER13_NV 0x8832 +#define GL_DRAW_BUFFER14_NV 0x8833 +#define GL_DRAW_BUFFER15_NV 0x8834 +#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 +#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 +#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 +#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 +#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 +#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 +#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 +#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 +#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 +#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 +#define GL_COLOR_ATTACHMENT10_NV 0x8CEA +#define GL_COLOR_ATTACHMENT11_NV 0x8CEB +#define GL_COLOR_ATTACHMENT12_NV 0x8CEC +#define GL_COLOR_ATTACHMENT13_NV 0x8CED +#define GL_COLOR_ATTACHMENT14_NV 0x8CEE +#define GL_COLOR_ATTACHMENT15_NV 0x8CEF +#endif + +/* GL_NV_draw_instanced */ +/* No new tokens introduced by this extension. */ + +/* GL_NV_fbo_color_attachments */ +#ifndef GL_NV_fbo_color_attachments +#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF +/* GL_COLOR_ATTACHMENT{0-15}_NV defined in GL_NV_draw_buffers already. */ +#endif + +/* GL_NV_fence */ +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +/* GL_NV_framebuffer_blit */ +#ifndef GL_NV_framebuffer_blit +#define GL_READ_FRAMEBUFFER_NV 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_NV 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA +#endif + +/* GL_NV_framebuffer_multisample */ +#ifndef GL_NV_framebuffer_multisample +#define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56 +#define GL_MAX_SAMPLES_NV 0x8D57 +#endif + +/* GL_NV_generate_mipmap_sRGB */ +/* No new tokens introduced by this extension. */ + +/* GL_NV_instanced_arrays */ +#ifndef GL_NV_instanced_arrays +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE +#endif + +/* GL_NV_read_buffer */ +#ifndef GL_NV_read_buffer +#define GL_READ_BUFFER_NV 0x0C02 +#endif + +/* GL_NV_read_buffer_front */ +/* No new tokens introduced by this extension. */ + +/* GL_NV_read_depth */ +/* No new tokens introduced by this extension. */ + +/* GL_NV_read_depth_stencil */ +/* No new tokens introduced by this extension. */ + +/* GL_NV_read_stencil */ +/* No new tokens introduced by this extension. */ + +/* GL_NV_shadow_samplers_array */ +#ifndef GL_NV_shadow_samplers_array +#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 +#endif + +/* GL_NV_shadow_samplers_cube */ +#ifndef GL_NV_shadow_samplers_cube +#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 +#endif + +/* GL_NV_sRGB_formats */ +#ifndef GL_NV_sRGB_formats +#define GL_SLUMINANCE_NV 0x8C46 +#define GL_SLUMINANCE_ALPHA_NV 0x8C44 +#define GL_SRGB8_NV 0x8C41 +#define GL_SLUMINANCE8_NV 0x8C47 +#define GL_SLUMINANCE8_ALPHA8_NV 0x8C45 +#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F +#define GL_ETC1_SRGB8_NV 0x88EE +#endif + +/* GL_NV_texture_border_clamp */ +#ifndef GL_NV_texture_border_clamp +#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 +#define GL_CLAMP_TO_BORDER_NV 0x812D +#endif + +/* GL_NV_texture_compression_s3tc_update */ +/* No new tokens introduced by this extension. */ + +/* GL_NV_texture_npot_2D_mipmap */ +/* No new tokens introduced by this extension. */ + +/*------------------------------------------------------------------------* + * QCOM extension tokens + *------------------------------------------------------------------------*/ + +/* GL_QCOM_alpha_test */ +#ifndef GL_QCOM_alpha_test +#define GL_ALPHA_TEST_QCOM 0x0BC0 +#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 +#define GL_ALPHA_TEST_REF_QCOM 0x0BC2 +#endif + +/* GL_QCOM_binning_control */ +#ifndef GL_QCOM_binning_control +#define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0 +#define GL_CPU_OPTIMIZED_QCOM 0x8FB1 +#define GL_GPU_OPTIMIZED_QCOM 0x8FB2 +#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3 +#endif + +/* GL_QCOM_driver_control */ +/* No new tokens introduced by this extension. */ + +/* GL_QCOM_extended_get */ +#ifndef GL_QCOM_extended_get +#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 +#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 +#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 +#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 +#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 +#define GL_TEXTURE_TYPE_QCOM 0x8BD7 +#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 +#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 +#define GL_TEXTURE_TARGET_QCOM 0x8BDA +#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB +#define GL_STATE_RESTORE 0x8BDC +#endif + +/* GL_QCOM_extended_get2 */ +/* No new tokens introduced by this extension. */ + +/* GL_QCOM_perfmon_global_mode */ +#ifndef GL_QCOM_perfmon_global_mode +#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 +#endif + +/* GL_QCOM_writeonly_rendering */ +#ifndef GL_QCOM_writeonly_rendering +#define GL_WRITEONLY_RENDERING_QCOM 0x8823 +#endif + +/* GL_QCOM_tiled_rendering */ +#ifndef GL_QCOM_tiled_rendering +#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 +#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 +#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 +#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 +#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 +#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 +#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 +#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 +#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 +#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 +#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 +#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 +#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 +#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 +#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 +#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 +#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 +#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 +#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 +#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 +#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 +#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 +#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 +#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 +#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 +#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 +#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 +#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 +#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 +#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 +#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 +#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 +#endif + +/*------------------------------------------------------------------------* + * VIV extension tokens + *------------------------------------------------------------------------*/ + +/* GL_VIV_shader_binary */ +#ifndef GL_VIV_shader_binary +#define GL_SHADER_BINARY_VIV 0x8FC4 +#endif + +/*------------------------------------------------------------------------* + * End of extension tokens, start of corresponding extension functions + *------------------------------------------------------------------------*/ + +/*------------------------------------------------------------------------* + * OES extension functions + *------------------------------------------------------------------------*/ + +/* GL_OES_compressed_ETC1_RGB8_texture */ +#ifndef GL_OES_compressed_ETC1_RGB8_texture +#define GL_OES_compressed_ETC1_RGB8_texture 1 +#endif + +/* GL_OES_compressed_paletted_texture */ +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 +#endif + +/* GL_OES_depth24 */ +#ifndef GL_OES_depth24 +#define GL_OES_depth24 1 +#endif + +/* GL_OES_depth32 */ +#ifndef GL_OES_depth32 +#define GL_OES_depth32 1 +#endif + +/* GL_OES_depth_texture */ +#ifndef GL_OES_depth_texture +#define GL_OES_depth_texture 1 +#endif + +/* GL_OES_EGL_image */ +#ifndef GL_OES_EGL_image +#define GL_OES_EGL_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); +GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); +#endif +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); +#endif + +/* GL_OES_EGL_image_external */ +#ifndef GL_OES_EGL_image_external +#define GL_OES_EGL_image_external 1 +/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */ +#endif + +/* GL_OES_element_index_uint */ +#ifndef GL_OES_element_index_uint +#define GL_OES_element_index_uint 1 +#endif + +/* GL_OES_fbo_render_mipmap */ +#ifndef GL_OES_fbo_render_mipmap +#define GL_OES_fbo_render_mipmap 1 +#endif + +/* GL_OES_fragment_precision_high */ +#ifndef GL_OES_fragment_precision_high +#define GL_OES_fragment_precision_high 1 +#endif + +/* GL_OES_get_program_binary */ +#ifndef GL_OES_get_program_binary +#define GL_OES_get_program_binary 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); +#endif +typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); +#endif + +/* GL_OES_mapbuffer */ +#ifndef GL_OES_mapbuffer +#define GL_OES_mapbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); +GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); +GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid **params); +#endif +typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); +typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid **params); +#endif + +/* GL_OES_packed_depth_stencil */ +#ifndef GL_OES_packed_depth_stencil +#define GL_OES_packed_depth_stencil 1 +#endif + +/* GL_OES_required_internalformat */ +#ifndef GL_OES_required_internalformat +#define GL_OES_required_internalformat 1 +#endif + +/* GL_OES_rgb8_rgba8 */ +#ifndef GL_OES_rgb8_rgba8 +#define GL_OES_rgb8_rgba8 1 +#endif + +/* GL_OES_standard_derivatives */ +#ifndef GL_OES_standard_derivatives +#define GL_OES_standard_derivatives 1 +#endif + +/* GL_OES_stencil1 */ +#ifndef GL_OES_stencil1 +#define GL_OES_stencil1 1 +#endif + +/* GL_OES_stencil4 */ +#ifndef GL_OES_stencil4 +#define GL_OES_stencil4 1 +#endif + +#ifndef GL_OES_surfaceless_context +#define GL_OES_surfaceless_context 1 +#endif + +/* GL_OES_texture_3D */ +#ifndef GL_OES_texture_3D +#define GL_OES_texture_3D 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); +GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); +GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); +GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); +GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +#endif +typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); +typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); +typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); +typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +#endif + +/* GL_OES_texture_float */ +#ifndef GL_OES_texture_float +#define GL_OES_texture_float 1 +#endif + +/* GL_OES_texture_float_linear */ +#ifndef GL_OES_texture_float_linear +#define GL_OES_texture_float_linear 1 +#endif + +/* GL_OES_texture_half_float */ +#ifndef GL_OES_texture_half_float +#define GL_OES_texture_half_float 1 +#endif + +/* GL_OES_texture_half_float_linear */ +#ifndef GL_OES_texture_half_float_linear +#define GL_OES_texture_half_float_linear 1 +#endif + +/* GL_OES_texture_npot */ +#ifndef GL_OES_texture_npot +#define GL_OES_texture_npot 1 +#endif + +/* GL_OES_vertex_array_object */ +#ifndef GL_OES_vertex_array_object +#define GL_OES_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array); +GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays); +GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays); +GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array); +#endif +typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); +typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); +typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); +#endif + +/* GL_OES_vertex_half_float */ +#ifndef GL_OES_vertex_half_float +#define GL_OES_vertex_half_float 1 +#endif + +/* GL_OES_vertex_type_10_10_10_2 */ +#ifndef GL_OES_vertex_type_10_10_10_2 +#define GL_OES_vertex_type_10_10_10_2 1 +#endif + +/*------------------------------------------------------------------------* + * KHR extension functions + *------------------------------------------------------------------------*/ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam); +GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHR (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +GL_APICALL void GL_APIENTRY glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message); +GL_APICALL void GL_APIENTRY glPopDebugGroupKHR (void); +GL_APICALL void GL_APIENTRY glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label); +GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, GLvoid **params); +#endif +typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam); +typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); +typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void); +typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label); +typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, GLvoid **params); +#endif + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 +#endif + + +/*------------------------------------------------------------------------* + * AMD extension functions + *------------------------------------------------------------------------*/ + +/* GL_AMD_compressed_3DC_texture */ +#ifndef GL_AMD_compressed_3DC_texture +#define GL_AMD_compressed_3DC_texture 1 +#endif + +/* GL_AMD_compressed_ATC_texture */ +#ifndef GL_AMD_compressed_ATC_texture +#define GL_AMD_compressed_ATC_texture 1 +#endif + +/* AMD_performance_monitor */ +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); +GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); +GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); +GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor); +GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); +typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif + +/* GL_AMD_program_binary_Z400 */ +#ifndef GL_AMD_program_binary_Z400 +#define GL_AMD_program_binary_Z400 1 +#endif + +/*------------------------------------------------------------------------* + * ANGLE extension functions + *------------------------------------------------------------------------*/ + +/* GL_ANGLE_depth_texture */ +#ifndef GL_ANGLE_depth_texture +#define GL_ANGLE_depth_texture 1 +#endif + +/* GL_ANGLE_framebuffer_blit */ +#ifndef GL_ANGLE_framebuffer_blit +#define GL_ANGLE_framebuffer_blit 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif +typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif + +/* GL_ANGLE_framebuffer_multisample */ +#ifndef GL_ANGLE_framebuffer_multisample +#define GL_ANGLE_framebuffer_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_ANGLE_instanced_arrays +#define GL_ANGLE_instanced_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor); +#endif +typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); +#endif + +/* GL_ANGLE_pack_reverse_row_order */ +#ifndef GL_ANGLE_pack_reverse_row_order +#define GL_ANGLE_pack_reverse_row_order 1 +#endif + +/* GL_ANGLE_program_binary */ +#ifndef GL_ANGLE_program_binary +#define GL_ANGLE_program_binary 1 +#endif + +/* GL_ANGLE_texture_compression_dxt3 */ +#ifndef GL_ANGLE_texture_compression_dxt3 +#define GL_ANGLE_texture_compression_dxt3 1 +#endif + +/* GL_ANGLE_texture_compression_dxt5 */ +#ifndef GL_ANGLE_texture_compression_dxt5 +#define GL_ANGLE_texture_compression_dxt5 1 +#endif + +/* GL_ANGLE_texture_usage */ +#ifndef GL_ANGLE_texture_usage +#define GL_ANGLE_texture_usage 1 +#endif + +#ifndef GL_ANGLE_translated_shader_source +#define GL_ANGLE_translated_shader_source 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); +#endif +typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); +#endif + +/*------------------------------------------------------------------------* + * APPLE extension functions + *------------------------------------------------------------------------*/ + +/* GL_APPLE_copy_texture_levels */ +#ifndef GL_APPLE_copy_texture_levels +#define GL_APPLE_copy_texture_levels 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); +#endif +typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); +#endif + +/* GL_APPLE_framebuffer_multisample */ +#ifndef GL_APPLE_framebuffer_multisample +#define GL_APPLE_framebuffer_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); +#endif + +/* GL_APPLE_rgb_422 */ +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 +#endif + +/* GL_APPLE_sync */ +#ifndef GL_APPLE_sync +#define GL_APPLE_sync 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags); +GL_APICALL GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync); +GL_APICALL void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync); +GL_APICALL GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); +GL_APICALL void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); +GL_APICALL void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params); +GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +#endif +typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); +typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync); +typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync); +typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params); +typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +#endif + +/* GL_APPLE_texture_format_BGRA8888 */ +#ifndef GL_APPLE_texture_format_BGRA8888 +#define GL_APPLE_texture_format_BGRA8888 1 +#endif + +/* GL_APPLE_texture_max_level */ +#ifndef GL_APPLE_texture_max_level +#define GL_APPLE_texture_max_level 1 +#endif + +/*------------------------------------------------------------------------* + * ARM extension functions + *------------------------------------------------------------------------*/ + +/* GL_ARM_mali_program_binary */ +#ifndef GL_ARM_mali_program_binary +#define GL_ARM_mali_program_binary 1 +#endif + +/* GL_ARM_mali_shader_binary */ +#ifndef GL_ARM_mali_shader_binary +#define GL_ARM_mali_shader_binary 1 +#endif + +/* GL_ARM_rgba8 */ +#ifndef GL_ARM_rgba8 +#define GL_ARM_rgba8 1 +#endif + +/*------------------------------------------------------------------------* + * EXT extension functions + *------------------------------------------------------------------------*/ + +/* GL_EXT_blend_minmax */ +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#endif + +/* GL_EXT_color_buffer_half_float */ +#ifndef GL_EXT_color_buffer_half_float +#define GL_EXT_color_buffer_half_float 1 +#endif + +/* GL_EXT_debug_label */ +#ifndef GL_EXT_debug_label +#define GL_EXT_debug_label 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); +GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); +#endif +typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); +typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); +#endif + +/* GL_EXT_debug_marker */ +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); +GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); +GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void); +#endif +typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); +#endif + +/* GL_EXT_discard_framebuffer */ +#ifndef GL_EXT_discard_framebuffer +#define GL_EXT_discard_framebuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); +#endif +typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); +#endif + +#ifndef GL_EXT_disjoint_timer_query +#define GL_EXT_disjoint_timer_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids); +GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids); +GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id); +GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id); +GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target); +GL_APICALL void GL_APIENTRY glQueryCounterEXT (GLuint id, GLenum target); +GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params); +GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); +GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); +#endif +typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids); +typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id); +typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id); +typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target); +typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); +typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); +#endif /* GL_EXT_disjoint_timer_query */ + +#ifndef GL_EXT_draw_buffers +#define GL_EXT_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei n, const GLenum *bufs); +#endif +typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum *bufs); +#endif /* GL_EXT_draw_buffers */ + +/* GL_EXT_map_buffer_range */ +#ifndef GL_EXT_map_buffer_range +#define GL_EXT_map_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void* GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length); +#endif +typedef void* (GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +#endif + +/* GL_EXT_multisampled_render_to_texture */ +#ifndef GL_EXT_multisampled_render_to_texture +#define GL_EXT_multisampled_render_to_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#endif +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#endif + +/* GL_EXT_multiview_draw_buffers */ +#ifndef GL_EXT_multiview_draw_buffers +#define GL_EXT_multiview_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glReadBufferIndexedEXT (GLenum src, GLint index); +GL_APICALL void GL_APIENTRY glDrawBuffersIndexedEXT (GLint n, const GLenum *location, const GLint *indices); +GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLint *data); +#endif +typedef void (GL_APIENTRYP PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index); +typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum *location, const GLint *indices); +typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint *data); +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); +#endif + +/* GL_EXT_occlusion_query_boolean */ +#ifndef GL_EXT_occlusion_query_boolean +#define GL_EXT_occlusion_query_boolean 1 +/* All entry points also exist in GL_EXT_disjoint_timer_query */ +#endif + +/* GL_EXT_read_format_bgra */ +#ifndef GL_EXT_read_format_bgra +#define GL_EXT_read_format_bgra 1 +#endif + +/* GL_EXT_robustness */ +#ifndef GL_EXT_robustness +#define GL_EXT_robustness 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void); +GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); +GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params); +#endif +typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void); +typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); +typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); +#endif + +/* GL_EXT_separate_shader_objects */ +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program); +GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program); +GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings); +GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline); +GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines); +GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines); +GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline); +GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); +GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint x); +GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint x, GLint y); +GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z); +GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); +GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat x); +GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat x, GLfloat y); +GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); +GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline); +GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +#endif +typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program); +typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings); +typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines); +typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines); +typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint x); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint x, GLint y); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat x); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +#endif + +/* GL_EXT_shader_framebuffer_fetch */ +#ifndef GL_EXT_shader_framebuffer_fetch +#define GL_EXT_shader_framebuffer_fetch 1 +#endif + +/* GL_EXT_shader_texture_lod */ +#ifndef GL_EXT_shader_texture_lod +#define GL_EXT_shader_texture_lod 1 +#endif + +/* GL_EXT_shadow_samplers */ +#ifndef GL_EXT_shadow_samplers +#define GL_EXT_shadow_samplers 1 +#endif + +/* GL_EXT_sRGB */ +#ifndef GL_EXT_sRGB +#define GL_EXT_sRGB 1 +#endif + +/* GL_EXT_texture_compression_dxt1 */ +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 +#endif + +/* GL_EXT_texture_filter_anisotropic */ +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +/* GL_EXT_texture_format_BGRA8888 */ +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_EXT_texture_format_BGRA8888 1 +#endif + +/* GL_EXT_texture_rg */ +#ifndef GL_EXT_texture_rg +#define GL_EXT_texture_rg 1 +#endif + +/* GL_EXT_texture_storage */ +#ifndef GL_EXT_texture_storage +#define GL_EXT_texture_storage 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +#endif +typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +#endif + +/* GL_EXT_texture_type_2_10_10_10_REV */ +#ifndef GL_EXT_texture_type_2_10_10_10_REV +#define GL_EXT_texture_type_2_10_10_10_REV 1 +#endif + +/* GL_EXT_unpack_subimage */ +#ifndef GL_EXT_unpack_subimage +#define GL_EXT_unpack_subimage 1 +#endif + +/*------------------------------------------------------------------------* + * DMP extension functions + *------------------------------------------------------------------------*/ + +/* GL_DMP_shader_binary */ +#ifndef GL_DMP_shader_binary +#define GL_DMP_shader_binary 1 +#endif + +/*------------------------------------------------------------------------* + * FJ extension functions + *------------------------------------------------------------------------*/ + +/* GL_FJ_shader_binary_GCCSO */ +#ifndef GL_FJ_shader_binary_GCCSO +#define GL_FJ_shader_binary_GCCSO 1 +#endif + +/*------------------------------------------------------------------------* + * IMG extension functions + *------------------------------------------------------------------------*/ + +/* GL_IMG_program_binary */ +#ifndef GL_IMG_program_binary +#define GL_IMG_program_binary 1 +#endif + +/* GL_IMG_read_format */ +#ifndef GL_IMG_read_format +#define GL_IMG_read_format 1 +#endif + +/* GL_IMG_shader_binary */ +#ifndef GL_IMG_shader_binary +#define GL_IMG_shader_binary 1 +#endif + +/* GL_IMG_texture_compression_pvrtc */ +#ifndef GL_IMG_texture_compression_pvrtc +#define GL_IMG_texture_compression_pvrtc 1 +#endif + +/* GL_IMG_texture_compression_pvrtc2 */ +#ifndef GL_IMG_texture_compression_pvrtc2 +#define GL_IMG_texture_compression_pvrtc2 1 +#endif + +/* GL_IMG_multisampled_render_to_texture */ +#ifndef GL_IMG_multisampled_render_to_texture +#define GL_IMG_multisampled_render_to_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#endif +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#endif + +/*------------------------------------------------------------------------* + * NV extension functions + *------------------------------------------------------------------------*/ + +/* GL_NV_coverage_sample */ +#ifndef GL_NV_coverage_sample +#define GL_NV_coverage_sample 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask); +GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation); +#endif +typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask); +typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation); +#endif + +/* GL_NV_depth_nonlinear */ +#ifndef GL_NV_depth_nonlinear +#define GL_NV_depth_nonlinear 1 +#endif + +/* GL_NV_draw_buffers */ +#ifndef GL_NV_draw_buffers +#define GL_NV_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs); +#endif +typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs); +#endif + +/* GL_NV_draw_instanced */ +#ifndef GL_NV_draw_instanced +#define GL_NV_draw_instanced 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawArraysInstancedNV (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GL_APICALL void GL_APIENTRY glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif +typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif + +/* GL_NV_fbo_color_attachments */ +#ifndef GL_NV_fbo_color_attachments +#define GL_NV_fbo_color_attachments 1 +#endif + +/* GL_NV_fence */ +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); +GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); +GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint fence); +GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint fence); +GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint fence); +GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition); +#endif +typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#endif + +/* GL_NV_framebuffer_blit */ +#ifndef GL_NV_framebuffer_blit +#define GL_NV_framebuffer_blit 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif +typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif + +/* GL_NV_framebuffer_multisample */ +#ifndef GL_NV_framebuffer_multisample +#define GL_NV_framebuffer_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleNV ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +/* GL_NV_generate_mipmap_sRGB */ +#ifndef GL_NV_generate_mipmap_sRGB +#define GL_NV_generate_mipmap_sRGB 1 +#endif + +/* GL_NV_instanced_arrays */ +#ifndef GL_NV_instanced_arrays +#define GL_NV_instanced_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint divisor); +#endif +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor); +#endif + +/* GL_NV_read_buffer */ +#ifndef GL_NV_read_buffer +#define GL_NV_read_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode); +#endif +typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode); +#endif + +/* GL_NV_read_buffer_front */ +#ifndef GL_NV_read_buffer_front +#define GL_NV_read_buffer_front 1 +#endif + +/* GL_NV_read_depth */ +#ifndef GL_NV_read_depth +#define GL_NV_read_depth 1 +#endif + +/* GL_NV_read_depth_stencil */ +#ifndef GL_NV_read_depth_stencil +#define GL_NV_read_depth_stencil 1 +#endif + +/* GL_NV_read_stencil */ +#ifndef GL_NV_read_stencil +#define GL_NV_read_stencil 1 +#endif + +/* GL_NV_shadow_samplers_array */ +#ifndef GL_NV_shadow_samplers_array +#define GL_NV_shadow_samplers_array 1 +#endif + +/* GL_NV_shadow_samplers_cube */ +#ifndef GL_NV_shadow_samplers_cube +#define GL_NV_shadow_samplers_cube 1 +#endif + +/* GL_NV_sRGB_formats */ +#ifndef GL_NV_sRGB_formats +#define GL_NV_sRGB_formats 1 +#endif + +/* GL_NV_texture_border_clamp */ +#ifndef GL_NV_texture_border_clamp +#define GL_NV_texture_border_clamp 1 +#endif + +/* GL_NV_texture_compression_s3tc_update */ +#ifndef GL_NV_texture_compression_s3tc_update +#define GL_NV_texture_compression_s3tc_update 1 +#endif + +/* GL_NV_texture_npot_2D_mipmap */ +#ifndef GL_NV_texture_npot_2D_mipmap +#define GL_NV_texture_npot_2D_mipmap 1 +#endif + +/*------------------------------------------------------------------------* + * QCOM extension functions + *------------------------------------------------------------------------*/ + +/* GL_QCOM_alpha_test */ +#ifndef GL_QCOM_alpha_test +#define GL_QCOM_alpha_test 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref); +#endif +typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); +#endif + +/* GL_QCOM_binning_control */ +#ifndef GL_QCOM_binning_control +#define GL_QCOM_binning_control 1 +#endif + +/* GL_QCOM_driver_control */ +#ifndef GL_QCOM_driver_control +#define GL_QCOM_driver_control 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); +GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); +GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); +GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); +#endif +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); +typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +#endif + +/* GL_QCOM_extended_get */ +#ifndef GL_QCOM_extended_get +#define GL_QCOM_extended_get 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); +GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); +GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); +GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); +GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); +GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params); +#endif +typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); +typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); +typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params); +#endif + +/* GL_QCOM_extended_get2 */ +#ifndef GL_QCOM_extended_get2 +#define GL_QCOM_extended_get2 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); +GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); +GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); +GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length); +#endif +typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); +typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); +typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); +typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); +#endif + +/* GL_QCOM_perfmon_global_mode */ +#ifndef GL_QCOM_perfmon_global_mode +#define GL_QCOM_perfmon_global_mode 1 +#endif + +/* GL_QCOM_writeonly_rendering */ +#ifndef GL_QCOM_writeonly_rendering +#define GL_QCOM_writeonly_rendering 1 +#endif + +/* GL_QCOM_tiled_rendering */ +#ifndef GL_QCOM_tiled_rendering +#define GL_QCOM_tiled_rendering 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); +GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); +#endif +typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); +typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); +#endif + +/*------------------------------------------------------------------------* + * VIV extension tokens + *------------------------------------------------------------------------*/ + +/* GL_VIV_shader_binary */ +#ifndef GL_VIV_shader_binary +#define GL_VIV_shader_binary 1 +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __gl2ext_h_ */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2_gl2platform.h b/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2_gl2platform.h new file mode 100644 index 0000000..c325686 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2_gl2platform.h @@ -0,0 +1,30 @@ +#ifndef __gl2platform_h_ +#define __gl2platform_h_ + +/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ + +/* + * This document is licensed under the SGI Free Software B License Version + * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . + */ + +/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h + * + * Adopters may modify khrplatform.h and this file to suit their platform. + * You are encouraged to submit all modifications to the Khronos group so that + * they can be included in future versions of this file. Please submit changes + * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) + * by filing a bug against product "OpenGL-ES" component "Registry". + */ + +/*#include */ + +#ifndef GL_APICALL +#define GL_APICALL KHRONOS_APICALL +#endif + +#ifndef GL_APIENTRY +#define GL_APIENTRY KHRONOS_APIENTRY +#endif + +#endif /* __gl2platform_h_ */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2_khrplatform.h b/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2_khrplatform.h new file mode 100644 index 0000000..c9e6f17 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_opengles2_khrplatform.h @@ -0,0 +1,282 @@ +#ifndef __khrplatform_h_ +#define __khrplatform_h_ + +/* +** Copyright (c) 2008-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Khronos platform-specific types and definitions. + * + * $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $ + * + * Adopters may modify this file to suit their platform. Adopters are + * encouraged to submit platform specific modifications to the Khronos + * group so that they can be included in future versions of this file. + * Please submit changes by sending them to the public Khronos Bugzilla + * (http://khronos.org/bugzilla) by filing a bug against product + * "Khronos (general)" component "Registry". + * + * A predefined template which fills in some of the bug fields can be + * reached using http://tinyurl.com/khrplatform-h-bugreport, but you + * must create a Bugzilla login first. + * + * + * See the Implementer's Guidelines for information about where this file + * should be located on your system and for more details of its use: + * http://www.khronos.org/registry/implementers_guide.pdf + * + * This file should be included as + * #include + * by Khronos client API header files that use its types and defines. + * + * The types in khrplatform.h should only be used to define API-specific types. + * + * Types defined in khrplatform.h: + * khronos_int8_t signed 8 bit + * khronos_uint8_t unsigned 8 bit + * khronos_int16_t signed 16 bit + * khronos_uint16_t unsigned 16 bit + * khronos_int32_t signed 32 bit + * khronos_uint32_t unsigned 32 bit + * khronos_int64_t signed 64 bit + * khronos_uint64_t unsigned 64 bit + * khronos_intptr_t signed same number of bits as a pointer + * khronos_uintptr_t unsigned same number of bits as a pointer + * khronos_ssize_t signed size + * khronos_usize_t unsigned size + * khronos_float_t signed 32 bit floating point + * khronos_time_ns_t unsigned 64 bit time in nanoseconds + * khronos_utime_nanoseconds_t unsigned time interval or absolute time in + * nanoseconds + * khronos_stime_nanoseconds_t signed time interval in nanoseconds + * khronos_boolean_enum_t enumerated boolean type. This should + * only be used as a base type when a client API's boolean type is + * an enum. Client APIs which use an integer or other type for + * booleans cannot use this as the base type for their boolean. + * + * Tokens defined in khrplatform.h: + * + * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. + * + * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. + * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. + * + * Calling convention macros defined in this file: + * KHRONOS_APICALL + * KHRONOS_APIENTRY + * KHRONOS_APIATTRIBUTES + * + * These may be used in function prototypes as: + * + * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( + * int arg1, + * int arg2) KHRONOS_APIATTRIBUTES; + */ + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APICALL + *------------------------------------------------------------------------- + * This precedes the return type of the function in the function prototype. + */ +#if defined(_WIN32) && !defined(__SCITECH_SNAP__) +# define KHRONOS_APICALL __declspec(dllimport) +#elif defined (__SYMBIAN32__) +# define KHRONOS_APICALL IMPORT_C +#else +# define KHRONOS_APICALL +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIENTRY + *------------------------------------------------------------------------- + * This follows the return type of the function and precedes the function + * name in the function prototype. + */ +#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) + /* Win32 but not WinCE */ +# define KHRONOS_APIENTRY __stdcall +#else +# define KHRONOS_APIENTRY +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIATTRIBUTES + *------------------------------------------------------------------------- + * This follows the closing parenthesis of the function prototype arguments. + */ +#if defined (__ARMCC_2__) +#define KHRONOS_APIATTRIBUTES __softfp +#else +#define KHRONOS_APIATTRIBUTES +#endif + +/*------------------------------------------------------------------------- + * basic type definitions + *-----------------------------------------------------------------------*/ +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) + + +/* + * Using + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__VMS ) || defined(__sgi) + +/* + * Using + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) + +/* + * Win32 + */ +typedef __int32 khronos_int32_t; +typedef unsigned __int32 khronos_uint32_t; +typedef __int64 khronos_int64_t; +typedef unsigned __int64 khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__sun__) || defined(__digital__) + +/* + * Sun or Digital + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#if defined(__arch64__) || defined(_LP64) +typedef long int khronos_int64_t; +typedef unsigned long int khronos_uint64_t; +#else +typedef long long int khronos_int64_t; +typedef unsigned long long int khronos_uint64_t; +#endif /* __arch64__ */ +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif 0 + +/* + * Hypothetical platform with no float or int64 support + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#define KHRONOS_SUPPORT_INT64 0 +#define KHRONOS_SUPPORT_FLOAT 0 + +#else + +/* + * Generic fallback + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#endif + + +/* + * Types that are (so far) the same on all platforms + */ +typedef signed char khronos_int8_t; +typedef unsigned char khronos_uint8_t; +typedef signed short int khronos_int16_t; +typedef unsigned short int khronos_uint16_t; + +/* + * Types that differ between LLP64 and LP64 architectures - in LLP64, + * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears + * to be the only LLP64 architecture in current use. + */ +#ifdef _WIN64 +typedef signed long long int khronos_intptr_t; +typedef unsigned long long int khronos_uintptr_t; +typedef signed long long int khronos_ssize_t; +typedef unsigned long long int khronos_usize_t; +#else +typedef signed long int khronos_intptr_t; +typedef unsigned long int khronos_uintptr_t; +typedef signed long int khronos_ssize_t; +typedef unsigned long int khronos_usize_t; +#endif + +#if KHRONOS_SUPPORT_FLOAT +/* + * Float type + */ +typedef float khronos_float_t; +#endif + +#if KHRONOS_SUPPORT_INT64 +/* Time types + * + * These types can be used to represent a time interval in nanoseconds or + * an absolute Unadjusted System Time. Unadjusted System Time is the number + * of nanoseconds since some arbitrary system event (e.g. since the last + * time the system booted). The Unadjusted System Time is an unsigned + * 64 bit value that wraps back to 0 every 584 years. Time intervals + * may be either signed or unsigned. + */ +typedef khronos_uint64_t khronos_utime_nanoseconds_t; +typedef khronos_int64_t khronos_stime_nanoseconds_t; +#endif + +/* + * Dummy value used to pad enum types to 32 bits. + */ +#ifndef KHRONOS_MAX_ENUM +#define KHRONOS_MAX_ENUM 0x7FFFFFFF +#endif + +/* + * Enumerated boolean type + * + * Values other than zero should be considered to be true. Therefore + * comparisons should not be made against KHRONOS_TRUE. + */ +typedef enum { + KHRONOS_FALSE = 0, + KHRONOS_TRUE = 1, + KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM +} khronos_boolean_enum_t; + +#endif /* __khrplatform_h_ */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_pixels.h b/Src/Decoder_H264_ALL/include/SDL/SDL_pixels.h new file mode 100644 index 0000000..8499c32 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_pixels.h @@ -0,0 +1,454 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_pixels.h + * + * Header for the enumerated pixel format definitions. + */ + +#ifndef _SDL_pixels_h +#define _SDL_pixels_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name Transparency definitions + * + * These define alpha as the opacity of a surface. + */ +/* @{ */ +#define SDL_ALPHA_OPAQUE 255 +#define SDL_ALPHA_TRANSPARENT 0 +/* @} */ + +/** Pixel type. */ +enum +{ + SDL_PIXELTYPE_UNKNOWN, + SDL_PIXELTYPE_INDEX1, + SDL_PIXELTYPE_INDEX4, + SDL_PIXELTYPE_INDEX8, + SDL_PIXELTYPE_PACKED8, + SDL_PIXELTYPE_PACKED16, + SDL_PIXELTYPE_PACKED32, + SDL_PIXELTYPE_ARRAYU8, + SDL_PIXELTYPE_ARRAYU16, + SDL_PIXELTYPE_ARRAYU32, + SDL_PIXELTYPE_ARRAYF16, + SDL_PIXELTYPE_ARRAYF32 +}; + +/** Bitmap pixel order, high bit -> low bit. */ +enum +{ + SDL_BITMAPORDER_NONE, + SDL_BITMAPORDER_4321, + SDL_BITMAPORDER_1234 +}; + +/** Packed component order, high bit -> low bit. */ +enum +{ + SDL_PACKEDORDER_NONE, + SDL_PACKEDORDER_XRGB, + SDL_PACKEDORDER_RGBX, + SDL_PACKEDORDER_ARGB, + SDL_PACKEDORDER_RGBA, + SDL_PACKEDORDER_XBGR, + SDL_PACKEDORDER_BGRX, + SDL_PACKEDORDER_ABGR, + SDL_PACKEDORDER_BGRA +}; + +/** Array component order, low byte -> high byte. */ +/* !!! FIXME: in 2.1, make these not overlap differently with + !!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */ +enum +{ + SDL_ARRAYORDER_NONE, + SDL_ARRAYORDER_RGB, + SDL_ARRAYORDER_RGBA, + SDL_ARRAYORDER_ARGB, + SDL_ARRAYORDER_BGR, + SDL_ARRAYORDER_BGRA, + SDL_ARRAYORDER_ABGR +}; + +/** Packed component layout. */ +enum +{ + SDL_PACKEDLAYOUT_NONE, + SDL_PACKEDLAYOUT_332, + SDL_PACKEDLAYOUT_4444, + SDL_PACKEDLAYOUT_1555, + SDL_PACKEDLAYOUT_5551, + SDL_PACKEDLAYOUT_565, + SDL_PACKEDLAYOUT_8888, + SDL_PACKEDLAYOUT_2101010, + SDL_PACKEDLAYOUT_1010102 +}; + +#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D) + +#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \ + ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \ + ((bits) << 8) | ((bytes) << 0)) + +#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F) +#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F) +#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F) +#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F) +#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF) +#define SDL_BYTESPERPIXEL(X) \ + (SDL_ISPIXELFORMAT_FOURCC(X) ? \ + ((((X) == SDL_PIXELFORMAT_YUY2) || \ + ((X) == SDL_PIXELFORMAT_UYVY) || \ + ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF)) + +#define SDL_ISPIXELFORMAT_INDEXED(format) \ + (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))) + +#define SDL_ISPIXELFORMAT_PACKED(format) \ + (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32))) + +#define SDL_ISPIXELFORMAT_ARRAY(format) \ + (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32))) + +#define SDL_ISPIXELFORMAT_ALPHA(format) \ + ((SDL_ISPIXELFORMAT_PACKED(format) && \ + ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \ + (SDL_ISPIXELFORMAT_ARRAY(format) && \ + ((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \ + (SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \ + (SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \ + (SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA)))) + +/* The flag is set to 1 because 0x1? is not in the printable ASCII range */ +#define SDL_ISPIXELFORMAT_FOURCC(format) \ + ((format) && (SDL_PIXELFLAG(format) != 1)) + +/* Note: If you modify this list, update SDL_GetPixelFormatName() */ +enum +{ + SDL_PIXELFORMAT_UNKNOWN, + SDL_PIXELFORMAT_INDEX1LSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, + 1, 0), + SDL_PIXELFORMAT_INDEX1MSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, + 1, 0), + SDL_PIXELFORMAT_INDEX4LSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, + 4, 0), + SDL_PIXELFORMAT_INDEX4MSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, + 4, 0), + SDL_PIXELFORMAT_INDEX8 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1), + SDL_PIXELFORMAT_RGB332 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_332, 8, 1), + SDL_PIXELFORMAT_RGB444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_4444, 12, 2), + SDL_PIXELFORMAT_RGB555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_1555, 15, 2), + SDL_PIXELFORMAT_BGR555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_1555, 15, 2), + SDL_PIXELFORMAT_ARGB4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_RGBA4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_ABGR4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_BGRA4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_ARGB1555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_1555, 16, 2), + SDL_PIXELFORMAT_RGBA5551 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_5551, 16, 2), + SDL_PIXELFORMAT_ABGR1555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_1555, 16, 2), + SDL_PIXELFORMAT_BGRA5551 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_5551, 16, 2), + SDL_PIXELFORMAT_RGB565 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_565, 16, 2), + SDL_PIXELFORMAT_BGR565 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_565, 16, 2), + SDL_PIXELFORMAT_RGB24 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, + 24, 3), + SDL_PIXELFORMAT_BGR24 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, + 24, 3), + SDL_PIXELFORMAT_RGB888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_RGBX8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_BGR888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_BGRX8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_ARGB8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_RGBA8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_ABGR8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_BGRA8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_ARGB2101010 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_2101010, 32, 4), + + SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ + SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'), + SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */ + SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'), + SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'), + SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'), + SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'), + SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */ + SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'), + SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */ + SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1') +}; + +typedef struct SDL_Color +{ + Uint8 r; + Uint8 g; + Uint8 b; + Uint8 a; +} SDL_Color; +#define SDL_Colour SDL_Color + +typedef struct SDL_Palette +{ + int ncolors; + SDL_Color *colors; + Uint32 version; + int refcount; +} SDL_Palette; + +/** + * \note Everything in the pixel format structure is read-only. + */ +typedef struct SDL_PixelFormat +{ + Uint32 format; + SDL_Palette *palette; + Uint8 BitsPerPixel; + Uint8 BytesPerPixel; + Uint8 padding[2]; + Uint32 Rmask; + Uint32 Gmask; + Uint32 Bmask; + Uint32 Amask; + Uint8 Rloss; + Uint8 Gloss; + Uint8 Bloss; + Uint8 Aloss; + Uint8 Rshift; + Uint8 Gshift; + Uint8 Bshift; + Uint8 Ashift; + int refcount; + struct SDL_PixelFormat *next; +} SDL_PixelFormat; + +/** + * \brief Get the human readable name of a pixel format + */ +extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format); + +/** + * \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks. + * + * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible. + * + * \sa SDL_MasksToPixelFormatEnum() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, + int *bpp, + Uint32 * Rmask, + Uint32 * Gmask, + Uint32 * Bmask, + Uint32 * Amask); + +/** + * \brief Convert a bpp and RGBA masks to an enumerated pixel format. + * + * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion + * wasn't possible. + * + * \sa SDL_PixelFormatEnumToMasks() + */ +extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, + Uint32 Rmask, + Uint32 Gmask, + Uint32 Bmask, + Uint32 Amask); + +/** + * \brief Create an SDL_PixelFormat structure from a pixel format enum. + */ +extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format); + +/** + * \brief Free an SDL_PixelFormat structure. + */ +extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format); + +/** + * \brief Create a palette structure with the specified number of color + * entries. + * + * \return A new palette, or NULL if there wasn't enough memory. + * + * \note The palette entries are initialized to white. + * + * \sa SDL_FreePalette() + */ +extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors); + +/** + * \brief Set the palette for a pixel format structure. + */ +extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format, + SDL_Palette *palette); + +/** + * \brief Set a range of colors in a palette. + * + * \param palette The palette to modify. + * \param colors An array of colors to copy into the palette. + * \param firstcolor The index of the first palette entry to modify. + * \param ncolors The number of entries to modify. + * + * \return 0 on success, or -1 if not all of the colors could be set. + */ +extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, + const SDL_Color * colors, + int firstcolor, int ncolors); + +/** + * \brief Free a palette created with SDL_AllocPalette(). + * + * \sa SDL_AllocPalette() + */ +extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette); + +/** + * \brief Maps an RGB triple to an opaque pixel value for a given pixel format. + * + * \sa SDL_MapRGBA + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, + Uint8 r, Uint8 g, Uint8 b); + +/** + * \brief Maps an RGBA quadruple to a pixel value for a given pixel format. + * + * \sa SDL_MapRGB + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, + Uint8 r, Uint8 g, Uint8 b, + Uint8 a); + +/** + * \brief Get the RGB components from a pixel of the specified format. + * + * \sa SDL_GetRGBA + */ +extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, + const SDL_PixelFormat * format, + Uint8 * r, Uint8 * g, Uint8 * b); + +/** + * \brief Get the RGBA components from a pixel of the specified format. + * + * \sa SDL_GetRGB + */ +extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, + const SDL_PixelFormat * format, + Uint8 * r, Uint8 * g, Uint8 * b, + Uint8 * a); + +/** + * \brief Calculate a 256 entry gamma ramp for a gamma value. + */ +extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_pixels_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_platform.h b/Src/Decoder_H264_ALL/include/SDL/SDL_platform.h new file mode 100644 index 0000000..c6c2139 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_platform.h @@ -0,0 +1,181 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_platform.h + * + * Try to get a standard set of platform defines. + */ + +#ifndef _SDL_platform_h +#define _SDL_platform_h + +#if defined(_AIX) +#undef __AIX__ +#define __AIX__ 1 +#endif +#if defined(__HAIKU__) +#undef __HAIKU__ +#define __HAIKU__ 1 +#endif +#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) +#undef __BSDI__ +#define __BSDI__ 1 +#endif +#if defined(_arch_dreamcast) +#undef __DREAMCAST__ +#define __DREAMCAST__ 1 +#endif +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +#undef __FREEBSD__ +#define __FREEBSD__ 1 +#endif +#if defined(hpux) || defined(__hpux) || defined(__hpux__) +#undef __HPUX__ +#define __HPUX__ 1 +#endif +#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) +#undef __IRIX__ +#define __IRIX__ 1 +#endif +#if (defined(linux) || defined(__linux) || defined(__linux__)) +#undef __LINUX__ +#define __LINUX__ 1 +#endif +#if defined(ANDROID) || defined(__ANDROID__) +#undef __ANDROID__ +#undef __LINUX__ /* do we need to do this? */ +#define __ANDROID__ 1 +#endif + +#if defined(__APPLE__) +/* lets us know what version of Mac OS X we're compiling on */ +#include "AvailabilityMacros.h" +#include "TargetConditionals.h" +#if TARGET_OS_IPHONE +/* if compiling for iPhone */ +#undef __IPHONEOS__ +#define __IPHONEOS__ 1 +#undef __MACOSX__ +#else +/* if not compiling for iPhone */ +#undef __MACOSX__ +#define __MACOSX__ 1 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 +# error SDL for Mac OS X only supports deploying on 10.5 and above. +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */ +#endif /* TARGET_OS_IPHONE */ +#endif /* defined(__APPLE__) */ + +#if defined(__NetBSD__) +#undef __NETBSD__ +#define __NETBSD__ 1 +#endif +#if defined(__OpenBSD__) +#undef __OPENBSD__ +#define __OPENBSD__ 1 +#endif +#if defined(__OS2__) +#undef __OS2__ +#define __OS2__ 1 +#endif +#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) +#undef __OSF__ +#define __OSF__ 1 +#endif +#if defined(__QNXNTO__) +#undef __QNXNTO__ +#define __QNXNTO__ 1 +#endif +#if defined(riscos) || defined(__riscos) || defined(__riscos__) +#undef __RISCOS__ +#define __RISCOS__ 1 +#endif +#if defined(__sun) && defined(__SVR4) +#undef __SOLARIS__ +#define __SOLARIS__ 1 +#endif + +#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) +/* Try to find out if we're compiling for WinRT or non-WinRT */ +/* If _USING_V110_SDK71_ is defined it means we are using the v110_xp or v120_xp toolset. */ +#if (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_) /* _MSC_VER==1700 for MSVC 2012 */ +#include +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +#undef __WINDOWS__ +#define __WINDOWS__ 1 +/* See if we're compiling for WinRT: */ +#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) +#undef __WINRT__ +#define __WINRT__ 1 +#endif +#else +#undef __WINDOWS__ +#define __WINDOWS__ 1 +#endif /* _MSC_VER < 1700 */ +#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */ + +#if defined(__WINDOWS__) +#undef __WIN32__ +#define __WIN32__ 1 +#endif +#if defined(__PSP__) +#undef __PSP__ +#define __PSP__ 1 +#endif + +/* The NACL compiler defines __native_client__ and __pnacl__ + * Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi + */ +#if defined(__native_client__) +#undef __LINUX__ +#undef __NACL__ +#define __NACL__ 1 +#endif +#if defined(__pnacl__) +#undef __LINUX__ +#undef __PNACL__ +#define __PNACL__ 1 +/* PNACL with newlib supports static linking only */ +#define __SDL_NOGETPROCADDR__ +#endif + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Gets the name of the platform. + */ +extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_platform_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_power.h b/Src/Decoder_H264_ALL/include/SDL/SDL_power.h new file mode 100644 index 0000000..24c0501 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_power.h @@ -0,0 +1,75 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_power_h +#define _SDL_power_h + +/** + * \file SDL_power.h + * + * Header for the SDL power management routines. + */ + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The basic state for the system's power supply. + */ +typedef enum +{ + SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ + SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ + SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ + SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ + SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ +} SDL_PowerState; + + +/** + * \brief Get the current power supply details. + * + * \param secs Seconds of battery life left. You can pass a NULL here if + * you don't care. Will return -1 if we can't determine a + * value, or we're not running on a battery. + * + * \param pct Percentage of battery life left, between 0 and 100. You can + * pass a NULL here if you don't care. Will return -1 if we + * can't determine a value, or we're not running on a battery. + * + * \return The state of the battery (if any). + */ +extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_power_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_quit.h b/Src/Decoder_H264_ALL/include/SDL/SDL_quit.h new file mode 100644 index 0000000..cc06f28 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_quit.h @@ -0,0 +1,58 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_quit.h + * + * Include file for SDL quit event handling. + */ + +#ifndef _SDL_quit_h +#define _SDL_quit_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/** + * \file SDL_quit.h + * + * An ::SDL_QUIT event is generated when the user tries to close the application + * window. If it is ignored or filtered out, the window will remain open. + * If it is not ignored or filtered, it is queued normally and the window + * is allowed to close. When the window is closed, screen updates will + * complete, but have no effect. + * + * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) + * and SIGTERM (system termination request), if handlers do not already + * exist, that generate ::SDL_QUIT events as well. There is no way + * to determine the cause of an ::SDL_QUIT event, but setting a signal + * handler in your application will override the default generation of + * quit events for that signal. + * + * \sa SDL_Quit() + */ + +/* There are no functions directly affecting the quit event */ + +#define SDL_QuitRequested() \ + (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) + +#endif /* _SDL_quit_h */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_rect.h b/Src/Decoder_H264_ALL/include/SDL/SDL_rect.h new file mode 100644 index 0000000..bbcb9a3 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_rect.h @@ -0,0 +1,148 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_rect.h + * + * Header file for SDL_rect definition and management functions. + */ + +#ifndef _SDL_rect_h +#define _SDL_rect_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_pixels.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The structure that defines a point + * + * \sa SDL_EnclosePoints + * \sa SDL_PointInRect + */ +typedef struct SDL_Point +{ + int x; + int y; +} SDL_Point; + +/** + * \brief A rectangle, with the origin at the upper left. + * + * \sa SDL_RectEmpty + * \sa SDL_RectEquals + * \sa SDL_HasIntersection + * \sa SDL_IntersectRect + * \sa SDL_UnionRect + * \sa SDL_EnclosePoints + */ +typedef struct SDL_Rect +{ + int x, y; + int w, h; +} SDL_Rect; + +/** + * \brief Returns true if point resides inside a rectangle. + */ +SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) +{ + return ( (p->x >= r->x) && (p->x < (r->x + r->w)) && + (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE; +} + +/** + * \brief Returns true if the rectangle has no area. + */ +SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) +{ + return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE; +} + +/** + * \brief Returns true if the two rectangles are equal. + */ +SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b) +{ + return (a && b && (a->x == b->x) && (a->y == b->y) && + (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE; +} + +/** + * \brief Determine whether two rectangles intersect. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, + const SDL_Rect * B); + +/** + * \brief Calculate the intersection of two rectangles. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, + const SDL_Rect * B, + SDL_Rect * result); + +/** + * \brief Calculate the union of two rectangles. + */ +extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A, + const SDL_Rect * B, + SDL_Rect * result); + +/** + * \brief Calculate a minimal rectangle enclosing a set of points + * + * \return SDL_TRUE if any points were within the clipping rect + */ +extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, + int count, + const SDL_Rect * clip, + SDL_Rect * result); + +/** + * \brief Calculate the intersection of a rectangle and line segment. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * + rect, int *X1, + int *Y1, int *X2, + int *Y2); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_rect_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_render.h b/Src/Decoder_H264_ALL/include/SDL/SDL_render.h new file mode 100644 index 0000000..e4ed2af --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_render.h @@ -0,0 +1,880 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_render.h + * + * Header file for SDL 2D rendering functions. + * + * This API supports the following features: + * * single pixel points + * * single pixel lines + * * filled rectangles + * * texture images + * + * The primitives may be drawn in opaque, blended, or additive modes. + * + * The texture images may be drawn in opaque, blended, or additive modes. + * They can have an additional color tint or alpha modulation applied to + * them, and may also be stretched with linear interpolation. + * + * This API is designed to accelerate simple 2D operations. You may + * want more functionality such as polygons and particle effects and + * in that case you should use SDL's OpenGL/Direct3D support or one + * of the many good 3D engines. + * + * These functions must be called from the main thread. + * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995 + */ + +#ifndef _SDL_render_h +#define _SDL_render_h + +#include "SDL_stdinc.h" +#include "SDL_rect.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Flags used when creating a rendering context + */ +typedef enum +{ + SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */ + SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware + acceleration */ + SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized + with the refresh rate */ + SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports + rendering to texture */ +} SDL_RendererFlags; + +/** + * \brief Information on the capabilities of a render driver or context. + */ +typedef struct SDL_RendererInfo +{ + const char *name; /**< The name of the renderer */ + Uint32 flags; /**< Supported ::SDL_RendererFlags */ + Uint32 num_texture_formats; /**< The number of available texture formats */ + Uint32 texture_formats[16]; /**< The available texture formats */ + int max_texture_width; /**< The maximum texture width */ + int max_texture_height; /**< The maximum texture height */ +} SDL_RendererInfo; + +/** + * \brief The access pattern allowed for a texture. + */ +typedef enum +{ + SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */ + SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */ + SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */ +} SDL_TextureAccess; + +/** + * \brief The texture channel modulation used in SDL_RenderCopy(). + */ +typedef enum +{ + SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */ + SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */ + SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */ +} SDL_TextureModulate; + +/** + * \brief Flip constants for SDL_RenderCopyEx + */ +typedef enum +{ + SDL_FLIP_NONE = 0x00000000, /**< Do not flip */ + SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */ + SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */ +} SDL_RendererFlip; + +/** + * \brief A structure representing rendering state + */ +struct SDL_Renderer; +typedef struct SDL_Renderer SDL_Renderer; + +/** + * \brief An efficient driver-specific representation of pixel data + */ +struct SDL_Texture; +typedef struct SDL_Texture SDL_Texture; + + +/* Function prototypes */ + +/** + * \brief Get the number of 2D rendering drivers available for the current + * display. + * + * A render driver is a set of code that handles rendering and texture + * management on a particular display. Normally there is only one, but + * some drivers may have several available with different capabilities. + * + * \sa SDL_GetRenderDriverInfo() + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); + +/** + * \brief Get information about a specific 2D rendering driver for the current + * display. + * + * \param index The index of the driver to query information about. + * \param info A pointer to an SDL_RendererInfo struct to be filled with + * information on the rendering driver. + * + * \return 0 on success, -1 if the index was out of range. + * + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, + SDL_RendererInfo * info); + +/** + * \brief Create a window and default renderer + * + * \param width The width of the window + * \param height The height of the window + * \param window_flags The flags used to create the window + * \param window A pointer filled with the window, or NULL on error + * \param renderer A pointer filled with the renderer, or NULL on error + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer( + int width, int height, Uint32 window_flags, + SDL_Window **window, SDL_Renderer **renderer); + + +/** + * \brief Create a 2D rendering context for a window. + * + * \param window The window where rendering is displayed. + * \param index The index of the rendering driver to initialize, or -1 to + * initialize the first one supporting the requested flags. + * \param flags ::SDL_RendererFlags. + * + * \return A valid rendering context or NULL if there was an error. + * + * \sa SDL_CreateSoftwareRenderer() + * \sa SDL_GetRendererInfo() + * \sa SDL_DestroyRenderer() + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window, + int index, Uint32 flags); + +/** + * \brief Create a 2D software rendering context for a surface. + * + * \param surface The surface where rendering is done. + * + * \return A valid rendering context or NULL if there was an error. + * + * \sa SDL_CreateRenderer() + * \sa SDL_DestroyRenderer() + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface); + +/** + * \brief Get the renderer associated with a window. + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window); + +/** + * \brief Get information about a rendering context. + */ +extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer, + SDL_RendererInfo * info); + +/** + * \brief Get the output size in pixels of a rendering context. + */ +extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer, + int *w, int *h); + +/** + * \brief Create a texture for a rendering context. + * + * \param renderer The renderer. + * \param format The format of the texture. + * \param access One of the enumerated values in ::SDL_TextureAccess. + * \param w The width of the texture in pixels. + * \param h The height of the texture in pixels. + * + * \return The created texture is returned, or NULL if no rendering context was + * active, the format was unsupported, or the width or height were out + * of range. + * + * \sa SDL_QueryTexture() + * \sa SDL_UpdateTexture() + * \sa SDL_DestroyTexture() + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer, + Uint32 format, + int access, int w, + int h); + +/** + * \brief Create a texture from an existing surface. + * + * \param renderer The renderer. + * \param surface The surface containing pixel data used to fill the texture. + * + * \return The created texture is returned, or NULL on error. + * + * \note The surface is not modified or freed by this function. + * + * \sa SDL_QueryTexture() + * \sa SDL_DestroyTexture() + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface); + +/** + * \brief Query the attributes of a texture + * + * \param texture A texture to be queried. + * \param format A pointer filled in with the raw format of the texture. The + * actual format may differ, but pixel transfers will use this + * format. + * \param access A pointer filled in with the actual access to the texture. + * \param w A pointer filled in with the width of the texture in pixels. + * \param h A pointer filled in with the height of the texture in pixels. + * + * \return 0 on success, or -1 if the texture is not valid. + */ +extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture, + Uint32 * format, int *access, + int *w, int *h); + +/** + * \brief Set an additional color value used in render copy operations. + * + * \param texture The texture to update. + * \param r The red color value multiplied into copy operations. + * \param g The green color value multiplied into copy operations. + * \param b The blue color value multiplied into copy operations. + * + * \return 0 on success, or -1 if the texture is not valid or color modulation + * is not supported. + * + * \sa SDL_GetTextureColorMod() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture, + Uint8 r, Uint8 g, Uint8 b); + + +/** + * \brief Get the additional color value used in render copy operations. + * + * \param texture The texture to query. + * \param r A pointer filled in with the current red color value. + * \param g A pointer filled in with the current green color value. + * \param b A pointer filled in with the current blue color value. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureColorMod() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture, + Uint8 * r, Uint8 * g, + Uint8 * b); + +/** + * \brief Set an additional alpha value used in render copy operations. + * + * \param texture The texture to update. + * \param alpha The alpha value multiplied into copy operations. + * + * \return 0 on success, or -1 if the texture is not valid or alpha modulation + * is not supported. + * + * \sa SDL_GetTextureAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture, + Uint8 alpha); + +/** + * \brief Get the additional alpha value used in render copy operations. + * + * \param texture The texture to query. + * \param alpha A pointer filled in with the current alpha value. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture, + Uint8 * alpha); + +/** + * \brief Set the blend mode used for texture copy operations. + * + * \param texture The texture to update. + * \param blendMode ::SDL_BlendMode to use for texture blending. + * + * \return 0 on success, or -1 if the texture is not valid or the blend mode is + * not supported. + * + * \note If the blend mode is not supported, the closest supported mode is + * chosen. + * + * \sa SDL_GetTextureBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, + SDL_BlendMode blendMode); + +/** + * \brief Get the blend mode used for texture copy operations. + * + * \param texture The texture to query. + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, + SDL_BlendMode *blendMode); + +/** + * \brief Update the given texture rectangle with new pixel data. + * + * \param texture The texture to update + * \param rect A pointer to the rectangle of pixels to update, or NULL to + * update the entire texture. + * \param pixels The raw pixel data. + * \param pitch The number of bytes in a row of pixel data, including padding between lines. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \note This is a fairly slow function. + */ +extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture, + const SDL_Rect * rect, + const void *pixels, int pitch); + +/** + * \brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data. + * + * \param texture The texture to update + * \param rect A pointer to the rectangle of pixels to update, or NULL to + * update the entire texture. + * \param Yplane The raw pixel data for the Y plane. + * \param Ypitch The number of bytes between rows of pixel data for the Y plane. + * \param Uplane The raw pixel data for the U plane. + * \param Upitch The number of bytes between rows of pixel data for the U plane. + * \param Vplane The raw pixel data for the V plane. + * \param Vpitch The number of bytes between rows of pixel data for the V plane. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \note You can use SDL_UpdateTexture() as long as your pixel data is + * a contiguous block of Y and U/V planes in the proper order, but + * this function is available if your pixel data is not contiguous. + */ +extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture, + const SDL_Rect * rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *Uplane, int Upitch, + const Uint8 *Vplane, int Vpitch); + +/** + * \brief Lock a portion of the texture for write-only pixel access. + * + * \param texture The texture to lock for access, which was created with + * ::SDL_TEXTUREACCESS_STREAMING. + * \param rect A pointer to the rectangle to lock for access. If the rect + * is NULL, the entire texture will be locked. + * \param pixels This is filled in with a pointer to the locked pixels, + * appropriately offset by the locked area. + * \param pitch This is filled in with the pitch of the locked pixels. + * + * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING. + * + * \sa SDL_UnlockTexture() + */ +extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture, + const SDL_Rect * rect, + void **pixels, int *pitch); + +/** + * \brief Unlock a texture, uploading the changes to video memory, if needed. + * + * \sa SDL_LockTexture() + */ +extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture); + +/** + * \brief Determines whether a window supports the use of render targets + * + * \param renderer The renderer that will be checked + * + * \return SDL_TRUE if supported, SDL_FALSE if not. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer); + +/** + * \brief Set a texture as the current rendering target. + * + * \param renderer The renderer. + * \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target + * + * \return 0 on success, or -1 on error + * + * \sa SDL_GetRenderTarget() + */ +extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, + SDL_Texture *texture); + +/** + * \brief Get the current render target or NULL for the default render target. + * + * \return The current render target + * + * \sa SDL_SetRenderTarget() + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer); + +/** + * \brief Set device independent resolution for rendering + * + * \param renderer The renderer for which resolution should be set. + * \param w The width of the logical resolution + * \param h The height of the logical resolution + * + * This function uses the viewport and scaling functionality to allow a fixed logical + * resolution for rendering, regardless of the actual output resolution. If the actual + * output resolution doesn't have the same aspect ratio the output rendering will be + * centered within the output display. + * + * If the output display is a window, mouse events in the window will be filtered + * and scaled so they seem to arrive within the logical resolution. + * + * \note If this function results in scaling or subpixel drawing by the + * rendering backend, it will be handled using the appropriate + * quality hints. + * + * \sa SDL_RenderGetLogicalSize() + * \sa SDL_RenderSetScale() + * \sa SDL_RenderSetViewport() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h); + +/** + * \brief Get device independent resolution for rendering + * + * \param renderer The renderer from which resolution should be queried. + * \param w A pointer filled with the width of the logical resolution + * \param h A pointer filled with the height of the logical resolution + * + * \sa SDL_RenderSetLogicalSize() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h); + +/** + * \brief Set the drawing area for rendering on the current target. + * + * \param renderer The renderer for which the drawing area should be set. + * \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target. + * + * The x,y of the viewport rect represents the origin for rendering. + * + * \return 0 on success, or -1 on error + * + * \note If the window associated with the renderer is resized, the viewport is automatically reset. + * + * \sa SDL_RenderGetViewport() + * \sa SDL_RenderSetLogicalSize() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Get the drawing area for the current target. + * + * \sa SDL_RenderSetViewport() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer, + SDL_Rect * rect); + +/** + * \brief Set the clip rectangle for the current target. + * + * \param renderer The renderer for which clip rectangle should be set. + * \param rect A pointer to the rectangle to set as the clip rectangle, or + * NULL to disable clipping. + * + * \return 0 on success, or -1 on error + * + * \sa SDL_RenderGetClipRect() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Get the clip rectangle for the current target. + * + * \param renderer The renderer from which clip rectangle should be queried. + * \param rect A pointer filled in with the current clip rectangle, or + * an empty rectangle if clipping is disabled. + * + * \sa SDL_RenderSetClipRect() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer, + SDL_Rect * rect); + +/** + * \brief Get whether clipping is enabled on the given renderer. + * + * \param renderer The renderer from which clip state should be queried. + * + * \sa SDL_RenderGetClipRect() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer); + + +/** + * \brief Set the drawing scale for rendering on the current target. + * + * \param renderer The renderer for which the drawing scale should be set. + * \param scaleX The horizontal scaling factor + * \param scaleY The vertical scaling factor + * + * The drawing coordinates are scaled by the x/y scaling factors + * before they are used by the renderer. This allows resolution + * independent drawing with a single coordinate system. + * + * \note If this results in scaling or subpixel drawing by the + * rendering backend, it will be handled using the appropriate + * quality hints. For best results use integer scaling factors. + * + * \sa SDL_RenderGetScale() + * \sa SDL_RenderSetLogicalSize() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer, + float scaleX, float scaleY); + +/** + * \brief Get the drawing scale for the current target. + * + * \param renderer The renderer from which drawing scale should be queried. + * \param scaleX A pointer filled in with the horizontal scaling factor + * \param scaleY A pointer filled in with the vertical scaling factor + * + * \sa SDL_RenderSetScale() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer, + float *scaleX, float *scaleY); + +/** + * \brief Set the color used for drawing operations (Rect, Line and Clear). + * + * \param renderer The renderer for which drawing color should be set. + * \param r The red value used to draw on the rendering target. + * \param g The green value used to draw on the rendering target. + * \param b The blue value used to draw on the rendering target. + * \param a The alpha value used to draw on the rendering target, usually + * ::SDL_ALPHA_OPAQUE (255). + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer * renderer, + Uint8 r, Uint8 g, Uint8 b, + Uint8 a); + +/** + * \brief Get the color used for drawing operations (Rect, Line and Clear). + * + * \param renderer The renderer from which drawing color should be queried. + * \param r A pointer to the red value used to draw on the rendering target. + * \param g A pointer to the green value used to draw on the rendering target. + * \param b A pointer to the blue value used to draw on the rendering target. + * \param a A pointer to the alpha value used to draw on the rendering target, + * usually ::SDL_ALPHA_OPAQUE (255). + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer * renderer, + Uint8 * r, Uint8 * g, Uint8 * b, + Uint8 * a); + +/** + * \brief Set the blend mode used for drawing operations (Fill and Line). + * + * \param renderer The renderer for which blend mode should be set. + * \param blendMode ::SDL_BlendMode to use for blending. + * + * \return 0 on success, or -1 on error + * + * \note If the blend mode is not supported, the closest supported mode is + * chosen. + * + * \sa SDL_GetRenderDrawBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, + SDL_BlendMode blendMode); + +/** + * \brief Get the blend mode used for drawing operations. + * + * \param renderer The renderer from which blend mode should be queried. + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 on error + * + * \sa SDL_SetRenderDrawBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, + SDL_BlendMode *blendMode); + +/** + * \brief Clear the current rendering target with the drawing color + * + * This function clears the entire rendering target, ignoring the viewport. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer); + +/** + * \brief Draw a point on the current rendering target. + * + * \param renderer The renderer which should draw a point. + * \param x The x coordinate of the point. + * \param y The y coordinate of the point. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer, + int x, int y); + +/** + * \brief Draw multiple points on the current rendering target. + * + * \param renderer The renderer which should draw multiple points. + * \param points The points to draw + * \param count The number of points to draw + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer, + const SDL_Point * points, + int count); + +/** + * \brief Draw a line on the current rendering target. + * + * \param renderer The renderer which should draw a line. + * \param x1 The x coordinate of the start point. + * \param y1 The y coordinate of the start point. + * \param x2 The x coordinate of the end point. + * \param y2 The y coordinate of the end point. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer, + int x1, int y1, int x2, int y2); + +/** + * \brief Draw a series of connected lines on the current rendering target. + * + * \param renderer The renderer which should draw multiple lines. + * \param points The points along the lines + * \param count The number of points, drawing count-1 lines + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer, + const SDL_Point * points, + int count); + +/** + * \brief Draw a rectangle on the current rendering target. + * + * \param renderer The renderer which should draw a rectangle. + * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Draw some number of rectangles on the current rendering target. + * + * \param renderer The renderer which should draw multiple rectangles. + * \param rects A pointer to an array of destination rectangles. + * \param count The number of rectangles. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer, + const SDL_Rect * rects, + int count); + +/** + * \brief Fill a rectangle on the current rendering target with the drawing color. + * + * \param renderer The renderer which should fill a rectangle. + * \param rect A pointer to the destination rectangle, or NULL for the entire + * rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Fill some number of rectangles on the current rendering target with the drawing color. + * + * \param renderer The renderer which should fill multiple rectangles. + * \param rects A pointer to an array of destination rectangles. + * \param count The number of rectangles. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer, + const SDL_Rect * rects, + int count); + +/** + * \brief Copy a portion of the texture to the current rendering target. + * + * \param renderer The renderer which should copy parts of a texture. + * \param texture The source texture. + * \param srcrect A pointer to the source rectangle, or NULL for the entire + * texture. + * \param dstrect A pointer to the destination rectangle, or NULL for the + * entire rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer, + SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_Rect * dstrect); + +/** + * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center + * + * \param renderer The renderer which should copy parts of a texture. + * \param texture The source texture. + * \param srcrect A pointer to the source rectangle, or NULL for the entire + * texture. + * \param dstrect A pointer to the destination rectangle, or NULL for the + * entire rendering target. + * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect + * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2). + * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer, + SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_Rect * dstrect, + const double angle, + const SDL_Point *center, + const SDL_RendererFlip flip); + +/** + * \brief Read pixels from the current rendering target. + * + * \param renderer The renderer from which pixels should be read. + * \param rect A pointer to the rectangle to read, or NULL for the entire + * render target. + * \param format The desired format of the pixel data, or 0 to use the format + * of the rendering target + * \param pixels A pointer to be filled in with the pixel data + * \param pitch The pitch of the pixels parameter. + * + * \return 0 on success, or -1 if pixel reading is not supported. + * + * \warning This is a very slow operation, and should not be used frequently. + */ +extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer, + const SDL_Rect * rect, + Uint32 format, + void *pixels, int pitch); + +/** + * \brief Update the screen with rendering performed. + */ +extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer); + +/** + * \brief Destroy the specified texture. + * + * \sa SDL_CreateTexture() + * \sa SDL_CreateTextureFromSurface() + */ +extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture); + +/** + * \brief Destroy the rendering context for a window and free associated + * textures. + * + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer); + + +/** + * \brief Bind the texture to the current OpenGL/ES/ES2 context for use with + * OpenGL instructions. + * + * \param texture The SDL texture to bind + * \param texw A pointer to a float that will be filled with the texture width + * \param texh A pointer to a float that will be filled with the texture height + * + * \return 0 on success, or -1 if the operation is not supported + */ +extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh); + +/** + * \brief Unbind a texture from the current OpenGL/ES/ES2 context. + * + * \param texture The SDL texture to unbind + * + * \return 0 on success, or -1 if the operation is not supported + */ +extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_render_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_revision.h b/Src/Decoder_H264_ALL/include/SDL/SDL_revision.h new file mode 100644 index 0000000..6d7163d --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_revision.h @@ -0,0 +1,2 @@ +#define SDL_REVISION "hg-10001:e12c38730512" +#define SDL_REVISION_NUMBER 10001 diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_rwops.h b/Src/Decoder_H264_ALL/include/SDL/SDL_rwops.h new file mode 100644 index 0000000..f460ae7 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_rwops.h @@ -0,0 +1,231 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_rwops.h + * + * This file provides a general interface for SDL to read and write + * data streams. It can easily be extended to files, memory, etc. + */ + +#ifndef _SDL_rwops_h +#define _SDL_rwops_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* RWops Types */ +#define SDL_RWOPS_UNKNOWN 0 /* Unknown stream type */ +#define SDL_RWOPS_WINFILE 1 /* Win32 file */ +#define SDL_RWOPS_STDFILE 2 /* Stdio file */ +#define SDL_RWOPS_JNIFILE 3 /* Android asset */ +#define SDL_RWOPS_MEMORY 4 /* Memory stream */ +#define SDL_RWOPS_MEMORY_RO 5 /* Read-Only memory stream */ + +/** + * This is the read/write operation structure -- very basic. + */ +typedef struct SDL_RWops +{ + /** + * Return the size of the file in this rwops, or -1 if unknown + */ + Sint64 (SDLCALL * size) (struct SDL_RWops * context); + + /** + * Seek to \c offset relative to \c whence, one of stdio's whence values: + * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END + * + * \return the final offset in the data stream, or -1 on error. + */ + Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset, + int whence); + + /** + * Read up to \c maxnum objects each of size \c size from the data + * stream to the area pointed at by \c ptr. + * + * \return the number of objects read, or 0 at error or end of file. + */ + size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr, + size_t size, size_t maxnum); + + /** + * Write exactly \c num objects each of size \c size from the area + * pointed at by \c ptr to data stream. + * + * \return the number of objects written, or 0 at error or end of file. + */ + size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr, + size_t size, size_t num); + + /** + * Close and free an allocated SDL_RWops structure. + * + * \return 0 if successful or -1 on write error when flushing data. + */ + int (SDLCALL * close) (struct SDL_RWops * context); + + Uint32 type; + union + { +#if defined(__ANDROID__) + struct + { + void *fileNameRef; + void *inputStreamRef; + void *readableByteChannelRef; + void *readMethod; + void *assetFileDescriptorRef; + long position; + long size; + long offset; + int fd; + } androidio; +#elif defined(__WIN32__) + struct + { + SDL_bool append; + void *h; + struct + { + void *data; + size_t size; + size_t left; + } buffer; + } windowsio; +#endif + +#ifdef HAVE_STDIO_H + struct + { + SDL_bool autoclose; + FILE *fp; + } stdio; +#endif + struct + { + Uint8 *base; + Uint8 *here; + Uint8 *stop; + } mem; + struct + { + void *data1; + void *data2; + } unknown; + } hidden; + +} SDL_RWops; + + +/** + * \name RWFrom functions + * + * Functions to create SDL_RWops structures from various data streams. + */ +/* @{ */ + +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file, + const char *mode); + +#ifdef HAVE_STDIO_H +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, + SDL_bool autoclose); +#else +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp, + SDL_bool autoclose); +#endif + +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size); +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem, + int size); + +/* @} *//* RWFrom functions */ + + +extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); +extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area); + +#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ +#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ +#define RW_SEEK_END 2 /**< Seek relative to the end of data */ + +/** + * \name Read/write macros + * + * Macros to easily read and write from an SDL_RWops structure. + */ +/* @{ */ +#define SDL_RWsize(ctx) (ctx)->size(ctx) +#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) +#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) +#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) +#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) +#define SDL_RWclose(ctx) (ctx)->close(ctx) +/* @} *//* Read/write macros */ + + +/** + * \name Read endian functions + * + * Read an item of the specified endianness and return in native format. + */ +/* @{ */ +extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src); +extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src); +extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src); +/* @} *//* Read endian functions */ + +/** + * \name Write endian functions + * + * Write an item of native format to the specified endianness. + */ +/* @{ */ +extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value); +extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value); +extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value); +extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value); +/* @} *//* Write endian functions */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_rwops_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_scancode.h b/Src/Decoder_H264_ALL/include/SDL/SDL_scancode.h new file mode 100644 index 0000000..0af1dd5 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_scancode.h @@ -0,0 +1,401 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_scancode.h + * + * Defines keyboard scancodes. + */ + +#ifndef _SDL_scancode_h +#define _SDL_scancode_h + +#include "SDL_stdinc.h" + +/** + * \brief The SDL keyboard scancode representation. + * + * Values of this type are used to represent keyboard keys, among other places + * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the + * SDL_Event structure. + * + * The values in this enumeration are based on the USB usage page standard: + * http://www.usb.org/developers/devclass_docs/Hut1_12v2.pdf + */ +typedef enum +{ + SDL_SCANCODE_UNKNOWN = 0, + + /** + * \name Usage page 0x07 + * + * These values are from usage page 0x07 (USB keyboard page). + */ + /* @{ */ + + SDL_SCANCODE_A = 4, + SDL_SCANCODE_B = 5, + SDL_SCANCODE_C = 6, + SDL_SCANCODE_D = 7, + SDL_SCANCODE_E = 8, + SDL_SCANCODE_F = 9, + SDL_SCANCODE_G = 10, + SDL_SCANCODE_H = 11, + SDL_SCANCODE_I = 12, + SDL_SCANCODE_J = 13, + SDL_SCANCODE_K = 14, + SDL_SCANCODE_L = 15, + SDL_SCANCODE_M = 16, + SDL_SCANCODE_N = 17, + SDL_SCANCODE_O = 18, + SDL_SCANCODE_P = 19, + SDL_SCANCODE_Q = 20, + SDL_SCANCODE_R = 21, + SDL_SCANCODE_S = 22, + SDL_SCANCODE_T = 23, + SDL_SCANCODE_U = 24, + SDL_SCANCODE_V = 25, + SDL_SCANCODE_W = 26, + SDL_SCANCODE_X = 27, + SDL_SCANCODE_Y = 28, + SDL_SCANCODE_Z = 29, + + SDL_SCANCODE_1 = 30, + SDL_SCANCODE_2 = 31, + SDL_SCANCODE_3 = 32, + SDL_SCANCODE_4 = 33, + SDL_SCANCODE_5 = 34, + SDL_SCANCODE_6 = 35, + SDL_SCANCODE_7 = 36, + SDL_SCANCODE_8 = 37, + SDL_SCANCODE_9 = 38, + SDL_SCANCODE_0 = 39, + + SDL_SCANCODE_RETURN = 40, + SDL_SCANCODE_ESCAPE = 41, + SDL_SCANCODE_BACKSPACE = 42, + SDL_SCANCODE_TAB = 43, + SDL_SCANCODE_SPACE = 44, + + SDL_SCANCODE_MINUS = 45, + SDL_SCANCODE_EQUALS = 46, + SDL_SCANCODE_LEFTBRACKET = 47, + SDL_SCANCODE_RIGHTBRACKET = 48, + SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return + * key on ISO keyboards and at the right end + * of the QWERTY row on ANSI keyboards. + * Produces REVERSE SOLIDUS (backslash) and + * VERTICAL LINE in a US layout, REVERSE + * SOLIDUS and VERTICAL LINE in a UK Mac + * layout, NUMBER SIGN and TILDE in a UK + * Windows layout, DOLLAR SIGN and POUND SIGN + * in a Swiss German layout, NUMBER SIGN and + * APOSTROPHE in a German layout, GRAVE + * ACCENT and POUND SIGN in a French Mac + * layout, and ASTERISK and MICRO SIGN in a + * French Windows layout. + */ + SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code + * instead of 49 for the same key, but all + * OSes I've seen treat the two codes + * identically. So, as an implementor, unless + * your keyboard generates both of those + * codes and your OS treats them differently, + * you should generate SDL_SCANCODE_BACKSLASH + * instead of this code. As a user, you + * should not rely on this code because SDL + * will never generate it with most (all?) + * keyboards. + */ + SDL_SCANCODE_SEMICOLON = 51, + SDL_SCANCODE_APOSTROPHE = 52, + SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI + * and ISO keyboards). Produces GRAVE ACCENT and + * TILDE in a US Windows layout and in US and UK + * Mac layouts on ANSI keyboards, GRAVE ACCENT + * and NOT SIGN in a UK Windows layout, SECTION + * SIGN and PLUS-MINUS SIGN in US and UK Mac + * layouts on ISO keyboards, SECTION SIGN and + * DEGREE SIGN in a Swiss German layout (Mac: + * only on ISO keyboards), CIRCUMFLEX ACCENT and + * DEGREE SIGN in a German layout (Mac: only on + * ISO keyboards), SUPERSCRIPT TWO and TILDE in a + * French Windows layout, COMMERCIAL AT and + * NUMBER SIGN in a French Mac layout on ISO + * keyboards, and LESS-THAN SIGN and GREATER-THAN + * SIGN in a Swiss German, German, or French Mac + * layout on ANSI keyboards. + */ + SDL_SCANCODE_COMMA = 54, + SDL_SCANCODE_PERIOD = 55, + SDL_SCANCODE_SLASH = 56, + + SDL_SCANCODE_CAPSLOCK = 57, + + SDL_SCANCODE_F1 = 58, + SDL_SCANCODE_F2 = 59, + SDL_SCANCODE_F3 = 60, + SDL_SCANCODE_F4 = 61, + SDL_SCANCODE_F5 = 62, + SDL_SCANCODE_F6 = 63, + SDL_SCANCODE_F7 = 64, + SDL_SCANCODE_F8 = 65, + SDL_SCANCODE_F9 = 66, + SDL_SCANCODE_F10 = 67, + SDL_SCANCODE_F11 = 68, + SDL_SCANCODE_F12 = 69, + + SDL_SCANCODE_PRINTSCREEN = 70, + SDL_SCANCODE_SCROLLLOCK = 71, + SDL_SCANCODE_PAUSE = 72, + SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but + does send code 73, not 117) */ + SDL_SCANCODE_HOME = 74, + SDL_SCANCODE_PAGEUP = 75, + SDL_SCANCODE_DELETE = 76, + SDL_SCANCODE_END = 77, + SDL_SCANCODE_PAGEDOWN = 78, + SDL_SCANCODE_RIGHT = 79, + SDL_SCANCODE_LEFT = 80, + SDL_SCANCODE_DOWN = 81, + SDL_SCANCODE_UP = 82, + + SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards + */ + SDL_SCANCODE_KP_DIVIDE = 84, + SDL_SCANCODE_KP_MULTIPLY = 85, + SDL_SCANCODE_KP_MINUS = 86, + SDL_SCANCODE_KP_PLUS = 87, + SDL_SCANCODE_KP_ENTER = 88, + SDL_SCANCODE_KP_1 = 89, + SDL_SCANCODE_KP_2 = 90, + SDL_SCANCODE_KP_3 = 91, + SDL_SCANCODE_KP_4 = 92, + SDL_SCANCODE_KP_5 = 93, + SDL_SCANCODE_KP_6 = 94, + SDL_SCANCODE_KP_7 = 95, + SDL_SCANCODE_KP_8 = 96, + SDL_SCANCODE_KP_9 = 97, + SDL_SCANCODE_KP_0 = 98, + SDL_SCANCODE_KP_PERIOD = 99, + + SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO + * keyboards have over ANSI ones, + * located between left shift and Y. + * Produces GRAVE ACCENT and TILDE in a + * US or UK Mac layout, REVERSE SOLIDUS + * (backslash) and VERTICAL LINE in a + * US or UK Windows layout, and + * LESS-THAN SIGN and GREATER-THAN SIGN + * in a Swiss German, German, or French + * layout. */ + SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */ + SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, + * not a physical key - but some Mac keyboards + * do have a power key. */ + SDL_SCANCODE_KP_EQUALS = 103, + SDL_SCANCODE_F13 = 104, + SDL_SCANCODE_F14 = 105, + SDL_SCANCODE_F15 = 106, + SDL_SCANCODE_F16 = 107, + SDL_SCANCODE_F17 = 108, + SDL_SCANCODE_F18 = 109, + SDL_SCANCODE_F19 = 110, + SDL_SCANCODE_F20 = 111, + SDL_SCANCODE_F21 = 112, + SDL_SCANCODE_F22 = 113, + SDL_SCANCODE_F23 = 114, + SDL_SCANCODE_F24 = 115, + SDL_SCANCODE_EXECUTE = 116, + SDL_SCANCODE_HELP = 117, + SDL_SCANCODE_MENU = 118, + SDL_SCANCODE_SELECT = 119, + SDL_SCANCODE_STOP = 120, + SDL_SCANCODE_AGAIN = 121, /**< redo */ + SDL_SCANCODE_UNDO = 122, + SDL_SCANCODE_CUT = 123, + SDL_SCANCODE_COPY = 124, + SDL_SCANCODE_PASTE = 125, + SDL_SCANCODE_FIND = 126, + SDL_SCANCODE_MUTE = 127, + SDL_SCANCODE_VOLUMEUP = 128, + SDL_SCANCODE_VOLUMEDOWN = 129, +/* not sure whether there's a reason to enable these */ +/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */ +/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */ +/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */ + SDL_SCANCODE_KP_COMMA = 133, + SDL_SCANCODE_KP_EQUALSAS400 = 134, + + SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see + footnotes in USB doc */ + SDL_SCANCODE_INTERNATIONAL2 = 136, + SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */ + SDL_SCANCODE_INTERNATIONAL4 = 138, + SDL_SCANCODE_INTERNATIONAL5 = 139, + SDL_SCANCODE_INTERNATIONAL6 = 140, + SDL_SCANCODE_INTERNATIONAL7 = 141, + SDL_SCANCODE_INTERNATIONAL8 = 142, + SDL_SCANCODE_INTERNATIONAL9 = 143, + SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */ + SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */ + SDL_SCANCODE_LANG3 = 146, /**< Katakana */ + SDL_SCANCODE_LANG4 = 147, /**< Hiragana */ + SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */ + SDL_SCANCODE_LANG6 = 149, /**< reserved */ + SDL_SCANCODE_LANG7 = 150, /**< reserved */ + SDL_SCANCODE_LANG8 = 151, /**< reserved */ + SDL_SCANCODE_LANG9 = 152, /**< reserved */ + + SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */ + SDL_SCANCODE_SYSREQ = 154, + SDL_SCANCODE_CANCEL = 155, + SDL_SCANCODE_CLEAR = 156, + SDL_SCANCODE_PRIOR = 157, + SDL_SCANCODE_RETURN2 = 158, + SDL_SCANCODE_SEPARATOR = 159, + SDL_SCANCODE_OUT = 160, + SDL_SCANCODE_OPER = 161, + SDL_SCANCODE_CLEARAGAIN = 162, + SDL_SCANCODE_CRSEL = 163, + SDL_SCANCODE_EXSEL = 164, + + SDL_SCANCODE_KP_00 = 176, + SDL_SCANCODE_KP_000 = 177, + SDL_SCANCODE_THOUSANDSSEPARATOR = 178, + SDL_SCANCODE_DECIMALSEPARATOR = 179, + SDL_SCANCODE_CURRENCYUNIT = 180, + SDL_SCANCODE_CURRENCYSUBUNIT = 181, + SDL_SCANCODE_KP_LEFTPAREN = 182, + SDL_SCANCODE_KP_RIGHTPAREN = 183, + SDL_SCANCODE_KP_LEFTBRACE = 184, + SDL_SCANCODE_KP_RIGHTBRACE = 185, + SDL_SCANCODE_KP_TAB = 186, + SDL_SCANCODE_KP_BACKSPACE = 187, + SDL_SCANCODE_KP_A = 188, + SDL_SCANCODE_KP_B = 189, + SDL_SCANCODE_KP_C = 190, + SDL_SCANCODE_KP_D = 191, + SDL_SCANCODE_KP_E = 192, + SDL_SCANCODE_KP_F = 193, + SDL_SCANCODE_KP_XOR = 194, + SDL_SCANCODE_KP_POWER = 195, + SDL_SCANCODE_KP_PERCENT = 196, + SDL_SCANCODE_KP_LESS = 197, + SDL_SCANCODE_KP_GREATER = 198, + SDL_SCANCODE_KP_AMPERSAND = 199, + SDL_SCANCODE_KP_DBLAMPERSAND = 200, + SDL_SCANCODE_KP_VERTICALBAR = 201, + SDL_SCANCODE_KP_DBLVERTICALBAR = 202, + SDL_SCANCODE_KP_COLON = 203, + SDL_SCANCODE_KP_HASH = 204, + SDL_SCANCODE_KP_SPACE = 205, + SDL_SCANCODE_KP_AT = 206, + SDL_SCANCODE_KP_EXCLAM = 207, + SDL_SCANCODE_KP_MEMSTORE = 208, + SDL_SCANCODE_KP_MEMRECALL = 209, + SDL_SCANCODE_KP_MEMCLEAR = 210, + SDL_SCANCODE_KP_MEMADD = 211, + SDL_SCANCODE_KP_MEMSUBTRACT = 212, + SDL_SCANCODE_KP_MEMMULTIPLY = 213, + SDL_SCANCODE_KP_MEMDIVIDE = 214, + SDL_SCANCODE_KP_PLUSMINUS = 215, + SDL_SCANCODE_KP_CLEAR = 216, + SDL_SCANCODE_KP_CLEARENTRY = 217, + SDL_SCANCODE_KP_BINARY = 218, + SDL_SCANCODE_KP_OCTAL = 219, + SDL_SCANCODE_KP_DECIMAL = 220, + SDL_SCANCODE_KP_HEXADECIMAL = 221, + + SDL_SCANCODE_LCTRL = 224, + SDL_SCANCODE_LSHIFT = 225, + SDL_SCANCODE_LALT = 226, /**< alt, option */ + SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */ + SDL_SCANCODE_RCTRL = 228, + SDL_SCANCODE_RSHIFT = 229, + SDL_SCANCODE_RALT = 230, /**< alt gr, option */ + SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */ + + SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered + * by any of the above, but since there's a + * special KMOD_MODE for it I'm adding it here + */ + + /* @} *//* Usage page 0x07 */ + + /** + * \name Usage page 0x0C + * + * These values are mapped from usage page 0x0C (USB consumer page). + */ + /* @{ */ + + SDL_SCANCODE_AUDIONEXT = 258, + SDL_SCANCODE_AUDIOPREV = 259, + SDL_SCANCODE_AUDIOSTOP = 260, + SDL_SCANCODE_AUDIOPLAY = 261, + SDL_SCANCODE_AUDIOMUTE = 262, + SDL_SCANCODE_MEDIASELECT = 263, + SDL_SCANCODE_WWW = 264, + SDL_SCANCODE_MAIL = 265, + SDL_SCANCODE_CALCULATOR = 266, + SDL_SCANCODE_COMPUTER = 267, + SDL_SCANCODE_AC_SEARCH = 268, + SDL_SCANCODE_AC_HOME = 269, + SDL_SCANCODE_AC_BACK = 270, + SDL_SCANCODE_AC_FORWARD = 271, + SDL_SCANCODE_AC_STOP = 272, + SDL_SCANCODE_AC_REFRESH = 273, + SDL_SCANCODE_AC_BOOKMARKS = 274, + + /* @} *//* Usage page 0x0C */ + + /** + * \name Walther keys + * + * These are values that Christian Walther added (for mac keyboard?). + */ + /* @{ */ + + SDL_SCANCODE_BRIGHTNESSDOWN = 275, + SDL_SCANCODE_BRIGHTNESSUP = 276, + SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display + switch, video mode switch */ + SDL_SCANCODE_KBDILLUMTOGGLE = 278, + SDL_SCANCODE_KBDILLUMDOWN = 279, + SDL_SCANCODE_KBDILLUMUP = 280, + SDL_SCANCODE_EJECT = 281, + SDL_SCANCODE_SLEEP = 282, + + SDL_SCANCODE_APP1 = 283, + SDL_SCANCODE_APP2 = 284, + + /* @} *//* Walther keys */ + + /* Add any other keys here. */ + + SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes + for array bounds */ +} SDL_Scancode; + +#endif /* _SDL_scancode_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_shape.h b/Src/Decoder_H264_ALL/include/SDL/SDL_shape.h new file mode 100644 index 0000000..db10a8f --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_shape.h @@ -0,0 +1,143 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_shape_h +#define _SDL_shape_h + +#include "SDL_stdinc.h" +#include "SDL_pixels.h" +#include "SDL_rect.h" +#include "SDL_surface.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** \file SDL_shape.h + * + * Header file for the shaped window API. + */ + +#define SDL_NONSHAPEABLE_WINDOW -1 +#define SDL_INVALID_SHAPE_ARGUMENT -2 +#define SDL_WINDOW_LACKS_SHAPE -3 + +/** + * \brief Create a window that can be shaped with the specified position, dimensions, and flags. + * + * \param title The title of the window, in UTF-8 encoding. + * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param w The width of the window. + * \param h The height of the window. + * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following: + * ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED, + * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE, + * ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED, + * ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset. + * + * \return The window created, or NULL if window creation failed. + * + * \sa SDL_DestroyWindow() + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); + +/** + * \brief Return whether the given window is a shaped window. + * + * \param window The window to query for being shaped. + * + * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL. + * \sa SDL_CreateShapedWindow + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window); + +/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */ +typedef enum { + /** \brief The default mode, a binarized alpha cutoff of 1. */ + ShapeModeDefault, + /** \brief A binarized alpha cutoff with a given integer value. */ + ShapeModeBinarizeAlpha, + /** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */ + ShapeModeReverseBinarizeAlpha, + /** \brief A color key is applied. */ + ShapeModeColorKey +} WindowShapeMode; + +#define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha) + +/** \brief A union containing parameters for shaped windows. */ +typedef union { + /** \brief a cutoff alpha value for binarization of the window shape's alpha channel. */ + Uint8 binarizationCutoff; + SDL_Color colorKey; +} SDL_WindowShapeParams; + +/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */ +typedef struct SDL_WindowShapeMode { + /** \brief The mode of these window-shape parameters. */ + WindowShapeMode mode; + /** \brief Window-shape parameters. */ + SDL_WindowShapeParams parameters; +} SDL_WindowShapeMode; + +/** + * \brief Set the shape and parameters of a shaped window. + * + * \param window The shaped window whose parameters should be set. + * \param shape A surface encoding the desired shape for the window. + * \param shape_mode The parameters to set for the shaped window. + * + * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on invalid an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW + * if the SDL_Window* given does not reference a valid shaped window. + * + * \sa SDL_WindowShapeMode + * \sa SDL_GetShapedWindowMode. + */ +extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); + +/** + * \brief Get the shape parameters of a shaped window. + * + * \param window The shaped window whose parameters should be retrieved. + * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape. + * + * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode + * data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if + * the SDL_Window* given is a shapeable window currently lacking a shape. + * + * \sa SDL_WindowShapeMode + * \sa SDL_SetWindowShape + */ +extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_shape_h */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_stdinc.h b/Src/Decoder_H264_ALL/include/SDL/SDL_stdinc.h new file mode 100644 index 0000000..887bcd2 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_stdinc.h @@ -0,0 +1,527 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_stdinc.h + * + * This is a general header that includes C language support. + */ + +#ifndef _SDL_stdinc_h +#define _SDL_stdinc_h + +#include "SDL_config.h" + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_STDIO_H +#include +#endif +#if defined(STDC_HEADERS) +# include +# include +# include +#else +# if defined(HAVE_STDLIB_H) +# include +# elif defined(HAVE_MALLOC_H) +# include +# endif +# if defined(HAVE_STDDEF_H) +# include +# endif +# if defined(HAVE_STDARG_H) +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#if defined(HAVE_INTTYPES_H) +# include +#elif defined(HAVE_STDINT_H) +# include +#endif +#ifdef HAVE_CTYPE_H +# include +#endif +#ifdef HAVE_MATH_H +# if defined(__WINRT__) +/* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on + WinRT. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx + for more information. +*/ +# define _USE_MATH_DEFINES +# endif +# include +#endif +#ifdef HAVE_FLOAT_H +# include +#endif +#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) +# include +#endif + +/** + * The number of elements in an array. + */ +#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) +#define SDL_TABLESIZE(table) SDL_arraysize(table) + +/** + * \name Cast operators + * + * Use proper C++ casts when compiled as C++ to be compatible with the option + * -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above). + */ +/* @{ */ +#ifdef __cplusplus +#define SDL_reinterpret_cast(type, expression) reinterpret_cast(expression) +#define SDL_static_cast(type, expression) static_cast(expression) +#define SDL_const_cast(type, expression) const_cast(expression) +#else +#define SDL_reinterpret_cast(type, expression) ((type)(expression)) +#define SDL_static_cast(type, expression) ((type)(expression)) +#define SDL_const_cast(type, expression) ((type)(expression)) +#endif +/* @} *//* Cast operators */ + +/* Define a four character code as a Uint32 */ +#define SDL_FOURCC(A, B, C, D) \ + ((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24)) + +/** + * \name Basic data types + */ +/* @{ */ + +typedef enum +{ + SDL_FALSE = 0, + SDL_TRUE = 1 +} SDL_bool; + +/** + * \brief A signed 8-bit integer type. + */ +typedef int8_t Sint8; +/** + * \brief An unsigned 8-bit integer type. + */ +typedef uint8_t Uint8; +/** + * \brief A signed 16-bit integer type. + */ +typedef int16_t Sint16; +/** + * \brief An unsigned 16-bit integer type. + */ +typedef uint16_t Uint16; +/** + * \brief A signed 32-bit integer type. + */ +typedef int32_t Sint32; +/** + * \brief An unsigned 32-bit integer type. + */ +typedef uint32_t Uint32; + +/** + * \brief A signed 64-bit integer type. + */ +typedef int64_t Sint64; +/** + * \brief An unsigned 64-bit integer type. + */ +typedef uint64_t Uint64; + +/* @} *//* Basic data types */ + +/* Make sure we have macros for printing 64 bit values. + * should define these but this is not true all platforms. + * (for example win32) */ +#ifndef SDL_PRIs64 +#ifdef PRIs64 +#define SDL_PRIs64 PRIs64 +#elif defined(__WIN32__) +#define SDL_PRIs64 "I64d" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIs64 "ld" +#else +#define SDL_PRIs64 "lld" +#endif +#endif +#ifndef SDL_PRIu64 +#ifdef PRIu64 +#define SDL_PRIu64 PRIu64 +#elif defined(__WIN32__) +#define SDL_PRIu64 "I64u" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIu64 "lu" +#else +#define SDL_PRIu64 "llu" +#endif +#endif +#ifndef SDL_PRIx64 +#ifdef PRIx64 +#define SDL_PRIx64 PRIx64 +#elif defined(__WIN32__) +#define SDL_PRIx64 "I64x" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIx64 "lx" +#else +#define SDL_PRIx64 "llx" +#endif +#endif +#ifndef SDL_PRIX64 +#ifdef PRIX64 +#define SDL_PRIX64 PRIX64 +#elif defined(__WIN32__) +#define SDL_PRIX64 "I64X" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIX64 "lX" +#else +#define SDL_PRIX64 "llX" +#endif +#endif + +/* Annotations to help code analysis tools */ +#ifdef SDL_DISABLE_ANALYZE_MACROS +#define SDL_IN_BYTECAP(x) +#define SDL_INOUT_Z_CAP(x) +#define SDL_OUT_Z_CAP(x) +#define SDL_OUT_CAP(x) +#define SDL_OUT_BYTECAP(x) +#define SDL_OUT_Z_BYTECAP(x) +#define SDL_PRINTF_FORMAT_STRING +#define SDL_SCANF_FORMAT_STRING +#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) +#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) +#else +#if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */ +#include + +#define SDL_IN_BYTECAP(x) _In_bytecount_(x) +#define SDL_INOUT_Z_CAP(x) _Inout_z_cap_(x) +#define SDL_OUT_Z_CAP(x) _Out_z_cap_(x) +#define SDL_OUT_CAP(x) _Out_cap_(x) +#define SDL_OUT_BYTECAP(x) _Out_bytecap_(x) +#define SDL_OUT_Z_BYTECAP(x) _Out_z_bytecap_(x) + +#define SDL_PRINTF_FORMAT_STRING _Printf_format_string_ +#define SDL_SCANF_FORMAT_STRING _Scanf_format_string_impl_ +#else +#define SDL_IN_BYTECAP(x) +#define SDL_INOUT_Z_CAP(x) +#define SDL_OUT_Z_CAP(x) +#define SDL_OUT_CAP(x) +#define SDL_OUT_BYTECAP(x) +#define SDL_OUT_Z_BYTECAP(x) +#define SDL_PRINTF_FORMAT_STRING +#define SDL_SCANF_FORMAT_STRING +#endif +#if defined(__GNUC__) +#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 ))) +#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 ))) +#else +#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) +#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) +#endif +#endif /* SDL_DISABLE_ANALYZE_MACROS */ + +#define SDL_COMPILE_TIME_ASSERT(name, x) \ + typedef int SDL_dummy_ ## name[(x) * 2 - 1] +/** \cond */ +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); +SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); +SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); +SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); +SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); +SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); +SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); +SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ +/** \endcond */ + +/* Check to make sure enums are the size of ints, for structure packing. + For both Watcom C/C++ and Borland C/C++ the compiler option that makes + enums having the size of an int must be enabled. + This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). +*/ + +/** \cond */ +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +#if !defined(__ANDROID__) + /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */ +typedef enum +{ + DUMMY_ENUM_VALUE +} SDL_DUMMY_ENUM; + +SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); +#endif +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ +/** \endcond */ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(HAVE_ALLOCA) && !defined(alloca) +# if defined(HAVE_ALLOCA_H) +# include +# elif defined(__GNUC__) +# define alloca __builtin_alloca +# elif defined(_MSC_VER) +# include +# define alloca _alloca +# elif defined(__WATCOMC__) +# include +# elif defined(__BORLANDC__) +# include +# elif defined(__DMC__) +# include +# elif defined(__AIX__) +#pragma alloca +# elif defined(__MRC__) +void *alloca(unsigned); +# else +char *alloca(); +# endif +#endif +#ifdef HAVE_ALLOCA +#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) +#define SDL_stack_free(data) +#else +#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) +#define SDL_stack_free(data) SDL_free(data) +#endif + +extern DECLSPEC void *SDLCALL SDL_malloc(size_t size); +extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size); +extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size); +extern DECLSPEC void SDLCALL SDL_free(void *mem); + +extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); +extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite); + +extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)); + +extern DECLSPEC int SDLCALL SDL_abs(int x); + +/* !!! FIXME: these have side effects. You probably shouldn't use them. */ +/* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */ +#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) +#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) + +extern DECLSPEC int SDLCALL SDL_isdigit(int x); +extern DECLSPEC int SDLCALL SDL_isspace(int x); +extern DECLSPEC int SDLCALL SDL_toupper(int x); +extern DECLSPEC int SDLCALL SDL_tolower(int x); + +extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len); + +#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) +#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x))) + +/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */ +SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords) +{ +#if defined(__GNUC__) && defined(i386) + int u0, u1, u2; + __asm__ __volatile__ ( + "cld \n\t" + "rep ; stosl \n\t" + : "=&D" (u0), "=&a" (u1), "=&c" (u2) + : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords)) + : "memory" + ); +#else + size_t _n = (dwords + 3) / 4; + Uint32 *_p = SDL_static_cast(Uint32 *, dst); + Uint32 _val = (val); + if (dwords == 0) + return; + switch (dwords % 4) + { + case 0: do { *_p++ = _val; + case 3: *_p++ = _val; + case 2: *_p++ = _val; + case 1: *_p++ = _val; + } while ( --_n ); + } +#endif +} + + +extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); + +extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); +extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); + +extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr); +extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); +extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); + +extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); +extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); +extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes); +extern DECLSPEC size_t SDLCALL SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); +extern DECLSPEC char *SDLCALL SDL_strdup(const char *str); +extern DECLSPEC char *SDLCALL SDL_strrev(char *str); +extern DECLSPEC char *SDLCALL SDL_strupr(char *str); +extern DECLSPEC char *SDLCALL SDL_strlwr(char *str); +extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c); +extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c); +extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle); + +extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix); + +extern DECLSPEC int SDLCALL SDL_atoi(const char *str); +extern DECLSPEC double SDLCALL SDL_atof(const char *str); +extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base); +extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base); +extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base); +extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base); +extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp); + +extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); +extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); +extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); +extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len); + +extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2); +extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap); +extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3); +extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap); + +#ifndef HAVE_M_PI +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327950288 /* pi */ +#endif +#endif + +extern DECLSPEC double SDLCALL SDL_acos(double x); +extern DECLSPEC double SDLCALL SDL_asin(double x); +extern DECLSPEC double SDLCALL SDL_atan(double x); +extern DECLSPEC double SDLCALL SDL_atan2(double x, double y); +extern DECLSPEC double SDLCALL SDL_ceil(double x); +extern DECLSPEC double SDLCALL SDL_copysign(double x, double y); +extern DECLSPEC double SDLCALL SDL_cos(double x); +extern DECLSPEC float SDLCALL SDL_cosf(float x); +extern DECLSPEC double SDLCALL SDL_fabs(double x); +extern DECLSPEC double SDLCALL SDL_floor(double x); +extern DECLSPEC double SDLCALL SDL_log(double x); +extern DECLSPEC double SDLCALL SDL_pow(double x, double y); +extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n); +extern DECLSPEC double SDLCALL SDL_sin(double x); +extern DECLSPEC float SDLCALL SDL_sinf(float x); +extern DECLSPEC double SDLCALL SDL_sqrt(double x); +extern DECLSPEC float SDLCALL SDL_sqrtf(float x); +extern DECLSPEC double SDLCALL SDL_tan(double x); +extern DECLSPEC float SDLCALL SDL_tanf(float x); + +/* The SDL implementation of iconv() returns these error codes */ +#define SDL_ICONV_ERROR (size_t)-1 +#define SDL_ICONV_E2BIG (size_t)-2 +#define SDL_ICONV_EILSEQ (size_t)-3 +#define SDL_ICONV_EINVAL (size_t)-4 + +/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */ +typedef struct _SDL_iconv_t *SDL_iconv_t; +extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, + const char *fromcode); +extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); +extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, + size_t * inbytesleft, char **outbuf, + size_t * outbytesleft); +/** + * This function converts a string between encodings in one pass, returning a + * string that must be freed with SDL_free() or NULL on error. + */ +extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, + const char *fromcode, + const char *inbuf, + size_t inbytesleft); +#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) + +/* force builds using Clang's static analysis tools to use literal C runtime + here, since there are possibly tests that are ineffective otherwise. */ +#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) +#define SDL_malloc malloc +#define SDL_calloc calloc +#define SDL_realloc realloc +#define SDL_free free +#define SDL_memset memset +#define SDL_memcpy memcpy +#define SDL_memmove memmove +#define SDL_memcmp memcmp +#define SDL_strlen strlen +#define SDL_strlcpy strlcpy +#define SDL_strlcat strlcat +#define SDL_strdup strdup +#define SDL_strchr strchr +#define SDL_strrchr strrchr +#define SDL_strstr strstr +#define SDL_strcmp strcmp +#define SDL_strncmp strncmp +#define SDL_strcasecmp strcasecmp +#define SDL_strncasecmp strncasecmp +#define SDL_sscanf sscanf +#define SDL_vsscanf vsscanf +#define SDL_snprintf snprintf +#define SDL_vsnprintf vsnprintf +#endif + +SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_BYTECAP(dwords*4) const void *src, size_t dwords) +{ + return SDL_memcpy(dst, src, dwords * 4); +} + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_stdinc_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_surface.h b/Src/Decoder_H264_ALL/include/SDL/SDL_surface.h new file mode 100644 index 0000000..e63ca89 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_surface.h @@ -0,0 +1,503 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_surface.h + * + * Header file for ::SDL_Surface definition and management functions. + */ + +#ifndef _SDL_surface_h +#define _SDL_surface_h + +#include "SDL_stdinc.h" +#include "SDL_pixels.h" +#include "SDL_rect.h" +#include "SDL_blendmode.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name Surface flags + * + * These are the currently supported flags for the ::SDL_Surface. + * + * \internal + * Used internally (read-only). + */ +/* @{ */ +#define SDL_SWSURFACE 0 /**< Just here for compatibility */ +#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */ +#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */ +#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */ +/* @} *//* Surface flags */ + +/** + * Evaluates to true if the surface needs to be locked before access. + */ +#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) + +/** + * \brief A collection of pixels used in software blitting. + * + * \note This structure should be treated as read-only, except for \c pixels, + * which, if not NULL, contains the raw pixel data for the surface. + */ +typedef struct SDL_Surface +{ + Uint32 flags; /**< Read-only */ + SDL_PixelFormat *format; /**< Read-only */ + int w, h; /**< Read-only */ + int pitch; /**< Read-only */ + void *pixels; /**< Read-write */ + + /** Application data associated with the surface */ + void *userdata; /**< Read-write */ + + /** information needed for surfaces requiring locks */ + int locked; /**< Read-only */ + void *lock_data; /**< Read-only */ + + /** clipping information */ + SDL_Rect clip_rect; /**< Read-only */ + + /** info for fast blit mapping to other surfaces */ + struct SDL_BlitMap *map; /**< Private */ + + /** Reference count -- used when freeing surface */ + int refcount; /**< Read-mostly */ +} SDL_Surface; + +/** + * \brief The type of function used for surface blitting functions. + */ +typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, + struct SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * Allocate and free an RGB surface. + * + * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. + * If the depth is greater than 8 bits, the pixel format is set using the + * flags '[RGB]mask'. + * + * If the function runs out of memory, it will return NULL. + * + * \param flags The \c flags are obsolete and should be set to 0. + * \param width The width in pixels of the surface to create. + * \param height The height in pixels of the surface to create. + * \param depth The depth in bits of the surface to create. + * \param Rmask The red mask of the surface to create. + * \param Gmask The green mask of the surface to create. + * \param Bmask The blue mask of the surface to create. + * \param Amask The alpha mask of the surface to create. + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface + (Uint32 flags, int width, int height, int depth, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); +extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, + int width, + int height, + int depth, + int pitch, + Uint32 Rmask, + Uint32 Gmask, + Uint32 Bmask, + Uint32 Amask); +extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface); + +/** + * \brief Set the palette used by a surface. + * + * \return 0, or -1 if the surface format doesn't use a palette. + * + * \note A single palette can be shared with many surfaces. + */ +extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface, + SDL_Palette * palette); + +/** + * \brief Sets up a surface for directly accessing the pixels. + * + * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write + * to and read from \c surface->pixels, using the pixel format stored in + * \c surface->format. Once you are done accessing the surface, you should + * use SDL_UnlockSurface() to release it. + * + * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates + * to 0, then you can read and write to the surface at any time, and the + * pixel format of the surface will not change. + * + * No operating system or library calls should be made between lock/unlock + * pairs, as critical system locks may be held during this time. + * + * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. + * + * \sa SDL_UnlockSurface() + */ +extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface); +/** \sa SDL_LockSurface() */ +extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface); + +/** + * Load a surface from a seekable SDL data stream (memory or file). + * + * If \c freesrc is non-zero, the stream will be closed after being read. + * + * The new surface should be freed with SDL_FreeSurface(). + * + * \return the new surface, or NULL if there was an error. + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src, + int freesrc); + +/** + * Load a surface from a file. + * + * Convenience macro. + */ +#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) + +/** + * Save a surface to a seekable SDL data stream (memory or file). + * + * If \c freedst is non-zero, the stream will be closed after being written. + * + * \return 0 if successful or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SaveBMP_RW + (SDL_Surface * surface, SDL_RWops * dst, int freedst); + +/** + * Save a surface to a file. + * + * Convenience macro. + */ +#define SDL_SaveBMP(surface, file) \ + SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) + +/** + * \brief Sets the RLE acceleration hint for a surface. + * + * \return 0 on success, or -1 if the surface is not valid + * + * \note If RLE is enabled, colorkey and alpha blending blits are much faster, + * but the surface must be locked before directly accessing the pixels. + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, + int flag); + +/** + * \brief Sets the color key (transparent pixel) in a blittable surface. + * + * \param surface The surface to update + * \param flag Non-zero to enable colorkey and 0 to disable colorkey + * \param key The transparent pixel in the native surface format + * + * \return 0 on success, or -1 if the surface is not valid + * + * You can pass SDL_RLEACCEL to enable RLE accelerated blits. + */ +extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, + int flag, Uint32 key); + +/** + * \brief Gets the color key (transparent pixel) in a blittable surface. + * + * \param surface The surface to update + * \param key A pointer filled in with the transparent pixel in the native + * surface format + * + * \return 0 on success, or -1 if the surface is not valid or colorkey is not + * enabled. + */ +extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface, + Uint32 * key); + +/** + * \brief Set an additional color value used in blit operations. + * + * \param surface The surface to update. + * \param r The red color value multiplied into blit operations. + * \param g The green color value multiplied into blit operations. + * \param b The blue color value multiplied into blit operations. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_GetSurfaceColorMod() + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface, + Uint8 r, Uint8 g, Uint8 b); + + +/** + * \brief Get the additional color value used in blit operations. + * + * \param surface The surface to query. + * \param r A pointer filled in with the current red color value. + * \param g A pointer filled in with the current green color value. + * \param b A pointer filled in with the current blue color value. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceColorMod() + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface, + Uint8 * r, Uint8 * g, + Uint8 * b); + +/** + * \brief Set an additional alpha value used in blit operations. + * + * \param surface The surface to update. + * \param alpha The alpha value multiplied into blit operations. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_GetSurfaceAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface, + Uint8 alpha); + +/** + * \brief Get the additional alpha value used in blit operations. + * + * \param surface The surface to query. + * \param alpha A pointer filled in with the current alpha value. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface, + Uint8 * alpha); + +/** + * \brief Set the blend mode used for blit operations. + * + * \param surface The surface to update. + * \param blendMode ::SDL_BlendMode to use for blit blending. + * + * \return 0 on success, or -1 if the parameters are not valid. + * + * \sa SDL_GetSurfaceBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface, + SDL_BlendMode blendMode); + +/** + * \brief Get the blend mode used for blit operations. + * + * \param surface The surface to query. + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface, + SDL_BlendMode *blendMode); + +/** + * Sets the clipping rectangle for the destination surface in a blit. + * + * If the clip rectangle is NULL, clipping will be disabled. + * + * If the clip rectangle doesn't intersect the surface, the function will + * return SDL_FALSE and blits will be completely clipped. Otherwise the + * function returns SDL_TRUE and blits to the surface will be clipped to + * the intersection of the surface area and the clipping rectangle. + * + * Note that blits are automatically clipped to the edges of the source + * and destination surfaces. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface, + const SDL_Rect * rect); + +/** + * Gets the clipping rectangle for the destination surface in a blit. + * + * \c rect must be a pointer to a valid rectangle which will be filled + * with the correct values. + */ +extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface, + SDL_Rect * rect); + +/** + * Creates a new surface of the specified format, and then copies and maps + * the given surface to it so the blit of the converted surface will be as + * fast as possible. If this function fails, it returns NULL. + * + * The \c flags parameter is passed to SDL_CreateRGBSurface() and has those + * semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and + * SDL will try to RLE accelerate colorkey and alpha blits in the resulting + * surface. + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface + (SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags); +extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat + (SDL_Surface * src, Uint32 pixel_format, Uint32 flags); + +/** + * \brief Copy a block of pixels of one format to another format + * + * \return 0 on success, or -1 if there was an error + */ +extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, + Uint32 src_format, + const void * src, int src_pitch, + Uint32 dst_format, + void * dst, int dst_pitch); + +/** + * Performs a fast fill of the given rectangle with \c color. + * + * If \c rect is NULL, the whole surface will be filled with \c color. + * + * The color should be a pixel of the format used by the surface, and + * can be generated by the SDL_MapRGB() function. + * + * \return 0 on success, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_FillRect + (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color); +extern DECLSPEC int SDLCALL SDL_FillRects + (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color); + +/** + * Performs a fast blit from the source surface to the destination surface. + * + * This assumes that the source and destination rectangles are + * the same size. If either \c srcrect or \c dstrect are NULL, the entire + * surface (\c src or \c dst) is copied. The final blit rectangles are saved + * in \c srcrect and \c dstrect after all clipping is performed. + * + * \return If the blit is successful, it returns 0, otherwise it returns -1. + * + * The blit function should not be called on a locked surface. + * + * The blit semantics for surfaces with and without blending and colorkey + * are defined as follows: + * \verbatim + RGBA->RGB: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source alpha-channel and per-surface alpha) + SDL_SRCCOLORKEY ignored. + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source color key, ignoring alpha in the + comparison. + + RGB->RGBA: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source per-surface alpha) + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB, set destination alpha to source per-surface alpha value. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source color key. + + RGBA->RGBA: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source alpha-channel and per-surface alpha) + SDL_SRCCOLORKEY ignored. + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy all of RGBA to the destination. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source color key, ignoring alpha in the + comparison. + + RGB->RGB: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source per-surface alpha) + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source color key. + \endverbatim + * + * You should call SDL_BlitSurface() unless you know exactly how SDL + * blitting works internally and how to use the other blit functions. + */ +#define SDL_BlitSurface SDL_UpperBlit + +/** + * This is the public blit function, SDL_BlitSurface(), and it performs + * rectangle validation and clipping before passing it to SDL_LowerBlit() + */ +extern DECLSPEC int SDLCALL SDL_UpperBlit + (SDL_Surface * src, const SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * This is a semi-private blit function and it performs low-level surface + * blitting only. + */ +extern DECLSPEC int SDLCALL SDL_LowerBlit + (SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * \brief Perform a fast, low quality, stretch blit between two surfaces of the + * same pixel format. + * + * \note This function uses a static buffer, and is not thread-safe. + */ +extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, + const SDL_Rect * srcrect, + SDL_Surface * dst, + const SDL_Rect * dstrect); + +#define SDL_BlitScaled SDL_UpperBlitScaled + +/** + * This is the public scaled blit function, SDL_BlitScaled(), and it performs + * rectangle validation and clipping before passing it to SDL_LowerBlitScaled() + */ +extern DECLSPEC int SDLCALL SDL_UpperBlitScaled + (SDL_Surface * src, const SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * This is a semi-private blit function and it performs low-level surface + * scaled blitting only. + */ +extern DECLSPEC int SDLCALL SDL_LowerBlitScaled + (SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_surface_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_system.h b/Src/Decoder_H264_ALL/include/SDL/SDL_system.h new file mode 100644 index 0000000..5da9adb --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_system.h @@ -0,0 +1,216 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_system.h + * + * Include file for platform specific SDL API functions + */ + +#ifndef _SDL_system_h +#define _SDL_system_h + +#include "SDL_stdinc.h" +#include "SDL_keyboard.h" +#include "SDL_render.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* Platform specific functions for Windows */ +#ifdef __WIN32__ + +/** + \brief Set a function that is called for every windows message, before TranslateMessage() +*/ +typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam); +extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata); + +/** + \brief Returns the D3D9 adapter index that matches the specified display index. + + This adapter index can be passed to IDirect3D9::CreateDevice and controls + on which monitor a full screen application will appear. +*/ +extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex ); + +typedef struct IDirect3DDevice9 IDirect3DDevice9; +/** + \brief Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer. + + Once you are done using the device, you should release it to avoid a resource leak. + */ +extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer); + +/** + \brief Returns the DXGI Adapter and Output indices for the specified display index. + + These can be passed to EnumAdapters and EnumOutputs respectively to get the objects + required to create a DX10 or DX11 device and swap chain. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex ); + +#endif /* __WIN32__ */ + + +/* Platform specific functions for iOS */ +#if defined(__IPHONEOS__) && __IPHONEOS__ + +#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam) +extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); + +#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled) +extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); + +#endif /* __IPHONEOS__ */ + + +/* Platform specific functions for Android */ +#if defined(__ANDROID__) && __ANDROID__ + +/** + \brief Get the JNI environment for the current thread + + This returns JNIEnv*, but the prototype is void* so we don't need jni.h + */ +extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(); + +/** + \brief Get the SDL Activity object for the application + + This returns jobject, but the prototype is void* so we don't need jni.h + The jobject returned by SDL_AndroidGetActivity is a local reference. + It is the caller's responsibility to properly release it + (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef) + */ +extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(); + +/** + See the official Android developer guide for more information: + http://developer.android.com/guide/topics/data/data-storage.html +*/ +#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01 +#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02 + +/** + \brief Get the path used for internal storage for this application. + + This path is unique to your application and cannot be written to + by other applications. + */ +extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(); + +/** + \brief Get the current state of external storage, a bitmask of these values: + SDL_ANDROID_EXTERNAL_STORAGE_READ + SDL_ANDROID_EXTERNAL_STORAGE_WRITE + + If external storage is currently unavailable, this will return 0. +*/ +extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(); + +/** + \brief Get the path used for external storage for this application. + + This path is unique to your application, but is public and can be + written to by other applications. + */ +extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(); + +#endif /* __ANDROID__ */ + +/* Platform specific functions for WinRT */ +#if defined(__WINRT__) && __WINRT__ + +/** + * \brief WinRT / Windows Phone path types + */ +typedef enum +{ + /** \brief The installed app's root directory. + Files here are likely to be read-only. */ + SDL_WINRT_PATH_INSTALLED_LOCATION, + + /** \brief The app's local data store. Files may be written here */ + SDL_WINRT_PATH_LOCAL_FOLDER, + + /** \brief The app's roaming data store. Unsupported on Windows Phone. + Files written here may be copied to other machines via a network + connection. + */ + SDL_WINRT_PATH_ROAMING_FOLDER, + + /** \brief The app's temporary data store. Unsupported on Windows Phone. + Files written here may be deleted at any time. */ + SDL_WINRT_PATH_TEMP_FOLDER +} SDL_WinRT_Path; + + +/** + * \brief Retrieves a WinRT defined path on the local file system + * + * \note Documentation on most app-specific path types on WinRT + * can be found on MSDN, at the URL: + * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx + * + * \param pathType The type of path to retrieve. + * \return A UCS-2 string (16-bit, wide-char) containing the path, or NULL + * if the path is not available for any reason. Not all paths are + * available on all versions of Windows. This is especially true on + * Windows Phone. Check the documentation for the given + * SDL_WinRT_Path for more information on which path types are + * supported where. + */ +extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType); + +/** + * \brief Retrieves a WinRT defined path on the local file system + * + * \note Documentation on most app-specific path types on WinRT + * can be found on MSDN, at the URL: + * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx + * + * \param pathType The type of path to retrieve. + * \return A UTF-8 string (8-bit, multi-byte) containing the path, or NULL + * if the path is not available for any reason. Not all paths are + * available on all versions of Windows. This is especially true on + * Windows Phone. Check the documentation for the given + * SDL_WinRT_Path for more information on which path types are + * supported where. + */ +extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType); + +#endif /* __WINRT__ */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_system_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_syswm.h b/Src/Decoder_H264_ALL/include/SDL/SDL_syswm.h new file mode 100644 index 0000000..1056e52 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_syswm.h @@ -0,0 +1,301 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_syswm.h + * + * Include file for SDL custom system window manager hooks. + */ + +#ifndef _SDL_syswm_h +#define _SDL_syswm_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" +#include "SDL_version.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_syswm.h + * + * Your application has access to a special type of event ::SDL_SYSWMEVENT, + * which contains window-manager specific information and arrives whenever + * an unhandled window event occurs. This event is ignored by default, but + * you can enable it with SDL_EventState(). + */ +#ifdef SDL_PROTOTYPES_ONLY +struct SDL_SysWMinfo; +#else + +#if defined(SDL_VIDEO_DRIVER_WINDOWS) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#endif + +#if defined(SDL_VIDEO_DRIVER_WINRT) +#include +#endif + +/* This is the structure for custom window manager events */ +#if defined(SDL_VIDEO_DRIVER_X11) +#if defined(__APPLE__) && defined(__MACH__) +/* conflicts with Quickdraw.h */ +#define Cursor X11Cursor +#endif + +#include +#include + +#if defined(__APPLE__) && defined(__MACH__) +/* matches the re-define above */ +#undef Cursor +#endif + +#endif /* defined(SDL_VIDEO_DRIVER_X11) */ + +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) +#include +#endif + +#if defined(SDL_VIDEO_DRIVER_COCOA) +#ifdef __OBJC__ +@class NSWindow; +#else +typedef struct _NSWindow NSWindow; +#endif +#endif + +#if defined(SDL_VIDEO_DRIVER_UIKIT) +#ifdef __OBJC__ +#include +#else +typedef struct _UIWindow UIWindow; +typedef struct _UIViewController UIViewController; +#endif +typedef Uint32 GLuint; +#endif + +#if defined(SDL_VIDEO_DRIVER_ANDROID) +typedef struct ANativeWindow ANativeWindow; +typedef void *EGLSurface; +#endif + +/** + * These are the various supported windowing subsystems + */ +typedef enum +{ + SDL_SYSWM_UNKNOWN, + SDL_SYSWM_WINDOWS, + SDL_SYSWM_X11, + SDL_SYSWM_DIRECTFB, + SDL_SYSWM_COCOA, + SDL_SYSWM_UIKIT, + SDL_SYSWM_WAYLAND, + SDL_SYSWM_MIR, + SDL_SYSWM_WINRT, + SDL_SYSWM_ANDROID +} SDL_SYSWM_TYPE; + +/** + * The custom event structure. + */ +struct SDL_SysWMmsg +{ + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union + { +#if defined(SDL_VIDEO_DRIVER_WINDOWS) + struct { + HWND hwnd; /**< The window for the message */ + UINT msg; /**< The type of message */ + WPARAM wParam; /**< WORD message parameter */ + LPARAM lParam; /**< LONG message parameter */ + } win; +#endif +#if defined(SDL_VIDEO_DRIVER_X11) + struct { + XEvent event; + } x11; +#endif +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) + struct { + DFBEvent event; + } dfb; +#endif +#if defined(SDL_VIDEO_DRIVER_COCOA) + struct + { + /* Latest version of Xcode clang complains about empty structs in C v. C++: + error: empty struct has size 0 in C, size 1 in C++ + */ + int dummy; + /* No Cocoa window events yet */ + } cocoa; +#endif +#if defined(SDL_VIDEO_DRIVER_UIKIT) + struct + { + int dummy; + /* No UIKit window events yet */ + } uikit; +#endif + /* Can't have an empty union */ + int dummy; + } msg; +}; + +/** + * The custom window manager information structure. + * + * When this structure is returned, it holds information about which + * low level system it is using, and will be one of SDL_SYSWM_TYPE. + */ +struct SDL_SysWMinfo +{ + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union + { +#if defined(SDL_VIDEO_DRIVER_WINDOWS) + struct + { + HWND window; /**< The window handle */ + HDC hdc; /**< The window device context */ + } win; +#endif +#if defined(SDL_VIDEO_DRIVER_WINRT) + struct + { + IInspectable * window; /**< The WinRT CoreWindow */ + } winrt; +#endif +#if defined(SDL_VIDEO_DRIVER_X11) + struct + { + Display *display; /**< The X11 display */ + Window window; /**< The X11 window */ + } x11; +#endif +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) + struct + { + IDirectFB *dfb; /**< The directfb main interface */ + IDirectFBWindow *window; /**< The directfb window handle */ + IDirectFBSurface *surface; /**< The directfb client surface */ + } dfb; +#endif +#if defined(SDL_VIDEO_DRIVER_COCOA) + struct + { +#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc) + NSWindow __unsafe_unretained *window; /* The Cocoa window */ +#else + NSWindow *window; /* The Cocoa window */ +#endif + } cocoa; +#endif +#if defined(SDL_VIDEO_DRIVER_UIKIT) + struct + { +#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc) + UIWindow __unsafe_unretained *window; /* The UIKit window */ +#else + UIWindow *window; /* The UIKit window */ +#endif + GLuint framebuffer; /* The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */ + GLuint colorbuffer; /* The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */ + GLuint resolveFramebuffer; /* The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */ + } uikit; +#endif +#if defined(SDL_VIDEO_DRIVER_WAYLAND) + struct + { + struct wl_display *display; /**< Wayland display */ + struct wl_surface *surface; /**< Wayland surface */ + struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */ + } wl; +#endif +#if defined(SDL_VIDEO_DRIVER_MIR) + struct + { + struct MirConnection *connection; /**< Mir display server connection */ + struct MirSurface *surface; /**< Mir surface */ + } mir; +#endif + +#if defined(SDL_VIDEO_DRIVER_ANDROID) + struct + { + ANativeWindow *window; + EGLSurface surface; + } android; +#endif + + /* Can't have an empty union */ + int dummy; + } info; +}; + +#endif /* SDL_PROTOTYPES_ONLY */ + +typedef struct SDL_SysWMinfo SDL_SysWMinfo; + +/* Function prototypes */ +/** + * \brief This function allows access to driver-dependent window information. + * + * \param window The window about which information is being requested + * \param info This structure must be initialized with the SDL version, and is + * then filled in with information about the given window. + * + * \return SDL_TRUE if the function is implemented and the version member of + * the \c info struct is valid, SDL_FALSE otherwise. + * + * You typically use this function like this: + * \code + * SDL_SysWMinfo info; + * SDL_VERSION(&info.version); + * if ( SDL_GetWindowWMInfo(window, &info) ) { ... } + * \endcode + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window, + SDL_SysWMinfo * info); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_syswm_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_test.h b/Src/Decoder_H264_ALL/include/SDL/SDL_test.h new file mode 100644 index 0000000..217847b --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_test.h @@ -0,0 +1,68 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +#ifndef _SDL_test_h +#define _SDL_test_h + +#include "SDL.h" +#include "SDL_test_common.h" +#include "SDL_test_font.h" +#include "SDL_test_random.h" +#include "SDL_test_fuzzer.h" +#include "SDL_test_crc32.h" +#include "SDL_test_md5.h" +#include "SDL_test_log.h" +#include "SDL_test_assert.h" +#include "SDL_test_harness.h" +#include "SDL_test_images.h" +#include "SDL_test_compare.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Global definitions */ + +/* + * Note: Maximum size of SDLTest log message is less than SDL's limit + * to ensure we can fit additional information such as the timestamp. + */ +#define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_test_assert.h b/Src/Decoder_H264_ALL/include/SDL/SDL_test_assert.h new file mode 100644 index 0000000..29277e1 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_test_assert.h @@ -0,0 +1,105 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_assert.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + * + * Assert API for test code and test cases + * + */ + +#ifndef _SDL_test_assert_h +#define _SDL_test_assert_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Fails the assert. + */ +#define ASSERT_FAIL 0 + +/** + * \brief Passes the assert. + */ +#define ASSERT_PASS 1 + +/** + * \brief Assert that logs and break execution flow on failures. + * + * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). + * \param assertDescription Message to log with the assert describing it. + */ +void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters. + * + * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). + * \param assertDescription Message to log with the assert describing it. + * + * \returns Returns the assertCondition so it can be used to externally to break execution flow if desired. + */ +int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * \brief Explicitly pass without checking an assertion condition. Updates assertion counter. + * + * \param assertDescription Message to log with the assert describing it. + */ +void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1); + +/** + * \brief Resets the assert summary counters to zero. + */ +void SDLTest_ResetAssertSummary(); + +/** + * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR. + */ +void SDLTest_LogAssertSummary(); + + +/** + * \brief Converts the current assert summary state to a test result. + * + * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT + */ +int SDLTest_AssertSummaryToTestResult(); + +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_assert_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_test_common.h b/Src/Decoder_H264_ALL/include/SDL/SDL_test_common.h new file mode 100644 index 0000000..0ebf31c --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_test_common.h @@ -0,0 +1,188 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_common.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* Ported from original test\common.h file. */ + +#ifndef _SDL_test_common_h +#define _SDL_test_common_h + +#include "SDL.h" + +#if defined(__PSP__) +#define DEFAULT_WINDOW_WIDTH 480 +#define DEFAULT_WINDOW_HEIGHT 272 +#else +#define DEFAULT_WINDOW_WIDTH 640 +#define DEFAULT_WINDOW_HEIGHT 480 +#endif + +#define VERBOSE_VIDEO 0x00000001 +#define VERBOSE_MODES 0x00000002 +#define VERBOSE_RENDER 0x00000004 +#define VERBOSE_EVENT 0x00000008 +#define VERBOSE_AUDIO 0x00000010 + +typedef struct +{ + /* SDL init flags */ + char **argv; + Uint32 flags; + Uint32 verbose; + + /* Video info */ + const char *videodriver; + int display; + const char *window_title; + const char *window_icon; + Uint32 window_flags; + int window_x; + int window_y; + int window_w; + int window_h; + int window_minW; + int window_minH; + int window_maxW; + int window_maxH; + int logical_w; + int logical_h; + float scale; + int depth; + int refresh_rate; + int num_windows; + SDL_Window **windows; + + /* Renderer info */ + const char *renderdriver; + Uint32 render_flags; + SDL_bool skip_renderer; + SDL_Renderer **renderers; + SDL_Texture **targets; + + /* Audio info */ + const char *audiodriver; + SDL_AudioSpec audiospec; + + /* GL settings */ + int gl_red_size; + int gl_green_size; + int gl_blue_size; + int gl_alpha_size; + int gl_buffer_size; + int gl_depth_size; + int gl_stencil_size; + int gl_double_buffer; + int gl_accum_red_size; + int gl_accum_green_size; + int gl_accum_blue_size; + int gl_accum_alpha_size; + int gl_stereo; + int gl_multisamplebuffers; + int gl_multisamplesamples; + int gl_retained_backing; + int gl_accelerated; + int gl_major_version; + int gl_minor_version; + int gl_debug; + int gl_profile_mask; +} SDLTest_CommonState; + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Function prototypes */ + +/** + * \brief Parse command line parameters and create common state. + * + * \param argv Array of command line parameters + * \param flags Flags indicating which subsystem to initialize (i.e. SDL_INIT_VIDEO | SDL_INIT_AUDIO) + * + * \returns Returns a newly allocated common state object. + */ +SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags); + +/** + * \brief Process one common argument. + * + * \param state The common state describing the test window to create. + * \param index The index of the argument to process in argv[]. + * + * \returns The number of arguments processed (i.e. 1 for --fullscreen, 2 for --video [videodriver], or -1 on error. + */ +int SDLTest_CommonArg(SDLTest_CommonState * state, int index); + +/** + * \brief Returns common usage information + * + * \param state The common state describing the test window to create. + * + * \returns String with usage information + */ +const char *SDLTest_CommonUsage(SDLTest_CommonState * state); + +/** + * \brief Open test window. + * + * \param state The common state describing the test window to create. + * + * \returns True if initialization succeeded, false otherwise + */ +SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state); + +/** + * \brief Common event handler for test windows. + * + * \param state The common state used to create test window. + * \param event The event to handle. + * \param done Flag indicating we are done. + * + */ +void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done); + +/** + * \brief Close test window. + * + * \param state The common state used to create test window. + * + */ +void SDLTest_CommonQuit(SDLTest_CommonState * state); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_common_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_test_compare.h b/Src/Decoder_H264_ALL/include/SDL/SDL_test_compare.h new file mode 100644 index 0000000..772cf9f --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_test_compare.h @@ -0,0 +1,69 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_compare.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Defines comparison functions (i.e. for surfaces). + +*/ + +#ifndef _SDL_test_compare_h +#define _SDL_test_compare_h + +#include "SDL.h" + +#include "SDL_test_images.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Compares a surface and with reference image data for equality + * + * \param surface Surface used in comparison + * \param referenceSurface Test Surface used in comparison + * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy. + * + * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. + */ +int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_compare_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_test_crc32.h b/Src/Decoder_H264_ALL/include/SDL/SDL_test_crc32.h new file mode 100644 index 0000000..572a3d9 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_test_crc32.h @@ -0,0 +1,124 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_crc32.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Implements CRC32 calculations (default output is Perl String::CRC32 compatible). + +*/ + +#ifndef _SDL_test_crc32_h +#define _SDL_test_crc32_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* ------------ Definitions --------- */ + +/* Definition shared by all CRC routines */ + +#ifndef CrcUint32 + #define CrcUint32 unsigned int +#endif +#ifndef CrcUint8 + #define CrcUint8 unsigned char +#endif + +#ifdef ORIGINAL_METHOD + #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */ +#else + #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */ +#endif + +/** + * Data structure for CRC32 (checksum) computation + */ + typedef struct { + CrcUint32 crc32_table[256]; /* CRC table */ + } SDLTest_Crc32Context; + +/* ---------- Function Prototypes ------------- */ + +/** + * \brief Initialize the CRC context + * + * Note: The function initializes the crc table required for all crc calculations. + * + * \param crcContext pointer to context variable + * + * \returns 0 for OK, -1 on error + * + */ + int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext); + + +/** + * \brief calculate a crc32 from a data block + * + * \param crcContext pointer to context variable + * \param inBuf input buffer to checksum + * \param inLen length of input buffer + * \param crc32 pointer to Uint32 to store the final CRC into + * + * \returns 0 for OK, -1 on error + * + */ +int SDLTest_crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); + +/* Same routine broken down into three steps */ +int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); +int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); +int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); + + +/** + * \brief clean up CRC context + * + * \param crcContext pointer to context variable + * + * \returns 0 for OK, -1 on error + * +*/ + +int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_crc32_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_test_font.h b/Src/Decoder_H264_ALL/include/SDL/SDL_test_font.h new file mode 100644 index 0000000..3378ea8 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_test_font.h @@ -0,0 +1,76 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_font.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +#ifndef _SDL_test_font_h +#define _SDL_test_font_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Function prototypes */ + +#define FONT_CHARACTER_SIZE 8 + +/** + * \brief Draw a string in the currently set font. + * + * \param renderer The renderer to draw on. + * \param x The X coordinate of the upper left corner of the character. + * \param y The Y coordinate of the upper left corner of the character. + * \param c The character to draw. + * + * \returns Returns 0 on success, -1 on failure. + */ +int SDLTest_DrawCharacter( SDL_Renderer *renderer, int x, int y, char c ); + +/** + * \brief Draw a string in the currently set font. + * + * \param renderer The renderer to draw on. + * \param x The X coordinate of the upper left corner of the string. + * \param y The Y coordinate of the upper left corner of the string. + * \param s The string to draw. + * + * \returns Returns 0 on success, -1 on failure. + */ +int SDLTest_DrawString( SDL_Renderer * renderer, int x, int y, const char *s ); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_font_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_test_fuzzer.h b/Src/Decoder_H264_ALL/include/SDL/SDL_test_fuzzer.h new file mode 100644 index 0000000..9603652 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_test_fuzzer.h @@ -0,0 +1,384 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_fuzzer.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Data generators for fuzzing test data in a reproducible way. + +*/ + +#ifndef _SDL_test_fuzzer_h +#define _SDL_test_fuzzer_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* + Based on GSOC code by Markus Kauppila +*/ + + +/** + * \file + * Note: The fuzzer implementation uses a static instance of random context + * internally which makes it thread-UNsafe. + */ + +/** + * Initializes the fuzzer for a test + * + * \param execKey Execution "Key" that initializes the random number generator uniquely for the test. + * + */ +void SDLTest_FuzzerInit(Uint64 execKey); + + +/** + * Returns a random Uint8 + * + * \returns Generated integer + */ +Uint8 SDLTest_RandomUint8(); + +/** + * Returns a random Sint8 + * + * \returns Generated signed integer + */ +Sint8 SDLTest_RandomSint8(); + + +/** + * Returns a random Uint16 + * + * \returns Generated integer + */ +Uint16 SDLTest_RandomUint16(); + +/** + * Returns a random Sint16 + * + * \returns Generated signed integer + */ +Sint16 SDLTest_RandomSint16(); + + +/** + * Returns a random integer + * + * \returns Generated integer + */ +Sint32 SDLTest_RandomSint32(); + + +/** + * Returns a random positive integer + * + * \returns Generated integer + */ +Uint32 SDLTest_RandomUint32(); + +/** + * Returns random Uint64. + * + * \returns Generated integer + */ +Uint64 SDLTest_RandomUint64(); + + +/** + * Returns random Sint64. + * + * \returns Generated signed integer + */ +Sint64 SDLTest_RandomSint64(); + +/** + * \returns random float in range [0.0 - 1.0[ + */ +float SDLTest_RandomUnitFloat(); + +/** + * \returns random double in range [0.0 - 1.0[ + */ +double SDLTest_RandomUnitDouble(); + +/** + * \returns random float. + * + */ +float SDLTest_RandomFloat(); + +/** + * \returns random double. + * + */ +double SDLTest_RandomDouble(); + +/** + * Returns a random boundary value for Uint8 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint8BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint8BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint8BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint8BoundaryValue(0, 255, SDL_FALSE) returns 0 (error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Uint16 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint16BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint16BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint16BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint16BoundaryValue(0, 0xFFFF, SDL_FALSE) returns 0 (error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Uint32 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint32BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint32BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint32BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint32BoundaryValue(0, 0xFFFFFFFF, SDL_FALSE) returns 0 (with error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Uint64 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint64BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint64BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint64BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint64BoundaryValue(0, 0xFFFFFFFFFFFFFFFF, SDL_FALSE) returns 0 (with error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Sint8 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint8BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint8BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint8BoundaryValue(SINT8_MIN, 99, SDL_FALSE) returns 100 + * RandomSint8BoundaryValue(SINT8_MIN, SINT8_MAX, SDL_FALSE) returns SINT8_MIN (== error value) with error set + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT8_MIN with error set + */ +Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain); + + +/** + * Returns a random boundary value for Sint16 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint16BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint16BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint16BoundaryValue(SINT16_MIN, 99, SDL_FALSE) returns 100 + * RandomSint16BoundaryValue(SINT16_MIN, SINT16_MAX, SDL_FALSE) returns SINT16_MIN (== error value) with error set + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT16_MIN with error set + */ +Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Sint32 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint32BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint32BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint32BoundaryValue(SINT32_MIN, 99, SDL_FALSE) returns 100 + * RandomSint32BoundaryValue(SINT32_MIN, SINT32_MAX, SDL_FALSE) returns SINT32_MIN (== error value) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT32_MIN with error set + */ +Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Sint64 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint64BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint64BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint64BoundaryValue(SINT64_MIN, 99, SDL_FALSE) returns 100 + * RandomSint64BoundaryValue(SINT64_MIN, SINT64_MAX, SDL_FALSE) returns SINT64_MIN (== error value) and error set + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT64_MIN with error set + */ +Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain); + + +/** + * Returns integer in range [min, max] (inclusive). + * Min and max values can be negative values. + * If Max in smaller than min, then the values are swapped. + * Min and max are the same value, that value will be returned. + * + * \param min Minimum inclusive value of returned random number + * \param max Maximum inclusive value of returned random number + * + * \returns Generated random integer in range + */ +Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max); + + +/** + * Generates random null-terminated string. The minimum length for + * the string is 1 character, maximum length for the string is 255 + * characters and it can contain ASCII characters from 32 to 126. + * + * Note: Returned string needs to be deallocated. + * + * \returns Newly allocated random string; or NULL if length was invalid or string could not be allocated. + */ +char * SDLTest_RandomAsciiString(); + + +/** + * Generates random null-terminated string. The maximum length for + * the string is defined by the maxLength parameter. + * String can contain ASCII characters from 32 to 126. + * + * Note: Returned string needs to be deallocated. + * + * \param maxLength The maximum length of the generated string. + * + * \returns Newly allocated random string; or NULL if maxLength was invalid or string could not be allocated. + */ +char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength); + + +/** + * Generates random null-terminated string. The length for + * the string is defined by the size parameter. + * String can contain ASCII characters from 32 to 126. + * + * Note: Returned string needs to be deallocated. + * + * \param size The length of the generated string + * + * \returns Newly allocated random string; or NULL if size was invalid or string could not be allocated. + */ +char * SDLTest_RandomAsciiStringOfSize(int size); + +/** + * Returns the invocation count for the fuzzer since last ...FuzzerInit. + */ +int SDLTest_GetFuzzerInvocationCount(); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_fuzzer_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_test_harness.h b/Src/Decoder_H264_ALL/include/SDL/SDL_test_harness.h new file mode 100644 index 0000000..74c0950 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_test_harness.h @@ -0,0 +1,123 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_harness.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + Defines types for test case definitions and the test execution harness API. + + Based on original GSOC code by Markus Kauppila +*/ + +#ifndef _SDL_test_harness_h +#define _SDL_test_harness_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* ! Definitions for test case structures */ +#define TEST_ENABLED 1 +#define TEST_DISABLED 0 + +/* ! Definition of all the possible test return values of the test case method */ +#define TEST_ABORTED -1 +#define TEST_STARTED 0 +#define TEST_COMPLETED 1 +#define TEST_SKIPPED 2 + +/* ! Definition of all the possible test results for the harness */ +#define TEST_RESULT_PASSED 0 +#define TEST_RESULT_FAILED 1 +#define TEST_RESULT_NO_ASSERT 2 +#define TEST_RESULT_SKIPPED 3 +#define TEST_RESULT_SETUP_FAILURE 4 + +/* !< Function pointer to a test case setup function (run before every test) */ +typedef void (*SDLTest_TestCaseSetUpFp)(void *arg); + +/* !< Function pointer to a test case function */ +typedef int (*SDLTest_TestCaseFp)(void *arg); + +/* !< Function pointer to a test case teardown function (run after every test) */ +typedef void (*SDLTest_TestCaseTearDownFp)(void *arg); + +/** + * Holds information about a single test case. + */ +typedef struct SDLTest_TestCaseReference { + /* !< Func2Stress */ + SDLTest_TestCaseFp testCase; + /* !< Short name (or function name) "Func2Stress" */ + char *name; + /* !< Long name or full description "This test pushes func2() to the limit." */ + char *description; + /* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */ + int enabled; +} SDLTest_TestCaseReference; + +/** + * Holds information about a test suite (multiple test cases). + */ +typedef struct SDLTest_TestSuiteReference { + /* !< "PlatformSuite" */ + char *name; + /* !< The function that is run before each test. NULL skips. */ + SDLTest_TestCaseSetUpFp testSetUp; + /* !< The test cases that are run as part of the suite. Last item should be NULL. */ + const SDLTest_TestCaseReference **testCases; + /* !< The function that is run after each test. NULL skips. */ + SDLTest_TestCaseTearDownFp testTearDown; +} SDLTest_TestSuiteReference; + + +/** + * \brief Execute a test suite using the given run seed and execution key. + * + * \param testSuites Suites containing the test case. + * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one. + * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one. + * \param filter Filter specification. NULL disables. Case sensitive. + * \param testIterations Number of iterations to run each test case. + * + * \returns Test run result; 0 when all tests passed, 1 if any tests failed. + */ +int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_harness_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_test_images.h b/Src/Decoder_H264_ALL/include/SDL/SDL_test_images.h new file mode 100644 index 0000000..8c64b4f --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_test_images.h @@ -0,0 +1,78 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_images.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Defines some images for tests. + +*/ + +#ifndef _SDL_test_images_h +#define _SDL_test_images_h + +#include "SDL.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + *Type for test images. + */ +typedef struct SDLTest_SurfaceImage_s { + int width; + int height; + unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ + const char *pixel_data; +} SDLTest_SurfaceImage_t; + +/* Test images */ +SDL_Surface *SDLTest_ImageBlit(); +SDL_Surface *SDLTest_ImageBlitColor(); +SDL_Surface *SDLTest_ImageBlitAlpha(); +SDL_Surface *SDLTest_ImageBlitBlendAdd(); +SDL_Surface *SDLTest_ImageBlitBlend(); +SDL_Surface *SDLTest_ImageBlitBlendMod(); +SDL_Surface *SDLTest_ImageBlitBlendNone(); +SDL_Surface *SDLTest_ImageBlitBlendAll(); +SDL_Surface *SDLTest_ImageFace(); +SDL_Surface *SDLTest_ImagePrimitives(); +SDL_Surface *SDLTest_ImagePrimitivesBlend(); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_images_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_test_log.h b/Src/Decoder_H264_ALL/include/SDL/SDL_test_log.h new file mode 100644 index 0000000..73a5c01 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_test_log.h @@ -0,0 +1,67 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_log.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + * + * Wrapper to log in the TEST category + * + */ + +#ifndef _SDL_test_log_h +#define _SDL_test_log_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Prints given message with a timestamp in the TEST category and INFO priority. + * + * \param fmt Message to be logged + */ +void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); + +/** + * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. + * + * \param fmt Message to be logged + */ +void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_log_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_test_md5.h b/Src/Decoder_H264_ALL/include/SDL/SDL_test_md5.h new file mode 100644 index 0000000..f2d9a7d --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_test_md5.h @@ -0,0 +1,129 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_md5.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + *********************************************************************** + ** Header file for implementation of MD5 ** + ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** + ** Created: 2/17/90 RLR ** + ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** + ** Revised (for MD5): RLR 4/27/91 ** + ** -- G modified to have y&~z instead of y&z ** + ** -- FF, GG, HH modified to add in last register done ** + ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** + ** -- distinct additive constant for each step ** + ** -- round 4 added, working mod 7 ** + *********************************************************************** +*/ + +/* + *********************************************************************** + ** Message-digest routines: ** + ** To form the message digest for a message M ** + ** (1) Initialize a context buffer mdContext using MD5Init ** + ** (2) Call MD5Update on mdContext and M ** + ** (3) Call MD5Final on mdContext ** + ** The message digest is now in mdContext->digest[0...15] ** + *********************************************************************** +*/ + +#ifndef _SDL_test_md5_h +#define _SDL_test_md5_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* ------------ Definitions --------- */ + +/* typedef a 32-bit type */ + typedef unsigned long int MD5UINT4; + +/* Data structure for MD5 (Message-Digest) computation */ + typedef struct { + MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ + MD5UINT4 buf[4]; /* scratch buffer */ + unsigned char in[64]; /* input buffer */ + unsigned char digest[16]; /* actual digest after Md5Final call */ + } SDLTest_Md5Context; + +/* ---------- Function Prototypes ------------- */ + +/** + * \brief initialize the context + * + * \param mdContext pointer to context variable + * + * Note: The function initializes the message-digest context + * mdContext. Call before each new use of the context - + * all fields are set to zero. + */ + void SDLTest_Md5Init(SDLTest_Md5Context * mdContext); + + +/** + * \brief update digest from variable length data + * + * \param mdContext pointer to context variable + * \param inBuf pointer to data array/string + * \param inLen length of data array/string + * + * Note: The function updates the message-digest context to account + * for the presence of each of the characters inBuf[0..inLen-1] + * in the message whose digest is being computed. +*/ + + void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf, + unsigned int inLen); + + +/** + * \brief complete digest computation + * + * \param mdContext pointer to context variable + * + * Note: The function terminates the message-digest computation and + * ends with the desired message digest in mdContext.digest[0..15]. + * Always call before using the digest[] variable. +*/ + + void SDLTest_Md5Final(SDLTest_Md5Context * mdContext); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_md5_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_test_random.h b/Src/Decoder_H264_ALL/include/SDL/SDL_test_random.h new file mode 100644 index 0000000..91c3652 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_test_random.h @@ -0,0 +1,115 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_random.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + A "32-bit Multiply with carry random number generator. Very fast. + Includes a list of recommended multipliers. + + multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32. + period: (a*2^31)-1 + +*/ + +#ifndef _SDL_test_random_h +#define _SDL_test_random_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* --- Definitions */ + +/* + * Macros that return a random number in a specific format. + */ +#define SDLTest_RandomInt(c) ((int)SDLTest_Random(c)) + +/* + * Context structure for the random number generator state. + */ + typedef struct { + unsigned int a; + unsigned int x; + unsigned int c; + unsigned int ah; + unsigned int al; + } SDLTest_RandomContext; + + +/* --- Function prototypes */ + +/** + * \brief Initialize random number generator with two integers. + * + * Note: The random sequence of numbers returned by ...Random() is the + * same for the same two integers and has a period of 2^31. + * + * \param rndContext pointer to context structure + * \param xi integer that defines the random sequence + * \param ci integer that defines the random sequence + * + */ + void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, + unsigned int ci); + +/** + * \brief Initialize random number generator based on current system time. + * + * \param rndContext pointer to context structure + * + */ + void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext); + + +/** + * \brief Initialize random number generator based on current system time. + * + * Note: ...RandomInit() or ...RandomInitTime() must have been called + * before using this function. + * + * \param rndContext pointer to context structure + * + * \returns A random number (32bit unsigned integer) + * + */ + unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_random_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_thread.h b/Src/Decoder_H264_ALL/include/SDL/SDL_thread.h new file mode 100644 index 0000000..377e6c7 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_thread.h @@ -0,0 +1,287 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_thread_h +#define _SDL_thread_h + +/** + * \file SDL_thread.h + * + * Header for the SDL thread management routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/* Thread synchronization primitives */ +#include "SDL_atomic.h" +#include "SDL_mutex.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* The SDL thread structure, defined in SDL_thread.c */ +struct SDL_Thread; +typedef struct SDL_Thread SDL_Thread; + +/* The SDL thread ID */ +typedef unsigned long SDL_threadID; + +/* Thread local storage ID, 0 is the invalid ID */ +typedef unsigned int SDL_TLSID; + +/** + * The SDL thread priority. + * + * \note On many systems you require special privileges to set high priority. + */ +typedef enum { + SDL_THREAD_PRIORITY_LOW, + SDL_THREAD_PRIORITY_NORMAL, + SDL_THREAD_PRIORITY_HIGH +} SDL_ThreadPriority; + +/** + * The function passed to SDL_CreateThread(). + * It is passed a void* user context parameter and returns an int. + */ +typedef int (SDLCALL * SDL_ThreadFunction) (void *data); + +#if defined(__WIN32__) && !defined(HAVE_LIBC) +/** + * \file SDL_thread.h + * + * We compile SDL into a DLL. This means, that it's the DLL which + * creates a new thread for the calling process with the SDL_CreateThread() + * API. There is a problem with this, that only the RTL of the SDL.DLL will + * be initialized for those threads, and not the RTL of the calling + * application! + * + * To solve this, we make a little hack here. + * + * We'll always use the caller's _beginthread() and _endthread() APIs to + * start a new thread. This way, if it's the SDL.DLL which uses this API, + * then the RTL of SDL.DLL will be used to create the new thread, and if it's + * the application, then the RTL of the application will be used. + * + * So, in short: + * Always use the _beginthread() and _endthread() of the calling runtime + * library! + */ +#define SDL_PASSED_BEGINTHREAD_ENDTHREAD +#include /* This has _beginthread() and _endthread() defined! */ + +typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall * + func) (void + *), + void *arg, unsigned, + unsigned *threadID); +typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); + +/** + * Create a thread. + */ +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread); + +/** + * Create a thread. + */ +#if defined(SDL_CreateThread) && SDL_DYNAMIC_API +#undef SDL_CreateThread +#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) +#else +#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) +#endif + +#else + +/** + * Create a thread. + * + * Thread naming is a little complicated: Most systems have very small + * limits for the string length (Haiku has 32 bytes, Linux currently has 16, + * Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll + * have to see what happens with your system's debugger. The name should be + * UTF-8 (but using the naming limits of C identifiers is a better bet). + * There are no requirements for thread naming conventions, so long as the + * string is null-terminated UTF-8, but these guidelines are helpful in + * choosing a name: + * + * http://stackoverflow.com/questions/149932/naming-conventions-for-threads + * + * If a system imposes requirements, SDL will try to munge the string for + * it (truncate, etc), but the original string contents will be available + * from SDL_GetThreadName(). + */ +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data); + +#endif + +/** + * Get the thread name, as it was specified in SDL_CreateThread(). + * This function returns a pointer to a UTF-8 string that names the + * specified thread, or NULL if it doesn't have a name. This is internal + * memory, not to be free()'d by the caller, and remains valid until the + * specified thread is cleaned up by SDL_WaitThread(). + */ +extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread); + +/** + * Get the thread identifier for the current thread. + */ +extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void); + +/** + * Get the thread identifier for the specified thread. + * + * Equivalent to SDL_ThreadID() if the specified thread is NULL. + */ +extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread); + +/** + * Set the priority for the current thread + */ +extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority); + +/** + * Wait for a thread to finish. Threads that haven't been detached will + * remain (as a "zombie") until this function cleans them up. Not doing so + * is a resource leak. + * + * Once a thread has been cleaned up through this function, the SDL_Thread + * that references it becomes invalid and should not be referenced again. + * As such, only one thread may call SDL_WaitThread() on another. + * + * The return code for the thread function is placed in the area + * pointed to by \c status, if \c status is not NULL. + * + * You may not wait on a thread that has been used in a call to + * SDL_DetachThread(). Use either that function or this one, but not + * both, or behavior is undefined. + * + * It is safe to pass NULL to this function; it is a no-op. + */ +extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); + +/** + * A thread may be "detached" to signify that it should not remain until + * another thread has called SDL_WaitThread() on it. Detaching a thread + * is useful for long-running threads that nothing needs to synchronize + * with or further manage. When a detached thread is done, it simply + * goes away. + * + * There is no way to recover the return code of a detached thread. If you + * need this, don't detach the thread and instead use SDL_WaitThread(). + * + * Once a thread is detached, you should usually assume the SDL_Thread isn't + * safe to reference again, as it will become invalid immediately upon + * the detached thread's exit, instead of remaining until someone has called + * SDL_WaitThread() to finally clean it up. As such, don't detach the same + * thread more than once. + * + * If a thread has already exited when passed to SDL_DetachThread(), it will + * stop waiting for a call to SDL_WaitThread() and clean up immediately. + * It is not safe to detach a thread that might be used with SDL_WaitThread(). + * + * You may not call SDL_WaitThread() on a thread that has been detached. + * Use either that function or this one, but not both, or behavior is + * undefined. + * + * It is safe to pass NULL to this function; it is a no-op. + */ +extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread); + +/** + * \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific. + * + * \return The newly created thread local storage identifier, or 0 on error + * + * \code + * static SDL_SpinLock tls_lock; + * static SDL_TLSID thread_local_storage; + * + * void SetMyThreadData(void *value) + * { + * if (!thread_local_storage) { + * SDL_AtomicLock(&tls_lock); + * if (!thread_local_storage) { + * thread_local_storage = SDL_TLSCreate(); + * } + * SDL_AtomicUnlock(&tls_lock); + * } + * SDL_TLSSet(thread_local_storage, value, 0); + * } + * + * void *GetMyThreadData(void) + * { + * return SDL_TLSGet(thread_local_storage); + * } + * \endcode + * + * \sa SDL_TLSGet() + * \sa SDL_TLSSet() + */ +extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void); + +/** + * \brief Get the value associated with a thread local storage ID for the current thread. + * + * \param id The thread local storage ID + * + * \return The value associated with the ID for the current thread, or NULL if no value has been set. + * + * \sa SDL_TLSCreate() + * \sa SDL_TLSSet() + */ +extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id); + +/** + * \brief Set the value associated with a thread local storage ID for the current thread. + * + * \param id The thread local storage ID + * \param value The value to associate with the ID for the current thread + * \param destructor A function called when the thread exits, to free the value. + * + * \return 0 on success, -1 on error + * + * \sa SDL_TLSCreate() + * \sa SDL_TLSGet() + */ +extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (*destructor)(void*)); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_thread_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_timer.h b/Src/Decoder_H264_ALL/include/SDL/SDL_timer.h new file mode 100644 index 0000000..e0d3785 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_timer.h @@ -0,0 +1,115 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_timer_h +#define _SDL_timer_h + +/** + * \file SDL_timer.h + * + * Header for the SDL time management routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Get the number of milliseconds since the SDL library initialization. + * + * \note This value wraps if the program runs for more than ~49 days. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); + +/** + * \brief Compare SDL ticks values, and return true if A has passed B + * + * e.g. if you want to wait 100 ms, you could do this: + * Uint32 timeout = SDL_GetTicks() + 100; + * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) { + * ... do work until timeout has elapsed + * } + */ +#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) + +/** + * \brief Get the current value of the high resolution counter + */ +extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void); + +/** + * \brief Get the count per second of the high resolution counter + */ +extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void); + +/** + * \brief Wait a specified number of milliseconds before returning. + */ +extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); + +/** + * Function prototype for the timer callback function. + * + * The callback function is passed the current timer interval and returns + * the next timer interval. If the returned value is the same as the one + * passed in, the periodic alarm continues, otherwise a new alarm is + * scheduled. If the callback returns 0, the periodic alarm is cancelled. + */ +typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); + +/** + * Definition of the timer ID type. + */ +typedef int SDL_TimerID; + +/** + * \brief Add a new timer to the pool of timers already running. + * + * \return A timer ID, or 0 when an error occurs. + */ +extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, + SDL_TimerCallback callback, + void *param); + +/** + * \brief Remove a timer knowing its ID. + * + * \return A boolean value indicating success or failure. + * + * \warning It is not safe to remove a timer multiple times. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_timer_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_touch.h b/Src/Decoder_H264_ALL/include/SDL/SDL_touch.h new file mode 100644 index 0000000..2643e36 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_touch.h @@ -0,0 +1,86 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_touch.h + * + * Include file for SDL touch event handling. + */ + +#ifndef _SDL_touch_h +#define _SDL_touch_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef Sint64 SDL_TouchID; +typedef Sint64 SDL_FingerID; + +typedef struct SDL_Finger +{ + SDL_FingerID id; + float x; + float y; + float pressure; +} SDL_Finger; + +/* Used as the device ID for mouse events simulated with touch input */ +#define SDL_TOUCH_MOUSEID ((Uint32)-1) + + +/* Function prototypes */ + +/** + * \brief Get the number of registered touch devices. + */ +extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); + +/** + * \brief Get the touch ID with the given index, or 0 if the index is invalid. + */ +extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); + +/** + * \brief Get the number of active fingers for a given touch device. + */ +extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); + +/** + * \brief Get the finger object of the given touch, with the given index. + */ +extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_touch_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_types.h b/Src/Decoder_H264_ALL/include/SDL/SDL_types.h new file mode 100644 index 0000000..5118af2 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_types.h @@ -0,0 +1,29 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_types.h + * + * \deprecated + */ + +/* DEPRECATED */ +#include "SDL_stdinc.h" diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_version.h b/Src/Decoder_H264_ALL/include/SDL/SDL_version.h new file mode 100644 index 0000000..de1f160 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_version.h @@ -0,0 +1,162 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_version.h + * + * This header defines the current SDL version. + */ + +#ifndef _SDL_version_h +#define _SDL_version_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Information the version of SDL in use. + * + * Represents the library's version as three levels: major revision + * (increments with massive changes, additions, and enhancements), + * minor revision (increments with backwards-compatible changes to the + * major revision), and patchlevel (increments with fixes to the minor + * revision). + * + * \sa SDL_VERSION + * \sa SDL_GetVersion + */ +typedef struct SDL_version +{ + Uint8 major; /**< major version */ + Uint8 minor; /**< minor version */ + Uint8 patch; /**< update version */ +} SDL_version; + +/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL +*/ +#define SDL_MAJOR_VERSION 2 +#define SDL_MINOR_VERSION 0 +#define SDL_PATCHLEVEL 4 + +/** + * \brief Macro to determine SDL version program was compiled against. + * + * This macro fills in a SDL_version structure with the version of the + * library you compiled against. This is determined by what header the + * compiler uses. Note that if you dynamically linked the library, you might + * have a slightly newer or older version at runtime. That version can be + * determined with SDL_GetVersion(), which, unlike SDL_VERSION(), + * is not a macro. + * + * \param x A pointer to a SDL_version struct to initialize. + * + * \sa SDL_version + * \sa SDL_GetVersion + */ +#define SDL_VERSION(x) \ +{ \ + (x)->major = SDL_MAJOR_VERSION; \ + (x)->minor = SDL_MINOR_VERSION; \ + (x)->patch = SDL_PATCHLEVEL; \ +} + +/** + * This macro turns the version numbers into a numeric value: + * \verbatim + (1,2,3) -> (1203) + \endverbatim + * + * This assumes that there will never be more than 100 patchlevels. + */ +#define SDL_VERSIONNUM(X, Y, Z) \ + ((X)*1000 + (Y)*100 + (Z)) + +/** + * This is the version number macro for the current SDL version. + */ +#define SDL_COMPILEDVERSION \ + SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) + +/** + * This macro will evaluate to true if compiled with SDL at least X.Y.Z. + */ +#define SDL_VERSION_ATLEAST(X, Y, Z) \ + (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) + +/** + * \brief Get the version of SDL that is linked against your program. + * + * If you are linking to SDL dynamically, then it is possible that the + * current version will be different than the version you compiled against. + * This function returns the current version, while SDL_VERSION() is a + * macro that tells you what version you compiled with. + * + * \code + * SDL_version compiled; + * SDL_version linked; + * + * SDL_VERSION(&compiled); + * SDL_GetVersion(&linked); + * printf("We compiled against SDL version %d.%d.%d ...\n", + * compiled.major, compiled.minor, compiled.patch); + * printf("But we linked against SDL version %d.%d.%d.\n", + * linked.major, linked.minor, linked.patch); + * \endcode + * + * This function may be called safely at any time, even before SDL_Init(). + * + * \sa SDL_VERSION + */ +extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); + +/** + * \brief Get the code revision of SDL that is linked against your program. + * + * Returns an arbitrary string (a hash value) uniquely identifying the + * exact revision of the SDL library in use, and is only useful in comparing + * against other revisions. It is NOT an incrementing number. + */ +extern DECLSPEC const char *SDLCALL SDL_GetRevision(void); + +/** + * \brief Get the revision number of SDL that is linked against your program. + * + * Returns a number uniquely identifying the exact revision of the SDL + * library in use. It is an incrementing number based on commits to + * hg.libsdl.org. + */ +extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_version_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/SDL_video.h b/Src/Decoder_H264_ALL/include/SDL/SDL_video.h new file mode 100644 index 0000000..52dbbc7 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/SDL_video.h @@ -0,0 +1,1103 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_video.h + * + * Header file for SDL video functions. + */ + +#ifndef _SDL_video_h +#define _SDL_video_h + +#include "SDL_stdinc.h" +#include "SDL_pixels.h" +#include "SDL_rect.h" +#include "SDL_surface.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The structure that defines a display mode + * + * \sa SDL_GetNumDisplayModes() + * \sa SDL_GetDisplayMode() + * \sa SDL_GetDesktopDisplayMode() + * \sa SDL_GetCurrentDisplayMode() + * \sa SDL_GetClosestDisplayMode() + * \sa SDL_SetWindowDisplayMode() + * \sa SDL_GetWindowDisplayMode() + */ +typedef struct +{ + Uint32 format; /**< pixel format */ + int w; /**< width, in screen coordinates */ + int h; /**< height, in screen coordinates */ + int refresh_rate; /**< refresh rate (or zero for unspecified) */ + void *driverdata; /**< driver-specific data, initialize to 0 */ +} SDL_DisplayMode; + +/** + * \brief The type used to identify a window + * + * \sa SDL_CreateWindow() + * \sa SDL_CreateWindowFrom() + * \sa SDL_DestroyWindow() + * \sa SDL_GetWindowData() + * \sa SDL_GetWindowFlags() + * \sa SDL_GetWindowGrab() + * \sa SDL_GetWindowPosition() + * \sa SDL_GetWindowSize() + * \sa SDL_GetWindowTitle() + * \sa SDL_HideWindow() + * \sa SDL_MaximizeWindow() + * \sa SDL_MinimizeWindow() + * \sa SDL_RaiseWindow() + * \sa SDL_RestoreWindow() + * \sa SDL_SetWindowData() + * \sa SDL_SetWindowFullscreen() + * \sa SDL_SetWindowGrab() + * \sa SDL_SetWindowIcon() + * \sa SDL_SetWindowPosition() + * \sa SDL_SetWindowSize() + * \sa SDL_SetWindowBordered() + * \sa SDL_SetWindowTitle() + * \sa SDL_ShowWindow() + */ +typedef struct SDL_Window SDL_Window; + +/** + * \brief The flags on a window + * + * \sa SDL_GetWindowFlags() + */ +typedef enum +{ + SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */ + SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */ + SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */ + SDL_WINDOW_HIDDEN = 0x00000008, /**< window is not visible */ + SDL_WINDOW_BORDERLESS = 0x00000010, /**< no window decoration */ + SDL_WINDOW_RESIZABLE = 0x00000020, /**< window can be resized */ + SDL_WINDOW_MINIMIZED = 0x00000040, /**< window is minimized */ + SDL_WINDOW_MAXIMIZED = 0x00000080, /**< window is maximized */ + SDL_WINDOW_INPUT_GRABBED = 0x00000100, /**< window has grabbed input focus */ + SDL_WINDOW_INPUT_FOCUS = 0x00000200, /**< window has input focus */ + SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */ + SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ), + SDL_WINDOW_FOREIGN = 0x00000800, /**< window not created by SDL */ + SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000, /**< window should be created in high-DPI mode if supported */ + SDL_WINDOW_MOUSE_CAPTURE = 0x00004000 /**< window has mouse captured (unrelated to INPUT_GRABBED) */ +} SDL_WindowFlags; + +/** + * \brief Used to indicate that you don't care what the window position is. + */ +#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000 +#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X)) +#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0) +#define SDL_WINDOWPOS_ISUNDEFINED(X) \ + (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK) + +/** + * \brief Used to indicate that the window position should be centered. + */ +#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000 +#define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X)) +#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0) +#define SDL_WINDOWPOS_ISCENTERED(X) \ + (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK) + +/** + * \brief Event subtype for window events + */ +typedef enum +{ + SDL_WINDOWEVENT_NONE, /**< Never used */ + SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */ + SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */ + SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be + redrawn */ + SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2 + */ + SDL_WINDOWEVENT_RESIZED, /**< Window has been resized to data1xdata2 */ + SDL_WINDOWEVENT_SIZE_CHANGED, /**< The window size has changed, either as + a result of an API call or through the + system or user changing the window size. */ + SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */ + SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */ + SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size + and position */ + SDL_WINDOWEVENT_ENTER, /**< Window has gained mouse focus */ + SDL_WINDOWEVENT_LEAVE, /**< Window has lost mouse focus */ + SDL_WINDOWEVENT_FOCUS_GAINED, /**< Window has gained keyboard focus */ + SDL_WINDOWEVENT_FOCUS_LOST, /**< Window has lost keyboard focus */ + SDL_WINDOWEVENT_CLOSE /**< The window manager requests that the + window be closed */ +} SDL_WindowEventID; + +/** + * \brief An opaque handle to an OpenGL context. + */ +typedef void *SDL_GLContext; + +/** + * \brief OpenGL configuration attributes + */ +typedef enum +{ + SDL_GL_RED_SIZE, + SDL_GL_GREEN_SIZE, + SDL_GL_BLUE_SIZE, + SDL_GL_ALPHA_SIZE, + SDL_GL_BUFFER_SIZE, + SDL_GL_DOUBLEBUFFER, + SDL_GL_DEPTH_SIZE, + SDL_GL_STENCIL_SIZE, + SDL_GL_ACCUM_RED_SIZE, + SDL_GL_ACCUM_GREEN_SIZE, + SDL_GL_ACCUM_BLUE_SIZE, + SDL_GL_ACCUM_ALPHA_SIZE, + SDL_GL_STEREO, + SDL_GL_MULTISAMPLEBUFFERS, + SDL_GL_MULTISAMPLESAMPLES, + SDL_GL_ACCELERATED_VISUAL, + SDL_GL_RETAINED_BACKING, + SDL_GL_CONTEXT_MAJOR_VERSION, + SDL_GL_CONTEXT_MINOR_VERSION, + SDL_GL_CONTEXT_EGL, + SDL_GL_CONTEXT_FLAGS, + SDL_GL_CONTEXT_PROFILE_MASK, + SDL_GL_SHARE_WITH_CURRENT_CONTEXT, + SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, + SDL_GL_CONTEXT_RELEASE_BEHAVIOR +} SDL_GLattr; + +typedef enum +{ + SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, + SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, + SDL_GL_CONTEXT_PROFILE_ES = 0x0004 /* GLX_CONTEXT_ES2_PROFILE_BIT_EXT */ +} SDL_GLprofile; + +typedef enum +{ + SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, + SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, + SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004, + SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008 +} SDL_GLcontextFlag; + +typedef enum +{ + SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000, + SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001 +} SDL_GLcontextReleaseFlag; + + +/* Function prototypes */ + +/** + * \brief Get the number of video drivers compiled into SDL + * + * \sa SDL_GetVideoDriver() + */ +extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); + +/** + * \brief Get the name of a built in video driver. + * + * \note The video drivers are presented in the order in which they are + * normally checked during initialization. + * + * \sa SDL_GetNumVideoDrivers() + */ +extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); + +/** + * \brief Initialize the video subsystem, optionally specifying a video driver. + * + * \param driver_name Initialize a specific driver by name, or NULL for the + * default video driver. + * + * \return 0 on success, -1 on error + * + * This function initializes the video subsystem; setting up a connection + * to the window manager, etc, and determines the available display modes + * and pixel formats, but does not initialize a window or graphics mode. + * + * \sa SDL_VideoQuit() + */ +extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name); + +/** + * \brief Shuts down the video subsystem. + * + * This function closes all windows, and restores the original video mode. + * + * \sa SDL_VideoInit() + */ +extern DECLSPEC void SDLCALL SDL_VideoQuit(void); + +/** + * \brief Returns the name of the currently initialized video driver. + * + * \return The name of the current video driver or NULL if no driver + * has been initialized + * + * \sa SDL_GetNumVideoDrivers() + * \sa SDL_GetVideoDriver() + */ +extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void); + +/** + * \brief Returns the number of available video displays. + * + * \sa SDL_GetDisplayBounds() + */ +extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void); + +/** + * \brief Get the name of a display in UTF-8 encoding + * + * \return The name of a display, or NULL for an invalid display index. + * + * \sa SDL_GetNumVideoDisplays() + */ +extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex); + +/** + * \brief Get the desktop area represented by a display, with the primary + * display located at 0,0 + * + * \return 0 on success, or -1 if the index is out of range. + * + * \sa SDL_GetNumVideoDisplays() + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect); + +/** + * \brief Get the dots/pixels-per-inch for a display + * + * \note Diagonal, horizontal and vertical DPI can all be optionally + * returned if the parameter is non-NULL. + * + * \return 0 on success, or -1 if no DPI information is available or the index is out of range. + * + * \sa SDL_GetNumVideoDisplays() + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi); + +/** + * \brief Returns the number of available display modes. + * + * \sa SDL_GetDisplayMode() + */ +extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex); + +/** + * \brief Fill in information about a specific display mode. + * + * \note The display modes are sorted in this priority: + * \li bits per pixel -> more colors to fewer colors + * \li width -> largest to smallest + * \li height -> largest to smallest + * \li refresh rate -> highest to lowest + * + * \sa SDL_GetNumDisplayModes() + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex, + SDL_DisplayMode * mode); + +/** + * \brief Fill in information about the desktop display mode. + */ +extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode); + +/** + * \brief Fill in information about the current display mode. + */ +extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode); + + +/** + * \brief Get the closest match to the requested display mode. + * + * \param displayIndex The index of display from which mode should be queried. + * \param mode The desired display mode + * \param closest A pointer to a display mode to be filled in with the closest + * match of the available display modes. + * + * \return The passed in value \c closest, or NULL if no matching video mode + * was available. + * + * The available display modes are scanned, and \c closest is filled in with the + * closest mode matching the requested mode and returned. The mode format and + * refresh_rate default to the desktop mode if they are 0. The modes are + * scanned with size being first priority, format being second priority, and + * finally checking the refresh_rate. If all the available modes are too + * small, then NULL is returned. + * + * \sa SDL_GetNumDisplayModes() + * \sa SDL_GetDisplayMode() + */ +extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest); + +/** + * \brief Get the display index associated with a window. + * + * \return the display index of the display containing the center of the + * window, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window); + +/** + * \brief Set the display mode used when a fullscreen window is visible. + * + * By default the window's dimensions and the desktop format and refresh rate + * are used. + * + * \param window The window for which the display mode should be set. + * \param mode The mode to use, or NULL for the default mode. + * + * \return 0 on success, or -1 if setting the display mode failed. + * + * \sa SDL_GetWindowDisplayMode() + * \sa SDL_SetWindowFullscreen() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window, + const SDL_DisplayMode + * mode); + +/** + * \brief Fill in information about the display mode used when a fullscreen + * window is visible. + * + * \sa SDL_SetWindowDisplayMode() + * \sa SDL_SetWindowFullscreen() + */ +extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window, + SDL_DisplayMode * mode); + +/** + * \brief Get the pixel format associated with the window. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); + +/** + * \brief Create a window with the specified position, dimensions, and flags. + * + * \param title The title of the window, in UTF-8 encoding. + * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param w The width of the window, in screen coordinates. + * \param h The height of the window, in screen coordinates. + * \param flags The flags for the window, a mask of any of the following: + * ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL, + * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS, + * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, + * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED, + * ::SDL_WINDOW_ALLOW_HIGHDPI. + * + * \return The id of the window created, or zero if window creation failed. + * + * If the window is created with the SDL_WINDOW_ALLOW_HIGHDPI flag, its size + * in pixels may differ from its size in screen coordinates on platforms with + * high-DPI support (e.g. iOS and Mac OS X). Use SDL_GetWindowSize() to query + * the client area's size in screen coordinates, and SDL_GL_GetDrawableSize() + * or SDL_GetRendererOutputSize() to query the drawable size in pixels. + * + * \sa SDL_DestroyWindow() + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, + int x, int y, int w, + int h, Uint32 flags); + +/** + * \brief Create an SDL window from an existing native window. + * + * \param data A pointer to driver-dependent window creation data + * + * \return The id of the window created, or zero if window creation failed. + * + * \sa SDL_DestroyWindow() + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data); + +/** + * \brief Get the numeric ID of a window, for logging purposes. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window); + +/** + * \brief Get a window from a stored ID, or NULL if it doesn't exist. + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id); + +/** + * \brief Get the window flags. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window); + +/** + * \brief Set the title of a window, in UTF-8 format. + * + * \sa SDL_GetWindowTitle() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window, + const char *title); + +/** + * \brief Get the title of a window, in UTF-8 format. + * + * \sa SDL_SetWindowTitle() + */ +extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window); + +/** + * \brief Set the icon for a window. + * + * \param window The window for which the icon should be set. + * \param icon The icon for the window. + */ +extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window, + SDL_Surface * icon); + +/** + * \brief Associate an arbitrary named pointer with a window. + * + * \param window The window to associate with the pointer. + * \param name The name of the pointer. + * \param userdata The associated pointer. + * + * \return The previous value associated with 'name' + * + * \note The name is case-sensitive. + * + * \sa SDL_GetWindowData() + */ +extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window, + const char *name, + void *userdata); + +/** + * \brief Retrieve the data pointer associated with a window. + * + * \param window The window to query. + * \param name The name of the pointer. + * + * \return The value associated with 'name' + * + * \sa SDL_SetWindowData() + */ +extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window, + const char *name); + +/** + * \brief Set the position of a window. + * + * \param window The window to reposition. + * \param x The x coordinate of the window in screen coordinates, or + * ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y coordinate of the window in screen coordinates, or + * ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED. + * + * \note The window coordinate origin is the upper left of the display. + * + * \sa SDL_GetWindowPosition() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window, + int x, int y); + +/** + * \brief Get the position of a window. + * + * \param window The window to query. + * \param x Pointer to variable for storing the x position, in screen + * coordinates. May be NULL. + * \param y Pointer to variable for storing the y position, in screen + * coordinates. May be NULL. + * + * \sa SDL_SetWindowPosition() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window, + int *x, int *y); + +/** + * \brief Set the size of a window's client area. + * + * \param window The window to resize. + * \param w The width of the window, in screen coordinates. Must be >0. + * \param h The height of the window, in screen coordinates. Must be >0. + * + * \note You can't change the size of a fullscreen window, it automatically + * matches the size of the display mode. + * + * The window size in screen coordinates may differ from the size in pixels, if + * the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with + * high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or + * SDL_GetRendererOutputSize() to get the real client area size in pixels. + * + * \sa SDL_GetWindowSize() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w, + int h); + +/** + * \brief Get the size of a window's client area. + * + * \param window The window to query. + * \param w Pointer to variable for storing the width, in screen + * coordinates. May be NULL. + * \param h Pointer to variable for storing the height, in screen + * coordinates. May be NULL. + * + * The window size in screen coordinates may differ from the size in pixels, if + * the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with + * high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or + * SDL_GetRendererOutputSize() to get the real client area size in pixels. + * + * \sa SDL_SetWindowSize() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w, + int *h); + +/** + * \brief Set the minimum size of a window's client area. + * + * \param window The window to set a new minimum size. + * \param min_w The minimum width of the window, must be >0 + * \param min_h The minimum height of the window, must be >0 + * + * \note You can't change the minimum size of a fullscreen window, it + * automatically matches the size of the display mode. + * + * \sa SDL_GetWindowMinimumSize() + * \sa SDL_SetWindowMaximumSize() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window, + int min_w, int min_h); + +/** + * \brief Get the minimum size of a window's client area. + * + * \param window The window to query. + * \param w Pointer to variable for storing the minimum width, may be NULL + * \param h Pointer to variable for storing the minimum height, may be NULL + * + * \sa SDL_GetWindowMaximumSize() + * \sa SDL_SetWindowMinimumSize() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window, + int *w, int *h); + +/** + * \brief Set the maximum size of a window's client area. + * + * \param window The window to set a new maximum size. + * \param max_w The maximum width of the window, must be >0 + * \param max_h The maximum height of the window, must be >0 + * + * \note You can't change the maximum size of a fullscreen window, it + * automatically matches the size of the display mode. + * + * \sa SDL_GetWindowMaximumSize() + * \sa SDL_SetWindowMinimumSize() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window, + int max_w, int max_h); + +/** + * \brief Get the maximum size of a window's client area. + * + * \param window The window to query. + * \param w Pointer to variable for storing the maximum width, may be NULL + * \param h Pointer to variable for storing the maximum height, may be NULL + * + * \sa SDL_GetWindowMinimumSize() + * \sa SDL_SetWindowMaximumSize() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window, + int *w, int *h); + +/** + * \brief Set the border state of a window. + * + * This will add or remove the window's SDL_WINDOW_BORDERLESS flag and + * add or remove the border from the actual window. This is a no-op if the + * window's border already matches the requested state. + * + * \param window The window of which to change the border state. + * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border. + * + * \note You can't change the border state of a fullscreen window. + * + * \sa SDL_GetWindowFlags() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window, + SDL_bool bordered); + +/** + * \brief Show a window. + * + * \sa SDL_HideWindow() + */ +extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window); + +/** + * \brief Hide a window. + * + * \sa SDL_ShowWindow() + */ +extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window); + +/** + * \brief Raise a window above other windows and set the input focus. + */ +extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window); + +/** + * \brief Make a window as large as possible. + * + * \sa SDL_RestoreWindow() + */ +extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window); + +/** + * \brief Minimize a window to an iconic representation. + * + * \sa SDL_RestoreWindow() + */ +extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window); + +/** + * \brief Restore the size and position of a minimized or maximized window. + * + * \sa SDL_MaximizeWindow() + * \sa SDL_MinimizeWindow() + */ +extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window); + +/** + * \brief Set a window's fullscreen state. + * + * \return 0 on success, or -1 if setting the display mode failed. + * + * \sa SDL_SetWindowDisplayMode() + * \sa SDL_GetWindowDisplayMode() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, + Uint32 flags); + +/** + * \brief Get the SDL surface associated with the window. + * + * \return The window's framebuffer surface, or NULL on error. + * + * A new surface will be created with the optimal format for the window, + * if necessary. This surface will be freed when the window is destroyed. + * + * \note You may not combine this with 3D or the rendering API on this window. + * + * \sa SDL_UpdateWindowSurface() + * \sa SDL_UpdateWindowSurfaceRects() + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window); + +/** + * \brief Copy the window surface to the screen. + * + * \return 0 on success, or -1 on error. + * + * \sa SDL_GetWindowSurface() + * \sa SDL_UpdateWindowSurfaceRects() + */ +extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); + +/** + * \brief Copy a number of rectangles on the window surface to the screen. + * + * \return 0 on success, or -1 on error. + * + * \sa SDL_GetWindowSurface() + * \sa SDL_UpdateWindowSurfaceRect() + */ +extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, + const SDL_Rect * rects, + int numrects); + +/** + * \brief Set a window's input grab mode. + * + * \param window The window for which the input grab mode should be set. + * \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input. + * + * If the caller enables a grab while another window is currently grabbed, + * the other window loses its grab in favor of the caller's window. + * + * \sa SDL_GetWindowGrab() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window, + SDL_bool grabbed); + +/** + * \brief Get a window's input grab mode. + * + * \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise. + * + * \sa SDL_SetWindowGrab() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window); + +/** + * \brief Get the window that currently has an input grab enabled. + * + * \return This returns the window if input is grabbed, and NULL otherwise. + * + * \sa SDL_SetWindowGrab() + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void); + +/** + * \brief Set the brightness (gamma correction) for a window. + * + * \return 0 on success, or -1 if setting the brightness isn't supported. + * + * \sa SDL_GetWindowBrightness() + * \sa SDL_SetWindowGammaRamp() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness); + +/** + * \brief Get the brightness (gamma correction) for a window. + * + * \return The last brightness value passed to SDL_SetWindowBrightness() + * + * \sa SDL_SetWindowBrightness() + */ +extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window); + +/** + * \brief Set the gamma ramp for a window. + * + * \param window The window for which the gamma ramp should be set. + * \param red The translation table for the red channel, or NULL. + * \param green The translation table for the green channel, or NULL. + * \param blue The translation table for the blue channel, or NULL. + * + * \return 0 on success, or -1 if gamma ramps are unsupported. + * + * Set the gamma translation table for the red, green, and blue channels + * of the video hardware. Each table is an array of 256 16-bit quantities, + * representing a mapping between the input and output for that channel. + * The input is the index into the array, and the output is the 16-bit + * gamma value at that index, scaled to the output color precision. + * + * \sa SDL_GetWindowGammaRamp() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window, + const Uint16 * red, + const Uint16 * green, + const Uint16 * blue); + +/** + * \brief Get the gamma ramp for a window. + * + * \param window The window from which the gamma ramp should be queried. + * \param red A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the red channel, or NULL. + * \param green A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the green channel, or NULL. + * \param blue A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the blue channel, or NULL. + * + * \return 0 on success, or -1 if gamma ramps are unsupported. + * + * \sa SDL_SetWindowGammaRamp() + */ +extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window, + Uint16 * red, + Uint16 * green, + Uint16 * blue); + +/** + * \brief Possible return values from the SDL_HitTest callback. + * + * \sa SDL_HitTest + */ +typedef enum +{ + SDL_HITTEST_NORMAL, /**< Region is normal. No special properties. */ + SDL_HITTEST_DRAGGABLE, /**< Region can drag entire window. */ + SDL_HITTEST_RESIZE_TOPLEFT, + SDL_HITTEST_RESIZE_TOP, + SDL_HITTEST_RESIZE_TOPRIGHT, + SDL_HITTEST_RESIZE_RIGHT, + SDL_HITTEST_RESIZE_BOTTOMRIGHT, + SDL_HITTEST_RESIZE_BOTTOM, + SDL_HITTEST_RESIZE_BOTTOMLEFT, + SDL_HITTEST_RESIZE_LEFT +} SDL_HitTestResult; + +/** + * \brief Callback used for hit-testing. + * + * \sa SDL_SetWindowHitTest + */ +typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win, + const SDL_Point *area, + void *data); + +/** + * \brief Provide a callback that decides if a window region has special properties. + * + * Normally windows are dragged and resized by decorations provided by the + * system window manager (a title bar, borders, etc), but for some apps, it + * makes sense to drag them from somewhere else inside the window itself; for + * example, one might have a borderless window that wants to be draggable + * from any part, or simulate its own title bar, etc. + * + * This function lets the app provide a callback that designates pieces of + * a given window as special. This callback is run during event processing + * if we need to tell the OS to treat a region of the window specially; the + * use of this callback is known as "hit testing." + * + * Mouse input may not be delivered to your application if it is within + * a special area; the OS will often apply that input to moving the window or + * resizing the window and not deliver it to the application. + * + * Specifying NULL for a callback disables hit-testing. Hit-testing is + * disabled by default. + * + * Platforms that don't support this functionality will return -1 + * unconditionally, even if you're attempting to disable hit-testing. + * + * Your callback may fire at any time, and its firing does not indicate any + * specific behavior (for example, on Windows, this certainly might fire + * when the OS is deciding whether to drag your window, but it fires for lots + * of other reasons, too, some unrelated to anything you probably care about + * _and when the mouse isn't actually at the location it is testing_). + * Since this can fire at any time, you should try to keep your callback + * efficient, devoid of allocations, etc. + * + * \param window The window to set hit-testing on. + * \param callback The callback to call when doing a hit-test. + * \param callback_data An app-defined void pointer passed to the callback. + * \return 0 on success, -1 on error (including unsupported). + */ +extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window * window, + SDL_HitTest callback, + void *callback_data); + +/** + * \brief Destroy a window. + */ +extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window); + + +/** + * \brief Returns whether the screensaver is currently enabled (default on). + * + * \sa SDL_EnableScreenSaver() + * \sa SDL_DisableScreenSaver() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void); + +/** + * \brief Allow the screen to be blanked by a screensaver + * + * \sa SDL_IsScreenSaverEnabled() + * \sa SDL_DisableScreenSaver() + */ +extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); + +/** + * \brief Prevent the screen from being blanked by a screensaver + * + * \sa SDL_IsScreenSaverEnabled() + * \sa SDL_EnableScreenSaver() + */ +extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); + + +/** + * \name OpenGL support functions + */ +/* @{ */ + +/** + * \brief Dynamically load an OpenGL library. + * + * \param path The platform dependent OpenGL library name, or NULL to open the + * default OpenGL library. + * + * \return 0 on success, or -1 if the library couldn't be loaded. + * + * This should be done after initializing the video driver, but before + * creating any OpenGL windows. If no OpenGL library is loaded, the default + * library will be loaded upon creation of the first OpenGL window. + * + * \note If you do this, you need to retrieve all of the GL functions used in + * your program from the dynamic library using SDL_GL_GetProcAddress(). + * + * \sa SDL_GL_GetProcAddress() + * \sa SDL_GL_UnloadLibrary() + */ +extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); + +/** + * \brief Get the address of an OpenGL function. + */ +extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); + +/** + * \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). + * + * \sa SDL_GL_LoadLibrary() + */ +extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); + +/** + * \brief Return true if an OpenGL extension is supported for the current + * context. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char + *extension); + +/** + * \brief Reset all previously set OpenGL context attributes to their default values + */ +extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void); + +/** + * \brief Set an OpenGL window attribute before window creation. + */ +extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); + +/** + * \brief Get the actual value for an attribute from the current context. + */ +extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); + +/** + * \brief Create an OpenGL context for use with an OpenGL window, and make it + * current. + * + * \sa SDL_GL_DeleteContext() + */ +extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window * + window); + +/** + * \brief Set up an OpenGL context for rendering into an OpenGL window. + * + * \note The context must have been created with a compatible window. + */ +extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window, + SDL_GLContext context); + +/** + * \brief Get the currently active OpenGL window. + */ +extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void); + +/** + * \brief Get the currently active OpenGL context. + */ +extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void); + +/** + * \brief Get the size of a window's underlying drawable in pixels (for use + * with glViewport). + * + * \param window Window from which the drawable size should be queried + * \param w Pointer to variable for storing the width in pixels, may be NULL + * \param h Pointer to variable for storing the height in pixels, may be NULL + * + * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI + * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a + * platform with high-DPI support (Apple calls this "Retina"), and not disabled + * by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint. + * + * \sa SDL_GetWindowSize() + * \sa SDL_CreateWindow() + */ +extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w, + int *h); + +/** + * \brief Set the swap interval for the current OpenGL context. + * + * \param interval 0 for immediate updates, 1 for updates synchronized with the + * vertical retrace. If the system supports it, you may + * specify -1 to allow late swaps to happen immediately + * instead of waiting for the next retrace. + * + * \return 0 on success, or -1 if setting the swap interval is not supported. + * + * \sa SDL_GL_GetSwapInterval() + */ +extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval); + +/** + * \brief Get the swap interval for the current OpenGL context. + * + * \return 0 if there is no vertical retrace synchronization, 1 if the buffer + * swap is synchronized with the vertical retrace, and -1 if late + * swaps happen immediately instead of waiting for the next retrace. + * If the system can't determine the swap interval, or there isn't a + * valid current context, this will return 0 as a safe default. + * + * \sa SDL_GL_SetSwapInterval() + */ +extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); + +/** + * \brief Swap the OpenGL buffers for a window, if double-buffering is + * supported. + */ +extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window); + +/** + * \brief Delete an OpenGL context. + * + * \sa SDL_GL_CreateContext() + */ +extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); + +/* @} *//* OpenGL support functions */ + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/Src/Decoder_H264_ALL/include/SDL/begin_code.h b/Src/Decoder_H264_ALL/include/SDL/begin_code.h new file mode 100644 index 0000000..04e78c6 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/begin_code.h @@ -0,0 +1,146 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file begin_code.h + * + * This file sets things up for C dynamic library function definitions, + * static inlined functions, and structures aligned at 4-byte alignment. + * If you don't like ugly C preprocessor code, don't look at this file. :) + */ + +/* This shouldn't be nested -- included it around code only. */ +#ifdef _begin_code_h +#error Nested inclusion of begin_code.h +#endif +#define _begin_code_h + +#ifndef SDL_DEPRECATED +# if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ +# define SDL_DEPRECATED __attribute__((deprecated)) +# else +# define SDL_DEPRECATED +# endif +#endif + +#ifndef SDL_UNUSED +# ifdef __GNUC__ +# define SDL_UNUSED __attribute__((unused)) +# else +# define SDL_UNUSED +# endif +#endif + +/* Some compilers use a special export keyword */ +#ifndef DECLSPEC +# if defined(__WIN32__) || defined(__WINRT__) +# ifdef __BORLANDC__ +# ifdef BUILD_SDL +# define DECLSPEC +# else +# define DECLSPEC __declspec(dllimport) +# endif +# else +# define DECLSPEC __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && __GNUC__ >= 4 +# define DECLSPEC __attribute__ ((visibility("default"))) +# else +# define DECLSPEC +# endif +# endif +#endif + +/* By default SDL uses the C calling convention */ +#ifndef SDLCALL +#if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__) +#define SDLCALL __cdecl +#else +#define SDLCALL +#endif +#endif /* SDLCALL */ + +/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */ +#ifdef __SYMBIAN32__ +#undef DECLSPEC +#define DECLSPEC +#endif /* __SYMBIAN32__ */ + +/* Force structure packing at 4 byte alignment. + This is necessary if the header is included in code which has structure + packing set to an alternate value, say for loading structures from disk. + The packing is reset to the previous value in close_code.h + */ +#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) +#ifdef _MSC_VER +#pragma warning(disable: 4103) +#endif +#ifdef __BORLANDC__ +#pragma nopackwarning +#endif +#ifdef _M_X64 +/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ +#pragma pack(push,8) +#else +#pragma pack(push,4) +#endif +#endif /* Compiler needs structure packing set */ + +#ifndef SDL_INLINE +#if defined(__GNUC__) +#define SDL_INLINE __inline__ +#elif defined(_MSC_VER) || defined(__BORLANDC__) || \ + defined(__DMC__) || defined(__SC__) || \ + defined(__WATCOMC__) || defined(__LCC__) || \ + defined(__DECC) +#define SDL_INLINE __inline +#ifndef __inline__ +#define __inline__ __inline +#endif +#else +#define SDL_INLINE inline +#ifndef __inline__ +#define __inline__ inline +#endif +#endif +#endif /* SDL_INLINE not defined */ + +#ifndef SDL_FORCE_INLINE +#if defined(_MSC_VER) +#define SDL_FORCE_INLINE __forceinline +#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) ) +#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__ +#else +#define SDL_FORCE_INLINE static SDL_INLINE +#endif +#endif /* SDL_FORCE_INLINE not defined */ + +/* Apparently this is needed by several Windows compilers */ +#if !defined(__MACH__) +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif /* NULL */ +#endif /* ! Mac OS X - breaks precompiled headers */ diff --git a/Src/Decoder_H264_ALL/include/SDL/close_code.h b/Src/Decoder_H264_ALL/include/SDL/close_code.h new file mode 100644 index 0000000..d908b00 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SDL/close_code.h @@ -0,0 +1,37 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2016 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file close_code.h + * + * This file reverses the effects of begin_code.h and should be included + * after you finish any function and structure declarations in your headers + */ + +#undef _begin_code_h + +/* Reset structure packing at previous byte alignment */ +#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) +#ifdef __BORLANDC__ +#pragma nopackwarning +#endif +#pragma pack(pop) +#endif /* Compiler needs structure packing set */ diff --git a/Src/Decoder_H264_ALL/include/SShellNotifyIcon.cpp b/Src/Decoder_H264_ALL/include/SShellNotifyIcon.cpp new file mode 100644 index 0000000..f927271 Binary files /dev/null and b/Src/Decoder_H264_ALL/include/SShellNotifyIcon.cpp differ diff --git a/Src/Decoder_H264_ALL/include/SShellNotifyIcon.h b/Src/Decoder_H264_ALL/include/SShellNotifyIcon.h new file mode 100644 index 0000000..a551d4d Binary files /dev/null and b/Src/Decoder_H264_ALL/include/SShellNotifyIcon.h differ diff --git a/Src/Decoder_H264_ALL/include/SouiRealWndHandler.cpp b/Src/Decoder_H264_ALL/include/SouiRealWndHandler.cpp new file mode 100644 index 0000000..decfd38 Binary files /dev/null and b/Src/Decoder_H264_ALL/include/SouiRealWndHandler.cpp differ diff --git a/Src/Decoder_H264_ALL/include/SouiRealWndHandler.h b/Src/Decoder_H264_ALL/include/SouiRealWndHandler.h new file mode 100644 index 0000000..400e036 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/SouiRealWndHandler.h @@ -0,0 +1,50 @@ +#pragma once + +#include + +namespace SOUI +{ + class CSouiRealWndHandler :public TObjRefImpl2 + { + public: + CSouiRealWndHandler(void); + ~CSouiRealWndHandler(void); + + /** + * SRealWnd::OnRealWndCreate + * @brief 创建真窗口 + * @param SRealWnd * pRealWnd -- 窗口指针 + * @return HWND -- 创建出来的真窗口句柄 + * Describe + */ + virtual HWND OnRealWndCreate(SRealWnd *pRealWnd); + + /** + * SRealWnd::OnRealWndDestroy + * @brief 销毁窗口 + * @param SRealWnd *pRealWnd -- 窗口指针 + * + * Describe 销毁窗口 + */ + virtual void OnRealWndDestroy(SRealWnd *pRealWnd); + + /** + * SRealWnd::OnRealWndInit + * @brief 初始化窗口 + * @param SRealWnd *pRealWnd -- 窗口指针 + * + * Describe 初始化窗口 + */ + virtual BOOL OnRealWndInit(SRealWnd *pRealWnd); + + /** + * SRealWnd::OnRealWndSize + * @brief 调整窗口大小 + * @param SRealWnd *pRealWnd -- 窗口指针 + * @return BOOL -- TRUE:用户管理窗口的移动;FALSE:交由SOUI自己管理。 + * Describe 调整窗口大小, 从pRealWnd中获得窗口位置。 + */ + virtual BOOL OnRealWndSize(SRealWnd *pRealWnd); + }; + +} diff --git a/Src/Decoder_H264_ALL/include/_mingw.h b/Src/Decoder_H264_ALL/include/_mingw.h new file mode 100644 index 0000000..a89bdf8 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/_mingw.h @@ -0,0 +1,288 @@ +#ifndef __MINGW_H +/* + * _mingw.h + * + * Mingw specific macros included by ALL include files. + * + * This file is part of the Mingw32 package. + * + * Contributors: + * Created by Mumit Khan + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ +#define __MINGW_H + +#define __MINGW32_VERSION 3.20 +#define __MINGW32_MAJOR_VERSION 3 +#define __MINGW32_MINOR_VERSION 20 +#define __MINGW32_PATCHLEVEL 0 + +#if __GNUC__ >= 3 +#ifndef __PCC__ +#pragma GCC system_header +#endif +#endif + +/* These are defined by the user (or the compiler) + to specify how identifiers are imported from a DLL. + + __DECLSPEC_SUPPORTED Defined if dllimport attribute is supported. + __MINGW_IMPORT The attribute definition to specify imported + variables/functions. + _CRTIMP As above. For MS compatibility. + __MINGW32_VERSION Runtime version. + __MINGW32_MAJOR_VERSION Runtime major version. + __MINGW32_MINOR_VERSION Runtime minor version. + __MINGW32_BUILD_DATE Runtime build date. + + Macros to enable MinGW features which deviate from standard MSVC + compatible behaviour; these may be specified directly in user code, + activated implicitly, (e.g. by specifying _POSIX_C_SOURCE or such), + or by inclusion in __MINGW_FEATURES__: + + __USE_MINGW_ANSI_STDIO Select a more ANSI C99 compatible + implementation of printf() and friends. + + Other macros: + + __int64 define to be long long. Using a typedef + doesn't work for "unsigned __int64" + + All headers should include this first, and then use __DECLSPEC_SUPPORTED + to choose between the old ``__imp__name'' style or __MINGW_IMPORT + style declarations. */ + + +/* Manifest definitions identifying the flag bits, controlling activation + * of MinGW features, as specified by the user in __MINGW_FEATURES__. + */ +#define __MINGW_ANSI_STDIO__ 0x0000000000000001ULL +/* + * The following three are not yet formally supported; they are + * included here, to document anticipated future usage. + */ +#define __MINGW_LC_EXTENSIONS__ 0x0000000000000050ULL +#define __MINGW_LC_MESSAGES__ 0x0000000000000010ULL +#define __MINGW_LC_ENVVARS__ 0x0000000000000040ULL + +/* Try to avoid problems with outdated checks for GCC __attribute__ support. */ +#undef __attribute__ + +#if defined (__PCC__) +# undef __DECLSPEC_SUPPORTED +# ifndef __MINGW_IMPORT +# define __MINGW_IMPORT extern +# endif +# ifndef _CRTIMP +# define _CRTIMP +# endif +# ifndef __cdecl +# define __cdecl _Pragma("cdecl") +# endif +# ifndef __stdcall +# define __stdcall _Pragma("stdcall") +# endif +# ifndef __int64 +# define __int64 long long +# endif +# ifndef __int32 +# define __int32 long +# endif +# ifndef __int16 +# define __int16 short +# endif +# ifndef __int8 +# define __int8 char +# endif +# ifndef __small +# define __small char +# endif +# ifndef __hyper +# define __hyper long long +# endif +# ifndef __volatile__ +# define __volatile__ volatile +# endif +# ifndef __restrict__ +# define __restrict__ restrict +# endif +# define NONAMELESSUNION +#elif defined(__GNUC__) +# ifdef __declspec +# ifndef __MINGW_IMPORT + /* Note the extern. This is needed to work around GCC's + limitations in handling dllimport attribute. */ +# define __MINGW_IMPORT extern __attribute__ ((__dllimport__)) +# endif +# ifndef _CRTIMP +# ifdef __USE_CRTIMP +# define _CRTIMP __attribute__ ((dllimport)) +# else +# define _CRTIMP +# endif +# endif +# define __DECLSPEC_SUPPORTED +# else /* __declspec */ +# undef __DECLSPEC_SUPPORTED +# undef __MINGW_IMPORT +# ifndef _CRTIMP +# define _CRTIMP +# endif +# endif /* __declspec */ +/* + * The next two defines can cause problems if user code adds the + * __cdecl attribute like so: + * void __attribute__ ((__cdecl)) foo(void); + */ +# ifndef __cdecl +# define __cdecl __attribute__ ((__cdecl__)) +# endif +# ifndef __stdcall +# define __stdcall __attribute__ ((__stdcall__)) +# endif +# ifndef __int64 +# define __int64 long long +# endif +# ifndef __int32 +# define __int32 long +# endif +# ifndef __int16 +# define __int16 short +# endif +# ifndef __int8 +# define __int8 char +# endif +# ifndef __small +# define __small char +# endif +# ifndef __hyper +# define __hyper long long +# endif +#else /* ! __GNUC__ && ! __PCC__ */ +# ifndef __MINGW_IMPORT +# define __MINGW_IMPORT __declspec(dllimport) +# endif +# ifndef _CRTIMP +# define _CRTIMP __declspec(dllimport) +# endif +# define __DECLSPEC_SUPPORTED +# define __attribute__(x) /* nothing */ +#endif + +#if defined (__GNUC__) && defined (__GNUC_MINOR__) +#define __MINGW_GNUC_PREREQ(major, minor) \ + (__GNUC__ > (major) \ + || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) +#else +#define __MINGW_GNUC_PREREQ(major, minor) 0 +#endif + +#ifdef __cplusplus +# define __CRT_INLINE inline +#else +# if __GNUC_STDC_INLINE__ +# define __CRT_INLINE extern inline __attribute__((__gnu_inline__)) +# else +# define __CRT_INLINE extern __inline__ +# endif +#endif + +# ifdef __GNUC__ +# define _CRTALIAS __CRT_INLINE __attribute__ ((__always_inline__)) +# else +# define _CRTALIAS __CRT_INLINE +# endif + +#ifdef __cplusplus +# define __UNUSED_PARAM(x) +#else +# ifdef __GNUC__ +# define __UNUSED_PARAM(x) x __attribute__ ((__unused__)) +# else +# define __UNUSED_PARAM(x) x +# endif +#endif + +#ifdef __GNUC__ +#define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__)) +#define __MINGW_ATTRIB_CONST __attribute__ ((__const__)) +#else +#define __MINGW_ATTRIB_NORETURN +#define __MINGW_ATTRIB_CONST +#endif + +#if __MINGW_GNUC_PREREQ (3, 0) +#define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__)) +#define __MINGW_ATTRIB_PURE __attribute__ ((__pure__)) +#else +#define __MINGW_ATTRIB_MALLOC +#define __MINGW_ATTRIB_PURE +#endif + +/* Attribute `nonnull' was valid as of gcc 3.3. We don't use GCC's + variadiac macro facility, because variadic macros cause syntax + errors with --traditional-cpp. */ +#if __MINGW_GNUC_PREREQ (3, 3) +#define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg))) +#else +#define __MINGW_ATTRIB_NONNULL(arg) +#endif /* GNUC >= 3.3 */ + +#if __MINGW_GNUC_PREREQ (3, 1) +#define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__)) +#else +#define __MINGW_ATTRIB_DEPRECATED +#endif /* GNUC >= 3.1 */ + +#if __MINGW_GNUC_PREREQ (3, 3) +#define __MINGW_NOTHROW __attribute__ ((__nothrow__)) +#else +#define __MINGW_NOTHROW +#endif /* GNUC >= 3.3 */ + + +/* TODO: Mark (almost) all CRT functions as __MINGW_NOTHROW. This will +allow GCC to optimize away some EH unwind code, at least in DW2 case. */ + +#ifndef __MSVCRT_VERSION__ +/* High byte is the major version, low byte is the minor. */ +# define __MSVCRT_VERSION__ 0x0600 +#endif + +/* Activation of MinGW specific extended features: + */ +#ifndef __USE_MINGW_ANSI_STDIO +/* + * If user didn't specify it explicitly... + */ +# if defined __STRICT_ANSI__ || defined _ISOC99_SOURCE \ + || defined _POSIX_SOURCE || defined _POSIX_C_SOURCE \ + || defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED \ + || defined _GNU_SOURCE || defined _BSD_SOURCE \ + || defined _SVID_SOURCE + /* + * but where any of these source code qualifiers are specified, + * then assume ANSI I/O standards are preferred over Microsoft's... + */ +# define __USE_MINGW_ANSI_STDIO 1 +# else + /* + * otherwise use whatever __MINGW_FEATURES__ specifies... + */ +# define __USE_MINGW_ANSI_STDIO (__MINGW_FEATURES__ & __MINGW_ANSI_STDIO__) +# endif +#endif +//解决inttypes.h有问题的错误 +#define __restrict__ + +#endif /* __MINGW_H */ diff --git a/Src/Decoder_H264_ALL/include/inttypes.h b/Src/Decoder_H264_ALL/include/inttypes.h new file mode 100644 index 0000000..57db989 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/inttypes.h @@ -0,0 +1,206 @@ +/* ISO C9x 7.18 Integer types + * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794) + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * Contributor: Danny Smith + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Date: 2000-12-02 + */ + + +#ifndef _STDINT_H +#define _STDINT_H +#define __need_wint_t +#define __need_wchar_t +#include + +/* 7.18.1.1 Exact-width integer types */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; +typedef unsigned short uint16_t; +typedef int int32_t; +typedef unsigned uint32_t; +typedef long long int64_t; +typedef unsigned long long uint64_t; + +/* 7.18.1.2 Minimum-width integer types */ +typedef signed char int_least8_t; +typedef unsigned char uint_least8_t; +typedef short int_least16_t; +typedef unsigned short uint_least16_t; +typedef int int_least32_t; +typedef unsigned uint_least32_t; +typedef long long int_least64_t; +typedef unsigned long long uint_least64_t; + +/* 7.18.1.3 Fastest minimum-width integer types + * Not actually guaranteed to be fastest for all purposes + * Here we use the exact-width types for 8 and 16-bit ints. + */ +typedef char int_fast8_t; +typedef unsigned char uint_fast8_t; +typedef short int_fast16_t; +typedef unsigned short uint_fast16_t; +typedef int int_fast32_t; +typedef unsigned int uint_fast32_t; +typedef long long int_fast64_t; +typedef unsigned long long uint_fast64_t; + +/* 7.18.1.4 Integer types capable of holding object pointers */ + +#ifndef _INTPTR_T_DEFINED +#define _INTPTR_T_DEFINED +#ifdef _WIN64 + typedef __int64 intptr_t; +#else + typedef int intptr_t; +#endif +#endif + +#ifndef _UINTPTR_T_DEFINED +#define _UINTPTR_T_DEFINED +#ifdef _WIN64 + typedef unsigned __int64 uintptr_t; +#else + typedef unsigned int uintptr_t; +#endif +#endif + +/* 7.18.1.5 Greatest-width integer types */ +typedef long long intmax_t; +typedef unsigned long long uintmax_t; + +/* 7.18.2 Limits of specified-width integer types */ +#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS) + +/* 7.18.2.1 Limits of exact-width integer types */ +#define INT8_MIN (-128) +#define INT16_MIN (-32768) +#define INT32_MIN (-2147483647 - 1) +#define INT64_MIN (-9223372036854775807LL - 1) + +#define INT8_MAX 127 +#define INT16_MAX 32767 +#define INT32_MAX 2147483647 +#define INT64_MAX 9223372036854775807LL + +#define UINT8_MAX 0xff /* 255U */ +#define UINT16_MAX 0xffff /* 65535U */ +#define UINT32_MAX 0xffffffff /* 4294967295U */ +#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */ + +/* 7.18.2.2 Limits of minimum-width integer types */ +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST64_MIN INT64_MIN + +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MAX INT64_MAX + +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +/* 7.18.2.3 Limits of fastest minimum-width integer types */ +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST64_MIN INT64_MIN + +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MAX INT64_MAX + +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +/* 7.18.2.4 Limits of integer types capable of holding + object pointers */ +#ifdef _WIN64 +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX +#else +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX +#endif + +/* 7.18.2.5 Limits of greatest-width integer types */ +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +/* 7.18.3 Limits of other integer types */ +#define PTRDIFF_MIN INTPTR_MIN +#define PTRDIFF_MAX INTPTR_MAX + +#define SIG_ATOMIC_MIN INTPTR_MIN +#define SIG_ATOMIC_MAX INTPTR_MAX + +#define SIZE_MAX UINTPTR_MAX + +#ifndef WCHAR_MIN /* also in wchar.h */ +#define WCHAR_MIN 0 +#define WCHAR_MAX 0xffff /* UINT16_MAX */ +#endif + +/* + * wint_t is unsigned short for compatibility with MS runtime + */ +#define WINT_MIN 0 +#define WINT_MAX 0xffff /* UINT16_MAX */ + +#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */ + + +/* 7.18.4 Macros for integer constants */ +#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS) + +/* 7.18.4.1 Macros for minimum-width integer constants + + Accoding to Douglas Gwyn : + "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC + 9899:1999 as initially published, the expansion was required + to be an integer constant of precisely matching type, which + is impossible to accomplish for the shorter types on most + platforms, because C99 provides no standard way to designate + an integer constant with width less than that of type int. + TC1 changed this to require just an integer constant + *expression* with *promoted* type." +*/ + +#define INT8_C(val) ((int8_t) + (val)) +#define UINT8_C(val) ((uint8_t) + (val##U)) +#define INT16_C(val) ((int16_t) + (val)) +#define UINT16_C(val) ((uint16_t) + (val##U)) + +#define INT32_C(val) val##L +#define UINT32_C(val) val##UL +#define INT64_C(val) val##LL +#define UINT64_C(val) val##ULL + +/* 7.18.4.2 Macros for greatest-width integer constants */ +#define INTMAX_C(val) INT64_C(val) +#define UINTMAX_C(val) UINT64_C(val) + +#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */ + +#endif diff --git a/Src/Decoder_H264_ALL/include/libavcodec/avcodec.h b/Src/Decoder_H264_ALL/include/libavcodec/avcodec.h new file mode 100644 index 0000000..e52b2f8 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/avcodec.h @@ -0,0 +1,6110 @@ +/* + * copyright (c) 2001 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_AVCODEC_H +#define AVCODEC_AVCODEC_H + +/** + * @file + * @ingroup libavc + * Libavcodec external API header + */ + +#include +#include "libavutil/samplefmt.h" +#include "libavutil/attributes.h" +#include "libavutil/avutil.h" +#include "libavutil/buffer.h" +#include "libavutil/cpu.h" +#include "libavutil/channel_layout.h" +#include "libavutil/dict.h" +#include "libavutil/frame.h" +#include "libavutil/log.h" +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" + +#include "version.h" + +/** + * @defgroup libavc Encoding/Decoding Library + * @{ + * + * @defgroup lavc_decoding Decoding + * @{ + * @} + * + * @defgroup lavc_encoding Encoding + * @{ + * @} + * + * @defgroup lavc_codec Codecs + * @{ + * @defgroup lavc_codec_native Native Codecs + * @{ + * @} + * @defgroup lavc_codec_wrappers External library wrappers + * @{ + * @} + * @defgroup lavc_codec_hwaccel Hardware Accelerators bridge + * @{ + * @} + * @} + * @defgroup lavc_internal Internal + * @{ + * @} + * @} + */ + +/** + * @ingroup libavc + * @defgroup lavc_encdec send/receive encoding and decoding API overview + * @{ + * + * The avcodec_send_packet()/avcodec_receive_frame()/avcodec_send_frame()/ + * avcodec_receive_packet() functions provide an encode/decode API, which + * decouples input and output. + * + * The API is very similar for encoding/decoding and audio/video, and works as + * follows: + * - Set up and open the AVCodecContext as usual. + * - Send valid input: + * - For decoding, call avcodec_send_packet() to give the decoder raw + * compressed data in an AVPacket. + * - For encoding, call avcodec_send_frame() to give the decoder an AVFrame + * containing uncompressed audio or video. + * In both cases, it is recommended that AVPackets and AVFrames are + * refcounted, or libavcodec might have to copy the input data. (libavformat + * always returns refcounted AVPackets, and av_frame_get_buffer() allocates + * refcounted AVFrames.) + * - Receive output in a loop. Periodically call one of the avcodec_receive_*() + * functions and process their output: + * - For decoding, call avcodec_receive_frame(). On success, it will return + * an AVFrame containing uncompressed audio or video data. + * - For encoding, call avcodec_receive_packet(). On success, it will return + * an AVPacket with a compressed frame. + * Repeat this call until it returns AVERROR(EAGAIN) or an error. The + * AVERROR(EAGAIN) return value means that new input data is required to + * return new output. In this case, continue with sending input. For each + * input frame/packet, the codec will typically return 1 output frame/packet, + * but it can also be 0 or more than 1. + * + * At the beginning of decoding or encoding, the codec might accept multiple + * input frames/packets without returning a frame, until its internal buffers + * are filled. This situation is handled transparently if you follow the steps + * outlined above. + * + * End of stream situations. These require "flushing" (aka draining) the codec, + * as the codec might buffer multiple frames or packets internally for + * performance or out of necessity (consider B-frames). + * This is handled as follows: + * - Instead of valid input, send NULL to the avcodec_send_packet() (decoding) + * or avcodec_send_frame() (encoding) functions. This will enter draining + * mode. + * - Call avcodec_receive_frame() (decoding) or avcodec_receive_packet() + * (encoding) in a loop until AVERROR_EOF is returned. The functions will + * not return AVERROR(EAGAIN), unless you forgot to enter draining mode. + * - Before decoding can be resumed again, the codec has to be reset with + * avcodec_flush_buffers(). + * + * Using the API as outlined above is highly recommended. But it is also + * possible to call functions outside of this rigid schema. For example, you can + * call avcodec_send_packet() repeatedly without calling + * avcodec_receive_frame(). In this case, avcodec_send_packet() will succeed + * until the codec's internal buffer has been filled up (which is typically of + * size 1 per output frame, after initial input), and then reject input with + * AVERROR(EAGAIN). Once it starts rejecting input, you have no choice but to + * read at least some output. + * + * Not all codecs will follow a rigid and predictable dataflow; the only + * guarantee is that an AVERROR(EAGAIN) return value on a send/receive call on + * one end implies that a receive/send call on the other end will succeed. In + * general, no codec will permit unlimited buffering of input or output. + * + * This API replaces the following legacy functions: + * - avcodec_decode_video2() and avcodec_decode_audio4(): + * Use avcodec_send_packet() to feed input to the decoder, then use + * avcodec_receive_frame() to receive decoded frames after each packet. + * Unlike with the old video decoding API, multiple frames might result from + * a packet. For audio, splitting the input packet into frames by partially + * decoding packets becomes transparent to the API user. You never need to + * feed an AVPacket to the API twice. + * Additionally, sending a flush/draining packet is required only once. + * - avcodec_encode_video2()/avcodec_encode_audio2(): + * Use avcodec_send_frame() to feed input to the encoder, then use + * avcodec_receive_packet() to receive encoded packets. + * Providing user-allocated buffers for avcodec_receive_packet() is not + * possible. + * - The new API does not handle subtitles yet. + * + * Mixing new and old function calls on the same AVCodecContext is not allowed, + * and will result in undefined behavior. + * + * Some codecs might require using the new API; using the old API will return + * an error when calling it. + * @} + */ + +/** + * @defgroup lavc_core Core functions/structures. + * @ingroup libavc + * + * Basic definitions, functions for querying libavcodec capabilities, + * allocating core structures, etc. + * @{ + */ + + +/** + * Identify the syntax and semantics of the bitstream. + * The principle is roughly: + * Two decoders with the same ID can decode the same streams. + * Two encoders with the same ID can encode compatible streams. + * There may be slight deviations from the principle due to implementation + * details. + * + * If you add a codec ID to this list, add it so that + * 1. no value of an existing codec ID changes (that would break ABI), + * 2. it is as close as possible to similar codecs + * + * After adding new codec IDs, do not forget to add an entry to the codec + * descriptor list and bump libavcodec minor version. + */ +enum AVCodecID { + AV_CODEC_ID_NONE, + + /* video codecs */ + AV_CODEC_ID_MPEG1VIDEO, + AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding +#if FF_API_XVMC + AV_CODEC_ID_MPEG2VIDEO_XVMC, +#endif /* FF_API_XVMC */ + AV_CODEC_ID_H261, + AV_CODEC_ID_H263, + AV_CODEC_ID_RV10, + AV_CODEC_ID_RV20, + AV_CODEC_ID_MJPEG, + AV_CODEC_ID_MJPEGB, + AV_CODEC_ID_LJPEG, + AV_CODEC_ID_SP5X, + AV_CODEC_ID_JPEGLS, + AV_CODEC_ID_MPEG4, + AV_CODEC_ID_RAWVIDEO, + AV_CODEC_ID_MSMPEG4V1, + AV_CODEC_ID_MSMPEG4V2, + AV_CODEC_ID_MSMPEG4V3, + AV_CODEC_ID_WMV1, + AV_CODEC_ID_WMV2, + AV_CODEC_ID_H263P, + AV_CODEC_ID_H263I, + AV_CODEC_ID_FLV1, + AV_CODEC_ID_SVQ1, + AV_CODEC_ID_SVQ3, + AV_CODEC_ID_DVVIDEO, + AV_CODEC_ID_HUFFYUV, + AV_CODEC_ID_CYUV, + AV_CODEC_ID_H264, + AV_CODEC_ID_INDEO3, + AV_CODEC_ID_VP3, + AV_CODEC_ID_THEORA, + AV_CODEC_ID_ASV1, + AV_CODEC_ID_ASV2, + AV_CODEC_ID_FFV1, + AV_CODEC_ID_4XM, + AV_CODEC_ID_VCR1, + AV_CODEC_ID_CLJR, + AV_CODEC_ID_MDEC, + AV_CODEC_ID_ROQ, + AV_CODEC_ID_INTERPLAY_VIDEO, + AV_CODEC_ID_XAN_WC3, + AV_CODEC_ID_XAN_WC4, + AV_CODEC_ID_RPZA, + AV_CODEC_ID_CINEPAK, + AV_CODEC_ID_WS_VQA, + AV_CODEC_ID_MSRLE, + AV_CODEC_ID_MSVIDEO1, + AV_CODEC_ID_IDCIN, + AV_CODEC_ID_8BPS, + AV_CODEC_ID_SMC, + AV_CODEC_ID_FLIC, + AV_CODEC_ID_TRUEMOTION1, + AV_CODEC_ID_VMDVIDEO, + AV_CODEC_ID_MSZH, + AV_CODEC_ID_ZLIB, + AV_CODEC_ID_QTRLE, + AV_CODEC_ID_TSCC, + AV_CODEC_ID_ULTI, + AV_CODEC_ID_QDRAW, + AV_CODEC_ID_VIXL, + AV_CODEC_ID_QPEG, + AV_CODEC_ID_PNG, + AV_CODEC_ID_PPM, + AV_CODEC_ID_PBM, + AV_CODEC_ID_PGM, + AV_CODEC_ID_PGMYUV, + AV_CODEC_ID_PAM, + AV_CODEC_ID_FFVHUFF, + AV_CODEC_ID_RV30, + AV_CODEC_ID_RV40, + AV_CODEC_ID_VC1, + AV_CODEC_ID_WMV3, + AV_CODEC_ID_LOCO, + AV_CODEC_ID_WNV1, + AV_CODEC_ID_AASC, + AV_CODEC_ID_INDEO2, + AV_CODEC_ID_FRAPS, + AV_CODEC_ID_TRUEMOTION2, + AV_CODEC_ID_BMP, + AV_CODEC_ID_CSCD, + AV_CODEC_ID_MMVIDEO, + AV_CODEC_ID_ZMBV, + AV_CODEC_ID_AVS, + AV_CODEC_ID_SMACKVIDEO, + AV_CODEC_ID_NUV, + AV_CODEC_ID_KMVC, + AV_CODEC_ID_FLASHSV, + AV_CODEC_ID_CAVS, + AV_CODEC_ID_JPEG2000, + AV_CODEC_ID_VMNC, + AV_CODEC_ID_VP5, + AV_CODEC_ID_VP6, + AV_CODEC_ID_VP6F, + AV_CODEC_ID_TARGA, + AV_CODEC_ID_DSICINVIDEO, + AV_CODEC_ID_TIERTEXSEQVIDEO, + AV_CODEC_ID_TIFF, + AV_CODEC_ID_GIF, + AV_CODEC_ID_DXA, + AV_CODEC_ID_DNXHD, + AV_CODEC_ID_THP, + AV_CODEC_ID_SGI, + AV_CODEC_ID_C93, + AV_CODEC_ID_BETHSOFTVID, + AV_CODEC_ID_PTX, + AV_CODEC_ID_TXD, + AV_CODEC_ID_VP6A, + AV_CODEC_ID_AMV, + AV_CODEC_ID_VB, + AV_CODEC_ID_PCX, + AV_CODEC_ID_SUNRAST, + AV_CODEC_ID_INDEO4, + AV_CODEC_ID_INDEO5, + AV_CODEC_ID_MIMIC, + AV_CODEC_ID_RL2, + AV_CODEC_ID_ESCAPE124, + AV_CODEC_ID_DIRAC, + AV_CODEC_ID_BFI, + AV_CODEC_ID_CMV, + AV_CODEC_ID_MOTIONPIXELS, + AV_CODEC_ID_TGV, + AV_CODEC_ID_TGQ, + AV_CODEC_ID_TQI, + AV_CODEC_ID_AURA, + AV_CODEC_ID_AURA2, + AV_CODEC_ID_V210X, + AV_CODEC_ID_TMV, + AV_CODEC_ID_V210, + AV_CODEC_ID_DPX, + AV_CODEC_ID_MAD, + AV_CODEC_ID_FRWU, + AV_CODEC_ID_FLASHSV2, + AV_CODEC_ID_CDGRAPHICS, + AV_CODEC_ID_R210, + AV_CODEC_ID_ANM, + AV_CODEC_ID_BINKVIDEO, + AV_CODEC_ID_IFF_ILBM, +#define AV_CODEC_ID_IFF_BYTERUN1 AV_CODEC_ID_IFF_ILBM + AV_CODEC_ID_KGV1, + AV_CODEC_ID_YOP, + AV_CODEC_ID_VP8, + AV_CODEC_ID_PICTOR, + AV_CODEC_ID_ANSI, + AV_CODEC_ID_A64_MULTI, + AV_CODEC_ID_A64_MULTI5, + AV_CODEC_ID_R10K, + AV_CODEC_ID_MXPEG, + AV_CODEC_ID_LAGARITH, + AV_CODEC_ID_PRORES, + AV_CODEC_ID_JV, + AV_CODEC_ID_DFA, + AV_CODEC_ID_WMV3IMAGE, + AV_CODEC_ID_VC1IMAGE, + AV_CODEC_ID_UTVIDEO, + AV_CODEC_ID_BMV_VIDEO, + AV_CODEC_ID_VBLE, + AV_CODEC_ID_DXTORY, + AV_CODEC_ID_V410, + AV_CODEC_ID_XWD, + AV_CODEC_ID_CDXL, + AV_CODEC_ID_XBM, + AV_CODEC_ID_ZEROCODEC, + AV_CODEC_ID_MSS1, + AV_CODEC_ID_MSA1, + AV_CODEC_ID_TSCC2, + AV_CODEC_ID_MTS2, + AV_CODEC_ID_CLLC, + AV_CODEC_ID_MSS2, + AV_CODEC_ID_VP9, + AV_CODEC_ID_AIC, + AV_CODEC_ID_ESCAPE130, + AV_CODEC_ID_G2M, + AV_CODEC_ID_WEBP, + AV_CODEC_ID_HNM4_VIDEO, + AV_CODEC_ID_HEVC, +#define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC + AV_CODEC_ID_FIC, + AV_CODEC_ID_ALIAS_PIX, + AV_CODEC_ID_BRENDER_PIX, + AV_CODEC_ID_PAF_VIDEO, + AV_CODEC_ID_EXR, + AV_CODEC_ID_VP7, + AV_CODEC_ID_SANM, + AV_CODEC_ID_SGIRLE, + AV_CODEC_ID_MVC1, + AV_CODEC_ID_MVC2, + AV_CODEC_ID_HQX, + AV_CODEC_ID_TDSC, + AV_CODEC_ID_HQ_HQA, + AV_CODEC_ID_HAP, + AV_CODEC_ID_DDS, + AV_CODEC_ID_DXV, + AV_CODEC_ID_SCREENPRESSO, + AV_CODEC_ID_RSCC, + + AV_CODEC_ID_Y41P = 0x8000, + AV_CODEC_ID_AVRP, + AV_CODEC_ID_012V, + AV_CODEC_ID_AVUI, + AV_CODEC_ID_AYUV, + AV_CODEC_ID_TARGA_Y216, + AV_CODEC_ID_V308, + AV_CODEC_ID_V408, + AV_CODEC_ID_YUV4, + AV_CODEC_ID_AVRN, + AV_CODEC_ID_CPIA, + AV_CODEC_ID_XFACE, + AV_CODEC_ID_SNOW, + AV_CODEC_ID_SMVJPEG, + AV_CODEC_ID_APNG, + AV_CODEC_ID_DAALA, + AV_CODEC_ID_CFHD, + AV_CODEC_ID_TRUEMOTION2RT, + AV_CODEC_ID_M101, + AV_CODEC_ID_MAGICYUV, + AV_CODEC_ID_SHEERVIDEO, + AV_CODEC_ID_YLC, + + /* various PCM "codecs" */ + AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs + AV_CODEC_ID_PCM_S16LE = 0x10000, + AV_CODEC_ID_PCM_S16BE, + AV_CODEC_ID_PCM_U16LE, + AV_CODEC_ID_PCM_U16BE, + AV_CODEC_ID_PCM_S8, + AV_CODEC_ID_PCM_U8, + AV_CODEC_ID_PCM_MULAW, + AV_CODEC_ID_PCM_ALAW, + AV_CODEC_ID_PCM_S32LE, + AV_CODEC_ID_PCM_S32BE, + AV_CODEC_ID_PCM_U32LE, + AV_CODEC_ID_PCM_U32BE, + AV_CODEC_ID_PCM_S24LE, + AV_CODEC_ID_PCM_S24BE, + AV_CODEC_ID_PCM_U24LE, + AV_CODEC_ID_PCM_U24BE, + AV_CODEC_ID_PCM_S24DAUD, + AV_CODEC_ID_PCM_ZORK, + AV_CODEC_ID_PCM_S16LE_PLANAR, + AV_CODEC_ID_PCM_DVD, + AV_CODEC_ID_PCM_F32BE, + AV_CODEC_ID_PCM_F32LE, + AV_CODEC_ID_PCM_F64BE, + AV_CODEC_ID_PCM_F64LE, + AV_CODEC_ID_PCM_BLURAY, + AV_CODEC_ID_PCM_LXF, + AV_CODEC_ID_S302M, + AV_CODEC_ID_PCM_S8_PLANAR, + AV_CODEC_ID_PCM_S24LE_PLANAR, + AV_CODEC_ID_PCM_S32LE_PLANAR, + AV_CODEC_ID_PCM_S16BE_PLANAR, + /* new PCM "codecs" should be added right below this line starting with + * an explicit value of for example 0x10800 + */ + + /* various ADPCM codecs */ + AV_CODEC_ID_ADPCM_IMA_QT = 0x11000, + AV_CODEC_ID_ADPCM_IMA_WAV, + AV_CODEC_ID_ADPCM_IMA_DK3, + AV_CODEC_ID_ADPCM_IMA_DK4, + AV_CODEC_ID_ADPCM_IMA_WS, + AV_CODEC_ID_ADPCM_IMA_SMJPEG, + AV_CODEC_ID_ADPCM_MS, + AV_CODEC_ID_ADPCM_4XM, + AV_CODEC_ID_ADPCM_XA, + AV_CODEC_ID_ADPCM_ADX, + AV_CODEC_ID_ADPCM_EA, + AV_CODEC_ID_ADPCM_G726, + AV_CODEC_ID_ADPCM_CT, + AV_CODEC_ID_ADPCM_SWF, + AV_CODEC_ID_ADPCM_YAMAHA, + AV_CODEC_ID_ADPCM_SBPRO_4, + AV_CODEC_ID_ADPCM_SBPRO_3, + AV_CODEC_ID_ADPCM_SBPRO_2, + AV_CODEC_ID_ADPCM_THP, + AV_CODEC_ID_ADPCM_IMA_AMV, + AV_CODEC_ID_ADPCM_EA_R1, + AV_CODEC_ID_ADPCM_EA_R3, + AV_CODEC_ID_ADPCM_EA_R2, + AV_CODEC_ID_ADPCM_IMA_EA_SEAD, + AV_CODEC_ID_ADPCM_IMA_EA_EACS, + AV_CODEC_ID_ADPCM_EA_XAS, + AV_CODEC_ID_ADPCM_EA_MAXIS_XA, + AV_CODEC_ID_ADPCM_IMA_ISS, + AV_CODEC_ID_ADPCM_G722, + AV_CODEC_ID_ADPCM_IMA_APC, + AV_CODEC_ID_ADPCM_VIMA, +#if FF_API_VIMA_DECODER + AV_CODEC_ID_VIMA = AV_CODEC_ID_ADPCM_VIMA, +#endif + + AV_CODEC_ID_ADPCM_AFC = 0x11800, + AV_CODEC_ID_ADPCM_IMA_OKI, + AV_CODEC_ID_ADPCM_DTK, + AV_CODEC_ID_ADPCM_IMA_RAD, + AV_CODEC_ID_ADPCM_G726LE, + AV_CODEC_ID_ADPCM_THP_LE, + AV_CODEC_ID_ADPCM_PSX, + AV_CODEC_ID_ADPCM_AICA, + AV_CODEC_ID_ADPCM_IMA_DAT4, + AV_CODEC_ID_ADPCM_MTAF, + + /* AMR */ + AV_CODEC_ID_AMR_NB = 0x12000, + AV_CODEC_ID_AMR_WB, + + /* RealAudio codecs*/ + AV_CODEC_ID_RA_144 = 0x13000, + AV_CODEC_ID_RA_288, + + /* various DPCM codecs */ + AV_CODEC_ID_ROQ_DPCM = 0x14000, + AV_CODEC_ID_INTERPLAY_DPCM, + AV_CODEC_ID_XAN_DPCM, + AV_CODEC_ID_SOL_DPCM, + + AV_CODEC_ID_SDX2_DPCM = 0x14800, + + /* audio codecs */ + AV_CODEC_ID_MP2 = 0x15000, + AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 + AV_CODEC_ID_AAC, + AV_CODEC_ID_AC3, + AV_CODEC_ID_DTS, + AV_CODEC_ID_VORBIS, + AV_CODEC_ID_DVAUDIO, + AV_CODEC_ID_WMAV1, + AV_CODEC_ID_WMAV2, + AV_CODEC_ID_MACE3, + AV_CODEC_ID_MACE6, + AV_CODEC_ID_VMDAUDIO, + AV_CODEC_ID_FLAC, + AV_CODEC_ID_MP3ADU, + AV_CODEC_ID_MP3ON4, + AV_CODEC_ID_SHORTEN, + AV_CODEC_ID_ALAC, + AV_CODEC_ID_WESTWOOD_SND1, + AV_CODEC_ID_GSM, ///< as in Berlin toast format + AV_CODEC_ID_QDM2, + AV_CODEC_ID_COOK, + AV_CODEC_ID_TRUESPEECH, + AV_CODEC_ID_TTA, + AV_CODEC_ID_SMACKAUDIO, + AV_CODEC_ID_QCELP, + AV_CODEC_ID_WAVPACK, + AV_CODEC_ID_DSICINAUDIO, + AV_CODEC_ID_IMC, + AV_CODEC_ID_MUSEPACK7, + AV_CODEC_ID_MLP, + AV_CODEC_ID_GSM_MS, /* as found in WAV */ + AV_CODEC_ID_ATRAC3, +#if FF_API_VOXWARE + AV_CODEC_ID_VOXWARE, +#endif + AV_CODEC_ID_APE, + AV_CODEC_ID_NELLYMOSER, + AV_CODEC_ID_MUSEPACK8, + AV_CODEC_ID_SPEEX, + AV_CODEC_ID_WMAVOICE, + AV_CODEC_ID_WMAPRO, + AV_CODEC_ID_WMALOSSLESS, + AV_CODEC_ID_ATRAC3P, + AV_CODEC_ID_EAC3, + AV_CODEC_ID_SIPR, + AV_CODEC_ID_MP1, + AV_CODEC_ID_TWINVQ, + AV_CODEC_ID_TRUEHD, + AV_CODEC_ID_MP4ALS, + AV_CODEC_ID_ATRAC1, + AV_CODEC_ID_BINKAUDIO_RDFT, + AV_CODEC_ID_BINKAUDIO_DCT, + AV_CODEC_ID_AAC_LATM, + AV_CODEC_ID_QDMC, + AV_CODEC_ID_CELT, + AV_CODEC_ID_G723_1, + AV_CODEC_ID_G729, + AV_CODEC_ID_8SVX_EXP, + AV_CODEC_ID_8SVX_FIB, + AV_CODEC_ID_BMV_AUDIO, + AV_CODEC_ID_RALF, + AV_CODEC_ID_IAC, + AV_CODEC_ID_ILBC, + AV_CODEC_ID_OPUS, + AV_CODEC_ID_COMFORT_NOISE, + AV_CODEC_ID_TAK, + AV_CODEC_ID_METASOUND, + AV_CODEC_ID_PAF_AUDIO, + AV_CODEC_ID_ON2AVC, + AV_CODEC_ID_DSS_SP, + + AV_CODEC_ID_FFWAVESYNTH = 0x15800, + AV_CODEC_ID_SONIC, + AV_CODEC_ID_SONIC_LS, + AV_CODEC_ID_EVRC, + AV_CODEC_ID_SMV, + AV_CODEC_ID_DSD_LSBF, + AV_CODEC_ID_DSD_MSBF, + AV_CODEC_ID_DSD_LSBF_PLANAR, + AV_CODEC_ID_DSD_MSBF_PLANAR, + AV_CODEC_ID_4GV, + AV_CODEC_ID_INTERPLAY_ACM, + AV_CODEC_ID_XMA1, + AV_CODEC_ID_XMA2, + AV_CODEC_ID_DST, + + /* subtitle codecs */ + AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. + AV_CODEC_ID_DVD_SUBTITLE = 0x17000, + AV_CODEC_ID_DVB_SUBTITLE, + AV_CODEC_ID_TEXT, ///< raw UTF-8 text + AV_CODEC_ID_XSUB, + AV_CODEC_ID_SSA, + AV_CODEC_ID_MOV_TEXT, + AV_CODEC_ID_HDMV_PGS_SUBTITLE, + AV_CODEC_ID_DVB_TELETEXT, + AV_CODEC_ID_SRT, + + AV_CODEC_ID_MICRODVD = 0x17800, + AV_CODEC_ID_EIA_608, + AV_CODEC_ID_JACOSUB, + AV_CODEC_ID_SAMI, + AV_CODEC_ID_REALTEXT, + AV_CODEC_ID_STL, + AV_CODEC_ID_SUBVIEWER1, + AV_CODEC_ID_SUBVIEWER, + AV_CODEC_ID_SUBRIP, + AV_CODEC_ID_WEBVTT, + AV_CODEC_ID_MPL2, + AV_CODEC_ID_VPLAYER, + AV_CODEC_ID_PJS, + AV_CODEC_ID_ASS, + AV_CODEC_ID_HDMV_TEXT_SUBTITLE, + + /* other specific kind of codecs (generally used for attachments) */ + AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. + AV_CODEC_ID_TTF = 0x18000, + + AV_CODEC_ID_BINTEXT = 0x18800, + AV_CODEC_ID_XBIN, + AV_CODEC_ID_IDF, + AV_CODEC_ID_OTF, + AV_CODEC_ID_SMPTE_KLV, + AV_CODEC_ID_DVD_NAV, + AV_CODEC_ID_TIMED_ID3, + AV_CODEC_ID_BIN_DATA, + + + AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it + + AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS + * stream (only used by libavformat) */ + AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems + * stream (only used by libavformat) */ + AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. + AV_CODEC_ID_WRAPPED_AVFRAME = 0x21001, ///< Passthrough codec, AVFrames wrapped in AVPacket +}; + +/** + * This struct describes the properties of a single codec described by an + * AVCodecID. + * @see avcodec_descriptor_get() + */ +typedef struct AVCodecDescriptor { + enum AVCodecID id; + enum AVMediaType type; + /** + * Name of the codec described by this descriptor. It is non-empty and + * unique for each codec descriptor. It should contain alphanumeric + * characters and '_' only. + */ + const char *name; + /** + * A more descriptive name for this codec. May be NULL. + */ + const char *long_name; + /** + * Codec properties, a combination of AV_CODEC_PROP_* flags. + */ + int props; + /** + * MIME type(s) associated with the codec. + * May be NULL; if not, a NULL-terminated array of MIME types. + * The first item is always non-NULL and is the preferred MIME type. + */ + const char *const *mime_types; + /** + * If non-NULL, an array of profiles recognized for this codec. + * Terminated with FF_PROFILE_UNKNOWN. + */ + const struct AVProfile *profiles; +} AVCodecDescriptor; + +/** + * Codec uses only intra compression. + * Video codecs only. + */ +#define AV_CODEC_PROP_INTRA_ONLY (1 << 0) +/** + * Codec supports lossy compression. Audio and video codecs only. + * @note a codec may support both lossy and lossless + * compression modes + */ +#define AV_CODEC_PROP_LOSSY (1 << 1) +/** + * Codec supports lossless compression. Audio and video codecs only. + */ +#define AV_CODEC_PROP_LOSSLESS (1 << 2) +/** + * Codec supports frame reordering. That is, the coded order (the order in which + * the encoded packets are output by the encoders / stored / input to the + * decoders) may be different from the presentation order of the corresponding + * frames. + * + * For codecs that do not have this property set, PTS and DTS should always be + * equal. + */ +#define AV_CODEC_PROP_REORDER (1 << 3) +/** + * Subtitle codec is bitmap based + * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. + */ +#define AV_CODEC_PROP_BITMAP_SUB (1 << 16) +/** + * Subtitle codec is text based. + * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. + */ +#define AV_CODEC_PROP_TEXT_SUB (1 << 17) + +/** + * @ingroup lavc_decoding + * Required number of additionally allocated bytes at the end of the input bitstream for decoding. + * This is mainly needed because some optimized bitstream readers read + * 32 or 64 bit at once and could read over the end.
+ * Note: If the first 23 bits of the additional bytes are not 0, then damaged + * MPEG bitstreams could cause overread and segfault. + */ +#define AV_INPUT_BUFFER_PADDING_SIZE 32 + +/** + * @ingroup lavc_encoding + * minimum encoding buffer size + * Used to avoid some checks during header writing. + */ +#define AV_INPUT_BUFFER_MIN_SIZE 16384 + +#if FF_API_WITHOUT_PREFIX +/** + * @deprecated use AV_INPUT_BUFFER_PADDING_SIZE instead + */ +#define FF_INPUT_BUFFER_PADDING_SIZE 32 + +/** + * @deprecated use AV_INPUT_BUFFER_MIN_SIZE instead + */ +#define FF_MIN_BUFFER_SIZE 16384 +#endif /* FF_API_WITHOUT_PREFIX */ + +/** + * @ingroup lavc_encoding + * motion estimation type. + * @deprecated use codec private option instead + */ +#if FF_API_MOTION_EST +enum Motion_Est_ID { + ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed + ME_FULL, + ME_LOG, + ME_PHODS, + ME_EPZS, ///< enhanced predictive zonal search + ME_X1, ///< reserved for experiments + ME_HEX, ///< hexagon based search + ME_UMH, ///< uneven multi-hexagon search + ME_TESA, ///< transformed exhaustive search algorithm + ME_ITER=50, ///< iterative search +}; +#endif + +/** + * @ingroup lavc_decoding + */ +enum AVDiscard{ + /* We leave some space between them for extensions (drop some + * keyframes for intra-only or drop just some bidir frames). */ + AVDISCARD_NONE =-16, ///< discard nothing + AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi + AVDISCARD_NONREF = 8, ///< discard all non reference + AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames + AVDISCARD_NONINTRA= 24, ///< discard all non intra frames + AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes + AVDISCARD_ALL = 48, ///< discard all +}; + +enum AVAudioServiceType { + AV_AUDIO_SERVICE_TYPE_MAIN = 0, + AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, + AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, + AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, + AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, + AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, + AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, + AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, + AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, + AV_AUDIO_SERVICE_TYPE_NB , ///< Not part of ABI +}; + +/** + * @ingroup lavc_encoding + */ +typedef struct RcOverride{ + int start_frame; + int end_frame; + int qscale; // If this is 0 then quality_factor will be used instead. + float quality_factor; +} RcOverride; + +#if FF_API_MAX_BFRAMES +/** + * @deprecated there is no libavcodec-wide limit on the number of B-frames + */ +#define FF_MAX_B_FRAMES 16 +#endif + +/* encoding support + These flags can be passed in AVCodecContext.flags before initialization. + Note: Not everything is supported yet. +*/ + +/** + * Allow decoders to produce frames with data planes that are not aligned + * to CPU requirements (e.g. due to cropping). + */ +#define AV_CODEC_FLAG_UNALIGNED (1 << 0) +/** + * Use fixed qscale. + */ +#define AV_CODEC_FLAG_QSCALE (1 << 1) +/** + * 4 MV per MB allowed / advanced prediction for H.263. + */ +#define AV_CODEC_FLAG_4MV (1 << 2) +/** + * Output even those frames that might be corrupted. + */ +#define AV_CODEC_FLAG_OUTPUT_CORRUPT (1 << 3) +/** + * Use qpel MC. + */ +#define AV_CODEC_FLAG_QPEL (1 << 4) +/** + * Use internal 2pass ratecontrol in first pass mode. + */ +#define AV_CODEC_FLAG_PASS1 (1 << 9) +/** + * Use internal 2pass ratecontrol in second pass mode. + */ +#define AV_CODEC_FLAG_PASS2 (1 << 10) +/** + * loop filter. + */ +#define AV_CODEC_FLAG_LOOP_FILTER (1 << 11) +/** + * Only decode/encode grayscale. + */ +#define AV_CODEC_FLAG_GRAY (1 << 13) +/** + * error[?] variables will be set during encoding. + */ +#define AV_CODEC_FLAG_PSNR (1 << 15) +/** + * Input bitstream might be truncated at a random location + * instead of only at frame boundaries. + */ +#define AV_CODEC_FLAG_TRUNCATED (1 << 16) +/** + * Use interlaced DCT. + */ +#define AV_CODEC_FLAG_INTERLACED_DCT (1 << 18) +/** + * Force low delay. + */ +#define AV_CODEC_FLAG_LOW_DELAY (1 << 19) +/** + * Place global headers in extradata instead of every keyframe. + */ +#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22) +/** + * Use only bitexact stuff (except (I)DCT). + */ +#define AV_CODEC_FLAG_BITEXACT (1 << 23) +/* Fx : Flag for H.263+ extra options */ +/** + * H.263 advanced intra coding / MPEG-4 AC prediction + */ +#define AV_CODEC_FLAG_AC_PRED (1 << 24) +/** + * interlaced motion estimation + */ +#define AV_CODEC_FLAG_INTERLACED_ME (1 << 29) +#define AV_CODEC_FLAG_CLOSED_GOP (1U << 31) + +/** + * Allow non spec compliant speedup tricks. + */ +#define AV_CODEC_FLAG2_FAST (1 << 0) +/** + * Skip bitstream encoding. + */ +#define AV_CODEC_FLAG2_NO_OUTPUT (1 << 2) +/** + * Place global headers at every keyframe instead of in extradata. + */ +#define AV_CODEC_FLAG2_LOCAL_HEADER (1 << 3) + +/** + * timecode is in drop frame format. DEPRECATED!!!! + */ +#define AV_CODEC_FLAG2_DROP_FRAME_TIMECODE (1 << 13) + +/** + * Input bitstream might be truncated at a packet boundaries + * instead of only at frame boundaries. + */ +#define AV_CODEC_FLAG2_CHUNKS (1 << 15) +/** + * Discard cropping information from SPS. + */ +#define AV_CODEC_FLAG2_IGNORE_CROP (1 << 16) + +/** + * Show all frames before the first keyframe + */ +#define AV_CODEC_FLAG2_SHOW_ALL (1 << 22) +/** + * Export motion vectors through frame side data + */ +#define AV_CODEC_FLAG2_EXPORT_MVS (1 << 28) +/** + * Do not skip samples and export skip information as frame side data + */ +#define AV_CODEC_FLAG2_SKIP_MANUAL (1 << 29) +/** + * Do not reset ASS ReadOrder field on flush (subtitles decoding) + */ +#define AV_CODEC_FLAG2_RO_FLUSH_NOOP (1 << 30) + +/* Unsupported options : + * Syntax Arithmetic coding (SAC) + * Reference Picture Selection + * Independent Segment Decoding */ +/* /Fx */ +/* codec capabilities */ + +/** + * Decoder can use draw_horiz_band callback. + */ +#define AV_CODEC_CAP_DRAW_HORIZ_BAND (1 << 0) +/** + * Codec uses get_buffer() for allocating buffers and supports custom allocators. + * If not set, it might not use get_buffer() at all or use operations that + * assume the buffer was allocated by avcodec_default_get_buffer. + */ +#define AV_CODEC_CAP_DR1 (1 << 1) +#define AV_CODEC_CAP_TRUNCATED (1 << 3) +/** + * Encoder or decoder requires flushing with NULL input at the end in order to + * give the complete and correct output. + * + * NOTE: If this flag is not set, the codec is guaranteed to never be fed with + * with NULL data. The user can still send NULL data to the public encode + * or decode function, but libavcodec will not pass it along to the codec + * unless this flag is set. + * + * Decoders: + * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, + * avpkt->size=0 at the end to get the delayed data until the decoder no longer + * returns frames. + * + * Encoders: + * The encoder needs to be fed with NULL data at the end of encoding until the + * encoder no longer returns data. + * + * NOTE: For encoders implementing the AVCodec.encode2() function, setting this + * flag also means that the encoder must set the pts and duration for + * each output packet. If this flag is not set, the pts and duration will + * be determined by libavcodec from the input frame. + */ +#define AV_CODEC_CAP_DELAY (1 << 5) +/** + * Codec can be fed a final frame with a smaller size. + * This can be used to prevent truncation of the last audio samples. + */ +#define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6) + +#if FF_API_CAP_VDPAU +/** + * Codec can export data for HW decoding (VDPAU). + */ +#define AV_CODEC_CAP_HWACCEL_VDPAU (1 << 7) +#endif + +/** + * Codec can output multiple frames per AVPacket + * Normally demuxers return one frame at a time, demuxers which do not do + * are connected to a parser to split what they return into proper frames. + * This flag is reserved to the very rare category of codecs which have a + * bitstream that cannot be split into frames without timeconsuming + * operations like full decoding. Demuxers carrying such bitstreams thus + * may return multiple frames in a packet. This has many disadvantages like + * prohibiting stream copy in many cases thus it should only be considered + * as a last resort. + */ +#define AV_CODEC_CAP_SUBFRAMES (1 << 8) +/** + * Codec is experimental and is thus avoided in favor of non experimental + * encoders + */ +#define AV_CODEC_CAP_EXPERIMENTAL (1 << 9) +/** + * Codec should fill in channel configuration and samplerate instead of container + */ +#define AV_CODEC_CAP_CHANNEL_CONF (1 << 10) +/** + * Codec supports frame-level multithreading. + */ +#define AV_CODEC_CAP_FRAME_THREADS (1 << 12) +/** + * Codec supports slice-based (or partition-based) multithreading. + */ +#define AV_CODEC_CAP_SLICE_THREADS (1 << 13) +/** + * Codec supports changed parameters at any point. + */ +#define AV_CODEC_CAP_PARAM_CHANGE (1 << 14) +/** + * Codec supports avctx->thread_count == 0 (auto). + */ +#define AV_CODEC_CAP_AUTO_THREADS (1 << 15) +/** + * Audio encoder supports receiving a different number of samples in each call. + */ +#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1 << 16) +/** + * Codec is intra only. + */ +#define AV_CODEC_CAP_INTRA_ONLY 0x40000000 +/** + * Codec is lossless. + */ +#define AV_CODEC_CAP_LOSSLESS 0x80000000 + + +#if FF_API_WITHOUT_PREFIX +/** + * Allow decoders to produce frames with data planes that are not aligned + * to CPU requirements (e.g. due to cropping). + */ +#define CODEC_FLAG_UNALIGNED AV_CODEC_FLAG_UNALIGNED +#define CODEC_FLAG_QSCALE AV_CODEC_FLAG_QSCALE +#define CODEC_FLAG_4MV AV_CODEC_FLAG_4MV +#define CODEC_FLAG_OUTPUT_CORRUPT AV_CODEC_FLAG_OUTPUT_CORRUPT +#define CODEC_FLAG_QPEL AV_CODEC_FLAG_QPEL +#if FF_API_GMC +/** + * @deprecated use the "gmc" private option of the libxvid encoder + */ +#define CODEC_FLAG_GMC 0x0020 ///< Use GMC. +#endif +#if FF_API_MV0 +/** + * @deprecated use the flag "mv0" in the "mpv_flags" private option of the + * mpegvideo encoders + */ +#define CODEC_FLAG_MV0 0x0040 +#endif +#if FF_API_INPUT_PRESERVED +/** + * @deprecated passing reference-counted frames to the encoders replaces this + * flag + */ +#define CODEC_FLAG_INPUT_PRESERVED 0x0100 +#endif +#define CODEC_FLAG_PASS1 AV_CODEC_FLAG_PASS1 +#define CODEC_FLAG_PASS2 AV_CODEC_FLAG_PASS2 +#define CODEC_FLAG_GRAY AV_CODEC_FLAG_GRAY +#if FF_API_EMU_EDGE +/** + * @deprecated edges are not used/required anymore. I.e. this flag is now always + * set. + */ +#define CODEC_FLAG_EMU_EDGE 0x4000 +#endif +#define CODEC_FLAG_PSNR AV_CODEC_FLAG_PSNR +#define CODEC_FLAG_TRUNCATED AV_CODEC_FLAG_TRUNCATED + +#if FF_API_NORMALIZE_AQP +/** + * @deprecated use the flag "naq" in the "mpv_flags" private option of the + * mpegvideo encoders + */ +#define CODEC_FLAG_NORMALIZE_AQP 0x00020000 +#endif +#define CODEC_FLAG_INTERLACED_DCT AV_CODEC_FLAG_INTERLACED_DCT +#define CODEC_FLAG_LOW_DELAY AV_CODEC_FLAG_LOW_DELAY +#define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER +#define CODEC_FLAG_BITEXACT AV_CODEC_FLAG_BITEXACT +#define CODEC_FLAG_AC_PRED AV_CODEC_FLAG_AC_PRED +#define CODEC_FLAG_LOOP_FILTER AV_CODEC_FLAG_LOOP_FILTER +#define CODEC_FLAG_INTERLACED_ME AV_CODEC_FLAG_INTERLACED_ME +#define CODEC_FLAG_CLOSED_GOP AV_CODEC_FLAG_CLOSED_GOP +#define CODEC_FLAG2_FAST AV_CODEC_FLAG2_FAST +#define CODEC_FLAG2_NO_OUTPUT AV_CODEC_FLAG2_NO_OUTPUT +#define CODEC_FLAG2_LOCAL_HEADER AV_CODEC_FLAG2_LOCAL_HEADER +#define CODEC_FLAG2_DROP_FRAME_TIMECODE AV_CODEC_FLAG2_DROP_FRAME_TIMECODE +#define CODEC_FLAG2_IGNORE_CROP AV_CODEC_FLAG2_IGNORE_CROP + +#define CODEC_FLAG2_CHUNKS AV_CODEC_FLAG2_CHUNKS +#define CODEC_FLAG2_SHOW_ALL AV_CODEC_FLAG2_SHOW_ALL +#define CODEC_FLAG2_EXPORT_MVS AV_CODEC_FLAG2_EXPORT_MVS +#define CODEC_FLAG2_SKIP_MANUAL AV_CODEC_FLAG2_SKIP_MANUAL + +/* Unsupported options : + * Syntax Arithmetic coding (SAC) + * Reference Picture Selection + * Independent Segment Decoding */ +/* /Fx */ +/* codec capabilities */ + +#define CODEC_CAP_DRAW_HORIZ_BAND AV_CODEC_CAP_DRAW_HORIZ_BAND ///< Decoder can use draw_horiz_band callback. +/** + * Codec uses get_buffer() for allocating buffers and supports custom allocators. + * If not set, it might not use get_buffer() at all or use operations that + * assume the buffer was allocated by avcodec_default_get_buffer. + */ +#define CODEC_CAP_DR1 AV_CODEC_CAP_DR1 +#define CODEC_CAP_TRUNCATED AV_CODEC_CAP_TRUNCATED +#if FF_API_XVMC +/* Codec can export data for HW decoding. This flag indicates that + * the codec would call get_format() with list that might contain HW accelerated + * pixel formats (XvMC, VDPAU, VAAPI, etc). The application can pick any of them + * including raw image format. + * The application can use the passed context to determine bitstream version, + * chroma format, resolution etc. + */ +#define CODEC_CAP_HWACCEL 0x0010 +#endif /* FF_API_XVMC */ +/** + * Encoder or decoder requires flushing with NULL input at the end in order to + * give the complete and correct output. + * + * NOTE: If this flag is not set, the codec is guaranteed to never be fed with + * with NULL data. The user can still send NULL data to the public encode + * or decode function, but libavcodec will not pass it along to the codec + * unless this flag is set. + * + * Decoders: + * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, + * avpkt->size=0 at the end to get the delayed data until the decoder no longer + * returns frames. + * + * Encoders: + * The encoder needs to be fed with NULL data at the end of encoding until the + * encoder no longer returns data. + * + * NOTE: For encoders implementing the AVCodec.encode2() function, setting this + * flag also means that the encoder must set the pts and duration for + * each output packet. If this flag is not set, the pts and duration will + * be determined by libavcodec from the input frame. + */ +#define CODEC_CAP_DELAY AV_CODEC_CAP_DELAY +/** + * Codec can be fed a final frame with a smaller size. + * This can be used to prevent truncation of the last audio samples. + */ +#define CODEC_CAP_SMALL_LAST_FRAME AV_CODEC_CAP_SMALL_LAST_FRAME +#if FF_API_CAP_VDPAU +/** + * Codec can export data for HW decoding (VDPAU). + */ +#define CODEC_CAP_HWACCEL_VDPAU AV_CODEC_CAP_HWACCEL_VDPAU +#endif +/** + * Codec can output multiple frames per AVPacket + * Normally demuxers return one frame at a time, demuxers which do not do + * are connected to a parser to split what they return into proper frames. + * This flag is reserved to the very rare category of codecs which have a + * bitstream that cannot be split into frames without timeconsuming + * operations like full decoding. Demuxers carrying such bitstreams thus + * may return multiple frames in a packet. This has many disadvantages like + * prohibiting stream copy in many cases thus it should only be considered + * as a last resort. + */ +#define CODEC_CAP_SUBFRAMES AV_CODEC_CAP_SUBFRAMES +/** + * Codec is experimental and is thus avoided in favor of non experimental + * encoders + */ +#define CODEC_CAP_EXPERIMENTAL AV_CODEC_CAP_EXPERIMENTAL +/** + * Codec should fill in channel configuration and samplerate instead of container + */ +#define CODEC_CAP_CHANNEL_CONF AV_CODEC_CAP_CHANNEL_CONF +#if FF_API_NEG_LINESIZES +/** + * @deprecated no codecs use this capability + */ +#define CODEC_CAP_NEG_LINESIZES 0x0800 +#endif +/** + * Codec supports frame-level multithreading. + */ +#define CODEC_CAP_FRAME_THREADS AV_CODEC_CAP_FRAME_THREADS +/** + * Codec supports slice-based (or partition-based) multithreading. + */ +#define CODEC_CAP_SLICE_THREADS AV_CODEC_CAP_SLICE_THREADS +/** + * Codec supports changed parameters at any point. + */ +#define CODEC_CAP_PARAM_CHANGE AV_CODEC_CAP_PARAM_CHANGE +/** + * Codec supports avctx->thread_count == 0 (auto). + */ +#define CODEC_CAP_AUTO_THREADS AV_CODEC_CAP_AUTO_THREADS +/** + * Audio encoder supports receiving a different number of samples in each call. + */ +#define CODEC_CAP_VARIABLE_FRAME_SIZE AV_CODEC_CAP_VARIABLE_FRAME_SIZE +/** + * Codec is intra only. + */ +#define CODEC_CAP_INTRA_ONLY AV_CODEC_CAP_INTRA_ONLY +/** + * Codec is lossless. + */ +#define CODEC_CAP_LOSSLESS AV_CODEC_CAP_LOSSLESS + +/** + * HWAccel is experimental and is thus avoided in favor of non experimental + * codecs + */ +#define HWACCEL_CODEC_CAP_EXPERIMENTAL 0x0200 +#endif /* FF_API_WITHOUT_PREFIX */ + +#if FF_API_MB_TYPE +//The following defines may change, don't expect compatibility if you use them. +#define MB_TYPE_INTRA4x4 0x0001 +#define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific +#define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific +#define MB_TYPE_16x16 0x0008 +#define MB_TYPE_16x8 0x0010 +#define MB_TYPE_8x16 0x0020 +#define MB_TYPE_8x8 0x0040 +#define MB_TYPE_INTERLACED 0x0080 +#define MB_TYPE_DIRECT2 0x0100 //FIXME +#define MB_TYPE_ACPRED 0x0200 +#define MB_TYPE_GMC 0x0400 +#define MB_TYPE_SKIP 0x0800 +#define MB_TYPE_P0L0 0x1000 +#define MB_TYPE_P1L0 0x2000 +#define MB_TYPE_P0L1 0x4000 +#define MB_TYPE_P1L1 0x8000 +#define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0) +#define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1) +#define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1) +#define MB_TYPE_QUANT 0x00010000 +#define MB_TYPE_CBP 0x00020000 +// Note bits 24-31 are reserved for codec specific use (H.264 ref0, MPEG-1 0mv, ...) +#endif + +/** + * Pan Scan area. + * This specifies the area which should be displayed. + * Note there may be multiple such areas for one frame. + */ +typedef struct AVPanScan{ + /** + * id + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + int id; + + /** + * width and height in 1/16 pel + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + int width; + int height; + + /** + * position of the top left corner in 1/16 pel for up to 3 fields/frames + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + int16_t position[3][2]; +}AVPanScan; + +/** + * This structure describes the bitrate properties of an encoded bitstream. It + * roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD + * parameters for H.264/HEVC. + */ +typedef struct AVCPBProperties { + /** + * Maximum bitrate of the stream, in bits per second. + * Zero if unknown or unspecified. + */ + int max_bitrate; + /** + * Minimum bitrate of the stream, in bits per second. + * Zero if unknown or unspecified. + */ + int min_bitrate; + /** + * Average bitrate of the stream, in bits per second. + * Zero if unknown or unspecified. + */ + int avg_bitrate; + + /** + * The size of the buffer to which the ratecontrol is applied, in bits. + * Zero if unknown or unspecified. + */ + int buffer_size; + + /** + * The delay between the time the packet this structure is associated with + * is received and the time when it should be decoded, in periods of a 27MHz + * clock. + * + * UINT64_MAX when unknown or unspecified. + */ + uint64_t vbv_delay; +} AVCPBProperties; + +#if FF_API_QSCALE_TYPE +#define FF_QSCALE_TYPE_MPEG1 0 +#define FF_QSCALE_TYPE_MPEG2 1 +#define FF_QSCALE_TYPE_H264 2 +#define FF_QSCALE_TYPE_VP56 3 +#endif + +/** + * The decoder will keep a reference to the frame and may reuse it later. + */ +#define AV_GET_BUFFER_FLAG_REF (1 << 0) + +/** + * @defgroup lavc_packet AVPacket + * + * Types and functions for working with AVPacket. + * @{ + */ +enum AVPacketSideDataType { + AV_PKT_DATA_PALETTE, + + /** + * The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format + * that the extradata buffer was changed and the receiving side should + * act upon it appropriately. The new extradata is embedded in the side + * data buffer and should be immediately used for processing the current + * frame or packet. + */ + AV_PKT_DATA_NEW_EXTRADATA, + + /** + * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: + * @code + * u32le param_flags + * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) + * s32le channel_count + * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) + * u64le channel_layout + * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) + * s32le sample_rate + * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) + * s32le width + * s32le height + * @endcode + */ + AV_PKT_DATA_PARAM_CHANGE, + + /** + * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of + * structures with info about macroblocks relevant to splitting the + * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). + * That is, it does not necessarily contain info about all macroblocks, + * as long as the distance between macroblocks in the info is smaller + * than the target payload size. + * Each MB info structure is 12 bytes, and is laid out as follows: + * @code + * u32le bit offset from the start of the packet + * u8 current quantizer at the start of the macroblock + * u8 GOB number + * u16le macroblock address within the GOB + * u8 horizontal MV predictor + * u8 vertical MV predictor + * u8 horizontal MV predictor for block number 3 + * u8 vertical MV predictor for block number 3 + * @endcode + */ + AV_PKT_DATA_H263_MB_INFO, + + /** + * This side data should be associated with an audio stream and contains + * ReplayGain information in form of the AVReplayGain struct. + */ + AV_PKT_DATA_REPLAYGAIN, + + /** + * This side data contains a 3x3 transformation matrix describing an affine + * transformation that needs to be applied to the decoded video frames for + * correct presentation. + * + * See libavutil/display.h for a detailed description of the data. + */ + AV_PKT_DATA_DISPLAYMATRIX, + + /** + * This side data should be associated with a video stream and contains + * Stereoscopic 3D information in form of the AVStereo3D struct. + */ + AV_PKT_DATA_STEREO3D, + + /** + * This side data should be associated with an audio stream and corresponds + * to enum AVAudioServiceType. + */ + AV_PKT_DATA_AUDIO_SERVICE_TYPE, + + /** + * This side data contains quality related information from the encoder. + * @code + * u32le quality factor of the compressed frame. Allowed range is between 1 (good) and FF_LAMBDA_MAX (bad). + * u8 picture type + * u8 error count + * u16 reserved + * u64le[error count] sum of squared differences between encoder in and output + * @endcode + */ + AV_PKT_DATA_QUALITY_STATS, + + /** + * This side data contains an integer value representing the stream index + * of a "fallback" track. A fallback track indicates an alternate + * track to use when the current track can not be decoded for some reason. + * e.g. no decoder available for codec. + */ + AV_PKT_DATA_FALLBACK_TRACK, + + /** + * This side data corresponds to the AVCPBProperties struct. + */ + AV_PKT_DATA_CPB_PROPERTIES, + + /** + * Recommmends skipping the specified number of samples + * @code + * u32le number of samples to skip from start of this packet + * u32le number of samples to skip from end of this packet + * u8 reason for start skip + * u8 reason for end skip (0=padding silence, 1=convergence) + * @endcode + */ + AV_PKT_DATA_SKIP_SAMPLES=70, + + /** + * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that + * the packet may contain "dual mono" audio specific to Japanese DTV + * and if it is true, recommends only the selected channel to be used. + * @code + * u8 selected channels (0=mail/left, 1=sub/right, 2=both) + * @endcode + */ + AV_PKT_DATA_JP_DUALMONO, + + /** + * A list of zero terminated key/value strings. There is no end marker for + * the list, so it is required to rely on the side data size to stop. + */ + AV_PKT_DATA_STRINGS_METADATA, + + /** + * Subtitle event position + * @code + * u32le x1 + * u32le y1 + * u32le x2 + * u32le y2 + * @endcode + */ + AV_PKT_DATA_SUBTITLE_POSITION, + + /** + * Data found in BlockAdditional element of matroska container. There is + * no end marker for the data, so it is required to rely on the side data + * size to recognize the end. 8 byte id (as found in BlockAddId) followed + * by data. + */ + AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, + + /** + * The optional first identifier line of a WebVTT cue. + */ + AV_PKT_DATA_WEBVTT_IDENTIFIER, + + /** + * The optional settings (rendering instructions) that immediately + * follow the timestamp specifier of a WebVTT cue. + */ + AV_PKT_DATA_WEBVTT_SETTINGS, + + /** + * A list of zero terminated key/value strings. There is no end marker for + * the list, so it is required to rely on the side data size to stop. This + * side data includes updated metadata which appeared in the stream. + */ + AV_PKT_DATA_METADATA_UPDATE, + + /** + * MPEGTS stream ID, this is required to pass the stream ID + * information from the demuxer to the corresponding muxer. + */ + AV_PKT_DATA_MPEGTS_STREAM_ID, + + /** + * Mastering display metadata (based on SMPTE-2086:2014). This metadata + * should be associated with a video stream and containts data in the form + * of the AVMasteringDisplayMetadata struct. + */ + AV_PKT_DATA_MASTERING_DISPLAY_METADATA +}; + +#define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED + +typedef struct AVPacketSideData { + uint8_t *data; + int size; + enum AVPacketSideDataType type; +} AVPacketSideData; + +/** + * This structure stores compressed data. It is typically exported by demuxers + * and then passed as input to decoders, or received as output from encoders and + * then passed to muxers. + * + * For video, it should typically contain one compressed frame. For audio it may + * contain several compressed frames. Encoders are allowed to output empty + * packets, with no compressed data, containing only side data + * (e.g. to update some stream parameters at the end of encoding). + * + * AVPacket is one of the few structs in FFmpeg, whose size is a part of public + * ABI. Thus it may be allocated on stack and no new fields can be added to it + * without libavcodec and libavformat major bump. + * + * The semantics of data ownership depends on the buf field. + * If it is set, the packet data is dynamically allocated and is + * valid indefinitely until a call to av_packet_unref() reduces the + * reference count to 0. + * + * If the buf field is not set av_packet_ref() would make a copy instead + * of increasing the reference count. + * + * The side data is always allocated with av_malloc(), copied by + * av_packet_ref() and freed by av_packet_unref(). + * + * @see av_packet_ref + * @see av_packet_unref + */ +typedef struct AVPacket { + /** + * A reference to the reference-counted buffer where the packet data is + * stored. + * May be NULL, then the packet data is not reference-counted. + */ + AVBufferRef *buf; + /** + * Presentation timestamp in AVStream->time_base units; the time at which + * the decompressed packet will be presented to the user. + * Can be AV_NOPTS_VALUE if it is not stored in the file. + * pts MUST be larger or equal to dts as presentation cannot happen before + * decompression, unless one wants to view hex dumps. Some formats misuse + * the terms dts and pts/cts to mean something different. Such timestamps + * must be converted to true pts/dts before they are stored in AVPacket. + */ + int64_t pts; + /** + * Decompression timestamp in AVStream->time_base units; the time at which + * the packet is decompressed. + * Can be AV_NOPTS_VALUE if it is not stored in the file. + */ + int64_t dts; + uint8_t *data; + int size; + int stream_index; + /** + * A combination of AV_PKT_FLAG values + */ + int flags; + /** + * Additional packet data that can be provided by the container. + * Packet can contain several types of side information. + */ + AVPacketSideData *side_data; + int side_data_elems; + + /** + * Duration of this packet in AVStream->time_base units, 0 if unknown. + * Equals next_pts - this_pts in presentation order. + */ + int64_t duration; + + int64_t pos; ///< byte position in stream, -1 if unknown + +#if FF_API_CONVERGENCE_DURATION + /** + * @deprecated Same as the duration field, but as int64_t. This was required + * for Matroska subtitles, whose duration values could overflow when the + * duration field was still an int. + */ + attribute_deprecated + int64_t convergence_duration; +#endif +} AVPacket; +#define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe +#define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted + +enum AVSideDataParamChangeFlags { + AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, + AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, + AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, + AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008, +}; +/** + * @} + */ + +struct AVCodecInternal; + +enum AVFieldOrder { + AV_FIELD_UNKNOWN, + AV_FIELD_PROGRESSIVE, + AV_FIELD_TT, //< Top coded_first, top displayed first + AV_FIELD_BB, //< Bottom coded first, bottom displayed first + AV_FIELD_TB, //< Top coded first, bottom displayed first + AV_FIELD_BT, //< Bottom coded first, top displayed first +}; + +/** + * main external API structure. + * New fields can be added to the end with minor version bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. + * Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user + * applications. + * The name string for AVOptions options matches the associated command line + * parameter name and can be found in libavcodec/options_table.h + * The AVOption/command line parameter names differ in some cases from the C + * structure field names for historic reasons or brevity. + * sizeof(AVCodecContext) must not be used outside libav*. + */ +typedef struct AVCodecContext { + /** + * information on struct for av_log + * - set by avcodec_alloc_context3 + */ + const AVClass *av_class; + int log_level_offset; + + enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */ + const struct AVCodec *codec; +#if FF_API_CODEC_NAME + /** + * @deprecated this field is not used for anything in libavcodec + */ + attribute_deprecated + char codec_name[32]; +#endif + enum AVCodecID codec_id; /* see AV_CODEC_ID_xxx */ + + /** + * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). + * This is used to work around some encoder bugs. + * A demuxer should set this to what is stored in the field used to identify the codec. + * If there are multiple such fields in a container then the demuxer should choose the one + * which maximizes the information about the used codec. + * If the codec tag field in a container is larger than 32 bits then the demuxer should + * remap the longer ID to 32 bits with a table or other structure. Alternatively a new + * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated + * first. + * - encoding: Set by user, if not then the default based on codec_id will be used. + * - decoding: Set by user, will be converted to uppercase by libavcodec during init. + */ + unsigned int codec_tag; + +#if FF_API_STREAM_CODEC_TAG + /** + * @deprecated this field is unused + */ + attribute_deprecated + unsigned int stream_codec_tag; +#endif + + void *priv_data; + + /** + * Private context used for internal data. + * + * Unlike priv_data, this is not codec-specific. It is used in general + * libavcodec functions. + */ + struct AVCodecInternal *internal; + + /** + * Private data of the user, can be used to carry app specific stuff. + * - encoding: Set by user. + * - decoding: Set by user. + */ + void *opaque; + + /** + * the average bitrate + * - encoding: Set by user; unused for constant quantizer encoding. + * - decoding: Set by user, may be overwritten by libavcodec + * if this info is available in the stream + */ + int64_t bit_rate; + + /** + * number of bits the bitstream is allowed to diverge from the reference. + * the reference can be CBR (for CBR pass1) or VBR (for pass2) + * - encoding: Set by user; unused for constant quantizer encoding. + * - decoding: unused + */ + int bit_rate_tolerance; + + /** + * Global quality for codecs which cannot change it per frame. + * This should be proportional to MPEG-1/2/4 qscale. + * - encoding: Set by user. + * - decoding: unused + */ + int global_quality; + + /** + * - encoding: Set by user. + * - decoding: unused + */ + int compression_level; +#define FF_COMPRESSION_DEFAULT -1 + + /** + * AV_CODEC_FLAG_*. + * - encoding: Set by user. + * - decoding: Set by user. + */ + int flags; + + /** + * AV_CODEC_FLAG2_* + * - encoding: Set by user. + * - decoding: Set by user. + */ + int flags2; + + /** + * some codecs need / can use extradata like Huffman tables. + * MJPEG: Huffman tables + * rv10: additional flags + * MPEG-4: global headers (they can be in the bitstream or here) + * The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger + * than extradata_size to avoid problems if it is read with the bitstream reader. + * The bytewise contents of extradata must not depend on the architecture or CPU endianness. + * - encoding: Set/allocated/freed by libavcodec. + * - decoding: Set/allocated/freed by user. + */ + uint8_t *extradata; + int extradata_size; + + /** + * This is the fundamental unit of time (in seconds) in terms + * of which frame timestamps are represented. For fixed-fps content, + * timebase should be 1/framerate and timestamp increments should be + * identically 1. + * This often, but not always is the inverse of the frame rate or field rate + * for video. 1/time_base is not the average frame rate if the frame rate is not + * constant. + * + * Like containers, elementary streams also can store timestamps, 1/time_base + * is the unit in which these timestamps are specified. + * As example of such codec time base see ISO/IEC 14496-2:2001(E) + * vop_time_increment_resolution and fixed_vop_rate + * (fixed_vop_rate == 0 implies that it is different from the framerate) + * + * - encoding: MUST be set by user. + * - decoding: the use of this field for decoding is deprecated. + * Use framerate instead. + */ + AVRational time_base; + + /** + * For some codecs, the time base is closer to the field rate than the frame rate. + * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration + * if no telecine is used ... + * + * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. + */ + int ticks_per_frame; + + /** + * Codec delay. + * + * Encoding: Number of frames delay there will be from the encoder input to + * the decoder output. (we assume the decoder matches the spec) + * Decoding: Number of frames delay in addition to what a standard decoder + * as specified in the spec would produce. + * + * Video: + * Number of frames the decoded output will be delayed relative to the + * encoded input. + * + * Audio: + * For encoding, this field is unused (see initial_padding). + * + * For decoding, this is the number of samples the decoder needs to + * output before the decoder's output is valid. When seeking, you should + * start decoding this many samples prior to your desired seek point. + * + * - encoding: Set by libavcodec. + * - decoding: Set by libavcodec. + */ + int delay; + + + /* video only */ + /** + * picture width / height. + * + * @note Those fields may not match the values of the last + * AVFrame output by avcodec_decode_video2 due frame + * reordering. + * + * - encoding: MUST be set by user. + * - decoding: May be set by the user before opening the decoder if known e.g. + * from the container. Some decoders will require the dimensions + * to be set by the caller. During decoding, the decoder may + * overwrite those values as required while parsing the data. + */ + int width, height; + + /** + * Bitstream width / height, may be different from width/height e.g. when + * the decoded frame is cropped before being output or lowres is enabled. + * + * @note Those field may not match the value of the last + * AVFrame output by avcodec_receive_frame() due frame + * reordering. + * + * - encoding: unused + * - decoding: May be set by the user before opening the decoder if known + * e.g. from the container. During decoding, the decoder may + * overwrite those values as required while parsing the data. + */ + int coded_width, coded_height; + +#if FF_API_ASPECT_EXTENDED +#define FF_ASPECT_EXTENDED 15 +#endif + + /** + * the number of pictures in a group of pictures, or 0 for intra_only + * - encoding: Set by user. + * - decoding: unused + */ + int gop_size; + + /** + * Pixel format, see AV_PIX_FMT_xxx. + * May be set by the demuxer if known from headers. + * May be overridden by the decoder if it knows better. + * + * @note This field may not match the value of the last + * AVFrame output by avcodec_receive_frame() due frame + * reordering. + * + * - encoding: Set by user. + * - decoding: Set by user if known, overridden by libavcodec while + * parsing the data. + */ + enum AVPixelFormat pix_fmt; + +#if FF_API_MOTION_EST + /** + * This option does nothing + * @deprecated use codec private options instead + */ + attribute_deprecated int me_method; +#endif + + /** + * If non NULL, 'draw_horiz_band' is called by the libavcodec + * decoder to draw a horizontal band. It improves cache usage. Not + * all codecs can do that. You must check the codec capabilities + * beforehand. + * When multithreading is used, it may be called from multiple threads + * at the same time; threads might draw different parts of the same AVFrame, + * or multiple AVFrames, and there is no guarantee that slices will be drawn + * in order. + * The function is also used by hardware acceleration APIs. + * It is called at least once during frame decoding to pass + * the data needed for hardware render. + * In that mode instead of pixel data, AVFrame points to + * a structure specific to the acceleration API. The application + * reads the structure and can change some fields to indicate progress + * or mark state. + * - encoding: unused + * - decoding: Set by user. + * @param height the height of the slice + * @param y the y position of the slice + * @param type 1->top field, 2->bottom field, 3->frame + * @param offset offset into the AVFrame.data from which the slice should be read + */ + void (*draw_horiz_band)(struct AVCodecContext *s, + const AVFrame *src, int offset[AV_NUM_DATA_POINTERS], + int y, int type, int height); + + /** + * callback to negotiate the pixelFormat + * @param fmt is the list of formats which are supported by the codec, + * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. + * The first is always the native one. + * @note The callback may be called again immediately if initialization for + * the selected (hardware-accelerated) pixel format failed. + * @warning Behavior is undefined if the callback returns a value not + * in the fmt list of formats. + * @return the chosen format + * - encoding: unused + * - decoding: Set by user, if not set the native format will be chosen. + */ + enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt); + + /** + * maximum number of B-frames between non-B-frames + * Note: The output will be delayed by max_b_frames+1 relative to the input. + * - encoding: Set by user. + * - decoding: unused + */ + int max_b_frames; + + /** + * qscale factor between IP and B-frames + * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). + * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). + * - encoding: Set by user. + * - decoding: unused + */ + float b_quant_factor; + +#if FF_API_RC_STRATEGY + /** @deprecated use codec private option instead */ + attribute_deprecated int rc_strategy; +#define FF_RC_STRATEGY_XVID 1 +#endif + +#if FF_API_PRIVATE_OPT + /** @deprecated use encoder private options instead */ + attribute_deprecated + int b_frame_strategy; +#endif + + /** + * qscale offset between IP and B-frames + * - encoding: Set by user. + * - decoding: unused + */ + float b_quant_offset; + + /** + * Size of the frame reordering buffer in the decoder. + * For MPEG-2 it is 1 IPB or 0 low delay IP. + * - encoding: Set by libavcodec. + * - decoding: Set by libavcodec. + */ + int has_b_frames; + +#if FF_API_PRIVATE_OPT + /** @deprecated use encoder private options instead */ + attribute_deprecated + int mpeg_quant; +#endif + + /** + * qscale factor between P- and I-frames + * If > 0 then the last P-frame quantizer will be used (q = lastp_q * factor + offset). + * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). + * - encoding: Set by user. + * - decoding: unused + */ + float i_quant_factor; + + /** + * qscale offset between P and I-frames + * - encoding: Set by user. + * - decoding: unused + */ + float i_quant_offset; + + /** + * luminance masking (0-> disabled) + * - encoding: Set by user. + * - decoding: unused + */ + float lumi_masking; + + /** + * temporary complexity masking (0-> disabled) + * - encoding: Set by user. + * - decoding: unused + */ + float temporal_cplx_masking; + + /** + * spatial complexity masking (0-> disabled) + * - encoding: Set by user. + * - decoding: unused + */ + float spatial_cplx_masking; + + /** + * p block masking (0-> disabled) + * - encoding: Set by user. + * - decoding: unused + */ + float p_masking; + + /** + * darkness masking (0-> disabled) + * - encoding: Set by user. + * - decoding: unused + */ + float dark_masking; + + /** + * slice count + * - encoding: Set by libavcodec. + * - decoding: Set by user (or 0). + */ + int slice_count; + +#if FF_API_PRIVATE_OPT + /** @deprecated use encoder private options instead */ + attribute_deprecated + int prediction_method; +#define FF_PRED_LEFT 0 +#define FF_PRED_PLANE 1 +#define FF_PRED_MEDIAN 2 +#endif + + /** + * slice offsets in the frame in bytes + * - encoding: Set/allocated by libavcodec. + * - decoding: Set/allocated by user (or NULL). + */ + int *slice_offset; + + /** + * sample aspect ratio (0 if unknown) + * That is the width of a pixel divided by the height of the pixel. + * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + AVRational sample_aspect_ratio; + + /** + * motion estimation comparison function + * - encoding: Set by user. + * - decoding: unused + */ + int me_cmp; + /** + * subpixel motion estimation comparison function + * - encoding: Set by user. + * - decoding: unused + */ + int me_sub_cmp; + /** + * macroblock comparison function (not supported yet) + * - encoding: Set by user. + * - decoding: unused + */ + int mb_cmp; + /** + * interlaced DCT comparison function + * - encoding: Set by user. + * - decoding: unused + */ + int ildct_cmp; +#define FF_CMP_SAD 0 +#define FF_CMP_SSE 1 +#define FF_CMP_SATD 2 +#define FF_CMP_DCT 3 +#define FF_CMP_PSNR 4 +#define FF_CMP_BIT 5 +#define FF_CMP_RD 6 +#define FF_CMP_ZERO 7 +#define FF_CMP_VSAD 8 +#define FF_CMP_VSSE 9 +#define FF_CMP_NSSE 10 +#define FF_CMP_W53 11 +#define FF_CMP_W97 12 +#define FF_CMP_DCTMAX 13 +#define FF_CMP_DCT264 14 +#define FF_CMP_CHROMA 256 + + /** + * ME diamond size & shape + * - encoding: Set by user. + * - decoding: unused + */ + int dia_size; + + /** + * amount of previous MV predictors (2a+1 x 2a+1 square) + * - encoding: Set by user. + * - decoding: unused + */ + int last_predictor_count; + +#if FF_API_PRIVATE_OPT + /** @deprecated use encoder private options instead */ + attribute_deprecated + int pre_me; +#endif + + /** + * motion estimation prepass comparison function + * - encoding: Set by user. + * - decoding: unused + */ + int me_pre_cmp; + + /** + * ME prepass diamond size & shape + * - encoding: Set by user. + * - decoding: unused + */ + int pre_dia_size; + + /** + * subpel ME quality + * - encoding: Set by user. + * - decoding: unused + */ + int me_subpel_quality; + +#if FF_API_AFD + /** + * DTG active format information (additional aspect ratio + * information only used in DVB MPEG-2 transport streams) + * 0 if not set. + * + * - encoding: unused + * - decoding: Set by decoder. + * @deprecated Deprecated in favor of AVSideData + */ + attribute_deprecated int dtg_active_format; +#define FF_DTG_AFD_SAME 8 +#define FF_DTG_AFD_4_3 9 +#define FF_DTG_AFD_16_9 10 +#define FF_DTG_AFD_14_9 11 +#define FF_DTG_AFD_4_3_SP_14_9 13 +#define FF_DTG_AFD_16_9_SP_14_9 14 +#define FF_DTG_AFD_SP_4_3 15 +#endif /* FF_API_AFD */ + + /** + * maximum motion estimation search range in subpel units + * If 0 then no limit. + * + * - encoding: Set by user. + * - decoding: unused + */ + int me_range; + +#if FF_API_QUANT_BIAS + /** + * @deprecated use encoder private option instead + */ + attribute_deprecated int intra_quant_bias; +#define FF_DEFAULT_QUANT_BIAS 999999 + + /** + * @deprecated use encoder private option instead + */ + attribute_deprecated int inter_quant_bias; +#endif + + /** + * slice flags + * - encoding: unused + * - decoding: Set by user. + */ + int slice_flags; +#define SLICE_FLAG_CODED_ORDER 0x0001 ///< draw_horiz_band() is called in coded order instead of display +#define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG-2 field pics) +#define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1) + +#if FF_API_XVMC + /** + * XVideo Motion Acceleration + * - encoding: forbidden + * - decoding: set by decoder + * @deprecated XvMC doesn't need it anymore. + */ + attribute_deprecated int xvmc_acceleration; +#endif /* FF_API_XVMC */ + + /** + * macroblock decision mode + * - encoding: Set by user. + * - decoding: unused + */ + int mb_decision; +#define FF_MB_DECISION_SIMPLE 0 ///< uses mb_cmp +#define FF_MB_DECISION_BITS 1 ///< chooses the one which needs the fewest bits +#define FF_MB_DECISION_RD 2 ///< rate distortion + + /** + * custom intra quantization matrix + * - encoding: Set by user, can be NULL. + * - decoding: Set by libavcodec. + */ + uint16_t *intra_matrix; + + /** + * custom inter quantization matrix + * - encoding: Set by user, can be NULL. + * - decoding: Set by libavcodec. + */ + uint16_t *inter_matrix; + +#if FF_API_PRIVATE_OPT + /** @deprecated use encoder private options instead */ + attribute_deprecated + int scenechange_threshold; + + /** @deprecated use encoder private options instead */ + attribute_deprecated + int noise_reduction; +#endif + +#if FF_API_MPV_OPT + /** + * @deprecated this field is unused + */ + attribute_deprecated + int me_threshold; + + /** + * @deprecated this field is unused + */ + attribute_deprecated + int mb_threshold; +#endif + + /** + * precision of the intra DC coefficient - 8 + * - encoding: Set by user. + * - decoding: Set by libavcodec + */ + int intra_dc_precision; + + /** + * Number of macroblock rows at the top which are skipped. + * - encoding: unused + * - decoding: Set by user. + */ + int skip_top; + + /** + * Number of macroblock rows at the bottom which are skipped. + * - encoding: unused + * - decoding: Set by user. + */ + int skip_bottom; + +#if FF_API_MPV_OPT + /** + * @deprecated use encoder private options instead + */ + attribute_deprecated + float border_masking; +#endif + + /** + * minimum MB Lagrange multiplier + * - encoding: Set by user. + * - decoding: unused + */ + int mb_lmin; + + /** + * maximum MB Lagrange multiplier + * - encoding: Set by user. + * - decoding: unused + */ + int mb_lmax; + +#if FF_API_PRIVATE_OPT + /** + * @deprecated use encoder private options instead + */ + attribute_deprecated + int me_penalty_compensation; +#endif + + /** + * - encoding: Set by user. + * - decoding: unused + */ + int bidir_refine; + +#if FF_API_PRIVATE_OPT + /** @deprecated use encoder private options instead */ + attribute_deprecated + int brd_scale; +#endif + + /** + * minimum GOP size + * - encoding: Set by user. + * - decoding: unused + */ + int keyint_min; + + /** + * number of reference frames + * - encoding: Set by user. + * - decoding: Set by lavc. + */ + int refs; + +#if FF_API_PRIVATE_OPT + /** @deprecated use encoder private options instead */ + attribute_deprecated + int chromaoffset; +#endif + +#if FF_API_UNUSED_MEMBERS + /** + * Multiplied by qscale for each frame and added to scene_change_score. + * - encoding: Set by user. + * - decoding: unused + */ + attribute_deprecated int scenechange_factor; +#endif + + /** + * Note: Value depends upon the compare function used for fullpel ME. + * - encoding: Set by user. + * - decoding: unused + */ + int mv0_threshold; + +#if FF_API_PRIVATE_OPT + /** @deprecated use encoder private options instead */ + attribute_deprecated + int b_sensitivity; +#endif + + /** + * Chromaticity coordinates of the source primaries. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVColorPrimaries color_primaries; + + /** + * Color Transfer Characteristic. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVColorTransferCharacteristic color_trc; + + /** + * YUV colorspace type. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVColorSpace colorspace; + + /** + * MPEG vs JPEG YUV range. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVColorRange color_range; + + /** + * This defines the location of chroma samples. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVChromaLocation chroma_sample_location; + + /** + * Number of slices. + * Indicates number of picture subdivisions. Used for parallelized + * decoding. + * - encoding: Set by user + * - decoding: unused + */ + int slices; + + /** Field order + * - encoding: set by libavcodec + * - decoding: Set by user. + */ + enum AVFieldOrder field_order; + + /* audio only */ + int sample_rate; ///< samples per second + int channels; ///< number of audio channels + + /** + * audio sample format + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + enum AVSampleFormat sample_fmt; ///< sample format + + /* The following data should not be initialized. */ + /** + * Number of samples per channel in an audio frame. + * + * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame + * except the last must contain exactly frame_size samples per channel. + * May be 0 when the codec has AV_CODEC_CAP_VARIABLE_FRAME_SIZE set, then the + * frame size is not restricted. + * - decoding: may be set by some decoders to indicate constant frame size + */ + int frame_size; + + /** + * Frame counter, set by libavcodec. + * + * - decoding: total number of frames returned from the decoder so far. + * - encoding: total number of frames passed to the encoder so far. + * + * @note the counter is not incremented if encoding/decoding resulted in + * an error. + */ + int frame_number; + + /** + * number of bytes per packet if constant and known or 0 + * Used by some WAV based audio codecs. + */ + int block_align; + + /** + * Audio cutoff bandwidth (0 means "automatic") + * - encoding: Set by user. + * - decoding: unused + */ + int cutoff; + + /** + * Audio channel layout. + * - encoding: set by user. + * - decoding: set by user, may be overwritten by libavcodec. + */ + uint64_t channel_layout; + + /** + * Request decoder to use this channel layout if it can (0 for default) + * - encoding: unused + * - decoding: Set by user. + */ + uint64_t request_channel_layout; + + /** + * Type of service that the audio stream conveys. + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + enum AVAudioServiceType audio_service_type; + + /** + * desired sample format + * - encoding: Not used. + * - decoding: Set by user. + * Decoder will decode to this format if it can. + */ + enum AVSampleFormat request_sample_fmt; + + /** + * This callback is called at the beginning of each frame to get data + * buffer(s) for it. There may be one contiguous buffer for all the data or + * there may be a buffer per each data plane or anything in between. What + * this means is, you may set however many entries in buf[] you feel necessary. + * Each buffer must be reference-counted using the AVBuffer API (see description + * of buf[] below). + * + * The following fields will be set in the frame before this callback is + * called: + * - format + * - width, height (video only) + * - sample_rate, channel_layout, nb_samples (audio only) + * Their values may differ from the corresponding values in + * AVCodecContext. This callback must use the frame values, not the codec + * context values, to calculate the required buffer size. + * + * This callback must fill the following fields in the frame: + * - data[] + * - linesize[] + * - extended_data: + * * if the data is planar audio with more than 8 channels, then this + * callback must allocate and fill extended_data to contain all pointers + * to all data planes. data[] must hold as many pointers as it can. + * extended_data must be allocated with av_malloc() and will be freed in + * av_frame_unref(). + * * otherwise extended_data must point to data + * - buf[] must contain one or more pointers to AVBufferRef structures. Each of + * the frame's data and extended_data pointers must be contained in these. That + * is, one AVBufferRef for each allocated chunk of memory, not necessarily one + * AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(), + * and av_buffer_ref(). + * - extended_buf and nb_extended_buf must be allocated with av_malloc() by + * this callback and filled with the extra buffers if there are more + * buffers than buf[] can hold. extended_buf will be freed in + * av_frame_unref(). + * + * If AV_CODEC_CAP_DR1 is not set then get_buffer2() must call + * avcodec_default_get_buffer2() instead of providing buffers allocated by + * some other means. + * + * Each data plane must be aligned to the maximum required by the target + * CPU. + * + * @see avcodec_default_get_buffer2() + * + * Video: + * + * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused + * (read and/or written to if it is writable) later by libavcodec. + * + * avcodec_align_dimensions2() should be used to find the required width and + * height, as they normally need to be rounded up to the next multiple of 16. + * + * Some decoders do not support linesizes changing between frames. + * + * If frame multithreading is used and thread_safe_callbacks is set, + * this callback may be called from a different thread, but not from more + * than one at once. Does not need to be reentrant. + * + * @see avcodec_align_dimensions2() + * + * Audio: + * + * Decoders request a buffer of a particular size by setting + * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, + * however, utilize only part of the buffer by setting AVFrame.nb_samples + * to a smaller value in the output frame. + * + * As a convenience, av_samples_get_buffer_size() and + * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() + * functions to find the required data size and to fill data pointers and + * linesize. In AVFrame.linesize, only linesize[0] may be set for audio + * since all planes must be the same size. + * + * @see av_samples_get_buffer_size(), av_samples_fill_arrays() + * + * - encoding: unused + * - decoding: Set by libavcodec, user can override. + */ + int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags); + + /** + * If non-zero, the decoded audio and video frames returned from + * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted + * and are valid indefinitely. The caller must free them with + * av_frame_unref() when they are not needed anymore. + * Otherwise, the decoded frames must not be freed by the caller and are + * only valid until the next decode call. + * + * This is always automatically enabled if avcodec_receive_frame() is used. + * + * - encoding: unused + * - decoding: set by the caller before avcodec_open2(). + */ + int refcounted_frames; + + /* - encoding parameters */ + float qcompress; ///< amount of qscale change between easy & hard scenes (0.0-1.0) + float qblur; ///< amount of qscale smoothing over time (0.0-1.0) + + /** + * minimum quantizer + * - encoding: Set by user. + * - decoding: unused + */ + int qmin; + + /** + * maximum quantizer + * - encoding: Set by user. + * - decoding: unused + */ + int qmax; + + /** + * maximum quantizer difference between frames + * - encoding: Set by user. + * - decoding: unused + */ + int max_qdiff; + +#if FF_API_MPV_OPT + /** + * @deprecated use encoder private options instead + */ + attribute_deprecated + float rc_qsquish; + + attribute_deprecated + float rc_qmod_amp; + attribute_deprecated + int rc_qmod_freq; +#endif + + /** + * decoder bitstream buffer size + * - encoding: Set by user. + * - decoding: unused + */ + int rc_buffer_size; + + /** + * ratecontrol override, see RcOverride + * - encoding: Allocated/set/freed by user. + * - decoding: unused + */ + int rc_override_count; + RcOverride *rc_override; + +#if FF_API_MPV_OPT + /** + * @deprecated use encoder private options instead + */ + attribute_deprecated + const char *rc_eq; +#endif + + /** + * maximum bitrate + * - encoding: Set by user. + * - decoding: Set by user, may be overwritten by libavcodec. + */ + int64_t rc_max_rate; + + /** + * minimum bitrate + * - encoding: Set by user. + * - decoding: unused + */ + int64_t rc_min_rate; + +#if FF_API_MPV_OPT + /** + * @deprecated use encoder private options instead + */ + attribute_deprecated + float rc_buffer_aggressivity; + + attribute_deprecated + float rc_initial_cplx; +#endif + + /** + * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. + * - encoding: Set by user. + * - decoding: unused. + */ + float rc_max_available_vbv_use; + + /** + * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. + * - encoding: Set by user. + * - decoding: unused. + */ + float rc_min_vbv_overflow_use; + + /** + * Number of bits which should be loaded into the rc buffer before decoding starts. + * - encoding: Set by user. + * - decoding: unused + */ + int rc_initial_buffer_occupancy; + +#if FF_API_CODER_TYPE +#define FF_CODER_TYPE_VLC 0 +#define FF_CODER_TYPE_AC 1 +#define FF_CODER_TYPE_RAW 2 +#define FF_CODER_TYPE_RLE 3 +#if FF_API_UNUSED_MEMBERS +#define FF_CODER_TYPE_DEFLATE 4 +#endif /* FF_API_UNUSED_MEMBERS */ + /** + * @deprecated use encoder private options instead + */ + attribute_deprecated + int coder_type; +#endif /* FF_API_CODER_TYPE */ + +#if FF_API_PRIVATE_OPT + /** @deprecated use encoder private options instead */ + attribute_deprecated + int context_model; +#endif + +#if FF_API_MPV_OPT + /** + * @deprecated use encoder private options instead + */ + attribute_deprecated + int lmin; + + /** + * @deprecated use encoder private options instead + */ + attribute_deprecated + int lmax; +#endif + +#if FF_API_PRIVATE_OPT + /** @deprecated use encoder private options instead */ + attribute_deprecated + int frame_skip_threshold; + + /** @deprecated use encoder private options instead */ + attribute_deprecated + int frame_skip_factor; + + /** @deprecated use encoder private options instead */ + attribute_deprecated + int frame_skip_exp; + + /** @deprecated use encoder private options instead */ + attribute_deprecated + int frame_skip_cmp; +#endif /* FF_API_PRIVATE_OPT */ + + /** + * trellis RD quantization + * - encoding: Set by user. + * - decoding: unused + */ + int trellis; + +#if FF_API_PRIVATE_OPT + /** @deprecated use encoder private options instead */ + attribute_deprecated + int min_prediction_order; + + /** @deprecated use encoder private options instead */ + attribute_deprecated + int max_prediction_order; + + /** @deprecated use encoder private options instead */ + attribute_deprecated + int64_t timecode_frame_start; +#endif + +#if FF_API_RTP_CALLBACK + /** + * @deprecated unused + */ + /* The RTP callback: This function is called */ + /* every time the encoder has a packet to send. */ + /* It depends on the encoder if the data starts */ + /* with a Start Code (it should). H.263 does. */ + /* mb_nb contains the number of macroblocks */ + /* encoded in the RTP payload. */ + attribute_deprecated + void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb); +#endif + +#if FF_API_PRIVATE_OPT + /** @deprecated use encoder private options instead */ + attribute_deprecated + int rtp_payload_size; /* The size of the RTP payload: the coder will */ + /* do its best to deliver a chunk with size */ + /* below rtp_payload_size, the chunk will start */ + /* with a start code on some codecs like H.263. */ + /* This doesn't take account of any particular */ + /* headers inside the transmitted RTP payload. */ +#endif + +#if FF_API_STAT_BITS + /* statistics, used for 2-pass encoding */ + attribute_deprecated + int mv_bits; + attribute_deprecated + int header_bits; + attribute_deprecated + int i_tex_bits; + attribute_deprecated + int p_tex_bits; + attribute_deprecated + int i_count; + attribute_deprecated + int p_count; + attribute_deprecated + int skip_count; + attribute_deprecated + int misc_bits; + + /** @deprecated this field is unused */ + attribute_deprecated + int frame_bits; +#endif + + /** + * pass1 encoding statistics output buffer + * - encoding: Set by libavcodec. + * - decoding: unused + */ + char *stats_out; + + /** + * pass2 encoding statistics input buffer + * Concatenated stuff from stats_out of pass1 should be placed here. + * - encoding: Allocated/set/freed by user. + * - decoding: unused + */ + char *stats_in; + + /** + * Work around bugs in encoders which sometimes cannot be detected automatically. + * - encoding: Set by user + * - decoding: Set by user + */ + int workaround_bugs; +#define FF_BUG_AUTODETECT 1 ///< autodetection +#if FF_API_OLD_MSMPEG4 +#define FF_BUG_OLD_MSMPEG4 2 +#endif +#define FF_BUG_XVID_ILACE 4 +#define FF_BUG_UMP4 8 +#define FF_BUG_NO_PADDING 16 +#define FF_BUG_AMV 32 +#if FF_API_AC_VLC +#define FF_BUG_AC_VLC 0 ///< Will be removed, libavcodec can now handle these non-compliant files by default. +#endif +#define FF_BUG_QPEL_CHROMA 64 +#define FF_BUG_STD_QPEL 128 +#define FF_BUG_QPEL_CHROMA2 256 +#define FF_BUG_DIRECT_BLOCKSIZE 512 +#define FF_BUG_EDGE 1024 +#define FF_BUG_HPEL_CHROMA 2048 +#define FF_BUG_DC_CLIP 4096 +#define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders. +#define FF_BUG_TRUNCATED 16384 + + /** + * strictly follow the standard (MPEG-4, ...). + * - encoding: Set by user. + * - decoding: Set by user. + * Setting this to STRICT or higher means the encoder and decoder will + * generally do stupid things, whereas setting it to unofficial or lower + * will mean the encoder might produce output that is not supported by all + * spec-compliant decoders. Decoders don't differentiate between normal, + * unofficial and experimental (that is, they always try to decode things + * when they can) unless they are explicitly asked to behave stupidly + * (=strictly conform to the specs) + */ + int strict_std_compliance; +#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software. +#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences. +#define FF_COMPLIANCE_NORMAL 0 +#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions +#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. + + /** + * error concealment flags + * - encoding: unused + * - decoding: Set by user. + */ + int error_concealment; +#define FF_EC_GUESS_MVS 1 +#define FF_EC_DEBLOCK 2 +#define FF_EC_FAVOR_INTER 256 + + /** + * debug + * - encoding: Set by user. + * - decoding: Set by user. + */ + int debug; +#define FF_DEBUG_PICT_INFO 1 +#define FF_DEBUG_RC 2 +#define FF_DEBUG_BITSTREAM 4 +#define FF_DEBUG_MB_TYPE 8 +#define FF_DEBUG_QP 16 +#if FF_API_DEBUG_MV +/** + * @deprecated this option does nothing + */ +#define FF_DEBUG_MV 32 +#endif +#define FF_DEBUG_DCT_COEFF 0x00000040 +#define FF_DEBUG_SKIP 0x00000080 +#define FF_DEBUG_STARTCODE 0x00000100 +#if FF_API_UNUSED_MEMBERS +#define FF_DEBUG_PTS 0x00000200 +#endif /* FF_API_UNUSED_MEMBERS */ +#define FF_DEBUG_ER 0x00000400 +#define FF_DEBUG_MMCO 0x00000800 +#define FF_DEBUG_BUGS 0x00001000 +#if FF_API_DEBUG_MV +#define FF_DEBUG_VIS_QP 0x00002000 ///< only access through AVOptions from outside libavcodec +#define FF_DEBUG_VIS_MB_TYPE 0x00004000 ///< only access through AVOptions from outside libavcodec +#endif +#define FF_DEBUG_BUFFERS 0x00008000 +#define FF_DEBUG_THREADS 0x00010000 +#define FF_DEBUG_GREEN_MD 0x00800000 +#define FF_DEBUG_NOMC 0x01000000 + +#if FF_API_DEBUG_MV + /** + * debug + * Code outside libavcodec should access this field using AVOptions + * - encoding: Set by user. + * - decoding: Set by user. + */ + int debug_mv; +#define FF_DEBUG_VIS_MV_P_FOR 0x00000001 // visualize forward predicted MVs of P-frames +#define FF_DEBUG_VIS_MV_B_FOR 0x00000002 // visualize forward predicted MVs of B-frames +#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 // visualize backward predicted MVs of B-frames +#endif + + /** + * Error recognition; may misdetect some more or less valid parts as errors. + * - encoding: unused + * - decoding: Set by user. + */ + int err_recognition; + +/** + * Verify checksums embedded in the bitstream (could be of either encoded or + * decoded data, depending on the codec) and print an error message on mismatch. + * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the + * decoder returning an error. + */ +#define AV_EF_CRCCHECK (1<<0) +#define AV_EF_BITSTREAM (1<<1) ///< detect bitstream specification deviations +#define AV_EF_BUFFER (1<<2) ///< detect improper bitstream length +#define AV_EF_EXPLODE (1<<3) ///< abort decoding on minor error detection + +#define AV_EF_IGNORE_ERR (1<<15) ///< ignore errors and continue +#define AV_EF_CAREFUL (1<<16) ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors +#define AV_EF_COMPLIANT (1<<17) ///< consider all spec non compliances as errors +#define AV_EF_AGGRESSIVE (1<<18) ///< consider things that a sane encoder should not do as an error + + + /** + * opaque 64-bit number (generally a PTS) that will be reordered and + * output in AVFrame.reordered_opaque + * - encoding: unused + * - decoding: Set by user. + */ + int64_t reordered_opaque; + + /** + * Hardware accelerator in use + * - encoding: unused. + * - decoding: Set by libavcodec + */ + struct AVHWAccel *hwaccel; + + /** + * Hardware accelerator context. + * For some hardware accelerators, a global context needs to be + * provided by the user. In that case, this holds display-dependent + * data FFmpeg cannot instantiate itself. Please refer to the + * FFmpeg HW accelerator documentation to know how to fill this + * is. e.g. for VA API, this is a struct vaapi_context. + * - encoding: unused + * - decoding: Set by user + */ + void *hwaccel_context; + + /** + * error + * - encoding: Set by libavcodec if flags & AV_CODEC_FLAG_PSNR. + * - decoding: unused + */ + uint64_t error[AV_NUM_DATA_POINTERS]; + + /** + * DCT algorithm, see FF_DCT_* below + * - encoding: Set by user. + * - decoding: unused + */ + int dct_algo; +#define FF_DCT_AUTO 0 +#define FF_DCT_FASTINT 1 +#define FF_DCT_INT 2 +#define FF_DCT_MMX 3 +#define FF_DCT_ALTIVEC 5 +#define FF_DCT_FAAN 6 + + /** + * IDCT algorithm, see FF_IDCT_* below. + * - encoding: Set by user. + * - decoding: Set by user. + */ + int idct_algo; +#define FF_IDCT_AUTO 0 +#define FF_IDCT_INT 1 +#define FF_IDCT_SIMPLE 2 +#define FF_IDCT_SIMPLEMMX 3 +#define FF_IDCT_ARM 7 +#define FF_IDCT_ALTIVEC 8 +#if FF_API_ARCH_SH4 +#define FF_IDCT_SH4 9 +#endif +#define FF_IDCT_SIMPLEARM 10 +#if FF_API_UNUSED_MEMBERS +#define FF_IDCT_IPP 13 +#endif /* FF_API_UNUSED_MEMBERS */ +#define FF_IDCT_XVID 14 +#if FF_API_IDCT_XVIDMMX +#define FF_IDCT_XVIDMMX 14 +#endif /* FF_API_IDCT_XVIDMMX */ +#define FF_IDCT_SIMPLEARMV5TE 16 +#define FF_IDCT_SIMPLEARMV6 17 +#if FF_API_ARCH_SPARC +#define FF_IDCT_SIMPLEVIS 18 +#endif +#define FF_IDCT_FAAN 20 +#define FF_IDCT_SIMPLENEON 22 +#if FF_API_ARCH_ALPHA +#define FF_IDCT_SIMPLEALPHA 23 +#endif +#define FF_IDCT_SIMPLEAUTO 128 + + /** + * bits per sample/pixel from the demuxer (needed for huffyuv). + * - encoding: Set by libavcodec. + * - decoding: Set by user. + */ + int bits_per_coded_sample; + + /** + * Bits per sample/pixel of internal libavcodec pixel/sample format. + * - encoding: set by user. + * - decoding: set by libavcodec. + */ + int bits_per_raw_sample; + +#if FF_API_LOWRES + /** + * low resolution decoding, 1-> 1/2 size, 2->1/4 size + * - encoding: unused + * - decoding: Set by user. + * Code outside libavcodec should access this field using: + * av_codec_{get,set}_lowres(avctx) + */ + int lowres; +#endif + +#if FF_API_CODED_FRAME + /** + * the picture in the bitstream + * - encoding: Set by libavcodec. + * - decoding: unused + * + * @deprecated use the quality factor packet side data instead + */ + attribute_deprecated AVFrame *coded_frame; +#endif + + /** + * thread count + * is used to decide how many independent tasks should be passed to execute() + * - encoding: Set by user. + * - decoding: Set by user. + */ + int thread_count; + + /** + * Which multithreading methods to use. + * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, + * so clients which cannot provide future frames should not use it. + * + * - encoding: Set by user, otherwise the default is used. + * - decoding: Set by user, otherwise the default is used. + */ + int thread_type; +#define FF_THREAD_FRAME 1 ///< Decode more than one frame at once +#define FF_THREAD_SLICE 2 ///< Decode more than one part of a single frame at once + + /** + * Which multithreading methods are in use by the codec. + * - encoding: Set by libavcodec. + * - decoding: Set by libavcodec. + */ + int active_thread_type; + + /** + * Set by the client if its custom get_buffer() callback can be called + * synchronously from another thread, which allows faster multithreaded decoding. + * draw_horiz_band() will be called from other threads regardless of this setting. + * Ignored if the default get_buffer() is used. + * - encoding: Set by user. + * - decoding: Set by user. + */ + int thread_safe_callbacks; + + /** + * The codec may call this to execute several independent things. + * It will return only after finishing all tasks. + * The user may replace this with some multithreaded implementation, + * the default implementation will execute the parts serially. + * @param count the number of things to execute + * - encoding: Set by libavcodec, user can override. + * - decoding: Set by libavcodec, user can override. + */ + int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size); + + /** + * The codec may call this to execute several independent things. + * It will return only after finishing all tasks. + * The user may replace this with some multithreaded implementation, + * the default implementation will execute the parts serially. + * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. + * @param c context passed also to func + * @param count the number of things to execute + * @param arg2 argument passed unchanged to func + * @param ret return values of executed functions, must have space for "count" values. May be NULL. + * @param func function that will be called count times, with jobnr from 0 to count-1. + * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no + * two instances of func executing at the same time will have the same threadnr. + * @return always 0 currently, but code should handle a future improvement where when any call to func + * returns < 0 no further calls to func may be done and < 0 is returned. + * - encoding: Set by libavcodec, user can override. + * - decoding: Set by libavcodec, user can override. + */ + int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count); + + /** + * noise vs. sse weight for the nsse comparison function + * - encoding: Set by user. + * - decoding: unused + */ + int nsse_weight; + + /** + * profile + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + int profile; +#define FF_PROFILE_UNKNOWN -99 +#define FF_PROFILE_RESERVED -100 + +#define FF_PROFILE_AAC_MAIN 0 +#define FF_PROFILE_AAC_LOW 1 +#define FF_PROFILE_AAC_SSR 2 +#define FF_PROFILE_AAC_LTP 3 +#define FF_PROFILE_AAC_HE 4 +#define FF_PROFILE_AAC_HE_V2 28 +#define FF_PROFILE_AAC_LD 22 +#define FF_PROFILE_AAC_ELD 38 +#define FF_PROFILE_MPEG2_AAC_LOW 128 +#define FF_PROFILE_MPEG2_AAC_HE 131 + +#define FF_PROFILE_DTS 20 +#define FF_PROFILE_DTS_ES 30 +#define FF_PROFILE_DTS_96_24 40 +#define FF_PROFILE_DTS_HD_HRA 50 +#define FF_PROFILE_DTS_HD_MA 60 +#define FF_PROFILE_DTS_EXPRESS 70 + +#define FF_PROFILE_MPEG2_422 0 +#define FF_PROFILE_MPEG2_HIGH 1 +#define FF_PROFILE_MPEG2_SS 2 +#define FF_PROFILE_MPEG2_SNR_SCALABLE 3 +#define FF_PROFILE_MPEG2_MAIN 4 +#define FF_PROFILE_MPEG2_SIMPLE 5 + +#define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag +#define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag + +#define FF_PROFILE_H264_BASELINE 66 +#define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED) +#define FF_PROFILE_H264_MAIN 77 +#define FF_PROFILE_H264_EXTENDED 88 +#define FF_PROFILE_H264_HIGH 100 +#define FF_PROFILE_H264_HIGH_10 110 +#define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA) +#define FF_PROFILE_H264_MULTIVIEW_HIGH 118 +#define FF_PROFILE_H264_HIGH_422 122 +#define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA) +#define FF_PROFILE_H264_STEREO_HIGH 128 +#define FF_PROFILE_H264_HIGH_444 144 +#define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244 +#define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA) +#define FF_PROFILE_H264_CAVLC_444 44 + +#define FF_PROFILE_VC1_SIMPLE 0 +#define FF_PROFILE_VC1_MAIN 1 +#define FF_PROFILE_VC1_COMPLEX 2 +#define FF_PROFILE_VC1_ADVANCED 3 + +#define FF_PROFILE_MPEG4_SIMPLE 0 +#define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1 +#define FF_PROFILE_MPEG4_CORE 2 +#define FF_PROFILE_MPEG4_MAIN 3 +#define FF_PROFILE_MPEG4_N_BIT 4 +#define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5 +#define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6 +#define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7 +#define FF_PROFILE_MPEG4_HYBRID 8 +#define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9 +#define FF_PROFILE_MPEG4_CORE_SCALABLE 10 +#define FF_PROFILE_MPEG4_ADVANCED_CODING 11 +#define FF_PROFILE_MPEG4_ADVANCED_CORE 12 +#define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13 +#define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14 +#define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15 + +#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1 +#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2 +#define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768 +#define FF_PROFILE_JPEG2000_DCINEMA_2K 3 +#define FF_PROFILE_JPEG2000_DCINEMA_4K 4 + +#define FF_PROFILE_VP9_0 0 +#define FF_PROFILE_VP9_1 1 +#define FF_PROFILE_VP9_2 2 +#define FF_PROFILE_VP9_3 3 + +#define FF_PROFILE_HEVC_MAIN 1 +#define FF_PROFILE_HEVC_MAIN_10 2 +#define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3 +#define FF_PROFILE_HEVC_REXT 4 + + /** + * level + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + int level; +#define FF_LEVEL_UNKNOWN -99 + + /** + * Skip loop filtering for selected frames. + * - encoding: unused + * - decoding: Set by user. + */ + enum AVDiscard skip_loop_filter; + + /** + * Skip IDCT/dequantization for selected frames. + * - encoding: unused + * - decoding: Set by user. + */ + enum AVDiscard skip_idct; + + /** + * Skip decoding for selected frames. + * - encoding: unused + * - decoding: Set by user. + */ + enum AVDiscard skip_frame; + + /** + * Header containing style information for text subtitles. + * For SUBTITLE_ASS subtitle type, it should contain the whole ASS + * [Script Info] and [V4+ Styles] section, plus the [Events] line and + * the Format line following. It shouldn't include any Dialogue line. + * - encoding: Set/allocated/freed by user (before avcodec_open2()) + * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) + */ + uint8_t *subtitle_header; + int subtitle_header_size; + +#if FF_API_ERROR_RATE + /** + * @deprecated use the 'error_rate' private AVOption of the mpegvideo + * encoders + */ + attribute_deprecated + int error_rate; +#endif + +#if FF_API_VBV_DELAY + /** + * VBV delay coded in the last frame (in periods of a 27 MHz clock). + * Used for compliant TS muxing. + * - encoding: Set by libavcodec. + * - decoding: unused. + * @deprecated this value is now exported as a part of + * AV_PKT_DATA_CPB_PROPERTIES packet side data + */ + attribute_deprecated + uint64_t vbv_delay; +#endif + +#if FF_API_SIDEDATA_ONLY_PKT + /** + * Encoding only and set by default. Allow encoders to output packets + * that do not contain any encoded data, only side data. + * + * Some encoders need to output such packets, e.g. to update some stream + * parameters at the end of encoding. + * + * @deprecated this field disables the default behaviour and + * it is kept only for compatibility. + */ + attribute_deprecated + int side_data_only_packets; +#endif + + /** + * Audio only. The number of "priming" samples (padding) inserted by the + * encoder at the beginning of the audio. I.e. this number of leading + * decoded samples must be discarded by the caller to get the original audio + * without leading padding. + * + * - decoding: unused + * - encoding: Set by libavcodec. The timestamps on the output packets are + * adjusted by the encoder so that they always refer to the + * first sample of the data actually contained in the packet, + * including any added padding. E.g. if the timebase is + * 1/samplerate and the timestamp of the first input sample is + * 0, the timestamp of the first output packet will be + * -initial_padding. + */ + int initial_padding; + + /** + * - decoding: For codecs that store a framerate value in the compressed + * bitstream, the decoder may export it here. { 0, 1} when + * unknown. + * - encoding: May be used to signal the framerate of CFR content to an + * encoder. + */ + AVRational framerate; + + /** + * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. + * - encoding: unused. + * - decoding: Set by libavcodec before calling get_format() + */ + enum AVPixelFormat sw_pix_fmt; + + /** + * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. + * Code outside libavcodec should access this field using: + * av_codec_{get,set}_pkt_timebase(avctx) + * - encoding unused. + * - decoding set by user. + */ + AVRational pkt_timebase; + + /** + * AVCodecDescriptor + * Code outside libavcodec should access this field using: + * av_codec_{get,set}_codec_descriptor(avctx) + * - encoding: unused. + * - decoding: set by libavcodec. + */ + const AVCodecDescriptor *codec_descriptor; + +#if !FF_API_LOWRES + /** + * low resolution decoding, 1-> 1/2 size, 2->1/4 size + * - encoding: unused + * - decoding: Set by user. + * Code outside libavcodec should access this field using: + * av_codec_{get,set}_lowres(avctx) + */ + int lowres; +#endif + + /** + * Current statistics for PTS correction. + * - decoding: maintained and used by libavcodec, not intended to be used by user apps + * - encoding: unused + */ + int64_t pts_correction_num_faulty_pts; /// Number of incorrect PTS values so far + int64_t pts_correction_num_faulty_dts; /// Number of incorrect DTS values so far + int64_t pts_correction_last_pts; /// PTS of the last frame + int64_t pts_correction_last_dts; /// DTS of the last frame + + /** + * Character encoding of the input subtitles file. + * - decoding: set by user + * - encoding: unused + */ + char *sub_charenc; + + /** + * Subtitles character encoding mode. Formats or codecs might be adjusting + * this setting (if they are doing the conversion themselves for instance). + * - decoding: set by libavcodec + * - encoding: unused + */ + int sub_charenc_mode; +#define FF_SUB_CHARENC_MODE_DO_NOTHING -1 ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance) +#define FF_SUB_CHARENC_MODE_AUTOMATIC 0 ///< libavcodec will select the mode itself +#define FF_SUB_CHARENC_MODE_PRE_DECODER 1 ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv + + /** + * Skip processing alpha if supported by codec. + * Note that if the format uses pre-multiplied alpha (common with VP6, + * and recommended due to better video quality/compression) + * the image will look as if alpha-blended onto a black background. + * However for formats that do not use pre-multiplied alpha + * there might be serious artefacts (though e.g. libswscale currently + * assumes pre-multiplied alpha anyway). + * Code outside libavcodec should access this field using AVOptions + * + * - decoding: set by user + * - encoding: unused + */ + int skip_alpha; + + /** + * Number of samples to skip after a discontinuity + * - decoding: unused + * - encoding: set by libavcodec + */ + int seek_preroll; + +#if !FF_API_DEBUG_MV + /** + * debug motion vectors + * Code outside libavcodec should access this field using AVOptions + * - encoding: Set by user. + * - decoding: Set by user. + */ + int debug_mv; +#define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames +#define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames +#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames +#endif + + /** + * custom intra quantization matrix + * Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix() + * - encoding: Set by user, can be NULL. + * - decoding: unused. + */ + uint16_t *chroma_intra_matrix; + + /** + * dump format separator. + * can be ", " or "\n " or anything else + * Code outside libavcodec should access this field using AVOptions + * (NO direct access). + * - encoding: Set by user. + * - decoding: Set by user. + */ + uint8_t *dump_separator; + + /** + * ',' separated list of allowed decoders. + * If NULL then all are allowed + * - encoding: unused + * - decoding: set by user through AVOPtions (NO direct access) + */ + char *codec_whitelist; + + /* + * Properties of the stream that gets decoded + * To be accessed through av_codec_get_properties() (NO direct access) + * - encoding: unused + * - decoding: set by libavcodec + */ + unsigned properties; +#define FF_CODEC_PROPERTY_LOSSLESS 0x00000001 +#define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x00000002 + + /** + * Additional data associated with the entire coded stream. + * + * - decoding: unused + * - encoding: may be set by libavcodec after avcodec_open2(). + */ + AVPacketSideData *coded_side_data; + int nb_coded_side_data; + + /** + * Encoding only. + * + * For hardware encoders configured to use a hwaccel pixel format, this + * field should be set by the caller to a reference to the AVHWFramesContext + * describing input frames. AVHWFramesContext.format must be equal to + * AVCodecContext.pix_fmt. + * + * This field should be set before avcodec_open2() is called and is + * afterwards owned and managed by libavcodec. + */ + AVBufferRef *hw_frames_ctx; + + /** + * Control the form of AVSubtitle.rects[N]->ass + * - decoding: set by user + * - encoding: unused + */ + int sub_text_format; +#define FF_SUB_TEXT_FMT_ASS 0 +#if FF_API_ASS_TIMING +#define FF_SUB_TEXT_FMT_ASS_WITH_TIMINGS 1 +#endif + +} AVCodecContext; + +AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx); +void av_codec_set_pkt_timebase (AVCodecContext *avctx, AVRational val); + +const AVCodecDescriptor *av_codec_get_codec_descriptor(const AVCodecContext *avctx); +void av_codec_set_codec_descriptor(AVCodecContext *avctx, const AVCodecDescriptor *desc); + +unsigned av_codec_get_codec_properties(const AVCodecContext *avctx); + +int av_codec_get_lowres(const AVCodecContext *avctx); +void av_codec_set_lowres(AVCodecContext *avctx, int val); + +int av_codec_get_seek_preroll(const AVCodecContext *avctx); +void av_codec_set_seek_preroll(AVCodecContext *avctx, int val); + +uint16_t *av_codec_get_chroma_intra_matrix(const AVCodecContext *avctx); +void av_codec_set_chroma_intra_matrix(AVCodecContext *avctx, uint16_t *val); + +/** + * AVProfile. + */ +typedef struct AVProfile { + int profile; + const char *name; ///< short name for the profile +} AVProfile; + +typedef struct AVCodecDefault AVCodecDefault; + +struct AVSubtitle; + +/** + * AVCodec. + */ +typedef struct AVCodec { + /** + * Name of the codec implementation. + * The name is globally unique among encoders and among decoders (but an + * encoder and a decoder can share the same name). + * This is the primary way to find a codec from the user perspective. + */ + const char *name; + /** + * Descriptive name for the codec, meant to be more human readable than name. + * You should use the NULL_IF_CONFIG_SMALL() macro to define it. + */ + const char *long_name; + enum AVMediaType type; + enum AVCodecID id; + /** + * Codec capabilities. + * see AV_CODEC_CAP_* + */ + int capabilities; + const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} + const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 + const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 + const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 + const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 + uint8_t max_lowres; ///< maximum value for lowres supported by the decoder, no direct access, use av_codec_get_max_lowres() + const AVClass *priv_class; ///< AVClass for the private context + const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} + + /***************************************************************** + * No fields below this line are part of the public API. They + * may not be used outside of libavcodec and can be changed and + * removed at will. + * New public fields should be added right above. + ***************************************************************** + */ + int priv_data_size; + struct AVCodec *next; + /** + * @name Frame-level threading support functions + * @{ + */ + /** + * If defined, called on thread contexts when they are created. + * If the codec allocates writable tables in init(), re-allocate them here. + * priv_data will be set to a copy of the original. + */ + int (*init_thread_copy)(AVCodecContext *); + /** + * Copy necessary context variables from a previous thread context to the current one. + * If not defined, the next thread will start automatically; otherwise, the codec + * must call ff_thread_finish_setup(). + * + * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. + */ + int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src); + /** @} */ + + /** + * Private codec-specific defaults. + */ + const AVCodecDefault *defaults; + + /** + * Initialize codec static data, called from avcodec_register(). + */ + void (*init_static_data)(struct AVCodec *codec); + + int (*init)(AVCodecContext *); + int (*encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size, + const struct AVSubtitle *sub); + /** + * Encode data to an AVPacket. + * + * @param avctx codec context + * @param avpkt output AVPacket (may contain a user-provided buffer) + * @param[in] frame AVFrame containing the raw data to be encoded + * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a + * non-empty packet was returned in avpkt. + * @return 0 on success, negative error code on failure + */ + int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, + int *got_packet_ptr); + int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt); + int (*close)(AVCodecContext *); + /** + * Decode/encode API with decoupled packet/frame dataflow. The API is the + * same as the avcodec_ prefixed APIs (avcodec_send_frame() etc.), except + * that: + * - never called if the codec is closed or the wrong type, + * - AVPacket parameter change side data is applied right before calling + * AVCodec->send_packet, + * - if AV_CODEC_CAP_DELAY is not set, drain packets or frames are never sent, + * - only one drain packet is ever passed down (until the next flush()), + * - a drain AVPacket is always NULL (no need to check for avpkt->size). + */ + int (*send_frame)(AVCodecContext *avctx, const AVFrame *frame); + int (*send_packet)(AVCodecContext *avctx, const AVPacket *avpkt); + int (*receive_frame)(AVCodecContext *avctx, AVFrame *frame); + int (*receive_packet)(AVCodecContext *avctx, AVPacket *avpkt); + /** + * Flush buffers. + * Will be called when seeking + */ + void (*flush)(AVCodecContext *); + /** + * Internal codec capabilities. + * See FF_CODEC_CAP_* in internal.h + */ + int caps_internal; +} AVCodec; + +int av_codec_get_max_lowres(const AVCodec *codec); + +struct MpegEncContext; + +/** + * @defgroup lavc_hwaccel AVHWAccel + * @{ + */ +typedef struct AVHWAccel { + /** + * Name of the hardware accelerated codec. + * The name is globally unique among encoders and among decoders (but an + * encoder and a decoder can share the same name). + */ + const char *name; + + /** + * Type of codec implemented by the hardware accelerator. + * + * See AVMEDIA_TYPE_xxx + */ + enum AVMediaType type; + + /** + * Codec implemented by the hardware accelerator. + * + * See AV_CODEC_ID_xxx + */ + enum AVCodecID id; + + /** + * Supported pixel format. + * + * Only hardware accelerated formats are supported here. + */ + enum AVPixelFormat pix_fmt; + + /** + * Hardware accelerated codec capabilities. + * see HWACCEL_CODEC_CAP_* + */ + int capabilities; + + /***************************************************************** + * No fields below this line are part of the public API. They + * may not be used outside of libavcodec and can be changed and + * removed at will. + * New public fields should be added right above. + ***************************************************************** + */ + struct AVHWAccel *next; + + /** + * Allocate a custom buffer + */ + int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame); + + /** + * Called at the beginning of each frame or field picture. + * + * Meaningful frame information (codec specific) is guaranteed to + * be parsed at this point. This function is mandatory. + * + * Note that buf can be NULL along with buf_size set to 0. + * Otherwise, this means the whole frame is available at this point. + * + * @param avctx the codec context + * @param buf the frame data buffer base + * @param buf_size the size of the frame in bytes + * @return zero if successful, a negative value otherwise + */ + int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); + + /** + * Callback for each slice. + * + * Meaningful slice information (codec specific) is guaranteed to + * be parsed at this point. This function is mandatory. + * The only exception is XvMC, that works on MB level. + * + * @param avctx the codec context + * @param buf the slice data buffer base + * @param buf_size the size of the slice in bytes + * @return zero if successful, a negative value otherwise + */ + int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); + + /** + * Called at the end of each frame or field picture. + * + * The whole picture is parsed at this point and can now be sent + * to the hardware accelerator. This function is mandatory. + * + * @param avctx the codec context + * @return zero if successful, a negative value otherwise + */ + int (*end_frame)(AVCodecContext *avctx); + + /** + * Size of per-frame hardware accelerator private data. + * + * Private data is allocated with av_mallocz() before + * AVCodecContext.get_buffer() and deallocated after + * AVCodecContext.release_buffer(). + */ + int frame_priv_data_size; + + /** + * Called for every Macroblock in a slice. + * + * XvMC uses it to replace the ff_mpv_decode_mb(). + * Instead of decoding to raw picture, MB parameters are + * stored in an array provided by the video driver. + * + * @param s the mpeg context + */ + void (*decode_mb)(struct MpegEncContext *s); + + /** + * Initialize the hwaccel private data. + * + * This will be called from ff_get_format(), after hwaccel and + * hwaccel_context are set and the hwaccel private data in AVCodecInternal + * is allocated. + */ + int (*init)(AVCodecContext *avctx); + + /** + * Uninitialize the hwaccel private data. + * + * This will be called from get_format() or avcodec_close(), after hwaccel + * and hwaccel_context are already uninitialized. + */ + int (*uninit)(AVCodecContext *avctx); + + /** + * Size of the private data to allocate in + * AVCodecInternal.hwaccel_priv_data. + */ + int priv_data_size; +} AVHWAccel; + +/** + * Hardware acceleration should be used for decoding even if the codec level + * used is unknown or higher than the maximum supported level reported by the + * hardware driver. + * + * It's generally a good idea to pass this flag unless you have a specific + * reason not to, as hardware tends to under-report supported levels. + */ +#define AV_HWACCEL_FLAG_IGNORE_LEVEL (1 << 0) + +/** + * Hardware acceleration can output YUV pixel formats with a different chroma + * sampling than 4:2:0 and/or other than 8 bits per component. + */ +#define AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH (1 << 1) + +/** + * @} + */ + +#if FF_API_AVPICTURE +/** + * @defgroup lavc_picture AVPicture + * + * Functions for working with AVPicture + * @{ + */ + +/** + * Picture data structure. + * + * Up to four components can be stored into it, the last component is + * alpha. + * @deprecated use AVFrame or imgutils functions instead + */ +typedef struct AVPicture { + attribute_deprecated + uint8_t *data[AV_NUM_DATA_POINTERS]; ///< pointers to the image data planes + attribute_deprecated + int linesize[AV_NUM_DATA_POINTERS]; ///< number of bytes per line +} AVPicture; + +/** + * @} + */ +#endif + +enum AVSubtitleType { + SUBTITLE_NONE, + + SUBTITLE_BITMAP, ///< A bitmap, pict will be set + + /** + * Plain text, the text field must be set by the decoder and is + * authoritative. ass and pict fields may contain approximations. + */ + SUBTITLE_TEXT, + + /** + * Formatted text, the ass field must be set by the decoder and is + * authoritative. pict and text fields may contain approximations. + */ + SUBTITLE_ASS, +}; + +#define AV_SUBTITLE_FLAG_FORCED 0x00000001 + +typedef struct AVSubtitleRect { + int x; ///< top left corner of pict, undefined when pict is not set + int y; ///< top left corner of pict, undefined when pict is not set + int w; ///< width of pict, undefined when pict is not set + int h; ///< height of pict, undefined when pict is not set + int nb_colors; ///< number of colors in pict, undefined when pict is not set + +#if FF_API_AVPICTURE + /** + * @deprecated unused + */ + attribute_deprecated + AVPicture pict; +#endif + /** + * data+linesize for the bitmap of this subtitle. + * Can be set for text/ass as well once they are rendered. + */ + uint8_t *data[4]; + int linesize[4]; + + enum AVSubtitleType type; + + char *text; ///< 0 terminated plain UTF-8 text + + /** + * 0 terminated ASS/SSA compatible event line. + * The presentation of this is unaffected by the other values in this + * struct. + */ + char *ass; + + int flags; +} AVSubtitleRect; + +typedef struct AVSubtitle { + uint16_t format; /* 0 = graphics */ + uint32_t start_display_time; /* relative to packet pts, in ms */ + uint32_t end_display_time; /* relative to packet pts, in ms */ + unsigned num_rects; + AVSubtitleRect **rects; + int64_t pts; ///< Same as packet pts, in AV_TIME_BASE +} AVSubtitle; + +/** + * This struct describes the properties of an encoded stream. + * + * sizeof(AVCodecParameters) is not a part of the public ABI, this struct must + * be allocated with avcodec_parameters_alloc() and freed with + * avcodec_parameters_free(). + */ +typedef struct AVCodecParameters { + /** + * General type of the encoded data. + */ + enum AVMediaType codec_type; + /** + * Specific type of the encoded data (the codec used). + */ + enum AVCodecID codec_id; + /** + * Additional information about the codec (corresponds to the AVI FOURCC). + */ + uint32_t codec_tag; + + /** + * Extra binary data needed for initializing the decoder, codec-dependent. + * + * Must be allocated with av_malloc() and will be freed by + * avcodec_parameters_free(). The allocated size of extradata must be at + * least extradata_size + AV_INPUT_BUFFER_PADDING_SIZE, with the padding + * bytes zeroed. + */ + uint8_t *extradata; + /** + * Size of the extradata content in bytes. + */ + int extradata_size; + + /** + * - video: the pixel format, the value corresponds to enum AVPixelFormat. + * - audio: the sample format, the value corresponds to enum AVSampleFormat. + */ + int format; + + /** + * The average bitrate of the encoded data (in bits per second). + */ + int64_t bit_rate; + + /** + * The number of bits per sample in the codedwords. + * + * This is basically the bitrate per sample. It is mandatory for a bunch of + * formats to actually decode them. It's the number of bits for one sample in + * the actual coded bitstream. + * + * This could be for example 4 for ADPCM + * For PCM formats this matches bits_per_raw_sample + * Can be 0 + */ + int bits_per_coded_sample; + + /** + * This is the number of valid bits in each output sample. If the + * sample format has more bits, the least significant bits are additional + * padding bits, which are always 0. Use right shifts to reduce the sample + * to its actual size. For example, audio formats with 24 bit samples will + * have bits_per_raw_sample set to 24, and format set to AV_SAMPLE_FMT_S32. + * To get the original sample use "(int32_t)sample >> 8"." + * + * For ADPCM this might be 12 or 16 or similar + * Can be 0 + */ + int bits_per_raw_sample; + + /** + * Codec-specific bitstream restrictions that the stream conforms to. + */ + int profile; + int level; + + /** + * Video only. The dimensions of the video frame in pixels. + */ + int width; + int height; + + /** + * Video only. The aspect ratio (width / height) which a single pixel + * should have when displayed. + * + * When the aspect ratio is unknown / undefined, the numerator should be + * set to 0 (the denominator may have any value). + */ + AVRational sample_aspect_ratio; + + /** + * Video only. The order of the fields in interlaced video. + */ + enum AVFieldOrder field_order; + + /** + * Video only. Additional colorspace characteristics. + */ + enum AVColorRange color_range; + enum AVColorPrimaries color_primaries; + enum AVColorTransferCharacteristic color_trc; + enum AVColorSpace color_space; + enum AVChromaLocation chroma_location; + + /** + * Video only. Number of delayed frames. + */ + int video_delay; + + /** + * Audio only. The channel layout bitmask. May be 0 if the channel layout is + * unknown or unspecified, otherwise the number of bits set must be equal to + * the channels field. + */ + uint64_t channel_layout; + /** + * Audio only. The number of audio channels. + */ + int channels; + /** + * Audio only. The number of audio samples per second. + */ + int sample_rate; + /** + * Audio only. The number of bytes per coded audio frame, required by some + * formats. + * + * Corresponds to nBlockAlign in WAVEFORMATEX. + */ + int block_align; + /** + * Audio only. Audio frame size, if known. Required by some formats to be static. + */ + int frame_size; + + /** + * Audio only. The amount of padding (in samples) inserted by the encoder at + * the beginning of the audio. I.e. this number of leading decoded samples + * must be discarded by the caller to get the original audio without leading + * padding. + */ + int initial_padding; + /** + * Audio only. The amount of padding (in samples) appended by the encoder to + * the end of the audio. I.e. this number of decoded samples must be + * discarded by the caller from the end of the stream to get the original + * audio without any trailing padding. + */ + int trailing_padding; + /** + * Audio only. Number of samples to skip after a discontinuity. + */ + int seek_preroll; +} AVCodecParameters; + +/** + * If c is NULL, returns the first registered codec, + * if c is non-NULL, returns the next registered codec after c, + * or NULL if c is the last one. + */ +AVCodec *av_codec_next(const AVCodec *c); + +/** + * Return the LIBAVCODEC_VERSION_INT constant. + */ +unsigned avcodec_version(void); + +/** + * Return the libavcodec build-time configuration. + */ +const char *avcodec_configuration(void); + +/** + * Return the libavcodec license. + */ +const char *avcodec_license(void); + +/** + * Register the codec codec and initialize libavcodec. + * + * @warning either this function or avcodec_register_all() must be called + * before any other libavcodec functions. + * + * @see avcodec_register_all() + */ +void avcodec_register(AVCodec *codec); + +/** + * Register all the codecs, parsers and bitstream filters which were enabled at + * configuration time. If you do not call this function you can select exactly + * which formats you want to support, by using the individual registration + * functions. + * + * @see avcodec_register + * @see av_register_codec_parser + * @see av_register_bitstream_filter + */ +void avcodec_register_all(void); + +/** + * Allocate an AVCodecContext and set its fields to default values. The + * resulting struct should be freed with avcodec_free_context(). + * + * @param codec if non-NULL, allocate private data and initialize defaults + * for the given codec. It is illegal to then call avcodec_open2() + * with a different codec. + * If NULL, then the codec-specific defaults won't be initialized, + * which may result in suboptimal default settings (this is + * important mainly for encoders, e.g. libx264). + * + * @return An AVCodecContext filled with default values or NULL on failure. + */ +AVCodecContext *avcodec_alloc_context3(const AVCodec *codec); + +/** + * Free the codec context and everything associated with it and write NULL to + * the provided pointer. + */ +void avcodec_free_context(AVCodecContext **avctx); + +#if FF_API_GET_CONTEXT_DEFAULTS +/** + * @deprecated This function should not be used, as closing and opening a codec + * context multiple time is not supported. A new codec context should be + * allocated for each new use. + */ +int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec); +#endif + +/** + * Get the AVClass for AVCodecContext. It can be used in combination with + * AV_OPT_SEARCH_FAKE_OBJ for examining options. + * + * @see av_opt_find(). + */ +const AVClass *avcodec_get_class(void); + +#if FF_API_COPY_CONTEXT +/** + * Get the AVClass for AVFrame. It can be used in combination with + * AV_OPT_SEARCH_FAKE_OBJ for examining options. + * + * @see av_opt_find(). + */ +const AVClass *avcodec_get_frame_class(void); + +/** + * Get the AVClass for AVSubtitleRect. It can be used in combination with + * AV_OPT_SEARCH_FAKE_OBJ for examining options. + * + * @see av_opt_find(). + */ +const AVClass *avcodec_get_subtitle_rect_class(void); + +/** + * Copy the settings of the source AVCodecContext into the destination + * AVCodecContext. The resulting destination codec context will be + * unopened, i.e. you are required to call avcodec_open2() before you + * can use this AVCodecContext to decode/encode video/audio data. + * + * @param dest target codec context, should be initialized with + * avcodec_alloc_context3(NULL), but otherwise uninitialized + * @param src source codec context + * @return AVERROR() on error (e.g. memory allocation error), 0 on success + * + * @deprecated The semantics of this function are ill-defined and it should not + * be used. If you need to transfer the stream parameters from one codec context + * to another, use an intermediate AVCodecParameters instance and the + * avcodec_parameters_from_context() / avcodec_parameters_to_context() + * functions. + */ +attribute_deprecated +int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src); +#endif + +/** + * Allocate a new AVCodecParameters and set its fields to default values + * (unknown/invalid/0). The returned struct must be freed with + * avcodec_parameters_free(). + */ +AVCodecParameters *avcodec_parameters_alloc(void); + +/** + * Free an AVCodecParameters instance and everything associated with it and + * write NULL to the supplied pointer. + */ +void avcodec_parameters_free(AVCodecParameters **par); + +/** + * Copy the contents of src to dst. Any allocated fields in dst are freed and + * replaced with newly allocated duplicates of the corresponding fields in src. + * + * @return >= 0 on success, a negative AVERROR code on failure. + */ +int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src); + +/** + * Fill the parameters struct based on the values from the supplied codec + * context. Any allocated fields in par are freed and replaced with duplicates + * of the corresponding fields in codec. + * + * @return >= 0 on success, a negative AVERROR code on failure + */ +int avcodec_parameters_from_context(AVCodecParameters *par, + const AVCodecContext *codec); + +/** + * Fill the codec context based on the values from the supplied codec + * parameters. Any allocated fields in codec that have a corresponding field in + * par are freed and replaced with duplicates of the corresponding field in par. + * Fields in codec that do not have a counterpart in par are not touched. + * + * @return >= 0 on success, a negative AVERROR code on failure. + */ +int avcodec_parameters_to_context(AVCodecContext *codec, + const AVCodecParameters *par); + +/** + * Initialize the AVCodecContext to use the given AVCodec. Prior to using this + * function the context has to be allocated with avcodec_alloc_context3(). + * + * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), + * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for + * retrieving a codec. + * + * @warning This function is not thread safe! + * + * @note Always call this function before using decoding routines (such as + * @ref avcodec_receive_frame()). + * + * @code + * avcodec_register_all(); + * av_dict_set(&opts, "b", "2.5M", 0); + * codec = avcodec_find_decoder(AV_CODEC_ID_H264); + * if (!codec) + * exit(1); + * + * context = avcodec_alloc_context3(codec); + * + * if (avcodec_open2(context, codec, opts) < 0) + * exit(1); + * @endcode + * + * @param avctx The context to initialize. + * @param codec The codec to open this context for. If a non-NULL codec has been + * previously passed to avcodec_alloc_context3() or + * for this context, then this parameter MUST be either NULL or + * equal to the previously passed codec. + * @param options A dictionary filled with AVCodecContext and codec-private options. + * On return this object will be filled with options that were not found. + * + * @return zero on success, a negative value on error + * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), + * av_dict_set(), av_opt_find(). + */ +int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options); + +/** + * Close a given AVCodecContext and free all the data associated with it + * (but not the AVCodecContext itself). + * + * Calling this function on an AVCodecContext that hasn't been opened will free + * the codec-specific data allocated in avcodec_alloc_context3() with a non-NULL + * codec. Subsequent calls will do nothing. + * + * @note Do not use this function. Use avcodec_free_context() to destroy a + * codec context (either open or closed). Opening and closing a codec context + * multiple times is not supported anymore -- use multiple codec contexts + * instead. + */ +int avcodec_close(AVCodecContext *avctx); + +/** + * Free all allocated data in the given subtitle struct. + * + * @param sub AVSubtitle to free. + */ +void avsubtitle_free(AVSubtitle *sub); + +/** + * @} + */ + +/** + * @addtogroup lavc_packet + * @{ + */ + +/** + * Allocate an AVPacket and set its fields to default values. The resulting + * struct must be freed using av_packet_free(). + * + * @return An AVPacket filled with default values or NULL on failure. + * + * @note this only allocates the AVPacket itself, not the data buffers. Those + * must be allocated through other means such as av_new_packet. + * + * @see av_new_packet + */ +AVPacket *av_packet_alloc(void); + +/** + * Create a new packet that references the same data as src. + * + * This is a shortcut for av_packet_alloc()+av_packet_ref(). + * + * @return newly created AVPacket on success, NULL on error. + * + * @see av_packet_alloc + * @see av_packet_ref + */ +AVPacket *av_packet_clone(AVPacket *src); + +/** + * Free the packet, if the packet is reference counted, it will be + * unreferenced first. + * + * @param packet packet to be freed. The pointer will be set to NULL. + * @note passing NULL is a no-op. + */ +void av_packet_free(AVPacket **pkt); + +/** + * Initialize optional fields of a packet with default values. + * + * Note, this does not touch the data and size members, which have to be + * initialized separately. + * + * @param pkt packet + */ +void av_init_packet(AVPacket *pkt); + +/** + * Allocate the payload of a packet and initialize its fields with + * default values. + * + * @param pkt packet + * @param size wanted payload size + * @return 0 if OK, AVERROR_xxx otherwise + */ +int av_new_packet(AVPacket *pkt, int size); + +/** + * Reduce packet size, correctly zeroing padding + * + * @param pkt packet + * @param size new size + */ +void av_shrink_packet(AVPacket *pkt, int size); + +/** + * Increase packet size, correctly zeroing padding + * + * @param pkt packet + * @param grow_by number of bytes by which to increase the size of the packet + */ +int av_grow_packet(AVPacket *pkt, int grow_by); + +/** + * Initialize a reference-counted packet from av_malloc()ed data. + * + * @param pkt packet to be initialized. This function will set the data, size, + * buf and destruct fields, all others are left untouched. + * @param data Data allocated by av_malloc() to be used as packet data. If this + * function returns successfully, the data is owned by the underlying AVBuffer. + * The caller may not access the data through other means. + * @param size size of data in bytes, without the padding. I.e. the full buffer + * size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE. + * + * @return 0 on success, a negative AVERROR on error + */ +int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size); + +#if FF_API_AVPACKET_OLD_API +/** + * @warning This is a hack - the packet memory allocation stuff is broken. The + * packet is allocated if it was not really allocated. + * + * @deprecated Use av_packet_ref + */ +attribute_deprecated +int av_dup_packet(AVPacket *pkt); +/** + * Copy packet, including contents + * + * @return 0 on success, negative AVERROR on fail + */ +int av_copy_packet(AVPacket *dst, const AVPacket *src); + +/** + * Copy packet side data + * + * @return 0 on success, negative AVERROR on fail + */ +int av_copy_packet_side_data(AVPacket *dst, const AVPacket *src); + +/** + * Free a packet. + * + * @deprecated Use av_packet_unref + * + * @param pkt packet to free + */ +attribute_deprecated +void av_free_packet(AVPacket *pkt); +#endif +/** + * Allocate new information of a packet. + * + * @param pkt packet + * @param type side information type + * @param size side information size + * @return pointer to fresh allocated data or NULL otherwise + */ +uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, + int size); + +/** + * Wrap an existing array as a packet side data. + * + * @param pkt packet + * @param type side information type + * @param data the side data array. It must be allocated with the av_malloc() + * family of functions. The ownership of the data is transferred to + * pkt. + * @param size side information size + * @return a non-negative number on success, a negative AVERROR code on + * failure. On failure, the packet is unchanged and the data remains + * owned by the caller. + */ +int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type, + uint8_t *data, size_t size); + +/** + * Shrink the already allocated side data buffer + * + * @param pkt packet + * @param type side information type + * @param size new side information size + * @return 0 on success, < 0 on failure + */ +int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, + int size); + +/** + * Get side information from packet. + * + * @param pkt packet + * @param type desired side information type + * @param size pointer for side information size to store (optional) + * @return pointer to data if present or NULL otherwise + */ +uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, + int *size); + +int av_packet_merge_side_data(AVPacket *pkt); + +int av_packet_split_side_data(AVPacket *pkt); + +const char *av_packet_side_data_name(enum AVPacketSideDataType type); + +/** + * Pack a dictionary for use in side_data. + * + * @param dict The dictionary to pack. + * @param size pointer to store the size of the returned data + * @return pointer to data if successful, NULL otherwise + */ +uint8_t *av_packet_pack_dictionary(AVDictionary *dict, int *size); +/** + * Unpack a dictionary from side_data. + * + * @param data data from side_data + * @param size size of the data + * @param dict the metadata storage dictionary + * @return 0 on success, < 0 on failure + */ +int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict); + + +/** + * Convenience function to free all the side data stored. + * All the other fields stay untouched. + * + * @param pkt packet + */ +void av_packet_free_side_data(AVPacket *pkt); + +/** + * Setup a new reference to the data described by a given packet + * + * If src is reference-counted, setup dst as a new reference to the + * buffer in src. Otherwise allocate a new buffer in dst and copy the + * data from src into it. + * + * All the other fields are copied from src. + * + * @see av_packet_unref + * + * @param dst Destination packet + * @param src Source packet + * + * @return 0 on success, a negative AVERROR on error. + */ +int av_packet_ref(AVPacket *dst, const AVPacket *src); + +/** + * Wipe the packet. + * + * Unreference the buffer referenced by the packet and reset the + * remaining packet fields to their default values. + * + * @param pkt The packet to be unreferenced. + */ +void av_packet_unref(AVPacket *pkt); + +/** + * Move every field in src to dst and reset src. + * + * @see av_packet_unref + * + * @param src Source packet, will be reset + * @param dst Destination packet + */ +void av_packet_move_ref(AVPacket *dst, AVPacket *src); + +/** + * Copy only "properties" fields from src to dst. + * + * Properties for the purpose of this function are all the fields + * beside those related to the packet data (buf, data, size) + * + * @param dst Destination packet + * @param src Source packet + * + * @return 0 on success AVERROR on failure. + */ +int av_packet_copy_props(AVPacket *dst, const AVPacket *src); + +/** + * Convert valid timing fields (timestamps / durations) in a packet from one + * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be + * ignored. + * + * @param pkt packet on which the conversion will be performed + * @param tb_src source timebase, in which the timing fields in pkt are + * expressed + * @param tb_dst destination timebase, to which the timing fields will be + * converted + */ +void av_packet_rescale_ts(AVPacket *pkt, AVRational tb_src, AVRational tb_dst); + +/** + * @} + */ + +/** + * @addtogroup lavc_decoding + * @{ + */ + +/** + * Find a registered decoder with a matching codec ID. + * + * @param id AVCodecID of the requested decoder + * @return A decoder if one was found, NULL otherwise. + */ +AVCodec *avcodec_find_decoder(enum AVCodecID id); + +/** + * Find a registered decoder with the specified name. + * + * @param name name of the requested decoder + * @return A decoder if one was found, NULL otherwise. + */ +AVCodec *avcodec_find_decoder_by_name(const char *name); + +/** + * The default callback for AVCodecContext.get_buffer2(). It is made public so + * it can be called by custom get_buffer2() implementations for decoders without + * AV_CODEC_CAP_DR1 set. + */ +int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags); + +#if FF_API_EMU_EDGE +/** + * Return the amount of padding in pixels which the get_buffer callback must + * provide around the edge of the image for codecs which do not have the + * CODEC_FLAG_EMU_EDGE flag. + * + * @return Required padding in pixels. + * + * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer + * needed + */ +attribute_deprecated +unsigned avcodec_get_edge_width(void); +#endif + +/** + * Modify width and height values so that they will result in a memory + * buffer that is acceptable for the codec if you do not use any horizontal + * padding. + * + * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. + */ +void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height); + +/** + * Modify width and height values so that they will result in a memory + * buffer that is acceptable for the codec if you also ensure that all + * line sizes are a multiple of the respective linesize_align[i]. + * + * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. + */ +void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, + int linesize_align[AV_NUM_DATA_POINTERS]); + +/** + * Converts AVChromaLocation to swscale x/y chroma position. + * + * The positions represent the chroma (0,0) position in a coordinates system + * with luma (0,0) representing the origin and luma(1,1) representing 256,256 + * + * @param xpos horizontal chroma sample position + * @param ypos vertical chroma sample position + */ +int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos); + +/** + * Converts swscale x/y chroma position to AVChromaLocation. + * + * The positions represent the chroma (0,0) position in a coordinates system + * with luma (0,0) representing the origin and luma(1,1) representing 256,256 + * + * @param xpos horizontal chroma sample position + * @param ypos vertical chroma sample position + */ +enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos); + +/** + * Decode the audio frame of size avpkt->size from avpkt->data into frame. + * + * Some decoders may support multiple frames in a single AVPacket. Such + * decoders would then just decode the first frame and the return value would be + * less than the packet size. In this case, avcodec_decode_audio4 has to be + * called again with an AVPacket containing the remaining data in order to + * decode the second frame, etc... Even if no frames are returned, the packet + * needs to be fed to the decoder with remaining data until it is completely + * consumed or an error occurs. + * + * Some decoders (those marked with AV_CODEC_CAP_DELAY) have a delay between input + * and output. This means that for some packets they will not immediately + * produce decoded output and need to be flushed at the end of decoding to get + * all the decoded data. Flushing is done by calling this function with packets + * with avpkt->data set to NULL and avpkt->size set to 0 until it stops + * returning samples. It is safe to flush even those decoders that are not + * marked with AV_CODEC_CAP_DELAY, then no samples will be returned. + * + * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE + * larger than the actual read bytes because some optimized bitstream + * readers read 32 or 64 bits at once and could read over the end. + * + * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() + * before packets may be fed to the decoder. + * + * @param avctx the codec context + * @param[out] frame The AVFrame in which to store decoded audio samples. + * The decoder will allocate a buffer for the decoded frame by + * calling the AVCodecContext.get_buffer2() callback. + * When AVCodecContext.refcounted_frames is set to 1, the frame is + * reference counted and the returned reference belongs to the + * caller. The caller must release the frame using av_frame_unref() + * when the frame is no longer needed. The caller may safely write + * to the frame if av_frame_is_writable() returns 1. + * When AVCodecContext.refcounted_frames is set to 0, the returned + * reference belongs to the decoder and is valid only until the + * next call to this function or until closing or flushing the + * decoder. The caller may not write to it. + * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is + * non-zero. Note that this field being set to zero + * does not mean that an error has occurred. For + * decoders with AV_CODEC_CAP_DELAY set, no given decode + * call is guaranteed to produce a frame. + * @param[in] avpkt The input AVPacket containing the input buffer. + * At least avpkt->data and avpkt->size should be set. Some + * decoders might also require additional fields to be set. + * @return A negative error code is returned if an error occurred during + * decoding, otherwise the number of bytes consumed from the input + * AVPacket is returned. + * +* @deprecated Use avcodec_send_packet() and avcodec_receive_frame(). + */ +attribute_deprecated +int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, + int *got_frame_ptr, const AVPacket *avpkt); + +/** + * Decode the video frame of size avpkt->size from avpkt->data into picture. + * Some decoders may support multiple frames in a single AVPacket, such + * decoders would then just decode the first frame. + * + * @warning The input buffer must be AV_INPUT_BUFFER_PADDING_SIZE larger than + * the actual read bytes because some optimized bitstream readers read 32 or 64 + * bits at once and could read over the end. + * + * @warning The end of the input buffer buf should be set to 0 to ensure that + * no overreading happens for damaged MPEG streams. + * + * @note Codecs which have the AV_CODEC_CAP_DELAY capability set have a delay + * between input and output, these need to be fed with avpkt->data=NULL, + * avpkt->size=0 at the end to return the remaining frames. + * + * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() + * before packets may be fed to the decoder. + * + * @param avctx the codec context + * @param[out] picture The AVFrame in which the decoded video frame will be stored. + * Use av_frame_alloc() to get an AVFrame. The codec will + * allocate memory for the actual bitmap by calling the + * AVCodecContext.get_buffer2() callback. + * When AVCodecContext.refcounted_frames is set to 1, the frame is + * reference counted and the returned reference belongs to the + * caller. The caller must release the frame using av_frame_unref() + * when the frame is no longer needed. The caller may safely write + * to the frame if av_frame_is_writable() returns 1. + * When AVCodecContext.refcounted_frames is set to 0, the returned + * reference belongs to the decoder and is valid only until the + * next call to this function or until closing or flushing the + * decoder. The caller may not write to it. + * + * @param[in] avpkt The input AVPacket containing the input buffer. + * You can create such packet with av_init_packet() and by then setting + * data and size, some decoders might in addition need other fields like + * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least + * fields possible. + * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. + * @return On error a negative value is returned, otherwise the number of bytes + * used or zero if no frame could be decompressed. + * + * @deprecated Use avcodec_send_packet() and avcodec_receive_frame(). + */ +attribute_deprecated +int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, + int *got_picture_ptr, + const AVPacket *avpkt); + +/** + * Decode a subtitle message. + * Return a negative value on error, otherwise return the number of bytes used. + * If no subtitle could be decompressed, got_sub_ptr is zero. + * Otherwise, the subtitle is stored in *sub. + * Note that AV_CODEC_CAP_DR1 is not available for subtitle codecs. This is for + * simplicity, because the performance difference is expect to be negligible + * and reusing a get_buffer written for video codecs would probably perform badly + * due to a potentially very different allocation pattern. + * + * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input + * and output. This means that for some packets they will not immediately + * produce decoded output and need to be flushed at the end of decoding to get + * all the decoded data. Flushing is done by calling this function with packets + * with avpkt->data set to NULL and avpkt->size set to 0 until it stops + * returning subtitles. It is safe to flush even those decoders that are not + * marked with CODEC_CAP_DELAY, then no subtitles will be returned. + * + * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() + * before packets may be fed to the decoder. + * + * @param avctx the codec context + * @param[out] sub The Preallocated AVSubtitle in which the decoded subtitle will be stored, + * must be freed with avsubtitle_free if *got_sub_ptr is set. + * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. + * @param[in] avpkt The input AVPacket containing the input buffer. + */ +int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, + AVPacket *avpkt); + +/** + * Supply raw packet data as input to a decoder. + * + * Internally, this call will copy relevant AVCodecContext fields, which can + * influence decoding per-packet, and apply them when the packet is actually + * decoded. (For example AVCodecContext.skip_frame, which might direct the + * decoder to drop the frame contained by the packet sent with this function.) + * + * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE + * larger than the actual read bytes because some optimized bitstream + * readers read 32 or 64 bits at once and could read over the end. + * + * @warning Do not mix this API with the legacy API (like avcodec_decode_video2()) + * on the same AVCodecContext. It will return unexpected results now + * or in future libavcodec versions. + * + * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() + * before packets may be fed to the decoder. + * + * @param avctx codec context + * @param[in] avpkt The input AVPacket. Usually, this will be a single video + * frame, or several complete audio frames. + * Ownership of the packet remains with the caller, and the + * decoder will not write to the packet. The decoder may create + * a reference to the packet data (or copy it if the packet is + * not reference-counted). + * Unlike with older APIs, the packet is always fully consumed, + * and if it contains multiple frames (e.g. some audio codecs), + * will require you to call avcodec_receive_frame() multiple + * times afterwards before you can send a new packet. + * It can be NULL (or an AVPacket with data set to NULL and + * size set to 0); in this case, it is considered a flush + * packet, which signals the end of the stream. Sending the + * first flush packet will return success. Subsequent ones are + * unnecessary and will return AVERROR_EOF. If the decoder + * still has frames buffered, it will return them after sending + * a flush packet. + * + * @return 0 on success, otherwise negative error code: + * AVERROR(EAGAIN): input is not accepted right now - the packet must be + * resent after trying to read output + * AVERROR_EOF: the decoder has been flushed, and no new packets can + * be sent to it (also returned if more than 1 flush + * packet is sent) + * AVERROR(EINVAL): codec not opened, it is an encoder, or requires flush + * AVERROR(ENOMEM): failed to add packet to internal queue, or similar + * other errors: legitimate decoding errors + */ +int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt); + +/** + * Return decoded output data from a decoder. + * + * @param avctx codec context + * @param frame This will be set to a reference-counted video or audio + * frame (depending on the decoder type) allocated by the + * decoder. Note that the function will always call + * av_frame_unref(frame) before doing anything else. + * + * @return + * 0: success, a frame was returned + * AVERROR(EAGAIN): output is not available right now - user must try + * to send new input + * AVERROR_EOF: the decoder has been fully flushed, and there will be + * no more output frames + * AVERROR(EINVAL): codec not opened, or it is an encoder + * other negative values: legitimate decoding errors + */ +int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame); + +/** + * Supply a raw video or audio frame to the encoder. Use avcodec_receive_packet() + * to retrieve buffered output packets. + * + * @param avctx codec context + * @param[in] frame AVFrame containing the raw audio or video frame to be encoded. + * Ownership of the frame remains with the caller, and the + * encoder will not write to the frame. The encoder may create + * a reference to the frame data (or copy it if the frame is + * not reference-counted). + * It can be NULL, in which case it is considered a flush + * packet. This signals the end of the stream. If the encoder + * still has packets buffered, it will return them after this + * call. Once flushing mode has been entered, additional flush + * packets are ignored, and sending frames will return + * AVERROR_EOF. + * + * For audio: + * If AV_CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame + * can have any number of samples. + * If it is not set, frame->nb_samples must be equal to + * avctx->frame_size for all frames except the last. + * The final frame may be smaller than avctx->frame_size. + * @return 0 on success, otherwise negative error code: + * AVERROR(EAGAIN): input is not accepted right now - the frame must be + * resent after trying to read output packets + * AVERROR_EOF: the encoder has been flushed, and no new frames can + * be sent to it + * AVERROR(EINVAL): codec not opened, refcounted_frames not set, it is a + * decoder, or requires flush + * AVERROR(ENOMEM): failed to add packet to internal queue, or similar + * other errors: legitimate decoding errors + */ +int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame); + +/** + * Read encoded data from the encoder. + * + * @param avctx codec context + * @param avpkt This will be set to a reference-counted packet allocated by the + * encoder. Note that the function will always call + * av_frame_unref(frame) before doing anything else. + * @return 0 on success, otherwise negative error code: + * AVERROR(EAGAIN): output is not available right now - user must try + * to send input + * AVERROR_EOF: the encoder has been fully flushed, and there will be + * no more output packets + * AVERROR(EINVAL): codec not opened, or it is an encoder + * other errors: legitimate decoding errors + */ +int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt); + + +/** + * @defgroup lavc_parsing Frame parsing + * @{ + */ + +enum AVPictureStructure { + AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown + AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field + AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field + AV_PICTURE_STRUCTURE_FRAME, //< coded as frame +}; + +typedef struct AVCodecParserContext { + void *priv_data; + struct AVCodecParser *parser; + int64_t frame_offset; /* offset of the current frame */ + int64_t cur_offset; /* current offset + (incremented by each av_parser_parse()) */ + int64_t next_frame_offset; /* offset of the next frame */ + /* video info */ + int pict_type; /* XXX: Put it back in AVCodecContext. */ + /** + * This field is used for proper frame duration computation in lavf. + * It signals, how much longer the frame duration of the current frame + * is compared to normal frame duration. + * + * frame_duration = (1 + repeat_pict) * time_base + * + * It is used by codecs like H.264 to display telecined material. + */ + int repeat_pict; /* XXX: Put it back in AVCodecContext. */ + int64_t pts; /* pts of the current frame */ + int64_t dts; /* dts of the current frame */ + + /* private data */ + int64_t last_pts; + int64_t last_dts; + int fetch_timestamp; + +#define AV_PARSER_PTS_NB 4 + int cur_frame_start_index; + int64_t cur_frame_offset[AV_PARSER_PTS_NB]; + int64_t cur_frame_pts[AV_PARSER_PTS_NB]; + int64_t cur_frame_dts[AV_PARSER_PTS_NB]; + + int flags; +#define PARSER_FLAG_COMPLETE_FRAMES 0x0001 +#define PARSER_FLAG_ONCE 0x0002 +/// Set if the parser has a valid file offset +#define PARSER_FLAG_FETCHED_OFFSET 0x0004 +#define PARSER_FLAG_USE_CODEC_TS 0x1000 + + int64_t offset; ///< byte offset from starting packet start + int64_t cur_frame_end[AV_PARSER_PTS_NB]; + + /** + * Set by parser to 1 for key frames and 0 for non-key frames. + * It is initialized to -1, so if the parser doesn't set this flag, + * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames + * will be used. + */ + int key_frame; + +#if FF_API_CONVERGENCE_DURATION + /** + * @deprecated unused + */ + attribute_deprecated + int64_t convergence_duration; +#endif + + // Timestamp generation support: + /** + * Synchronization point for start of timestamp generation. + * + * Set to >0 for sync point, 0 for no sync point and <0 for undefined + * (default). + * + * For example, this corresponds to presence of H.264 buffering period + * SEI message. + */ + int dts_sync_point; + + /** + * Offset of the current timestamp against last timestamp sync point in + * units of AVCodecContext.time_base. + * + * Set to INT_MIN when dts_sync_point unused. Otherwise, it must + * contain a valid timestamp offset. + * + * Note that the timestamp of sync point has usually a nonzero + * dts_ref_dts_delta, which refers to the previous sync point. Offset of + * the next frame after timestamp sync point will be usually 1. + * + * For example, this corresponds to H.264 cpb_removal_delay. + */ + int dts_ref_dts_delta; + + /** + * Presentation delay of current frame in units of AVCodecContext.time_base. + * + * Set to INT_MIN when dts_sync_point unused. Otherwise, it must + * contain valid non-negative timestamp delta (presentation time of a frame + * must not lie in the past). + * + * This delay represents the difference between decoding and presentation + * time of the frame. + * + * For example, this corresponds to H.264 dpb_output_delay. + */ + int pts_dts_delta; + + /** + * Position of the packet in file. + * + * Analogous to cur_frame_pts/dts + */ + int64_t cur_frame_pos[AV_PARSER_PTS_NB]; + + /** + * Byte position of currently parsed frame in stream. + */ + int64_t pos; + + /** + * Previous frame byte position. + */ + int64_t last_pos; + + /** + * Duration of the current frame. + * For audio, this is in units of 1 / AVCodecContext.sample_rate. + * For all other types, this is in units of AVCodecContext.time_base. + */ + int duration; + + enum AVFieldOrder field_order; + + /** + * Indicate whether a picture is coded as a frame, top field or bottom field. + * + * For example, H.264 field_pic_flag equal to 0 corresponds to + * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag + * equal to 1 and bottom_field_flag equal to 0 corresponds to + * AV_PICTURE_STRUCTURE_TOP_FIELD. + */ + enum AVPictureStructure picture_structure; + + /** + * Picture number incremented in presentation or output order. + * This field may be reinitialized at the first picture of a new sequence. + * + * For example, this corresponds to H.264 PicOrderCnt. + */ + int output_picture_number; + + /** + * Dimensions of the decoded video intended for presentation. + */ + int width; + int height; + + /** + * Dimensions of the coded video. + */ + int coded_width; + int coded_height; + + /** + * The format of the coded data, corresponds to enum AVPixelFormat for video + * and for enum AVSampleFormat for audio. + * + * Note that a decoder can have considerable freedom in how exactly it + * decodes the data, so the format reported here might be different from the + * one returned by a decoder. + */ + int format; +} AVCodecParserContext; + +typedef struct AVCodecParser { + int codec_ids[5]; /* several codec IDs are permitted */ + int priv_data_size; + int (*parser_init)(AVCodecParserContext *s); + /* This callback never returns an error, a negative value means that + * the frame start was in a previous packet. */ + int (*parser_parse)(AVCodecParserContext *s, + AVCodecContext *avctx, + const uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size); + void (*parser_close)(AVCodecParserContext *s); + int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size); + struct AVCodecParser *next; +} AVCodecParser; + +AVCodecParser *av_parser_next(const AVCodecParser *c); + +void av_register_codec_parser(AVCodecParser *parser); +AVCodecParserContext *av_parser_init(int codec_id); + +/** + * Parse a packet. + * + * @param s parser context. + * @param avctx codec context. + * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. + * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. + * @param buf input buffer. + * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). + * @param pts input presentation timestamp. + * @param dts input decoding timestamp. + * @param pos input byte position in stream. + * @return the number of bytes of the input bitstream used. + * + * Example: + * @code + * while(in_len){ + * len = av_parser_parse2(myparser, AVCodecContext, &data, &size, + * in_data, in_len, + * pts, dts, pos); + * in_data += len; + * in_len -= len; + * + * if(size) + * decode_frame(data, size); + * } + * @endcode + */ +int av_parser_parse2(AVCodecParserContext *s, + AVCodecContext *avctx, + uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size, + int64_t pts, int64_t dts, + int64_t pos); + +/** + * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed + * @deprecated use AVBitStreamFilter + */ +int av_parser_change(AVCodecParserContext *s, + AVCodecContext *avctx, + uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size, int keyframe); +void av_parser_close(AVCodecParserContext *s); + +/** + * @} + * @} + */ + +/** + * @addtogroup lavc_encoding + * @{ + */ + +/** + * Find a registered encoder with a matching codec ID. + * + * @param id AVCodecID of the requested encoder + * @return An encoder if one was found, NULL otherwise. + */ +AVCodec *avcodec_find_encoder(enum AVCodecID id); + +/** + * Find a registered encoder with the specified name. + * + * @param name name of the requested encoder + * @return An encoder if one was found, NULL otherwise. + */ +AVCodec *avcodec_find_encoder_by_name(const char *name); + +/** + * Encode a frame of audio. + * + * Takes input samples from frame and writes the next output packet, if + * available, to avpkt. The output packet does not necessarily contain data for + * the most recent frame, as encoders can delay, split, and combine input frames + * internally as needed. + * + * @param avctx codec context + * @param avpkt output AVPacket. + * The user can supply an output buffer by setting + * avpkt->data and avpkt->size prior to calling the + * function, but if the size of the user-provided data is not + * large enough, encoding will fail. If avpkt->data and + * avpkt->size are set, avpkt->destruct must also be set. All + * other AVPacket fields will be reset by the encoder using + * av_init_packet(). If avpkt->data is NULL, the encoder will + * allocate it. The encoder will set avpkt->size to the size + * of the output packet. + * + * If this function fails or produces no output, avpkt will be + * freed using av_packet_unref(). + * @param[in] frame AVFrame containing the raw audio data to be encoded. + * May be NULL when flushing an encoder that has the + * AV_CODEC_CAP_DELAY capability set. + * If AV_CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame + * can have any number of samples. + * If it is not set, frame->nb_samples must be equal to + * avctx->frame_size for all frames except the last. + * The final frame may be smaller than avctx->frame_size. + * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the + * output packet is non-empty, and to 0 if it is + * empty. If the function returns an error, the + * packet can be assumed to be invalid, and the + * value of got_packet_ptr is undefined and should + * not be used. + * @return 0 on success, negative error code on failure + * + * @deprecated use avcodec_send_frame()/avcodec_receive_packet() instead + */ +attribute_deprecated +int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, + const AVFrame *frame, int *got_packet_ptr); + +/** + * Encode a frame of video. + * + * Takes input raw video data from frame and writes the next output packet, if + * available, to avpkt. The output packet does not necessarily contain data for + * the most recent frame, as encoders can delay and reorder input frames + * internally as needed. + * + * @param avctx codec context + * @param avpkt output AVPacket. + * The user can supply an output buffer by setting + * avpkt->data and avpkt->size prior to calling the + * function, but if the size of the user-provided data is not + * large enough, encoding will fail. All other AVPacket fields + * will be reset by the encoder using av_init_packet(). If + * avpkt->data is NULL, the encoder will allocate it. + * The encoder will set avpkt->size to the size of the + * output packet. The returned data (if any) belongs to the + * caller, he is responsible for freeing it. + * + * If this function fails or produces no output, avpkt will be + * freed using av_packet_unref(). + * @param[in] frame AVFrame containing the raw video data to be encoded. + * May be NULL when flushing an encoder that has the + * AV_CODEC_CAP_DELAY capability set. + * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the + * output packet is non-empty, and to 0 if it is + * empty. If the function returns an error, the + * packet can be assumed to be invalid, and the + * value of got_packet_ptr is undefined and should + * not be used. + * @return 0 on success, negative error code on failure + * + * @deprecated use avcodec_send_frame()/avcodec_receive_packet() instead + */ +attribute_deprecated +int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, + const AVFrame *frame, int *got_packet_ptr); + +int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, + const AVSubtitle *sub); + + +/** + * @} + */ + +#if FF_API_AVCODEC_RESAMPLE +/** + * @defgroup lavc_resample Audio resampling + * @ingroup libavc + * @deprecated use libswresample instead + * + * @{ + */ +struct ReSampleContext; +struct AVResampleContext; + +typedef struct ReSampleContext ReSampleContext; + +/** + * Initialize audio resampling context. + * + * @param output_channels number of output channels + * @param input_channels number of input channels + * @param output_rate output sample rate + * @param input_rate input sample rate + * @param sample_fmt_out requested output sample format + * @param sample_fmt_in input sample format + * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency + * @param log2_phase_count log2 of the number of entries in the polyphase filterbank + * @param linear if 1 then the used FIR filter will be linearly interpolated + between the 2 closest, if 0 the closest will be used + * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate + * @return allocated ReSampleContext, NULL if error occurred + */ +attribute_deprecated +ReSampleContext *av_audio_resample_init(int output_channels, int input_channels, + int output_rate, int input_rate, + enum AVSampleFormat sample_fmt_out, + enum AVSampleFormat sample_fmt_in, + int filter_length, int log2_phase_count, + int linear, double cutoff); + +attribute_deprecated +int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples); + +/** + * Free resample context. + * + * @param s a non-NULL pointer to a resample context previously + * created with av_audio_resample_init() + */ +attribute_deprecated +void audio_resample_close(ReSampleContext *s); + + +/** + * Initialize an audio resampler. + * Note, if either rate is not an integer then simply scale both rates up so they are. + * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq + * @param log2_phase_count log2 of the number of entries in the polyphase filterbank + * @param linear If 1 then the used FIR filter will be linearly interpolated + between the 2 closest, if 0 the closest will be used + * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate + */ +attribute_deprecated +struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff); + +/** + * Resample an array of samples using a previously configured context. + * @param src an array of unconsumed samples + * @param consumed the number of samples of src which have been consumed are returned here + * @param src_size the number of unconsumed samples available + * @param dst_size the amount of space in samples available in dst + * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. + * @return the number of samples written in dst or -1 if an error occurred + */ +attribute_deprecated +int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx); + + +/** + * Compensate samplerate/timestamp drift. The compensation is done by changing + * the resampler parameters, so no audible clicks or similar distortions occur + * @param compensation_distance distance in output samples over which the compensation should be performed + * @param sample_delta number of output samples which should be output less + * + * example: av_resample_compensate(c, 10, 500) + * here instead of 510 samples only 500 samples would be output + * + * note, due to rounding the actual compensation might be slightly different, + * especially if the compensation_distance is large and the in_rate used during init is small + */ +attribute_deprecated +void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance); +attribute_deprecated +void av_resample_close(struct AVResampleContext *c); + +/** + * @} + */ +#endif + +#if FF_API_AVPICTURE +/** + * @addtogroup lavc_picture + * @{ + */ + +/** + * @deprecated unused + */ +attribute_deprecated +int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height); + +/** + * @deprecated unused + */ +attribute_deprecated +void avpicture_free(AVPicture *picture); + +/** + * @deprecated use av_image_fill_arrays() instead. + */ +attribute_deprecated +int avpicture_fill(AVPicture *picture, const uint8_t *ptr, + enum AVPixelFormat pix_fmt, int width, int height); + +/** + * @deprecated use av_image_copy_to_buffer() instead. + */ +attribute_deprecated +int avpicture_layout(const AVPicture *src, enum AVPixelFormat pix_fmt, + int width, int height, + unsigned char *dest, int dest_size); + +/** + * @deprecated use av_image_get_buffer_size() instead. + */ +attribute_deprecated +int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height); + +/** + * @deprecated av_image_copy() instead. + */ +attribute_deprecated +void av_picture_copy(AVPicture *dst, const AVPicture *src, + enum AVPixelFormat pix_fmt, int width, int height); + +/** + * @deprecated unused + */ +attribute_deprecated +int av_picture_crop(AVPicture *dst, const AVPicture *src, + enum AVPixelFormat pix_fmt, int top_band, int left_band); + +/** + * @deprecated unused + */ +attribute_deprecated +int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt, + int padtop, int padbottom, int padleft, int padright, int *color); + +/** + * @} + */ +#endif + +/** + * @defgroup lavc_misc Utility functions + * @ingroup libavc + * + * Miscellaneous utility functions related to both encoding and decoding + * (or neither). + * @{ + */ + +/** + * @defgroup lavc_misc_pixfmt Pixel formats + * + * Functions for working with pixel formats. + * @{ + */ + +/** + * Utility function to access log2_chroma_w log2_chroma_h from + * the pixel format AVPixFmtDescriptor. + * + * This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample + * for one that returns a failure code and continues in case of invalid + * pix_fmts. + * + * @param[in] pix_fmt the pixel format + * @param[out] h_shift store log2_chroma_w + * @param[out] v_shift store log2_chroma_h + * + * @see av_pix_fmt_get_chroma_sub_sample + */ + +void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift); + +/** + * Return a value representing the fourCC code associated to the + * pixel format pix_fmt, or 0 if no associated fourCC code can be + * found. + */ +unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt); + +/** + * @deprecated see av_get_pix_fmt_loss() + */ +int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt, + int has_alpha); + +/** + * Find the best pixel format to convert to given a certain source pixel + * format. When converting from one pixel format to another, information loss + * may occur. For example, when converting from RGB24 to GRAY, the color + * information will be lost. Similarly, other losses occur when converting from + * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of + * the given pixel formats should be used to suffer the least amount of loss. + * The pixel formats from which it chooses one, are determined by the + * pix_fmt_list parameter. + * + * + * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from + * @param[in] src_pix_fmt source pixel format + * @param[in] has_alpha Whether the source pixel format alpha channel is used. + * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. + * @return The best pixel format to convert to or -1 if none was found. + */ +enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(const enum AVPixelFormat *pix_fmt_list, + enum AVPixelFormat src_pix_fmt, + int has_alpha, int *loss_ptr); + +/** + * @deprecated see av_find_best_pix_fmt_of_2() + */ +enum AVPixelFormat avcodec_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, + enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); + +attribute_deprecated +#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI +enum AVPixelFormat avcodec_find_best_pix_fmt2(const enum AVPixelFormat *pix_fmt_list, + enum AVPixelFormat src_pix_fmt, + int has_alpha, int *loss_ptr); +#else +enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, + enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); +#endif + + +enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt); + +/** + * @} + */ + +#if FF_API_SET_DIMENSIONS +/** + * @deprecated this function is not supposed to be used from outside of lavc + */ +attribute_deprecated +void avcodec_set_dimensions(AVCodecContext *s, int width, int height); +#endif + +/** + * Put a string representing the codec tag codec_tag in buf. + * + * @param buf buffer to place codec tag in + * @param buf_size size in bytes of buf + * @param codec_tag codec tag to assign + * @return the length of the string that would have been generated if + * enough space had been available, excluding the trailing null + */ +size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag); + +void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode); + +/** + * Return a name for the specified profile, if available. + * + * @param codec the codec that is searched for the given profile + * @param profile the profile value for which a name is requested + * @return A name for the profile if found, NULL otherwise. + */ +const char *av_get_profile_name(const AVCodec *codec, int profile); + +/** + * Return a name for the specified profile, if available. + * + * @param codec_id the ID of the codec to which the requested profile belongs + * @param profile the profile value for which a name is requested + * @return A name for the profile if found, NULL otherwise. + * + * @note unlike av_get_profile_name(), which searches a list of profiles + * supported by a specific decoder or encoder implementation, this + * function searches the list of profiles from the AVCodecDescriptor + */ +const char *avcodec_profile_name(enum AVCodecID codec_id, int profile); + +int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size); +int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count); +//FIXME func typedef + +/** + * Fill AVFrame audio data and linesize pointers. + * + * The buffer buf must be a preallocated buffer with a size big enough + * to contain the specified samples amount. The filled AVFrame data + * pointers will point to this buffer. + * + * AVFrame extended_data channel pointers are allocated if necessary for + * planar audio. + * + * @param frame the AVFrame + * frame->nb_samples must be set prior to calling the + * function. This function fills in frame->data, + * frame->extended_data, frame->linesize[0]. + * @param nb_channels channel count + * @param sample_fmt sample format + * @param buf buffer to use for frame data + * @param buf_size size of buffer + * @param align plane size sample alignment (0 = default) + * @return >=0 on success, negative error code on failure + * @todo return the size in bytes required to store the samples in + * case of success, at the next libavutil bump + */ +int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, + enum AVSampleFormat sample_fmt, const uint8_t *buf, + int buf_size, int align); + +/** + * Reset the internal decoder state / flush internal buffers. Should be called + * e.g. when seeking or when switching to a different stream. + * + * @note when refcounted frames are not used (i.e. avctx->refcounted_frames is 0), + * this invalidates the frames previously returned from the decoder. When + * refcounted frames are used, the decoder just releases any references it might + * keep internally, but the caller's reference remains valid. + */ +void avcodec_flush_buffers(AVCodecContext *avctx); + +/** + * Return codec bits per sample. + * + * @param[in] codec_id the codec + * @return Number of bits per sample or zero if unknown for the given codec. + */ +int av_get_bits_per_sample(enum AVCodecID codec_id); + +/** + * Return the PCM codec associated with a sample format. + * @param be endianness, 0 for little, 1 for big, + * -1 (or anything else) for native + * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE + */ +enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be); + +/** + * Return codec bits per sample. + * Only return non-zero if the bits per sample is exactly correct, not an + * approximation. + * + * @param[in] codec_id the codec + * @return Number of bits per sample or zero if unknown for the given codec. + */ +int av_get_exact_bits_per_sample(enum AVCodecID codec_id); + +/** + * Return audio frame duration. + * + * @param avctx codec context + * @param frame_bytes size of the frame, or 0 if unknown + * @return frame duration, in samples, if known. 0 if not able to + * determine. + */ +int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes); + +/** + * This function is the same as av_get_audio_frame_duration(), except it works + * with AVCodecParameters instead of an AVCodecContext. + */ +int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes); + +#if FF_API_OLD_BSF +typedef struct AVBitStreamFilterContext { + void *priv_data; + struct AVBitStreamFilter *filter; + AVCodecParserContext *parser; + struct AVBitStreamFilterContext *next; + /** + * Internal default arguments, used if NULL is passed to av_bitstream_filter_filter(). + * Not for access by library users. + */ + char *args; +} AVBitStreamFilterContext; +#endif + +typedef struct AVBSFInternal AVBSFInternal; + +/** + * The bitstream filter state. + * + * This struct must be allocated with av_bsf_alloc() and freed with + * av_bsf_free(). + * + * The fields in the struct will only be changed (by the caller or by the + * filter) as described in their documentation, and are to be considered + * immutable otherwise. + */ +typedef struct AVBSFContext { + /** + * A class for logging and AVOptions + */ + const AVClass *av_class; + + /** + * The bitstream filter this context is an instance of. + */ + const struct AVBitStreamFilter *filter; + + /** + * Opaque libavcodec internal data. Must not be touched by the caller in any + * way. + */ + AVBSFInternal *internal; + + /** + * Opaque filter-specific private data. If filter->priv_class is non-NULL, + * this is an AVOptions-enabled struct. + */ + void *priv_data; + + /** + * Parameters of the input stream. Set by the caller before av_bsf_init(). + */ + AVCodecParameters *par_in; + + /** + * Parameters of the output stream. Set by the filter in av_bsf_init(). + */ + AVCodecParameters *par_out; + + /** + * The timebase used for the timestamps of the input packets. Set by the + * caller before av_bsf_init(). + */ + AVRational time_base_in; + + /** + * The timebase used for the timestamps of the output packets. Set by the + * filter in av_bsf_init(). + */ + AVRational time_base_out; +} AVBSFContext; + +typedef struct AVBitStreamFilter { + const char *name; + + /** + * A list of codec ids supported by the filter, terminated by + * AV_CODEC_ID_NONE. + * May be NULL, in that case the bitstream filter works with any codec id. + */ + const enum AVCodecID *codec_ids; + + /** + * A class for the private data, used to declare bitstream filter private + * AVOptions. This field is NULL for bitstream filters that do not declare + * any options. + * + * If this field is non-NULL, the first member of the filter private data + * must be a pointer to AVClass, which will be set by libavcodec generic + * code to this class. + */ + const AVClass *priv_class; + + /***************************************************************** + * No fields below this line are part of the public API. They + * may not be used outside of libavcodec and can be changed and + * removed at will. + * New public fields should be added right above. + ***************************************************************** + */ + + int priv_data_size; + int (*init)(AVBSFContext *ctx); + int (*filter)(AVBSFContext *ctx, AVPacket *pkt); + void (*close)(AVBSFContext *ctx); +} AVBitStreamFilter; + +#if FF_API_OLD_BSF +/** + * Register a bitstream filter. + * + * The filter will be accessible to the application code through + * av_bitstream_filter_next() or can be directly initialized with + * av_bitstream_filter_init(). + * + * @see avcodec_register_all() + */ +attribute_deprecated +void av_register_bitstream_filter(AVBitStreamFilter *bsf); + +/** + * Create and initialize a bitstream filter context given a bitstream + * filter name. + * + * The returned context must be freed with av_bitstream_filter_close(). + * + * @param name the name of the bitstream filter + * @return a bitstream filter context if a matching filter was found + * and successfully initialized, NULL otherwise + */ +attribute_deprecated +AVBitStreamFilterContext *av_bitstream_filter_init(const char *name); + +/** + * Filter bitstream. + * + * This function filters the buffer buf with size buf_size, and places the + * filtered buffer in the buffer pointed to by poutbuf. + * + * The output buffer must be freed by the caller. + * + * @param bsfc bitstream filter context created by av_bitstream_filter_init() + * @param avctx AVCodecContext accessed by the filter, may be NULL. + * If specified, this must point to the encoder context of the + * output stream the packet is sent to. + * @param args arguments which specify the filter configuration, may be NULL + * @param poutbuf pointer which is updated to point to the filtered buffer + * @param poutbuf_size pointer which is updated to the filtered buffer size in bytes + * @param buf buffer containing the data to filter + * @param buf_size size in bytes of buf + * @param keyframe set to non-zero if the buffer to filter corresponds to a key-frame packet data + * @return >= 0 in case of success, or a negative error code in case of failure + * + * If the return value is positive, an output buffer is allocated and + * is available in *poutbuf, and is distinct from the input buffer. + * + * If the return value is 0, the output buffer is not allocated and + * should be considered identical to the input buffer, or in case + * *poutbuf was set it points to the input buffer (not necessarily to + * its starting address). A special case is if *poutbuf was set to NULL and + * *poutbuf_size was set to 0, which indicates the packet should be dropped. + */ +attribute_deprecated +int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc, + AVCodecContext *avctx, const char *args, + uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size, int keyframe); + +/** + * Release bitstream filter context. + * + * @param bsf the bitstream filter context created with + * av_bitstream_filter_init(), can be NULL + */ +attribute_deprecated +void av_bitstream_filter_close(AVBitStreamFilterContext *bsf); + +/** + * If f is NULL, return the first registered bitstream filter, + * if f is non-NULL, return the next registered bitstream filter + * after f, or NULL if f is the last one. + * + * This function can be used to iterate over all registered bitstream + * filters. + */ +attribute_deprecated +AVBitStreamFilter *av_bitstream_filter_next(const AVBitStreamFilter *f); +#endif + +/** + * @return a bitstream filter with the specified name or NULL if no such + * bitstream filter exists. + */ +const AVBitStreamFilter *av_bsf_get_by_name(const char *name); + +/** + * Iterate over all registered bitstream filters. + * + * @param opaque a pointer where libavcodec will store the iteration state. Must + * point to NULL to start the iteration. + * + * @return the next registered bitstream filter or NULL when the iteration is + * finished + */ +const AVBitStreamFilter *av_bsf_next(void **opaque); + +/** + * Allocate a context for a given bitstream filter. The caller must fill in the + * context parameters as described in the documentation and then call + * av_bsf_init() before sending any data to the filter. + * + * @param filter the filter for which to allocate an instance. + * @param ctx a pointer into which the pointer to the newly-allocated context + * will be written. It must be freed with av_bsf_free() after the + * filtering is done. + * + * @return 0 on success, a negative AVERROR code on failure + */ +int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **ctx); + +/** + * Prepare the filter for use, after all the parameters and options have been + * set. + */ +int av_bsf_init(AVBSFContext *ctx); + +/** + * Submit a packet for filtering. + * + * After sending each packet, the filter must be completely drained by calling + * av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or + * AVERROR_EOF. + * + * @param pkt the packet to filter. The bitstream filter will take ownership of + * the packet and reset the contents of pkt. pkt is not touched if an error occurs. + * This parameter may be NULL, which signals the end of the stream (i.e. no more + * packets will be sent). That will cause the filter to output any packets it + * may have buffered internally. + * + * @return 0 on success, a negative AVERROR on error. + */ +int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt); + +/** + * Retrieve a filtered packet. + * + * @param[out] pkt this struct will be filled with the contents of the filtered + * packet. It is owned by the caller and must be freed using + * av_packet_unref() when it is no longer needed. + * This parameter should be "clean" (i.e. freshly allocated + * with av_packet_alloc() or unreffed with av_packet_unref()) + * when this function is called. If this function returns + * successfully, the contents of pkt will be completely + * overwritten by the returned data. On failure, pkt is not + * touched. + * + * @return 0 on success. AVERROR(EAGAIN) if more packets need to be sent to the + * filter (using av_bsf_send_packet()) to get more output. AVERROR_EOF if there + * will be no further output from the filter. Another negative AVERROR value if + * an error occurs. + * + * @note one input packet may result in several output packets, so after sending + * a packet with av_bsf_send_packet(), this function needs to be called + * repeatedly until it stops returning 0. It is also possible for a filter to + * output fewer packets than were sent to it, so this function may return + * AVERROR(EAGAIN) immediately after a successful av_bsf_send_packet() call. + */ +int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt); + +/** + * Free a bitstream filter context and everything associated with it; write NULL + * into the supplied pointer. + */ +void av_bsf_free(AVBSFContext **ctx); + +/** + * Get the AVClass for AVBSFContext. It can be used in combination with + * AV_OPT_SEARCH_FAKE_OBJ for examining options. + * + * @see av_opt_find(). + */ +const AVClass *av_bsf_get_class(void); + +/* memory */ + +/** + * Same behaviour av_fast_malloc but the buffer has additional + * AV_INPUT_BUFFER_PADDING_SIZE at the end which will always be 0. + * + * In addition the whole buffer will initially and after resizes + * be 0-initialized so that no uninitialized data will ever appear. + */ +void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size); + +/** + * Same behaviour av_fast_padded_malloc except that buffer will always + * be 0-initialized after call. + */ +void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size); + +/** + * Encode extradata length to a buffer. Used by xiph codecs. + * + * @param s buffer to write to; must be at least (v/255+1) bytes long + * @param v size of extradata in bytes + * @return number of bytes written to the buffer. + */ +unsigned int av_xiphlacing(unsigned char *s, unsigned int v); + +#if FF_API_MISSING_SAMPLE +/** + * Log a generic warning message about a missing feature. This function is + * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) + * only, and would normally not be used by applications. + * @param[in] avc a pointer to an arbitrary struct of which the first field is + * a pointer to an AVClass struct + * @param[in] feature string containing the name of the missing feature + * @param[in] want_sample indicates if samples are wanted which exhibit this feature. + * If want_sample is non-zero, additional verbiage will be added to the log + * message which tells the user how to report samples to the development + * mailing list. + * @deprecated Use avpriv_report_missing_feature() instead. + */ +attribute_deprecated +void av_log_missing_feature(void *avc, const char *feature, int want_sample); + +/** + * Log a generic warning message asking for a sample. This function is + * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) + * only, and would normally not be used by applications. + * @param[in] avc a pointer to an arbitrary struct of which the first field is + * a pointer to an AVClass struct + * @param[in] msg string containing an optional message, or NULL if no message + * @deprecated Use avpriv_request_sample() instead. + */ +attribute_deprecated +void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3); +#endif /* FF_API_MISSING_SAMPLE */ + +/** + * Register the hardware accelerator hwaccel. + */ +void av_register_hwaccel(AVHWAccel *hwaccel); + +/** + * If hwaccel is NULL, returns the first registered hardware accelerator, + * if hwaccel is non-NULL, returns the next registered hardware accelerator + * after hwaccel, or NULL if hwaccel is the last one. + */ +AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel); + + +/** + * Lock operation used by lockmgr + */ +enum AVLockOp { + AV_LOCK_CREATE, ///< Create a mutex + AV_LOCK_OBTAIN, ///< Lock the mutex + AV_LOCK_RELEASE, ///< Unlock the mutex + AV_LOCK_DESTROY, ///< Free mutex resources +}; + +/** + * Register a user provided lock manager supporting the operations + * specified by AVLockOp. The "mutex" argument to the function points + * to a (void *) where the lockmgr should store/get a pointer to a user + * allocated mutex. It is NULL upon AV_LOCK_CREATE and equal to the + * value left by the last call for all other ops. If the lock manager is + * unable to perform the op then it should leave the mutex in the same + * state as when it was called and return a non-zero value. However, + * when called with AV_LOCK_DESTROY the mutex will always be assumed to + * have been successfully destroyed. If av_lockmgr_register succeeds + * it will return a non-negative value, if it fails it will return a + * negative value and destroy all mutex and unregister all callbacks. + * av_lockmgr_register is not thread-safe, it must be called from a + * single thread before any calls which make use of locking are used. + * + * @param cb User defined callback. av_lockmgr_register invokes calls + * to this callback and the previously registered callback. + * The callback will be used to create more than one mutex + * each of which must be backed by its own underlying locking + * mechanism (i.e. do not use a single static object to + * implement your lock manager). If cb is set to NULL the + * lockmgr will be unregistered. + */ +int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)); + +/** + * Get the type of the given codec. + */ +enum AVMediaType avcodec_get_type(enum AVCodecID codec_id); + +/** + * Get the name of a codec. + * @return a static string identifying the codec; never NULL + */ +const char *avcodec_get_name(enum AVCodecID id); + +/** + * @return a positive value if s is open (i.e. avcodec_open2() was called on it + * with no corresponding avcodec_close()), 0 otherwise. + */ +int avcodec_is_open(AVCodecContext *s); + +/** + * @return a non-zero number if codec is an encoder, zero otherwise + */ +int av_codec_is_encoder(const AVCodec *codec); + +/** + * @return a non-zero number if codec is a decoder, zero otherwise + */ +int av_codec_is_decoder(const AVCodec *codec); + +/** + * @return descriptor for given codec ID or NULL if no descriptor exists. + */ +const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id); + +/** + * Iterate over all codec descriptors known to libavcodec. + * + * @param prev previous descriptor. NULL to get the first descriptor. + * + * @return next descriptor or NULL after the last descriptor + */ +const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev); + +/** + * @return codec descriptor with the given name or NULL if no such descriptor + * exists. + */ +const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name); + +/** + * Allocate a CPB properties structure and initialize its fields to default + * values. + * + * @param size if non-NULL, the size of the allocated struct will be written + * here. This is useful for embedding it in side data. + * + * @return the newly allocated struct or NULL on failure + */ +AVCPBProperties *av_cpb_properties_alloc(size_t *size); + +/** + * @} + */ + +#endif /* AVCODEC_AVCODEC_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/avdct.h b/Src/Decoder_H264_ALL/include/libavcodec/avdct.h new file mode 100644 index 0000000..272422e --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/avdct.h @@ -0,0 +1,84 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_AVDCT_H +#define AVCODEC_AVDCT_H + +#include "libavutil/opt.h" + +/** + * AVDCT context. + * @note function pointers can be NULL if the specific features have been + * disabled at build time. + */ +typedef struct AVDCT { + const AVClass *av_class; + + void (*idct)(int16_t *block /* align 16 */); + + /** + * IDCT input permutation. + * Several optimized IDCTs need a permutated input (relative to the + * normal order of the reference IDCT). + * This permutation must be performed before the idct_put/add. + * Note, normally this can be merged with the zigzag/alternate scan
+ * An example to avoid confusion: + * - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...) + * - (x -> reference DCT -> reference IDCT -> x) + * - (x -> reference DCT -> simple_mmx_perm = idct_permutation + * -> simple_idct_mmx -> x) + * - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant + * -> simple_idct_mmx -> ...) + */ + uint8_t idct_permutation[64]; + + void (*fdct)(int16_t *block /* align 16 */); + + + /** + * DCT algorithm. + * must use AVOptions to set this field. + */ + int dct_algo; + + /** + * IDCT algorithm. + * must use AVOptions to set this field. + */ + int idct_algo; + + void (*get_pixels)(int16_t *block /* align 16 */, + const uint8_t *pixels /* align 8 */, + ptrdiff_t line_size); + + int bits_per_sample; +} AVDCT; + +/** + * Allocates a AVDCT context. + * This needs to be initialized with avcodec_dct_init() after optionally + * configuring it with AVOptions. + * + * To free it use av_free() + */ +AVDCT *avcodec_dct_alloc(void); +int avcodec_dct_init(AVDCT *); + +const AVClass *avcodec_dct_get_class(void); + +#endif /* AVCODEC_AVDCT_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/avfft.h b/Src/Decoder_H264_ALL/include/libavcodec/avfft.h new file mode 100644 index 0000000..0c0f9b8 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/avfft.h @@ -0,0 +1,118 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_AVFFT_H +#define AVCODEC_AVFFT_H + +/** + * @file + * @ingroup lavc_fft + * FFT functions + */ + +/** + * @defgroup lavc_fft FFT functions + * @ingroup lavc_misc + * + * @{ + */ + +typedef float FFTSample; + +typedef struct FFTComplex { + FFTSample re, im; +} FFTComplex; + +typedef struct FFTContext FFTContext; + +/** + * Set up a complex FFT. + * @param nbits log2 of the length of the input array + * @param inverse if 0 perform the forward transform, if 1 perform the inverse + */ +FFTContext *av_fft_init(int nbits, int inverse); + +/** + * Do the permutation needed BEFORE calling ff_fft_calc(). + */ +void av_fft_permute(FFTContext *s, FFTComplex *z); + +/** + * Do a complex FFT with the parameters defined in av_fft_init(). The + * input data must be permuted before. No 1.0/sqrt(n) normalization is done. + */ +void av_fft_calc(FFTContext *s, FFTComplex *z); + +void av_fft_end(FFTContext *s); + +FFTContext *av_mdct_init(int nbits, int inverse, double scale); +void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input); +void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +void av_mdct_end(FFTContext *s); + +/* Real Discrete Fourier Transform */ + +enum RDFTransformType { + DFT_R2C, + IDFT_C2R, + IDFT_R2C, + DFT_C2R, +}; + +typedef struct RDFTContext RDFTContext; + +/** + * Set up a real FFT. + * @param nbits log2 of the length of the input array + * @param trans the type of transform + */ +RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans); +void av_rdft_calc(RDFTContext *s, FFTSample *data); +void av_rdft_end(RDFTContext *s); + +/* Discrete Cosine Transform */ + +typedef struct DCTContext DCTContext; + +enum DCTTransformType { + DCT_II = 0, + DCT_III, + DCT_I, + DST_I, +}; + +/** + * Set up DCT. + * + * @param nbits size of the input array: + * (1 << nbits) for DCT-II, DCT-III and DST-I + * (1 << nbits) + 1 for DCT-I + * @param type the type of transform + * + * @note the first element of the input of DST-I is ignored + */ +DCTContext *av_dct_init(int nbits, enum DCTTransformType type); +void av_dct_calc(DCTContext *s, FFTSample *data); +void av_dct_end (DCTContext *s); + +/** + * @} + */ + +#endif /* AVCODEC_AVFFT_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/d3d11va.h b/Src/Decoder_H264_ALL/include/libavcodec/d3d11va.h new file mode 100644 index 0000000..6816b6c --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/d3d11va.h @@ -0,0 +1,112 @@ +/* + * Direct3D11 HW acceleration + * + * copyright (c) 2009 Laurent Aimar + * copyright (c) 2015 Steve Lhomme + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_D3D11VA_H +#define AVCODEC_D3D11VA_H + +/** + * @file + * @ingroup lavc_codec_hwaccel_d3d11va + * Public libavcodec D3D11VA header. + */ + +#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602 +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x0602 +#endif + +#include +#include + +/** + * @defgroup lavc_codec_hwaccel_d3d11va Direct3D11 + * @ingroup lavc_codec_hwaccel + * + * @{ + */ + +#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for Direct3D11 and old UVD/UVD+ ATI video cards +#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for Direct3D11 and old Intel GPUs with ClearVideo interface + +/** + * This structure is used to provides the necessary configurations and data + * to the Direct3D11 FFmpeg HWAccel implementation. + * + * The application must make it available as AVCodecContext.hwaccel_context. + * + * Use av_d3d11va_alloc_context() exclusively to allocate an AVD3D11VAContext. + */ +typedef struct AVD3D11VAContext { + /** + * D3D11 decoder object + */ + ID3D11VideoDecoder *decoder; + + /** + * D3D11 VideoContext + */ + ID3D11VideoContext *video_context; + + /** + * D3D11 configuration used to create the decoder + */ + D3D11_VIDEO_DECODER_CONFIG *cfg; + + /** + * The number of surface in the surface array + */ + unsigned surface_count; + + /** + * The array of Direct3D surfaces used to create the decoder + */ + ID3D11VideoDecoderOutputView **surface; + + /** + * A bit field configuring the workarounds needed for using the decoder + */ + uint64_t workaround; + + /** + * Private to the FFmpeg AVHWAccel implementation + */ + unsigned report_id; + + /** + * Mutex to access video_context + */ + HANDLE context_mutex; +} AVD3D11VAContext; + +/** + * Allocate an AVD3D11VAContext. + * + * @return Newly-allocated AVD3D11VAContext or NULL on failure. + */ +AVD3D11VAContext *av_d3d11va_alloc_context(void); + +/** + * @} + */ + +#endif /* AVCODEC_D3D11VA_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/dirac.h b/Src/Decoder_H264_ALL/include/libavcodec/dirac.h new file mode 100644 index 0000000..e6d9d34 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/dirac.h @@ -0,0 +1,131 @@ +/* + * Copyright (C) 2007 Marco Gerards + * Copyright (C) 2009 David Conrad + * Copyright (C) 2011 Jordi Ortiz + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_DIRAC_H +#define AVCODEC_DIRAC_H + +/** + * @file + * Interface to Dirac Decoder/Encoder + * @author Marco Gerards + * @author David Conrad + * @author Jordi Ortiz + */ + +#include "avcodec.h" + +/** + * The spec limits the number of wavelet decompositions to 4 for both + * level 1 (VC-2) and 128 (long-gop default). + * 5 decompositions is the maximum before >16-bit buffers are needed. + * Schroedinger allows this for DD 9,7 and 13,7 wavelets only, limiting + * the others to 4 decompositions (or 3 for the fidelity filter). + * + * We use this instead of MAX_DECOMPOSITIONS to save some memory. + */ +#define MAX_DWT_LEVELS 5 + +/** + * Parse code values: + * + * Dirac Specification -> + * 9.6.1 Table 9.1 + * + * VC-2 Specification -> + * 10.4.1 Table 10.1 + */ + +enum DiracParseCodes { + DIRAC_PCODE_SEQ_HEADER = 0x00, + DIRAC_PCODE_END_SEQ = 0x10, + DIRAC_PCODE_AUX = 0x20, + DIRAC_PCODE_PAD = 0x30, + DIRAC_PCODE_PICTURE_CODED = 0x08, + DIRAC_PCODE_PICTURE_RAW = 0x48, + DIRAC_PCODE_PICTURE_LOW_DEL = 0xC8, + DIRAC_PCODE_PICTURE_HQ = 0xE8, + DIRAC_PCODE_INTER_NOREF_CO1 = 0x0A, + DIRAC_PCODE_INTER_NOREF_CO2 = 0x09, + DIRAC_PCODE_INTER_REF_CO1 = 0x0D, + DIRAC_PCODE_INTER_REF_CO2 = 0x0E, + DIRAC_PCODE_INTRA_REF_CO = 0x0C, + DIRAC_PCODE_INTRA_REF_RAW = 0x4C, + DIRAC_PCODE_INTRA_REF_PICT = 0xCC, + DIRAC_PCODE_MAGIC = 0x42424344, +}; + +typedef struct DiracVersionInfo { + int major; + int minor; +} DiracVersionInfo; + +typedef struct AVDiracSeqHeader { + unsigned width; + unsigned height; + uint8_t chroma_format; ///< 0: 444 1: 422 2: 420 + + uint8_t interlaced; + uint8_t top_field_first; + + uint8_t frame_rate_index; ///< index into dirac_frame_rate[] + uint8_t aspect_ratio_index; ///< index into dirac_aspect_ratio[] + + uint16_t clean_width; + uint16_t clean_height; + uint16_t clean_left_offset; + uint16_t clean_right_offset; + + uint8_t pixel_range_index; ///< index into dirac_pixel_range_presets[] + uint8_t color_spec_index; ///< index into dirac_color_spec_presets[] + + int profile; + int level; + + AVRational framerate; + AVRational sample_aspect_ratio; + + enum AVPixelFormat pix_fmt; + enum AVColorRange color_range; + enum AVColorPrimaries color_primaries; + enum AVColorTransferCharacteristic color_trc; + enum AVColorSpace colorspace; + + DiracVersionInfo version; + int bit_depth; +} AVDiracSeqHeader; + +/** + * Parse a Dirac sequence header. + * + * @param dsh this function will allocate and fill an AVDiracSeqHeader struct + * and write it into this pointer. The caller must free it with + * av_free(). + * @param buf the data buffer + * @param buf_size the size of the data buffer in bytes + * @param log_ctx if non-NULL, this function will log errors here + * @return 0 on success, a negative AVERROR code on failure + */ +int av_dirac_parse_sequence_header(AVDiracSeqHeader **dsh, + const uint8_t *buf, size_t buf_size, + void *log_ctx); + +#endif /* AVCODEC_DIRAC_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/dv_profile.h b/Src/Decoder_H264_ALL/include/libavcodec/dv_profile.h new file mode 100644 index 0000000..9380a66 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/dv_profile.h @@ -0,0 +1,83 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_DV_PROFILE_H +#define AVCODEC_DV_PROFILE_H + +#include + +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" +#include "avcodec.h" + +/* minimum number of bytes to read from a DV stream in order to + * determine the profile */ +#define DV_PROFILE_BYTES (6 * 80) /* 6 DIF blocks */ + + +/* + * AVDVProfile is used to express the differences between various + * DV flavors. For now it's primarily used for differentiating + * 525/60 and 625/50, but the plans are to use it for various + * DV specs as well (e.g. SMPTE314M vs. IEC 61834). + */ +typedef struct AVDVProfile { + int dsf; /* value of the dsf in the DV header */ + int video_stype; /* stype for VAUX source pack */ + int frame_size; /* total size of one frame in bytes */ + int difseg_size; /* number of DIF segments per DIF channel */ + int n_difchan; /* number of DIF channels per frame */ + AVRational time_base; /* 1/framerate */ + int ltc_divisor; /* FPS from the LTS standpoint */ + int height; /* picture height in pixels */ + int width; /* picture width in pixels */ + AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */ + enum AVPixelFormat pix_fmt; /* picture pixel format */ + int bpm; /* blocks per macroblock */ + const uint8_t *block_sizes; /* AC block sizes, in bits */ + int audio_stride; /* size of audio_shuffle table */ + int audio_min_samples[3]; /* min amount of audio samples */ + /* for 48kHz, 44.1kHz and 32kHz */ + int audio_samples_dist[5]; /* how many samples are supposed to be */ + /* in each frame in a 5 frames window */ + const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */ +} AVDVProfile; + +/** + * Get a DV profile for the provided compressed frame. + * + * @param sys the profile used for the previous frame, may be NULL + * @param frame the compressed data buffer + * @param buf_size size of the buffer in bytes + * @return the DV profile for the supplied data or NULL on failure + */ +const AVDVProfile *av_dv_frame_profile(const AVDVProfile *sys, + const uint8_t *frame, unsigned buf_size); + +/** + * Get a DV profile for the provided stream parameters. + */ +const AVDVProfile *av_dv_codec_profile(int width, int height, enum AVPixelFormat pix_fmt); + +/** + * Get a DV profile for the provided stream parameters. + * The frame rate is used as a best-effort parameter. + */ +const AVDVProfile *av_dv_codec_profile2(int width, int height, enum AVPixelFormat pix_fmt, AVRational frame_rate); + +#endif /* AVCODEC_DV_PROFILE_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/dxva2.h b/Src/Decoder_H264_ALL/include/libavcodec/dxva2.h new file mode 100644 index 0000000..22c9399 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/dxva2.h @@ -0,0 +1,93 @@ +/* + * DXVA2 HW acceleration + * + * copyright (c) 2009 Laurent Aimar + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_DXVA2_H +#define AVCODEC_DXVA2_H + +/** + * @file + * @ingroup lavc_codec_hwaccel_dxva2 + * Public libavcodec DXVA2 header. + */ + +#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602 +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x0602 +#endif + +#include +#include +#include + +/** + * @defgroup lavc_codec_hwaccel_dxva2 DXVA2 + * @ingroup lavc_codec_hwaccel + * + * @{ + */ + +#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards +#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for DXVA2 and old Intel GPUs with ClearVideo interface + +/** + * This structure is used to provides the necessary configurations and data + * to the DXVA2 FFmpeg HWAccel implementation. + * + * The application must make it available as AVCodecContext.hwaccel_context. + */ +struct dxva_context { + /** + * DXVA2 decoder object + */ + IDirectXVideoDecoder *decoder; + + /** + * DXVA2 configuration used to create the decoder + */ + const DXVA2_ConfigPictureDecode *cfg; + + /** + * The number of surface in the surface array + */ + unsigned surface_count; + + /** + * The array of Direct3D surfaces used to create the decoder + */ + LPDIRECT3DSURFACE9 *surface; + + /** + * A bit field configuring the workarounds needed for using the decoder + */ + uint64_t workaround; + + /** + * Private to the FFmpeg AVHWAccel implementation + */ + unsigned report_id; +}; + +/** + * @} + */ + +#endif /* AVCODEC_DXVA2_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/jni.h b/Src/Decoder_H264_ALL/include/libavcodec/jni.h new file mode 100644 index 0000000..dd99e92 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/jni.h @@ -0,0 +1,46 @@ +/* + * JNI public API functions + * + * Copyright (c) 2015-2016 Matthieu Bouron + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_JNI_H +#define AVCODEC_JNI_H + +/* + * Manually set a Java virtual machine which will be used to retrieve the JNI + * environment. Once a Java VM is set it cannot be changed afterwards, meaning + * you can call multiple times av_jni_set_java_vm with the same Java VM pointer + * however it will error out if you try to set a different Java VM. + * + * @param vm Java virtual machine + * @param log_ctx context used for logging, can be NULL + * @return 0 on success, < 0 otherwise + */ +int av_jni_set_java_vm(void *vm, void *log_ctx); + +/* + * Get the Java virtual machine which has been set with av_jni_set_java_vm. + * + * @param vm Java virtual machine + * @return a pointer to the Java virtual machine + */ +void *av_jni_get_java_vm(void *log_ctx); + +#endif /* AVCODEC_JNI_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/mediacodec.h b/Src/Decoder_H264_ALL/include/libavcodec/mediacodec.h new file mode 100644 index 0000000..5606d24 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/mediacodec.h @@ -0,0 +1,88 @@ +/* + * Android MediaCodec public API + * + * Copyright (c) 2016 Matthieu Bouron + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_MEDIACODEC_H +#define AVCODEC_MEDIACODEC_H + +#include "libavcodec/avcodec.h" + +/** + * This structure holds a reference to a android/view/Surface object that will + * be used as output by the decoder. + * + */ +typedef struct AVMediaCodecContext { + + /** + * android/view/Surface object reference. + */ + void *surface; + +} AVMediaCodecContext; + +/** + * Allocate and initialize a MediaCodec context. + * + * When decoding with MediaCodec is finished, the caller must free the + * MediaCodec context with av_mediacodec_default_free. + * + * @return a pointer to a newly allocated AVMediaCodecContext on success, NULL otherwise + */ +AVMediaCodecContext *av_mediacodec_alloc_context(void); + +/** + * Convenience function that sets up the MediaCodec context. + * + * @param avctx codec context + * @param ctx MediaCodec context to initialize + * @param surface reference to an android/view/Surface + * @return 0 on success, < 0 otherwise + */ +int av_mediacodec_default_init(AVCodecContext *avctx, AVMediaCodecContext *ctx, void *surface); + +/** + * This function must be called to free the MediaCodec context initialized with + * av_mediacodec_default_init(). + * + * @param avctx codec context + */ +void av_mediacodec_default_free(AVCodecContext *avctx); + +/** + * Opaque structure representing a MediaCodec buffer to render. + */ +typedef struct MediaCodecBuffer AVMediaCodecBuffer; + +/** + * Release a MediaCodec buffer and render it to the surface that is associated + * with the decoder. This function should only be called once on a given + * buffer, once released the underlying buffer returns to the codec, thus + * subsequent calls to this function will have no effect. + * + * @param buffer the buffer to render + * @param render 1 to release and render the buffer to the surface or 0 to + * discard the buffer + * @return 0 on success, < 0 otherwise + */ +int av_mediacodec_release_buffer(AVMediaCodecBuffer *buffer, int render); + +#endif /* AVCODEC_MEDIACODEC_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/qsv.h b/Src/Decoder_H264_ALL/include/libavcodec/qsv.h new file mode 100644 index 0000000..b77158e --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/qsv.h @@ -0,0 +1,107 @@ +/* + * Intel MediaSDK QSV public API + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_QSV_H +#define AVCODEC_QSV_H + +#include + +#include "libavutil/buffer.h" + +/** + * This struct is used for communicating QSV parameters between libavcodec and + * the caller. It is managed by the caller and must be assigned to + * AVCodecContext.hwaccel_context. + * - decoding: hwaccel_context must be set on return from the get_format() + * callback + * - encoding: hwaccel_context must be set before avcodec_open2() + */ +typedef struct AVQSVContext { + /** + * If non-NULL, the session to use for encoding or decoding. + * Otherwise, libavcodec will try to create an internal session. + */ + mfxSession session; + + /** + * The IO pattern to use. + */ + int iopattern; + + /** + * Extra buffers to pass to encoder or decoder initialization. + */ + mfxExtBuffer **ext_buffers; + int nb_ext_buffers; + + /** + * Encoding only. If this field is set to non-zero by the caller, libavcodec + * will create an mfxExtOpaqueSurfaceAlloc extended buffer and pass it to + * the encoder initialization. This only makes sense if iopattern is also + * set to MFX_IOPATTERN_IN_OPAQUE_MEMORY. + * + * The number of allocated opaque surfaces will be the sum of the number + * required by the encoder and the user-provided value nb_opaque_surfaces. + * The array of the opaque surfaces will be exported to the caller through + * the opaque_surfaces field. + */ + int opaque_alloc; + + /** + * Encoding only, and only if opaque_alloc is set to non-zero. Before + * calling avcodec_open2(), the caller should set this field to the number + * of extra opaque surfaces to allocate beyond what is required by the + * encoder. + * + * On return from avcodec_open2(), this field will be set by libavcodec to + * the total number of allocated opaque surfaces. + */ + int nb_opaque_surfaces; + + /** + * Encoding only, and only if opaque_alloc is set to non-zero. On return + * from avcodec_open2(), this field will be used by libavcodec to export the + * array of the allocated opaque surfaces to the caller, so they can be + * passed to other parts of the pipeline. + * + * The buffer reference exported here is owned and managed by libavcodec, + * the callers should make their own reference with av_buffer_ref() and free + * it with av_buffer_unref() when it is no longer needed. + * + * The buffer data is an nb_opaque_surfaces-sized array of mfxFrameSurface1. + */ + AVBufferRef *opaque_surfaces; + + /** + * Encoding only, and only if opaque_alloc is set to non-zero. On return + * from avcodec_open2(), this field will be set to the surface type used in + * the opaque allocation request. + */ + int opaque_alloc_type; +} AVQSVContext; + +/** + * Allocate a new context. + * + * It must be freed by the caller with av_free(). + */ +AVQSVContext *av_qsv_alloc_context(void); + +#endif /* AVCODEC_QSV_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/vaapi.h b/Src/Decoder_H264_ALL/include/libavcodec/vaapi.h new file mode 100644 index 0000000..7a29f6f --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/vaapi.h @@ -0,0 +1,189 @@ +/* + * Video Acceleration API (shared data between FFmpeg and the video player) + * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1 + * + * Copyright (C) 2008-2009 Splitted-Desktop Systems + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_VAAPI_H +#define AVCODEC_VAAPI_H + +/** + * @file + * @ingroup lavc_codec_hwaccel_vaapi + * Public libavcodec VA API header. + */ + +#include +#include "libavutil/attributes.h" +#include "version.h" + +/** + * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding + * @ingroup lavc_codec_hwaccel + * @{ + */ + +/** + * This structure is used to share data between the FFmpeg library and + * the client video application. + * This shall be zero-allocated and available as + * AVCodecContext.hwaccel_context. All user members can be set once + * during initialization or through each AVCodecContext.get_buffer() + * function call. In any case, they must be valid prior to calling + * decoding functions. + */ +struct vaapi_context { + /** + * Window system dependent data + * + * - encoding: unused + * - decoding: Set by user + */ + void *display; + + /** + * Configuration ID + * + * - encoding: unused + * - decoding: Set by user + */ + uint32_t config_id; + + /** + * Context ID (video decode pipeline) + * + * - encoding: unused + * - decoding: Set by user + */ + uint32_t context_id; + +#if FF_API_VAAPI_CONTEXT + /** + * VAPictureParameterBuffer ID + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + attribute_deprecated + uint32_t pic_param_buf_id; + + /** + * VAIQMatrixBuffer ID + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + attribute_deprecated + uint32_t iq_matrix_buf_id; + + /** + * VABitPlaneBuffer ID (for VC-1 decoding) + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + attribute_deprecated + uint32_t bitplane_buf_id; + + /** + * Slice parameter/data buffer IDs + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + attribute_deprecated + uint32_t *slice_buf_ids; + + /** + * Number of effective slice buffer IDs to send to the HW + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + attribute_deprecated + unsigned int n_slice_buf_ids; + + /** + * Size of pre-allocated slice_buf_ids + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + attribute_deprecated + unsigned int slice_buf_ids_alloc; + + /** + * Pointer to VASliceParameterBuffers + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + attribute_deprecated + void *slice_params; + + /** + * Size of a VASliceParameterBuffer element + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + attribute_deprecated + unsigned int slice_param_size; + + /** + * Size of pre-allocated slice_params + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + attribute_deprecated + unsigned int slice_params_alloc; + + /** + * Number of slices currently filled in + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + attribute_deprecated + unsigned int slice_count; + + /** + * Pointer to slice data buffer base + * - encoding: unused + * - decoding: Set by libavcodec + */ + attribute_deprecated + const uint8_t *slice_data; + + /** + * Current size of slice data + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + attribute_deprecated + uint32_t slice_data_size; +#endif +}; + +/* @} */ + +#endif /* AVCODEC_VAAPI_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/vda.h b/Src/Decoder_H264_ALL/include/libavcodec/vda.h new file mode 100644 index 0000000..bde14e3 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/vda.h @@ -0,0 +1,230 @@ +/* + * VDA HW acceleration + * + * copyright (c) 2011 Sebastien Zwickert + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_VDA_H +#define AVCODEC_VDA_H + +/** + * @file + * @ingroup lavc_codec_hwaccel_vda + * Public libavcodec VDA header. + */ + +#include "libavcodec/avcodec.h" + +#include + +// emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes +// http://openradar.appspot.com/8026390 +#undef __GNUC_STDC_INLINE__ + +#define Picture QuickdrawPicture +#include +#undef Picture + +#include "libavcodec/version.h" + +// extra flags not defined in VDADecoder.h +enum { + kVDADecodeInfo_Asynchronous = 1UL << 0, + kVDADecodeInfo_FrameDropped = 1UL << 1 +}; + +/** + * @defgroup lavc_codec_hwaccel_vda VDA + * @ingroup lavc_codec_hwaccel + * + * @{ + */ + +/** + * This structure is used to provide the necessary configurations and data + * to the VDA FFmpeg HWAccel implementation. + * + * The application must make it available as AVCodecContext.hwaccel_context. + */ +struct vda_context { + /** + * VDA decoder object. + * + * - encoding: unused + * - decoding: Set/Unset by libavcodec. + */ + VDADecoder decoder; + + /** + * The Core Video pixel buffer that contains the current image data. + * + * encoding: unused + * decoding: Set by libavcodec. Unset by user. + */ + CVPixelBufferRef cv_buffer; + + /** + * Use the hardware decoder in synchronous mode. + * + * encoding: unused + * decoding: Set by user. + */ + int use_sync_decoding; + + /** + * The frame width. + * + * - encoding: unused + * - decoding: Set/Unset by user. + */ + int width; + + /** + * The frame height. + * + * - encoding: unused + * - decoding: Set/Unset by user. + */ + int height; + + /** + * The frame format. + * + * - encoding: unused + * - decoding: Set/Unset by user. + */ + int format; + + /** + * The pixel format for output image buffers. + * + * - encoding: unused + * - decoding: Set/Unset by user. + */ + OSType cv_pix_fmt_type; + + /** + * unused + */ + uint8_t *priv_bitstream; + + /** + * unused + */ + int priv_bitstream_size; + + /** + * unused + */ + int priv_allocated_size; + + /** + * Use av_buffer to manage buffer. + * When the flag is set, the CVPixelBuffers returned by the decoder will + * be released automatically, so you have to retain them if necessary. + * Not setting this flag may cause memory leak. + * + * encoding: unused + * decoding: Set by user. + */ + int use_ref_buffer; +}; + +/** Create the video decoder. */ +int ff_vda_create_decoder(struct vda_context *vda_ctx, + uint8_t *extradata, + int extradata_size); + +/** Destroy the video decoder. */ +int ff_vda_destroy_decoder(struct vda_context *vda_ctx); + +/** + * This struct holds all the information that needs to be passed + * between the caller and libavcodec for initializing VDA decoding. + * Its size is not a part of the public ABI, it must be allocated with + * av_vda_alloc_context() and freed with av_free(). + */ +typedef struct AVVDAContext { + /** + * VDA decoder object. Created and freed by the caller. + */ + VDADecoder decoder; + + /** + * The output callback that must be passed to VDADecoderCreate. + * Set by av_vda_alloc_context(). + */ + VDADecoderOutputCallback output_callback; + + /** + * CVPixelBuffer Format Type that VDA will use for decoded frames; set by + * the caller. + */ + OSType cv_pix_fmt_type; +} AVVDAContext; + +/** + * Allocate and initialize a VDA context. + * + * This function should be called from the get_format() callback when the caller + * selects the AV_PIX_FMT_VDA format. The caller must then create the decoder + * object (using the output callback provided by libavcodec) that will be used + * for VDA-accelerated decoding. + * + * When decoding with VDA is finished, the caller must destroy the decoder + * object and free the VDA context using av_free(). + * + * @return the newly allocated context or NULL on failure + */ +AVVDAContext *av_vda_alloc_context(void); + +/** + * This is a convenience function that creates and sets up the VDA context using + * an internal implementation. + * + * @param avctx the corresponding codec context + * + * @return >= 0 on success, a negative AVERROR code on failure + */ +int av_vda_default_init(AVCodecContext *avctx); + +/** + * This is a convenience function that creates and sets up the VDA context using + * an internal implementation. + * + * @param avctx the corresponding codec context + * @param vdactx the VDA context to use + * + * @return >= 0 on success, a negative AVERROR code on failure + */ +int av_vda_default_init2(AVCodecContext *avctx, AVVDAContext *vdactx); + +/** + * This function must be called to free the VDA context initialized with + * av_vda_default_init(). + * + * @param avctx the corresponding codec context + */ +void av_vda_default_free(AVCodecContext *avctx); + +/** + * @} + */ + +#endif /* AVCODEC_VDA_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/vdpau.h b/Src/Decoder_H264_ALL/include/libavcodec/vdpau.h new file mode 100644 index 0000000..e85e4d9 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/vdpau.h @@ -0,0 +1,253 @@ +/* + * The Video Decode and Presentation API for UNIX (VDPAU) is used for + * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1. + * + * Copyright (C) 2008 NVIDIA + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_VDPAU_H +#define AVCODEC_VDPAU_H + +/** + * @file + * @ingroup lavc_codec_hwaccel_vdpau + * Public libavcodec VDPAU header. + */ + + +/** + * @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer + * @ingroup lavc_codec_hwaccel + * + * VDPAU hardware acceleration has two modules + * - VDPAU decoding + * - VDPAU presentation + * + * The VDPAU decoding module parses all headers using FFmpeg + * parsing mechanisms and uses VDPAU for the actual decoding. + * + * As per the current implementation, the actual decoding + * and rendering (API calls) are done as part of the VDPAU + * presentation (vo_vdpau.c) module. + * + * @{ + */ + +#include +#include +#include "libavutil/avconfig.h" +#include "libavutil/attributes.h" + +#include "avcodec.h" +#include "version.h" + +#if FF_API_BUFS_VDPAU +union AVVDPAUPictureInfo { + VdpPictureInfoH264 h264; + VdpPictureInfoMPEG1Or2 mpeg; + VdpPictureInfoVC1 vc1; + VdpPictureInfoMPEG4Part2 mpeg4; +}; +#endif + +struct AVCodecContext; +struct AVFrame; + +typedef int (*AVVDPAU_Render2)(struct AVCodecContext *, struct AVFrame *, + const VdpPictureInfo *, uint32_t, + const VdpBitstreamBuffer *); + +/** + * This structure is used to share data between the libavcodec library and + * the client video application. + * The user shall allocate the structure via the av_alloc_vdpau_hwaccel + * function and make it available as + * AVCodecContext.hwaccel_context. Members can be set by the user once + * during initialization or through each AVCodecContext.get_buffer() + * function call. In any case, they must be valid prior to calling + * decoding functions. + * + * The size of this structure is not a part of the public ABI and must not + * be used outside of libavcodec. Use av_vdpau_alloc_context() to allocate an + * AVVDPAUContext. + */ +typedef struct AVVDPAUContext { + /** + * VDPAU decoder handle + * + * Set by user. + */ + VdpDecoder decoder; + + /** + * VDPAU decoder render callback + * + * Set by the user. + */ + VdpDecoderRender *render; + +#if FF_API_BUFS_VDPAU + /** + * VDPAU picture information + * + * Set by libavcodec. + */ + attribute_deprecated + union AVVDPAUPictureInfo info; + + /** + * Allocated size of the bitstream_buffers table. + * + * Set by libavcodec. + */ + attribute_deprecated + int bitstream_buffers_allocated; + + /** + * Useful bitstream buffers in the bitstream buffers table. + * + * Set by libavcodec. + */ + attribute_deprecated + int bitstream_buffers_used; + + /** + * Table of bitstream buffers. + * The user is responsible for freeing this buffer using av_freep(). + * + * Set by libavcodec. + */ + attribute_deprecated + VdpBitstreamBuffer *bitstream_buffers; +#endif + AVVDPAU_Render2 render2; +} AVVDPAUContext; + +/** + * @brief allocation function for AVVDPAUContext + * + * Allows extending the struct without breaking API/ABI + */ +AVVDPAUContext *av_alloc_vdpaucontext(void); + +AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext *); +void av_vdpau_hwaccel_set_render2(AVVDPAUContext *, AVVDPAU_Render2); + +/** + * Associate a VDPAU device with a codec context for hardware acceleration. + * This function is meant to be called from the get_format() codec callback, + * or earlier. It can also be called after avcodec_flush_buffers() to change + * the underlying VDPAU device mid-stream (e.g. to recover from non-transparent + * display preemption). + * + * @note get_format() must return AV_PIX_FMT_VDPAU if this function completes + * successfully. + * + * @param avctx decoding context whose get_format() callback is invoked + * @param device VDPAU device handle to use for hardware acceleration + * @param get_proc_address VDPAU device driver + * @param flags zero of more OR'd AV_HWACCEL_FLAG_* flags + * + * @return 0 on success, an AVERROR code on failure. + */ +int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device, + VdpGetProcAddress *get_proc_address, unsigned flags); + +/** + * Gets the parameters to create an adequate VDPAU video surface for the codec + * context using VDPAU hardware decoding acceleration. + * + * @note Behavior is undefined if the context was not successfully bound to a + * VDPAU device using av_vdpau_bind_context(). + * + * @param avctx the codec context being used for decoding the stream + * @param type storage space for the VDPAU video surface chroma type + * (or NULL to ignore) + * @param width storage space for the VDPAU video surface pixel width + * (or NULL to ignore) + * @param height storage space for the VDPAU video surface pixel height + * (or NULL to ignore) + * + * @return 0 on success, a negative AVERROR code on failure. + */ +int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type, + uint32_t *width, uint32_t *height); + +/** + * Allocate an AVVDPAUContext. + * + * @return Newly-allocated AVVDPAUContext or NULL on failure. + */ +AVVDPAUContext *av_vdpau_alloc_context(void); + +#if FF_API_VDPAU_PROFILE +/** + * Get a decoder profile that should be used for initializing a VDPAU decoder. + * Should be called from the AVCodecContext.get_format() callback. + * + * @deprecated Use av_vdpau_bind_context() instead. + * + * @param avctx the codec context being used for decoding the stream + * @param profile a pointer into which the result will be written on success. + * The contents of profile are undefined if this function returns + * an error. + * + * @return 0 on success (non-negative), a negative AVERROR on failure. + */ +attribute_deprecated +int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile); +#endif + +#if FF_API_CAP_VDPAU +/** @brief The videoSurface is used for rendering. */ +#define FF_VDPAU_STATE_USED_FOR_RENDER 1 + +/** + * @brief The videoSurface is needed for reference/prediction. + * The codec manipulates this. + */ +#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2 + +/** + * @brief This structure is used as a callback between the FFmpeg + * decoder (vd_) and presentation (vo_) module. + * This is used for defining a video frame containing surface, + * picture parameter, bitstream information etc which are passed + * between the FFmpeg decoder and its clients. + */ +struct vdpau_render_state { + VdpVideoSurface surface; ///< Used as rendered surface, never changed. + + int state; ///< Holds FF_VDPAU_STATE_* values. + + /** picture parameter information for all supported codecs */ + union AVVDPAUPictureInfo info; + + /** Describe size/location of the compressed video data. + Set to 0 when freeing bitstream_buffers. */ + int bitstream_buffers_allocated; + int bitstream_buffers_used; + /** The user is responsible for freeing this buffer using av_freep(). */ + VdpBitstreamBuffer *bitstream_buffers; +}; +#endif + +/* @}*/ + +#endif /* AVCODEC_VDPAU_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/version.h b/Src/Decoder_H264_ALL/include/libavcodec/version.h new file mode 100644 index 0000000..f588316 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/version.h @@ -0,0 +1,230 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_VERSION_H +#define AVCODEC_VERSION_H + +/** + * @file + * @ingroup libavc + * Libavcodec version macros. + */ + +#include "libavutil/version.h" + +#define LIBAVCODEC_VERSION_MAJOR 57 +#define LIBAVCODEC_VERSION_MINOR 50 +#define LIBAVCODEC_VERSION_MICRO 100 + +#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ + LIBAVCODEC_VERSION_MINOR, \ + LIBAVCODEC_VERSION_MICRO) +#define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \ + LIBAVCODEC_VERSION_MINOR, \ + LIBAVCODEC_VERSION_MICRO) +#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT + +#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) + +/** + * FF_API_* defines may be placed below to indicate public API that will be + * dropped at a future version bump. The defines themselves are not part of + * the public API and may change, break or disappear at any time. + * + * @note, when bumping the major version it is recommended to manually + * disable each FF_API_* in its own commit instead of disabling them all + * at once through the bump. This improves the git bisect-ability of the change. + */ + +#ifndef FF_API_VIMA_DECODER +#define FF_API_VIMA_DECODER (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_AUDIO_CONVERT +#define FF_API_AUDIO_CONVERT (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_AVCODEC_RESAMPLE +#define FF_API_AVCODEC_RESAMPLE FF_API_AUDIO_CONVERT +#endif +#ifndef FF_API_GETCHROMA +#define FF_API_GETCHROMA (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_MISSING_SAMPLE +#define FF_API_MISSING_SAMPLE (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_LOWRES +#define FF_API_LOWRES (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_CAP_VDPAU +#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_BUFS_VDPAU +#define FF_API_BUFS_VDPAU (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_VOXWARE +#define FF_API_VOXWARE (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_SET_DIMENSIONS +#define FF_API_SET_DIMENSIONS (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_DEBUG_MV +#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_AC_VLC +#define FF_API_AC_VLC (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_OLD_MSMPEG4 +#define FF_API_OLD_MSMPEG4 (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_ASPECT_EXTENDED +#define FF_API_ASPECT_EXTENDED (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_ARCH_ALPHA +#define FF_API_ARCH_ALPHA (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_XVMC +#define FF_API_XVMC (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_ERROR_RATE +#define FF_API_ERROR_RATE (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_QSCALE_TYPE +#define FF_API_QSCALE_TYPE (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_MB_TYPE +#define FF_API_MB_TYPE (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_MAX_BFRAMES +#define FF_API_MAX_BFRAMES (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_NEG_LINESIZES +#define FF_API_NEG_LINESIZES (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_EMU_EDGE +#define FF_API_EMU_EDGE (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_ARCH_SH4 +#define FF_API_ARCH_SH4 (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_ARCH_SPARC +#define FF_API_ARCH_SPARC (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_UNUSED_MEMBERS +#define FF_API_UNUSED_MEMBERS (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_IDCT_XVIDMMX +#define FF_API_IDCT_XVIDMMX (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_INPUT_PRESERVED +#define FF_API_INPUT_PRESERVED (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_NORMALIZE_AQP +#define FF_API_NORMALIZE_AQP (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_GMC +#define FF_API_GMC (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_MV0 +#define FF_API_MV0 (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_CODEC_NAME +#define FF_API_CODEC_NAME (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_AFD +#define FF_API_AFD (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_VISMV +/* XXX: don't forget to drop the -vismv documentation */ +#define FF_API_VISMV (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_AUDIOENC_DELAY +#define FF_API_AUDIOENC_DELAY (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_VAAPI_CONTEXT +#define FF_API_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_AVCTX_TIMEBASE +#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_MPV_OPT +#define FF_API_MPV_OPT (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_STREAM_CODEC_TAG +#define FF_API_STREAM_CODEC_TAG (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_QUANT_BIAS +#define FF_API_QUANT_BIAS (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_RC_STRATEGY +#define FF_API_RC_STRATEGY (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_CODED_FRAME +#define FF_API_CODED_FRAME (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_MOTION_EST +#define FF_API_MOTION_EST (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_WITHOUT_PREFIX +#define FF_API_WITHOUT_PREFIX (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_SIDEDATA_ONLY_PKT +#define FF_API_SIDEDATA_ONLY_PKT (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_VDPAU_PROFILE +#define FF_API_VDPAU_PROFILE (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_CONVERGENCE_DURATION +#define FF_API_CONVERGENCE_DURATION (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_AVPICTURE +#define FF_API_AVPICTURE (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_AVPACKET_OLD_API +#define FF_API_AVPACKET_OLD_API (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_RTP_CALLBACK +#define FF_API_RTP_CALLBACK (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_VBV_DELAY +#define FF_API_VBV_DELAY (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_CODER_TYPE +#define FF_API_CODER_TYPE (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_STAT_BITS +#define FF_API_STAT_BITS (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_PRIVATE_OPT +#define FF_API_PRIVATE_OPT (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_ASS_TIMING +#define FF_API_ASS_TIMING (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_OLD_BSF +#define FF_API_OLD_BSF (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_COPY_CONTEXT +#define FF_API_COPY_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_GET_CONTEXT_DEFAULTS +#define FF_API_GET_CONTEXT_DEFAULTS (LIBAVCODEC_VERSION_MAJOR < 59) +#endif +#ifndef FF_API_NVENC_OLD_NAME +#define FF_API_NVENC_OLD_NAME (LIBAVCODEC_VERSION_MAJOR < 59) +#endif + +#endif /* AVCODEC_VERSION_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/videotoolbox.h b/Src/Decoder_H264_ALL/include/libavcodec/videotoolbox.h new file mode 100644 index 0000000..a48638e --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/videotoolbox.h @@ -0,0 +1,126 @@ +/* + * Videotoolbox hardware acceleration + * + * copyright (c) 2012 Sebastien Zwickert + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_VIDEOTOOLBOX_H +#define AVCODEC_VIDEOTOOLBOX_H + +/** + * @file + * @ingroup lavc_codec_hwaccel_videotoolbox + * Public libavcodec Videotoolbox header. + */ + +#include + +#define Picture QuickdrawPicture +#include +#undef Picture + +#include "libavcodec/avcodec.h" + +/** + * This struct holds all the information that needs to be passed + * between the caller and libavcodec for initializing Videotoolbox decoding. + * Its size is not a part of the public ABI, it must be allocated with + * av_videotoolbox_alloc_context() and freed with av_free(). + */ +typedef struct AVVideotoolboxContext { + /** + * Videotoolbox decompression session object. + * Created and freed the caller. + */ + VTDecompressionSessionRef session; + + /** + * The output callback that must be passed to the session. + * Set by av_videottoolbox_default_init() + */ + VTDecompressionOutputCallback output_callback; + + /** + * CVPixelBuffer Format Type that Videotoolbox will use for decoded frames. + * set by the caller. + */ + OSType cv_pix_fmt_type; + + /** + * CoreMedia Format Description that Videotoolbox will use to create the decompression session. + * Set by the caller. + */ + CMVideoFormatDescriptionRef cm_fmt_desc; + + /** + * CoreMedia codec type that Videotoolbox will use to create the decompression session. + * Set by the caller. + */ + int cm_codec_type; +} AVVideotoolboxContext; + +/** + * Allocate and initialize a Videotoolbox context. + * + * This function should be called from the get_format() callback when the caller + * selects the AV_PIX_FMT_VIDETOOLBOX format. The caller must then create + * the decoder object (using the output callback provided by libavcodec) that + * will be used for Videotoolbox-accelerated decoding. + * + * When decoding with Videotoolbox is finished, the caller must destroy the decoder + * object and free the Videotoolbox context using av_free(). + * + * @return the newly allocated context or NULL on failure + */ +AVVideotoolboxContext *av_videotoolbox_alloc_context(void); + +/** + * This is a convenience function that creates and sets up the Videotoolbox context using + * an internal implementation. + * + * @param avctx the corresponding codec context + * + * @return >= 0 on success, a negative AVERROR code on failure + */ +int av_videotoolbox_default_init(AVCodecContext *avctx); + +/** + * This is a convenience function that creates and sets up the Videotoolbox context using + * an internal implementation. + * + * @param avctx the corresponding codec context + * @param vtctx the Videotoolbox context to use + * + * @return >= 0 on success, a negative AVERROR code on failure + */ +int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx); + +/** + * This function must be called to free the Videotoolbox context initialized with + * av_videotoolbox_default_init(). + * + * @param avctx the corresponding codec context + */ +void av_videotoolbox_default_free(AVCodecContext *avctx); + +/** + * @} + */ + +#endif /* AVCODEC_VIDEOTOOLBOX_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/vorbis_parser.h b/Src/Decoder_H264_ALL/include/libavcodec/vorbis_parser.h new file mode 100644 index 0000000..9205027 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/vorbis_parser.h @@ -0,0 +1,77 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * A public API for Vorbis parsing + * + * Determines the duration for each packet. + */ + +#ifndef AVCODEC_VORBIS_PARSER_H +#define AVCODEC_VORBIS_PARSER_H + +#include + +typedef struct AVVorbisParseContext AVVorbisParseContext; + +/** + * Allocate and initialize the Vorbis parser using headers in the extradata. + * + * @param avctx codec context + * @param s Vorbis parser context + */ +AVVorbisParseContext *av_vorbis_parse_init(const uint8_t *extradata, + int extradata_size); + +/** + * Free the parser and everything associated with it. + */ +void av_vorbis_parse_free(AVVorbisParseContext **s); + +#define VORBIS_FLAG_HEADER 0x00000001 +#define VORBIS_FLAG_COMMENT 0x00000002 +#define VORBIS_FLAG_SETUP 0x00000004 + +/** + * Get the duration for a Vorbis packet. + * + * If @p flags is @c NULL, + * special frames are considered invalid. + * + * @param s Vorbis parser context + * @param buf buffer containing a Vorbis frame + * @param buf_size size of the buffer + * @param flags flags for special frames + */ +int av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf, + int buf_size, int *flags); + +/** + * Get the duration for a Vorbis packet. + * + * @param s Vorbis parser context + * @param buf buffer containing a Vorbis frame + * @param buf_size size of the buffer + */ +int av_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf, + int buf_size); + +void av_vorbis_parse_reset(AVVorbisParseContext *s); + +#endif /* AVCODEC_VORBIS_PARSER_H */ diff --git a/Src/Decoder_H264_ALL/include/libavcodec/xvmc.h b/Src/Decoder_H264_ALL/include/libavcodec/xvmc.h new file mode 100644 index 0000000..465ee78 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavcodec/xvmc.h @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2003 Ivan Kalvachev + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_XVMC_H +#define AVCODEC_XVMC_H + +/** + * @file + * @ingroup lavc_codec_hwaccel_xvmc + * Public libavcodec XvMC header. + */ + +#include + +#include "libavutil/attributes.h" +#include "version.h" +#include "avcodec.h" + +/** + * @defgroup lavc_codec_hwaccel_xvmc XvMC + * @ingroup lavc_codec_hwaccel + * + * @{ + */ + +#define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct + the number is 1337 speak for the letters IDCT MCo (motion compensation) */ + +struct attribute_deprecated xvmc_pix_fmt { + /** The field contains the special constant value AV_XVMC_ID. + It is used as a test that the application correctly uses the API, + and that there is no corruption caused by pixel routines. + - application - set during initialization + - libavcodec - unchanged + */ + int xvmc_id; + + /** Pointer to the block array allocated by XvMCCreateBlocks(). + The array has to be freed by XvMCDestroyBlocks(). + Each group of 64 values represents one data block of differential + pixel information (in MoCo mode) or coefficients for IDCT. + - application - set the pointer during initialization + - libavcodec - fills coefficients/pixel data into the array + */ + short* data_blocks; + + /** Pointer to the macroblock description array allocated by + XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks(). + - application - set the pointer during initialization + - libavcodec - fills description data into the array + */ + XvMCMacroBlock* mv_blocks; + + /** Number of macroblock descriptions that can be stored in the mv_blocks + array. + - application - set during initialization + - libavcodec - unchanged + */ + int allocated_mv_blocks; + + /** Number of blocks that can be stored at once in the data_blocks array. + - application - set during initialization + - libavcodec - unchanged + */ + int allocated_data_blocks; + + /** Indicate that the hardware would interpret data_blocks as IDCT + coefficients and perform IDCT on them. + - application - set during initialization + - libavcodec - unchanged + */ + int idct; + + /** In MoCo mode it indicates that intra macroblocks are assumed to be in + unsigned format; same as the XVMC_INTRA_UNSIGNED flag. + - application - set during initialization + - libavcodec - unchanged + */ + int unsigned_intra; + + /** Pointer to the surface allocated by XvMCCreateSurface(). + It has to be freed by XvMCDestroySurface() on application exit. + It identifies the frame and its state on the video hardware. + - application - set during initialization + - libavcodec - unchanged + */ + XvMCSurface* p_surface; + +/** Set by the decoder before calling ff_draw_horiz_band(), + needed by the XvMCRenderSurface function. */ +//@{ + /** Pointer to the surface used as past reference + - application - unchanged + - libavcodec - set + */ + XvMCSurface* p_past_surface; + + /** Pointer to the surface used as future reference + - application - unchanged + - libavcodec - set + */ + XvMCSurface* p_future_surface; + + /** top/bottom field or frame + - application - unchanged + - libavcodec - set + */ + unsigned int picture_structure; + + /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence + - application - unchanged + - libavcodec - set + */ + unsigned int flags; +//}@ + + /** Number of macroblock descriptions in the mv_blocks array + that have already been passed to the hardware. + - application - zeroes it on get_buffer(). + A successful ff_draw_horiz_band() may increment it + with filled_mb_block_num or zero both. + - libavcodec - unchanged + */ + int start_mv_blocks_num; + + /** Number of new macroblock descriptions in the mv_blocks array (after + start_mv_blocks_num) that are filled by libavcodec and have to be + passed to the hardware. + - application - zeroes it on get_buffer() or after successful + ff_draw_horiz_band(). + - libavcodec - increment with one of each stored MB + */ + int filled_mv_blocks_num; + + /** Number of the next free data block; one data block consists of + 64 short values in the data_blocks array. + All blocks before this one have already been claimed by placing their + position into the corresponding block description structure field, + that are part of the mv_blocks array. + - application - zeroes it on get_buffer(). + A successful ff_draw_horiz_band() may zero it together + with start_mb_blocks_num. + - libavcodec - each decoded macroblock increases it by the number + of coded blocks it contains. + */ + int next_free_data_block_num; +}; + +/** + * @} + */ + +#endif /* AVCODEC_XVMC_H */ diff --git a/Src/Decoder_H264_ALL/include/libavdevice/avdevice.h b/Src/Decoder_H264_ALL/include/libavdevice/avdevice.h new file mode 100644 index 0000000..6b0446c --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavdevice/avdevice.h @@ -0,0 +1,509 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVDEVICE_AVDEVICE_H +#define AVDEVICE_AVDEVICE_H + +#include "version.h" + +/** + * @file + * @ingroup lavd + * Main libavdevice API header + */ + +/** + * @defgroup lavd Special devices muxing/demuxing library + * @{ + * Libavdevice is a complementary library to @ref libavf "libavformat". It + * provides various "special" platform-specific muxers and demuxers, e.g. for + * grabbing devices, audio capture and playback etc. As a consequence, the + * (de)muxers in libavdevice are of the AVFMT_NOFILE type (they use their own + * I/O functions). The filename passed to avformat_open_input() often does not + * refer to an actually existing file, but has some special device-specific + * meaning - e.g. for x11grab it is the display name. + * + * To use libavdevice, simply call avdevice_register_all() to register all + * compiled muxers and demuxers. They all use standard libavformat API. + * @} + */ + +#include "libavutil/log.h" +#include "libavutil/opt.h" +#include "libavutil/dict.h" +#include "libavformat/avformat.h" + +/** + * Return the LIBAVDEVICE_VERSION_INT constant. + */ +unsigned avdevice_version(void); + +/** + * Return the libavdevice build-time configuration. + */ +const char *avdevice_configuration(void); + +/** + * Return the libavdevice license. + */ +const char *avdevice_license(void); + +/** + * Initialize libavdevice and register all the input and output devices. + * @warning This function is not thread safe. + */ +void avdevice_register_all(void); + +/** + * Audio input devices iterator. + * + * If d is NULL, returns the first registered input audio/video device, + * if d is non-NULL, returns the next registered input audio/video device after d + * or NULL if d is the last one. + */ +AVInputFormat *av_input_audio_device_next(AVInputFormat *d); + +/** + * Video input devices iterator. + * + * If d is NULL, returns the first registered input audio/video device, + * if d is non-NULL, returns the next registered input audio/video device after d + * or NULL if d is the last one. + */ +AVInputFormat *av_input_video_device_next(AVInputFormat *d); + +/** + * Audio output devices iterator. + * + * If d is NULL, returns the first registered output audio/video device, + * if d is non-NULL, returns the next registered output audio/video device after d + * or NULL if d is the last one. + */ +AVOutputFormat *av_output_audio_device_next(AVOutputFormat *d); + +/** + * Video output devices iterator. + * + * If d is NULL, returns the first registered output audio/video device, + * if d is non-NULL, returns the next registered output audio/video device after d + * or NULL if d is the last one. + */ +AVOutputFormat *av_output_video_device_next(AVOutputFormat *d); + +typedef struct AVDeviceRect { + int x; /**< x coordinate of top left corner */ + int y; /**< y coordinate of top left corner */ + int width; /**< width */ + int height; /**< height */ +} AVDeviceRect; + +/** + * Message types used by avdevice_app_to_dev_control_message(). + */ +enum AVAppToDevMessageType { + /** + * Dummy message. + */ + AV_APP_TO_DEV_NONE = MKBETAG('N','O','N','E'), + + /** + * Window size change message. + * + * Message is sent to the device every time the application changes the size + * of the window device renders to. + * Message should also be sent right after window is created. + * + * data: AVDeviceRect: new window size. + */ + AV_APP_TO_DEV_WINDOW_SIZE = MKBETAG('G','E','O','M'), + + /** + * Repaint request message. + * + * Message is sent to the device when window has to be repainted. + * + * data: AVDeviceRect: area required to be repainted. + * NULL: whole area is required to be repainted. + */ + AV_APP_TO_DEV_WINDOW_REPAINT = MKBETAG('R','E','P','A'), + + /** + * Request pause/play. + * + * Application requests pause/unpause playback. + * Mostly usable with devices that have internal buffer. + * By default devices are not paused. + * + * data: NULL + */ + AV_APP_TO_DEV_PAUSE = MKBETAG('P', 'A', 'U', ' '), + AV_APP_TO_DEV_PLAY = MKBETAG('P', 'L', 'A', 'Y'), + AV_APP_TO_DEV_TOGGLE_PAUSE = MKBETAG('P', 'A', 'U', 'T'), + + /** + * Volume control message. + * + * Set volume level. It may be device-dependent if volume + * is changed per stream or system wide. Per stream volume + * change is expected when possible. + * + * data: double: new volume with range of 0.0 - 1.0. + */ + AV_APP_TO_DEV_SET_VOLUME = MKBETAG('S', 'V', 'O', 'L'), + + /** + * Mute control messages. + * + * Change mute state. It may be device-dependent if mute status + * is changed per stream or system wide. Per stream mute status + * change is expected when possible. + * + * data: NULL. + */ + AV_APP_TO_DEV_MUTE = MKBETAG(' ', 'M', 'U', 'T'), + AV_APP_TO_DEV_UNMUTE = MKBETAG('U', 'M', 'U', 'T'), + AV_APP_TO_DEV_TOGGLE_MUTE = MKBETAG('T', 'M', 'U', 'T'), + + /** + * Get volume/mute messages. + * + * Force the device to send AV_DEV_TO_APP_VOLUME_LEVEL_CHANGED or + * AV_DEV_TO_APP_MUTE_STATE_CHANGED command respectively. + * + * data: NULL. + */ + AV_APP_TO_DEV_GET_VOLUME = MKBETAG('G', 'V', 'O', 'L'), + AV_APP_TO_DEV_GET_MUTE = MKBETAG('G', 'M', 'U', 'T'), +}; + +/** + * Message types used by avdevice_dev_to_app_control_message(). + */ +enum AVDevToAppMessageType { + /** + * Dummy message. + */ + AV_DEV_TO_APP_NONE = MKBETAG('N','O','N','E'), + + /** + * Create window buffer message. + * + * Device requests to create a window buffer. Exact meaning is device- + * and application-dependent. Message is sent before rendering first + * frame and all one-shot initializations should be done here. + * Application is allowed to ignore preferred window buffer size. + * + * @note: Application is obligated to inform about window buffer size + * with AV_APP_TO_DEV_WINDOW_SIZE message. + * + * data: AVDeviceRect: preferred size of the window buffer. + * NULL: no preferred size of the window buffer. + */ + AV_DEV_TO_APP_CREATE_WINDOW_BUFFER = MKBETAG('B','C','R','E'), + + /** + * Prepare window buffer message. + * + * Device requests to prepare a window buffer for rendering. + * Exact meaning is device- and application-dependent. + * Message is sent before rendering of each frame. + * + * data: NULL. + */ + AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER = MKBETAG('B','P','R','E'), + + /** + * Display window buffer message. + * + * Device requests to display a window buffer. + * Message is sent when new frame is ready to be displayed. + * Usually buffers need to be swapped in handler of this message. + * + * data: NULL. + */ + AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER = MKBETAG('B','D','I','S'), + + /** + * Destroy window buffer message. + * + * Device requests to destroy a window buffer. + * Message is sent when device is about to be destroyed and window + * buffer is not required anymore. + * + * data: NULL. + */ + AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER = MKBETAG('B','D','E','S'), + + /** + * Buffer fullness status messages. + * + * Device signals buffer overflow/underflow. + * + * data: NULL. + */ + AV_DEV_TO_APP_BUFFER_OVERFLOW = MKBETAG('B','O','F','L'), + AV_DEV_TO_APP_BUFFER_UNDERFLOW = MKBETAG('B','U','F','L'), + + /** + * Buffer readable/writable. + * + * Device informs that buffer is readable/writable. + * When possible, device informs how many bytes can be read/write. + * + * @warning Device may not inform when number of bytes than can be read/write changes. + * + * data: int64_t: amount of bytes available to read/write. + * NULL: amount of bytes available to read/write is not known. + */ + AV_DEV_TO_APP_BUFFER_READABLE = MKBETAG('B','R','D',' '), + AV_DEV_TO_APP_BUFFER_WRITABLE = MKBETAG('B','W','R',' '), + + /** + * Mute state change message. + * + * Device informs that mute state has changed. + * + * data: int: 0 for not muted state, non-zero for muted state. + */ + AV_DEV_TO_APP_MUTE_STATE_CHANGED = MKBETAG('C','M','U','T'), + + /** + * Volume level change message. + * + * Device informs that volume level has changed. + * + * data: double: new volume with range of 0.0 - 1.0. + */ + AV_DEV_TO_APP_VOLUME_LEVEL_CHANGED = MKBETAG('C','V','O','L'), +}; + +/** + * Send control message from application to device. + * + * @param s device context. + * @param type message type. + * @param data message data. Exact type depends on message type. + * @param data_size size of message data. + * @return >= 0 on success, negative on error. + * AVERROR(ENOSYS) when device doesn't implement handler of the message. + */ +int avdevice_app_to_dev_control_message(struct AVFormatContext *s, + enum AVAppToDevMessageType type, + void *data, size_t data_size); + +/** + * Send control message from device to application. + * + * @param s device context. + * @param type message type. + * @param data message data. Can be NULL. + * @param data_size size of message data. + * @return >= 0 on success, negative on error. + * AVERROR(ENOSYS) when application doesn't implement handler of the message. + */ +int avdevice_dev_to_app_control_message(struct AVFormatContext *s, + enum AVDevToAppMessageType type, + void *data, size_t data_size); + +/** + * Following API allows user to probe device capabilities (supported codecs, + * pixel formats, sample formats, resolutions, channel counts, etc). + * It is build on top op AVOption API. + * Queried capabilities make it possible to set up converters of video or audio + * parameters that fit to the device. + * + * List of capabilities that can be queried: + * - Capabilities valid for both audio and video devices: + * - codec: supported audio/video codecs. + * type: AV_OPT_TYPE_INT (AVCodecID value) + * - Capabilities valid for audio devices: + * - sample_format: supported sample formats. + * type: AV_OPT_TYPE_INT (AVSampleFormat value) + * - sample_rate: supported sample rates. + * type: AV_OPT_TYPE_INT + * - channels: supported number of channels. + * type: AV_OPT_TYPE_INT + * - channel_layout: supported channel layouts. + * type: AV_OPT_TYPE_INT64 + * - Capabilities valid for video devices: + * - pixel_format: supported pixel formats. + * type: AV_OPT_TYPE_INT (AVPixelFormat value) + * - window_size: supported window sizes (describes size of the window size presented to the user). + * type: AV_OPT_TYPE_IMAGE_SIZE + * - frame_size: supported frame sizes (describes size of provided video frames). + * type: AV_OPT_TYPE_IMAGE_SIZE + * - fps: supported fps values + * type: AV_OPT_TYPE_RATIONAL + * + * Value of the capability may be set by user using av_opt_set() function + * and AVDeviceCapabilitiesQuery object. Following queries will + * limit results to the values matching already set capabilities. + * For example, setting a codec may impact number of formats or fps values + * returned during next query. Setting invalid value may limit results to zero. + * + * Example of the usage basing on opengl output device: + * + * @code + * AVFormatContext *oc = NULL; + * AVDeviceCapabilitiesQuery *caps = NULL; + * AVOptionRanges *ranges; + * int ret; + * + * if ((ret = avformat_alloc_output_context2(&oc, NULL, "opengl", NULL)) < 0) + * goto fail; + * if (avdevice_capabilities_create(&caps, oc, NULL) < 0) + * goto fail; + * + * //query codecs + * if (av_opt_query_ranges(&ranges, caps, "codec", AV_OPT_MULTI_COMPONENT_RANGE)) < 0) + * goto fail; + * //pick codec here and set it + * av_opt_set(caps, "codec", AV_CODEC_ID_RAWVIDEO, 0); + * + * //query format + * if (av_opt_query_ranges(&ranges, caps, "pixel_format", AV_OPT_MULTI_COMPONENT_RANGE)) < 0) + * goto fail; + * //pick format here and set it + * av_opt_set(caps, "pixel_format", AV_PIX_FMT_YUV420P, 0); + * + * //query and set more capabilities + * + * fail: + * //clean up code + * avdevice_capabilities_free(&query, oc); + * avformat_free_context(oc); + * @endcode + */ + +/** + * Structure describes device capabilities. + * + * It is used by devices in conjunction with av_device_capabilities AVOption table + * to implement capabilities probing API based on AVOption API. Should not be used directly. + */ +typedef struct AVDeviceCapabilitiesQuery { + const AVClass *av_class; + AVFormatContext *device_context; + enum AVCodecID codec; + enum AVSampleFormat sample_format; + enum AVPixelFormat pixel_format; + int sample_rate; + int channels; + int64_t channel_layout; + int window_width; + int window_height; + int frame_width; + int frame_height; + AVRational fps; +} AVDeviceCapabilitiesQuery; + +/** + * AVOption table used by devices to implement device capabilities API. Should not be used by a user. + */ +extern const AVOption av_device_capabilities[]; + +/** + * Initialize capabilities probing API based on AVOption API. + * + * avdevice_capabilities_free() must be called when query capabilities API is + * not used anymore. + * + * @param[out] caps Device capabilities data. Pointer to a NULL pointer must be passed. + * @param s Context of the device. + * @param device_options An AVDictionary filled with device-private options. + * On return this parameter will be destroyed and replaced with a dict + * containing options that were not found. May be NULL. + * The same options must be passed later to avformat_write_header() for output + * devices or avformat_open_input() for input devices, or at any other place + * that affects device-private options. + * + * @return >= 0 on success, negative otherwise. + */ +int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s, + AVDictionary **device_options); + +/** + * Free resources created by avdevice_capabilities_create() + * + * @param caps Device capabilities data to be freed. + * @param s Context of the device. + */ +void avdevice_capabilities_free(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s); + +/** + * Structure describes basic parameters of the device. + */ +typedef struct AVDeviceInfo { + char *device_name; /**< device name, format depends on device */ + char *device_description; /**< human friendly name */ +} AVDeviceInfo; + +/** + * List of devices. + */ +typedef struct AVDeviceInfoList { + AVDeviceInfo **devices; /**< list of autodetected devices */ + int nb_devices; /**< number of autodetected devices */ + int default_device; /**< index of default device or -1 if no default */ +} AVDeviceInfoList; + +/** + * List devices. + * + * Returns available device names and their parameters. + * + * @note: Some devices may accept system-dependent device names that cannot be + * autodetected. The list returned by this function cannot be assumed to + * be always completed. + * + * @param s device context. + * @param[out] device_list list of autodetected devices. + * @return count of autodetected devices, negative on error. + */ +int avdevice_list_devices(struct AVFormatContext *s, AVDeviceInfoList **device_list); + +/** + * Convenient function to free result of avdevice_list_devices(). + * + * @param devices device list to be freed. + */ +void avdevice_free_list_devices(AVDeviceInfoList **device_list); + +/** + * List devices. + * + * Returns available device names and their parameters. + * These are convinient wrappers for avdevice_list_devices(). + * Device context is allocated and deallocated internally. + * + * @param device device format. May be NULL if device name is set. + * @param device_name device name. May be NULL if device format is set. + * @param device_options An AVDictionary filled with device-private options. May be NULL. + * The same options must be passed later to avformat_write_header() for output + * devices or avformat_open_input() for input devices, or at any other place + * that affects device-private options. + * @param[out] device_list list of autodetected devices + * @return count of autodetected devices, negative on error. + * @note device argument takes precedence over device_name when both are set. + */ +int avdevice_list_input_sources(struct AVInputFormat *device, const char *device_name, + AVDictionary *device_options, AVDeviceInfoList **device_list); +int avdevice_list_output_sinks(struct AVOutputFormat *device, const char *device_name, + AVDictionary *device_options, AVDeviceInfoList **device_list); + +#endif /* AVDEVICE_AVDEVICE_H */ diff --git a/Src/Decoder_H264_ALL/include/libavdevice/version.h b/Src/Decoder_H264_ALL/include/libavdevice/version.h new file mode 100644 index 0000000..94a34fd --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavdevice/version.h @@ -0,0 +1,50 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVDEVICE_VERSION_H +#define AVDEVICE_VERSION_H + +/** + * @file + * @ingroup lavd + * Libavdevice version macros + */ + +#include "libavutil/version.h" + +#define LIBAVDEVICE_VERSION_MAJOR 57 +#define LIBAVDEVICE_VERSION_MINOR 0 +#define LIBAVDEVICE_VERSION_MICRO 102 + +#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ + LIBAVDEVICE_VERSION_MINOR, \ + LIBAVDEVICE_VERSION_MICRO) +#define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \ + LIBAVDEVICE_VERSION_MINOR, \ + LIBAVDEVICE_VERSION_MICRO) +#define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT + +#define LIBAVDEVICE_IDENT "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION) + +/** + * FF_API_* defines may be placed below to indicate public API that will be + * dropped at a future version bump. The defines themselves are not part of + * the public API and may change, break or disappear at any time. + */ + +#endif /* AVDEVICE_VERSION_H */ diff --git a/Src/Decoder_H264_ALL/include/libavfilter/avfilter.h b/Src/Decoder_H264_ALL/include/libavfilter/avfilter.h new file mode 100644 index 0000000..757b81a --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavfilter/avfilter.h @@ -0,0 +1,1117 @@ +/* + * filter layer + * Copyright (c) 2007 Bobby Bingham + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_AVFILTER_H +#define AVFILTER_AVFILTER_H + +/** + * @file + * @ingroup lavfi + * Main libavfilter public API header + */ + +/** + * @defgroup lavfi Libavfilter - graph-based frame editing library + * @{ + */ + +#include + +#include "libavutil/attributes.h" +#include "libavutil/avutil.h" +#include "libavutil/buffer.h" +#include "libavutil/dict.h" +#include "libavutil/frame.h" +#include "libavutil/log.h" +#include "libavutil/samplefmt.h" +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" + +#include "libavfilter/version.h" + +/** + * Return the LIBAVFILTER_VERSION_INT constant. + */ +unsigned avfilter_version(void); + +/** + * Return the libavfilter build-time configuration. + */ +const char *avfilter_configuration(void); + +/** + * Return the libavfilter license. + */ +const char *avfilter_license(void); + +typedef struct AVFilterContext AVFilterContext; +typedef struct AVFilterLink AVFilterLink; +typedef struct AVFilterPad AVFilterPad; +typedef struct AVFilterFormats AVFilterFormats; + +/** + * Get the number of elements in a NULL-terminated array of AVFilterPads (e.g. + * AVFilter.inputs/outputs). + */ +int avfilter_pad_count(const AVFilterPad *pads); + +/** + * Get the name of an AVFilterPad. + * + * @param pads an array of AVFilterPads + * @param pad_idx index of the pad in the array it; is the caller's + * responsibility to ensure the index is valid + * + * @return name of the pad_idx'th pad in pads + */ +const char *avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx); + +/** + * Get the type of an AVFilterPad. + * + * @param pads an array of AVFilterPads + * @param pad_idx index of the pad in the array; it is the caller's + * responsibility to ensure the index is valid + * + * @return type of the pad_idx'th pad in pads + */ +enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx); + +/** + * The number of the filter inputs is not determined just by AVFilter.inputs. + * The filter might add additional inputs during initialization depending on the + * options supplied to it. + */ +#define AVFILTER_FLAG_DYNAMIC_INPUTS (1 << 0) +/** + * The number of the filter outputs is not determined just by AVFilter.outputs. + * The filter might add additional outputs during initialization depending on + * the options supplied to it. + */ +#define AVFILTER_FLAG_DYNAMIC_OUTPUTS (1 << 1) +/** + * The filter supports multithreading by splitting frames into multiple parts + * and processing them concurrently. + */ +#define AVFILTER_FLAG_SLICE_THREADS (1 << 2) +/** + * Some filters support a generic "enable" expression option that can be used + * to enable or disable a filter in the timeline. Filters supporting this + * option have this flag set. When the enable expression is false, the default + * no-op filter_frame() function is called in place of the filter_frame() + * callback defined on each input pad, thus the frame is passed unchanged to + * the next filters. + */ +#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC (1 << 16) +/** + * Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will + * have its filter_frame() callback(s) called as usual even when the enable + * expression is false. The filter will disable filtering within the + * filter_frame() callback(s) itself, for example executing code depending on + * the AVFilterContext->is_disabled value. + */ +#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL (1 << 17) +/** + * Handy mask to test whether the filter supports or no the timeline feature + * (internally or generically). + */ +#define AVFILTER_FLAG_SUPPORT_TIMELINE (AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL) + +/** + * Filter definition. This defines the pads a filter contains, and all the + * callback functions used to interact with the filter. + */ +typedef struct AVFilter { + /** + * Filter name. Must be non-NULL and unique among filters. + */ + const char *name; + + /** + * A description of the filter. May be NULL. + * + * You should use the NULL_IF_CONFIG_SMALL() macro to define it. + */ + const char *description; + + /** + * List of inputs, terminated by a zeroed element. + * + * NULL if there are no (static) inputs. Instances of filters with + * AVFILTER_FLAG_DYNAMIC_INPUTS set may have more inputs than present in + * this list. + */ + const AVFilterPad *inputs; + /** + * List of outputs, terminated by a zeroed element. + * + * NULL if there are no (static) outputs. Instances of filters with + * AVFILTER_FLAG_DYNAMIC_OUTPUTS set may have more outputs than present in + * this list. + */ + const AVFilterPad *outputs; + + /** + * A class for the private data, used to declare filter private AVOptions. + * This field is NULL for filters that do not declare any options. + * + * If this field is non-NULL, the first member of the filter private data + * must be a pointer to AVClass, which will be set by libavfilter generic + * code to this class. + */ + const AVClass *priv_class; + + /** + * A combination of AVFILTER_FLAG_* + */ + int flags; + + /***************************************************************** + * All fields below this line are not part of the public API. They + * may not be used outside of libavfilter and can be changed and + * removed at will. + * New public fields should be added right above. + ***************************************************************** + */ + + /** + * Filter initialization function. + * + * This callback will be called only once during the filter lifetime, after + * all the options have been set, but before links between filters are + * established and format negotiation is done. + * + * Basic filter initialization should be done here. Filters with dynamic + * inputs and/or outputs should create those inputs/outputs here based on + * provided options. No more changes to this filter's inputs/outputs can be + * done after this callback. + * + * This callback must not assume that the filter links exist or frame + * parameters are known. + * + * @ref AVFilter.uninit "uninit" is guaranteed to be called even if + * initialization fails, so this callback does not have to clean up on + * failure. + * + * @return 0 on success, a negative AVERROR on failure + */ + int (*init)(AVFilterContext *ctx); + + /** + * Should be set instead of @ref AVFilter.init "init" by the filters that + * want to pass a dictionary of AVOptions to nested contexts that are + * allocated during init. + * + * On return, the options dict should be freed and replaced with one that + * contains all the options which could not be processed by this filter (or + * with NULL if all the options were processed). + * + * Otherwise the semantics is the same as for @ref AVFilter.init "init". + */ + int (*init_dict)(AVFilterContext *ctx, AVDictionary **options); + + /** + * Filter uninitialization function. + * + * Called only once right before the filter is freed. Should deallocate any + * memory held by the filter, release any buffer references, etc. It does + * not need to deallocate the AVFilterContext.priv memory itself. + * + * This callback may be called even if @ref AVFilter.init "init" was not + * called or failed, so it must be prepared to handle such a situation. + */ + void (*uninit)(AVFilterContext *ctx); + + /** + * Query formats supported by the filter on its inputs and outputs. + * + * This callback is called after the filter is initialized (so the inputs + * and outputs are fixed), shortly before the format negotiation. This + * callback may be called more than once. + * + * This callback must set AVFilterLink.out_formats on every input link and + * AVFilterLink.in_formats on every output link to a list of pixel/sample + * formats that the filter supports on that link. For audio links, this + * filter must also set @ref AVFilterLink.in_samplerates "in_samplerates" / + * @ref AVFilterLink.out_samplerates "out_samplerates" and + * @ref AVFilterLink.in_channel_layouts "in_channel_layouts" / + * @ref AVFilterLink.out_channel_layouts "out_channel_layouts" analogously. + * + * This callback may be NULL for filters with one input, in which case + * libavfilter assumes that it supports all input formats and preserves + * them on output. + * + * @return zero on success, a negative value corresponding to an + * AVERROR code otherwise + */ + int (*query_formats)(AVFilterContext *); + + int priv_size; ///< size of private data to allocate for the filter + + /** + * Used by the filter registration system. Must not be touched by any other + * code. + */ + struct AVFilter *next; + + /** + * Make the filter instance process a command. + * + * @param cmd the command to process, for handling simplicity all commands must be alphanumeric only + * @param arg the argument for the command + * @param res a buffer with size res_size where the filter(s) can return a response. This must not change when the command is not supported. + * @param flags if AVFILTER_CMD_FLAG_FAST is set and the command would be + * time consuming then a filter should treat it like an unsupported command + * + * @returns >=0 on success otherwise an error code. + * AVERROR(ENOSYS) on unsupported commands + */ + int (*process_command)(AVFilterContext *, const char *cmd, const char *arg, char *res, int res_len, int flags); + + /** + * Filter initialization function, alternative to the init() + * callback. Args contains the user-supplied parameters, opaque is + * used for providing binary data. + */ + int (*init_opaque)(AVFilterContext *ctx, void *opaque); +} AVFilter; + +/** + * Process multiple parts of the frame concurrently. + */ +#define AVFILTER_THREAD_SLICE (1 << 0) + +typedef struct AVFilterInternal AVFilterInternal; + +/** An instance of a filter */ +struct AVFilterContext { + const AVClass *av_class; ///< needed for av_log() and filters common options + + const AVFilter *filter; ///< the AVFilter of which this is an instance + + char *name; ///< name of this filter instance + + AVFilterPad *input_pads; ///< array of input pads + AVFilterLink **inputs; ///< array of pointers to input links + unsigned nb_inputs; ///< number of input pads + + AVFilterPad *output_pads; ///< array of output pads + AVFilterLink **outputs; ///< array of pointers to output links + unsigned nb_outputs; ///< number of output pads + + void *priv; ///< private data for use by the filter + + struct AVFilterGraph *graph; ///< filtergraph this filter belongs to + + /** + * Type of multithreading being allowed/used. A combination of + * AVFILTER_THREAD_* flags. + * + * May be set by the caller before initializing the filter to forbid some + * or all kinds of multithreading for this filter. The default is allowing + * everything. + * + * When the filter is initialized, this field is combined using bit AND with + * AVFilterGraph.thread_type to get the final mask used for determining + * allowed threading types. I.e. a threading type needs to be set in both + * to be allowed. + * + * After the filter is initialized, libavfilter sets this field to the + * threading type that is actually used (0 for no multithreading). + */ + int thread_type; + + /** + * An opaque struct for libavfilter internal use. + */ + AVFilterInternal *internal; + + struct AVFilterCommand *command_queue; + + char *enable_str; ///< enable expression string + void *enable; ///< parsed expression (AVExpr*) + double *var_values; ///< variable values for the enable expression + int is_disabled; ///< the enabled state from the last expression evaluation + + /** + * For filters which will create hardware frames, sets the device the + * filter should create them in. All other filters will ignore this field: + * in particular, a filter which consumes or processes hardware frames will + * instead use the hw_frames_ctx field in AVFilterLink to carry the + * hardware context information. + */ + AVBufferRef *hw_device_ctx; +}; + +/** + * A link between two filters. This contains pointers to the source and + * destination filters between which this link exists, and the indexes of + * the pads involved. In addition, this link also contains the parameters + * which have been negotiated and agreed upon between the filter, such as + * image dimensions, format, etc. + */ +struct AVFilterLink { + AVFilterContext *src; ///< source filter + AVFilterPad *srcpad; ///< output pad on the source filter + + AVFilterContext *dst; ///< dest filter + AVFilterPad *dstpad; ///< input pad on the dest filter + + enum AVMediaType type; ///< filter media type + + /* These parameters apply only to video */ + int w; ///< agreed upon image width + int h; ///< agreed upon image height + AVRational sample_aspect_ratio; ///< agreed upon sample aspect ratio + /* These parameters apply only to audio */ + uint64_t channel_layout; ///< channel layout of current buffer (see libavutil/channel_layout.h) + int sample_rate; ///< samples per second + + int format; ///< agreed upon media format + + /** + * Define the time base used by the PTS of the frames/samples + * which will pass through this link. + * During the configuration stage, each filter is supposed to + * change only the output timebase, while the timebase of the + * input link is assumed to be an unchangeable property. + */ + AVRational time_base; + + /***************************************************************** + * All fields below this line are not part of the public API. They + * may not be used outside of libavfilter and can be changed and + * removed at will. + * New public fields should be added right above. + ***************************************************************** + */ + /** + * Lists of formats and channel layouts supported by the input and output + * filters respectively. These lists are used for negotiating the format + * to actually be used, which will be loaded into the format and + * channel_layout members, above, when chosen. + * + */ + AVFilterFormats *in_formats; + AVFilterFormats *out_formats; + + /** + * Lists of channel layouts and sample rates used for automatic + * negotiation. + */ + AVFilterFormats *in_samplerates; + AVFilterFormats *out_samplerates; + struct AVFilterChannelLayouts *in_channel_layouts; + struct AVFilterChannelLayouts *out_channel_layouts; + + /** + * Audio only, the destination filter sets this to a non-zero value to + * request that buffers with the given number of samples should be sent to + * it. AVFilterPad.needs_fifo must also be set on the corresponding input + * pad. + * Last buffer before EOF will be padded with silence. + */ + int request_samples; + + /** stage of the initialization of the link properties (dimensions, etc) */ + enum { + AVLINK_UNINIT = 0, ///< not started + AVLINK_STARTINIT, ///< started, but incomplete + AVLINK_INIT ///< complete + } init_state; + + /** + * Graph the filter belongs to. + */ + struct AVFilterGraph *graph; + + /** + * Current timestamp of the link, as defined by the most recent + * frame(s), in link time_base units. + */ + int64_t current_pts; + + /** + * Current timestamp of the link, as defined by the most recent + * frame(s), in AV_TIME_BASE units. + */ + int64_t current_pts_us; + + /** + * Index in the age array. + */ + int age_index; + + /** + * Frame rate of the stream on the link, or 1/0 if unknown or variable; + * if left to 0/0, will be automatically copied from the first input + * of the source filter if it exists. + * + * Sources should set it to the best estimation of the real frame rate. + * If the source frame rate is unknown or variable, set this to 1/0. + * Filters should update it if necessary depending on their function. + * Sinks can use it to set a default output frame rate. + * It is similar to the r_frame_rate field in AVStream. + */ + AVRational frame_rate; + + /** + * Buffer partially filled with samples to achieve a fixed/minimum size. + */ + AVFrame *partial_buf; + + /** + * Size of the partial buffer to allocate. + * Must be between min_samples and max_samples. + */ + int partial_buf_size; + + /** + * Minimum number of samples to filter at once. If filter_frame() is + * called with fewer samples, it will accumulate them in partial_buf. + * This field and the related ones must not be changed after filtering + * has started. + * If 0, all related fields are ignored. + */ + int min_samples; + + /** + * Maximum number of samples to filter at once. If filter_frame() is + * called with more samples, it will split them. + */ + int max_samples; + + /** + * Link status. + * If not zero, all attempts of filter_frame or request_frame + * will fail with the corresponding code, and if necessary the reference + * will be destroyed. + * If request_frame returns an error, the status is set on the + * corresponding link. + * It can be set also be set by either the source or the destination + * filter. + */ + int status; + + /** + * Number of channels. + */ + int channels; + + /** + * Link processing flags. + */ + unsigned flags; + + /** + * Number of past frames sent through the link. + */ + int64_t frame_count; + + /** + * A pointer to a FFVideoFramePool struct. + */ + void *video_frame_pool; + + /** + * True if a frame is currently wanted on the input of this filter. + * Set when ff_request_frame() is called by the output, + * cleared when the request is handled or forwarded. + */ + int frame_wanted_in; + + /** + * True if a frame is currently wanted on the output of this filter. + * Set when ff_request_frame() is called by the output, + * cleared when a frame is filtered. + */ + int frame_wanted_out; + + /** + * For hwaccel pixel formats, this should be a reference to the + * AVHWFramesContext describing the frames. + */ + AVBufferRef *hw_frames_ctx; +}; + +/** + * Link two filters together. + * + * @param src the source filter + * @param srcpad index of the output pad on the source filter + * @param dst the destination filter + * @param dstpad index of the input pad on the destination filter + * @return zero on success + */ +int avfilter_link(AVFilterContext *src, unsigned srcpad, + AVFilterContext *dst, unsigned dstpad); + +/** + * Free the link in *link, and set its pointer to NULL. + */ +void avfilter_link_free(AVFilterLink **link); + +/** + * Get the number of channels of a link. + */ +int avfilter_link_get_channels(AVFilterLink *link); + +/** + * Set the closed field of a link. + * @deprecated applications are not supposed to mess with links, they should + * close the sinks. + */ +attribute_deprecated +void avfilter_link_set_closed(AVFilterLink *link, int closed); + +/** + * Negotiate the media format, dimensions, etc of all inputs to a filter. + * + * @param filter the filter to negotiate the properties for its inputs + * @return zero on successful negotiation + */ +int avfilter_config_links(AVFilterContext *filter); + +#define AVFILTER_CMD_FLAG_ONE 1 ///< Stop once a filter understood the command (for target=all for example), fast filters are favored automatically +#define AVFILTER_CMD_FLAG_FAST 2 ///< Only execute command when its fast (like a video out that supports contrast adjustment in hw) + +/** + * Make the filter instance process a command. + * It is recommended to use avfilter_graph_send_command(). + */ +int avfilter_process_command(AVFilterContext *filter, const char *cmd, const char *arg, char *res, int res_len, int flags); + +/** Initialize the filter system. Register all builtin filters. */ +void avfilter_register_all(void); + +#if FF_API_OLD_FILTER_REGISTER +/** Uninitialize the filter system. Unregister all filters. */ +attribute_deprecated +void avfilter_uninit(void); +#endif + +/** + * Register a filter. This is only needed if you plan to use + * avfilter_get_by_name later to lookup the AVFilter structure by name. A + * filter can still by instantiated with avfilter_graph_alloc_filter even if it + * is not registered. + * + * @param filter the filter to register + * @return 0 if the registration was successful, a negative value + * otherwise + */ +int avfilter_register(AVFilter *filter); + +/** + * Get a filter definition matching the given name. + * + * @param name the filter name to find + * @return the filter definition, if any matching one is registered. + * NULL if none found. + */ +#if !FF_API_NOCONST_GET_NAME +const +#endif +AVFilter *avfilter_get_by_name(const char *name); + +/** + * Iterate over all registered filters. + * @return If prev is non-NULL, next registered filter after prev or NULL if + * prev is the last filter. If prev is NULL, return the first registered filter. + */ +const AVFilter *avfilter_next(const AVFilter *prev); + +#if FF_API_OLD_FILTER_REGISTER +/** + * If filter is NULL, returns a pointer to the first registered filter pointer, + * if filter is non-NULL, returns the next pointer after filter. + * If the returned pointer points to NULL, the last registered filter + * was already reached. + * @deprecated use avfilter_next() + */ +attribute_deprecated +AVFilter **av_filter_next(AVFilter **filter); +#endif + +#if FF_API_AVFILTER_OPEN +/** + * Create a filter instance. + * + * @param filter_ctx put here a pointer to the created filter context + * on success, NULL on failure + * @param filter the filter to create an instance of + * @param inst_name Name to give to the new instance. Can be NULL for none. + * @return >= 0 in case of success, a negative error code otherwise + * @deprecated use avfilter_graph_alloc_filter() instead + */ +attribute_deprecated +int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name); +#endif + + +#if FF_API_AVFILTER_INIT_FILTER +/** + * Initialize a filter. + * + * @param filter the filter to initialize + * @param args A string of parameters to use when initializing the filter. + * The format and meaning of this string varies by filter. + * @param opaque Any extra non-string data needed by the filter. The meaning + * of this parameter varies by filter. + * @return zero on success + */ +attribute_deprecated +int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque); +#endif + +/** + * Initialize a filter with the supplied parameters. + * + * @param ctx uninitialized filter context to initialize + * @param args Options to initialize the filter with. This must be a + * ':'-separated list of options in the 'key=value' form. + * May be NULL if the options have been set directly using the + * AVOptions API or there are no options that need to be set. + * @return 0 on success, a negative AVERROR on failure + */ +int avfilter_init_str(AVFilterContext *ctx, const char *args); + +/** + * Initialize a filter with the supplied dictionary of options. + * + * @param ctx uninitialized filter context to initialize + * @param options An AVDictionary filled with options for this filter. On + * return this parameter will be destroyed and replaced with + * a dict containing options that were not found. This dictionary + * must be freed by the caller. + * May be NULL, then this function is equivalent to + * avfilter_init_str() with the second parameter set to NULL. + * @return 0 on success, a negative AVERROR on failure + * + * @note This function and avfilter_init_str() do essentially the same thing, + * the difference is in manner in which the options are passed. It is up to the + * calling code to choose whichever is more preferable. The two functions also + * behave differently when some of the provided options are not declared as + * supported by the filter. In such a case, avfilter_init_str() will fail, but + * this function will leave those extra options in the options AVDictionary and + * continue as usual. + */ +int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options); + +/** + * Free a filter context. This will also remove the filter from its + * filtergraph's list of filters. + * + * @param filter the filter to free + */ +void avfilter_free(AVFilterContext *filter); + +/** + * Insert a filter in the middle of an existing link. + * + * @param link the link into which the filter should be inserted + * @param filt the filter to be inserted + * @param filt_srcpad_idx the input pad on the filter to connect + * @param filt_dstpad_idx the output pad on the filter to connect + * @return zero on success + */ +int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, + unsigned filt_srcpad_idx, unsigned filt_dstpad_idx); + +/** + * @return AVClass for AVFilterContext. + * + * @see av_opt_find(). + */ +const AVClass *avfilter_get_class(void); + +typedef struct AVFilterGraphInternal AVFilterGraphInternal; + +/** + * A function pointer passed to the @ref AVFilterGraph.execute callback to be + * executed multiple times, possibly in parallel. + * + * @param ctx the filter context the job belongs to + * @param arg an opaque parameter passed through from @ref + * AVFilterGraph.execute + * @param jobnr the index of the job being executed + * @param nb_jobs the total number of jobs + * + * @return 0 on success, a negative AVERROR on error + */ +typedef int (avfilter_action_func)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs); + +/** + * A function executing multiple jobs, possibly in parallel. + * + * @param ctx the filter context to which the jobs belong + * @param func the function to be called multiple times + * @param arg the argument to be passed to func + * @param ret a nb_jobs-sized array to be filled with return values from each + * invocation of func + * @param nb_jobs the number of jobs to execute + * + * @return 0 on success, a negative AVERROR on error + */ +typedef int (avfilter_execute_func)(AVFilterContext *ctx, avfilter_action_func *func, + void *arg, int *ret, int nb_jobs); + +typedef struct AVFilterGraph { + const AVClass *av_class; + AVFilterContext **filters; + unsigned nb_filters; + + char *scale_sws_opts; ///< sws options to use for the auto-inserted scale filters + char *resample_lavr_opts; ///< libavresample options to use for the auto-inserted resample filters + + /** + * Type of multithreading allowed for filters in this graph. A combination + * of AVFILTER_THREAD_* flags. + * + * May be set by the caller at any point, the setting will apply to all + * filters initialized after that. The default is allowing everything. + * + * When a filter in this graph is initialized, this field is combined using + * bit AND with AVFilterContext.thread_type to get the final mask used for + * determining allowed threading types. I.e. a threading type needs to be + * set in both to be allowed. + */ + int thread_type; + + /** + * Maximum number of threads used by filters in this graph. May be set by + * the caller before adding any filters to the filtergraph. Zero (the + * default) means that the number of threads is determined automatically. + */ + int nb_threads; + + /** + * Opaque object for libavfilter internal use. + */ + AVFilterGraphInternal *internal; + + /** + * Opaque user data. May be set by the caller to an arbitrary value, e.g. to + * be used from callbacks like @ref AVFilterGraph.execute. + * Libavfilter will not touch this field in any way. + */ + void *opaque; + + /** + * This callback may be set by the caller immediately after allocating the + * graph and before adding any filters to it, to provide a custom + * multithreading implementation. + * + * If set, filters with slice threading capability will call this callback + * to execute multiple jobs in parallel. + * + * If this field is left unset, libavfilter will use its internal + * implementation, which may or may not be multithreaded depending on the + * platform and build options. + */ + avfilter_execute_func *execute; + + char *aresample_swr_opts; ///< swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions + + /** + * Private fields + * + * The following fields are for internal use only. + * Their type, offset, number and semantic can change without notice. + */ + + AVFilterLink **sink_links; + int sink_links_count; + + unsigned disable_auto_convert; +} AVFilterGraph; + +/** + * Allocate a filter graph. + * + * @return the allocated filter graph on success or NULL. + */ +AVFilterGraph *avfilter_graph_alloc(void); + +/** + * Create a new filter instance in a filter graph. + * + * @param graph graph in which the new filter will be used + * @param filter the filter to create an instance of + * @param name Name to give to the new instance (will be copied to + * AVFilterContext.name). This may be used by the caller to identify + * different filters, libavfilter itself assigns no semantics to + * this parameter. May be NULL. + * + * @return the context of the newly created filter instance (note that it is + * also retrievable directly through AVFilterGraph.filters or with + * avfilter_graph_get_filter()) on success or NULL on failure. + */ +AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph, + const AVFilter *filter, + const char *name); + +/** + * Get a filter instance identified by instance name from graph. + * + * @param graph filter graph to search through. + * @param name filter instance name (should be unique in the graph). + * @return the pointer to the found filter instance or NULL if it + * cannot be found. + */ +AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, const char *name); + +#if FF_API_AVFILTER_OPEN +/** + * Add an existing filter instance to a filter graph. + * + * @param graphctx the filter graph + * @param filter the filter to be added + * + * @deprecated use avfilter_graph_alloc_filter() to allocate a filter in a + * filter graph + */ +attribute_deprecated +int avfilter_graph_add_filter(AVFilterGraph *graphctx, AVFilterContext *filter); +#endif + +/** + * Create and add a filter instance into an existing graph. + * The filter instance is created from the filter filt and inited + * with the parameters args and opaque. + * + * In case of success put in *filt_ctx the pointer to the created + * filter instance, otherwise set *filt_ctx to NULL. + * + * @param name the instance name to give to the created filter instance + * @param graph_ctx the filter graph + * @return a negative AVERROR error code in case of failure, a non + * negative value otherwise + */ +int avfilter_graph_create_filter(AVFilterContext **filt_ctx, const AVFilter *filt, + const char *name, const char *args, void *opaque, + AVFilterGraph *graph_ctx); + +/** + * Enable or disable automatic format conversion inside the graph. + * + * Note that format conversion can still happen inside explicitly inserted + * scale and aresample filters. + * + * @param flags any of the AVFILTER_AUTO_CONVERT_* constants + */ +void avfilter_graph_set_auto_convert(AVFilterGraph *graph, unsigned flags); + +enum { + AVFILTER_AUTO_CONVERT_ALL = 0, /**< all automatic conversions enabled */ + AVFILTER_AUTO_CONVERT_NONE = -1, /**< all automatic conversions disabled */ +}; + +/** + * Check validity and configure all the links and formats in the graph. + * + * @param graphctx the filter graph + * @param log_ctx context used for logging + * @return >= 0 in case of success, a negative AVERROR code otherwise + */ +int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx); + +/** + * Free a graph, destroy its links, and set *graph to NULL. + * If *graph is NULL, do nothing. + */ +void avfilter_graph_free(AVFilterGraph **graph); + +/** + * A linked-list of the inputs/outputs of the filter chain. + * + * This is mainly useful for avfilter_graph_parse() / avfilter_graph_parse2(), + * where it is used to communicate open (unlinked) inputs and outputs from and + * to the caller. + * This struct specifies, per each not connected pad contained in the graph, the + * filter context and the pad index required for establishing a link. + */ +typedef struct AVFilterInOut { + /** unique name for this input/output in the list */ + char *name; + + /** filter context associated to this input/output */ + AVFilterContext *filter_ctx; + + /** index of the filt_ctx pad to use for linking */ + int pad_idx; + + /** next input/input in the list, NULL if this is the last */ + struct AVFilterInOut *next; +} AVFilterInOut; + +/** + * Allocate a single AVFilterInOut entry. + * Must be freed with avfilter_inout_free(). + * @return allocated AVFilterInOut on success, NULL on failure. + */ +AVFilterInOut *avfilter_inout_alloc(void); + +/** + * Free the supplied list of AVFilterInOut and set *inout to NULL. + * If *inout is NULL, do nothing. + */ +void avfilter_inout_free(AVFilterInOut **inout); + +/** + * Add a graph described by a string to a graph. + * + * @note The caller must provide the lists of inputs and outputs, + * which therefore must be known before calling the function. + * + * @note The inputs parameter describes inputs of the already existing + * part of the graph; i.e. from the point of view of the newly created + * part, they are outputs. Similarly the outputs parameter describes + * outputs of the already existing filters, which are provided as + * inputs to the parsed filters. + * + * @param graph the filter graph where to link the parsed graph context + * @param filters string to be parsed + * @param inputs linked list to the inputs of the graph + * @param outputs linked list to the outputs of the graph + * @return zero on success, a negative AVERROR code on error + */ +int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, + AVFilterInOut *inputs, AVFilterInOut *outputs, + void *log_ctx); + +/** + * Add a graph described by a string to a graph. + * + * In the graph filters description, if the input label of the first + * filter is not specified, "in" is assumed; if the output label of + * the last filter is not specified, "out" is assumed. + * + * @param graph the filter graph where to link the parsed graph context + * @param filters string to be parsed + * @param inputs pointer to a linked list to the inputs of the graph, may be NULL. + * If non-NULL, *inputs is updated to contain the list of open inputs + * after the parsing, should be freed with avfilter_inout_free(). + * @param outputs pointer to a linked list to the outputs of the graph, may be NULL. + * If non-NULL, *outputs is updated to contain the list of open outputs + * after the parsing, should be freed with avfilter_inout_free(). + * @return non negative on success, a negative AVERROR code on error + */ +int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters, + AVFilterInOut **inputs, AVFilterInOut **outputs, + void *log_ctx); + +/** + * Add a graph described by a string to a graph. + * + * @param[in] graph the filter graph where to link the parsed graph context + * @param[in] filters string to be parsed + * @param[out] inputs a linked list of all free (unlinked) inputs of the + * parsed graph will be returned here. It is to be freed + * by the caller using avfilter_inout_free(). + * @param[out] outputs a linked list of all free (unlinked) outputs of the + * parsed graph will be returned here. It is to be freed by the + * caller using avfilter_inout_free(). + * @return zero on success, a negative AVERROR code on error + * + * @note This function returns the inputs and outputs that are left + * unlinked after parsing the graph and the caller then deals with + * them. + * @note This function makes no reference whatsoever to already + * existing parts of the graph and the inputs parameter will on return + * contain inputs of the newly parsed part of the graph. Analogously + * the outputs parameter will contain outputs of the newly created + * filters. + */ +int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters, + AVFilterInOut **inputs, + AVFilterInOut **outputs); + +/** + * Send a command to one or more filter instances. + * + * @param graph the filter graph + * @param target the filter(s) to which the command should be sent + * "all" sends to all filters + * otherwise it can be a filter or filter instance name + * which will send the command to all matching filters. + * @param cmd the command to send, for handling simplicity all commands must be alphanumeric only + * @param arg the argument for the command + * @param res a buffer with size res_size where the filter(s) can return a response. + * + * @returns >=0 on success otherwise an error code. + * AVERROR(ENOSYS) on unsupported commands + */ +int avfilter_graph_send_command(AVFilterGraph *graph, const char *target, const char *cmd, const char *arg, char *res, int res_len, int flags); + +/** + * Queue a command for one or more filter instances. + * + * @param graph the filter graph + * @param target the filter(s) to which the command should be sent + * "all" sends to all filters + * otherwise it can be a filter or filter instance name + * which will send the command to all matching filters. + * @param cmd the command to sent, for handling simplicity all commands must be alphanumeric only + * @param arg the argument for the command + * @param ts time at which the command should be sent to the filter + * + * @note As this executes commands after this function returns, no return code + * from the filter is provided, also AVFILTER_CMD_FLAG_ONE is not supported. + */ +int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const char *cmd, const char *arg, int flags, double ts); + + +/** + * Dump a graph into a human-readable string representation. + * + * @param graph the graph to dump + * @param options formatting options; currently ignored + * @return a string, or NULL in case of memory allocation failure; + * the string must be freed using av_free + */ +char *avfilter_graph_dump(AVFilterGraph *graph, const char *options); + +/** + * Request a frame on the oldest sink link. + * + * If the request returns AVERROR_EOF, try the next. + * + * Note that this function is not meant to be the sole scheduling mechanism + * of a filtergraph, only a convenience function to help drain a filtergraph + * in a balanced way under normal circumstances. + * + * Also note that AVERROR_EOF does not mean that frames did not arrive on + * some of the sinks during the process. + * When there are multiple sink links, in case the requested link + * returns an EOF, this may cause a filter to flush pending frames + * which are sent to another sink link, although unrequested. + * + * @return the return value of ff_request_frame(), + * or AVERROR_EOF if all links returned AVERROR_EOF + */ +int avfilter_graph_request_oldest(AVFilterGraph *graph); + +/** + * @} + */ + +#endif /* AVFILTER_AVFILTER_H */ diff --git a/Src/Decoder_H264_ALL/include/libavfilter/avfiltergraph.h b/Src/Decoder_H264_ALL/include/libavfilter/avfiltergraph.h new file mode 100644 index 0000000..b31d581 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavfilter/avfiltergraph.h @@ -0,0 +1,28 @@ +/* + * Filter graphs + * copyright (c) 2007 Bobby Bingham + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_AVFILTERGRAPH_H +#define AVFILTER_AVFILTERGRAPH_H + +#include "avfilter.h" +#include "libavutil/log.h" + +#endif /* AVFILTER_AVFILTERGRAPH_H */ diff --git a/Src/Decoder_H264_ALL/include/libavfilter/buffersink.h b/Src/Decoder_H264_ALL/include/libavfilter/buffersink.h new file mode 100644 index 0000000..e399b91 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavfilter/buffersink.h @@ -0,0 +1,147 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_BUFFERSINK_H +#define AVFILTER_BUFFERSINK_H + +/** + * @file + * @ingroup lavfi_buffersink + * memory buffer sink API for audio and video + */ + +#include "avfilter.h" + +/** + * @defgroup lavfi_buffersink Buffer sink API + * @ingroup lavfi + * @{ + */ + +/** + * Get a frame with filtered data from sink and put it in frame. + * + * @param ctx pointer to a buffersink or abuffersink filter context. + * @param frame pointer to an allocated frame that will be filled with data. + * The data must be freed using av_frame_unref() / av_frame_free() + * @param flags a combination of AV_BUFFERSINK_FLAG_* flags + * + * @return >= 0 in for success, a negative AVERROR code for failure. + */ +int av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flags); + +/** + * Tell av_buffersink_get_buffer_ref() to read video/samples buffer + * reference, but not remove it from the buffer. This is useful if you + * need only to read a video/samples buffer, without to fetch it. + */ +#define AV_BUFFERSINK_FLAG_PEEK 1 + +/** + * Tell av_buffersink_get_buffer_ref() not to request a frame from its input. + * If a frame is already buffered, it is read (and removed from the buffer), + * but if no frame is present, return AVERROR(EAGAIN). + */ +#define AV_BUFFERSINK_FLAG_NO_REQUEST 2 + +/** + * Struct to use for initializing a buffersink context. + */ +typedef struct { + const enum AVPixelFormat *pixel_fmts; ///< list of allowed pixel formats, terminated by AV_PIX_FMT_NONE +} AVBufferSinkParams; + +/** + * Create an AVBufferSinkParams structure. + * + * Must be freed with av_free(). + */ +AVBufferSinkParams *av_buffersink_params_alloc(void); + +/** + * Struct to use for initializing an abuffersink context. + */ +typedef struct { + const enum AVSampleFormat *sample_fmts; ///< list of allowed sample formats, terminated by AV_SAMPLE_FMT_NONE + const int64_t *channel_layouts; ///< list of allowed channel layouts, terminated by -1 + const int *channel_counts; ///< list of allowed channel counts, terminated by -1 + int all_channel_counts; ///< if not 0, accept any channel count or layout + int *sample_rates; ///< list of allowed sample rates, terminated by -1 +} AVABufferSinkParams; + +/** + * Create an AVABufferSinkParams structure. + * + * Must be freed with av_free(). + */ +AVABufferSinkParams *av_abuffersink_params_alloc(void); + +/** + * Set the frame size for an audio buffer sink. + * + * All calls to av_buffersink_get_buffer_ref will return a buffer with + * exactly the specified number of samples, or AVERROR(EAGAIN) if there is + * not enough. The last buffer at EOF will be padded with 0. + */ +void av_buffersink_set_frame_size(AVFilterContext *ctx, unsigned frame_size); + +/** + * Get the frame rate of the input. + */ +AVRational av_buffersink_get_frame_rate(AVFilterContext *ctx); + +/** + * Get a frame with filtered data from sink and put it in frame. + * + * @param ctx pointer to a context of a buffersink or abuffersink AVFilter. + * @param frame pointer to an allocated frame that will be filled with data. + * The data must be freed using av_frame_unref() / av_frame_free() + * + * @return + * - >= 0 if a frame was successfully returned. + * - AVERROR(EAGAIN) if no frames are available at this point; more + * input frames must be added to the filtergraph to get more output. + * - AVERROR_EOF if there will be no more output frames on this sink. + * - A different negative AVERROR code in other failure cases. + */ +int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame); + +/** + * Same as av_buffersink_get_frame(), but with the ability to specify the number + * of samples read. This function is less efficient than + * av_buffersink_get_frame(), because it copies the data around. + * + * @param ctx pointer to a context of the abuffersink AVFilter. + * @param frame pointer to an allocated frame that will be filled with data. + * The data must be freed using av_frame_unref() / av_frame_free() + * frame will contain exactly nb_samples audio samples, except at + * the end of stream, when it can contain less than nb_samples. + * + * @return The return codes have the same meaning as for + * av_buffersink_get_samples(). + * + * @warning do not mix this function with av_buffersink_get_frame(). Use only one or + * the other with a single sink, not both. + */ +int av_buffersink_get_samples(AVFilterContext *ctx, AVFrame *frame, int nb_samples); + +/** + * @} + */ + +#endif /* AVFILTER_BUFFERSINK_H */ diff --git a/Src/Decoder_H264_ALL/include/libavfilter/buffersrc.h b/Src/Decoder_H264_ALL/include/libavfilter/buffersrc.h new file mode 100644 index 0000000..31417c4 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavfilter/buffersrc.h @@ -0,0 +1,202 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_BUFFERSRC_H +#define AVFILTER_BUFFERSRC_H + +/** + * @file + * @ingroup lavfi_buffersrc + * Memory buffer source API. + */ + +#include "libavcodec/avcodec.h" +#include "avfilter.h" + +/** + * @defgroup lavfi_buffersrc Buffer source API + * @ingroup lavfi + * @{ + */ + +enum { + + /** + * Do not check for format changes. + */ + AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT = 1, + + /** + * Immediately push the frame to the output. + */ + AV_BUFFERSRC_FLAG_PUSH = 4, + + /** + * Keep a reference to the frame. + * If the frame if reference-counted, create a new reference; otherwise + * copy the frame data. + */ + AV_BUFFERSRC_FLAG_KEEP_REF = 8, + +}; + +/** + * Get the number of failed requests. + * + * A failed request is when the request_frame method is called while no + * frame is present in the buffer. + * The number is reset when a frame is added. + */ +unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src); + +/** + * This structure contains the parameters describing the frames that will be + * passed to this filter. + * + * It should be allocated with av_buffersrc_parameters_alloc() and freed with + * av_free(). All the allocated fields in it remain owned by the caller. + */ +typedef struct AVBufferSrcParameters { + /** + * video: the pixel format, value corresponds to enum AVPixelFormat + * audio: the sample format, value corresponds to enum AVSampleFormat + */ + int format; + /** + * The timebase to be used for the timestamps on the input frames. + */ + AVRational time_base; + + /** + * Video only, the display dimensions of the input frames. + */ + int width, height; + + /** + * Video only, the sample (pixel) aspect ratio. + */ + AVRational sample_aspect_ratio; + + /** + * Video only, the frame rate of the input video. This field must only be + * set to a non-zero value if input stream has a known constant framerate + * and should be left at its initial value if the framerate is variable or + * unknown. + */ + AVRational frame_rate; + + /** + * Video with a hwaccel pixel format only. This should be a reference to an + * AVHWFramesContext instance describing the input frames. + */ + AVBufferRef *hw_frames_ctx; + + /** + * Audio only, the audio sampling rate in samples per secon. + */ + int sample_rate; + + /** + * Audio only, the audio channel layout + */ + uint64_t channel_layout; +} AVBufferSrcParameters; + +/** + * Allocate a new AVBufferSrcParameters instance. It should be freed by the + * caller with av_free(). + */ +AVBufferSrcParameters *av_buffersrc_parameters_alloc(void); + +/** + * Initialize the buffersrc or abuffersrc filter with the provided parameters. + * This function may be called multiple times, the later calls override the + * previous ones. Some of the parameters may also be set through AVOptions, then + * whatever method is used last takes precedence. + * + * @param ctx an instance of the buffersrc or abuffersrc filter + * @param param the stream parameters. The frames later passed to this filter + * must conform to those parameters. All the allocated fields in + * param remain owned by the caller, libavfilter will make internal + * copies or references when necessary. + * @return 0 on success, a negative AVERROR code on failure. + */ +int av_buffersrc_parameters_set(AVFilterContext *ctx, AVBufferSrcParameters *param); + +/** + * Add a frame to the buffer source. + * + * @param ctx an instance of the buffersrc filter + * @param frame frame to be added. If the frame is reference counted, this + * function will make a new reference to it. Otherwise the frame data will be + * copied. + * + * @return 0 on success, a negative AVERROR on error + * + * This function is equivalent to av_buffersrc_add_frame_flags() with the + * AV_BUFFERSRC_FLAG_KEEP_REF flag. + */ +av_warn_unused_result +int av_buffersrc_write_frame(AVFilterContext *ctx, const AVFrame *frame); + +/** + * Add a frame to the buffer source. + * + * @param ctx an instance of the buffersrc filter + * @param frame frame to be added. If the frame is reference counted, this + * function will take ownership of the reference(s) and reset the frame. + * Otherwise the frame data will be copied. If this function returns an error, + * the input frame is not touched. + * + * @return 0 on success, a negative AVERROR on error. + * + * @note the difference between this function and av_buffersrc_write_frame() is + * that av_buffersrc_write_frame() creates a new reference to the input frame, + * while this function takes ownership of the reference passed to it. + * + * This function is equivalent to av_buffersrc_add_frame_flags() without the + * AV_BUFFERSRC_FLAG_KEEP_REF flag. + */ +av_warn_unused_result +int av_buffersrc_add_frame(AVFilterContext *ctx, AVFrame *frame); + +/** + * Add a frame to the buffer source. + * + * By default, if the frame is reference-counted, this function will take + * ownership of the reference(s) and reset the frame. This can be controlled + * using the flags. + * + * If this function returns an error, the input frame is not touched. + * + * @param buffer_src pointer to a buffer source context + * @param frame a frame, or NULL to mark EOF + * @param flags a combination of AV_BUFFERSRC_FLAG_* + * @return >= 0 in case of success, a negative AVERROR code + * in case of failure + */ +av_warn_unused_result +int av_buffersrc_add_frame_flags(AVFilterContext *buffer_src, + AVFrame *frame, int flags); + + +/** + * @} + */ + +#endif /* AVFILTER_BUFFERSRC_H */ diff --git a/Src/Decoder_H264_ALL/include/libavfilter/version.h b/Src/Decoder_H264_ALL/include/libavfilter/version.h new file mode 100644 index 0000000..6d56dad --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavfilter/version.h @@ -0,0 +1,71 @@ +/* + * Version macros. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_VERSION_H +#define AVFILTER_VERSION_H + +/** + * @file + * @ingroup lavfi + * Libavfilter version macros + */ + +#include "libavutil/version.h" + +#define LIBAVFILTER_VERSION_MAJOR 6 +#define LIBAVFILTER_VERSION_MINOR 47 +#define LIBAVFILTER_VERSION_MICRO 100 + +#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ + LIBAVFILTER_VERSION_MINOR, \ + LIBAVFILTER_VERSION_MICRO) +#define LIBAVFILTER_VERSION AV_VERSION(LIBAVFILTER_VERSION_MAJOR, \ + LIBAVFILTER_VERSION_MINOR, \ + LIBAVFILTER_VERSION_MICRO) +#define LIBAVFILTER_BUILD LIBAVFILTER_VERSION_INT + +#define LIBAVFILTER_IDENT "Lavfi" AV_STRINGIFY(LIBAVFILTER_VERSION) + +/** + * FF_API_* defines may be placed below to indicate public API that will be + * dropped at a future version bump. The defines themselves are not part of + * the public API and may change, break or disappear at any time. + */ + +#ifndef FF_API_OLD_FILTER_OPTS +#define FF_API_OLD_FILTER_OPTS (LIBAVFILTER_VERSION_MAJOR < 7) +#endif +#ifndef FF_API_OLD_FILTER_OPTS_ERROR +#define FF_API_OLD_FILTER_OPTS_ERROR (LIBAVFILTER_VERSION_MAJOR < 7) +#endif +#ifndef FF_API_AVFILTER_OPEN +#define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 7) +#endif +#ifndef FF_API_AVFILTER_INIT_FILTER +#define FF_API_AVFILTER_INIT_FILTER (LIBAVFILTER_VERSION_MAJOR < 7) +#endif +#ifndef FF_API_OLD_FILTER_REGISTER +#define FF_API_OLD_FILTER_REGISTER (LIBAVFILTER_VERSION_MAJOR < 7) +#endif +#ifndef FF_API_NOCONST_GET_NAME +#define FF_API_NOCONST_GET_NAME (LIBAVFILTER_VERSION_MAJOR < 7) +#endif + +#endif /* AVFILTER_VERSION_H */ diff --git a/Src/Decoder_H264_ALL/include/libavformat/avformat.h b/Src/Decoder_H264_ALL/include/libavformat/avformat.h new file mode 100644 index 0000000..818184e --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavformat/avformat.h @@ -0,0 +1,2886 @@ +/* + * copyright (c) 2001 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFORMAT_AVFORMAT_H +#define AVFORMAT_AVFORMAT_H + +/** + * @file + * @ingroup libavf + * Main libavformat public API header + */ + +/** + * @defgroup libavf I/O and Muxing/Demuxing Library + * @{ + * + * Libavformat (lavf) is a library for dealing with various media container + * formats. Its main two purposes are demuxing - i.e. splitting a media file + * into component streams, and the reverse process of muxing - writing supplied + * data in a specified container format. It also has an @ref lavf_io + * "I/O module" which supports a number of protocols for accessing the data (e.g. + * file, tcp, http and others). Before using lavf, you need to call + * av_register_all() to register all compiled muxers, demuxers and protocols. + * Unless you are absolutely sure you won't use libavformat's network + * capabilities, you should also call avformat_network_init(). + * + * A supported input format is described by an AVInputFormat struct, conversely + * an output format is described by AVOutputFormat. You can iterate over all + * registered input/output formats using the av_iformat_next() / + * av_oformat_next() functions. The protocols layer is not part of the public + * API, so you can only get the names of supported protocols with the + * avio_enum_protocols() function. + * + * Main lavf structure used for both muxing and demuxing is AVFormatContext, + * which exports all information about the file being read or written. As with + * most Libavformat structures, its size is not part of public ABI, so it cannot be + * allocated on stack or directly with av_malloc(). To create an + * AVFormatContext, use avformat_alloc_context() (some functions, like + * avformat_open_input() might do that for you). + * + * Most importantly an AVFormatContext contains: + * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat + * "output" format. It is either autodetected or set by user for input; + * always set by user for output. + * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all + * elementary streams stored in the file. AVStreams are typically referred to + * using their index in this array. + * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or + * set by user for input, always set by user for output (unless you are dealing + * with an AVFMT_NOFILE format). + * + * @section lavf_options Passing options to (de)muxers + * It is possible to configure lavf muxers and demuxers using the @ref avoptions + * mechanism. Generic (format-independent) libavformat options are provided by + * AVFormatContext, they can be examined from a user program by calling + * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass + * from avformat_get_class()). Private (format-specific) options are provided by + * AVFormatContext.priv_data if and only if AVInputFormat.priv_class / + * AVOutputFormat.priv_class of the corresponding format struct is non-NULL. + * Further options may be provided by the @ref AVFormatContext.pb "I/O context", + * if its AVClass is non-NULL, and the protocols layer. See the discussion on + * nesting in @ref avoptions documentation to learn how to access those. + * + * @section urls + * URL strings in libavformat are made of a scheme/protocol, a ':', and a + * scheme specific string. URLs without a scheme and ':' used for local files + * are supported but deprecated. "file:" should be used for local files. + * + * It is important that the scheme string is not taken from untrusted + * sources without checks. + * + * Note that some schemes/protocols are quite powerful, allowing access to + * both local and remote files, parts of them, concatenations of them, local + * audio and video devices and so on. + * + * @defgroup lavf_decoding Demuxing + * @{ + * Demuxers read a media file and split it into chunks of data (@em packets). A + * @ref AVPacket "packet" contains one or more encoded frames which belongs to a + * single elementary stream. In the lavf API this process is represented by the + * avformat_open_input() function for opening a file, av_read_frame() for + * reading a single packet and finally avformat_close_input(), which does the + * cleanup. + * + * @section lavf_decoding_open Opening a media file + * The minimum information required to open a file is its URL, which + * is passed to avformat_open_input(), as in the following code: + * @code + * const char *url = "file:in.mp3"; + * AVFormatContext *s = NULL; + * int ret = avformat_open_input(&s, url, NULL, NULL); + * if (ret < 0) + * abort(); + * @endcode + * The above code attempts to allocate an AVFormatContext, open the + * specified file (autodetecting the format) and read the header, exporting the + * information stored there into s. Some formats do not have a header or do not + * store enough information there, so it is recommended that you call the + * avformat_find_stream_info() function which tries to read and decode a few + * frames to find missing information. + * + * In some cases you might want to preallocate an AVFormatContext yourself with + * avformat_alloc_context() and do some tweaking on it before passing it to + * avformat_open_input(). One such case is when you want to use custom functions + * for reading input data instead of lavf internal I/O layer. + * To do that, create your own AVIOContext with avio_alloc_context(), passing + * your reading callbacks to it. Then set the @em pb field of your + * AVFormatContext to newly created AVIOContext. + * + * Since the format of the opened file is in general not known until after + * avformat_open_input() has returned, it is not possible to set demuxer private + * options on a preallocated context. Instead, the options should be passed to + * avformat_open_input() wrapped in an AVDictionary: + * @code + * AVDictionary *options = NULL; + * av_dict_set(&options, "video_size", "640x480", 0); + * av_dict_set(&options, "pixel_format", "rgb24", 0); + * + * if (avformat_open_input(&s, url, NULL, &options) < 0) + * abort(); + * av_dict_free(&options); + * @endcode + * This code passes the private options 'video_size' and 'pixel_format' to the + * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it + * cannot know how to interpret raw video data otherwise. If the format turns + * out to be something different than raw video, those options will not be + * recognized by the demuxer and therefore will not be applied. Such unrecognized + * options are then returned in the options dictionary (recognized options are + * consumed). The calling program can handle such unrecognized options as it + * wishes, e.g. + * @code + * AVDictionaryEntry *e; + * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) { + * fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key); + * abort(); + * } + * @endcode + * + * After you have finished reading the file, you must close it with + * avformat_close_input(). It will free everything associated with the file. + * + * @section lavf_decoding_read Reading from an opened file + * Reading data from an opened AVFormatContext is done by repeatedly calling + * av_read_frame() on it. Each call, if successful, will return an AVPacket + * containing encoded data for one AVStream, identified by + * AVPacket.stream_index. This packet may be passed straight into the libavcodec + * decoding functions avcodec_send_packet() or avcodec_decode_subtitle2() if the + * caller wishes to decode the data. + * + * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be + * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for + * pts/dts, 0 for duration) if the stream does not provide them. The timing + * information will be in AVStream.time_base units, i.e. it has to be + * multiplied by the timebase to convert them to seconds. + * + * If AVPacket.buf is set on the returned packet, then the packet is + * allocated dynamically and the user may keep it indefinitely. + * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a + * static storage somewhere inside the demuxer and the packet is only valid + * until the next av_read_frame() call or closing the file. If the caller + * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy + * of it. + * In both cases, the packet must be freed with av_packet_unref() when it is no + * longer needed. + * + * @section lavf_decoding_seek Seeking + * @} + * + * @defgroup lavf_encoding Muxing + * @{ + * Muxers take encoded data in the form of @ref AVPacket "AVPackets" and write + * it into files or other output bytestreams in the specified container format. + * + * The main API functions for muxing are avformat_write_header() for writing the + * file header, av_write_frame() / av_interleaved_write_frame() for writing the + * packets and av_write_trailer() for finalizing the file. + * + * At the beginning of the muxing process, the caller must first call + * avformat_alloc_context() to create a muxing context. The caller then sets up + * the muxer by filling the various fields in this context: + * + * - The @ref AVFormatContext.oformat "oformat" field must be set to select the + * muxer that will be used. + * - Unless the format is of the AVFMT_NOFILE type, the @ref AVFormatContext.pb + * "pb" field must be set to an opened IO context, either returned from + * avio_open2() or a custom one. + * - Unless the format is of the AVFMT_NOSTREAMS type, at least one stream must + * be created with the avformat_new_stream() function. The caller should fill + * the @ref AVStream.codecpar "stream codec parameters" information, such as the + * codec @ref AVCodecParameters.codec_type "type", @ref AVCodecParameters.codec_id + * "id" and other parameters (e.g. width / height, the pixel or sample format, + * etc.) as known. The @ref AVStream.time_base "stream timebase" should + * be set to the timebase that the caller desires to use for this stream (note + * that the timebase actually used by the muxer can be different, as will be + * described later). + * - It is advised to manually initialize only the relevant fields in + * AVCodecParameters, rather than using @ref avcodec_parameters_copy() during + * remuxing: there is no guarantee that the codec context values remain valid + * for both input and output format contexts. + * - The caller may fill in additional information, such as @ref + * AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream" + * metadata, @ref AVFormatContext.chapters "chapters", @ref + * AVFormatContext.programs "programs", etc. as described in the + * AVFormatContext documentation. Whether such information will actually be + * stored in the output depends on what the container format and the muxer + * support. + * + * When the muxing context is fully set up, the caller must call + * avformat_write_header() to initialize the muxer internals and write the file + * header. Whether anything actually is written to the IO context at this step + * depends on the muxer, but this function must always be called. Any muxer + * private options must be passed in the options parameter to this function. + * + * The data is then sent to the muxer by repeatedly calling av_write_frame() or + * av_interleaved_write_frame() (consult those functions' documentation for + * discussion on the difference between them; only one of them may be used with + * a single muxing context, they should not be mixed). Do note that the timing + * information on the packets sent to the muxer must be in the corresponding + * AVStream's timebase. That timebase is set by the muxer (in the + * avformat_write_header() step) and may be different from the timebase + * requested by the caller. + * + * Once all the data has been written, the caller must call av_write_trailer() + * to flush any buffered packets and finalize the output file, then close the IO + * context (if any) and finally free the muxing context with + * avformat_free_context(). + * @} + * + * @defgroup lavf_io I/O Read/Write + * @{ + * @section lavf_io_dirlist Directory listing + * The directory listing API makes it possible to list files on remote servers. + * + * Some of possible use cases: + * - an "open file" dialog to choose files from a remote location, + * - a recursive media finder providing a player with an ability to play all + * files from a given directory. + * + * @subsection lavf_io_dirlist_open Opening a directory + * At first, a directory needs to be opened by calling avio_open_dir() + * supplied with a URL and, optionally, ::AVDictionary containing + * protocol-specific parameters. The function returns zero or positive + * integer and allocates AVIODirContext on success. + * + * @code + * AVIODirContext *ctx = NULL; + * if (avio_open_dir(&ctx, "smb://example.com/some_dir", NULL) < 0) { + * fprintf(stderr, "Cannot open directory.\n"); + * abort(); + * } + * @endcode + * + * This code tries to open a sample directory using smb protocol without + * any additional parameters. + * + * @subsection lavf_io_dirlist_read Reading entries + * Each directory's entry (i.e. file, another directory, anything else + * within ::AVIODirEntryType) is represented by AVIODirEntry. + * Reading consecutive entries from an opened AVIODirContext is done by + * repeatedly calling avio_read_dir() on it. Each call returns zero or + * positive integer if successful. Reading can be stopped right after the + * NULL entry has been read -- it means there are no entries left to be + * read. The following code reads all entries from a directory associated + * with ctx and prints their names to standard output. + * @code + * AVIODirEntry *entry = NULL; + * for (;;) { + * if (avio_read_dir(ctx, &entry) < 0) { + * fprintf(stderr, "Cannot list directory.\n"); + * abort(); + * } + * if (!entry) + * break; + * printf("%s\n", entry->name); + * avio_free_directory_entry(&entry); + * } + * @endcode + * @} + * + * @defgroup lavf_codec Demuxers + * @{ + * @defgroup lavf_codec_native Native Demuxers + * @{ + * @} + * @defgroup lavf_codec_wrappers External library wrappers + * @{ + * @} + * @} + * @defgroup lavf_protos I/O Protocols + * @{ + * @} + * @defgroup lavf_internal Internal + * @{ + * @} + * @} + */ + +#include +#include /* FILE */ +#include "libavcodec/avcodec.h" +#include "libavutil/dict.h" +#include "libavutil/log.h" + +#include "avio.h" +#include "libavformat/version.h" + +struct AVFormatContext; + +struct AVDeviceInfoList; +struct AVDeviceCapabilitiesQuery; + +/** + * @defgroup metadata_api Public Metadata API + * @{ + * @ingroup libavf + * The metadata API allows libavformat to export metadata tags to a client + * application when demuxing. Conversely it allows a client application to + * set metadata when muxing. + * + * Metadata is exported or set as pairs of key/value strings in the 'metadata' + * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs + * using the @ref lavu_dict "AVDictionary" API. Like all strings in FFmpeg, + * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata + * exported by demuxers isn't checked to be valid UTF-8 in most cases. + * + * Important concepts to keep in mind: + * - Keys are unique; there can never be 2 tags with the same key. This is + * also meant semantically, i.e., a demuxer should not knowingly produce + * several keys that are literally different but semantically identical. + * E.g., key=Author5, key=Author6. In this example, all authors must be + * placed in the same tag. + * - Metadata is flat, not hierarchical; there are no subtags. If you + * want to store, e.g., the email address of the child of producer Alice + * and actor Bob, that could have key=alice_and_bobs_childs_email_address. + * - Several modifiers can be applied to the tag name. This is done by + * appending a dash character ('-') and the modifier name in the order + * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. + * - language -- a tag whose value is localized for a particular language + * is appended with the ISO 639-2/B 3-letter language code. + * For example: Author-ger=Michael, Author-eng=Mike + * The original/default language is in the unqualified "Author" tag. + * A demuxer should set a default if it sets any translated tag. + * - sorting -- a modified version of a tag that should be used for + * sorting will have '-sort' appended. E.g. artist="The Beatles", + * artist-sort="Beatles, The". + * - Some protocols and demuxers support metadata updates. After a successful + * call to av_read_packet(), AVFormatContext.event_flags or AVStream.event_flags + * will be updated to indicate if metadata changed. In order to detect metadata + * changes on a stream, you need to loop through all streams in the AVFormatContext + * and check their individual event_flags. + * + * - Demuxers attempt to export metadata in a generic format, however tags + * with no generic equivalents are left as they are stored in the container. + * Follows a list of generic tag names: + * + @verbatim + album -- name of the set this work belongs to + album_artist -- main creator of the set/album, if different from artist. + e.g. "Various Artists" for compilation albums. + artist -- main creator of the work + comment -- any additional description of the file. + composer -- who composed the work, if different from artist. + copyright -- name of copyright holder. + creation_time-- date when the file was created, preferably in ISO 8601. + date -- date when the work was created, preferably in ISO 8601. + disc -- number of a subset, e.g. disc in a multi-disc collection. + encoder -- name/settings of the software/hardware that produced the file. + encoded_by -- person/group who created the file. + filename -- original name of the file. + genre -- . + language -- main language in which the work is performed, preferably + in ISO 639-2 format. Multiple languages can be specified by + separating them with commas. + performer -- artist who performed the work, if different from artist. + E.g for "Also sprach Zarathustra", artist would be "Richard + Strauss" and performer "London Philharmonic Orchestra". + publisher -- name of the label/publisher. + service_name -- name of the service in broadcasting (channel name). + service_provider -- name of the service provider in broadcasting. + title -- name of the work. + track -- number of this work in the set, can be in form current/total. + variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of + @endverbatim + * + * Look in the examples section for an application example how to use the Metadata API. + * + * @} + */ + +/* packet functions */ + + +/** + * Allocate and read the payload of a packet and initialize its + * fields with default values. + * + * @param s associated IO context + * @param pkt packet + * @param size desired payload size + * @return >0 (read size) if OK, AVERROR_xxx otherwise + */ +int av_get_packet(AVIOContext *s, AVPacket *pkt, int size); + + +/** + * Read data and append it to the current content of the AVPacket. + * If pkt->size is 0 this is identical to av_get_packet. + * Note that this uses av_grow_packet and thus involves a realloc + * which is inefficient. Thus this function should only be used + * when there is no reasonable way to know (an upper bound of) + * the final size. + * + * @param s associated IO context + * @param pkt packet + * @param size amount of data to read + * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data + * will not be lost even if an error occurs. + */ +int av_append_packet(AVIOContext *s, AVPacket *pkt, int size); + +#if FF_API_LAVF_FRAC +/*************************************************/ +/* fractional numbers for exact pts handling */ + +/** + * The exact value of the fractional number is: 'val + num / den'. + * num is assumed to be 0 <= num < den. + */ +typedef struct AVFrac { + int64_t val, num, den; +} AVFrac; +#endif + +/*************************************************/ +/* input/output formats */ + +struct AVCodecTag; + +/** + * This structure contains the data a format has to probe a file. + */ +typedef struct AVProbeData { + const char *filename; + unsigned char *buf; /**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. */ + int buf_size; /**< Size of buf except extra allocated bytes */ + const char *mime_type; /**< mime_type, when known. */ +} AVProbeData; + +#define AVPROBE_SCORE_RETRY (AVPROBE_SCORE_MAX/4) +#define AVPROBE_SCORE_STREAM_RETRY (AVPROBE_SCORE_MAX/4-1) + +#define AVPROBE_SCORE_EXTENSION 50 ///< score for file extension +#define AVPROBE_SCORE_MIME 75 ///< score for file mime type +#define AVPROBE_SCORE_MAX 100 ///< maximum score + +#define AVPROBE_PADDING_SIZE 32 ///< extra allocated bytes at the end of the probe buffer + +/// Demuxer will use avio_open, no opened file should be provided by the caller. +#define AVFMT_NOFILE 0x0001 +#define AVFMT_NEEDNUMBER 0x0002 /**< Needs '%d' in filename. */ +#define AVFMT_SHOW_IDS 0x0008 /**< Show format stream IDs numbers. */ +#if FF_API_LAVF_FMT_RAWPICTURE +#define AVFMT_RAWPICTURE 0x0020 /**< Format wants AVPicture structure for + raw picture data. @deprecated Not used anymore */ +#endif +#define AVFMT_GLOBALHEADER 0x0040 /**< Format wants global header. */ +#define AVFMT_NOTIMESTAMPS 0x0080 /**< Format does not need / have any timestamps. */ +#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */ +#define AVFMT_TS_DISCONT 0x0200 /**< Format allows timestamp discontinuities. Note, muxers always require valid (monotone) timestamps */ +#define AVFMT_VARIABLE_FPS 0x0400 /**< Format allows variable fps. */ +#define AVFMT_NODIMENSIONS 0x0800 /**< Format does not need width/height */ +#define AVFMT_NOSTREAMS 0x1000 /**< Format does not require any streams */ +#define AVFMT_NOBINSEARCH 0x2000 /**< Format does not allow to fall back on binary search via read_timestamp */ +#define AVFMT_NOGENSEARCH 0x4000 /**< Format does not allow to fall back on generic search */ +#define AVFMT_NO_BYTE_SEEK 0x8000 /**< Format does not allow seeking by bytes */ +#define AVFMT_ALLOW_FLUSH 0x10000 /**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. */ +#define AVFMT_TS_NONSTRICT 0x20000 /**< Format does not require strictly + increasing timestamps, but they must + still be monotonic */ +#define AVFMT_TS_NEGATIVE 0x40000 /**< Format allows muxing negative + timestamps. If not set the timestamp + will be shifted in av_write_frame and + av_interleaved_write_frame so they + start from 0. + The user or muxer can override this through + AVFormatContext.avoid_negative_ts + */ + +#define AVFMT_SEEK_TO_PTS 0x4000000 /**< Seeking is based on PTS */ + +/** + * @addtogroup lavf_encoding + * @{ + */ +typedef struct AVOutputFormat { + const char *name; + /** + * Descriptive name for the format, meant to be more human-readable + * than name. You should use the NULL_IF_CONFIG_SMALL() macro + * to define it. + */ + const char *long_name; + const char *mime_type; + const char *extensions; /**< comma-separated filename extensions */ + /* output support */ + enum AVCodecID audio_codec; /**< default audio codec */ + enum AVCodecID video_codec; /**< default video codec */ + enum AVCodecID subtitle_codec; /**< default subtitle codec */ + /** + * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, + * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, + * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, + * AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVE + */ + int flags; + + /** + * List of supported codec_id-codec_tag pairs, ordered by "better + * choice first". The arrays are all terminated by AV_CODEC_ID_NONE. + */ + const struct AVCodecTag * const *codec_tag; + + + const AVClass *priv_class; ///< AVClass for the private context + + /***************************************************************** + * No fields below this line are part of the public API. They + * may not be used outside of libavformat and can be changed and + * removed at will. + * New public fields should be added right above. + ***************************************************************** + */ + struct AVOutputFormat *next; + /** + * size of private data so that it can be allocated in the wrapper + */ + int priv_data_size; + + int (*write_header)(struct AVFormatContext *); + /** + * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, + * pkt can be NULL in order to flush data buffered in the muxer. + * When flushing, return 0 if there still is more data to flush, + * or 1 if everything was flushed and there is no more buffered + * data. + */ + int (*write_packet)(struct AVFormatContext *, AVPacket *pkt); + int (*write_trailer)(struct AVFormatContext *); + /** + * Currently only used to set pixel format if not YUV420P. + */ + int (*interleave_packet)(struct AVFormatContext *, AVPacket *out, + AVPacket *in, int flush); + /** + * Test if the given codec can be stored in this container. + * + * @return 1 if the codec is supported, 0 if it is not. + * A negative number if unknown. + * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC + */ + int (*query_codec)(enum AVCodecID id, int std_compliance); + + void (*get_output_timestamp)(struct AVFormatContext *s, int stream, + int64_t *dts, int64_t *wall); + /** + * Allows sending messages from application to device. + */ + int (*control_message)(struct AVFormatContext *s, int type, + void *data, size_t data_size); + + /** + * Write an uncoded AVFrame. + * + * See av_write_uncoded_frame() for details. + * + * The library will free *frame afterwards, but the muxer can prevent it + * by setting the pointer to NULL. + */ + int (*write_uncoded_frame)(struct AVFormatContext *, int stream_index, + AVFrame **frame, unsigned flags); + /** + * Returns device list with it properties. + * @see avdevice_list_devices() for more details. + */ + int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list); + /** + * Initialize device capabilities submodule. + * @see avdevice_capabilities_create() for more details. + */ + int (*create_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps); + /** + * Free device capabilities submodule. + * @see avdevice_capabilities_free() for more details. + */ + int (*free_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps); + enum AVCodecID data_codec; /**< default data codec */ + /** + * Initialize format. May allocate data here, and set any AVFormatContext or + * AVStream parameters that need to be set before packets are sent. + * This method must not write output. + * + * Any allocations made here must be freed in deinit(). + */ + int (*init)(struct AVFormatContext *); + /** + * Deinitialize format. If present, this is called whenever the muxer is being + * destroyed, regardless of whether or not the header has been written. + * + * If a trailer is being written, this is called after write_trailer(). + * + * This is called if init() fails as well. + */ + void (*deinit)(struct AVFormatContext *); + /** + * Set up any necessary bitstream filtering and extract any extra data needed + * for the global header. + * Return 0 if more packets from this stream must be checked; 1 if not. + */ + int (*check_bitstream)(struct AVFormatContext *, const AVPacket *pkt); +} AVOutputFormat; +/** + * @} + */ + +/** + * @addtogroup lavf_decoding + * @{ + */ +typedef struct AVInputFormat { + /** + * A comma separated list of short names for the format. New names + * may be appended with a minor bump. + */ + const char *name; + + /** + * Descriptive name for the format, meant to be more human-readable + * than name. You should use the NULL_IF_CONFIG_SMALL() macro + * to define it. + */ + const char *long_name; + + /** + * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, + * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, + * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. + */ + int flags; + + /** + * If extensions are defined, then no probe is done. You should + * usually not use extension format guessing because it is not + * reliable enough + */ + const char *extensions; + + const struct AVCodecTag * const *codec_tag; + + const AVClass *priv_class; ///< AVClass for the private context + + /** + * Comma-separated list of mime types. + * It is used check for matching mime types while probing. + * @see av_probe_input_format2 + */ + const char *mime_type; + + /***************************************************************** + * No fields below this line are part of the public API. They + * may not be used outside of libavformat and can be changed and + * removed at will. + * New public fields should be added right above. + ***************************************************************** + */ + struct AVInputFormat *next; + + /** + * Raw demuxers store their codec ID here. + */ + int raw_codec_id; + + /** + * Size of private data so that it can be allocated in the wrapper. + */ + int priv_data_size; + + /** + * Tell if a given file has a chance of being parsed as this format. + * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes + * big so you do not have to check for that unless you need more. + */ + int (*read_probe)(AVProbeData *); + + /** + * Read the format header and initialize the AVFormatContext + * structure. Return 0 if OK. 'avformat_new_stream' should be + * called to create new streams. + */ + int (*read_header)(struct AVFormatContext *); + + /** + * Read one packet and put it in 'pkt'. pts and flags are also + * set. 'avformat_new_stream' can be called only if the flag + * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a + * background thread). + * @return 0 on success, < 0 on error. + * When returning an error, pkt must not have been allocated + * or must be freed before returning + */ + int (*read_packet)(struct AVFormatContext *, AVPacket *pkt); + + /** + * Close the stream. The AVFormatContext and AVStreams are not + * freed by this function + */ + int (*read_close)(struct AVFormatContext *); + + /** + * Seek to a given timestamp relative to the frames in + * stream component stream_index. + * @param stream_index Must not be -1. + * @param flags Selects which direction should be preferred if no exact + * match is available. + * @return >= 0 on success (but not necessarily the new offset) + */ + int (*read_seek)(struct AVFormatContext *, + int stream_index, int64_t timestamp, int flags); + + /** + * Get the next timestamp in stream[stream_index].time_base units. + * @return the timestamp or AV_NOPTS_VALUE if an error occurred + */ + int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index, + int64_t *pos, int64_t pos_limit); + + /** + * Start/resume playing - only meaningful if using a network-based format + * (RTSP). + */ + int (*read_play)(struct AVFormatContext *); + + /** + * Pause playing - only meaningful if using a network-based format + * (RTSP). + */ + int (*read_pause)(struct AVFormatContext *); + + /** + * Seek to timestamp ts. + * Seeking will be done so that the point from which all active streams + * can be presented successfully will be closest to ts and within min/max_ts. + * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. + */ + int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags); + + /** + * Returns device list with it properties. + * @see avdevice_list_devices() for more details. + */ + int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list); + + /** + * Initialize device capabilities submodule. + * @see avdevice_capabilities_create() for more details. + */ + int (*create_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps); + + /** + * Free device capabilities submodule. + * @see avdevice_capabilities_free() for more details. + */ + int (*free_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps); +} AVInputFormat; +/** + * @} + */ + +enum AVStreamParseType { + AVSTREAM_PARSE_NONE, + AVSTREAM_PARSE_FULL, /**< full parsing and repack */ + AVSTREAM_PARSE_HEADERS, /**< Only parse headers, do not repack. */ + AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on a packet boundary */ + AVSTREAM_PARSE_FULL_ONCE, /**< full parsing and repack of the first frame only, only implemented for H.264 currently */ + AVSTREAM_PARSE_FULL_RAW=MKTAG(0,'R','A','W'), /**< full parsing and repack with timestamp and position generation by parser for raw + this assumes that each packet in the file contains no demuxer level headers and + just codec level data, otherwise position generation would fail */ +}; + +typedef struct AVIndexEntry { + int64_t pos; + int64_t timestamp; /**< + * Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available + * when seeking to this entry. That means preferable PTS on keyframe based formats. + * But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better + * is known + */ +#define AVINDEX_KEYFRAME 0x0001 + int flags:2; + int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). + int min_distance; /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */ +} AVIndexEntry; + +#define AV_DISPOSITION_DEFAULT 0x0001 +#define AV_DISPOSITION_DUB 0x0002 +#define AV_DISPOSITION_ORIGINAL 0x0004 +#define AV_DISPOSITION_COMMENT 0x0008 +#define AV_DISPOSITION_LYRICS 0x0010 +#define AV_DISPOSITION_KARAOKE 0x0020 + +/** + * Track should be used during playback by default. + * Useful for subtitle track that should be displayed + * even when user did not explicitly ask for subtitles. + */ +#define AV_DISPOSITION_FORCED 0x0040 +#define AV_DISPOSITION_HEARING_IMPAIRED 0x0080 /**< stream for hearing impaired audiences */ +#define AV_DISPOSITION_VISUAL_IMPAIRED 0x0100 /**< stream for visual impaired audiences */ +#define AV_DISPOSITION_CLEAN_EFFECTS 0x0200 /**< stream without voice */ +/** + * The stream is stored in the file as an attached picture/"cover art" (e.g. + * APIC frame in ID3v2). The single packet associated with it will be returned + * among the first few packets read from the file unless seeking takes place. + * It can also be accessed at any time in AVStream.attached_pic. + */ +#define AV_DISPOSITION_ATTACHED_PIC 0x0400 + +typedef struct AVStreamInternal AVStreamInternal; + +/** + * To specify text track kind (different from subtitles default). + */ +#define AV_DISPOSITION_CAPTIONS 0x10000 +#define AV_DISPOSITION_DESCRIPTIONS 0x20000 +#define AV_DISPOSITION_METADATA 0x40000 + +/** + * Options for behavior on timestamp wrap detection. + */ +#define AV_PTS_WRAP_IGNORE 0 ///< ignore the wrap +#define AV_PTS_WRAP_ADD_OFFSET 1 ///< add the format specific offset on wrap detection +#define AV_PTS_WRAP_SUB_OFFSET -1 ///< subtract the format specific offset on wrap detection + +/** + * Stream structure. + * New fields can be added to the end with minor version bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. + * sizeof(AVStream) must not be used outside libav*. + */ +typedef struct AVStream { + int index; /**< stream index in AVFormatContext */ + /** + * Format-specific stream ID. + * decoding: set by libavformat + * encoding: set by the user, replaced by libavformat if left unset + */ + int id; +#if FF_API_LAVF_AVCTX + /** + * @deprecated use the codecpar struct instead + */ + attribute_deprecated + AVCodecContext *codec; +#endif + void *priv_data; + +#if FF_API_LAVF_FRAC + /** + * @deprecated this field is unused + */ + attribute_deprecated + struct AVFrac pts; +#endif + + /** + * This is the fundamental unit of time (in seconds) in terms + * of which frame timestamps are represented. + * + * decoding: set by libavformat + * encoding: May be set by the caller before avformat_write_header() to + * provide a hint to the muxer about the desired timebase. In + * avformat_write_header(), the muxer will overwrite this field + * with the timebase that will actually be used for the timestamps + * written into the file (which may or may not be related to the + * user-provided one, depending on the format). + */ + AVRational time_base; + + /** + * Decoding: pts of the first frame of the stream in presentation order, in stream time base. + * Only set this if you are absolutely 100% sure that the value you set + * it to really is the pts of the first frame. + * This may be undefined (AV_NOPTS_VALUE). + * @note The ASF header does NOT contain a correct start_time the ASF + * demuxer must NOT set this. + */ + int64_t start_time; + + /** + * Decoding: duration of the stream, in stream time base. + * If a source file does not specify a duration, but does specify + * a bitrate, this value will be estimated from bitrate and file size. + */ + int64_t duration; + + int64_t nb_frames; ///< number of frames in this stream if known or 0 + + int disposition; /**< AV_DISPOSITION_* bit field */ + + enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed. + + /** + * sample aspect ratio (0 if unknown) + * - encoding: Set by user. + * - decoding: Set by libavformat. + */ + AVRational sample_aspect_ratio; + + AVDictionary *metadata; + + /** + * Average framerate + * + * - demuxing: May be set by libavformat when creating the stream or in + * avformat_find_stream_info(). + * - muxing: May be set by the caller before avformat_write_header(). + */ + AVRational avg_frame_rate; + + /** + * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet + * will contain the attached picture. + * + * decoding: set by libavformat, must not be modified by the caller. + * encoding: unused + */ + AVPacket attached_pic; + + /** + * An array of side data that applies to the whole stream (i.e. the + * container does not allow it to change between packets). + * + * There may be no overlap between the side data in this array and side data + * in the packets. I.e. a given side data is either exported by the muxer + * (demuxing) / set by the caller (muxing) in this array, then it never + * appears in the packets, or the side data is exported / sent through + * the packets (always in the first packet where the value becomes known or + * changes), then it does not appear in this array. + * + * - demuxing: Set by libavformat when the stream is created. + * - muxing: May be set by the caller before avformat_write_header(). + * + * Freed by libavformat in avformat_free_context(). + * + * @see av_format_inject_global_side_data() + */ + AVPacketSideData *side_data; + /** + * The number of elements in the AVStream.side_data array. + */ + int nb_side_data; + + /** + * Flags for the user to detect events happening on the stream. Flags must + * be cleared by the user once the event has been handled. + * A combination of AVSTREAM_EVENT_FLAG_*. + */ + int event_flags; +#define AVSTREAM_EVENT_FLAG_METADATA_UPDATED 0x0001 ///< The call resulted in updated metadata. + + /***************************************************************** + * All fields below this line are not part of the public API. They + * may not be used outside of libavformat and can be changed and + * removed at will. + * New public fields should be added right above. + ***************************************************************** + */ + + /** + * Stream information used internally by av_find_stream_info() + */ +#define MAX_STD_TIMEBASES (30*12+30+3+6) + struct { + int64_t last_dts; + int64_t duration_gcd; + int duration_count; + int64_t rfps_duration_sum; + double (*duration_error)[2][MAX_STD_TIMEBASES]; + int64_t codec_info_duration; + int64_t codec_info_duration_fields; + + /** + * 0 -> decoder has not been searched for yet. + * >0 -> decoder found + * <0 -> decoder with codec_id == -found_decoder has not been found + */ + int found_decoder; + + int64_t last_duration; + + /** + * Those are used for average framerate estimation. + */ + int64_t fps_first_dts; + int fps_first_dts_idx; + int64_t fps_last_dts; + int fps_last_dts_idx; + + } *info; + + int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */ + + // Timestamp generation support: + /** + * Timestamp corresponding to the last dts sync point. + * + * Initialized when AVCodecParserContext.dts_sync_point >= 0 and + * a DTS is received from the underlying container. Otherwise set to + * AV_NOPTS_VALUE by default. + */ + int64_t first_dts; + int64_t cur_dts; + int64_t last_IP_pts; + int last_IP_duration; + + /** + * Number of packets to buffer for codec probing + */ + int probe_packets; + + /** + * Number of frames that have been demuxed during av_find_stream_info() + */ + int codec_info_nb_frames; + + /* av_read_frame() support */ + enum AVStreamParseType need_parsing; + struct AVCodecParserContext *parser; + + /** + * last packet in packet_buffer for this stream when muxing. + */ + struct AVPacketList *last_in_packet_buffer; + AVProbeData probe_data; +#define MAX_REORDER_DELAY 16 + int64_t pts_buffer[MAX_REORDER_DELAY+1]; + + AVIndexEntry *index_entries; /**< Only used if the format does not + support seeking natively. */ + int nb_index_entries; + unsigned int index_entries_allocated_size; + + /** + * Real base framerate of the stream. + * This is the lowest framerate with which all timestamps can be + * represented accurately (it is the least common multiple of all + * framerates in the stream). Note, this value is just a guess! + * For example, if the time base is 1/90000 and all frames have either + * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. + * + * Code outside avformat should access this field using: + * av_stream_get/set_r_frame_rate(stream) + */ + AVRational r_frame_rate; + + /** + * Stream Identifier + * This is the MPEG-TS stream identifier +1 + * 0 means unknown + */ + int stream_identifier; + + int64_t interleaver_chunk_size; + int64_t interleaver_chunk_duration; + + /** + * stream probing state + * -1 -> probing finished + * 0 -> no probing requested + * rest -> perform probing with request_probe being the minimum score to accept. + * NOT PART OF PUBLIC API + */ + int request_probe; + /** + * Indicates that everything up to the next keyframe + * should be discarded. + */ + int skip_to_keyframe; + + /** + * Number of samples to skip at the start of the frame decoded from the next packet. + */ + int skip_samples; + + /** + * If not 0, the number of samples that should be skipped from the start of + * the stream (the samples are removed from packets with pts==0, which also + * assumes negative timestamps do not happen). + * Intended for use with formats such as mp3 with ad-hoc gapless audio + * support. + */ + int64_t start_skip_samples; + + /** + * If not 0, the first audio sample that should be discarded from the stream. + * This is broken by design (needs global sample count), but can't be + * avoided for broken by design formats such as mp3 with ad-hoc gapless + * audio support. + */ + int64_t first_discard_sample; + + /** + * The sample after last sample that is intended to be discarded after + * first_discard_sample. Works on frame boundaries only. Used to prevent + * early EOF if the gapless info is broken (considered concatenated mp3s). + */ + int64_t last_discard_sample; + + /** + * Number of internally decoded frames, used internally in libavformat, do not access + * its lifetime differs from info which is why it is not in that structure. + */ + int nb_decoded_frames; + + /** + * Timestamp offset added to timestamps before muxing + * NOT PART OF PUBLIC API + */ + int64_t mux_ts_offset; + + /** + * Internal data to check for wrapping of the time stamp + */ + int64_t pts_wrap_reference; + + /** + * Options for behavior, when a wrap is detected. + * + * Defined by AV_PTS_WRAP_ values. + * + * If correction is enabled, there are two possibilities: + * If the first time stamp is near the wrap point, the wrap offset + * will be subtracted, which will create negative time stamps. + * Otherwise the offset will be added. + */ + int pts_wrap_behavior; + + /** + * Internal data to prevent doing update_initial_durations() twice + */ + int update_initial_durations_done; + + /** + * Internal data to generate dts from pts + */ + int64_t pts_reorder_error[MAX_REORDER_DELAY+1]; + uint8_t pts_reorder_error_count[MAX_REORDER_DELAY+1]; + + /** + * Internal data to analyze DTS and detect faulty mpeg streams + */ + int64_t last_dts_for_order_check; + uint8_t dts_ordered; + uint8_t dts_misordered; + + /** + * Internal data to inject global side data + */ + int inject_global_side_data; + + /** + * String containing paris of key and values describing recommended encoder configuration. + * Paris are separated by ','. + * Keys are separated from values by '='. + */ + char *recommended_encoder_configuration; + + /** + * display aspect ratio (0 if unknown) + * - encoding: unused + * - decoding: Set by libavformat to calculate sample_aspect_ratio internally + */ + AVRational display_aspect_ratio; + + struct FFFrac *priv_pts; + + /** + * An opaque field for libavformat internal usage. + * Must not be accessed in any way by callers. + */ + AVStreamInternal *internal; + + /* + * Codec parameters associated with this stream. Allocated and freed by + * libavformat in avformat_new_stream() and avformat_free_context() + * respectively. + * + * - demuxing: filled by libavformat on stream creation or in + * avformat_find_stream_info() + * - muxing: filled by the caller before avformat_write_header() + */ + AVCodecParameters *codecpar; +} AVStream; + +AVRational av_stream_get_r_frame_rate(const AVStream *s); +void av_stream_set_r_frame_rate(AVStream *s, AVRational r); +struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); +char* av_stream_get_recommended_encoder_configuration(const AVStream *s); +void av_stream_set_recommended_encoder_configuration(AVStream *s, char *configuration); + +/** + * Returns the pts of the last muxed packet + its duration + * + * the retuned value is undefined when used with a demuxer. + */ +int64_t av_stream_get_end_pts(const AVStream *st); + +#define AV_PROGRAM_RUNNING 1 + +/** + * New fields can be added to the end with minor version bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. + * sizeof(AVProgram) must not be used outside libav*. + */ +typedef struct AVProgram { + int id; + int flags; + enum AVDiscard discard; ///< selects which program to discard and which to feed to the caller + unsigned int *stream_index; + unsigned int nb_stream_indexes; + AVDictionary *metadata; + + int program_num; + int pmt_pid; + int pcr_pid; + + /***************************************************************** + * All fields below this line are not part of the public API. They + * may not be used outside of libavformat and can be changed and + * removed at will. + * New public fields should be added right above. + ***************************************************************** + */ + int64_t start_time; + int64_t end_time; + + int64_t pts_wrap_reference; ///< reference dts for wrap detection + int pts_wrap_behavior; ///< behavior on wrap detection +} AVProgram; + +#define AVFMTCTX_NOHEADER 0x0001 /**< signal that no header is present + (streams are added dynamically) */ + +typedef struct AVChapter { + int id; ///< unique ID to identify the chapter + AVRational time_base; ///< time base in which the start/end timestamps are specified + int64_t start, end; ///< chapter start/end time in time_base units + AVDictionary *metadata; +} AVChapter; + + +/** + * Callback used by devices to communicate with application. + */ +typedef int (*av_format_control_message)(struct AVFormatContext *s, int type, + void *data, size_t data_size); + +typedef int (*AVOpenCallback)(struct AVFormatContext *s, AVIOContext **pb, const char *url, int flags, + const AVIOInterruptCB *int_cb, AVDictionary **options); + +/** + * The duration of a video can be estimated through various ways, and this enum can be used + * to know how the duration was estimated. + */ +enum AVDurationEstimationMethod { + AVFMT_DURATION_FROM_PTS, ///< Duration accurately estimated from PTSes + AVFMT_DURATION_FROM_STREAM, ///< Duration estimated from a stream with a known duration + AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate) +}; + +typedef struct AVFormatInternal AVFormatInternal; + +/** + * Format I/O context. + * New fields can be added to the end with minor version bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. + * sizeof(AVFormatContext) must not be used outside libav*, use + * avformat_alloc_context() to create an AVFormatContext. + * + * Fields can be accessed through AVOptions (av_opt*), + * the name string used matches the associated command line parameter name and + * can be found in libavformat/options_table.h. + * The AVOption/command line parameter names differ in some cases from the C + * structure field names for historic reasons or brevity. + */ +typedef struct AVFormatContext { + /** + * A class for logging and @ref avoptions. Set by avformat_alloc_context(). + * Exports (de)muxer private options if they exist. + */ + const AVClass *av_class; + + /** + * The input container format. + * + * Demuxing only, set by avformat_open_input(). + */ + struct AVInputFormat *iformat; + + /** + * The output container format. + * + * Muxing only, must be set by the caller before avformat_write_header(). + */ + struct AVOutputFormat *oformat; + + /** + * Format private data. This is an AVOptions-enabled struct + * if and only if iformat/oformat.priv_class is not NULL. + * + * - muxing: set by avformat_write_header() + * - demuxing: set by avformat_open_input() + */ + void *priv_data; + + /** + * I/O context. + * + * - demuxing: either set by the user before avformat_open_input() (then + * the user must close it manually) or set by avformat_open_input(). + * - muxing: set by the user before avformat_write_header(). The caller must + * take care of closing / freeing the IO context. + * + * Do NOT set this field if AVFMT_NOFILE flag is set in + * iformat/oformat.flags. In such a case, the (de)muxer will handle + * I/O in some other way and this field will be NULL. + */ + AVIOContext *pb; + + /* stream info */ + /** + * Flags signalling stream properties. A combination of AVFMTCTX_*. + * Set by libavformat. + */ + int ctx_flags; + + /** + * Number of elements in AVFormatContext.streams. + * + * Set by avformat_new_stream(), must not be modified by any other code. + */ + unsigned int nb_streams; + /** + * A list of all streams in the file. New streams are created with + * avformat_new_stream(). + * + * - demuxing: streams are created by libavformat in avformat_open_input(). + * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also + * appear in av_read_frame(). + * - muxing: streams are created by the user before avformat_write_header(). + * + * Freed by libavformat in avformat_free_context(). + */ + AVStream **streams; + + /** + * input or output filename + * + * - demuxing: set by avformat_open_input() + * - muxing: may be set by the caller before avformat_write_header() + */ + char filename[1024]; + + /** + * Position of the first frame of the component, in + * AV_TIME_BASE fractional seconds. NEVER set this value directly: + * It is deduced from the AVStream values. + * + * Demuxing only, set by libavformat. + */ + int64_t start_time; + + /** + * Duration of the stream, in AV_TIME_BASE fractional + * seconds. Only set this value if you know none of the individual stream + * durations and also do not set any of them. This is deduced from the + * AVStream values if not set. + * + * Demuxing only, set by libavformat. + */ + int64_t duration; + + /** + * Total stream bitrate in bit/s, 0 if not + * available. Never set it directly if the file_size and the + * duration are known as FFmpeg can compute it automatically. + */ + int64_t bit_rate; + + unsigned int packet_size; + int max_delay; + + /** + * Flags modifying the (de)muxer behaviour. A combination of AVFMT_FLAG_*. + * Set by the user before avformat_open_input() / avformat_write_header(). + */ + int flags; +#define AVFMT_FLAG_GENPTS 0x0001 ///< Generate missing pts even if it requires parsing future frames. +#define AVFMT_FLAG_IGNIDX 0x0002 ///< Ignore index. +#define AVFMT_FLAG_NONBLOCK 0x0004 ///< Do not block when reading packets from input. +#define AVFMT_FLAG_IGNDTS 0x0008 ///< Ignore DTS on frames that contain both DTS & PTS +#define AVFMT_FLAG_NOFILLIN 0x0010 ///< Do not infer any values from other values, just return what is stored in the container +#define AVFMT_FLAG_NOPARSE 0x0020 ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled +#define AVFMT_FLAG_NOBUFFER 0x0040 ///< Do not buffer frames when possible +#define AVFMT_FLAG_CUSTOM_IO 0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it. +#define AVFMT_FLAG_DISCARD_CORRUPT 0x0100 ///< Discard frames marked corrupted +#define AVFMT_FLAG_FLUSH_PACKETS 0x0200 ///< Flush the AVIOContext every packet. +/** + * When muxing, try to avoid writing any random/volatile data to the output. + * This includes any random IDs, real-time timestamps/dates, muxer version, etc. + * + * This flag is mainly intended for testing. + */ +#define AVFMT_FLAG_BITEXACT 0x0400 +#define AVFMT_FLAG_MP4A_LATM 0x8000 ///< Enable RTP MP4A-LATM payload +#define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) +#define AVFMT_FLAG_PRIV_OPT 0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) +#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Don't merge side data but keep it separate. +#define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats + + /** + * Maximum size of the data read from input for determining + * the input container format. + * Demuxing only, set by the caller before avformat_open_input(). + */ + int64_t probesize; + + /** + * Maximum duration (in AV_TIME_BASE units) of the data read + * from input in avformat_find_stream_info(). + * Demuxing only, set by the caller before avformat_find_stream_info(). + * Can be set to 0 to let avformat choose using a heuristic. + */ + int64_t max_analyze_duration; + + const uint8_t *key; + int keylen; + + unsigned int nb_programs; + AVProgram **programs; + + /** + * Forced video codec_id. + * Demuxing: Set by user. + */ + enum AVCodecID video_codec_id; + + /** + * Forced audio codec_id. + * Demuxing: Set by user. + */ + enum AVCodecID audio_codec_id; + + /** + * Forced subtitle codec_id. + * Demuxing: Set by user. + */ + enum AVCodecID subtitle_codec_id; + + /** + * Maximum amount of memory in bytes to use for the index of each stream. + * If the index exceeds this size, entries will be discarded as + * needed to maintain a smaller size. This can lead to slower or less + * accurate seeking (depends on demuxer). + * Demuxers for which a full in-memory index is mandatory will ignore + * this. + * - muxing: unused + * - demuxing: set by user + */ + unsigned int max_index_size; + + /** + * Maximum amount of memory in bytes to use for buffering frames + * obtained from realtime capture devices. + */ + unsigned int max_picture_buffer; + + /** + * Number of chapters in AVChapter array. + * When muxing, chapters are normally written in the file header, + * so nb_chapters should normally be initialized before write_header + * is called. Some muxers (e.g. mov and mkv) can also write chapters + * in the trailer. To write chapters in the trailer, nb_chapters + * must be zero when write_header is called and non-zero when + * write_trailer is called. + * - muxing: set by user + * - demuxing: set by libavformat + */ + unsigned int nb_chapters; + AVChapter **chapters; + + /** + * Metadata that applies to the whole file. + * + * - demuxing: set by libavformat in avformat_open_input() + * - muxing: may be set by the caller before avformat_write_header() + * + * Freed by libavformat in avformat_free_context(). + */ + AVDictionary *metadata; + + /** + * Start time of the stream in real world time, in microseconds + * since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the + * stream was captured at this real world time. + * - muxing: Set by the caller before avformat_write_header(). If set to + * either 0 or AV_NOPTS_VALUE, then the current wall-time will + * be used. + * - demuxing: Set by libavformat. AV_NOPTS_VALUE if unknown. Note that + * the value may become known after some number of frames + * have been received. + */ + int64_t start_time_realtime; + + /** + * The number of frames used for determining the framerate in + * avformat_find_stream_info(). + * Demuxing only, set by the caller before avformat_find_stream_info(). + */ + int fps_probe_size; + + /** + * Error recognition; higher values will detect more errors but may + * misdetect some more or less valid parts as errors. + * Demuxing only, set by the caller before avformat_open_input(). + */ + int error_recognition; + + /** + * Custom interrupt callbacks for the I/O layer. + * + * demuxing: set by the user before avformat_open_input(). + * muxing: set by the user before avformat_write_header() + * (mainly useful for AVFMT_NOFILE formats). The callback + * should also be passed to avio_open2() if it's used to + * open the file. + */ + AVIOInterruptCB interrupt_callback; + + /** + * Flags to enable debugging. + */ + int debug; +#define FF_FDEBUG_TS 0x0001 + + /** + * Maximum buffering duration for interleaving. + * + * To ensure all the streams are interleaved correctly, + * av_interleaved_write_frame() will wait until it has at least one packet + * for each stream before actually writing any packets to the output file. + * When some streams are "sparse" (i.e. there are large gaps between + * successive packets), this can result in excessive buffering. + * + * This field specifies the maximum difference between the timestamps of the + * first and the last packet in the muxing queue, above which libavformat + * will output a packet regardless of whether it has queued a packet for all + * the streams. + * + * Muxing only, set by the caller before avformat_write_header(). + */ + int64_t max_interleave_delta; + + /** + * Allow non-standard and experimental extension + * @see AVCodecContext.strict_std_compliance + */ + int strict_std_compliance; + + /** + * Flags for the user to detect events happening on the file. Flags must + * be cleared by the user once the event has been handled. + * A combination of AVFMT_EVENT_FLAG_*. + */ + int event_flags; +#define AVFMT_EVENT_FLAG_METADATA_UPDATED 0x0001 ///< The call resulted in updated metadata. + + /** + * Maximum number of packets to read while waiting for the first timestamp. + * Decoding only. + */ + int max_ts_probe; + + /** + * Avoid negative timestamps during muxing. + * Any value of the AVFMT_AVOID_NEG_TS_* constants. + * Note, this only works when using av_interleaved_write_frame. (interleave_packet_per_dts is in use) + * - muxing: Set by user + * - demuxing: unused + */ + int avoid_negative_ts; +#define AVFMT_AVOID_NEG_TS_AUTO -1 ///< Enabled when required by target format +#define AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE 1 ///< Shift timestamps so they are non negative +#define AVFMT_AVOID_NEG_TS_MAKE_ZERO 2 ///< Shift timestamps so that they start at 0 + + /** + * Transport stream id. + * This will be moved into demuxer private options. Thus no API/ABI compatibility + */ + int ts_id; + + /** + * Audio preload in microseconds. + * Note, not all formats support this and unpredictable things may happen if it is used when not supported. + * - encoding: Set by user via AVOptions (NO direct access) + * - decoding: unused + */ + int audio_preload; + + /** + * Max chunk time in microseconds. + * Note, not all formats support this and unpredictable things may happen if it is used when not supported. + * - encoding: Set by user via AVOptions (NO direct access) + * - decoding: unused + */ + int max_chunk_duration; + + /** + * Max chunk size in bytes + * Note, not all formats support this and unpredictable things may happen if it is used when not supported. + * - encoding: Set by user via AVOptions (NO direct access) + * - decoding: unused + */ + int max_chunk_size; + + /** + * forces the use of wallclock timestamps as pts/dts of packets + * This has undefined results in the presence of B frames. + * - encoding: unused + * - decoding: Set by user via AVOptions (NO direct access) + */ + int use_wallclock_as_timestamps; + + /** + * avio flags, used to force AVIO_FLAG_DIRECT. + * - encoding: unused + * - decoding: Set by user via AVOptions (NO direct access) + */ + int avio_flags; + + /** + * The duration field can be estimated through various ways, and this field can be used + * to know how the duration was estimated. + * - encoding: unused + * - decoding: Read by user via AVOptions (NO direct access) + */ + enum AVDurationEstimationMethod duration_estimation_method; + + /** + * Skip initial bytes when opening stream + * - encoding: unused + * - decoding: Set by user via AVOptions (NO direct access) + */ + int64_t skip_initial_bytes; + + /** + * Correct single timestamp overflows + * - encoding: unused + * - decoding: Set by user via AVOptions (NO direct access) + */ + unsigned int correct_ts_overflow; + + /** + * Force seeking to any (also non key) frames. + * - encoding: unused + * - decoding: Set by user via AVOptions (NO direct access) + */ + int seek2any; + + /** + * Flush the I/O context after each packet. + * - encoding: Set by user via AVOptions (NO direct access) + * - decoding: unused + */ + int flush_packets; + + /** + * format probing score. + * The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes + * the format. + * - encoding: unused + * - decoding: set by avformat, read by user via av_format_get_probe_score() (NO direct access) + */ + int probe_score; + + /** + * number of bytes to read maximally to identify format. + * - encoding: unused + * - decoding: set by user through AVOPtions (NO direct access) + */ + int format_probesize; + + /** + * ',' separated list of allowed decoders. + * If NULL then all are allowed + * - encoding: unused + * - decoding: set by user through AVOptions (NO direct access) + */ + char *codec_whitelist; + + /** + * ',' separated list of allowed demuxers. + * If NULL then all are allowed + * - encoding: unused + * - decoding: set by user through AVOptions (NO direct access) + */ + char *format_whitelist; + + /** + * An opaque field for libavformat internal usage. + * Must not be accessed in any way by callers. + */ + AVFormatInternal *internal; + + /** + * IO repositioned flag. + * This is set by avformat when the underlaying IO context read pointer + * is repositioned, for example when doing byte based seeking. + * Demuxers can use the flag to detect such changes. + */ + int io_repositioned; + + /** + * Forced video codec. + * This allows forcing a specific decoder, even when there are multiple with + * the same codec_id. + * Demuxing: Set by user via av_format_set_video_codec (NO direct access). + */ + AVCodec *video_codec; + + /** + * Forced audio codec. + * This allows forcing a specific decoder, even when there are multiple with + * the same codec_id. + * Demuxing: Set by user via av_format_set_audio_codec (NO direct access). + */ + AVCodec *audio_codec; + + /** + * Forced subtitle codec. + * This allows forcing a specific decoder, even when there are multiple with + * the same codec_id. + * Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access). + */ + AVCodec *subtitle_codec; + + /** + * Forced data codec. + * This allows forcing a specific decoder, even when there are multiple with + * the same codec_id. + * Demuxing: Set by user via av_format_set_data_codec (NO direct access). + */ + AVCodec *data_codec; + + /** + * Number of bytes to be written as padding in a metadata header. + * Demuxing: Unused. + * Muxing: Set by user via av_format_set_metadata_header_padding. + */ + int metadata_header_padding; + + /** + * User data. + * This is a place for some private data of the user. + */ + void *opaque; + + /** + * Callback used by devices to communicate with application. + */ + av_format_control_message control_message_cb; + + /** + * Output timestamp offset, in microseconds. + * Muxing: set by user via AVOptions (NO direct access) + */ + int64_t output_ts_offset; + + /** + * dump format separator. + * can be ", " or "\n " or anything else + * Code outside libavformat should access this field using AVOptions + * (NO direct access). + * - muxing: Set by user. + * - demuxing: Set by user. + */ + uint8_t *dump_separator; + + /** + * Forced Data codec_id. + * Demuxing: Set by user. + */ + enum AVCodecID data_codec_id; + +#if FF_API_OLD_OPEN_CALLBACKS + /** + * Called to open further IO contexts when needed for demuxing. + * + * This can be set by the user application to perform security checks on + * the URLs before opening them. + * The function should behave like avio_open2(), AVFormatContext is provided + * as contextual information and to reach AVFormatContext.opaque. + * + * If NULL then some simple checks are used together with avio_open2(). + * + * Must not be accessed directly from outside avformat. + * @See av_format_set_open_cb() + * + * Demuxing: Set by user. + * + * @deprecated Use io_open and io_close. + */ + attribute_deprecated + int (*open_cb)(struct AVFormatContext *s, AVIOContext **p, const char *url, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options); +#endif + + /** + * ',' separated list of allowed protocols. + * - encoding: unused + * - decoding: set by user through AVOptions (NO direct access) + */ + char *protocol_whitelist; + + /* + * A callback for opening new IO streams. + * + * Whenever a muxer or a demuxer needs to open an IO stream (typically from + * avformat_open_input() for demuxers, but for certain formats can happen at + * other times as well), it will call this callback to obtain an IO context. + * + * @param s the format context + * @param pb on success, the newly opened IO context should be returned here + * @param url the url to open + * @param flags a combination of AVIO_FLAG_* + * @param options a dictionary of additional options, with the same + * semantics as in avio_open2() + * @return 0 on success, a negative AVERROR code on failure + * + * @note Certain muxers and demuxers do nesting, i.e. they open one or more + * additional internal format contexts. Thus the AVFormatContext pointer + * passed to this callback may be different from the one facing the caller. + * It will, however, have the same 'opaque' field. + */ + int (*io_open)(struct AVFormatContext *s, AVIOContext **pb, const char *url, + int flags, AVDictionary **options); + + /** + * A callback for closing the streams opened with AVFormatContext.io_open(). + */ + void (*io_close)(struct AVFormatContext *s, AVIOContext *pb); + + /** + * ',' separated list of disallowed protocols. + * - encoding: unused + * - decoding: set by user through AVOptions (NO direct access) + */ + char *protocol_blacklist; +} AVFormatContext; + +int av_format_get_probe_score(const AVFormatContext *s); +AVCodec * av_format_get_video_codec(const AVFormatContext *s); +void av_format_set_video_codec(AVFormatContext *s, AVCodec *c); +AVCodec * av_format_get_audio_codec(const AVFormatContext *s); +void av_format_set_audio_codec(AVFormatContext *s, AVCodec *c); +AVCodec * av_format_get_subtitle_codec(const AVFormatContext *s); +void av_format_set_subtitle_codec(AVFormatContext *s, AVCodec *c); +AVCodec * av_format_get_data_codec(const AVFormatContext *s); +void av_format_set_data_codec(AVFormatContext *s, AVCodec *c); +int av_format_get_metadata_header_padding(const AVFormatContext *s); +void av_format_set_metadata_header_padding(AVFormatContext *s, int c); +void * av_format_get_opaque(const AVFormatContext *s); +void av_format_set_opaque(AVFormatContext *s, void *opaque); +av_format_control_message av_format_get_control_message_cb(const AVFormatContext *s); +void av_format_set_control_message_cb(AVFormatContext *s, av_format_control_message callback); +#if FF_API_OLD_OPEN_CALLBACKS +attribute_deprecated AVOpenCallback av_format_get_open_cb(const AVFormatContext *s); +attribute_deprecated void av_format_set_open_cb(AVFormatContext *s, AVOpenCallback callback); +#endif + +/** + * This function will cause global side data to be injected in the next packet + * of each stream as well as after any subsequent seek. + */ +void av_format_inject_global_side_data(AVFormatContext *s); + +/** + * Returns the method used to set ctx->duration. + * + * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. + */ +enum AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx); + +typedef struct AVPacketList { + AVPacket pkt; + struct AVPacketList *next; +} AVPacketList; + + +/** + * @defgroup lavf_core Core functions + * @ingroup libavf + * + * Functions for querying libavformat capabilities, allocating core structures, + * etc. + * @{ + */ + +/** + * Return the LIBAVFORMAT_VERSION_INT constant. + */ +unsigned avformat_version(void); + +/** + * Return the libavformat build-time configuration. + */ +const char *avformat_configuration(void); + +/** + * Return the libavformat license. + */ +const char *avformat_license(void); + +/** + * Initialize libavformat and register all the muxers, demuxers and + * protocols. If you do not call this function, then you can select + * exactly which formats you want to support. + * + * @see av_register_input_format() + * @see av_register_output_format() + */ +void av_register_all(void); + +void av_register_input_format(AVInputFormat *format); +void av_register_output_format(AVOutputFormat *format); + +/** + * Do global initialization of network components. This is optional, + * but recommended, since it avoids the overhead of implicitly + * doing the setup for each session. + * + * Calling this function will become mandatory if using network + * protocols at some major version bump. + */ +int avformat_network_init(void); + +/** + * Undo the initialization done by avformat_network_init. + */ +int avformat_network_deinit(void); + +/** + * If f is NULL, returns the first registered input format, + * if f is non-NULL, returns the next registered input format after f + * or NULL if f is the last one. + */ +AVInputFormat *av_iformat_next(const AVInputFormat *f); + +/** + * If f is NULL, returns the first registered output format, + * if f is non-NULL, returns the next registered output format after f + * or NULL if f is the last one. + */ +AVOutputFormat *av_oformat_next(const AVOutputFormat *f); + +/** + * Allocate an AVFormatContext. + * avformat_free_context() can be used to free the context and everything + * allocated by the framework within it. + */ +AVFormatContext *avformat_alloc_context(void); + +/** + * Free an AVFormatContext and all its streams. + * @param s context to free + */ +void avformat_free_context(AVFormatContext *s); + +/** + * Get the AVClass for AVFormatContext. It can be used in combination with + * AV_OPT_SEARCH_FAKE_OBJ for examining options. + * + * @see av_opt_find(). + */ +const AVClass *avformat_get_class(void); + +/** + * Add a new stream to a media file. + * + * When demuxing, it is called by the demuxer in read_header(). If the + * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also + * be called in read_packet(). + * + * When muxing, should be called by the user before avformat_write_header(). + * + * User is required to call avcodec_close() and avformat_free_context() to + * clean up the allocation by avformat_new_stream(). + * + * @param s media file handle + * @param c If non-NULL, the AVCodecContext corresponding to the new stream + * will be initialized to use this codec. This is needed for e.g. codec-specific + * defaults to be set, so codec should be provided if it is known. + * + * @return newly created stream or NULL on error. + */ +AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c); + +/** + * Allocate new information from stream. + * + * @param stream stream + * @param type desired side information type + * @param size side information size + * @return pointer to fresh allocated data or NULL otherwise + */ +uint8_t *av_stream_new_side_data(AVStream *stream, + enum AVPacketSideDataType type, int size); +/** + * Get side information from stream. + * + * @param stream stream + * @param type desired side information type + * @param size pointer for side information size to store (optional) + * @return pointer to data if present or NULL otherwise + */ +uint8_t *av_stream_get_side_data(AVStream *stream, + enum AVPacketSideDataType type, int *size); + +AVProgram *av_new_program(AVFormatContext *s, int id); + +/** + * @} + */ + + +/** + * Allocate an AVFormatContext for an output format. + * avformat_free_context() can be used to free the context and + * everything allocated by the framework within it. + * + * @param *ctx is set to the created format context, or to NULL in + * case of failure + * @param oformat format to use for allocating the context, if NULL + * format_name and filename are used instead + * @param format_name the name of output format to use for allocating the + * context, if NULL filename is used instead + * @param filename the name of the filename to use for allocating the + * context, may be NULL + * @return >= 0 in case of success, a negative AVERROR code in case of + * failure + */ +int avformat_alloc_output_context2(AVFormatContext **ctx, AVOutputFormat *oformat, + const char *format_name, const char *filename); + +/** + * @addtogroup lavf_decoding + * @{ + */ + +/** + * Find AVInputFormat based on the short name of the input format. + */ +AVInputFormat *av_find_input_format(const char *short_name); + +/** + * Guess the file format. + * + * @param pd data to be probed + * @param is_opened Whether the file is already opened; determines whether + * demuxers with or without AVFMT_NOFILE are probed. + */ +AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened); + +/** + * Guess the file format. + * + * @param pd data to be probed + * @param is_opened Whether the file is already opened; determines whether + * demuxers with or without AVFMT_NOFILE are probed. + * @param score_max A probe score larger that this is required to accept a + * detection, the variable is set to the actual detection + * score afterwards. + * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended + * to retry with a larger probe buffer. + */ +AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max); + +/** + * Guess the file format. + * + * @param is_opened Whether the file is already opened; determines whether + * demuxers with or without AVFMT_NOFILE are probed. + * @param score_ret The score of the best detection. + */ +AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score_ret); + +/** + * Probe a bytestream to determine the input format. Each time a probe returns + * with a score that is too low, the probe buffer size is increased and another + * attempt is made. When the maximum probe size is reached, the input format + * with the highest score is returned. + * + * @param pb the bytestream to probe + * @param fmt the input format is put here + * @param url the url of the stream + * @param logctx the log context + * @param offset the offset within the bytestream to probe from + * @param max_probe_size the maximum probe buffer size (zero for default) + * @return the score in case of success, a negative value corresponding to an + * the maximal score is AVPROBE_SCORE_MAX + * AVERROR code otherwise + */ +int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt, + const char *url, void *logctx, + unsigned int offset, unsigned int max_probe_size); + +/** + * Like av_probe_input_buffer2() but returns 0 on success + */ +int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, + const char *url, void *logctx, + unsigned int offset, unsigned int max_probe_size); + +/** + * Open an input stream and read the header. The codecs are not opened. + * The stream must be closed with avformat_close_input(). + * + * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). + * May be a pointer to NULL, in which case an AVFormatContext is allocated by this + * function and written into ps. + * Note that a user-supplied AVFormatContext will be freed on failure. + * @param url URL of the stream to open. + * @param fmt If non-NULL, this parameter forces a specific input format. + * Otherwise the format is autodetected. + * @param options A dictionary filled with AVFormatContext and demuxer-private options. + * On return this parameter will be destroyed and replaced with a dict containing + * options that were not found. May be NULL. + * + * @return 0 on success, a negative AVERROR on failure. + * + * @note If you want to use custom IO, preallocate the format context and set its pb field. + */ +int avformat_open_input(AVFormatContext **ps, const char *url, AVInputFormat *fmt, AVDictionary **options); + +attribute_deprecated +int av_demuxer_open(AVFormatContext *ic); + +/** + * Read packets of a media file to get stream information. This + * is useful for file formats with no headers such as MPEG. This + * function also computes the real framerate in case of MPEG-2 repeat + * frame mode. + * The logical file position is not changed by this function; + * examined packets may be buffered for later processing. + * + * @param ic media file handle + * @param options If non-NULL, an ic.nb_streams long array of pointers to + * dictionaries, where i-th member contains options for + * codec corresponding to i-th stream. + * On return each dictionary will be filled with options that were not found. + * @return >=0 if OK, AVERROR_xxx on error + * + * @note this function isn't guaranteed to open all the codecs, so + * options being non-empty at return is a perfectly normal behavior. + * + * @todo Let the user decide somehow what information is needed so that + * we do not waste time getting stuff the user does not need. + */ +int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options); + +/** + * Find the programs which belong to a given stream. + * + * @param ic media file handle + * @param last the last found program, the search will start after this + * program, or from the beginning if it is NULL + * @param s stream index + * @return the next program which belongs to s, NULL if no program is found or + * the last program is not among the programs of ic. + */ +AVProgram *av_find_program_from_stream(AVFormatContext *ic, AVProgram *last, int s); + +void av_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int idx); + +/** + * Find the "best" stream in the file. + * The best stream is determined according to various heuristics as the most + * likely to be what the user expects. + * If the decoder parameter is non-NULL, av_find_best_stream will find the + * default decoder for the stream's codec; streams for which no decoder can + * be found are ignored. + * + * @param ic media file handle + * @param type stream type: video, audio, subtitles, etc. + * @param wanted_stream_nb user-requested stream number, + * or -1 for automatic selection + * @param related_stream try to find a stream related (eg. in the same + * program) to this one, or -1 if none + * @param decoder_ret if non-NULL, returns the decoder for the + * selected stream + * @param flags flags; none are currently defined + * @return the non-negative stream number in case of success, + * AVERROR_STREAM_NOT_FOUND if no stream with the requested type + * could be found, + * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder + * @note If av_find_best_stream returns successfully and decoder_ret is not + * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. + */ +int av_find_best_stream(AVFormatContext *ic, + enum AVMediaType type, + int wanted_stream_nb, + int related_stream, + AVCodec **decoder_ret, + int flags); + +/** + * Return the next frame of a stream. + * This function returns what is stored in the file, and does not validate + * that what is there are valid frames for the decoder. It will split what is + * stored in the file into frames and return one for each call. It will not + * omit invalid data between valid frames so as to give the decoder the maximum + * information possible for decoding. + * + * If pkt->buf is NULL, then the packet is valid until the next + * av_read_frame() or until avformat_close_input(). Otherwise the packet + * is valid indefinitely. In both cases the packet must be freed with + * av_packet_unref when it is no longer needed. For video, the packet contains + * exactly one frame. For audio, it contains an integer number of frames if each + * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames + * have a variable size (e.g. MPEG audio), then it contains one frame. + * + * pkt->pts, pkt->dts and pkt->duration are always set to correct + * values in AVStream.time_base units (and guessed if the format cannot + * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format + * has B-frames, so it is better to rely on pkt->dts if you do not + * decompress the payload. + * + * @return 0 if OK, < 0 on error or end of file + */ +int av_read_frame(AVFormatContext *s, AVPacket *pkt); + +/** + * Seek to the keyframe at timestamp. + * 'timestamp' in 'stream_index'. + * + * @param s media file handle + * @param stream_index If stream_index is (-1), a default + * stream is selected, and timestamp is automatically converted + * from AV_TIME_BASE units to the stream specific time_base. + * @param timestamp Timestamp in AVStream.time_base units + * or, if no stream is specified, in AV_TIME_BASE units. + * @param flags flags which select direction and seeking mode + * @return >= 0 on success + */ +int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, + int flags); + +/** + * Seek to timestamp ts. + * Seeking will be done so that the point from which all active streams + * can be presented successfully will be closest to ts and within min/max_ts. + * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. + * + * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and + * are the file position (this may not be supported by all demuxers). + * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames + * in the stream with stream_index (this may not be supported by all demuxers). + * Otherwise all timestamps are in units of the stream selected by stream_index + * or if stream_index is -1, in AV_TIME_BASE units. + * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as + * keyframes (this may not be supported by all demuxers). + * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. + * + * @param s media file handle + * @param stream_index index of the stream which is used as time base reference + * @param min_ts smallest acceptable timestamp + * @param ts target timestamp + * @param max_ts largest acceptable timestamp + * @param flags flags + * @return >=0 on success, error code otherwise + * + * @note This is part of the new seek API which is still under construction. + * Thus do not use this yet. It may change at any time, do not expect + * ABI compatibility yet! + */ +int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags); + +/** + * Discard all internally buffered data. This can be useful when dealing with + * discontinuities in the byte stream. Generally works only with formats that + * can resync. This includes headerless formats like MPEG-TS/TS but should also + * work with NUT, Ogg and in a limited way AVI for example. + * + * The set of streams, the detected duration, stream parameters and codecs do + * not change when calling this function. If you want a complete reset, it's + * better to open a new AVFormatContext. + * + * This does not flush the AVIOContext (s->pb). If necessary, call + * avio_flush(s->pb) before calling this function. + * + * @param s media file handle + * @return >=0 on success, error code otherwise + */ +int avformat_flush(AVFormatContext *s); + +/** + * Start playing a network-based stream (e.g. RTSP stream) at the + * current position. + */ +int av_read_play(AVFormatContext *s); + +/** + * Pause a network-based stream (e.g. RTSP stream). + * + * Use av_read_play() to resume it. + */ +int av_read_pause(AVFormatContext *s); + +/** + * Close an opened input AVFormatContext. Free it and all its contents + * and set *s to NULL. + */ +void avformat_close_input(AVFormatContext **s); +/** + * @} + */ + +#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward +#define AVSEEK_FLAG_BYTE 2 ///< seeking based on position in bytes +#define AVSEEK_FLAG_ANY 4 ///< seek to any frame, even non-keyframes +#define AVSEEK_FLAG_FRAME 8 ///< seeking based on frame number + +/** + * @addtogroup lavf_encoding + * @{ + */ +/** + * Allocate the stream private data and write the stream header to + * an output media file. + * + * @param s Media file handle, must be allocated with avformat_alloc_context(). + * Its oformat field must be set to the desired output format; + * Its pb field must be set to an already opened AVIOContext. + * @param options An AVDictionary filled with AVFormatContext and muxer-private options. + * On return this parameter will be destroyed and replaced with a dict containing + * options that were not found. May be NULL. + * + * @return 0 on success, negative AVERROR on failure. + * + * @see av_opt_find, av_dict_set, avio_open, av_oformat_next. + */ +av_warn_unused_result +int avformat_write_header(AVFormatContext *s, AVDictionary **options); + +/** + * Write a packet to an output media file. + * + * This function passes the packet directly to the muxer, without any buffering + * or reordering. The caller is responsible for correctly interleaving the + * packets if the format requires it. Callers that want libavformat to handle + * the interleaving should call av_interleaved_write_frame() instead of this + * function. + * + * @param s media file handle + * @param pkt The packet containing the data to be written. Note that unlike + * av_interleaved_write_frame(), this function does not take + * ownership of the packet passed to it (though some muxers may make + * an internal reference to the input packet). + *
+ * This parameter can be NULL (at any time, not just at the end), in + * order to immediately flush data buffered within the muxer, for + * muxers that buffer up data internally before writing it to the + * output. + *
+ * Packet's @ref AVPacket.stream_index "stream_index" field must be + * set to the index of the corresponding stream in @ref + * AVFormatContext.streams "s->streams". + *
+ * The timestamps (@ref AVPacket.pts "pts", @ref AVPacket.dts "dts") + * must be set to correct values in the stream's timebase (unless the + * output format is flagged with the AVFMT_NOTIMESTAMPS flag, then + * they can be set to AV_NOPTS_VALUE). + * The dts for subsequent packets passed to this function must be strictly + * increasing when compared in their respective timebases (unless the + * output format is flagged with the AVFMT_TS_NONSTRICT, then they + * merely have to be nondecreasing). @ref AVPacket.duration + * "duration") should also be set if known. + * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush + * + * @see av_interleaved_write_frame() + */ +int av_write_frame(AVFormatContext *s, AVPacket *pkt); + +/** + * Write a packet to an output media file ensuring correct interleaving. + * + * This function will buffer the packets internally as needed to make sure the + * packets in the output file are properly interleaved in the order of + * increasing dts. Callers doing their own interleaving should call + * av_write_frame() instead of this function. + * + * Using this function instead of av_write_frame() can give muxers advance + * knowledge of future packets, improving e.g. the behaviour of the mp4 + * muxer for VFR content in fragmenting mode. + * + * @param s media file handle + * @param pkt The packet containing the data to be written. + *
+ * If the packet is reference-counted, this function will take + * ownership of this reference and unreference it later when it sees + * fit. + * The caller must not access the data through this reference after + * this function returns. If the packet is not reference-counted, + * libavformat will make a copy. + *
+ * This parameter can be NULL (at any time, not just at the end), to + * flush the interleaving queues. + *
+ * Packet's @ref AVPacket.stream_index "stream_index" field must be + * set to the index of the corresponding stream in @ref + * AVFormatContext.streams "s->streams". + *
+ * The timestamps (@ref AVPacket.pts "pts", @ref AVPacket.dts "dts") + * must be set to correct values in the stream's timebase (unless the + * output format is flagged with the AVFMT_NOTIMESTAMPS flag, then + * they can be set to AV_NOPTS_VALUE). + * The dts for subsequent packets in one stream must be strictly + * increasing (unless the output format is flagged with the + * AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). + * @ref AVPacket.duration "duration") should also be set if known. + * + * @return 0 on success, a negative AVERROR on error. Libavformat will always + * take care of freeing the packet, even if this function fails. + * + * @see av_write_frame(), AVFormatContext.max_interleave_delta + */ +int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt); + +/** + * Write an uncoded frame to an output media file. + * + * The frame must be correctly interleaved according to the container + * specification; if not, then av_interleaved_write_frame() must be used. + * + * See av_interleaved_write_frame() for details. + */ +int av_write_uncoded_frame(AVFormatContext *s, int stream_index, + AVFrame *frame); + +/** + * Write an uncoded frame to an output media file. + * + * If the muxer supports it, this function makes it possible to write an AVFrame + * structure directly, without encoding it into a packet. + * It is mostly useful for devices and similar special muxers that use raw + * video or PCM data and will not serialize it into a byte stream. + * + * To test whether it is possible to use it with a given muxer and stream, + * use av_write_uncoded_frame_query(). + * + * The caller gives up ownership of the frame and must not access it + * afterwards. + * + * @return >=0 for success, a negative code on error + */ +int av_interleaved_write_uncoded_frame(AVFormatContext *s, int stream_index, + AVFrame *frame); + +/** + * Test whether a muxer supports uncoded frame. + * + * @return >=0 if an uncoded frame can be written to that muxer and stream, + * <0 if not + */ +int av_write_uncoded_frame_query(AVFormatContext *s, int stream_index); + +/** + * Write the stream trailer to an output media file and free the + * file private data. + * + * May only be called after a successful call to avformat_write_header. + * + * @param s media file handle + * @return 0 if OK, AVERROR_xxx on error + */ +int av_write_trailer(AVFormatContext *s); + +/** + * Return the output format in the list of registered output formats + * which best matches the provided parameters, or return NULL if + * there is no match. + * + * @param short_name if non-NULL checks if short_name matches with the + * names of the registered formats + * @param filename if non-NULL checks if filename terminates with the + * extensions of the registered formats + * @param mime_type if non-NULL checks if mime_type matches with the + * MIME type of the registered formats + */ +AVOutputFormat *av_guess_format(const char *short_name, + const char *filename, + const char *mime_type); + +/** + * Guess the codec ID based upon muxer and filename. + */ +enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, + const char *filename, const char *mime_type, + enum AVMediaType type); + +/** + * Get timing information for the data currently output. + * The exact meaning of "currently output" depends on the format. + * It is mostly relevant for devices that have an internal buffer and/or + * work in real time. + * @param s media file handle + * @param stream stream in the media file + * @param[out] dts DTS of the last packet output for the stream, in stream + * time_base units + * @param[out] wall absolute time when that packet whas output, + * in microsecond + * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it + * Note: some formats or devices may not allow to measure dts and wall + * atomically. + */ +int av_get_output_timestamp(struct AVFormatContext *s, int stream, + int64_t *dts, int64_t *wall); + + +/** + * @} + */ + + +/** + * @defgroup lavf_misc Utility functions + * @ingroup libavf + * @{ + * + * Miscellaneous utility functions related to both muxing and demuxing + * (or neither). + */ + +/** + * Send a nice hexadecimal dump of a buffer to the specified file stream. + * + * @param f The file stream pointer where the dump should be sent to. + * @param buf buffer + * @param size buffer size + * + * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 + */ +void av_hex_dump(FILE *f, const uint8_t *buf, int size); + +/** + * Send a nice hexadecimal dump of a buffer to the log. + * + * @param avcl A pointer to an arbitrary struct of which the first field is a + * pointer to an AVClass struct. + * @param level The importance level of the message, lower values signifying + * higher importance. + * @param buf buffer + * @param size buffer size + * + * @see av_hex_dump, av_pkt_dump2, av_pkt_dump_log2 + */ +void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size); + +/** + * Send a nice dump of a packet to the specified file stream. + * + * @param f The file stream pointer where the dump should be sent to. + * @param pkt packet to dump + * @param dump_payload True if the payload must be displayed, too. + * @param st AVStream that the packet belongs to + */ +void av_pkt_dump2(FILE *f, const AVPacket *pkt, int dump_payload, const AVStream *st); + + +/** + * Send a nice dump of a packet to the log. + * + * @param avcl A pointer to an arbitrary struct of which the first field is a + * pointer to an AVClass struct. + * @param level The importance level of the message, lower values signifying + * higher importance. + * @param pkt packet to dump + * @param dump_payload True if the payload must be displayed, too. + * @param st AVStream that the packet belongs to + */ +void av_pkt_dump_log2(void *avcl, int level, const AVPacket *pkt, int dump_payload, + const AVStream *st); + +/** + * Get the AVCodecID for the given codec tag tag. + * If no codec id is found returns AV_CODEC_ID_NONE. + * + * @param tags list of supported codec_id-codec_tag pairs, as stored + * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + * @param tag codec tag to match to a codec ID + */ +enum AVCodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag); + +/** + * Get the codec tag for the given codec id id. + * If no codec tag is found returns 0. + * + * @param tags list of supported codec_id-codec_tag pairs, as stored + * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + * @param id codec ID to match to a codec tag + */ +unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum AVCodecID id); + +/** + * Get the codec tag for the given codec id. + * + * @param tags list of supported codec_id - codec_tag pairs, as stored + * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + * @param id codec id that should be searched for in the list + * @param tag A pointer to the found tag + * @return 0 if id was not found in tags, > 0 if it was found + */ +int av_codec_get_tag2(const struct AVCodecTag * const *tags, enum AVCodecID id, + unsigned int *tag); + +int av_find_default_stream_index(AVFormatContext *s); + +/** + * Get the index for a specific timestamp. + * + * @param st stream that the timestamp belongs to + * @param timestamp timestamp to retrieve the index for + * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond + * to the timestamp which is <= the requested one, if backward + * is 0, then it will be >= + * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise + * @return < 0 if no such timestamp could be found + */ +int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags); + +/** + * Add an index entry into a sorted list. Update the entry if the list + * already contains it. + * + * @param timestamp timestamp in the time base of the given stream + */ +int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, + int size, int distance, int flags); + + +/** + * Split a URL string into components. + * + * The pointers to buffers for storing individual components may be null, + * in order to ignore that component. Buffers for components not found are + * set to empty strings. If the port is not found, it is set to a negative + * value. + * + * @param proto the buffer for the protocol + * @param proto_size the size of the proto buffer + * @param authorization the buffer for the authorization + * @param authorization_size the size of the authorization buffer + * @param hostname the buffer for the host name + * @param hostname_size the size of the hostname buffer + * @param port_ptr a pointer to store the port number in + * @param path the buffer for the path + * @param path_size the size of the path buffer + * @param url the URL to split + */ +void av_url_split(char *proto, int proto_size, + char *authorization, int authorization_size, + char *hostname, int hostname_size, + int *port_ptr, + char *path, int path_size, + const char *url); + + +/** + * Print detailed information about the input or output format, such as + * duration, bitrate, streams, container, programs, metadata, side data, + * codec and time base. + * + * @param ic the context to analyze + * @param index index of the stream to dump information about + * @param url the URL to print, such as source or destination file + * @param is_output Select whether the specified context is an input(0) or output(1) + */ +void av_dump_format(AVFormatContext *ic, + int index, + const char *url, + int is_output); + +/** + * Return in 'buf' the path with '%d' replaced by a number. + * + * Also handles the '%0nd' format where 'n' is the total number + * of digits and '%%'. + * + * @param buf destination buffer + * @param buf_size destination buffer size + * @param path numbered sequence string + * @param number frame number + * @return 0 if OK, -1 on format error + */ +int av_get_frame_filename(char *buf, int buf_size, + const char *path, int number); + +/** + * Check whether filename actually is a numbered sequence generator. + * + * @param filename possible numbered sequence string + * @return 1 if a valid numbered sequence string, 0 otherwise + */ +int av_filename_number_test(const char *filename); + +/** + * Generate an SDP for an RTP session. + * + * Note, this overwrites the id values of AVStreams in the muxer contexts + * for getting unique dynamic payload types. + * + * @param ac array of AVFormatContexts describing the RTP streams. If the + * array is composed by only one context, such context can contain + * multiple AVStreams (one AVStream per RTP stream). Otherwise, + * all the contexts in the array (an AVCodecContext per RTP stream) + * must contain only one AVStream. + * @param n_files number of AVCodecContexts contained in ac + * @param buf buffer where the SDP will be stored (must be allocated by + * the caller) + * @param size the size of the buffer + * @return 0 if OK, AVERROR_xxx on error + */ +int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size); + +/** + * Return a positive value if the given filename has one of the given + * extensions, 0 otherwise. + * + * @param filename file name to check against the given extensions + * @param extensions a comma-separated list of filename extensions + */ +int av_match_ext(const char *filename, const char *extensions); + +/** + * Test if the given container can store a codec. + * + * @param ofmt container to check for compatibility + * @param codec_id codec to potentially store in container + * @param std_compliance standards compliance level, one of FF_COMPLIANCE_* + * + * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. + * A negative number if this information is not available. + */ +int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id, + int std_compliance); + +/** + * @defgroup riff_fourcc RIFF FourCCs + * @{ + * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are + * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the + * following code: + * @code + * uint32_t tag = MKTAG('H', '2', '6', '4'); + * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 }; + * enum AVCodecID id = av_codec_get_id(table, tag); + * @endcode + */ +/** + * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID. + */ +const struct AVCodecTag *avformat_get_riff_video_tags(void); +/** + * @return the table mapping RIFF FourCCs for audio to AVCodecID. + */ +const struct AVCodecTag *avformat_get_riff_audio_tags(void); +/** + * @return the table mapping MOV FourCCs for video to libavcodec AVCodecID. + */ +const struct AVCodecTag *avformat_get_mov_video_tags(void); +/** + * @return the table mapping MOV FourCCs for audio to AVCodecID. + */ +const struct AVCodecTag *avformat_get_mov_audio_tags(void); + +/** + * @} + */ + +/** + * Guess the sample aspect ratio of a frame, based on both the stream and the + * frame aspect ratio. + * + * Since the frame aspect ratio is set by the codec but the stream aspect ratio + * is set by the demuxer, these two may not be equal. This function tries to + * return the value that you should use if you would like to display the frame. + * + * Basic logic is to use the stream aspect ratio if it is set to something sane + * otherwise use the frame aspect ratio. This way a container setting, which is + * usually easy to modify can override the coded value in the frames. + * + * @param format the format context which the stream is part of + * @param stream the stream which the frame is part of + * @param frame the frame with the aspect ratio to be determined + * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea + */ +AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *stream, AVFrame *frame); + +/** + * Guess the frame rate, based on both the container and codec information. + * + * @param ctx the format context which the stream is part of + * @param stream the stream which the frame is part of + * @param frame the frame for which the frame rate should be determined, may be NULL + * @return the guessed (valid) frame rate, 0/1 if no idea + */ +AVRational av_guess_frame_rate(AVFormatContext *ctx, AVStream *stream, AVFrame *frame); + +/** + * Check if the stream st contained in s is matched by the stream specifier + * spec. + * + * See the "stream specifiers" chapter in the documentation for the syntax + * of spec. + * + * @return >0 if st is matched by spec; + * 0 if st is not matched by spec; + * AVERROR code if spec is invalid + * + * @note A stream specifier can match several streams in the format. + */ +int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st, + const char *spec); + +int avformat_queue_attached_pictures(AVFormatContext *s); + +/** + * Apply a list of bitstream filters to a packet. + * + * @param codec AVCodecContext, usually from an AVStream + * @param pkt the packet to apply filters to. If, on success, the returned + * packet has size == 0 and side_data_elems == 0, it indicates that + * the packet should be dropped + * @param bsfc a NULL-terminated list of filters to apply + * @return >=0 on success; + * AVERROR code on failure + */ +#if FF_API_OLD_BSF +attribute_deprecated +int av_apply_bitstream_filters(AVCodecContext *codec, AVPacket *pkt, + AVBitStreamFilterContext *bsfc); +#endif + +/** + * @} + */ + +#endif /* AVFORMAT_AVFORMAT_H */ diff --git a/Src/Decoder_H264_ALL/include/libavformat/avio.h b/Src/Decoder_H264_ALL/include/libavformat/avio.h new file mode 100644 index 0000000..b1ce1d1 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavformat/avio.h @@ -0,0 +1,801 @@ +/* + * copyright (c) 2001 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#ifndef AVFORMAT_AVIO_H +#define AVFORMAT_AVIO_H + +/** + * @file + * @ingroup lavf_io + * Buffered I/O operations + */ + +#include + +#include "libavutil/common.h" +#include "libavutil/dict.h" +#include "libavutil/log.h" + +#include "libavformat/version.h" + +#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */ + +/** + * Callback for checking whether to abort blocking functions. + * AVERROR_EXIT is returned in this case by the interrupted + * function. During blocking operations, callback is called with + * opaque as parameter. If the callback returns 1, the + * blocking operation will be aborted. + * + * No members can be added to this struct without a major bump, if + * new elements have been added after this struct in AVFormatContext + * or AVIOContext. + */ +typedef struct AVIOInterruptCB { + int (*callback)(void*); + void *opaque; +} AVIOInterruptCB; + +/** + * Directory entry types. + */ +enum AVIODirEntryType { + AVIO_ENTRY_UNKNOWN, + AVIO_ENTRY_BLOCK_DEVICE, + AVIO_ENTRY_CHARACTER_DEVICE, + AVIO_ENTRY_DIRECTORY, + AVIO_ENTRY_NAMED_PIPE, + AVIO_ENTRY_SYMBOLIC_LINK, + AVIO_ENTRY_SOCKET, + AVIO_ENTRY_FILE, + AVIO_ENTRY_SERVER, + AVIO_ENTRY_SHARE, + AVIO_ENTRY_WORKGROUP, +}; + +/** + * Describes single entry of the directory. + * + * Only name and type fields are guaranteed be set. + * Rest of fields are protocol or/and platform dependent and might be unknown. + */ +typedef struct AVIODirEntry { + char *name; /**< Filename */ + int type; /**< Type of the entry */ + int utf8; /**< Set to 1 when name is encoded with UTF-8, 0 otherwise. + Name can be encoded with UTF-8 even though 0 is set. */ + int64_t size; /**< File size in bytes, -1 if unknown. */ + int64_t modification_timestamp; /**< Time of last modification in microseconds since unix + epoch, -1 if unknown. */ + int64_t access_timestamp; /**< Time of last access in microseconds since unix epoch, + -1 if unknown. */ + int64_t status_change_timestamp; /**< Time of last status change in microseconds since unix + epoch, -1 if unknown. */ + int64_t user_id; /**< User ID of owner, -1 if unknown. */ + int64_t group_id; /**< Group ID of owner, -1 if unknown. */ + int64_t filemode; /**< Unix file mode, -1 if unknown. */ +} AVIODirEntry; + +typedef struct AVIODirContext { + struct URLContext *url_context; +} AVIODirContext; + +/** + * Different data types that can be returned via the AVIO + * write_data_type callback. + */ +enum AVIODataMarkerType { + /** + * Header data; this needs to be present for the stream to be decodeable. + */ + AVIO_DATA_MARKER_HEADER, + /** + * A point in the output bytestream where a decoder can start decoding + * (i.e. a keyframe). A demuxer/decoder given the data flagged with + * AVIO_DATA_MARKER_HEADER, followed by any AVIO_DATA_MARKER_SYNC_POINT, + * should give decodeable results. + */ + AVIO_DATA_MARKER_SYNC_POINT, + /** + * A point in the output bytestream where a demuxer can start parsing + * (for non self synchronizing bytestream formats). That is, any + * non-keyframe packet start point. + */ + AVIO_DATA_MARKER_BOUNDARY_POINT, + /** + * This is any, unlabelled data. It can either be a muxer not marking + * any positions at all, it can be an actual boundary/sync point + * that the muxer chooses not to mark, or a later part of a packet/fragment + * that is cut into multiple write callbacks due to limited IO buffer size. + */ + AVIO_DATA_MARKER_UNKNOWN, + /** + * Trailer data, which doesn't contain actual content, but only for + * finalizing the output file. + */ + AVIO_DATA_MARKER_TRAILER +}; + +/** + * Bytestream IO Context. + * New fields can be added to the end with minor version bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. + * sizeof(AVIOContext) must not be used outside libav*. + * + * @note None of the function pointers in AVIOContext should be called + * directly, they should only be set by the client application + * when implementing custom I/O. Normally these are set to the + * function pointers specified in avio_alloc_context() + */ +typedef struct AVIOContext { + /** + * A class for private options. + * + * If this AVIOContext is created by avio_open2(), av_class is set and + * passes the options down to protocols. + * + * If this AVIOContext is manually allocated, then av_class may be set by + * the caller. + * + * warning -- this field can be NULL, be sure to not pass this AVIOContext + * to any av_opt_* functions in that case. + */ + const AVClass *av_class; + + /* + * The following shows the relationship between buffer, buf_ptr, buf_end, buf_size, + * and pos, when reading and when writing (since AVIOContext is used for both): + * + ********************************************************************************** + * READING + ********************************************************************************** + * + * | buffer_size | + * |---------------------------------------| + * | | + * + * buffer buf_ptr buf_end + * +---------------+-----------------------+ + * |/ / / / / / / /|/ / / / / / /| | + * read buffer: |/ / consumed / | to be read /| | + * |/ / / / / / / /|/ / / / / / /| | + * +---------------+-----------------------+ + * + * pos + * +-------------------------------------------+-----------------+ + * input file: | | | + * +-------------------------------------------+-----------------+ + * + * + ********************************************************************************** + * WRITING + ********************************************************************************** + * + * | buffer_size | + * |-------------------------------| + * | | + * + * buffer buf_ptr buf_end + * +-------------------+-----------+ + * |/ / / / / / / / / /| | + * write buffer: | / to be flushed / | | + * |/ / / / / / / / / /| | + * +-------------------+-----------+ + * + * pos + * +--------------------------+-----------------------------------+ + * output file: | | | + * +--------------------------+-----------------------------------+ + * + */ + unsigned char *buffer; /**< Start of the buffer. */ + int buffer_size; /**< Maximum buffer size */ + unsigned char *buf_ptr; /**< Current position in the buffer */ + unsigned char *buf_end; /**< End of the data, may be less than + buffer+buffer_size if the read function returned + less data than requested, e.g. for streams where + no more data has been received yet. */ + void *opaque; /**< A private pointer, passed to the read/write/seek/... + functions. */ + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size); + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size); + int64_t (*seek)(void *opaque, int64_t offset, int whence); + int64_t pos; /**< position in the file of the current buffer */ + int must_flush; /**< true if the next seek should flush */ + int eof_reached; /**< true if eof reached */ + int write_flag; /**< true if open for writing */ + int max_packet_size; + unsigned long checksum; + unsigned char *checksum_ptr; + unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size); + int error; /**< contains the error code or 0 if no error happened */ + /** + * Pause or resume playback for network streaming protocols - e.g. MMS. + */ + int (*read_pause)(void *opaque, int pause); + /** + * Seek to a given timestamp in stream with the specified stream_index. + * Needed for some network streaming protocols which don't support seeking + * to byte position. + */ + int64_t (*read_seek)(void *opaque, int stream_index, + int64_t timestamp, int flags); + /** + * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. + */ + int seekable; + + /** + * max filesize, used to limit allocations + * This field is internal to libavformat and access from outside is not allowed. + */ + int64_t maxsize; + + /** + * avio_read and avio_write should if possible be satisfied directly + * instead of going through a buffer, and avio_seek will always + * call the underlying seek function directly. + */ + int direct; + + /** + * Bytes read statistic + * This field is internal to libavformat and access from outside is not allowed. + */ + int64_t bytes_read; + + /** + * seek statistic + * This field is internal to libavformat and access from outside is not allowed. + */ + int seek_count; + + /** + * writeout statistic + * This field is internal to libavformat and access from outside is not allowed. + */ + int writeout_count; + + /** + * Original buffer size + * used internally after probing and ensure seekback to reset the buffer size + * This field is internal to libavformat and access from outside is not allowed. + */ + int orig_buffer_size; + + /** + * Threshold to favor readahead over seek. + * This is current internal only, do not use from outside. + */ + int short_seek_threshold; + + /** + * ',' separated list of allowed protocols. + */ + const char *protocol_whitelist; + + /** + * ',' separated list of disallowed protocols. + */ + const char *protocol_blacklist; + + /** + * A callback that is used instead of write_packet. + */ + int (*write_data_type)(void *opaque, uint8_t *buf, int buf_size, + enum AVIODataMarkerType type, int64_t time); + /** + * If set, don't call write_data_type separately for AVIO_DATA_MARKER_BOUNDARY_POINT, + * but ignore them and treat them as AVIO_DATA_MARKER_UNKNOWN (to avoid needlessly + * small chunks of data returned from the callback). + */ + int ignore_boundary_point; + + /** + * Internal, not meant to be used from outside of AVIOContext. + */ + enum AVIODataMarkerType current_type; + int64_t last_time; +} AVIOContext; + +/** + * Return the name of the protocol that will handle the passed URL. + * + * NULL is returned if no protocol could be found for the given URL. + * + * @return Name of the protocol or NULL. + */ +const char *avio_find_protocol_name(const char *url); + +/** + * Return AVIO_FLAG_* access flags corresponding to the access permissions + * of the resource in url, or a negative value corresponding to an + * AVERROR code in case of failure. The returned access flags are + * masked by the value in flags. + * + * @note This function is intrinsically unsafe, in the sense that the + * checked resource may change its existence or permission status from + * one call to another. Thus you should not trust the returned value, + * unless you are sure that no other processes are accessing the + * checked resource. + */ +int avio_check(const char *url, int flags); + +/** + * Move or rename a resource. + * + * @note url_src and url_dst should share the same protocol and authority. + * + * @param url_src url to resource to be moved + * @param url_dst new url to resource if the operation succeeded + * @return >=0 on success or negative on error. + */ +int avpriv_io_move(const char *url_src, const char *url_dst); + +/** + * Delete a resource. + * + * @param url resource to be deleted. + * @return >=0 on success or negative on error. + */ +int avpriv_io_delete(const char *url); + +/** + * Open directory for reading. + * + * @param s directory read context. Pointer to a NULL pointer must be passed. + * @param url directory to be listed. + * @param options A dictionary filled with protocol-private options. On return + * this parameter will be destroyed and replaced with a dictionary + * containing options that were not found. May be NULL. + * @return >=0 on success or negative on error. + */ +int avio_open_dir(AVIODirContext **s, const char *url, AVDictionary **options); + +/** + * Get next directory entry. + * + * Returned entry must be freed with avio_free_directory_entry(). In particular + * it may outlive AVIODirContext. + * + * @param s directory read context. + * @param[out] next next entry or NULL when no more entries. + * @return >=0 on success or negative on error. End of list is not considered an + * error. + */ +int avio_read_dir(AVIODirContext *s, AVIODirEntry **next); + +/** + * Close directory. + * + * @note Entries created using avio_read_dir() are not deleted and must be + * freeded with avio_free_directory_entry(). + * + * @param s directory read context. + * @return >=0 on success or negative on error. + */ +int avio_close_dir(AVIODirContext **s); + +/** + * Free entry allocated by avio_read_dir(). + * + * @param entry entry to be freed. + */ +void avio_free_directory_entry(AVIODirEntry **entry); + +/** + * Allocate and initialize an AVIOContext for buffered I/O. It must be later + * freed with av_free(). + * + * @param buffer Memory block for input/output operations via AVIOContext. + * The buffer must be allocated with av_malloc() and friends. + * It may be freed and replaced with a new buffer by libavformat. + * AVIOContext.buffer holds the buffer currently in use, + * which must be later freed with av_free(). + * @param buffer_size The buffer size is very important for performance. + * For protocols with fixed blocksize it should be set to this blocksize. + * For others a typical size is a cache page, e.g. 4kb. + * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. + * @param opaque An opaque pointer to user-specific data. + * @param read_packet A function for refilling the buffer, may be NULL. + * @param write_packet A function for writing the buffer contents, may be NULL. + * The function may not change the input buffers content. + * @param seek A function for seeking to specified byte position, may be NULL. + * + * @return Allocated AVIOContext or NULL on failure. + */ +AVIOContext *avio_alloc_context( + unsigned char *buffer, + int buffer_size, + int write_flag, + void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), + int64_t (*seek)(void *opaque, int64_t offset, int whence)); + +void avio_w8(AVIOContext *s, int b); +void avio_write(AVIOContext *s, const unsigned char *buf, int size); +void avio_wl64(AVIOContext *s, uint64_t val); +void avio_wb64(AVIOContext *s, uint64_t val); +void avio_wl32(AVIOContext *s, unsigned int val); +void avio_wb32(AVIOContext *s, unsigned int val); +void avio_wl24(AVIOContext *s, unsigned int val); +void avio_wb24(AVIOContext *s, unsigned int val); +void avio_wl16(AVIOContext *s, unsigned int val); +void avio_wb16(AVIOContext *s, unsigned int val); + +/** + * Write a NULL-terminated string. + * @return number of bytes written. + */ +int avio_put_str(AVIOContext *s, const char *str); + +/** + * Convert an UTF-8 string to UTF-16LE and write it. + * @param s the AVIOContext + * @param str NULL-terminated UTF-8 string + * + * @return number of bytes written. + */ +int avio_put_str16le(AVIOContext *s, const char *str); + +/** + * Convert an UTF-8 string to UTF-16BE and write it. + * @param s the AVIOContext + * @param str NULL-terminated UTF-8 string + * + * @return number of bytes written. + */ +int avio_put_str16be(AVIOContext *s, const char *str); + +/** + * Mark the written bytestream as a specific type. + * + * Zero-length ranges are omitted from the output. + * + * @param time the stream time the current bytestream pos corresponds to + * (in AV_TIME_BASE units), or AV_NOPTS_VALUE if unknown or not + * applicable + * @param type the kind of data written starting at the current pos + */ +void avio_write_marker(AVIOContext *s, int64_t time, enum AVIODataMarkerType type); + +/** + * ORing this as the "whence" parameter to a seek function causes it to + * return the filesize without seeking anywhere. Supporting this is optional. + * If it is not supported then the seek function will return <0. + */ +#define AVSEEK_SIZE 0x10000 + +/** + * Passing this flag as the "whence" parameter to a seek function causes it to + * seek by any means (like reopening and linear reading) or other normally unreasonable + * means that can be extremely slow. + * This may be ignored by the seek code. + */ +#define AVSEEK_FORCE 0x20000 + +/** + * fseek() equivalent for AVIOContext. + * @return new position or AVERROR. + */ +int64_t avio_seek(AVIOContext *s, int64_t offset, int whence); + +/** + * Skip given number of bytes forward + * @return new position or AVERROR. + */ +int64_t avio_skip(AVIOContext *s, int64_t offset); + +/** + * ftell() equivalent for AVIOContext. + * @return position or AVERROR. + */ +static av_always_inline int64_t avio_tell(AVIOContext *s) +{ + return avio_seek(s, 0, SEEK_CUR); +} + +/** + * Get the filesize. + * @return filesize or AVERROR + */ +int64_t avio_size(AVIOContext *s); + +/** + * feof() equivalent for AVIOContext. + * @return non zero if and only if end of file + */ +int avio_feof(AVIOContext *s); +#if FF_API_URL_FEOF +/** + * @deprecated use avio_feof() + */ +attribute_deprecated +int url_feof(AVIOContext *s); +#endif + +/** @warning Writes up to 4 KiB per call */ +int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3); + +/** + * Force flushing of buffered data. + * + * For write streams, force the buffered data to be immediately written to the output, + * without to wait to fill the internal buffer. + * + * For read streams, discard all currently buffered data, and advance the + * reported file position to that of the underlying stream. This does not + * read new data, and does not perform any seeks. + */ +void avio_flush(AVIOContext *s); + +/** + * Read size bytes from AVIOContext into buf. + * @return number of bytes read or AVERROR + */ +int avio_read(AVIOContext *s, unsigned char *buf, int size); + +/** + * @name Functions for reading from AVIOContext + * @{ + * + * @note return 0 if EOF, so you cannot use it if EOF handling is + * necessary + */ +int avio_r8 (AVIOContext *s); +unsigned int avio_rl16(AVIOContext *s); +unsigned int avio_rl24(AVIOContext *s); +unsigned int avio_rl32(AVIOContext *s); +uint64_t avio_rl64(AVIOContext *s); +unsigned int avio_rb16(AVIOContext *s); +unsigned int avio_rb24(AVIOContext *s); +unsigned int avio_rb32(AVIOContext *s); +uint64_t avio_rb64(AVIOContext *s); +/** + * @} + */ + +/** + * Read a string from pb into buf. The reading will terminate when either + * a NULL character was encountered, maxlen bytes have been read, or nothing + * more can be read from pb. The result is guaranteed to be NULL-terminated, it + * will be truncated if buf is too small. + * Note that the string is not interpreted or validated in any way, it + * might get truncated in the middle of a sequence for multi-byte encodings. + * + * @return number of bytes read (is always <= maxlen). + * If reading ends on EOF or error, the return value will be one more than + * bytes actually read. + */ +int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen); + +/** + * Read a UTF-16 string from pb and convert it to UTF-8. + * The reading will terminate when either a null or invalid character was + * encountered or maxlen bytes have been read. + * @return number of bytes read (is always <= maxlen) + */ +int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen); +int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen); + + +/** + * @name URL open modes + * The flags argument to avio_open must be one of the following + * constants, optionally ORed with other flags. + * @{ + */ +#define AVIO_FLAG_READ 1 /**< read-only */ +#define AVIO_FLAG_WRITE 2 /**< write-only */ +#define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE) /**< read-write pseudo flag */ +/** + * @} + */ + +/** + * Use non-blocking mode. + * If this flag is set, operations on the context will return + * AVERROR(EAGAIN) if they can not be performed immediately. + * If this flag is not set, operations on the context will never return + * AVERROR(EAGAIN). + * Note that this flag does not affect the opening/connecting of the + * context. Connecting a protocol will always block if necessary (e.g. on + * network protocols) but never hang (e.g. on busy devices). + * Warning: non-blocking protocols is work-in-progress; this flag may be + * silently ignored. + */ +#define AVIO_FLAG_NONBLOCK 8 + +/** + * Use direct mode. + * avio_read and avio_write should if possible be satisfied directly + * instead of going through a buffer, and avio_seek will always + * call the underlying seek function directly. + */ +#define AVIO_FLAG_DIRECT 0x8000 + +/** + * Create and initialize a AVIOContext for accessing the + * resource indicated by url. + * @note When the resource indicated by url has been opened in + * read+write mode, the AVIOContext can be used only for writing. + * + * @param s Used to return the pointer to the created AVIOContext. + * In case of failure the pointed to value is set to NULL. + * @param url resource to access + * @param flags flags which control how the resource indicated by url + * is to be opened + * @return >= 0 in case of success, a negative value corresponding to an + * AVERROR code in case of failure + */ +int avio_open(AVIOContext **s, const char *url, int flags); + +/** + * Create and initialize a AVIOContext for accessing the + * resource indicated by url. + * @note When the resource indicated by url has been opened in + * read+write mode, the AVIOContext can be used only for writing. + * + * @param s Used to return the pointer to the created AVIOContext. + * In case of failure the pointed to value is set to NULL. + * @param url resource to access + * @param flags flags which control how the resource indicated by url + * is to be opened + * @param int_cb an interrupt callback to be used at the protocols level + * @param options A dictionary filled with protocol-private options. On return + * this parameter will be destroyed and replaced with a dict containing options + * that were not found. May be NULL. + * @return >= 0 in case of success, a negative value corresponding to an + * AVERROR code in case of failure + */ +int avio_open2(AVIOContext **s, const char *url, int flags, + const AVIOInterruptCB *int_cb, AVDictionary **options); + +/** + * Close the resource accessed by the AVIOContext s and free it. + * This function can only be used if s was opened by avio_open(). + * + * The internal buffer is automatically flushed before closing the + * resource. + * + * @return 0 on success, an AVERROR < 0 on error. + * @see avio_closep + */ +int avio_close(AVIOContext *s); + +/** + * Close the resource accessed by the AVIOContext *s, free it + * and set the pointer pointing to it to NULL. + * This function can only be used if s was opened by avio_open(). + * + * The internal buffer is automatically flushed before closing the + * resource. + * + * @return 0 on success, an AVERROR < 0 on error. + * @see avio_close + */ +int avio_closep(AVIOContext **s); + + +/** + * Open a write only memory stream. + * + * @param s new IO context + * @return zero if no error. + */ +int avio_open_dyn_buf(AVIOContext **s); + +/** + * Return the written size and a pointer to the buffer. The buffer + * must be freed with av_free(). + * Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer. + * + * @param s IO context + * @param pbuffer pointer to a byte buffer + * @return the length of the byte buffer + */ +int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer); + +/** + * Iterate through names of available protocols. + * + * @param opaque A private pointer representing current protocol. + * It must be a pointer to NULL on first iteration and will + * be updated by successive calls to avio_enum_protocols. + * @param output If set to 1, iterate over output protocols, + * otherwise over input protocols. + * + * @return A static string containing the name of current protocol or NULL + */ +const char *avio_enum_protocols(void **opaque, int output); + +/** + * Pause and resume playing - only meaningful if using a network streaming + * protocol (e.g. MMS). + * + * @param h IO context from which to call the read_pause function pointer + * @param pause 1 for pause, 0 for resume + */ +int avio_pause(AVIOContext *h, int pause); + +/** + * Seek to a given timestamp relative to some component stream. + * Only meaningful if using a network streaming protocol (e.g. MMS.). + * + * @param h IO context from which to call the seek function pointers + * @param stream_index The stream index that the timestamp is relative to. + * If stream_index is (-1) the timestamp should be in AV_TIME_BASE + * units from the beginning of the presentation. + * If a stream_index >= 0 is used and the protocol does not support + * seeking based on component streams, the call will fail. + * @param timestamp timestamp in AVStream.time_base units + * or if there is no stream specified then in AV_TIME_BASE units. + * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE + * and AVSEEK_FLAG_ANY. The protocol may silently ignore + * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will + * fail if used and not supported. + * @return >= 0 on success + * @see AVInputFormat::read_seek + */ +int64_t avio_seek_time(AVIOContext *h, int stream_index, + int64_t timestamp, int flags); + +/* Avoid a warning. The header can not be included because it breaks c++. */ +struct AVBPrint; + +/** + * Read contents of h into print buffer, up to max_size bytes, or up to EOF. + * + * @return 0 for success (max_size bytes read or EOF reached), negative error + * code otherwise + */ +int avio_read_to_bprint(AVIOContext *h, struct AVBPrint *pb, size_t max_size); + +/** + * Accept and allocate a client context on a server context. + * @param s the server context + * @param c the client context, must be unallocated + * @return >= 0 on success or a negative value corresponding + * to an AVERROR on failure + */ +int avio_accept(AVIOContext *s, AVIOContext **c); + +/** + * Perform one step of the protocol handshake to accept a new client. + * This function must be called on a client returned by avio_accept() before + * using it as a read/write context. + * It is separate from avio_accept() because it may block. + * A step of the handshake is defined by places where the application may + * decide to change the proceedings. + * For example, on a protocol with a request header and a reply header, each + * one can constitute a step because the application may use the parameters + * from the request to change parameters in the reply; or each individual + * chunk of the request can constitute a step. + * If the handshake is already finished, avio_handshake() does nothing and + * returns 0 immediately. + * + * @param c the client context to perform the handshake on + * @return 0 on a complete and successful handshake + * > 0 if the handshake progressed, but is not complete + * < 0 for an AVERROR code + */ +int avio_handshake(AVIOContext *c); +#endif /* AVFORMAT_AVIO_H */ diff --git a/Src/Decoder_H264_ALL/include/libavformat/version.h b/Src/Decoder_H264_ALL/include/libavformat/version.h new file mode 100644 index 0000000..47a8afb --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavformat/version.h @@ -0,0 +1,86 @@ +/* + * Version macros. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFORMAT_VERSION_H +#define AVFORMAT_VERSION_H + +/** + * @file + * @ingroup libavf + * Libavformat version macros + */ + +#include "libavutil/version.h" + +// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium) +// Also please add any ticket numbers that you belive might be affected here +#define LIBAVFORMAT_VERSION_MAJOR 57 +#define LIBAVFORMAT_VERSION_MINOR 41 +#define LIBAVFORMAT_VERSION_MICRO 100 + +#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ + LIBAVFORMAT_VERSION_MINOR, \ + LIBAVFORMAT_VERSION_MICRO) +#define LIBAVFORMAT_VERSION AV_VERSION(LIBAVFORMAT_VERSION_MAJOR, \ + LIBAVFORMAT_VERSION_MINOR, \ + LIBAVFORMAT_VERSION_MICRO) +#define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT + +#define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION) + +/** + * FF_API_* defines may be placed below to indicate public API that will be + * dropped at a future version bump. The defines themselves are not part of + * the public API and may change, break or disappear at any time. + * + * @note, when bumping the major version it is recommended to manually + * disable each FF_API_* in its own commit instead of disabling them all + * at once through the bump. This improves the git bisect-ability of the change. + * + */ +#ifndef FF_API_LAVF_BITEXACT +#define FF_API_LAVF_BITEXACT (LIBAVFORMAT_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_LAVF_FRAC +#define FF_API_LAVF_FRAC (LIBAVFORMAT_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_LAVF_CODEC_TB +#define FF_API_LAVF_CODEC_TB (LIBAVFORMAT_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_URL_FEOF +#define FF_API_URL_FEOF (LIBAVFORMAT_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_LAVF_FMT_RAWPICTURE +#define FF_API_LAVF_FMT_RAWPICTURE (LIBAVFORMAT_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_COMPUTE_PKT_FIELDS2 +#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_OLD_OPEN_CALLBACKS +#define FF_API_OLD_OPEN_CALLBACKS (LIBAVFORMAT_VERSION_MAJOR < 58) +#endif +#ifndef FF_API_LAVF_AVCTX +#define FF_API_LAVF_AVCTX (LIBAVFORMAT_VERSION_MAJOR < 58) +#endif + +#ifndef FF_API_R_FRAME_RATE +#define FF_API_R_FRAME_RATE 1 +#endif +#endif /* AVFORMAT_VERSION_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/adler32.h b/Src/Decoder_H264_ALL/include/libavutil/adler32.h new file mode 100644 index 0000000..0dc69ec --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/adler32.h @@ -0,0 +1,55 @@ +/* + * copyright (c) 2006 Mans Rullgard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_ADLER32_H +#define AVUTIL_ADLER32_H + +#include +#include "attributes.h" + +/** + * @file + * Public header for libavutil Adler32 hasher + * + * @defgroup lavu_adler32 Adler32 + * @ingroup lavu_crypto + * @{ + */ + +/** + * Calculate the Adler32 checksum of a buffer. + * + * Passing the return value to a subsequent av_adler32_update() call + * allows the checksum of multiple buffers to be calculated as though + * they were concatenated. + * + * @param adler initial checksum value + * @param buf pointer to input buffer + * @param len size of input buffer + * @return updated checksum + */ +unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, + unsigned int len) av_pure; + +/** + * @} + */ + +#endif /* AVUTIL_ADLER32_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/aes.h b/Src/Decoder_H264_ALL/include/libavutil/aes.h new file mode 100644 index 0000000..09efbda --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/aes.h @@ -0,0 +1,65 @@ +/* + * copyright (c) 2007 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_AES_H +#define AVUTIL_AES_H + +#include + +#include "attributes.h" +#include "version.h" + +/** + * @defgroup lavu_aes AES + * @ingroup lavu_crypto + * @{ + */ + +extern const int av_aes_size; + +struct AVAES; + +/** + * Allocate an AVAES context. + */ +struct AVAES *av_aes_alloc(void); + +/** + * Initialize an AVAES context. + * @param key_bits 128, 192 or 256 + * @param decrypt 0 for encryption, 1 for decryption + */ +int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt); + +/** + * Encrypt or decrypt a buffer using a previously initialized context. + * @param count number of 16 byte blocks + * @param dst destination array, can be equal to src + * @param src source array, can be equal to dst + * @param iv initialization vector for CBC mode, if NULL then ECB will be used + * @param decrypt 0 for encryption, 1 for decryption + */ +void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); + +/** + * @} + */ + +#endif /* AVUTIL_AES_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/aes_ctr.h b/Src/Decoder_H264_ALL/include/libavutil/aes_ctr.h new file mode 100644 index 0000000..f596fa6 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/aes_ctr.h @@ -0,0 +1,83 @@ +/* + * AES-CTR cipher + * Copyright (c) 2015 Eran Kornblau + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_AES_CTR_H +#define AVUTIL_AES_CTR_H + +#include + +#include "attributes.h" +#include "version.h" + +#define AES_CTR_KEY_SIZE (16) +#define AES_CTR_IV_SIZE (8) + +struct AVAESCTR; + +/** + * Allocate an AVAESCTR context. + */ +struct AVAESCTR *av_aes_ctr_alloc(void); + +/** + * Initialize an AVAESCTR context. + * @param key encryption key, must have a length of AES_CTR_KEY_SIZE + */ +int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key); + +/** + * Release an AVAESCTR context. + */ +void av_aes_ctr_free(struct AVAESCTR *a); + +/** + * Process a buffer using a previously initialized context. + * @param dst destination array, can be equal to src + * @param src source array, can be equal to dst + * @param size the size of src and dst + */ +void av_aes_ctr_crypt(struct AVAESCTR *a, uint8_t *dst, const uint8_t *src, int size); + +/** + * Get the current iv + */ +const uint8_t* av_aes_ctr_get_iv(struct AVAESCTR *a); + +/** + * Generate a random iv + */ +void av_aes_ctr_set_random_iv(struct AVAESCTR *a); + +/** + * Forcefully change the iv + */ +void av_aes_ctr_set_iv(struct AVAESCTR *a, const uint8_t* iv); + +/** + * Increment the top 64 bit of the iv (performed after each frame) + */ +void av_aes_ctr_increment_iv(struct AVAESCTR *a); + +/** + * @} + */ + +#endif /* AVUTIL_AES_CTR_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/attributes.h b/Src/Decoder_H264_ALL/include/libavutil/attributes.h new file mode 100644 index 0000000..5c6b9de --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/attributes.h @@ -0,0 +1,168 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Macro definitions for various function/variable attributes + */ + +#ifndef AVUTIL_ATTRIBUTES_H +#define AVUTIL_ATTRIBUTES_H + +#ifdef __GNUC__ +# define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y)) +# define AV_GCC_VERSION_AT_MOST(x,y) (__GNUC__ < (x) || __GNUC__ == (x) && __GNUC_MINOR__ <= (y)) +#else +# define AV_GCC_VERSION_AT_LEAST(x,y) 0 +# define AV_GCC_VERSION_AT_MOST(x,y) 0 +#endif + +#ifndef av_always_inline +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define av_always_inline __attribute__((always_inline)) inline +#elif defined(_MSC_VER) +# define av_always_inline __forceinline +#else +# define av_always_inline inline +#endif +#endif + +#ifndef av_extern_inline +#if defined(__ICL) && __ICL >= 1210 || defined(__GNUC_STDC_INLINE__) +# define av_extern_inline extern inline +#else +# define av_extern_inline inline +#endif +#endif + +#if AV_GCC_VERSION_AT_LEAST(3,4) +# define av_warn_unused_result __attribute__((warn_unused_result)) +#else +# define av_warn_unused_result +#endif + +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define av_noinline __attribute__((noinline)) +#elif defined(_MSC_VER) +# define av_noinline __declspec(noinline) +#else +# define av_noinline +#endif + +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define av_pure __attribute__((pure)) +#else +# define av_pure +#endif + +#if AV_GCC_VERSION_AT_LEAST(2,6) +# define av_const __attribute__((const)) +#else +# define av_const +#endif + +#if AV_GCC_VERSION_AT_LEAST(4,3) +# define av_cold __attribute__((cold)) +#else +# define av_cold +#endif + +#if AV_GCC_VERSION_AT_LEAST(4,1) && !defined(__llvm__) +# define av_flatten __attribute__((flatten)) +#else +# define av_flatten +#endif + +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define attribute_deprecated __attribute__((deprecated)) +#elif defined(_MSC_VER) +# define attribute_deprecated __declspec(deprecated) +#else +# define attribute_deprecated +#endif + +/** + * Disable warnings about deprecated features + * This is useful for sections of code kept for backward compatibility and + * scheduled for removal. + */ +#ifndef AV_NOWARN_DEPRECATED +#if AV_GCC_VERSION_AT_LEAST(4,6) +# define AV_NOWARN_DEPRECATED(code) \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \ + code \ + _Pragma("GCC diagnostic pop") +#elif defined(_MSC_VER) +# define AV_NOWARN_DEPRECATED(code) \ + __pragma(warning(push)) \ + __pragma(warning(disable : 4996)) \ + code; \ + __pragma(warning(pop)) +#else +# define AV_NOWARN_DEPRECATED(code) code +#endif +#endif + + +#if defined(__GNUC__) +# define av_unused __attribute__((unused)) +#else +# define av_unused +#endif + +/** + * Mark a variable as used and prevent the compiler from optimizing it + * away. This is useful for variables accessed only from inline + * assembler without the compiler being aware. + */ +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define av_used __attribute__((used)) +#else +# define av_used +#endif + +#if AV_GCC_VERSION_AT_LEAST(3,3) +# define av_alias __attribute__((may_alias)) +#else +# define av_alias +#endif + +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__) +# define av_uninit(x) x=x +#else +# define av_uninit(x) x +#endif + +#ifdef __GNUC__ +# define av_builtin_constant_p __builtin_constant_p +# define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos))) +#else +# define av_builtin_constant_p(x) 0 +# define av_printf_format(fmtpos, attrpos) +#endif + +#if AV_GCC_VERSION_AT_LEAST(2,5) +# define av_noreturn __attribute__((noreturn)) +#else +# define av_noreturn +#endif + +#endif /* AVUTIL_ATTRIBUTES_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/audio_fifo.h b/Src/Decoder_H264_ALL/include/libavutil/audio_fifo.h new file mode 100644 index 0000000..d8a9194 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/audio_fifo.h @@ -0,0 +1,187 @@ +/* + * Audio FIFO + * Copyright (c) 2012 Justin Ruggles + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Audio FIFO Buffer + */ + +#ifndef AVUTIL_AUDIO_FIFO_H +#define AVUTIL_AUDIO_FIFO_H + +#include "avutil.h" +#include "fifo.h" +#include "samplefmt.h" + +/** + * @addtogroup lavu_audio + * @{ + * + * @defgroup lavu_audiofifo Audio FIFO Buffer + * @{ + */ + +/** + * Context for an Audio FIFO Buffer. + * + * - Operates at the sample level rather than the byte level. + * - Supports multiple channels with either planar or packed sample format. + * - Automatic reallocation when writing to a full buffer. + */ +typedef struct AVAudioFifo AVAudioFifo; + +/** + * Free an AVAudioFifo. + * + * @param af AVAudioFifo to free + */ +void av_audio_fifo_free(AVAudioFifo *af); + +/** + * Allocate an AVAudioFifo. + * + * @param sample_fmt sample format + * @param channels number of channels + * @param nb_samples initial allocation size, in samples + * @return newly allocated AVAudioFifo, or NULL on error + */ +AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels, + int nb_samples); + +/** + * Reallocate an AVAudioFifo. + * + * @param af AVAudioFifo to reallocate + * @param nb_samples new allocation size, in samples + * @return 0 if OK, or negative AVERROR code on failure + */ +av_warn_unused_result +int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples); + +/** + * Write data to an AVAudioFifo. + * + * The AVAudioFifo will be reallocated automatically if the available space + * is less than nb_samples. + * + * @see enum AVSampleFormat + * The documentation for AVSampleFormat describes the data layout. + * + * @param af AVAudioFifo to write to + * @param data audio data plane pointers + * @param nb_samples number of samples to write + * @return number of samples actually written, or negative AVERROR + * code on failure. If successful, the number of samples + * actually written will always be nb_samples. + */ +int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples); + +/** + * Peek data from an AVAudioFifo. + * + * @see enum AVSampleFormat + * The documentation for AVSampleFormat describes the data layout. + * + * @param af AVAudioFifo to read from + * @param data audio data plane pointers + * @param nb_samples number of samples to peek + * @return number of samples actually peek, or negative AVERROR code + * on failure. The number of samples actually peek will not + * be greater than nb_samples, and will only be less than + * nb_samples if av_audio_fifo_size is less than nb_samples. + */ +int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples); + +/** + * Peek data from an AVAudioFifo. + * + * @see enum AVSampleFormat + * The documentation for AVSampleFormat describes the data layout. + * + * @param af AVAudioFifo to read from + * @param data audio data plane pointers + * @param nb_samples number of samples to peek + * @param offset offset from current read position + * @return number of samples actually peek, or negative AVERROR code + * on failure. The number of samples actually peek will not + * be greater than nb_samples, and will only be less than + * nb_samples if av_audio_fifo_size is less than nb_samples. + */ +int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset); + +/** + * Read data from an AVAudioFifo. + * + * @see enum AVSampleFormat + * The documentation for AVSampleFormat describes the data layout. + * + * @param af AVAudioFifo to read from + * @param data audio data plane pointers + * @param nb_samples number of samples to read + * @return number of samples actually read, or negative AVERROR code + * on failure. The number of samples actually read will not + * be greater than nb_samples, and will only be less than + * nb_samples if av_audio_fifo_size is less than nb_samples. + */ +int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples); + +/** + * Drain data from an AVAudioFifo. + * + * Removes the data without reading it. + * + * @param af AVAudioFifo to drain + * @param nb_samples number of samples to drain + * @return 0 if OK, or negative AVERROR code on failure + */ +int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples); + +/** + * Reset the AVAudioFifo buffer. + * + * This empties all data in the buffer. + * + * @param af AVAudioFifo to reset + */ +void av_audio_fifo_reset(AVAudioFifo *af); + +/** + * Get the current number of samples in the AVAudioFifo available for reading. + * + * @param af the AVAudioFifo to query + * @return number of samples available for reading + */ +int av_audio_fifo_size(AVAudioFifo *af); + +/** + * Get the current number of samples in the AVAudioFifo available for writing. + * + * @param af the AVAudioFifo to query + * @return number of samples available for writing + */ +int av_audio_fifo_space(AVAudioFifo *af); + +/** + * @} + * @} + */ + +#endif /* AVUTIL_AUDIO_FIFO_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/avassert.h b/Src/Decoder_H264_ALL/include/libavutil/avassert.h new file mode 100644 index 0000000..f473637 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/avassert.h @@ -0,0 +1,66 @@ +/* + * copyright (c) 2010 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * simple assert() macros that are a bit more flexible than ISO C assert(). + * @author Michael Niedermayer + */ + +#ifndef AVUTIL_AVASSERT_H +#define AVUTIL_AVASSERT_H + +#include +#include "avutil.h" +#include "log.h" + +/** + * assert() equivalent, that is always enabled. + */ +#define av_assert0(cond) do { \ + if (!(cond)) { \ + av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \ + AV_STRINGIFY(cond), __FILE__, __LINE__); \ + abort(); \ + } \ +} while (0) + + +/** + * assert() equivalent, that does not lie in speed critical code. + * These asserts() thus can be enabled without fearing speed loss. + */ +#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0 +#define av_assert1(cond) av_assert0(cond) +#else +#define av_assert1(cond) ((void)0) +#endif + + +/** + * assert() equivalent, that does lie in speed critical code. + */ +#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1 +#define av_assert2(cond) av_assert0(cond) +#else +#define av_assert2(cond) ((void)0) +#endif + +#endif /* AVUTIL_AVASSERT_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/avconfig.h b/Src/Decoder_H264_ALL/include/libavutil/avconfig.h new file mode 100644 index 0000000..36a8cd1 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/avconfig.h @@ -0,0 +1,7 @@ +/* Generated by ffconf */ +#ifndef AVUTIL_AVCONFIG_H +#define AVUTIL_AVCONFIG_H +#define AV_HAVE_BIGENDIAN 0 +#define AV_HAVE_FAST_UNALIGNED 1 +#define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0 +#endif /* AVUTIL_AVCONFIG_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/avstring.h b/Src/Decoder_H264_ALL/include/libavutil/avstring.h new file mode 100644 index 0000000..dd28769 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/avstring.h @@ -0,0 +1,402 @@ +/* + * Copyright (c) 2007 Mans Rullgard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_AVSTRING_H +#define AVUTIL_AVSTRING_H + +#include +#include +#include "attributes.h" + +/** + * @addtogroup lavu_string + * @{ + */ + +/** + * Return non-zero if pfx is a prefix of str. If it is, *ptr is set to + * the address of the first character in str after the prefix. + * + * @param str input string + * @param pfx prefix to test + * @param ptr updated if the prefix is matched inside str + * @return non-zero if the prefix matches, zero otherwise + */ +int av_strstart(const char *str, const char *pfx, const char **ptr); + +/** + * Return non-zero if pfx is a prefix of str independent of case. If + * it is, *ptr is set to the address of the first character in str + * after the prefix. + * + * @param str input string + * @param pfx prefix to test + * @param ptr updated if the prefix is matched inside str + * @return non-zero if the prefix matches, zero otherwise + */ +int av_stristart(const char *str, const char *pfx, const char **ptr); + +/** + * Locate the first case-independent occurrence in the string haystack + * of the string needle. A zero-length string needle is considered to + * match at the start of haystack. + * + * This function is a case-insensitive version of the standard strstr(). + * + * @param haystack string to search in + * @param needle string to search for + * @return pointer to the located match within haystack + * or a null pointer if no match + */ +char *av_stristr(const char *haystack, const char *needle); + +/** + * Locate the first occurrence of the string needle in the string haystack + * where not more than hay_length characters are searched. A zero-length + * string needle is considered to match at the start of haystack. + * + * This function is a length-limited version of the standard strstr(). + * + * @param haystack string to search in + * @param needle string to search for + * @param hay_length length of string to search in + * @return pointer to the located match within haystack + * or a null pointer if no match + */ +char *av_strnstr(const char *haystack, const char *needle, size_t hay_length); + +/** + * Copy the string src to dst, but no more than size - 1 bytes, and + * null-terminate dst. + * + * This function is the same as BSD strlcpy(). + * + * @param dst destination buffer + * @param src source string + * @param size size of destination buffer + * @return the length of src + * + * @warning since the return value is the length of src, src absolutely + * _must_ be a properly 0-terminated string, otherwise this will read beyond + * the end of the buffer and possibly crash. + */ +size_t av_strlcpy(char *dst, const char *src, size_t size); + +/** + * Append the string src to the string dst, but to a total length of + * no more than size - 1 bytes, and null-terminate dst. + * + * This function is similar to BSD strlcat(), but differs when + * size <= strlen(dst). + * + * @param dst destination buffer + * @param src source string + * @param size size of destination buffer + * @return the total length of src and dst + * + * @warning since the return value use the length of src and dst, these + * absolutely _must_ be a properly 0-terminated strings, otherwise this + * will read beyond the end of the buffer and possibly crash. + */ +size_t av_strlcat(char *dst, const char *src, size_t size); + +/** + * Append output to a string, according to a format. Never write out of + * the destination buffer, and always put a terminating 0 within + * the buffer. + * @param dst destination buffer (string to which the output is + * appended) + * @param size total size of the destination buffer + * @param fmt printf-compatible format string, specifying how the + * following parameters are used + * @return the length of the string that would have been generated + * if enough space had been available + */ +size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_format(3, 4); + +/** + * Get the count of continuous non zero chars starting from the beginning. + * + * @param len maximum number of characters to check in the string, that + * is the maximum value which is returned by the function + */ +static inline size_t av_strnlen(const char *s, size_t len) +{ + size_t i; + for (i = 0; i < len && s[i]; i++) + ; + return i; +} + +/** + * Print arguments following specified format into a large enough auto + * allocated buffer. It is similar to GNU asprintf(). + * @param fmt printf-compatible format string, specifying how the + * following parameters are used. + * @return the allocated string + * @note You have to free the string yourself with av_free(). + */ +char *av_asprintf(const char *fmt, ...) av_printf_format(1, 2); + +/** + * Convert a number to an av_malloced string. + */ +char *av_d2str(double d); + +/** + * Unescape the given string until a non escaped terminating char, + * and return the token corresponding to the unescaped string. + * + * The normal \ and ' escaping is supported. Leading and trailing + * whitespaces are removed, unless they are escaped with '\' or are + * enclosed between ''. + * + * @param buf the buffer to parse, buf will be updated to point to the + * terminating char + * @param term a 0-terminated list of terminating chars + * @return the malloced unescaped string, which must be av_freed by + * the user, NULL in case of allocation failure + */ +char *av_get_token(const char **buf, const char *term); + +/** + * Split the string into several tokens which can be accessed by + * successive calls to av_strtok(). + * + * A token is defined as a sequence of characters not belonging to the + * set specified in delim. + * + * On the first call to av_strtok(), s should point to the string to + * parse, and the value of saveptr is ignored. In subsequent calls, s + * should be NULL, and saveptr should be unchanged since the previous + * call. + * + * This function is similar to strtok_r() defined in POSIX.1. + * + * @param s the string to parse, may be NULL + * @param delim 0-terminated list of token delimiters, must be non-NULL + * @param saveptr user-provided pointer which points to stored + * information necessary for av_strtok() to continue scanning the same + * string. saveptr is updated to point to the next character after the + * first delimiter found, or to NULL if the string was terminated + * @return the found token, or NULL when no token is found + */ +char *av_strtok(char *s, const char *delim, char **saveptr); + +/** + * Locale-independent conversion of ASCII isdigit. + */ +static inline av_const int av_isdigit(int c) +{ + return c >= '0' && c <= '9'; +} + +/** + * Locale-independent conversion of ASCII isgraph. + */ +static inline av_const int av_isgraph(int c) +{ + return c > 32 && c < 127; +} + +/** + * Locale-independent conversion of ASCII isspace. + */ +static inline av_const int av_isspace(int c) +{ + return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || + c == '\v'; +} + +/** + * Locale-independent conversion of ASCII characters to uppercase. + */ +static inline av_const int av_toupper(int c) +{ + if (c >= 'a' && c <= 'z') + c ^= 0x20; + return c; +} + +/** + * Locale-independent conversion of ASCII characters to lowercase. + */ +static inline av_const int av_tolower(int c) +{ + if (c >= 'A' && c <= 'Z') + c ^= 0x20; + return c; +} + +/** + * Locale-independent conversion of ASCII isxdigit. + */ +static inline av_const int av_isxdigit(int c) +{ + c = av_tolower(c); + return av_isdigit(c) || (c >= 'a' && c <= 'f'); +} + +/** + * Locale-independent case-insensitive compare. + * @note This means only ASCII-range characters are case-insensitive + */ +int av_strcasecmp(const char *a, const char *b); + +/** + * Locale-independent case-insensitive compare. + * @note This means only ASCII-range characters are case-insensitive + */ +int av_strncasecmp(const char *a, const char *b, size_t n); + + +/** + * Thread safe basename. + * @param path the path, on DOS both \ and / are considered separators. + * @return pointer to the basename substring. + */ +const char *av_basename(const char *path); + +/** + * Thread safe dirname. + * @param path the path, on DOS both \ and / are considered separators. + * @return the path with the separator replaced by the string terminator or ".". + * @note the function may change the input string. + */ +const char *av_dirname(char *path); + +/** + * Match instances of a name in a comma-separated list of names. + * List entries are checked from the start to the end of the names list, + * the first match ends further processing. If an entry prefixed with '-' + * matches, then 0 is returned. The "ALL" list entry is considered to + * match all names. + * + * @param name Name to look for. + * @param names List of names. + * @return 1 on match, 0 otherwise. + */ +int av_match_name(const char *name, const char *names); + +/** + * Append path component to the existing path. + * Path separator '/' is placed between when needed. + * Resulting string have to be freed with av_free(). + * @param path base path + * @param component component to be appended + * @return new path or NULL on error. + */ +char *av_append_path_component(const char *path, const char *component); + +enum AVEscapeMode { + AV_ESCAPE_MODE_AUTO, ///< Use auto-selected escaping mode. + AV_ESCAPE_MODE_BACKSLASH, ///< Use backslash escaping. + AV_ESCAPE_MODE_QUOTE, ///< Use single-quote escaping. +}; + +/** + * Consider spaces special and escape them even in the middle of the + * string. + * + * This is equivalent to adding the whitespace characters to the special + * characters lists, except it is guaranteed to use the exact same list + * of whitespace characters as the rest of libavutil. + */ +#define AV_ESCAPE_FLAG_WHITESPACE (1 << 0) + +/** + * Escape only specified special characters. + * Without this flag, escape also any characters that may be considered + * special by av_get_token(), such as the single quote. + */ +#define AV_ESCAPE_FLAG_STRICT (1 << 1) + +/** + * Escape string in src, and put the escaped string in an allocated + * string in *dst, which must be freed with av_free(). + * + * @param dst pointer where an allocated string is put + * @param src string to escape, must be non-NULL + * @param special_chars string containing the special characters which + * need to be escaped, can be NULL + * @param mode escape mode to employ, see AV_ESCAPE_MODE_* macros. + * Any unknown value for mode will be considered equivalent to + * AV_ESCAPE_MODE_BACKSLASH, but this behaviour can change without + * notice. + * @param flags flags which control how to escape, see AV_ESCAPE_FLAG_ macros + * @return the length of the allocated string, or a negative error code in case of error + * @see av_bprint_escape() + */ +av_warn_unused_result +int av_escape(char **dst, const char *src, const char *special_chars, + enum AVEscapeMode mode, int flags); + +#define AV_UTF8_FLAG_ACCEPT_INVALID_BIG_CODES 1 ///< accept codepoints over 0x10FFFF +#define AV_UTF8_FLAG_ACCEPT_NON_CHARACTERS 2 ///< accept non-characters - 0xFFFE and 0xFFFF +#define AV_UTF8_FLAG_ACCEPT_SURROGATES 4 ///< accept UTF-16 surrogates codes +#define AV_UTF8_FLAG_EXCLUDE_XML_INVALID_CONTROL_CODES 8 ///< exclude control codes not accepted by XML + +#define AV_UTF8_FLAG_ACCEPT_ALL \ + AV_UTF8_FLAG_ACCEPT_INVALID_BIG_CODES|AV_UTF8_FLAG_ACCEPT_NON_CHARACTERS|AV_UTF8_FLAG_ACCEPT_SURROGATES + +/** + * Read and decode a single UTF-8 code point (character) from the + * buffer in *buf, and update *buf to point to the next byte to + * decode. + * + * In case of an invalid byte sequence, the pointer will be updated to + * the next byte after the invalid sequence and the function will + * return an error code. + * + * Depending on the specified flags, the function will also fail in + * case the decoded code point does not belong to a valid range. + * + * @note For speed-relevant code a carefully implemented use of + * GET_UTF8() may be preferred. + * + * @param codep pointer used to return the parsed code in case of success. + * The value in *codep is set even in case the range check fails. + * @param bufp pointer to the address the first byte of the sequence + * to decode, updated by the function to point to the + * byte next after the decoded sequence + * @param buf_end pointer to the end of the buffer, points to the next + * byte past the last in the buffer. This is used to + * avoid buffer overreads (in case of an unfinished + * UTF-8 sequence towards the end of the buffer). + * @param flags a collection of AV_UTF8_FLAG_* flags + * @return >= 0 in case a sequence was successfully read, a negative + * value in case of invalid sequence + */ +av_warn_unused_result +int av_utf8_decode(int32_t *codep, const uint8_t **bufp, const uint8_t *buf_end, + unsigned int flags); + +/** + * Check if a name is in a list. + * @returns 0 if not found, or the 1 based index where it has been found in the + * list. + */ +int av_match_list(const char *name, const char *list, char separator); + +/** + * @} + */ + +#endif /* AVUTIL_AVSTRING_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/avutil.h b/Src/Decoder_H264_ALL/include/libavutil/avutil.h new file mode 100644 index 0000000..c1f76c1 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/avutil.h @@ -0,0 +1,343 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_AVUTIL_H +#define AVUTIL_AVUTIL_H + +/** + * @file + * external API header + */ + +/** + * @mainpage + * + * @section ffmpeg_intro Introduction + * + * This document describes the usage of the different libraries + * provided by FFmpeg. + * + * @li @ref libavc "libavcodec" encoding/decoding library + * @li @ref lavfi "libavfilter" graph-based frame editing library + * @li @ref libavf "libavformat" I/O and muxing/demuxing library + * @li @ref lavd "libavdevice" special devices muxing/demuxing library + * @li @ref lavu "libavutil" common utility library + * @li @ref lswr "libswresample" audio resampling, format conversion and mixing + * @li @ref lpp "libpostproc" post processing library + * @li @ref libsws "libswscale" color conversion and scaling library + * + * @section ffmpeg_versioning Versioning and compatibility + * + * Each of the FFmpeg libraries contains a version.h header, which defines a + * major, minor and micro version number with the + * LIBRARYNAME_VERSION_{MAJOR,MINOR,MICRO} macros. The major version + * number is incremented with backward incompatible changes - e.g. removing + * parts of the public API, reordering public struct members, etc. The minor + * version number is incremented for backward compatible API changes or major + * new features - e.g. adding a new public function or a new decoder. The micro + * version number is incremented for smaller changes that a calling program + * might still want to check for - e.g. changing behavior in a previously + * unspecified situation. + * + * FFmpeg guarantees backward API and ABI compatibility for each library as long + * as its major version number is unchanged. This means that no public symbols + * will be removed or renamed. Types and names of the public struct members and + * values of public macros and enums will remain the same (unless they were + * explicitly declared as not part of the public API). Documented behavior will + * not change. + * + * In other words, any correct program that works with a given FFmpeg snapshot + * should work just as well without any changes with any later snapshot with the + * same major versions. This applies to both rebuilding the program against new + * FFmpeg versions or to replacing the dynamic FFmpeg libraries that a program + * links against. + * + * However, new public symbols may be added and new members may be appended to + * public structs whose size is not part of public ABI (most public structs in + * FFmpeg). New macros and enum values may be added. Behavior in undocumented + * situations may change slightly (and be documented). All those are accompanied + * by an entry in doc/APIchanges and incrementing either the minor or micro + * version number. + */ + +/** + * @defgroup lavu Common utility functions + * + * @brief + * libavutil contains the code shared across all the other FFmpeg + * libraries + * + * @note In order to use the functions provided by avutil you must include + * the specific header. + * + * @{ + * + * @defgroup lavu_crypto Crypto and Hashing + * + * @{ + * @} + * + * @defgroup lavu_math Maths + * @{ + * + * @} + * + * @defgroup lavu_string String Manipulation + * + * @{ + * + * @} + * + * @defgroup lavu_mem Memory Management + * + * @{ + * + * @} + * + * @defgroup lavu_data Data Structures + * @{ + * + * @} + * + * @defgroup lavu_audio Audio related + * + * @{ + * + * @} + * + * @defgroup lavu_error Error Codes + * + * @{ + * + * @} + * + * @defgroup lavu_log Logging Facility + * + * @{ + * + * @} + * + * @defgroup lavu_misc Other + * + * @{ + * + * @defgroup preproc_misc Preprocessor String Macros + * + * @{ + * + * @} + * + * @defgroup version_utils Library Version Macros + * + * @{ + * + * @} + */ + + +/** + * @addtogroup lavu_ver + * @{ + */ + +/** + * Return the LIBAVUTIL_VERSION_INT constant. + */ +unsigned avutil_version(void); + +/** + * Return an informative version string. This usually is the actual release + * version number or a git commit description. This string has no fixed format + * and can change any time. It should never be parsed by code. + */ +const char *av_version_info(void); + +/** + * Return the libavutil build-time configuration. + */ +const char *avutil_configuration(void); + +/** + * Return the libavutil license. + */ +const char *avutil_license(void); + +/** + * @} + */ + +/** + * @addtogroup lavu_media Media Type + * @brief Media Type + */ + +enum AVMediaType { + AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA + AVMEDIA_TYPE_VIDEO, + AVMEDIA_TYPE_AUDIO, + AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous + AVMEDIA_TYPE_SUBTITLE, + AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse + AVMEDIA_TYPE_NB +}; + +/** + * Return a string describing the media_type enum, NULL if media_type + * is unknown. + */ +const char *av_get_media_type_string(enum AVMediaType media_type); + +/** + * @defgroup lavu_const Constants + * @{ + * + * @defgroup lavu_enc Encoding specific + * + * @note those definition should move to avcodec + * @{ + */ + +#define FF_LAMBDA_SHIFT 7 +#define FF_LAMBDA_SCALE (1< + +/** + * @defgroup lavu_base64 Base64 + * @ingroup lavu_crypto + * @{ + */ + +/** + * Decode a base64-encoded string. + * + * @param out buffer for decoded data + * @param in null-terminated input string + * @param out_size size in bytes of the out buffer, must be at + * least 3/4 of the length of in, that is AV_BASE64_DECODE_SIZE(strlen(in)) + * @return number of bytes written, or a negative value in case of + * invalid input + */ +int av_base64_decode(uint8_t *out, const char *in, int out_size); + +/** + * Calculate the output size in bytes needed to decode a base64 string + * with length x to a data buffer. + */ +#define AV_BASE64_DECODE_SIZE(x) ((x) * 3LL / 4) + +/** + * Encode data to base64 and null-terminate. + * + * @param out buffer for encoded data + * @param out_size size in bytes of the out buffer (including the + * null terminator), must be at least AV_BASE64_SIZE(in_size) + * @param in input buffer containing the data to encode + * @param in_size size in bytes of the in buffer + * @return out or NULL in case of error + */ +char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size); + +/** + * Calculate the output size needed to base64-encode x bytes to a + * null-terminated string. + */ +#define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1) + + /** + * @} + */ + +#endif /* AVUTIL_BASE64_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/blowfish.h b/Src/Decoder_H264_ALL/include/libavutil/blowfish.h new file mode 100644 index 0000000..9e289a4 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/blowfish.h @@ -0,0 +1,82 @@ +/* + * Blowfish algorithm + * Copyright (c) 2012 Samuel Pitoiset + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_BLOWFISH_H +#define AVUTIL_BLOWFISH_H + +#include + +/** + * @defgroup lavu_blowfish Blowfish + * @ingroup lavu_crypto + * @{ + */ + +#define AV_BF_ROUNDS 16 + +typedef struct AVBlowfish { + uint32_t p[AV_BF_ROUNDS + 2]; + uint32_t s[4][256]; +} AVBlowfish; + +/** + * Allocate an AVBlowfish context. + */ +AVBlowfish *av_blowfish_alloc(void); + +/** + * Initialize an AVBlowfish context. + * + * @param ctx an AVBlowfish context + * @param key a key + * @param key_len length of the key + */ +void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len); + +/** + * Encrypt or decrypt a buffer using a previously initialized context. + * + * @param ctx an AVBlowfish context + * @param xl left four bytes halves of input to be encrypted + * @param xr right four bytes halves of input to be encrypted + * @param decrypt 0 for encryption, 1 for decryption + */ +void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr, + int decrypt); + +/** + * Encrypt or decrypt a buffer using a previously initialized context. + * + * @param ctx an AVBlowfish context + * @param dst destination array, can be equal to src + * @param src source array, can be equal to dst + * @param count number of 8 byte blocks + * @param iv initialization vector for CBC mode, if NULL ECB will be used + * @param decrypt 0 for encryption, 1 for decryption + */ +void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src, + int count, uint8_t *iv, int decrypt); + +/** + * @} + */ + +#endif /* AVUTIL_BLOWFISH_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/bprint.h b/Src/Decoder_H264_ALL/include/libavutil/bprint.h new file mode 100644 index 0000000..c09b1ac --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/bprint.h @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2012 Nicolas George + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_BPRINT_H +#define AVUTIL_BPRINT_H + +#include + +#include "attributes.h" +#include "avstring.h" + +/** + * Define a structure with extra padding to a fixed size + * This helps ensuring binary compatibility with future versions. + */ + +#define FF_PAD_STRUCTURE(name, size, ...) \ +struct ff_pad_helper_##name { __VA_ARGS__ }; \ +typedef struct name { \ + __VA_ARGS__ \ + char reserved_padding[size - sizeof(struct ff_pad_helper_##name)]; \ +} name; + +/** + * Buffer to print data progressively + * + * The string buffer grows as necessary and is always 0-terminated. + * The content of the string is never accessed, and thus is + * encoding-agnostic and can even hold binary data. + * + * Small buffers are kept in the structure itself, and thus require no + * memory allocation at all (unless the contents of the buffer is needed + * after the structure goes out of scope). This is almost as lightweight as + * declaring a local "char buf[512]". + * + * The length of the string can go beyond the allocated size: the buffer is + * then truncated, but the functions still keep account of the actual total + * length. + * + * In other words, buf->len can be greater than buf->size and records the + * total length of what would have been to the buffer if there had been + * enough memory. + * + * Append operations do not need to be tested for failure: if a memory + * allocation fails, data stop being appended to the buffer, but the length + * is still updated. This situation can be tested with + * av_bprint_is_complete(). + * + * The size_max field determines several possible behaviours: + * + * size_max = -1 (= UINT_MAX) or any large value will let the buffer be + * reallocated as necessary, with an amortized linear cost. + * + * size_max = 0 prevents writing anything to the buffer: only the total + * length is computed. The write operations can then possibly be repeated in + * a buffer with exactly the necessary size + * (using size_init = size_max = len + 1). + * + * size_max = 1 is automatically replaced by the exact size available in the + * structure itself, thus ensuring no dynamic memory allocation. The + * internal buffer is large enough to hold a reasonable paragraph of text, + * such as the current paragraph. + */ + +FF_PAD_STRUCTURE(AVBPrint, 1024, + char *str; /**< string so far */ + unsigned len; /**< length so far */ + unsigned size; /**< allocated memory */ + unsigned size_max; /**< maximum allocated memory */ + char reserved_internal_buffer[1]; +) + +/** + * Convenience macros for special values for av_bprint_init() size_max + * parameter. + */ +#define AV_BPRINT_SIZE_UNLIMITED ((unsigned)-1) +#define AV_BPRINT_SIZE_AUTOMATIC 1 +#define AV_BPRINT_SIZE_COUNT_ONLY 0 + +/** + * Init a print buffer. + * + * @param buf buffer to init + * @param size_init initial size (including the final 0) + * @param size_max maximum size; + * 0 means do not write anything, just count the length; + * 1 is replaced by the maximum value for automatic storage; + * any large value means that the internal buffer will be + * reallocated as needed up to that limit; -1 is converted to + * UINT_MAX, the largest limit possible. + * Check also AV_BPRINT_SIZE_* macros. + */ +void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max); + +/** + * Init a print buffer using a pre-existing buffer. + * + * The buffer will not be reallocated. + * + * @param buf buffer structure to init + * @param buffer byte buffer to use for the string data + * @param size size of buffer + */ +void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size); + +/** + * Append a formatted string to a print buffer. + */ +void av_bprintf(AVBPrint *buf, const char *fmt, ...) av_printf_format(2, 3); + +/** + * Append a formatted string to a print buffer. + */ +void av_vbprintf(AVBPrint *buf, const char *fmt, va_list vl_arg); + +/** + * Append char c n times to a print buffer. + */ +void av_bprint_chars(AVBPrint *buf, char c, unsigned n); + +/** + * Append data to a print buffer. + * + * param buf bprint buffer to use + * param data pointer to data + * param size size of data + */ +void av_bprint_append_data(AVBPrint *buf, const char *data, unsigned size); + +struct tm; +/** + * Append a formatted date and time to a print buffer. + * + * param buf bprint buffer to use + * param fmt date and time format string, see strftime() + * param tm broken-down time structure to translate + * + * @note due to poor design of the standard strftime function, it may + * produce poor results if the format string expands to a very long text and + * the bprint buffer is near the limit stated by the size_max option. + */ +void av_bprint_strftime(AVBPrint *buf, const char *fmt, const struct tm *tm); + +/** + * Allocate bytes in the buffer for external use. + * + * @param[in] buf buffer structure + * @param[in] size required size + * @param[out] mem pointer to the memory area + * @param[out] actual_size size of the memory area after allocation; + * can be larger or smaller than size + */ +void av_bprint_get_buffer(AVBPrint *buf, unsigned size, + unsigned char **mem, unsigned *actual_size); + +/** + * Reset the string to "" but keep internal allocated data. + */ +void av_bprint_clear(AVBPrint *buf); + +/** + * Test if the print buffer is complete (not truncated). + * + * It may have been truncated due to a memory allocation failure + * or the size_max limit (compare size and size_max if necessary). + */ +static inline int av_bprint_is_complete(const AVBPrint *buf) +{ + return buf->len < buf->size; +} + +/** + * Finalize a print buffer. + * + * The print buffer can no longer be used afterwards, + * but the len and size fields are still valid. + * + * @arg[out] ret_str if not NULL, used to return a permanent copy of the + * buffer contents, or NULL if memory allocation fails; + * if NULL, the buffer is discarded and freed + * @return 0 for success or error code (probably AVERROR(ENOMEM)) + */ +int av_bprint_finalize(AVBPrint *buf, char **ret_str); + +/** + * Escape the content in src and append it to dstbuf. + * + * @param dstbuf already inited destination bprint buffer + * @param src string containing the text to escape + * @param special_chars string containing the special characters which + * need to be escaped, can be NULL + * @param mode escape mode to employ, see AV_ESCAPE_MODE_* macros. + * Any unknown value for mode will be considered equivalent to + * AV_ESCAPE_MODE_BACKSLASH, but this behaviour can change without + * notice. + * @param flags flags which control how to escape, see AV_ESCAPE_FLAG_* macros + */ +void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_chars, + enum AVEscapeMode mode, int flags); + +#endif /* AVUTIL_BPRINT_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/bswap.h b/Src/Decoder_H264_ALL/include/libavutil/bswap.h new file mode 100644 index 0000000..91cb795 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/bswap.h @@ -0,0 +1,109 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * byte swapping routines + */ + +#ifndef AVUTIL_BSWAP_H +#define AVUTIL_BSWAP_H + +#include +#include "libavutil/avconfig.h" +#include "attributes.h" + +#ifdef HAVE_AV_CONFIG_H + +#include "config.h" + +#if ARCH_AARCH64 +# include "aarch64/bswap.h" +#elif ARCH_ARM +# include "arm/bswap.h" +#elif ARCH_AVR32 +# include "avr32/bswap.h" +#elif ARCH_SH4 +# include "sh4/bswap.h" +#elif ARCH_X86 +# include "x86/bswap.h" +#endif + +#endif /* HAVE_AV_CONFIG_H */ + +#define AV_BSWAP16C(x) (((x) << 8 & 0xff00) | ((x) >> 8 & 0x00ff)) +#define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16)) +#define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32)) + +#define AV_BSWAPC(s, x) AV_BSWAP##s##C(x) + +#ifndef av_bswap16 +static av_always_inline av_const uint16_t av_bswap16(uint16_t x) +{ + x= (x>>8) | (x<<8); + return x; +} +#endif + +#ifndef av_bswap32 +static av_always_inline av_const uint32_t av_bswap32(uint32_t x) +{ + return AV_BSWAP32C(x); +} +#endif + +#ifndef av_bswap64 +static inline uint64_t av_const av_bswap64(uint64_t x) +{ + return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32); +} +#endif + +// be2ne ... big-endian to native-endian +// le2ne ... little-endian to native-endian + +#if AV_HAVE_BIGENDIAN +#define av_be2ne16(x) (x) +#define av_be2ne32(x) (x) +#define av_be2ne64(x) (x) +#define av_le2ne16(x) av_bswap16(x) +#define av_le2ne32(x) av_bswap32(x) +#define av_le2ne64(x) av_bswap64(x) +#define AV_BE2NEC(s, x) (x) +#define AV_LE2NEC(s, x) AV_BSWAPC(s, x) +#else +#define av_be2ne16(x) av_bswap16(x) +#define av_be2ne32(x) av_bswap32(x) +#define av_be2ne64(x) av_bswap64(x) +#define av_le2ne16(x) (x) +#define av_le2ne32(x) (x) +#define av_le2ne64(x) (x) +#define AV_BE2NEC(s, x) AV_BSWAPC(s, x) +#define AV_LE2NEC(s, x) (x) +#endif + +#define AV_BE2NE16C(x) AV_BE2NEC(16, x) +#define AV_BE2NE32C(x) AV_BE2NEC(32, x) +#define AV_BE2NE64C(x) AV_BE2NEC(64, x) +#define AV_LE2NE16C(x) AV_LE2NEC(16, x) +#define AV_LE2NE32C(x) AV_LE2NEC(32, x) +#define AV_LE2NE64C(x) AV_LE2NEC(64, x) + +#endif /* AVUTIL_BSWAP_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/buffer.h b/Src/Decoder_H264_ALL/include/libavutil/buffer.h new file mode 100644 index 0000000..0c0ce12 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/buffer.h @@ -0,0 +1,290 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * @ingroup lavu_buffer + * refcounted data buffer API + */ + +#ifndef AVUTIL_BUFFER_H +#define AVUTIL_BUFFER_H + +#include + +/** + * @defgroup lavu_buffer AVBuffer + * @ingroup lavu_data + * + * @{ + * AVBuffer is an API for reference-counted data buffers. + * + * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer + * represents the data buffer itself; it is opaque and not meant to be accessed + * by the caller directly, but only through AVBufferRef. However, the caller may + * e.g. compare two AVBuffer pointers to check whether two different references + * are describing the same data buffer. AVBufferRef represents a single + * reference to an AVBuffer and it is the object that may be manipulated by the + * caller directly. + * + * There are two functions provided for creating a new AVBuffer with a single + * reference -- av_buffer_alloc() to just allocate a new buffer, and + * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing + * reference, additional references may be created with av_buffer_ref(). + * Use av_buffer_unref() to free a reference (this will automatically free the + * data once all the references are freed). + * + * The convention throughout this API and the rest of FFmpeg is such that the + * buffer is considered writable if there exists only one reference to it (and + * it has not been marked as read-only). The av_buffer_is_writable() function is + * provided to check whether this is true and av_buffer_make_writable() will + * automatically create a new writable buffer when necessary. + * Of course nothing prevents the calling code from violating this convention, + * however that is safe only when all the existing references are under its + * control. + * + * @note Referencing and unreferencing the buffers is thread-safe and thus + * may be done from multiple threads simultaneously without any need for + * additional locking. + * + * @note Two different references to the same buffer can point to different + * parts of the buffer (i.e. their AVBufferRef.data will not be equal). + */ + +/** + * A reference counted buffer type. It is opaque and is meant to be used through + * references (AVBufferRef). + */ +typedef struct AVBuffer AVBuffer; + +/** + * A reference to a data buffer. + * + * The size of this struct is not a part of the public ABI and it is not meant + * to be allocated directly. + */ +typedef struct AVBufferRef { + AVBuffer *buffer; + + /** + * The data buffer. It is considered writable if and only if + * this is the only reference to the buffer, in which case + * av_buffer_is_writable() returns 1. + */ + uint8_t *data; + /** + * Size of data in bytes. + */ + int size; +} AVBufferRef; + +/** + * Allocate an AVBuffer of the given size using av_malloc(). + * + * @return an AVBufferRef of given size or NULL when out of memory + */ +AVBufferRef *av_buffer_alloc(int size); + +/** + * Same as av_buffer_alloc(), except the returned buffer will be initialized + * to zero. + */ +AVBufferRef *av_buffer_allocz(int size); + +/** + * Always treat the buffer as read-only, even when it has only one + * reference. + */ +#define AV_BUFFER_FLAG_READONLY (1 << 0) + +/** + * Create an AVBuffer from an existing array. + * + * If this function is successful, data is owned by the AVBuffer. The caller may + * only access data through the returned AVBufferRef and references derived from + * it. + * If this function fails, data is left untouched. + * @param data data array + * @param size size of data in bytes + * @param free a callback for freeing this buffer's data + * @param opaque parameter to be got for processing or passed to free + * @param flags a combination of AV_BUFFER_FLAG_* + * + * @return an AVBufferRef referring to data on success, NULL on failure. + */ +AVBufferRef *av_buffer_create(uint8_t *data, int size, + void (*free)(void *opaque, uint8_t *data), + void *opaque, int flags); + +/** + * Default free callback, which calls av_free() on the buffer data. + * This function is meant to be passed to av_buffer_create(), not called + * directly. + */ +void av_buffer_default_free(void *opaque, uint8_t *data); + +/** + * Create a new reference to an AVBuffer. + * + * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on + * failure. + */ +AVBufferRef *av_buffer_ref(AVBufferRef *buf); + +/** + * Free a given reference and automatically free the buffer if there are no more + * references to it. + * + * @param buf the reference to be freed. The pointer is set to NULL on return. + */ +void av_buffer_unref(AVBufferRef **buf); + +/** + * @return 1 if the caller may write to the data referred to by buf (which is + * true if and only if buf is the only reference to the underlying AVBuffer). + * Return 0 otherwise. + * A positive answer is valid until av_buffer_ref() is called on buf. + */ +int av_buffer_is_writable(const AVBufferRef *buf); + +/** + * @return the opaque parameter set by av_buffer_create. + */ +void *av_buffer_get_opaque(const AVBufferRef *buf); + +int av_buffer_get_ref_count(const AVBufferRef *buf); + +/** + * Create a writable reference from a given buffer reference, avoiding data copy + * if possible. + * + * @param buf buffer reference to make writable. On success, buf is either left + * untouched, or it is unreferenced and a new writable AVBufferRef is + * written in its place. On failure, buf is left untouched. + * @return 0 on success, a negative AVERROR on failure. + */ +int av_buffer_make_writable(AVBufferRef **buf); + +/** + * Reallocate a given buffer. + * + * @param buf a buffer reference to reallocate. On success, buf will be + * unreferenced and a new reference with the required size will be + * written in its place. On failure buf will be left untouched. *buf + * may be NULL, then a new buffer is allocated. + * @param size required new buffer size. + * @return 0 on success, a negative AVERROR on failure. + * + * @note the buffer is actually reallocated with av_realloc() only if it was + * initially allocated through av_buffer_realloc(NULL) and there is only one + * reference to it (i.e. the one passed to this function). In all other cases + * a new buffer is allocated and the data is copied. + */ +int av_buffer_realloc(AVBufferRef **buf, int size); + +/** + * @} + */ + +/** + * @defgroup lavu_bufferpool AVBufferPool + * @ingroup lavu_data + * + * @{ + * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. + * + * Frequently allocating and freeing large buffers may be slow. AVBufferPool is + * meant to solve this in cases when the caller needs a set of buffers of the + * same size (the most obvious use case being buffers for raw video or audio + * frames). + * + * At the beginning, the user must call av_buffer_pool_init() to create the + * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to + * get a reference to a new buffer, similar to av_buffer_alloc(). This new + * reference works in all aspects the same way as the one created by + * av_buffer_alloc(). However, when the last reference to this buffer is + * unreferenced, it is returned to the pool instead of being freed and will be + * reused for subsequent av_buffer_pool_get() calls. + * + * When the caller is done with the pool and no longer needs to allocate any new + * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. + * Once all the buffers are released, it will automatically be freed. + * + * Allocating and releasing buffers with this API is thread-safe as long as + * either the default alloc callback is used, or the user-supplied one is + * thread-safe. + */ + +/** + * The buffer pool. This structure is opaque and not meant to be accessed + * directly. It is allocated with av_buffer_pool_init() and freed with + * av_buffer_pool_uninit(). + */ +typedef struct AVBufferPool AVBufferPool; + +/** + * Allocate and initialize a buffer pool. + * + * @param size size of each buffer in this pool + * @param alloc a function that will be used to allocate new buffers when the + * pool is empty. May be NULL, then the default allocator will be used + * (av_buffer_alloc()). + * @return newly created buffer pool on success, NULL on error. + */ +AVBufferPool *av_buffer_pool_init(int size, AVBufferRef* (*alloc)(int size)); + +/** + * Allocate and initialize a buffer pool with a more complex allocator. + * + * @param size size of each buffer in this pool + * @param opaque arbitrary user data used by the allocator + * @param alloc a function that will be used to allocate new buffers when the + * pool is empty. + * @param pool_free a function that will be called immediately before the pool + * is freed. I.e. after av_buffer_pool_can_uninit() is called + * by the pool and all the frames are returned to the pool and + * freed. It is intended to uninitialize the user opaque data. + * @return newly created buffer pool on success, NULL on error. + */ +AVBufferPool *av_buffer_pool_init2(int size, void *opaque, + AVBufferRef* (*alloc)(void *opaque, int size), + void (*pool_free)(void *opaque)); + +/** + * Mark the pool as being available for freeing. It will actually be freed only + * once all the allocated buffers associated with the pool are released. Thus it + * is safe to call this function while some of the allocated buffers are still + * in use. + * + * @param pool pointer to the pool to be freed. It will be set to NULL. + */ +void av_buffer_pool_uninit(AVBufferPool **pool); + +/** + * Allocate a new AVBuffer, reusing an old buffer from the pool when available. + * This function may be called simultaneously from multiple threads. + * + * @return a reference to the new buffer on success, NULL on error. + */ +AVBufferRef *av_buffer_pool_get(AVBufferPool *pool); + +/** + * @} + */ + +#endif /* AVUTIL_BUFFER_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/camellia.h b/Src/Decoder_H264_ALL/include/libavutil/camellia.h new file mode 100644 index 0000000..e674c9b --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/camellia.h @@ -0,0 +1,70 @@ +/* + * An implementation of the CAMELLIA algorithm as mentioned in RFC3713 + * Copyright (c) 2014 Supraja Meedinti + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_CAMELLIA_H +#define AVUTIL_CAMELLIA_H + +#include + + +/** + * @file + * @brief Public header for libavutil CAMELLIA algorithm + * @defgroup lavu_camellia CAMELLIA + * @ingroup lavu_crypto + * @{ + */ + +extern const int av_camellia_size; + +struct AVCAMELLIA; + +/** + * Allocate an AVCAMELLIA context + * To free the struct: av_free(ptr) + */ +struct AVCAMELLIA *av_camellia_alloc(void); + +/** + * Initialize an AVCAMELLIA context. + * + * @param ctx an AVCAMELLIA context + * @param key a key of 16, 24, 32 bytes used for encryption/decryption + * @param key_bits number of keybits: possible are 128, 192, 256 + */ +int av_camellia_init(struct AVCAMELLIA *ctx, const uint8_t *key, int key_bits); + +/** + * Encrypt or decrypt a buffer using a previously initialized context + * + * @param ctx an AVCAMELLIA context + * @param dst destination array, can be equal to src + * @param src source array, can be equal to dst + * @param count number of 16 byte blocks + * @paran iv initialization vector for CBC mode, NULL for ECB mode + * @param decrypt 0 for encryption, 1 for decryption + */ +void av_camellia_crypt(struct AVCAMELLIA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt); + +/** + * @} + */ +#endif /* AVUTIL_CAMELLIA_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/cast5.h b/Src/Decoder_H264_ALL/include/libavutil/cast5.h new file mode 100644 index 0000000..ad5b347 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/cast5.h @@ -0,0 +1,80 @@ +/* + * An implementation of the CAST128 algorithm as mentioned in RFC2144 + * Copyright (c) 2014 Supraja Meedinti + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_CAST5_H +#define AVUTIL_CAST5_H + +#include + + +/** + * @file + * @brief Public header for libavutil CAST5 algorithm + * @defgroup lavu_cast5 CAST5 + * @ingroup lavu_crypto + * @{ + */ + +extern const int av_cast5_size; + +struct AVCAST5; + +/** + * Allocate an AVCAST5 context + * To free the struct: av_free(ptr) + */ +struct AVCAST5 *av_cast5_alloc(void); +/** + * Initialize an AVCAST5 context. + * + * @param ctx an AVCAST5 context + * @param key a key of 5,6,...16 bytes used for encryption/decryption + * @param key_bits number of keybits: possible are 40,48,...,128 + * @return 0 on success, less than 0 on failure + */ +int av_cast5_init(struct AVCAST5 *ctx, const uint8_t *key, int key_bits); + +/** + * Encrypt or decrypt a buffer using a previously initialized context, ECB mode only + * + * @param ctx an AVCAST5 context + * @param dst destination array, can be equal to src + * @param src source array, can be equal to dst + * @param count number of 8 byte blocks + * @param decrypt 0 for encryption, 1 for decryption + */ +void av_cast5_crypt(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, int decrypt); + +/** + * Encrypt or decrypt a buffer using a previously initialized context + * + * @param ctx an AVCAST5 context + * @param dst destination array, can be equal to src + * @param src source array, can be equal to dst + * @param count number of 8 byte blocks + * @param iv initialization vector for CBC mode, NULL for ECB mode + * @param decrypt 0 for encryption, 1 for decryption + */ +void av_cast5_crypt2(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); +/** + * @} + */ +#endif /* AVUTIL_CAST5_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/channel_layout.h b/Src/Decoder_H264_ALL/include/libavutil/channel_layout.h new file mode 100644 index 0000000..ec7effe --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/channel_layout.h @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2006 Michael Niedermayer + * Copyright (c) 2008 Peter Ross + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_CHANNEL_LAYOUT_H +#define AVUTIL_CHANNEL_LAYOUT_H + +#include + +/** + * @file + * audio channel layout utility functions + */ + +/** + * @addtogroup lavu_audio + * @{ + */ + +/** + * @defgroup channel_masks Audio channel masks + * + * A channel layout is a 64-bits integer with a bit set for every channel. + * The number of bits set must be equal to the number of channels. + * The value 0 means that the channel layout is not known. + * @note this data structure is not powerful enough to handle channels + * combinations that have the same channel multiple times, such as + * dual-mono. + * + * @{ + */ +#define AV_CH_FRONT_LEFT 0x00000001 +#define AV_CH_FRONT_RIGHT 0x00000002 +#define AV_CH_FRONT_CENTER 0x00000004 +#define AV_CH_LOW_FREQUENCY 0x00000008 +#define AV_CH_BACK_LEFT 0x00000010 +#define AV_CH_BACK_RIGHT 0x00000020 +#define AV_CH_FRONT_LEFT_OF_CENTER 0x00000040 +#define AV_CH_FRONT_RIGHT_OF_CENTER 0x00000080 +#define AV_CH_BACK_CENTER 0x00000100 +#define AV_CH_SIDE_LEFT 0x00000200 +#define AV_CH_SIDE_RIGHT 0x00000400 +#define AV_CH_TOP_CENTER 0x00000800 +#define AV_CH_TOP_FRONT_LEFT 0x00001000 +#define AV_CH_TOP_FRONT_CENTER 0x00002000 +#define AV_CH_TOP_FRONT_RIGHT 0x00004000 +#define AV_CH_TOP_BACK_LEFT 0x00008000 +#define AV_CH_TOP_BACK_CENTER 0x00010000 +#define AV_CH_TOP_BACK_RIGHT 0x00020000 +#define AV_CH_STEREO_LEFT 0x20000000 ///< Stereo downmix. +#define AV_CH_STEREO_RIGHT 0x40000000 ///< See AV_CH_STEREO_LEFT. +#define AV_CH_WIDE_LEFT 0x0000000080000000ULL +#define AV_CH_WIDE_RIGHT 0x0000000100000000ULL +#define AV_CH_SURROUND_DIRECT_LEFT 0x0000000200000000ULL +#define AV_CH_SURROUND_DIRECT_RIGHT 0x0000000400000000ULL +#define AV_CH_LOW_FREQUENCY_2 0x0000000800000000ULL + +/** Channel mask value used for AVCodecContext.request_channel_layout + to indicate that the user requests the channel order of the decoder output + to be the native codec channel order. */ +#define AV_CH_LAYOUT_NATIVE 0x8000000000000000ULL + +/** + * @} + * @defgroup channel_mask_c Audio channel layouts + * @{ + * */ +#define AV_CH_LAYOUT_MONO (AV_CH_FRONT_CENTER) +#define AV_CH_LAYOUT_STEREO (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT) +#define AV_CH_LAYOUT_2POINT1 (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY) +#define AV_CH_LAYOUT_2_1 (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER) +#define AV_CH_LAYOUT_SURROUND (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER) +#define AV_CH_LAYOUT_3POINT1 (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY) +#define AV_CH_LAYOUT_4POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER) +#define AV_CH_LAYOUT_4POINT1 (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY) +#define AV_CH_LAYOUT_2_2 (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT) +#define AV_CH_LAYOUT_QUAD (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_5POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT) +#define AV_CH_LAYOUT_5POINT1 (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY) +#define AV_CH_LAYOUT_5POINT0_BACK (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_5POINT1_BACK (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY) +#define AV_CH_LAYOUT_6POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER) +#define AV_CH_LAYOUT_6POINT0_FRONT (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) +#define AV_CH_LAYOUT_HEXAGONAL (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER) +#define AV_CH_LAYOUT_6POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER) +#define AV_CH_LAYOUT_6POINT1_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER) +#define AV_CH_LAYOUT_6POINT1_FRONT (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY) +#define AV_CH_LAYOUT_7POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_7POINT0_FRONT (AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) +#define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) +#define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) +#define AV_CH_LAYOUT_OCTAGONAL (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_HEXADECAGONAL (AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) +#define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT) + +enum AVMatrixEncoding { + AV_MATRIX_ENCODING_NONE, + AV_MATRIX_ENCODING_DOLBY, + AV_MATRIX_ENCODING_DPLII, + AV_MATRIX_ENCODING_DPLIIX, + AV_MATRIX_ENCODING_DPLIIZ, + AV_MATRIX_ENCODING_DOLBYEX, + AV_MATRIX_ENCODING_DOLBYHEADPHONE, + AV_MATRIX_ENCODING_NB +}; + +/** + * Return a channel layout id that matches name, or 0 if no match is found. + * + * name can be one or several of the following notations, + * separated by '+' or '|': + * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, + * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); + * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, + * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); + * - a number of channels, in decimal, optionally followed by 'c', yielding + * the default channel layout for that number of channels (@see + * av_get_default_channel_layout); + * - a channel layout mask, in hexadecimal starting with "0x" (see the + * AV_CH_* macros). + * + * @warning Starting from the next major bump the trailing character + * 'c' to specify a number of channels will be required, while a + * channel layout mask could also be specified as a decimal number + * (if and only if not followed by "c"). + * + * Example: "stereo+FC" = "2c+FC" = "2c+1c" = "0x7" + */ +uint64_t av_get_channel_layout(const char *name); + +/** + * Return a description of a channel layout. + * If nb_channels is <= 0, it is guessed from the channel_layout. + * + * @param buf put here the string containing the channel layout + * @param buf_size size in bytes of the buffer + */ +void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout); + +struct AVBPrint; +/** + * Append a description of a channel layout to a bprint buffer. + */ +void av_bprint_channel_layout(struct AVBPrint *bp, int nb_channels, uint64_t channel_layout); + +/** + * Return the number of channels in the channel layout. + */ +int av_get_channel_layout_nb_channels(uint64_t channel_layout); + +/** + * Return default channel layout for a given number of channels. + */ +int64_t av_get_default_channel_layout(int nb_channels); + +/** + * Get the index of a channel in channel_layout. + * + * @param channel a channel layout describing exactly one channel which must be + * present in channel_layout. + * + * @return index of channel in channel_layout on success, a negative AVERROR + * on error. + */ +int av_get_channel_layout_channel_index(uint64_t channel_layout, + uint64_t channel); + +/** + * Get the channel with the given index in channel_layout. + */ +uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index); + +/** + * Get the name of a given channel. + * + * @return channel name on success, NULL on error. + */ +const char *av_get_channel_name(uint64_t channel); + +/** + * Get the description of a given channel. + * + * @param channel a channel layout with a single channel + * @return channel description on success, NULL on error + */ +const char *av_get_channel_description(uint64_t channel); + +/** + * Get the value and name of a standard channel layout. + * + * @param[in] index index in an internal list, starting at 0 + * @param[out] layout channel layout mask + * @param[out] name name of the layout + * @return 0 if the layout exists, + * <0 if index is beyond the limits + */ +int av_get_standard_channel_layout(unsigned index, uint64_t *layout, + const char **name); + +/** + * @} + * @} + */ + +#endif /* AVUTIL_CHANNEL_LAYOUT_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/common.h b/Src/Decoder_H264_ALL/include/libavutil/common.h new file mode 100644 index 0000000..d4627da --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/common.h @@ -0,0 +1,543 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * common internal and external API header + */ + +#ifndef AVUTIL_COMMON_H +#define AVUTIL_COMMON_H + +#ifdef __cplusplus +#define __STDC_CONSTANT_MACROS +#ifdef _STDINT_H +#undef _STDINT_H +#endif +#include "stdint.h" +#endif + +#ifndef INT64_C +#define INT64_C(c)(c ## LL) +#define UINT64_C(c)(c ## ULL) +#endif + +#if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS) && !defined(UINT64_C) +#error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "attributes.h" +#include "macros.h" +#include "version.h" +#include "libavutil/avconfig.h" + +#if AV_HAVE_BIGENDIAN +# define AV_NE(be, le) (be) +#else +# define AV_NE(be, le) (le) +#endif + +//rounded division & shift +#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b)) +/* assume b>0 */ +#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b)) +/* Fast a/(1<=0 and b>=0 */ +#define AV_CEIL_RSHIFT(a,b) (!av_builtin_constant_p(b) ? -((-(a)) >> (b)) \ + : ((a) + (1<<(b)) - 1) >> (b)) +/* Backwards compat. */ +#define FF_CEIL_RSHIFT AV_CEIL_RSHIFT + +#define FFUDIV(a,b) (((a)>0 ?(a):(a)-(b)+1) / (b)) +#define FFUMOD(a,b) ((a)-(b)*FFUDIV(a,b)) + +/** + * Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they + * are not representable as absolute values of their type. This is the same + * as with *abs() + * @see FFNABS() + */ +#define FFABS(a) ((a) >= 0 ? (a) : (-(a))) +#define FFSIGN(a) ((a) > 0 ? 1 : -1) + +/** + * Negative Absolute value. + * this works for all integers of all types. + * As with many macros, this evaluates its argument twice, it thus must not have + * a sideeffect, that is FFNABS(x++) has undefined behavior. + */ +#define FFNABS(a) ((a) <= 0 ? (a) : (-(a))) + +/** + * Comparator. + * For two numerical expressions x and y, gives 1 if x > y, -1 if x < y, and 0 + * if x == y. This is useful for instance in a qsort comparator callback. + * Furthermore, compilers are able to optimize this to branchless code, and + * there is no risk of overflow with signed types. + * As with many macros, this evaluates its argument multiple times, it thus + * must not have a side-effect. + */ +#define FFDIFFSIGN(x,y) (((x)>(y)) - ((x)<(y))) + +#define FFMAX(a,b) ((a) > (b) ? (a) : (b)) +#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c) +#define FFMIN(a,b) ((a) > (b) ? (b) : (a)) +#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c) + +#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0) +#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) + +/* misc math functions */ + +#ifdef HAVE_AV_CONFIG_H +# include "config.h" +# include "intmath.h" +#endif + +/* Pull in unguarded fallback defines at the end of this file. */ +#include "common.h" + +#ifndef av_log2 +av_const int av_log2(unsigned v); +#endif + +#ifndef av_log2_16bit +av_const int av_log2_16bit(unsigned v); +#endif + +/** + * Clip a signed integer value into the amin-amax range. + * @param a value to clip + * @param amin minimum value of the clip range + * @param amax maximum value of the clip range + * @return clipped value + */ +static av_always_inline av_const int av_clip_c(int a, int amin, int amax) +{ +#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 + if (amin > amax) abort(); +#endif + if (a < amin) return amin; + else if (a > amax) return amax; + else return a; +} + +/** + * Clip a signed 64bit integer value into the amin-amax range. + * @param a value to clip + * @param amin minimum value of the clip range + * @param amax maximum value of the clip range + * @return clipped value + */ +static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, int64_t amax) +{ +#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 + if (amin > amax) abort(); +#endif + if (a < amin) return amin; + else if (a > amax) return amax; + else return a; +} + +/** + * Clip a signed integer value into the 0-255 range. + * @param a value to clip + * @return clipped value + */ +static av_always_inline av_const uint8_t av_clip_uint8_c(int a) +{ + if (a&(~0xFF)) return (-a)>>31; + else return a; +} + +/** + * Clip a signed integer value into the -128,127 range. + * @param a value to clip + * @return clipped value + */ +static av_always_inline av_const int8_t av_clip_int8_c(int a) +{ + if ((a+0x80U) & ~0xFF) return (a>>31) ^ 0x7F; + else return a; +} + +/** + * Clip a signed integer value into the 0-65535 range. + * @param a value to clip + * @return clipped value + */ +static av_always_inline av_const uint16_t av_clip_uint16_c(int a) +{ + if (a&(~0xFFFF)) return (-a)>>31; + else return a; +} + +/** + * Clip a signed integer value into the -32768,32767 range. + * @param a value to clip + * @return clipped value + */ +static av_always_inline av_const int16_t av_clip_int16_c(int a) +{ + if ((a+0x8000U) & ~0xFFFF) return (a>>31) ^ 0x7FFF; + else return a; +} + +/** + * Clip a signed 64-bit integer value into the -2147483648,2147483647 range. + * @param a value to clip + * @return clipped value + */ +static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a) +{ + if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (int32_t)((a>>63) ^ 0x7FFFFFFF); + else return (int32_t)a; +} + +/** + * Clip a signed integer into the -(2^p),(2^p-1) range. + * @param a value to clip + * @param p bit position to clip at + * @return clipped value + */ +static av_always_inline av_const int av_clip_intp2_c(int a, int p) +{ + if (((unsigned)a + (1 << p)) & ~((2 << p) - 1)) + return (a >> 31) ^ ((1 << p) - 1); + else + return a; +} + +/** + * Clip a signed integer to an unsigned power of two range. + * @param a value to clip + * @param p bit position to clip at + * @return clipped value + */ +static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p) +{ + if (a & ~((1<> 31 & ((1<= 2 + if (amin > amax) abort(); +#endif + if (a < amin) return amin; + else if (a > amax) return amax; + else return a; +} + +/** + * Clip a double value into the amin-amax range. + * @param a value to clip + * @param amin minimum value of the clip range + * @param amax maximum value of the clip range + * @return clipped value + */ +static av_always_inline av_const double av_clipd_c(double a, double amin, double amax) +{ +#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 + if (amin > amax) abort(); +#endif + if (a < amin) return amin; + else if (a > amax) return amax; + else return a; +} + +/** Compute ceil(log2(x)). + * @param x value used to compute ceil(log2(x)) + * @return computed ceiling of log2(x) + */ +static av_always_inline av_const int av_ceil_log2_c(int x) +{ + return av_log2((x - 1) << 1); +} + +/** + * Count number of bits set to one in x + * @param x value to count bits of + * @return the number of bits set to one in x + */ +static av_always_inline av_const int av_popcount_c(uint32_t x) +{ + x -= (x >> 1) & 0x55555555; + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + x = (x + (x >> 4)) & 0x0F0F0F0F; + x += x >> 8; + return (x + (x >> 16)) & 0x3F; +} + +/** + * Count number of bits set to one in x + * @param x value to count bits of + * @return the number of bits set to one in x + */ +static av_always_inline av_const int av_popcount64_c(uint64_t x) +{ + return av_popcount((uint32_t)x) + av_popcount((uint32_t)(x >> 32)); +} + +static av_always_inline av_const int av_parity_c(uint32_t v) +{ + return av_popcount(v) & 1; +} + +#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24)) +#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24)) + +/** + * Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form. + * + * @param val Output value, must be an lvalue of type uint32_t. + * @param GET_BYTE Expression reading one byte from the input. + * Evaluated up to 7 times (4 for the currently + * assigned Unicode range). With a memory buffer + * input, this could be *ptr++. + * @param ERROR Expression to be evaluated on invalid input, + * typically a goto statement. + * + * @warning ERROR should not contain a loop control statement which + * could interact with the internal while loop, and should force an + * exit from the macro code (e.g. through a goto or a return) in order + * to prevent undefined results. + */ +#define GET_UTF8(val, GET_BYTE, ERROR)\ + val= (GET_BYTE);\ + {\ + uint32_t top = (val & 128) >> 1;\ + if ((val & 0xc0) == 0x80 || val >= 0xFE)\ + ERROR\ + while (val & top) {\ + int tmp= (GET_BYTE) - 128;\ + if(tmp>>6)\ + ERROR\ + val= (val<<6) + tmp;\ + top <<= 5;\ + }\ + val &= (top << 1) - 1;\ + } + +/** + * Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form. + * + * @param val Output value, must be an lvalue of type uint32_t. + * @param GET_16BIT Expression returning two bytes of UTF-16 data converted + * to native byte order. Evaluated one or two times. + * @param ERROR Expression to be evaluated on invalid input, + * typically a goto statement. + */ +#define GET_UTF16(val, GET_16BIT, ERROR)\ + val = GET_16BIT;\ + {\ + unsigned int hi = val - 0xD800;\ + if (hi < 0x800) {\ + val = GET_16BIT - 0xDC00;\ + if (val > 0x3FFU || hi > 0x3FFU)\ + ERROR\ + val += (hi<<10) + 0x10000;\ + }\ + }\ + +/** + * @def PUT_UTF8(val, tmp, PUT_BYTE) + * Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long). + * @param val is an input-only argument and should be of type uint32_t. It holds + * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If + * val is given as a function it is executed only once. + * @param tmp is a temporary variable and should be of type uint8_t. It + * represents an intermediate value during conversion that is to be + * output by PUT_BYTE. + * @param PUT_BYTE writes the converted UTF-8 bytes to any proper destination. + * It could be a function or a statement, and uses tmp as the input byte. + * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be + * executed up to 4 times for values in the valid UTF-8 range and up to + * 7 times in the general case, depending on the length of the converted + * Unicode character. + */ +#define PUT_UTF8(val, tmp, PUT_BYTE)\ + {\ + int bytes, shift;\ + uint32_t in = val;\ + if (in < 0x80) {\ + tmp = in;\ + PUT_BYTE\ + } else {\ + bytes = (av_log2(in) + 4) / 5;\ + shift = (bytes - 1) * 6;\ + tmp = (256 - (256 >> bytes)) | (in >> shift);\ + PUT_BYTE\ + while (shift >= 6) {\ + shift -= 6;\ + tmp = 0x80 | ((in >> shift) & 0x3f);\ + PUT_BYTE\ + }\ + }\ + } + +/** + * @def PUT_UTF16(val, tmp, PUT_16BIT) + * Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes). + * @param val is an input-only argument and should be of type uint32_t. It holds + * a UCS-4 encoded Unicode character that is to be converted to UTF-16. If + * val is given as a function it is executed only once. + * @param tmp is a temporary variable and should be of type uint16_t. It + * represents an intermediate value during conversion that is to be + * output by PUT_16BIT. + * @param PUT_16BIT writes the converted UTF-16 data to any proper destination + * in desired endianness. It could be a function or a statement, and uses tmp + * as the input byte. For example, PUT_BYTE could be "*output++ = tmp;" + * PUT_BYTE will be executed 1 or 2 times depending on input character. + */ +#define PUT_UTF16(val, tmp, PUT_16BIT)\ + {\ + uint32_t in = val;\ + if (in < 0x10000) {\ + tmp = in;\ + PUT_16BIT\ + } else {\ + tmp = 0xD800 | ((in - 0x10000) >> 10);\ + PUT_16BIT\ + tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\ + PUT_16BIT\ + }\ + }\ + + + +#include "mem.h" + +#ifdef HAVE_AV_CONFIG_H +# include "internal.h" +#endif /* HAVE_AV_CONFIG_H */ + +#endif /* AVUTIL_COMMON_H */ + +/* + * The following definitions are outside the multiple inclusion guard + * to ensure they are immediately available in intmath.h. + */ + +#ifndef av_ceil_log2 +# define av_ceil_log2 av_ceil_log2_c +#endif +#ifndef av_clip +# define av_clip av_clip_c +#endif +#ifndef av_clip64 +# define av_clip64 av_clip64_c +#endif +#ifndef av_clip_uint8 +# define av_clip_uint8 av_clip_uint8_c +#endif +#ifndef av_clip_int8 +# define av_clip_int8 av_clip_int8_c +#endif +#ifndef av_clip_uint16 +# define av_clip_uint16 av_clip_uint16_c +#endif +#ifndef av_clip_int16 +# define av_clip_int16 av_clip_int16_c +#endif +#ifndef av_clipl_int32 +# define av_clipl_int32 av_clipl_int32_c +#endif +#ifndef av_clip_intp2 +# define av_clip_intp2 av_clip_intp2_c +#endif +#ifndef av_clip_uintp2 +# define av_clip_uintp2 av_clip_uintp2_c +#endif +#ifndef av_mod_uintp2 +# define av_mod_uintp2 av_mod_uintp2_c +#endif +#ifndef av_sat_add32 +# define av_sat_add32 av_sat_add32_c +#endif +#ifndef av_sat_dadd32 +# define av_sat_dadd32 av_sat_dadd32_c +#endif +#ifndef av_clipf +# define av_clipf av_clipf_c +#endif +#ifndef av_clipd +# define av_clipd av_clipd_c +#endif +#ifndef av_popcount +# define av_popcount av_popcount_c +#endif +#ifndef av_popcount64 +# define av_popcount64 av_popcount64_c +#endif +#ifndef av_parity +# define av_parity av_parity_c +#endif diff --git a/Src/Decoder_H264_ALL/include/libavutil/cpu.h b/Src/Decoder_H264_ALL/include/libavutil/cpu.h new file mode 100644 index 0000000..4bff167 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/cpu.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_CPU_H +#define AVUTIL_CPU_H + +#include "attributes.h" + +#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */ + + /* lower 16 bits - CPU features */ +#define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX +#define AV_CPU_FLAG_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext +#define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext +#define AV_CPU_FLAG_3DNOW 0x0004 ///< AMD 3DNOW +#define AV_CPU_FLAG_SSE 0x0008 ///< SSE functions +#define AV_CPU_FLAG_SSE2 0x0010 ///< PIV SSE2 functions +#define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster + ///< than regular MMX/SSE (e.g. Core1) +#define AV_CPU_FLAG_3DNOWEXT 0x0020 ///< AMD 3DNowExt +#define AV_CPU_FLAG_SSE3 0x0040 ///< Prescott SSE3 functions +#define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster + ///< than regular MMX/SSE (e.g. Core1) +#define AV_CPU_FLAG_SSSE3 0x0080 ///< Conroe SSSE3 functions +#define AV_CPU_FLAG_ATOM 0x10000000 ///< Atom processor, some SSSE3 instructions are slower +#define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions +#define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions +#define AV_CPU_FLAG_AESNI 0x80000 ///< Advanced Encryption Standard functions +#define AV_CPU_FLAG_AVX 0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used +#define AV_CPU_FLAG_AVXSLOW 0x8000000 ///< AVX supported, but slow when using YMM registers (e.g. Bulldozer) +#define AV_CPU_FLAG_XOP 0x0400 ///< Bulldozer XOP functions +#define AV_CPU_FLAG_FMA4 0x0800 ///< Bulldozer FMA4 functions +#define AV_CPU_FLAG_CMOV 0x1000 ///< supports cmov instruction +#define AV_CPU_FLAG_AVX2 0x8000 ///< AVX2 functions: requires OS support even if YMM registers aren't used +#define AV_CPU_FLAG_FMA3 0x10000 ///< Haswell FMA3 functions +#define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 1 +#define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 2 + +#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard +#define AV_CPU_FLAG_VSX 0x0002 ///< ISA 2.06 +#define AV_CPU_FLAG_POWER8 0x0004 ///< ISA 2.07 + +#define AV_CPU_FLAG_ARMV5TE (1 << 0) +#define AV_CPU_FLAG_ARMV6 (1 << 1) +#define AV_CPU_FLAG_ARMV6T2 (1 << 2) +#define AV_CPU_FLAG_VFP (1 << 3) +#define AV_CPU_FLAG_VFPV3 (1 << 4) +#define AV_CPU_FLAG_NEON (1 << 5) +#define AV_CPU_FLAG_ARMV8 (1 << 6) +#define AV_CPU_FLAG_VFP_VM (1 << 7) ///< VFPv2 vector mode, deprecated in ARMv7-A and unavailable in various CPUs implementations +#define AV_CPU_FLAG_SETEND (1 <<16) + +/** + * Return the flags which specify extensions supported by the CPU. + * The returned value is affected by av_force_cpu_flags() if that was used + * before. So av_get_cpu_flags() can easily be used in an application to + * detect the enabled cpu flags. + */ +int av_get_cpu_flags(void); + +/** + * Disables cpu detection and forces the specified flags. + * -1 is a special case that disables forcing of specific flags. + */ +void av_force_cpu_flags(int flags); + +/** + * Set a mask on flags returned by av_get_cpu_flags(). + * This function is mainly useful for testing. + * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible + * + * @warning this function is not thread safe. + */ +attribute_deprecated void av_set_cpu_flags_mask(int mask); + +/** + * Parse CPU flags from a string. + * + * The returned flags contain the specified flags as well as related unspecified flags. + * + * This function exists only for compatibility with libav. + * Please use av_parse_cpu_caps() when possible. + * @return a combination of AV_CPU_* flags, negative on error. + */ +attribute_deprecated +int av_parse_cpu_flags(const char *s); + +/** + * Parse CPU caps from a string and update the given AV_CPU_* flags based on that. + * + * @return negative on error. + */ +int av_parse_cpu_caps(unsigned *flags, const char *s); + +/** + * @return the number of logical CPU cores present. + */ +int av_cpu_count(void); + +#endif /* AVUTIL_CPU_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/crc.h b/Src/Decoder_H264_ALL/include/libavutil/crc.h new file mode 100644 index 0000000..ef8a713 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/crc.h @@ -0,0 +1,91 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_CRC_H +#define AVUTIL_CRC_H + +#include +#include +#include "attributes.h" +#include "version.h" + +/** + * @defgroup lavu_crc32 CRC32 + * @ingroup lavu_crypto + * @{ + */ + +typedef uint32_t AVCRC; + +typedef enum { + AV_CRC_8_ATM, + AV_CRC_16_ANSI, + AV_CRC_16_CCITT, + AV_CRC_32_IEEE, + AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */ + AV_CRC_16_ANSI_LE, /*< reversed bitorder version of AV_CRC_16_ANSI */ +#if FF_API_CRC_BIG_TABLE + AV_CRC_24_IEEE = 12, +#else + AV_CRC_24_IEEE, +#endif /* FF_API_CRC_BIG_TABLE */ + AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */ +}AVCRCId; + +/** + * Initialize a CRC table. + * @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024 + * @param le If 1, the lowest bit represents the coefficient for the highest + * exponent of the corresponding polynomial (both for poly and + * actual CRC). + * If 0, you must swap the CRC parameter and the result of av_crc + * if you need the standard representation (can be simplified in + * most cases to e.g. bswap16): + * av_bswap32(crc << (32-bits)) + * @param bits number of bits for the CRC + * @param poly generator polynomial without the x**bits coefficient, in the + * representation as specified by le + * @param ctx_size size of ctx in bytes + * @return <0 on failure + */ +int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size); + +/** + * Get an initialized standard CRC table. + * @param crc_id ID of a standard CRC + * @return a pointer to the CRC table or NULL on failure + */ +const AVCRC *av_crc_get_table(AVCRCId crc_id); + +/** + * Calculate the CRC of a block. + * @param crc CRC of previous blocks if any or initial value for CRC + * @return CRC updated with the data from the given block + * + * @see av_crc_init() "le" parameter + */ +uint32_t av_crc(const AVCRC *ctx, uint32_t crc, + const uint8_t *buffer, size_t length) av_pure; + +/** + * @} + */ + +#endif /* AVUTIL_CRC_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/des.h b/Src/Decoder_H264_ALL/include/libavutil/des.h new file mode 100644 index 0000000..4cf11f5 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/des.h @@ -0,0 +1,77 @@ +/* + * DES encryption/decryption + * Copyright (c) 2007 Reimar Doeffinger + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_DES_H +#define AVUTIL_DES_H + +#include + +/** + * @defgroup lavu_des DES + * @ingroup lavu_crypto + * @{ + */ + +typedef struct AVDES { + uint64_t round_keys[3][16]; + int triple_des; +} AVDES; + +/** + * Allocate an AVDES context. + */ +AVDES *av_des_alloc(void); + +/** + * @brief Initializes an AVDES context. + * + * @param key_bits must be 64 or 192 + * @param decrypt 0 for encryption/CBC-MAC, 1 for decryption + * @return zero on success, negative value otherwise + */ +int av_des_init(struct AVDES *d, const uint8_t *key, int key_bits, int decrypt); + +/** + * @brief Encrypts / decrypts using the DES algorithm. + * + * @param count number of 8 byte blocks + * @param dst destination array, can be equal to src, must be 8-byte aligned + * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL + * @param iv initialization vector for CBC mode, if NULL then ECB will be used, + * must be 8-byte aligned + * @param decrypt 0 for encryption, 1 for decryption + */ +void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); + +/** + * @brief Calculates CBC-MAC using the DES algorithm. + * + * @param count number of 8 byte blocks + * @param dst destination array, can be equal to src, must be 8-byte aligned + * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL + */ +void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count); + +/** + * @} + */ + +#endif /* AVUTIL_DES_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/dict.h b/Src/Decoder_H264_ALL/include/libavutil/dict.h new file mode 100644 index 0000000..118f1f0 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/dict.h @@ -0,0 +1,200 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Public dictionary API. + * @deprecated + * AVDictionary is provided for compatibility with libav. It is both in + * implementation as well as API inefficient. It does not scale and is + * extremely slow with large dictionaries. + * It is recommended that new code uses our tree container from tree.c/h + * where applicable, which uses AVL trees to achieve O(log n) performance. + */ + +#ifndef AVUTIL_DICT_H +#define AVUTIL_DICT_H + +#include + +#include "version.h" + +/** + * @addtogroup lavu_dict AVDictionary + * @ingroup lavu_data + * + * @brief Simple key:value store + * + * @{ + * Dictionaries are used for storing key:value pairs. To create + * an AVDictionary, simply pass an address of a NULL pointer to + * av_dict_set(). NULL can be used as an empty dictionary wherever + * a pointer to an AVDictionary is required. + * Use av_dict_get() to retrieve an entry or iterate over all + * entries and finally av_dict_free() to free the dictionary + * and all its contents. + * + @code + AVDictionary *d = NULL; // "create" an empty dictionary + AVDictionaryEntry *t = NULL; + + av_dict_set(&d, "foo", "bar", 0); // add an entry + + char *k = av_strdup("key"); // if your strings are already allocated, + char *v = av_strdup("value"); // you can avoid copying them like this + av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL); + + while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) { + <....> // iterate over all entries in d + } + av_dict_free(&d); + @endcode + */ + +#define AV_DICT_MATCH_CASE 1 /**< Only get an entry with exact-case key match. Only relevant in av_dict_get(). */ +#define AV_DICT_IGNORE_SUFFIX 2 /**< Return first entry in a dictionary whose first part corresponds to the search key, + ignoring the suffix of the found key string. Only relevant in av_dict_get(). */ +#define AV_DICT_DONT_STRDUP_KEY 4 /**< Take ownership of a key that's been + allocated with av_malloc() or another memory allocation function. */ +#define AV_DICT_DONT_STRDUP_VAL 8 /**< Take ownership of a value that's been + allocated with av_malloc() or another memory allocation function. */ +#define AV_DICT_DONT_OVERWRITE 16 ///< Don't overwrite existing entries. +#define AV_DICT_APPEND 32 /**< If the entry already exists, append to it. Note that no + delimiter is added, the strings are simply concatenated. */ +#define AV_DICT_MULTIKEY 64 /**< Allow to store several equal keys in the dictionary */ + +typedef struct AVDictionaryEntry { + char *key; + char *value; +} AVDictionaryEntry; + +typedef struct AVDictionary AVDictionary; + +/** + * Get a dictionary entry with matching key. + * + * The returned entry key or value must not be changed, or it will + * cause undefined behavior. + * + * To iterate through all the dictionary entries, you can set the matching key + * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. + * + * @param prev Set to the previous matching element to find the next. + * If set to NULL the first matching element is returned. + * @param key matching key + * @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved + * @return found entry or NULL in case no matching entry was found in the dictionary + */ +AVDictionaryEntry *av_dict_get(const AVDictionary *m, const char *key, + const AVDictionaryEntry *prev, int flags); + +/** + * Get number of entries in dictionary. + * + * @param m dictionary + * @return number of entries in dictionary + */ +int av_dict_count(const AVDictionary *m); + +/** + * Set the given entry in *pm, overwriting an existing entry. + * + * Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set, + * these arguments will be freed on error. + * + * Warning: Adding a new entry to a dictionary invalidates all existing entries + * previously returned with av_dict_get. + * + * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL + * a dictionary struct is allocated and put in *pm. + * @param key entry key to add to *pm (will either be av_strduped or added as a new key depending on flags) + * @param value entry value to add to *pm (will be av_strduped or added as a new key depending on flags). + * Passing a NULL value will cause an existing entry to be deleted. + * @return >= 0 on success otherwise an error code <0 + */ +int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags); + +/** + * Convenience wrapper for av_dict_set that converts the value to a string + * and stores it. + * + * Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. + */ +int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags); + +/** + * Parse the key/value pairs list and add the parsed entries to a dictionary. + * + * In case of failure, all the successfully set entries are stored in + * *pm. You may need to manually free the created dictionary. + * + * @param key_val_sep a 0-terminated list of characters used to separate + * key from value + * @param pairs_sep a 0-terminated list of characters used to separate + * two pairs from each other + * @param flags flags to use when adding to dictionary. + * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL + * are ignored since the key/value tokens will always + * be duplicated. + * @return 0 on success, negative AVERROR code on failure + */ +int av_dict_parse_string(AVDictionary **pm, const char *str, + const char *key_val_sep, const char *pairs_sep, + int flags); + +/** + * Copy entries from one AVDictionary struct into another. + * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, + * this function will allocate a struct for you and put it in *dst + * @param src pointer to source AVDictionary struct + * @param flags flags to use when setting entries in *dst + * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag + * @return 0 on success, negative AVERROR code on failure. If dst was allocated + * by this function, callers should free the associated memory. + */ +int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags); + +/** + * Free all the memory allocated for an AVDictionary struct + * and all keys and values. + */ +void av_dict_free(AVDictionary **m); + +/** + * Get dictionary entries as a string. + * + * Create a string containing dictionary's entries. + * Such string may be passed back to av_dict_parse_string(). + * @note String is escaped with backslashes ('\'). + * + * @param[in] m dictionary + * @param[out] buffer Pointer to buffer that will be allocated with string containg entries. + * Buffer must be freed by the caller when is no longer needed. + * @param[in] key_val_sep character used to separate key from value + * @param[in] pairs_sep character used to separate two pairs from each other + * @return >= 0 on success, negative on error + * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. + */ +int av_dict_get_string(const AVDictionary *m, char **buffer, + const char key_val_sep, const char pairs_sep); + +/** + * @} + */ + +#endif /* AVUTIL_DICT_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/display.h b/Src/Decoder_H264_ALL/include/libavutil/display.h new file mode 100644 index 0000000..39c15ee --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/display.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2014 Vittorio Giovara + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_DISPLAY_H +#define AVUTIL_DISPLAY_H + +#include +#include "common.h" + +/** + * The display transformation matrix specifies an affine transformation that + * should be applied to video frames for correct presentation. It is compatible + * with the matrices stored in the ISO/IEC 14496-12 container format. + * + * The data is a 3x3 matrix represented as a 9-element array: + * + * | a b u | + * (a, b, u, c, d, v, x, y, w) -> | c d v | + * | x y w | + * + * All numbers are stored in native endianness, as 16.16 fixed-point values, + * except for u, v and w, which are stored as 2.30 fixed-point values. + * + * The transformation maps a point (p, q) in the source (pre-transformation) + * frame to the point (p', q') in the destination (post-transformation) frame as + * follows: + * | a b u | + * (p, q, 1) . | c d v | = z * (p', q', 1) + * | x y w | + * + * The transformation can also be more explicitly written in components as + * follows: + * p' = (a * p + c * q + x) / z; + * q' = (b * p + d * q + y) / z; + * z = u * p + v * q + w + */ + +/** + * Extract the rotation component of the transformation matrix. + * + * @param matrix the transformation matrix + * @return the angle (in degrees) by which the transformation rotates the frame + * counterclockwise. The angle will be in range [-180.0, 180.0], + * or NaN if the matrix is singular. + * + * @note floating point numbers are inherently inexact, so callers are + * recommended to round the return value to nearest integer before use. + */ +double av_display_rotation_get(const int32_t matrix[9]); + +/** + * Initialize a transformation matrix describing a pure counterclockwise + * rotation by the specified angle (in degrees). + * + * @param matrix an allocated transformation matrix (will be fully overwritten + * by this function) + * @param angle rotation angle in degrees. + */ +void av_display_rotation_set(int32_t matrix[9], double angle); + +/** + * Flip the input matrix horizontally and/or vertically. + * + * @param matrix an allocated transformation matrix + * @param hflip whether the matrix should be flipped horizontally + * @param vflip whether the matrix should be flipped vertically + */ +void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip); + +#endif /* AVUTIL_DISPLAY_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/downmix_info.h b/Src/Decoder_H264_ALL/include/libavutil/downmix_info.h new file mode 100644 index 0000000..221cf5b --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/downmix_info.h @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2014 Tim Walker + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_DOWNMIX_INFO_H +#define AVUTIL_DOWNMIX_INFO_H + +#include "frame.h" + +/** + * @file + * audio downmix medatata + */ + +/** + * @addtogroup lavu_audio + * @{ + */ + +/** + * @defgroup downmix_info Audio downmix metadata + * @{ + */ + +/** + * Possible downmix types. + */ +enum AVDownmixType { + AV_DOWNMIX_TYPE_UNKNOWN, /**< Not indicated. */ + AV_DOWNMIX_TYPE_LORO, /**< Lo/Ro 2-channel downmix (Stereo). */ + AV_DOWNMIX_TYPE_LTRT, /**< Lt/Rt 2-channel downmix, Dolby Surround compatible. */ + AV_DOWNMIX_TYPE_DPLII, /**< Lt/Rt 2-channel downmix, Dolby Pro Logic II compatible. */ + AV_DOWNMIX_TYPE_NB /**< Number of downmix types. Not part of ABI. */ +}; + +/** + * This structure describes optional metadata relevant to a downmix procedure. + * + * All fields are set by the decoder to the value indicated in the audio + * bitstream (if present), or to a "sane" default otherwise. + */ +typedef struct AVDownmixInfo { + /** + * Type of downmix preferred by the mastering engineer. + */ + enum AVDownmixType preferred_downmix_type; + + /** + * Absolute scale factor representing the nominal level of the center + * channel during a regular downmix. + */ + double center_mix_level; + + /** + * Absolute scale factor representing the nominal level of the center + * channel during an Lt/Rt compatible downmix. + */ + double center_mix_level_ltrt; + + /** + * Absolute scale factor representing the nominal level of the surround + * channels during a regular downmix. + */ + double surround_mix_level; + + /** + * Absolute scale factor representing the nominal level of the surround + * channels during an Lt/Rt compatible downmix. + */ + double surround_mix_level_ltrt; + + /** + * Absolute scale factor representing the level at which the LFE data is + * mixed into L/R channels during downmixing. + */ + double lfe_mix_level; +} AVDownmixInfo; + +/** + * Get a frame's AV_FRAME_DATA_DOWNMIX_INFO side data for editing. + * + * If the side data is absent, it is created and added to the frame. + * + * @param frame the frame for which the side data is to be obtained or created + * + * @return the AVDownmixInfo structure to be edited by the caller, or NULL if + * the structure cannot be allocated. + */ +AVDownmixInfo *av_downmix_info_update_side_data(AVFrame *frame); + +/** + * @} + */ + +/** + * @} + */ + +#endif /* AVUTIL_DOWNMIX_INFO_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/error.h b/Src/Decoder_H264_ALL/include/libavutil/error.h new file mode 100644 index 0000000..71df4da --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/error.h @@ -0,0 +1,126 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * error code definitions + */ + +#ifndef AVUTIL_ERROR_H +#define AVUTIL_ERROR_H + +#include +#include + +/** + * @addtogroup lavu_error + * + * @{ + */ + + +/* error handling */ +#if EDOM > 0 +#define AVERROR(e) (-(e)) ///< Returns a negative error code from a POSIX error code, to return from library functions. +#define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value. +#else +/* Some platforms have E* and errno already negated. */ +#define AVERROR(e) (e) +#define AVUNERROR(e) (e) +#endif + +#define FFERRTAG(a, b, c, d) (-(int)MKTAG(a, b, c, d)) + +#define AVERROR_BSF_NOT_FOUND FFERRTAG(0xF8,'B','S','F') ///< Bitstream filter not found +#define AVERROR_BUG FFERRTAG( 'B','U','G','!') ///< Internal bug, also see AVERROR_BUG2 +#define AVERROR_BUFFER_TOO_SMALL FFERRTAG( 'B','U','F','S') ///< Buffer too small +#define AVERROR_DECODER_NOT_FOUND FFERRTAG(0xF8,'D','E','C') ///< Decoder not found +#define AVERROR_DEMUXER_NOT_FOUND FFERRTAG(0xF8,'D','E','M') ///< Demuxer not found +#define AVERROR_ENCODER_NOT_FOUND FFERRTAG(0xF8,'E','N','C') ///< Encoder not found +#define AVERROR_EOF FFERRTAG( 'E','O','F',' ') ///< End of file +#define AVERROR_EXIT FFERRTAG( 'E','X','I','T') ///< Immediate exit was requested; the called function should not be restarted +#define AVERROR_EXTERNAL FFERRTAG( 'E','X','T',' ') ///< Generic error in an external library +#define AVERROR_FILTER_NOT_FOUND FFERRTAG(0xF8,'F','I','L') ///< Filter not found +#define AVERROR_INVALIDDATA FFERRTAG( 'I','N','D','A') ///< Invalid data found when processing input +#define AVERROR_MUXER_NOT_FOUND FFERRTAG(0xF8,'M','U','X') ///< Muxer not found +#define AVERROR_OPTION_NOT_FOUND FFERRTAG(0xF8,'O','P','T') ///< Option not found +#define AVERROR_PATCHWELCOME FFERRTAG( 'P','A','W','E') ///< Not yet implemented in FFmpeg, patches welcome +#define AVERROR_PROTOCOL_NOT_FOUND FFERRTAG(0xF8,'P','R','O') ///< Protocol not found + +#define AVERROR_STREAM_NOT_FOUND FFERRTAG(0xF8,'S','T','R') ///< Stream not found +/** + * This is semantically identical to AVERROR_BUG + * it has been introduced in Libav after our AVERROR_BUG and with a modified value. + */ +#define AVERROR_BUG2 FFERRTAG( 'B','U','G',' ') +#define AVERROR_UNKNOWN FFERRTAG( 'U','N','K','N') ///< Unknown error, typically from an external library +#define AVERROR_EXPERIMENTAL (-0x2bb2afa8) ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. +#define AVERROR_INPUT_CHANGED (-0x636e6701) ///< Input changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_OUTPUT_CHANGED) +#define AVERROR_OUTPUT_CHANGED (-0x636e6702) ///< Output changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_INPUT_CHANGED) +/* HTTP & RTSP errors */ +#define AVERROR_HTTP_BAD_REQUEST FFERRTAG(0xF8,'4','0','0') +#define AVERROR_HTTP_UNAUTHORIZED FFERRTAG(0xF8,'4','0','1') +#define AVERROR_HTTP_FORBIDDEN FFERRTAG(0xF8,'4','0','3') +#define AVERROR_HTTP_NOT_FOUND FFERRTAG(0xF8,'4','0','4') +#define AVERROR_HTTP_OTHER_4XX FFERRTAG(0xF8,'4','X','X') +#define AVERROR_HTTP_SERVER_ERROR FFERRTAG(0xF8,'5','X','X') + +#define AV_ERROR_MAX_STRING_SIZE 64 + +/** + * Put a description of the AVERROR code errnum in errbuf. + * In case of failure the global variable errno is set to indicate the + * error. Even in case of failure av_strerror() will print a generic + * error message indicating the errnum provided to errbuf. + * + * @param errnum error code to describe + * @param errbuf buffer to which description is written + * @param errbuf_size the size in bytes of errbuf + * @return 0 on success, a negative value if a description for errnum + * cannot be found + */ +int av_strerror(int errnum, char *errbuf, size_t errbuf_size); + +/** + * Fill the provided buffer with a string containing an error string + * corresponding to the AVERROR code errnum. + * + * @param errbuf a buffer + * @param errbuf_size size in bytes of errbuf + * @param errnum error code to describe + * @return the buffer in input, filled with the error description + * @see av_strerror() + */ +static inline char *av_make_error_string(char *errbuf, size_t errbuf_size, int errnum) +{ + av_strerror(errnum, errbuf, errbuf_size); + return errbuf; +} + +/** + * Convenience macro, the return value should be used only directly in + * function arguments but never stand-alone. + */ +#define av_err2str(errnum) \ + av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum) + +/** + * @} + */ + +#endif /* AVUTIL_ERROR_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/eval.h b/Src/Decoder_H264_ALL/include/libavutil/eval.h new file mode 100644 index 0000000..dacd22b --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/eval.h @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2002 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * simple arithmetic expression evaluator + */ + +#ifndef AVUTIL_EVAL_H +#define AVUTIL_EVAL_H + +#include "avutil.h" + +typedef struct AVExpr AVExpr; + +/** + * Parse and evaluate an expression. + * Note, this is significantly slower than av_expr_eval(). + * + * @param res a pointer to a double where is put the result value of + * the expression, or NAN in case of error + * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)" + * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0} + * @param const_values a zero terminated array of values for the identifiers from const_names + * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers + * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument + * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers + * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments + * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2 + * @param log_ctx parent logging context + * @return >= 0 in case of success, a negative value corresponding to an + * AVERROR code otherwise + */ +int av_expr_parse_and_eval(double *res, const char *s, + const char * const *const_names, const double *const_values, + const char * const *func1_names, double (* const *funcs1)(void *, double), + const char * const *func2_names, double (* const *funcs2)(void *, double, double), + void *opaque, int log_offset, void *log_ctx); + +/** + * Parse an expression. + * + * @param expr a pointer where is put an AVExpr containing the parsed + * value in case of successful parsing, or NULL otherwise. + * The pointed to AVExpr must be freed with av_expr_free() by the user + * when it is not needed anymore. + * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)" + * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0} + * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers + * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument + * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers + * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments + * @param log_ctx parent logging context + * @return >= 0 in case of success, a negative value corresponding to an + * AVERROR code otherwise + */ +int av_expr_parse(AVExpr **expr, const char *s, + const char * const *const_names, + const char * const *func1_names, double (* const *funcs1)(void *, double), + const char * const *func2_names, double (* const *funcs2)(void *, double, double), + int log_offset, void *log_ctx); + +/** + * Evaluate a previously parsed expression. + * + * @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names + * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2 + * @return the value of the expression + */ +double av_expr_eval(AVExpr *e, const double *const_values, void *opaque); + +/** + * Free a parsed expression previously created with av_expr_parse(). + */ +void av_expr_free(AVExpr *e); + +/** + * Parse the string in numstr and return its value as a double. If + * the string is empty, contains only whitespaces, or does not contain + * an initial substring that has the expected syntax for a + * floating-point number, no conversion is performed. In this case, + * returns a value of zero and the value returned in tail is the value + * of numstr. + * + * @param numstr a string representing a number, may contain one of + * the International System number postfixes, for example 'K', 'M', + * 'G'. If 'i' is appended after the postfix, powers of 2 are used + * instead of powers of 10. The 'B' postfix multiplies the value by + * 8, and can be appended after another postfix or used alone. This + * allows using for example 'KB', 'MiB', 'G' and 'B' as postfix. + * @param tail if non-NULL puts here the pointer to the char next + * after the last parsed character + */ +double av_strtod(const char *numstr, char **tail); + +#endif /* AVUTIL_EVAL_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/ffversion.h b/Src/Decoder_H264_ALL/include/libavutil/ffversion.h new file mode 100644 index 0000000..1cf0616 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/ffversion.h @@ -0,0 +1,5 @@ +/* Automatically generated by version.sh, do not manually edit! */ +#ifndef AVUTIL_FFVERSION_H +#define AVUTIL_FFVERSION_H +#define FFMPEG_VERSION "N-80999-gf41e37b" +#endif /* AVUTIL_FFVERSION_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/fifo.h b/Src/Decoder_H264_ALL/include/libavutil/fifo.h new file mode 100644 index 0000000..dc7bc6f --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/fifo.h @@ -0,0 +1,179 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * a very simple circular buffer FIFO implementation + */ + +#ifndef AVUTIL_FIFO_H +#define AVUTIL_FIFO_H + +#include +#include "avutil.h" +#include "attributes.h" + +typedef struct AVFifoBuffer { + uint8_t *buffer; + uint8_t *rptr, *wptr, *end; + uint32_t rndx, wndx; +} AVFifoBuffer; + +/** + * Initialize an AVFifoBuffer. + * @param size of FIFO + * @return AVFifoBuffer or NULL in case of memory allocation failure + */ +AVFifoBuffer *av_fifo_alloc(unsigned int size); + +/** + * Initialize an AVFifoBuffer. + * @param nmemb number of elements + * @param size size of the single element + * @return AVFifoBuffer or NULL in case of memory allocation failure + */ +AVFifoBuffer *av_fifo_alloc_array(size_t nmemb, size_t size); + +/** + * Free an AVFifoBuffer. + * @param f AVFifoBuffer to free + */ +void av_fifo_free(AVFifoBuffer *f); + +/** + * Free an AVFifoBuffer and reset pointer to NULL. + * @param f AVFifoBuffer to free + */ +void av_fifo_freep(AVFifoBuffer **f); + +/** + * Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied. + * @param f AVFifoBuffer to reset + */ +void av_fifo_reset(AVFifoBuffer *f); + +/** + * Return the amount of data in bytes in the AVFifoBuffer, that is the + * amount of data you can read from it. + * @param f AVFifoBuffer to read from + * @return size + */ +int av_fifo_size(const AVFifoBuffer *f); + +/** + * Return the amount of space in bytes in the AVFifoBuffer, that is the + * amount of data you can write into it. + * @param f AVFifoBuffer to write into + * @return size + */ +int av_fifo_space(const AVFifoBuffer *f); + +/** + * Feed data at specific position from an AVFifoBuffer to a user-supplied callback. + * Similar as av_fifo_gereric_read but without discarding data. + * @param f AVFifoBuffer to read from + * @param offset offset from current read position + * @param buf_size number of bytes to read + * @param func generic read function + * @param dest data destination + */ +int av_fifo_generic_peek_at(AVFifoBuffer *f, void *dest, int offset, int buf_size, void (*func)(void*, void*, int)); + +/** + * Feed data from an AVFifoBuffer to a user-supplied callback. + * Similar as av_fifo_gereric_read but without discarding data. + * @param f AVFifoBuffer to read from + * @param buf_size number of bytes to read + * @param func generic read function + * @param dest data destination + */ +int av_fifo_generic_peek(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int)); + +/** + * Feed data from an AVFifoBuffer to a user-supplied callback. + * @param f AVFifoBuffer to read from + * @param buf_size number of bytes to read + * @param func generic read function + * @param dest data destination + */ +int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int)); + +/** + * Feed data from a user-supplied callback to an AVFifoBuffer. + * @param f AVFifoBuffer to write to + * @param src data source; non-const since it may be used as a + * modifiable context by the function defined in func + * @param size number of bytes to write + * @param func generic write function; the first parameter is src, + * the second is dest_buf, the third is dest_buf_size. + * func must return the number of bytes written to dest_buf, or <= 0 to + * indicate no more data available to write. + * If func is NULL, src is interpreted as a simple byte array for source data. + * @return the number of bytes written to the FIFO + */ +int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int)); + +/** + * Resize an AVFifoBuffer. + * In case of reallocation failure, the old FIFO is kept unchanged. + * + * @param f AVFifoBuffer to resize + * @param size new AVFifoBuffer size in bytes + * @return <0 for failure, >=0 otherwise + */ +int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size); + +/** + * Enlarge an AVFifoBuffer. + * In case of reallocation failure, the old FIFO is kept unchanged. + * The new fifo size may be larger than the requested size. + * + * @param f AVFifoBuffer to resize + * @param additional_space the amount of space in bytes to allocate in addition to av_fifo_size() + * @return <0 for failure, >=0 otherwise + */ +int av_fifo_grow(AVFifoBuffer *f, unsigned int additional_space); + +/** + * Read and discard the specified amount of data from an AVFifoBuffer. + * @param f AVFifoBuffer to read from + * @param size amount of data to read in bytes + */ +void av_fifo_drain(AVFifoBuffer *f, int size); + +/** + * Return a pointer to the data stored in a FIFO buffer at a certain offset. + * The FIFO buffer is not modified. + * + * @param f AVFifoBuffer to peek at, f must be non-NULL + * @param offs an offset in bytes, its absolute value must be less + * than the used buffer size or the returned pointer will + * point outside to the buffer data. + * The used buffer size can be checked with av_fifo_size(). + */ +static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs) +{ + uint8_t *ptr = f->rptr + offs; + if (ptr >= f->end) + ptr = f->buffer + (ptr - f->end); + else if (ptr < f->buffer) + ptr = f->end - (f->buffer - ptr); + return ptr; +} + +#endif /* AVUTIL_FIFO_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/file.h b/Src/Decoder_H264_ALL/include/libavutil/file.h new file mode 100644 index 0000000..8666c7b --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/file.h @@ -0,0 +1,69 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_FILE_H +#define AVUTIL_FILE_H + +#include + +#include "avutil.h" + +/** + * @file + * Misc file utilities. + */ + +/** + * Read the file with name filename, and put its content in a newly + * allocated buffer or map it with mmap() when available. + * In case of success set *bufptr to the read or mmapped buffer, and + * *size to the size in bytes of the buffer in *bufptr. + * The returned buffer must be released with av_file_unmap(). + * + * @param log_offset loglevel offset used for logging + * @param log_ctx context used for logging + * @return a non negative number in case of success, a negative value + * corresponding to an AVERROR error code in case of failure + */ +av_warn_unused_result +int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, + int log_offset, void *log_ctx); + +/** + * Unmap or free the buffer bufptr created by av_file_map(). + * + * @param size size in bytes of bufptr, must be the same as returned + * by av_file_map() + */ +void av_file_unmap(uint8_t *bufptr, size_t size); + +/** + * Wrapper to work around the lack of mkstemp() on mingw. + * Also, tries to create file in /tmp first, if possible. + * *prefix can be a character constant; *filename will be allocated internally. + * @return file descriptor of opened file (or negative value corresponding to an + * AVERROR code on error) + * and opened file name in **filename. + * @note On very old libcs it is necessary to set a secure umask before + * calling this, av_tempfile() can't call umask itself as it is used in + * libraries and could interfere with the calling application. + * @deprecated as fd numbers cannot be passed saftely between libs on some platforms + */ +int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx); + +#endif /* AVUTIL_FILE_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/frame.h b/Src/Decoder_H264_ALL/include/libavutil/frame.h new file mode 100644 index 0000000..2b5c332 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/frame.h @@ -0,0 +1,746 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * @ingroup lavu_frame + * reference-counted frame API + */ + +#ifndef AVUTIL_FRAME_H +#define AVUTIL_FRAME_H + +#include + +#include "avutil.h" +#include "buffer.h" +#include "dict.h" +#include "rational.h" +#include "samplefmt.h" +#include "pixfmt.h" +#include "version.h" + + +/** + * @defgroup lavu_frame AVFrame + * @ingroup lavu_data + * + * @{ + * AVFrame is an abstraction for reference-counted raw multimedia data. + */ + +enum AVFrameSideDataType { + /** + * The data is the AVPanScan struct defined in libavcodec. + */ + AV_FRAME_DATA_PANSCAN, + /** + * ATSC A53 Part 4 Closed Captions. + * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. + * The number of bytes of CC data is AVFrameSideData.size. + */ + AV_FRAME_DATA_A53_CC, + /** + * Stereoscopic 3d metadata. + * The data is the AVStereo3D struct defined in libavutil/stereo3d.h. + */ + AV_FRAME_DATA_STEREO3D, + /** + * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h. + */ + AV_FRAME_DATA_MATRIXENCODING, + /** + * Metadata relevant to a downmix procedure. + * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h. + */ + AV_FRAME_DATA_DOWNMIX_INFO, + /** + * ReplayGain information in the form of the AVReplayGain struct. + */ + AV_FRAME_DATA_REPLAYGAIN, + /** + * This side data contains a 3x3 transformation matrix describing an affine + * transformation that needs to be applied to the frame for correct + * presentation. + * + * See libavutil/display.h for a detailed description of the data. + */ + AV_FRAME_DATA_DISPLAYMATRIX, + /** + * Active Format Description data consisting of a single byte as specified + * in ETSI TS 101 154 using AVActiveFormatDescription enum. + */ + AV_FRAME_DATA_AFD, + /** + * Motion vectors exported by some codecs (on demand through the export_mvs + * flag set in the libavcodec AVCodecContext flags2 option). + * The data is the AVMotionVector struct defined in + * libavutil/motion_vector.h. + */ + AV_FRAME_DATA_MOTION_VECTORS, + /** + * Recommmends skipping the specified number of samples. This is exported + * only if the "skip_manual" AVOption is set in libavcodec. + * This has the same format as AV_PKT_DATA_SKIP_SAMPLES. + * @code + * u32le number of samples to skip from start of this packet + * u32le number of samples to skip from end of this packet + * u8 reason for start skip + * u8 reason for end skip (0=padding silence, 1=convergence) + * @endcode + */ + AV_FRAME_DATA_SKIP_SAMPLES, + /** + * This side data must be associated with an audio frame and corresponds to + * enum AVAudioServiceType defined in avcodec.h. + */ + AV_FRAME_DATA_AUDIO_SERVICE_TYPE, + /** + * Mastering display metadata associated with a video frame. The payload is + * an AVMasteringDisplayMetadata type and contains information about the + * mastering display color volume. + */ + AV_FRAME_DATA_MASTERING_DISPLAY_METADATA, + /** + * The GOP timecode in 25 bit timecode format. Data format is 64-bit integer. + * This is set on the first frame of a GOP that has a temporal reference of 0. + */ + AV_FRAME_DATA_GOP_TIMECODE +}; + +enum AVActiveFormatDescription { + AV_AFD_SAME = 8, + AV_AFD_4_3 = 9, + AV_AFD_16_9 = 10, + AV_AFD_14_9 = 11, + AV_AFD_4_3_SP_14_9 = 13, + AV_AFD_16_9_SP_14_9 = 14, + AV_AFD_SP_4_3 = 15, +}; + + +/** + * Structure to hold side data for an AVFrame. + * + * sizeof(AVFrameSideData) is not a part of the public ABI, so new fields may be added + * to the end with a minor bump. + */ +typedef struct AVFrameSideData { + enum AVFrameSideDataType type; + uint8_t *data; + int size; + AVDictionary *metadata; + AVBufferRef *buf; +} AVFrameSideData; + +/** + * This structure describes decoded (raw) audio or video data. + * + * AVFrame must be allocated using av_frame_alloc(). Note that this only + * allocates the AVFrame itself, the buffers for the data must be managed + * through other means (see below). + * AVFrame must be freed with av_frame_free(). + * + * AVFrame is typically allocated once and then reused multiple times to hold + * different data (e.g. a single AVFrame to hold frames received from a + * decoder). In such a case, av_frame_unref() will free any references held by + * the frame and reset it to its original clean state before it + * is reused again. + * + * The data described by an AVFrame is usually reference counted through the + * AVBuffer API. The underlying buffer references are stored in AVFrame.buf / + * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at + * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, + * every single data plane must be contained in one of the buffers in + * AVFrame.buf or AVFrame.extended_buf. + * There may be a single buffer for all the data, or one separate buffer for + * each plane, or anything in between. + * + * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added + * to the end with a minor bump. + * Similarly fields that are marked as to be only accessed by + * av_opt_ptr() can be reordered. This allows 2 forks to add fields + * without breaking compatibility with each other. + * + * Fields can be accessed through AVOptions, the name string used, matches the + * C structure field name for fields accessable through AVOptions. The AVClass + * for AVFrame can be obtained from avcodec_get_frame_class() + */ +typedef struct AVFrame { +#define AV_NUM_DATA_POINTERS 8 + /** + * pointer to the picture/channel planes. + * This might be different from the first allocated byte + * + * Some decoders access areas outside 0,0 - width,height, please + * see avcodec_align_dimensions2(). Some filters and swscale can read + * up to 16 bytes beyond the planes, if these filters are to be used, + * then 16 extra bytes must be allocated. + * + * NOTE: Except for hwaccel formats, pointers not needed by the format + * MUST be set to NULL. + */ + uint8_t *data[AV_NUM_DATA_POINTERS]; + + /** + * For video, size in bytes of each picture line. + * For audio, size in bytes of each plane. + * + * For audio, only linesize[0] may be set. For planar audio, each channel + * plane must be the same size. + * + * For video the linesizes should be multiples of the CPUs alignment + * preference, this is 16 or 32 for modern desktop CPUs. + * Some code requires such alignment other code can be slower without + * correct alignment, for yet other it makes no difference. + * + * @note The linesize may be larger than the size of usable data -- there + * may be extra padding present for performance reasons. + */ + int linesize[AV_NUM_DATA_POINTERS]; + + /** + * pointers to the data planes/channels. + * + * For video, this should simply point to data[]. + * + * For planar audio, each channel has a separate data pointer, and + * linesize[0] contains the size of each channel buffer. + * For packed audio, there is just one data pointer, and linesize[0] + * contains the total size of the buffer for all channels. + * + * Note: Both data and extended_data should always be set in a valid frame, + * but for planar audio with more channels that can fit in data, + * extended_data must be used in order to access all channels. + */ + uint8_t **extended_data; + + /** + * width and height of the video frame + */ + int width, height; + + /** + * number of audio samples (per channel) described by this frame + */ + int nb_samples; + + /** + * format of the frame, -1 if unknown or unset + * Values correspond to enum AVPixelFormat for video frames, + * enum AVSampleFormat for audio) + */ + int format; + + /** + * 1 -> keyframe, 0-> not + */ + int key_frame; + + /** + * Picture type of the frame. + */ + enum AVPictureType pict_type; + + /** + * Sample aspect ratio for the video frame, 0/1 if unknown/unspecified. + */ + AVRational sample_aspect_ratio; + + /** + * Presentation timestamp in time_base units (time when frame should be shown to user). + */ + int64_t pts; + + /** + * PTS copied from the AVPacket that was decoded to produce this frame. + */ + int64_t pkt_pts; + + /** + * DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used) + * This is also the Presentation time of this AVFrame calculated from + * only AVPacket.dts values without pts values. + */ + int64_t pkt_dts; + + /** + * picture number in bitstream order + */ + int coded_picture_number; + /** + * picture number in display order + */ + int display_picture_number; + + /** + * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) + */ + int quality; + + /** + * for some private data of the user + */ + void *opaque; + +#if FF_API_ERROR_FRAME + /** + * @deprecated unused + */ + attribute_deprecated + uint64_t error[AV_NUM_DATA_POINTERS]; +#endif + + /** + * When decoding, this signals how much the picture must be delayed. + * extra_delay = repeat_pict / (2*fps) + */ + int repeat_pict; + + /** + * The content of the picture is interlaced. + */ + int interlaced_frame; + + /** + * If the content is interlaced, is top field displayed first. + */ + int top_field_first; + + /** + * Tell user application that palette has changed from previous frame. + */ + int palette_has_changed; + + /** + * reordered opaque 64 bits (generally an integer or a double precision float + * PTS but can be anything). + * The user sets AVCodecContext.reordered_opaque to represent the input at + * that time, + * the decoder reorders values as needed and sets AVFrame.reordered_opaque + * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque + * @deprecated in favor of pkt_pts + */ + int64_t reordered_opaque; + + /** + * Sample rate of the audio data. + */ + int sample_rate; + + /** + * Channel layout of the audio data. + */ + uint64_t channel_layout; + + /** + * AVBuffer references backing the data for this frame. If all elements of + * this array are NULL, then this frame is not reference counted. This array + * must be filled contiguously -- if buf[i] is non-NULL then buf[j] must + * also be non-NULL for all j < i. + * + * There may be at most one AVBuffer per data plane, so for video this array + * always contains all the references. For planar audio with more than + * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in + * this array. Then the extra AVBufferRef pointers are stored in the + * extended_buf array. + */ + AVBufferRef *buf[AV_NUM_DATA_POINTERS]; + + /** + * For planar audio which requires more than AV_NUM_DATA_POINTERS + * AVBufferRef pointers, this array will hold all the references which + * cannot fit into AVFrame.buf. + * + * Note that this is different from AVFrame.extended_data, which always + * contains all the pointers. This array only contains the extra pointers, + * which cannot fit into AVFrame.buf. + * + * This array is always allocated using av_malloc() by whoever constructs + * the frame. It is freed in av_frame_unref(). + */ + AVBufferRef **extended_buf; + /** + * Number of elements in extended_buf. + */ + int nb_extended_buf; + + AVFrameSideData **side_data; + int nb_side_data; + +/** + * @defgroup lavu_frame_flags AV_FRAME_FLAGS + * Flags describing additional frame properties. + * + * @{ + */ + +/** + * The frame data may be corrupted, e.g. due to decoding errors. + */ +#define AV_FRAME_FLAG_CORRUPT (1 << 0) +/** + * @} + */ + + /** + * Frame flags, a combination of @ref lavu_frame_flags + */ + int flags; + + /** + * MPEG vs JPEG YUV range. + * It must be accessed using av_frame_get_color_range() and + * av_frame_set_color_range(). + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVColorRange color_range; + + enum AVColorPrimaries color_primaries; + + enum AVColorTransferCharacteristic color_trc; + + /** + * YUV colorspace type. + * It must be accessed using av_frame_get_colorspace() and + * av_frame_set_colorspace(). + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVColorSpace colorspace; + + enum AVChromaLocation chroma_location; + + /** + * frame timestamp estimated using various heuristics, in stream time base + * Code outside libavutil should access this field using: + * av_frame_get_best_effort_timestamp(frame) + * - encoding: unused + * - decoding: set by libavcodec, read by user. + */ + int64_t best_effort_timestamp; + + /** + * reordered pos from the last AVPacket that has been input into the decoder + * Code outside libavutil should access this field using: + * av_frame_get_pkt_pos(frame) + * - encoding: unused + * - decoding: Read by user. + */ + int64_t pkt_pos; + + /** + * duration of the corresponding packet, expressed in + * AVStream->time_base units, 0 if unknown. + * Code outside libavutil should access this field using: + * av_frame_get_pkt_duration(frame) + * - encoding: unused + * - decoding: Read by user. + */ + int64_t pkt_duration; + + /** + * metadata. + * Code outside libavutil should access this field using: + * av_frame_get_metadata(frame) + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + AVDictionary *metadata; + + /** + * decode error flags of the frame, set to a combination of + * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there + * were errors during the decoding. + * Code outside libavutil should access this field using: + * av_frame_get_decode_error_flags(frame) + * - encoding: unused + * - decoding: set by libavcodec, read by user. + */ + int decode_error_flags; +#define FF_DECODE_ERROR_INVALID_BITSTREAM 1 +#define FF_DECODE_ERROR_MISSING_REFERENCE 2 + + /** + * number of audio channels, only used for audio. + * Code outside libavutil should access this field using: + * av_frame_get_channels(frame) + * - encoding: unused + * - decoding: Read by user. + */ + int channels; + + /** + * size of the corresponding packet containing the compressed + * frame. It must be accessed using av_frame_get_pkt_size() and + * av_frame_set_pkt_size(). + * It is set to a negative value if unknown. + * - encoding: unused + * - decoding: set by libavcodec, read by user. + */ + int pkt_size; + +#if FF_API_FRAME_QP + /** + * QP table + * Not to be accessed directly from outside libavutil + */ + attribute_deprecated + int8_t *qscale_table; + /** + * QP store stride + * Not to be accessed directly from outside libavutil + */ + attribute_deprecated + int qstride; + + attribute_deprecated + int qscale_type; + + /** + * Not to be accessed directly from outside libavutil + */ + AVBufferRef *qp_table_buf; +#endif + /** + * For hwaccel-format frames, this should be a reference to the + * AVHWFramesContext describing the frame. + */ + AVBufferRef *hw_frames_ctx; +} AVFrame; + +/** + * Accessors for some AVFrame fields. + * The position of these field in the structure is not part of the ABI, + * they should not be accessed directly outside libavutil. + */ +int64_t av_frame_get_best_effort_timestamp(const AVFrame *frame); +void av_frame_set_best_effort_timestamp(AVFrame *frame, int64_t val); +int64_t av_frame_get_pkt_duration (const AVFrame *frame); +void av_frame_set_pkt_duration (AVFrame *frame, int64_t val); +int64_t av_frame_get_pkt_pos (const AVFrame *frame); +void av_frame_set_pkt_pos (AVFrame *frame, int64_t val); +int64_t av_frame_get_channel_layout (const AVFrame *frame); +void av_frame_set_channel_layout (AVFrame *frame, int64_t val); +int av_frame_get_channels (const AVFrame *frame); +void av_frame_set_channels (AVFrame *frame, int val); +int av_frame_get_sample_rate (const AVFrame *frame); +void av_frame_set_sample_rate (AVFrame *frame, int val); +AVDictionary *av_frame_get_metadata (const AVFrame *frame); +void av_frame_set_metadata (AVFrame *frame, AVDictionary *val); +int av_frame_get_decode_error_flags (const AVFrame *frame); +void av_frame_set_decode_error_flags (AVFrame *frame, int val); +int av_frame_get_pkt_size(const AVFrame *frame); +void av_frame_set_pkt_size(AVFrame *frame, int val); +AVDictionary **avpriv_frame_get_metadatap(AVFrame *frame); +#if FF_API_FRAME_QP +int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type); +int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int type); +#endif +enum AVColorSpace av_frame_get_colorspace(const AVFrame *frame); +void av_frame_set_colorspace(AVFrame *frame, enum AVColorSpace val); +enum AVColorRange av_frame_get_color_range(const AVFrame *frame); +void av_frame_set_color_range(AVFrame *frame, enum AVColorRange val); + +/** + * Get the name of a colorspace. + * @return a static string identifying the colorspace; can be NULL. + */ +const char *av_get_colorspace_name(enum AVColorSpace val); + +/** + * Allocate an AVFrame and set its fields to default values. The resulting + * struct must be freed using av_frame_free(). + * + * @return An AVFrame filled with default values or NULL on failure. + * + * @note this only allocates the AVFrame itself, not the data buffers. Those + * must be allocated through other means, e.g. with av_frame_get_buffer() or + * manually. + */ +AVFrame *av_frame_alloc(void); + +/** + * Free the frame and any dynamically allocated objects in it, + * e.g. extended_data. If the frame is reference counted, it will be + * unreferenced first. + * + * @param frame frame to be freed. The pointer will be set to NULL. + */ +void av_frame_free(AVFrame **frame); + +/** + * Set up a new reference to the data described by the source frame. + * + * Copy frame properties from src to dst and create a new reference for each + * AVBufferRef from src. + * + * If src is not reference counted, new buffers are allocated and the data is + * copied. + * + * @warning: dst MUST have been either unreferenced with av_frame_unref(dst), + * or newly allocated with av_frame_alloc() before calling this + * function, or undefined behavior will occur. + * + * @return 0 on success, a negative AVERROR on error + */ +int av_frame_ref(AVFrame *dst, const AVFrame *src); + +/** + * Create a new frame that references the same data as src. + * + * This is a shortcut for av_frame_alloc()+av_frame_ref(). + * + * @return newly created AVFrame on success, NULL on error. + */ +AVFrame *av_frame_clone(const AVFrame *src); + +/** + * Unreference all the buffers referenced by frame and reset the frame fields. + */ +void av_frame_unref(AVFrame *frame); + +/** + * Move everything contained in src to dst and reset src. + * + * @warning: dst is not unreferenced, but directly overwritten without reading + * or deallocating its contents. Call av_frame_unref(dst) manually + * before calling this function to ensure that no memory is leaked. + */ +void av_frame_move_ref(AVFrame *dst, AVFrame *src); + +/** + * Allocate new buffer(s) for audio or video data. + * + * The following fields must be set on frame before calling this function: + * - format (pixel format for video, sample format for audio) + * - width and height for video + * - nb_samples and channel_layout for audio + * + * This function will fill AVFrame.data and AVFrame.buf arrays and, if + * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. + * For planar formats, one buffer will be allocated for each plane. + * + * @warning: if frame already has been allocated, calling this function will + * leak memory. In addition, undefined behavior can occur in certain + * cases. + * + * @param frame frame in which to store the new buffers. + * @param align required buffer size alignment + * + * @return 0 on success, a negative AVERROR on error. + */ +int av_frame_get_buffer(AVFrame *frame, int align); + +/** + * Check if the frame data is writable. + * + * @return A positive value if the frame data is writable (which is true if and + * only if each of the underlying buffers has only one reference, namely the one + * stored in this frame). Return 0 otherwise. + * + * If 1 is returned the answer is valid until av_buffer_ref() is called on any + * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). + * + * @see av_frame_make_writable(), av_buffer_is_writable() + */ +int av_frame_is_writable(AVFrame *frame); + +/** + * Ensure that the frame data is writable, avoiding data copy if possible. + * + * Do nothing if the frame is writable, allocate new buffers and copy the data + * if it is not. + * + * @return 0 on success, a negative AVERROR on error. + * + * @see av_frame_is_writable(), av_buffer_is_writable(), + * av_buffer_make_writable() + */ +int av_frame_make_writable(AVFrame *frame); + +/** + * Copy the frame data from src to dst. + * + * This function does not allocate anything, dst must be already initialized and + * allocated with the same parameters as src. + * + * This function only copies the frame data (i.e. the contents of the data / + * extended data arrays), not any other properties. + * + * @return >= 0 on success, a negative AVERROR on error. + */ +int av_frame_copy(AVFrame *dst, const AVFrame *src); + +/** + * Copy only "metadata" fields from src to dst. + * + * Metadata for the purpose of this function are those fields that do not affect + * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample + * aspect ratio (for video), but not width/height or channel layout. + * Side data is also copied. + */ +int av_frame_copy_props(AVFrame *dst, const AVFrame *src); + +/** + * Get the buffer reference a given data plane is stored in. + * + * @param plane index of the data plane of interest in frame->extended_data. + * + * @return the buffer reference that contains the plane or NULL if the input + * frame is not valid. + */ +AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane); + +/** + * Add a new side data to a frame. + * + * @param frame a frame to which the side data should be added + * @param type type of the added side data + * @param size size of the side data + * + * @return newly added side data on success, NULL on error + */ +AVFrameSideData *av_frame_new_side_data(AVFrame *frame, + enum AVFrameSideDataType type, + int size); + +/** + * @return a pointer to the side data of a given type on success, NULL if there + * is no side data with such type in this frame. + */ +AVFrameSideData *av_frame_get_side_data(const AVFrame *frame, + enum AVFrameSideDataType type); + +/** + * If side data of the supplied type exists in the frame, free it and remove it + * from the frame. + */ +void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type); + +/** + * @return a string identifying the side data type + */ +const char *av_frame_side_data_name(enum AVFrameSideDataType type); + +/** + * @} + */ + +#endif /* AVUTIL_FRAME_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/hash.h b/Src/Decoder_H264_ALL/include/libavutil/hash.h new file mode 100644 index 0000000..d4bcbf8 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/hash.h @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2013 Reimar D枚ffinger + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_HASH_H +#define AVUTIL_HASH_H + +#include + +struct AVHashContext; + +/** + * Allocate a hash context for the algorithm specified by name. + * + * @return >= 0 for success, a negative error code for failure + * @note The context is not initialized, you must call av_hash_init(). + */ +int av_hash_alloc(struct AVHashContext **ctx, const char *name); + +/** + * Get the names of available hash algorithms. + * + * This function can be used to enumerate the algorithms. + * + * @param i index of the hash algorithm, starting from 0 + * @return a pointer to a static string or NULL if i is out of range + */ +const char *av_hash_names(int i); + +/** + * Get the name of the algorithm corresponding to the given hash context. + */ +const char *av_hash_get_name(const struct AVHashContext *ctx); + +/** + * Maximum value that av_hash_get_size will currently return. + * + * You can use this if you absolutely want or need to use static allocation + * and are fine with not supporting hashes newly added to libavutil without + * recompilation. + * Note that you still need to check against av_hash_get_size, adding new hashes + * with larger sizes will not be considered an ABI change and should not cause + * your code to overflow a buffer. + */ +#define AV_HASH_MAX_SIZE 64 + +/** + * Get the size of the resulting hash value in bytes. + * + * The pointer passed to av_hash_final have space for at least this many bytes. + */ +int av_hash_get_size(const struct AVHashContext *ctx); + +/** + * Initialize or reset a hash context. + */ +void av_hash_init(struct AVHashContext *ctx); + +/** + * Update a hash context with additional data. + */ +void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len); + +/** + * Finalize a hash context and compute the actual hash value. + */ +void av_hash_final(struct AVHashContext *ctx, uint8_t *dst); + +/** + * Finalize a hash context and compute the actual hash value. + * If size is smaller than the hash size, the hash is truncated; + * if size is larger, the buffer is padded with 0. + */ +void av_hash_final_bin(struct AVHashContext *ctx, uint8_t *dst, int size); + +/** + * Finalize a hash context and compute the actual hash value as a hex string. + * The string is always 0-terminated. + * If size is smaller than 2 * hash_size + 1, the hex string is truncated. + */ +void av_hash_final_hex(struct AVHashContext *ctx, uint8_t *dst, int size); + +/** + * Finalize a hash context and compute the actual hash value as a base64 string. + * The string is always 0-terminated. + * If size is smaller than AV_BASE64_SIZE(hash_size), the base64 string is + * truncated. + */ +void av_hash_final_b64(struct AVHashContext *ctx, uint8_t *dst, int size); + +/** + * Free hash context. + */ +void av_hash_freep(struct AVHashContext **ctx); + +#endif /* AVUTIL_HASH_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/hmac.h b/Src/Decoder_H264_ALL/include/libavutil/hmac.h new file mode 100644 index 0000000..576a0a4 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/hmac.h @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2012 Martin Storsjo + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_HMAC_H +#define AVUTIL_HMAC_H + +#include + +#include "version.h" +/** + * @defgroup lavu_hmac HMAC + * @ingroup lavu_crypto + * @{ + */ + +enum AVHMACType { + AV_HMAC_MD5, + AV_HMAC_SHA1, + AV_HMAC_SHA224, + AV_HMAC_SHA256, + AV_HMAC_SHA384 = 12, + AV_HMAC_SHA512, +}; + +typedef struct AVHMAC AVHMAC; + +/** + * Allocate an AVHMAC context. + * @param type The hash function used for the HMAC. + */ +AVHMAC *av_hmac_alloc(enum AVHMACType type); + +/** + * Free an AVHMAC context. + * @param ctx The context to free, may be NULL + */ +void av_hmac_free(AVHMAC *ctx); + +/** + * Initialize an AVHMAC context with an authentication key. + * @param ctx The HMAC context + * @param key The authentication key + * @param keylen The length of the key, in bytes + */ +void av_hmac_init(AVHMAC *ctx, const uint8_t *key, unsigned int keylen); + +/** + * Hash data with the HMAC. + * @param ctx The HMAC context + * @param data The data to hash + * @param len The length of the data, in bytes + */ +void av_hmac_update(AVHMAC *ctx, const uint8_t *data, unsigned int len); + +/** + * Finish hashing and output the HMAC digest. + * @param ctx The HMAC context + * @param out The output buffer to write the digest into + * @param outlen The length of the out buffer, in bytes + * @return The number of bytes written to out, or a negative error code. + */ +int av_hmac_final(AVHMAC *ctx, uint8_t *out, unsigned int outlen); + +/** + * Hash an array of data with a key. + * @param ctx The HMAC context + * @param data The data to hash + * @param len The length of the data, in bytes + * @param key The authentication key + * @param keylen The length of the key, in bytes + * @param out The output buffer to write the digest into + * @param outlen The length of the out buffer, in bytes + * @return The number of bytes written to out, or a negative error code. + */ +int av_hmac_calc(AVHMAC *ctx, const uint8_t *data, unsigned int len, + const uint8_t *key, unsigned int keylen, + uint8_t *out, unsigned int outlen); + +/** + * @} + */ + +#endif /* AVUTIL_HMAC_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/hwcontext.h b/Src/Decoder_H264_ALL/include/libavutil/hwcontext.h new file mode 100644 index 0000000..4e9da02 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/hwcontext.h @@ -0,0 +1,428 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_HWCONTEXT_H +#define AVUTIL_HWCONTEXT_H + +#include "buffer.h" +#include "frame.h" +#include "log.h" +#include "pixfmt.h" + +enum AVHWDeviceType { + AV_HWDEVICE_TYPE_VDPAU, + AV_HWDEVICE_TYPE_CUDA, + AV_HWDEVICE_TYPE_VAAPI, + AV_HWDEVICE_TYPE_DXVA2, +}; + +typedef struct AVHWDeviceInternal AVHWDeviceInternal; + +/** + * This struct aggregates all the (hardware/vendor-specific) "high-level" state, + * i.e. state that is not tied to a concrete processing configuration. + * E.g., in an API that supports hardware-accelerated encoding and decoding, + * this struct will (if possible) wrap the state that is common to both encoding + * and decoding and from which specific instances of encoders or decoders can be + * derived. + * + * This struct is reference-counted with the AVBuffer mechanism. The + * av_hwdevice_ctx_alloc() constructor yields a reference, whose data field + * points to the actual AVHWDeviceContext. Further objects derived from + * AVHWDeviceContext (such as AVHWFramesContext, describing a frame pool with + * specific properties) will hold an internal reference to it. After all the + * references are released, the AVHWDeviceContext itself will be freed, + * optionally invoking a user-specified callback for uninitializing the hardware + * state. + */ +typedef struct AVHWDeviceContext { + /** + * A class for logging. Set by av_hwdevice_ctx_alloc(). + */ + const AVClass *av_class; + + /** + * Private data used internally by libavutil. Must not be accessed in any + * way by the caller. + */ + AVHWDeviceInternal *internal; + + /** + * This field identifies the underlying API used for hardware access. + * + * This field is set when this struct is allocated and never changed + * afterwards. + */ + enum AVHWDeviceType type; + + /** + * The format-specific data, allocated and freed by libavutil along with + * this context. + * + * Should be cast by the user to the format-specific context defined in the + * corresponding header (hwcontext_*.h) and filled as described in the + * documentation before calling av_hwdevice_ctx_init(). + * + * After calling av_hwdevice_ctx_init() this struct should not be modified + * by the caller. + */ + void *hwctx; + + /** + * This field may be set by the caller before calling av_hwdevice_ctx_init(). + * + * If non-NULL, this callback will be called when the last reference to + * this context is unreferenced, immediately before it is freed. + * + * @note when other objects (e.g an AVHWFramesContext) are derived from this + * struct, this callback will be invoked after all such child objects + * are fully uninitialized and their respective destructors invoked. + */ + void (*free)(struct AVHWDeviceContext *ctx); + + /** + * Arbitrary user data, to be used e.g. by the free() callback. + */ + void *user_opaque; +} AVHWDeviceContext; + +typedef struct AVHWFramesInternal AVHWFramesInternal; + +/** + * This struct describes a set or pool of "hardware" frames (i.e. those with + * data not located in normal system memory). All the frames in the pool are + * assumed to be allocated in the same way and interchangeable. + * + * This struct is reference-counted with the AVBuffer mechanism and tied to a + * given AVHWDeviceContext instance. The av_hwframe_ctx_alloc() constructor + * yields a reference, whose data field points to the actual AVHWFramesContext + * struct. + */ +typedef struct AVHWFramesContext { + /** + * A class for logging. + */ + const AVClass *av_class; + + /** + * Private data used internally by libavutil. Must not be accessed in any + * way by the caller. + */ + AVHWFramesInternal *internal; + + /** + * A reference to the parent AVHWDeviceContext. This reference is owned and + * managed by the enclosing AVHWFramesContext, but the caller may derive + * additional references from it. + */ + AVBufferRef *device_ref; + + /** + * The parent AVHWDeviceContext. This is simply a pointer to + * device_ref->data provided for convenience. + * + * Set by libavutil in av_hwframe_ctx_init(). + */ + AVHWDeviceContext *device_ctx; + + /** + * The format-specific data, allocated and freed automatically along with + * this context. + * + * Should be cast by the user to the format-specific context defined in the + * corresponding header (hwframe_*.h) and filled as described in the + * documentation before calling av_hwframe_ctx_init(). + * + * After any frames using this context are created, the contents of this + * struct should not be modified by the caller. + */ + void *hwctx; + + /** + * This field may be set by the caller before calling av_hwframe_ctx_init(). + * + * If non-NULL, this callback will be called when the last reference to + * this context is unreferenced, immediately before it is freed. + */ + void (*free)(struct AVHWFramesContext *ctx); + + /** + * Arbitrary user data, to be used e.g. by the free() callback. + */ + void *user_opaque; + + /** + * A pool from which the frames are allocated by av_hwframe_get_buffer(). + * This field may be set by the caller before calling av_hwframe_ctx_init(). + * The buffers returned by calling av_buffer_pool_get() on this pool must + * have the properties described in the documentation in the corresponding hw + * type's header (hwcontext_*.h). The pool will be freed strictly before + * this struct's free() callback is invoked. + * + * This field may be NULL, then libavutil will attempt to allocate a pool + * internally. Note that certain device types enforce pools allocated at + * fixed size (frame count), which cannot be extended dynamically. In such a + * case, initial_pool_size must be set appropriately. + */ + AVBufferPool *pool; + + /** + * Initial size of the frame pool. If a device type does not support + * dynamically resizing the pool, then this is also the maximum pool size. + * + * May be set by the caller before calling av_hwframe_ctx_init(). Must be + * set if pool is NULL and the device type does not support dynamic pools. + */ + int initial_pool_size; + + /** + * The pixel format identifying the underlying HW surface type. + * + * Must be a hwaccel format, i.e. the corresponding descriptor must have the + * AV_PIX_FMT_FLAG_HWACCEL flag set. + * + * Must be set by the user before calling av_hwframe_ctx_init(). + */ + enum AVPixelFormat format; + + /** + * The pixel format identifying the actual data layout of the hardware + * frames. + * + * Must be set by the caller before calling av_hwframe_ctx_init(). + * + * @note when the underlying API does not provide the exact data layout, but + * only the colorspace/bit depth, this field should be set to the fully + * planar version of that format (e.g. for 8-bit 420 YUV it should be + * AV_PIX_FMT_YUV420P, not AV_PIX_FMT_NV12 or anything else). + */ + enum AVPixelFormat sw_format; + + /** + * The allocated dimensions of the frames in this pool. + * + * Must be set by the user before calling av_hwframe_ctx_init(). + */ + int width, height; +} AVHWFramesContext; + +/** + * Allocate an AVHWDeviceContext for a given pixel format. + * + * @param format a hwaccel pixel format (AV_PIX_FMT_FLAG_HWACCEL must be set + * on the corresponding format descriptor) + * @return a reference to the newly created AVHWDeviceContext on success or NULL + * on failure. + */ +AVBufferRef *av_hwdevice_ctx_alloc(enum AVHWDeviceType type); + +/** + * Finalize the device context before use. This function must be called after + * the context is filled with all the required information and before it is + * used in any way. + * + * @param ref a reference to the AVHWDeviceContext + * @return 0 on success, a negative AVERROR code on failure + */ +int av_hwdevice_ctx_init(AVBufferRef *ref); + +/** + * Open a device of the specified type and create an AVHWDeviceContext for it. + * + * This is a convenience function intended to cover the simple cases. Callers + * who need to fine-tune device creation/management should open the device + * manually and then wrap it in an AVHWDeviceContext using + * av_hwdevice_ctx_alloc()/av_hwdevice_ctx_init(). + * + * The returned context is already initialized and ready for use, the caller + * should not call av_hwdevice_ctx_init() on it. The user_opaque/free fields of + * the created AVHWDeviceContext are set by this function and should not be + * touched by the caller. + * + * @param device_ctx On success, a reference to the newly-created device context + * will be written here. The reference is owned by the caller + * and must be released with av_buffer_unref() when no longer + * needed. On failure, NULL will be written to this pointer. + * @param type The type of the device to create. + * @param device A type-specific string identifying the device to open. + * @param opts A dictionary of additional (type-specific) options to use in + * opening the device. The dictionary remains owned by the caller. + * @param flags currently unused + * + * @return 0 on success, a negative AVERROR code on failure. + */ +int av_hwdevice_ctx_create(AVBufferRef **device_ctx, enum AVHWDeviceType type, + const char *device, AVDictionary *opts, int flags); + +/** + * Allocate an AVHWFramesContext tied to a given device context. + * + * @param device_ctx a reference to a AVHWDeviceContext. This function will make + * a new reference for internal use, the one passed to the + * function remains owned by the caller. + * @return a reference to the newly created AVHWFramesContext on success or NULL + * on failure. + */ +AVBufferRef *av_hwframe_ctx_alloc(AVBufferRef *device_ctx); + +/** + * Finalize the context before use. This function must be called after the + * context is filled with all the required information and before it is attached + * to any frames. + * + * @param ref a reference to the AVHWFramesContext + * @return 0 on success, a negative AVERROR code on failure + */ +int av_hwframe_ctx_init(AVBufferRef *ref); + +/** + * Allocate a new frame attached to the given AVHWFramesContext. + * + * @param hwframe_ctx a reference to an AVHWFramesContext + * @param frame an empty (freshly allocated or unreffed) frame to be filled with + * newly allocated buffers. + * @param flags currently unused, should be set to zero + * @return 0 on success, a negative AVERROR code on failure + */ +int av_hwframe_get_buffer(AVBufferRef *hwframe_ctx, AVFrame *frame, int flags); + +/** + * Copy data to or from a hw surface. At least one of dst/src must have an + * AVHWFramesContext attached. + * + * If src has an AVHWFramesContext attached, then the format of dst (if set) + * must use one of the formats returned by av_hwframe_transfer_get_formats(src, + * AV_HWFRAME_TRANSFER_DIRECTION_FROM). + * If dst has an AVHWFramesContext attached, then the format of src must use one + * of the formats returned by av_hwframe_transfer_get_formats(dst, + * AV_HWFRAME_TRANSFER_DIRECTION_TO) + * + * dst may be "clean" (i.e. with data/buf pointers unset), in which case the + * data buffers will be allocated by this function using av_frame_get_buffer(). + * If dst->format is set, then this format will be used, otherwise (when + * dst->format is AV_PIX_FMT_NONE) the first acceptable format will be chosen. + * + * @param dst the destination frame. dst is not touched on failure. + * @param src the source frame. + * @param flags currently unused, should be set to zero + * @return 0 on success, a negative AVERROR error code on failure. + */ +int av_hwframe_transfer_data(AVFrame *dst, const AVFrame *src, int flags); + +enum AVHWFrameTransferDirection { + /** + * Transfer the data from the queried hw frame. + */ + AV_HWFRAME_TRANSFER_DIRECTION_FROM, + + /** + * Transfer the data to the queried hw frame. + */ + AV_HWFRAME_TRANSFER_DIRECTION_TO, +}; + +/** + * Get a list of possible source or target formats usable in + * av_hwframe_transfer_data(). + * + * @param hwframe_ctx the frame context to obtain the information for + * @param dir the direction of the transfer + * @param formats the pointer to the output format list will be written here. + * The list is terminated with AV_PIX_FMT_NONE and must be freed + * by the caller when no longer needed using av_free(). + * If this function returns successfully, the format list will + * have at least one item (not counting the terminator). + * On failure, the contents of this pointer are unspecified. + * @param flags currently unused, should be set to zero + * @return 0 on success, a negative AVERROR code on failure. + */ +int av_hwframe_transfer_get_formats(AVBufferRef *hwframe_ctx, + enum AVHWFrameTransferDirection dir, + enum AVPixelFormat **formats, int flags); + + +/** + * This struct describes the constraints on hardware frames attached to + * a given device with a hardware-specific configuration. This is returned + * by av_hwdevice_get_hwframe_constraints() and must be freed by + * av_hwframe_constraints_free() after use. + */ +typedef struct AVHWFramesConstraints { + /** + * A list of possible values for format in the hw_frames_ctx, + * terminated by AV_PIX_FMT_NONE. This member will always be filled. + */ + enum AVPixelFormat *valid_hw_formats; + + /** + * A list of possible values for sw_format in the hw_frames_ctx, + * terminated by AV_PIX_FMT_NONE. Can be NULL if this information is + * not known. + */ + enum AVPixelFormat *valid_sw_formats; + + /** + * The minimum size of frames in this hw_frames_ctx. + * (Zero if not known.) + */ + int min_width; + int min_height; + + /** + * The maximum size of frames in this hw_frames_ctx. + * (INT_MAX if not known / no limit.) + */ + int max_width; + int max_height; +} AVHWFramesConstraints; + +/** + * Allocate a HW-specific configuration structure for a given HW device. + * After use, the user must free all members as required by the specific + * hardware structure being used, then free the structure itself with + * av_free(). + * + * @param device_ctx a reference to the associated AVHWDeviceContext. + * @return The newly created HW-specific configuration structure on + * success or NULL on failure. + */ +void *av_hwdevice_hwconfig_alloc(AVBufferRef *device_ctx); + +/** + * Get the constraints on HW frames given a device and the HW-specific + * configuration to be used with that device. If no HW-specific + * configuration is provided, returns the maximum possible capabilities + * of the device. + * + * @param device_ctx a reference to the associated AVHWDeviceContext. + * @param hwconfig a filled HW-specific configuration structure, or NULL + * to return the maximum possible capabilities of the device. + * @return AVHWFramesConstraints structure describing the constraints + * on the device, or NULL if not available. + */ +AVHWFramesConstraints *av_hwdevice_get_hwframe_constraints(AVBufferRef *ref, + const void *hwconfig); + +/** + * Free an AVHWFrameConstraints structure. + * + * @param constraints The (filled or unfilled) AVHWFrameConstraints structure. + */ +void av_hwframe_constraints_free(AVHWFramesConstraints **constraints); + +#endif /* AVUTIL_HWCONTEXT_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/hwcontext_cuda.h b/Src/Decoder_H264_ALL/include/libavutil/hwcontext_cuda.h new file mode 100644 index 0000000..23a77ce --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/hwcontext_cuda.h @@ -0,0 +1,46 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +#ifndef AVUTIL_HWCONTEXT_CUDA_H +#define AVUTIL_HWCONTEXT_CUDA_H + +#include + +#include "pixfmt.h" + +/** + * @file + * An API-specific header for AV_HWDEVICE_TYPE_CUDA. + * + * This API supports dynamic frame pools. AVHWFramesContext.pool must return + * AVBufferRefs whose data pointer is a CUdeviceptr. + */ + +/** + * This struct is allocated as AVHWDeviceContext.hwctx + */ +typedef struct AVCUDADeviceContext { + CUcontext cuda_ctx; +} AVCUDADeviceContext; + +/** + * AVHWFramesContext.hwctx is currently not used + */ + +#endif /* AVUTIL_HWCONTEXT_CUDA_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/hwcontext_dxva2.h b/Src/Decoder_H264_ALL/include/libavutil/hwcontext_dxva2.h new file mode 100644 index 0000000..6c36cb4 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/hwcontext_dxva2.h @@ -0,0 +1,72 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +#ifndef AVUTIL_HWCONTEXT_DXVA2_H +#define AVUTIL_HWCONTEXT_DXVA2_H + +/** + * @file + * An API-specific header for AV_HWDEVICE_TYPE_DXVA2. + * + * Only fixed-size pools are supported. + * + * For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs + * with the data pointer set to a pointer to IDirect3DSurface9. + */ + +#include +#include + +/** + * This struct is allocated as AVHWDeviceContext.hwctx + */ +typedef struct AVDXVA2DeviceContext { + IDirect3DDeviceManager9 *devmgr; +} AVDXVA2DeviceContext; + +/** + * This struct is allocated as AVHWFramesContext.hwctx + */ +typedef struct AVDXVA2FramesContext { + /** + * The surface type (e.g. DXVA2_VideoProcessorRenderTarget or + * DXVA2_VideoDecoderRenderTarget). Must be set by the caller. + */ + DWORD surface_type; + + /** + * The surface pool. When an external pool is not provided by the caller, + * this will be managed (allocated and filled on init, freed on uninit) by + * libavutil. + */ + IDirect3DSurface9 **surfaces; + int nb_surfaces; + + /** + * Certain drivers require the decoder to be destroyed before the surfaces. + * To allow internally managed pools to work properly in such cases, this + * field is provided. + * + * If it is non-NULL, libavutil will call IDirectXVideoDecoder_Release() on + * it just before the internal surface pool is freed. + */ + IDirectXVideoDecoder *decoder_to_release; +} AVDXVA2FramesContext; + +#endif /* AVUTIL_HWCONTEXT_DXVA2_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/hwcontext_vaapi.h b/Src/Decoder_H264_ALL/include/libavutil/hwcontext_vaapi.h new file mode 100644 index 0000000..7fd1a36 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/hwcontext_vaapi.h @@ -0,0 +1,82 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_HWCONTEXT_VAAPI_H +#define AVUTIL_HWCONTEXT_VAAPI_H + +#include + +/** + * @file + * API-specific header for AV_HWDEVICE_TYPE_VAAPI. + * + * Dynamic frame pools are supported, but note that any pool used as a render + * target is required to be of fixed size in order to be be usable as an + * argument to vaCreateContext(). + * + * For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs + * with the data pointer set to a VASurfaceID. + */ + +/** + * VAAPI connection details. + * + * Allocated as AVHWDeviceContext.hwctx + */ +typedef struct AVVAAPIDeviceContext { + /** + * The VADisplay handle, to be filled by the user. + */ + VADisplay display; +} AVVAAPIDeviceContext; + +/** + * VAAPI-specific data associated with a frame pool. + * + * Allocated as AVHWFramesContext.hwctx. + */ +typedef struct AVVAAPIFramesContext { + /** + * Set by the user to apply surface attributes to all surfaces in + * the frame pool. If null, default settings are used. + */ + VASurfaceAttrib *attributes; + int nb_attributes; + /** + * The surfaces IDs of all surfaces in the pool after creation. + * Only valid if AVHWFramesContext.initial_pool_size was positive. + * These are intended to be used as the render_targets arguments to + * vaCreateContext(). + */ + VASurfaceID *surface_ids; + int nb_surfaces; +} AVVAAPIFramesContext; + +/** + * VAAPI hardware pipeline configuration details. + * + * Allocated with av_hwdevice_hwconfig_alloc(). + */ +typedef struct AVVAAPIHWConfig { + /** + * ID of a VAAPI pipeline configuration. + */ + VAConfigID config_id; +} AVVAAPIHWConfig; + +#endif /* AVUTIL_HWCONTEXT_VAAPI_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/hwcontext_vdpau.h b/Src/Decoder_H264_ALL/include/libavutil/hwcontext_vdpau.h new file mode 100644 index 0000000..1b7ea1e --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/hwcontext_vdpau.h @@ -0,0 +1,44 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_HWCONTEXT_VDPAU_H +#define AVUTIL_HWCONTEXT_VDPAU_H + +#include + +/** + * @file + * An API-specific header for AV_HWDEVICE_TYPE_VDPAU. + * + * This API supports dynamic frame pools. AVHWFramesContext.pool must return + * AVBufferRefs whose data pointer is a VdpVideoSurface. + */ + +/** + * This struct is allocated as AVHWDeviceContext.hwctx + */ +typedef struct AVVDPAUDeviceContext { + VdpDevice device; + VdpGetProcAddress *get_proc_address; +} AVVDPAUDeviceContext; + +/** + * AVHWFramesContext.hwctx is currently not used + */ + +#endif /* AVUTIL_HWCONTEXT_VDPAU_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/imgutils.h b/Src/Decoder_H264_ALL/include/libavutil/imgutils.h new file mode 100644 index 0000000..23282a3 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/imgutils.h @@ -0,0 +1,213 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_IMGUTILS_H +#define AVUTIL_IMGUTILS_H + +/** + * @file + * misc image utilities + * + * @addtogroup lavu_picture + * @{ + */ + +#include "avutil.h" +#include "pixdesc.h" +#include "rational.h" + +/** + * Compute the max pixel step for each plane of an image with a + * format described by pixdesc. + * + * The pixel step is the distance in bytes between the first byte of + * the group of bytes which describe a pixel component and the first + * byte of the successive group in the same plane for the same + * component. + * + * @param max_pixsteps an array which is filled with the max pixel step + * for each plane. Since a plane may contain different pixel + * components, the computed max_pixsteps[plane] is relative to the + * component in the plane with the max pixel step. + * @param max_pixstep_comps an array which is filled with the component + * for each plane which has the max pixel step. May be NULL. + */ +void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], + const AVPixFmtDescriptor *pixdesc); + +/** + * Compute the size of an image line with format pix_fmt and width + * width for the plane plane. + * + * @return the computed size in bytes + */ +int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane); + +/** + * Fill plane linesizes for an image with pixel format pix_fmt and + * width width. + * + * @param linesizes array to be filled with the linesize for each plane + * @return >= 0 in case of success, a negative error code otherwise + */ +int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width); + +/** + * Fill plane data pointers for an image with pixel format pix_fmt and + * height height. + * + * @param data pointers array to be filled with the pointer for each image plane + * @param ptr the pointer to a buffer which will contain the image + * @param linesizes the array containing the linesize for each + * plane, should be filled by av_image_fill_linesizes() + * @return the size in bytes required for the image buffer, a negative + * error code in case of failure + */ +int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int height, + uint8_t *ptr, const int linesizes[4]); + +/** + * Allocate an image with size w and h and pixel format pix_fmt, and + * fill pointers and linesizes accordingly. + * The allocated image buffer has to be freed by using + * av_freep(&pointers[0]). + * + * @param align the value to use for buffer size alignment + * @return the size in bytes required for the image buffer, a negative + * error code in case of failure + */ +int av_image_alloc(uint8_t *pointers[4], int linesizes[4], + int w, int h, enum AVPixelFormat pix_fmt, int align); + +/** + * Copy image plane from src to dst. + * That is, copy "height" number of lines of "bytewidth" bytes each. + * The first byte of each successive line is separated by *_linesize + * bytes. + * + * bytewidth must be contained by both absolute values of dst_linesize + * and src_linesize, otherwise the function behavior is undefined. + * + * @param dst_linesize linesize for the image plane in dst + * @param src_linesize linesize for the image plane in src + */ +void av_image_copy_plane(uint8_t *dst, int dst_linesize, + const uint8_t *src, int src_linesize, + int bytewidth, int height); + +/** + * Copy image in src_data to dst_data. + * + * @param dst_linesizes linesizes for the image in dst_data + * @param src_linesizes linesizes for the image in src_data + */ +void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], + const uint8_t *src_data[4], const int src_linesizes[4], + enum AVPixelFormat pix_fmt, int width, int height); + +/** + * Setup the data pointers and linesizes based on the specified image + * parameters and the provided array. + * + * The fields of the given image are filled in by using the src + * address which points to the image data buffer. Depending on the + * specified pixel format, one or multiple image data pointers and + * line sizes will be set. If a planar format is specified, several + * pointers will be set pointing to the different picture planes and + * the line sizes of the different planes will be stored in the + * lines_sizes array. Call with src == NULL to get the required + * size for the src buffer. + * + * To allocate the buffer and fill in the dst_data and dst_linesize in + * one call, use av_image_alloc(). + * + * @param dst_data data pointers to be filled in + * @param dst_linesizes linesizes for the image in dst_data to be filled in + * @param src buffer which will contain or contains the actual image data, can be NULL + * @param pix_fmt the pixel format of the image + * @param width the width of the image in pixels + * @param height the height of the image in pixels + * @param align the value used in src for linesize alignment + * @return the size in bytes required for src, a negative error code + * in case of failure + */ +int av_image_fill_arrays(uint8_t *dst_data[4], int dst_linesize[4], + const uint8_t *src, + enum AVPixelFormat pix_fmt, int width, int height, int align); + +/** + * Return the size in bytes of the amount of data required to store an + * image with the given parameters. + * + * @param[in] align the assumed linesize alignment + */ +int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align); + +/** + * Copy image data from an image into a buffer. + * + * av_image_get_buffer_size() can be used to compute the required size + * for the buffer to fill. + * + * @param dst a buffer into which picture data will be copied + * @param dst_size the size in bytes of dst + * @param src_data pointers containing the source image data + * @param src_linesizes linesizes for the image in src_data + * @param pix_fmt the pixel format of the source image + * @param width the width of the source image in pixels + * @param height the height of the source image in pixels + * @param align the assumed linesize alignment for dst + * @return the number of bytes written to dst, or a negative value + * (error code) on error + */ +int av_image_copy_to_buffer(uint8_t *dst, int dst_size, + const uint8_t * const src_data[4], const int src_linesize[4], + enum AVPixelFormat pix_fmt, int width, int height, int align); + +/** + * Check if the given dimension of an image is valid, meaning that all + * bytes of the image can be addressed with a signed int. + * + * @param w the width of the picture + * @param h the height of the picture + * @param log_offset the offset to sum to the log level for logging with log_ctx + * @param log_ctx the parent logging context, it may be NULL + * @return >= 0 if valid, a negative error code otherwise + */ +int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx); + +/** + * Check if the given sample aspect ratio of an image is valid. + * + * It is considered invalid if the denominator is 0 or if applying the ratio + * to the image size would make the smaller dimension less than 1. If the + * sar numerator is 0, it is considered unknown and will return as valid. + * + * @param w width of the image + * @param h height of the image + * @param sar sample aspect ratio of the image + * @return 0 if valid, a negative AVERROR code otherwise + */ +int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar); + +/** + * @} + */ + + +#endif /* AVUTIL_IMGUTILS_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/intfloat.h b/Src/Decoder_H264_ALL/include/libavutil/intfloat.h new file mode 100644 index 0000000..fe3d7ec --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/intfloat.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2011 Mans Rullgard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_INTFLOAT_H +#define AVUTIL_INTFLOAT_H + +#include +#include "attributes.h" + +union av_intfloat32 { + uint32_t i; + float f; +}; + +union av_intfloat64 { + uint64_t i; + double f; +}; + +/** + * Reinterpret a 32-bit integer as a float. + */ +static av_always_inline float av_int2float(uint32_t i) +{ + union av_intfloat32 v; + v.i = i; + return v.f; +} + +/** + * Reinterpret a float as a 32-bit integer. + */ +static av_always_inline uint32_t av_float2int(float f) +{ + union av_intfloat32 v; + v.f = f; + return v.i; +} + +/** + * Reinterpret a 64-bit integer as a double. + */ +static av_always_inline double av_int2double(uint64_t i) +{ + union av_intfloat64 v; + v.i = i; + return v.f; +} + +/** + * Reinterpret a double as a 64-bit integer. + */ +static av_always_inline uint64_t av_double2int(double f) +{ + union av_intfloat64 v; + v.f = f; + return v.i; +} + +#endif /* AVUTIL_INTFLOAT_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/intreadwrite.h b/Src/Decoder_H264_ALL/include/libavutil/intreadwrite.h new file mode 100644 index 0000000..51fbe30 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/intreadwrite.h @@ -0,0 +1,629 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_INTREADWRITE_H +#define AVUTIL_INTREADWRITE_H + +#include +#include "libavutil/avconfig.h" +#include "attributes.h" +#include "bswap.h" + +typedef union { + uint64_t u64; + uint32_t u32[2]; + uint16_t u16[4]; + uint8_t u8 [8]; + double f64; + float f32[2]; +} av_alias av_alias64; + +typedef union { + uint32_t u32; + uint16_t u16[2]; + uint8_t u8 [4]; + float f32; +} av_alias av_alias32; + +typedef union { + uint16_t u16; + uint8_t u8 [2]; +} av_alias av_alias16; + +/* + * Arch-specific headers can provide any combination of + * AV_[RW][BLN](16|24|32|48|64) and AV_(COPY|SWAP|ZERO)(64|128) macros. + * Preprocessor symbols must be defined, even if these are implemented + * as inline functions. + * + * R/W means read/write, B/L/N means big/little/native endianness. + * The following macros require aligned access, compared to their + * unaligned variants: AV_(COPY|SWAP|ZERO)(64|128), AV_[RW]N[8-64]A. + * Incorrect usage may range from abysmal performance to crash + * depending on the platform. + * + * The unaligned variants are AV_[RW][BLN][8-64] and AV_COPY*U. + */ + +#ifdef HAVE_AV_CONFIG_H + +#include "config.h" + +#if ARCH_ARM +# include "arm/intreadwrite.h" +#elif ARCH_AVR32 +# include "avr32/intreadwrite.h" +#elif ARCH_MIPS +# include "mips/intreadwrite.h" +#elif ARCH_PPC +# include "ppc/intreadwrite.h" +#elif ARCH_TOMI +# include "tomi/intreadwrite.h" +#elif ARCH_X86 +# include "x86/intreadwrite.h" +#endif + +#endif /* HAVE_AV_CONFIG_H */ + +/* + * Map AV_RNXX <-> AV_R[BL]XX for all variants provided by per-arch headers. + */ + +#if AV_HAVE_BIGENDIAN + +# if defined(AV_RN16) && !defined(AV_RB16) +# define AV_RB16(p) AV_RN16(p) +# elif !defined(AV_RN16) && defined(AV_RB16) +# define AV_RN16(p) AV_RB16(p) +# endif + +# if defined(AV_WN16) && !defined(AV_WB16) +# define AV_WB16(p, v) AV_WN16(p, v) +# elif !defined(AV_WN16) && defined(AV_WB16) +# define AV_WN16(p, v) AV_WB16(p, v) +# endif + +# if defined(AV_RN24) && !defined(AV_RB24) +# define AV_RB24(p) AV_RN24(p) +# elif !defined(AV_RN24) && defined(AV_RB24) +# define AV_RN24(p) AV_RB24(p) +# endif + +# if defined(AV_WN24) && !defined(AV_WB24) +# define AV_WB24(p, v) AV_WN24(p, v) +# elif !defined(AV_WN24) && defined(AV_WB24) +# define AV_WN24(p, v) AV_WB24(p, v) +# endif + +# if defined(AV_RN32) && !defined(AV_RB32) +# define AV_RB32(p) AV_RN32(p) +# elif !defined(AV_RN32) && defined(AV_RB32) +# define AV_RN32(p) AV_RB32(p) +# endif + +# if defined(AV_WN32) && !defined(AV_WB32) +# define AV_WB32(p, v) AV_WN32(p, v) +# elif !defined(AV_WN32) && defined(AV_WB32) +# define AV_WN32(p, v) AV_WB32(p, v) +# endif + +# if defined(AV_RN48) && !defined(AV_RB48) +# define AV_RB48(p) AV_RN48(p) +# elif !defined(AV_RN48) && defined(AV_RB48) +# define AV_RN48(p) AV_RB48(p) +# endif + +# if defined(AV_WN48) && !defined(AV_WB48) +# define AV_WB48(p, v) AV_WN48(p, v) +# elif !defined(AV_WN48) && defined(AV_WB48) +# define AV_WN48(p, v) AV_WB48(p, v) +# endif + +# if defined(AV_RN64) && !defined(AV_RB64) +# define AV_RB64(p) AV_RN64(p) +# elif !defined(AV_RN64) && defined(AV_RB64) +# define AV_RN64(p) AV_RB64(p) +# endif + +# if defined(AV_WN64) && !defined(AV_WB64) +# define AV_WB64(p, v) AV_WN64(p, v) +# elif !defined(AV_WN64) && defined(AV_WB64) +# define AV_WN64(p, v) AV_WB64(p, v) +# endif + +#else /* AV_HAVE_BIGENDIAN */ + +# if defined(AV_RN16) && !defined(AV_RL16) +# define AV_RL16(p) AV_RN16(p) +# elif !defined(AV_RN16) && defined(AV_RL16) +# define AV_RN16(p) AV_RL16(p) +# endif + +# if defined(AV_WN16) && !defined(AV_WL16) +# define AV_WL16(p, v) AV_WN16(p, v) +# elif !defined(AV_WN16) && defined(AV_WL16) +# define AV_WN16(p, v) AV_WL16(p, v) +# endif + +# if defined(AV_RN24) && !defined(AV_RL24) +# define AV_RL24(p) AV_RN24(p) +# elif !defined(AV_RN24) && defined(AV_RL24) +# define AV_RN24(p) AV_RL24(p) +# endif + +# if defined(AV_WN24) && !defined(AV_WL24) +# define AV_WL24(p, v) AV_WN24(p, v) +# elif !defined(AV_WN24) && defined(AV_WL24) +# define AV_WN24(p, v) AV_WL24(p, v) +# endif + +# if defined(AV_RN32) && !defined(AV_RL32) +# define AV_RL32(p) AV_RN32(p) +# elif !defined(AV_RN32) && defined(AV_RL32) +# define AV_RN32(p) AV_RL32(p) +# endif + +# if defined(AV_WN32) && !defined(AV_WL32) +# define AV_WL32(p, v) AV_WN32(p, v) +# elif !defined(AV_WN32) && defined(AV_WL32) +# define AV_WN32(p, v) AV_WL32(p, v) +# endif + +# if defined(AV_RN48) && !defined(AV_RL48) +# define AV_RL48(p) AV_RN48(p) +# elif !defined(AV_RN48) && defined(AV_RL48) +# define AV_RN48(p) AV_RL48(p) +# endif + +# if defined(AV_WN48) && !defined(AV_WL48) +# define AV_WL48(p, v) AV_WN48(p, v) +# elif !defined(AV_WN48) && defined(AV_WL48) +# define AV_WN48(p, v) AV_WL48(p, v) +# endif + +# if defined(AV_RN64) && !defined(AV_RL64) +# define AV_RL64(p) AV_RN64(p) +# elif !defined(AV_RN64) && defined(AV_RL64) +# define AV_RN64(p) AV_RL64(p) +# endif + +# if defined(AV_WN64) && !defined(AV_WL64) +# define AV_WL64(p, v) AV_WN64(p, v) +# elif !defined(AV_WN64) && defined(AV_WL64) +# define AV_WN64(p, v) AV_WL64(p, v) +# endif + +#endif /* !AV_HAVE_BIGENDIAN */ + +/* + * Define AV_[RW]N helper macros to simplify definitions not provided + * by per-arch headers. + */ + +#if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__) + +union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias; +union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias; +union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias; + +# define AV_RN(s, p) (((const union unaligned_##s *) (p))->l) +# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v)) + +#elif defined(__DECC) + +# define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p))) +# define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v)) + +#elif AV_HAVE_FAST_UNALIGNED + +# define AV_RN(s, p) (((const av_alias##s*)(p))->u##s) +# define AV_WN(s, p, v) (((av_alias##s*)(p))->u##s = (v)) + +#else + +#ifndef AV_RB16 +# define AV_RB16(x) \ + ((((const uint8_t*)(x))[0] << 8) | \ + ((const uint8_t*)(x))[1]) +#endif +#ifndef AV_WB16 +# define AV_WB16(p, darg) do { \ + unsigned d = (darg); \ + ((uint8_t*)(p))[1] = (d); \ + ((uint8_t*)(p))[0] = (d)>>8; \ + } while(0) +#endif + +#ifndef AV_RL16 +# define AV_RL16(x) \ + ((((const uint8_t*)(x))[1] << 8) | \ + ((const uint8_t*)(x))[0]) +#endif +#ifndef AV_WL16 +# define AV_WL16(p, darg) do { \ + unsigned d = (darg); \ + ((uint8_t*)(p))[0] = (d); \ + ((uint8_t*)(p))[1] = (d)>>8; \ + } while(0) +#endif + +#ifndef AV_RB32 +# define AV_RB32(x) \ + (((uint32_t)((const uint8_t*)(x))[0] << 24) | \ + (((const uint8_t*)(x))[1] << 16) | \ + (((const uint8_t*)(x))[2] << 8) | \ + ((const uint8_t*)(x))[3]) +#endif +#ifndef AV_WB32 +# define AV_WB32(p, darg) do { \ + unsigned d = (darg); \ + ((uint8_t*)(p))[3] = (d); \ + ((uint8_t*)(p))[2] = (d)>>8; \ + ((uint8_t*)(p))[1] = (d)>>16; \ + ((uint8_t*)(p))[0] = (d)>>24; \ + } while(0) +#endif + +#ifndef AV_RL32 +# define AV_RL32(x) \ + (((uint32_t)((const uint8_t*)(x))[3] << 24) | \ + (((const uint8_t*)(x))[2] << 16) | \ + (((const uint8_t*)(x))[1] << 8) | \ + ((const uint8_t*)(x))[0]) +#endif +#ifndef AV_WL32 +# define AV_WL32(p, darg) do { \ + unsigned d = (darg); \ + ((uint8_t*)(p))[0] = (d); \ + ((uint8_t*)(p))[1] = (d)>>8; \ + ((uint8_t*)(p))[2] = (d)>>16; \ + ((uint8_t*)(p))[3] = (d)>>24; \ + } while(0) +#endif + +#ifndef AV_RB64 +# define AV_RB64(x) \ + (((uint64_t)((const uint8_t*)(x))[0] << 56) | \ + ((uint64_t)((const uint8_t*)(x))[1] << 48) | \ + ((uint64_t)((const uint8_t*)(x))[2] << 40) | \ + ((uint64_t)((const uint8_t*)(x))[3] << 32) | \ + ((uint64_t)((const uint8_t*)(x))[4] << 24) | \ + ((uint64_t)((const uint8_t*)(x))[5] << 16) | \ + ((uint64_t)((const uint8_t*)(x))[6] << 8) | \ + (uint64_t)((const uint8_t*)(x))[7]) +#endif +#ifndef AV_WB64 +# define AV_WB64(p, darg) do { \ + uint64_t d = (darg); \ + ((uint8_t*)(p))[7] = (d); \ + ((uint8_t*)(p))[6] = (d)>>8; \ + ((uint8_t*)(p))[5] = (d)>>16; \ + ((uint8_t*)(p))[4] = (d)>>24; \ + ((uint8_t*)(p))[3] = (d)>>32; \ + ((uint8_t*)(p))[2] = (d)>>40; \ + ((uint8_t*)(p))[1] = (d)>>48; \ + ((uint8_t*)(p))[0] = (d)>>56; \ + } while(0) +#endif + +#ifndef AV_RL64 +# define AV_RL64(x) \ + (((uint64_t)((const uint8_t*)(x))[7] << 56) | \ + ((uint64_t)((const uint8_t*)(x))[6] << 48) | \ + ((uint64_t)((const uint8_t*)(x))[5] << 40) | \ + ((uint64_t)((const uint8_t*)(x))[4] << 32) | \ + ((uint64_t)((const uint8_t*)(x))[3] << 24) | \ + ((uint64_t)((const uint8_t*)(x))[2] << 16) | \ + ((uint64_t)((const uint8_t*)(x))[1] << 8) | \ + (uint64_t)((const uint8_t*)(x))[0]) +#endif +#ifndef AV_WL64 +# define AV_WL64(p, darg) do { \ + uint64_t d = (darg); \ + ((uint8_t*)(p))[0] = (d); \ + ((uint8_t*)(p))[1] = (d)>>8; \ + ((uint8_t*)(p))[2] = (d)>>16; \ + ((uint8_t*)(p))[3] = (d)>>24; \ + ((uint8_t*)(p))[4] = (d)>>32; \ + ((uint8_t*)(p))[5] = (d)>>40; \ + ((uint8_t*)(p))[6] = (d)>>48; \ + ((uint8_t*)(p))[7] = (d)>>56; \ + } while(0) +#endif + +#if AV_HAVE_BIGENDIAN +# define AV_RN(s, p) AV_RB##s(p) +# define AV_WN(s, p, v) AV_WB##s(p, v) +#else +# define AV_RN(s, p) AV_RL##s(p) +# define AV_WN(s, p, v) AV_WL##s(p, v) +#endif + +#endif /* HAVE_FAST_UNALIGNED */ + +#ifndef AV_RN16 +# define AV_RN16(p) AV_RN(16, p) +#endif + +#ifndef AV_RN32 +# define AV_RN32(p) AV_RN(32, p) +#endif + +#ifndef AV_RN64 +# define AV_RN64(p) AV_RN(64, p) +#endif + +#ifndef AV_WN16 +# define AV_WN16(p, v) AV_WN(16, p, v) +#endif + +#ifndef AV_WN32 +# define AV_WN32(p, v) AV_WN(32, p, v) +#endif + +#ifndef AV_WN64 +# define AV_WN64(p, v) AV_WN(64, p, v) +#endif + +#if AV_HAVE_BIGENDIAN +# define AV_RB(s, p) AV_RN##s(p) +# define AV_WB(s, p, v) AV_WN##s(p, v) +# define AV_RL(s, p) av_bswap##s(AV_RN##s(p)) +# define AV_WL(s, p, v) AV_WN##s(p, av_bswap##s(v)) +#else +# define AV_RB(s, p) av_bswap##s(AV_RN##s(p)) +# define AV_WB(s, p, v) AV_WN##s(p, av_bswap##s(v)) +# define AV_RL(s, p) AV_RN##s(p) +# define AV_WL(s, p, v) AV_WN##s(p, v) +#endif + +#define AV_RB8(x) (((const uint8_t*)(x))[0]) +#define AV_WB8(p, d) do { ((uint8_t*)(p))[0] = (d); } while(0) + +#define AV_RL8(x) AV_RB8(x) +#define AV_WL8(p, d) AV_WB8(p, d) + +#ifndef AV_RB16 +# define AV_RB16(p) AV_RB(16, p) +#endif +#ifndef AV_WB16 +# define AV_WB16(p, v) AV_WB(16, p, v) +#endif + +#ifndef AV_RL16 +# define AV_RL16(p) AV_RL(16, p) +#endif +#ifndef AV_WL16 +# define AV_WL16(p, v) AV_WL(16, p, v) +#endif + +#ifndef AV_RB32 +# define AV_RB32(p) AV_RB(32, p) +#endif +#ifndef AV_WB32 +# define AV_WB32(p, v) AV_WB(32, p, v) +#endif + +#ifndef AV_RL32 +# define AV_RL32(p) AV_RL(32, p) +#endif +#ifndef AV_WL32 +# define AV_WL32(p, v) AV_WL(32, p, v) +#endif + +#ifndef AV_RB64 +# define AV_RB64(p) AV_RB(64, p) +#endif +#ifndef AV_WB64 +# define AV_WB64(p, v) AV_WB(64, p, v) +#endif + +#ifndef AV_RL64 +# define AV_RL64(p) AV_RL(64, p) +#endif +#ifndef AV_WL64 +# define AV_WL64(p, v) AV_WL(64, p, v) +#endif + +#ifndef AV_RB24 +# define AV_RB24(x) \ + ((((const uint8_t*)(x))[0] << 16) | \ + (((const uint8_t*)(x))[1] << 8) | \ + ((const uint8_t*)(x))[2]) +#endif +#ifndef AV_WB24 +# define AV_WB24(p, d) do { \ + ((uint8_t*)(p))[2] = (d); \ + ((uint8_t*)(p))[1] = (d)>>8; \ + ((uint8_t*)(p))[0] = (d)>>16; \ + } while(0) +#endif + +#ifndef AV_RL24 +# define AV_RL24(x) \ + ((((const uint8_t*)(x))[2] << 16) | \ + (((const uint8_t*)(x))[1] << 8) | \ + ((const uint8_t*)(x))[0]) +#endif +#ifndef AV_WL24 +# define AV_WL24(p, d) do { \ + ((uint8_t*)(p))[0] = (d); \ + ((uint8_t*)(p))[1] = (d)>>8; \ + ((uint8_t*)(p))[2] = (d)>>16; \ + } while(0) +#endif + +#ifndef AV_RB48 +# define AV_RB48(x) \ + (((uint64_t)((const uint8_t*)(x))[0] << 40) | \ + ((uint64_t)((const uint8_t*)(x))[1] << 32) | \ + ((uint64_t)((const uint8_t*)(x))[2] << 24) | \ + ((uint64_t)((const uint8_t*)(x))[3] << 16) | \ + ((uint64_t)((const uint8_t*)(x))[4] << 8) | \ + (uint64_t)((const uint8_t*)(x))[5]) +#endif +#ifndef AV_WB48 +# define AV_WB48(p, darg) do { \ + uint64_t d = (darg); \ + ((uint8_t*)(p))[5] = (d); \ + ((uint8_t*)(p))[4] = (d)>>8; \ + ((uint8_t*)(p))[3] = (d)>>16; \ + ((uint8_t*)(p))[2] = (d)>>24; \ + ((uint8_t*)(p))[1] = (d)>>32; \ + ((uint8_t*)(p))[0] = (d)>>40; \ + } while(0) +#endif + +#ifndef AV_RL48 +# define AV_RL48(x) \ + (((uint64_t)((const uint8_t*)(x))[5] << 40) | \ + ((uint64_t)((const uint8_t*)(x))[4] << 32) | \ + ((uint64_t)((const uint8_t*)(x))[3] << 24) | \ + ((uint64_t)((const uint8_t*)(x))[2] << 16) | \ + ((uint64_t)((const uint8_t*)(x))[1] << 8) | \ + (uint64_t)((const uint8_t*)(x))[0]) +#endif +#ifndef AV_WL48 +# define AV_WL48(p, darg) do { \ + uint64_t d = (darg); \ + ((uint8_t*)(p))[0] = (d); \ + ((uint8_t*)(p))[1] = (d)>>8; \ + ((uint8_t*)(p))[2] = (d)>>16; \ + ((uint8_t*)(p))[3] = (d)>>24; \ + ((uint8_t*)(p))[4] = (d)>>32; \ + ((uint8_t*)(p))[5] = (d)>>40; \ + } while(0) +#endif + +/* + * The AV_[RW]NA macros access naturally aligned data + * in a type-safe way. + */ + +#define AV_RNA(s, p) (((const av_alias##s*)(p))->u##s) +#define AV_WNA(s, p, v) (((av_alias##s*)(p))->u##s = (v)) + +#ifndef AV_RN16A +# define AV_RN16A(p) AV_RNA(16, p) +#endif + +#ifndef AV_RN32A +# define AV_RN32A(p) AV_RNA(32, p) +#endif + +#ifndef AV_RN64A +# define AV_RN64A(p) AV_RNA(64, p) +#endif + +#ifndef AV_WN16A +# define AV_WN16A(p, v) AV_WNA(16, p, v) +#endif + +#ifndef AV_WN32A +# define AV_WN32A(p, v) AV_WNA(32, p, v) +#endif + +#ifndef AV_WN64A +# define AV_WN64A(p, v) AV_WNA(64, p, v) +#endif + +/* + * The AV_COPYxxU macros are suitable for copying data to/from unaligned + * memory locations. + */ + +#define AV_COPYU(n, d, s) AV_WN##n(d, AV_RN##n(s)); + +#ifndef AV_COPY16U +# define AV_COPY16U(d, s) AV_COPYU(16, d, s) +#endif + +#ifndef AV_COPY32U +# define AV_COPY32U(d, s) AV_COPYU(32, d, s) +#endif + +#ifndef AV_COPY64U +# define AV_COPY64U(d, s) AV_COPYU(64, d, s) +#endif + +#ifndef AV_COPY128U +# define AV_COPY128U(d, s) \ + do { \ + AV_COPY64U(d, s); \ + AV_COPY64U((char *)(d) + 8, (const char *)(s) + 8); \ + } while(0) +#endif + +/* Parameters for AV_COPY*, AV_SWAP*, AV_ZERO* must be + * naturally aligned. They may be implemented using MMX, + * so emms_c() must be called before using any float code + * afterwards. + */ + +#define AV_COPY(n, d, s) \ + (((av_alias##n*)(d))->u##n = ((const av_alias##n*)(s))->u##n) + +#ifndef AV_COPY16 +# define AV_COPY16(d, s) AV_COPY(16, d, s) +#endif + +#ifndef AV_COPY32 +# define AV_COPY32(d, s) AV_COPY(32, d, s) +#endif + +#ifndef AV_COPY64 +# define AV_COPY64(d, s) AV_COPY(64, d, s) +#endif + +#ifndef AV_COPY128 +# define AV_COPY128(d, s) \ + do { \ + AV_COPY64(d, s); \ + AV_COPY64((char*)(d)+8, (char*)(s)+8); \ + } while(0) +#endif + +#define AV_SWAP(n, a, b) FFSWAP(av_alias##n, *(av_alias##n*)(a), *(av_alias##n*)(b)) + +#ifndef AV_SWAP64 +# define AV_SWAP64(a, b) AV_SWAP(64, a, b) +#endif + +#define AV_ZERO(n, d) (((av_alias##n*)(d))->u##n = 0) + +#ifndef AV_ZERO16 +# define AV_ZERO16(d) AV_ZERO(16, d) +#endif + +#ifndef AV_ZERO32 +# define AV_ZERO32(d) AV_ZERO(32, d) +#endif + +#ifndef AV_ZERO64 +# define AV_ZERO64(d) AV_ZERO(64, d) +#endif + +#ifndef AV_ZERO128 +# define AV_ZERO128(d) \ + do { \ + AV_ZERO64(d); \ + AV_ZERO64((char*)(d)+8); \ + } while(0) +#endif + +#endif /* AVUTIL_INTREADWRITE_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/lfg.h b/Src/Decoder_H264_ALL/include/libavutil/lfg.h new file mode 100644 index 0000000..ec90562 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/lfg.h @@ -0,0 +1,62 @@ +/* + * Lagged Fibonacci PRNG + * Copyright (c) 2008 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_LFG_H +#define AVUTIL_LFG_H + +typedef struct AVLFG { + unsigned int state[64]; + int index; +} AVLFG; + +void av_lfg_init(AVLFG *c, unsigned int seed); + +/** + * Get the next random unsigned 32-bit number using an ALFG. + * + * Please also consider a simple LCG like state= state*1664525+1013904223, + * it may be good enough and faster for your specific use case. + */ +static inline unsigned int av_lfg_get(AVLFG *c){ + c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; + return c->state[c->index++ & 63]; +} + +/** + * Get the next random unsigned 32-bit number using a MLFG. + * + * Please also consider av_lfg_get() above, it is faster. + */ +static inline unsigned int av_mlfg_get(AVLFG *c){ + unsigned int a= c->state[(c->index-55) & 63]; + unsigned int b= c->state[(c->index-24) & 63]; + return c->state[c->index++ & 63] = 2*a*b+a+b; +} + +/** + * Get the next two numbers generated by a Box-Muller Gaussian + * generator using the random numbers issued by lfg. + * + * @param out array where the two generated numbers are placed + */ +void av_bmg_get(AVLFG *lfg, double out[2]); + +#endif /* AVUTIL_LFG_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/log.h b/Src/Decoder_H264_ALL/include/libavutil/log.h new file mode 100644 index 0000000..0acc1b9 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/log.h @@ -0,0 +1,376 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_LOG_H +#define AVUTIL_LOG_H + +#include +#include "avutil.h" +#include "attributes.h" +#include "version.h" + +typedef enum { + AV_CLASS_CATEGORY_NA = 0, + AV_CLASS_CATEGORY_INPUT, + AV_CLASS_CATEGORY_OUTPUT, + AV_CLASS_CATEGORY_MUXER, + AV_CLASS_CATEGORY_DEMUXER, + AV_CLASS_CATEGORY_ENCODER, + AV_CLASS_CATEGORY_DECODER, + AV_CLASS_CATEGORY_FILTER, + AV_CLASS_CATEGORY_BITSTREAM_FILTER, + AV_CLASS_CATEGORY_SWSCALER, + AV_CLASS_CATEGORY_SWRESAMPLER, + AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40, + AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, + AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, + AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT, + AV_CLASS_CATEGORY_DEVICE_OUTPUT, + AV_CLASS_CATEGORY_DEVICE_INPUT, + AV_CLASS_CATEGORY_NB, ///< not part of ABI/API +}AVClassCategory; + +#define AV_IS_INPUT_DEVICE(category) \ + (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \ + ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \ + ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT)) + +#define AV_IS_OUTPUT_DEVICE(category) \ + (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \ + ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \ + ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT)) + +struct AVOptionRanges; + +/** + * Describe the class of an AVClass context structure. That is an + * arbitrary struct of which the first field is a pointer to an + * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). + */ +typedef struct AVClass { + /** + * The name of the class; usually it is the same name as the + * context structure type to which the AVClass is associated. + */ + const char* class_name; + + /** + * A pointer to a function which returns the name of a context + * instance ctx associated with the class. + */ + const char* (*item_name)(void* ctx); + + /** + * a pointer to the first option specified in the class if any or NULL + * + * @see av_set_default_options() + */ + const struct AVOption *option; + + /** + * LIBAVUTIL_VERSION with which this structure was created. + * This is used to allow fields to be added without requiring major + * version bumps everywhere. + */ + + int version; + + /** + * Offset in the structure where log_level_offset is stored. + * 0 means there is no such variable + */ + int log_level_offset_offset; + + /** + * Offset in the structure where a pointer to the parent context for + * logging is stored. For example a decoder could pass its AVCodecContext + * to eval as such a parent context, which an av_log() implementation + * could then leverage to display the parent context. + * The offset can be NULL. + */ + int parent_log_context_offset; + + /** + * Return next AVOptions-enabled child or NULL + */ + void* (*child_next)(void *obj, void *prev); + + /** + * Return an AVClass corresponding to the next potential + * AVOptions-enabled child. + * + * The difference between child_next and this is that + * child_next iterates over _already existing_ objects, while + * child_class_next iterates over _all possible_ children. + */ + const struct AVClass* (*child_class_next)(const struct AVClass *prev); + + /** + * Category used for visualization (like color) + * This is only set if the category is equal for all objects using this class. + * available since version (51 << 16 | 56 << 8 | 100) + */ + AVClassCategory category; + + /** + * Callback to return the category. + * available since version (51 << 16 | 59 << 8 | 100) + */ + AVClassCategory (*get_category)(void* ctx); + + /** + * Callback to return the supported/allowed ranges. + * available since version (52.12) + */ + int (*query_ranges)(struct AVOptionRanges **, void *obj, const char *key, int flags); +} AVClass; + +/** + * @addtogroup lavu_log + * + * @{ + * + * @defgroup lavu_log_constants Logging Constants + * + * @{ + */ + +/** + * Print no output. + */ +#define AV_LOG_QUIET -8 + +/** + * Something went really wrong and we will crash now. + */ +#define AV_LOG_PANIC 0 + +/** + * Something went wrong and recovery is not possible. + * For example, no header was found for a format which depends + * on headers or an illegal combination of parameters is used. + */ +#define AV_LOG_FATAL 8 + +/** + * Something went wrong and cannot losslessly be recovered. + * However, not all future data is affected. + */ +#define AV_LOG_ERROR 16 + +/** + * Something somehow does not look correct. This may or may not + * lead to problems. An example would be the use of '-vstrict -2'. + */ +#define AV_LOG_WARNING 24 + +/** + * Standard information. + */ +#define AV_LOG_INFO 32 + +/** + * Detailed information. + */ +#define AV_LOG_VERBOSE 40 + +/** + * Stuff which is only useful for libav* developers. + */ +#define AV_LOG_DEBUG 48 + +/** + * Extremely verbose debugging, useful for libav* development. + */ +#define AV_LOG_TRACE 56 + +#define AV_LOG_MAX_OFFSET (AV_LOG_TRACE - AV_LOG_QUIET) + +/** + * @} + */ + +/** + * Sets additional colors for extended debugging sessions. + * @code + av_log(ctx, AV_LOG_DEBUG|AV_LOG_C(134), "Message in purple\n"); + @endcode + * Requires 256color terminal support. Uses outside debugging is not + * recommended. + */ +#define AV_LOG_C(x) ((x) << 8) + +/** + * Send the specified message to the log if the level is less than or equal + * to the current av_log_level. By default, all logging messages are sent to + * stderr. This behavior can be altered by setting a different logging callback + * function. + * @see av_log_set_callback + * + * @param avcl A pointer to an arbitrary struct of which the first field is a + * pointer to an AVClass struct or NULL if general log. + * @param level The importance level of the message expressed using a @ref + * lavu_log_constants "Logging Constant". + * @param fmt The format string (printf-compatible) that specifies how + * subsequent arguments are converted to output. + */ +void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); + + +/** + * Send the specified message to the log if the level is less than or equal + * to the current av_log_level. By default, all logging messages are sent to + * stderr. This behavior can be altered by setting a different logging callback + * function. + * @see av_log_set_callback + * + * @param avcl A pointer to an arbitrary struct of which the first field is a + * pointer to an AVClass struct. + * @param level The importance level of the message expressed using a @ref + * lavu_log_constants "Logging Constant". + * @param fmt The format string (printf-compatible) that specifies how + * subsequent arguments are converted to output. + * @param vl The arguments referenced by the format string. + */ +void av_vlog(void *avcl, int level, const char *fmt, va_list vl); + +/** + * Get the current log level + * + * @see lavu_log_constants + * + * @return Current log level + */ +int av_log_get_level(void); + +/** + * Set the log level + * + * @see lavu_log_constants + * + * @param level Logging level + */ +void av_log_set_level(int level); + +/** + * Set the logging callback + * + * @note The callback must be thread safe, even if the application does not use + * threads itself as some codecs are multithreaded. + * + * @see av_log_default_callback + * + * @param callback A logging function with a compatible signature. + */ +void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)); + +/** + * Default logging callback + * + * It prints the message to stderr, optionally colorizing it. + * + * @param avcl A pointer to an arbitrary struct of which the first field is a + * pointer to an AVClass struct. + * @param level The importance level of the message expressed using a @ref + * lavu_log_constants "Logging Constant". + * @param fmt The format string (printf-compatible) that specifies how + * subsequent arguments are converted to output. + * @param vl The arguments referenced by the format string. + */ +void av_log_default_callback(void *avcl, int level, const char *fmt, + va_list vl); + +/** + * Return the context name + * + * @param ctx The AVClass context + * + * @return The AVClass class_name + */ +const char* av_default_item_name(void* ctx); +AVClassCategory av_default_get_category(void *ptr); + +/** + * Format a line of log the same way as the default callback. + * @param line buffer to receive the formatted line + * @param line_size size of the buffer + * @param print_prefix used to store whether the prefix must be printed; + * must point to a persistent integer initially set to 1 + */ +void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl, + char *line, int line_size, int *print_prefix); + +/** + * Format a line of log the same way as the default callback. + * @param line buffer to receive the formatted line; + * may be NULL if line_size is 0 + * @param line_size size of the buffer; at most line_size-1 characters will + * be written to the buffer, plus one null terminator + * @param print_prefix used to store whether the prefix must be printed; + * must point to a persistent integer initially set to 1 + * @return Returns a negative value if an error occurred, otherwise returns + * the number of characters that would have been written for a + * sufficiently large buffer, not including the terminating null + * character. If the return value is not less than line_size, it means + * that the log message was truncated to fit the buffer. + */ +int av_log_format_line2(void *ptr, int level, const char *fmt, va_list vl, + char *line, int line_size, int *print_prefix); + +#if FF_API_DLOG +/** + * av_dlog macros + * @deprecated unused + * Useful to print debug messages that shouldn't get compiled in normally. + */ + +#ifdef DEBUG +# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) +#else +# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) +#endif +#endif /* FF_API_DLOG */ + +/** + * Skip repeated messages, this requires the user app to use av_log() instead of + * (f)printf as the 2 would otherwise interfere and lead to + * "Last message repeated x times" messages below (f)printf messages with some + * bad luck. + * Also to receive the last, "last repeated" line if any, the user app must + * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end + */ +#define AV_LOG_SKIP_REPEATED 1 + +/** + * Include the log severity in messages originating from codecs. + * + * Results in messages such as: + * [rawvideo @ 0xDEADBEEF] [error] encode did not produce valid pts + */ +#define AV_LOG_PRINT_LEVEL 2 + +void av_log_set_flags(int arg); +int av_log_get_flags(void); + +/** + * @} + */ + +#endif /* AVUTIL_LOG_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/lzo.h b/Src/Decoder_H264_ALL/include/libavutil/lzo.h new file mode 100644 index 0000000..c034039 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/lzo.h @@ -0,0 +1,66 @@ +/* + * LZO 1x decompression + * copyright (c) 2006 Reimar Doeffinger + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_LZO_H +#define AVUTIL_LZO_H + +/** + * @defgroup lavu_lzo LZO + * @ingroup lavu_crypto + * + * @{ + */ + +#include + +/** @name Error flags returned by av_lzo1x_decode + * @{ */ +/// end of the input buffer reached before decoding finished +#define AV_LZO_INPUT_DEPLETED 1 +/// decoded data did not fit into output buffer +#define AV_LZO_OUTPUT_FULL 2 +/// a reference to previously decoded data was wrong +#define AV_LZO_INVALID_BACKPTR 4 +/// a non-specific error in the compressed bitstream +#define AV_LZO_ERROR 8 +/** @} */ + +#define AV_LZO_INPUT_PADDING 8 +#define AV_LZO_OUTPUT_PADDING 12 + +/** + * @brief Decodes LZO 1x compressed data. + * @param out output buffer + * @param outlen size of output buffer, number of bytes left are returned here + * @param in input buffer + * @param inlen size of input buffer, number of bytes left are returned here + * @return 0 on success, otherwise a combination of the error flags above + * + * Make sure all buffers are appropriately padded, in must provide + * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes. + */ +int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen); + +/** + * @} + */ + +#endif /* AVUTIL_LZO_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/macros.h b/Src/Decoder_H264_ALL/include/libavutil/macros.h new file mode 100644 index 0000000..2007ee5 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/macros.h @@ -0,0 +1,50 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * @ingroup lavu + * Utility Preprocessor macros + */ + +#ifndef AVUTIL_MACROS_H +#define AVUTIL_MACROS_H + +/** + * @addtogroup preproc_misc Preprocessor String Macros + * + * String manipulation macros + * + * @{ + */ + +#define AV_STRINGIFY(s) AV_TOSTRING(s) +#define AV_TOSTRING(s) #s + +#define AV_GLUE(a, b) a ## b +#define AV_JOIN(a, b) AV_GLUE(a, b) + +/** + * @} + */ + +#define AV_PRAGMA(s) _Pragma(#s) + +#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1)) + +#endif /* AVUTIL_MACROS_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/mastering_display_metadata.h b/Src/Decoder_H264_ALL/include/libavutil/mastering_display_metadata.h new file mode 100644 index 0000000..936533f --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/mastering_display_metadata.h @@ -0,0 +1,89 @@ +/** + * Copyright (c) 2016 Neil Birkbeck + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_MASTERING_DISPLAY_METADATA_H +#define AVUTIL_MASTERING_DISPLAY_METADATA_H + +#include "frame.h" +#include "rational.h" + + +/** + * Mastering display metadata capable of representing the color volume of + * the display used to master the content (SMPTE 2086:2014). + * + * To be used as payload of a AVFrameSideData or AVPacketSideData with the + * appropriate type. + * + * @note The struct should be allocated with av_mastering_display_metadata_alloc() + * and its size is not a part of the public ABI. + */ +typedef struct AVMasteringDisplayMetadata { + /** + * CIE 1931 xy chromaticity coords of color primaries (r, g, b order). + */ + AVRational display_primaries[3][2]; + + /** + * CIE 1931 xy chromaticity coords of white point. + */ + AVRational white_point[2]; + + /** + * Min luminance of mastering display (cd/m^2). + */ + AVRational min_luminance; + + /** + * Max luminance of mastering display (cd/m^2). + */ + AVRational max_luminance; + + /** + * Flag indicating whether the display primaries (and white point) are set. + */ + int has_primaries; + + /** + * Flag indicating whether the luminance (min_ and max_) have been set. + */ + int has_luminance; + +} AVMasteringDisplayMetadata; + +/** + * Allocate an AVMasteringDisplayMetadata structure and set its fields to + * default values. The resulting struct can be freed using av_freep(). + * + * @return An AVMasteringDisplayMetadata filled with default values or NULL + * on failure. + */ +AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc(void); + +/** + * Allocate a complete AVMasteringDisplayMetadata and add it to the frame. + * + * @param frame The frame which side data is added to. + * + * @return The AVMasteringDisplayMetadata structure to be filled by caller. + */ +AVMasteringDisplayMetadata *av_mastering_display_metadata_create_side_data(AVFrame *frame); + +#endif /* AVUTIL_MASTERING_DISPLAY_METADATA_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/mathematics.h b/Src/Decoder_H264_ALL/include/libavutil/mathematics.h new file mode 100644 index 0000000..57c44f8 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/mathematics.h @@ -0,0 +1,165 @@ +/* + * copyright (c) 2005-2012 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_MATHEMATICS_H +#define AVUTIL_MATHEMATICS_H + +#include +#include +#include "attributes.h" +#include "rational.h" +#include "intfloat.h" + +#ifndef M_E +#define M_E 2.7182818284590452354 /* e */ +#endif +#ifndef M_LN2 +#define M_LN2 0.69314718055994530942 /* log_e 2 */ +#endif +#ifndef M_LN10 +#define M_LN10 2.30258509299404568402 /* log_e 10 */ +#endif +#ifndef M_LOG2_10 +#define M_LOG2_10 3.32192809488736234787 /* log_2 10 */ +#endif +#ifndef M_PHI +#define M_PHI 1.61803398874989484820 /* phi / golden ratio */ +#endif +#ifndef M_PI +#define M_PI 3.14159265358979323846 /* pi */ +#endif +#ifndef M_PI_2 +#define M_PI_2 1.57079632679489661923 /* pi/2 */ +#endif +#ifndef M_SQRT1_2 +#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ +#endif +#ifndef M_SQRT2 +#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ +#endif +#ifndef NAN +#define NAN av_int2float(0x7fc00000) +#endif +#ifndef INFINITY +#define INFINITY av_int2float(0x7f800000) +#endif + +/** + * @addtogroup lavu_math + * @{ + */ + + +enum AVRounding { + AV_ROUND_ZERO = 0, ///< Round toward zero. + AV_ROUND_INF = 1, ///< Round away from zero. + AV_ROUND_DOWN = 2, ///< Round toward -infinity. + AV_ROUND_UP = 3, ///< Round toward +infinity. + AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. + AV_ROUND_PASS_MINMAX = 8192, ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE +}; + +/** + * Compute the greatest common divisor of a and b. + * + * @return gcd of a and b up to sign; if a >= 0 and b >= 0, return value is >= 0; + * if a == 0 and b == 0, returns 0. + */ +int64_t av_const av_gcd(int64_t a, int64_t b); + +/** + * Rescale a 64-bit integer with rounding to nearest. + * A simple a*b/c isn't possible as it can overflow. + */ +int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const; + +/** + * Rescale a 64-bit integer with specified rounding. + * A simple a*b/c isn't possible as it can overflow. + * + * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is + * INT64_MIN or INT64_MAX then a is passed through unchanged. + */ +int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const; + +/** + * Rescale a 64-bit integer by 2 rational numbers. + */ +int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const; + +/** + * Rescale a 64-bit integer by 2 rational numbers with specified rounding. + * + * @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is + * INT64_MIN or INT64_MAX then a is passed through unchanged. + */ +int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq, + enum AVRounding) av_const; + +/** + * Compare 2 timestamps each in its own timebases. + * The result of the function is undefined if one of the timestamps + * is outside the int64_t range when represented in the others timebase. + * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position + */ +int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b); + +/** + * Compare 2 integers modulo mod. + * That is we compare integers a and b for which only the least + * significant log2(mod) bits are known. + * + * @param mod must be a power of 2 + * @return a negative value if a is smaller than b + * a positive value if a is greater than b + * 0 if a equals b + */ +int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod); + +/** + * Rescale a timestamp while preserving known durations. + * + * @param in_ts Input timestamp + * @param in_tb Input timebase + * @param fs_tb Duration and *last timebase + * @param duration duration till the next call + * @param out_tb Output timebase + */ +int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int duration, int64_t *last, AVRational out_tb); + +/** + * Add a value to a timestamp. + * + * This function guarantees that when the same value is repeatly added that + * no accumulation of rounding errors occurs. + * + * @param ts Input timestamp + * @param ts_tb Input timestamp timebase + * @param inc value to add to ts + * @param inc_tb inc timebase + */ +int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc); + + + /** + * @} + */ + +#endif /* AVUTIL_MATHEMATICS_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/md5.h b/Src/Decoder_H264_ALL/include/libavutil/md5.h new file mode 100644 index 0000000..79702c8 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/md5.h @@ -0,0 +1,81 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_MD5_H +#define AVUTIL_MD5_H + +#include + +#include "attributes.h" +#include "version.h" + +/** + * @defgroup lavu_md5 MD5 + * @ingroup lavu_crypto + * @{ + */ + +extern const int av_md5_size; + +struct AVMD5; + +/** + * Allocate an AVMD5 context. + */ +struct AVMD5 *av_md5_alloc(void); + +/** + * Initialize MD5 hashing. + * + * @param ctx pointer to the function context (of size av_md5_size) + */ +void av_md5_init(struct AVMD5 *ctx); + +/** + * Update hash value. + * + * @param ctx hash function context + * @param src input data to update hash with + * @param len input data length + */ +void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, int len); + +/** + * Finish hashing and output digest value. + * + * @param ctx hash function context + * @param dst buffer where output digest value is stored + */ +void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); + +/** + * Hash an array of data. + * + * @param dst The output buffer to write the digest into + * @param src The data to hash + * @param len The length of the data, in bytes + */ +void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); + +/** + * @} + */ + +#endif /* AVUTIL_MD5_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/mem.h b/Src/Decoder_H264_ALL/include/libavutil/mem.h new file mode 100644 index 0000000..d25b322 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/mem.h @@ -0,0 +1,406 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * memory handling functions + */ + +#ifndef AVUTIL_MEM_H +#define AVUTIL_MEM_H + +#include +#include + +#include "attributes.h" +#include "error.h" +#include "avutil.h" + +/** + * @addtogroup lavu_mem + * @{ + */ + + +#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C) + #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v + #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v +#elif defined(__TI_COMPILER_VERSION__) + #define DECLARE_ALIGNED(n,t,v) \ + AV_PRAGMA(DATA_ALIGN(v,n)) \ + t __attribute__((aligned(n))) v + #define DECLARE_ASM_CONST(n,t,v) \ + AV_PRAGMA(DATA_ALIGN(v,n)) \ + static const t __attribute__((aligned(n))) v +#elif defined(__GNUC__) + #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v + #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v +#elif defined(_MSC_VER) + #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v + #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v +#else + #define DECLARE_ALIGNED(n,t,v) t v + #define DECLARE_ASM_CONST(n,t,v) static const t v +#endif + +#if AV_GCC_VERSION_AT_LEAST(3,1) + #define av_malloc_attrib __attribute__((__malloc__)) +#else + #define av_malloc_attrib +#endif + +#if AV_GCC_VERSION_AT_LEAST(4,3) + #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__))) +#else + #define av_alloc_size(...) +#endif + +/** + * Allocate a block of size bytes with alignment suitable for all + * memory accesses (including vectors if available on the CPU). + * @param size Size in bytes for the memory block to be allocated. + * @return Pointer to the allocated block, NULL if the block cannot + * be allocated. + * @see av_mallocz() + */ +void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1); + +/** + * Allocate a block of size * nmemb bytes with av_malloc(). + * @param nmemb Number of elements + * @param size Size of the single element + * @return Pointer to the allocated block, NULL if the block cannot + * be allocated. + * @see av_malloc() + */ +av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size) +{ + if (!size || nmemb >= INT_MAX / size) + return NULL; + return av_malloc(nmemb * size); +} + +/** + * Allocate or reallocate a block of memory. + * If ptr is NULL and size > 0, allocate a new block. If + * size is zero, free the memory block pointed to by ptr. + * @param ptr Pointer to a memory block already allocated with + * av_realloc() or NULL. + * @param size Size in bytes of the memory block to be allocated or + * reallocated. + * @return Pointer to a newly-reallocated block or NULL if the block + * cannot be reallocated or the function is used to free the memory block. + * @warning Pointers originating from the av_malloc() family of functions must + * not be passed to av_realloc(). The former can be implemented using + * memalign() (or other functions), and there is no guarantee that + * pointers from such functions can be passed to realloc() at all. + * The situation is undefined according to POSIX and may crash with + * some libc implementations. + * @see av_fast_realloc() + */ +void *av_realloc(void *ptr, size_t size) av_alloc_size(2); + +/** + * Allocate or reallocate a block of memory. + * This function does the same thing as av_realloc, except: + * - It takes two arguments and checks the result of the multiplication for + * integer overflow. + * - It frees the input block in case of failure, thus avoiding the memory + * leak with the classic "buf = realloc(buf); if (!buf) return -1;". + */ +void *av_realloc_f(void *ptr, size_t nelem, size_t elsize); + +/** + * Allocate or reallocate a block of memory. + * If *ptr is NULL and size > 0, allocate a new block. If + * size is zero, free the memory block pointed to by ptr. + * @param ptr Pointer to a pointer to a memory block already allocated + * with av_realloc(), or pointer to a pointer to NULL. + * The pointer is updated on success, or freed on failure. + * @param size Size in bytes for the memory block to be allocated or + * reallocated + * @return Zero on success, an AVERROR error code on failure. + * @warning Pointers originating from the av_malloc() family of functions must + * not be passed to av_reallocp(). The former can be implemented using + * memalign() (or other functions), and there is no guarantee that + * pointers from such functions can be passed to realloc() at all. + * The situation is undefined according to POSIX and may crash with + * some libc implementations. + */ +av_warn_unused_result +int av_reallocp(void *ptr, size_t size); + +/** + * Allocate or reallocate an array. + * If ptr is NULL and nmemb > 0, allocate a new block. If + * nmemb is zero, free the memory block pointed to by ptr. + * @param ptr Pointer to a memory block already allocated with + * av_realloc() or NULL. + * @param nmemb Number of elements + * @param size Size of the single element + * @return Pointer to a newly-reallocated block or NULL if the block + * cannot be reallocated or the function is used to free the memory block. + * @warning Pointers originating from the av_malloc() family of functions must + * not be passed to av_realloc(). The former can be implemented using + * memalign() (or other functions), and there is no guarantee that + * pointers from such functions can be passed to realloc() at all. + * The situation is undefined according to POSIX and may crash with + * some libc implementations. + */ +av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size); + +/** + * Allocate or reallocate an array through a pointer to a pointer. + * If *ptr is NULL and nmemb > 0, allocate a new block. If + * nmemb is zero, free the memory block pointed to by ptr. + * @param ptr Pointer to a pointer to a memory block already allocated + * with av_realloc(), or pointer to a pointer to NULL. + * The pointer is updated on success, or freed on failure. + * @param nmemb Number of elements + * @param size Size of the single element + * @return Zero on success, an AVERROR error code on failure. + * @warning Pointers originating from the av_malloc() family of functions must + * not be passed to av_realloc(). The former can be implemented using + * memalign() (or other functions), and there is no guarantee that + * pointers from such functions can be passed to realloc() at all. + * The situation is undefined according to POSIX and may crash with + * some libc implementations. + */ +av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size); + +/** + * Free a memory block which has been allocated with av_malloc(z)() or + * av_realloc(). + * @param ptr Pointer to the memory block which should be freed. + * @note ptr = NULL is explicitly allowed. + * @note It is recommended that you use av_freep() instead. + * @see av_freep() + */ +void av_free(void *ptr); + +/** + * Allocate a block of size bytes with alignment suitable for all + * memory accesses (including vectors if available on the CPU) and + * zero all the bytes of the block. + * @param size Size in bytes for the memory block to be allocated. + * @return Pointer to the allocated block, NULL if it cannot be allocated. + * @see av_malloc() + */ +void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1); + +/** + * Allocate a block of nmemb * size bytes with alignment suitable for all + * memory accesses (including vectors if available on the CPU) and + * zero all the bytes of the block. + * The allocation will fail if nmemb * size is greater than or equal + * to INT_MAX. + * @param nmemb + * @param size + * @return Pointer to the allocated block, NULL if it cannot be allocated. + */ +void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib; + +/** + * Allocate a block of size * nmemb bytes with av_mallocz(). + * @param nmemb Number of elements + * @param size Size of the single element + * @return Pointer to the allocated block, NULL if the block cannot + * be allocated. + * @see av_mallocz() + * @see av_malloc_array() + */ +av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size) +{ + if (!size || nmemb >= INT_MAX / size) + return NULL; + return av_mallocz(nmemb * size); +} + +/** + * Duplicate the string s. + * @param s string to be duplicated + * @return Pointer to a newly-allocated string containing a + * copy of s or NULL if the string cannot be allocated. + */ +char *av_strdup(const char *s) av_malloc_attrib; + +/** + * Duplicate a substring of the string s. + * @param s string to be duplicated + * @param len the maximum length of the resulting string (not counting the + * terminating byte). + * @return Pointer to a newly-allocated string containing a + * copy of s or NULL if the string cannot be allocated. + */ +char *av_strndup(const char *s, size_t len) av_malloc_attrib; + +/** + * Duplicate the buffer p. + * @param p buffer to be duplicated + * @return Pointer to a newly allocated buffer containing a + * copy of p or NULL if the buffer cannot be allocated. + */ +void *av_memdup(const void *p, size_t size); + +/** + * Free a memory block which has been allocated with av_malloc(z)() or + * av_realloc() and set the pointer pointing to it to NULL. + * @param ptr Pointer to the pointer to the memory block which should + * be freed. + * @note passing a pointer to a NULL pointer is safe and leads to no action. + * @see av_free() + */ +void av_freep(void *ptr); + +/** + * Add an element to a dynamic array. + * + * The array to grow is supposed to be an array of pointers to + * structures, and the element to add must be a pointer to an already + * allocated structure. + * + * The array is reallocated when its size reaches powers of 2. + * Therefore, the amortized cost of adding an element is constant. + * + * In case of success, the pointer to the array is updated in order to + * point to the new grown array, and the number pointed to by nb_ptr + * is incremented. + * In case of failure, the array is freed, *tab_ptr is set to NULL and + * *nb_ptr is set to 0. + * + * @param tab_ptr pointer to the array to grow + * @param nb_ptr pointer to the number of elements in the array + * @param elem element to add + * @see av_dynarray_add_nofree(), av_dynarray2_add() + */ +void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem); + +/** + * Add an element to a dynamic array. + * + * Function has the same functionality as av_dynarray_add(), + * but it doesn't free memory on fails. It returns error code + * instead and leave current buffer untouched. + * + * @param tab_ptr pointer to the array to grow + * @param nb_ptr pointer to the number of elements in the array + * @param elem element to add + * @return >=0 on success, negative otherwise. + * @see av_dynarray_add(), av_dynarray2_add() + */ +av_warn_unused_result +int av_dynarray_add_nofree(void *tab_ptr, int *nb_ptr, void *elem); + +/** + * Add an element of size elem_size to a dynamic array. + * + * The array is reallocated when its number of elements reaches powers of 2. + * Therefore, the amortized cost of adding an element is constant. + * + * In case of success, the pointer to the array is updated in order to + * point to the new grown array, and the number pointed to by nb_ptr + * is incremented. + * In case of failure, the array is freed, *tab_ptr is set to NULL and + * *nb_ptr is set to 0. + * + * @param tab_ptr pointer to the array to grow + * @param nb_ptr pointer to the number of elements in the array + * @param elem_size size in bytes of the elements in the array + * @param elem_data pointer to the data of the element to add. If NULL, the space of + * the new added element is not filled. + * @return pointer to the data of the element to copy in the new allocated space. + * If NULL, the new allocated space is left uninitialized." + * @see av_dynarray_add(), av_dynarray_add_nofree() + */ +void *av_dynarray2_add(void **tab_ptr, int *nb_ptr, size_t elem_size, + const uint8_t *elem_data); + +/** + * Multiply two size_t values checking for overflow. + * @return 0 if success, AVERROR(EINVAL) if overflow. + */ +static inline int av_size_mult(size_t a, size_t b, size_t *r) +{ + size_t t = a * b; + /* Hack inspired from glibc: only try the division if nelem and elsize + * are both greater than sqrt(SIZE_MAX). */ + if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) + return AVERROR(EINVAL); + *r = t; + return 0; +} + +/** + * Set the maximum size that may me allocated in one block. + */ +void av_max_alloc(size_t max); + +/** + * deliberately overlapping memcpy implementation + * @param dst destination buffer + * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0 + * @param cnt number of bytes to copy, must be >= 0 + * + * cnt > back is valid, this will copy the bytes we just copied, + * thus creating a repeating pattern with a period length of back. + */ +void av_memcpy_backptr(uint8_t *dst, int back, int cnt); + +/** + * Reallocate the given block if it is not large enough, otherwise do nothing. + * + * @see av_realloc + */ +void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size); + +/** + * Allocate a buffer, reusing the given one if large enough. + * + * Contrary to av_fast_realloc the current buffer contents might not be + * preserved and on error the old buffer is freed, thus no special + * handling to avoid memleaks is necessary. + * + * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer + * @param size size of the buffer *ptr points to + * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and + * *size 0 if an error occurred. + */ +void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size); + +/** + * Allocate a buffer, reusing the given one if large enough. + * + * All newly allocated space is initially cleared + * Contrary to av_fast_realloc the current buffer contents might not be + * preserved and on error the old buffer is freed, thus no special + * handling to avoid memleaks is necessary. + * + * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer + * @param size size of the buffer *ptr points to + * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and + * *size 0 if an error occurred. + */ +void av_fast_mallocz(void *ptr, unsigned int *size, size_t min_size); + +/** + * @} + */ + +#endif /* AVUTIL_MEM_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/motion_vector.h b/Src/Decoder_H264_ALL/include/libavutil/motion_vector.h new file mode 100644 index 0000000..ec29556 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/motion_vector.h @@ -0,0 +1,57 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_MOTION_VECTOR_H +#define AVUTIL_MOTION_VECTOR_H + +#include + +typedef struct AVMotionVector { + /** + * Where the current macroblock comes from; negative value when it comes + * from the past, positive value when it comes from the future. + * XXX: set exact relative ref frame reference instead of a +/- 1 "direction". + */ + int32_t source; + /** + * Width and height of the block. + */ + uint8_t w, h; + /** + * Absolute source position. Can be outside the frame area. + */ + int16_t src_x, src_y; + /** + * Absolute destination position. Can be outside the frame area. + */ + int16_t dst_x, dst_y; + /** + * Extra flag information. + * Currently unused. + */ + uint64_t flags; + /** + * Motion vector + * src_x = dst_x + motion_x / motion_scale + * src_y = dst_y + motion_y / motion_scale + */ + int32_t motion_x, motion_y; + uint16_t motion_scale; +} AVMotionVector; + +#endif /* AVUTIL_MOTION_VECTOR_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/murmur3.h b/Src/Decoder_H264_ALL/include/libavutil/murmur3.h new file mode 100644 index 0000000..f29ed97 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/murmur3.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2013 Reimar D枚ffinger + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_MURMUR3_H +#define AVUTIL_MURMUR3_H + +#include + +struct AVMurMur3 *av_murmur3_alloc(void); +void av_murmur3_init_seeded(struct AVMurMur3 *c, uint64_t seed); +void av_murmur3_init(struct AVMurMur3 *c); +void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len); +void av_murmur3_final(struct AVMurMur3 *c, uint8_t dst[16]); + +#endif /* AVUTIL_MURMUR3_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/opt.h b/Src/Decoder_H264_ALL/include/libavutil/opt.h new file mode 100644 index 0000000..9a76a47 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/opt.h @@ -0,0 +1,865 @@ +/* + * AVOptions + * copyright (c) 2005 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_OPT_H +#define AVUTIL_OPT_H + +/** + * @file + * AVOptions + */ + +#include "rational.h" +#include "avutil.h" +#include "dict.h" +#include "log.h" +#include "pixfmt.h" +#include "samplefmt.h" +#include "version.h" + +/** + * @defgroup avoptions AVOptions + * @ingroup lavu_data + * @{ + * AVOptions provide a generic system to declare options on arbitrary structs + * ("objects"). An option can have a help text, a type and a range of possible + * values. Options may then be enumerated, read and written to. + * + * @section avoptions_implement Implementing AVOptions + * This section describes how to add AVOptions capabilities to a struct. + * + * All AVOptions-related information is stored in an AVClass. Therefore + * the first member of the struct should be a pointer to an AVClass describing it. + * The option field of the AVClass must be set to a NULL-terminated static array + * of AVOptions. Each AVOption must have a non-empty name, a type, a default + * value and for number-type AVOptions also a range of allowed values. It must + * also declare an offset in bytes from the start of the struct, where the field + * associated with this AVOption is located. Other fields in the AVOption struct + * should also be set when applicable, but are not required. + * + * The following example illustrates an AVOptions-enabled struct: + * @code + * typedef struct test_struct { + * AVClass *class; + * int int_opt; + * char *str_opt; + * uint8_t *bin_opt; + * int bin_len; + * } test_struct; + * + * static const AVOption test_options[] = { + * { "test_int", "This is a test option of int type.", offsetof(test_struct, int_opt), + * AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX }, + * { "test_str", "This is a test option of string type.", offsetof(test_struct, str_opt), + * AV_OPT_TYPE_STRING }, + * { "test_bin", "This is a test option of binary type.", offsetof(test_struct, bin_opt), + * AV_OPT_TYPE_BINARY }, + * { NULL }, + * }; + * + * static const AVClass test_class = { + * .class_name = "test class", + * .item_name = av_default_item_name, + * .option = test_options, + * .version = LIBAVUTIL_VERSION_INT, + * }; + * @endcode + * + * Next, when allocating your struct, you must ensure that the AVClass pointer + * is set to the correct value. Then, av_opt_set_defaults() can be called to + * initialize defaults. After that the struct is ready to be used with the + * AVOptions API. + * + * When cleaning up, you may use the av_opt_free() function to automatically + * free all the allocated string and binary options. + * + * Continuing with the above example: + * + * @code + * test_struct *alloc_test_struct(void) + * { + * test_struct *ret = av_malloc(sizeof(*ret)); + * ret->class = &test_class; + * av_opt_set_defaults(ret); + * return ret; + * } + * void free_test_struct(test_struct **foo) + * { + * av_opt_free(*foo); + * av_freep(foo); + * } + * @endcode + * + * @subsection avoptions_implement_nesting Nesting + * It may happen that an AVOptions-enabled struct contains another + * AVOptions-enabled struct as a member (e.g. AVCodecContext in + * libavcodec exports generic options, while its priv_data field exports + * codec-specific options). In such a case, it is possible to set up the + * parent struct to export a child's options. To do that, simply + * implement AVClass.child_next() and AVClass.child_class_next() in the + * parent struct's AVClass. + * Assuming that the test_struct from above now also contains a + * child_struct field: + * + * @code + * typedef struct child_struct { + * AVClass *class; + * int flags_opt; + * } child_struct; + * static const AVOption child_opts[] = { + * { "test_flags", "This is a test option of flags type.", + * offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX }, + * { NULL }, + * }; + * static const AVClass child_class = { + * .class_name = "child class", + * .item_name = av_default_item_name, + * .option = child_opts, + * .version = LIBAVUTIL_VERSION_INT, + * }; + * + * void *child_next(void *obj, void *prev) + * { + * test_struct *t = obj; + * if (!prev && t->child_struct) + * return t->child_struct; + * return NULL + * } + * const AVClass child_class_next(const AVClass *prev) + * { + * return prev ? NULL : &child_class; + * } + * @endcode + * Putting child_next() and child_class_next() as defined above into + * test_class will now make child_struct's options accessible through + * test_struct (again, proper setup as described above needs to be done on + * child_struct right after it is created). + * + * From the above example it might not be clear why both child_next() + * and child_class_next() are needed. The distinction is that child_next() + * iterates over actually existing objects, while child_class_next() + * iterates over all possible child classes. E.g. if an AVCodecContext + * was initialized to use a codec which has private options, then its + * child_next() will return AVCodecContext.priv_data and finish + * iterating. OTOH child_class_next() on AVCodecContext.av_class will + * iterate over all available codecs with private options. + * + * @subsection avoptions_implement_named_constants Named constants + * It is possible to create named constants for options. Simply set the unit + * field of the option the constants should apply to a string and + * create the constants themselves as options of type AV_OPT_TYPE_CONST + * with their unit field set to the same string. + * Their default_val field should contain the value of the named + * constant. + * For example, to add some named constants for the test_flags option + * above, put the following into the child_opts array: + * @code + * { "test_flags", "This is a test option of flags type.", + * offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX, "test_unit" }, + * { "flag1", "This is a flag with value 16", 0, AV_OPT_TYPE_CONST, { .i64 = 16 }, 0, 0, "test_unit" }, + * @endcode + * + * @section avoptions_use Using AVOptions + * This section deals with accessing options in an AVOptions-enabled struct. + * Such structs in FFmpeg are e.g. AVCodecContext in libavcodec or + * AVFormatContext in libavformat. + * + * @subsection avoptions_use_examine Examining AVOptions + * The basic functions for examining options are av_opt_next(), which iterates + * over all options defined for one object, and av_opt_find(), which searches + * for an option with the given name. + * + * The situation is more complicated with nesting. An AVOptions-enabled struct + * may have AVOptions-enabled children. Passing the AV_OPT_SEARCH_CHILDREN flag + * to av_opt_find() will make the function search children recursively. + * + * For enumerating there are basically two cases. The first is when you want to + * get all options that may potentially exist on the struct and its children + * (e.g. when constructing documentation). In that case you should call + * av_opt_child_class_next() recursively on the parent struct's AVClass. The + * second case is when you have an already initialized struct with all its + * children and you want to get all options that can be actually written or read + * from it. In that case you should call av_opt_child_next() recursively (and + * av_opt_next() on each result). + * + * @subsection avoptions_use_get_set Reading and writing AVOptions + * When setting options, you often have a string read directly from the + * user. In such a case, simply passing it to av_opt_set() is enough. For + * non-string type options, av_opt_set() will parse the string according to the + * option type. + * + * Similarly av_opt_get() will read any option type and convert it to a string + * which will be returned. Do not forget that the string is allocated, so you + * have to free it with av_free(). + * + * In some cases it may be more convenient to put all options into an + * AVDictionary and call av_opt_set_dict() on it. A specific case of this + * are the format/codec open functions in lavf/lavc which take a dictionary + * filled with option as a parameter. This makes it possible to set some options + * that cannot be set otherwise, since e.g. the input file format is not known + * before the file is actually opened. + */ + +enum AVOptionType{ + AV_OPT_TYPE_FLAGS, + AV_OPT_TYPE_INT, + AV_OPT_TYPE_INT64, + AV_OPT_TYPE_DOUBLE, + AV_OPT_TYPE_FLOAT, + AV_OPT_TYPE_STRING, + AV_OPT_TYPE_RATIONAL, + AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length + AV_OPT_TYPE_DICT, + AV_OPT_TYPE_CONST = 128, + AV_OPT_TYPE_IMAGE_SIZE = MKBETAG('S','I','Z','E'), ///< offset must point to two consecutive integers + AV_OPT_TYPE_PIXEL_FMT = MKBETAG('P','F','M','T'), + AV_OPT_TYPE_SAMPLE_FMT = MKBETAG('S','F','M','T'), + AV_OPT_TYPE_VIDEO_RATE = MKBETAG('V','R','A','T'), ///< offset must point to AVRational + AV_OPT_TYPE_DURATION = MKBETAG('D','U','R',' '), + AV_OPT_TYPE_COLOR = MKBETAG('C','O','L','R'), + AV_OPT_TYPE_CHANNEL_LAYOUT = MKBETAG('C','H','L','A'), + AV_OPT_TYPE_BOOL = MKBETAG('B','O','O','L'), +}; + +/** + * AVOption + */ +typedef struct AVOption { + const char *name; + + /** + * short English help text + * @todo What about other languages? + */ + const char *help; + + /** + * The offset relative to the context structure where the option + * value is stored. It should be 0 for named constants. + */ + int offset; + enum AVOptionType type; + + /** + * the default value for scalar options + */ + union { + int64_t i64; + double dbl; + const char *str; + /* TODO those are unused now */ + AVRational q; + } default_val; + double min; ///< minimum valid value for the option + double max; ///< maximum valid value for the option + + int flags; +#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding +#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding +#if FF_API_OPT_TYPE_METADATA +#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ... +#endif +#define AV_OPT_FLAG_AUDIO_PARAM 8 +#define AV_OPT_FLAG_VIDEO_PARAM 16 +#define AV_OPT_FLAG_SUBTITLE_PARAM 32 +/** + * The option is intended for exporting values to the caller. + */ +#define AV_OPT_FLAG_EXPORT 64 +/** + * The option may not be set through the AVOptions API, only read. + * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set. + */ +#define AV_OPT_FLAG_READONLY 128 +#define AV_OPT_FLAG_FILTERING_PARAM (1<<16) ///< a generic parameter which can be set by the user for filtering +//FIXME think about enc-audio, ... style flags + + /** + * The logical unit to which the option belongs. Non-constant + * options and corresponding named constants share the same + * unit. May be NULL. + */ + const char *unit; +} AVOption; + +/** + * A single allowed range of values, or a single allowed value. + */ +typedef struct AVOptionRange { + const char *str; + /** + * Value range. + * For string ranges this represents the min/max length. + * For dimensions this represents the min/max pixel count or width/height in multi-component case. + */ + double value_min, value_max; + /** + * Value's component range. + * For string this represents the unicode range for chars, 0-127 limits to ASCII. + */ + double component_min, component_max; + /** + * Range flag. + * If set to 1 the struct encodes a range, if set to 0 a single value. + */ + int is_range; +} AVOptionRange; + +/** + * List of AVOptionRange structs. + */ +typedef struct AVOptionRanges { + /** + * Array of option ranges. + * + * Most of option types use just one component. + * Following describes multi-component option types: + * + * AV_OPT_TYPE_IMAGE_SIZE: + * component index 0: range of pixel count (width * height). + * component index 1: range of width. + * component index 2: range of height. + * + * @note To obtain multi-component version of this structure, user must + * provide AV_OPT_MULTI_COMPONENT_RANGE to av_opt_query_ranges or + * av_opt_query_ranges_default function. + * + * Multi-component range can be read as in following example: + * + * @code + * int range_index, component_index; + * AVOptionRanges *ranges; + * AVOptionRange *range[3]; //may require more than 3 in the future. + * av_opt_query_ranges(&ranges, obj, key, AV_OPT_MULTI_COMPONENT_RANGE); + * for (range_index = 0; range_index < ranges->nb_ranges; range_index++) { + * for (component_index = 0; component_index < ranges->nb_components; component_index++) + * range[component_index] = ranges->range[ranges->nb_ranges * component_index + range_index]; + * //do something with range here. + * } + * av_opt_freep_ranges(&ranges); + * @endcode + */ + AVOptionRange **range; + /** + * Number of ranges per component. + */ + int nb_ranges; + /** + * Number of componentes. + */ + int nb_components; +} AVOptionRanges; + +/** + * Show the obj options. + * + * @param req_flags requested flags for the options to show. Show only the + * options for which it is opt->flags & req_flags. + * @param rej_flags rejected flags for the options to show. Show only the + * options for which it is !(opt->flags & req_flags). + * @param av_log_obj log context to use for showing the options + */ +int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags); + +/** + * Set the values of all AVOption fields to their default values. + * + * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) + */ +void av_opt_set_defaults(void *s); + +/** + * Set the values of all AVOption fields to their default values. Only these + * AVOption fields for which (opt->flags & mask) == flags will have their + * default applied to s. + * + * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass) + * @param mask combination of AV_OPT_FLAG_* + * @param flags combination of AV_OPT_FLAG_* + */ +void av_opt_set_defaults2(void *s, int mask, int flags); + +/** + * Parse the key/value pairs list in opts. For each key/value pair + * found, stores the value in the field in ctx that is named like the + * key. ctx must be an AVClass context, storing is done using + * AVOptions. + * + * @param opts options string to parse, may be NULL + * @param key_val_sep a 0-terminated list of characters used to + * separate key from value + * @param pairs_sep a 0-terminated list of characters used to separate + * two pairs from each other + * @return the number of successfully set key/value pairs, or a negative + * value corresponding to an AVERROR code in case of error: + * AVERROR(EINVAL) if opts cannot be parsed, + * the error code issued by av_opt_set() if a key/value pair + * cannot be set + */ +int av_set_options_string(void *ctx, const char *opts, + const char *key_val_sep, const char *pairs_sep); + +/** + * Parse the key-value pairs list in opts. For each key=value pair found, + * set the value of the corresponding option in ctx. + * + * @param ctx the AVClass object to set options on + * @param opts the options string, key-value pairs separated by a + * delimiter + * @param shorthand a NULL-terminated array of options names for shorthand + * notation: if the first field in opts has no key part, + * the key is taken from the first element of shorthand; + * then again for the second, etc., until either opts is + * finished, shorthand is finished or a named option is + * found; after that, all options must be named + * @param key_val_sep a 0-terminated list of characters used to separate + * key from value, for example '=' + * @param pairs_sep a 0-terminated list of characters used to separate + * two pairs from each other, for example ':' or ',' + * @return the number of successfully set key=value pairs, or a negative + * value corresponding to an AVERROR code in case of error: + * AVERROR(EINVAL) if opts cannot be parsed, + * the error code issued by av_set_string3() if a key/value pair + * cannot be set + * + * Options names must use only the following characters: a-z A-Z 0-9 - . / _ + * Separators must use characters distinct from option names and from each + * other. + */ +int av_opt_set_from_string(void *ctx, const char *opts, + const char *const *shorthand, + const char *key_val_sep, const char *pairs_sep); +/** + * Free all allocated objects in obj. + */ +void av_opt_free(void *obj); + +/** + * Check whether a particular flag is set in a flags field. + * + * @param field_name the name of the flag field option + * @param flag_name the name of the flag to check + * @return non-zero if the flag is set, zero if the flag isn't set, + * isn't of the right type, or the flags field doesn't exist. + */ +int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name); + +/** + * Set all the options from a given dictionary on an object. + * + * @param obj a struct whose first element is a pointer to AVClass + * @param options options to process. This dictionary will be freed and replaced + * by a new one containing all options not found in obj. + * Of course this new dictionary needs to be freed by caller + * with av_dict_free(). + * + * @return 0 on success, a negative AVERROR if some option was found in obj, + * but could not be set. + * + * @see av_dict_copy() + */ +int av_opt_set_dict(void *obj, struct AVDictionary **options); + + +/** + * Set all the options from a given dictionary on an object. + * + * @param obj a struct whose first element is a pointer to AVClass + * @param options options to process. This dictionary will be freed and replaced + * by a new one containing all options not found in obj. + * Of course this new dictionary needs to be freed by caller + * with av_dict_free(). + * @param search_flags A combination of AV_OPT_SEARCH_*. + * + * @return 0 on success, a negative AVERROR if some option was found in obj, + * but could not be set. + * + * @see av_dict_copy() + */ +int av_opt_set_dict2(void *obj, struct AVDictionary **options, int search_flags); + +/** + * Extract a key-value pair from the beginning of a string. + * + * @param ropts pointer to the options string, will be updated to + * point to the rest of the string (one of the pairs_sep + * or the final NUL) + * @param key_val_sep a 0-terminated list of characters used to separate + * key from value, for example '=' + * @param pairs_sep a 0-terminated list of characters used to separate + * two pairs from each other, for example ':' or ',' + * @param flags flags; see the AV_OPT_FLAG_* values below + * @param rkey parsed key; must be freed using av_free() + * @param rval parsed value; must be freed using av_free() + * + * @return >=0 for success, or a negative value corresponding to an + * AVERROR code in case of error; in particular: + * AVERROR(EINVAL) if no key is present + * + */ +int av_opt_get_key_value(const char **ropts, + const char *key_val_sep, const char *pairs_sep, + unsigned flags, + char **rkey, char **rval); + +enum { + + /** + * Accept to parse a value without a key; the key will then be returned + * as NULL. + */ + AV_OPT_FLAG_IMPLICIT_KEY = 1, +}; + +/** + * @defgroup opt_eval_funcs Evaluating option strings + * @{ + * This group of functions can be used to evaluate option strings + * and get numbers out of them. They do the same thing as av_opt_set(), + * except the result is written into the caller-supplied pointer. + * + * @param obj a struct whose first element is a pointer to AVClass. + * @param o an option for which the string is to be evaluated. + * @param val string to be evaluated. + * @param *_out value of the string will be written here. + * + * @return 0 on success, a negative number on failure. + */ +int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int *flags_out); +int av_opt_eval_int (void *obj, const AVOption *o, const char *val, int *int_out); +int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, int64_t *int64_out); +int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float *float_out); +int av_opt_eval_double(void *obj, const AVOption *o, const char *val, double *double_out); +int av_opt_eval_q (void *obj, const AVOption *o, const char *val, AVRational *q_out); +/** + * @} + */ + +#define AV_OPT_SEARCH_CHILDREN (1 << 0) /**< Search in possible children of the + given object first. */ +/** + * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass + * instead of a required pointer to a struct containing AVClass. This is + * useful for searching for options without needing to allocate the corresponding + * object. + */ +#define AV_OPT_SEARCH_FAKE_OBJ (1 << 1) + +/** + * In av_opt_get, return NULL if the option has a pointer type and is set to NULL, + * rather than returning an empty string. + */ +#define AV_OPT_ALLOW_NULL (1 << 2) + +/** + * Allows av_opt_query_ranges and av_opt_query_ranges_default to return more than + * one component for certain option types. + * @see AVOptionRanges for details. + */ +#define AV_OPT_MULTI_COMPONENT_RANGE (1 << 12) + +/** + * Look for an option in an object. Consider only options which + * have all the specified flags set. + * + * @param[in] obj A pointer to a struct whose first element is a + * pointer to an AVClass. + * Alternatively a double pointer to an AVClass, if + * AV_OPT_SEARCH_FAKE_OBJ search flag is set. + * @param[in] name The name of the option to look for. + * @param[in] unit When searching for named constants, name of the unit + * it belongs to. + * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). + * @param search_flags A combination of AV_OPT_SEARCH_*. + * + * @return A pointer to the option found, or NULL if no option + * was found. + * + * @note Options found with AV_OPT_SEARCH_CHILDREN flag may not be settable + * directly with av_opt_set(). Use special calls which take an options + * AVDictionary (e.g. avformat_open_input()) to set options found with this + * flag. + */ +const AVOption *av_opt_find(void *obj, const char *name, const char *unit, + int opt_flags, int search_flags); + +/** + * Look for an option in an object. Consider only options which + * have all the specified flags set. + * + * @param[in] obj A pointer to a struct whose first element is a + * pointer to an AVClass. + * Alternatively a double pointer to an AVClass, if + * AV_OPT_SEARCH_FAKE_OBJ search flag is set. + * @param[in] name The name of the option to look for. + * @param[in] unit When searching for named constants, name of the unit + * it belongs to. + * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). + * @param search_flags A combination of AV_OPT_SEARCH_*. + * @param[out] target_obj if non-NULL, an object to which the option belongs will be + * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present + * in search_flags. This parameter is ignored if search_flags contain + * AV_OPT_SEARCH_FAKE_OBJ. + * + * @return A pointer to the option found, or NULL if no option + * was found. + */ +const AVOption *av_opt_find2(void *obj, const char *name, const char *unit, + int opt_flags, int search_flags, void **target_obj); + +/** + * Iterate over all AVOptions belonging to obj. + * + * @param obj an AVOptions-enabled struct or a double pointer to an + * AVClass describing it. + * @param prev result of the previous call to av_opt_next() on this object + * or NULL + * @return next AVOption or NULL + */ +const AVOption *av_opt_next(const void *obj, const AVOption *prev); + +/** + * Iterate over AVOptions-enabled children of obj. + * + * @param prev result of a previous call to this function or NULL + * @return next AVOptions-enabled child or NULL + */ +void *av_opt_child_next(void *obj, void *prev); + +/** + * Iterate over potential AVOptions-enabled children of parent. + * + * @param prev result of a previous call to this function or NULL + * @return AVClass corresponding to next potential child or NULL + */ +const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev); + +/** + * @defgroup opt_set_funcs Option setting functions + * @{ + * Those functions set the field of obj with the given name to value. + * + * @param[in] obj A struct whose first element is a pointer to an AVClass. + * @param[in] name the name of the field to set + * @param[in] val The value to set. In case of av_opt_set() if the field is not + * of a string type, then the given string is parsed. + * SI postfixes and some named scalars are supported. + * If the field is of a numeric type, it has to be a numeric or named + * scalar. Behavior with more than one scalar and +- infix operators + * is undefined. + * If the field is of a flags type, it has to be a sequence of numeric + * scalars or named flags separated by '+' or '-'. Prefixing a flag + * with '+' causes it to be set without affecting the other flags; + * similarly, '-' unsets a flag. + * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN + * is passed here, then the option may be set on a child of obj. + * + * @return 0 if the value has been set, or an AVERROR code in case of + * error: + * AVERROR_OPTION_NOT_FOUND if no matching option exists + * AVERROR(ERANGE) if the value is out of range + * AVERROR(EINVAL) if the value is not valid + */ +int av_opt_set (void *obj, const char *name, const char *val, int search_flags); +int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags); +int av_opt_set_double (void *obj, const char *name, double val, int search_flags); +int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags); +int av_opt_set_bin (void *obj, const char *name, const uint8_t *val, int size, int search_flags); +int av_opt_set_image_size(void *obj, const char *name, int w, int h, int search_flags); +int av_opt_set_pixel_fmt (void *obj, const char *name, enum AVPixelFormat fmt, int search_flags); +int av_opt_set_sample_fmt(void *obj, const char *name, enum AVSampleFormat fmt, int search_flags); +int av_opt_set_video_rate(void *obj, const char *name, AVRational val, int search_flags); +int av_opt_set_channel_layout(void *obj, const char *name, int64_t ch_layout, int search_flags); +/** + * @note Any old dictionary present is discarded and replaced with a copy of the new one. The + * caller still owns val is and responsible for freeing it. + */ +int av_opt_set_dict_val(void *obj, const char *name, const AVDictionary *val, int search_flags); + +/** + * Set a binary option to an integer list. + * + * @param obj AVClass object to set options on + * @param name name of the binary option + * @param val pointer to an integer list (must have the correct type with + * regard to the contents of the list) + * @param term list terminator (usually 0 or -1) + * @param flags search flags + */ +#define av_opt_set_int_list(obj, name, val, term, flags) \ + (av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? \ + AVERROR(EINVAL) : \ + av_opt_set_bin(obj, name, (const uint8_t *)(val), \ + av_int_list_length(val, term) * sizeof(*(val)), flags)) + +/** + * @} + */ + +/** + * @defgroup opt_get_funcs Option getting functions + * @{ + * Those functions get a value of the option with the given name from an object. + * + * @param[in] obj a struct whose first element is a pointer to an AVClass. + * @param[in] name name of the option to get. + * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN + * is passed here, then the option may be found in a child of obj. + * @param[out] out_val value of the option will be written here + * @return >=0 on success, a negative error code otherwise + */ +/** + * @note the returned string will be av_malloc()ed and must be av_free()ed by the caller + * + * @note if AV_OPT_ALLOW_NULL is set in search_flags in av_opt_get, and the option has + * AV_OPT_TYPE_STRING or AV_OPT_TYPE_BINARY and is set to NULL, *out_val will be set + * to NULL instead of an allocated empty string. + */ +int av_opt_get (void *obj, const char *name, int search_flags, uint8_t **out_val); +int av_opt_get_int (void *obj, const char *name, int search_flags, int64_t *out_val); +int av_opt_get_double (void *obj, const char *name, int search_flags, double *out_val); +int av_opt_get_q (void *obj, const char *name, int search_flags, AVRational *out_val); +int av_opt_get_image_size(void *obj, const char *name, int search_flags, int *w_out, int *h_out); +int av_opt_get_pixel_fmt (void *obj, const char *name, int search_flags, enum AVPixelFormat *out_fmt); +int av_opt_get_sample_fmt(void *obj, const char *name, int search_flags, enum AVSampleFormat *out_fmt); +int av_opt_get_video_rate(void *obj, const char *name, int search_flags, AVRational *out_val); +int av_opt_get_channel_layout(void *obj, const char *name, int search_flags, int64_t *ch_layout); +/** + * @param[out] out_val The returned dictionary is a copy of the actual value and must + * be freed with av_dict_free() by the caller + */ +int av_opt_get_dict_val(void *obj, const char *name, int search_flags, AVDictionary **out_val); +/** + * @} + */ +/** + * Gets a pointer to the requested field in a struct. + * This function allows accessing a struct even when its fields are moved or + * renamed since the application making the access has been compiled, + * + * @returns a pointer to the field, it can be cast to the correct type and read + * or written to. + */ +void *av_opt_ptr(const AVClass *avclass, void *obj, const char *name); + +/** + * Free an AVOptionRanges struct and set it to NULL. + */ +void av_opt_freep_ranges(AVOptionRanges **ranges); + +/** + * Get a list of allowed ranges for the given option. + * + * The returned list may depend on other fields in obj like for example profile. + * + * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored + * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance + * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges + * + * The result must be freed with av_opt_freep_ranges. + * + * @return number of compontents returned on success, a negative errro code otherwise + */ +int av_opt_query_ranges(AVOptionRanges **, void *obj, const char *key, int flags); + +/** + * Copy options from src object into dest object. + * + * Options that require memory allocation (e.g. string or binary) are malloc'ed in dest object. + * Original memory allocated for such options is freed unless both src and dest options points to the same memory. + * + * @param dest Object to copy from + * @param src Object to copy into + * @return 0 on success, negative on error + */ +int av_opt_copy(void *dest, const void *src); + +/** + * Get a default list of allowed ranges for the given option. + * + * This list is constructed without using the AVClass.query_ranges() callback + * and can be used as fallback from within the callback. + * + * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored + * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance + * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges + * + * The result must be freed with av_opt_free_ranges. + * + * @return number of compontents returned on success, a negative errro code otherwise + */ +int av_opt_query_ranges_default(AVOptionRanges **, void *obj, const char *key, int flags); + +/** + * Check if given option is set to its default value. + * + * Options o must belong to the obj. This function must not be called to check child's options state. + * @see av_opt_is_set_to_default_by_name(). + * + * @param obj AVClass object to check option on + * @param o option to be checked + * @return >0 when option is set to its default, + * 0 when option is not set its default, + * <0 on error + */ +int av_opt_is_set_to_default(void *obj, const AVOption *o); + +/** + * Check if given option is set to its default value. + * + * @param obj AVClass object to check option on + * @param name option name + * @param search_flags combination of AV_OPT_SEARCH_* + * @return >0 when option is set to its default, + * 0 when option is not set its default, + * <0 on error + */ +int av_opt_is_set_to_default_by_name(void *obj, const char *name, int search_flags); + + +#define AV_OPT_SERIALIZE_SKIP_DEFAULTS 0x00000001 ///< Serialize options that are not set to default values only. +#define AV_OPT_SERIALIZE_OPT_FLAGS_EXACT 0x00000002 ///< Serialize options that exactly match opt_flags only. + +/** + * Serialize object's options. + * + * Create a string containing object's serialized options. + * Such string may be passed back to av_opt_set_from_string() in order to restore option values. + * A key/value or pairs separator occurring in the serialized value or + * name string are escaped through the av_escape() function. + * + * @param[in] obj AVClass object to serialize + * @param[in] opt_flags serialize options with all the specified flags set (AV_OPT_FLAG) + * @param[in] flags combination of AV_OPT_SERIALIZE_* flags + * @param[out] buffer Pointer to buffer that will be allocated with string containg serialized options. + * Buffer must be freed by the caller when is no longer needed. + * @param[in] key_val_sep character used to separate key from value + * @param[in] pairs_sep character used to separate two pairs from each other + * @return >= 0 on success, negative on error + * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. + */ +int av_opt_serialize(void *obj, int opt_flags, int flags, char **buffer, + const char key_val_sep, const char pairs_sep); +/** + * @} + */ + +#endif /* AVUTIL_OPT_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/parseutils.h b/Src/Decoder_H264_ALL/include/libavutil/parseutils.h new file mode 100644 index 0000000..e66d24b --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/parseutils.h @@ -0,0 +1,193 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_PARSEUTILS_H +#define AVUTIL_PARSEUTILS_H + +#include + +#include "rational.h" + +/** + * @file + * misc parsing utilities + */ + +/** + * Parse str and store the parsed ratio in q. + * + * Note that a ratio with infinite (1/0) or negative value is + * considered valid, so you should check on the returned value if you + * want to exclude those values. + * + * The undefined value can be expressed using the "0:0" string. + * + * @param[in,out] q pointer to the AVRational which will contain the ratio + * @param[in] str the string to parse: it has to be a string in the format + * num:den, a float number or an expression + * @param[in] max the maximum allowed numerator and denominator + * @param[in] log_offset log level offset which is applied to the log + * level of log_ctx + * @param[in] log_ctx parent logging context + * @return >= 0 on success, a negative error code otherwise + */ +int av_parse_ratio(AVRational *q, const char *str, int max, + int log_offset, void *log_ctx); + +#define av_parse_ratio_quiet(rate, str, max) \ + av_parse_ratio(rate, str, max, AV_LOG_MAX_OFFSET, NULL) + +/** + * Parse str and put in width_ptr and height_ptr the detected values. + * + * @param[in,out] width_ptr pointer to the variable which will contain the detected + * width value + * @param[in,out] height_ptr pointer to the variable which will contain the detected + * height value + * @param[in] str the string to parse: it has to be a string in the format + * width x height or a valid video size abbreviation. + * @return >= 0 on success, a negative error code otherwise + */ +int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str); + +/** + * Parse str and store the detected values in *rate. + * + * @param[in,out] rate pointer to the AVRational which will contain the detected + * frame rate + * @param[in] str the string to parse: it has to be a string in the format + * rate_num / rate_den, a float number or a valid video rate abbreviation + * @return >= 0 on success, a negative error code otherwise + */ +int av_parse_video_rate(AVRational *rate, const char *str); + +/** + * Put the RGBA values that correspond to color_string in rgba_color. + * + * @param color_string a string specifying a color. It can be the name of + * a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence, + * possibly followed by "@" and a string representing the alpha + * component. + * The alpha component may be a string composed by "0x" followed by an + * hexadecimal number or a decimal number between 0.0 and 1.0, which + * represents the opacity value (0x00/0.0 means completely transparent, + * 0xff/1.0 completely opaque). + * If the alpha component is not specified then 0xff is assumed. + * The string "random" will result in a random color. + * @param slen length of the initial part of color_string containing the + * color. It can be set to -1 if color_string is a null terminated string + * containing nothing else than the color. + * @return >= 0 in case of success, a negative value in case of + * failure (for example if color_string cannot be parsed). + */ +int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, + void *log_ctx); + +/** + * Get the name of a color from the internal table of hard-coded named + * colors. + * + * This function is meant to enumerate the color names recognized by + * av_parse_color(). + * + * @param color_idx index of the requested color, starting from 0 + * @param rgbp if not NULL, will point to a 3-elements array with the color value in RGB + * @return the color name string or NULL if color_idx is not in the array + */ +const char *av_get_known_color_name(int color_idx, const uint8_t **rgb); + +/** + * Parse timestr and return in *time a corresponding number of + * microseconds. + * + * @param timeval puts here the number of microseconds corresponding + * to the string in timestr. If the string represents a duration, it + * is the number of microseconds contained in the time interval. If + * the string is a date, is the number of microseconds since 1st of + * January, 1970 up to the time of the parsed date. If timestr cannot + * be successfully parsed, set *time to INT64_MIN. + + * @param timestr a string representing a date or a duration. + * - If a date the syntax is: + * @code + * [{YYYY-MM-DD|YYYYMMDD}[T|t| ]]{{HH:MM:SS[.m...]]]}|{HHMMSS[.m...]]]}}[Z] + * now + * @endcode + * If the value is "now" it takes the current time. + * Time is local time unless Z is appended, in which case it is + * interpreted as UTC. + * If the year-month-day part is not specified it takes the current + * year-month-day. + * - If a duration the syntax is: + * @code + * [-][HH:]MM:SS[.m...] + * [-]S+[.m...] + * @endcode + * @param duration flag which tells how to interpret timestr, if not + * zero timestr is interpreted as a duration, otherwise as a date + * @return >= 0 in case of success, a negative value corresponding to an + * AVERROR code otherwise + */ +int av_parse_time(int64_t *timeval, const char *timestr, int duration); + +/** + * Attempt to find a specific tag in a URL. + * + * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done. + * Return 1 if found. + */ +int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info); + +/** + * Simplified version of strptime + * + * Parse the input string p according to the format string fmt and + * store its results in the structure dt. + * This implementation supports only a subset of the formats supported + * by the standard strptime(). + * + * The supported input field descriptors are listed below. + * - %H: the hour as a decimal number, using a 24-hour clock, in the + * range '00' through '23' + * - %J: hours as a decimal number, in the range '0' through INT_MAX + * - %M: the minute as a decimal number, using a 24-hour clock, in the + * range '00' through '59' + * - %S: the second as a decimal number, using a 24-hour clock, in the + * range '00' through '59' + * - %Y: the year as a decimal number, using the Gregorian calendar + * - %m: the month as a decimal number, in the range '1' through '12' + * - %d: the day of the month as a decimal number, in the range '1' + * through '31' + * - %T: alias for '%H:%M:%S' + * - %%: a literal '%' + * + * @return a pointer to the first character not processed in this function + * call. In case the input string contains more characters than + * required by the format string the return value points right after + * the last consumed input character. In case the whole input string + * is consumed the return value points to the null byte at the end of + * the string. On failure NULL is returned. + */ +char *av_small_strptime(const char *p, const char *fmt, struct tm *dt); + +/** + * Convert the decomposed UTC time in tm to a time_t value. + */ +time_t av_timegm(struct tm *tm); + +#endif /* AVUTIL_PARSEUTILS_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/pixdesc.h b/Src/Decoder_H264_ALL/include/libavutil/pixdesc.h new file mode 100644 index 0000000..3b0bcdb --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/pixdesc.h @@ -0,0 +1,394 @@ +/* + * pixel format descriptor + * Copyright (c) 2009 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_PIXDESC_H +#define AVUTIL_PIXDESC_H + +#include + +#include "attributes.h" +#include "pixfmt.h" +#include "version.h" + +typedef struct AVComponentDescriptor { + /** + * Which of the 4 planes contains the component. + */ + int plane; + + /** + * Number of elements between 2 horizontally consecutive pixels. + * Elements are bits for bitstream formats, bytes otherwise. + */ + int step; + + /** + * Number of elements before the component of the first pixel. + * Elements are bits for bitstream formats, bytes otherwise. + */ + int offset; + + /** + * Number of least significant bits that must be shifted away + * to get the value. + */ + int shift; + + /** + * Number of bits in the component. + */ + int depth; + +#if FF_API_PLUS1_MINUS1 + /** deprecated, use step instead */ + attribute_deprecated int step_minus1; + + /** deprecated, use depth instead */ + attribute_deprecated int depth_minus1; + + /** deprecated, use offset instead */ + attribute_deprecated int offset_plus1; +#endif +} AVComponentDescriptor; + +/** + * Descriptor that unambiguously describes how the bits of a pixel are + * stored in the up to 4 data planes of an image. It also stores the + * subsampling factors and number of components. + * + * @note This is separate of the colorspace (RGB, YCbCr, YPbPr, JPEG-style YUV + * and all the YUV variants) AVPixFmtDescriptor just stores how values + * are stored not what these values represent. + */ +typedef struct AVPixFmtDescriptor { + const char *name; + uint8_t nb_components; ///< The number of components each pixel has, (1-4) + + /** + * Amount to shift the luma width right to find the chroma width. + * For YV12 this is 1 for example. + * chroma_width = AV_CEIL_RSHIFT(luma_width, log2_chroma_w) + * The note above is needed to ensure rounding up. + * This value only refers to the chroma components. + */ + uint8_t log2_chroma_w; + + /** + * Amount to shift the luma height right to find the chroma height. + * For YV12 this is 1 for example. + * chroma_height= AV_CEIL_RSHIFT(luma_height, log2_chroma_h) + * The note above is needed to ensure rounding up. + * This value only refers to the chroma components. + */ + uint8_t log2_chroma_h; + + /** + * Combination of AV_PIX_FMT_FLAG_... flags. + */ + uint64_t flags; + + /** + * Parameters that describe how pixels are packed. + * If the format has 1 or 2 components, then luma is 0. + * If the format has 3 or 4 components: + * if the RGB flag is set then 0 is red, 1 is green and 2 is blue; + * otherwise 0 is luma, 1 is chroma-U and 2 is chroma-V. + * + * If present, the Alpha channel is always the last component. + */ + AVComponentDescriptor comp[4]; + + /** + * Alternative comma-separated names. + */ + const char *alias; +} AVPixFmtDescriptor; + +/** + * Pixel format is big-endian. + */ +#define AV_PIX_FMT_FLAG_BE (1 << 0) +/** + * Pixel format has a palette in data[1], values are indexes in this palette. + */ +#define AV_PIX_FMT_FLAG_PAL (1 << 1) +/** + * All values of a component are bit-wise packed end to end. + */ +#define AV_PIX_FMT_FLAG_BITSTREAM (1 << 2) +/** + * Pixel format is an HW accelerated format. + */ +#define AV_PIX_FMT_FLAG_HWACCEL (1 << 3) +/** + * At least one pixel component is not in the first data plane. + */ +#define AV_PIX_FMT_FLAG_PLANAR (1 << 4) +/** + * The pixel format contains RGB-like data (as opposed to YUV/grayscale). + */ +#define AV_PIX_FMT_FLAG_RGB (1 << 5) + +/** + * The pixel format is "pseudo-paletted". This means that it contains a + * fixed palette in the 2nd plane but the palette is fixed/constant for each + * PIX_FMT. This allows interpreting the data as if it was PAL8, which can + * in some cases be simpler. Or the data can be interpreted purely based on + * the pixel format without using the palette. + * An example of a pseudo-paletted format is AV_PIX_FMT_GRAY8 + */ +#define AV_PIX_FMT_FLAG_PSEUDOPAL (1 << 6) + +/** + * The pixel format has an alpha channel. This is set on all formats that + * support alpha in some way. The exception is AV_PIX_FMT_PAL8, which can + * carry alpha as part of the palette. Details are explained in the + * AVPixelFormat enum, and are also encoded in the corresponding + * AVPixFmtDescriptor. + * + * The alpha is always straight, never pre-multiplied. + * + * If a codec or a filter does not support alpha, it should set all alpha to + * opaque, or use the equivalent pixel formats without alpha component, e.g. + * AV_PIX_FMT_RGB0 (or AV_PIX_FMT_RGB24 etc.) instead of AV_PIX_FMT_RGBA. + */ +#define AV_PIX_FMT_FLAG_ALPHA (1 << 7) + +/** + * Read a line from an image, and write the values of the + * pixel format component c to dst. + * + * @param data the array containing the pointers to the planes of the image + * @param linesize the array containing the linesizes of the image + * @param desc the pixel format descriptor for the image + * @param x the horizontal coordinate of the first pixel to read + * @param y the vertical coordinate of the first pixel to read + * @param w the width of the line to read, that is the number of + * values to write to dst + * @param read_pal_component if not zero and the format is a paletted + * format writes the values corresponding to the palette + * component c in data[1] to dst, rather than the palette indexes in + * data[0]. The behavior is undefined if the format is not paletted. + */ +void av_read_image_line(uint16_t *dst, const uint8_t *data[4], + const int linesize[4], const AVPixFmtDescriptor *desc, + int x, int y, int c, int w, int read_pal_component); + +/** + * Write the values from src to the pixel format component c of an + * image line. + * + * @param src array containing the values to write + * @param data the array containing the pointers to the planes of the + * image to write into. It is supposed to be zeroed. + * @param linesize the array containing the linesizes of the image + * @param desc the pixel format descriptor for the image + * @param x the horizontal coordinate of the first pixel to write + * @param y the vertical coordinate of the first pixel to write + * @param w the width of the line to write, that is the number of + * values to write to the image line + */ +void av_write_image_line(const uint16_t *src, uint8_t *data[4], + const int linesize[4], const AVPixFmtDescriptor *desc, + int x, int y, int c, int w); + +/** + * Return the pixel format corresponding to name. + * + * If there is no pixel format with name name, then looks for a + * pixel format with the name corresponding to the native endian + * format of name. + * For example in a little-endian system, first looks for "gray16", + * then for "gray16le". + * + * Finally if no pixel format has been found, returns AV_PIX_FMT_NONE. + */ +enum AVPixelFormat av_get_pix_fmt(const char *name); + +/** + * Return the short name for a pixel format, NULL in case pix_fmt is + * unknown. + * + * @see av_get_pix_fmt(), av_get_pix_fmt_string() + */ +const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt); + +/** + * Print in buf the string corresponding to the pixel format with + * number pix_fmt, or a header if pix_fmt is negative. + * + * @param buf the buffer where to write the string + * @param buf_size the size of buf + * @param pix_fmt the number of the pixel format to print the + * corresponding info string, or a negative value to print the + * corresponding header. + */ +char *av_get_pix_fmt_string(char *buf, int buf_size, + enum AVPixelFormat pix_fmt); + +/** + * Return the number of bits per pixel used by the pixel format + * described by pixdesc. Note that this is not the same as the number + * of bits per sample. + * + * The returned number of bits refers to the number of bits actually + * used for storing the pixel information, that is padding bits are + * not counted. + */ +int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc); + +/** + * Return the number of bits per pixel for the pixel format + * described by pixdesc, including any padding or unused bits. + */ +int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc); + +/** + * @return a pixel format descriptor for provided pixel format or NULL if + * this pixel format is unknown. + */ +const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt); + +/** + * Iterate over all pixel format descriptors known to libavutil. + * + * @param prev previous descriptor. NULL to get the first descriptor. + * + * @return next descriptor or NULL after the last descriptor + */ +const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev); + +/** + * @return an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc + * is not a valid pointer to a pixel format descriptor. + */ +enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc); + +/** + * Utility function to access log2_chroma_w log2_chroma_h from + * the pixel format AVPixFmtDescriptor. + * + * See av_get_chroma_sub_sample() for a function that asserts a + * valid pixel format instead of returning an error code. + * Its recommended that you use avcodec_get_chroma_sub_sample unless + * you do check the return code! + * + * @param[in] pix_fmt the pixel format + * @param[out] h_shift store log2_chroma_w (horizontal/width shift) + * @param[out] v_shift store log2_chroma_h (vertical/height shift) + * + * @return 0 on success, AVERROR(ENOSYS) on invalid or unknown pixel format + */ +int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, + int *h_shift, int *v_shift); + +/** + * @return number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a + * valid pixel format. + */ +int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt); + +/** + * Utility function to swap the endianness of a pixel format. + * + * @param[in] pix_fmt the pixel format + * + * @return pixel format with swapped endianness if it exists, + * otherwise AV_PIX_FMT_NONE + */ +enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt); + +#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */ +#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */ +#define FF_LOSS_COLORSPACE 0x0004 /**< loss due to color space conversion */ +#define FF_LOSS_ALPHA 0x0008 /**< loss of alpha bits */ +#define FF_LOSS_COLORQUANT 0x0010 /**< loss due to color quantization */ +#define FF_LOSS_CHROMA 0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */ + +/** + * Compute what kind of losses will occur when converting from one specific + * pixel format to another. + * When converting from one pixel format to another, information loss may occur. + * For example, when converting from RGB24 to GRAY, the color information will + * be lost. Similarly, other losses occur when converting from some formats to + * other formats. These losses can involve loss of chroma, but also loss of + * resolution, loss of color depth, loss due to the color space conversion, loss + * of the alpha bits or loss due to color quantization. + * av_get_fix_fmt_loss() informs you about the various types of losses + * which will occur when converting from one pixel format to another. + * + * @param[in] dst_pix_fmt destination pixel format + * @param[in] src_pix_fmt source pixel format + * @param[in] has_alpha Whether the source pixel format alpha channel is used. + * @return Combination of flags informing you what kind of losses will occur + * (maximum loss for an invalid dst_pix_fmt). + */ +int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, + enum AVPixelFormat src_pix_fmt, + int has_alpha); + +/** + * Compute what kind of losses will occur when converting from one specific + * pixel format to another. + * When converting from one pixel format to another, information loss may occur. + * For example, when converting from RGB24 to GRAY, the color information will + * be lost. Similarly, other losses occur when converting from some formats to + * other formats. These losses can involve loss of chroma, but also loss of + * resolution, loss of color depth, loss due to the color space conversion, loss + * of the alpha bits or loss due to color quantization. + * av_get_fix_fmt_loss() informs you about the various types of losses + * which will occur when converting from one pixel format to another. + * + * @param[in] dst_pix_fmt destination pixel format + * @param[in] src_pix_fmt source pixel format + * @param[in] has_alpha Whether the source pixel format alpha channel is used. + * @return Combination of flags informing you what kind of losses will occur + * (maximum loss for an invalid dst_pix_fmt). + */ +enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, + enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); + +/** + * @return the name for provided color range or NULL if unknown. + */ +const char *av_color_range_name(enum AVColorRange range); + +/** + * @return the name for provided color primaries or NULL if unknown. + */ +const char *av_color_primaries_name(enum AVColorPrimaries primaries); + +/** + * @return the name for provided color transfer or NULL if unknown. + */ +const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer); + +/** + * @return the name for provided color space or NULL if unknown. + */ +const char *av_color_space_name(enum AVColorSpace space); + +/** + * @return the name for provided chroma location or NULL if unknown. + */ +const char *av_chroma_location_name(enum AVChromaLocation location); + +#endif /* AVUTIL_PIXDESC_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/pixelutils.h b/Src/Decoder_H264_ALL/include/libavutil/pixelutils.h new file mode 100644 index 0000000..a8dbc15 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/pixelutils.h @@ -0,0 +1,52 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_PIXELUTILS_H +#define AVUTIL_PIXELUTILS_H + +#include +#include +#include "common.h" + +/** + * Sum of abs(src1[x] - src2[x]) + */ +typedef int (*av_pixelutils_sad_fn)(const uint8_t *src1, ptrdiff_t stride1, + const uint8_t *src2, ptrdiff_t stride2); + +/** + * Get a potentially optimized pointer to a Sum-of-absolute-differences + * function (see the av_pixelutils_sad_fn prototype). + * + * @param w_bits 1< + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_PIXFMT_H +#define AVUTIL_PIXFMT_H + +/** + * @file + * pixel format definitions + */ + +#include "libavutil/avconfig.h" +#include "version.h" + +#define AVPALETTE_SIZE 1024 +#define AVPALETTE_COUNT 256 + +/** + * Pixel format. + * + * @note + * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA + * color is put together as: + * (A << 24) | (R << 16) | (G << 8) | B + * This is stored as BGRA on little-endian CPU architectures and ARGB on + * big-endian CPUs. + * + * @par + * When the pixel format is palettized RGB32 (AV_PIX_FMT_PAL8), the palettized + * image data is stored in AVFrame.data[0]. The palette is transported in + * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is + * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is + * also endian-specific). Note also that the individual RGB32 palette + * components stored in AVFrame.data[1] should be in the range 0..255. + * This is important as many custom PAL8 video codecs that were designed + * to run on the IBM VGA graphics adapter use 6-bit palette components. + * + * @par + * For all the 8 bits per pixel formats, an RGB32 palette is in data[1] like + * for pal8. This palette is filled in automatically by the function + * allocating the picture. + */ +enum AVPixelFormat { + AV_PIX_FMT_NONE = -1, + AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) + AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr + AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... + AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... + AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) + AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) + AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) + AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) + AV_PIX_FMT_GRAY8, ///< Y , 8bpp + AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb + AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb + AV_PIX_FMT_PAL8, ///< 8 bits with AV_PIX_FMT_RGB32 palette + AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range + AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting color_range + AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting color_range +#if FF_API_XVMC + AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing + AV_PIX_FMT_XVMC_MPEG2_IDCT, +#define AV_PIX_FMT_XVMC AV_PIX_FMT_XVMC_MPEG2_IDCT +#endif /* FF_API_XVMC */ + AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 + AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 + AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) + AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits + AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) + AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) + AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits + AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) + AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) + AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped + + AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... + AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... + AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... + AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... + + AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian + AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian + AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) + AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range + AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) +#if FF_API_VDPAU + AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers + AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers + AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers + AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers + AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers +#endif + AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian + AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian + + AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian + AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian + AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined + AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined + + AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian + AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian + AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined + AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined + +#if FF_API_VAAPI + /** @name Deprecated pixel formats */ + /**@{*/ + AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers + AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers + AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a VASurfaceID + /**@}*/ + AV_PIX_FMT_VAAPI = AV_PIX_FMT_VAAPI_VLD, +#else + /** + * Hardware acceleration through VA-API, data[3] contains a + * VASurfaceID. + */ + AV_PIX_FMT_VAAPI, +#endif + + AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian + AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian +#if FF_API_VDPAU + AV_PIX_FMT_VDPAU_MPEG4, ///< MPEG-4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers +#endif + AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer + + AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined + AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, X=unused/undefined + AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, X=unused/undefined + AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, X=unused/undefined + AV_PIX_FMT_YA8, ///< 8 bits gray, 8 bits alpha + + AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 + AV_PIX_FMT_GRAY8A= AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 + + AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian + AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian + + /** + * The following 12 formats have the disadvantage of needing 1 format for each bit depth. + * Notice that each 9/10 bits sample is stored in 16 bits with extra padding. + * If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately is better. + */ + AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian + AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian + AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian + AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian + AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA + AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp + AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian + AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian + AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian + AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian + AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian + AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian + AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) + AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) + AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian + AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian + AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian + AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian + AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian + AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian + AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) + AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) + AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) + AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) + AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) + AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) + AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) + AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) + AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) + AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) + AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) + AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) + + AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface + + AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 + AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 + AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) + AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + + AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian + AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian + AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian + AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian + + AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb + + AV_PIX_FMT_VDA, ///< HW acceleration through VDA, data[3] contains a CVPixelBufferRef + + AV_PIX_FMT_YA16BE, ///< 16 bits gray, 16 bits alpha (big-endian) + AV_PIX_FMT_YA16LE, ///< 16 bits gray, 16 bits alpha (little-endian) + + AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp + AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian + AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian + /** + * HW acceleration through QSV, data[3] contains a pointer to the + * mfxFrameSurface1 structure. + */ + AV_PIX_FMT_QSV, + /** + * HW acceleration though MMAL, data[3] contains a pointer to the + * MMAL_BUFFER_HEADER_T structure. + */ + AV_PIX_FMT_MMAL, + + AV_PIX_FMT_D3D11VA_VLD, ///< HW decoding through Direct3D11, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer + + /** + * HW acceleration through CUDA. data[i] contain CUdeviceptr pointers + * exactly as for system memory frames. + */ + AV_PIX_FMT_CUDA, + + AV_PIX_FMT_0RGB=0x123+4,///< packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined + AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined + AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined + AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined + + AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian + AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian + AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian + AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian + AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian + AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian + AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian + AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian + AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV411P and setting color_range + + AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples */ + AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples */ + AV_PIX_FMT_BAYER_GBRG8, ///< bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples */ + AV_PIX_FMT_BAYER_GRBG8, ///< bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples */ + AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian */ + AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian */ + AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian */ + AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian */ + AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian */ + AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian */ + AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian */ + AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian */ +#if !FF_API_XVMC + AV_PIX_FMT_XVMC,///< XVideo Motion Acceleration via common packet passing +#endif /* !FF_API_XVMC */ + AV_PIX_FMT_YUV440P10LE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian + AV_PIX_FMT_YUV440P10BE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian + AV_PIX_FMT_YUV440P12LE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian + AV_PIX_FMT_YUV440P12BE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian + AV_PIX_FMT_AYUV64LE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian + AV_PIX_FMT_AYUV64BE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), big-endian + + AV_PIX_FMT_VIDEOTOOLBOX, ///< hardware decoding through Videotoolbox + + AV_PIX_FMT_P010LE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian + AV_PIX_FMT_P010BE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian + + AV_PIX_FMT_GBRAP12BE, ///< planar GBR 4:4:4:4 48bpp, big-endian + AV_PIX_FMT_GBRAP12LE, ///< planar GBR 4:4:4:4 48bpp, little-endian + + AV_PIX_FMT_GBRAP10BE, ///< planar GBR 4:4:4:4 40bpp, big-endian + AV_PIX_FMT_GBRAP10LE, ///< planar GBR 4:4:4:4 40bpp, little-endian + + AV_PIX_FMT_MEDIACODEC, ///< hardware decoding through MediaCodec + + AV_PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions +}; + +#define AV_PIX_FMT_Y400A AV_PIX_FMT_GRAY8A +#define AV_PIX_FMT_GBR24P AV_PIX_FMT_GBRP + +#if AV_HAVE_BIGENDIAN +# define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##be +#else +# define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##le +#endif + +#define AV_PIX_FMT_RGB32 AV_PIX_FMT_NE(ARGB, BGRA) +#define AV_PIX_FMT_RGB32_1 AV_PIX_FMT_NE(RGBA, ABGR) +#define AV_PIX_FMT_BGR32 AV_PIX_FMT_NE(ABGR, RGBA) +#define AV_PIX_FMT_BGR32_1 AV_PIX_FMT_NE(BGRA, ARGB) +#define AV_PIX_FMT_0RGB32 AV_PIX_FMT_NE(0RGB, BGR0) +#define AV_PIX_FMT_0BGR32 AV_PIX_FMT_NE(0BGR, RGB0) + +#define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE) +#define AV_PIX_FMT_YA16 AV_PIX_FMT_NE(YA16BE, YA16LE) +#define AV_PIX_FMT_RGB48 AV_PIX_FMT_NE(RGB48BE, RGB48LE) +#define AV_PIX_FMT_RGB565 AV_PIX_FMT_NE(RGB565BE, RGB565LE) +#define AV_PIX_FMT_RGB555 AV_PIX_FMT_NE(RGB555BE, RGB555LE) +#define AV_PIX_FMT_RGB444 AV_PIX_FMT_NE(RGB444BE, RGB444LE) +#define AV_PIX_FMT_RGBA64 AV_PIX_FMT_NE(RGBA64BE, RGBA64LE) +#define AV_PIX_FMT_BGR48 AV_PIX_FMT_NE(BGR48BE, BGR48LE) +#define AV_PIX_FMT_BGR565 AV_PIX_FMT_NE(BGR565BE, BGR565LE) +#define AV_PIX_FMT_BGR555 AV_PIX_FMT_NE(BGR555BE, BGR555LE) +#define AV_PIX_FMT_BGR444 AV_PIX_FMT_NE(BGR444BE, BGR444LE) +#define AV_PIX_FMT_BGRA64 AV_PIX_FMT_NE(BGRA64BE, BGRA64LE) + +#define AV_PIX_FMT_YUV420P9 AV_PIX_FMT_NE(YUV420P9BE , YUV420P9LE) +#define AV_PIX_FMT_YUV422P9 AV_PIX_FMT_NE(YUV422P9BE , YUV422P9LE) +#define AV_PIX_FMT_YUV444P9 AV_PIX_FMT_NE(YUV444P9BE , YUV444P9LE) +#define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE) +#define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE) +#define AV_PIX_FMT_YUV440P10 AV_PIX_FMT_NE(YUV440P10BE, YUV440P10LE) +#define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE) +#define AV_PIX_FMT_YUV420P12 AV_PIX_FMT_NE(YUV420P12BE, YUV420P12LE) +#define AV_PIX_FMT_YUV422P12 AV_PIX_FMT_NE(YUV422P12BE, YUV422P12LE) +#define AV_PIX_FMT_YUV440P12 AV_PIX_FMT_NE(YUV440P12BE, YUV440P12LE) +#define AV_PIX_FMT_YUV444P12 AV_PIX_FMT_NE(YUV444P12BE, YUV444P12LE) +#define AV_PIX_FMT_YUV420P14 AV_PIX_FMT_NE(YUV420P14BE, YUV420P14LE) +#define AV_PIX_FMT_YUV422P14 AV_PIX_FMT_NE(YUV422P14BE, YUV422P14LE) +#define AV_PIX_FMT_YUV444P14 AV_PIX_FMT_NE(YUV444P14BE, YUV444P14LE) +#define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE) +#define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE) +#define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE) + +#define AV_PIX_FMT_GBRP9 AV_PIX_FMT_NE(GBRP9BE , GBRP9LE) +#define AV_PIX_FMT_GBRP10 AV_PIX_FMT_NE(GBRP10BE, GBRP10LE) +#define AV_PIX_FMT_GBRP12 AV_PIX_FMT_NE(GBRP12BE, GBRP12LE) +#define AV_PIX_FMT_GBRP14 AV_PIX_FMT_NE(GBRP14BE, GBRP14LE) +#define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE) +#define AV_PIX_FMT_GBRAP10 AV_PIX_FMT_NE(GBRAP10BE, GBRAP10LE) +#define AV_PIX_FMT_GBRAP12 AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE) +#define AV_PIX_FMT_GBRAP16 AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE) + +#define AV_PIX_FMT_BAYER_BGGR16 AV_PIX_FMT_NE(BAYER_BGGR16BE, BAYER_BGGR16LE) +#define AV_PIX_FMT_BAYER_RGGB16 AV_PIX_FMT_NE(BAYER_RGGB16BE, BAYER_RGGB16LE) +#define AV_PIX_FMT_BAYER_GBRG16 AV_PIX_FMT_NE(BAYER_GBRG16BE, BAYER_GBRG16LE) +#define AV_PIX_FMT_BAYER_GRBG16 AV_PIX_FMT_NE(BAYER_GRBG16BE, BAYER_GRBG16LE) + + +#define AV_PIX_FMT_YUVA420P9 AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE) +#define AV_PIX_FMT_YUVA422P9 AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE) +#define AV_PIX_FMT_YUVA444P9 AV_PIX_FMT_NE(YUVA444P9BE , YUVA444P9LE) +#define AV_PIX_FMT_YUVA420P10 AV_PIX_FMT_NE(YUVA420P10BE, YUVA420P10LE) +#define AV_PIX_FMT_YUVA422P10 AV_PIX_FMT_NE(YUVA422P10BE, YUVA422P10LE) +#define AV_PIX_FMT_YUVA444P10 AV_PIX_FMT_NE(YUVA444P10BE, YUVA444P10LE) +#define AV_PIX_FMT_YUVA420P16 AV_PIX_FMT_NE(YUVA420P16BE, YUVA420P16LE) +#define AV_PIX_FMT_YUVA422P16 AV_PIX_FMT_NE(YUVA422P16BE, YUVA422P16LE) +#define AV_PIX_FMT_YUVA444P16 AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE) + +#define AV_PIX_FMT_XYZ12 AV_PIX_FMT_NE(XYZ12BE, XYZ12LE) +#define AV_PIX_FMT_NV20 AV_PIX_FMT_NE(NV20BE, NV20LE) +#define AV_PIX_FMT_AYUV64 AV_PIX_FMT_NE(AYUV64BE, AYUV64LE) +#define AV_PIX_FMT_P010 AV_PIX_FMT_NE(P010BE, P010LE) + +/** + * Chromaticity coordinates of the source primaries. + */ +enum AVColorPrimaries { + AVCOL_PRI_RESERVED0 = 0, + AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B + AVCOL_PRI_UNSPECIFIED = 2, + AVCOL_PRI_RESERVED = 3, + AVCOL_PRI_BT470M = 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20) + + AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM + AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC + AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above + AVCOL_PRI_FILM = 8, ///< colour filters using Illuminant C + AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 + AVCOL_PRI_SMPTEST428_1= 10, ///< SMPTE ST 428-1 (CIE 1931 XYZ) + AVCOL_PRI_NB, ///< Not part of ABI +}; + +/** + * Color Transfer Characteristic. + */ +enum AVColorTransferCharacteristic { + AVCOL_TRC_RESERVED0 = 0, + AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 + AVCOL_TRC_UNSPECIFIED = 2, + AVCOL_TRC_RESERVED = 3, + AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM + AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG + AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC + AVCOL_TRC_SMPTE240M = 7, + AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" + AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" + AVCOL_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)" + AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 + AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut + AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) + AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10-bit system + AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12-bit system + AVCOL_TRC_SMPTEST2084 = 16, ///< SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + AVCOL_TRC_SMPTEST428_1 = 17, ///< SMPTE ST 428-1 + AVCOL_TRC_ARIB_STD_B67 = 18, ///< ARIB STD-B67, known as "Hybrid log-gamma" + AVCOL_TRC_NB, ///< Not part of ABI +}; + +/** + * YUV colorspace type. + */ +enum AVColorSpace { + AVCOL_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB) + AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B + AVCOL_SPC_UNSPECIFIED = 2, + AVCOL_SPC_RESERVED = 3, + AVCOL_SPC_FCC = 4, ///< FCC Title 47 Code of Federal Regulations 73.682 (a)(20) + AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 + AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC + AVCOL_SPC_SMPTE240M = 7, ///< functionally identical to above + AVCOL_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 + AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system + AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system + AVCOL_SPC_NB, ///< Not part of ABI +}; +#define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG + + +/** + * MPEG vs JPEG YUV range. + */ +enum AVColorRange { + AVCOL_RANGE_UNSPECIFIED = 0, + AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges + AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges + AVCOL_RANGE_NB, ///< Not part of ABI +}; + +/** + * Location of chroma samples. + * + * Illustration showing the location of the first (top left) chroma sample of the + * image, the left shows only luma, the right + * shows the location of the chroma sample, the 2 could be imagined to overlay + * each other but are drawn separately due to limitations of ASCII + * + * 1st 2nd 1st 2nd horizontal luma sample positions + * v v v v + * ______ ______ + *1st luma line > |X X ... |3 4 X ... X are luma samples, + * | |1 2 1-6 are possible chroma positions + *2nd luma line > |X X ... |5 6 X ... 0 is undefined/unknown position + */ +enum AVChromaLocation { + AVCHROMA_LOC_UNSPECIFIED = 0, + AVCHROMA_LOC_LEFT = 1, ///< MPEG-2/4 4:2:0, H.264 default for 4:2:0 + AVCHROMA_LOC_CENTER = 2, ///< MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0 + AVCHROMA_LOC_TOPLEFT = 3, ///< ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2 + AVCHROMA_LOC_TOP = 4, + AVCHROMA_LOC_BOTTOMLEFT = 5, + AVCHROMA_LOC_BOTTOM = 6, + AVCHROMA_LOC_NB, ///< Not part of ABI +}; + +#endif /* AVUTIL_PIXFMT_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/random_seed.h b/Src/Decoder_H264_ALL/include/libavutil/random_seed.h new file mode 100644 index 0000000..0462a04 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/random_seed.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2009 Baptiste Coudurier + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_RANDOM_SEED_H +#define AVUTIL_RANDOM_SEED_H + +#include +/** + * @addtogroup lavu_crypto + * @{ + */ + +/** + * Get a seed to use in conjunction with random functions. + * This function tries to provide a good seed at a best effort bases. + * Its possible to call this function multiple times if more bits are needed. + * It can be quite slow, which is why it should only be used as seed for a faster + * PRNG. The quality of the seed depends on the platform. + */ +uint32_t av_get_random_seed(void); + +/** + * @} + */ + +#endif /* AVUTIL_RANDOM_SEED_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/rational.h b/Src/Decoder_H264_ALL/include/libavutil/rational.h new file mode 100644 index 0000000..2897469 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/rational.h @@ -0,0 +1,173 @@ +/* + * rational numbers + * Copyright (c) 2003 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * rational numbers + * @author Michael Niedermayer + */ + +#ifndef AVUTIL_RATIONAL_H +#define AVUTIL_RATIONAL_H + +#include +#include +#include "attributes.h" + +/** + * @addtogroup lavu_math + * @{ + */ + +/** + * rational number numerator/denominator + */ +typedef struct AVRational{ + int num; ///< numerator + int den; ///< denominator +} AVRational; + +/** + * Create a rational. + * Useful for compilers that do not support compound literals. + * @note The return value is not reduced. + */ +static inline AVRational av_make_q(int num, int den) +{ + AVRational r = { num, den }; + return r; +} + +/** + * Compare two rationals. + * @param a first rational + * @param b second rational + * @return 0 if a==b, 1 if a>b, -1 if a>63)|1; + else if(b.den && a.den) return 0; + else if(a.num && b.num) return (a.num>>31) - (b.num>>31); + else return INT_MIN; +} + +/** + * Convert rational to double. + * @param a rational to convert + * @return (double) a + */ +static inline double av_q2d(AVRational a){ + return a.num / (double) a.den; +} + +/** + * Reduce a fraction. + * This is useful for framerate calculations. + * @param dst_num destination numerator + * @param dst_den destination denominator + * @param num source numerator + * @param den source denominator + * @param max the maximum allowed for dst_num & dst_den + * @return 1 if exact, 0 otherwise + */ +int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max); + +/** + * Multiply two rationals. + * @param b first rational + * @param c second rational + * @return b*c + */ +AVRational av_mul_q(AVRational b, AVRational c) av_const; + +/** + * Divide one rational by another. + * @param b first rational + * @param c second rational + * @return b/c + */ +AVRational av_div_q(AVRational b, AVRational c) av_const; + +/** + * Add two rationals. + * @param b first rational + * @param c second rational + * @return b+c + */ +AVRational av_add_q(AVRational b, AVRational c) av_const; + +/** + * Subtract one rational from another. + * @param b first rational + * @param c second rational + * @return b-c + */ +AVRational av_sub_q(AVRational b, AVRational c) av_const; + +/** + * Invert a rational. + * @param q value + * @return 1 / q + */ +static av_always_inline AVRational av_inv_q(AVRational q) +{ + AVRational r = { q.den, q.num }; + return r; +} + +/** + * Convert a double precision floating point number to a rational. + * inf is expressed as {1,0} or {-1,0} depending on the sign. + * + * @param d double to convert + * @param max the maximum allowed numerator and denominator + * @return (AVRational) d + */ +AVRational av_d2q(double d, int max) av_const; + +/** + * @return 1 if q1 is nearer to q than q2, -1 if q2 is nearer + * than q1, 0 if they have the same distance. + */ +int av_nearer_q(AVRational q, AVRational q1, AVRational q2); + +/** + * Find the nearest value in q_list to q. + * @param q_list an array of rationals terminated by {0, 0} + * @return the index of the nearest value found in the array + */ +int av_find_nearest_q_idx(AVRational q, const AVRational* q_list); + +/** + * Converts a AVRational to a IEEE 32bit float. + * + * The float is returned in a uint32_t and its value is platform indepenant. + */ +uint32_t av_q2intfloat(AVRational q); + +/** + * @} + */ + +#endif /* AVUTIL_RATIONAL_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/rc4.h b/Src/Decoder_H264_ALL/include/libavutil/rc4.h new file mode 100644 index 0000000..029cd2a --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/rc4.h @@ -0,0 +1,66 @@ +/* + * RC4 encryption/decryption/pseudo-random number generator + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_RC4_H +#define AVUTIL_RC4_H + +#include + +/** + * @defgroup lavu_rc4 RC4 + * @ingroup lavu_crypto + * @{ + */ + +typedef struct AVRC4 { + uint8_t state[256]; + int x, y; +} AVRC4; + +/** + * Allocate an AVRC4 context. + */ +AVRC4 *av_rc4_alloc(void); + +/** + * @brief Initializes an AVRC4 context. + * + * @param key_bits must be a multiple of 8 + * @param decrypt 0 for encryption, 1 for decryption, currently has no effect + * @return zero on success, negative value otherwise + */ +int av_rc4_init(struct AVRC4 *d, const uint8_t *key, int key_bits, int decrypt); + +/** + * @brief Encrypts / decrypts using the RC4 algorithm. + * + * @param count number of bytes + * @param dst destination array, can be equal to src + * @param src source array, can be equal to dst, may be NULL + * @param iv not (yet) used for RC4, should be NULL + * @param decrypt 0 for encryption, 1 for decryption, not (yet) used + */ +void av_rc4_crypt(struct AVRC4 *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); + +/** + * @} + */ + +#endif /* AVUTIL_RC4_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/replaygain.h b/Src/Decoder_H264_ALL/include/libavutil/replaygain.h new file mode 100644 index 0000000..b49bf1a --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/replaygain.h @@ -0,0 +1,50 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_REPLAYGAIN_H +#define AVUTIL_REPLAYGAIN_H + +#include + +/** + * ReplayGain information (see + * http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification). + * The size of this struct is a part of the public ABI. + */ +typedef struct AVReplayGain { + /** + * Track replay gain in microbels (divide by 100000 to get the value in dB). + * Should be set to INT32_MIN when unknown. + */ + int32_t track_gain; + /** + * Peak track amplitude, with 100000 representing full scale (but values + * may overflow). 0 when unknown. + */ + uint32_t track_peak; + /** + * Same as track_gain, but for the whole album. + */ + int32_t album_gain; + /** + * Same as track_peak, but for the whole album, + */ + uint32_t album_peak; +} AVReplayGain; + +#endif /* AVUTIL_REPLAYGAIN_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/ripemd.h b/Src/Decoder_H264_ALL/include/libavutil/ripemd.h new file mode 100644 index 0000000..7b0c8bc --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/ripemd.h @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2007 Michael Niedermayer + * Copyright (C) 2013 James Almer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_RIPEMD_H +#define AVUTIL_RIPEMD_H + +#include + +#include "attributes.h" +#include "version.h" + +/** + * @defgroup lavu_ripemd RIPEMD + * @ingroup lavu_crypto + * @{ + */ + +extern const int av_ripemd_size; + +struct AVRIPEMD; + +/** + * Allocate an AVRIPEMD context. + */ +struct AVRIPEMD *av_ripemd_alloc(void); + +/** + * Initialize RIPEMD hashing. + * + * @param context pointer to the function context (of size av_ripemd_size) + * @param bits number of bits in digest (128, 160, 256 or 320 bits) + * @return zero if initialization succeeded, -1 otherwise + */ +int av_ripemd_init(struct AVRIPEMD* context, int bits); + +/** + * Update hash value. + * + * @param context hash function context + * @param data input data to update hash with + * @param len input data length + */ +void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len); + +/** + * Finish hashing and output digest value. + * + * @param context hash function context + * @param digest buffer where output digest value is stored + */ +void av_ripemd_final(struct AVRIPEMD* context, uint8_t *digest); + +/** + * @} + */ + +#endif /* AVUTIL_RIPEMD_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/samplefmt.h b/Src/Decoder_H264_ALL/include/libavutil/samplefmt.h new file mode 100644 index 0000000..57da278 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/samplefmt.h @@ -0,0 +1,270 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_SAMPLEFMT_H +#define AVUTIL_SAMPLEFMT_H + +#include + +#include "avutil.h" +#include "attributes.h" + +/** + * @addtogroup lavu_audio + * @{ + * + * @defgroup lavu_sampfmts Audio sample formats + * + * Audio sample format enumeration and related convenience functions. + * @{ + */ + +/** + * Audio sample formats + * + * - The data described by the sample format is always in native-endian order. + * Sample values can be expressed by native C types, hence the lack of a signed + * 24-bit sample format even though it is a common raw audio data format. + * + * - The floating-point formats are based on full volume being in the range + * [-1.0, 1.0]. Any values outside this range are beyond full volume level. + * + * - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg + * (such as AVFrame in libavcodec) is as follows: + * + * @par + * For planar sample formats, each audio channel is in a separate data plane, + * and linesize is the buffer size, in bytes, for a single plane. All data + * planes must be the same size. For packed sample formats, only the first data + * plane is used, and samples for each channel are interleaved. In this case, + * linesize is the buffer size, in bytes, for the 1 plane. + * + */ +enum AVSampleFormat { + AV_SAMPLE_FMT_NONE = -1, + AV_SAMPLE_FMT_U8, ///< unsigned 8 bits + AV_SAMPLE_FMT_S16, ///< signed 16 bits + AV_SAMPLE_FMT_S32, ///< signed 32 bits + AV_SAMPLE_FMT_FLT, ///< float + AV_SAMPLE_FMT_DBL, ///< double + + AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar + AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar + AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar + AV_SAMPLE_FMT_FLTP, ///< float, planar + AV_SAMPLE_FMT_DBLP, ///< double, planar + + AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically +}; + +/** + * Return the name of sample_fmt, or NULL if sample_fmt is not + * recognized. + */ +const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt); + +/** + * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE + * on error. + */ +enum AVSampleFormat av_get_sample_fmt(const char *name); + +/** + * Return the planar<->packed alternative form of the given sample format, or + * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the + * requested planar/packed format, the format returned is the same as the + * input. + */ +enum AVSampleFormat av_get_alt_sample_fmt(enum AVSampleFormat sample_fmt, int planar); + +/** + * Get the packed alternative form of the given sample format. + * + * If the passed sample_fmt is already in packed format, the format returned is + * the same as the input. + * + * @return the packed alternative form of the given sample format or + AV_SAMPLE_FMT_NONE on error. + */ +enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt); + +/** + * Get the planar alternative form of the given sample format. + * + * If the passed sample_fmt is already in planar format, the format returned is + * the same as the input. + * + * @return the planar alternative form of the given sample format or + AV_SAMPLE_FMT_NONE on error. + */ +enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt); + +/** + * Generate a string corresponding to the sample format with + * sample_fmt, or a header if sample_fmt is negative. + * + * @param buf the buffer where to write the string + * @param buf_size the size of buf + * @param sample_fmt the number of the sample format to print the + * corresponding info string, or a negative value to print the + * corresponding header. + * @return the pointer to the filled buffer or NULL if sample_fmt is + * unknown or in case of other errors + */ +char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt); + +/** + * Return number of bytes per sample. + * + * @param sample_fmt the sample format + * @return number of bytes per sample or zero if unknown for the given + * sample format + */ +int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt); + +/** + * Check if the sample format is planar. + * + * @param sample_fmt the sample format to inspect + * @return 1 if the sample format is planar, 0 if it is interleaved + */ +int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt); + +/** + * Get the required buffer size for the given audio parameters. + * + * @param[out] linesize calculated linesize, may be NULL + * @param nb_channels the number of channels + * @param nb_samples the number of samples in a single channel + * @param sample_fmt the sample format + * @param align buffer size alignment (0 = default, 1 = no alignment) + * @return required buffer size, or negative error code on failure + */ +int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, + enum AVSampleFormat sample_fmt, int align); + +/** + * @} + * + * @defgroup lavu_sampmanip Samples manipulation + * + * Functions that manipulate audio samples + * @{ + */ + +/** + * Fill plane data pointers and linesize for samples with sample + * format sample_fmt. + * + * The audio_data array is filled with the pointers to the samples data planes: + * for planar, set the start point of each channel's data within the buffer, + * for packed, set the start point of the entire buffer only. + * + * The value pointed to by linesize is set to the aligned size of each + * channel's data buffer for planar layout, or to the aligned size of the + * buffer for all channels for packed layout. + * + * The buffer in buf must be big enough to contain all the samples + * (use av_samples_get_buffer_size() to compute its minimum size), + * otherwise the audio_data pointers will point to invalid data. + * + * @see enum AVSampleFormat + * The documentation for AVSampleFormat describes the data layout. + * + * @param[out] audio_data array to be filled with the pointer for each channel + * @param[out] linesize calculated linesize, may be NULL + * @param buf the pointer to a buffer containing the samples + * @param nb_channels the number of channels + * @param nb_samples the number of samples in a single channel + * @param sample_fmt the sample format + * @param align buffer size alignment (0 = default, 1 = no alignment) + * @return >=0 on success or a negative error code on failure + * @todo return minimum size in bytes required for the buffer in case + * of success at the next bump + */ +int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, + const uint8_t *buf, + int nb_channels, int nb_samples, + enum AVSampleFormat sample_fmt, int align); + +/** + * Allocate a samples buffer for nb_samples samples, and fill data pointers and + * linesize accordingly. + * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) + * Allocated data will be initialized to silence. + * + * @see enum AVSampleFormat + * The documentation for AVSampleFormat describes the data layout. + * + * @param[out] audio_data array to be filled with the pointer for each channel + * @param[out] linesize aligned size for audio buffer(s), may be NULL + * @param nb_channels number of audio channels + * @param nb_samples number of samples per channel + * @param align buffer size alignment (0 = default, 1 = no alignment) + * @return >=0 on success or a negative error code on failure + * @todo return the size of the allocated buffer in case of success at the next bump + * @see av_samples_fill_arrays() + * @see av_samples_alloc_array_and_samples() + */ +int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels, + int nb_samples, enum AVSampleFormat sample_fmt, int align); + +/** + * Allocate a data pointers array, samples buffer for nb_samples + * samples, and fill data pointers and linesize accordingly. + * + * This is the same as av_samples_alloc(), but also allocates the data + * pointers array. + * + * @see av_samples_alloc() + */ +int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int nb_channels, + int nb_samples, enum AVSampleFormat sample_fmt, int align); + +/** + * Copy samples from src to dst. + * + * @param dst destination array of pointers to data planes + * @param src source array of pointers to data planes + * @param dst_offset offset in samples at which the data will be written to dst + * @param src_offset offset in samples at which the data will be read from src + * @param nb_samples number of samples to be copied + * @param nb_channels number of audio channels + * @param sample_fmt audio sample format + */ +int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, + int src_offset, int nb_samples, int nb_channels, + enum AVSampleFormat sample_fmt); + +/** + * Fill an audio buffer with silence. + * + * @param audio_data array of pointers to data planes + * @param offset offset in samples at which to start filling + * @param nb_samples number of samples to fill + * @param nb_channels number of audio channels + * @param sample_fmt audio sample format + */ +int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, + int nb_channels, enum AVSampleFormat sample_fmt); + +/** + * @} + * @} + */ +#endif /* AVUTIL_SAMPLEFMT_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/sha.h b/Src/Decoder_H264_ALL/include/libavutil/sha.h new file mode 100644 index 0000000..bf4377e --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/sha.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2007 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_SHA_H +#define AVUTIL_SHA_H + +#include + +#include "attributes.h" +#include "version.h" + +/** + * @defgroup lavu_sha SHA + * @ingroup lavu_crypto + * @{ + */ + +extern const int av_sha_size; + +struct AVSHA; + +/** + * Allocate an AVSHA context. + */ +struct AVSHA *av_sha_alloc(void); + +/** + * Initialize SHA-1 or SHA-2 hashing. + * + * @param context pointer to the function context (of size av_sha_size) + * @param bits number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits) + * @return zero if initialization succeeded, -1 otherwise + */ +int av_sha_init(struct AVSHA* context, int bits); + +/** + * Update hash value. + * + * @param context hash function context + * @param data input data to update hash with + * @param len input data length + */ +void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len); + +/** + * Finish hashing and output digest value. + * + * @param context hash function context + * @param digest buffer where output digest value is stored + */ +void av_sha_final(struct AVSHA* context, uint8_t *digest); + +/** + * @} + */ + +#endif /* AVUTIL_SHA_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/sha512.h b/Src/Decoder_H264_ALL/include/libavutil/sha512.h new file mode 100644 index 0000000..7b08701 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/sha512.h @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2007 Michael Niedermayer + * Copyright (C) 2013 James Almer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_SHA512_H +#define AVUTIL_SHA512_H + +#include + +#include "attributes.h" +#include "version.h" + +/** + * @defgroup lavu_sha512 SHA512 + * @ingroup lavu_crypto + * @{ + */ + +extern const int av_sha512_size; + +struct AVSHA512; + +/** + * Allocate an AVSHA512 context. + */ +struct AVSHA512 *av_sha512_alloc(void); + +/** + * Initialize SHA-2 512 hashing. + * + * @param context pointer to the function context (of size av_sha512_size) + * @param bits number of bits in digest (224, 256, 384 or 512 bits) + * @return zero if initialization succeeded, -1 otherwise + */ +int av_sha512_init(struct AVSHA512* context, int bits); + +/** + * Update hash value. + * + * @param context hash function context + * @param data input data to update hash with + * @param len input data length + */ +void av_sha512_update(struct AVSHA512* context, const uint8_t* data, unsigned int len); + +/** + * Finish hashing and output digest value. + * + * @param context hash function context + * @param digest buffer where output digest value is stored + */ +void av_sha512_final(struct AVSHA512* context, uint8_t *digest); + +/** + * @} + */ + +#endif /* AVUTIL_SHA512_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/stereo3d.h b/Src/Decoder_H264_ALL/include/libavutil/stereo3d.h new file mode 100644 index 0000000..19c5416 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/stereo3d.h @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2013 Vittorio Giovara + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_STEREO3D_H +#define AVUTIL_STEREO3D_H + +#include + +#include "frame.h" + +/** + * List of possible 3D Types + */ +enum AVStereo3DType { + /** + * Video is not stereoscopic (and metadata has to be there). + */ + AV_STEREO3D_2D, + + /** + * Views are next to each other. + * + * LLLLRRRR + * LLLLRRRR + * LLLLRRRR + * ... + */ + AV_STEREO3D_SIDEBYSIDE, + + /** + * Views are on top of each other. + * + * LLLLLLLL + * LLLLLLLL + * RRRRRRRR + * RRRRRRRR + */ + AV_STEREO3D_TOPBOTTOM, + + /** + * Views are alternated temporally. + * + * frame0 frame1 frame2 ... + * LLLLLLLL RRRRRRRR LLLLLLLL + * LLLLLLLL RRRRRRRR LLLLLLLL + * LLLLLLLL RRRRRRRR LLLLLLLL + * ... ... ... + */ + AV_STEREO3D_FRAMESEQUENCE, + + /** + * Views are packed in a checkerboard-like structure per pixel. + * + * LRLRLRLR + * RLRLRLRL + * LRLRLRLR + * ... + */ + AV_STEREO3D_CHECKERBOARD, + + /** + * Views are next to each other, but when upscaling + * apply a checkerboard pattern. + * + * LLLLRRRR L L L L R R R R + * LLLLRRRR => L L L L R R R R + * LLLLRRRR L L L L R R R R + * LLLLRRRR L L L L R R R R + */ + AV_STEREO3D_SIDEBYSIDE_QUINCUNX, + + /** + * Views are packed per line, as if interlaced. + * + * LLLLLLLL + * RRRRRRRR + * LLLLLLLL + * ... + */ + AV_STEREO3D_LINES, + + /** + * Views are packed per column. + * + * LRLRLRLR + * LRLRLRLR + * LRLRLRLR + * ... + */ + AV_STEREO3D_COLUMNS, +}; + + +/** + * Inverted views, Right/Bottom represents the left view. + */ +#define AV_STEREO3D_FLAG_INVERT (1 << 0) + +/** + * Stereo 3D type: this structure describes how two videos are packed + * within a single video surface, with additional information as needed. + * + * @note The struct must be allocated with av_stereo3d_alloc() and + * its size is not a part of the public ABI. + */ +typedef struct AVStereo3D { + /** + * How views are packed within the video. + */ + enum AVStereo3DType type; + + /** + * Additional information about the frame packing. + */ + int flags; +} AVStereo3D; + +/** + * Allocate an AVStereo3D structure and set its fields to default values. + * The resulting struct can be freed using av_freep(). + * + * @return An AVStereo3D filled with default values or NULL on failure. + */ +AVStereo3D *av_stereo3d_alloc(void); + +/** + * Allocate a complete AVFrameSideData and add it to the frame. + * + * @param frame The frame which side data is added to. + * + * @return The AVStereo3D structure to be filled by caller. + */ +AVStereo3D *av_stereo3d_create_side_data(AVFrame *frame); + +/** + * Provide a human-readable name of a given stereo3d type. + * + * @param type The input stereo3d type value. + * + * @return The name of the stereo3d value, or "unknown". + */ +const char *av_stereo3d_type_name(unsigned int type); + +/** + * Get the AVStereo3DType form a human-readable name. + * + * @param type The input string. + * + * @return The AVStereo3DType value, or -1 if not found. + */ +int av_stereo3d_from_name(const char *name); + +#endif /* AVUTIL_STEREO3D_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/tea.h b/Src/Decoder_H264_ALL/include/libavutil/tea.h new file mode 100644 index 0000000..dd929bd --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/tea.h @@ -0,0 +1,71 @@ +/* + * A 32-bit implementation of the TEA algorithm + * Copyright (c) 2015 Vesselin Bontchev + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_TEA_H +#define AVUTIL_TEA_H + +#include + +/** + * @file + * @brief Public header for libavutil TEA algorithm + * @defgroup lavu_tea TEA + * @ingroup lavu_crypto + * @{ + */ + +extern const int av_tea_size; + +struct AVTEA; + +/** + * Allocate an AVTEA context + * To free the struct: av_free(ptr) + */ +struct AVTEA *av_tea_alloc(void); + +/** + * Initialize an AVTEA context. + * + * @param ctx an AVTEA context + * @param key a key of 16 bytes used for encryption/decryption + * @param rounds the number of rounds in TEA (64 is the "standard") + */ +void av_tea_init(struct AVTEA *ctx, const uint8_t key[16], int rounds); + +/** + * Encrypt or decrypt a buffer using a previously initialized context. + * + * @param ctx an AVTEA context + * @param dst destination array, can be equal to src + * @param src source array, can be equal to dst + * @param count number of 8 byte blocks + * @param iv initialization vector for CBC mode, if NULL then ECB will be used + * @param decrypt 0 for encryption, 1 for decryption + */ +void av_tea_crypt(struct AVTEA *ctx, uint8_t *dst, const uint8_t *src, + int count, uint8_t *iv, int decrypt); + +/** + * @} + */ + +#endif /* AVUTIL_TEA_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/threadmessage.h b/Src/Decoder_H264_ALL/include/libavutil/threadmessage.h new file mode 100644 index 0000000..8480a0a --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/threadmessage.h @@ -0,0 +1,107 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with FFmpeg; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_THREADMESSAGE_H +#define AVUTIL_THREADMESSAGE_H + +typedef struct AVThreadMessageQueue AVThreadMessageQueue; + +typedef enum AVThreadMessageFlags { + + /** + * Perform non-blocking operation. + * If this flag is set, send and recv operations are non-blocking and + * return AVERROR(EAGAIN) immediately if they can not proceed. + */ + AV_THREAD_MESSAGE_NONBLOCK = 1, + +} AVThreadMessageFlags; + +/** + * Allocate a new message queue. + * + * @param mq pointer to the message queue + * @param nelem maximum number of elements in the queue + * @param elsize size of each element in the queue + * @return >=0 for success; <0 for error, in particular AVERROR(ENOSYS) if + * lavu was built without thread support + */ +int av_thread_message_queue_alloc(AVThreadMessageQueue **mq, + unsigned nelem, + unsigned elsize); + +/** + * Free a message queue. + * + * The message queue must no longer be in use by another thread. + */ +void av_thread_message_queue_free(AVThreadMessageQueue **mq); + +/** + * Send a message on the queue. + */ +int av_thread_message_queue_send(AVThreadMessageQueue *mq, + void *msg, + unsigned flags); + +/** + * Receive a message from the queue. + */ +int av_thread_message_queue_recv(AVThreadMessageQueue *mq, + void *msg, + unsigned flags); + +/** + * Set the sending error code. + * + * If the error code is set to non-zero, av_thread_message_queue_send() will + * return it immediately. Conventional values, such as AVERROR_EOF or + * AVERROR(EAGAIN), can be used to cause the sending thread to stop or + * suspend its operation. + */ +void av_thread_message_queue_set_err_send(AVThreadMessageQueue *mq, + int err); + +/** + * Set the receiving error code. + * + * If the error code is set to non-zero, av_thread_message_queue_recv() will + * return it immediately when there are no longer available messages. + * Conventional values, such as AVERROR_EOF or AVERROR(EAGAIN), can be used + * to cause the receiving thread to stop or suspend its operation. + */ +void av_thread_message_queue_set_err_recv(AVThreadMessageQueue *mq, + int err); + +/** + * Set the optional free message callback function which will be called if an + * operation is removing messages from the queue. + */ +void av_thread_message_queue_set_free_func(AVThreadMessageQueue *mq, + void (*free_func)(void *msg)); + +/** + * Flush the message queue + * + * This function is mostly equivalent to reading and free-ing every message + * except that it will be done in a single operation (no lock/unlock between + * reads). + */ +void av_thread_message_flush(AVThreadMessageQueue *mq); + +#endif /* AVUTIL_THREADMESSAGE_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/time.h b/Src/Decoder_H264_ALL/include/libavutil/time.h new file mode 100644 index 0000000..dc169b0 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/time.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2000-2003 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_TIME_H +#define AVUTIL_TIME_H + +#include + +/** + * Get the current time in microseconds. + */ +int64_t av_gettime(void); + +/** + * Get the current time in microseconds since some unspecified starting point. + * On platforms that support it, the time comes from a monotonic clock + * This property makes this time source ideal for measuring relative time. + * The returned values may not be monotonic on platforms where a monotonic + * clock is not available. + */ +int64_t av_gettime_relative(void); + +/** + * Indicates with a boolean result if the av_gettime_relative() time source + * is monotonic. + */ +int av_gettime_relative_is_monotonic(void); + +/** + * Sleep for a period of time. Although the duration is expressed in + * microseconds, the actual delay may be rounded to the precision of the + * system timer. + * + * @param usec Number of microseconds to sleep. + * @return zero on success or (negative) error code. + */ +int av_usleep(unsigned usec); + +#endif /* AVUTIL_TIME_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/timecode.h b/Src/Decoder_H264_ALL/include/libavutil/timecode.h new file mode 100644 index 0000000..56e3975 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/timecode.h @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2006 Smartjog S.A.S, Baptiste Coudurier + * Copyright (c) 2011-2012 Smartjog S.A.S, Cl茅ment B艙sch + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Timecode helpers header + */ + +#ifndef AVUTIL_TIMECODE_H +#define AVUTIL_TIMECODE_H + +#include +#include "rational.h" + +#define AV_TIMECODE_STR_SIZE 16 + +enum AVTimecodeFlag { + AV_TIMECODE_FLAG_DROPFRAME = 1<<0, ///< timecode is drop frame + AV_TIMECODE_FLAG_24HOURSMAX = 1<<1, ///< timecode wraps after 24 hours + AV_TIMECODE_FLAG_ALLOWNEGATIVE = 1<<2, ///< negative time values are allowed +}; + +typedef struct { + int start; ///< timecode frame start (first base frame number) + uint32_t flags; ///< flags such as drop frame, +24 hours support, ... + AVRational rate; ///< frame rate in rational form + unsigned fps; ///< frame per second; must be consistent with the rate field +} AVTimecode; + +/** + * Adjust frame number for NTSC drop frame time code. + * + * @param framenum frame number to adjust + * @param fps frame per second, 30 or 60 + * @return adjusted frame number + * @warning adjustment is only valid in NTSC 29.97 and 59.94 + */ +int av_timecode_adjust_ntsc_framenum2(int framenum, int fps); + +/** + * Convert frame number to SMPTE 12M binary representation. + * + * @param tc timecode data correctly initialized + * @param framenum frame number + * @return the SMPTE binary representation + * + * @note Frame number adjustment is automatically done in case of drop timecode, + * you do NOT have to call av_timecode_adjust_ntsc_framenum2(). + * @note The frame number is relative to tc->start. + * @note Color frame (CF), binary group flags (BGF) and biphase mark polarity + * correction (PC) bits are set to zero. + */ +uint32_t av_timecode_get_smpte_from_framenum(const AVTimecode *tc, int framenum); + +/** + * Load timecode string in buf. + * + * @param buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long + * @param tc timecode data correctly initialized + * @param framenum frame number + * @return the buf parameter + * + * @note Timecode representation can be a negative timecode and have more than + * 24 hours, but will only be honored if the flags are correctly set. + * @note The frame number is relative to tc->start. + */ +char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum); + +/** + * Get the timecode string from the SMPTE timecode format. + * + * @param buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long + * @param tcsmpte the 32-bit SMPTE timecode + * @param prevent_df prevent the use of a drop flag when it is known the DF bit + * is arbitrary + * @return the buf parameter + */ +char *av_timecode_make_smpte_tc_string(char *buf, uint32_t tcsmpte, int prevent_df); + +/** + * Get the timecode string from the 25-bit timecode format (MPEG GOP format). + * + * @param buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long + * @param tc25bit the 25-bits timecode + * @return the buf parameter + */ +char *av_timecode_make_mpeg_tc_string(char *buf, uint32_t tc25bit); + +/** + * Init a timecode struct with the passed parameters. + * + * @param log_ctx a pointer to an arbitrary struct of which the first field + * is a pointer to an AVClass struct (used for av_log) + * @param tc pointer to an allocated AVTimecode + * @param rate frame rate in rational form + * @param flags miscellaneous flags such as drop frame, +24 hours, ... + * (see AVTimecodeFlag) + * @param frame_start the first frame number + * @return 0 on success, AVERROR otherwise + */ +int av_timecode_init(AVTimecode *tc, AVRational rate, int flags, int frame_start, void *log_ctx); + +/** + * Parse timecode representation (hh:mm:ss[:;.]ff). + * + * @param log_ctx a pointer to an arbitrary struct of which the first field is a + * pointer to an AVClass struct (used for av_log). + * @param tc pointer to an allocated AVTimecode + * @param rate frame rate in rational form + * @param str timecode string which will determine the frame start + * @return 0 on success, AVERROR otherwise + */ +int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx); + +/** + * Check if the timecode feature is available for the given frame rate + * + * @return 0 if supported, <0 otherwise + */ +int av_timecode_check_frame_rate(AVRational rate); + +#endif /* AVUTIL_TIMECODE_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/timestamp.h b/Src/Decoder_H264_ALL/include/libavutil/timestamp.h new file mode 100644 index 0000000..f010a7e --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/timestamp.h @@ -0,0 +1,78 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * timestamp utils, mostly useful for debugging/logging purposes + */ + +#ifndef AVUTIL_TIMESTAMP_H +#define AVUTIL_TIMESTAMP_H + +#include "common.h" + +#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64) +#error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS +#endif + +#define AV_TS_MAX_STRING_SIZE 32 + +/** + * Fill the provided buffer with a string containing a timestamp + * representation. + * + * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE + * @param ts the timestamp to represent + * @return the buffer in input + */ +static inline char *av_ts_make_string(char *buf, int64_t ts) +{ + if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); + else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64, ts); + return buf; +} + +/** + * Convenience macro, the return value should be used only directly in + * function arguments but never stand-alone. + */ +#define av_ts2str(ts) av_ts_make_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts) + +/** + * Fill the provided buffer with a string containing a timestamp time + * representation. + * + * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE + * @param ts the timestamp to represent + * @param tb the timebase of the timestamp + * @return the buffer in input + */ +static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb) +{ + if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); + else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts); + return buf; +} + +/** + * Convenience macro, the return value should be used only directly in + * function arguments but never stand-alone. + */ +#define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb) + +#endif /* AVUTIL_TIMESTAMP_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/tree.h b/Src/Decoder_H264_ALL/include/libavutil/tree.h new file mode 100644 index 0000000..9a9e11b --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/tree.h @@ -0,0 +1,138 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * A tree container. + * @author Michael Niedermayer + */ + +#ifndef AVUTIL_TREE_H +#define AVUTIL_TREE_H + +#include "attributes.h" +#include "version.h" + +/** + * @addtogroup lavu_tree AVTree + * @ingroup lavu_data + * + * Low-complexity tree container + * + * Insertion, removal, finding equal, largest which is smaller than and + * smallest which is larger than, all have O(log n) worst-case complexity. + * @{ + */ + + +struct AVTreeNode; +extern const int av_tree_node_size; + +/** + * Allocate an AVTreeNode. + */ +struct AVTreeNode *av_tree_node_alloc(void); + +/** + * Find an element. + * @param root a pointer to the root node of the tree + * @param next If next is not NULL, then next[0] will contain the previous + * element and next[1] the next element. If either does not exist, + * then the corresponding entry in next is unchanged. + * @param cmp compare function used to compare elements in the tree, + * API identical to that of Standard C's qsort + * It is guranteed that the first and only the first argument to cmp() + * will be the key parameter to av_tree_find(), thus it could if the + * user wants, be a different type (like an opaque context). + * @return An element with cmp(key, elem) == 0 or NULL if no such element + * exists in the tree. + */ +void *av_tree_find(const struct AVTreeNode *root, void *key, + int (*cmp)(const void *key, const void *b), void *next[2]); + +/** + * Insert or remove an element. + * + * If *next is NULL, then the supplied element will be removed if it exists. + * If *next is non-NULL, then the supplied element will be inserted, unless + * it already exists in the tree. + * + * @param rootp A pointer to a pointer to the root node of the tree; note that + * the root node can change during insertions, this is required + * to keep the tree balanced. + * @param key pointer to the element key to insert in the tree + * @param next Used to allocate and free AVTreeNodes. For insertion the user + * must set it to an allocated and zeroed object of at least + * av_tree_node_size bytes size. av_tree_insert() will set it to + * NULL if it has been consumed. + * For deleting elements *next is set to NULL by the user and + * av_tree_insert() will set it to the AVTreeNode which was + * used for the removed element. + * This allows the use of flat arrays, which have + * lower overhead compared to many malloced elements. + * You might want to define a function like: + * @code + * void *tree_insert(struct AVTreeNode **rootp, void *key, + * int (*cmp)(void *key, const void *b), + * AVTreeNode **next) + * { + * if (!*next) + * *next = av_mallocz(av_tree_node_size); + * return av_tree_insert(rootp, key, cmp, next); + * } + * void *tree_remove(struct AVTreeNode **rootp, void *key, + * int (*cmp)(void *key, const void *b, AVTreeNode **next)) + * { + * av_freep(next); + * return av_tree_insert(rootp, key, cmp, next); + * } + * @endcode + * @param cmp compare function used to compare elements in the tree, API identical + * to that of Standard C's qsort + * @return If no insertion happened, the found element; if an insertion or + * removal happened, then either key or NULL will be returned. + * Which one it is depends on the tree state and the implementation. You + * should make no assumptions that it's one or the other in the code. + */ +void *av_tree_insert(struct AVTreeNode **rootp, void *key, + int (*cmp)(const void *key, const void *b), + struct AVTreeNode **next); + +void av_tree_destroy(struct AVTreeNode *t); + +/** + * Apply enu(opaque, &elem) to all the elements in the tree in a given range. + * + * @param cmp a comparison function that returns < 0 for an element below the + * range, > 0 for an element above the range and == 0 for an + * element inside the range + * + * @note The cmp function should use the same ordering used to construct the + * tree. + */ +void av_tree_enumerate(struct AVTreeNode *t, void *opaque, + int (*cmp)(void *opaque, void *elem), + int (*enu)(void *opaque, void *elem)); + +/** + * @} + */ + +#endif /* AVUTIL_TREE_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/twofish.h b/Src/Decoder_H264_ALL/include/libavutil/twofish.h new file mode 100644 index 0000000..813cfec --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/twofish.h @@ -0,0 +1,70 @@ +/* + * An implementation of the TwoFish algorithm + * Copyright (c) 2015 Supraja Meedinti + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_TWOFISH_H +#define AVUTIL_TWOFISH_H + +#include + + +/** + * @file + * @brief Public header for libavutil TWOFISH algorithm + * @defgroup lavu_twofish TWOFISH + * @ingroup lavu_crypto + * @{ + */ + +extern const int av_twofish_size; + +struct AVTWOFISH; + +/** + * Allocate an AVTWOFISH context + * To free the struct: av_free(ptr) + */ +struct AVTWOFISH *av_twofish_alloc(void); + +/** + * Initialize an AVTWOFISH context. + * + * @param ctx an AVTWOFISH context + * @param key a key of size ranging from 1 to 32 bytes used for encryption/decryption + * @param key_bits number of keybits: 128, 192, 256 If less than the required, padded with zeroes to nearest valid value; return value is 0 if key_bits is 128/192/256, -1 if less than 0, 1 otherwise + */ +int av_twofish_init(struct AVTWOFISH *ctx, const uint8_t *key, int key_bits); + +/** + * Encrypt or decrypt a buffer using a previously initialized context + * + * @param ctx an AVTWOFISH context + * @param dst destination array, can be equal to src + * @param src source array, can be equal to dst + * @param count number of 16 byte blocks + * @paran iv initialization vector for CBC mode, NULL for ECB mode + * @param decrypt 0 for encryption, 1 for decryption + */ +void av_twofish_crypt(struct AVTWOFISH *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt); + +/** + * @} + */ +#endif /* AVUTIL_TWOFISH_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/version.h b/Src/Decoder_H264_ALL/include/libavutil/version.h new file mode 100644 index 0000000..07618fc --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/version.h @@ -0,0 +1,128 @@ +/* + * copyright (c) 2003 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_VERSION_H +#define AVUTIL_VERSION_H + +#include "macros.h" + +/** + * @addtogroup version_utils + * + * Useful to check and match library version in order to maintain + * backward compatibility. + * + * @{ + */ + +#define AV_VERSION_INT(a, b, c) ((a)<<16 | (b)<<8 | (c)) +#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c +#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) + +/** + * Extract version components from the full ::AV_VERSION_INT int as returned + * by functions like ::avformat_version() and ::avcodec_version() + */ +#define AV_VERSION_MAJOR(a) ((a) >> 16) +#define AV_VERSION_MINOR(a) (((a) & 0x00FF00) >> 8) +#define AV_VERSION_MICRO(a) ((a) & 0xFF) + +/** + * @} + */ + +/** + * @file + * @ingroup lavu + * Libavutil version macros + */ + +/** + * @defgroup lavu_ver Version and Build diagnostics + * + * Macros and function useful to check at compiletime and at runtime + * which version of libavutil is in use. + * + * @{ + */ + +#define LIBAVUTIL_VERSION_MAJOR 55 +#define LIBAVUTIL_VERSION_MINOR 28 +#define LIBAVUTIL_VERSION_MICRO 100 + +#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ + LIBAVUTIL_VERSION_MINOR, \ + LIBAVUTIL_VERSION_MICRO) +#define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \ + LIBAVUTIL_VERSION_MINOR, \ + LIBAVUTIL_VERSION_MICRO) +#define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT + +#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION) + +/** + * @} + * + * @defgroup depr_guards Deprecation guards + * FF_API_* defines may be placed below to indicate public API that will be + * dropped at a future version bump. The defines themselves are not part of + * the public API and may change, break or disappear at any time. + * + * @note, when bumping the major version it is recommended to manually + * disable each FF_API_* in its own commit instead of disabling them all + * at once through the bump. This improves the git bisect-ability of the change. + * + * @{ + */ + +#ifndef FF_API_VDPAU +#define FF_API_VDPAU (LIBAVUTIL_VERSION_MAJOR < 56) +#endif +#ifndef FF_API_XVMC +#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 56) +#endif +#ifndef FF_API_OPT_TYPE_METADATA +#define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 56) +#endif +#ifndef FF_API_DLOG +#define FF_API_DLOG (LIBAVUTIL_VERSION_MAJOR < 56) +#endif +#ifndef FF_API_VAAPI +#define FF_API_VAAPI (LIBAVUTIL_VERSION_MAJOR < 56) +#endif +#ifndef FF_API_FRAME_QP +#define FF_API_FRAME_QP (LIBAVUTIL_VERSION_MAJOR < 56) +#endif +#ifndef FF_API_PLUS1_MINUS1 +#define FF_API_PLUS1_MINUS1 (LIBAVUTIL_VERSION_MAJOR < 56) +#endif +#ifndef FF_API_ERROR_FRAME +#define FF_API_ERROR_FRAME (LIBAVUTIL_VERSION_MAJOR < 56) +#endif +#ifndef FF_API_CRC_BIG_TABLE +#define FF_API_CRC_BIG_TABLE (LIBAVUTIL_VERSION_MAJOR < 56) +#endif + + +/** + * @} + */ + +#endif /* AVUTIL_VERSION_H */ diff --git a/Src/Decoder_H264_ALL/include/libavutil/xtea.h b/Src/Decoder_H264_ALL/include/libavutil/xtea.h new file mode 100644 index 0000000..735427c --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libavutil/xtea.h @@ -0,0 +1,94 @@ +/* + * A 32-bit implementation of the XTEA algorithm + * Copyright (c) 2012 Samuel Pitoiset + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_XTEA_H +#define AVUTIL_XTEA_H + +#include + +/** + * @file + * @brief Public header for libavutil XTEA algorithm + * @defgroup lavu_xtea XTEA + * @ingroup lavu_crypto + * @{ + */ + +typedef struct AVXTEA { + uint32_t key[16]; +} AVXTEA; + +/** + * Allocate an AVXTEA context. + */ +AVXTEA *av_xtea_alloc(void); + +/** + * Initialize an AVXTEA context. + * + * @param ctx an AVXTEA context + * @param key a key of 16 bytes used for encryption/decryption, + * interpreted as big endian 32 bit numbers + */ +void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]); + +/** + * Initialize an AVXTEA context. + * + * @param ctx an AVXTEA context + * @param key a key of 16 bytes used for encryption/decryption, + * interpreted as little endian 32 bit numbers + */ +void av_xtea_le_init(struct AVXTEA *ctx, const uint8_t key[16]); + +/** + * Encrypt or decrypt a buffer using a previously initialized context, + * in big endian format. + * + * @param ctx an AVXTEA context + * @param dst destination array, can be equal to src + * @param src source array, can be equal to dst + * @param count number of 8 byte blocks + * @param iv initialization vector for CBC mode, if NULL then ECB will be used + * @param decrypt 0 for encryption, 1 for decryption + */ +void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, + int count, uint8_t *iv, int decrypt); + +/** + * Encrypt or decrypt a buffer using a previously initialized context, + * in little endian format. + * + * @param ctx an AVXTEA context + * @param dst destination array, can be equal to src + * @param src source array, can be equal to dst + * @param count number of 8 byte blocks + * @param iv initialization vector for CBC mode, if NULL then ECB will be used + * @param decrypt 0 for encryption, 1 for decryption + */ +void av_xtea_le_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, + int count, uint8_t *iv, int decrypt); + +/** + * @} + */ + +#endif /* AVUTIL_XTEA_H */ diff --git a/Src/Decoder_H264_ALL/include/libpostproc/postprocess.h b/Src/Decoder_H264_ALL/include/libpostproc/postprocess.h new file mode 100644 index 0000000..2b55ed6 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libpostproc/postprocess.h @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at) + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef POSTPROC_POSTPROCESS_H +#define POSTPROC_POSTPROCESS_H + +/** + * @file + * @ingroup lpp + * external API header + */ + +/** + * @defgroup lpp Libpostproc + * @{ + */ + +#include "libpostproc/version.h" + +/** + * Return the LIBPOSTPROC_VERSION_INT constant. + */ +unsigned postproc_version(void); + +/** + * Return the libpostproc build-time configuration. + */ +const char *postproc_configuration(void); + +/** + * Return the libpostproc license. + */ +const char *postproc_license(void); + +#define PP_QUALITY_MAX 6 + +#if FF_API_QP_TYPE +#define QP_STORE_T int8_t //deprecated +#endif + +#include + +typedef void pp_context; +typedef void pp_mode; + +#if LIBPOSTPROC_VERSION_INT < (52<<16) +typedef pp_context pp_context_t; +typedef pp_mode pp_mode_t; +extern const char *const pp_help; ///< a simple help text +#else +extern const char pp_help[]; ///< a simple help text +#endif + +void pp_postprocess(const uint8_t * src[3], const int srcStride[3], + uint8_t * dst[3], const int dstStride[3], + int horizontalSize, int verticalSize, + const int8_t *QP_store, int QP_stride, + pp_mode *mode, pp_context *ppContext, int pict_type); + + +/** + * Return a pp_mode or NULL if an error occurred. + * + * @param name the string after "-pp" on the command line + * @param quality a number from 0 to PP_QUALITY_MAX + */ +pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality); +void pp_free_mode(pp_mode *mode); + +pp_context *pp_get_context(int width, int height, int flags); +void pp_free_context(pp_context *ppContext); + +#define PP_CPU_CAPS_MMX 0x80000000 +#define PP_CPU_CAPS_MMX2 0x20000000 +#define PP_CPU_CAPS_3DNOW 0x40000000 +#define PP_CPU_CAPS_ALTIVEC 0x10000000 +#define PP_CPU_CAPS_AUTO 0x00080000 + +#define PP_FORMAT 0x00000008 +#define PP_FORMAT_420 (0x00000011|PP_FORMAT) +#define PP_FORMAT_422 (0x00000001|PP_FORMAT) +#define PP_FORMAT_411 (0x00000002|PP_FORMAT) +#define PP_FORMAT_444 (0x00000000|PP_FORMAT) +#define PP_FORMAT_440 (0x00000010|PP_FORMAT) + +#define PP_PICT_TYPE_QP2 0x00000010 ///< MPEG2 style QScale + +/** + * @} + */ + +#endif /* POSTPROC_POSTPROCESS_H */ diff --git a/Src/Decoder_H264_ALL/include/libpostproc/version.h b/Src/Decoder_H264_ALL/include/libpostproc/version.h new file mode 100644 index 0000000..8f62582 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libpostproc/version.h @@ -0,0 +1,49 @@ +/* + * Version macros. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef POSTPROC_VERSION_H +#define POSTPROC_VERSION_H + +/** + * @file + * Libpostproc version macros + */ + +#include "libavutil/avutil.h" + +#define LIBPOSTPROC_VERSION_MAJOR 54 +#define LIBPOSTPROC_VERSION_MINOR 0 +#define LIBPOSTPROC_VERSION_MICRO 100 + +#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \ + LIBPOSTPROC_VERSION_MINOR, \ + LIBPOSTPROC_VERSION_MICRO) +#define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \ + LIBPOSTPROC_VERSION_MINOR, \ + LIBPOSTPROC_VERSION_MICRO) +#define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT + +#define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION) + +#ifndef FF_API_QP_TYPE +#define FF_API_QP_TYPE (LIBPOSTPROC_VERSION_MAJOR < 55) +#endif + +#endif /* POSTPROC_VERSION_H */ diff --git a/Src/Decoder_H264_ALL/include/libswresample/swresample.h b/Src/Decoder_H264_ALL/include/libswresample/swresample.h new file mode 100644 index 0000000..10eaebc --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libswresample/swresample.h @@ -0,0 +1,553 @@ +/* + * Copyright (C) 2011-2013 Michael Niedermayer (michaelni@gmx.at) + * + * This file is part of libswresample + * + * libswresample is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * libswresample is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with libswresample; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SWRESAMPLE_SWRESAMPLE_H +#define SWRESAMPLE_SWRESAMPLE_H + +/** + * @file + * @ingroup lswr + * libswresample public header + */ + +/** + * @defgroup lswr Libswresample + * @{ + * + * Libswresample (lswr) is a library that handles audio resampling, sample + * format conversion and mixing. + * + * Interaction with lswr is done through SwrContext, which is + * allocated with swr_alloc() or swr_alloc_set_opts(). It is opaque, so all parameters + * must be set with the @ref avoptions API. + * + * The first thing you will need to do in order to use lswr is to allocate + * SwrContext. This can be done with swr_alloc() or swr_alloc_set_opts(). If you + * are using the former, you must set options through the @ref avoptions API. + * The latter function provides the same feature, but it allows you to set some + * common options in the same statement. + * + * For example the following code will setup conversion from planar float sample + * format to interleaved signed 16-bit integer, downsampling from 48kHz to + * 44.1kHz and downmixing from 5.1 channels to stereo (using the default mixing + * matrix). This is using the swr_alloc() function. + * @code + * SwrContext *swr = swr_alloc(); + * av_opt_set_channel_layout(swr, "in_channel_layout", AV_CH_LAYOUT_5POINT1, 0); + * av_opt_set_channel_layout(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO, 0); + * av_opt_set_int(swr, "in_sample_rate", 48000, 0); + * av_opt_set_int(swr, "out_sample_rate", 44100, 0); + * av_opt_set_sample_fmt(swr, "in_sample_fmt", AV_SAMPLE_FMT_FLTP, 0); + * av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0); + * @endcode + * + * The same job can be done using swr_alloc_set_opts() as well: + * @code + * SwrContext *swr = swr_alloc_set_opts(NULL, // we're allocating a new context + * AV_CH_LAYOUT_STEREO, // out_ch_layout + * AV_SAMPLE_FMT_S16, // out_sample_fmt + * 44100, // out_sample_rate + * AV_CH_LAYOUT_5POINT1, // in_ch_layout + * AV_SAMPLE_FMT_FLTP, // in_sample_fmt + * 48000, // in_sample_rate + * 0, // log_offset + * NULL); // log_ctx + * @endcode + * + * Once all values have been set, it must be initialized with swr_init(). If + * you need to change the conversion parameters, you can change the parameters + * using @ref AVOptions, as described above in the first example; or by using + * swr_alloc_set_opts(), but with the first argument the allocated context. + * You must then call swr_init() again. + * + * The conversion itself is done by repeatedly calling swr_convert(). + * Note that the samples may get buffered in swr if you provide insufficient + * output space or if sample rate conversion is done, which requires "future" + * samples. Samples that do not require future input can be retrieved at any + * time by using swr_convert() (in_count can be set to 0). + * At the end of conversion the resampling buffer can be flushed by calling + * swr_convert() with NULL in and 0 in_count. + * + * The samples used in the conversion process can be managed with the libavutil + * @ref lavu_sampmanip "samples manipulation" API, including av_samples_alloc() + * function used in the following example. + * + * The delay between input and output, can at any time be found by using + * swr_get_delay(). + * + * The following code demonstrates the conversion loop assuming the parameters + * from above and caller-defined functions get_input() and handle_output(): + * @code + * uint8_t **input; + * int in_samples; + * + * while (get_input(&input, &in_samples)) { + * uint8_t *output; + * int out_samples = av_rescale_rnd(swr_get_delay(swr, 48000) + + * in_samples, 44100, 48000, AV_ROUND_UP); + * av_samples_alloc(&output, NULL, 2, out_samples, + * AV_SAMPLE_FMT_S16, 0); + * out_samples = swr_convert(swr, &output, out_samples, + * input, in_samples); + * handle_output(output, out_samples); + * av_freep(&output); + * } + * @endcode + * + * When the conversion is finished, the conversion + * context and everything associated with it must be freed with swr_free(). + * A swr_close() function is also available, but it exists mainly for + * compatibility with libavresample, and is not required to be called. + * + * There will be no memory leak if the data is not completely flushed before + * swr_free(). + */ + +#include +#include "libavutil/frame.h" +#include "libavutil/samplefmt.h" + +#include "libswresample/version.h" + +#if LIBSWRESAMPLE_VERSION_MAJOR < 1 +#define SWR_CH_MAX 32 ///< Maximum number of channels +#endif + +/** + * @name Option constants + * These constants are used for the @ref avoptions interface for lswr. + * @{ + * + */ + +#define SWR_FLAG_RESAMPLE 1 ///< Force resampling even if equal sample rate +//TODO use int resample ? +//long term TODO can we enable this dynamically? + +/** Dithering algorithms */ +enum SwrDitherType { + SWR_DITHER_NONE = 0, + SWR_DITHER_RECTANGULAR, + SWR_DITHER_TRIANGULAR, + SWR_DITHER_TRIANGULAR_HIGHPASS, + + SWR_DITHER_NS = 64, ///< not part of API/ABI + SWR_DITHER_NS_LIPSHITZ, + SWR_DITHER_NS_F_WEIGHTED, + SWR_DITHER_NS_MODIFIED_E_WEIGHTED, + SWR_DITHER_NS_IMPROVED_E_WEIGHTED, + SWR_DITHER_NS_SHIBATA, + SWR_DITHER_NS_LOW_SHIBATA, + SWR_DITHER_NS_HIGH_SHIBATA, + SWR_DITHER_NB, ///< not part of API/ABI +}; + +/** Resampling Engines */ +enum SwrEngine { + SWR_ENGINE_SWR, /**< SW Resampler */ + SWR_ENGINE_SOXR, /**< SoX Resampler */ + SWR_ENGINE_NB, ///< not part of API/ABI +}; + +/** Resampling Filter Types */ +enum SwrFilterType { + SWR_FILTER_TYPE_CUBIC, /**< Cubic */ + SWR_FILTER_TYPE_BLACKMAN_NUTTALL, /**< Blackman Nuttall windowed sinc */ + SWR_FILTER_TYPE_KAISER, /**< Kaiser windowed sinc */ +}; + +/** + * @} + */ + +/** + * The libswresample context. Unlike libavcodec and libavformat, this structure + * is opaque. This means that if you would like to set options, you must use + * the @ref avoptions API and cannot directly set values to members of the + * structure. + */ +typedef struct SwrContext SwrContext; + +/** + * Get the AVClass for SwrContext. It can be used in combination with + * AV_OPT_SEARCH_FAKE_OBJ for examining options. + * + * @see av_opt_find(). + * @return the AVClass of SwrContext + */ +const AVClass *swr_get_class(void); + +/** + * @name SwrContext constructor functions + * @{ + */ + +/** + * Allocate SwrContext. + * + * If you use this function you will need to set the parameters (manually or + * with swr_alloc_set_opts()) before calling swr_init(). + * + * @see swr_alloc_set_opts(), swr_init(), swr_free() + * @return NULL on error, allocated context otherwise + */ +struct SwrContext *swr_alloc(void); + +/** + * Initialize context after user parameters have been set. + * @note The context must be configured using the AVOption API. + * + * @see av_opt_set_int() + * @see av_opt_set_dict() + * + * @param[in,out] s Swr context to initialize + * @return AVERROR error code in case of failure. + */ +int swr_init(struct SwrContext *s); + +/** + * Check whether an swr context has been initialized or not. + * + * @param[in] s Swr context to check + * @see swr_init() + * @return positive if it has been initialized, 0 if not initialized + */ +int swr_is_initialized(struct SwrContext *s); + +/** + * Allocate SwrContext if needed and set/reset common parameters. + * + * This function does not require s to be allocated with swr_alloc(). On the + * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters + * on the allocated context. + * + * @param s existing Swr context if available, or NULL if not + * @param out_ch_layout output channel layout (AV_CH_LAYOUT_*) + * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_*). + * @param out_sample_rate output sample rate (frequency in Hz) + * @param in_ch_layout input channel layout (AV_CH_LAYOUT_*) + * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_*). + * @param in_sample_rate input sample rate (frequency in Hz) + * @param log_offset logging level offset + * @param log_ctx parent logging context, can be NULL + * + * @see swr_init(), swr_free() + * @return NULL on error, allocated context otherwise + */ +struct SwrContext *swr_alloc_set_opts(struct SwrContext *s, + int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, + int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, + int log_offset, void *log_ctx); + +/** + * @} + * + * @name SwrContext destructor functions + * @{ + */ + +/** + * Free the given SwrContext and set the pointer to NULL. + * + * @param[in] s a pointer to a pointer to Swr context + */ +void swr_free(struct SwrContext **s); + +/** + * Closes the context so that swr_is_initialized() returns 0. + * + * The context can be brought back to life by running swr_init(), + * swr_init() can also be used without swr_close(). + * This function is mainly provided for simplifying the usecase + * where one tries to support libavresample and libswresample. + * + * @param[in,out] s Swr context to be closed + */ +void swr_close(struct SwrContext *s); + +/** + * @} + * + * @name Core conversion functions + * @{ + */ + +/** Convert audio. + * + * in and in_count can be set to 0 to flush the last few samples out at the + * end. + * + * If more input is provided than output space, then the input will be buffered. + * You can avoid this buffering by using swr_get_out_samples() to retrieve an + * upper bound on the required number of output samples for the given number of + * input samples. Conversion will run directly without copying whenever possible. + * + * @param s allocated Swr context, with parameters set + * @param out output buffers, only the first one need be set in case of packed audio + * @param out_count amount of space available for output in samples per channel + * @param in input buffers, only the first one need to be set in case of packed audio + * @param in_count number of input samples available in one channel + * + * @return number of samples output per channel, negative value on error + */ +int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, + const uint8_t **in , int in_count); + +/** + * Convert the next timestamp from input to output + * timestamps are in 1/(in_sample_rate * out_sample_rate) units. + * + * @note There are 2 slightly differently behaving modes. + * @li When automatic timestamp compensation is not used, (min_compensation >= FLT_MAX) + * in this case timestamps will be passed through with delays compensated + * @li When automatic timestamp compensation is used, (min_compensation < FLT_MAX) + * in this case the output timestamps will match output sample numbers. + * See ffmpeg-resampler(1) for the two modes of compensation. + * + * @param s[in] initialized Swr context + * @param pts[in] timestamp for the next input sample, INT64_MIN if unknown + * @see swr_set_compensation(), swr_drop_output(), and swr_inject_silence() are + * function used internally for timestamp compensation. + * @return the output timestamp for the next output sample + */ +int64_t swr_next_pts(struct SwrContext *s, int64_t pts); + +/** + * @} + * + * @name Low-level option setting functions + * These functons provide a means to set low-level options that is not possible + * with the AVOption API. + * @{ + */ + +/** + * Activate resampling compensation ("soft" compensation). This function is + * internally called when needed in swr_next_pts(). + * + * @param[in,out] s allocated Swr context. If it is not initialized, + * or SWR_FLAG_RESAMPLE is not set, swr_init() is + * called with the flag set. + * @param[in] sample_delta delta in PTS per sample + * @param[in] compensation_distance number of samples to compensate for + * @return >= 0 on success, AVERROR error codes if: + * @li @c s is NULL, + * @li @c compensation_distance is less than 0, + * @li @c compensation_distance is 0 but sample_delta is not, + * @li compensation unsupported by resampler, or + * @li swr_init() fails when called. + */ +int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance); + +/** + * Set a customized input channel mapping. + * + * @param[in,out] s allocated Swr context, not yet initialized + * @param[in] channel_map customized input channel mapping (array of channel + * indexes, -1 for a muted channel) + * @return >= 0 on success, or AVERROR error code in case of failure. + */ +int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map); + +/** + * Set a customized remix matrix. + * + * @param s allocated Swr context, not yet initialized + * @param matrix remix coefficients; matrix[i + stride * o] is + * the weight of input channel i in output channel o + * @param stride offset between lines of the matrix + * @return >= 0 on success, or AVERROR error code in case of failure. + */ +int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride); + +/** + * @} + * + * @name Sample handling functions + * @{ + */ + +/** + * Drops the specified number of output samples. + * + * This function, along with swr_inject_silence(), is called by swr_next_pts() + * if needed for "hard" compensation. + * + * @param s allocated Swr context + * @param count number of samples to be dropped + * + * @return >= 0 on success, or a negative AVERROR code on failure + */ +int swr_drop_output(struct SwrContext *s, int count); + +/** + * Injects the specified number of silence samples. + * + * This function, along with swr_drop_output(), is called by swr_next_pts() + * if needed for "hard" compensation. + * + * @param s allocated Swr context + * @param count number of samples to be dropped + * + * @return >= 0 on success, or a negative AVERROR code on failure + */ +int swr_inject_silence(struct SwrContext *s, int count); + +/** + * Gets the delay the next input sample will experience relative to the next output sample. + * + * Swresample can buffer data if more input has been provided than available + * output space, also converting between sample rates needs a delay. + * This function returns the sum of all such delays. + * The exact delay is not necessarily an integer value in either input or + * output sample rate. Especially when downsampling by a large value, the + * output sample rate may be a poor choice to represent the delay, similarly + * for upsampling and the input sample rate. + * + * @param s swr context + * @param base timebase in which the returned delay will be: + * @li if it's set to 1 the returned delay is in seconds + * @li if it's set to 1000 the returned delay is in milliseconds + * @li if it's set to the input sample rate then the returned + * delay is in input samples + * @li if it's set to the output sample rate then the returned + * delay is in output samples + * @li if it's the least common multiple of in_sample_rate and + * out_sample_rate then an exact rounding-free delay will be + * returned + * @returns the delay in 1 / @c base units. + */ +int64_t swr_get_delay(struct SwrContext *s, int64_t base); + +/** + * Find an upper bound on the number of samples that the next swr_convert + * call will output, if called with in_samples of input samples. This + * depends on the internal state, and anything changing the internal state + * (like further swr_convert() calls) will may change the number of samples + * swr_get_out_samples() returns for the same number of input samples. + * + * @param in_samples number of input samples. + * @note any call to swr_inject_silence(), swr_convert(), swr_next_pts() + * or swr_set_compensation() invalidates this limit + * @note it is recommended to pass the correct available buffer size + * to all functions like swr_convert() even if swr_get_out_samples() + * indicates that less would be used. + * @returns an upper bound on the number of samples that the next swr_convert + * will output or a negative value to indicate an error + */ +int swr_get_out_samples(struct SwrContext *s, int in_samples); + +/** + * @} + * + * @name Configuration accessors + * @{ + */ + +/** + * Return the @ref LIBSWRESAMPLE_VERSION_INT constant. + * + * This is useful to check if the build-time libswresample has the same version + * as the run-time one. + * + * @returns the unsigned int-typed version + */ +unsigned swresample_version(void); + +/** + * Return the swr build-time configuration. + * + * @returns the build-time @c ./configure flags + */ +const char *swresample_configuration(void); + +/** + * Return the swr license. + * + * @returns the license of libswresample, determined at build-time + */ +const char *swresample_license(void); + +/** + * @} + * + * @name AVFrame based API + * @{ + */ + +/** + * Convert the samples in the input AVFrame and write them to the output AVFrame. + * + * Input and output AVFrames must have channel_layout, sample_rate and format set. + * + * If the output AVFrame does not have the data pointers allocated the nb_samples + * field will be set using av_frame_get_buffer() + * is called to allocate the frame. + * + * The output AVFrame can be NULL or have fewer allocated samples than required. + * In this case, any remaining samples not written to the output will be added + * to an internal FIFO buffer, to be returned at the next call to this function + * or to swr_convert(). + * + * If converting sample rate, there may be data remaining in the internal + * resampling delay buffer. swr_get_delay() tells the number of + * remaining samples. To get this data as output, call this function or + * swr_convert() with NULL input. + * + * If the SwrContext configuration does not match the output and + * input AVFrame settings the conversion does not take place and depending on + * which AVFrame is not matching AVERROR_OUTPUT_CHANGED, AVERROR_INPUT_CHANGED + * or the result of a bitwise-OR of them is returned. + * + * @see swr_delay() + * @see swr_convert() + * @see swr_get_delay() + * + * @param swr audio resample context + * @param output output AVFrame + * @param input input AVFrame + * @return 0 on success, AVERROR on failure or nonmatching + * configuration. + */ +int swr_convert_frame(SwrContext *swr, + AVFrame *output, const AVFrame *input); + +/** + * Configure or reconfigure the SwrContext using the information + * provided by the AVFrames. + * + * The original resampling context is reset even on failure. + * The function calls swr_close() internally if the context is open. + * + * @see swr_close(); + * + * @param swr audio resample context + * @param output output AVFrame + * @param input input AVFrame + * @return 0 on success, AVERROR on failure. + */ +int swr_config_frame(SwrContext *swr, const AVFrame *out, const AVFrame *in); + +/** + * @} + * @} + */ + +#endif /* SWRESAMPLE_SWRESAMPLE_H */ diff --git a/Src/Decoder_H264_ALL/include/libswresample/version.h b/Src/Decoder_H264_ALL/include/libswresample/version.h new file mode 100644 index 0000000..b8e32c0 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libswresample/version.h @@ -0,0 +1,45 @@ +/* + * Version macros. + * + * This file is part of libswresample + * + * libswresample is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * libswresample is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with libswresample; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SWRESAMPLE_VERSION_H +#define SWRESAMPLE_VERSION_H + +/** + * @file + * Libswresample version macros + */ + +#include "libavutil/avutil.h" + +#define LIBSWRESAMPLE_VERSION_MAJOR 2 +#define LIBSWRESAMPLE_VERSION_MINOR 1 +#define LIBSWRESAMPLE_VERSION_MICRO 100 + +#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ + LIBSWRESAMPLE_VERSION_MINOR, \ + LIBSWRESAMPLE_VERSION_MICRO) +#define LIBSWRESAMPLE_VERSION AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \ + LIBSWRESAMPLE_VERSION_MINOR, \ + LIBSWRESAMPLE_VERSION_MICRO) +#define LIBSWRESAMPLE_BUILD LIBSWRESAMPLE_VERSION_INT + +#define LIBSWRESAMPLE_IDENT "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION) + +#endif /* SWRESAMPLE_VERSION_H */ diff --git a/Src/Decoder_H264_ALL/include/libswscale/swscale.h b/Src/Decoder_H264_ALL/include/libswscale/swscale.h new file mode 100644 index 0000000..efcbef3 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libswscale/swscale.h @@ -0,0 +1,334 @@ +/* + * Copyright (C) 2001-2011 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SWSCALE_SWSCALE_H +#define SWSCALE_SWSCALE_H + +/** + * @file + * @ingroup libsws + * external API header + */ + +#include + +#include "libavutil/avutil.h" +#include "libavutil/log.h" +#include "libavutil/pixfmt.h" +#include "version.h" + +/** + * @defgroup libsws Color conversion and scaling + * @{ + * + * Return the LIBSWSCALE_VERSION_INT constant. + */ +unsigned swscale_version(void); + +/** + * Return the libswscale build-time configuration. + */ +const char *swscale_configuration(void); + +/** + * Return the libswscale license. + */ +const char *swscale_license(void); + +/* values for the flags, the stuff on the command line is different */ +#define SWS_FAST_BILINEAR 1 +#define SWS_BILINEAR 2 +#define SWS_BICUBIC 4 +#define SWS_X 8 +#define SWS_POINT 0x10 +#define SWS_AREA 0x20 +#define SWS_BICUBLIN 0x40 +#define SWS_GAUSS 0x80 +#define SWS_SINC 0x100 +#define SWS_LANCZOS 0x200 +#define SWS_SPLINE 0x400 + +#define SWS_SRC_V_CHR_DROP_MASK 0x30000 +#define SWS_SRC_V_CHR_DROP_SHIFT 16 + +#define SWS_PARAM_DEFAULT 123456 + +#define SWS_PRINT_INFO 0x1000 + +//the following 3 flags are not completely implemented +//internal chrominance subsampling info +#define SWS_FULL_CHR_H_INT 0x2000 +//input subsampling info +#define SWS_FULL_CHR_H_INP 0x4000 +#define SWS_DIRECT_BGR 0x8000 +#define SWS_ACCURATE_RND 0x40000 +#define SWS_BITEXACT 0x80000 +#define SWS_ERROR_DIFFUSION 0x800000 + +#define SWS_MAX_REDUCE_CUTOFF 0.002 + +#define SWS_CS_ITU709 1 +#define SWS_CS_FCC 4 +#define SWS_CS_ITU601 5 +#define SWS_CS_ITU624 5 +#define SWS_CS_SMPTE170M 5 +#define SWS_CS_SMPTE240M 7 +#define SWS_CS_DEFAULT 5 +#define SWS_CS_BT2020 9 + +/** + * Return a pointer to yuv<->rgb coefficients for the given colorspace + * suitable for sws_setColorspaceDetails(). + * + * @param colorspace One of the SWS_CS_* macros. If invalid, + * SWS_CS_DEFAULT is used. + */ +const int *sws_getCoefficients(int colorspace); + +// when used for filters they must have an odd number of elements +// coeffs cannot be shared between vectors +typedef struct SwsVector { + double *coeff; ///< pointer to the list of coefficients + int length; ///< number of coefficients in the vector +} SwsVector; + +// vectors can be shared +typedef struct SwsFilter { + SwsVector *lumH; + SwsVector *lumV; + SwsVector *chrH; + SwsVector *chrV; +} SwsFilter; + +struct SwsContext; + +/** + * Return a positive value if pix_fmt is a supported input format, 0 + * otherwise. + */ +int sws_isSupportedInput(enum AVPixelFormat pix_fmt); + +/** + * Return a positive value if pix_fmt is a supported output format, 0 + * otherwise. + */ +int sws_isSupportedOutput(enum AVPixelFormat pix_fmt); + +/** + * @param[in] pix_fmt the pixel format + * @return a positive value if an endianness conversion for pix_fmt is + * supported, 0 otherwise. + */ +int sws_isSupportedEndiannessConversion(enum AVPixelFormat pix_fmt); + +/** + * Allocate an empty SwsContext. This must be filled and passed to + * sws_init_context(). For filling see AVOptions, options.c and + * sws_setColorspaceDetails(). + */ +struct SwsContext *sws_alloc_context(void); + +/** + * Initialize the swscaler context sws_context. + * + * @return zero or positive value on success, a negative value on + * error + */ +av_warn_unused_result +int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter); + +/** + * Free the swscaler context swsContext. + * If swsContext is NULL, then does nothing. + */ +void sws_freeContext(struct SwsContext *swsContext); + +/** + * Allocate and return an SwsContext. You need it to perform + * scaling/conversion operations using sws_scale(). + * + * @param srcW the width of the source image + * @param srcH the height of the source image + * @param srcFormat the source image format + * @param dstW the width of the destination image + * @param dstH the height of the destination image + * @param dstFormat the destination image format + * @param flags specify which algorithm and options to use for rescaling + * @param param extra parameters to tune the used scaler + * For SWS_BICUBIC param[0] and [1] tune the shape of the basis + * function, param[0] tunes f(1) and param[1] f麓(1) + * For SWS_GAUSS param[0] tunes the exponent and thus cutoff + * frequency + * For SWS_LANCZOS param[0] tunes the width of the window function + * @return a pointer to an allocated context, or NULL in case of error + * @note this function is to be removed after a saner alternative is + * written + */ +struct SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat, + int dstW, int dstH, enum AVPixelFormat dstFormat, + int flags, SwsFilter *srcFilter, + SwsFilter *dstFilter, const double *param); + +/** + * Scale the image slice in srcSlice and put the resulting scaled + * slice in the image in dst. A slice is a sequence of consecutive + * rows in an image. + * + * Slices have to be provided in sequential order, either in + * top-bottom or bottom-top order. If slices are provided in + * non-sequential order the behavior of the function is undefined. + * + * @param c the scaling context previously created with + * sws_getContext() + * @param srcSlice the array containing the pointers to the planes of + * the source slice + * @param srcStride the array containing the strides for each plane of + * the source image + * @param srcSliceY the position in the source image of the slice to + * process, that is the number (counted starting from + * zero) in the image of the first row of the slice + * @param srcSliceH the height of the source slice, that is the number + * of rows in the slice + * @param dst the array containing the pointers to the planes of + * the destination image + * @param dstStride the array containing the strides for each plane of + * the destination image + * @return the height of the output slice + */ +int sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[], + const int srcStride[], int srcSliceY, int srcSliceH, + uint8_t *const dst[], const int dstStride[]); + +/** + * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) + * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) + * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] + * @param inv_table the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] + * @param brightness 16.16 fixed point brightness correction + * @param contrast 16.16 fixed point contrast correction + * @param saturation 16.16 fixed point saturation correction + * @return -1 if not supported + */ +int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], + int srcRange, const int table[4], int dstRange, + int brightness, int contrast, int saturation); + +/** + * @return -1 if not supported + */ +int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, + int *srcRange, int **table, int *dstRange, + int *brightness, int *contrast, int *saturation); + +/** + * Allocate and return an uninitialized vector with length coefficients. + */ +SwsVector *sws_allocVec(int length); + +/** + * Return a normalized Gaussian curve used to filter stuff + * quality = 3 is high quality, lower is lower quality. + */ +SwsVector *sws_getGaussianVec(double variance, double quality); + +/** + * Scale all the coefficients of a by the scalar value. + */ +void sws_scaleVec(SwsVector *a, double scalar); + +/** + * Scale all the coefficients of a so that their sum equals height. + */ +void sws_normalizeVec(SwsVector *a, double height); + +#if FF_API_SWS_VECTOR +attribute_deprecated SwsVector *sws_getConstVec(double c, int length); +attribute_deprecated SwsVector *sws_getIdentityVec(void); +attribute_deprecated void sws_convVec(SwsVector *a, SwsVector *b); +attribute_deprecated void sws_addVec(SwsVector *a, SwsVector *b); +attribute_deprecated void sws_subVec(SwsVector *a, SwsVector *b); +attribute_deprecated void sws_shiftVec(SwsVector *a, int shift); +attribute_deprecated SwsVector *sws_cloneVec(SwsVector *a); +attribute_deprecated void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level); +#endif + +void sws_freeVec(SwsVector *a); + +SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, + float lumaSharpen, float chromaSharpen, + float chromaHShift, float chromaVShift, + int verbose); +void sws_freeFilter(SwsFilter *filter); + +/** + * Check if context can be reused, otherwise reallocate a new one. + * + * If context is NULL, just calls sws_getContext() to get a new + * context. Otherwise, checks if the parameters are the ones already + * saved in context. If that is the case, returns the current + * context. Otherwise, frees context and gets a new context with + * the new parameters. + * + * Be warned that srcFilter and dstFilter are not checked, they + * are assumed to remain the same. + */ +struct SwsContext *sws_getCachedContext(struct SwsContext *context, + int srcW, int srcH, enum AVPixelFormat srcFormat, + int dstW, int dstH, enum AVPixelFormat dstFormat, + int flags, SwsFilter *srcFilter, + SwsFilter *dstFilter, const double *param); + +/** + * Convert an 8-bit paletted frame into a frame with a color depth of 32 bits. + * + * The output frame will have the same packed format as the palette. + * + * @param src source frame buffer + * @param dst destination frame buffer + * @param num_pixels number of pixels to convert + * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src + */ +void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette); + +/** + * Convert an 8-bit paletted frame into a frame with a color depth of 24 bits. + * + * With the palette format "ABCD", the destination frame ends up with the format "ABC". + * + * @param src source frame buffer + * @param dst destination frame buffer + * @param num_pixels number of pixels to convert + * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src + */ +void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette); + +/** + * Get the AVClass for swsContext. It can be used in combination with + * AV_OPT_SEARCH_FAKE_OBJ for examining options. + * + * @see av_opt_find(). + */ +const AVClass *sws_get_class(void); + +/** + * @} + */ + +#endif /* SWSCALE_SWSCALE_H */ diff --git a/Src/Decoder_H264_ALL/include/libswscale/version.h b/Src/Decoder_H264_ALL/include/libswscale/version.h new file mode 100644 index 0000000..d03a5cb --- /dev/null +++ b/Src/Decoder_H264_ALL/include/libswscale/version.h @@ -0,0 +1,53 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SWSCALE_VERSION_H +#define SWSCALE_VERSION_H + +/** + * @file + * swscale version macros + */ + +#include "libavutil/version.h" + +#define LIBSWSCALE_VERSION_MAJOR 4 +#define LIBSWSCALE_VERSION_MINOR 1 +#define LIBSWSCALE_VERSION_MICRO 100 + +#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ + LIBSWSCALE_VERSION_MINOR, \ + LIBSWSCALE_VERSION_MICRO) +#define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \ + LIBSWSCALE_VERSION_MINOR, \ + LIBSWSCALE_VERSION_MICRO) +#define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT + +#define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION) + +/** + * FF_API_* defines may be placed below to indicate public API that will be + * dropped at a future version bump. The defines themselves are not part of + * the public API and may change, break or disappear at any time. + */ + +#ifndef FF_API_SWS_VECTOR +#define FF_API_SWS_VECTOR (LIBSWSCALE_VERSION_MAJOR < 6) +#endif + +#endif /* SWSCALE_VERSION_H */ diff --git a/Src/Decoder_H264_ALL/include/stdint.h b/Src/Decoder_H264_ALL/include/stdint.h new file mode 100644 index 0000000..1365af7 --- /dev/null +++ b/Src/Decoder_H264_ALL/include/stdint.h @@ -0,0 +1,225 @@ +/* ISO C9x 7.18 Integer types + * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794) + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * Contributor: Danny Smith + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Date: 2000-12-02 + */ + + +#ifndef _STDINT_H +#define _STDINT_H +#define __need_wint_t +#define __need_wchar_t +#include + +#define UINT64_C(val) val##ULL + +/* 7.18.1.1 Exact-width integer types */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; +typedef unsigned short uint16_t; +typedef int int32_t; +typedef unsigned uint32_t; +//typedef long long int64_t; +//typedef unsigned long long uint64_t; + +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; + +/* 7.18.1.2 Minimum-width integer types */ +typedef signed char int_least8_t; +typedef unsigned char uint_least8_t; +typedef short int_least16_t; +typedef unsigned short uint_least16_t; +typedef int int_least32_t; +typedef unsigned uint_least32_t; +//typedef long long int_least64_t; +//typedef unsigned long long uint_least64_t; + +typedef __int64 int_least64_t; +typedef unsigned __int64 uint_least64_t; + +/* 7.18.1.3 Fastest minimum-width integer types + * Not actually guaranteed to be fastest for all purposes + * Here we use the exact-width types for 8 and 16-bit ints. + */ +typedef char int_fast8_t; +typedef unsigned char uint_fast8_t; +typedef short int_fast16_t; +typedef unsigned short uint_fast16_t; +typedef int int_fast32_t; +typedef unsigned int uint_fast32_t; +//typedef long long int_fast64_t; +//typedef unsigned long long uint_fast64_t; + +typedef __int64 int_fast64_t; +typedef unsigned __int64 uint_fast64_t; + +/* 7.18.1.4 Integer types capable of holding object pointers */ + +#ifndef _INTPTR_T_DEFINED +#define _INTPTR_T_DEFINED +#ifdef _WIN64 + typedef __int64 intptr_t; +#else + typedef int intptr_t; +#endif +#endif + +#ifndef _UINTPTR_T_DEFINED +#define _UINTPTR_T_DEFINED +#ifdef _WIN64 + typedef unsigned __int64 uintptr_t; +#else + typedef unsigned int uintptr_t; +#endif +#endif + +/* 7.18.1.5 Greatest-width integer types */ +//typedef long long intmax_t; +//typedef unsigned long long uintmax_t; + +typedef __int64 intmax_t; +typedef unsigned __int64 uintmax_t; + +/* 7.18.2 Limits of specified-width integer types */ +//#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS) + +/* 7.18.2.1 Limits of exact-width integer types */ +#define INT8_MIN (-128) +#define INT16_MIN (-32768) +#define INT32_MIN (-2147483647 - 1) +#define INT64_MIN (-9223372036854775807LL - 1) + +#define INT8_MAX 127 +#define INT16_MAX 32767 +#define INT32_MAX 2147483647 +#define INT64_MAX 9223372036854775807LL + +#define UINT8_MAX 0xff /* 255U */ +#define UINT16_MAX 0xffff /* 65535U */ +#define UINT32_MAX 0xffffffff /* 4294967295U */ +#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */ + +#define FLOAT_MIN (3.4E-38) +#define FLOAT_MAX (3.4E+38) +#define DOUBLE_MIN (1.7E-308) +#define DOUBLE_MAX (1.7E+308) + +/* 7.18.2.2 Limits of minimum-width integer types */ +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST64_MIN INT64_MIN + +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MAX INT64_MAX + +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +/* 7.18.2.3 Limits of fastest minimum-width integer types */ +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST64_MIN INT64_MIN + +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MAX INT64_MAX + +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +/* 7.18.2.4 Limits of integer types capable of holding + object pointers */ +#ifdef _WIN64 +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX +#else +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX +#endif + +/* 7.18.2.5 Limits of greatest-width integer types */ +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +/* 7.18.3 Limits of other integer types */ +#define PTRDIFF_MIN INTPTR_MIN +#define PTRDIFF_MAX INTPTR_MAX + +#define SIG_ATOMIC_MIN INTPTR_MIN +#define SIG_ATOMIC_MAX INTPTR_MAX + +#define SIZE_MAX UINTPTR_MAX + +#ifndef WCHAR_MIN /* also in wchar.h */ +#define WCHAR_MIN 0 +#define WCHAR_MAX 0xffff /* UINT16_MAX */ +#endif + +/* + * wint_t is unsigned short for compatibility with MS runtime + */ +#define WINT_MIN 0 +#define WINT_MAX 0xffff /* UINT16_MAX */ + +//#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */ + + +/* 7.18.4 Macros for integer constants */ +//#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS) + +/* 7.18.4.1 Macros for minimum-width integer constants + + Accoding to Douglas Gwyn : + "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC + 9899:1999 as initially published, the expansion was required + to be an integer constant of precisely matching type, which + is impossible to accomplish for the shorter types on most + platforms, because C99 provides no standard way to designate + an integer constant with width less than that of type int. + TC1 changed this to require just an integer constant + *expression* with *promoted* type." +*/ + +#define INT8_C(val) ((int8_t) + (val)) +#define UINT8_C(val) ((uint8_t) + (val##U)) +#define INT16_C(val) ((int16_t) + (val)) +#define UINT16_C(val) ((uint16_t) + (val##U)) + +#define INT32_C(val) val##L +#define UINT32_C(val) val##UL +#define INT64_C(val) val##LL +#define UINT64_C(val) val##ULL + +/* 7.18.4.2 Macros for greatest-width integer constants */ +#define INTMAX_C(val) INT64_C(val) +#define UINTMAX_C(val) UINT64_C(val) + +//#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */ + +#endif diff --git a/Src/OpenCVProjectD.props b/Src/OpenCVProjectD.props new file mode 100644 index 0000000..57b4f23 --- /dev/null +++ b/Src/OpenCVProjectD.props @@ -0,0 +1,20 @@ +锘 + + + + + $(OpenCV245)\x86\vc10\bin;$(ExecutablePath) + + + $(OpenCV245)\include;$(OpenCV245)\include\opencv;$(OpenCV245)\include\opencv2;$(IncludePath) + + + $(OpenCV245)\x86\vc10\lib;$(LibraryPath) + + + + opencv_calib3d245d.lib;opencv_contrib245d.lib;opencv_core245d.lib;opencv_features2d245d.lib;opencv_flann245d.lib;opencv_gpu245d.lib;opencv_haartraining_engined.lib;opencv_highgui245d.lib;opencv_imgproc245d.lib;opencv_legacy245d.lib;opencv_ml245d.lib;opencv_nonfree245d.lib;opencv_objdetect245d.lib;opencv_photo245d.lib;opencv_stitching245d.lib;opencv_superres245d.lib;opencv_ts245d.lib;opencv_videostab245d.lib;opencv_video245d.lib;%(AdditionalDependencies) + + + + \ No newline at end of file diff --git a/Src/OpenCVProjectR.props b/Src/OpenCVProjectR.props new file mode 100644 index 0000000..be432c0 --- /dev/null +++ b/Src/OpenCVProjectR.props @@ -0,0 +1,20 @@ +锘 + + + + + $(OpenCV245)\x86\vc10\bin;$(ExecutablePath) + + + $(OpenCV245)\include;$(OpenCV245)\include\opencv;$(OpenCV245)\include\opencv2;$(IncludePath) + + + $(OpenCV245)\x86\vc10\lib;$(LibraryPath) + + + + opencv_calib3d245.lib;opencv_contrib245.lib;opencv_core245.lib;opencv_features2d245.lib;opencv_flann245.lib;opencv_gpu245.lib;opencv_haartraining_engine.lib;opencv_highgui245.lib;opencv_imgproc245.lib;opencv_legacy245.lib;opencv_ml245.lib;opencv_nonfree245.lib;opencv_objdetect245.lib;opencv_photo245.lib;opencv_stitching245.lib;opencv_superres245.lib;opencv_ts245.lib;opencv_video245.lib;opencv_videostab245.lib;%(AdditionalDependencies) + + + + \ No newline at end of file diff --git a/Src/boost-156.props b/Src/boost-156.props new file mode 100644 index 0000000..5e2c7cd --- /dev/null +++ b/Src/boost-156.props @@ -0,0 +1,13 @@ +锘 + + + + + E:\CLJ\thirdpart\boost_1_56;$(IncludePath) + + + E:\CLJ\thirdpart\boost_1_56\stage\lib;$(LibraryPath) + + + + \ No newline at end of file diff --git a/Src/gdal.props b/Src/gdal.props new file mode 100644 index 0000000..7543637 --- /dev/null +++ b/Src/gdal.props @@ -0,0 +1,15 @@ +锘 + + + <_ProjectFileVersion>10.0.30319.1 + + + + $(gdal)\include;%(AdditionalIncludeDirectories) + + + gdal_i.lib;%(AdditionalDependencies) + $(gdal)\bin;$(gdal)\lib;%(AdditionalLibraryDirectories) + + + \ No newline at end of file diff --git a/鐗堟湰璇存槑.txt b/鐗堟湰璇存槑.txt new file mode 100644 index 0000000..d460109 --- /dev/null +++ b/鐗堟湰璇存槑.txt @@ -0,0 +1,15 @@ +202401221 +澧炲姞IMP瀵硅瘽妗 +澧炲姞IMP涓婁笅琛岄氫俊杩炴帴 + +20240510 +澧炲姞13鎵鍚婅埍鎺у埗鍔熻兘 +闅愯棌IMP瀵硅瘽妗嗗強涓婁笅琛岄氫俊杩炴帴 + +20240617 +浼樺寲13鎵鍚婅埍鎺у埗鍗忚甯 +澧炲姞澶╄繘鍚婅埍鎺у埗鍔熻兘 +浼樺寲鎺у埗鎸囦护鍙戦侀昏緫锛堣璁㈡寚浠わ級 +澧炲姞瑙嗛绠$悊璁$畻鏈烘寚浠わ紙寮鍏虫寚浠わ級鍙戦 +澧炲姞13鎵鍚婅埍鍗忚銆佸ぉ杩涘悐鑸卞崗璁丠264瑁告祦瑙嗛鍗忚瑙f瀽閫夋嫨 +澧炲姞澶╄繘鍚婅埍鐐瑰嚮鈥滃崟鐐硅窡韪濇寜閽悗锛屽弻鍑诲浘鍍忓尯鍩熷彂閫佸悐鑸辫窡韪潗鏍囩偣 \ No newline at end of file